@editora/ui-core 0.1.19 → 0.1.21
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 +30 -29
- package/dist/color-picker.cjs.js +10 -10
- package/dist/color-picker.esm.js +190 -253
- 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-collection.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-portal.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +8 -0
- package/dist/components/ui-sortable.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-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.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 +7 -7
- package/dist/date-time-picker.esm.js +115 -147
- 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 +5 -5
- package/dist/multi-select.esm.js +125 -137
- 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 +3 -3
- package/dist/portal.esm.js +20 -28
- 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 +22 -28
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/primitives/auto-scroll.d.ts +9 -0
- package/dist/primitives/auto-scroll.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +4 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- 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/selector-BvAh35ve.js +1 -0
- package/dist/selector-WI8pD7YO.mjs +18 -0
- 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 +79 -65
- package/dist/sortable.esm.js +714 -734
- 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 +8 -8
- package/dist/tabs.esm.js +89 -109
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +49 -52
- 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 +31 -31
- package/dist/transfer-list.esm.js +114 -127
- 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
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,7 @@ const A = `
|
|
|
145
143
|
outline-color: Highlight;
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
|
-
`,
|
|
146
|
+
`, L = `
|
|
149
147
|
.ui-time-picker-overlay-host {
|
|
150
148
|
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
151
149
|
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
@@ -260,17 +258,20 @@ const A = `
|
|
|
260
258
|
}
|
|
261
259
|
}
|
|
262
260
|
`;
|
|
263
|
-
function
|
|
264
|
-
return String(
|
|
261
|
+
function _(d) {
|
|
262
|
+
return String(d).padStart(2, "0");
|
|
265
263
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
268
|
-
return i ? `${s}:${n}:${h(e)}` : `${s}:${n}`;
|
|
264
|
+
function c(d) {
|
|
265
|
+
return d.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
269
266
|
}
|
|
270
|
-
|
|
267
|
+
function m(d, t, e, i) {
|
|
268
|
+
const s = _(d), n = _(t);
|
|
269
|
+
return i ? `${s}:${n}:${_(e)}` : `${s}:${n}`;
|
|
270
|
+
}
|
|
271
|
+
class T extends E {
|
|
271
272
|
constructor() {
|
|
272
|
-
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 =
|
|
273
|
-
|
|
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();
|
|
274
275
|
};
|
|
275
276
|
}
|
|
276
277
|
static get observedAttributes() {
|
|
@@ -303,7 +304,7 @@ class L extends x {
|
|
|
303
304
|
connectedCallback() {
|
|
304
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) {
|
|
305
306
|
const t = this._normalizeCanonical(this.getAttribute("value") || this.getAttribute("default-value"));
|
|
306
|
-
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;
|
|
307
308
|
}
|
|
308
309
|
this._open && !this._isInlineMode() && this._ensureOverlay();
|
|
309
310
|
}
|
|
@@ -323,7 +324,7 @@ class L extends x {
|
|
|
323
324
|
return (this.getAttribute("mode") || "popover") === "inline";
|
|
324
325
|
}
|
|
325
326
|
_isMobileSheet() {
|
|
326
|
-
return
|
|
327
|
+
return B(this.getAttribute("mode"));
|
|
327
328
|
}
|
|
328
329
|
_isDisabled() {
|
|
329
330
|
return this.hasAttribute("disabled");
|
|
@@ -332,10 +333,10 @@ class L extends x {
|
|
|
332
333
|
return this.hasAttribute("readonly");
|
|
333
334
|
}
|
|
334
335
|
_allowInput() {
|
|
335
|
-
return
|
|
336
|
+
return b(this.getAttribute("allow-input"), !0);
|
|
336
337
|
}
|
|
337
338
|
_clearable() {
|
|
338
|
-
return
|
|
339
|
+
return b(this.getAttribute("clearable"), !0);
|
|
339
340
|
}
|
|
340
341
|
_withSeconds() {
|
|
341
342
|
return this.hasAttribute("seconds");
|
|
@@ -352,16 +353,15 @@ class L extends x {
|
|
|
352
353
|
return !Number.isFinite(t) || t < 1 ? 1 : Math.min(60, Math.trunc(t));
|
|
353
354
|
}
|
|
354
355
|
_translations() {
|
|
355
|
-
return
|
|
356
|
+
return w(
|
|
356
357
|
this.getAttribute("locale"),
|
|
357
358
|
this.getAttribute("translations")
|
|
358
359
|
);
|
|
359
360
|
}
|
|
360
361
|
_normalizeCanonical(t) {
|
|
361
|
-
if (!t)
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
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;
|
|
365
365
|
}
|
|
366
366
|
_minTime() {
|
|
367
367
|
return this._normalizeCanonical(this.getAttribute("min"));
|
|
@@ -370,7 +370,7 @@ class L extends x {
|
|
|
370
370
|
return this._normalizeCanonical(this.getAttribute("max"));
|
|
371
371
|
}
|
|
372
372
|
_formatDisplay(t) {
|
|
373
|
-
return t ? this._is12h() ?
|
|
373
|
+
return t ? this._is12h() ? O(t, this.getAttribute("locale") || "en-US") : t : "";
|
|
374
374
|
}
|
|
375
375
|
_syncOpenAttribute(t) {
|
|
376
376
|
this._syncing = !0;
|
|
@@ -400,15 +400,13 @@ class L extends x {
|
|
|
400
400
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
401
401
|
}
|
|
402
402
|
_clampToBounds(t) {
|
|
403
|
-
if (!t)
|
|
404
|
-
return null;
|
|
403
|
+
if (!t) return null;
|
|
405
404
|
const e = this._minTime(), i = this._maxTime();
|
|
406
405
|
let s = t;
|
|
407
|
-
return e &&
|
|
406
|
+
return e && y(s, e) < 0 && (s = e), i && y(s, i) > 0 && (s = i), s;
|
|
408
407
|
}
|
|
409
408
|
_commit(t, e) {
|
|
410
|
-
if (this._isDisabled() || this._isReadonly())
|
|
411
|
-
return;
|
|
409
|
+
if (this._isDisabled() || this._isReadonly()) return;
|
|
412
410
|
const i = this._clampToBounds(this._normalizeCanonical(t));
|
|
413
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();
|
|
414
412
|
}
|
|
@@ -433,42 +431,35 @@ class L extends x {
|
|
|
433
431
|
}
|
|
434
432
|
}
|
|
435
433
|
_ensureOverlay() {
|
|
436
|
-
if (this._overlay || typeof document > "u")
|
|
437
|
-
return;
|
|
434
|
+
if (this._overlay || typeof document > "u") return;
|
|
438
435
|
const t = document.createElement("div");
|
|
439
|
-
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 =
|
|
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());
|
|
440
437
|
}
|
|
441
438
|
_syncOverlayHostZIndex() {
|
|
442
|
-
if (!this._overlay || typeof window > "u")
|
|
443
|
-
return;
|
|
439
|
+
if (!this._overlay || typeof window > "u") return;
|
|
444
440
|
const t = window.getComputedStyle(this).getPropertyValue("--ui-dp-z").trim();
|
|
445
441
|
this._overlay.style.zIndex = t || "1600";
|
|
446
442
|
}
|
|
447
443
|
_destroyOverlay() {
|
|
448
|
-
|
|
449
|
-
(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));
|
|
450
445
|
}
|
|
451
446
|
_syncDismissableLayer() {
|
|
452
|
-
|
|
453
|
-
if ((e = this._dismissableLayer) == null || e.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
|
|
454
|
-
return;
|
|
447
|
+
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
455
448
|
const t = this._overlay.querySelector(".panel, .sheet");
|
|
456
|
-
t && (this._dismissableLayer =
|
|
449
|
+
t && (this._dismissableLayer = k({
|
|
457
450
|
node: t,
|
|
458
451
|
trigger: this._fieldEl,
|
|
459
452
|
closeOnEscape: !0,
|
|
460
453
|
closeOnPointerOutside: !0,
|
|
461
454
|
closeOnFocusOutside: !1,
|
|
462
|
-
onBeforeDismiss: (
|
|
455
|
+
onBeforeDismiss: (e) => e === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (e === "outside-pointer" && this._setOpen(!1, "outside"), !1)
|
|
463
456
|
}));
|
|
464
457
|
}
|
|
465
458
|
_positionOverlay() {
|
|
466
|
-
if (!this._overlay || !this._open || this._isMobileSheet())
|
|
467
|
-
return;
|
|
459
|
+
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
468
460
|
const t = this._fieldEl, e = this._overlay.querySelector(".panel");
|
|
469
|
-
if (!t || !e)
|
|
470
|
-
|
|
471
|
-
const i = e.getAttribute("data-placement"), s = I(
|
|
461
|
+
if (!t || !e) return;
|
|
462
|
+
const i = e.getAttribute("data-placement"), s = A(
|
|
472
463
|
t.getBoundingClientRect(),
|
|
473
464
|
e.getBoundingClientRect(),
|
|
474
465
|
8,
|
|
@@ -478,7 +469,7 @@ class L extends x {
|
|
|
478
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);
|
|
479
470
|
}
|
|
480
471
|
_timeParts(t) {
|
|
481
|
-
const e =
|
|
472
|
+
const e = f(t || "00:00") || { hours: 0, minutes: 0, seconds: 0 }, i = e.hours >= 12 ? "pm" : "am";
|
|
482
473
|
return {
|
|
483
474
|
hours: e.hours,
|
|
484
475
|
minutes: e.minutes,
|
|
@@ -487,33 +478,33 @@ class L extends x {
|
|
|
487
478
|
};
|
|
488
479
|
}
|
|
489
480
|
_buildOverlayContent(t) {
|
|
490
|
-
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 }, (
|
|
491
|
-
const u = s ?
|
|
492
|
-
return `<option value="${u}" ${u === r ? "selected" : ""}>${
|
|
493
|
-
}).join(""),
|
|
494
|
-
const u = Math.min(59,
|
|
495
|
-
return `<option value="${u}" ${u === i.minutes ? "selected" : ""}>${
|
|
496
|
-
}).join(""),
|
|
497
|
-
const u = Math.min(59,
|
|
498
|
-
return `<option value="${u}" ${u === i.seconds ? "selected" : ""}>${
|
|
499
|
-
}).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 = `
|
|
500
491
|
<div class="pickers" data-seconds="${n ? "true" : "false"}" data-ampm="${s ? "true" : "false"}">
|
|
501
|
-
<div class="picker"><label>${e.hour}</label><select data-segment="hours">${a}</select></div>
|
|
502
|
-
<div class="picker"><label>${e.minute}</label><select data-segment="minutes">${
|
|
503
|
-
${n ? `<div class="picker"><label>${e.second}</label><select data-segment="seconds">${
|
|
504
|
-
${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>` : ""}
|
|
505
496
|
</div>
|
|
506
497
|
`;
|
|
507
498
|
return `
|
|
508
|
-
<style>${
|
|
499
|
+
<style>${L}</style>
|
|
509
500
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
510
501
|
<section class="${t ? "sheet" : "panel"}" part="${t ? "sheet" : "popover"}">
|
|
511
|
-
${
|
|
502
|
+
${x}
|
|
512
503
|
<footer class="footer" part="footer">
|
|
513
|
-
<button type="button" class="action" data-action="now">${e.now}</button>
|
|
514
|
-
<button type="button" class="action" data-action="clear" part="clear">${e.clear}</button>
|
|
515
|
-
<button type="button" class="action" data-action="cancel" part="cancel">${e.cancel}</button>
|
|
516
|
-
<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>
|
|
517
508
|
</footer>
|
|
518
509
|
</section>
|
|
519
510
|
`;
|
|
@@ -529,15 +520,13 @@ class L extends x {
|
|
|
529
520
|
].join(":");
|
|
530
521
|
}
|
|
531
522
|
_ensureOverlayContent(t) {
|
|
532
|
-
if (!this._overlay)
|
|
533
|
-
return;
|
|
523
|
+
if (!this._overlay) return;
|
|
534
524
|
const e = this._overlaySignature(t);
|
|
535
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>`);
|
|
536
526
|
}
|
|
537
527
|
_setClosestOptionValue(t, e) {
|
|
538
528
|
const i = Array.from(t.options).map((r) => Number(r.value)).filter((r) => Number.isFinite(r));
|
|
539
|
-
if (!i.length)
|
|
540
|
-
return;
|
|
529
|
+
if (!i.length) return;
|
|
541
530
|
let s = i[0], n = Math.abs(s - e);
|
|
542
531
|
for (let r = 1; r < i.length; r += 1) {
|
|
543
532
|
const o = i[r], l = Math.abs(o - e);
|
|
@@ -546,8 +535,7 @@ class L extends x {
|
|
|
546
535
|
t.value = String(s);
|
|
547
536
|
}
|
|
548
537
|
_syncOverlayState() {
|
|
549
|
-
if (!this._overlay)
|
|
550
|
-
return;
|
|
538
|
+
if (!this._overlay) return;
|
|
551
539
|
this._syncOverlayHostZIndex();
|
|
552
540
|
const t = this._isMobileSheet();
|
|
553
541
|
this._ensureOverlayContent(t), this._syncDismissableLayer();
|
|
@@ -564,26 +552,22 @@ class L extends x {
|
|
|
564
552
|
this._syncOverlayState();
|
|
565
553
|
}
|
|
566
554
|
_applySegmentsFromOverlay() {
|
|
567
|
-
if (!this._overlay)
|
|
568
|
-
return;
|
|
555
|
+
if (!this._overlay) return;
|
|
569
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"]');
|
|
570
|
-
if (!t || !e)
|
|
571
|
-
return;
|
|
557
|
+
if (!t || !e) return;
|
|
572
558
|
let n = Number(t.value);
|
|
573
559
|
const r = Number(e.value), o = i ? Number(i.value) : 0;
|
|
574
560
|
if (this._is12h() && s) {
|
|
575
561
|
const a = s.value === "pm" ? "pm" : "am";
|
|
576
562
|
a === "pm" && n < 12 && (n += 12), a === "am" && n === 12 && (n = 0);
|
|
577
563
|
}
|
|
578
|
-
const l =
|
|
564
|
+
const l = m(n, r, o, this._withSeconds());
|
|
579
565
|
this._pending = this._clampToBounds(l), this._emitInput("picker");
|
|
580
566
|
}
|
|
581
567
|
_onRootClick(t) {
|
|
582
|
-
var s;
|
|
583
568
|
const e = t.target;
|
|
584
|
-
if (!e)
|
|
585
|
-
|
|
586
|
-
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");
|
|
587
571
|
if (i) {
|
|
588
572
|
if (i === "toggle") {
|
|
589
573
|
this._restoreFocusEl = e, this._setOpen(!this._open, "toggle");
|
|
@@ -594,16 +578,14 @@ class L extends x {
|
|
|
594
578
|
}
|
|
595
579
|
_onRootInput(t) {
|
|
596
580
|
const e = t.target;
|
|
597
|
-
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput())
|
|
598
|
-
return;
|
|
581
|
+
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput()) return;
|
|
599
582
|
this._draft = e.value, this._inlineError = "";
|
|
600
583
|
const i = this._normalizeCanonical(e.value);
|
|
601
584
|
this._pending = i, this._emitInput("typing");
|
|
602
585
|
}
|
|
603
586
|
_onRootBlur(t) {
|
|
604
587
|
const e = t.target;
|
|
605
|
-
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput())
|
|
606
|
-
return;
|
|
588
|
+
if (!(e instanceof HTMLInputElement) || !e.classList.contains("input") || !this._allowInput()) return;
|
|
607
589
|
if (!this._draft.trim()) {
|
|
608
590
|
this._commit(null, "blur");
|
|
609
591
|
return;
|
|
@@ -616,7 +598,7 @@ class L extends x {
|
|
|
616
598
|
this._commit(i, "blur");
|
|
617
599
|
}
|
|
618
600
|
_stepBy(t) {
|
|
619
|
-
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());
|
|
620
602
|
this._pending = this._clampToBounds(o), this._emitInput("keyboard-step"), this._updateHostState();
|
|
621
603
|
}
|
|
622
604
|
_onRootKeyDown(t) {
|
|
@@ -648,11 +630,9 @@ class L extends x {
|
|
|
648
630
|
}
|
|
649
631
|
}
|
|
650
632
|
_onOverlayClick(t) {
|
|
651
|
-
var s;
|
|
652
633
|
const e = t.target;
|
|
653
|
-
if (!e)
|
|
654
|
-
|
|
655
|
-
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");
|
|
656
636
|
if (i) {
|
|
657
637
|
if (i === "backdrop") {
|
|
658
638
|
this._setOpen(!1, "outside");
|
|
@@ -667,8 +647,8 @@ class L extends x {
|
|
|
667
647
|
return;
|
|
668
648
|
}
|
|
669
649
|
if (i === "now") {
|
|
670
|
-
const
|
|
671
|
-
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();
|
|
672
652
|
return;
|
|
673
653
|
}
|
|
674
654
|
i === "apply" && (this._commit(this._pending, "apply"), this._setOpen(!1, "apply"));
|
|
@@ -679,8 +659,7 @@ class L extends x {
|
|
|
679
659
|
e instanceof HTMLSelectElement && e.matches("select[data-segment]") && this._applySegmentsFromOverlay();
|
|
680
660
|
}
|
|
681
661
|
_onDocumentPointerDown(t) {
|
|
682
|
-
if (!this._open || !this._overlay)
|
|
683
|
-
return;
|
|
662
|
+
if (!this._open || !this._overlay) return;
|
|
684
663
|
const e = t.composedPath();
|
|
685
664
|
e.includes(this) || e.includes(this._overlay) || this._setOpen(!1, "outside");
|
|
686
665
|
}
|
|
@@ -691,24 +670,23 @@ class L extends x {
|
|
|
691
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");
|
|
692
671
|
}
|
|
693
672
|
_updateHostState() {
|
|
694
|
-
if (!this._hasView)
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
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();
|
|
698
676
|
}
|
|
699
677
|
render() {
|
|
700
678
|
this._hasView || (this.setContent(`
|
|
701
|
-
<style>${
|
|
679
|
+
<style>${z}</style>
|
|
702
680
|
<div class="root">
|
|
703
681
|
<label class="label" part="label">
|
|
704
682
|
<span class="label-text"></span>
|
|
705
683
|
<span class="required">*</span>
|
|
706
684
|
</label>
|
|
707
685
|
<div class="field" part="field input">
|
|
708
|
-
<span class="icon" part="icon">${
|
|
686
|
+
<span class="icon" part="icon">${D}</span>
|
|
709
687
|
<input class="input" part="input" />
|
|
710
|
-
<button type="button" class="btn" part="clear" data-action="clear">${
|
|
711
|
-
<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>
|
|
712
690
|
</div>
|
|
713
691
|
<div class="hint" part="hint"></div>
|
|
714
692
|
<div class="error" part="error" role="alert"></div>
|
|
@@ -720,7 +698,7 @@ class L extends x {
|
|
|
720
698
|
return !1;
|
|
721
699
|
}
|
|
722
700
|
}
|
|
723
|
-
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);
|
|
724
702
|
export {
|
|
725
|
-
|
|
703
|
+
T as UITimePicker
|
|
726
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`
|