Files
ComfyUI-Lora-Manager/vue-widgets/src/composables/useModalState.ts
Will Miao 65cede7335 feat(lora-pool): add folder filtering and preview tooltip enhancements
- Add include/exclude folder modals for advanced filtering
- Implement folder tree search with auto-expand functionality
- Add hover tooltip to preview header showing matching LoRA thumbnails
- Format match count with locale string for better readability
- Prevent event propagation on refresh button click
- Improve folder tree component with expand/collapse controls
2026-01-12 10:08:16 +08:00

32 lines
681 B
TypeScript

import { ref, computed } from 'vue'
export type ModalType = 'baseModels' | 'includeTags' | 'excludeTags' | 'includeFolders' | 'excludeFolders' | null
export function useModalState() {
const activeModal = ref<ModalType>(null)
const isOpen = computed(() => activeModal.value !== null)
const openModal = (modal: ModalType) => {
activeModal.value = modal
}
const closeModal = () => {
activeModal.value = null
}
const isModalOpen = (modal: ModalType) => {
return activeModal.value === modal
}
return {
activeModal,
isOpen,
openModal,
closeModal,
isModalOpen
}
}
export type ModalStateReturn = ReturnType<typeof useModalState>