@editora/ui-core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/alert-dialog.cjs.js +32 -24
- package/dist/alert-dialog.esm.js +48 -40
- package/dist/alert.cjs.js +2 -2
- package/dist/alert.esm.js +2 -2
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +12 -7
- package/dist/app-header.esm.js +12 -7
- package/dist/avatar.cjs.js +3 -3
- package/dist/avatar.esm.js +3 -3
- package/dist/{calendar-o273O28D.js → calendar-CzpWDxLc.js} +5 -4
- package/dist/{calendar-DmxiZrR7.mjs → calendar-DkSDFg33.mjs} +1 -0
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/chart.cjs.js +13 -7
- package/dist/chart.esm.js +13 -7
- package/dist/collapsible.cjs.js +2 -2
- package/dist/collapsible.esm.js +2 -2
- package/dist/color-picker.cjs.js +3 -3
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +3 -3
- package/dist/combobox.esm.js +36 -36
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +1 -1
- package/dist/context-menu.esm.js +1 -1
- package/dist/data-table.cjs.js +3 -3
- package/dist/data-table.esm.js +3 -3
- package/dist/date-field.cjs.js +2 -2
- package/dist/date-field.esm.js +14 -14
- package/dist/date-picker.cjs.js +3 -3
- package/dist/date-picker.esm.js +4 -4
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +59 -59
- package/dist/date-range-time-picker.cjs.js +2 -2
- package/dist/date-range-time-picker.esm.js +3 -3
- package/dist/date-time-picker.cjs.js +2 -2
- package/dist/date-time-picker.esm.js +3 -3
- package/dist/{date-time-utils-DdigV4hs.js → date-time-utils-C-4eHTyy.js} +1 -1
- package/dist/{date-time-utils-B4hAkt36.mjs → date-time-utils-zAx4ghvC.mjs} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +1 -1
- package/dist/field.esm.js +29 -29
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +3 -3
- package/dist/file-upload.cjs.js +2 -2
- package/dist/file-upload.esm.js +2 -2
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/form.cjs.js +4 -4
- package/dist/form.esm.js +4 -4
- package/dist/gantt.cjs.js +7 -5
- package/dist/gantt.esm.js +7 -5
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +11 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inline-edit.cjs.js +6 -6
- package/dist/inline-edit.esm.js +15 -15
- package/dist/input.cjs.js +1 -1
- package/dist/input.esm.js +1 -1
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +1 -1
- package/dist/menu.esm.js +1 -1
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +1 -1
- package/dist/multi-select.cjs.js +7 -7
- package/dist/multi-select.esm.js +26 -26
- package/dist/number-field.cjs.js +1 -1
- package/dist/number-field.esm.js +1 -1
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +7 -7
- package/dist/odometer.esm.js +14 -14
- package/dist/password-field.cjs.js +1 -1
- package/dist/password-field.esm.js +1 -1
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/quick-actions.cjs.js +1 -1
- package/dist/quick-actions.esm.js +1 -1
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/{runtime-CQM6wZOc.mjs → runtime-BRT7E4A8.mjs} +377 -329
- package/dist/runtime-CXw4SGV9.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +1 -1
- package/dist/select.cjs.js +2 -2
- package/dist/select.esm.js +2 -2
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -6
- package/dist/sidebar.esm.js +7 -6
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +6 -6
- package/dist/sortable.esm.js +6 -6
- package/dist/split-button.cjs.js +2 -2
- package/dist/split-button.esm.js +2 -2
- package/dist/tabs.cjs.js +11 -6
- package/dist/tabs.esm.js +28 -23
- package/dist/tags-input.cjs.js +2 -2
- package/dist/tags-input.esm.js +2 -2
- package/dist/textarea.cjs.js +2 -2
- package/dist/textarea.esm.js +16 -16
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +2 -2
- package/dist/time-field.esm.js +24 -24
- package/dist/time-picker.cjs.js +2 -2
- package/dist/time-picker.esm.js +3 -3
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/transfer-list.cjs.js +9 -9
- package/dist/transfer-list.esm.js +4 -4
- package/dist/wizard.cjs.js +16 -7
- package/dist/wizard.esm.js +16 -7
- package/package.json +1 -1
- package/dist/runtime-DxCl0A5q.js +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E as et } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { s as D, a as E } from "./control-name-Bpj7F34X.mjs";
|
|
3
3
|
import { c as it } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
-
import { r as
|
|
5
|
-
import { r as
|
|
4
|
+
import { r as rt, c as K } from "./calendar-DkSDFg33.mjs";
|
|
5
|
+
import { r as nt, e as st, i as v, s as at, b as ot, p as Z, f as W, a as Y, l as j, c as lt, d as k, g as dt, h as ut, n as L } from "./date-time-utils-zAx4ghvC.mjs";
|
|
6
6
|
let ct = 0;
|
|
7
7
|
const pt = `
|
|
8
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -31,7 +31,7 @@ const pt = `
|
|
|
31
31
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
32
32
|
--ui-dp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
33
33
|
--ui-dp-panel-radius: calc(var(--ui-dp-radius) + 2px);
|
|
34
|
-
--ui-dp-field-error: var(--ui-color-danger, #dc2626);
|
|
34
|
+
--ui-dp-field-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
35
35
|
--ui-dp-focus-ring: color-mix(in srgb, var(--ui-dp-accent) 26%, transparent);
|
|
36
36
|
--ui-dp-z: 1600;
|
|
37
37
|
--ui-dp-duration: 160ms;
|
|
@@ -342,7 +342,7 @@ const pt = `
|
|
|
342
342
|
--ui-dp-success: var(--ui-color-success, #15803d);
|
|
343
343
|
--ui-dp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
344
344
|
--ui-dp-panel-radius: calc(var(--ui-dp-radius) + 2px);
|
|
345
|
-
--ui-dp-field-error: var(--ui-color-danger, #dc2626);
|
|
345
|
+
--ui-dp-field-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
346
346
|
--ui-dp-focus-ring: color-mix(in srgb, var(--ui-dp-accent) 26%, transparent);
|
|
347
347
|
--ui-dp-duration: 160ms;
|
|
348
348
|
--ui-dp-ease: cubic-bezier(0.2, 0.9, 0.24, 1);
|
|
@@ -447,16 +447,16 @@ function _(c) {
|
|
|
447
447
|
function yt(c, t) {
|
|
448
448
|
const e = c.trim();
|
|
449
449
|
if (!e) return { start: null, end: null };
|
|
450
|
-
const i = e.split(/\s(?:—|–|to)\s/i).map((
|
|
450
|
+
const i = e.split(/\s(?:—|–|to)\s/i).map((n) => n.trim()).filter(Boolean);
|
|
451
451
|
if (i.length > 1) {
|
|
452
|
-
const
|
|
453
|
-
return { start:
|
|
452
|
+
const n = k(i[0] || "", t), d = k(i[1] || "", t);
|
|
453
|
+
return { start: n, end: d };
|
|
454
454
|
}
|
|
455
455
|
return { start: k(e, t), end: null };
|
|
456
456
|
}
|
|
457
457
|
class gt extends et {
|
|
458
458
|
constructor() {
|
|
459
|
-
super(...arguments), this._value = { start: null, end: null }, this._pending = { start: null, end: null }, this._draftStart = "", this._draftEnd = "", this._draftSingle = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayMode = null, this._uid = `ui-drp-${++ct}`, this._singleId = `${this._uid}-single`, this._startId = `${this._uid}-start`, this._endId = `${this._uid}-end`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._panelTitleId = `${this._uid}-panel-title`, this._overlayFocusedOnOpen = !1, this._inlineCalendarFramePending = !1, this._inlineCalendarUpgradePending = !1, this._schedulePosition =
|
|
459
|
+
super(...arguments), this._value = { start: null, end: null }, this._pending = { start: null, end: null }, this._draftStart = "", this._draftEnd = "", this._draftSingle = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayMode = null, this._uid = `ui-drp-${++ct}`, this._singleId = `${this._uid}-single`, this._startId = `${this._uid}-start`, this._endId = `${this._uid}-end`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._panelTitleId = `${this._uid}-panel-title`, this._overlayFocusedOnOpen = !1, this._inlineCalendarFramePending = !1, this._inlineCalendarUpgradePending = !1, this._schedulePosition = nt(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
|
|
460
460
|
st(t, [this._overlay]) || this._schedulePosition.run();
|
|
461
461
|
}, this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendarChange(t);
|
|
462
462
|
}
|
|
@@ -560,7 +560,7 @@ class gt extends et {
|
|
|
560
560
|
return ot(this.getAttribute("locale"));
|
|
561
561
|
}
|
|
562
562
|
_translations() {
|
|
563
|
-
return
|
|
563
|
+
return rt(
|
|
564
564
|
this.getAttribute("locale"),
|
|
565
565
|
this.getAttribute("translations")
|
|
566
566
|
);
|
|
@@ -631,8 +631,8 @@ class gt extends et {
|
|
|
631
631
|
this.dispatchEvent(new CustomEvent("invalid", { detail: { raw: t, reason: e }, bubbles: !0, composed: !0 }));
|
|
632
632
|
}
|
|
633
633
|
_normalizePending(t) {
|
|
634
|
-
const { min: e, max: i } = this._resolvedBounds(),
|
|
635
|
-
return !
|
|
634
|
+
const { min: e, max: i } = this._resolvedBounds(), r = t.start ? Y(t.start, e, i) : null, n = t.end ? Y(t.end, e, i) : null;
|
|
635
|
+
return !r || !n ? { start: r, end: n } : K(r, n) > 0 ? { start: n, end: r } : { start: r, end: n };
|
|
636
636
|
}
|
|
637
637
|
_canCommit(t) {
|
|
638
638
|
return !t.start && !t.end ? !0 : !(!this._allowPartial() && (!t.start || !t.end) || t.start && t.end && !this._allowSameDay() && t.start === t.end);
|
|
@@ -697,18 +697,18 @@ class gt extends et {
|
|
|
697
697
|
if (!t || !e) return;
|
|
698
698
|
const i = t.getBoundingClientRect();
|
|
699
699
|
e.style.setProperty("--ui-drp-panel-width", `${Math.round(i.width)}px`);
|
|
700
|
-
const
|
|
700
|
+
const r = e.getBoundingClientRect(), n = e.getAttribute("data-placement"), d = lt(
|
|
701
701
|
i,
|
|
702
|
-
|
|
702
|
+
r,
|
|
703
703
|
8,
|
|
704
704
|
8,
|
|
705
|
-
|
|
705
|
+
n === "top" ? "top" : n === "bottom" ? "bottom" : null
|
|
706
706
|
);
|
|
707
707
|
e.style.position = "absolute", e.style.top = `${Math.round(d.top)}px`, e.style.left = `${Math.round(d.left)}px`, e.setAttribute("data-placement", d.placement);
|
|
708
708
|
}
|
|
709
709
|
_renderPanelInner(t) {
|
|
710
|
-
const e = this._translations(), i = (this.getAttribute("label") || "").trim(),
|
|
711
|
-
<header class="header" part="header" ${
|
|
710
|
+
const e = this._translations(), i = (this.getAttribute("label") || "").trim(), r = !!i || t, n = t ? "true" : "false", d = `
|
|
711
|
+
<header class="header" part="header" ${r ? "" : "hidden"}>
|
|
712
712
|
<p class="title" id="${this._panelTitleId}" ${i ? "" : "hidden"}>${_(i)}</p>
|
|
713
713
|
${t ? `<button type="button" class="action" data-action="cancel">${_(e.cancel)}</button>` : ""}
|
|
714
714
|
</header>
|
|
@@ -727,7 +727,7 @@ class gt extends et {
|
|
|
727
727
|
return `
|
|
728
728
|
<style>${bt}</style>
|
|
729
729
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
730
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${
|
|
730
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${n}" aria-labelledby="${this._panelTitleId}" part="${t ? "sheet" : "popover"}">${d}</section>
|
|
731
731
|
`;
|
|
732
732
|
}
|
|
733
733
|
_syncCalendar(t) {
|
|
@@ -737,8 +737,8 @@ class gt extends et {
|
|
|
737
737
|
return;
|
|
738
738
|
}
|
|
739
739
|
t.getAttribute(h) !== u && t.setAttribute(h, u);
|
|
740
|
-
}, i = G(this._pending), { min:
|
|
741
|
-
e("selection", "range"), e("value", i), e("min",
|
|
740
|
+
}, i = G(this._pending), { min: r, max: n } = this._resolvedBounds();
|
|
741
|
+
e("selection", "range"), e("value", i), e("min", r), e("max", n), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
|
|
742
742
|
const a = this.getAttribute("size") || "sm";
|
|
743
743
|
e("size", a === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), e("outside-click", this.getAttribute("outside-click"));
|
|
744
744
|
const p = t.classList.contains("inline-calendar");
|
|
@@ -756,10 +756,10 @@ class gt extends et {
|
|
|
756
756
|
t && !this._releaseScrollLock ? this._releaseScrollLock = j() : !t && this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null), this._ensureOverlayContent(t);
|
|
757
757
|
const e = this._overlay.querySelector(".title"), i = this._overlay.querySelector(".panel, .sheet");
|
|
758
758
|
this._syncDismissableLayer();
|
|
759
|
-
const
|
|
760
|
-
i && (i.dataset.bare = this._isBare() ? "true" : "false"),
|
|
759
|
+
const r = this._overlay.querySelector(".header"), n = this._overlay.querySelector(".presets"), d = this._overlay.querySelector(".footer"), a = this._translations();
|
|
760
|
+
i && (i.dataset.bare = this._isBare() ? "true" : "false"), r && (r.hidden = !(this.getAttribute("label") || "").trim() && !t);
|
|
761
761
|
const p = this._showFooter();
|
|
762
|
-
if (
|
|
762
|
+
if (n && (n.hidden = !p), d && (d.hidden = !p), e) {
|
|
763
763
|
const y = (this.getAttribute("label") || "").trim();
|
|
764
764
|
e.textContent = y, e.hidden = !y;
|
|
765
765
|
}
|
|
@@ -809,24 +809,24 @@ class gt extends et {
|
|
|
809
809
|
}
|
|
810
810
|
_updateHostState() {
|
|
811
811
|
if (!this._hasView) return;
|
|
812
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "",
|
|
813
|
-
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", a === "single-field" ? this._singleId : this._startId)), S && (S.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = a === "single-field" ? "true" : "false", f.dataset.invalid =
|
|
812
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, n = this._translations(), d = r ? "error" : this._state(), a = this._rangeVariant(), p = this._isInlineMode(), h = !!(this._value.start || this._value.end || this._pending.start || this._pending.end), u = this._isInteractionBlocked(), b = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), I = this.root.querySelector(".required"), f = this.root.querySelector(".fields"), o = this.root.querySelector(".single"), l = this.root.querySelector(".start"), s = this.root.querySelector(".end"), y = this.root.querySelector(".sep"), A = this.root.querySelector('.btn[data-action="clear"]'), m = this.root.querySelector('.btn[data-action="toggle"]'), x = this.root.querySelector(".hint"), C = this.root.querySelector(".error"), g = this.root.querySelector(".inline-panel"), q = this.root.querySelector(".inline-panel .presets"), R = this.root.querySelector(".inline-panel .footer"), O = this.root.querySelector(".hidden-range"), z = this.root.querySelector(".hidden-start"), P = this.root.querySelector(".hidden-end"), Q = this.root.querySelectorAll(".inline-panel .action");
|
|
813
|
+
b && (b.hidden = !t, b.id = this._labelId, b.setAttribute("for", a === "single-field" ? this._singleId : this._startId)), S && (S.textContent = t), I && (I.hidden = !this.hasAttribute("required")), f && (f.dataset.single = a === "single-field" ? "true" : "false", f.dataset.invalid = r ? "true" : "false", f.dataset.open = this._open && !p ? "true" : "false", f.dataset.state = d, f.setAttribute("aria-disabled", u ? "true" : "false")), o && (o.value !== this._draftSingle && (o.value = this._draftSingle), o.id = this._singleId, o.hidden = a !== "single-field", o.readOnly = this._isReadonly() || u, o.disabled = u, o.required = this.hasAttribute("required"), o.placeholder = n.startEnd, o.autocomplete = "off", o.setAttribute("role", "combobox"), o.setAttribute("aria-haspopup", "dialog"), o.setAttribute("aria-controls", this._panelId), o.setAttribute("aria-expanded", p ? "false" : String(this._open)), o.setAttribute("aria-invalid", r ? "true" : "false"), D(o, this, t ? this._labelId : null, n.startEnd)), l && (l.value !== this._draftStart && (l.value = this._draftStart), l.id = this._startId, l.hidden = a === "single-field", l.readOnly = this._isReadonly() || u, l.disabled = u, l.required = this.hasAttribute("required"), l.placeholder = n.startDate, l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-expanded", p ? "false" : String(this._open)), l.setAttribute("aria-invalid", r ? "true" : "false"), D(l, this, t ? this._labelId : null, n.startDate)), s && (s.value !== this._draftEnd && (s.value = this._draftEnd), s.id = this._endId, s.hidden = a === "single-field", s.readOnly = this._isReadonly() || u, s.disabled = u, s.required = this.hasAttribute("required"), s.placeholder = n.endDate, s.autocomplete = "off", s.setAttribute("role", "combobox"), s.setAttribute("aria-haspopup", "dialog"), s.setAttribute("aria-controls", this._panelId), s.setAttribute("aria-expanded", p ? "false" : String(this._open)), s.setAttribute("aria-invalid", r ? "true" : "false"), D(s, this, t ? this._labelId : null, n.endDate)), y && (y.hidden = a === "single-field"), A && (A.hidden = !(this._clearable() && h), A.disabled = u, A.setAttribute("aria-label", n.clearDateRange)), m && (m.hidden = p, m.disabled = u, m.setAttribute("aria-expanded", p ? "false" : String(this._open)), m.setAttribute("aria-controls", this._panelId), m.setAttribute("aria-label", n.toggleCalendar)), x && (x.id = this._hintId, x.hidden = !e, x.textContent = e), C && (C.id = this._errorId, C.hidden = !r, C.textContent = r);
|
|
814
814
|
const w = [];
|
|
815
|
-
e && x && !x.hidden && w.push(this._hintId),
|
|
815
|
+
e && x && !x.hidden && w.push(this._hintId), r && w.push(this._errorId), E(o, this, `${this._uid}-single`, w), E(l, this, `${this._uid}-start`, w), E(s, this, `${this._uid}-end`, w), g && (g.hidden = !p, g.id = this._panelId, g.dataset.bare = this._isBare() ? "true" : "false", g.setAttribute("role", "dialog"), g.setAttribute("aria-modal", "false"), g.setAttribute("aria-label", t || n.selectDateRange));
|
|
816
816
|
const $ = this._showFooter();
|
|
817
817
|
q && (q.hidden = !$), R && (R.hidden = !$), Q.forEach((tt) => {
|
|
818
818
|
tt.disabled = u || this._isReadonly();
|
|
819
819
|
});
|
|
820
820
|
const M = this.root.querySelector('.inline-panel [data-action="preset-today"]');
|
|
821
|
-
M && (M.textContent =
|
|
821
|
+
M && (M.textContent = n.today);
|
|
822
822
|
const F = this.root.querySelector('.inline-panel [data-action="preset-last7"]');
|
|
823
|
-
F && (F.textContent =
|
|
823
|
+
F && (F.textContent = n.last7Days);
|
|
824
824
|
const V = this.root.querySelector('.inline-panel [data-action="preset-month"]');
|
|
825
|
-
V && (V.textContent =
|
|
825
|
+
V && (V.textContent = n.thisMonth);
|
|
826
826
|
const H = this.root.querySelector('.inline-panel [data-action="clear"]');
|
|
827
|
-
H && (H.textContent =
|
|
827
|
+
H && (H.textContent = n.clear);
|
|
828
828
|
const T = this.root.querySelector('.inline-panel [data-action="apply"]');
|
|
829
|
-
T && (T.textContent =
|
|
829
|
+
T && (T.textContent = n.apply);
|
|
830
830
|
const B = this.getAttribute("name") || "", U = this.getAttribute("name-start") || "", N = this.getAttribute("name-end") || "", X = this._value.start && this._value.end ? `${this._value.start}..${this._value.end}` : "";
|
|
831
831
|
if (O && (O.disabled = !B, O.name = B, O.value = X), z && (z.disabled = !!B || !U, z.name = U, z.value = this._value.start || ""), P && (P.disabled = !!B || !N, P.name = N, P.value = this._value.end || ""), p) {
|
|
832
832
|
this._scheduleInlineCalendarSync(), this._destroyOverlay();
|
|
@@ -837,21 +837,21 @@ class gt extends et {
|
|
|
837
837
|
_onRootClick(t) {
|
|
838
838
|
const e = t.target;
|
|
839
839
|
if (!e) return;
|
|
840
|
-
const i = e.closest("[data-action]"),
|
|
841
|
-
if (
|
|
842
|
-
if (
|
|
840
|
+
const i = e.closest("[data-action]"), r = i?.getAttribute("data-action");
|
|
841
|
+
if (r && !this._isInteractionBlocked()) {
|
|
842
|
+
if (r === "toggle") {
|
|
843
843
|
this._restoreFocusEl = i, this._setOpen(!this._open, "toggle");
|
|
844
844
|
return;
|
|
845
845
|
}
|
|
846
|
-
if (
|
|
846
|
+
if (r === "clear") {
|
|
847
847
|
this._commit({ start: null, end: null }, "clear");
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
|
-
if (
|
|
850
|
+
if (r === "apply") {
|
|
851
851
|
this._commit(this._pending, "apply"), this._isInlineMode() || this._setOpen(!1, "apply");
|
|
852
852
|
return;
|
|
853
853
|
}
|
|
854
|
-
|
|
854
|
+
r === "cancel" && (this._pending = { ...this._value }, this._isInlineMode() || this._setOpen(!1, "cancel"), this._updateHostState());
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
_onRootInput(t) {
|
|
@@ -865,21 +865,21 @@ class gt extends et {
|
|
|
865
865
|
}
|
|
866
866
|
_commitFromDraft(t) {
|
|
867
867
|
if (this._rangeVariant() === "single-field") {
|
|
868
|
-
const
|
|
869
|
-
if (!
|
|
868
|
+
const n = this._draftSingle.trim();
|
|
869
|
+
if (!n)
|
|
870
870
|
return this._pending = { start: null, end: null }, this._commit(this._pending, t), !0;
|
|
871
|
-
const d = yt(
|
|
872
|
-
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(
|
|
871
|
+
const d = yt(n, this._locale());
|
|
872
|
+
return !d.start || !d.end && !this._allowPartial() ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(n, "parse"), this._updateHostState(), !1) : (this._pending = this._normalizePending({ start: d.start, end: d.end || null }), this._commit(this._pending, t), !0);
|
|
873
873
|
}
|
|
874
|
-
const i = this._draftStart ? k(this._draftStart, this._locale()) : null,
|
|
875
|
-
return this._draftStart && !i || this._draftEnd && !
|
|
874
|
+
const i = this._draftStart ? k(this._draftStart, this._locale()) : null, r = this._draftEnd ? k(this._draftEnd, this._locale()) : null;
|
|
875
|
+
return this._draftStart && !i || this._draftEnd && !r ? (this._inlineError = this.getAttribute("error") || this._translations().invalidRange, this._emitInvalid(`${this._draftStart} ${this._draftEnd}`.trim(), "parse"), this._updateHostState(), !1) : (this._pending = this._normalizePending({ start: i, end: r }), this._commit(this._pending, t), !0);
|
|
876
876
|
}
|
|
877
877
|
_onRootBlur(t) {
|
|
878
878
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
879
879
|
const e = t, i = e.target;
|
|
880
880
|
if (!(i instanceof HTMLInputElement)) return;
|
|
881
|
-
const
|
|
882
|
-
|
|
881
|
+
const r = e.relatedTarget;
|
|
882
|
+
r && this._overlay?.contains(r) || this._open && !this._isInlineMode() || (i.classList.contains("single") || i.classList.contains("start") || i.classList.contains("end")) && (i.classList.contains("single") && (this._draftSingle = i.value), i.classList.contains("start") && (this._draftStart = i.value), i.classList.contains("end") && (this._draftEnd = i.value), this._commitFromDraft("blur"));
|
|
883
883
|
}
|
|
884
884
|
_onRootKeyDown(t) {
|
|
885
885
|
const e = t;
|
|
@@ -909,37 +909,37 @@ class gt extends et {
|
|
|
909
909
|
_onOverlayClick(t) {
|
|
910
910
|
const e = t.target;
|
|
911
911
|
if (!e) return;
|
|
912
|
-
const
|
|
913
|
-
if (
|
|
914
|
-
if (
|
|
912
|
+
const r = e.closest("[data-action]")?.getAttribute("data-action");
|
|
913
|
+
if (r && !(this._isInteractionBlocked() || this._isReadonly())) {
|
|
914
|
+
if (r === "backdrop") {
|
|
915
915
|
this._setOpen(!1, "outside");
|
|
916
916
|
return;
|
|
917
917
|
}
|
|
918
|
-
if (
|
|
918
|
+
if (r === "clear") {
|
|
919
919
|
this._pending = { start: null, end: null }, this._emitInput("clear"), this._renderOverlay();
|
|
920
920
|
return;
|
|
921
921
|
}
|
|
922
|
-
if (
|
|
922
|
+
if (r === "cancel") {
|
|
923
923
|
this._pending = { ...this._value }, this._setOpen(!1, "cancel");
|
|
924
924
|
return;
|
|
925
925
|
}
|
|
926
|
-
if (
|
|
926
|
+
if (r === "apply") {
|
|
927
927
|
this._commit(this._pending, "apply"), this._setOpen(!1, "apply");
|
|
928
928
|
return;
|
|
929
929
|
}
|
|
930
|
-
if (
|
|
931
|
-
const
|
|
932
|
-
this._pending = this._normalizePending({ start:
|
|
930
|
+
if (r === "preset-today") {
|
|
931
|
+
const n = this._todayIso();
|
|
932
|
+
this._pending = this._normalizePending({ start: n, end: n }), this._emitInput("preset-today"), this._renderOverlay();
|
|
933
933
|
return;
|
|
934
934
|
}
|
|
935
|
-
if (
|
|
936
|
-
const
|
|
937
|
-
this._pending = this._normalizePending(dt(
|
|
935
|
+
if (r === "preset-last7") {
|
|
936
|
+
const n = this._todayIso();
|
|
937
|
+
this._pending = this._normalizePending(dt(n, 7)), this._emitInput("preset-last7"), this._renderOverlay();
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
942
|
-
this._pending = this._normalizePending(ut(
|
|
940
|
+
if (r === "preset-month") {
|
|
941
|
+
const n = this._todayIso();
|
|
942
|
+
this._pending = this._normalizePending(ut(n)), this._emitInput("preset-month"), this._renderOverlay();
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const G=require("./ElementBase-DxbvhLJs.js"),j=require("./control-name-BmoI1m3a.js"),Q=require("./dismissable-layer-DNfrKA20.js"),X=require("./calendar-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const G=require("./ElementBase-DxbvhLJs.js"),j=require("./control-name-BmoI1m3a.js"),Q=require("./dismissable-layer-DNfrKA20.js"),X=require("./calendar-CzpWDxLc.js"),s=require("./date-time-utils-C-4eHTyy.js");let tt=0;const et=`
|
|
2
2
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
3
3
|
<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"/>
|
|
4
4
|
</svg>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
28
28
|
--ui-drtp-accent: var(--ui-color-primary, #2563eb);
|
|
29
29
|
--ui-drtp-success: var(--ui-color-success, #15803d);
|
|
30
|
-
--ui-drtp-error: var(--ui-color-danger, #dc2626);
|
|
30
|
+
--ui-drtp-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
31
31
|
--ui-drtp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
32
32
|
--ui-drtp-panel-radius: 14px;
|
|
33
33
|
--ui-drtp-z: 1600;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E as tt } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { s as et, a as it } from "./control-name-Bpj7F34X.mjs";
|
|
3
3
|
import { c as rt } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
-
import { r as st } from "./calendar-
|
|
5
|
-
import { r as nt, e as at, i as C, s as ot, b as lt, j as I, k as A, f as dt, m as D, o as P, l as ut, c as ct, q as k, g as pt, h as ht } from "./date-time-utils-
|
|
4
|
+
import { r as st } from "./calendar-DkSDFg33.mjs";
|
|
5
|
+
import { r as nt, e as at, i as C, s as ot, b as lt, j as I, k as A, f as dt, m as D, o as P, l as ut, c as ct, q as k, g as pt, h as ht } from "./date-time-utils-zAx4ghvC.mjs";
|
|
6
6
|
let mt = 0;
|
|
7
7
|
const ft = `
|
|
8
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -33,7 +33,7 @@ const ft = `
|
|
|
33
33
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
34
34
|
--ui-drtp-accent: var(--ui-color-primary, #2563eb);
|
|
35
35
|
--ui-drtp-success: var(--ui-color-success, #15803d);
|
|
36
|
-
--ui-drtp-error: var(--ui-color-danger, #dc2626);
|
|
36
|
+
--ui-drtp-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
37
37
|
--ui-drtp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
38
38
|
--ui-drtp-panel-radius: 14px;
|
|
39
39
|
--ui-drtp-z: 1600;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("./ElementBase-DxbvhLJs.js"),P=require("./control-name-BmoI1m3a.js"),K=require("./dismissable-layer-DNfrKA20.js"),U=require("./calendar-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("./ElementBase-DxbvhLJs.js"),P=require("./control-name-BmoI1m3a.js"),K=require("./dismissable-layer-DNfrKA20.js"),U=require("./calendar-CzpWDxLc.js"),l=require("./date-time-utils-C-4eHTyy.js");let Z=0;const j=`
|
|
2
2
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
3
3
|
<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"/>
|
|
4
4
|
</svg>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
28
28
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
29
29
|
--ui-dtp-success: var(--ui-color-success, #15803d);
|
|
30
|
-
--ui-dtp-error: var(--ui-color-danger, #dc2626);
|
|
30
|
+
--ui-dtp-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
31
31
|
--ui-dtp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
32
32
|
--ui-dtp-panel-radius: 14px;
|
|
33
33
|
--ui-dtp-z: 1600;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E as W } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { s as Y, a as J } from "./control-name-Bpj7F34X.mjs";
|
|
3
3
|
import { c as G } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
-
import { r as Q } from "./calendar-
|
|
5
|
-
import { r as X, e as tt, i as g, s as et, b as it, f as rt, t as st, n as E, d as nt, p as F, o as N, a as at, m as R, j as Z, k as j, q as y, l as ot, c as lt } from "./date-time-utils-
|
|
4
|
+
import { r as Q } from "./calendar-DkSDFg33.mjs";
|
|
5
|
+
import { r as X, e as tt, i as g, s as et, b as it, f as rt, t as st, n as E, d as nt, p as F, o as N, a as at, m as R, j as Z, k as j, q as y, l as ot, c as lt } from "./date-time-utils-zAx4ghvC.mjs";
|
|
6
6
|
let dt = 0;
|
|
7
7
|
const ut = `
|
|
8
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
@@ -33,7 +33,7 @@ const ut = `
|
|
|
33
33
|
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
34
34
|
--ui-dtp-accent: var(--ui-color-primary, #2563eb);
|
|
35
35
|
--ui-dtp-success: var(--ui-color-success, #15803d);
|
|
36
|
-
--ui-dtp-error: var(--ui-color-danger, #dc2626);
|
|
36
|
+
--ui-dtp-error: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
37
37
|
--ui-dtp-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
38
38
|
--ui-dtp-panel-radius: 14px;
|
|
39
39
|
--ui-dtp-z: 1600;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./calendar-
|
|
1
|
+
"use strict";const l=require("./calendar-CzpWDxLc.js"),I=require("./scroll-lock-BX6e3Ced.js"),v=require("./positioner-DZ1FW6A9.js"),w=new Map,N=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function u(t){return String(t).padStart(2,"0")}function $(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function O(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function L(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function U(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function F(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function P(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function C(t){try{return new Intl.DateTimeFormat(t),!0}catch{return!1}}function z(t){const e=(t||"").trim();return e&&C(e)?e:typeof navigator<"u"&&navigator.language&&C(navigator.language)?navigator.language:"en-US"}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${u(e.m)}-${u(e.d)}`:null}function D(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=d(e[2]);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function A(t,e){if(!t||!e)return null;const n=m(t),r=d(e);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function Y(t){if(!t)return null;const e=m(t);return e||D(t)?.date||null}function k(t){if(!t)return null;const e=D(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function q(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify({})}`;let i=w.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),w.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function B(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=L(e),s=U(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,s[o.m-1]||"").replace(/MM/g,u(o.m)).replace(/DD/g,u(o.d))}return q(t,e)}function x(t,e){const n=m(t.trim());if(n)return n;const r=O(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map(b=>b.trim()).filter(Boolean);if(i.length!==3)return null;const s=$(i[0]),a=$(i[1]),h=$(i[2]);if(s==null||a==null||h==null)return null;let f=h;f<100&&(f+=f>=70?1900:2e3);const p=e.toLowerCase().startsWith("en-us"),c=p?s:a,g=p?a:s;if(f<1e3||c<1||c>12||g<1||g>31)return null;const T=`${f}-${u(c)}-${u(g)}`;return m(T)}function d(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),s=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||i<0||i>59||s<0||s>59)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:s}}function M(t,e=!1){if(!t)return"";const n=u(y(t.hours,0,23)),r=u(y(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=u(y(t.seconds,0,59));return`${n}:${r}:${o}`}function H(t,e){const n=d(t);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=d(t),r=d(e);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function E(t,e,n){const r=d(t);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function W(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function Z(t,e){const n=D(t),r=D(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function _(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${u(n.m)}-${u(n.d)}`,end:`${r.y}-${u(r.m)}-${u(r.d)}`}}function R(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function G(t,e,n=8,r=8,o=null){const s=(typeof window<"u"?window.innerHeight:800)-t.bottom-r-n,a=t.top-r-n,h=s>=e.height,f=a>=e.height,p=o==="top"?"top":"bottom";let c;if(h&&!f)c="bottom";else if(f&&!h)c="top";else if(f&&h)c=p;else{const T=p==="bottom"?s:a,b=p==="bottom"?a:s;T>0&&b<=T+N?c=p:c=s>=a?"bottom":"top"}const g=v.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(g.y),left:Math.round(g.x),placement:c}}function J(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function K(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function V(){return I.acquireBodyScrollLock()}exports.clampDateIso=W;exports.clampTime=E;exports.combineDateTime=A;exports.compareDateTimes=Z;exports.compareTimes=S;exports.computeLastDaysRange=R;exports.computeMonthRange=_;exports.computePopoverPosition=G;exports.eventOriginatesWithin=P;exports.formatDateForDisplay=B;exports.formatTime=M;exports.isTruthyAttr=F;exports.lockBodyScroll=V;exports.normalizeDateIso=m;exports.normalizeLocale=z;exports.parseConstraintDate=Y;exports.parseConstraintDateTime=k;exports.parseTimeInput=d;exports.parseUserDateInput=x;exports.rafThrottle=J;exports.shouldUseMobileSheet=K;exports.splitDateTime=D;exports.to12hDisplay=H;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as T, c as b, a as N, s as F, e as L } from "./calendar-
|
|
1
|
+
import { p as T, c as b, a as N, s as F, e as L } from "./calendar-DkSDFg33.mjs";
|
|
2
2
|
import { a as U } from "./scroll-lock-LfqXXqsu.mjs";
|
|
3
3
|
import { c as I } from "./positioner-BE8Nbho2.mjs";
|
|
4
4
|
const C = /* @__PURE__ */ new Map(), O = 24;
|
package/dist/description.cjs.js
CHANGED
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
letter-spacing: 0.01em;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
:host([tone="brand"]) { --ui-description-color: var(--ui-color-primary, #2563eb); }
|
|
35
|
-
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #15803d); }
|
|
36
|
-
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #b45309); }
|
|
37
|
-
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger, #dc2626); }
|
|
34
|
+
:host([tone="brand"]) { --ui-description-color: var(--ui-color-accent-text, var(--ui-color-primary, #2563eb)); }
|
|
35
|
+
:host([tone="success"]) { --ui-description-color: var(--ui-color-success-text, var(--ui-color-success, #15803d)); }
|
|
36
|
+
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning-text, var(--ui-color-warning, #b45309)); }
|
|
37
|
+
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626)); }
|
|
38
38
|
|
|
39
39
|
:host([size="sm"]),
|
|
40
40
|
:host([size="1"]) {
|
package/dist/description.esm.js
CHANGED
|
@@ -32,10 +32,10 @@ const a = `
|
|
|
32
32
|
letter-spacing: 0.01em;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
:host([tone="brand"]) { --ui-description-color: var(--ui-color-primary, #2563eb); }
|
|
36
|
-
:host([tone="success"]) { --ui-description-color: var(--ui-color-success, #15803d); }
|
|
37
|
-
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning, #b45309); }
|
|
38
|
-
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger, #dc2626); }
|
|
35
|
+
:host([tone="brand"]) { --ui-description-color: var(--ui-color-accent-text, var(--ui-color-primary, #2563eb)); }
|
|
36
|
+
:host([tone="success"]) { --ui-description-color: var(--ui-color-success-text, var(--ui-color-success, #15803d)); }
|
|
37
|
+
:host([tone="warning"]) { --ui-description-color: var(--ui-color-warning-text, var(--ui-color-warning, #b45309)); }
|
|
38
|
+
:host([tone="danger"]) { --ui-description-color: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626)); }
|
|
39
39
|
|
|
40
40
|
:host([size="sm"]),
|
|
41
41
|
:host([size="1"]) {
|
package/dist/dialog.cjs.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
--ui-dialog-padding-y: 20px;
|
|
21
21
|
--ui-dialog-width: min(560px, calc(100vw - 24px));
|
|
22
22
|
--ui-dialog-focus: var(--ui-color-focus-ring, #2563eb);
|
|
23
|
-
--ui-dialog-danger: var(--ui-color-danger, #dc2626);
|
|
23
|
+
--ui-dialog-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
24
24
|
--ui-dialog-success: var(--ui-color-success, #15803d);
|
|
25
25
|
--ui-dialog-z: 1201;
|
|
26
26
|
--ui-dialog-backdrop-z: 1200;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--ui-dialog-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
29
29
|
--ui-dialog-btn-hover: color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 78%, var(--ui-color-border, #cbd5e1) 22%);
|
|
30
30
|
--ui-dialog-submit-bg: var(--ui-color-primary, #2563eb);
|
|
31
|
-
--ui-dialog-submit-color: var(--ui-color-primary-contrast, #ffffff);
|
|
31
|
+
--ui-dialog-submit-color: var(--ui-color-foreground-on-primary, var(--ui-color-primary-contrast, #ffffff));
|
|
32
32
|
--ui-dialog-duration: 170ms;
|
|
33
33
|
--ui-dialog-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
34
34
|
}
|
package/dist/dialog.esm.js
CHANGED
|
@@ -25,7 +25,7 @@ const H = `
|
|
|
25
25
|
--ui-dialog-padding-y: 20px;
|
|
26
26
|
--ui-dialog-width: min(560px, calc(100vw - 24px));
|
|
27
27
|
--ui-dialog-focus: var(--ui-color-focus-ring, #2563eb);
|
|
28
|
-
--ui-dialog-danger: var(--ui-color-danger, #dc2626);
|
|
28
|
+
--ui-dialog-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
29
29
|
--ui-dialog-success: var(--ui-color-success, #15803d);
|
|
30
30
|
--ui-dialog-z: 1201;
|
|
31
31
|
--ui-dialog-backdrop-z: 1200;
|
|
@@ -33,7 +33,7 @@ const H = `
|
|
|
33
33
|
--ui-dialog-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
34
34
|
--ui-dialog-btn-hover: color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 78%, var(--ui-color-border, #cbd5e1) 22%);
|
|
35
35
|
--ui-dialog-submit-bg: var(--ui-color-primary, #2563eb);
|
|
36
|
-
--ui-dialog-submit-color: var(--ui-color-primary-contrast, #ffffff);
|
|
36
|
+
--ui-dialog-submit-color: var(--ui-color-foreground-on-primary, var(--ui-color-primary-contrast, #ffffff));
|
|
37
37
|
--ui-dialog-duration: 170ms;
|
|
38
38
|
--ui-dialog-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
39
39
|
}
|
package/dist/dock.cjs.js
CHANGED
|
@@ -330,4 +330,4 @@
|
|
|
330
330
|
</div>
|
|
331
331
|
</div>
|
|
332
332
|
</div>
|
|
333
|
-
`),this._bindElements(),this._syncHostStyles(),this.refresh()}_bindElements(){const e=this.root.querySelector(".frame");e&&e!==this._frameEl&&(this._frameEl&&(this._frameEl.removeEventListener("pointermove",this._handlePointerMove),this._frameEl.removeEventListener("pointerleave",this._handlePointerLeave)),e.addEventListener("pointermove",this._handlePointerMove),e.addEventListener("pointerleave",this._handlePointerLeave),this._frameEl=e);const t=this.root.querySelector("slot");t&&t!==this._slotEl&&(this._slotEl&&this._slotEl.removeEventListener("slotchange",this._handleSlotChange),t.addEventListener("slotchange",this._handleSlotChange),this._slotEl=t),this.removeEventListener("focusin",this._handleFocusIn),this.removeEventListener("focusout",this._handleFocusOut),this.removeEventListener("keydown",this._handleKeyDown),this.addEventListener("focusin",this._handleFocusIn),this.addEventListener("focusout",this._handleFocusOut),this.addEventListener("keydown",this._handleKeyDown),this._ensureResizeObserver()}_observeLightDom(){this._mutationObserver||typeof MutationObserver>"u"||(this._mutationObserver=new MutationObserver(this._handleLightDomMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_ensureResizeObserver(){this._resizeObserver||typeof ResizeObserver>"u"||(this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this))}_bindReducedMotion(){if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");this._reducedMotion=e.matches,this._mediaQuery=e;try{e.addEventListener("change",this._handleReducedMotionChange)}catch{e.addListener(this._handleReducedMotionChange)}}_handleReducedMotionChange(e){this._reducedMotion=e.matches,this.refresh()}_handleSlotChange(){this.refresh()}_handleLightDomMutation(){this.refresh()}_handleResize(){this._measureItems(),this._updateTargets(),this._queueAnimation()}_handlePointerMove(e){if("pointerType"in e&&e.pointerType==="touch"||!this._frameEl)return;const t=this._frameEl.getBoundingClientRect(),n=this._orientation()==="horizontal"?e.clientX-t.left:e.clientY-t.top;this._pointerActive=!0,this._pointerCoord=n,this._measureItems(),this._updateTargets(),this._queueAnimation()}_handlePointerLeave(){this._pointerActive=!1,this._pointerCoord=Number.NaN,this._updateTargets(),this._queueAnimation()}_handleFocusIn(e){const t=e.target?.closest?.("[data-ui-dock-item]");if(!t)return;const a=this._items.findIndex(n=>n.el===t);a<0||(this._focusedIndex=a,this._rovingIndex=a,this._syncTabIndices(),this._pointerActive=!1,this._pointerCoord=Number.NaN,this._updateTargets(),this._queueAnimation())}_handleFocusOut(e){const t=e.relatedTarget;t&&this.contains(t)||(this._focusedIndex=-1,this._pointerActive||(this._updateTargets(),this._queueAnimation()))}_handleKeyDown(e){if(e.defaultPrevented||!this._items.length)return;const t=this._orientation(),a=t==="horizontal"?["ArrowLeft"]:["ArrowUp"],n=t==="horizontal"?["ArrowRight"]:["ArrowDown"];if(a.includes(e.key)){e.preventDefault();const i=w(this._items,this._rovingIndex,-1);i>=0&&this.focusItem(i);return}if(n.includes(e.key)){e.preventDefault();const i=w(this._items,this._rovingIndex,1);i>=0&&this.focusItem(i);return}if(e.key==="Home"){e.preventDefault();const i=this._items.findIndex(c=>!c.disabled);i>=0&&this.focusItem(i);return}if(e.key==="End"){e.preventDefault();for(let i=this._items.length-1;i>=0;i-=1)if(!this._items[i]?.disabled){this.focusItem(i);break}return}e.key==="Escape"&&this.clearActive()}_collectItems(){const e=new Map(this._items.map(n=>[n.el,n])),t=Array.from(this.children).filter(B).map(n=>{const i=e.get(n),c=n.querySelector("[data-ui-dock-icon]"),o=n.querySelector("[data-ui-dock-label]"),l=n.querySelector("[data-ui-dock-badge]");return{el:n,iconEl:c,labelEl:o,badgeEl:l,center:i?.center??0,currentScale:i?.currentScale??this._idleScale(),targetScale:i?.targetScale??this._idleScale(),currentLift:i?.currentLift??0,targetLift:i?.targetLift??0,labelVisible:i?.labelVisible??!1,disabled:H(n),sticky:j(n),scaleVelocity:i?.scaleVelocity??0,liftVelocity:i?.liftVelocity??0}});this._items=t;const a=this._items.findIndex(n=>n.sticky&&!n.disabled);a>=0?this._rovingIndex=a:(!this._items[this._rovingIndex]||this._items[this._rovingIndex]?.disabled)&&(this._rovingIndex=this._items.findIndex(n=>!n.disabled)),this._rovingIndex<0&&(this._rovingIndex=0),(this._focusedIndex>=this._items.length||this._items[this._focusedIndex]?.disabled)&&(this._focusedIndex=-1),this._syncItemChrome()}_syncItemChrome(){const e=S(this.getAttribute("label-placement"),this._orientation()),t=this._labelMode(),a=this._orientation();this._items.forEach(n=>{const{el:i,iconEl:c,labelEl:o,badgeEl:l,sticky:h}=n;i.setAttribute("data-ui-dock-item",""),i.style.setProperty("position","relative"),i.style.setProperty("display","inline-flex"),i.style.setProperty("align-items","center"),i.style.setProperty("justify-content","center"),i.style.setProperty("inline-size","var(--ui-dock-item-size)"),i.style.setProperty("block-size","var(--ui-dock-item-size)"),i.style.setProperty("min-inline-size","var(--ui-dock-item-size)"),i.style.setProperty("min-block-size","var(--ui-dock-item-size)"),i.style.setProperty("flex","0 0 var(--ui-dock-item-size)"),i.style.setProperty("box-sizing","border-box"),i.style.setProperty("background","transparent"),i.style.setProperty("border","none"),i.style.setProperty("padding","0"),i.style.setProperty("margin","0"),i.style.setProperty("color","inherit"),i.style.setProperty("text-decoration","none"),i.style.setProperty("outline","none"),i.style.setProperty("cursor",n.disabled?"not-allowed":"pointer"),i.style.setProperty("transform-origin",a==="horizontal"?"center bottom":"center center"),i.style.setProperty("touch-action","manipulation"),i.hasAttribute("tabindex")||(i.tabIndex=-1);const r=i.getAttribute("aria-label"),d=this._itemNames.get(i),u=d&&d.composed===r?d.base:r||o?.textContent?.trim()||i.getAttribute("data-label")||i.getAttribute("title")||"",m=l?.textContent?.trim()??"",f=u&&m&&!u.includes(m)?`${u}, ${m}`:u;f&&(f!==r&&i.setAttribute("aria-label",f),this._itemNames.set(i,{base:u,composed:f})),h?i.setAttribute("data-dock-current","true"):i.removeAttribute("data-dock-current"),c&&(c.style.setProperty("display","inline-flex"),c.style.setProperty("align-items","center"),c.style.setProperty("justify-content","center"),c.style.setProperty("inline-size","100%"),c.style.setProperty("block-size","100%"),c.style.setProperty("border-radius","var(--ui-dock-item-radius)"),c.style.setProperty("background","var(--ui-dock-item-bg)"),c.style.setProperty("border","1px solid var(--ui-dock-item-border)"),c.style.setProperty("box-shadow","var(--ui-dock-item-shadow)"),c.style.setProperty("backdrop-filter","var(--ui-dock-item-backdrop)"),c.style.setProperty("font-size","var(--ui-dock-icon-size)"),c.style.setProperty("color","inherit"),c.style.setProperty("overflow","hidden"),c.style.setProperty("box-sizing","border-box")),o&&(o.setAttribute("aria-hidden","true"),o.style.setProperty("position","absolute"),o.style.setProperty("pointer-events","none"),o.style.setProperty("white-space","nowrap"),o.style.setProperty("padding","var(--ui-dock-label-padding)"),o.style.setProperty("border-radius","var(--ui-dock-label-radius)"),o.style.setProperty("background","var(--ui-dock-label-bg)"),o.style.setProperty("color","var(--ui-dock-label-color)"),o.style.setProperty("border","1px solid var(--ui-dock-label-border)"),o.style.setProperty("box-shadow","var(--ui-dock-label-shadow)"),o.style.setProperty("backdrop-filter","var(--ui-dock-label-backdrop)"),o.style.setProperty("font-size","var(--ui-dock-label-font-size)"),o.style.setProperty("font-weight","var(--ui-dock-label-font-weight)"),o.style.setProperty("line-height","1.2"),o.style.setProperty("letter-spacing","0.01em"),o.style.setProperty("min-inline-size","max-content"),o.style.setProperty("z-index","3"),o.style.setProperty("display",t==="none"?"none":"inline-flex"),o.style.removeProperty("top"),o.style.removeProperty("bottom"),o.style.removeProperty("left"),o.style.removeProperty("right"),e==="top"?(o.style.setProperty("left","50%"),o.style.setProperty("bottom","calc(100% + var(--ui-dock-label-offset))")):e==="bottom"?(o.style.setProperty("left","50%"),o.style.setProperty("top","calc(100% + var(--ui-dock-label-offset))")):e==="start"?(o.style.setProperty("right","calc(100% + var(--ui-dock-label-offset))"),o.style.setProperty("top","50%")):(o.style.setProperty("left","calc(100% + var(--ui-dock-label-offset))"),o.style.setProperty("top","50%"))),l&&(l.setAttribute("aria-hidden","true"),l.style.setProperty("position","absolute"),l.style.setProperty("inset-inline-end","-2px"),l.style.setProperty("inset-block-start","-2px"),l.style.setProperty("display","inline-flex"),l.style.setProperty("align-items","center"),l.style.setProperty("justify-content","center"),l.style.setProperty("min-inline-size","18px"),l.style.setProperty("min-block-size","18px"),l.style.setProperty("padding","0 6px"),l.style.setProperty("border-radius","999px"),l.style.setProperty("background","var(--ui-dock-accent)"),l.style.setProperty("color","#ffffff"),l.style.setProperty("font-size","11px"),l.style.setProperty("font-weight","700"),l.style.setProperty("box-shadow","none"),l.style.setProperty("z-index","4"))})}_syncTabIndices(){const e=this._items.findIndex(t=>!t.disabled);e>=0&&(this._rovingIndex<0||this._items[this._rovingIndex]?.disabled)&&(this._rovingIndex=e),this._items.forEach((t,a)=>{if(t.disabled){t.el.tabIndex=-1;return}t.el.tabIndex=a===this._rovingIndex?0:-1})}_measureItems(){if(!this._frameEl)return;const e=this._frameEl.getBoundingClientRect(),t=this._orientation(),a=t==="horizontal"?e.left:e.top;this._items.forEach(n=>{const i=n.el.getBoundingClientRect();n.center=(t==="horizontal"?i.left+i.width/2:i.top+i.height/2)-a})}_updateTargets(){const e=this._idleScale(),t=Math.max(e,this._magnification()),a=Math.max(1,this._distance()),n=this._lift()*this._motion().lift,i=this._labelMode();this._items.forEach((c,o)=>{let l=e;if(c.sticky&&(l=Math.max(l,e+(t-e)*.08)),this._pointerActive&&Number.isFinite(this._pointerCoord)){const r=Math.abs(this._pointerCoord-c.center),d=g(1-r/a,0,1);l=Math.max(l,e+(t-e)*d*d)}o===this._focusedIndex&&(l=Math.max(l,t)),c.disabled&&(l=e);const h=t===e?0:(l-e)/(t-e);c.targetScale=g(l,e,t),c.targetLift=h*n,c.labelVisible=i==="always"||i!=="none"&&(o===this._focusedIndex||h>.18)}),this._updateRuntimeState()}_applyFrame(e=!1){const t=this._smoothing(),a=this._motion(),n=g(a.response+t*.12,.05,.42),i=g(a.damping+(t-x)*.14,.52,.9),c=this._orientation(),o=S(this.getAttribute("label-placement"),c),l=this._mainAxisOffsets(a.spread);let h=!1;this._items.forEach((r,d)=>{e?(r.currentScale=r.targetScale,r.currentLift=r.targetLift,r.scaleVelocity=0,r.liftVelocity=0):(r.scaleVelocity=r.scaleVelocity*i+(r.targetScale-r.currentScale)*n,r.liftVelocity=r.liftVelocity*i+(r.targetLift-r.currentLift)*n,r.currentScale+=r.scaleVelocity,r.currentLift+=r.liftVelocity,Math.abs(r.targetScale-r.currentScale)<.002&&Math.abs(r.scaleVelocity)<.002&&(r.currentScale=r.targetScale,r.scaleVelocity=0),Math.abs(r.targetLift-r.currentLift)<.002&&Math.abs(r.liftVelocity)<.002&&(r.currentLift=r.targetLift,r.liftVelocity=0)),(Math.abs(r.targetScale-r.currentScale)>=.002||Math.abs(r.targetLift-r.currentLift)>=.002||Math.abs(r.scaleVelocity)>=.002||Math.abs(r.liftVelocity)>=.002)&&(h=!0);const u=l[d]??0,m=c==="horizontal"?u:o==="start"?-r.currentLift*.28:r.currentLift*.28,f=c==="horizontal"?-r.currentLift:u;if(r.el.style.setProperty("transform",`translate3d(${m}px, ${f}px, 0) scale(${r.currentScale})`),r.el.style.setProperty("z-index",String(100+Math.round(r.currentScale*100)+d)),r.iconEl){const p=d===this._focusedIndex?"0 0 0 2px var(--ui-ring-color, var(--ui-dock-focus-ring)), ":r.sticky?"0 0 0 2px color-mix(in srgb, var(--ui-dock-accent) 22%, transparent), ":"";r.iconEl.style.setProperty("box-shadow",`${p}var(--ui-dock-item-shadow)`),r.iconEl.style.setProperty("border-color",r.sticky||d===this._focusedIndex?"color-mix(in srgb, var(--ui-dock-accent) 55%, transparent)":"var(--ui-dock-item-border)")}if(r.labelEl){const p=r.labelVisible;r.labelEl.style.setProperty("opacity",p?"1":"0"),r.labelEl.style.setProperty("visibility",p?"visible":"hidden"),r.labelEl.style.setProperty("transform",this._labelTransform(o,p)),r.labelEl.style.setProperty("filter",p?"blur(0px)":"blur(6px)")}}),h&&this._queueAnimation()}_queueAnimation(){if(this._reducedMotion){A(this._raf),this._raf=null,this._applyFrame(!0);return}this._raf==null&&(this._raf=$(()=>{this._raf=null,this._applyFrame(!1)}))}_mainAxisOffsets(e){if(this._items.length<2)return this._items.map(()=>0);const t=this._resolvedItemSizePx(),a=this._resolvedGapPx(),n=t+a,i=[0];for(let o=1;o<this._items.length;o+=1){const l=this._items[o-1],h=this._items[o],r=t*l.currentScale/2,d=t*h.currentScale/2,u=Math.max(0,r+d-n);i[o]=i[o-1]+u*e}const c=i[i.length-1]/2;return i.map(o=>o-c)}_labelTransform(e,t){return e==="top"?t?"translate3d(-50%, 0, 0)":"translate3d(-50%, 6px, 0)":e==="bottom"?t?"translate3d(-50%, 0, 0)":"translate3d(-50%, -6px, 0)":e==="start"?t?"translate3d(0, -50%, 0)":"translate3d(6px, -50%, 0)":t?"translate3d(0, -50%, 0)":"translate3d(-6px, -50%, 0)"}_syncHostStyles(){const e=b(this.getAttribute("gap"));e?this.style.setProperty("--ui-dock-gap",e):this.style.removeProperty("--ui-dock-gap");const t=b(this.getAttribute("padding"));t?this.style.setProperty("--ui-dock-padding",t):this.style.removeProperty("--ui-dock-padding");const a=b(this.getAttribute("item-size"));a?(this.style.setProperty("--ui-dock-item-size",a),this.style.setProperty("--ui-dock-icon-size",`calc(${a} * 0.44)`)):(this.style.removeProperty("--ui-dock-item-size"),this.style.removeProperty("--ui-dock-icon-size"));const n=this.getAttribute("radius");if(n&&!V.has(n)){const i=b(n)||n;this.style.setProperty("--ui-dock-radius",i),this.style.setProperty("--ui-dock-item-radius",`calc(${i} * 0.82)`)}else this.style.removeProperty("--ui-dock-radius"),this.style.removeProperty("--ui-dock-item-radius")}_orientation(){return this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"}_motion(){const e=this.getAttribute("animation");return e==="calm"||e==="snappy"||e==="bouncy"?P[e]:P.smooth}_labelMode(){const e=this.getAttribute("label-mode");return e==="always"||e==="none"?e:"hover"}_magnification(){return Math.max(this._idleScale(),y(this.getAttribute("magnification"),F))}_distance(){return y(this.getAttribute("distance"),C)}_idleScale(){return Math.max(.5,y(this.getAttribute("idle-scale"),R))}_lift(){return y(this.getAttribute("lift"),D)}_smoothing(){return U(this.getAttribute("smoothing"),x)}_sizeToken(){const e=this.getAttribute("size");return e==="xs"||e==="0"?"xs":e==="sm"||e==="1"?"sm":e==="lg"||e==="3"?"lg":e==="xl"||e==="4"?"xl":"md"}_resolvedItemSizePx(){const e=b(this.getAttribute("item-size"));if(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return t}return z[this._sizeToken()]?.itemSize??O}_resolvedGapPx(){const e=b(this.getAttribute("gap"));if(e){const a=Number.parseFloat(e);if(Number.isFinite(a))return a}const t=z[this._sizeToken()];return t?Number.parseFloat(t.gap):Number.parseFloat(_)}_updateRuntimeState(){const e=this._focusedIndex>=0?"keyboard":this._pointerActive?"pointer":"idle";this.setAttribute("data-state",e)}}typeof customElements<"u"&&!customElements.get("ui-dock")&&customElements.define("ui-dock",M);exports.UIDock=M;
|
|
333
|
+
`),this._bindElements(),this._syncHostStyles(),this.refresh()}_bindElements(){const e=this.root.querySelector(".frame");e&&e!==this._frameEl&&(this._frameEl&&(this._frameEl.removeEventListener("pointermove",this._handlePointerMove),this._frameEl.removeEventListener("pointerleave",this._handlePointerLeave)),e.addEventListener("pointermove",this._handlePointerMove),e.addEventListener("pointerleave",this._handlePointerLeave),this._frameEl=e);const t=this.root.querySelector("slot");t&&t!==this._slotEl&&(this._slotEl&&this._slotEl.removeEventListener("slotchange",this._handleSlotChange),t.addEventListener("slotchange",this._handleSlotChange),this._slotEl=t),this.removeEventListener("focusin",this._handleFocusIn),this.removeEventListener("focusout",this._handleFocusOut),this.removeEventListener("keydown",this._handleKeyDown),this.addEventListener("focusin",this._handleFocusIn),this.addEventListener("focusout",this._handleFocusOut),this.addEventListener("keydown",this._handleKeyDown),this._ensureResizeObserver()}_observeLightDom(){this._mutationObserver||typeof MutationObserver>"u"||(this._mutationObserver=new MutationObserver(this._handleLightDomMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_ensureResizeObserver(){this._resizeObserver||typeof ResizeObserver>"u"||(this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this))}_bindReducedMotion(){if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");this._reducedMotion=e.matches,this._mediaQuery=e;try{e.addEventListener("change",this._handleReducedMotionChange)}catch{e.addListener(this._handleReducedMotionChange)}}_handleReducedMotionChange(e){this._reducedMotion=e.matches,this.refresh()}_handleSlotChange(){this.refresh()}_handleLightDomMutation(){this.refresh()}_handleResize(){this._measureItems(),this._updateTargets(),this._queueAnimation()}_handlePointerMove(e){if("pointerType"in e&&e.pointerType==="touch"||!this._frameEl)return;const t=this._frameEl.getBoundingClientRect(),n=this._orientation()==="horizontal"?e.clientX-t.left:e.clientY-t.top;this._pointerActive=!0,this._pointerCoord=n,this._measureItems(),this._updateTargets(),this._queueAnimation()}_handlePointerLeave(){this._pointerActive=!1,this._pointerCoord=Number.NaN,this._updateTargets(),this._queueAnimation()}_handleFocusIn(e){const t=e.target?.closest?.("[data-ui-dock-item]");if(!t)return;const a=this._items.findIndex(n=>n.el===t);a<0||(this._focusedIndex=a,this._rovingIndex=a,this._syncTabIndices(),this._pointerActive=!1,this._pointerCoord=Number.NaN,this._updateTargets(),this._queueAnimation())}_handleFocusOut(e){const t=e.relatedTarget;t&&this.contains(t)||(this._focusedIndex=-1,this._pointerActive||(this._updateTargets(),this._queueAnimation()))}_handleKeyDown(e){if(e.defaultPrevented||!this._items.length)return;const t=this._orientation(),a=t==="horizontal"?["ArrowLeft"]:["ArrowUp"],n=t==="horizontal"?["ArrowRight"]:["ArrowDown"];if(a.includes(e.key)){e.preventDefault();const i=w(this._items,this._rovingIndex,-1);i>=0&&this.focusItem(i);return}if(n.includes(e.key)){e.preventDefault();const i=w(this._items,this._rovingIndex,1);i>=0&&this.focusItem(i);return}if(e.key==="Home"){e.preventDefault();const i=this._items.findIndex(c=>!c.disabled);i>=0&&this.focusItem(i);return}if(e.key==="End"){e.preventDefault();for(let i=this._items.length-1;i>=0;i-=1)if(!this._items[i]?.disabled){this.focusItem(i);break}return}e.key==="Escape"&&this.clearActive()}_collectItems(){const e=new Map(this._items.map(n=>[n.el,n])),t=Array.from(this.children).filter(B).map(n=>{const i=e.get(n),c=n.querySelector("[data-ui-dock-icon]"),o=n.querySelector("[data-ui-dock-label]"),l=n.querySelector("[data-ui-dock-badge]");return{el:n,iconEl:c,labelEl:o,badgeEl:l,center:i?.center??0,currentScale:i?.currentScale??this._idleScale(),targetScale:i?.targetScale??this._idleScale(),currentLift:i?.currentLift??0,targetLift:i?.targetLift??0,labelVisible:i?.labelVisible??!1,disabled:H(n),sticky:j(n),scaleVelocity:i?.scaleVelocity??0,liftVelocity:i?.liftVelocity??0}});this._items=t;const a=this._items.findIndex(n=>n.sticky&&!n.disabled);a>=0?this._rovingIndex=a:(!this._items[this._rovingIndex]||this._items[this._rovingIndex]?.disabled)&&(this._rovingIndex=this._items.findIndex(n=>!n.disabled)),this._rovingIndex<0&&(this._rovingIndex=0),(this._focusedIndex>=this._items.length||this._items[this._focusedIndex]?.disabled)&&(this._focusedIndex=-1),this._syncItemChrome()}_syncItemChrome(){const e=S(this.getAttribute("label-placement"),this._orientation()),t=this._labelMode(),a=this._orientation();this._items.forEach(n=>{const{el:i,iconEl:c,labelEl:o,badgeEl:l,sticky:h}=n;i.setAttribute("data-ui-dock-item",""),i.style.setProperty("position","relative"),i.style.setProperty("display","inline-flex"),i.style.setProperty("align-items","center"),i.style.setProperty("justify-content","center"),i.style.setProperty("inline-size","var(--ui-dock-item-size)"),i.style.setProperty("block-size","var(--ui-dock-item-size)"),i.style.setProperty("min-inline-size","var(--ui-dock-item-size)"),i.style.setProperty("min-block-size","var(--ui-dock-item-size)"),i.style.setProperty("flex","0 0 var(--ui-dock-item-size)"),i.style.setProperty("box-sizing","border-box"),i.style.setProperty("background","transparent"),i.style.setProperty("border","none"),i.style.setProperty("padding","0"),i.style.setProperty("margin","0"),i.style.setProperty("color","inherit"),i.style.setProperty("text-decoration","none"),i.style.setProperty("outline","none"),i.style.setProperty("cursor",n.disabled?"not-allowed":"pointer"),i.style.setProperty("transform-origin",a==="horizontal"?"center bottom":"center center"),i.style.setProperty("touch-action","manipulation"),i.hasAttribute("tabindex")||(i.tabIndex=-1);const r=i.getAttribute("aria-label"),d=this._itemNames.get(i),u=d&&d.composed===r?d.base:r||o?.textContent?.trim()||i.getAttribute("data-label")||i.getAttribute("title")||"",m=l?.textContent?.trim()??"",f=u&&m&&!u.includes(m)?`${u}, ${m}`:u;f&&(f!==r&&i.setAttribute("aria-label",f),this._itemNames.set(i,{base:u,composed:f})),h?i.setAttribute("data-dock-current","true"):i.removeAttribute("data-dock-current"),c&&(c.style.setProperty("display","inline-flex"),c.style.setProperty("align-items","center"),c.style.setProperty("justify-content","center"),c.style.setProperty("inline-size","100%"),c.style.setProperty("block-size","100%"),c.style.setProperty("border-radius","var(--ui-dock-item-radius)"),c.style.setProperty("background","var(--ui-dock-item-bg)"),c.style.setProperty("border","1px solid var(--ui-dock-item-border)"),c.style.setProperty("box-shadow","var(--ui-dock-item-shadow)"),c.style.setProperty("backdrop-filter","var(--ui-dock-item-backdrop)"),c.style.setProperty("font-size","var(--ui-dock-icon-size)"),c.style.setProperty("color","inherit"),c.style.setProperty("overflow","hidden"),c.style.setProperty("box-sizing","border-box")),o&&(o.setAttribute("aria-hidden","true"),o.style.setProperty("position","absolute"),o.style.setProperty("pointer-events","none"),o.style.setProperty("white-space","nowrap"),o.style.setProperty("padding","var(--ui-dock-label-padding)"),o.style.setProperty("border-radius","var(--ui-dock-label-radius)"),o.style.setProperty("background","var(--ui-dock-label-bg)"),o.style.setProperty("color","var(--ui-dock-label-color)"),o.style.setProperty("border","1px solid var(--ui-dock-label-border)"),o.style.setProperty("box-shadow","var(--ui-dock-label-shadow)"),o.style.setProperty("backdrop-filter","var(--ui-dock-label-backdrop)"),o.style.setProperty("font-size","var(--ui-dock-label-font-size)"),o.style.setProperty("font-weight","var(--ui-dock-label-font-weight)"),o.style.setProperty("line-height","1.2"),o.style.setProperty("letter-spacing","0.01em"),o.style.setProperty("min-inline-size","max-content"),o.style.setProperty("z-index","3"),o.style.setProperty("display",t==="none"?"none":"inline-flex"),o.style.removeProperty("top"),o.style.removeProperty("bottom"),o.style.removeProperty("left"),o.style.removeProperty("right"),e==="top"?(o.style.setProperty("left","50%"),o.style.setProperty("bottom","calc(100% + var(--ui-dock-label-offset))")):e==="bottom"?(o.style.setProperty("left","50%"),o.style.setProperty("top","calc(100% + var(--ui-dock-label-offset))")):e==="start"?(o.style.setProperty("right","calc(100% + var(--ui-dock-label-offset))"),o.style.setProperty("top","50%")):(o.style.setProperty("left","calc(100% + var(--ui-dock-label-offset))"),o.style.setProperty("top","50%"))),l&&(l.setAttribute("aria-hidden","true"),l.style.setProperty("position","absolute"),l.style.setProperty("inset-inline-end","-2px"),l.style.setProperty("inset-block-start","-2px"),l.style.setProperty("display","inline-flex"),l.style.setProperty("align-items","center"),l.style.setProperty("justify-content","center"),l.style.setProperty("min-inline-size","18px"),l.style.setProperty("min-block-size","18px"),l.style.setProperty("padding","0 6px"),l.style.setProperty("border-radius","999px"),l.style.setProperty("background","var(--ui-dock-accent)"),l.style.setProperty("color","var(--ui-color-foreground-on-primary, #ffffff)"),l.style.setProperty("font-size","11px"),l.style.setProperty("font-weight","700"),l.style.setProperty("box-shadow","none"),l.style.setProperty("z-index","4"))})}_syncTabIndices(){const e=this._items.findIndex(t=>!t.disabled);e>=0&&(this._rovingIndex<0||this._items[this._rovingIndex]?.disabled)&&(this._rovingIndex=e),this._items.forEach((t,a)=>{if(t.disabled){t.el.tabIndex=-1;return}t.el.tabIndex=a===this._rovingIndex?0:-1})}_measureItems(){if(!this._frameEl)return;const e=this._frameEl.getBoundingClientRect(),t=this._orientation(),a=t==="horizontal"?e.left:e.top;this._items.forEach(n=>{const i=n.el.getBoundingClientRect();n.center=(t==="horizontal"?i.left+i.width/2:i.top+i.height/2)-a})}_updateTargets(){const e=this._idleScale(),t=Math.max(e,this._magnification()),a=Math.max(1,this._distance()),n=this._lift()*this._motion().lift,i=this._labelMode();this._items.forEach((c,o)=>{let l=e;if(c.sticky&&(l=Math.max(l,e+(t-e)*.08)),this._pointerActive&&Number.isFinite(this._pointerCoord)){const r=Math.abs(this._pointerCoord-c.center),d=g(1-r/a,0,1);l=Math.max(l,e+(t-e)*d*d)}o===this._focusedIndex&&(l=Math.max(l,t)),c.disabled&&(l=e);const h=t===e?0:(l-e)/(t-e);c.targetScale=g(l,e,t),c.targetLift=h*n,c.labelVisible=i==="always"||i!=="none"&&(o===this._focusedIndex||h>.18)}),this._updateRuntimeState()}_applyFrame(e=!1){const t=this._smoothing(),a=this._motion(),n=g(a.response+t*.12,.05,.42),i=g(a.damping+(t-x)*.14,.52,.9),c=this._orientation(),o=S(this.getAttribute("label-placement"),c),l=this._mainAxisOffsets(a.spread);let h=!1;this._items.forEach((r,d)=>{e?(r.currentScale=r.targetScale,r.currentLift=r.targetLift,r.scaleVelocity=0,r.liftVelocity=0):(r.scaleVelocity=r.scaleVelocity*i+(r.targetScale-r.currentScale)*n,r.liftVelocity=r.liftVelocity*i+(r.targetLift-r.currentLift)*n,r.currentScale+=r.scaleVelocity,r.currentLift+=r.liftVelocity,Math.abs(r.targetScale-r.currentScale)<.002&&Math.abs(r.scaleVelocity)<.002&&(r.currentScale=r.targetScale,r.scaleVelocity=0),Math.abs(r.targetLift-r.currentLift)<.002&&Math.abs(r.liftVelocity)<.002&&(r.currentLift=r.targetLift,r.liftVelocity=0)),(Math.abs(r.targetScale-r.currentScale)>=.002||Math.abs(r.targetLift-r.currentLift)>=.002||Math.abs(r.scaleVelocity)>=.002||Math.abs(r.liftVelocity)>=.002)&&(h=!0);const u=l[d]??0,m=c==="horizontal"?u:o==="start"?-r.currentLift*.28:r.currentLift*.28,f=c==="horizontal"?-r.currentLift:u;if(r.el.style.setProperty("transform",`translate3d(${m}px, ${f}px, 0) scale(${r.currentScale})`),r.el.style.setProperty("z-index",String(100+Math.round(r.currentScale*100)+d)),r.iconEl){const p=d===this._focusedIndex?"0 0 0 2px var(--ui-ring-color, var(--ui-dock-focus-ring)), ":r.sticky?"0 0 0 2px color-mix(in srgb, var(--ui-dock-accent) 22%, transparent), ":"";r.iconEl.style.setProperty("box-shadow",`${p}var(--ui-dock-item-shadow)`),r.iconEl.style.setProperty("border-color",r.sticky||d===this._focusedIndex?"color-mix(in srgb, var(--ui-dock-accent) 55%, transparent)":"var(--ui-dock-item-border)")}if(r.labelEl){const p=r.labelVisible;r.labelEl.style.setProperty("opacity",p?"1":"0"),r.labelEl.style.setProperty("visibility",p?"visible":"hidden"),r.labelEl.style.setProperty("transform",this._labelTransform(o,p)),r.labelEl.style.setProperty("filter",p?"blur(0px)":"blur(6px)")}}),h&&this._queueAnimation()}_queueAnimation(){if(this._reducedMotion){A(this._raf),this._raf=null,this._applyFrame(!0);return}this._raf==null&&(this._raf=$(()=>{this._raf=null,this._applyFrame(!1)}))}_mainAxisOffsets(e){if(this._items.length<2)return this._items.map(()=>0);const t=this._resolvedItemSizePx(),a=this._resolvedGapPx(),n=t+a,i=[0];for(let o=1;o<this._items.length;o+=1){const l=this._items[o-1],h=this._items[o],r=t*l.currentScale/2,d=t*h.currentScale/2,u=Math.max(0,r+d-n);i[o]=i[o-1]+u*e}const c=i[i.length-1]/2;return i.map(o=>o-c)}_labelTransform(e,t){return e==="top"?t?"translate3d(-50%, 0, 0)":"translate3d(-50%, 6px, 0)":e==="bottom"?t?"translate3d(-50%, 0, 0)":"translate3d(-50%, -6px, 0)":e==="start"?t?"translate3d(0, -50%, 0)":"translate3d(6px, -50%, 0)":t?"translate3d(0, -50%, 0)":"translate3d(-6px, -50%, 0)"}_syncHostStyles(){const e=b(this.getAttribute("gap"));e?this.style.setProperty("--ui-dock-gap",e):this.style.removeProperty("--ui-dock-gap");const t=b(this.getAttribute("padding"));t?this.style.setProperty("--ui-dock-padding",t):this.style.removeProperty("--ui-dock-padding");const a=b(this.getAttribute("item-size"));a?(this.style.setProperty("--ui-dock-item-size",a),this.style.setProperty("--ui-dock-icon-size",`calc(${a} * 0.44)`)):(this.style.removeProperty("--ui-dock-item-size"),this.style.removeProperty("--ui-dock-icon-size"));const n=this.getAttribute("radius");if(n&&!V.has(n)){const i=b(n)||n;this.style.setProperty("--ui-dock-radius",i),this.style.setProperty("--ui-dock-item-radius",`calc(${i} * 0.82)`)}else this.style.removeProperty("--ui-dock-radius"),this.style.removeProperty("--ui-dock-item-radius")}_orientation(){return this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"}_motion(){const e=this.getAttribute("animation");return e==="calm"||e==="snappy"||e==="bouncy"?P[e]:P.smooth}_labelMode(){const e=this.getAttribute("label-mode");return e==="always"||e==="none"?e:"hover"}_magnification(){return Math.max(this._idleScale(),y(this.getAttribute("magnification"),F))}_distance(){return y(this.getAttribute("distance"),C)}_idleScale(){return Math.max(.5,y(this.getAttribute("idle-scale"),R))}_lift(){return y(this.getAttribute("lift"),D)}_smoothing(){return U(this.getAttribute("smoothing"),x)}_sizeToken(){const e=this.getAttribute("size");return e==="xs"||e==="0"?"xs":e==="sm"||e==="1"?"sm":e==="lg"||e==="3"?"lg":e==="xl"||e==="4"?"xl":"md"}_resolvedItemSizePx(){const e=b(this.getAttribute("item-size"));if(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return t}return z[this._sizeToken()]?.itemSize??O}_resolvedGapPx(){const e=b(this.getAttribute("gap"));if(e){const a=Number.parseFloat(e);if(Number.isFinite(a))return a}const t=z[this._sizeToken()];return t?Number.parseFloat(t.gap):Number.parseFloat(_)}_updateRuntimeState(){const e=this._focusedIndex>=0?"keyboard":this._pointerActive?"pointer":"idle";this.setAttribute("data-state",e)}}typeof customElements<"u"&&!customElements.get("ui-dock")&&customElements.define("ui-dock",M);exports.UIDock=M;
|