@editora/ui-core 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
- package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
- package/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +39 -62
- package/dist/alert-dialog.cjs.js +19 -19
- package/dist/alert-dialog.esm.js +69 -87
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +4 -7
- package/dist/anchor.cjs.js +2 -2
- package/dist/anchor.esm.js +3 -3
- package/dist/animated-beam.cjs.js +83 -83
- package/dist/animated-beam.esm.js +250 -277
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +47 -61
- package/dist/animated-text.cjs.js +2 -2
- package/dist/animated-text.esm.js +13 -24
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +11 -13
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +4 -7
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +7 -13
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +4 -7
- package/dist/block-controls.cjs.js +2 -2
- package/dist/block-controls.esm.js +19 -35
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +8 -15
- package/dist/breadcrumb.cjs.js +2 -2
- package/dist/breadcrumb.esm.js +20 -37
- package/dist/button.cjs.js +1 -521
- package/dist/button.esm.js +2 -669
- package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
- package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +8 -9
- package/dist/card.cjs.js +4 -4
- package/dist/card.esm.js +13 -19
- package/dist/chart.cjs.js +64 -64
- package/dist/chart.esm.js +223 -254
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +2 -3
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +5 -9
- package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +4 -7
- package/dist/color-picker.cjs.js +9 -9
- package/dist/color-picker.esm.js +189 -252
- package/dist/combobox.cjs.js +13 -13
- package/dist/combobox.esm.js +93 -126
- package/dist/command-palette.cjs.js +3 -3
- package/dist/command-palette.esm.js +19 -30
- package/dist/command.cjs.js +4 -4
- package/dist/command.esm.js +41 -53
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.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 +1 -0
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts +1 -0
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts +1 -0
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/container.cjs.js +2 -2
- package/dist/container.esm.js +2 -3
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +157 -219
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +2 -3
- package/dist/data-table.cjs.js +4 -4
- package/dist/data-table.esm.js +299 -381
- package/dist/date-field.cjs.js +3 -3
- package/dist/date-field.esm.js +68 -80
- package/dist/date-picker.cjs.js +30 -9
- package/dist/date-picker.esm.js +90 -97
- package/dist/date-range-picker.cjs.js +22 -3
- package/dist/date-range-picker.esm.js +103 -108
- package/dist/date-range-time-picker.cjs.js +28 -12
- package/dist/date-range-time-picker.esm.js +137 -150
- package/dist/date-time-picker.cjs.js +25 -9
- package/dist/date-time-picker.esm.js +139 -155
- package/dist/date-time-utils-Dmost5Ee.js +1 -0
- package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +3 -5
- package/dist/dialog.cjs.js +12 -12
- package/dist/dialog.esm.js +44 -63
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +2 -3
- package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
- package/dist/dismissable-layer-DNfrKA20.js +1 -0
- package/dist/dismissable-layer.cjs.js +2 -2
- package/dist/dismissable-layer.esm.js +4 -6
- package/dist/dock.cjs.js +5 -5
- package/dist/dock.esm.js +134 -155
- package/dist/drawer.cjs.js +2 -2
- package/dist/drawer.esm.js +18 -35
- package/dist/dropdown.cjs.js +2 -2
- package/dist/dropdown.esm.js +119 -149
- package/dist/dropzone.cjs.js +1 -1
- package/dist/dropzone.esm.js +0 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +3 -5
- package/dist/field.cjs.js +5 -5
- package/dist/field.esm.js +27 -34
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +19 -24
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +69 -93
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +5 -9
- package/dist/floating-toolbar.cjs.js +4 -4
- package/dist/floating-toolbar.esm.js +60 -85
- package/dist/focus-scope-Bwug2gDv.js +1 -0
- package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
- package/dist/focus-scope.cjs.js +2 -2
- package/dist/focus-scope.esm.js +15 -20
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +26 -53
- package/dist/gantt.cjs.js +43 -43
- package/dist/gantt.esm.js +295 -322
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +5 -9
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +22 -28
- package/dist/icon-cloud.cjs.js +7 -7
- package/dist/icon-cloud.esm.js +48 -62
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +2 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +378 -390
- package/dist/inline-edit.cjs.js +11 -11
- package/dist/inline-edit.esm.js +32 -36
- package/dist/input.cjs.js +17 -17
- package/dist/input.esm.js +50 -63
- package/dist/label.cjs.js +2 -2
- package/dist/label.esm.js +8 -17
- package/dist/layout.cjs.js +2 -2
- package/dist/layout.esm.js +20 -26
- package/dist/listbox-B6QgECax.js +46 -0
- package/dist/listbox-DJamVeFj.mjs +200 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +2 -4
- package/dist/marquee.cjs.js +5 -5
- package/dist/marquee.esm.js +33 -50
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +5 -9
- package/dist/menu.cjs.js +3 -3
- package/dist/menu.esm.js +106 -126
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +118 -164
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +4 -4
- package/dist/multi-select.cjs.js +4 -4
- package/dist/multi-select.esm.js +120 -140
- package/dist/navigation-menu.cjs.js +4 -4
- package/dist/navigation-menu.esm.js +44 -55
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +73 -98
- package/dist/number-ticker.cjs.js +3 -3
- package/dist/number-ticker.esm.js +22 -43
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +5 -9
- package/dist/orbiter.cjs.js +13 -13
- package/dist/orbiter.esm.js +79 -90
- package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
- package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +14 -18
- package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
- package/dist/panel-group-CaD0_KQf.js +36 -0
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +2 -5
- package/dist/panel.cjs.js +4 -4
- package/dist/panel.esm.js +8 -10
- package/dist/password-field.cjs.js +9 -9
- package/dist/password-field.esm.js +62 -82
- package/dist/pin-input.cjs.js +3 -3
- package/dist/pin-input.esm.js +33 -39
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +108 -131
- package/dist/plugin-panel.cjs.js +7 -7
- package/dist/plugin-panel.esm.js +13 -15
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +21 -31
- package/dist/portal-DgpQ3Jo1.js +1 -0
- package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
- package/dist/portal.cjs.js +2 -2
- package/dist/portal.esm.js +10 -19
- package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
- package/dist/positioner-D_fqyx_j.js +1 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +11 -18
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +5 -9
- package/dist/quick-actions.cjs.js +6 -6
- package/dist/quick-actions.esm.js +52 -62
- package/dist/radio-group.cjs.js +13 -13
- package/dist/radio-group.esm.js +39 -51
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +5 -9
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +12 -23
- package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +3 -5
- package/dist/runtime-CTaOSmBj.js +1 -0
- package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +6 -6
- package/dist/scroll-area.cjs.js +3 -3
- package/dist/scroll-area.esm.js +38 -46
- package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +7 -7
- package/dist/select.esm.js +67 -97
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +8 -15
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +18 -18
- package/dist/sidebar.esm.js +117 -139
- package/dist/skeleton.cjs.js +11 -11
- package/dist/skeleton.esm.js +27 -24
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +6 -11
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +16 -19
- package/dist/sortable.cjs.js +45 -45
- package/dist/sortable.esm.js +421 -524
- package/dist/spinning-text.cjs.js +12 -12
- package/dist/spinning-text.esm.js +80 -92
- package/dist/split-button.cjs.js +4 -4
- package/dist/split-button.esm.js +77 -62
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +8 -8
- package/dist/stepper.esm.js +32 -52
- package/dist/switch.cjs.js +7 -7
- package/dist/switch.esm.js +23 -31
- package/dist/table.cjs.js +2 -2
- package/dist/table.esm.js +46 -56
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.esm.js +35 -55
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +6 -6
- package/dist/textarea.esm.js +32 -41
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +29 -21
- package/dist/time-picker.esm.js +96 -110
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +3 -5
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +33 -47
- package/dist/toggle-group.cjs.js +6 -6
- package/dist/toggle-group.esm.js +85 -105
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +3 -5
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +13 -24
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +31 -42
- package/dist/transfer-list.cjs.js +19 -19
- package/dist/transfer-list.esm.js +98 -111
- package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
- package/dist/tree-Dx_kv_ih.js +39 -0
- package/dist/tree-item.cjs.js +2 -2
- package/dist/tree-item.esm.js +2 -3
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +2 -5
- package/dist/ui-button-Q0GNNWKC.mjs +665 -0
- package/dist/ui-button-rXQOS9QJ.js +521 -0
- package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
- package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +14 -14
- package/dist/wizard.esm.js +85 -105
- package/package.json +3 -3
- package/dist/date-time-utils-66480de4.js +0 -1
- package/dist/date-time-utils-a2c7af25.mjs +0 -307
- package/dist/dismissable-layer-193e3bed.js +0 -1
- package/dist/focus-scope-2b12b4e7.js +0 -1
- package/dist/listbox-308789a0.mjs +0 -210
- package/dist/listbox-ef2f708e.js +0 -46
- package/dist/panel-group-40254cdd.js +0 -36
- package/dist/portal-c69756c0.js +0 -1
- package/dist/positioner-33529bb8.js +0 -1
- package/dist/runtime-3f13807b.js +0 -1
- package/dist/tree-0a7a8d05.js +0 -39
- /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
- /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
- /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
- /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
- /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { E as tt } from "./ElementBase-
|
|
2
|
-
import { c as et } from "./dismissable-layer-
|
|
3
|
-
import { r as it, c as N } from "./calendar-
|
|
4
|
-
import { r as
|
|
5
|
-
import "./scroll-lock-31da444f.mjs";
|
|
6
|
-
import "./positioner-e9770c66.mjs";
|
|
1
|
+
import { E as tt } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { c as et } from "./dismissable-layer-BmPIoK80.mjs";
|
|
3
|
+
import { r as it, c as N } from "./calendar-DLY4acgn.mjs";
|
|
4
|
+
import { r as rt, e as nt, i as m, s as st, b as at, p as K, f as Z, a as j, l as W, c as ot, d as w, g as lt, h as dt, n as L } from "./date-time-utils-y1N2gvG2.mjs";
|
|
7
5
|
let ut = 0;
|
|
8
6
|
const ct = `
|
|
9
7
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -324,6 +322,25 @@ const ct = `
|
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
`, _t = `
|
|
325
|
+
.ui-date-range-picker-overlay-host {
|
|
326
|
+
--ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
327
|
+
--ui-dp-surface: linear-gradient(
|
|
328
|
+
180deg,
|
|
329
|
+
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent),
|
|
330
|
+
color-mix(in srgb, var(--ui-color-surface, #ffffff) 92%, var(--ui-color-surface-alt, #f8fafc))
|
|
331
|
+
);
|
|
332
|
+
--ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
|
|
333
|
+
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
334
|
+
--ui-dp-muted: var(--ui-color-muted, #64748b);
|
|
335
|
+
--ui-dp-accent: var(--ui-color-primary, #2563eb);
|
|
336
|
+
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
337
|
+
--ui-dp-radius: 12px;
|
|
338
|
+
--ui-dp-panel-radius: calc(var(--ui-dp-radius) + 2px);
|
|
339
|
+
--ui-dp-field-error: var(--ui-color-danger, #dc2626);
|
|
340
|
+
--ui-dp-focus-ring: color-mix(in srgb, var(--ui-dp-accent) 26%, transparent);
|
|
341
|
+
--ui-dp-duration: 160ms;
|
|
342
|
+
--ui-dp-ease: cubic-bezier(0.2, 0.9, 0.24, 1);
|
|
343
|
+
}
|
|
327
344
|
.overlay { position: fixed; z-index: var(--ui-dp-z, 1600); pointer-events: none; }
|
|
328
345
|
.panel {
|
|
329
346
|
pointer-events: auto;
|
|
@@ -404,10 +421,9 @@ const ct = `
|
|
|
404
421
|
}
|
|
405
422
|
`;
|
|
406
423
|
function Y(c) {
|
|
407
|
-
if (!c)
|
|
408
|
-
return { start: null, end: null };
|
|
424
|
+
if (!c) return { start: null, end: null };
|
|
409
425
|
try {
|
|
410
|
-
const t = JSON.parse(c), e = L(
|
|
426
|
+
const t = JSON.parse(c), e = L(t?.start || null), i = L(t?.end || null);
|
|
411
427
|
return { start: e, end: i };
|
|
412
428
|
} catch {
|
|
413
429
|
return { start: null, end: null };
|
|
@@ -424,19 +440,18 @@ function _(c) {
|
|
|
424
440
|
}
|
|
425
441
|
function bt(c, t) {
|
|
426
442
|
const e = c.trim();
|
|
427
|
-
if (!e)
|
|
428
|
-
|
|
429
|
-
const i = e.split(/\s(?:—|–|to)\s/i).map((r) => r.trim()).filter(Boolean);
|
|
443
|
+
if (!e) return { start: null, end: null };
|
|
444
|
+
const i = e.split(/\s(?:—|–|to)\s/i).map((n) => n.trim()).filter(Boolean);
|
|
430
445
|
if (i.length > 1) {
|
|
431
|
-
const
|
|
432
|
-
return { start:
|
|
446
|
+
const n = w(i[0] || "", t), d = w(i[1] || "", t);
|
|
447
|
+
return { start: n, end: d };
|
|
433
448
|
}
|
|
434
449
|
return { start: w(e, t), end: null };
|
|
435
450
|
}
|
|
436
451
|
class yt extends tt {
|
|
437
452
|
constructor() {
|
|
438
|
-
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-${++ut}`, 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 =
|
|
439
|
-
|
|
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-${++ut}`, 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) => {
|
|
454
|
+
nt(t, [this._overlay]) || this._schedulePosition.run();
|
|
440
455
|
}, this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendarChange(t);
|
|
441
456
|
}
|
|
442
457
|
static get observedAttributes() {
|
|
@@ -607,15 +622,14 @@ class yt extends tt {
|
|
|
607
622
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
608
623
|
}
|
|
609
624
|
_normalizePending(t) {
|
|
610
|
-
const { min: e, max: i } = this._resolvedBounds(),
|
|
611
|
-
return !
|
|
625
|
+
const { min: e, max: i } = this._resolvedBounds(), r = t.start ? j(t.start, e, i) : null, n = t.end ? j(t.end, e, i) : null;
|
|
626
|
+
return !r || !n ? { start: r, end: n } : N(r, n) > 0 ? { start: n, end: r } : { start: r, end: n };
|
|
612
627
|
}
|
|
613
628
|
_canCommit(t) {
|
|
614
629
|
return !t.start && !t.end ? !0 : !(!this._allowPartial() && (!t.start || !t.end) || t.start && t.end && !this._allowSameDay() && t.start === t.end);
|
|
615
630
|
}
|
|
616
631
|
_commit(t, e) {
|
|
617
|
-
if (this._isInteractionBlocked() || this._isReadonly())
|
|
618
|
-
return;
|
|
632
|
+
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
619
633
|
const i = this._normalizePending(t);
|
|
620
634
|
if (!this._canCommit(i)) {
|
|
621
635
|
this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(JSON.stringify(t), "range"), this._updateHostState();
|
|
@@ -644,25 +658,20 @@ class yt extends tt {
|
|
|
644
658
|
}
|
|
645
659
|
}
|
|
646
660
|
_ensureOverlay() {
|
|
647
|
-
if (this._overlay || typeof document > "u")
|
|
648
|
-
return;
|
|
661
|
+
if (this._overlay || typeof document > "u") return;
|
|
649
662
|
const t = document.createElement("div");
|
|
650
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 = W());
|
|
651
664
|
}
|
|
652
665
|
_syncOverlayHostZIndex() {
|
|
653
|
-
if (!this._overlay || typeof window > "u")
|
|
654
|
-
return;
|
|
666
|
+
if (!this._overlay || typeof window > "u") return;
|
|
655
667
|
const t = window.getComputedStyle(this).getPropertyValue("--ui-dp-z").trim();
|
|
656
668
|
this._overlay.style.zIndex = t || "1600";
|
|
657
669
|
}
|
|
658
670
|
_destroyOverlay() {
|
|
659
|
-
|
|
660
|
-
(t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayMode = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
|
|
671
|
+
this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayMode = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
|
|
661
672
|
}
|
|
662
673
|
_syncDismissableLayer() {
|
|
663
|
-
|
|
664
|
-
if ((i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
|
|
665
|
-
return;
|
|
674
|
+
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
666
675
|
const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".fields");
|
|
667
676
|
t && (this._dismissableLayer = et({
|
|
668
677
|
node: t,
|
|
@@ -670,29 +679,27 @@ class yt extends tt {
|
|
|
670
679
|
closeOnEscape: !0,
|
|
671
680
|
closeOnPointerOutside: !0,
|
|
672
681
|
closeOnFocusOutside: !1,
|
|
673
|
-
onBeforeDismiss: (
|
|
682
|
+
onBeforeDismiss: (i) => i === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (i === "outside-pointer" && this._setOpen(!1, "outside"), !1)
|
|
674
683
|
}));
|
|
675
684
|
}
|
|
676
685
|
_positionOverlay() {
|
|
677
|
-
if (!this._overlay || !this._open || this._isMobileSheet())
|
|
678
|
-
return;
|
|
686
|
+
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
679
687
|
const t = this.root.querySelector(".fields"), e = this._overlay.querySelector(".panel");
|
|
680
|
-
if (!t || !e)
|
|
681
|
-
return;
|
|
688
|
+
if (!t || !e) return;
|
|
682
689
|
const i = t.getBoundingClientRect();
|
|
683
690
|
e.style.setProperty("--ui-drp-panel-width", `${Math.round(i.width)}px`);
|
|
684
|
-
const
|
|
691
|
+
const r = e.getBoundingClientRect(), n = e.getAttribute("data-placement"), d = ot(
|
|
685
692
|
i,
|
|
686
|
-
|
|
693
|
+
r,
|
|
687
694
|
8,
|
|
688
695
|
8,
|
|
689
|
-
|
|
696
|
+
n === "top" ? "top" : n === "bottom" ? "bottom" : null
|
|
690
697
|
);
|
|
691
698
|
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);
|
|
692
699
|
}
|
|
693
700
|
_renderPanelInner(t) {
|
|
694
|
-
const e = this._translations(), i = (this.getAttribute("label") || "").trim(),
|
|
695
|
-
<header class="header" part="header" ${
|
|
701
|
+
const e = this._translations(), i = (this.getAttribute("label") || "").trim(), r = !!i || t, n = t ? "true" : "false", d = `
|
|
702
|
+
<header class="header" part="header" ${r ? "" : "hidden"}>
|
|
696
703
|
<p class="title" id="${this._panelTitleId}" ${i ? "" : "hidden"}>${_(i)}</p>
|
|
697
704
|
${t ? `<button type="button" class="action" data-action="cancel">${_(e.cancel)}</button>` : ""}
|
|
698
705
|
</header>
|
|
@@ -711,7 +718,7 @@ class yt extends tt {
|
|
|
711
718
|
return `
|
|
712
719
|
<style>${_t}</style>
|
|
713
720
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
714
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${
|
|
721
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${n}" aria-labelledby="${this._panelTitleId}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
715
722
|
`;
|
|
716
723
|
}
|
|
717
724
|
_syncCalendar(t) {
|
|
@@ -721,31 +728,29 @@ class yt extends tt {
|
|
|
721
728
|
return;
|
|
722
729
|
}
|
|
723
730
|
t.getAttribute(h) !== u && t.setAttribute(h, u);
|
|
724
|
-
}, i = J(this._pending), { min:
|
|
725
|
-
e("selection", "range"), e("value", i), e("min",
|
|
731
|
+
}, i = J(this._pending), { min: r, max: n } = this._resolvedBounds();
|
|
732
|
+
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"));
|
|
726
733
|
const l = this.getAttribute("size") || "sm";
|
|
727
734
|
e("size", l === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), e("outside-click", this.getAttribute("outside-click"));
|
|
728
735
|
const p = t.classList.contains("inline-calendar");
|
|
729
736
|
l === "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", l === "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", l === "lg" ? "0.76em" : "0.68em"), t.style.setProperty("--ui-calendar-weekday-font-size", l === "lg" ? "0.66em" : "0.58em"), t.style.setProperty("--ui-calendar-title-font-size", l === "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);
|
|
730
737
|
}
|
|
731
738
|
_ensureOverlayContent(t) {
|
|
732
|
-
if (!this._overlay)
|
|
733
|
-
return;
|
|
739
|
+
if (!this._overlay) return;
|
|
734
740
|
const e = t ? "sheet" : "popover";
|
|
735
741
|
this._overlayMode === e && this._overlay.querySelector(".drp-calendar") || (this._overlayMode = e, this._overlay.innerHTML = t ? `<div class="sheet-wrap">${this._renderPanelInner(!0)}</div>` : `<div class="overlay">${this._renderPanelInner(!1)}</div>`);
|
|
736
742
|
}
|
|
737
743
|
_syncOverlayState() {
|
|
738
|
-
if (!this._overlay)
|
|
739
|
-
return;
|
|
744
|
+
if (!this._overlay) return;
|
|
740
745
|
this._syncOverlayHostZIndex();
|
|
741
746
|
const t = this._isMobileSheet();
|
|
742
747
|
t && !this._releaseScrollLock ? this._releaseScrollLock = W() : !t && this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null), this._ensureOverlayContent(t);
|
|
743
748
|
const e = this._overlay.querySelector(".title"), i = this._overlay.querySelector(".panel, .sheet");
|
|
744
749
|
this._syncDismissableLayer();
|
|
745
|
-
const
|
|
746
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
750
|
+
const r = this._overlay.querySelector(".header"), n = this._overlay.querySelector(".presets"), d = this._overlay.querySelector(".footer"), l = this._translations();
|
|
751
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), r && (r.hidden = !(this.getAttribute("label") || "").trim() && !t);
|
|
747
752
|
const p = this._showFooter();
|
|
748
|
-
if (
|
|
753
|
+
if (n && (n.hidden = !p), d && (d.hidden = !p), e) {
|
|
749
754
|
const y = (this.getAttribute("label") || "").trim();
|
|
750
755
|
e.textContent = y, e.hidden = !y;
|
|
751
756
|
}
|
|
@@ -794,28 +799,27 @@ class yt extends tt {
|
|
|
794
799
|
}));
|
|
795
800
|
}
|
|
796
801
|
_updateHostState() {
|
|
797
|
-
if (!this._hasView)
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", l === "single-field" ? this._singleId : this._startId)), A && (A.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = l === "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")), a && (a.value !== this._draftSingle && (a.value = this._draftSingle), a.id = this._singleId, a.hidden = l !== "single-field", a.readOnly = this._isReadonly() || u, a.disabled = u, a.required = this.hasAttribute("required"), a.placeholder = r.startEnd, a.autocomplete = "off", a.setAttribute("role", "combobox"), a.setAttribute("aria-haspopup", "dialog"), a.setAttribute("aria-controls", this._panelId), a.setAttribute("aria-expanded", p ? "false" : String(this._open)), a.setAttribute("aria-invalid", n ? "true" : "false"), t ? a.setAttribute("aria-labelledby", this._labelId) : a.removeAttribute("aria-labelledby")), o && (o.value !== this._draftStart && (o.value = this._draftStart), o.id = this._startId, o.hidden = l === "single-field", o.readOnly = this._isReadonly() || u, o.disabled = u, o.required = this.hasAttribute("required"), o.placeholder = r.startDate, 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"), t ? o.setAttribute("aria-labelledby", this._labelId) : o.removeAttribute("aria-labelledby")), s && (s.value !== this._draftEnd && (s.value = this._draftEnd), s.id = this._endId, s.hidden = l === "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"), t ? s.setAttribute("aria-labelledby", this._labelId) : s.removeAttribute("aria-labelledby")), y && (y.hidden = l === "single-field"), k && (k.hidden = !(this._clearable() && h), k.disabled = u, k.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);
|
|
802
|
+
if (!this._hasView) return;
|
|
803
|
+
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(), l = 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"), A = this.root.querySelector(".label-text"), I = this.root.querySelector(".required"), f = this.root.querySelector(".fields"), a = this.root.querySelector(".single"), o = this.root.querySelector(".start"), s = this.root.querySelector(".end"), y = this.root.querySelector(".sep"), k = 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"), E = this.root.querySelector(".inline-panel .presets"), q = this.root.querySelector(".inline-panel .footer"), O = this.root.querySelector(".hidden-range"), z = this.root.querySelector(".hidden-start"), P = this.root.querySelector(".hidden-end"), G = this.root.querySelectorAll(".inline-panel .action");
|
|
804
|
+
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", l === "single-field" ? this._singleId : this._startId)), A && (A.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = l === "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")), a && (a.value !== this._draftSingle && (a.value = this._draftSingle), a.id = this._singleId, a.hidden = l !== "single-field", a.readOnly = this._isReadonly() || u, a.disabled = u, a.required = this.hasAttribute("required"), a.placeholder = n.startEnd, a.autocomplete = "off", a.setAttribute("role", "combobox"), a.setAttribute("aria-haspopup", "dialog"), a.setAttribute("aria-controls", this._panelId), a.setAttribute("aria-expanded", p ? "false" : String(this._open)), a.setAttribute("aria-invalid", r ? "true" : "false"), t ? a.setAttribute("aria-labelledby", this._labelId) : a.removeAttribute("aria-labelledby")), o && (o.value !== this._draftStart && (o.value = this._draftStart), o.id = this._startId, o.hidden = l === "single-field", o.readOnly = this._isReadonly() || u, o.disabled = u, o.required = this.hasAttribute("required"), o.placeholder = n.startDate, 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"), t ? o.setAttribute("aria-labelledby", this._labelId) : o.removeAttribute("aria-labelledby")), s && (s.value !== this._draftEnd && (s.value = this._draftEnd), s.id = this._endId, s.hidden = l === "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"), t ? s.setAttribute("aria-labelledby", this._labelId) : s.removeAttribute("aria-labelledby")), y && (y.hidden = l === "single-field"), k && (k.hidden = !(this._clearable() && h), k.disabled = u, k.setAttribute("aria-label", n.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", n.toggleCalendar)), x && (x.id = this._hintId, x.hidden = !e, x.textContent = e), C && (C.id = this._errorId, C.hidden = !r, C.textContent = r);
|
|
801
805
|
const D = [];
|
|
802
|
-
e && x && !x.hidden && D.push(this._hintId),
|
|
806
|
+
e && x && !x.hidden && D.push(this._hintId), r && D.push(this._errorId);
|
|
803
807
|
const S = D.join(" ");
|
|
804
|
-
a && (S ? a.setAttribute("aria-describedby", S) : a.removeAttribute("aria-describedby")), o && (S ? o.setAttribute("aria-describedby", S) : o.removeAttribute("aria-describedby")), s && (S ? s.setAttribute("aria-describedby", S) : s.removeAttribute("aria-describedby")), 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 ||
|
|
805
|
-
const
|
|
806
|
-
|
|
808
|
+
a && (S ? a.setAttribute("aria-describedby", S) : a.removeAttribute("aria-describedby")), o && (S ? o.setAttribute("aria-describedby", S) : o.removeAttribute("aria-describedby")), s && (S ? s.setAttribute("aria-describedby", S) : s.removeAttribute("aria-describedby")), 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));
|
|
809
|
+
const R = this._showFooter();
|
|
810
|
+
E && (E.hidden = !R), q && (q.hidden = !R), G.forEach((X) => {
|
|
807
811
|
X.disabled = u || this._isReadonly();
|
|
808
812
|
});
|
|
809
813
|
const $ = this.root.querySelector('.inline-panel [data-action="preset-today"]');
|
|
810
|
-
$ && ($.textContent =
|
|
814
|
+
$ && ($.textContent = n.today);
|
|
811
815
|
const M = this.root.querySelector('.inline-panel [data-action="preset-last7"]');
|
|
812
|
-
M && (M.textContent =
|
|
816
|
+
M && (M.textContent = n.last7Days);
|
|
813
817
|
const F = this.root.querySelector('.inline-panel [data-action="preset-month"]');
|
|
814
|
-
F && (F.textContent =
|
|
818
|
+
F && (F.textContent = n.thisMonth);
|
|
815
819
|
const V = this.root.querySelector('.inline-panel [data-action="clear"]');
|
|
816
|
-
V && (V.textContent =
|
|
820
|
+
V && (V.textContent = n.clear);
|
|
817
821
|
const H = this.root.querySelector('.inline-panel [data-action="apply"]');
|
|
818
|
-
H && (H.textContent =
|
|
822
|
+
H && (H.textContent = n.apply);
|
|
819
823
|
const B = this.getAttribute("name") || "", T = this.getAttribute("name-start") || "", U = this.getAttribute("name-end") || "", Q = this._value.start && this._value.end ? `${this._value.start}..${this._value.end}` : "";
|
|
820
824
|
if (O && (O.disabled = !B, O.name = B, O.value = Q), z && (z.disabled = !!B || !T, z.name = T, z.value = this._value.start || ""), P && (P.disabled = !!B || !U, P.name = U, P.value = this._value.end || ""), p) {
|
|
821
825
|
this._scheduleInlineCalendarSync(), this._destroyOverlay();
|
|
@@ -825,29 +829,27 @@ class yt extends tt {
|
|
|
825
829
|
}
|
|
826
830
|
_onRootClick(t) {
|
|
827
831
|
const e = t.target;
|
|
828
|
-
if (!e)
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
if (n === "toggle") {
|
|
832
|
+
if (!e) return;
|
|
833
|
+
const i = e.closest("[data-action]"), r = i?.getAttribute("data-action");
|
|
834
|
+
if (r && !this._isInteractionBlocked()) {
|
|
835
|
+
if (r === "toggle") {
|
|
833
836
|
this._restoreFocusEl = i, this._setOpen(!this._open, "toggle");
|
|
834
837
|
return;
|
|
835
838
|
}
|
|
836
|
-
if (
|
|
839
|
+
if (r === "clear") {
|
|
837
840
|
this._commit({ start: null, end: null }, "clear");
|
|
838
841
|
return;
|
|
839
842
|
}
|
|
840
|
-
if (
|
|
843
|
+
if (r === "apply") {
|
|
841
844
|
this._commit(this._pending, "apply"), this._isInlineMode() || this._setOpen(!1, "apply");
|
|
842
845
|
return;
|
|
843
846
|
}
|
|
844
|
-
|
|
847
|
+
r === "cancel" && (this._pending = { ...this._value }, this._isInlineMode() || this._setOpen(!1, "cancel"), this._updateHostState());
|
|
845
848
|
}
|
|
846
849
|
}
|
|
847
850
|
_onRootInput(t) {
|
|
848
851
|
const e = t.target;
|
|
849
|
-
if (!(e instanceof HTMLInputElement) || this._isInteractionBlocked() || this._isReadonly())
|
|
850
|
-
return;
|
|
852
|
+
if (!(e instanceof HTMLInputElement) || this._isInteractionBlocked() || this._isReadonly()) return;
|
|
851
853
|
if (this._rangeVariant() === "single-field" && e.classList.contains("single")) {
|
|
852
854
|
this._draftSingle = e.value, this._inlineError = "";
|
|
853
855
|
return;
|
|
@@ -856,24 +858,21 @@ class yt extends tt {
|
|
|
856
858
|
}
|
|
857
859
|
_commitFromDraft(t) {
|
|
858
860
|
if (this._rangeVariant() === "single-field") {
|
|
859
|
-
const
|
|
860
|
-
if (!
|
|
861
|
+
const n = this._draftSingle.trim();
|
|
862
|
+
if (!n)
|
|
861
863
|
return this._pending = { start: null, end: null }, this._commit(this._pending, t), !0;
|
|
862
|
-
const d = bt(
|
|
863
|
-
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(
|
|
864
|
+
const d = bt(n, this._locale());
|
|
865
|
+
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);
|
|
864
866
|
}
|
|
865
|
-
const i = this._draftStart ? w(this._draftStart, this._locale()) : null,
|
|
866
|
-
return this._draftStart && !i || this._draftEnd && !
|
|
867
|
+
const i = this._draftStart ? w(this._draftStart, this._locale()) : null, r = this._draftEnd ? w(this._draftEnd, this._locale()) : null;
|
|
868
|
+
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);
|
|
867
869
|
}
|
|
868
870
|
_onRootBlur(t) {
|
|
869
|
-
|
|
870
|
-
if (this._isInteractionBlocked() || this._isReadonly())
|
|
871
|
-
return;
|
|
871
|
+
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
872
872
|
const e = t, i = e.target;
|
|
873
|
-
if (!(i instanceof HTMLInputElement))
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
n && ((r = this._overlay) != null && r.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"));
|
|
873
|
+
if (!(i instanceof HTMLInputElement)) return;
|
|
874
|
+
const r = e.relatedTarget;
|
|
875
|
+
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"));
|
|
877
876
|
}
|
|
878
877
|
_onRootKeyDown(t) {
|
|
879
878
|
const e = t;
|
|
@@ -893,8 +892,7 @@ class yt extends tt {
|
|
|
893
892
|
}
|
|
894
893
|
}
|
|
895
894
|
_onDocumentPointerDown(t) {
|
|
896
|
-
if (!this._open || !this._overlay)
|
|
897
|
-
return;
|
|
895
|
+
if (!this._open || !this._overlay) return;
|
|
898
896
|
const e = t.composedPath();
|
|
899
897
|
e.includes(this) || e.includes(this._overlay) || this._setOpen(!1, "outside");
|
|
900
898
|
}
|
|
@@ -903,48 +901,45 @@ class yt extends tt {
|
|
|
903
901
|
}
|
|
904
902
|
_onOverlayClick(t) {
|
|
905
903
|
const e = t.target;
|
|
906
|
-
if (!e)
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
if (n === "backdrop") {
|
|
904
|
+
if (!e) return;
|
|
905
|
+
const r = e.closest("[data-action]")?.getAttribute("data-action");
|
|
906
|
+
if (r && !(this._isInteractionBlocked() || this._isReadonly())) {
|
|
907
|
+
if (r === "backdrop") {
|
|
911
908
|
this._setOpen(!1, "outside");
|
|
912
909
|
return;
|
|
913
910
|
}
|
|
914
|
-
if (
|
|
911
|
+
if (r === "clear") {
|
|
915
912
|
this._pending = { start: null, end: null }, this._emitInput("clear"), this._renderOverlay();
|
|
916
913
|
return;
|
|
917
914
|
}
|
|
918
|
-
if (
|
|
915
|
+
if (r === "cancel") {
|
|
919
916
|
this._pending = { ...this._value }, this._setOpen(!1, "cancel");
|
|
920
917
|
return;
|
|
921
918
|
}
|
|
922
|
-
if (
|
|
919
|
+
if (r === "apply") {
|
|
923
920
|
this._commit(this._pending, "apply"), this._setOpen(!1, "apply");
|
|
924
921
|
return;
|
|
925
922
|
}
|
|
926
|
-
if (
|
|
927
|
-
const
|
|
928
|
-
this._pending = this._normalizePending({ start:
|
|
923
|
+
if (r === "preset-today") {
|
|
924
|
+
const n = this._todayIso();
|
|
925
|
+
this._pending = this._normalizePending({ start: n, end: n }), this._emitInput("preset-today"), this._renderOverlay();
|
|
929
926
|
return;
|
|
930
927
|
}
|
|
931
|
-
if (
|
|
932
|
-
const
|
|
933
|
-
this._pending = this._normalizePending(lt(
|
|
928
|
+
if (r === "preset-last7") {
|
|
929
|
+
const n = this._todayIso();
|
|
930
|
+
this._pending = this._normalizePending(lt(n, 7)), this._emitInput("preset-last7"), this._renderOverlay();
|
|
934
931
|
return;
|
|
935
932
|
}
|
|
936
|
-
if (
|
|
937
|
-
const
|
|
938
|
-
this._pending = this._normalizePending(dt(
|
|
933
|
+
if (r === "preset-month") {
|
|
934
|
+
const n = this._todayIso();
|
|
935
|
+
this._pending = this._normalizePending(dt(n)), this._emitInput("preset-month"), this._renderOverlay();
|
|
939
936
|
}
|
|
940
937
|
}
|
|
941
938
|
}
|
|
942
939
|
_onOverlayCalendarChange(t) {
|
|
943
|
-
if (this._isInteractionBlocked() || this._isReadonly())
|
|
944
|
-
return;
|
|
940
|
+
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
945
941
|
const e = t.target;
|
|
946
|
-
if (!e || e.tagName.toLowerCase() !== "ui-calendar")
|
|
947
|
-
return;
|
|
942
|
+
if (!e || e.tagName.toLowerCase() !== "ui-calendar") return;
|
|
948
943
|
const i = t.detail;
|
|
949
944
|
if (!(!i || i.mode !== "range")) {
|
|
950
945
|
if (this._pending = this._normalizePending({
|