@editora/ui-core 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
- package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
- package/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +39 -62
- package/dist/alert-dialog.cjs.js +19 -19
- package/dist/alert-dialog.esm.js +69 -87
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +4 -7
- package/dist/anchor.cjs.js +2 -2
- package/dist/anchor.esm.js +3 -3
- package/dist/animated-beam.cjs.js +83 -83
- package/dist/animated-beam.esm.js +250 -277
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +47 -61
- package/dist/animated-text.cjs.js +2 -2
- package/dist/animated-text.esm.js +13 -24
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +11 -13
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +4 -7
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +7 -13
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +4 -7
- package/dist/block-controls.cjs.js +2 -2
- package/dist/block-controls.esm.js +19 -35
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +8 -15
- package/dist/breadcrumb.cjs.js +2 -2
- package/dist/breadcrumb.esm.js +20 -37
- package/dist/button.cjs.js +1 -521
- package/dist/button.esm.js +2 -669
- package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
- package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +8 -9
- package/dist/card.cjs.js +4 -4
- package/dist/card.esm.js +13 -19
- package/dist/chart.cjs.js +64 -64
- package/dist/chart.esm.js +223 -254
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +2 -3
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +5 -9
- package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +4 -7
- package/dist/color-picker.cjs.js +9 -9
- package/dist/color-picker.esm.js +189 -252
- package/dist/combobox.cjs.js +13 -13
- package/dist/combobox.esm.js +93 -126
- package/dist/command-palette.cjs.js +3 -3
- package/dist/command-palette.esm.js +19 -30
- package/dist/command.cjs.js +4 -4
- package/dist/command.esm.js +41 -53
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts +1 -0
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts +1 -0
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts +1 -0
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/container.cjs.js +2 -2
- package/dist/container.esm.js +2 -3
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +157 -219
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +2 -3
- package/dist/data-table.cjs.js +4 -4
- package/dist/data-table.esm.js +299 -381
- package/dist/date-field.cjs.js +3 -3
- package/dist/date-field.esm.js +68 -80
- package/dist/date-picker.cjs.js +30 -9
- package/dist/date-picker.esm.js +90 -97
- package/dist/date-range-picker.cjs.js +22 -3
- package/dist/date-range-picker.esm.js +103 -108
- package/dist/date-range-time-picker.cjs.js +28 -12
- package/dist/date-range-time-picker.esm.js +137 -150
- package/dist/date-time-picker.cjs.js +25 -9
- package/dist/date-time-picker.esm.js +139 -155
- package/dist/date-time-utils-Dmost5Ee.js +1 -0
- package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +3 -5
- package/dist/dialog.cjs.js +12 -12
- package/dist/dialog.esm.js +44 -63
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +2 -3
- package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
- package/dist/dismissable-layer-DNfrKA20.js +1 -0
- package/dist/dismissable-layer.cjs.js +2 -2
- package/dist/dismissable-layer.esm.js +4 -6
- package/dist/dock.cjs.js +5 -5
- package/dist/dock.esm.js +134 -155
- package/dist/drawer.cjs.js +2 -2
- package/dist/drawer.esm.js +18 -35
- package/dist/dropdown.cjs.js +2 -2
- package/dist/dropdown.esm.js +119 -149
- package/dist/dropzone.cjs.js +1 -1
- package/dist/dropzone.esm.js +0 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +3 -5
- package/dist/field.cjs.js +5 -5
- package/dist/field.esm.js +27 -34
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +19 -24
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +69 -93
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +5 -9
- package/dist/floating-toolbar.cjs.js +4 -4
- package/dist/floating-toolbar.esm.js +60 -85
- package/dist/focus-scope-Bwug2gDv.js +1 -0
- package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
- package/dist/focus-scope.cjs.js +2 -2
- package/dist/focus-scope.esm.js +15 -20
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +26 -53
- package/dist/gantt.cjs.js +43 -43
- package/dist/gantt.esm.js +295 -322
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +5 -9
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +22 -28
- package/dist/icon-cloud.cjs.js +7 -7
- package/dist/icon-cloud.esm.js +48 -62
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +2 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +378 -390
- package/dist/inline-edit.cjs.js +11 -11
- package/dist/inline-edit.esm.js +32 -36
- package/dist/input.cjs.js +17 -17
- package/dist/input.esm.js +50 -63
- package/dist/label.cjs.js +2 -2
- package/dist/label.esm.js +8 -17
- package/dist/layout.cjs.js +2 -2
- package/dist/layout.esm.js +20 -26
- package/dist/listbox-B6QgECax.js +46 -0
- package/dist/listbox-DJamVeFj.mjs +200 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +2 -4
- package/dist/marquee.cjs.js +5 -5
- package/dist/marquee.esm.js +33 -50
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +5 -9
- package/dist/menu.cjs.js +3 -3
- package/dist/menu.esm.js +106 -126
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +118 -164
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +4 -4
- package/dist/multi-select.cjs.js +4 -4
- package/dist/multi-select.esm.js +120 -140
- package/dist/navigation-menu.cjs.js +4 -4
- package/dist/navigation-menu.esm.js +44 -55
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +73 -98
- package/dist/number-ticker.cjs.js +3 -3
- package/dist/number-ticker.esm.js +22 -43
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +5 -9
- package/dist/orbiter.cjs.js +13 -13
- package/dist/orbiter.esm.js +79 -90
- package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
- package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +14 -18
- package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
- package/dist/panel-group-CaD0_KQf.js +36 -0
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +2 -5
- package/dist/panel.cjs.js +4 -4
- package/dist/panel.esm.js +8 -10
- package/dist/password-field.cjs.js +9 -9
- package/dist/password-field.esm.js +62 -82
- package/dist/pin-input.cjs.js +3 -3
- package/dist/pin-input.esm.js +33 -39
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +108 -131
- package/dist/plugin-panel.cjs.js +7 -7
- package/dist/plugin-panel.esm.js +13 -15
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +21 -31
- package/dist/portal-DgpQ3Jo1.js +1 -0
- package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
- package/dist/portal.cjs.js +2 -2
- package/dist/portal.esm.js +10 -19
- package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
- package/dist/positioner-D_fqyx_j.js +1 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +11 -18
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +5 -9
- package/dist/quick-actions.cjs.js +6 -6
- package/dist/quick-actions.esm.js +52 -62
- package/dist/radio-group.cjs.js +13 -13
- package/dist/radio-group.esm.js +39 -51
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +5 -9
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +12 -23
- package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +3 -5
- package/dist/runtime-CTaOSmBj.js +1 -0
- package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +6 -6
- package/dist/scroll-area.cjs.js +3 -3
- package/dist/scroll-area.esm.js +38 -46
- package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +7 -7
- package/dist/select.esm.js +67 -97
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +8 -15
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +18 -18
- package/dist/sidebar.esm.js +117 -139
- package/dist/skeleton.cjs.js +11 -11
- package/dist/skeleton.esm.js +27 -24
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +6 -11
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +16 -19
- package/dist/sortable.cjs.js +45 -45
- package/dist/sortable.esm.js +421 -524
- package/dist/spinning-text.cjs.js +12 -12
- package/dist/spinning-text.esm.js +80 -92
- package/dist/split-button.cjs.js +4 -4
- package/dist/split-button.esm.js +77 -62
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +8 -8
- package/dist/stepper.esm.js +32 -52
- package/dist/switch.cjs.js +7 -7
- package/dist/switch.esm.js +23 -31
- package/dist/table.cjs.js +2 -2
- package/dist/table.esm.js +46 -56
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.esm.js +35 -55
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +6 -6
- package/dist/textarea.esm.js +32 -41
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +29 -21
- package/dist/time-picker.esm.js +96 -110
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +3 -5
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +33 -47
- package/dist/toggle-group.cjs.js +6 -6
- package/dist/toggle-group.esm.js +85 -105
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +3 -5
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +13 -24
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +31 -42
- package/dist/transfer-list.cjs.js +19 -19
- package/dist/transfer-list.esm.js +98 -111
- package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
- package/dist/tree-Dx_kv_ih.js +39 -0
- package/dist/tree-item.cjs.js +2 -2
- package/dist/tree-item.esm.js +2 -3
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +2 -5
- package/dist/ui-button-Q0GNNWKC.mjs +665 -0
- package/dist/ui-button-rXQOS9QJ.js +521 -0
- package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
- package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +14 -14
- package/dist/wizard.esm.js +85 -105
- package/package.json +3 -3
- package/dist/date-time-utils-66480de4.js +0 -1
- package/dist/date-time-utils-a2c7af25.mjs +0 -307
- package/dist/dismissable-layer-193e3bed.js +0 -1
- package/dist/focus-scope-2b12b4e7.js +0 -1
- package/dist/listbox-308789a0.mjs +0 -210
- package/dist/listbox-ef2f708e.js +0 -46
- package/dist/panel-group-40254cdd.js +0 -36
- package/dist/portal-c69756c0.js +0 -1
- package/dist/positioner-33529bb8.js +0 -1
- package/dist/runtime-3f13807b.js +0 -1
- package/dist/tree-0a7a8d05.js +0 -39
- /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
- /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
- /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
- /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
- /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/dialog.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { a as
|
|
3
|
-
import { c as M } from "./dismissable-layer-
|
|
4
|
-
import { c as R } from "./focus-scope-
|
|
1
|
+
import { E as z } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { a as B, r as I } from "./scroll-lock-LfqXXqsu.mjs";
|
|
3
|
+
import { c as M } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
+
import { c as R } from "./focus-scope-CmEsG5UZ.mjs";
|
|
5
5
|
const W = `
|
|
6
6
|
:host {
|
|
7
7
|
position: fixed;
|
|
@@ -378,24 +378,23 @@ const W = `
|
|
|
378
378
|
}
|
|
379
379
|
`, P = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
380
380
|
function g(n, t) {
|
|
381
|
-
if (n == null)
|
|
382
|
-
return t;
|
|
381
|
+
if (n == null) return t;
|
|
383
382
|
const i = n.trim().toLowerCase();
|
|
384
383
|
return i !== "false" && i !== "0" && i !== "off";
|
|
385
384
|
}
|
|
386
385
|
function a(n) {
|
|
387
386
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
388
387
|
}
|
|
389
|
-
function
|
|
388
|
+
function S() {
|
|
390
389
|
return typeof window < "u" && typeof document < "u";
|
|
391
390
|
}
|
|
392
|
-
function
|
|
391
|
+
function C(n) {
|
|
393
392
|
return window.setTimeout(n, 16);
|
|
394
393
|
}
|
|
395
394
|
function p(n) {
|
|
396
395
|
n && window.clearTimeout(n);
|
|
397
396
|
}
|
|
398
|
-
const
|
|
397
|
+
const l = class l extends z {
|
|
399
398
|
constructor() {
|
|
400
399
|
super(), this._isActive = !1, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = this._uid, this._lastFocused = null, this._terminalEmitted = !1, this._closeMeta = null, this._runtimeError = "", this._config = {}, this._dismissableLayer = null, this._focusScope = null, this._disconnectCleanupFrame = 0, this._restoreFocusFrame = 0, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onSubmit = this._onSubmit.bind(this);
|
|
401
400
|
}
|
|
@@ -428,7 +427,7 @@ const C = class l extends I {
|
|
|
428
427
|
this._disconnectCleanupFrame && (p(this._disconnectCleanupFrame), this._disconnectCleanupFrame = 0), super.connectedCallback(), this.root.addEventListener("click", this._onClick), this.root.addEventListener("keydown", this._onKeyDown), this.addEventListener("submit", this._onSubmit), this._syncFromAttributes(), this._syncOpenState();
|
|
429
428
|
}
|
|
430
429
|
disconnectedCallback() {
|
|
431
|
-
this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("submit", this._onSubmit), this._disconnectCleanupFrame && p(this._disconnectCleanupFrame), this._restoreFocusFrame && (p(this._restoreFocusFrame), this._restoreFocusFrame = 0), this._disconnectCleanupFrame =
|
|
430
|
+
this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("submit", this._onSubmit), this._disconnectCleanupFrame && p(this._disconnectCleanupFrame), this._restoreFocusFrame && (p(this._restoreFocusFrame), this._restoreFocusFrame = 0), this._disconnectCleanupFrame = C(() => {
|
|
432
431
|
this._disconnectCleanupFrame = 0, !this.isConnected && (this._isActive && !this._terminalEmitted ? this.close("dismiss", "unmount") : (this._destroyRuntimeControllers(), this._deactivate()), super.disconnectedCallback());
|
|
433
432
|
});
|
|
434
433
|
}
|
|
@@ -498,8 +497,7 @@ const C = class l extends I {
|
|
|
498
497
|
this.setAttribute("open", "");
|
|
499
498
|
}
|
|
500
499
|
closeDialog(t = "programmatic") {
|
|
501
|
-
if (!this.hasAttribute("open"))
|
|
502
|
-
return;
|
|
500
|
+
if (!this.hasAttribute("open")) return;
|
|
503
501
|
const i = new CustomEvent("request-close", {
|
|
504
502
|
detail: { reason: t },
|
|
505
503
|
bubbles: !0,
|
|
@@ -554,16 +552,15 @@ const C = class l extends I {
|
|
|
554
552
|
t && !this._isActive ? this._activate() : !t && this._isActive && this._deactivate(), this._syncOpenUi();
|
|
555
553
|
}
|
|
556
554
|
_activate() {
|
|
557
|
-
this._isActive = !0, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastFocused = document.activeElement || null,
|
|
555
|
+
this._isActive = !0, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastFocused = document.activeElement || null, B();
|
|
558
556
|
const t = this.dialogId || this._uid;
|
|
559
557
|
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.dispatchEvent(new CustomEvent("show", { bubbles: !0, composed: !0 })), this._syncOpenUi(), this._syncRuntimeControllers();
|
|
560
558
|
}
|
|
561
559
|
_deactivate() {
|
|
562
|
-
if (!this._isActive)
|
|
563
|
-
return;
|
|
560
|
+
if (!this._isActive) return;
|
|
564
561
|
this._isActive = !1, this._destroyRuntimeControllers();
|
|
565
562
|
const t = l._openStack.lastIndexOf(this);
|
|
566
|
-
if (t >= 0 && l._openStack.splice(t, 1),
|
|
563
|
+
if (t >= 0 && l._openStack.splice(t, 1), I(), !this._terminalEmitted) {
|
|
567
564
|
const e = this._closeMeta || { action: "dismiss", source: "abort" }, s = this.dialogId || this._uid;
|
|
568
565
|
e.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: s }) : this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
569
566
|
id: s,
|
|
@@ -577,7 +574,7 @@ const C = class l extends I {
|
|
|
577
574
|
}), this.dispatchEvent(new CustomEvent("hide", { bubbles: !0, composed: !0 })), this._terminalEmitted = !0, this._closeMeta = null;
|
|
578
575
|
}
|
|
579
576
|
const i = this._lastFocused;
|
|
580
|
-
this._lastFocused = null, i && this._canRestoreFocus(i) && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame =
|
|
577
|
+
this._lastFocused = null, i && this._canRestoreFocus(i) && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = C(() => {
|
|
581
578
|
this._restoreFocusFrame = 0;
|
|
582
579
|
try {
|
|
583
580
|
this._canRestoreFocus(i) && i.focus();
|
|
@@ -602,8 +599,7 @@ const C = class l extends I {
|
|
|
602
599
|
return this.dispatchEvent(r), o;
|
|
603
600
|
}
|
|
604
601
|
_isTopMost() {
|
|
605
|
-
if (!this._isActive)
|
|
606
|
-
return !1;
|
|
602
|
+
if (!this._isActive) return !1;
|
|
607
603
|
const t = l._openStack;
|
|
608
604
|
return t.length > 0 && t[t.length - 1] === this;
|
|
609
605
|
}
|
|
@@ -611,27 +607,22 @@ const C = class l extends I {
|
|
|
611
607
|
return this.root.querySelector(".panel");
|
|
612
608
|
}
|
|
613
609
|
_canRestoreFocus(t) {
|
|
614
|
-
if (!t || !t.isConnected || t.disabled || t.getAttribute("aria-hidden") === "true")
|
|
615
|
-
|
|
616
|
-
if (!F())
|
|
617
|
-
return !0;
|
|
610
|
+
if (!t || !t.isConnected || t.disabled || t.getAttribute("aria-hidden") === "true") return !1;
|
|
611
|
+
if (!S()) return !0;
|
|
618
612
|
const i = window.getComputedStyle(t);
|
|
619
613
|
return i.display !== "none" && i.visibility !== "hidden";
|
|
620
614
|
}
|
|
621
615
|
_collectFocusable(t) {
|
|
622
616
|
return Array.from(t.querySelectorAll(P)).filter((i) => {
|
|
623
|
-
if (i.disabled || i.getAttribute("aria-hidden") === "true")
|
|
624
|
-
|
|
625
|
-
const s = F() ? window.getComputedStyle(i) : null;
|
|
617
|
+
if (i.disabled || i.getAttribute("aria-hidden") === "true") return !1;
|
|
618
|
+
const s = S() ? window.getComputedStyle(i) : null;
|
|
626
619
|
return !(s && (s.display === "none" || s.visibility === "hidden"));
|
|
627
620
|
});
|
|
628
621
|
}
|
|
629
622
|
_focusInitial() {
|
|
630
|
-
if (!this.open)
|
|
631
|
-
return;
|
|
623
|
+
if (!this.open) return;
|
|
632
624
|
const t = this._queryPanel();
|
|
633
|
-
if (!t)
|
|
634
|
-
return;
|
|
625
|
+
if (!t) return;
|
|
635
626
|
const i = this.getAttribute("initial-focus") || this._config.initialFocus || "";
|
|
636
627
|
if (i) {
|
|
637
628
|
const r = t.querySelector(i);
|
|
@@ -654,16 +645,14 @@ const C = class l extends I {
|
|
|
654
645
|
t.key;
|
|
655
646
|
}
|
|
656
647
|
_destroyRuntimeControllers() {
|
|
657
|
-
|
|
658
|
-
(t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, (i = this._focusScope) == null || i.destroy(), this._focusScope = null;
|
|
648
|
+
this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._focusScope?.destroy(), this._focusScope = null;
|
|
659
649
|
}
|
|
660
650
|
_syncOpenUi() {
|
|
661
651
|
const t = this.root.querySelector(".overlay"), i = this._queryPanel(), e = this.open;
|
|
662
652
|
!t || !i || (t.hidden = !e, t.setAttribute("data-open", String(e)), t.setAttribute("aria-hidden", e ? "false" : "true"), i.setAttribute("aria-hidden", e ? "false" : "true"));
|
|
663
653
|
}
|
|
664
654
|
_syncRuntimeControllers() {
|
|
665
|
-
if (this._destroyRuntimeControllers(), !this.open || !this._isTopMost())
|
|
666
|
-
return;
|
|
655
|
+
if (this._destroyRuntimeControllers(), !this.open || !this._isTopMost()) return;
|
|
667
656
|
const t = this._queryPanel();
|
|
668
657
|
t && (this._dismissableLayer = M({
|
|
669
658
|
node: t,
|
|
@@ -684,9 +673,8 @@ const C = class l extends I {
|
|
|
684
673
|
}));
|
|
685
674
|
}
|
|
686
675
|
_collectFormData(t) {
|
|
687
|
-
const i = this._queryPanel(), e = t || this.querySelector("form") ||
|
|
688
|
-
if (!(e instanceof HTMLFormElement) || typeof FormData > "u")
|
|
689
|
-
return;
|
|
676
|
+
const i = this._queryPanel(), e = t || this.querySelector("form") || i?.querySelector("form") || null;
|
|
677
|
+
if (!(e instanceof HTMLFormElement) || typeof FormData > "u") return;
|
|
690
678
|
const s = new FormData(e), o = {};
|
|
691
679
|
for (const [r, h] of s.entries()) {
|
|
692
680
|
const c = String(h);
|
|
@@ -700,16 +688,13 @@ const C = class l extends I {
|
|
|
700
688
|
return Object.keys(o).length ? o : void 0;
|
|
701
689
|
}
|
|
702
690
|
_resolveSubmitForm(t) {
|
|
703
|
-
var s;
|
|
704
691
|
if (t) {
|
|
705
|
-
const
|
|
706
|
-
if (
|
|
707
|
-
return o;
|
|
692
|
+
const s = t.closest("form");
|
|
693
|
+
if (s instanceof HTMLFormElement && this.contains(s)) return s;
|
|
708
694
|
}
|
|
709
695
|
const i = this.querySelector("form");
|
|
710
|
-
if (i instanceof HTMLFormElement)
|
|
711
|
-
|
|
712
|
-
const e = (s = this._queryPanel()) == null ? void 0 : s.querySelector("form");
|
|
696
|
+
if (i instanceof HTMLFormElement) return i;
|
|
697
|
+
const e = this._queryPanel()?.querySelector("form");
|
|
713
698
|
return e instanceof HTMLFormElement ? e : null;
|
|
714
699
|
}
|
|
715
700
|
_isInteractionLocked() {
|
|
@@ -733,8 +718,7 @@ const C = class l extends I {
|
|
|
733
718
|
}
|
|
734
719
|
}
|
|
735
720
|
_handleSubmit(t) {
|
|
736
|
-
if (this._isInteractionLocked())
|
|
737
|
-
return;
|
|
721
|
+
if (this._isInteractionLocked()) return;
|
|
738
722
|
const i = t ?? this._resolveSubmitForm();
|
|
739
723
|
if (i && typeof i.reportValidity == "function" && !i.reportValidity())
|
|
740
724
|
return;
|
|
@@ -748,8 +732,7 @@ const C = class l extends I {
|
|
|
748
732
|
this._isInteractionLocked() || this.closeDialog("cancel");
|
|
749
733
|
}
|
|
750
734
|
_onClick(t) {
|
|
751
|
-
if (!this.open || !this._isTopMost())
|
|
752
|
-
return;
|
|
735
|
+
if (!this.open || !this._isTopMost()) return;
|
|
753
736
|
const i = t.target;
|
|
754
737
|
if (i) {
|
|
755
738
|
if (!i.closest(".panel") && i.closest(".overlay") && this.closeOnOverlay) {
|
|
@@ -768,26 +751,24 @@ const C = class l extends I {
|
|
|
768
751
|
}
|
|
769
752
|
}
|
|
770
753
|
_onSubmit(t) {
|
|
771
|
-
if (!this.open || !this._isTopMost())
|
|
772
|
-
return;
|
|
754
|
+
if (!this.open || !this._isTopMost()) return;
|
|
773
755
|
const i = t.target;
|
|
774
756
|
i && i !== this && this.contains(i) && (t.preventDefault(), t.stopPropagation(), this._handleSubmit(i));
|
|
775
757
|
}
|
|
776
758
|
_onKeyDown(t) {
|
|
777
759
|
if (!(!this.open || !this._isTopMost()) && t.key === "Escape") {
|
|
778
|
-
if (!this.closeOnEsc)
|
|
779
|
-
return;
|
|
760
|
+
if (!this.closeOnEsc) return;
|
|
780
761
|
t.preventDefault(), t.stopPropagation(), this._requestDismiss("esc");
|
|
781
762
|
return;
|
|
782
763
|
}
|
|
783
764
|
}
|
|
784
765
|
render() {
|
|
785
|
-
const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", e = this._config.submitText ?? this.getAttribute("submit-text") ?? "Submit", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", r = t.trim(), h = i.trim(), c = !!this.querySelector('[slot="title"]'), d = !!this.querySelector('[slot="description"]'), f = !!(r || c), m = !!(h || d), E = !!this.querySelector('[slot="content"]'), L = !!this.querySelector('[slot="footer"]'), O = this._config.showCancel ?? !0,
|
|
786
|
-
|
|
766
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", e = this._config.submitText ?? this.getAttribute("submit-text") ?? "Submit", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", r = t.trim(), h = i.trim(), c = !!this.querySelector('[slot="title"]'), d = !!this.querySelector('[slot="description"]'), f = !!(r || c), m = !!(h || d), E = !!this.querySelector('[slot="content"]'), L = !!this.querySelector('[slot="footer"]'), O = this._config.showCancel ?? !0, $ = this._config.showClose ?? this.dismissible, v = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", b = this.state === "loading", x = `ui-dialog-title-${this._uid}`, A = `ui-dialog-description-${this._uid}`, k = `ui-dialog-error-${this._uid}`, D = this.getAttribute("aria-label") || "", q = this.getAttribute("aria-labelledby") || "", w = this.getAttribute("aria-describedby") || "", _ = q || (f ? x : ""), F = D || (_ ? "" : "Dialog"), u = [];
|
|
767
|
+
w ? u.push(w) : (m && u.push(A), v && u.push(k));
|
|
787
768
|
const T = f || m ? `
|
|
788
769
|
<header class="header" part="header">
|
|
789
|
-
${f ? `<h2 id="${
|
|
790
|
-
${m ? `<p id="${
|
|
770
|
+
${f ? `<h2 id="${x}" class="title" part="title"><slot name="title">${a(r)}</slot></h2>` : ""}
|
|
771
|
+
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${a(h)}</slot></p>` : ""}
|
|
791
772
|
</header>
|
|
792
773
|
` : "";
|
|
793
774
|
this._destroyRuntimeControllers(), this.setContent(`
|
|
@@ -798,13 +779,13 @@ const C = class l extends I {
|
|
|
798
779
|
part="panel"
|
|
799
780
|
role="${a(this.getAttribute("role") || "dialog")}"
|
|
800
781
|
aria-modal="true"
|
|
801
|
-
${
|
|
782
|
+
${F ? `aria-label="${a(F)}"` : ""}
|
|
802
783
|
${_ ? `aria-labelledby="${a(_)}"` : ""}
|
|
803
784
|
${u.length ? `aria-describedby="${a(u.join(" "))}"` : ""}
|
|
804
785
|
aria-hidden="${this.open ? "false" : "true"}"
|
|
805
786
|
tabindex="-1"
|
|
806
787
|
>
|
|
807
|
-
${
|
|
788
|
+
${$ ? `<button class="close" part="close" aria-label="Close dialog" type="button" ${b ? "disabled" : ""}>
|
|
808
789
|
<svg class="close-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true">
|
|
809
790
|
<path d="M3.5 3.5L12.5 12.5"></path>
|
|
810
791
|
<path d="M12.5 3.5L3.5 12.5"></path>
|
|
@@ -815,7 +796,7 @@ const C = class l extends I {
|
|
|
815
796
|
${E ? '<slot name="content"></slot>' : "<slot></slot>"}
|
|
816
797
|
</div>
|
|
817
798
|
|
|
818
|
-
<div class="error" id="${
|
|
799
|
+
<div class="error" id="${k}" part="error" aria-live="polite" data-empty="${String(!v)}">${a(v)}</div>
|
|
819
800
|
|
|
820
801
|
<footer class="footer" part="footer">
|
|
821
802
|
${b ? `<span class="loading" part="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
@@ -828,9 +809,9 @@ const C = class l extends I {
|
|
|
828
809
|
`), this._syncOpenUi(), this.open ? this._syncRuntimeControllers() : this._destroyRuntimeControllers();
|
|
829
810
|
}
|
|
830
811
|
};
|
|
831
|
-
|
|
832
|
-
let
|
|
833
|
-
typeof customElements < "u" && !customElements.get("ui-dialog") && customElements.define("ui-dialog",
|
|
812
|
+
l._openStack = [];
|
|
813
|
+
let y = l;
|
|
814
|
+
typeof customElements < "u" && !customElements.get("ui-dialog") && customElements.define("ui-dialog", y);
|
|
834
815
|
export {
|
|
835
|
-
|
|
816
|
+
y as UIDialog
|
|
836
817
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./ElementBase-EV6mVBUV.js"),n=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
color-scheme: light dark;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as s } from "./ElementBase-
|
|
1
|
+
import { E as s } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const o = `
|
|
3
3
|
:host {
|
|
4
4
|
display: contents;
|
|
@@ -54,8 +54,7 @@ class n extends s {
|
|
|
54
54
|
}
|
|
55
55
|
_setDirOnChildren(e) {
|
|
56
56
|
const t = this.root.querySelector("slot");
|
|
57
|
-
if (!t)
|
|
58
|
-
return;
|
|
57
|
+
if (!t) return;
|
|
59
58
|
t.assignedElements({ flatten: !0 }).forEach((i) => {
|
|
60
59
|
i instanceof HTMLElement && i.setAttribute("dir", e);
|
|
61
60
|
});
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
const s = [];
|
|
2
2
|
let u = !1, i = null;
|
|
3
|
-
function
|
|
3
|
+
function E(e) {
|
|
4
4
|
return !!e && typeof e.nodeType == "number";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function L(e) {
|
|
7
7
|
return e instanceof HTMLElement;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function v() {
|
|
10
10
|
return s.filter((e) => !e.paused);
|
|
11
11
|
}
|
|
12
12
|
function f() {
|
|
13
|
-
const e =
|
|
13
|
+
const e = v();
|
|
14
14
|
return e.length ? e[e.length - 1] : null;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function l(e, t) {
|
|
17
17
|
return t ? e.includes(t) : !1;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function a(e, t) {
|
|
20
20
|
return !e || !t ? !1 : e === t || e.contains(t);
|
|
21
21
|
}
|
|
22
22
|
function p(e, t, n = []) {
|
|
23
|
-
return !!(
|
|
23
|
+
return !!(a(e.options.node, t) || a(e.options.trigger ?? null, t) || l(n, e.options.node) || l(n, e.options.trigger ?? null));
|
|
24
24
|
}
|
|
25
25
|
function d(e) {
|
|
26
26
|
typeof e.prevNodePointerEvents == "string" && (e.options.node.style.pointerEvents = e.prevNodePointerEvents, e.prevNodePointerEvents = void 0);
|
|
@@ -28,9 +28,8 @@ function d(e) {
|
|
|
28
28
|
t && typeof e.prevTriggerPointerEvents == "string" && (t.style.pointerEvents = e.prevTriggerPointerEvents, e.prevTriggerPointerEvents = void 0);
|
|
29
29
|
}
|
|
30
30
|
function r() {
|
|
31
|
-
if (typeof document > "u" || !document.body)
|
|
32
|
-
|
|
33
|
-
if (!L().filter((t) => t.options.disableOutsidePointerEvents).length) {
|
|
31
|
+
if (typeof document > "u" || !document.body) return;
|
|
32
|
+
if (!v().filter((t) => t.options.disableOutsidePointerEvents).length) {
|
|
34
33
|
document.body.removeAttribute("data-ui-dismissable-lock"), i !== null && (document.body.style.pointerEvents = i, i = null), s.forEach(d);
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
@@ -44,42 +43,39 @@ function r() {
|
|
|
44
43
|
o && (typeof t.prevTriggerPointerEvents != "string" && (t.prevTriggerPointerEvents = o.style.pointerEvents || ""), o.style.pointerEvents = "auto");
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
|
-
function
|
|
48
|
-
u || typeof document > "u" || (document.addEventListener("pointerdown",
|
|
46
|
+
function h() {
|
|
47
|
+
u || typeof document > "u" || (document.addEventListener("pointerdown", g, !0), document.addEventListener("focusin", y, !0), document.addEventListener("keydown", P, !0), u = !0);
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
!u || typeof document > "u" || (document.removeEventListener("pointerdown",
|
|
49
|
+
function b() {
|
|
50
|
+
!u || typeof document > "u" || (document.removeEventListener("pointerdown", g, !0), document.removeEventListener("focusin", y, !0), document.removeEventListener("keydown", P, !0), u = !1);
|
|
52
51
|
}
|
|
53
|
-
function
|
|
54
|
-
s.length ?
|
|
52
|
+
function m() {
|
|
53
|
+
s.length ? h() : b();
|
|
55
54
|
}
|
|
56
55
|
function c(e, t, n) {
|
|
57
|
-
|
|
58
|
-
e.paused || ((a = (l = e.options).onBeforeDismiss) == null ? void 0 : a.call(l, t, n)) === !1 || (E = (m = e.options).onDismiss) == null || E.call(m, t, n);
|
|
56
|
+
e.paused || e.options.onBeforeDismiss?.(t, n) === !1 || e.options.onDismiss?.(t, n);
|
|
59
57
|
}
|
|
60
|
-
function
|
|
58
|
+
function g(e) {
|
|
61
59
|
const t = f();
|
|
62
|
-
if (!t)
|
|
63
|
-
|
|
64
|
-
const n = typeof e.composedPath == "function" ? e.composedPath() : [], o = P(e.target) ? e.target : null;
|
|
60
|
+
if (!t) return;
|
|
61
|
+
const n = typeof e.composedPath == "function" ? e.composedPath() : [], o = E(e.target) ? e.target : null;
|
|
65
62
|
p(t, o, n) || t.options.closeOnPointerOutside !== !1 && c(t, "outside-pointer", e);
|
|
66
63
|
}
|
|
67
|
-
function
|
|
64
|
+
function y(e) {
|
|
68
65
|
const t = f();
|
|
69
|
-
if (!t)
|
|
70
|
-
|
|
71
|
-
const n = typeof e.composedPath == "function" ? e.composedPath() : [], o = P(e.target) ? e.target : null;
|
|
66
|
+
if (!t) return;
|
|
67
|
+
const n = typeof e.composedPath == "function" ? e.composedPath() : [], o = E(e.target) ? e.target : null;
|
|
72
68
|
p(t, o, n) || t.options.closeOnFocusOutside !== !1 && c(t, "outside-focus", e);
|
|
73
69
|
}
|
|
74
|
-
function
|
|
70
|
+
function P(e) {
|
|
75
71
|
const t = f();
|
|
76
72
|
t && e.key === "Escape" && t.options.closeOnEscape !== !1 && c(t, "escape-key", e);
|
|
77
73
|
}
|
|
78
|
-
function
|
|
79
|
-
if (!
|
|
74
|
+
function k(e) {
|
|
75
|
+
if (!L(e.node))
|
|
80
76
|
throw new Error("createDismissableLayer requires a valid HTMLElement node");
|
|
81
77
|
const t = {
|
|
82
|
-
id: Symbol("dismissable-layer"),
|
|
78
|
+
id: /* @__PURE__ */ Symbol("dismissable-layer"),
|
|
83
79
|
options: {
|
|
84
80
|
closeOnEscape: !0,
|
|
85
81
|
closeOnPointerOutside: !0,
|
|
@@ -88,10 +84,10 @@ function T(e) {
|
|
|
88
84
|
},
|
|
89
85
|
paused: !1
|
|
90
86
|
};
|
|
91
|
-
return s.push(t),
|
|
87
|
+
return s.push(t), m(), r(), {
|
|
92
88
|
destroy() {
|
|
93
89
|
const n = s.findIndex((o) => o.id === t.id);
|
|
94
|
-
n >= 0 && s.splice(n, 1), d(t),
|
|
90
|
+
n >= 0 && s.splice(n, 1), d(t), m(), r();
|
|
95
91
|
},
|
|
96
92
|
pause() {
|
|
97
93
|
t.paused = !0, r();
|
|
@@ -108,5 +104,5 @@ function T(e) {
|
|
|
108
104
|
};
|
|
109
105
|
}
|
|
110
106
|
export {
|
|
111
|
-
|
|
107
|
+
k as c
|
|
112
108
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=[];let u=!1,i=null;function E(e){return!!e&&typeof e.nodeType=="number"}function P(e){return e instanceof HTMLElement}function v(){return s.filter(e=>!e.paused)}function f(){const e=v();return e.length?e[e.length-1]:null}function l(e,t){return t?e.includes(t):!1}function a(e,t){return!e||!t?!1:e===t||e.contains(t)}function p(e,t,n=[]){return!!(a(e.options.node,t)||a(e.options.trigger??null,t)||l(n,e.options.node)||l(n,e.options.trigger??null))}function d(e){typeof e.prevNodePointerEvents=="string"&&(e.options.node.style.pointerEvents=e.prevNodePointerEvents,e.prevNodePointerEvents=void 0);const t=e.options.trigger;t&&typeof e.prevTriggerPointerEvents=="string"&&(t.style.pointerEvents=e.prevTriggerPointerEvents,e.prevTriggerPointerEvents=void 0)}function r(){if(typeof document>"u"||!document.body)return;if(!v().filter(t=>t.options.disableOutsidePointerEvents).length){document.body.removeAttribute("data-ui-dismissable-lock"),i!==null&&(document.body.style.pointerEvents=i,i=null),s.forEach(d);return}i===null&&(i=document.body.style.pointerEvents||""),document.body.setAttribute("data-ui-dismissable-lock",""),document.body.style.pointerEvents="none",s.forEach(t=>{if(!(!t.paused&&!!t.options.disableOutsidePointerEvents)){d(t);return}typeof t.prevNodePointerEvents!="string"&&(t.prevNodePointerEvents=t.options.node.style.pointerEvents||""),t.options.node.style.pointerEvents="auto";const o=t.options.trigger;o&&(typeof t.prevTriggerPointerEvents!="string"&&(t.prevTriggerPointerEvents=o.style.pointerEvents||""),o.style.pointerEvents="auto")})}function b(){u||typeof document>"u"||(document.addEventListener("pointerdown",g,!0),document.addEventListener("focusin",y,!0),document.addEventListener("keydown",L,!0),u=!0)}function h(){!u||typeof document>"u"||(document.removeEventListener("pointerdown",g,!0),document.removeEventListener("focusin",y,!0),document.removeEventListener("keydown",L,!0),u=!1)}function m(){s.length?b():h()}function c(e,t,n){e.paused||e.options.onBeforeDismiss?.(t,n)===!1||e.options.onDismiss?.(t,n)}function g(e){const t=f();if(!t)return;const n=typeof e.composedPath=="function"?e.composedPath():[],o=E(e.target)?e.target:null;p(t,o,n)||t.options.closeOnPointerOutside!==!1&&c(t,"outside-pointer",e)}function y(e){const t=f();if(!t)return;const n=typeof e.composedPath=="function"?e.composedPath():[],o=E(e.target)?e.target:null;p(t,o,n)||t.options.closeOnFocusOutside!==!1&&c(t,"outside-focus",e)}function L(e){const t=f();t&&e.key==="Escape"&&t.options.closeOnEscape!==!1&&c(t,"escape-key",e)}function k(e){if(!P(e.node))throw new Error("createDismissableLayer requires a valid HTMLElement node");const t={id:Symbol("dismissable-layer"),options:{closeOnEscape:!0,closeOnPointerOutside:!0,closeOnFocusOutside:!1,...e},paused:!1};return s.push(t),m(),r(),{destroy(){const n=s.findIndex(o=>o.id===t.id);n>=0&&s.splice(n,1),d(t),m(),r()},pause(){t.paused=!0,r()},resume(){t.paused=!1,r()},contains(n){return p(t,n)},dismiss(n="programmatic"){c(t,n)}}}exports.createDismissableLayer=k;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./ElementBase-EV6mVBUV.js"),a=require("./dismissable-layer-DNfrKA20.js"),u=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
color-scheme: light dark;
|
|
5
5
|
}
|
|
6
|
-
`;function i(o){if(o==null)return!1;const e=o.toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}class r extends n.ElementBase{constructor(){super(...arguments),this._layer=null,this._lastCloseDetail=null}static get observedAttributes(){return["open","modal","close-on-escape","close-on-pointer-outside","close-on-focus-outside","disable-outside-pointer-events","headless"]}connectedCallback(){super.connectedCallback(),this._syncLayer()}disconnectedCallback(){this._destroyLayer(),super.disconnectedCallback()}attributeChangedCallback(e,t,s){if(t!==s){if(e==="open"&&t!==null&&s===null){const l=this._lastCloseDetail||{reason:"programmatic"};this._destroyLayer(),this.dispatchEvent(new CustomEvent("close",{detail:l,bubbles:!0,composed:!0})),this._lastCloseDetail=null;return}if(e==="open"&&s!==null){this._syncLayer();return}this._syncLayer()}}open(){this.setAttribute("open","")}close(e="programmatic"){this.hasAttribute("open")&&this._emitBeforeClose(e)&&(this._lastCloseDetail={reason:e},this.removeAttribute("open"))}toggle(){this.hasAttribute("open")?this.close():this.open()}_emitBeforeClose(e,t){const s=new CustomEvent("before-close",{detail:{reason:e,originalEvent:t},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(s)}_destroyLayer(){
|
|
6
|
+
`;function i(o){if(o==null)return!1;const e=o.toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}class r extends n.ElementBase{constructor(){super(...arguments),this._layer=null,this._lastCloseDetail=null}static get observedAttributes(){return["open","modal","close-on-escape","close-on-pointer-outside","close-on-focus-outside","disable-outside-pointer-events","headless"]}connectedCallback(){super.connectedCallback(),this._syncLayer()}disconnectedCallback(){this._destroyLayer(),super.disconnectedCallback()}attributeChangedCallback(e,t,s){if(t!==s){if(e==="open"&&t!==null&&s===null){const l=this._lastCloseDetail||{reason:"programmatic"};this._destroyLayer(),this.dispatchEvent(new CustomEvent("close",{detail:l,bubbles:!0,composed:!0})),this._lastCloseDetail=null;return}if(e==="open"&&s!==null){this._syncLayer();return}this._syncLayer()}}open(){this.setAttribute("open","")}close(e="programmatic"){this.hasAttribute("open")&&this._emitBeforeClose(e)&&(this._lastCloseDetail={reason:e},this.removeAttribute("open"))}toggle(){this.hasAttribute("open")?this.close():this.open()}_emitBeforeClose(e,t){const s=new CustomEvent("before-close",{detail:{reason:e,originalEvent:t},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(s)}_destroyLayer(){this._layer?.destroy(),this._layer=null}_syncLayer(){if(this.isConnected){if(this.hasAttribute("headless")||!this.hasAttribute("open")){this._destroyLayer();return}this._destroyLayer(),this._layer=a.createDismissableLayer({node:this,trigger:this.querySelector('[slot="trigger"]'),modal:i(this.getAttribute("modal")),closeOnEscape:!this.hasAttribute("close-on-escape")||i(this.getAttribute("close-on-escape")),closeOnPointerOutside:!this.hasAttribute("close-on-pointer-outside")||i(this.getAttribute("close-on-pointer-outside")),closeOnFocusOutside:i(this.getAttribute("close-on-focus-outside")),disableOutsidePointerEvents:i(this.getAttribute("disable-outside-pointer-events")),onBeforeDismiss:(e,t)=>(e==="outside-pointer"&&this.dispatchEvent(new CustomEvent("interact-outside",{detail:{originalEvent:t},bubbles:!0,composed:!0})),e==="escape-key"&&this.dispatchEvent(new CustomEvent("escape-key-down",{detail:{originalEvent:t},bubbles:!0,composed:!0})),this._emitBeforeClose(e,t)),onDismiss:(e,t)=>{this._lastCloseDetail={reason:e,originalEvent:t},this.removeAttribute("open")}})}}render(){this.setContent(`<style>${u}</style><slot name="trigger"></slot><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-dismissable-layer")&&customElements.define("ui-dismissable-layer",r);exports.UIDismissableLayer=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as n } from "./ElementBase-
|
|
2
|
-
import { c as l } from "./dismissable-layer-
|
|
1
|
+
import { E as n } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { c as l } from "./dismissable-layer-BmPIoK80.mjs";
|
|
3
3
|
const a = `
|
|
4
4
|
:host {
|
|
5
5
|
display: contents;
|
|
@@ -7,8 +7,7 @@ const a = `
|
|
|
7
7
|
}
|
|
8
8
|
`;
|
|
9
9
|
function i(o) {
|
|
10
|
-
if (o == null)
|
|
11
|
-
return !1;
|
|
10
|
+
if (o == null) return !1;
|
|
12
11
|
const e = o.toLowerCase();
|
|
13
12
|
return e !== "false" && e !== "0" && e !== "off";
|
|
14
13
|
}
|
|
@@ -66,8 +65,7 @@ class u extends n {
|
|
|
66
65
|
return this.dispatchEvent(s);
|
|
67
66
|
}
|
|
68
67
|
_destroyLayer() {
|
|
69
|
-
|
|
70
|
-
(e = this._layer) == null || e.destroy(), this._layer = null;
|
|
68
|
+
this._layer?.destroy(), this._layer = null;
|
|
71
69
|
}
|
|
72
70
|
_syncLayer() {
|
|
73
71
|
if (this.isConnected) {
|