@editora/ui-core 0.1.25 → 0.2.1
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/README.md +132 -0
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +92 -53
- package/dist/alert-dialog.esm.js +211 -159
- package/dist/alert.cjs.js +42 -33
- package/dist/alert.esm.js +80 -71
- package/dist/animated-beam.cjs.js +42 -50
- package/dist/animated-beam.esm.js +47 -55
- package/dist/animated-list.cjs.js +11 -27
- package/dist/animated-list.esm.js +12 -28
- package/dist/animated-text.cjs.js +9 -9
- package/dist/animated-text.esm.js +9 -9
- package/dist/app-header.cjs.js +17 -12
- package/dist/app-header.esm.js +18 -13
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +16 -20
- package/dist/avatar.esm.js +16 -20
- package/dist/badge.cjs.js +27 -22
- package/dist/badge.esm.js +32 -27
- package/dist/block-controls.cjs.js +11 -12
- package/dist/block-controls.esm.js +8 -9
- package/dist/box.cjs.js +2 -3
- package/dist/box.esm.js +2 -3
- package/dist/breadcrumb.cjs.js +12 -18
- package/dist/breadcrumb.esm.js +11 -17
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
- package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -7
- package/dist/card.esm.js +5 -6
- package/dist/chart.cjs.js +58 -52
- package/dist/chart.esm.js +101 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +9 -13
- package/dist/collapsible.esm.js +9 -13
- package/dist/color-picker.cjs.js +38 -19
- package/dist/color-picker.esm.js +134 -115
- package/dist/combobox.cjs.js +60 -57
- package/dist/combobox.esm.js +96 -92
- package/dist/command-palette.cjs.js +1 -0
- package/dist/command-palette.esm.js +1 -0
- package/dist/command.cjs.js +32 -14
- package/dist/command.esm.js +46 -28
- package/dist/components/date-time-utils.d.ts.map +1 -1
- package/dist/components/ui-accordion.d.ts.map +1 -1
- package/dist/components/ui-alert-dialog.d.ts +2 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-alert.d.ts.map +1 -1
- package/dist/components/ui-animated-beam.d.ts.map +1 -1
- package/dist/components/ui-animated-list.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-badge.d.ts.map +1 -1
- package/dist/components/ui-block-controls.d.ts.map +1 -1
- package/dist/components/ui-box.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collapsible.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-command-palette.d.ts.map +1 -1
- package/dist/components/ui-command.d.ts.map +1 -1
- package/dist/components/ui-container.d.ts.map +1 -1
- package/dist/components/ui-context-menu.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts +7 -0
- package/dist/components/ui-data-table.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-dialog.d.ts +2 -0
- package/dist/components/ui-dialog.d.ts.map +1 -1
- 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-empty-state.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-fieldset.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-icon-cloud.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-marquee.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-meter.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-orbiter.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio-group.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-scroll-area.d.ts.map +1 -1
- package/dist/components/ui-section.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-selection-popup.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-spinning-text.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-splitter.d.ts.map +1 -1
- package/dist/components/ui-stepper.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- 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-picker.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts +2 -0
- 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-toolbar.d.ts +2 -0
- package/dist/components/ui-toolbar.d.ts.map +1 -1
- package/dist/components/ui-tooltip.d.ts.map +1 -1
- package/dist/components/ui-transfer-list.d.ts.map +1 -1
- package/dist/components/ui-tree-item.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/container.cjs.js +6 -12
- package/dist/container.esm.js +8 -14
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +42 -41
- package/dist/data-table.cjs.js +21 -18
- package/dist/data-table.esm.js +210 -190
- package/dist/date-field.cjs.js +9 -9
- package/dist/date-field.esm.js +19 -19
- package/dist/date-picker.cjs.js +29 -20
- package/dist/date-picker.esm.js +59 -50
- package/dist/date-range-picker.cjs.js +24 -19
- package/dist/date-range-picker.esm.js +86 -81
- package/dist/date-range-time-picker.cjs.js +27 -20
- package/dist/date-range-time-picker.esm.js +24 -17
- package/dist/date-time-picker.cjs.js +24 -17
- package/dist/date-time-picker.esm.js +89 -82
- package/dist/date-time-utils-C-4eHTyy.js +1 -0
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +59 -43
- package/dist/dialog.esm.js +86 -53
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +16 -30
- package/dist/dock.esm.js +26 -40
- package/dist/drawer.cjs.js +8 -12
- package/dist/drawer.esm.js +6 -10
- package/dist/dropdown.cjs.js +8 -6
- package/dist/dropdown.esm.js +33 -30
- package/dist/empty-state.cjs.js +17 -15
- package/dist/empty-state.esm.js +13 -11
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +23 -14
- package/dist/field.esm.js +30 -21
- package/dist/fieldset.cjs.js +16 -9
- package/dist/fieldset.esm.js +19 -12
- package/dist/file-upload.cjs.js +79 -37
- package/dist/file-upload.esm.js +154 -112
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +24 -27
- package/dist/form.esm.js +24 -27
- package/dist/gantt.cjs.js +13 -11
- package/dist/gantt.esm.js +13 -11
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +8 -8
- package/dist/hover-card.esm.js +18 -15
- package/dist/icon-cloud.cjs.js +19 -36
- package/dist/icon-cloud.esm.js +41 -58
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +108 -104
- package/dist/inline-edit.cjs.js +50 -22
- package/dist/inline-edit.esm.js +77 -49
- package/dist/input.cjs.js +45 -38
- package/dist/input.esm.js +60 -53
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/layout.cjs.js +3 -3
- package/dist/layout.esm.js +3 -3
- package/dist/marquee.cjs.js +7 -10
- package/dist/marquee.esm.js +7 -10
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +8 -24
- package/dist/menu.esm.js +52 -72
- package/dist/menubar.cjs.js +9 -31
- package/dist/menubar.esm.js +127 -153
- package/dist/meter.cjs.js +4 -9
- package/dist/meter.esm.js +6 -11
- package/dist/multi-select.cjs.js +53 -40
- package/dist/multi-select.esm.js +87 -73
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +28 -17
- package/dist/number-field.esm.js +37 -26
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +9 -9
- package/dist/odometer.esm.js +17 -17
- package/dist/orbiter.cjs.js +11 -28
- package/dist/orbiter.esm.js +28 -45
- package/dist/overlay-motion-B56x1GoY.js +49 -0
- package/dist/overlay-motion-BX3dPLay.mjs +120 -0
- package/dist/pagination.cjs.js +28 -25
- package/dist/pagination.esm.js +54 -51
- package/dist/password-field.cjs.js +39 -34
- package/dist/password-field.esm.js +63 -58
- package/dist/pin-input.cjs.js +18 -14
- package/dist/pin-input.esm.js +24 -20
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +16 -28
- package/dist/popover.esm.js +29 -45
- package/dist/portal-DeaM1tYY.mjs +121 -0
- package/dist/portal-XbYR3m_q.js +1 -0
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.d.ts +3 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
- package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/overlay-motion.d.ts +47 -0
- package/dist/primitives/overlay-motion.d.ts.map +1 -0
- package/dist/primitives/positioner.d.ts.map +1 -1
- package/dist/progress.cjs.js +11 -16
- package/dist/progress.esm.js +37 -42
- package/dist/quick-actions.cjs.js +14 -14
- package/dist/quick-actions.esm.js +12 -12
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +16 -13
- package/dist/radio.esm.js +16 -13
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
- package/dist/runtime-CXw4SGV9.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +36 -32
- package/dist/scroll-area.cjs.js +3 -4
- package/dist/scroll-area.esm.js +3 -4
- package/dist/section.cjs.js +2 -4
- package/dist/section.esm.js +2 -4
- package/dist/select.cjs.js +42 -75
- package/dist/select.esm.js +57 -89
- package/dist/selection-popup.cjs.js +3 -4
- package/dist/selection-popup.esm.js +3 -4
- package/dist/semantic-tokens.d.ts +17 -0
- package/dist/semantic-tokens.d.ts.map +1 -0
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +29 -28
- package/dist/sidebar.esm.js +32 -31
- package/dist/skeleton.cjs.js +2 -2
- package/dist/skeleton.esm.js +2 -2
- package/dist/slider.cjs.js +22 -26
- package/dist/slider.esm.js +25 -29
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +10 -11
- package/dist/sortable.esm.js +10 -11
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +7 -7
- package/dist/split-button.esm.js +17 -16
- package/dist/splitter.cjs.js +52 -10
- package/dist/splitter.esm.js +55 -13
- package/dist/stepper.cjs.js +31 -65
- package/dist/stepper.esm.js +32 -66
- package/dist/switch.cjs.js +20 -22
- package/dist/switch.esm.js +20 -22
- package/dist/table.cjs.js +5 -5
- package/dist/table.esm.js +20 -20
- package/dist/tabs.cjs.js +101 -26
- package/dist/tabs.esm.js +187 -112
- package/dist/tags-input.cjs.js +43 -17
- package/dist/tags-input.esm.js +75 -49
- package/dist/textarea.cjs.js +34 -35
- package/dist/textarea.esm.js +50 -51
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +8 -8
- package/dist/time-field.esm.js +29 -29
- package/dist/time-picker.cjs.js +17 -14
- package/dist/time-picker.esm.js +28 -25
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/toggle-group.cjs.js +13 -13
- package/dist/toggle-group.esm.js +66 -61
- package/dist/toggle.cjs.js +52 -34
- package/dist/toggle.esm.js +80 -62
- package/dist/toolbar.cjs.js +14 -14
- package/dist/toolbar.esm.js +41 -33
- package/dist/tooltip.cjs.js +3 -3
- package/dist/tooltip.esm.js +39 -33
- package/dist/transfer-list.cjs.js +37 -38
- package/dist/transfer-list.esm.js +32 -33
- package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
- package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
- package/dist/tree-item.cjs.js +9 -8
- package/dist/tree-item.esm.js +13 -12
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
- package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
- package/dist/wizard.cjs.js +51 -39
- package/dist/wizard.esm.js +51 -39
- package/package.json +1 -1
- package/dist/date-time-utils-y3AvNvGe.js +0 -1
- package/dist/portal-DgpQ3Jo1.js +0 -1
- package/dist/portal-bR42gHvG.mjs +0 -118
- package/dist/runtime-DwE-tizc.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E as W } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { s as Y, a as J } from "./control-name-Bpj7F34X.mjs";
|
|
3
3
|
import { c as G } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
-
import { r as Q } from "./calendar-
|
|
5
|
-
import { r as X, e as tt, i as
|
|
4
|
+
import { r as Q } from "./calendar-DkSDFg33.mjs";
|
|
5
|
+
import { r as X, e as tt, i as g, s as et, b as it, f as rt, t as st, 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-zAx4ghvC.mjs";
|
|
6
6
|
let dt = 0;
|
|
7
7
|
const ut = `
|
|
8
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -28,18 +28,18 @@ const ut = `
|
|
|
28
28
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent),
|
|
29
29
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 90%, var(--ui-color-surface-alt, #f8fafc))
|
|
30
30
|
);
|
|
31
|
-
--ui-dtp-border: color-
|
|
31
|
+
--ui-dtp-border: var(--ui-color-line, var(--ui-color-border, #cbd5e1));
|
|
32
32
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
33
33
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
34
34
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
35
35
|
--ui-dtp-success: var(--ui-color-success, #15803d);
|
|
36
|
-
--ui-dtp-error: var(--ui-color-danger, #dc2626);
|
|
37
|
-
--ui-dtp-radius:
|
|
36
|
+
--ui-dtp-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
37
|
+
--ui-dtp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
38
38
|
--ui-dtp-panel-radius: 14px;
|
|
39
39
|
--ui-dtp-z: 1600;
|
|
40
40
|
--ui-dtp-shadow: none;
|
|
41
41
|
--ui-dtp-gap: 12px;
|
|
42
|
-
--ui-dtp-hit:
|
|
42
|
+
--ui-dtp-hit: var(--ui-control-height-2, 32px);
|
|
43
43
|
--ui-dtp-duration: 160ms;
|
|
44
44
|
--ui-dtp-ease: cubic-bezier(0.2, 0.9, 0.24, 1);
|
|
45
45
|
color-scheme: light dark;
|
|
@@ -61,11 +61,14 @@ const ut = `
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
:host([size="sm"]) {
|
|
64
|
-
--ui-dtp-
|
|
64
|
+
--ui-dtp-action-size: 24px;
|
|
65
|
+
--ui-dtp-action-bleed: -1px;
|
|
66
|
+
--ui-dtp-hit: var(--ui-control-height-1, 24px);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
:host([size="lg"]) {
|
|
68
|
-
--ui-dtp-
|
|
70
|
+
--ui-dtp-action-size: 28px;
|
|
71
|
+
--ui-dtp-hit: var(--ui-control-height-3, 40px);
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
.root {
|
|
@@ -91,6 +94,7 @@ const ut = `
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
.field {
|
|
97
|
+
box-sizing: border-box;
|
|
94
98
|
display: grid;
|
|
95
99
|
grid-template-columns: auto minmax(0, 1fr) auto auto auto;
|
|
96
100
|
align-items: center;
|
|
@@ -106,18 +110,20 @@ const ut = `
|
|
|
106
110
|
|
|
107
111
|
.field[data-open="true"],
|
|
108
112
|
.field:focus-within {
|
|
109
|
-
border-color: color
|
|
110
|
-
|
|
113
|
+
border-color: var(--ui-ring-color, var(--ui-dtp-accent));
|
|
114
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-dtp-accent));
|
|
115
|
+
outline-offset: -1px;
|
|
116
|
+
box-shadow: none;
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
.field[data-invalid="true"] {
|
|
114
120
|
border-color: color-mix(in srgb, var(--ui-dtp-error) 72%, transparent);
|
|
115
|
-
box-shadow: 0 0 0
|
|
121
|
+
box-shadow: 0 0 0 1px var(--ui-dtp-error);
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
.field[data-state="success"]:not([data-invalid="true"]) {
|
|
119
125
|
border-color: color-mix(in srgb, var(--ui-dtp-success) 56%, transparent);
|
|
120
|
-
box-shadow: 0 0 0
|
|
126
|
+
box-shadow: 0 0 0 1px var(--ui-dtp-success);
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
.input {
|
|
@@ -127,12 +133,12 @@ const ut = `
|
|
|
127
133
|
outline: none;
|
|
128
134
|
min-inline-size: 0;
|
|
129
135
|
inline-size: 100%;
|
|
130
|
-
padding:
|
|
136
|
+
padding: 0;
|
|
131
137
|
font: 500 14px/1.35 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
132
138
|
}
|
|
133
139
|
|
|
134
140
|
.input::placeholder {
|
|
135
|
-
color: color-mix(in srgb, var(--ui-dp-text)
|
|
141
|
+
color: var(--ui-color-placeholder, color-mix(in srgb, var(--ui-dp-text) 62%, transparent));
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
.icon {
|
|
@@ -152,8 +158,9 @@ const ut = `
|
|
|
152
158
|
.btn {
|
|
153
159
|
border: 1px solid transparent;
|
|
154
160
|
background: color-mix(in srgb, var(--ui-dtp-bg) 84%, transparent);
|
|
155
|
-
inline-size:
|
|
156
|
-
block-size:
|
|
161
|
+
inline-size: var(--ui-dtp-action-size, 24px);
|
|
162
|
+
block-size: var(--ui-dtp-action-size, 24px);
|
|
163
|
+
margin-block: var(--ui-dtp-action-bleed, 0px);
|
|
157
164
|
border-radius: 8px;
|
|
158
165
|
color: color-mix(in srgb, var(--ui-dp-text) 72%, transparent);
|
|
159
166
|
cursor: pointer;
|
|
@@ -294,7 +301,7 @@ const ut = `
|
|
|
294
301
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent),
|
|
295
302
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 90%, var(--ui-color-surface-alt, #f8fafc))
|
|
296
303
|
);
|
|
297
|
-
--ui-dtp-border: color-
|
|
304
|
+
--ui-dtp-border: var(--ui-color-line, var(--ui-color-border, #cbd5e1));
|
|
298
305
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
299
306
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
300
307
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
@@ -522,7 +529,7 @@ class _t extends W {
|
|
|
522
529
|
connectedCallback() {
|
|
523
530
|
if (super.connectedCallback(), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("input", this._onRootInputBound), this.root.addEventListener("change", this._onRootChangeBound), this.root.addEventListener("focusout", this._onRootBlurBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), !this._isInitialized) {
|
|
524
531
|
const t = U(this.getAttribute("value") || this.getAttribute("default-value"));
|
|
525
|
-
this._value = t, this._pending = { ...t }, this._draft = this._formatDisplay(t), this._open = this.hasAttribute("open") ||
|
|
532
|
+
this._value = t, this._pending = { ...t }, this._draft = this._formatDisplay(t), this._open = this.hasAttribute("open") || g(this.getAttribute("default-open")), this._isInitialized = !0;
|
|
526
533
|
}
|
|
527
534
|
this._open && !this._isInlineMode() && this._ensureOverlay();
|
|
528
535
|
}
|
|
@@ -558,22 +565,22 @@ class _t extends W {
|
|
|
558
565
|
return this.hasAttribute("readonly");
|
|
559
566
|
}
|
|
560
567
|
_allowInput() {
|
|
561
|
-
return
|
|
568
|
+
return g(this.getAttribute("allow-input"), !0);
|
|
562
569
|
}
|
|
563
570
|
_clearable() {
|
|
564
|
-
return
|
|
571
|
+
return g(this.getAttribute("clearable"), !0);
|
|
565
572
|
}
|
|
566
573
|
_closeOnSelect() {
|
|
567
|
-
return
|
|
574
|
+
return g(this.getAttribute("close-on-select"), !1);
|
|
568
575
|
}
|
|
569
576
|
_shouldAutoCommit() {
|
|
570
577
|
return this._closeOnSelect() || !this._showFooter();
|
|
571
578
|
}
|
|
572
579
|
_showFooter() {
|
|
573
|
-
return
|
|
580
|
+
return g(this.getAttribute("show-footer"), !0);
|
|
574
581
|
}
|
|
575
582
|
_isBare() {
|
|
576
|
-
return
|
|
583
|
+
return g(this.getAttribute("bare"), !1);
|
|
577
584
|
}
|
|
578
585
|
_locale() {
|
|
579
586
|
return it(this.getAttribute("locale"));
|
|
@@ -590,8 +597,8 @@ class _t extends W {
|
|
|
590
597
|
}
|
|
591
598
|
_formatDisplay(t) {
|
|
592
599
|
if (!t.date || !t.time) return "";
|
|
593
|
-
const e =
|
|
594
|
-
return this._is12h() ? `${e} ${
|
|
600
|
+
const e = rt(t.date, this._locale(), "locale", null);
|
|
601
|
+
return this._is12h() ? `${e} ${st(t.time, this._locale())}` : `${e} ${t.time}`;
|
|
595
602
|
}
|
|
596
603
|
_is12h() {
|
|
597
604
|
return (this.getAttribute("format") || "24h") === "12h";
|
|
@@ -601,10 +608,10 @@ class _t extends W {
|
|
|
601
608
|
if (e) return e;
|
|
602
609
|
const i = nt(t, this._locale());
|
|
603
610
|
if (i) return i;
|
|
604
|
-
const
|
|
605
|
-
if (!Number.isFinite(
|
|
606
|
-
const o =
|
|
607
|
-
return `${o}-${a}-${
|
|
611
|
+
const r = new Date(t);
|
|
612
|
+
if (!Number.isFinite(r.getTime())) return null;
|
|
613
|
+
const o = r.getFullYear(), a = String(r.getMonth() + 1).padStart(2, "0"), s = String(r.getDate()).padStart(2, "0");
|
|
614
|
+
return `${o}-${a}-${s}`;
|
|
608
615
|
}
|
|
609
616
|
_syncOpenAttribute(t) {
|
|
610
617
|
this._syncing = !0;
|
|
@@ -662,16 +669,16 @@ class _t extends W {
|
|
|
662
669
|
}
|
|
663
670
|
_clampState(t) {
|
|
664
671
|
if (!t.date) return { date: null, time: t.time };
|
|
665
|
-
const e = this._minDate(), i = this._maxDate(),
|
|
666
|
-
let a = this._minDateTime(),
|
|
667
|
-
if (a &&
|
|
672
|
+
const e = this._minDate(), i = this._maxDate(), r = at(t.date, e, i), o = t.time || "00:00";
|
|
673
|
+
let a = this._minDateTime(), s = this._maxDateTime();
|
|
674
|
+
if (a && s && R(a, s) > 0) {
|
|
668
675
|
const _ = a;
|
|
669
|
-
a =
|
|
676
|
+
a = s, s = _;
|
|
670
677
|
}
|
|
671
|
-
let n = Z(
|
|
672
|
-
a && R(n, a) < 0 && (n = a),
|
|
678
|
+
let n = Z(r, o) || `${r}T00:00`;
|
|
679
|
+
a && R(n, a) < 0 && (n = a), s && R(n, s) > 0 && (n = s);
|
|
673
680
|
const d = j(n);
|
|
674
|
-
return d ? { date: d.date, time: d.time } : { date:
|
|
681
|
+
return d ? { date: d.date, time: d.time } : { date: r, time: o };
|
|
675
682
|
}
|
|
676
683
|
_commit(t, e) {
|
|
677
684
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
@@ -679,15 +686,15 @@ class _t extends W {
|
|
|
679
686
|
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();
|
|
680
687
|
return;
|
|
681
688
|
}
|
|
682
|
-
const i = y(t.time || ""),
|
|
689
|
+
const i = y(t.time || ""), r = this._clampState({
|
|
683
690
|
date: E(t.date),
|
|
684
691
|
time: i ? `${p(i.hours)}:${p(i.minutes)}` : null
|
|
685
692
|
});
|
|
686
|
-
if (!
|
|
693
|
+
if (!r.date || !r.time) {
|
|
687
694
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(JSON.stringify(t), "parse"), this._updateHostState();
|
|
688
695
|
return;
|
|
689
696
|
}
|
|
690
|
-
this._value =
|
|
697
|
+
this._value = r, this._pending = { ...r }, this._draft = this._formatDisplay(r), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
|
|
691
698
|
}
|
|
692
699
|
_setOpen(t, e) {
|
|
693
700
|
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 })));
|
|
@@ -738,27 +745,27 @@ class _t extends W {
|
|
|
738
745
|
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
739
746
|
const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
|
|
740
747
|
if (!t || !e) return;
|
|
741
|
-
const i = e.getAttribute("data-placement"),
|
|
748
|
+
const i = e.getAttribute("data-placement"), r = lt(
|
|
742
749
|
t.getBoundingClientRect(),
|
|
743
750
|
e.getBoundingClientRect(),
|
|
744
751
|
8,
|
|
745
752
|
8,
|
|
746
753
|
i === "top" ? "top" : i === "bottom" ? "bottom" : null
|
|
747
754
|
);
|
|
748
|
-
e.style.position = "absolute", e.style.top = `${Math.round(
|
|
755
|
+
e.style.position = "absolute", e.style.top = `${Math.round(r.top)}px`, e.style.left = `${Math.round(r.left)}px`, e.setAttribute("data-placement", r.placement);
|
|
749
756
|
}
|
|
750
757
|
_timeOptions() {
|
|
751
|
-
const t = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (a,
|
|
752
|
-
const n =
|
|
758
|
+
const t = y(this._pending.time || "00:00") || { hours: 0, minutes: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (a, s) => {
|
|
759
|
+
const n = s + 1, d = t.hours % 12 || 12;
|
|
753
760
|
return `<option value="${n}" ${n === d ? "selected" : ""}>${p(n)}</option>`;
|
|
754
|
-
}).join("") : Array.from({ length: 24 }, (a,
|
|
755
|
-
const n = Math.min(59,
|
|
761
|
+
}).join("") : Array.from({ length: 24 }, (a, s) => `<option value="${s}" ${s === t.hours ? "selected" : ""}>${p(s)}</option>`).join(""), r = Array.from({ length: Math.ceil(60 / e) }, (a, s) => {
|
|
762
|
+
const n = Math.min(59, s * e);
|
|
756
763
|
return `<option value="${n}" ${n === t.minutes ? "selected" : ""}>${p(n)}</option>`;
|
|
757
764
|
}).join(""), o = t.hours >= 12 ? "pm" : "am";
|
|
758
|
-
return { hours: i, minutes:
|
|
765
|
+
return { hours: i, minutes: r, meridiem: o };
|
|
759
766
|
}
|
|
760
767
|
_renderSurfaceInner(t, e = !1) {
|
|
761
|
-
const i = this._translations(),
|
|
768
|
+
const i = this._translations(), r = this._timeOptions(), o = (this.getAttribute("label") || "").trim(), a = c(o), s = c(o || i.selectDate), n = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
|
|
762
769
|
<header class="head">
|
|
763
770
|
<div>
|
|
764
771
|
<p class="head-title" ${o ? "" : "hidden"}>${a}</p>
|
|
@@ -770,9 +777,9 @@ class _t extends W {
|
|
|
770
777
|
<section class="time-panel" part="time">
|
|
771
778
|
<span class="icon" aria-hidden="true">${K}</span>
|
|
772
779
|
<div class="time-grid" data-meridiem="${this._is12h() ? "true" : "false"}">
|
|
773
|
-
<div><label>${c(i.hour)}</label><select data-segment="hours" aria-label="${c(i.hour)}">${
|
|
774
|
-
<div><label>${c(i.minute)}</label><select data-segment="minutes" aria-label="${c(i.minute)}">${
|
|
775
|
-
${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem" aria-label="${c(i.meridiem)}"><option value="am" ${
|
|
780
|
+
<div><label>${c(i.hour)}</label><select data-segment="hours" aria-label="${c(i.hour)}">${r.hours}</select></div>
|
|
781
|
+
<div><label>${c(i.minute)}</label><select data-segment="minutes" aria-label="${c(i.minute)}">${r.minutes}</select></div>
|
|
782
|
+
${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem" aria-label="${c(i.meridiem)}"><option value="am" ${r.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${r.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
|
|
776
783
|
</div>
|
|
777
784
|
</section>
|
|
778
785
|
</div>
|
|
@@ -786,18 +793,18 @@ class _t extends W {
|
|
|
786
793
|
return e ? d : `
|
|
787
794
|
<style>${mt}</style>
|
|
788
795
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
789
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${
|
|
796
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${s}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
790
797
|
`;
|
|
791
798
|
}
|
|
792
799
|
_syncCalendar(t) {
|
|
793
|
-
const e = (
|
|
800
|
+
const e = (s, n) => {
|
|
794
801
|
if (n == null || n === "") {
|
|
795
|
-
t.hasAttribute(
|
|
802
|
+
t.hasAttribute(s) && t.removeAttribute(s);
|
|
796
803
|
return;
|
|
797
804
|
}
|
|
798
|
-
t.getAttribute(
|
|
799
|
-
}, i = (
|
|
800
|
-
n ? e(
|
|
805
|
+
t.getAttribute(s) !== n && t.setAttribute(s, n);
|
|
806
|
+
}, i = (s, n) => {
|
|
807
|
+
n ? e(s, "") : e(s, null);
|
|
801
808
|
};
|
|
802
809
|
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"));
|
|
803
810
|
const o = this.getAttribute("size") || "sm", a = t.classList.contains("dt-calendar-inline");
|
|
@@ -820,20 +827,20 @@ class _t extends W {
|
|
|
820
827
|
_setClosestOptionValue(t, e) {
|
|
821
828
|
const i = Array.from(t.options).map((a) => Number(a.value)).filter((a) => Number.isFinite(a));
|
|
822
829
|
if (!i.length) return;
|
|
823
|
-
let
|
|
830
|
+
let r = i[0], o = Math.abs(r - e);
|
|
824
831
|
for (let a = 1; a < i.length; a += 1) {
|
|
825
|
-
const
|
|
826
|
-
n < o && (
|
|
832
|
+
const s = i[a], n = Math.abs(s - e);
|
|
833
|
+
n < o && (r = s, o = n);
|
|
827
834
|
}
|
|
828
|
-
t.value = String(
|
|
835
|
+
t.value = String(r);
|
|
829
836
|
}
|
|
830
837
|
_syncOverlayState() {
|
|
831
838
|
if (!this._overlay) return;
|
|
832
839
|
this._syncOverlayHostZIndex();
|
|
833
840
|
const t = this._isMobileSheet();
|
|
834
841
|
this._ensureOverlayContent(t), this._syncDismissableLayer();
|
|
835
|
-
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"),
|
|
836
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
842
|
+
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), r = this._overlay.querySelector(".footer");
|
|
843
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), r && (r.hidden = !this._showFooter());
|
|
837
844
|
const o = this._overlay.querySelector(".head-title");
|
|
838
845
|
if (o) {
|
|
839
846
|
const l = (this.getAttribute("label") || "").trim();
|
|
@@ -841,8 +848,8 @@ class _t extends W {
|
|
|
841
848
|
}
|
|
842
849
|
const a = this._overlay.querySelector(".head-meta");
|
|
843
850
|
a && (a.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : e.selectDate);
|
|
844
|
-
const
|
|
845
|
-
|
|
851
|
+
const s = this._overlay.querySelector(".dt-calendar");
|
|
852
|
+
s && this._syncCalendar(s);
|
|
846
853
|
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"]');
|
|
847
854
|
if (d) {
|
|
848
855
|
const l = this._is12h() ? n.hours % 12 || 12 : n.hours;
|
|
@@ -858,18 +865,18 @@ class _t extends W {
|
|
|
858
865
|
this._syncOverlayState();
|
|
859
866
|
}
|
|
860
867
|
_applyTimeFromSurface(t) {
|
|
861
|
-
const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'),
|
|
868
|
+
const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), r = t.querySelector('select[data-segment="meridiem"]');
|
|
862
869
|
if (!e || !i) return;
|
|
863
870
|
const o = Number(e.value), a = Number(i.value);
|
|
864
871
|
if (!Number.isFinite(o) || !Number.isFinite(a)) return;
|
|
865
|
-
let
|
|
872
|
+
let s = o;
|
|
866
873
|
if (this._is12h()) {
|
|
867
|
-
const n =
|
|
868
|
-
n === "pm" &&
|
|
874
|
+
const n = r?.value === "pm" ? "pm" : "am";
|
|
875
|
+
n === "pm" && s < 12 && (s += 12), n === "am" && s === 12 && (s = 0);
|
|
869
876
|
}
|
|
870
877
|
this._pending = this._clampState({
|
|
871
878
|
date: this._pending.date,
|
|
872
|
-
time: `${p(
|
|
879
|
+
time: `${p(s)}:${p(a)}`
|
|
873
880
|
}), this._emitInput("time");
|
|
874
881
|
}
|
|
875
882
|
_onRootClick(t) {
|
|
@@ -886,8 +893,8 @@ class _t extends W {
|
|
|
886
893
|
return;
|
|
887
894
|
}
|
|
888
895
|
if (this._isInlineMode() && i === "now") {
|
|
889
|
-
const
|
|
890
|
-
this._pending = this._clampState({ date:
|
|
896
|
+
const r = /* @__PURE__ */ new Date(), o = String(r.getMonth() + 1).padStart(2, "0"), a = String(r.getDate()).padStart(2, "0"), s = `${r.getFullYear()}-${o}-${a}`, n = `${p(r.getHours())}:${p(r.getMinutes())}`;
|
|
897
|
+
this._pending = this._clampState({ date: s, time: n }), this._emitInput("now"), this._updateHostState();
|
|
891
898
|
return;
|
|
892
899
|
}
|
|
893
900
|
if (this._isInlineMode() && i === "cancel") {
|
|
@@ -929,12 +936,12 @@ class _t extends W {
|
|
|
929
936
|
this._commit({ date: null, time: null }, "blur");
|
|
930
937
|
return;
|
|
931
938
|
}
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
939
|
+
const r = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
|
|
940
|
+
if (!r) {
|
|
934
941
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
|
|
935
942
|
return;
|
|
936
943
|
}
|
|
937
|
-
const o = this._parseDateInput(
|
|
944
|
+
const o = this._parseDateInput(r[1]), a = y(r[2]) ? r[2] : null;
|
|
938
945
|
if (!o || !a) {
|
|
939
946
|
this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
|
|
940
947
|
return;
|
|
@@ -969,8 +976,8 @@ class _t extends W {
|
|
|
969
976
|
return;
|
|
970
977
|
}
|
|
971
978
|
if (i === "now") {
|
|
972
|
-
const
|
|
973
|
-
this._pending = this._clampState({ date:
|
|
979
|
+
const r = /* @__PURE__ */ new Date(), o = String(r.getMonth() + 1).padStart(2, "0"), a = String(r.getDate()).padStart(2, "0"), s = `${r.getFullYear()}-${o}-${a}`, n = `${p(r.getHours())}:${p(r.getMinutes())}`;
|
|
980
|
+
this._pending = this._clampState({ date: s, time: n }), this._emitInput("now"), this._renderOverlay();
|
|
974
981
|
return;
|
|
975
982
|
}
|
|
976
983
|
i === "apply" && (this._commit(this._pending, "apply"), this._setOpen(!1, "apply"));
|
|
@@ -984,7 +991,7 @@ class _t extends W {
|
|
|
984
991
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
985
992
|
const e = t.target;
|
|
986
993
|
if (!e || e.tagName.toLowerCase() !== "ui-calendar") return;
|
|
987
|
-
const i = t.type,
|
|
994
|
+
const i = t.type, r = t.detail, o = E(i === "select" ? r?.value || null : r?.value);
|
|
988
995
|
if (o) {
|
|
989
996
|
if (this._pending = this._clampState({ date: o, time: this._pending.time || "09:00" }), this._emitInput("calendar"), this._shouldAutoCommit() && this._pending.time) {
|
|
990
997
|
this._commit(this._pending, "calendar"), this._setOpen(!1, "calendar");
|
|
@@ -1003,16 +1010,16 @@ class _t extends W {
|
|
|
1003
1010
|
}
|
|
1004
1011
|
_updateHostState() {
|
|
1005
1012
|
if (!this._hasView) return;
|
|
1006
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "",
|
|
1013
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, o = !!x(this._value), a = this.getAttribute("name") || "", s = this._allowInput() ? this._draft : this._formatDisplay(this._value), n = this._isInlineMode(), d = this._translations(), _ = r ? "error" : this._state();
|
|
1007
1014
|
this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
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"]'),
|
|
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 !==
|
|
1015
|
+
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"]'), v = this.root.querySelector(".hint"), I = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
|
|
1016
|
+
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 !== s && (l.value = s), 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", r ? "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()), v && (v.id = this._hintId, v.hidden = !e, v.textContent = e), I && (I.id = this._errorId, I.hidden = !r, I.textContent = r), l) {
|
|
1010
1017
|
const f = [];
|
|
1011
|
-
e &&
|
|
1018
|
+
e && v && !v.hidden && f.push(this._hintId), r && f.push(this._errorId), J(l, this, this._uid, f);
|
|
1012
1019
|
}
|
|
1013
1020
|
k && (k.disabled = !a, k.name = a, k.value = x(this._value) || "");
|
|
1014
1021
|
const C = this.root.querySelector(".field");
|
|
1015
|
-
C && (C.dataset.open = this._open && !n ? "true" : "false", C.dataset.invalid =
|
|
1022
|
+
C && (C.dataset.open = this._open && !n ? "true" : "false", C.dataset.invalid = r ? "true" : "false", C.dataset.state = _);
|
|
1016
1023
|
const u = this.root.querySelector(".inline-panel");
|
|
1017
1024
|
if (u) {
|
|
1018
1025
|
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);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("./calendar-CzpWDxLc.js"),I=require("./scroll-lock-BX6e3Ced.js"),v=require("./positioner-DZ1FW6A9.js"),w=new Map,N=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function u(t){return String(t).padStart(2,"0")}function $(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function O(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function L(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 U(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 F(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 P(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 C(t){try{return new Intl.DateTimeFormat(t),!0}catch{return!1}}function z(t){const e=(t||"").trim();return e&&C(e)?e:typeof navigator<"u"&&navigator.language&&C(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 D(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 A(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 Y(t){if(!t)return null;const e=m(t);return e||D(t)?.date||null}function k(t){if(!t)return null;const e=D(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function q(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 B(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=L(e),s=U(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 q(t,e)}function x(t,e){const n=m(t.trim());if(n)return n;const r=O(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map(b=>b.trim()).filter(Boolean);if(i.length!==3)return null;const s=$(i[0]),a=$(i[1]),h=$(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,g=p?a:s;if(f<1e3||c<1||c>12||g<1||g>31)return null;const T=`${f}-${u(c)}-${u(g)}`;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 H(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 E(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 W(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 Z(t,e){const n=D(t),r=D(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 _(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 R(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function G(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,b=p==="bottom"?a:s;T>0&&b<=T+N?c=p:c=s>=a?"bottom":"top"}const g=v.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(g.y),left:Math.round(g.x),placement:c}}function J(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function K(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function V(){return I.acquireBodyScrollLock()}exports.clampDateIso=W;exports.clampTime=E;exports.combineDateTime=A;exports.compareDateTimes=Z;exports.compareTimes=S;exports.computeLastDaysRange=R;exports.computeMonthRange=_;exports.computePopoverPosition=G;exports.eventOriginatesWithin=P;exports.formatDateForDisplay=B;exports.formatTime=M;exports.isTruthyAttr=F;exports.lockBodyScroll=V;exports.normalizeDateIso=m;exports.normalizeLocale=z;exports.parseConstraintDate=Y;exports.parseConstraintDateTime=k;exports.parseTimeInput=d;exports.parseUserDateInput=x;exports.rafThrottle=J;exports.shouldUseMobileSheet=K;exports.splitDateTime=D;exports.to12hDisplay=H;
|