Vue kit: UiDialog for the Data Library and scene sharing dialogs

UiDialog is a native <dialog> its owner opens and closes with open: true
opens it with showModal() (on mount, for one mounted open), false closes
it, and unmounting closes it. Each change is applied once the content has
rendered and then emitted as opened or closed, so the Data Library still
focuses its search field on open and returns focus to Browse on close.
Escape's cancel is prevented and emitted as dismiss; backdropDismiss makes
a click on the dialog itself a dismiss too, as the Data Library's was. When
the browser closes the dialog on its own while open is still true,
browserClose tells the owner, as the Data Library's close listener did;
closing on unmount reports nothing. A DOM without showModal() leaves it
closed. Attributes, classes, styles and listeners go to the dialog, and
element is exposed.

The two dialogs share no declarations, so there are no kit rules.
dialogs.test.mjs fails if a view writes a <dialog> by hand; the panels drawn
as role="dialog" are other controls.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-19 01:16:46 -08:00
1 parent 2d7b7be890
commit ec4a5b6afe
10 files changed
+388 -42

No files matched your search

+3
View File
@@ -1340,6 +1340,9 @@
"src/ui/kit/UiCheckbox.test.mjs",
"src/ui/kit/checkboxes.test.mjs",
"src/ui/styles/checkbox.css",
"src/ui/kit/UiDialog.vue",
"src/ui/kit/UiDialog.test.mjs",
"src/ui/kit/dialogs.test.mjs",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",