import { Dialog, ErrorMessage } from "frappe-ui"; import { reactive, ref } from "vue"; import { withLegacyCloseContext } from "@opendesk/shared/formScripts"; let dialogs = ref([]); export let Dialogs = { name: "Dialogs", render() { return dialogs.value.map((dialog) => ( (dialog.show = val)} > {{ default: () => { return [ dialog.message && (

{dialog.message}

), dialog.html &&
, , ]; }, }}
)); }, }; export function createDialog(dialogOptions) { let dialog = reactive(dialogOptions); dialog.actions = withLegacyCloseContext(dialog.actions); dialog.key = "dialog-" + dialogs.value.length; dialog.show = false; setTimeout(() => { dialog.show = true; }, 0); dialogs.value.push(dialog); }