@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,21 +1,22 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { E as et } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { s as D, a as E } from "./control-name-Bpj7F34X.mjs";
|
|
3
|
+
import { c as it } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
+
import { r as nt, c as K } from "./calendar-DbxYRdlv.mjs";
|
|
5
|
+
import { r as rt, e as st, i as m, 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-Cps2aSu2.mjs";
|
|
6
|
+
let ct = 0;
|
|
7
|
+
const pt = `
|
|
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
|
+
`, ht = `
|
|
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
|
+
`, ft = `
|
|
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>
|
|
18
|
-
`,
|
|
19
|
+
`, _t = `
|
|
19
20
|
:host {
|
|
20
21
|
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
21
22
|
--ui-dp-surface: linear-gradient(
|
|
@@ -25,7 +26,7 @@ const ct = `
|
|
|
25
26
|
);
|
|
26
27
|
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
|
|
27
28
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
28
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
29
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
29
30
|
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
30
31
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
31
32
|
--ui-dp-radius: 12px;
|
|
@@ -321,7 +322,7 @@ const ct = `
|
|
|
321
322
|
transform: rotate(360deg);
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
`,
|
|
325
|
+
`, bt = `
|
|
325
326
|
.ui-date-range-picker-overlay-host {
|
|
326
327
|
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
327
328
|
--ui-dp-surface: linear-gradient(
|
|
@@ -331,7 +332,7 @@ const ct = `
|
|
|
331
332
|
);
|
|
332
333
|
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
|
|
333
334
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
334
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
335
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
335
336
|
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
336
337
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
337
338
|
--ui-dp-radius: 12px;
|
|
@@ -420,7 +421,7 @@ const ct = `
|
|
|
420
421
|
to { opacity: 1; transform: translateY(0); }
|
|
421
422
|
}
|
|
422
423
|
`;
|
|
423
|
-
function
|
|
424
|
+
function J(c) {
|
|
424
425
|
if (!c) return { start: null, end: null };
|
|
425
426
|
try {
|
|
426
427
|
const t = JSON.parse(c), e = L(t?.start || null), i = L(t?.end || null);
|
|
@@ -429,7 +430,7 @@ function Y(c) {
|
|
|
429
430
|
return { start: null, end: null };
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
|
-
function
|
|
433
|
+
function G(c) {
|
|
433
434
|
return !c.start && !c.end ? null : JSON.stringify({
|
|
434
435
|
...c.start ? { start: c.start } : {},
|
|
435
436
|
...c.end ? { end: c.end } : {}
|
|
@@ -438,24 +439,27 @@ function J(c) {
|
|
|
438
439
|
function _(c) {
|
|
439
440
|
return c.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
440
441
|
}
|
|
441
|
-
function
|
|
442
|
+
function yt(c, t) {
|
|
442
443
|
const e = c.trim();
|
|
443
444
|
if (!e) return { start: null, end: null };
|
|
444
|
-
const i = e.split(/\s(?:—|–|to)\s/i).map((
|
|
445
|
+
const i = e.split(/\s(?:—|–|to)\s/i).map((r) => r.trim()).filter(Boolean);
|
|
445
446
|
if (i.length > 1) {
|
|
446
|
-
const
|
|
447
|
-
return { start:
|
|
447
|
+
const r = k(i[0] || "", t), d = k(i[1] || "", t);
|
|
448
|
+
return { start: r, end: d };
|
|
448
449
|
}
|
|
449
|
-
return { start:
|
|
450
|
+
return { start: k(e, t), end: null };
|
|
450
451
|
}
|
|
451
|
-
class
|
|
452
|
+
class gt extends et {
|
|
452
453
|
constructor() {
|
|
453
|
-
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-${++
|
|
454
|
-
|
|
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 = rt(() => 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
|
+
st(t, [this._overlay]) || this._schedulePosition.run();
|
|
455
456
|
}, this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendarChange(t);
|
|
456
457
|
}
|
|
457
458
|
static get observedAttributes() {
|
|
458
459
|
return [
|
|
460
|
+
"aria-label",
|
|
461
|
+
"aria-description",
|
|
462
|
+
"aria-describedby",
|
|
459
463
|
"open",
|
|
460
464
|
"default-open",
|
|
461
465
|
"value",
|
|
@@ -490,7 +494,7 @@ class yt extends tt {
|
|
|
490
494
|
}
|
|
491
495
|
connectedCallback() {
|
|
492
496
|
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) {
|
|
493
|
-
const t =
|
|
497
|
+
const t = J(this.getAttribute("value") || this.getAttribute("default-value")), e = this._normalizePending(t);
|
|
494
498
|
this._value = e, this._pending = { ...e }, this._refreshDraftFromValue(), this._open = this.hasAttribute("open") || m(this.getAttribute("default-open")), this._isInitialized = !0;
|
|
495
499
|
}
|
|
496
500
|
this._open && !this._isInlineMode() && this._ensureOverlay(), this._isInlineMode() && this._scheduleInlineCalendarSync();
|
|
@@ -499,7 +503,7 @@ class yt extends tt {
|
|
|
499
503
|
this.root.removeEventListener("click", this._onRootClickBound), this.root.removeEventListener("input", this._onRootInputBound), this.root.removeEventListener("focusout", this._onRootBlurBound), this.root.removeEventListener("keydown", this._onRootKeyDownBound), this._destroyOverlay(), super.disconnectedCallback();
|
|
500
504
|
}
|
|
501
505
|
attributeChangedCallback(t, e, i) {
|
|
502
|
-
if (e !== i && (t === "value" && !this._syncing && (this._value = this._normalizePending(
|
|
506
|
+
if (e !== i && (t === "value" && !this._syncing && (this._value = this._normalizePending(J(i)), this._pending = { ...this._value }, this._refreshDraftFromValue(), this._inlineError = "", this._syncValueAttribute(this._value)), t === "open" && !this._syncing && (this._open = this.hasAttribute("open"), this._syncOverlay("attribute")), t === "mode" && this._syncOverlay("attribute"), t === "disabled" && this.hasAttribute("disabled") && this._setOpen(!1, "outside"), (t === "min" || t === "max") && !this._syncing && (this._value = this._normalizePending(this._value), this._pending = this._normalizePending(this._pending), this._syncValueAttribute(this._value), this._refreshDraftFromValue()), t === "state" && this._state() === "loading" && this._setOpen(!1, "outside"), !!this.isConnected)) {
|
|
503
507
|
if (!this._hasView) {
|
|
504
508
|
this.requestRender();
|
|
505
509
|
return;
|
|
@@ -511,7 +515,7 @@ class yt extends tt {
|
|
|
511
515
|
return (this.getAttribute("mode") || "popover") === "inline";
|
|
512
516
|
}
|
|
513
517
|
_isMobileSheet() {
|
|
514
|
-
return
|
|
518
|
+
return at(this.getAttribute("mode"));
|
|
515
519
|
}
|
|
516
520
|
_isDisabled() {
|
|
517
521
|
return this.hasAttribute("disabled");
|
|
@@ -548,10 +552,10 @@ class yt extends tt {
|
|
|
548
552
|
return m(this.getAttribute("allow-same-day"), !0);
|
|
549
553
|
}
|
|
550
554
|
_locale() {
|
|
551
|
-
return
|
|
555
|
+
return ot(this.getAttribute("locale"));
|
|
552
556
|
}
|
|
553
557
|
_translations() {
|
|
554
|
-
return
|
|
558
|
+
return nt(
|
|
555
559
|
this.getAttribute("locale"),
|
|
556
560
|
this.getAttribute("translations")
|
|
557
561
|
);
|
|
@@ -560,10 +564,10 @@ class yt extends tt {
|
|
|
560
564
|
return (this.getAttribute("range-variant") || "two-fields") === "single-field" ? "single-field" : "two-fields";
|
|
561
565
|
}
|
|
562
566
|
_minIso() {
|
|
563
|
-
return
|
|
567
|
+
return Z(this.getAttribute("min"));
|
|
564
568
|
}
|
|
565
569
|
_maxIso() {
|
|
566
|
-
return
|
|
570
|
+
return Z(this.getAttribute("max"));
|
|
567
571
|
}
|
|
568
572
|
_todayIso() {
|
|
569
573
|
const t = /* @__PURE__ */ new Date(), e = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0");
|
|
@@ -571,14 +575,14 @@ class yt extends tt {
|
|
|
571
575
|
}
|
|
572
576
|
_resolvedBounds() {
|
|
573
577
|
let t = this._minIso(), e = this._maxIso();
|
|
574
|
-
if (t && e &&
|
|
578
|
+
if (t && e && K(t, e) > 0) {
|
|
575
579
|
const i = t;
|
|
576
580
|
t = e, e = i;
|
|
577
581
|
}
|
|
578
582
|
return { min: t, max: e };
|
|
579
583
|
}
|
|
580
584
|
_refreshDraftFromValue() {
|
|
581
|
-
const t =
|
|
585
|
+
const t = W(this._value.start, this._locale(), "locale", null), e = W(this._value.end, this._locale(), "locale", null);
|
|
582
586
|
this._draftStart = t, this._draftEnd = e, this._draftSingle = [t, e].filter(Boolean).join(" — ");
|
|
583
587
|
}
|
|
584
588
|
_syncOpenAttribute(t) {
|
|
@@ -590,7 +594,7 @@ class yt extends tt {
|
|
|
590
594
|
}
|
|
591
595
|
}
|
|
592
596
|
_syncValueAttribute(t) {
|
|
593
|
-
const e =
|
|
597
|
+
const e = G(t);
|
|
594
598
|
this._syncing = !0;
|
|
595
599
|
try {
|
|
596
600
|
e ? this.getAttribute("value") !== e && this.setAttribute("value", e) : this.hasAttribute("value") && this.removeAttribute("value");
|
|
@@ -622,8 +626,8 @@ class yt extends tt {
|
|
|
622
626
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
623
627
|
}
|
|
624
628
|
_normalizePending(t) {
|
|
625
|
-
const { min: e, max: i } = this._resolvedBounds(),
|
|
626
|
-
return !
|
|
629
|
+
const { min: e, max: i } = this._resolvedBounds(), n = t.start ? Y(t.start, e, i) : null, r = t.end ? Y(t.end, e, i) : null;
|
|
630
|
+
return !n || !r ? { start: n, end: r } : K(n, r) > 0 ? { start: r, end: n } : { start: n, end: r };
|
|
627
631
|
}
|
|
628
632
|
_canCommit(t) {
|
|
629
633
|
return !t.start && !t.end ? !0 : !(!this._allowPartial() && (!t.start || !t.end) || t.start && t.end && !this._allowSameDay() && t.start === t.end);
|
|
@@ -660,7 +664,7 @@ class yt extends tt {
|
|
|
660
664
|
_ensureOverlay() {
|
|
661
665
|
if (this._overlay || typeof document > "u") return;
|
|
662
666
|
const t = document.createElement("div");
|
|
663
|
-
t.className = "ui-date-range-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("select", this._onOverlayCalendarBound), t.addEventListener("change", 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 =
|
|
667
|
+
t.className = "ui-date-range-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("select", this._onOverlayCalendarBound), t.addEventListener("change", 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 = j());
|
|
664
668
|
}
|
|
665
669
|
_syncOverlayHostZIndex() {
|
|
666
670
|
if (!this._overlay || typeof window > "u") return;
|
|
@@ -673,7 +677,7 @@ class yt extends tt {
|
|
|
673
677
|
_syncDismissableLayer() {
|
|
674
678
|
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
675
679
|
const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".fields");
|
|
676
|
-
t && (this._dismissableLayer =
|
|
680
|
+
t && (this._dismissableLayer = it({
|
|
677
681
|
node: t,
|
|
678
682
|
trigger: e,
|
|
679
683
|
closeOnEscape: !0,
|
|
@@ -688,18 +692,18 @@ class yt extends tt {
|
|
|
688
692
|
if (!t || !e) return;
|
|
689
693
|
const i = t.getBoundingClientRect();
|
|
690
694
|
e.style.setProperty("--ui-drp-panel-width", `${Math.round(i.width)}px`);
|
|
691
|
-
const
|
|
695
|
+
const n = e.getBoundingClientRect(), r = e.getAttribute("data-placement"), d = lt(
|
|
692
696
|
i,
|
|
693
|
-
|
|
697
|
+
n,
|
|
694
698
|
8,
|
|
695
699
|
8,
|
|
696
|
-
|
|
700
|
+
r === "top" ? "top" : r === "bottom" ? "bottom" : null
|
|
697
701
|
);
|
|
698
702
|
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);
|
|
699
703
|
}
|
|
700
704
|
_renderPanelInner(t) {
|
|
701
|
-
const e = this._translations(), i = (this.getAttribute("label") || "").trim(),
|
|
702
|
-
<header class="header" part="header" ${
|
|
705
|
+
const e = this._translations(), i = (this.getAttribute("label") || "").trim(), n = !!i || t, r = t ? "true" : "false", d = `
|
|
706
|
+
<header class="header" part="header" ${n ? "" : "hidden"}>
|
|
703
707
|
<p class="title" id="${this._panelTitleId}" ${i ? "" : "hidden"}>${_(i)}</p>
|
|
704
708
|
${t ? `<button type="button" class="action" data-action="cancel">${_(e.cancel)}</button>` : ""}
|
|
705
709
|
</header>
|
|
@@ -716,9 +720,9 @@ class yt extends tt {
|
|
|
716
720
|
</footer>
|
|
717
721
|
`;
|
|
718
722
|
return `
|
|
719
|
-
<style>${
|
|
723
|
+
<style>${bt}</style>
|
|
720
724
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
721
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${
|
|
725
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${r}" aria-labelledby="${this._panelTitleId}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
722
726
|
`;
|
|
723
727
|
}
|
|
724
728
|
_syncCalendar(t) {
|
|
@@ -728,12 +732,12 @@ class yt extends tt {
|
|
|
728
732
|
return;
|
|
729
733
|
}
|
|
730
734
|
t.getAttribute(h) !== u && t.setAttribute(h, u);
|
|
731
|
-
}, i =
|
|
732
|
-
e("selection", "range"), e("value", i), e("min",
|
|
733
|
-
const
|
|
734
|
-
e("size",
|
|
735
|
+
}, i = G(this._pending), { min: n, max: r } = this._resolvedBounds();
|
|
736
|
+
e("selection", "range"), e("value", i), e("min", n), e("max", r), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
|
|
737
|
+
const a = this.getAttribute("size") || "sm";
|
|
738
|
+
e("size", a === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), e("outside-click", this.getAttribute("outside-click"));
|
|
735
739
|
const p = t.classList.contains("inline-calendar");
|
|
736
|
-
|
|
740
|
+
a === "lg" ? (t.style.setProperty("--ui-calendar-day-height", "1.95em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.2em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.26em"), t.style.setProperty("--ui-calendar-gap", "0.42em"), t.style.setProperty("--ui-calendar-day-font-size", "0.78em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.7em"), t.style.setProperty("--ui-calendar-title-font-size", "0.88em")) : (t.style.setProperty("--ui-calendar-day-height", "2.4em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.14em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.22em"), t.style.setProperty("--ui-calendar-gap", "0.34em"), t.style.setProperty("--ui-calendar-day-font-size", "0.72em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.64em"), t.style.setProperty("--ui-calendar-title-font-size", "0.8em")), p ? (t.style.setProperty("--ui-calendar-day-height", a === "lg" ? "2.1em" : "1.92em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.08em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.14em"), t.style.setProperty("--ui-calendar-frame-padding", "0.28em"), t.style.setProperty("--ui-calendar-week-gap", "0.16em"), t.style.setProperty("--ui-calendar-control-height", "1.64em"), t.style.setProperty("--ui-calendar-gap", "0.2em"), t.style.setProperty("--ui-calendar-day-font-size", a === "lg" ? "0.76em" : "0.68em"), t.style.setProperty("--ui-calendar-weekday-font-size", a === "lg" ? "0.66em" : "0.58em"), t.style.setProperty("--ui-calendar-title-font-size", a === "lg" ? "0.84em" : "0.76em")) : (t.style.removeProperty("--ui-calendar-frame-padding"), t.style.removeProperty("--ui-calendar-week-gap"), t.style.removeProperty("--ui-calendar-control-height")), this._isReadonly() ? e("readonly", "") : e("readonly", null), this._isInteractionBlocked() ? e("disabled", "") : e("disabled", null), this._isBare() ? e("bare", "") : e("bare", null), e("tabindex", "-1"), e("aria-label", this.getAttribute("label") || this._translations().selectDateRange);
|
|
737
741
|
}
|
|
738
742
|
_ensureOverlayContent(t) {
|
|
739
743
|
if (!this._overlay) return;
|
|
@@ -744,31 +748,31 @@ class yt extends tt {
|
|
|
744
748
|
if (!this._overlay) return;
|
|
745
749
|
this._syncOverlayHostZIndex();
|
|
746
750
|
const t = this._isMobileSheet();
|
|
747
|
-
t && !this._releaseScrollLock ? this._releaseScrollLock =
|
|
751
|
+
t && !this._releaseScrollLock ? this._releaseScrollLock = j() : !t && this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null), this._ensureOverlayContent(t);
|
|
748
752
|
const e = this._overlay.querySelector(".title"), i = this._overlay.querySelector(".panel, .sheet");
|
|
749
753
|
this._syncDismissableLayer();
|
|
750
|
-
const
|
|
751
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
754
|
+
const n = this._overlay.querySelector(".header"), r = this._overlay.querySelector(".presets"), d = this._overlay.querySelector(".footer"), a = this._translations();
|
|
755
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), n && (n.hidden = !(this.getAttribute("label") || "").trim() && !t);
|
|
752
756
|
const p = this._showFooter();
|
|
753
|
-
if (
|
|
757
|
+
if (r && (r.hidden = !p), d && (d.hidden = !p), e) {
|
|
754
758
|
const y = (this.getAttribute("label") || "").trim();
|
|
755
759
|
e.textContent = y, e.hidden = !y;
|
|
756
760
|
}
|
|
757
761
|
const h = this._overlay.querySelector('[data-action="preset-today"]');
|
|
758
|
-
h && (h.textContent =
|
|
762
|
+
h && (h.textContent = a.today);
|
|
759
763
|
const u = this._overlay.querySelector('[data-action="preset-last7"]');
|
|
760
|
-
u && (u.textContent =
|
|
764
|
+
u && (u.textContent = a.last7Days);
|
|
761
765
|
const b = this._overlay.querySelector('[data-action="preset-month"]');
|
|
762
|
-
b && (b.textContent =
|
|
763
|
-
const
|
|
764
|
-
|
|
766
|
+
b && (b.textContent = a.thisMonth);
|
|
767
|
+
const S = this._overlay.querySelector('[data-action="clear"]');
|
|
768
|
+
S && (S.textContent = a.clear);
|
|
765
769
|
const I = this._overlay.querySelector('[data-action="cancel"]');
|
|
766
|
-
I && (I.textContent =
|
|
770
|
+
I && (I.textContent = a.cancel);
|
|
767
771
|
const f = this._overlay.querySelector('[data-action="apply"]');
|
|
768
|
-
f && (f.textContent =
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
y.disabled =
|
|
772
|
+
f && (f.textContent = a.apply);
|
|
773
|
+
const o = this._overlay.querySelectorAll(".action"), l = this._isInteractionBlocked() || this._isReadonly();
|
|
774
|
+
o.forEach((y) => {
|
|
775
|
+
y.disabled = l;
|
|
772
776
|
});
|
|
773
777
|
const s = this._overlay.querySelector(".drp-calendar");
|
|
774
778
|
s && (this._syncCalendar(s), this._open && !this._overlayFocusedOnOpen && (this._overlayFocusedOnOpen = !0, requestAnimationFrame(() => {
|
|
@@ -800,28 +804,26 @@ class yt extends tt {
|
|
|
800
804
|
}
|
|
801
805
|
_updateHostState() {
|
|
802
806
|
if (!this._hasView) return;
|
|
803
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "",
|
|
804
|
-
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for",
|
|
805
|
-
const
|
|
806
|
-
e && x && !x.hidden &&
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
E && (E.hidden = !R), q && (q.hidden = !R), G.forEach((X) => {
|
|
811
|
-
X.disabled = u || this._isReadonly();
|
|
807
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", n = this._inlineError || i, r = this._translations(), d = n ? "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"]'), v = 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");
|
|
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 = n ? "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 = r.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", n ? "true" : "false"), D(o, this, t ? this._labelId : null, r.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 = r.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", n ? "true" : "false"), D(l, this, t ? this._labelId : null, r.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 = r.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", n ? "true" : "false"), D(s, this, t ? this._labelId : null, r.endDate)), y && (y.hidden = a === "single-field"), A && (A.hidden = !(this._clearable() && h), A.disabled = u, A.setAttribute("aria-label", r.clearDateRange)), v && (v.hidden = p, v.disabled = u, v.setAttribute("aria-expanded", p ? "false" : String(this._open)), v.setAttribute("aria-controls", this._panelId), v.setAttribute("aria-label", r.toggleCalendar)), x && (x.id = this._hintId, x.hidden = !e, x.textContent = e), C && (C.id = this._errorId, C.hidden = !n, C.textContent = n);
|
|
809
|
+
const w = [];
|
|
810
|
+
e && x && !x.hidden && w.push(this._hintId), n && 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 || r.selectDateRange));
|
|
811
|
+
const $ = this._showFooter();
|
|
812
|
+
q && (q.hidden = !$), R && (R.hidden = !$), Q.forEach((tt) => {
|
|
813
|
+
tt.disabled = u || this._isReadonly();
|
|
812
814
|
});
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
const B = this.getAttribute("name") || "",
|
|
824
|
-
if (O && (O.disabled = !B, O.name = B, O.value =
|
|
815
|
+
const M = this.root.querySelector('.inline-panel [data-action="preset-today"]');
|
|
816
|
+
M && (M.textContent = r.today);
|
|
817
|
+
const F = this.root.querySelector('.inline-panel [data-action="preset-last7"]');
|
|
818
|
+
F && (F.textContent = r.last7Days);
|
|
819
|
+
const V = this.root.querySelector('.inline-panel [data-action="preset-month"]');
|
|
820
|
+
V && (V.textContent = r.thisMonth);
|
|
821
|
+
const H = this.root.querySelector('.inline-panel [data-action="clear"]');
|
|
822
|
+
H && (H.textContent = r.clear);
|
|
823
|
+
const T = this.root.querySelector('.inline-panel [data-action="apply"]');
|
|
824
|
+
T && (T.textContent = r.apply);
|
|
825
|
+
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
|
+
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) {
|
|
825
827
|
this._scheduleInlineCalendarSync(), this._destroyOverlay();
|
|
826
828
|
return;
|
|
827
829
|
}
|
|
@@ -830,21 +832,21 @@ class yt extends tt {
|
|
|
830
832
|
_onRootClick(t) {
|
|
831
833
|
const e = t.target;
|
|
832
834
|
if (!e) return;
|
|
833
|
-
const i = e.closest("[data-action]"),
|
|
834
|
-
if (
|
|
835
|
-
if (
|
|
835
|
+
const i = e.closest("[data-action]"), n = i?.getAttribute("data-action");
|
|
836
|
+
if (n && !this._isInteractionBlocked()) {
|
|
837
|
+
if (n === "toggle") {
|
|
836
838
|
this._restoreFocusEl = i, this._setOpen(!this._open, "toggle");
|
|
837
839
|
return;
|
|
838
840
|
}
|
|
839
|
-
if (
|
|
841
|
+
if (n === "clear") {
|
|
840
842
|
this._commit({ start: null, end: null }, "clear");
|
|
841
843
|
return;
|
|
842
844
|
}
|
|
843
|
-
if (
|
|
845
|
+
if (n === "apply") {
|
|
844
846
|
this._commit(this._pending, "apply"), this._isInlineMode() || this._setOpen(!1, "apply");
|
|
845
847
|
return;
|
|
846
848
|
}
|
|
847
|
-
|
|
849
|
+
n === "cancel" && (this._pending = { ...this._value }, this._isInlineMode() || this._setOpen(!1, "cancel"), this._updateHostState());
|
|
848
850
|
}
|
|
849
851
|
}
|
|
850
852
|
_onRootInput(t) {
|
|
@@ -858,21 +860,21 @@ class yt extends tt {
|
|
|
858
860
|
}
|
|
859
861
|
_commitFromDraft(t) {
|
|
860
862
|
if (this._rangeVariant() === "single-field") {
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
863
|
+
const r = this._draftSingle.trim();
|
|
864
|
+
if (!r)
|
|
863
865
|
return this._pending = { start: null, end: null }, this._commit(this._pending, t), !0;
|
|
864
|
-
const d =
|
|
865
|
-
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(
|
|
866
|
+
const d = yt(r, this._locale());
|
|
867
|
+
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(r, "parse"), this._updateHostState(), !1) : (this._pending = this._normalizePending({ start: d.start, end: d.end || null }), this._commit(this._pending, t), !0);
|
|
866
868
|
}
|
|
867
|
-
const i = this._draftStart ?
|
|
868
|
-
return this._draftStart && !i || this._draftEnd && !
|
|
869
|
+
const i = this._draftStart ? k(this._draftStart, this._locale()) : null, n = this._draftEnd ? k(this._draftEnd, this._locale()) : null;
|
|
870
|
+
return this._draftStart && !i || this._draftEnd && !n ? (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: n }), this._commit(this._pending, t), !0);
|
|
869
871
|
}
|
|
870
872
|
_onRootBlur(t) {
|
|
871
873
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
872
874
|
const e = t, i = e.target;
|
|
873
875
|
if (!(i instanceof HTMLInputElement)) return;
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
+
const n = e.relatedTarget;
|
|
877
|
+
n && this._overlay?.contains(n) || 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"));
|
|
876
878
|
}
|
|
877
879
|
_onRootKeyDown(t) {
|
|
878
880
|
const e = t;
|
|
@@ -902,37 +904,37 @@ class yt extends tt {
|
|
|
902
904
|
_onOverlayClick(t) {
|
|
903
905
|
const e = t.target;
|
|
904
906
|
if (!e) return;
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
if (
|
|
907
|
+
const n = e.closest("[data-action]")?.getAttribute("data-action");
|
|
908
|
+
if (n && !(this._isInteractionBlocked() || this._isReadonly())) {
|
|
909
|
+
if (n === "backdrop") {
|
|
908
910
|
this._setOpen(!1, "outside");
|
|
909
911
|
return;
|
|
910
912
|
}
|
|
911
|
-
if (
|
|
913
|
+
if (n === "clear") {
|
|
912
914
|
this._pending = { start: null, end: null }, this._emitInput("clear"), this._renderOverlay();
|
|
913
915
|
return;
|
|
914
916
|
}
|
|
915
|
-
if (
|
|
917
|
+
if (n === "cancel") {
|
|
916
918
|
this._pending = { ...this._value }, this._setOpen(!1, "cancel");
|
|
917
919
|
return;
|
|
918
920
|
}
|
|
919
|
-
if (
|
|
921
|
+
if (n === "apply") {
|
|
920
922
|
this._commit(this._pending, "apply"), this._setOpen(!1, "apply");
|
|
921
923
|
return;
|
|
922
924
|
}
|
|
923
|
-
if (
|
|
924
|
-
const
|
|
925
|
-
this._pending = this._normalizePending({ start:
|
|
925
|
+
if (n === "preset-today") {
|
|
926
|
+
const r = this._todayIso();
|
|
927
|
+
this._pending = this._normalizePending({ start: r, end: r }), this._emitInput("preset-today"), this._renderOverlay();
|
|
926
928
|
return;
|
|
927
929
|
}
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
930
|
-
this._pending = this._normalizePending(
|
|
930
|
+
if (n === "preset-last7") {
|
|
931
|
+
const r = this._todayIso();
|
|
932
|
+
this._pending = this._normalizePending(dt(r, 7)), this._emitInput("preset-last7"), this._renderOverlay();
|
|
931
933
|
return;
|
|
932
934
|
}
|
|
933
|
-
if (
|
|
934
|
-
const
|
|
935
|
-
this._pending = this._normalizePending(
|
|
935
|
+
if (n === "preset-month") {
|
|
936
|
+
const r = this._todayIso();
|
|
937
|
+
this._pending = this._normalizePending(ut(r)), this._emitInput("preset-month"), this._renderOverlay();
|
|
936
938
|
}
|
|
937
939
|
}
|
|
938
940
|
}
|
|
@@ -954,21 +956,21 @@ class yt extends tt {
|
|
|
954
956
|
}
|
|
955
957
|
render() {
|
|
956
958
|
this._hasView || (this.setContent(`
|
|
957
|
-
<style>${
|
|
959
|
+
<style>${_t}</style>
|
|
958
960
|
<div class="root">
|
|
959
961
|
<label class="label" part="label" id="${this._labelId}">
|
|
960
962
|
<span class="label-text"></span>
|
|
961
963
|
<span class="required">*</span>
|
|
962
964
|
</label>
|
|
963
965
|
<div class="fields" part="field input" data-single="false">
|
|
964
|
-
<span class="icon" part="icon" aria-hidden="true">${
|
|
966
|
+
<span class="icon" part="icon" aria-hidden="true">${pt}</span>
|
|
965
967
|
<input class="input single" id="${this._singleId}" part="input" />
|
|
966
968
|
<input class="input start" id="${this._startId}" part="input" />
|
|
967
969
|
<span class="sep">—</span>
|
|
968
970
|
<input class="input end" id="${this._endId}" part="input" />
|
|
969
|
-
<button type="button" class="btn" part="clear" data-action="clear">${
|
|
971
|
+
<button type="button" class="btn" part="clear" data-action="clear">${ft}</button>
|
|
970
972
|
<button type="button" class="btn" part="toggle" data-action="toggle">
|
|
971
|
-
<span class="toggle-icon">${
|
|
973
|
+
<span class="toggle-icon">${ht}</span>
|
|
972
974
|
<span class="spinner" aria-hidden="true"></span>
|
|
973
975
|
</button>
|
|
974
976
|
</div>
|
|
@@ -996,7 +998,7 @@ class yt extends tt {
|
|
|
996
998
|
return !1;
|
|
997
999
|
}
|
|
998
1000
|
}
|
|
999
|
-
typeof customElements < "u" && !customElements.get("ui-date-range-picker") && customElements.define("ui-date-range-picker",
|
|
1001
|
+
typeof customElements < "u" && !customElements.get("ui-date-range-picker") && customElements.define("ui-date-range-picker", gt);
|
|
1000
1002
|
export {
|
|
1001
|
-
|
|
1003
|
+
gt as UIDateRangePicker
|
|
1002
1004
|
};
|