claude-web/node_modules/primevue/dynamicdialog/index.mjs.map

1 line
12 KiB
Plaintext
Raw Permalink Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/dynamicdialog/BaseDynamicDialog.vue","../../src/dynamicdialog/DynamicDialog.vue","../../src/dynamicdialog/DynamicDialog.vue?vue&type=template&id=4e9ba053&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport DynamicDialogStyle from 'primevue/dynamicdialog/style';\n\nexport default {\n name: 'BaseDynamicDialog',\n extends: BaseComponent,\n props: {},\n style: DynamicDialogStyle,\n provide() {\n return {\n $pcDynamicDialog: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <template v-for=\"(instance, key) in instanceMap\" :key=\"key\">\n <DDialog v-model:visible=\"instance.visible\" :_instance=\"instance\" v-bind=\"instance.options.props\" @hide=\"onDialogHide(instance)\" @after-hide=\"onDialogAfterHide(instance)\">\n <template v-if=\"instance.options.templates && instance.options.templates.header\" #header>\n <component v-for=\"(header, index) in getTemplateItems(instance.options.templates.header)\" :is=\"header\" :key=\"index + '_header'\" v-bind=\"instance.options.emits\"></component>\n </template>\n <component :is=\"instance.content\" v-bind=\"instance.options.emits\"></component>\n <template v-if=\"instance.options.templates && instance.options.templates.footer\" #footer>\n <component v-for=\"(footer, index) in getTemplateItems(instance.options.templates.footer)\" :is=\"footer\" :key=\"index + '_footer'\" v-bind=\"instance.options.emits\"></component>\n </template>\n </DDialog>\n </template>\n</template>\n\n<script>\nimport { uuid } from '@primeuix/utils';\nimport Dialog from 'primevue/dialog';\nimport DynamicDialogEventBus from 'primevue/dynamicdialogeventbus';\nimport BaseDynamicDialog from './BaseDynamicDialog.vue';\n\nexport default {\n name: 'DynamicDialog',\n extends: BaseDynamicDialog,\n inheritAttrs: false,\n data() {\n return {\n instanceMap: {}\n };\n },\n openListener: null,\n closeListener: null,\n currentInstance: null,\n mounted() {\n this.openListener = ({ instance }) => {\n const key = uuid() + '_dynamic_dialog';\n\n instance.visible = true;\n instance.key = key;\n this.instanceMap[key] = instance;\n };\n\n this.closeListener = ({ instance, params }) => {\n const key = instance.key;\n const currentInstance = this.instanceMap[key];\n\n if (currentInstance) {\n currentInstance.visible = false;\n currentInstance.options.onClose && currentInstance.options.onClose({ data: params, type: 'config-close' });\n\n this.currentInstance = currentInstance;\n }\n };\n\n DynamicDialogEventBus.on('open', this.openListener);\n DynamicDialogEventBus.on('close', this.closeListener);\n },\n beforeUnmount() {\n DynamicDialogEventBus.off('open', this.openListener);\n DynamicDialogEventBus.off('close', this.closeListener);\n },\n methods: {\n onDialogHide(instance) {\n !this.currentInstance && instance.options.onClose && instance.options.onClose({ type: 'dialog-close' });\n },\n onDialogAfterHide(instance) {\n this.currentInstance && delete this.currentInstance;\n this.currentInstance = null;\n delete this.instanceMap[instance.key];\n },\n getTemplateItems(template) {\n return Array.isArray(template) ? template : [template];\n }\n },\n components: {\n DDialog: Dialog\n }\n};\n</script>\n","<template>\n <template v-for=\"(instance, key) in instanceMap\" :key=\"key\">\n <DDialog v-model:visible=\"instance.visible\" :_instance=\"instance\" v-bind=\"instance.options.props\" @hide=\"onDialogHide(instance)\" @after-hide=\"onDialogAfterHide(instance)\">\n <template v-if=\