@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/time-picker.esm.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { E
|
|
2
|
-
import { c as
|
|
3
|
-
import { r as
|
|
4
|
-
import { r as
|
|
5
|
-
|
|
6
|
-
import "./positioner-e9770c66.mjs";
|
|
7
|
-
const A = `
|
|
1
|
+
import { E } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { c as k } from "./dismissable-layer-BmPIoK80.mjs";
|
|
3
|
+
import { r as w } from "./calendar-DLY4acgn.mjs";
|
|
4
|
+
import { r as S, e as C, i as b, s as B, q as f, t as O, w as y, l as I, c as A } from "./date-time-utils-y1N2gvG2.mjs";
|
|
5
|
+
const D = `
|
|
8
6
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
9
7
|
<path d="M10 2.4a7.6 7.6 0 1 1 0 15.2A7.6 7.6 0 0 1 10 2.4Zm0 1.4a6.2 6.2 0 1 0 0 12.4 6.2 6.2 0 0 0 0-12.4Zm.7 2.4a.7.7 0 0 0-1.4 0v4.1c0 .2.1.4.2.5l2.6 2.5a.7.7 0 1 0 1-1l-2.4-2.3v-3.8Z" fill="currentColor"/>
|
|
10
8
|
</svg>
|
|
11
|
-
`,
|
|
9
|
+
`, $ = `
|
|
12
10
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
13
11
|
<path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
|
14
12
|
</svg>
|
|
15
|
-
`,
|
|
13
|
+
`, M = `
|
|
16
14
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
17
15
|
<path d="m5.6 7.6 4.4 4.6 4.4-4.6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
18
16
|
</svg>
|
|
19
|
-
`,
|
|
17
|
+
`, z = `
|
|
20
18
|
:host {
|
|
21
19
|
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
22
20
|
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
@@ -145,7 +143,15 @@ const A = `
|
|
|
145
143
|
outline-color: Highlight;
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
|
-
`,
|
|
146
|
+
`, L = `
|
|
147
|
+
.ui-time-picker-overlay-host {
|
|
148
|
+
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
149
|
+
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
150
|
+
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
151
|
+
--ui-dp-muted: var(--ui-color-muted, #64748b);
|
|
152
|
+
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
153
|
+
--ui-dp-radius: 12px;
|
|
154
|
+
}
|
|
149
155
|
.overlay { position: fixed; z-index: var(--ui-dp-z, 1600); pointer-events: none; }
|
|
150
156
|
.panel {
|
|
151
157
|
pointer-events: auto;
|
|
@@ -252,17 +258,20 @@ const A = `
|
|
|
252
258
|
}
|
|
253
259
|
}
|
|
254
260
|
`;
|
|
255
|
-
function
|
|
256
|
-
return String(
|
|
261
|
+
function _(d) {
|
|
262
|
+
return String(d).padStart(2, "0");
|
|
263
|
+
}
|
|
264
|
+
function c(d) {
|
|
265
|
+
return d.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
257
266
|
}
|
|
258
|
-
function
|
|
259
|
-
const s =
|
|
260
|
-
return i ? `${s}:${n}:${
|
|
267
|
+
function m(d, t, e, i) {
|
|
268
|
+
const s = _(d), n = _(t);
|
|
269
|
+
return i ? `${s}:${n}:${_(e)}` : `${s}:${n}`;
|
|
261
270
|
}
|
|
262
|
-
class
|
|
271
|
+
class T extends E {
|
|
263
272
|
constructor() {
|
|
264
|
-
super(...arguments), this._value = null, this._pending = null, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._fieldEl = null, this._labelEl = null, this._labelTextEl = null, this._requiredEl = null, this._inputEl = null, this._clearBtn = null, this._toggleBtn = null, this._hintEl = null, this._errorEl = null, this._hiddenInputEl = null, this._schedulePosition =
|
|
265
|
-
|
|
273
|
+
super(...arguments), this._value = null, this._pending = null, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._fieldEl = null, this._labelEl = null, this._labelTextEl = null, this._requiredEl = null, this._inputEl = null, this._clearBtn = null, this._toggleBtn = null, this._hintEl = null, this._errorEl = null, this._hiddenInputEl = null, this._schedulePosition = S(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
|
|
274
|
+
C(t, [this._overlay]) || this._schedulePosition.run();
|
|
266
275
|
};
|
|
267
276
|
}
|
|
268
277
|
static get observedAttributes() {
|
|
@@ -295,7 +304,7 @@ class L extends x {
|
|
|
295
304
|
connectedCallback() {
|
|
296
305
|
if (super.connectedCallback(), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("input", this._onRootInputBound), this.root.addEventListener("focusout", this._onRootBlurBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), this._hasView && !this._inputEl && this._cacheDomRefs(), !this._isInitialized) {
|
|
297
306
|
const t = this._normalizeCanonical(this.getAttribute("value") || this.getAttribute("default-value"));
|
|
298
|
-
this._value = t, this._pending = t, this._draft = this._formatDisplay(t), this._open = this.hasAttribute("open") ||
|
|
307
|
+
this._value = t, this._pending = t, this._draft = this._formatDisplay(t), this._open = this.hasAttribute("open") || b(this.getAttribute("default-open")), this._isInitialized = !0;
|
|
299
308
|
}
|
|
300
309
|
this._open && !this._isInlineMode() && this._ensureOverlay();
|
|
301
310
|
}
|
|
@@ -315,7 +324,7 @@ class L extends x {
|
|
|
315
324
|
return (this.getAttribute("mode") || "popover") === "inline";
|
|
316
325
|
}
|
|
317
326
|
_isMobileSheet() {
|
|
318
|
-
return
|
|
327
|
+
return B(this.getAttribute("mode"));
|
|
319
328
|
}
|
|
320
329
|
_isDisabled() {
|
|
321
330
|
return this.hasAttribute("disabled");
|
|
@@ -324,10 +333,10 @@ class L extends x {
|
|
|
324
333
|
return this.hasAttribute("readonly");
|
|
325
334
|
}
|
|
326
335
|
_allowInput() {
|
|
327
|
-
return
|
|
336
|
+
return b(this.getAttribute("allow-input"), !0);
|
|
328
337
|
}
|
|
329
338
|
_clearable() {
|
|
330
|
-
return
|
|
339
|
+
return b(this.getAttribute("clearable"), !0);
|
|
331
340
|
}
|
|
332
341
|
_withSeconds() {
|
|
333
342
|
return this.hasAttribute("seconds");
|
|
@@ -344,16 +353,15 @@ class L extends x {
|
|
|
344
353
|
return !Number.isFinite(t) || t < 1 ? 1 : Math.min(60, Math.trunc(t));
|
|
345
354
|
}
|
|
346
355
|
_translations() {
|
|
347
|
-
return
|
|
356
|
+
return w(
|
|
348
357
|
this.getAttribute("locale"),
|
|
349
358
|
this.getAttribute("translations")
|
|
350
359
|
);
|
|
351
360
|
}
|
|
352
361
|
_normalizeCanonical(t) {
|
|
353
|
-
if (!t)
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return e ? _(e.hours, e.minutes, e.seconds, this._withSeconds()) : null;
|
|
362
|
+
if (!t) return null;
|
|
363
|
+
const e = f(t);
|
|
364
|
+
return e ? m(e.hours, e.minutes, e.seconds, this._withSeconds()) : null;
|
|
357
365
|
}
|
|
358
366
|
_minTime() {
|
|
359
367
|
return this._normalizeCanonical(this.getAttribute("min"));
|
|
@@ -362,7 +370,7 @@ class L extends x {
|
|
|
362
370
|
return this._normalizeCanonical(this.getAttribute("max"));
|
|
363
371
|
}
|
|
364
372
|
_formatDisplay(t) {
|
|
365
|
-
return t ? this._is12h() ?
|
|
373
|
+
return t ? this._is12h() ? O(t, this.getAttribute("locale") || "en-US") : t : "";
|
|
366
374
|
}
|
|
367
375
|
_syncOpenAttribute(t) {
|
|
368
376
|
this._syncing = !0;
|
|
@@ -392,15 +400,13 @@ class L extends x {
|
|
|
392
400
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
393
401
|
}
|
|
394
402
|
_clampToBounds(t) {
|
|
395
|
-
if (!t)
|
|
396
|
-
return null;
|
|
403
|
+
if (!t) return null;
|
|
397
404
|
const e = this._minTime(), i = this._maxTime();
|
|
398
405
|
let s = t;
|
|
399
|
-
return e &&
|
|
406
|
+
return e && y(s, e) < 0 && (s = e), i && y(s, i) > 0 && (s = i), s;
|
|
400
407
|
}
|
|
401
408
|
_commit(t, e) {
|
|
402
|
-
if (this._isDisabled() || this._isReadonly())
|
|
403
|
-
return;
|
|
409
|
+
if (this._isDisabled() || this._isReadonly()) return;
|
|
404
410
|
const i = this._clampToBounds(this._normalizeCanonical(t));
|
|
405
411
|
this._value = i, this._pending = i, this._draft = this._formatDisplay(i), this._inlineError = "", this._syncValueAttribute(i), this._emitInput(e), this._emitChange(e), this._updateHostState();
|
|
406
412
|
}
|
|
@@ -425,42 +431,35 @@ class L extends x {
|
|
|
425
431
|
}
|
|
426
432
|
}
|
|
427
433
|
_ensureOverlay() {
|
|
428
|
-
if (this._overlay || typeof document > "u")
|
|
429
|
-
return;
|
|
434
|
+
if (this._overlay || typeof document > "u") return;
|
|
430
435
|
const t = document.createElement("div");
|
|
431
|
-
t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock =
|
|
436
|
+
t.className = "ui-time-picker-overlay-host", t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock = I());
|
|
432
437
|
}
|
|
433
438
|
_syncOverlayHostZIndex() {
|
|
434
|
-
if (!this._overlay || typeof window > "u")
|
|
435
|
-
return;
|
|
439
|
+
if (!this._overlay || typeof window > "u") return;
|
|
436
440
|
const t = window.getComputedStyle(this).getPropertyValue("--ui-dp-z").trim();
|
|
437
441
|
this._overlay.style.zIndex = t || "1600";
|
|
438
442
|
}
|
|
439
443
|
_destroyOverlay() {
|
|
440
|
-
|
|
441
|
-
(t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
|
|
444
|
+
this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
|
|
442
445
|
}
|
|
443
446
|
_syncDismissableLayer() {
|
|
444
|
-
|
|
445
|
-
if ((e = this._dismissableLayer) == null || e.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
|
|
446
|
-
return;
|
|
447
|
+
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
447
448
|
const t = this._overlay.querySelector(".panel, .sheet");
|
|
448
|
-
t && (this._dismissableLayer =
|
|
449
|
+
t && (this._dismissableLayer = k({
|
|
449
450
|
node: t,
|
|
450
451
|
trigger: this._fieldEl,
|
|
451
452
|
closeOnEscape: !0,
|
|
452
453
|
closeOnPointerOutside: !0,
|
|
453
454
|
closeOnFocusOutside: !1,
|
|
454
|
-
onBeforeDismiss: (
|
|
455
|
+
onBeforeDismiss: (e) => e === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (e === "outside-pointer" && this._setOpen(!1, "outside"), !1)
|
|
455
456
|
}));
|
|
456
457
|
}
|
|
457
458
|
_positionOverlay() {
|
|
458
|
-
if (!this._overlay || !this._open || this._isMobileSheet())
|
|
459
|
-
return;
|
|
459
|
+
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
460
460
|
const t = this._fieldEl, e = this._overlay.querySelector(".panel");
|
|
461
|
-
if (!t || !e)
|
|
462
|
-
|
|
463
|
-
const i = e.getAttribute("data-placement"), s = I(
|
|
461
|
+
if (!t || !e) return;
|
|
462
|
+
const i = e.getAttribute("data-placement"), s = A(
|
|
464
463
|
t.getBoundingClientRect(),
|
|
465
464
|
e.getBoundingClientRect(),
|
|
466
465
|
8,
|
|
@@ -470,7 +469,7 @@ class L extends x {
|
|
|
470
469
|
e.style.position = "absolute", e.style.top = `${Math.round(s.top)}px`, e.style.left = `${Math.round(s.left)}px`, e.setAttribute("data-placement", s.placement);
|
|
471
470
|
}
|
|
472
471
|
_timeParts(t) {
|
|
473
|
-
const e =
|
|
472
|
+
const e = f(t || "00:00") || { hours: 0, minutes: 0, seconds: 0 }, i = e.hours >= 12 ? "pm" : "am";
|
|
474
473
|
return {
|
|
475
474
|
hours: e.hours,
|
|
476
475
|
minutes: e.minutes,
|
|
@@ -479,33 +478,33 @@ class L extends x {
|
|
|
479
478
|
};
|
|
480
479
|
}
|
|
481
480
|
_buildOverlayContent(t) {
|
|
482
|
-
const e = this._translations(), i = this._timeParts(this._pending), s = this._is12h(), n = this._withSeconds(), r = s ? i.hours % 12 || 12 : i.hours, o = this._minuteStep(), l = this._secondStep(), a = Array.from({ length: s ? 12 : 24 }, (
|
|
483
|
-
const u = s ?
|
|
484
|
-
return `<option value="${u}" ${u === r ? "selected" : ""}>${
|
|
485
|
-
}).join(""),
|
|
486
|
-
const u = Math.min(59,
|
|
487
|
-
return `<option value="${u}" ${u === i.minutes ? "selected" : ""}>${
|
|
488
|
-
}).join(""),
|
|
489
|
-
const u = Math.min(59,
|
|
490
|
-
return `<option value="${u}" ${u === i.seconds ? "selected" : ""}>${
|
|
491
|
-
}).join(""),
|
|
481
|
+
const e = this._translations(), i = this._timeParts(this._pending), s = this._is12h(), n = this._withSeconds(), r = s ? i.hours % 12 || 12 : i.hours, o = this._minuteStep(), l = this._secondStep(), a = Array.from({ length: s ? 12 : 24 }, (v, p) => {
|
|
482
|
+
const u = s ? p + 1 : p;
|
|
483
|
+
return `<option value="${u}" ${u === r ? "selected" : ""}>${_(u)}</option>`;
|
|
484
|
+
}).join(""), h = Array.from({ length: Math.ceil(60 / o) }, (v, p) => {
|
|
485
|
+
const u = Math.min(59, p * o);
|
|
486
|
+
return `<option value="${u}" ${u === i.minutes ? "selected" : ""}>${_(u)}</option>`;
|
|
487
|
+
}).join(""), g = Array.from({ length: Math.ceil(60 / l) }, (v, p) => {
|
|
488
|
+
const u = Math.min(59, p * l);
|
|
489
|
+
return `<option value="${u}" ${u === i.seconds ? "selected" : ""}>${_(u)}</option>`;
|
|
490
|
+
}).join(""), x = `
|
|
492
491
|
<div class="pickers" data-seconds="${n ? "true" : "false"}" data-ampm="${s ? "true" : "false"}">
|
|
493
|
-
<div class="picker"><label>${e.hour}</label><select data-segment="hours">${a}</select></div>
|
|
494
|
-
<div class="picker"><label>${e.minute}</label><select data-segment="minutes">${
|
|
495
|
-
${n ? `<div class="picker"><label>${e.second}</label><select data-segment="seconds">${
|
|
496
|
-
${s ? `<div class="picker"><label>${e.meridiem}</label><select data-segment="meridiem"><option value="am" ${i.meridiem === "am" ? "selected" : ""}>${e.am}</option><option value="pm" ${i.meridiem === "pm" ? "selected" : ""}>${e.pm}</option></select></div>` : ""}
|
|
492
|
+
<div class="picker"><label>${c(e.hour)}</label><select data-segment="hours">${a}</select></div>
|
|
493
|
+
<div class="picker"><label>${c(e.minute)}</label><select data-segment="minutes">${h}</select></div>
|
|
494
|
+
${n ? `<div class="picker"><label>${c(e.second)}</label><select data-segment="seconds">${g}</select></div>` : ""}
|
|
495
|
+
${s ? `<div class="picker"><label>${c(e.meridiem)}</label><select data-segment="meridiem"><option value="am" ${i.meridiem === "am" ? "selected" : ""}>${c(e.am)}</option><option value="pm" ${i.meridiem === "pm" ? "selected" : ""}>${c(e.pm)}</option></select></div>` : ""}
|
|
497
496
|
</div>
|
|
498
497
|
`;
|
|
499
498
|
return `
|
|
500
|
-
<style>${
|
|
499
|
+
<style>${L}</style>
|
|
501
500
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
502
501
|
<section class="${t ? "sheet" : "panel"}" part="${t ? "sheet" : "popover"}">
|
|
503
|
-
${
|
|
502
|
+
${x}
|
|
504
503
|
<footer class="footer" part="footer">
|
|
505
|
-
<button type="button" class="action" data-action="now">${e.now}</button>
|
|
506
|
-
<button type="button" class="action" data-action="clear" part="clear">${e.clear}</button>
|
|
507
|
-
<button type="button" class="action" data-action="cancel" part="cancel">${e.cancel}</button>
|
|
508
|
-
<button type="button" class="action" data-action="apply" data-tone="primary" part="apply">${e.apply}</button>
|
|
504
|
+
<button type="button" class="action" data-action="now">${c(e.now)}</button>
|
|
505
|
+
<button type="button" class="action" data-action="clear" part="clear">${c(e.clear)}</button>
|
|
506
|
+
<button type="button" class="action" data-action="cancel" part="cancel">${c(e.cancel)}</button>
|
|
507
|
+
<button type="button" class="action" data-action="apply" data-tone="primary" part="apply">${c(e.apply)}</button>
|
|
509
508
|
</footer>
|
|
510
509
|
</section>
|
|
511
510
|
`;
|
|
@@ -521,15 +520,13 @@ class L extends x {
|
|
|
521
520
|
].join(":");
|
|
522
521
|
}
|
|
523
522
|
_ensureOverlayContent(t) {
|
|
524
|
-
if (!this._overlay)
|
|
525
|
-
return;
|
|
523
|
+
if (!this._overlay) return;
|
|
526
524
|
const e = this._overlaySignature(t);
|
|
527
525
|
this._overlayKey !== e && (this._overlayKey = e, this._overlay.innerHTML = t ? `<div class="sheet-wrap">${this._buildOverlayContent(!0)}</div>` : `<div class="overlay">${this._buildOverlayContent(!1)}</div>`);
|
|
528
526
|
}
|
|
529
527
|
_setClosestOptionValue(t, e) {
|
|
530
528
|
const i = Array.from(t.options).map((r) => Number(r.value)).filter((r) => Number.isFinite(r));
|
|
531
|
-
if (!i.length)
|
|
532
|
-
return;
|
|
529
|
+
if (!i.length) return;
|
|
533
530
|
let s = i[0], n = Math.abs(s - e);
|
|
534
531
|
for (let r = 1; r < i.length; r += 1) {
|
|
535
532
|
const o = i[r], l = Math.abs(o - e);
|
|
@@ -538,8 +535,7 @@ class L extends x {
|
|
|
538
535
|
t.value = String(s);
|
|
539
536
|
}
|
|
540
537
|
_syncOverlayState() {
|
|
541
|
-
if (!this._overlay)
|
|
542
|
-
return;
|
|
538
|
+
if (!this._overlay) return;
|
|
543
539
|
this._syncOverlayHostZIndex();
|
|
544
540
|
const t = this._isMobileSheet();
|
|
545
541
|
this._ensureOverlayContent(t), this._syncDismissableLayer();
|
|
@@ -556,26 +552,22 @@ class L extends x {
|
|
|
556
552
|
this._syncOverlayState();
|
|
557
553
|
}
|
|
558
554
|
_applySegmentsFromOverlay() {
|
|
559
|
-
if (!this._overlay)
|
|
560
|
-
return;
|
|
555
|
+
if (!this._overlay) return;
|
|
561
556
|
const t = this._overlay.querySelector('select[data-segment="hours"]'), e = this._overlay.querySelector('select[data-segment="minutes"]'), i = this._overlay.querySelector('select[data-segment="seconds"]'), s = this._overlay.querySelector('select[data-segment="meridiem"]');
|
|
562
|
-
if (!t || !e)
|
|
563
|
-
return;
|
|
557
|
+
if (!t || !e) return;
|
|
564
558
|
let n = Number(t.value);
|
|
565
559
|
const r = Number(e.value), o = i ? Number(i.value) : 0;
|
|
566
560
|
if (this._is12h() && s) {
|
|
567
561
|
const a = s.value === "pm" ? "pm" : "am";
|
|
568
562
|
a === "pm" && n < 12 && (n += 12), a === "am" && n === 12 && (n = 0);
|
|
569
563
|
}
|
|
570
|
-
const l =
|
|
564
|
+
const l = m(n, r, o, this._withSeconds());
|
|
571
565
|
this._pending = this._clampToBounds(l), this._emitInput("picker");
|
|
572
566
|
}
|
|
573
567
|
_onRootClick(t) {
|
|
574
|
-
var s;
|
|
575
568
|
const e = t.target;
|
|
576
|
-
if (!e)
|
|
577
|
-
|
|
578
|
-
const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
|
|
569
|
+
if (!e) return;
|
|
570
|
+
const i = e.closest("[data-action]")?.getAttribute("data-action");
|
|
579
571
|
if (i) {
|
|
580
572
|
if (i === "toggle") {
|
|
581
573
|
this._restoreFocusEl = e, this._setOpen(!this._open, "toggle");
|
|
@@ -586,16 +578,14 @@ class L extends x {
|
|
|
586
578
|
}
|
|
587
579
|
_onRootInput(t) {
|
|
588
580
|
const e = t.target;
|
|
589
|
-
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput())
|
|
590
|
-
return;
|
|
581
|
+
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput()) return;
|
|
591
582
|
this._draft = e.value, this._inlineError = "";
|
|
592
583
|
const i = this._normalizeCanonical(e.value);
|
|
593
584
|
this._pending = i, this._emitInput("typing");
|
|
594
585
|
}
|
|
595
586
|
_onRootBlur(t) {
|
|
596
587
|
const e = t.target;
|
|
597
|
-
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput())
|
|
598
|
-
return;
|
|
588
|
+
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput()) return;
|
|
599
589
|
if (!this._draft.trim()) {
|
|
600
590
|
this._commit(null, "blur");
|
|
601
591
|
return;
|
|
@@ -608,7 +598,7 @@ class L extends x {
|
|
|
608
598
|
this._commit(i, "blur");
|
|
609
599
|
}
|
|
610
600
|
_stepBy(t) {
|
|
611
|
-
const e =
|
|
601
|
+
const e = f(this._pending || this._value || "00:00") || { hours: 0, minutes: 0, seconds: 0 }, i = this._minuteStep() * t, s = ((e.hours * 60 + e.minutes + i) % 1440 + 1440) % 1440, n = Math.floor(s / 60), r = s % 60, o = m(n, r, e.seconds, this._withSeconds());
|
|
612
602
|
this._pending = this._clampToBounds(o), this._emitInput("keyboard-step"), this._updateHostState();
|
|
613
603
|
}
|
|
614
604
|
_onRootKeyDown(t) {
|
|
@@ -640,11 +630,9 @@ class L extends x {
|
|
|
640
630
|
}
|
|
641
631
|
}
|
|
642
632
|
_onOverlayClick(t) {
|
|
643
|
-
var s;
|
|
644
633
|
const e = t.target;
|
|
645
|
-
if (!e)
|
|
646
|
-
|
|
647
|
-
const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
|
|
634
|
+
if (!e) return;
|
|
635
|
+
const i = e.closest("[data-action]")?.getAttribute("data-action");
|
|
648
636
|
if (i) {
|
|
649
637
|
if (i === "backdrop") {
|
|
650
638
|
this._setOpen(!1, "outside");
|
|
@@ -659,8 +647,8 @@ class L extends x {
|
|
|
659
647
|
return;
|
|
660
648
|
}
|
|
661
649
|
if (i === "now") {
|
|
662
|
-
const
|
|
663
|
-
this._pending = this._clampToBounds(
|
|
650
|
+
const s = /* @__PURE__ */ new Date(), n = m(s.getHours(), s.getMinutes(), s.getSeconds(), this._withSeconds());
|
|
651
|
+
this._pending = this._clampToBounds(n), this._emitInput("now"), this._renderOverlay();
|
|
664
652
|
return;
|
|
665
653
|
}
|
|
666
654
|
i === "apply" && (this._commit(this._pending, "apply"), this._setOpen(!1, "apply"));
|
|
@@ -671,8 +659,7 @@ class L extends x {
|
|
|
671
659
|
e instanceof HTMLSelectElement && e.matches("select[data-segment]") && this._applySegmentsFromOverlay();
|
|
672
660
|
}
|
|
673
661
|
_onDocumentPointerDown(t) {
|
|
674
|
-
if (!this._open || !this._overlay)
|
|
675
|
-
return;
|
|
662
|
+
if (!this._open || !this._overlay) return;
|
|
676
663
|
const e = t.composedPath();
|
|
677
664
|
e.includes(this) || e.includes(this._overlay) || this._setOpen(!1, "outside");
|
|
678
665
|
}
|
|
@@ -683,24 +670,23 @@ class L extends x {
|
|
|
683
670
|
this._labelEl = this.root.querySelector(".label"), this._labelTextEl = this.root.querySelector(".label-text"), this._requiredEl = this.root.querySelector(".required"), this._fieldEl = this.root.querySelector(".field"), this._inputEl = this.root.querySelector(".input"), this._clearBtn = this.root.querySelector('.btn[data-action="clear"]'), this._toggleBtn = this.root.querySelector('.btn[data-action="toggle"]'), this._hintEl = this.root.querySelector(".hint"), this._errorEl = this.root.querySelector(".error"), this._hiddenInputEl = this.root.querySelector(".hidden-input");
|
|
684
671
|
}
|
|
685
672
|
_updateHostState() {
|
|
686
|
-
if (!this._hasView)
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
this._labelEl && (this._labelEl.hidden = !t), this._labelTextEl && (this._labelTextEl.textContent = t), this._requiredEl && (this._requiredEl.hidden = !this.hasAttribute("required")), this._inputEl && (this._inputEl.value !== o && (this._inputEl.value = o), this._inputEl.placeholder = this._withSeconds() ? d.timePlaceholderSeconds : d.timePlaceholder, this._inputEl.readOnly = !this._allowInput() || this._isReadonly(), this._inputEl.disabled = a, this._inputEl.required = this.hasAttribute("required")), this._clearBtn && (this._clearBtn.hidden = !(this._clearable() && n), this._clearBtn.disabled = a || this._isReadonly(), this._clearBtn.setAttribute("aria-label", d.clear)), this._toggleBtn && (this._toggleBtn.hidden = l, this._toggleBtn.disabled = a || this._isReadonly(), this._toggleBtn.setAttribute("aria-label", d.toggleCalendar)), this._hintEl && (this._hintEl.hidden = !e, this._hintEl.textContent = e), this._errorEl && (this._errorEl.hidden = !s, this._errorEl.textContent = s), this._hiddenInputEl && (this._hiddenInputEl.disabled = !r, this._hiddenInputEl.name = r, this._hiddenInputEl.value = this._value || ""), !l && this._open && this._syncOverlayState();
|
|
673
|
+
if (!this._hasView) return;
|
|
674
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", s = this._inlineError || i, n = !!this._value, r = this.getAttribute("name") || "", o = this._allowInput() ? this._draft : this._formatDisplay(this._value), l = this._isInlineMode(), a = this._isDisabled(), h = this._translations();
|
|
675
|
+
this._labelEl && (this._labelEl.hidden = !t), this._labelTextEl && (this._labelTextEl.textContent = t), this._requiredEl && (this._requiredEl.hidden = !this.hasAttribute("required")), this._inputEl && (this._inputEl.value !== o && (this._inputEl.value = o), this._inputEl.placeholder = this._withSeconds() ? h.timePlaceholderSeconds : h.timePlaceholder, this._inputEl.readOnly = !this._allowInput() || this._isReadonly(), this._inputEl.disabled = a, this._inputEl.required = this.hasAttribute("required")), this._clearBtn && (this._clearBtn.hidden = !(this._clearable() && n), this._clearBtn.disabled = a || this._isReadonly(), this._clearBtn.setAttribute("aria-label", h.clear)), this._toggleBtn && (this._toggleBtn.hidden = l, this._toggleBtn.disabled = a || this._isReadonly(), this._toggleBtn.setAttribute("aria-label", h.toggleCalendar)), this._hintEl && (this._hintEl.hidden = !e, this._hintEl.textContent = e), this._errorEl && (this._errorEl.hidden = !s, this._errorEl.textContent = s), this._hiddenInputEl && (this._hiddenInputEl.disabled = !r, this._hiddenInputEl.name = r, this._hiddenInputEl.value = this._value || ""), !l && this._open && this._syncOverlayState();
|
|
690
676
|
}
|
|
691
677
|
render() {
|
|
692
678
|
this._hasView || (this.setContent(`
|
|
693
|
-
<style>${
|
|
679
|
+
<style>${z}</style>
|
|
694
680
|
<div class="root">
|
|
695
681
|
<label class="label" part="label">
|
|
696
682
|
<span class="label-text"></span>
|
|
697
683
|
<span class="required">*</span>
|
|
698
684
|
</label>
|
|
699
685
|
<div class="field" part="field input">
|
|
700
|
-
<span class="icon" part="icon">${
|
|
686
|
+
<span class="icon" part="icon">${D}</span>
|
|
701
687
|
<input class="input" part="input" />
|
|
702
|
-
<button type="button" class="btn" part="clear" data-action="clear">${
|
|
703
|
-
<button type="button" class="btn" part="toggle" data-action="toggle">${
|
|
688
|
+
<button type="button" class="btn" part="clear" data-action="clear">${$}</button>
|
|
689
|
+
<button type="button" class="btn" part="toggle" data-action="toggle">${M}</button>
|
|
704
690
|
</div>
|
|
705
691
|
<div class="hint" part="hint"></div>
|
|
706
692
|
<div class="error" part="error" role="alert"></div>
|
|
@@ -712,7 +698,7 @@ class L extends x {
|
|
|
712
698
|
return !1;
|
|
713
699
|
}
|
|
714
700
|
}
|
|
715
|
-
typeof customElements < "u" && !customElements.get("ui-time-picker") && customElements.define("ui-time-picker",
|
|
701
|
+
typeof customElements < "u" && !customElements.get("ui-time-picker") && customElements.define("ui-time-picker", T);
|
|
716
702
|
export {
|
|
717
|
-
|
|
703
|
+
T as UITimePicker
|
|
718
704
|
};
|
package/dist/timeline.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),m=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-timeline-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 95%, transparent);
|
|
4
4
|
--ui-timeline-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
|
package/dist/timeline.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as c } from "./ElementBase-
|
|
1
|
+
import { E as c } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const d = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-timeline-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 95%, transparent);
|
|
@@ -193,13 +193,11 @@ function a(n) {
|
|
|
193
193
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
194
194
|
}
|
|
195
195
|
function m(n) {
|
|
196
|
-
if (!n)
|
|
197
|
-
return [];
|
|
196
|
+
if (!n) return [];
|
|
198
197
|
try {
|
|
199
198
|
const t = JSON.parse(n);
|
|
200
199
|
return Array.isArray(t) ? t.map((e) => {
|
|
201
|
-
if (!e || typeof e != "object")
|
|
202
|
-
return null;
|
|
200
|
+
if (!e || typeof e != "object") return null;
|
|
203
201
|
const r = String(e.title || "").trim();
|
|
204
202
|
return r ? {
|
|
205
203
|
title: r,
|
package/dist/toast.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-EV6mVBUV.js"),c=3200,d=170,h=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
color-scheme: light dark;
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
border: 1px solid CanvasText;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
`;let p=0;function m(
|
|
213
|
+
`;let p=0;function m(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function g(i){const t=String(i||"").toLowerCase();return t==="success"||t==="warning"||t==="error"||t==="loading"||t==="neutral"?t:"info"}function f(i){const t=Number(i);return Number.isFinite(t)?Math.max(0,Math.trunc(t)):c}function b(i){const t=String(i||"polite").toLowerCase();return t==="off"||t==="assertive"?t:"polite"}class l extends u.ElementBase{constructor(){super(),this._toasts=[],this._timerMap=new Map,this._exitMap=new Map,this._onRootClick=this._handleRootClick.bind(this),this._onRootMouseEnter=this._handleRootMouseEnter.bind(this),this._onRootMouseLeave=this._handleRootMouseLeave.bind(this),this._onRootFocusIn=this._handleRootFocusIn.bind(this),this._onRootFocusOut=this._handleRootFocusOut.bind(this)}static get observedAttributes(){return["headless","position","max-visible"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-live","polite"),this.setAttribute("role","region"),this.root.addEventListener("click",this._onRootClick),this.root.addEventListener("mouseenter",this._onRootMouseEnter,!0),this.root.addEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.addEventListener("focusin",this._onRootFocusIn),this.root.addEventListener("focusout",this._onRootFocusOut)}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this.root.removeEventListener("mouseenter",this._onRootMouseEnter,!0),this.root.removeEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.removeEventListener("focusin",this._onRootFocusIn),this.root.removeEventListener("focusout",this._onRootFocusOut),this._clearAllTimers(),super.disconnectedCallback()}get headless(){return this.hasAttribute("headless")}set headless(t){t?this.setAttribute("headless",""):this.removeAttribute("headless")}show(t,e={}){const o=++p,s=g(e.type),a=f(e.duration),r=b(e.ariaLive),n={id:o,message:String(t??""),duration:a,tone:s,ariaLive:r,createdAt:Date.now(),closing:!1};return this._toasts.push(n),this._trimVisibleToasts(),this.requestRender(),this.dispatchEvent(new CustomEvent("show",{detail:{id:o,message:n.message,type:s},bubbles:!0})),this._scheduleAutoHide(o,a),o}hide(t){const e=this._toasts.find(a=>a.id===t);if(!e||e.closing)return;e.closing=!0,this._clearToastTimer(t),this.requestRender();const o=this._exitMap.get(t);o&&clearTimeout(o);const s=setTimeout(()=>{this._exitMap.delete(t);const a=this._toasts.length;this._toasts=this._toasts.filter(r=>r.id!==t),this._toasts.length!==a&&(this.requestRender(),this.dispatchEvent(new CustomEvent("hide",{detail:{id:t},bubbles:!0})))},d);this._exitMap.set(t,s)}_maxVisible(){const t=Number(this.getAttribute("max-visible"));return Number.isFinite(t)?Math.max(1,Math.trunc(t)):5}_trimVisibleToasts(){const t=this._toasts.filter(s=>!s.closing),e=this._maxVisible();if(t.length<=e)return;[...t].sort((s,a)=>s.createdAt-a.createdAt).slice(0,t.length-e).forEach(s=>this.hide(s.id))}_scheduleAutoHide(t,e){if(this._clearToastTimer(t),e<=0)return;const o=Date.now(),s=setTimeout(()=>{this._timerMap.delete(t),this.hide(t)},e);this._timerMap.set(t,{timeout:s,startedAt:o,remaining:e,paused:!1})}_pauseToast(t){const e=this._timerMap.get(t);if(!e||e.paused)return;clearTimeout(e.timeout);const o=Date.now()-e.startedAt;e.remaining=Math.max(0,e.remaining-o),e.paused=!0,this._timerMap.set(t,e)}_resumeToast(t){const e=this._timerMap.get(t);if(!e||!e.paused)return;const o=Math.max(0,e.remaining);this._scheduleAutoHide(t,o)}_clearToastTimer(t){const e=this._timerMap.get(t);e&&(clearTimeout(e.timeout),this._timerMap.delete(t));const o=this._exitMap.get(t);o&&(clearTimeout(o),this._exitMap.delete(t))}_clearAllTimers(){for(const t of this._timerMap.values())clearTimeout(t.timeout);this._timerMap.clear();for(const t of this._exitMap.values())clearTimeout(t);this._exitMap.clear()}_closestToastId(t){const o=(t instanceof HTMLElement?t:null)?.closest(".toast[data-toast-id]");if(!o)return null;const s=Number(o.getAttribute("data-toast-id"));return Number.isFinite(s)?s:null}_handleRootClick(t){const e=t.target;if(!e)return;const o=e.closest("button.close[data-toast-id]");if(!o)return;t.preventDefault();const s=Number(o.getAttribute("data-toast-id"));Number.isNaN(s)||this.hide(s)}_handleRootMouseEnter(t){const e=this._closestToastId(t.target);e!=null&&this._pauseToast(e)}_handleRootMouseLeave(t){const e=this._closestToastId(t.target);if(e==null)return;const o=t.target?.closest(".toast[data-toast-id]"),s=t.relatedTarget;s&&o?.contains(s)||this._resumeToast(e)}_handleRootFocusIn(t){const e=this._closestToastId(t.target);e!=null&&this._pauseToast(e)}_handleRootFocusOut(t){const e=this._closestToastId(t.target);if(e==null)return;const o=t.relatedTarget,s=t.target?.closest(".toast[data-toast-id]");o&&s?.contains(o)||this._resumeToast(e)}render(){this.setContent(`
|
|
214
214
|
<style>${h}</style>
|
|
215
215
|
<div class="toast-list" aria-live="polite" part="list">
|
|
216
216
|
${this._toasts.map(t=>{const e=t.ariaLive==="assertive"||t.tone==="error"?"alert":"status",o=t.duration>0?'<span class="meta" part="meta">Auto-dismiss</span>':'<span class="meta" part="meta">Persistent</span>';return`
|