@editora/ui-core 0.1.19 → 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 -671
- 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-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 +9 -9
- package/dist/date-picker.esm.js +69 -97
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +32 -56
- package/dist/date-range-time-picker.cjs.js +9 -9
- package/dist/date-range-time-picker.esm.js +111 -140
- package/dist/date-time-picker.cjs.js +4 -4
- package/dist/date-time-picker.esm.js +112 -144
- 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 +22 -22
- package/dist/time-picker.esm.js +88 -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 +2 -2
- 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
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
import { p as T, c as b, s as N, e as v, a as F } from "./calendar-2c11b824.mjs";
|
|
2
|
-
import { a as L } from "./scroll-lock-31da444f.mjs";
|
|
3
|
-
import { c as U } from "./positioner-e9770c66.mjs";
|
|
4
|
-
const C = /* @__PURE__ */ new Map(), I = 24;
|
|
5
|
-
function D(t, e, n) {
|
|
6
|
-
return Math.max(e, Math.min(n, t));
|
|
7
|
-
}
|
|
8
|
-
function u(t) {
|
|
9
|
-
return String(t).padStart(2, "0");
|
|
10
|
-
}
|
|
11
|
-
function $(t) {
|
|
12
|
-
if (!/^-?\d+$/.test(t))
|
|
13
|
-
return null;
|
|
14
|
-
const e = Number(t);
|
|
15
|
-
return Number.isFinite(e) ? Math.trunc(e) : null;
|
|
16
|
-
}
|
|
17
|
-
function O(t) {
|
|
18
|
-
return t.replace(/[.\-]/g, "/").replace(/\s+/g, " ").trim();
|
|
19
|
-
}
|
|
20
|
-
function P(t) {
|
|
21
|
-
const e = [];
|
|
22
|
-
for (let n = 0; n < 12; n += 1)
|
|
23
|
-
e.push(
|
|
24
|
-
new Intl.DateTimeFormat(t, {
|
|
25
|
-
month: "short",
|
|
26
|
-
timeZone: "UTC"
|
|
27
|
-
}).format(new Date(Date.UTC(2024, n, 1)))
|
|
28
|
-
);
|
|
29
|
-
return e;
|
|
30
|
-
}
|
|
31
|
-
function A(t) {
|
|
32
|
-
const e = [];
|
|
33
|
-
for (let n = 0; n < 12; n += 1)
|
|
34
|
-
e.push(
|
|
35
|
-
new Intl.DateTimeFormat(t, {
|
|
36
|
-
month: "long",
|
|
37
|
-
timeZone: "UTC"
|
|
38
|
-
}).format(new Date(Date.UTC(2024, n, 1)))
|
|
39
|
-
);
|
|
40
|
-
return e;
|
|
41
|
-
}
|
|
42
|
-
function B(t, e = !1) {
|
|
43
|
-
if (t == null)
|
|
44
|
-
return e;
|
|
45
|
-
const n = t.trim().toLowerCase();
|
|
46
|
-
return n ? n !== "false" && n !== "0" && n !== "off" && n !== "no" : !0;
|
|
47
|
-
}
|
|
48
|
-
function H(t, e) {
|
|
49
|
-
const n = typeof t.composedPath == "function" ? t.composedPath() : [];
|
|
50
|
-
for (const o of e)
|
|
51
|
-
if (o && n.includes(o))
|
|
52
|
-
return !0;
|
|
53
|
-
const r = t.target;
|
|
54
|
-
if (!(r instanceof Node))
|
|
55
|
-
return !1;
|
|
56
|
-
for (const o of e)
|
|
57
|
-
if (o instanceof Node && o.contains(r))
|
|
58
|
-
return !0;
|
|
59
|
-
return !1;
|
|
60
|
-
}
|
|
61
|
-
function q(t) {
|
|
62
|
-
const e = (t || "").trim();
|
|
63
|
-
return e || (typeof navigator < "u" && navigator.language ? navigator.language : "en-US");
|
|
64
|
-
}
|
|
65
|
-
function m(t) {
|
|
66
|
-
if (!t)
|
|
67
|
-
return null;
|
|
68
|
-
const e = T(t);
|
|
69
|
-
return e ? `${e.y}-${u(e.m)}-${u(e.d)}` : null;
|
|
70
|
-
}
|
|
71
|
-
function y(t) {
|
|
72
|
-
if (!t)
|
|
73
|
-
return null;
|
|
74
|
-
const e = /^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());
|
|
75
|
-
if (!e)
|
|
76
|
-
return null;
|
|
77
|
-
const n = m(e[1]);
|
|
78
|
-
if (!n)
|
|
79
|
-
return null;
|
|
80
|
-
const r = h(e[2], !0);
|
|
81
|
-
if (!r)
|
|
82
|
-
return null;
|
|
83
|
-
const o = e[2].split(":").length === 3;
|
|
84
|
-
return { date: n, time: w(r, o) };
|
|
85
|
-
}
|
|
86
|
-
function E(t, e) {
|
|
87
|
-
if (!t || !e)
|
|
88
|
-
return null;
|
|
89
|
-
const n = m(t), r = h(e, !0);
|
|
90
|
-
return !n || !r ? null : `${n}T${w(r, e.split(":").length >= 3)}`;
|
|
91
|
-
}
|
|
92
|
-
function Z(t) {
|
|
93
|
-
if (!t)
|
|
94
|
-
return null;
|
|
95
|
-
const e = m(t);
|
|
96
|
-
if (e)
|
|
97
|
-
return e;
|
|
98
|
-
const n = y(t);
|
|
99
|
-
return (n == null ? void 0 : n.date) || null;
|
|
100
|
-
}
|
|
101
|
-
function _(t) {
|
|
102
|
-
if (!t)
|
|
103
|
-
return null;
|
|
104
|
-
const e = y(t);
|
|
105
|
-
if (e)
|
|
106
|
-
return e;
|
|
107
|
-
const n = m(t);
|
|
108
|
-
return n ? { date: n, time: "00:00" } : null;
|
|
109
|
-
}
|
|
110
|
-
function z(t, e, n) {
|
|
111
|
-
const r = T(t);
|
|
112
|
-
if (!r)
|
|
113
|
-
return t;
|
|
114
|
-
const o = `${e}::${JSON.stringify(n || {})}`;
|
|
115
|
-
let s = C.get(o);
|
|
116
|
-
return s || (s = new Intl.DateTimeFormat(e, {
|
|
117
|
-
year: "numeric",
|
|
118
|
-
month: "short",
|
|
119
|
-
day: "2-digit",
|
|
120
|
-
timeZone: "UTC",
|
|
121
|
-
...n || {}
|
|
122
|
-
}), C.set(o, s)), s.format(new Date(Date.UTC(r.y, r.m - 1, r.d)));
|
|
123
|
-
}
|
|
124
|
-
function W(t, e, n, r) {
|
|
125
|
-
if (!t)
|
|
126
|
-
return "";
|
|
127
|
-
if (n === "iso")
|
|
128
|
-
return t;
|
|
129
|
-
if (n === "custom" && r) {
|
|
130
|
-
const o = T(t);
|
|
131
|
-
if (!o)
|
|
132
|
-
return t;
|
|
133
|
-
const s = P(e), i = A(e);
|
|
134
|
-
return r.replace(/YYYY/g, String(o.y)).replace(/MMM/g, s[o.m - 1] || "").replace(/MMMM/g, i[o.m - 1] || "").replace(/MM/g, u(o.m)).replace(/DD/g, u(o.d));
|
|
135
|
-
}
|
|
136
|
-
return z(t, e);
|
|
137
|
-
}
|
|
138
|
-
function j(t, e) {
|
|
139
|
-
const n = m(t.trim());
|
|
140
|
-
if (n)
|
|
141
|
-
return n;
|
|
142
|
-
const r = O(t);
|
|
143
|
-
if (!r)
|
|
144
|
-
return null;
|
|
145
|
-
const o = m(r);
|
|
146
|
-
if (o)
|
|
147
|
-
return o;
|
|
148
|
-
const s = r.split("/").map((M) => M.trim()).filter(Boolean);
|
|
149
|
-
if (s.length !== 3)
|
|
150
|
-
return null;
|
|
151
|
-
const i = $(s[0]), a = $(s[1]), d = $(s[2]);
|
|
152
|
-
if (i == null || a == null || d == null)
|
|
153
|
-
return null;
|
|
154
|
-
let f = d;
|
|
155
|
-
f < 100 && (f += f >= 70 ? 1900 : 2e3);
|
|
156
|
-
const l = e.toLowerCase().startsWith("en-us"), c = l ? i : a, p = l ? a : i;
|
|
157
|
-
if (f < 1e3 || c < 1 || c > 12 || p < 1 || p > 31)
|
|
158
|
-
return null;
|
|
159
|
-
const g = `${f}-${u(c)}-${u(p)}`;
|
|
160
|
-
return m(g);
|
|
161
|
-
}
|
|
162
|
-
function h(t, e) {
|
|
163
|
-
const n = t.trim().toLowerCase();
|
|
164
|
-
if (!n)
|
|
165
|
-
return null;
|
|
166
|
-
const r = /^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);
|
|
167
|
-
if (!r)
|
|
168
|
-
return null;
|
|
169
|
-
let o = Number(r[1]);
|
|
170
|
-
const s = Number(r[2] ?? "0"), i = Number(r[3] ?? "0");
|
|
171
|
-
if (!Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(i) || s < 0 || s > 59 || i < 0 || i > 59 || !e && i !== 0)
|
|
172
|
-
return null;
|
|
173
|
-
const a = r[4];
|
|
174
|
-
if (a) {
|
|
175
|
-
if (o < 1 || o > 12)
|
|
176
|
-
return null;
|
|
177
|
-
a === "pm" && o < 12 && (o += 12), a === "am" && o === 12 && (o = 0);
|
|
178
|
-
}
|
|
179
|
-
return o < 0 || o > 23 ? null : { hours: o, minutes: s, seconds: i };
|
|
180
|
-
}
|
|
181
|
-
function w(t, e = !1) {
|
|
182
|
-
if (!t)
|
|
183
|
-
return "";
|
|
184
|
-
const n = u(D(t.hours, 0, 23)), r = u(D(t.minutes, 0, 59));
|
|
185
|
-
if (!e)
|
|
186
|
-
return `${n}:${r}`;
|
|
187
|
-
const o = u(D(t.seconds, 0, 59));
|
|
188
|
-
return `${n}:${r}:${o}`;
|
|
189
|
-
}
|
|
190
|
-
function G(t, e) {
|
|
191
|
-
const n = h(t, !0);
|
|
192
|
-
if (!n)
|
|
193
|
-
return t;
|
|
194
|
-
const r = /* @__PURE__ */ new Date();
|
|
195
|
-
return r.setHours(n.hours, n.minutes, n.seconds, 0), new Intl.DateTimeFormat(e, {
|
|
196
|
-
hour: "numeric",
|
|
197
|
-
minute: "2-digit",
|
|
198
|
-
second: t.split(":").length > 2 ? "2-digit" : void 0,
|
|
199
|
-
hour12: !0
|
|
200
|
-
}).format(r);
|
|
201
|
-
}
|
|
202
|
-
function S(t, e) {
|
|
203
|
-
const n = h(t, !0), r = h(e, !0);
|
|
204
|
-
if (!n || !r)
|
|
205
|
-
return t.localeCompare(e);
|
|
206
|
-
const o = n.hours * 3600 + n.minutes * 60 + n.seconds, s = r.hours * 3600 + r.minutes * 60 + r.seconds;
|
|
207
|
-
return o - s;
|
|
208
|
-
}
|
|
209
|
-
function J(t, e, n) {
|
|
210
|
-
const r = h(t, !0);
|
|
211
|
-
if (!r)
|
|
212
|
-
return t;
|
|
213
|
-
let o = w(r, t.split(":").length >= 3);
|
|
214
|
-
return e && S(o, e) < 0 && (o = e), n && S(o, n) > 0 && (o = n), o;
|
|
215
|
-
}
|
|
216
|
-
function K(t, e, n) {
|
|
217
|
-
let r = t;
|
|
218
|
-
return e && b(r, e) < 0 && (r = e), n && b(r, n) > 0 && (r = n), r;
|
|
219
|
-
}
|
|
220
|
-
function V(t, e) {
|
|
221
|
-
const n = y(t), r = y(e);
|
|
222
|
-
if (!n || !r)
|
|
223
|
-
return t.localeCompare(e);
|
|
224
|
-
const o = b(n.date, r.date);
|
|
225
|
-
return o !== 0 ? o : S(n.time, r.time);
|
|
226
|
-
}
|
|
227
|
-
function Q(t) {
|
|
228
|
-
const e = T(t);
|
|
229
|
-
if (!e)
|
|
230
|
-
return { start: t, end: t };
|
|
231
|
-
const n = N(e.y, e.m), r = v(e.y, e.m);
|
|
232
|
-
return {
|
|
233
|
-
start: `${n.y}-${u(n.m)}-${u(n.d)}`,
|
|
234
|
-
end: `${r.y}-${u(r.m)}-${u(r.d)}`
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
function R(t, e) {
|
|
238
|
-
const n = D(e, 1, 366);
|
|
239
|
-
return {
|
|
240
|
-
start: F(t, -(n - 1)),
|
|
241
|
-
end: t
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function X(t, e, n = 8, r = 8, o = null) {
|
|
245
|
-
const i = (typeof window < "u" ? window.innerHeight : 800) - t.bottom - r - n, a = t.top - r - n, d = i >= e.height, f = a >= e.height, l = o === "top" ? "top" : "bottom";
|
|
246
|
-
let c;
|
|
247
|
-
if (d && !f)
|
|
248
|
-
c = "bottom";
|
|
249
|
-
else if (f && !d)
|
|
250
|
-
c = "top";
|
|
251
|
-
else if (f && d)
|
|
252
|
-
c = l;
|
|
253
|
-
else {
|
|
254
|
-
const g = l === "bottom" ? i : a, M = l === "bottom" ? a : i;
|
|
255
|
-
g > 0 && M <= g + I ? c = l : c = i >= a ? "bottom" : "top";
|
|
256
|
-
}
|
|
257
|
-
const p = U(t, e, {
|
|
258
|
-
placement: `${c}-start`,
|
|
259
|
-
strategy: "fixed",
|
|
260
|
-
offset: r,
|
|
261
|
-
shift: !1,
|
|
262
|
-
flip: !1,
|
|
263
|
-
boundaryPadding: n
|
|
264
|
-
});
|
|
265
|
-
return { top: Math.round(p.y), left: Math.round(p.x), placement: c };
|
|
266
|
-
}
|
|
267
|
-
function tt(t) {
|
|
268
|
-
let e = 0;
|
|
269
|
-
return { run: () => {
|
|
270
|
-
e || (e = requestAnimationFrame(() => {
|
|
271
|
-
e = 0, t();
|
|
272
|
-
}));
|
|
273
|
-
}, cancel: () => {
|
|
274
|
-
e && (cancelAnimationFrame(e), e = 0);
|
|
275
|
-
} };
|
|
276
|
-
}
|
|
277
|
-
function et(t) {
|
|
278
|
-
return (t || "popover") === "inline" || typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(max-width: 639px)").matches;
|
|
279
|
-
}
|
|
280
|
-
function nt() {
|
|
281
|
-
return L();
|
|
282
|
-
}
|
|
283
|
-
export {
|
|
284
|
-
K as a,
|
|
285
|
-
q as b,
|
|
286
|
-
X as c,
|
|
287
|
-
j as d,
|
|
288
|
-
H as e,
|
|
289
|
-
W as f,
|
|
290
|
-
R as g,
|
|
291
|
-
Q as h,
|
|
292
|
-
B as i,
|
|
293
|
-
E as j,
|
|
294
|
-
y as k,
|
|
295
|
-
nt as l,
|
|
296
|
-
V as m,
|
|
297
|
-
m as n,
|
|
298
|
-
_ as o,
|
|
299
|
-
Z as p,
|
|
300
|
-
h as q,
|
|
301
|
-
tt as r,
|
|
302
|
-
et as s,
|
|
303
|
-
G as t,
|
|
304
|
-
w as u,
|
|
305
|
-
J as v,
|
|
306
|
-
S as w
|
|
307
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=[];let u=!1,i=null;function L(e){return!!e&&typeof e.nodeType=="number"}function O(e){return e instanceof HTMLElement}function P(){return s.filter(e=>!e.paused)}function f(){const e=P();return e.length?e[e.length-1]:null}function v(e,t){return t?e.includes(t):!1}function g(e,t){return!e||!t?!1:e===t||e.contains(t)}function p(e,t,n=[]){return!!(g(e.options.node,t)||g(e.options.trigger??null,t)||v(n,e.options.node)||v(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(!P().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 w(){u||typeof document>"u"||(document.addEventListener("pointerdown",b,!0),document.addEventListener("focusin",h,!0),document.addEventListener("keydown",k,!0),u=!0)}function D(){!u||typeof document>"u"||(document.removeEventListener("pointerdown",b,!0),document.removeEventListener("focusin",h,!0),document.removeEventListener("keydown",k,!0),u=!1)}function y(){s.length?w():D()}function c(e,t,n){var l,a,m,E;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)}function b(e){const t=f();if(!t)return;const n=typeof e.composedPath=="function"?e.composedPath():[],o=L(e.target)?e.target:null;p(t,o,n)||t.options.closeOnPointerOutside!==!1&&c(t,"outside-pointer",e)}function h(e){const t=f();if(!t)return;const n=typeof e.composedPath=="function"?e.composedPath():[],o=L(e.target)?e.target:null;p(t,o,n)||t.options.closeOnFocusOutside!==!1&&c(t,"outside-focus",e)}function k(e){const t=f();t&&e.key==="Escape"&&t.options.closeOnEscape!==!1&&c(t,"escape-key",e)}function T(e){if(!O(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),y(),r(),{destroy(){const n=s.findIndex(o=>o.id===t.id);n>=0&&s.splice(n,1),d(t),y(),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=T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=[],y=["a[href]","area[href]",'input:not([type="hidden"])',"select","textarea","button","iframe","[tabindex]",'[contenteditable="true"]'].join(", ");function m(){const t=a.filter(e=>!e.paused);return t.length?t[t.length-1]:null}function F(t){return!(t.hasAttribute("disabled")||t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden")||t.getAttribute("tabindex")==="-1")}function d(t){return Array.from(t.querySelectorAll(y)).filter(F)}function l(t){t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1")}function b(t){return typeof t=="function"?t():t??null}function s(t){if(!t||!t.isConnected)return!1;try{return t.focus(),!0}catch{return!1}}function E(t){return t.querySelector('[aria-selected="true"], [data-selected="true"], [selected], [checked], [aria-current="true"]')||null}function v(t){if(!t.options.inertOthers||typeof document>"u"||!document.body)return;const e=Array.from(document.body.children);t.inerted=e.filter(r=>r!==t.options.node&&!r.contains(t.options.node)).map(r=>{const f=r.hasAttribute("inert");return f||r.setAttribute("inert",""),{element:r,hadInert:f}})}function A(t){t.inerted.forEach(({element:e,hadInert:r})=>{r||e.removeAttribute("inert")}),t.inerted=[]}function L(t){if(!(t.node instanceof HTMLElement))throw new Error("createFocusScope requires a valid HTMLElement node");const e={id:Symbol("focus-scope"),options:{trapped:!0,loop:!0,restoreFocus:!0,autoFocus:"first",inertOthers:!1,...t},paused:!1,previouslyFocused:document.activeElement instanceof HTMLElement?document.activeElement:null,inerted:[],onKeyDown:()=>{},onFocusIn:()=>{}},r=()=>{const n=d(e.options.node)[0]||null;s(n)||(l(e.options.node),s(e.options.node))},f=()=>{const n=d(e.options.node),o=n.length?n[n.length-1]:null;s(o)||(l(e.options.node),s(e.options.node))},u=()=>{const n=b(e.options.initialFocus);if(s(n))return;const o=e.options.autoFocus;if(o!=="none"){if(o==="container"){l(e.options.node),s(e.options.node);return}if(o==="selected"){const i=E(e.options.node);if(s(i))return}r()}};return e.onKeyDown=n=>{var h;if(e.paused||((h=m())==null?void 0:h.id)!==e.id||!e.options.trapped||n.key!=="Tab")return;const o=d(e.options.node);if(!o.length){n.preventDefault(),u();return}const i=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!i||!e.options.node.contains(i)){n.preventDefault(),u();return}const c=o[0],p=o[o.length-1];if(n.shiftKey){(i===c||i===e.options.node)&&(n.preventDefault(),e.options.loop&&s(p));return}i===p&&(n.preventDefault(),e.options.loop&&s(c))},e.onFocusIn=n=>{var c;if(e.paused||((c=m())==null?void 0:c.id)!==e.id||!e.options.trapped)return;const o=n.target;(typeof n.composedPath=="function"?n.composedPath():[]).includes(e.options.node)||o instanceof Node&&(e.options.node.contains(o)||u())},a.push(e),v(e),document.addEventListener("keydown",e.onKeyDown,!0),document.addEventListener("focusin",e.onFocusIn,!0),u(),{destroy(){const n=a.findIndex(i=>i.id===e.id);if(n>=0&&a.splice(n,1),document.removeEventListener("keydown",e.onKeyDown,!0),document.removeEventListener("focusin",e.onFocusIn,!0),A(e),!e.options.restoreFocus)return;const o=b(e.options.finalFocus)||e.previouslyFocused;s(o)},focusFirst:r,focusLast:f,focusInitial:u,pause(){e.paused=!0},resume(){e.paused=!1}}}exports.createFocusScope=L;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { f as E, a as D, c as M, d as q } from "./collection-a1aac0c6.mjs";
|
|
2
|
-
import { UICollection as A } from "./collection.esm.js";
|
|
3
|
-
function L(s) {
|
|
4
|
-
return !!(s && typeof s == "object" && "disabled" in s && s.disabled);
|
|
5
|
-
}
|
|
6
|
-
function R(s, e, t = L) {
|
|
7
|
-
return e === "first" ? E(s, t) : D(s, t);
|
|
8
|
-
}
|
|
9
|
-
function H(s, e = {}) {
|
|
10
|
-
const t = e.getDisabled || L, n = e.activeIndex ?? -1, l = e.selectedIndex ?? -1;
|
|
11
|
-
return n >= 0 && n < s.length && !t(s[n]) ? n : l >= 0 && l < s.length && !t(s[l]) ? l : E(s, t);
|
|
12
|
-
}
|
|
13
|
-
function W(s, e, t, n = {}) {
|
|
14
|
-
const l = typeof n.fallbackIndex == "number" ? n.fallbackIndex : e;
|
|
15
|
-
return M(s, e >= 0 ? e : l, t, n);
|
|
16
|
-
}
|
|
17
|
-
function N(s, e, t = {}) {
|
|
18
|
-
return q(s, e, t);
|
|
19
|
-
}
|
|
20
|
-
function X(s, e = { block: "nearest", inline: "nearest" }) {
|
|
21
|
-
if (!s)
|
|
22
|
-
return;
|
|
23
|
-
const t = s.ownerDocument, n = t == null ? void 0 : t.defaultView;
|
|
24
|
-
if (!t || !n)
|
|
25
|
-
return;
|
|
26
|
-
const l = (a, r) => {
|
|
27
|
-
const o = n.getComputedStyle(a), u = r === "y" ? o.overflowY || o.overflow : o.overflowX || o.overflow;
|
|
28
|
-
return /(auto|scroll|overlay)/.test(u);
|
|
29
|
-
};
|
|
30
|
-
let i = s.parentElement;
|
|
31
|
-
for (; i; ) {
|
|
32
|
-
const a = l(i, "y") && i.scrollHeight > i.clientHeight;
|
|
33
|
-
if (l(i, "x") && i.scrollWidth > i.clientWidth || a)
|
|
34
|
-
break;
|
|
35
|
-
i = i.parentElement;
|
|
36
|
-
}
|
|
37
|
-
if (!i)
|
|
38
|
-
return;
|
|
39
|
-
const c = s.getBoundingClientRect(), b = i.getBoundingClientRect(), d = c.top - b.top + i.scrollTop, f = d + c.height, x = c.left - b.left + i.scrollLeft, w = x + c.width, v = (a, r, o, u, _) => {
|
|
40
|
-
const m = _ || "nearest", p = o - r;
|
|
41
|
-
return m === "start" ? r : m === "end" ? o - u : m === "center" ? r - (u - p) / 2 : p >= u || r < a ? r : o > a + u ? o - u : a;
|
|
42
|
-
}, C = v(i.scrollTop, d, f, i.clientHeight, e.block), T = v(i.scrollLeft, x, w, i.clientWidth, e.inline), S = Math.max(0, i.scrollHeight - i.clientHeight), B = Math.max(0, i.scrollWidth - i.clientWidth), g = Math.max(0, Math.min(S, C)), I = Math.max(0, Math.min(B, T));
|
|
43
|
-
Math.abs(i.scrollTop - g) > 0.5 && (i.scrollTop = g), Math.abs(i.scrollLeft - I) > 0.5 && (i.scrollLeft = I);
|
|
44
|
-
}
|
|
45
|
-
function z(s, e) {
|
|
46
|
-
s && (e ? s.setAttribute("aria-activedescendant", e) : s.removeAttribute("aria-activedescendant"));
|
|
47
|
-
}
|
|
48
|
-
const h = "data-ui-listbox-base-style", y = `
|
|
49
|
-
ui-listbox {
|
|
50
|
-
display: block;
|
|
51
|
-
min-inline-size: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
ui-listbox[role="menu"] {
|
|
55
|
-
display: flex;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
gap: 0;
|
|
58
|
-
min-inline-size: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
ui-listbox .option-text,
|
|
62
|
-
ui-listbox [data-option-text] {
|
|
63
|
-
min-inline-size: 0;
|
|
64
|
-
display: grid;
|
|
65
|
-
gap: 1px;
|
|
66
|
-
flex: 1 1 auto;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
ui-listbox .option-label,
|
|
70
|
-
ui-listbox [data-option-label] {
|
|
71
|
-
display: block;
|
|
72
|
-
min-inline-size: 0;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
text-overflow: ellipsis;
|
|
75
|
-
white-space: nowrap;
|
|
76
|
-
font-size: inherit;
|
|
77
|
-
line-height: inherit;
|
|
78
|
-
letter-spacing: inherit;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
ui-listbox .option-description,
|
|
82
|
-
ui-listbox [data-option-description] {
|
|
83
|
-
display: block;
|
|
84
|
-
min-inline-size: 0;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
text-overflow: ellipsis;
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
color: color-mix(in srgb, currentColor 58%, transparent);
|
|
89
|
-
font-size: 0.92em;
|
|
90
|
-
line-height: 1.35;
|
|
91
|
-
letter-spacing: inherit;
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
94
|
-
function k(s, e) {
|
|
95
|
-
s.removeAttribute(e);
|
|
96
|
-
}
|
|
97
|
-
function O(s) {
|
|
98
|
-
const e = s.getAttribute("tabindex");
|
|
99
|
-
return e != null ? e !== "-1" || s.matches(":focus") : typeof s.focus == "function";
|
|
100
|
-
}
|
|
101
|
-
class Y extends A {
|
|
102
|
-
constructor() {
|
|
103
|
-
super(...arguments), this._onClickBound = this._onClick.bind(this);
|
|
104
|
-
}
|
|
105
|
-
connectedCallback() {
|
|
106
|
-
this._ensureBaseStyle(), super.connectedCallback(), this.addEventListener("click", this._onClickBound);
|
|
107
|
-
}
|
|
108
|
-
disconnectedCallback() {
|
|
109
|
-
this.removeEventListener("click", this._onClickBound), super.disconnectedCallback();
|
|
110
|
-
}
|
|
111
|
-
static get observedAttributes() {
|
|
112
|
-
return [...A.observedAttributes, "active-attribute"];
|
|
113
|
-
}
|
|
114
|
-
get activeAttribute() {
|
|
115
|
-
return this.getAttribute("active-attribute") || "data-active";
|
|
116
|
-
}
|
|
117
|
-
set activeAttribute(e) {
|
|
118
|
-
e ? this.setAttribute("active-attribute", e) : this.removeAttribute("active-attribute");
|
|
119
|
-
}
|
|
120
|
-
getActiveItem(e = {}) {
|
|
121
|
-
const t = this.activeAttribute;
|
|
122
|
-
return this.queryItems(e).find((n) => n.getAttribute(t) === "true") || null;
|
|
123
|
-
}
|
|
124
|
-
clearActive(e = {}) {
|
|
125
|
-
const t = this.activeAttribute;
|
|
126
|
-
this.queryItems(e).forEach((n) => {
|
|
127
|
-
k(n, t), n.hasAttribute("disabled") || n.setAttribute("tabindex", "-1");
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
setActiveItem(e, t = {}) {
|
|
131
|
-
const n = this.queryItems(t), l = this.activeAttribute, i = e && n.includes(e) ? e : null;
|
|
132
|
-
if (n.forEach((c) => {
|
|
133
|
-
c === i ? (c.setAttribute(l, "true"), O(c) && c.setAttribute("tabindex", "0")) : (k(c, l), c.hasAttribute("disabled") || c.setAttribute("tabindex", "-1"));
|
|
134
|
-
}), z(t.owner || null, (i == null ? void 0 : i.id) || null), !i)
|
|
135
|
-
return null;
|
|
136
|
-
if (t.scroll !== !1 && X(i, { block: "nearest", inline: "nearest" }), t.focus)
|
|
137
|
-
try {
|
|
138
|
-
i.focus({ preventScroll: t.scroll === !1 });
|
|
139
|
-
} catch {
|
|
140
|
-
i.focus();
|
|
141
|
-
}
|
|
142
|
-
return i;
|
|
143
|
-
}
|
|
144
|
-
focusBoundary(e, t = {}) {
|
|
145
|
-
const n = this.queryItems(t), l = R(n, e, (i) => this.isItemDisabled(i));
|
|
146
|
-
return l < 0 ? null : this.setActiveItem(n[l], t);
|
|
147
|
-
}
|
|
148
|
-
move(e, t = {}) {
|
|
149
|
-
const n = this.queryItems(t);
|
|
150
|
-
if (!n.length)
|
|
151
|
-
return null;
|
|
152
|
-
const l = t.current || this.getActiveItem(t), i = l ? n.indexOf(l) : -1, b = H(n, {
|
|
153
|
-
activeIndex: i,
|
|
154
|
-
selectedIndex: i,
|
|
155
|
-
getDisabled: (f) => this.isItemDisabled(f)
|
|
156
|
-
}), d = W(n, i, e, {
|
|
157
|
-
wrap: t.wrap !== !1,
|
|
158
|
-
fallbackIndex: b,
|
|
159
|
-
getDisabled: (f) => this.isItemDisabled(f)
|
|
160
|
-
});
|
|
161
|
-
return d < 0 ? null : this.setActiveItem(n[d], t);
|
|
162
|
-
}
|
|
163
|
-
typeahead(e, t = {}) {
|
|
164
|
-
const n = t.current || this.getActiveItem(t), l = this.queryEnabledItems(t), i = n ? l.indexOf(n) : -1, c = this.findTypeaheadMatch(e, { container: t.container, startIndex: i });
|
|
165
|
-
return c ? this.setActiveItem(c, t) : null;
|
|
166
|
-
}
|
|
167
|
-
_ensureBaseStyle() {
|
|
168
|
-
const e = this.getRootNode();
|
|
169
|
-
if (e instanceof ShadowRoot) {
|
|
170
|
-
if (e.querySelector(`style[${h}]`))
|
|
171
|
-
return;
|
|
172
|
-
const n = document.createElement("style");
|
|
173
|
-
n.setAttribute(h, ""), n.textContent = y, e.append(n);
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
if (typeof document > "u" || document.head.querySelector(`style[${h}]`))
|
|
177
|
-
return;
|
|
178
|
-
const t = document.createElement("style");
|
|
179
|
-
t.setAttribute(h, ""), t.textContent = y, document.head.append(t);
|
|
180
|
-
}
|
|
181
|
-
_onClick(e) {
|
|
182
|
-
const t = e.target;
|
|
183
|
-
if (!t)
|
|
184
|
-
return;
|
|
185
|
-
const n = t.closest(this.itemSelector);
|
|
186
|
-
if (!n || !this.contains(n) || this.isItemDisabled(n))
|
|
187
|
-
return;
|
|
188
|
-
const l = this.setActiveItem(n, { focus: !1, scroll: !1 });
|
|
189
|
-
l && this.dispatchEvent(
|
|
190
|
-
new CustomEvent("select", {
|
|
191
|
-
detail: {
|
|
192
|
-
value: l.getAttribute("data-value") || l.getAttribute("value") || l.textContent || "",
|
|
193
|
-
item: l
|
|
194
|
-
},
|
|
195
|
-
bubbles: !0,
|
|
196
|
-
composed: !0
|
|
197
|
-
})
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
typeof customElements < "u" && !customElements.get("ui-listbox") && customElements.define("ui-listbox", Y);
|
|
202
|
-
export {
|
|
203
|
-
Y as U,
|
|
204
|
-
z as a,
|
|
205
|
-
N as f,
|
|
206
|
-
R as g,
|
|
207
|
-
W as m,
|
|
208
|
-
H as r,
|
|
209
|
-
X as s
|
|
210
|
-
};
|
package/dist/listbox-ef2f708e.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";const b=require("./collection-a2969ad2.js"),y=require("./collection.cjs.js");function E(s){return!!(s&&typeof s=="object"&&"disabled"in s&&s.disabled)}function w(s,e,t=E){return e==="first"?b.findFirstEnabledIndex(s,t):b.findLastEnabledIndex(s,t)}function C(s,e={}){const t=e.getDisabled||E,n=e.activeIndex??-1,c=e.selectedIndex??-1;return n>=0&&n<s.length&&!t(s[n])?n:c>=0&&c<s.length&&!t(s[c])?c:b.findFirstEnabledIndex(s,t)}function T(s,e,t,n={}){const c=typeof n.fallbackIndex=="number"?n.fallbackIndex:e;return b.findNextEnabledIndex(s,e>=0?e:c,t,n)}function X(s,e,t={}){return b.findTypeaheadMatch(s,e,t)}function S(s,e={block:"nearest",inline:"nearest"}){if(!s)return;const t=s.ownerDocument,n=t==null?void 0:t.defaultView;if(!t||!n)return;const c=(a,r)=>{const o=n.getComputedStyle(a),u=r==="y"?o.overflowY||o.overflow:o.overflowX||o.overflow;return/(auto|scroll|overlay)/.test(u)};let i=s.parentElement;for(;i;){const a=c(i,"y")&&i.scrollHeight>i.clientHeight;if(c(i,"x")&&i.scrollWidth>i.clientWidth||a)break;i=i.parentElement}if(!i)return;const l=s.getBoundingClientRect(),h=i.getBoundingClientRect(),d=l.top-h.top+i.scrollTop,f=d+l.height,v=l.left-h.left+i.scrollLeft,D=v+l.width,I=(a,r,o,u,W)=>{const m=W||"nearest",p=o-r;return m==="start"?r:m==="end"?o-u:m==="center"?r-(u-p)/2:p>=u||r<a?r:o>a+u?o-u:a},q=I(i.scrollTop,d,f,i.clientHeight,e.block),M=I(i.scrollLeft,v,D,i.clientWidth,e.inline),R=Math.max(0,i.scrollHeight-i.clientHeight),H=Math.max(0,i.scrollWidth-i.clientWidth),A=Math.max(0,Math.min(R,q)),g=Math.max(0,Math.min(H,M));Math.abs(i.scrollTop-A)>.5&&(i.scrollTop=A),Math.abs(i.scrollLeft-g)>.5&&(i.scrollLeft=g)}function B(s,e){s&&(e?s.setAttribute("aria-activedescendant",e):s.removeAttribute("aria-activedescendant"))}const x="data-ui-listbox-base-style",L=`
|
|
2
|
-
ui-listbox {
|
|
3
|
-
display: block;
|
|
4
|
-
min-inline-size: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
ui-listbox[role="menu"] {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
gap: 0;
|
|
11
|
-
min-inline-size: 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
ui-listbox .option-text,
|
|
15
|
-
ui-listbox [data-option-text] {
|
|
16
|
-
min-inline-size: 0;
|
|
17
|
-
display: grid;
|
|
18
|
-
gap: 1px;
|
|
19
|
-
flex: 1 1 auto;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
ui-listbox .option-label,
|
|
23
|
-
ui-listbox [data-option-label] {
|
|
24
|
-
display: block;
|
|
25
|
-
min-inline-size: 0;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
text-overflow: ellipsis;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
font-size: inherit;
|
|
30
|
-
line-height: inherit;
|
|
31
|
-
letter-spacing: inherit;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ui-listbox .option-description,
|
|
35
|
-
ui-listbox [data-option-description] {
|
|
36
|
-
display: block;
|
|
37
|
-
min-inline-size: 0;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
text-overflow: ellipsis;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
color: color-mix(in srgb, currentColor 58%, transparent);
|
|
42
|
-
font-size: 0.92em;
|
|
43
|
-
line-height: 1.35;
|
|
44
|
-
letter-spacing: inherit;
|
|
45
|
-
}
|
|
46
|
-
`;function k(s,e){s.removeAttribute(e)}function z(s){const e=s.getAttribute("tabindex");return e!=null?e!=="-1"||s.matches(":focus"):typeof s.focus=="function"}class _ extends y.UICollection{constructor(){super(...arguments),this._onClickBound=this._onClick.bind(this)}connectedCallback(){this._ensureBaseStyle(),super.connectedCallback(),this.addEventListener("click",this._onClickBound)}disconnectedCallback(){this.removeEventListener("click",this._onClickBound),super.disconnectedCallback()}static get observedAttributes(){return[...y.UICollection.observedAttributes,"active-attribute"]}get activeAttribute(){return this.getAttribute("active-attribute")||"data-active"}set activeAttribute(e){e?this.setAttribute("active-attribute",e):this.removeAttribute("active-attribute")}getActiveItem(e={}){const t=this.activeAttribute;return this.queryItems(e).find(n=>n.getAttribute(t)==="true")||null}clearActive(e={}){const t=this.activeAttribute;this.queryItems(e).forEach(n=>{k(n,t),n.hasAttribute("disabled")||n.setAttribute("tabindex","-1")})}setActiveItem(e,t={}){const n=this.queryItems(t),c=this.activeAttribute,i=e&&n.includes(e)?e:null;if(n.forEach(l=>{l===i?(l.setAttribute(c,"true"),z(l)&&l.setAttribute("tabindex","0")):(k(l,c),l.hasAttribute("disabled")||l.setAttribute("tabindex","-1"))}),B(t.owner||null,(i==null?void 0:i.id)||null),!i)return null;if(t.scroll!==!1&&S(i,{block:"nearest",inline:"nearest"}),t.focus)try{i.focus({preventScroll:t.scroll===!1})}catch{i.focus()}return i}focusBoundary(e,t={}){const n=this.queryItems(t),c=w(n,e,i=>this.isItemDisabled(i));return c<0?null:this.setActiveItem(n[c],t)}move(e,t={}){const n=this.queryItems(t);if(!n.length)return null;const c=t.current||this.getActiveItem(t),i=c?n.indexOf(c):-1,h=C(n,{activeIndex:i,selectedIndex:i,getDisabled:f=>this.isItemDisabled(f)}),d=T(n,i,e,{wrap:t.wrap!==!1,fallbackIndex:h,getDisabled:f=>this.isItemDisabled(f)});return d<0?null:this.setActiveItem(n[d],t)}typeahead(e,t={}){const n=t.current||this.getActiveItem(t),c=this.queryEnabledItems(t),i=n?c.indexOf(n):-1,l=this.findTypeaheadMatch(e,{container:t.container,startIndex:i});return l?this.setActiveItem(l,t):null}_ensureBaseStyle(){const e=this.getRootNode();if(e instanceof ShadowRoot){if(e.querySelector(`style[${x}]`))return;const n=document.createElement("style");n.setAttribute(x,""),n.textContent=L,e.append(n);return}if(typeof document>"u"||document.head.querySelector(`style[${x}]`))return;const t=document.createElement("style");t.setAttribute(x,""),t.textContent=L,document.head.append(t)}_onClick(e){const t=e.target;if(!t)return;const n=t.closest(this.itemSelector);if(!n||!this.contains(n)||this.isItemDisabled(n))return;const c=this.setActiveItem(n,{focus:!1,scroll:!1});c&&this.dispatchEvent(new CustomEvent("select",{detail:{value:c.getAttribute("data-value")||c.getAttribute("value")||c.textContent||"",item:c},bubbles:!0,composed:!0}))}}typeof customElements<"u"&&!customElements.get("ui-listbox")&&customElements.define("ui-listbox",_);exports.UIListbox=_;exports.findListboxTypeaheadIndex=X;exports.getListboxBoundaryIndex=w;exports.moveListboxActiveIndex=T;exports.resolveListboxActiveIndex=C;exports.scrollListboxItemIntoView=S;exports.syncActiveDescendant=B;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("./ElementBase-1b301e7f.js"),y=require("./panel.cjs.js"),b=require("./splitter.cjs.js");function f(o,e,t){return Math.min(t,Math.max(e,o))}function x(o){return Math.round(o*1e3)/1e3}function v(o){if(o.collapsed){const i=f(o.collapsedSize,0,100);return{min:i,max:i}}const e=f(o.min,0,100),t=f(Math.max(e,o.max),e,100);return{min:e,max:t}}function p(o,e=[]){if(!o.length)return[];const t=o.map((l,c)=>{const d=e[c],{min:h,max:_}=v(l);return Number.isFinite(d)?f(Number(d),h,_):l.collapsed?h:NaN}),i=t.reduce((l,c,d)=>(Number.isFinite(c)||l.push(d),l),[]),n=t.reduce((l,c)=>l+(Number.isFinite(c)?c:0),0),s=Math.max(0,100-n),r=i.length?s/i.length:0;i.forEach(l=>{const{min:c,max:d}=v(o[l]);t[l]=f(r,c,d)});let a=t.reduce((l,c)=>l+c,0),u=x(100-a),m=0;for(;Math.abs(u)>.001&&m<30;){const l=o.reduce((h,_,g)=>{const{min:w,max:S}=v(_);return u>0&&t[g]<S-.001&&h.push(g),u<0&&t[g]>w+.001&&h.push(g),h},[]);if(!l.length)break;const c=u/l.length;let d=0;if(l.forEach(h=>{const{min:_,max:g}=v(o[h]),w=t[h],S=f(w+c,_,g);t[h]=x(S),d+=t[h]-w}),a=t.reduce((h,_)=>h+_,0),u=x(100-a),Math.abs(d)<.001)break;m+=1}return t.map(l=>x(l))}function L(o,e,t,i){const n=t,s=t+1;if(n<0||s>=o.length)return[...o];const r=[...o],a=r[n],u=r[s],m=v(e[n]),l=v(e[s]),c=Math.max(m.min-a,u-l.max),d=Math.min(m.max-a,u-l.min),h=f(i,c,d);return r[n]=x(a+h),r[s]=x(u-h),r}const E=`
|
|
2
|
-
:host {
|
|
3
|
-
display: block;
|
|
4
|
-
min-inline-size: 0;
|
|
5
|
-
min-block-size: 0;
|
|
6
|
-
--ui-panel-group-gap: 0px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.group {
|
|
10
|
-
inline-size: 100%;
|
|
11
|
-
block-size: 100%;
|
|
12
|
-
min-inline-size: 0;
|
|
13
|
-
min-block-size: 0;
|
|
14
|
-
display: flex;
|
|
15
|
-
gap: var(--ui-panel-group-gap);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host([orientation="vertical"]) .group {
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
slot {
|
|
23
|
-
display: contents;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
::slotted(ui-panel) {
|
|
27
|
-
min-inline-size: 0;
|
|
28
|
-
min-block-size: 0;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
}
|
|
31
|
-
`;function z(o,e){const t=Number(o);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):e}class A extends P.ElementBase{constructor(){super(),this._observer=null,this._panels=[],this._splitters=[],this._layout=[],this._initialLayout=[],this._dragState=null,this._isMutatingChildren=!1,this._onMutation=this._onMutation.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["orientation","storage-key","auto-save"]}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerdown",this._onPointerDown),this.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(this._onMutation),this._observer.observe(this,{childList:!0,attributes:!0,subtree:!0}),queueMicrotask(()=>this._syncStructure({restore:!0}))}disconnectedCallback(){var e;this.removeEventListener("pointerdown",this._onPointerDown),this.removeEventListener("keydown",this._onKeyDown),(e=this._observer)==null||e.disconnect(),this._observer=null,this._teardownDrag(),super.disconnectedCallback()}getLayout(){return[...this._layout]}setLayout(e){const t=p(this._constraints(),e);this._applyLayout(t,{persist:!0,emit:!0})}resetLayout(){const e=this._initialLayout.length?this._initialLayout:p(this._constraints(),[]);this._applyLayout(e,{persist:!0,emit:!0})}collapsePanel(e){const t=this._panels.indexOf(e);if(t<0)return;const i=this._constraints(),n=[...this._layout],s=n[t]-i[t].collapsedSize;n[t]=i[t].collapsedSize,this._distributeRemainder(n,t,s),e.setAttribute("collapsed",""),this._applyLayout(p(this._constraints(),n),{persist:!0,emit:!0})}expandPanel(e){const t=this._panels.indexOf(e);if(t<0)return;e.removeAttribute("collapsed");const i=this._constraints(),n=this._layout[t]<=i[t].collapsedSize+.001?p(i,this._initialLayout)[t]:this._layout[t],s=[...this._layout],r=n-s[t];s[t]=n,this._distributeRemainder(s,t,-r),this._applyLayout(p(this._constraints(),s),{persist:!0,emit:!0})}attributeChangedCallback(e,t,i){if(t!==i){if(e==="orientation"){this._syncOrientation(),this._applyLayout(this._layout.length?this._layout:p(this._constraints(),[]),{persist:!1,emit:!1});return}e==="storage-key"||e==="auto-save"||super.attributeChangedCallback(e,t,i)}}_onMutation(e){if(this._isMutatingChildren)return;e.some(i=>i.type==="childList"?!0:i.target instanceof y.UIPanel&&(i.attributeName==="size"||i.attributeName==="min-size"||i.attributeName==="max-size"||i.attributeName==="collapsed-size"||i.attributeName==="collapsed"))&&this._syncStructure({restore:!1})}_orientation(){return this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"}_constraints(){return this._panels.map(e=>{const t=e.hasAttribute("collapsed"),i=z(Number(e.getAttribute("collapsed-size")||0),0),n=z(Number(e.getAttribute("min-size")||(t?i:10)),t?i:10),s=z(Number(e.getAttribute("max-size")||100),100);return{min:t?i:Math.min(n,s),max:t?i:Math.max(n,s),collapsedSize:i,collapsed:t}})}_desiredLayout(){const e=this._loadPersistedLayout();return(e==null?void 0:e.length)===this._panels.length?e:this._panels.map(t=>{const i=t.getAttribute("size");if(i==null||i.trim()==="")return NaN;const n=Number(i);return Number.isFinite(n)?n:NaN})}_syncStructure(e){this._syncGeneratedSplitters(),this._panels=Array.from(this.children).filter(n=>n instanceof y.UIPanel),this._splitters=Array.from(this.children).filter(n=>n instanceof b.UISplitter),this._syncOrientation();const t=this._desiredLayout(),i=p(this._constraints(),t);(!this._initialLayout.length||e.restore)&&(this._initialLayout=[...i]),this._applyLayout(i,{persist:!1,emit:!1})}_syncGeneratedSplitters(){const e=Array.from(this.children).filter(t=>t instanceof y.UIPanel);if(!(e.length<=1)){this._isMutatingChildren=!0;try{Array.from(this.children).filter(t=>t instanceof b.UISplitter&&t.hasAttribute("data-generated")).forEach(t=>{const i=t.previousElementSibling,n=t.nextElementSibling;(!(i instanceof y.UIPanel)||!(n instanceof y.UIPanel))&&t.remove()});for(let t=1;t<e.length;t+=1){const i=e[t];let n=i.previousElementSibling;for(;n&&!(n instanceof y.UIPanel||n instanceof b.UISplitter);)n=n.previousElementSibling;if(n instanceof b.UISplitter)continue;const s=document.createElement("ui-splitter");s.setAttribute("data-generated",""),i.before(s)}}finally{this._isMutatingChildren=!1}}}_syncOrientation(){const e=this._orientation();this._splitters.forEach((t,i)=>{t.setAttribute("orientation",e),t.setAttribute("data-index",String(i))})}_applyLayout(e,t){this._layout=[...e];const i=this._orientation(),n=this._constraints();this._panels.forEach((s,r)=>{const a=this._layout[r]??0,u=n[r];s.style.flex=`${a} 1 0px`,i==="horizontal"?(s.style.minWidth=`${u.min}%`,s.style.maxWidth=`${u.max}%`,s.style.minHeight="0",s.style.maxHeight=""):(s.style.minHeight=`${u.min}%`,s.style.maxHeight=`${u.max}%`,s.style.minWidth="0",s.style.maxWidth=""),s.setAttribute("data-panel-size",String(a))}),this._splitters.forEach((s,r)=>{const a=this._layout[r]??0;s.setAttribute("aria-valuemin",String(Math.round(n[r].min))),s.setAttribute("aria-valuemax",String(Math.round(n[r].max))),s.setAttribute("aria-valuenow",String(Math.round(a)))}),t.persist&&this._persistLayout(),t.emit&&this.dispatchEvent(new CustomEvent("layout-change",{detail:{sizes:[...this._layout]},bubbles:!0,composed:!0}))}_availableSize(){const e=this.getBoundingClientRect(),t=this._orientation()==="horizontal"?e.width:e.height,i=this._splitters.reduce((n,s)=>{const r=s.getBoundingClientRect();return n+(this._orientation()==="horizontal"?r.width:r.height)},0);return Math.max(1,t-i)}_persistLayout(){const e=this.getAttribute("storage-key");if(!(!e||!M(this,"auto-save")))try{window.localStorage.setItem(`ui-panel-group:${e}`,JSON.stringify(this._layout))}catch{}}_loadPersistedLayout(){const e=this.getAttribute("storage-key");if(!e)return null;try{const t=window.localStorage.getItem(`ui-panel-group:${e}`);if(!t)return null;const i=JSON.parse(t);return Array.isArray(i)?i.map(n=>Number(n)).filter(Number.isFinite):null}catch{return null}}_distributeRemainder(e,t,i){if(Math.abs(i)<.001)return;const n=e.map((r,a)=>a).filter(r=>r!==t);if(!n.length)return;const s=i/n.length;n.forEach(r=>{e[r]+=s})}_onPointerDown(e){const t=e.composedPath().find(n=>n instanceof b.UISplitter);if(!t||t.hasAttribute("disabled"))return;const i=Number(t.getAttribute("data-index"));Number.isFinite(i)&&(e.preventDefault(),t.setAttribute("data-dragging","true"),this._dragState={splitterIndex:i,pointerId:e.pointerId,origin:this._orientation()==="horizontal"?e.clientX:e.clientY,startLayout:[...this._layout]},window.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp),this.dispatchEvent(new CustomEvent("resize-start",{detail:{index:i},bubbles:!0,composed:!0})))}_onPointerMove(e){if(!this._dragState||e.pointerId!==this._dragState.pointerId)return;const n=((this._orientation()==="horizontal"?e.clientX:e.clientY)-this._dragState.origin)/this._availableSize()*100,s=L(this._dragState.startLayout,this._constraints(),this._dragState.splitterIndex,n);this._applyLayout(s,{persist:!1,emit:!0}),this.dispatchEvent(new CustomEvent("resize",{detail:{index:this._dragState.splitterIndex,sizes:[...this._layout]},bubbles:!0,composed:!0}))}_onPointerUp(e){if(!this._dragState||e.pointerId!==this._dragState.pointerId)return;const t=this._splitters[this._dragState.splitterIndex];t==null||t.removeAttribute("data-dragging"),this._persistLayout(),this.dispatchEvent(new CustomEvent("resize-end",{detail:{index:this._dragState.splitterIndex,sizes:[...this._layout]},bubbles:!0,composed:!0})),this._teardownDrag()}_teardownDrag(){window.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this._splitters.forEach(e=>e.removeAttribute("data-dragging")),this._dragState=null}_onKeyDown(e){const t=e.composedPath().find(m=>m instanceof b.UISplitter);if(!t||t.hasAttribute("disabled"))return;const i=Number(t.getAttribute("data-index"));if(!Number.isFinite(i))return;const s=this._orientation()==="horizontal",r=e.shiftKey?10:2;let a=0;if((s&&e.key==="ArrowRight"||!s&&e.key==="ArrowDown")&&(a=r),(s&&e.key==="ArrowLeft"||!s&&e.key==="ArrowUp")&&(a=-r),e.key==="Home"&&(a=-100),e.key==="End"&&(a=100),!a)return;e.preventDefault();const u=L(this._layout,this._constraints(),i,a);this._applyLayout(u,{persist:!0,emit:!0}),this.dispatchEvent(new CustomEvent("resize",{detail:{index:i,sizes:[...this._layout]},bubbles:!0,composed:!0}))}shouldRenderOnAttributeChange(){return!1}render(){this.setContent(`
|
|
32
|
-
<style>${E}</style>
|
|
33
|
-
<div class="group" part="group">
|
|
34
|
-
<slot></slot>
|
|
35
|
-
</div>
|
|
36
|
-
`)}}function M(o,e){const t=o.getAttribute(e);if(t==null)return!1;const i=String(t).trim().toLowerCase();return i!=="false"&&i!=="0"}typeof customElements<"u"&&!customElements.get("ui-panel-group")&&customElements.define("ui-panel-group",A);exports.UIPanelGroup=A;exports.normalizePanelLayout=p;exports.resizePanelPair=L;
|
package/dist/portal-c69756c0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const H=require("./positioner-33529bb8.js");function M(a="ui-portal-root"){if(typeof document>"u")return null;let e=document.getElementById(a);return e||(e=document.createElement("div"),e.id=a,e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="0",e.style.pointerEvents="none",e.style.zIndex="var(--ui-portal-z, 1600)",document.body.appendChild(e)),e.style.zIndex||(e.style.zIndex="var(--ui-portal-z, 1600)"),e}function C(a,e,i="top"){var u,P,h,l;const t=typeof i=="string"?{placement:i}:i,c=e instanceof HTMLElement?e:typeof e.getBoundingClientRect=="function"?e.getBoundingClientRect():e,n=H.computePositionState(a,c,{placement:t.placement||"top",strategy:t.strategy||"fixed",offset:typeof t.offset=="number"?t.offset:8,flip:t.flip,shift:t.shift,arrow:t.arrow??null,boundary:t.boundary??null,boundaryPadding:t.boundaryPadding,dir:t.dir,autoPlacement:t.autoPlacement,allowedPlacements:t.allowedPlacements,fallbackPlacements:t.fallbackPlacements,inline:t.inline,hideWhenDetached:t.hideWhenDetached}),s=a.getBoundingClientRect(),w=((P=(u=n.middlewareData)==null?void 0:u.arrow)==null?void 0:P.x)??Math.round(s.left+s.width/2-n.x),b=((l=(h=n.middlewareData)==null?void 0:h.arrow)==null?void 0:l.y)??Math.round(s.top+s.height/2-n.y);return{top:n.y,left:n.x,placement:n.placement,x:w,y:b,strategy:n.strategy,availableWidth:n.availableWidth,availableHeight:n.availableHeight,middlewareData:n.middlewareData,referenceHidden:n.referenceHidden,escaped:n.escaped}}function W(a,e,i,t={}){return H.autoUpdatePositioner(a,e,i,t)}function D(a,e,i="top"){const t=typeof i=="string"?{placement:i}:i,c=t.placement||"top",n=typeof t.offset=="number"?t.offset:8,s=t.flip!==!1,w=!!t.shift,b=M();if(!b)return;e.style.position="absolute",e.style.pointerEvents="auto",b.appendChild(e);let u=()=>{};function P(l,x,p){const o=t.arrow||e.querySelector(".arrow");if(!o)return;const r=a.getBoundingClientRect(),d=r.left+r.width/2,v=r.top+r.height/2;if(p==="top"||p==="bottom"){const m=d-x,y=8,f=e.offsetWidth-8,g=Math.max(y,Math.min(f,m));o.style.left=`${Math.round(g)}px`,o.style.top=""}else{const m=v-l,y=8,f=e.offsetHeight-8,g=Math.max(y,Math.min(f,m));o.style.top=`${Math.round(g)}px`,o.style.left=""}}function h(){var r;if(a&&typeof a.getBoundingClientRect=="function"&&a instanceof HTMLElement){const d=a,v=(r=d.getRootNode)==null?void 0:r.call(d),m=v instanceof ShadowRoot?v.host:null,y=d.isConnected||document.body.contains(d)||(m?document.body.contains(m):!1),f=window.getComputedStyle(d),g=f.display!=="none"&&f.visibility!=="hidden"&&parseFloat(f.opacity||"1")>0;if(!y||!g){try{e.parentElement&&e.parentElement.removeChild(e)}catch{}u();return}}const l=C(a,e,{placement:c,offset:n,flip:s,shift:w,strategy:t.strategy||"fixed",boundary:t.boundary??null,boundaryPadding:t.boundaryPadding,dir:t.dir,autoPlacement:t.autoPlacement,allowedPlacements:t.allowedPlacements,fallbackPlacements:t.fallbackPlacements,inline:t.inline,hideWhenDetached:t.hideWhenDetached,arrow:t.arrow??null}),x=window.innerWidth||document.documentElement.clientWidth,p=window.innerHeight||document.documentElement.clientHeight;let o=l;s&&(l.top<0&&c==="top"||l.top+e.offsetHeight>p&&c==="bottom")&&(o=C(a,e,{placement:c==="top"?"bottom":"top",offset:n,flip:s,shift:w,strategy:t.strategy||"fixed",boundary:t.boundary??null,boundaryPadding:t.boundaryPadding,dir:t.dir,autoPlacement:t.autoPlacement,allowedPlacements:t.allowedPlacements,fallbackPlacements:t.fallbackPlacements,inline:t.inline,hideWhenDetached:t.hideWhenDetached,arrow:t.arrow??null})),o.left<4&&(o.left=4),o.left+e.offsetWidth>x-4&&(o.left=x-e.offsetWidth-4),o.top<4&&(o.top=4),o.top+e.offsetHeight>p-4&&(o.top=p-e.offsetHeight-4),e.style.top=`${Math.round(o.top)}px`,e.style.left=`${Math.round(o.left)}px`,P(o.top,o.left,o.placement),e.setAttribute("data-placement",o.placement)}return h(),u=W(a,e,h),()=>{try{e.parentElement&&e.parentElement.removeChild(e)}catch{}u()}}exports.autoUpdatePosition=W;exports.computePosition=C;exports.createPortalContainer=M;exports.showPortalFor=D;
|