mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
26 lines
606 B
TypeScript
26 lines
606 B
TypeScript
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
import { computed, ref } from 'vue'
|
|
|
|
import type { CommonSelectInternalInstance } from './types.ts'
|
|
import type { ComputedRef } from 'vue'
|
|
|
|
const instances = ref(new Set<CommonSelectInternalInstance>()) as unknown as ComputedRef<
|
|
Set<CommonSelectInternalInstance>
|
|
>
|
|
|
|
export const useCommonSelect = () => {
|
|
const isOpened = computed(() => {
|
|
for (const instance of instances.value) {
|
|
if (instance.isOpen.value) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
})
|
|
|
|
return {
|
|
isOpened,
|
|
instances,
|
|
}
|
|
}
|