diff --git a/src/lib/Dialog.svelte b/src/lib/Dialog.svelte index 14d6a15..35ae46e 100644 --- a/src/lib/Dialog.svelte +++ b/src/lib/Dialog.svelte @@ -5,6 +5,8 @@ export interface DialogAPI { /** shows an error message at the top of the dialog */ error: (message: RawError | null) => void; + /** Returns if the dialog is displaying an error */ + hasError: () => boolean; /** closes the dialog */ close: () => void; /** opens the dialog */ @@ -39,6 +41,8 @@ * changes made via this API will NOT propagate to consuming components. */ title: (title: string) => void; + /** Focuses the dialog */ + focus: () => void; } type DialogControlButton = { @@ -79,6 +83,9 @@ }; export { dialogCancelButton, dialogOkButton, dialogCloseButton }; + + /** stack of currently open dialogs by identifier */ + let dialogStack: DialogAPI[] = $state([]);