mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
39 lines
971 B
TypeScript
39 lines
971 B
TypeScript
import WorkflowTemplateSelectorDialog from '@/components/custom/widget/WorkflowTemplateSelectorDialog.vue'
|
|
import { useDialogService } from '@/services/dialogService'
|
|
import { useDialogStore } from '@/stores/dialogStore'
|
|
|
|
const DIALOG_KEY = 'global-workflow-template-selector'
|
|
|
|
export const useWorkflowTemplateSelectorDialog = () => {
|
|
const dialogService = useDialogService()
|
|
const dialogStore = useDialogStore()
|
|
|
|
function hide() {
|
|
dialogStore.closeDialog({ key: DIALOG_KEY })
|
|
}
|
|
|
|
function show() {
|
|
dialogService.showLayoutDialog({
|
|
key: DIALOG_KEY,
|
|
component: WorkflowTemplateSelectorDialog,
|
|
props: {
|
|
onClose: hide
|
|
},
|
|
dialogComponentProps: {
|
|
pt: {
|
|
content: { class: '!px-0 overflow-hidden h-full !py-0' },
|
|
root: {
|
|
style:
|
|
'width: 90vw; height: 85vh; max-width: 1400px; display: flex;'
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
return {
|
|
show,
|
|
hide
|
|
}
|
|
}
|