@editora/ui-core 0.1.21 → 0.1.22
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/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +3 -3
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +6 -6
- package/dist/alert.esm.js +6 -6
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +4 -4
- package/dist/animated-text.cjs.js +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +3 -3
- package/dist/aspect-ratio.cjs.js +3 -3
- package/dist/aspect-ratio.esm.js +3 -3
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +4 -4
- package/dist/badge.esm.js +4 -4
- package/dist/block-controls.cjs.js +4 -4
- package/dist/block-controls.esm.js +4 -4
- package/dist/box.cjs.js +2 -2
- package/dist/box.esm.js +2 -2
- package/dist/breadcrumb.cjs.js +5 -5
- package/dist/breadcrumb.esm.js +5 -5
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +4 -4
- package/dist/chart.esm.js +6 -6
- package/dist/checkbox.cjs.js +2 -2
- package/dist/checkbox.esm.js +2 -2
- package/dist/collapsible.cjs.js +7 -7
- package/dist/collapsible.esm.js +7 -7
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +82 -60
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +2 -2
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.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.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +4 -4
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +5 -2
- package/dist/data-table.esm.js +145 -142
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +48 -44
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +88 -84
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +102 -98
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
- package/dist/description.cjs.js +3 -3
- package/dist/description.esm.js +3 -3
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +72 -74
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +49 -48
- package/dist/empty-state.cjs.js +3 -3
- package/dist/empty-state.esm.js +3 -3
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +4 -4
- package/dist/file-upload.cjs.js +3 -3
- package/dist/file-upload.esm.js +5 -3
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +9 -9
- package/dist/form.cjs.js +11 -11
- package/dist/form.esm.js +11 -11
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +99 -88
- package/dist/icon-cloud.cjs.js +3 -3
- package/dist/icon-cloud.esm.js +3 -3
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +39 -32
- package/dist/label.cjs.js +3 -3
- package/dist/label.esm.js +3 -3
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +3 -3
- package/dist/marquee.esm.js +3 -3
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +29 -28
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +2 -2
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +51 -43
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +29 -27
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +4 -4
- package/dist/odometer.cjs.js +2 -2
- package/dist/odometer.esm.js +2 -2
- package/dist/orbiter.cjs.js +3 -3
- package/dist/orbiter.esm.js +3 -3
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +5 -5
- package/dist/popover.esm.js +4 -4
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +3 -3
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +1 -1
- package/dist/radio-group.esm.js +1 -1
- package/dist/radio.cjs.js +2 -2
- package/dist/radio.esm.js +2 -2
- package/dist/rating.cjs.js +17 -16
- package/dist/rating.esm.js +91 -92
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +36 -32
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/separator.cjs.js +7 -7
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -7
- package/dist/sidebar.esm.js +7 -7
- package/dist/skeleton.cjs.js +7 -7
- package/dist/skeleton.esm.js +7 -7
- package/dist/slider.cjs.js +3 -3
- package/dist/slider.esm.js +3 -3
- package/dist/slot.cjs.js +3 -3
- package/dist/slot.esm.js +3 -3
- package/dist/sortable.cjs.js +41 -42
- package/dist/sortable.esm.js +98 -99
- package/dist/spinning-text.cjs.js +3 -3
- package/dist/spinning-text.esm.js +3 -3
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.esm.js +1 -1
- package/dist/switch.cjs.js +10 -12
- package/dist/switch.esm.js +10 -12
- package/dist/table.cjs.js +9 -6
- package/dist/table.esm.js +46 -43
- package/dist/tabs.cjs.js +20 -21
- package/dist/tabs.esm.js +70 -66
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +30 -21
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +5 -5
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +4 -4
- package/dist/toast.cjs.js +6 -6
- package/dist/toast.esm.js +13 -13
- package/dist/toggle-group.cjs.js +5 -6
- package/dist/toggle-group.esm.js +63 -60
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/tooltip.cjs.js +4 -4
- package/dist/tooltip.esm.js +4 -4
- package/dist/transfer-list.cjs.js +3 -3
- package/dist/transfer-list.esm.js +3 -3
- package/dist/tree-7qbVnpGp.js +39 -0
- package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +17 -15
- package/package.json +1 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { E as W } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { s as Y, a as J } from "./control-name-Bpj7F34X.mjs";
|
|
3
|
+
import { c as G } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
+
import { r as Q } from "./calendar-DbxYRdlv.mjs";
|
|
5
|
+
import { r as X, e as tt, i as v, s as et, b as it, f as st, t as rt, n as E, d as nt, p as F, o as N, a as at, m as R, j as Z, k as j, q as y, l as ot, c as lt } from "./date-time-utils-Cps2aSu2.mjs";
|
|
6
|
+
let dt = 0;
|
|
7
|
+
const ut = `
|
|
7
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
8
9
|
<path d="M6 2a1 1 0 0 1 1 1v1h6V3a1 1 0 1 1 2 0v1h.5A2.5 2.5 0 0 1 18 6.5v9A2.5 2.5 0 0 1 15.5 18h-11A2.5 2.5 0 0 1 2 15.5v-9A2.5 2.5 0 0 1 4.5 4H5V3a1 1 0 0 1 1-1Zm10 7H4v6.5c0 .276.224.5.5.5h11a.5.5 0 0 0 .5-.5V9ZM4.5 6a.5.5 0 0 0-.5.5V7h12v-.5a.5.5 0 0 0-.5-.5h-11Z" fill="currentColor"/>
|
|
9
10
|
</svg>
|
|
10
|
-
`,
|
|
11
|
+
`, ct = `
|
|
11
12
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
12
13
|
<path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.12l3.71-3.9a.75.75 0 1 1 1.08 1.04l-4.25 4.47a.75.75 0 0 1-1.08 0L5.2 8.27a.75.75 0 0 1 .02-1.06Z" fill="currentColor"/>
|
|
13
14
|
</svg>
|
|
14
|
-
`,
|
|
15
|
+
`, pt = `
|
|
15
16
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
16
17
|
<path d="M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06Z" fill="currentColor"/>
|
|
17
18
|
</svg>
|
|
@@ -19,7 +20,7 @@ const lt = `
|
|
|
19
20
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
20
21
|
<path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm.75 2.75a.75.75 0 0 0-1.5 0v3.88c0 .2.08.4.22.54l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V6.25Z" fill="currentColor"/>
|
|
21
22
|
</svg>
|
|
22
|
-
`,
|
|
23
|
+
`, ht = `
|
|
23
24
|
:host {
|
|
24
25
|
--ui-dtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
25
26
|
--ui-dtp-surface: linear-gradient(
|
|
@@ -29,9 +30,9 @@ const lt = `
|
|
|
29
30
|
);
|
|
30
31
|
--ui-dtp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
31
32
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
32
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
33
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
33
34
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
34
|
-
--ui-dtp-success: var(--ui-color-success, #
|
|
35
|
+
--ui-dtp-success: var(--ui-color-success, #15803d);
|
|
35
36
|
--ui-dtp-error: var(--ui-color-danger, #dc2626);
|
|
36
37
|
--ui-dtp-radius: 12px;
|
|
37
38
|
--ui-dtp-panel-radius: 14px;
|
|
@@ -285,7 +286,7 @@ const lt = `
|
|
|
285
286
|
outline-color: Highlight;
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
|
-
`,
|
|
289
|
+
`, mt = `
|
|
289
290
|
.ui-date-time-picker-overlay-host {
|
|
290
291
|
--ui-dtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
291
292
|
--ui-dtp-surface: linear-gradient(
|
|
@@ -295,7 +296,7 @@ const lt = `
|
|
|
295
296
|
);
|
|
296
297
|
--ui-dtp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
297
298
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
298
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
299
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
299
300
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
300
301
|
--ui-dtp-panel-radius: 14px;
|
|
301
302
|
--ui-dtp-shadow: none;
|
|
@@ -354,7 +355,7 @@ const lt = `
|
|
|
354
355
|
.head-meta {
|
|
355
356
|
margin: 0;
|
|
356
357
|
font: 500 12px/1.3 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
357
|
-
color: var(--ui-dp-muted, #
|
|
358
|
+
color: var(--ui-dp-muted, #526175);
|
|
358
359
|
}
|
|
359
360
|
.content {
|
|
360
361
|
display: grid;
|
|
@@ -382,7 +383,7 @@ const lt = `
|
|
|
382
383
|
}
|
|
383
384
|
.time-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
|
|
384
385
|
.time-grid[data-meridiem="true"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
385
|
-
.time-grid label { font-size: 11px; color: var(--ui-dp-muted, #
|
|
386
|
+
.time-grid label { font-size: 11px; color: var(--ui-dp-muted, #526175); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
|
|
386
387
|
.time-grid select {
|
|
387
388
|
min-block-size: 34px;
|
|
388
389
|
border: 1px solid color-mix(in srgb, var(--ui-dtp-border, #cbd5e1) 84%, transparent);
|
|
@@ -477,14 +478,17 @@ function U(h) {
|
|
|
477
478
|
function x(h) {
|
|
478
479
|
return Z(h.date, h.time);
|
|
479
480
|
}
|
|
480
|
-
class
|
|
481
|
+
class _t extends W {
|
|
481
482
|
constructor() {
|
|
482
|
-
super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: 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._uid = `ui-dtp-${++
|
|
483
|
-
|
|
483
|
+
super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: 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._uid = `ui-dtp-${++dt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = X(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootChangeBound = (t) => this._onRootChange(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._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
|
|
484
|
+
tt(t, [this._overlay]) || this._schedulePosition.run();
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
static get observedAttributes() {
|
|
487
488
|
return [
|
|
489
|
+
"aria-label",
|
|
490
|
+
"aria-description",
|
|
491
|
+
"aria-describedby",
|
|
488
492
|
"open",
|
|
489
493
|
"default-open",
|
|
490
494
|
"value",
|
|
@@ -538,7 +542,7 @@ class ht extends W {
|
|
|
538
542
|
return (this.getAttribute("mode") || "popover") === "inline";
|
|
539
543
|
}
|
|
540
544
|
_isMobileSheet() {
|
|
541
|
-
return
|
|
545
|
+
return et(this.getAttribute("mode"));
|
|
542
546
|
}
|
|
543
547
|
_isDisabled() {
|
|
544
548
|
return this.hasAttribute("disabled");
|
|
@@ -572,10 +576,10 @@ class ht extends W {
|
|
|
572
576
|
return v(this.getAttribute("bare"), !1);
|
|
573
577
|
}
|
|
574
578
|
_locale() {
|
|
575
|
-
return
|
|
579
|
+
return it(this.getAttribute("locale"));
|
|
576
580
|
}
|
|
577
581
|
_translations() {
|
|
578
|
-
return
|
|
582
|
+
return Q(
|
|
579
583
|
this.getAttribute("locale"),
|
|
580
584
|
this.getAttribute("translations")
|
|
581
585
|
);
|
|
@@ -586,8 +590,8 @@ class ht extends W {
|
|
|
586
590
|
}
|
|
587
591
|
_formatDisplay(t) {
|
|
588
592
|
if (!t.date || !t.time) return "";
|
|
589
|
-
const e =
|
|
590
|
-
return this._is12h() ? `${e} ${
|
|
593
|
+
const e = st(t.date, this._locale(), "locale", null);
|
|
594
|
+
return this._is12h() ? `${e} ${rt(t.time, this._locale())}` : `${e} ${t.time}`;
|
|
591
595
|
}
|
|
592
596
|
_is12h() {
|
|
593
597
|
return (this.getAttribute("format") || "24h") === "12h";
|
|
@@ -595,12 +599,12 @@ class ht extends W {
|
|
|
595
599
|
_parseDateInput(t) {
|
|
596
600
|
const e = E(t);
|
|
597
601
|
if (e) return e;
|
|
598
|
-
const i =
|
|
602
|
+
const i = nt(t, this._locale());
|
|
599
603
|
if (i) return i;
|
|
600
|
-
const
|
|
601
|
-
if (!Number.isFinite(
|
|
602
|
-
const o =
|
|
603
|
-
return `${o}-${a}-${
|
|
604
|
+
const s = new Date(t);
|
|
605
|
+
if (!Number.isFinite(s.getTime())) return null;
|
|
606
|
+
const o = s.getFullYear(), a = String(s.getMonth() + 1).padStart(2, "0"), r = String(s.getDate()).padStart(2, "0");
|
|
607
|
+
return `${o}-${a}-${r}`;
|
|
604
608
|
}
|
|
605
609
|
_syncOpenAttribute(t) {
|
|
606
610
|
this._syncing = !0;
|
|
@@ -658,16 +662,16 @@ class ht extends W {
|
|
|
658
662
|
}
|
|
659
663
|
_clampState(t) {
|
|
660
664
|
if (!t.date) return { date: null, time: t.time };
|
|
661
|
-
const e = this._minDate(), i = this._maxDate(),
|
|
662
|
-
let a = this._minDateTime(),
|
|
663
|
-
if (a &&
|
|
664
|
-
const
|
|
665
|
-
a =
|
|
665
|
+
const e = this._minDate(), i = this._maxDate(), s = at(t.date, e, i), o = t.time || "00:00";
|
|
666
|
+
let a = this._minDateTime(), r = this._maxDateTime();
|
|
667
|
+
if (a && r && R(a, r) > 0) {
|
|
668
|
+
const _ = a;
|
|
669
|
+
a = r, r = _;
|
|
666
670
|
}
|
|
667
|
-
let n = Z(
|
|
668
|
-
a && R(n, a) < 0 && (n = a),
|
|
671
|
+
let n = Z(s, o) || `${s}T00:00`;
|
|
672
|
+
a && R(n, a) < 0 && (n = a), r && R(n, r) > 0 && (n = r);
|
|
669
673
|
const d = j(n);
|
|
670
|
-
return d ? { date: d.date, time: d.time } : { date:
|
|
674
|
+
return d ? { date: d.date, time: d.time } : { date: s, time: o };
|
|
671
675
|
}
|
|
672
676
|
_commit(t, e) {
|
|
673
677
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
@@ -675,15 +679,15 @@ class ht extends W {
|
|
|
675
679
|
this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
|
|
676
680
|
return;
|
|
677
681
|
}
|
|
678
|
-
const i = y(t.time || ""),
|
|
682
|
+
const i = y(t.time || ""), s = this._clampState({
|
|
679
683
|
date: E(t.date),
|
|
680
684
|
time: i ? `${p(i.hours)}:${p(i.minutes)}` : null
|
|
681
685
|
});
|
|
682
|
-
if (!
|
|
686
|
+
if (!s.date || !s.time) {
|
|
683
687
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(JSON.stringify(t), "parse"), this._updateHostState();
|
|
684
688
|
return;
|
|
685
689
|
}
|
|
686
|
-
this._value =
|
|
690
|
+
this._value = s, this._pending = { ...s }, this._draft = this._formatDisplay(s), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
|
|
687
691
|
}
|
|
688
692
|
_setOpen(t, e) {
|
|
689
693
|
t && this._isInteractionBlocked() || this._open !== t && (this._open = t, this._syncOpenAttribute(t), this._syncOverlay(e), this._updateHostState(), this.dispatchEvent(new CustomEvent(t ? "open" : "close", { bubbles: !0, composed: !0 })));
|
|
@@ -708,7 +712,7 @@ class ht extends W {
|
|
|
708
712
|
_ensureOverlay() {
|
|
709
713
|
if (this._overlay || typeof document > "u") return;
|
|
710
714
|
const t = document.createElement("div");
|
|
711
|
-
t.className = "ui-date-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), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), 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 =
|
|
715
|
+
t.className = "ui-date-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), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), 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 = ot());
|
|
712
716
|
}
|
|
713
717
|
_syncOverlayHostZIndex() {
|
|
714
718
|
if (!this._overlay || typeof window > "u") return;
|
|
@@ -721,7 +725,7 @@ class ht extends W {
|
|
|
721
725
|
_syncDismissableLayer() {
|
|
722
726
|
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
723
727
|
const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".field");
|
|
724
|
-
t && (this._dismissableLayer =
|
|
728
|
+
t && (this._dismissableLayer = G({
|
|
725
729
|
node: t,
|
|
726
730
|
trigger: e,
|
|
727
731
|
closeOnEscape: !0,
|
|
@@ -734,27 +738,27 @@ class ht extends W {
|
|
|
734
738
|
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
735
739
|
const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
|
|
736
740
|
if (!t || !e) return;
|
|
737
|
-
const i = e.getAttribute("data-placement"),
|
|
741
|
+
const i = e.getAttribute("data-placement"), s = lt(
|
|
738
742
|
t.getBoundingClientRect(),
|
|
739
743
|
e.getBoundingClientRect(),
|
|
740
744
|
8,
|
|
741
745
|
8,
|
|
742
746
|
i === "top" ? "top" : i === "bottom" ? "bottom" : null
|
|
743
747
|
);
|
|
744
|
-
e.style.position = "absolute", e.style.top = `${Math.round(
|
|
748
|
+
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);
|
|
745
749
|
}
|
|
746
750
|
_timeOptions() {
|
|
747
|
-
const t = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (a,
|
|
748
|
-
const n =
|
|
751
|
+
const t = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (a, r) => {
|
|
752
|
+
const n = r + 1, d = t.hours % 12 || 12;
|
|
749
753
|
return `<option value="${n}" ${n === d ? "selected" : ""}>${p(n)}</option>`;
|
|
750
|
-
}).join("") : Array.from({ length: 24 }, (a,
|
|
751
|
-
const n = Math.min(59,
|
|
754
|
+
}).join("") : Array.from({ length: 24 }, (a, r) => `<option value="${r}" ${r === t.hours ? "selected" : ""}>${p(r)}</option>`).join(""), s = Array.from({ length: Math.ceil(60 / e) }, (a, r) => {
|
|
755
|
+
const n = Math.min(59, r * e);
|
|
752
756
|
return `<option value="${n}" ${n === t.minutes ? "selected" : ""}>${p(n)}</option>`;
|
|
753
757
|
}).join(""), o = t.hours >= 12 ? "pm" : "am";
|
|
754
|
-
return { hours: i, minutes:
|
|
758
|
+
return { hours: i, minutes: s, meridiem: o };
|
|
755
759
|
}
|
|
756
760
|
_renderSurfaceInner(t, e = !1) {
|
|
757
|
-
const i = this._translations(),
|
|
761
|
+
const i = this._translations(), s = this._timeOptions(), o = (this.getAttribute("label") || "").trim(), a = c(o), r = c(o || i.selectDate), n = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
|
|
758
762
|
<header class="head">
|
|
759
763
|
<div>
|
|
760
764
|
<p class="head-title" ${o ? "" : "hidden"}>${a}</p>
|
|
@@ -766,9 +770,9 @@ class ht extends W {
|
|
|
766
770
|
<section class="time-panel" part="time">
|
|
767
771
|
<span class="icon" aria-hidden="true">${K}</span>
|
|
768
772
|
<div class="time-grid" data-meridiem="${this._is12h() ? "true" : "false"}">
|
|
769
|
-
<div><label>${c(i.hour)}</label><select data-segment="hours" aria-label="${c(i.hour)}">${
|
|
770
|
-
<div><label>${c(i.minute)}</label><select data-segment="minutes" aria-label="${c(i.minute)}">${
|
|
771
|
-
${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem" aria-label="${c(i.meridiem)}"><option value="am" ${
|
|
773
|
+
<div><label>${c(i.hour)}</label><select data-segment="hours" aria-label="${c(i.hour)}">${s.hours}</select></div>
|
|
774
|
+
<div><label>${c(i.minute)}</label><select data-segment="minutes" aria-label="${c(i.minute)}">${s.minutes}</select></div>
|
|
775
|
+
${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem" aria-label="${c(i.meridiem)}"><option value="am" ${s.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${s.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
|
|
772
776
|
</div>
|
|
773
777
|
</section>
|
|
774
778
|
</div>
|
|
@@ -780,20 +784,20 @@ class ht extends W {
|
|
|
780
784
|
</footer>
|
|
781
785
|
`;
|
|
782
786
|
return e ? d : `
|
|
783
|
-
<style>${
|
|
787
|
+
<style>${mt}</style>
|
|
784
788
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
785
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${
|
|
789
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${r}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
786
790
|
`;
|
|
787
791
|
}
|
|
788
792
|
_syncCalendar(t) {
|
|
789
|
-
const e = (
|
|
793
|
+
const e = (r, n) => {
|
|
790
794
|
if (n == null || n === "") {
|
|
791
|
-
t.hasAttribute(
|
|
795
|
+
t.hasAttribute(r) && t.removeAttribute(r);
|
|
792
796
|
return;
|
|
793
797
|
}
|
|
794
|
-
t.getAttribute(
|
|
795
|
-
}, i = (
|
|
796
|
-
n ? e(
|
|
798
|
+
t.getAttribute(r) !== n && t.setAttribute(r, n);
|
|
799
|
+
}, i = (r, n) => {
|
|
800
|
+
n ? e(r, "") : e(r, null);
|
|
797
801
|
};
|
|
798
802
|
e("selection", "single"), e("value", this._pending.date), e("min", this.getAttribute("min")), e("max", this.getAttribute("max")), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
|
|
799
803
|
const o = this.getAttribute("size") || "sm", a = t.classList.contains("dt-calendar-inline");
|
|
@@ -816,20 +820,20 @@ class ht extends W {
|
|
|
816
820
|
_setClosestOptionValue(t, e) {
|
|
817
821
|
const i = Array.from(t.options).map((a) => Number(a.value)).filter((a) => Number.isFinite(a));
|
|
818
822
|
if (!i.length) return;
|
|
819
|
-
let
|
|
823
|
+
let s = i[0], o = Math.abs(s - e);
|
|
820
824
|
for (let a = 1; a < i.length; a += 1) {
|
|
821
|
-
const
|
|
822
|
-
n < o && (
|
|
825
|
+
const r = i[a], n = Math.abs(r - e);
|
|
826
|
+
n < o && (s = r, o = n);
|
|
823
827
|
}
|
|
824
|
-
t.value = String(
|
|
828
|
+
t.value = String(s);
|
|
825
829
|
}
|
|
826
830
|
_syncOverlayState() {
|
|
827
831
|
if (!this._overlay) return;
|
|
828
832
|
this._syncOverlayHostZIndex();
|
|
829
833
|
const t = this._isMobileSheet();
|
|
830
834
|
this._ensureOverlayContent(t), this._syncDismissableLayer();
|
|
831
|
-
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"),
|
|
832
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
835
|
+
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), s = this._overlay.querySelector(".footer");
|
|
836
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), s && (s.hidden = !this._showFooter());
|
|
833
837
|
const o = this._overlay.querySelector(".head-title");
|
|
834
838
|
if (o) {
|
|
835
839
|
const l = (this.getAttribute("label") || "").trim();
|
|
@@ -837,14 +841,14 @@ class ht extends W {
|
|
|
837
841
|
}
|
|
838
842
|
const a = this._overlay.querySelector(".head-meta");
|
|
839
843
|
a && (a.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : e.selectDate);
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
const n = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, d = this._overlay.querySelector('select[data-segment="hours"]'),
|
|
844
|
+
const r = this._overlay.querySelector(".dt-calendar");
|
|
845
|
+
r && this._syncCalendar(r);
|
|
846
|
+
const n = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, d = this._overlay.querySelector('select[data-segment="hours"]'), _ = this._overlay.querySelector('select[data-segment="minutes"]'), m = this._overlay.querySelector('select[data-segment="meridiem"]');
|
|
843
847
|
if (d) {
|
|
844
848
|
const l = this._is12h() ? n.hours % 12 || 12 : n.hours;
|
|
845
849
|
this._setClosestOptionValue(d, l), d.disabled = this._isInteractionBlocked() || this._isReadonly();
|
|
846
850
|
}
|
|
847
|
-
|
|
851
|
+
_ && (this._setClosestOptionValue(_, n.minutes), _.disabled = this._isInteractionBlocked() || this._isReadonly()), m && (m.value = n.hours >= 12 ? "pm" : "am", m.disabled = this._isInteractionBlocked() || this._isReadonly());
|
|
848
852
|
const S = this._isInteractionBlocked() || this._isReadonly();
|
|
849
853
|
this._overlay.querySelectorAll(".action").forEach((l) => {
|
|
850
854
|
l.disabled = S;
|
|
@@ -854,18 +858,18 @@ class ht extends W {
|
|
|
854
858
|
this._syncOverlayState();
|
|
855
859
|
}
|
|
856
860
|
_applyTimeFromSurface(t) {
|
|
857
|
-
const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'),
|
|
861
|
+
const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), s = t.querySelector('select[data-segment="meridiem"]');
|
|
858
862
|
if (!e || !i) return;
|
|
859
863
|
const o = Number(e.value), a = Number(i.value);
|
|
860
864
|
if (!Number.isFinite(o) || !Number.isFinite(a)) return;
|
|
861
|
-
let
|
|
865
|
+
let r = o;
|
|
862
866
|
if (this._is12h()) {
|
|
863
|
-
const n =
|
|
864
|
-
n === "pm" &&
|
|
867
|
+
const n = s?.value === "pm" ? "pm" : "am";
|
|
868
|
+
n === "pm" && r < 12 && (r += 12), n === "am" && r === 12 && (r = 0);
|
|
865
869
|
}
|
|
866
870
|
this._pending = this._clampState({
|
|
867
871
|
date: this._pending.date,
|
|
868
|
-
time: `${p(
|
|
872
|
+
time: `${p(r)}:${p(a)}`
|
|
869
873
|
}), this._emitInput("time");
|
|
870
874
|
}
|
|
871
875
|
_onRootClick(t) {
|
|
@@ -882,8 +886,8 @@ class ht extends W {
|
|
|
882
886
|
return;
|
|
883
887
|
}
|
|
884
888
|
if (this._isInlineMode() && i === "now") {
|
|
885
|
-
const
|
|
886
|
-
this._pending = this._clampState({ date:
|
|
889
|
+
const s = /* @__PURE__ */ new Date(), o = String(s.getMonth() + 1).padStart(2, "0"), a = String(s.getDate()).padStart(2, "0"), r = `${s.getFullYear()}-${o}-${a}`, n = `${p(s.getHours())}:${p(s.getMinutes())}`;
|
|
890
|
+
this._pending = this._clampState({ date: r, time: n }), this._emitInput("now"), this._updateHostState();
|
|
887
891
|
return;
|
|
888
892
|
}
|
|
889
893
|
if (this._isInlineMode() && i === "cancel") {
|
|
@@ -925,12 +929,12 @@ class ht extends W {
|
|
|
925
929
|
this._commit({ date: null, time: null }, "blur");
|
|
926
930
|
return;
|
|
927
931
|
}
|
|
928
|
-
const
|
|
929
|
-
if (!
|
|
932
|
+
const s = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
|
|
933
|
+
if (!s) {
|
|
930
934
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
|
|
931
935
|
return;
|
|
932
936
|
}
|
|
933
|
-
const o = this._parseDateInput(
|
|
937
|
+
const o = this._parseDateInput(s[1]), a = y(s[2]) ? s[2] : null;
|
|
934
938
|
if (!o || !a) {
|
|
935
939
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
|
|
936
940
|
return;
|
|
@@ -965,8 +969,8 @@ class ht extends W {
|
|
|
965
969
|
return;
|
|
966
970
|
}
|
|
967
971
|
if (i === "now") {
|
|
968
|
-
const
|
|
969
|
-
this._pending = this._clampState({ date:
|
|
972
|
+
const s = /* @__PURE__ */ new Date(), o = String(s.getMonth() + 1).padStart(2, "0"), a = String(s.getDate()).padStart(2, "0"), r = `${s.getFullYear()}-${o}-${a}`, n = `${p(s.getHours())}:${p(s.getMinutes())}`;
|
|
973
|
+
this._pending = this._clampState({ date: r, time: n }), this._emitInput("now"), this._renderOverlay();
|
|
970
974
|
return;
|
|
971
975
|
}
|
|
972
976
|
i === "apply" && (this._commit(this._pending, "apply"), this._setOpen(!1, "apply"));
|
|
@@ -980,7 +984,7 @@ class ht extends W {
|
|
|
980
984
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
981
985
|
const e = t.target;
|
|
982
986
|
if (!e || e.tagName.toLowerCase() !== "ui-calendar") return;
|
|
983
|
-
const i = t.type,
|
|
987
|
+
const i = t.type, s = t.detail, o = E(i === "select" ? s?.value || null : s?.value);
|
|
984
988
|
if (o) {
|
|
985
989
|
if (this._pending = this._clampState({ date: o, time: this._pending.time || "09:00" }), this._emitInput("calendar"), this._shouldAutoCommit() && this._pending.time) {
|
|
986
990
|
this._commit(this._pending, "calendar"), this._setOpen(!1, "calendar");
|
|
@@ -999,21 +1003,21 @@ class ht extends W {
|
|
|
999
1003
|
}
|
|
1000
1004
|
_updateHostState() {
|
|
1001
1005
|
if (!this._hasView) return;
|
|
1002
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "",
|
|
1006
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", s = this._inlineError || i, o = !!x(this._value), a = this.getAttribute("name") || "", r = this._allowInput() ? this._draft : this._formatDisplay(this._value), n = this._isInlineMode(), d = this._translations(), _ = s ? "error" : this._state();
|
|
1003
1007
|
this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
1004
1008
|
const m = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), $ = this.root.querySelector(".required"), l = this.root.querySelector(".input"), w = this.root.querySelector('.btn[data-action="clear"]'), b = this.root.querySelector('.btn[data-action="toggle"]'), g = this.root.querySelector(".hint"), I = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
|
|
1005
|
-
if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), $ && ($.hidden = !this.hasAttribute("required")), l && (l.value !==
|
|
1006
|
-
const
|
|
1007
|
-
e && g && !g.hidden &&
|
|
1009
|
+
if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), $ && ($.hidden = !this.hasAttribute("required")), l && (l.value !== r && (l.value = r), l.id = this._inputId, l.placeholder = d.dateTimePlaceholder, l.readOnly = !this._allowInput() || this._isReadonly(), l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", n ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", s ? "true" : "false"), Y(l, this, t ? this._labelId : null, l.placeholder)), w && (w.hidden = !(this._clearable() && o), w.setAttribute("aria-label", d.clear), w.disabled = this._isInteractionBlocked()), b && (b.hidden = n, b.setAttribute("aria-label", d.toggleCalendar), b.setAttribute("aria-expanded", n ? "false" : String(this._open)), b.setAttribute("aria-controls", this._panelId), b.disabled = this._isInteractionBlocked()), g && (g.id = this._hintId, g.hidden = !e, g.textContent = e), I && (I.id = this._errorId, I.hidden = !s, I.textContent = s), l) {
|
|
1010
|
+
const f = [];
|
|
1011
|
+
e && g && !g.hidden && f.push(this._hintId), s && f.push(this._errorId), J(l, this, this._uid, f);
|
|
1008
1012
|
}
|
|
1009
1013
|
k && (k.disabled = !a, k.name = a, k.value = x(this._value) || "");
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1014
|
+
const C = this.root.querySelector(".field");
|
|
1015
|
+
C && (C.dataset.open = this._open && !n ? "true" : "false", C.dataset.invalid = s ? "true" : "false", C.dataset.state = _);
|
|
1012
1016
|
const u = this.root.querySelector(".inline-panel");
|
|
1013
1017
|
if (u) {
|
|
1014
1018
|
u.hidden = !n, u.id = this._panelId, u.dataset.bare = this._isBare() ? "true" : "false", u.setAttribute("role", "dialog"), u.setAttribute("aria-modal", "false"), u.setAttribute("aria-label", t || d.selectDate);
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1019
|
+
const f = u.querySelector(".panel-title");
|
|
1020
|
+
f && (f.textContent = t, f.hidden = !t);
|
|
1017
1021
|
const D = u.querySelector(".head-title");
|
|
1018
1022
|
D && (D.textContent = t, D.hidden = !t);
|
|
1019
1023
|
const q = u.querySelector(".head-meta");
|
|
@@ -1028,12 +1032,12 @@ class ht extends W {
|
|
|
1028
1032
|
H && (H.hidden = !this._showFooter());
|
|
1029
1033
|
const V = u.querySelector(".dt-calendar-inline");
|
|
1030
1034
|
V && this._syncCalendar(V);
|
|
1031
|
-
const O = u.querySelector('select[data-segment="hours"]'), B = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'),
|
|
1035
|
+
const O = u.querySelector('select[data-segment="hours"]'), B = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'), A = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 };
|
|
1032
1036
|
if (O) {
|
|
1033
|
-
const L = this._is12h() ?
|
|
1037
|
+
const L = this._is12h() ? A.hours % 12 || 12 : A.hours;
|
|
1034
1038
|
this._setClosestOptionValue(O, L), O.disabled = this._isInteractionBlocked() || this._isReadonly();
|
|
1035
1039
|
}
|
|
1036
|
-
B && (this._setClosestOptionValue(B,
|
|
1040
|
+
B && (this._setClosestOptionValue(B, A.minutes), B.disabled = this._isInteractionBlocked() || this._isReadonly()), z && (z.value = A.hours >= 12 ? "pm" : "am", z.disabled = this._isInteractionBlocked() || this._isReadonly()), u.querySelectorAll(".action").forEach((L) => {
|
|
1037
1041
|
L.disabled = this._isInteractionBlocked() || this._isReadonly();
|
|
1038
1042
|
});
|
|
1039
1043
|
}
|
|
@@ -1043,18 +1047,18 @@ class ht extends W {
|
|
|
1043
1047
|
if (!this._hasView) {
|
|
1044
1048
|
const t = this._translations();
|
|
1045
1049
|
this.setContent(`
|
|
1046
|
-
<style>${
|
|
1050
|
+
<style>${ht}</style>
|
|
1047
1051
|
<div class="root">
|
|
1048
1052
|
<label class="label" part="label" id="${this._labelId}">
|
|
1049
1053
|
<span class="label-text"></span>
|
|
1050
1054
|
<span class="required">*</span>
|
|
1051
1055
|
</label>
|
|
1052
1056
|
<div class="field" part="field input">
|
|
1053
|
-
<span class="icon" part="icon">${
|
|
1057
|
+
<span class="icon" part="icon">${ut}</span>
|
|
1054
1058
|
<input class="input" id="${this._inputId}" part="input" />
|
|
1055
1059
|
<span class="icon" part="icon">${K}</span>
|
|
1056
|
-
<button type="button" class="btn" part="clear" data-action="clear">${
|
|
1057
|
-
<button type="button" class="btn" part="toggle" data-action="toggle">${
|
|
1060
|
+
<button type="button" class="btn" part="clear" data-action="clear">${pt}</button>
|
|
1061
|
+
<button type="button" class="btn" part="toggle" data-action="toggle">${ct}</button>
|
|
1058
1062
|
</div>
|
|
1059
1063
|
<div class="hint" id="${this._hintId}" part="hint"></div>
|
|
1060
1064
|
<div class="error" id="${this._errorId}" part="error" role="alert"></div>
|
|
@@ -1072,7 +1076,7 @@ class ht extends W {
|
|
|
1072
1076
|
return !1;
|
|
1073
1077
|
}
|
|
1074
1078
|
}
|
|
1075
|
-
typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker",
|
|
1079
|
+
typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker", _t);
|
|
1076
1080
|
export {
|
|
1077
|
-
|
|
1081
|
+
_t as UIDateTimePicker
|
|
1078
1082
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./calendar-
|
|
1
|
+
"use strict";const l=require("./calendar-Qa-cFOp3.js"),C=require("./scroll-lock-BX6e3Ced.js"),I=require("./positioner-D_fqyx_j.js"),w=new Map,v=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function u(t){return String(t).padStart(2,"0")}function b(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function N(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function O(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function L(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function U(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function F(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function P(t){const e=(t||"").trim();return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${u(e.m)}-${u(e.d)}`:null}function g(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=d(e[2]);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function z(t,e){if(!t||!e)return null;const n=m(t),r=d(e);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function A(t){if(!t)return null;const e=m(t);return e||g(t)?.date||null}function Y(t){if(!t)return null;const e=g(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function k(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify({})}`;let i=w.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),w.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function q(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=O(e),s=L(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,s[o.m-1]||"").replace(/MM/g,u(o.m)).replace(/DD/g,u(o.d))}return k(t,e)}function B(t,e){const n=m(t.trim());if(n)return n;const r=N(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map($=>$.trim()).filter(Boolean);if(i.length!==3)return null;const s=b(i[0]),a=b(i[1]),h=b(i[2]);if(s==null||a==null||h==null)return null;let f=h;f<100&&(f+=f>=70?1900:2e3);const p=e.toLowerCase().startsWith("en-us"),c=p?s:a,D=p?a:s;if(f<1e3||c<1||c>12||D<1||D>31)return null;const T=`${f}-${u(c)}-${u(D)}`;return m(T)}function d(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),s=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||i<0||i>59||s<0||s>59)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:s}}function M(t,e=!1){if(!t)return"";const n=u(y(t.hours,0,23)),r=u(y(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=u(y(t.seconds,0,59));return`${n}:${r}:${o}`}function x(t,e){const n=d(t);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=d(t),r=d(e);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function H(t,e,n){const r=d(t);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function E(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function W(t,e){const n=g(t),r=g(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function Z(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${u(n.m)}-${u(n.d)}`,end:`${r.y}-${u(r.m)}-${u(r.d)}`}}function _(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function R(t,e,n=8,r=8,o=null){const s=(typeof window<"u"?window.innerHeight:800)-t.bottom-r-n,a=t.top-r-n,h=s>=e.height,f=a>=e.height,p=o==="top"?"top":"bottom";let c;if(h&&!f)c="bottom";else if(f&&!h)c="top";else if(f&&h)c=p;else{const T=p==="bottom"?s:a,$=p==="bottom"?a:s;T>0&&$<=T+v?c=p:c=s>=a?"bottom":"top"}const D=I.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(D.y),left:Math.round(D.x),placement:c}}function G(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function J(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function K(){return C.acquireBodyScrollLock()}exports.clampDateIso=E;exports.clampTime=H;exports.combineDateTime=z;exports.compareDateTimes=W;exports.compareTimes=S;exports.computeLastDaysRange=_;exports.computeMonthRange=Z;exports.computePopoverPosition=R;exports.eventOriginatesWithin=F;exports.formatDateForDisplay=q;exports.formatTime=M;exports.isTruthyAttr=U;exports.lockBodyScroll=K;exports.normalizeDateIso=m;exports.normalizeLocale=P;exports.parseConstraintDate=A;exports.parseConstraintDateTime=Y;exports.parseTimeInput=d;exports.parseUserDateInput=B;exports.rafThrottle=G;exports.shouldUseMobileSheet=J;exports.splitDateTime=g;exports.to12hDisplay=x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as T, c as b, a as N, s as v, e as F } from "./calendar-
|
|
1
|
+
import { p as T, c as b, a as N, s as v, e as F } from "./calendar-DbxYRdlv.mjs";
|
|
2
2
|
import { a as L } from "./scroll-lock-LfqXXqsu.mjs";
|
|
3
3
|
import { c as U } from "./positioner-D0VGxtYU.mjs";
|
|
4
4
|
const C = /* @__PURE__ */ new Map(), I = 24;
|
package/dist/description.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./ElementBase-EV6mVBUV.js"),u=`
|
|
2
2
|
:host {
|
|
3
|
-
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #
|
|
3
|
+
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
4
4
|
--ui-description-size: 12px;
|
|
5
5
|
--ui-description-weight: 500;
|
|
6
6
|
--ui-description-line-height: 1.45;
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
:host([tone="brand"]) { --ui-description-color: var(--ui-color-primary, #2563eb); }
|
|
35
|
-
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #
|
|
36
|
-
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #
|
|
35
|
+
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #15803d); }
|
|
36
|
+
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #b45309); }
|
|
37
37
|
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger, #dc2626); }
|
|
38
38
|
|
|
39
39
|
:host([size="sm"]),
|
package/dist/description.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as d } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const a = `
|
|
3
3
|
:host {
|
|
4
|
-
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #
|
|
4
|
+
--ui-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
5
5
|
--ui-description-size: 12px;
|
|
6
6
|
--ui-description-weight: 500;
|
|
7
7
|
--ui-description-line-height: 1.45;
|
|
@@ -33,8 +33,8 @@ const a = `
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:host([tone="brand"]) { --ui-description-color: var(--ui-color-primary, #2563eb); }
|
|
36
|
-
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #
|
|
37
|
-
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #
|
|
36
|
+
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #15803d); }
|
|
37
|
+
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #b45309); }
|
|
38
38
|
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger, #dc2626); }
|
|
39
39
|
|
|
40
40
|
:host([size="sm"]),
|
package/dist/dialog.cjs.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 24%, var(--ui-color-surface, #ffffff)) 100%
|
|
16
16
|
);
|
|
17
17
|
--ui-dialog-color: var(--ui-color-text, #0f172a);
|
|
18
|
-
--ui-dialog-muted: var(--ui-color-muted, #
|
|
18
|
+
--ui-dialog-muted: var(--ui-color-muted, #526175);
|
|
19
19
|
--ui-dialog-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
|
|
20
20
|
--ui-dialog-border: 1px solid var(--ui-dialog-border-color);
|
|
21
21
|
--ui-dialog-shadow: none;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
--ui-dialog-width: min(560px, calc(100vw - 24px));
|
|
26
26
|
--ui-dialog-focus: var(--ui-color-focus-ring, #2563eb);
|
|
27
27
|
--ui-dialog-danger: var(--ui-color-danger, #dc2626);
|
|
28
|
-
--ui-dialog-success: var(--ui-color-success, #
|
|
28
|
+
--ui-dialog-success: var(--ui-color-success, #15803d);
|
|
29
29
|
--ui-dialog-z: 1201;
|
|
30
30
|
--ui-dialog-backdrop-z: 1200;
|
|
31
31
|
--ui-dialog-btn-bg: color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 88%, transparent);
|
package/dist/dialog.esm.js
CHANGED
|
@@ -19,7 +19,7 @@ const W = `
|
|
|
19
19
|
color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 24%, var(--ui-color-surface, #ffffff)) 100%
|
|
20
20
|
);
|
|
21
21
|
--ui-dialog-color: var(--ui-color-text, #0f172a);
|
|
22
|
-
--ui-dialog-muted: var(--ui-color-muted, #
|
|
22
|
+
--ui-dialog-muted: var(--ui-color-muted, #526175);
|
|
23
23
|
--ui-dialog-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
|
|
24
24
|
--ui-dialog-border: 1px solid var(--ui-dialog-border-color);
|
|
25
25
|
--ui-dialog-shadow: none;
|
|
@@ -29,7 +29,7 @@ const W = `
|
|
|
29
29
|
--ui-dialog-width: min(560px, calc(100vw - 24px));
|
|
30
30
|
--ui-dialog-focus: var(--ui-color-focus-ring, #2563eb);
|
|
31
31
|
--ui-dialog-danger: var(--ui-color-danger, #dc2626);
|
|
32
|
-
--ui-dialog-success: var(--ui-color-success, #
|
|
32
|
+
--ui-dialog-success: var(--ui-color-success, #15803d);
|
|
33
33
|
--ui-dialog-z: 1201;
|
|
34
34
|
--ui-dialog-backdrop-z: 1200;
|
|
35
35
|
--ui-dialog-btn-bg: color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 88%, transparent);
|