@editora/ui-core 0.1.19 → 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 -671
- 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-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 +9 -9
- package/dist/date-picker.esm.js +69 -97
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +32 -56
- package/dist/date-range-time-picker.cjs.js +9 -9
- package/dist/date-range-time-picker.esm.js +111 -140
- package/dist/date-time-picker.cjs.js +4 -4
- package/dist/date-time-picker.esm.js +112 -144
- 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 +22 -22
- package/dist/time-picker.esm.js +88 -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 +2 -2
- 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
package/dist/wizard.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as A } from "./ElementBase-
|
|
1
|
+
import { E as A } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const k = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-wizard-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
@@ -610,13 +610,12 @@ const k = `
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
`;
|
|
613
|
-
function c(
|
|
614
|
-
return
|
|
613
|
+
function c(g) {
|
|
614
|
+
return g.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
if (
|
|
618
|
-
|
|
619
|
-
const t = String(v).toLowerCase();
|
|
616
|
+
function v(g) {
|
|
617
|
+
if (g == null) return !1;
|
|
618
|
+
const t = String(g).toLowerCase();
|
|
620
619
|
return t !== "false" && t !== "0" && t !== "off";
|
|
621
620
|
}
|
|
622
621
|
let $ = 0;
|
|
@@ -655,13 +654,12 @@ class C extends A {
|
|
|
655
654
|
t.some((i) => {
|
|
656
655
|
if (i.type === "childList")
|
|
657
656
|
return i.target === this;
|
|
658
|
-
if (i.type !== "attributes")
|
|
659
|
-
return !1;
|
|
657
|
+
if (i.type !== "attributes") return !1;
|
|
660
658
|
const a = i.target, r = i.attributeName || "";
|
|
661
659
|
if (r === "slot")
|
|
662
660
|
return a.getAttribute("slot") === "step" || a.matches('[slot="step"]');
|
|
663
|
-
const
|
|
664
|
-
return !
|
|
661
|
+
const o = a.closest('[slot="step"]');
|
|
662
|
+
return !o || a !== o ? !1 : r === "data-value" || r === "data-title" || r === "data-description" || r === "data-optional" || r === "data-disabled" || r === "data-state" || r === "data-invalid" || r === "disabled" || r === "invalid";
|
|
665
663
|
}) && this.requestRender();
|
|
666
664
|
}), this._observer.observe(this, {
|
|
667
665
|
childList: !0,
|
|
@@ -701,11 +699,11 @@ class C extends A {
|
|
|
701
699
|
e ? this.setAttribute("value", e) : this.removeAttribute("value");
|
|
702
700
|
}
|
|
703
701
|
_isBusy() {
|
|
704
|
-
return
|
|
702
|
+
return v(this.getAttribute("busy")) || this.hasAttribute("busy");
|
|
705
703
|
}
|
|
706
704
|
_isAnimationEnabled() {
|
|
707
705
|
const t = this.getAttribute("animate");
|
|
708
|
-
return t == null ? !0 :
|
|
706
|
+
return t == null ? !0 : v(t) || t === "";
|
|
709
707
|
}
|
|
710
708
|
_steps() {
|
|
711
709
|
return Array.from(this.children).filter(
|
|
@@ -717,8 +715,8 @@ class C extends A {
|
|
|
717
715
|
value: e.getAttribute("data-value") || String(i + 1),
|
|
718
716
|
title: e.getAttribute("data-title") || e.getAttribute("title") || `Step ${i + 1}`,
|
|
719
717
|
description: e.getAttribute("data-description") || "",
|
|
720
|
-
optional:
|
|
721
|
-
disabled: e.hasAttribute("disabled") ||
|
|
718
|
+
optional: v(e.getAttribute("data-optional")),
|
|
719
|
+
disabled: e.hasAttribute("disabled") || v(e.getAttribute("data-disabled")),
|
|
722
720
|
state: r,
|
|
723
721
|
node: e
|
|
724
722
|
};
|
|
@@ -731,13 +729,11 @@ class C extends A {
|
|
|
731
729
|
return `ui-wizard-${this._instanceId}-panel-${t}`;
|
|
732
730
|
}
|
|
733
731
|
_activeIndex(t) {
|
|
734
|
-
if (!t.length)
|
|
735
|
-
return -1;
|
|
732
|
+
if (!t.length) return -1;
|
|
736
733
|
const e = this.getAttribute("value") || "";
|
|
737
734
|
if (e) {
|
|
738
735
|
const a = t.findIndex((r) => r.value === e);
|
|
739
|
-
if (a >= 0)
|
|
740
|
-
return a;
|
|
736
|
+
if (a >= 0) return a;
|
|
741
737
|
}
|
|
742
738
|
const i = t.find((a) => !a.disabled) || t[0];
|
|
743
739
|
return i && this.getAttribute("value") !== i.value && this.setAttribute("value", i.value), t.findIndex((a) => a.value === i.value);
|
|
@@ -750,15 +746,15 @@ class C extends A {
|
|
|
750
746
|
i && this._visited.add(i.value);
|
|
751
747
|
}
|
|
752
748
|
_dispatchBlockedNext(t, e, i, a) {
|
|
753
|
-
const r = e[i],
|
|
749
|
+
const r = e[i], o = e[a];
|
|
754
750
|
this.dispatchEvent(
|
|
755
751
|
new CustomEvent("blocked-next", {
|
|
756
752
|
detail: {
|
|
757
753
|
reason: t,
|
|
758
754
|
currentIndex: i,
|
|
759
755
|
nextIndex: a,
|
|
760
|
-
currentValue:
|
|
761
|
-
nextValue:
|
|
756
|
+
currentValue: r?.value || "",
|
|
757
|
+
nextValue: o?.value || ""
|
|
762
758
|
},
|
|
763
759
|
bubbles: !0,
|
|
764
760
|
composed: !0
|
|
@@ -766,7 +762,7 @@ class C extends A {
|
|
|
766
762
|
);
|
|
767
763
|
}
|
|
768
764
|
_isStepInvalid(t, e) {
|
|
769
|
-
if (!t || t.node.hasAttribute("invalid") ||
|
|
765
|
+
if (!t || t.node.hasAttribute("invalid") || v(t.node.getAttribute("data-invalid")))
|
|
770
766
|
return !0;
|
|
771
767
|
const i = new CustomEvent("validate-step", {
|
|
772
768
|
detail: {
|
|
@@ -783,29 +779,27 @@ class C extends A {
|
|
|
783
779
|
}
|
|
784
780
|
validateCurrentStep() {
|
|
785
781
|
const t = this._steps();
|
|
786
|
-
if (!t.length)
|
|
787
|
-
return !1;
|
|
782
|
+
if (!t.length) return !1;
|
|
788
783
|
const e = this._activeIndex(t);
|
|
789
784
|
return e < 0 ? !1 : !this._isStepInvalid(t[e], e);
|
|
790
785
|
}
|
|
791
786
|
_syncPanels(t, e) {
|
|
792
787
|
const i = this.hasAttribute("keep-mounted"), a = this._isAnimationEnabled();
|
|
793
|
-
this._markVisited(t, e), t.forEach((r,
|
|
794
|
-
const
|
|
795
|
-
r.node.id = n, r.node.setAttribute("role", "tabpanel"), r.node.setAttribute("aria-labelledby",
|
|
788
|
+
this._markVisited(t, e), t.forEach((r, o) => {
|
|
789
|
+
const s = o === e, n = this._panelId(o), l = this._tabId(o), d = this._visited.has(r.value);
|
|
790
|
+
r.node.id = n, r.node.setAttribute("role", "tabpanel"), r.node.setAttribute("aria-labelledby", l), r.node.setAttribute("tabindex", s ? "0" : "-1"), r.node.setAttribute("data-active", s ? "true" : "false"), r.node.setAttribute("aria-hidden", s ? "false" : "true"), r.node.setAttribute(
|
|
796
791
|
"data-keep-mounted",
|
|
797
792
|
i ? "true" : "false"
|
|
798
|
-
), r.node.setAttribute("data-visible",
|
|
793
|
+
), r.node.setAttribute("data-visible", s ? "true" : "false"), r.node.setAttribute("data-visited", d ? "true" : "false"), r.node.setAttribute(
|
|
799
794
|
"data-nav-direction",
|
|
800
795
|
a ? this._lastDirection : "none"
|
|
801
|
-
), i ? r.node.hidden = !1 : r.node.hidden = !
|
|
796
|
+
), i ? r.node.hidden = !1 : r.node.hidden = !s;
|
|
802
797
|
});
|
|
803
798
|
}
|
|
804
799
|
_attemptChange(t, e, i, a) {
|
|
805
800
|
if (this._isBusy())
|
|
806
801
|
return this._dispatchBlockedNext("busy", t, e, i), !1;
|
|
807
|
-
if (i === e)
|
|
808
|
-
return !0;
|
|
802
|
+
if (i === e) return !0;
|
|
809
803
|
if (i < 0 || i >= t.length)
|
|
810
804
|
return this._dispatchBlockedNext("bounds", t, e, i), !1;
|
|
811
805
|
const r = t[i];
|
|
@@ -813,14 +807,14 @@ class C extends A {
|
|
|
813
807
|
return this._dispatchBlockedNext("disabled", t, e, i), !1;
|
|
814
808
|
if (this.hasAttribute("linear") && i > e + 1)
|
|
815
809
|
return this._dispatchBlockedNext("linear", t, e, i), !1;
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
810
|
+
const o = t[e], s = i > e;
|
|
811
|
+
if (s && o && this._isStepInvalid(o, e))
|
|
818
812
|
return this._dispatchBlockedNext("validation", t, e, i), !1;
|
|
819
813
|
const n = new CustomEvent("before-change", {
|
|
820
814
|
detail: {
|
|
821
815
|
currentIndex: e,
|
|
822
816
|
nextIndex: i,
|
|
823
|
-
currentValue:
|
|
817
|
+
currentValue: o?.value || "",
|
|
824
818
|
nextValue: r.value,
|
|
825
819
|
trigger: a
|
|
826
820
|
},
|
|
@@ -828,61 +822,54 @@ class C extends A {
|
|
|
828
822
|
composed: !0,
|
|
829
823
|
cancelable: !0
|
|
830
824
|
});
|
|
831
|
-
if (!this.dispatchEvent(n))
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
const o = {
|
|
825
|
+
if (!this.dispatchEvent(n)) return !1;
|
|
826
|
+
this._lastDirection = s ? "forward" : "backward", this.value = r.value;
|
|
827
|
+
const l = {
|
|
835
828
|
index: i,
|
|
836
829
|
value: r.value,
|
|
837
830
|
title: r.title,
|
|
838
831
|
trigger: a
|
|
839
832
|
};
|
|
840
833
|
return this.dispatchEvent(
|
|
841
|
-
new CustomEvent("input", { detail:
|
|
834
|
+
new CustomEvent("input", { detail: l, bubbles: !0, composed: !0 })
|
|
842
835
|
), this.dispatchEvent(
|
|
843
|
-
new CustomEvent("change", { detail:
|
|
836
|
+
new CustomEvent("change", { detail: l, bubbles: !0, composed: !0 })
|
|
844
837
|
), this.dispatchEvent(
|
|
845
|
-
new CustomEvent("step-change", { detail:
|
|
838
|
+
new CustomEvent("step-change", { detail: l, bubbles: !0, composed: !0 })
|
|
846
839
|
), !0;
|
|
847
840
|
}
|
|
848
841
|
goTo(t) {
|
|
849
842
|
const e = this._steps();
|
|
850
|
-
if (!e.length)
|
|
851
|
-
return !1;
|
|
843
|
+
if (!e.length) return !1;
|
|
852
844
|
const i = this._activeIndex(e), a = typeof t == "number" ? t : e.findIndex((r) => r.value === String(t));
|
|
853
845
|
return this._attemptChange(e, i, a, "api");
|
|
854
846
|
}
|
|
855
847
|
next() {
|
|
856
|
-
var i, a;
|
|
857
848
|
const t = this._steps();
|
|
858
|
-
if (!t.length)
|
|
859
|
-
return !1;
|
|
849
|
+
if (!t.length) return !1;
|
|
860
850
|
const e = this._activeIndex(t);
|
|
861
851
|
if (e >= t.length - 1) {
|
|
862
|
-
if (this._isBusy())
|
|
863
|
-
|
|
864
|
-
const r = {
|
|
852
|
+
if (this._isBusy()) return !1;
|
|
853
|
+
const i = {
|
|
865
854
|
index: e,
|
|
866
|
-
value:
|
|
867
|
-
title:
|
|
855
|
+
value: t[e]?.value || "",
|
|
856
|
+
title: t[e]?.title || ""
|
|
868
857
|
};
|
|
869
858
|
return this.dispatchEvent(
|
|
870
|
-
new CustomEvent("complete", { detail:
|
|
859
|
+
new CustomEvent("complete", { detail: i, bubbles: !0, composed: !0 })
|
|
871
860
|
), !0;
|
|
872
861
|
}
|
|
873
862
|
return this._attemptChange(t, e, e + 1, "next");
|
|
874
863
|
}
|
|
875
864
|
prev() {
|
|
876
865
|
const t = this._steps();
|
|
877
|
-
if (!t.length)
|
|
878
|
-
return !1;
|
|
866
|
+
if (!t.length) return !1;
|
|
879
867
|
const e = this._activeIndex(t);
|
|
880
868
|
return this._attemptChange(t, e, e - 1, "prev");
|
|
881
869
|
}
|
|
882
870
|
_onClick(t) {
|
|
883
871
|
const e = t.target;
|
|
884
|
-
if (!e)
|
|
885
|
-
return;
|
|
872
|
+
if (!e) return;
|
|
886
873
|
if (e.closest(".btn-prev")) {
|
|
887
874
|
this.prev();
|
|
888
875
|
return;
|
|
@@ -892,13 +879,11 @@ class C extends A {
|
|
|
892
879
|
return;
|
|
893
880
|
}
|
|
894
881
|
const i = e.closest(".step");
|
|
895
|
-
if (!i)
|
|
896
|
-
return;
|
|
882
|
+
if (!i) return;
|
|
897
883
|
const a = Number(i.getAttribute("data-index"));
|
|
898
|
-
if (!Number.isInteger(a))
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this._attemptChange(r, s, a, "stepper");
|
|
884
|
+
if (!Number.isInteger(a)) return;
|
|
885
|
+
const r = this._steps(), o = this._activeIndex(r);
|
|
886
|
+
this._attemptChange(r, o, a, "stepper");
|
|
902
887
|
}
|
|
903
888
|
_onKeyDown(t) {
|
|
904
889
|
const e = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", i = e === "horizontal" && getComputedStyle(this).direction === "rtl", a = e === "vertical" ? "ArrowDown" : i ? "ArrowLeft" : "ArrowRight", r = e === "vertical" ? "ArrowUp" : i ? "ArrowRight" : "ArrowLeft";
|
|
@@ -910,40 +895,35 @@ class C extends A {
|
|
|
910
895
|
t.preventDefault(), this.prev();
|
|
911
896
|
return;
|
|
912
897
|
}
|
|
913
|
-
const s = t.target
|
|
914
|
-
if (!
|
|
915
|
-
return;
|
|
898
|
+
const s = t.target?.closest(".step");
|
|
899
|
+
if (!s) return;
|
|
916
900
|
const n = this._stepButtons.filter((d) => !d.disabled);
|
|
917
|
-
if (!n.length)
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
if (!(o < 0)) {
|
|
901
|
+
if (!n.length) return;
|
|
902
|
+
const l = n.indexOf(s);
|
|
903
|
+
if (!(l < 0)) {
|
|
921
904
|
if (t.key === a) {
|
|
922
|
-
t.preventDefault(), n[(
|
|
905
|
+
t.preventDefault(), n[(l + 1) % n.length].focus();
|
|
923
906
|
return;
|
|
924
907
|
}
|
|
925
908
|
if (t.key === r) {
|
|
926
|
-
t.preventDefault(), n[(
|
|
909
|
+
t.preventDefault(), n[(l - 1 + n.length) % n.length].focus();
|
|
927
910
|
return;
|
|
928
911
|
}
|
|
929
912
|
if (t.key === "Home" || t.key === "End") {
|
|
930
913
|
t.preventDefault(), (t.key === "Home" ? n[0] : n[n.length - 1]).focus();
|
|
931
914
|
return;
|
|
932
915
|
}
|
|
933
|
-
(t.key === " " || t.key === "Enter") && (t.preventDefault(),
|
|
916
|
+
(t.key === " " || t.key === "Enter") && (t.preventDefault(), s.click());
|
|
934
917
|
}
|
|
935
918
|
}
|
|
936
919
|
_syncValueUi() {
|
|
937
|
-
|
|
938
|
-
if (!this.isConnected)
|
|
939
|
-
return;
|
|
920
|
+
if (!this.isConnected) return;
|
|
940
921
|
if (!this.root.querySelector(".frame")) {
|
|
941
922
|
this.requestRender();
|
|
942
923
|
return;
|
|
943
924
|
}
|
|
944
925
|
const t = this._steps();
|
|
945
|
-
if (!t.length)
|
|
946
|
-
return;
|
|
926
|
+
if (!t.length) return;
|
|
947
927
|
this._isSyncingValueAttribute = !0;
|
|
948
928
|
let e = -1;
|
|
949
929
|
try {
|
|
@@ -951,31 +931,31 @@ class C extends A {
|
|
|
951
931
|
} finally {
|
|
952
932
|
this._isSyncingValueAttribute = !1;
|
|
953
933
|
}
|
|
954
|
-
this._syncPanels(t, e), this._stepButtons.forEach((
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
const h =
|
|
960
|
-
h && (h.setAttribute("data-status",
|
|
934
|
+
this._syncPanels(t, e), this._stepButtons.forEach((s, n) => {
|
|
935
|
+
const l = n === e, d = this._visualStatus(t[n], n, e);
|
|
936
|
+
s.setAttribute("data-active", l ? "true" : "false"), s.setAttribute("data-status", d), s.setAttribute("aria-selected", l ? "true" : "false"), s.setAttribute("tabindex", l ? "0" : "-1");
|
|
937
|
+
const p = s.querySelector(".step-badge");
|
|
938
|
+
p && (d === "complete" || d === "success" ? p.textContent = "✓" : d === "warning" ? p.textContent = "!" : d === "error" ? p.textContent = "×" : p.textContent = String(n + 1));
|
|
939
|
+
const h = s.closest(".step-item");
|
|
940
|
+
h && (h.setAttribute("data-status", d), h.setAttribute(
|
|
961
941
|
"data-complete",
|
|
962
|
-
|
|
963
|
-
), h.setAttribute("data-current",
|
|
942
|
+
n < e ? "true" : "false"
|
|
943
|
+
), h.setAttribute("data-current", l ? "true" : "false"));
|
|
964
944
|
});
|
|
965
945
|
const i = t.length, a = i <= 1 || e < 0 ? 0 : Math.round(e / (i - 1) * 100);
|
|
966
946
|
this._progressEl && this._progressEl.style.setProperty("--ui-wizard-progress", `${a}%`), this._statusStepEl && (this._statusStepEl.textContent = `Step ${Math.max(1, e + 1)} of ${i}`), this._statusValueEl && (this._statusValueEl.textContent = `${a}%`);
|
|
967
947
|
const r = this._isBusy();
|
|
968
948
|
if (this._prevBtn && (this._prevBtn.disabled = e <= 0 || r), this._nextBtn) {
|
|
969
|
-
const
|
|
970
|
-
this._nextBtn.textContent =
|
|
949
|
+
const s = e >= i - 1, n = this.getAttribute("next-label") || "Next", l = this.getAttribute("finish-label") || "Finish";
|
|
950
|
+
this._nextBtn.textContent = s ? l : n, this._nextBtn.setAttribute("data-loading", r ? "true" : "false"), this._nextBtn.disabled = r || e < 0 || t[e]?.disabled === !0;
|
|
971
951
|
}
|
|
972
|
-
const
|
|
973
|
-
|
|
952
|
+
const o = this.root.querySelector(".frame");
|
|
953
|
+
o && o.setAttribute("aria-busy", r ? "true" : "false"), this._progressRow && (this.getAttribute("show-progress") !== "false" && i > 0 ? this._progressRow.removeAttribute("hidden") : this._progressRow.setAttribute("hidden", ""));
|
|
974
954
|
}
|
|
975
955
|
render() {
|
|
976
956
|
const t = this._steps(), e = this._activeIndex(t);
|
|
977
957
|
this._markVisited(t, e), this._syncPanels(t, e);
|
|
978
|
-
const i = this.getAttribute("title") || "", a = this.getAttribute("description") || "", r = this.getAttribute("show-stepper") !== "false" && t.length > 0,
|
|
958
|
+
const i = this.getAttribute("title") || "", a = this.getAttribute("description") || "", r = this.getAttribute("show-stepper") !== "false" && t.length > 0, o = this.getAttribute("show-progress") !== "false" && t.length > 0, s = this.getAttribute("stepper-position") === "bottom" ? "bottom" : "top", n = this.hasAttribute("hide-controls") || t.length === 0, l = this.getAttribute("prev-label") || "Previous", d = this.getAttribute("next-label") || "Next", p = this.getAttribute("finish-label") || "Finish", h = this.getAttribute("empty-label") || 'No wizard steps configured. Add elements with slot="step".', m = r ? `
|
|
979
959
|
<div
|
|
980
960
|
class="stepper"
|
|
981
961
|
part="stepper"
|
|
@@ -983,10 +963,10 @@ class C extends A {
|
|
|
983
963
|
aria-orientation="${this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal"}"
|
|
984
964
|
aria-label="${c(this.getAttribute("aria-label") || "Wizard steps")}"
|
|
985
965
|
>
|
|
986
|
-
${t.map((
|
|
987
|
-
const
|
|
966
|
+
${t.map((b, u) => {
|
|
967
|
+
const f = this._visualStatus(b, u, e), z = this._tabId(u), y = this._panelId(u), _ = f === "complete" || f === "success" ? "✓" : f === "warning" ? "!" : f === "error" ? "×" : String(u + 1);
|
|
988
968
|
return `
|
|
989
|
-
<div class="step-item" part="step-item" data-index="${u}" data-last="${u === t.length - 1 ? "true" : "false"}" data-status="${
|
|
969
|
+
<div class="step-item" part="step-item" data-index="${u}" data-last="${u === t.length - 1 ? "true" : "false"}" data-status="${f}" data-complete="${u < e ? "true" : "false"}" data-current="${u === e ? "true" : "false"}">
|
|
990
970
|
<button
|
|
991
971
|
type="button"
|
|
992
972
|
class="step"
|
|
@@ -996,16 +976,16 @@ class C extends A {
|
|
|
996
976
|
aria-controls="${y}"
|
|
997
977
|
data-index="${u}"
|
|
998
978
|
data-active="${u === e ? "true" : "false"}"
|
|
999
|
-
data-status="${
|
|
979
|
+
data-status="${f}"
|
|
1000
980
|
aria-selected="${u === e ? "true" : "false"}"
|
|
1001
|
-
aria-disabled="${
|
|
981
|
+
aria-disabled="${b.disabled ? "true" : "false"}"
|
|
1002
982
|
tabindex="${u === e ? "0" : "-1"}"
|
|
1003
|
-
${
|
|
983
|
+
${b.disabled ? "disabled" : ""}
|
|
1004
984
|
>
|
|
1005
985
|
<span class="step-badge" part="step-badge">${_}</span>
|
|
1006
986
|
<span class="step-main" part="step-main">
|
|
1007
|
-
<span class="step-title" part="step-title">${c(
|
|
1008
|
-
${
|
|
987
|
+
<span class="step-title" part="step-title">${c(b.title)}${b.optional ? " (optional)" : ""}</span>
|
|
988
|
+
${b.description ? `<span class="step-description" part="step-description">${c(b.description)}</span>` : ""}
|
|
1009
989
|
</span>
|
|
1010
990
|
</button>
|
|
1011
991
|
</div>
|
|
@@ -1019,7 +999,7 @@ class C extends A {
|
|
|
1019
999
|
<h3 class="title" part="title" ${i ? "" : "hidden"}>${c(i)}</h3>
|
|
1020
1000
|
<p class="description" part="description" ${a ? "" : "hidden"}>${c(a)}</p>
|
|
1021
1001
|
|
|
1022
|
-
<div class="status" part="status" ${
|
|
1002
|
+
<div class="status" part="status" ${o ? "" : "hidden"}>
|
|
1023
1003
|
<div class="status-row">
|
|
1024
1004
|
<span class="status-step" part="status-step"></span>
|
|
1025
1005
|
<span class="status-value" part="status-value"></span>
|
|
@@ -1027,19 +1007,19 @@ class C extends A {
|
|
|
1027
1007
|
<div class="progress" part="progress"></div>
|
|
1028
1008
|
</div>
|
|
1029
1009
|
|
|
1030
|
-
${
|
|
1010
|
+
${s === "top" ? m : ""}
|
|
1031
1011
|
|
|
1032
1012
|
<div class="panel" part="panel" ${t.length ? "" : "hidden"}>
|
|
1033
1013
|
<slot name="step"></slot>
|
|
1034
1014
|
</div>
|
|
1035
|
-
<p class="empty" part="empty" ${t.length ? "hidden" : ""}>${c(
|
|
1015
|
+
<p class="empty" part="empty" ${t.length ? "hidden" : ""}>${c(h)}</p>
|
|
1036
1016
|
|
|
1037
|
-
${
|
|
1017
|
+
${s === "bottom" ? m : ""}
|
|
1038
1018
|
|
|
1039
1019
|
<div class="controls" part="controls" ${n ? "hidden" : ""}>
|
|
1040
1020
|
<div class="group" part="controls-start"><slot name="controls-start"></slot></div>
|
|
1041
1021
|
<div class="group" part="controls-end">
|
|
1042
|
-
<button type="button" class="btn btn-prev" part="button-prev" ${w ? "disabled" : ""}>${c(
|
|
1022
|
+
<button type="button" class="btn btn-prev" part="button-prev" ${w ? "disabled" : ""}>${c(l)}</button>
|
|
1043
1023
|
<button type="button" class="btn primary btn-next" part="button-next" data-loading="${this._isBusy() ? "true" : "false"}">${c(x ? p : d)}</button>
|
|
1044
1024
|
<slot name="controls-end"></slot>
|
|
1045
1025
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editora/ui-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Framework-agnostic Web Components and primitives for the Editora UI ecosystem",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"jsdom": "^22.1.0",
|
|
48
48
|
"rimraf": "^5.0.0",
|
|
49
49
|
"typescript": "^5.0.0",
|
|
50
|
-
"vite": "^
|
|
50
|
+
"vite": "^7.3.1",
|
|
51
51
|
"vitest": "^1.0.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("./calendar-a8735e40.js"),C=require("./scroll-lock-d7b0df21.js"),I=require("./positioner-33529bb8.js"),w=new Map,v=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function s(t){return String(t).padStart(2,"0")}function b(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function N(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function O(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function L(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function U(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function F(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function P(t){const e=(t||"").trim();return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${s(e.m)}-${s(e.d)}`:null}function g(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=d(e[2],!0);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function z(t,e){if(!t||!e)return null;const n=m(t),r=d(e,!0);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function A(t){if(!t)return null;const e=m(t);if(e)return e;const n=g(t);return(n==null?void 0:n.date)||null}function Y(t){if(!t)return null;const e=g(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function k(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify(n||{})}`;let i=w.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC",...n||{}}),w.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function q(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=O(e),u=L(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,u[o.m-1]||"").replace(/MM/g,s(o.m)).replace(/DD/g,s(o.d))}return k(t,e)}function B(t,e){const n=m(t.trim());if(n)return n;const r=N(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map($=>$.trim()).filter(Boolean);if(i.length!==3)return null;const u=b(i[0]),a=b(i[1]),h=b(i[2]);if(u==null||a==null||h==null)return null;let f=h;f<100&&(f+=f>=70?1900:2e3);const p=e.toLowerCase().startsWith("en-us"),c=p?u:a,D=p?a:u;if(f<1e3||c<1||c>12||D<1||D>31)return null;const T=`${f}-${s(c)}-${s(D)}`;return m(T)}function d(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),u=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(u)||i<0||i>59||u<0||u>59||!e&&u!==0)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:u}}function M(t,e=!1){if(!t)return"";const n=s(y(t.hours,0,23)),r=s(y(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=s(y(t.seconds,0,59));return`${n}:${r}:${o}`}function x(t,e){const n=d(t,!0);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=d(t,!0),r=d(e,!0);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function H(t,e,n){const r=d(t,!0);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function E(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function W(t,e){const n=g(t),r=g(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function Z(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${s(n.m)}-${s(n.d)}`,end:`${r.y}-${s(r.m)}-${s(r.d)}`}}function _(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function R(t,e,n=8,r=8,o=null){const u=(typeof window<"u"?window.innerHeight:800)-t.bottom-r-n,a=t.top-r-n,h=u>=e.height,f=a>=e.height,p=o==="top"?"top":"bottom";let c;if(h&&!f)c="bottom";else if(f&&!h)c="top";else if(f&&h)c=p;else{const T=p==="bottom"?u:a,$=p==="bottom"?a:u;T>0&&$<=T+v?c=p:c=u>=a?"bottom":"top"}const D=I.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(D.y),left:Math.round(D.x),placement:c}}function G(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function J(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function K(){return C.acquireBodyScrollLock()}exports.clampDateIso=E;exports.clampTime=H;exports.combineDateTime=z;exports.compareDateTimes=W;exports.compareTimes=S;exports.computeLastDaysRange=_;exports.computeMonthRange=Z;exports.computePopoverPosition=R;exports.eventOriginatesWithin=F;exports.formatDateForDisplay=q;exports.formatTime=M;exports.isTruthyAttr=U;exports.lockBodyScroll=K;exports.normalizeDateIso=m;exports.normalizeLocale=P;exports.parseConstraintDate=A;exports.parseConstraintDateTime=Y;exports.parseTimeInput=d;exports.parseUserDateInput=B;exports.rafThrottle=G;exports.shouldUseMobileSheet=J;exports.splitDateTime=g;exports.to12hDisplay=x;
|