@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 et } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { s as D, a as E } from "./control-name-Bpj7F34X.mjs";
|
|
3
3
|
import { c as it } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
-
import { r as
|
|
5
|
-
import { r as
|
|
4
|
+
import { r as rt, c as K } from "./calendar-DkSDFg33.mjs";
|
|
5
|
+
import { r as nt, e as st, i as v, s as at, b as ot, p as Z, f as W, a as Y, l as j, c as lt, d as k, g as dt, h as ut, n as L } from "./date-time-utils-zAx4ghvC.mjs";
|
|
6
6
|
let ct = 0;
|
|
7
7
|
const pt = `
|
|
8
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -24,14 +24,14 @@ const pt = `
|
|
|
24
24
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent),
|
|
25
25
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 92%, var(--ui-color-surface-alt, #f8fafc))
|
|
26
26
|
);
|
|
27
|
-
--ui-dp-border: color-
|
|
27
|
+
--ui-dp-border: var(--ui-color-line, var(--ui-color-border, #cbd5e1));
|
|
28
28
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
29
29
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
30
30
|
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
31
31
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
32
|
-
--ui-dp-radius:
|
|
32
|
+
--ui-dp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
33
33
|
--ui-dp-panel-radius: calc(var(--ui-dp-radius) + 2px);
|
|
34
|
-
--ui-dp-field-error: var(--ui-color-danger, #dc2626);
|
|
34
|
+
--ui-dp-field-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
35
35
|
--ui-dp-focus-ring: color-mix(in srgb, var(--ui-dp-accent) 26%, transparent);
|
|
36
36
|
--ui-dp-z: 1600;
|
|
37
37
|
--ui-dp-duration: 160ms;
|
|
@@ -70,11 +70,12 @@ const pt = `
|
|
|
70
70
|
.required { color: var(--ui-dp-field-error); font-size: 11px; }
|
|
71
71
|
|
|
72
72
|
.fields {
|
|
73
|
+
box-sizing: border-box;
|
|
73
74
|
display: grid;
|
|
74
75
|
grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto auto;
|
|
75
76
|
align-items: center;
|
|
76
77
|
gap: 8px;
|
|
77
|
-
min-block-size:
|
|
78
|
+
min-block-size: var(--ui-control-height-2, 32px);
|
|
78
79
|
border: 1px solid var(--ui-dp-border);
|
|
79
80
|
border-radius: var(--ui-dp-radius);
|
|
80
81
|
padding: 0 10px 0 11px;
|
|
@@ -88,23 +89,27 @@ const pt = `
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
.fields:focus-within {
|
|
91
|
-
border-color: color
|
|
92
|
-
|
|
92
|
+
border-color: var(--ui-ring-color, var(--ui-dp-accent));
|
|
93
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-dp-accent));
|
|
94
|
+
outline-offset: -1px;
|
|
95
|
+
box-shadow: none;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
.fields[data-open="true"] {
|
|
96
|
-
border-color: color
|
|
97
|
-
|
|
99
|
+
border-color: var(--ui-ring-color, var(--ui-dp-accent));
|
|
100
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-dp-accent));
|
|
101
|
+
outline-offset: -1px;
|
|
102
|
+
box-shadow: none;
|
|
98
103
|
}
|
|
99
104
|
|
|
100
105
|
.fields[data-invalid="true"] {
|
|
101
106
|
border-color: color-mix(in srgb, var(--ui-dp-field-error) 68%, transparent);
|
|
102
|
-
box-shadow: 0 0 0
|
|
107
|
+
box-shadow: 0 0 0 1px var(--ui-dp-field-error);
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
.fields[data-state="success"]:not([data-invalid="true"]) {
|
|
106
111
|
border-color: color-mix(in srgb, var(--ui-dp-success) 56%, var(--ui-dp-border));
|
|
107
|
-
box-shadow: 0 0 0
|
|
112
|
+
box-shadow: 0 0 0 1px var(--ui-dp-success);
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
.fields[data-state="loading"] {
|
|
@@ -132,14 +137,14 @@ const pt = `
|
|
|
132
137
|
color: var(--ui-dp-text);
|
|
133
138
|
min-inline-size: 0;
|
|
134
139
|
inline-size: 100%;
|
|
135
|
-
padding:
|
|
140
|
+
padding: 0;
|
|
136
141
|
font: 500 14px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
137
142
|
letter-spacing: 0.005em;
|
|
138
143
|
outline: none;
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
.input::placeholder {
|
|
142
|
-
color: color-mix(in srgb, var(--ui-dp-text)
|
|
147
|
+
color: var(--ui-color-placeholder, color-mix(in srgb, var(--ui-dp-text) 62%, transparent));
|
|
143
148
|
}
|
|
144
149
|
|
|
145
150
|
.sep {
|
|
@@ -151,8 +156,8 @@ const pt = `
|
|
|
151
156
|
.btn {
|
|
152
157
|
border: 0;
|
|
153
158
|
background: transparent;
|
|
154
|
-
inline-size:
|
|
155
|
-
block-size:
|
|
159
|
+
inline-size: var(--ui-dp-action-size, 24px);
|
|
160
|
+
block-size: var(--ui-dp-action-size, 24px);
|
|
156
161
|
border-radius: 8px;
|
|
157
162
|
color: color-mix(in srgb, var(--ui-dp-text) 72%, transparent);
|
|
158
163
|
cursor: pointer;
|
|
@@ -330,14 +335,14 @@ const pt = `
|
|
|
330
335
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent),
|
|
331
336
|
color-mix(in srgb, var(--ui-color-surface, #ffffff) 92%, var(--ui-color-surface-alt, #f8fafc))
|
|
332
337
|
);
|
|
333
|
-
--ui-dp-border: color-
|
|
338
|
+
--ui-dp-border: var(--ui-color-line, var(--ui-color-border, #cbd5e1));
|
|
334
339
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
335
340
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
336
341
|
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
337
342
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
338
|
-
--ui-dp-radius:
|
|
343
|
+
--ui-dp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
339
344
|
--ui-dp-panel-radius: calc(var(--ui-dp-radius) + 2px);
|
|
340
|
-
--ui-dp-field-error: var(--ui-color-danger, #dc2626);
|
|
345
|
+
--ui-dp-field-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
341
346
|
--ui-dp-focus-ring: color-mix(in srgb, var(--ui-dp-accent) 26%, transparent);
|
|
342
347
|
--ui-dp-duration: 160ms;
|
|
343
348
|
--ui-dp-ease: cubic-bezier(0.2, 0.9, 0.24, 1);
|
|
@@ -442,16 +447,16 @@ function _(c) {
|
|
|
442
447
|
function yt(c, t) {
|
|
443
448
|
const e = c.trim();
|
|
444
449
|
if (!e) return { start: null, end: null };
|
|
445
|
-
const i = e.split(/\s(?:—|–|to)\s/i).map((
|
|
450
|
+
const i = e.split(/\s(?:—|–|to)\s/i).map((n) => n.trim()).filter(Boolean);
|
|
446
451
|
if (i.length > 1) {
|
|
447
|
-
const
|
|
448
|
-
return { start:
|
|
452
|
+
const n = k(i[0] || "", t), d = k(i[1] || "", t);
|
|
453
|
+
return { start: n, end: d };
|
|
449
454
|
}
|
|
450
455
|
return { start: k(e, t), end: null };
|
|
451
456
|
}
|
|
452
457
|
class gt extends et {
|
|
453
458
|
constructor() {
|
|
454
|
-
super(...arguments), this._value = { start: null, end: null }, this._pending = { start: null, end: null }, this._draftStart = "", this._draftEnd = "", this._draftSingle = "", 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._overlayMode = null, this._uid = `ui-drp-${++ct}`, this._singleId = `${this._uid}-single`, this._startId = `${this._uid}-start`, this._endId = `${this._uid}-end`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._panelTitleId = `${this._uid}-panel-title`, this._overlayFocusedOnOpen = !1, this._inlineCalendarFramePending = !1, this._inlineCalendarUpgradePending = !1, this._schedulePosition =
|
|
459
|
+
super(...arguments), this._value = { start: null, end: null }, this._pending = { start: null, end: null }, this._draftStart = "", this._draftEnd = "", this._draftSingle = "", 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._overlayMode = null, this._uid = `ui-drp-${++ct}`, this._singleId = `${this._uid}-single`, this._startId = `${this._uid}-start`, this._endId = `${this._uid}-end`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._panelTitleId = `${this._uid}-panel-title`, this._overlayFocusedOnOpen = !1, this._inlineCalendarFramePending = !1, this._inlineCalendarUpgradePending = !1, this._schedulePosition = nt(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
|
|
455
460
|
st(t, [this._overlay]) || this._schedulePosition.run();
|
|
456
461
|
}, this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendarChange(t);
|
|
457
462
|
}
|
|
@@ -495,7 +500,7 @@ class gt extends et {
|
|
|
495
500
|
connectedCallback() {
|
|
496
501
|
if (super.connectedCallback(), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("input", this._onRootInputBound), this.root.addEventListener("focusout", this._onRootBlurBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), !this._isInitialized) {
|
|
497
502
|
const t = J(this.getAttribute("value") || this.getAttribute("default-value")), e = this._normalizePending(t);
|
|
498
|
-
this._value = e, this._pending = { ...e }, this._refreshDraftFromValue(), this._open = this.hasAttribute("open") ||
|
|
503
|
+
this._value = e, this._pending = { ...e }, this._refreshDraftFromValue(), this._open = this.hasAttribute("open") || v(this.getAttribute("default-open")), this._isInitialized = !0;
|
|
499
504
|
}
|
|
500
505
|
this._open && !this._isInlineMode() && this._ensureOverlay(), this._isInlineMode() && this._scheduleInlineCalendarSync();
|
|
501
506
|
}
|
|
@@ -531,31 +536,31 @@ class gt extends et {
|
|
|
531
536
|
return this.hasAttribute("readonly");
|
|
532
537
|
}
|
|
533
538
|
_clearable() {
|
|
534
|
-
return
|
|
539
|
+
return v(this.getAttribute("clearable"), !0);
|
|
535
540
|
}
|
|
536
541
|
_closeOnSelect() {
|
|
537
|
-
return
|
|
542
|
+
return v(this.getAttribute("close-on-select"), !1);
|
|
538
543
|
}
|
|
539
544
|
_shouldAutoCommit() {
|
|
540
545
|
return this._closeOnSelect() || !this._showFooter();
|
|
541
546
|
}
|
|
542
547
|
_showFooter() {
|
|
543
|
-
return
|
|
548
|
+
return v(this.getAttribute("show-footer"), !0);
|
|
544
549
|
}
|
|
545
550
|
_isBare() {
|
|
546
|
-
return
|
|
551
|
+
return v(this.getAttribute("bare"), !1);
|
|
547
552
|
}
|
|
548
553
|
_allowPartial() {
|
|
549
|
-
return
|
|
554
|
+
return v(this.getAttribute("allow-partial"), !0);
|
|
550
555
|
}
|
|
551
556
|
_allowSameDay() {
|
|
552
|
-
return
|
|
557
|
+
return v(this.getAttribute("allow-same-day"), !0);
|
|
553
558
|
}
|
|
554
559
|
_locale() {
|
|
555
560
|
return ot(this.getAttribute("locale"));
|
|
556
561
|
}
|
|
557
562
|
_translations() {
|
|
558
|
-
return
|
|
563
|
+
return rt(
|
|
559
564
|
this.getAttribute("locale"),
|
|
560
565
|
this.getAttribute("translations")
|
|
561
566
|
);
|
|
@@ -626,8 +631,8 @@ class gt extends et {
|
|
|
626
631
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
627
632
|
}
|
|
628
633
|
_normalizePending(t) {
|
|
629
|
-
const { min: e, max: i } = this._resolvedBounds(),
|
|
630
|
-
return !
|
|
634
|
+
const { min: e, max: i } = this._resolvedBounds(), r = t.start ? Y(t.start, e, i) : null, n = t.end ? Y(t.end, e, i) : null;
|
|
635
|
+
return !r || !n ? { start: r, end: n } : K(r, n) > 0 ? { start: n, end: r } : { start: r, end: n };
|
|
631
636
|
}
|
|
632
637
|
_canCommit(t) {
|
|
633
638
|
return !t.start && !t.end ? !0 : !(!this._allowPartial() && (!t.start || !t.end) || t.start && t.end && !this._allowSameDay() && t.start === t.end);
|
|
@@ -692,18 +697,18 @@ class gt extends et {
|
|
|
692
697
|
if (!t || !e) return;
|
|
693
698
|
const i = t.getBoundingClientRect();
|
|
694
699
|
e.style.setProperty("--ui-drp-panel-width", `${Math.round(i.width)}px`);
|
|
695
|
-
const
|
|
700
|
+
const r = e.getBoundingClientRect(), n = e.getAttribute("data-placement"), d = lt(
|
|
696
701
|
i,
|
|
697
|
-
|
|
702
|
+
r,
|
|
698
703
|
8,
|
|
699
704
|
8,
|
|
700
|
-
|
|
705
|
+
n === "top" ? "top" : n === "bottom" ? "bottom" : null
|
|
701
706
|
);
|
|
702
707
|
e.style.position = "absolute", e.style.top = `${Math.round(d.top)}px`, e.style.left = `${Math.round(d.left)}px`, e.setAttribute("data-placement", d.placement);
|
|
703
708
|
}
|
|
704
709
|
_renderPanelInner(t) {
|
|
705
|
-
const e = this._translations(), i = (this.getAttribute("label") || "").trim(),
|
|
706
|
-
<header class="header" part="header" ${
|
|
710
|
+
const e = this._translations(), i = (this.getAttribute("label") || "").trim(), r = !!i || t, n = t ? "true" : "false", d = `
|
|
711
|
+
<header class="header" part="header" ${r ? "" : "hidden"}>
|
|
707
712
|
<p class="title" id="${this._panelTitleId}" ${i ? "" : "hidden"}>${_(i)}</p>
|
|
708
713
|
${t ? `<button type="button" class="action" data-action="cancel">${_(e.cancel)}</button>` : ""}
|
|
709
714
|
</header>
|
|
@@ -722,7 +727,7 @@ class gt extends et {
|
|
|
722
727
|
return `
|
|
723
728
|
<style>${bt}</style>
|
|
724
729
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
725
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${
|
|
730
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${n}" aria-labelledby="${this._panelTitleId}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
726
731
|
`;
|
|
727
732
|
}
|
|
728
733
|
_syncCalendar(t) {
|
|
@@ -732,8 +737,8 @@ class gt extends et {
|
|
|
732
737
|
return;
|
|
733
738
|
}
|
|
734
739
|
t.getAttribute(h) !== u && t.setAttribute(h, u);
|
|
735
|
-
}, i = G(this._pending), { min:
|
|
736
|
-
e("selection", "range"), e("value", i), e("min",
|
|
740
|
+
}, i = G(this._pending), { min: r, max: n } = this._resolvedBounds();
|
|
741
|
+
e("selection", "range"), e("value", i), e("min", r), e("max", n), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
|
|
737
742
|
const a = this.getAttribute("size") || "sm";
|
|
738
743
|
e("size", a === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), e("outside-click", this.getAttribute("outside-click"));
|
|
739
744
|
const p = t.classList.contains("inline-calendar");
|
|
@@ -751,10 +756,10 @@ class gt extends et {
|
|
|
751
756
|
t && !this._releaseScrollLock ? this._releaseScrollLock = j() : !t && this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null), this._ensureOverlayContent(t);
|
|
752
757
|
const e = this._overlay.querySelector(".title"), i = this._overlay.querySelector(".panel, .sheet");
|
|
753
758
|
this._syncDismissableLayer();
|
|
754
|
-
const
|
|
755
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
759
|
+
const r = this._overlay.querySelector(".header"), n = this._overlay.querySelector(".presets"), d = this._overlay.querySelector(".footer"), a = this._translations();
|
|
760
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), r && (r.hidden = !(this.getAttribute("label") || "").trim() && !t);
|
|
756
761
|
const p = this._showFooter();
|
|
757
|
-
if (
|
|
762
|
+
if (n && (n.hidden = !p), d && (d.hidden = !p), e) {
|
|
758
763
|
const y = (this.getAttribute("label") || "").trim();
|
|
759
764
|
e.textContent = y, e.hidden = !y;
|
|
760
765
|
}
|
|
@@ -804,24 +809,24 @@ class gt extends et {
|
|
|
804
809
|
}
|
|
805
810
|
_updateHostState() {
|
|
806
811
|
if (!this._hasView) return;
|
|
807
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "",
|
|
808
|
-
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", a === "single-field" ? this._singleId : this._startId)), S && (S.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = a === "single-field" ? "true" : "false", f.dataset.invalid =
|
|
812
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, n = this._translations(), d = r ? "error" : this._state(), a = this._rangeVariant(), p = this._isInlineMode(), h = !!(this._value.start || this._value.end || this._pending.start || this._pending.end), u = this._isInteractionBlocked(), b = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), I = this.root.querySelector(".required"), f = this.root.querySelector(".fields"), o = this.root.querySelector(".single"), l = this.root.querySelector(".start"), s = this.root.querySelector(".end"), y = this.root.querySelector(".sep"), A = this.root.querySelector('.btn[data-action="clear"]'), m = this.root.querySelector('.btn[data-action="toggle"]'), x = this.root.querySelector(".hint"), C = this.root.querySelector(".error"), g = this.root.querySelector(".inline-panel"), q = this.root.querySelector(".inline-panel .presets"), R = this.root.querySelector(".inline-panel .footer"), O = this.root.querySelector(".hidden-range"), z = this.root.querySelector(".hidden-start"), P = this.root.querySelector(".hidden-end"), Q = this.root.querySelectorAll(".inline-panel .action");
|
|
813
|
+
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", a === "single-field" ? this._singleId : this._startId)), S && (S.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = a === "single-field" ? "true" : "false", f.dataset.invalid = r ? "true" : "false", f.dataset.open = this._open && !p ? "true" : "false", f.dataset.state = d, f.setAttribute("aria-disabled", u ? "true" : "false")), o && (o.value !== this._draftSingle && (o.value = this._draftSingle), o.id = this._singleId, o.hidden = a !== "single-field", o.readOnly = this._isReadonly() || u, o.disabled = u, o.required = this.hasAttribute("required"), o.placeholder = n.startEnd, o.autocomplete = "off", o.setAttribute("role", "combobox"), o.setAttribute("aria-haspopup", "dialog"), o.setAttribute("aria-controls", this._panelId), o.setAttribute("aria-expanded", p ? "false" : String(this._open)), o.setAttribute("aria-invalid", r ? "true" : "false"), D(o, this, t ? this._labelId : null, n.startEnd)), l && (l.value !== this._draftStart && (l.value = this._draftStart), l.id = this._startId, l.hidden = a === "single-field", l.readOnly = this._isReadonly() || u, l.disabled = u, l.required = this.hasAttribute("required"), l.placeholder = n.startDate, l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-expanded", p ? "false" : String(this._open)), l.setAttribute("aria-invalid", r ? "true" : "false"), D(l, this, t ? this._labelId : null, n.startDate)), s && (s.value !== this._draftEnd && (s.value = this._draftEnd), s.id = this._endId, s.hidden = a === "single-field", s.readOnly = this._isReadonly() || u, s.disabled = u, s.required = this.hasAttribute("required"), s.placeholder = n.endDate, s.autocomplete = "off", s.setAttribute("role", "combobox"), s.setAttribute("aria-haspopup", "dialog"), s.setAttribute("aria-controls", this._panelId), s.setAttribute("aria-expanded", p ? "false" : String(this._open)), s.setAttribute("aria-invalid", r ? "true" : "false"), D(s, this, t ? this._labelId : null, n.endDate)), y && (y.hidden = a === "single-field"), A && (A.hidden = !(this._clearable() && h), A.disabled = u, A.setAttribute("aria-label", n.clearDateRange)), m && (m.hidden = p, m.disabled = u, m.setAttribute("aria-expanded", p ? "false" : String(this._open)), m.setAttribute("aria-controls", this._panelId), m.setAttribute("aria-label", n.toggleCalendar)), x && (x.id = this._hintId, x.hidden = !e, x.textContent = e), C && (C.id = this._errorId, C.hidden = !r, C.textContent = r);
|
|
809
814
|
const w = [];
|
|
810
|
-
e && x && !x.hidden && w.push(this._hintId),
|
|
815
|
+
e && x && !x.hidden && w.push(this._hintId), r && w.push(this._errorId), E(o, this, `${this._uid}-single`, w), E(l, this, `${this._uid}-start`, w), E(s, this, `${this._uid}-end`, w), g && (g.hidden = !p, g.id = this._panelId, g.dataset.bare = this._isBare() ? "true" : "false", g.setAttribute("role", "dialog"), g.setAttribute("aria-modal", "false"), g.setAttribute("aria-label", t || n.selectDateRange));
|
|
811
816
|
const $ = this._showFooter();
|
|
812
817
|
q && (q.hidden = !$), R && (R.hidden = !$), Q.forEach((tt) => {
|
|
813
818
|
tt.disabled = u || this._isReadonly();
|
|
814
819
|
});
|
|
815
820
|
const M = this.root.querySelector('.inline-panel [data-action="preset-today"]');
|
|
816
|
-
M && (M.textContent =
|
|
821
|
+
M && (M.textContent = n.today);
|
|
817
822
|
const F = this.root.querySelector('.inline-panel [data-action="preset-last7"]');
|
|
818
|
-
F && (F.textContent =
|
|
823
|
+
F && (F.textContent = n.last7Days);
|
|
819
824
|
const V = this.root.querySelector('.inline-panel [data-action="preset-month"]');
|
|
820
|
-
V && (V.textContent =
|
|
825
|
+
V && (V.textContent = n.thisMonth);
|
|
821
826
|
const H = this.root.querySelector('.inline-panel [data-action="clear"]');
|
|
822
|
-
H && (H.textContent =
|
|
827
|
+
H && (H.textContent = n.clear);
|
|
823
828
|
const T = this.root.querySelector('.inline-panel [data-action="apply"]');
|
|
824
|
-
T && (T.textContent =
|
|
829
|
+
T && (T.textContent = n.apply);
|
|
825
830
|
const B = this.getAttribute("name") || "", U = this.getAttribute("name-start") || "", N = this.getAttribute("name-end") || "", X = this._value.start && this._value.end ? `${this._value.start}..${this._value.end}` : "";
|
|
826
831
|
if (O && (O.disabled = !B, O.name = B, O.value = X), z && (z.disabled = !!B || !U, z.name = U, z.value = this._value.start || ""), P && (P.disabled = !!B || !N, P.name = N, P.value = this._value.end || ""), p) {
|
|
827
832
|
this._scheduleInlineCalendarSync(), this._destroyOverlay();
|
|
@@ -832,21 +837,21 @@ class gt extends et {
|
|
|
832
837
|
_onRootClick(t) {
|
|
833
838
|
const e = t.target;
|
|
834
839
|
if (!e) return;
|
|
835
|
-
const i = e.closest("[data-action]"),
|
|
836
|
-
if (
|
|
837
|
-
if (
|
|
840
|
+
const i = e.closest("[data-action]"), r = i?.getAttribute("data-action");
|
|
841
|
+
if (r && !this._isInteractionBlocked()) {
|
|
842
|
+
if (r === "toggle") {
|
|
838
843
|
this._restoreFocusEl = i, this._setOpen(!this._open, "toggle");
|
|
839
844
|
return;
|
|
840
845
|
}
|
|
841
|
-
if (
|
|
846
|
+
if (r === "clear") {
|
|
842
847
|
this._commit({ start: null, end: null }, "clear");
|
|
843
848
|
return;
|
|
844
849
|
}
|
|
845
|
-
if (
|
|
850
|
+
if (r === "apply") {
|
|
846
851
|
this._commit(this._pending, "apply"), this._isInlineMode() || this._setOpen(!1, "apply");
|
|
847
852
|
return;
|
|
848
853
|
}
|
|
849
|
-
|
|
854
|
+
r === "cancel" && (this._pending = { ...this._value }, this._isInlineMode() || this._setOpen(!1, "cancel"), this._updateHostState());
|
|
850
855
|
}
|
|
851
856
|
}
|
|
852
857
|
_onRootInput(t) {
|
|
@@ -860,21 +865,21 @@ class gt extends et {
|
|
|
860
865
|
}
|
|
861
866
|
_commitFromDraft(t) {
|
|
862
867
|
if (this._rangeVariant() === "single-field") {
|
|
863
|
-
const
|
|
864
|
-
if (!
|
|
868
|
+
const n = this._draftSingle.trim();
|
|
869
|
+
if (!n)
|
|
865
870
|
return this._pending = { start: null, end: null }, this._commit(this._pending, t), !0;
|
|
866
|
-
const d = yt(
|
|
867
|
-
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(
|
|
871
|
+
const d = yt(n, this._locale());
|
|
872
|
+
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(n, "parse"), this._updateHostState(), !1) : (this._pending = this._normalizePending({ start: d.start, end: d.end || null }), this._commit(this._pending, t), !0);
|
|
868
873
|
}
|
|
869
|
-
const i = this._draftStart ? k(this._draftStart, this._locale()) : null,
|
|
870
|
-
return this._draftStart && !i || this._draftEnd && !
|
|
874
|
+
const i = this._draftStart ? k(this._draftStart, this._locale()) : null, r = this._draftEnd ? k(this._draftEnd, this._locale()) : null;
|
|
875
|
+
return this._draftStart && !i || this._draftEnd && !r ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(`${this._draftStart} ${this._draftEnd}`.trim(), "parse"), this._updateHostState(), !1) : (this._pending = this._normalizePending({ start: i, end: r }), this._commit(this._pending, t), !0);
|
|
871
876
|
}
|
|
872
877
|
_onRootBlur(t) {
|
|
873
878
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
874
879
|
const e = t, i = e.target;
|
|
875
880
|
if (!(i instanceof HTMLInputElement)) return;
|
|
876
|
-
const
|
|
877
|
-
|
|
881
|
+
const r = e.relatedTarget;
|
|
882
|
+
r && this._overlay?.contains(r) || this._open && !this._isInlineMode() || (i.classList.contains("single") || i.classList.contains("start") || i.classList.contains("end")) && (i.classList.contains("single") && (this._draftSingle = i.value), i.classList.contains("start") && (this._draftStart = i.value), i.classList.contains("end") && (this._draftEnd = i.value), this._commitFromDraft("blur"));
|
|
878
883
|
}
|
|
879
884
|
_onRootKeyDown(t) {
|
|
880
885
|
const e = t;
|
|
@@ -904,37 +909,37 @@ class gt extends et {
|
|
|
904
909
|
_onOverlayClick(t) {
|
|
905
910
|
const e = t.target;
|
|
906
911
|
if (!e) return;
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
909
|
-
if (
|
|
912
|
+
const r = e.closest("[data-action]")?.getAttribute("data-action");
|
|
913
|
+
if (r && !(this._isInteractionBlocked() || this._isReadonly())) {
|
|
914
|
+
if (r === "backdrop") {
|
|
910
915
|
this._setOpen(!1, "outside");
|
|
911
916
|
return;
|
|
912
917
|
}
|
|
913
|
-
if (
|
|
918
|
+
if (r === "clear") {
|
|
914
919
|
this._pending = { start: null, end: null }, this._emitInput("clear"), this._renderOverlay();
|
|
915
920
|
return;
|
|
916
921
|
}
|
|
917
|
-
if (
|
|
922
|
+
if (r === "cancel") {
|
|
918
923
|
this._pending = { ...this._value }, this._setOpen(!1, "cancel");
|
|
919
924
|
return;
|
|
920
925
|
}
|
|
921
|
-
if (
|
|
926
|
+
if (r === "apply") {
|
|
922
927
|
this._commit(this._pending, "apply"), this._setOpen(!1, "apply");
|
|
923
928
|
return;
|
|
924
929
|
}
|
|
925
|
-
if (
|
|
926
|
-
const
|
|
927
|
-
this._pending = this._normalizePending({ start:
|
|
930
|
+
if (r === "preset-today") {
|
|
931
|
+
const n = this._todayIso();
|
|
932
|
+
this._pending = this._normalizePending({ start: n, end: n }), this._emitInput("preset-today"), this._renderOverlay();
|
|
928
933
|
return;
|
|
929
934
|
}
|
|
930
|
-
if (
|
|
931
|
-
const
|
|
932
|
-
this._pending = this._normalizePending(dt(
|
|
935
|
+
if (r === "preset-last7") {
|
|
936
|
+
const n = this._todayIso();
|
|
937
|
+
this._pending = this._normalizePending(dt(n, 7)), this._emitInput("preset-last7"), this._renderOverlay();
|
|
933
938
|
return;
|
|
934
939
|
}
|
|
935
|
-
if (
|
|
936
|
-
const
|
|
937
|
-
this._pending = this._normalizePending(ut(
|
|
940
|
+
if (r === "preset-month") {
|
|
941
|
+
const n = this._todayIso();
|
|
942
|
+
this._pending = this._normalizePending(ut(n)), this._emitInput("preset-month"), this._renderOverlay();
|
|
938
943
|
}
|
|
939
944
|
}
|
|
940
945
|
}
|