monobill-mintui 0.6.650 → 0.6.652
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/bin/component-dependencies.json +13 -1
- package/dist/components/chunks/ScrollFade-D1FPF6ZS.js +82 -0
- package/dist/components/chunks/ScrollFade-DT2Br2g7.js +1 -0
- package/dist/components/chunks/date-picker-BQsCoKaK.js +1282 -0
- package/dist/components/chunks/date-picker-tm5Oc92c.js +1 -0
- package/dist/components/chunks/{input-CYv5hraJ.js → input-DcglGwsR.js} +13 -6
- package/dist/components/chunks/input-awdYlp-G.js +1 -0
- package/dist/components/chunks/{popover-DB1OaYVe.js → popover-FdMS4yAD.js} +54 -14
- package/dist/components/chunks/popover-wGdggZ-a.js +1 -0
- package/dist/components/chunks/{table-DRdsVUJL.js → table-B9e-cnAC.js} +7 -6
- package/dist/components/chunks/table-vjF3q3J5.js +1 -0
- package/dist/components/chunks/time-picker-Cq3qzkDb.js +1 -0
- package/dist/components/chunks/time-picker-S0bc0BPU.js +360 -0
- package/dist/components/date-picker/DatePicker.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/browser.js +2 -1270
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +2 -1270
- package/dist/components/datetime-picker/DateTimePicker.d.ts +44 -0
- package/dist/components/datetime-picker/DateTimePicker.d.ts.map +1 -0
- package/dist/components/datetime-picker/browser.js +255 -0
- package/dist/components/datetime-picker/index.cjs +1 -0
- package/dist/components/datetime-picker/index.d.ts +4 -0
- package/dist/components/datetime-picker/index.d.ts.map +1 -0
- package/dist/components/datetime-picker/index.js +243 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/browser.js +9 -8
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +9 -8
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/link/browser.js +1 -1
- package/dist/components/link/index.cjs +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/navigation/browser.js +2 -2
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/popover/Popover.d.ts.map +1 -1
- package/dist/components/popover/browser.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/resource-table/ResourceTable.d.ts +1 -0
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +22 -22
- package/dist/components/resource-table/index.cjs +2 -2
- package/dist/components/resource-table/index.js +22 -22
- package/dist/components/scroll-fade/ScrollFade.d.ts +15 -0
- package/dist/components/scroll-fade/ScrollFade.d.ts.map +1 -0
- package/dist/components/scroll-fade/browser.js +16 -0
- package/dist/components/scroll-fade/index.cjs +1 -0
- package/dist/components/scroll-fade/index.d.ts +6 -0
- package/dist/components/scroll-fade/index.d.ts.map +1 -0
- package/dist/components/scroll-fade/index.js +4 -0
- package/dist/components/search/Search.d.ts.map +1 -1
- package/dist/components/search/browser.js +3 -3
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +3 -3
- package/dist/components/select/NativeSelect.d.ts +38 -0
- package/dist/components/select/NativeSelect.d.ts.map +1 -0
- package/dist/components/select/Select.d.ts +36 -29
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/browser.js +313 -19
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.d.ts +3 -2
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +313 -19
- package/dist/components/side-navigation/SideNavigation.d.ts +1 -0
- package/dist/components/side-navigation/SideNavigation.d.ts.map +1 -1
- package/dist/components/side-navigation/browser.js +24 -23
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +24 -23
- package/dist/components/sortable/browser.js +1 -1
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.js +1 -1
- package/dist/components/table/Table.d.ts +1 -0
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/browser.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/tags/browser.js +1 -1
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +1 -1
- package/dist/components/time-picker/TimePicker.d.ts +1 -0
- package/dist/components/time-picker/TimePicker.d.ts.map +1 -1
- package/dist/components/time-picker/browser.js +2 -347
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -347
- package/dist/components/tree/Tree.d.ts +2 -0
- package/dist/components/tree/Tree.d.ts.map +1 -1
- package/dist/components/tree/browser.js +15 -7
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +15 -7
- package/dist/datetime-picker.css +3 -0
- package/dist/index.cjs +4 -4
- package/dist/index.css +22 -9
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1413 -739
- package/dist/modal.css +1 -1
- package/dist/navigation-search.json +15 -1
- package/dist/navigation.css +1 -1
- package/dist/off-canvas.css +1 -1
- package/dist/popover.css +1 -1
- package/dist/scroll-fade.css +3 -0
- package/dist/select.css +1 -1
- package/dist/side-navigation.css +1 -1
- package/dist/theme.css +7 -2
- package/dist/time-picker.css +1 -1
- package/package.json +19 -1
- package/dist/components/chunks/caret-up-DzrY-bTy.js +0 -1
- package/dist/components/chunks/caret-up-ZK3v_oWQ.js +0 -9
- package/dist/components/chunks/input-Du8C2LW8.js +0 -1
- package/dist/components/chunks/popover-CNZ5u-MA.js +0 -1
- package/dist/components/chunks/table-2-0iNQJy.js +0 -1
- /package/dist/components/chunks/{caret-right-BzeJ0Fw3.js → caret-right-BcZ9bOhS.js} +0 -0
- /package/dist/components/chunks/{caret-right-Bh7uMg-Y.js → caret-right-CgIVfus7.js} +0 -0
- /package/dist/components/chunks/{link-BsC3zT_I.js → link-BjbBJpI6.js} +0 -0
- /package/dist/components/chunks/{link-dTjSvr4E.js → link-CU-gTgir.js} +0 -0
- /package/dist/components/chunks/{search-v06eZL4m.js → search--bcFMYMP.js} +0 -0
- /package/dist/components/chunks/{search-CTAGy5ab.js → search-Cixhf7hA.js} +0 -0
- /package/dist/components/chunks/{sortable-B1nMJBah.js → sortable-CNlF0_gv.js} +0 -0
- /package/dist/components/chunks/{sortable-CXM-7eyL.js → sortable-CVK48xj1.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -2775,13 +2775,102 @@ var fn = class extends HTMLElement {
|
|
|
2775
2775
|
};
|
|
2776
2776
|
typeof customElements < "u" && !customElements.get("mint-modal") && a("mint-modal", fn);
|
|
2777
2777
|
//#endregion
|
|
2778
|
+
//#region src/components/scroll-fade/ScrollFade.ts
|
|
2779
|
+
function I(e, t = "vertical", n = "1.5rem") {
|
|
2780
|
+
let r = null, i = null, a = 0, o = () => {
|
|
2781
|
+
cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
2782
|
+
let r = t === "vertical" || t === "both", i = t === "horizontal" || t === "both", a = r && e.scrollTop > 1, o = r && e.scrollTop + e.clientHeight < e.scrollHeight - 1, s = i && e.scrollLeft > 1, c = i && e.scrollLeft + e.clientWidth < e.scrollWidth - 1, l = getComputedStyle(e), u = Number.parseFloat(l.borderTopWidth) || 0, d = Number.parseFloat(l.borderRightWidth) || 0, f = Number.parseFloat(l.borderBottomWidth) || 0, p = Number.parseFloat(l.borderLeftWidth) || 0;
|
|
2783
|
+
e.dataset.mintScrollFadeTop = String(a), e.dataset.mintScrollFadeBottom = String(o), e.dataset.mintScrollFadeLeft = String(s), e.dataset.mintScrollFadeRight = String(c), e.style.setProperty("--mint-scroll-fade-size", n), e.style.setProperty("--mint-scroll-fade-top-size", a ? n : "0px"), e.style.setProperty("--mint-scroll-fade-bottom-size", o ? n : "0px"), e.style.setProperty("--mint-scroll-fade-left-size", s ? n : "0px"), e.style.setProperty("--mint-scroll-fade-right-size", c ? n : "0px");
|
|
2784
|
+
let m = [];
|
|
2785
|
+
if (r) {
|
|
2786
|
+
let e = ["#000 0"];
|
|
2787
|
+
a && e.push(`transparent ${u}px`, `#000 calc(var(--mint-scroll-fade-top-size) + ${u}px)`), o ? e.push(`#000 calc(100% - var(--mint-scroll-fade-bottom-size) - ${f}px)`, `transparent calc(100% - ${f}px)`, "#000 100%") : e.push("#000 100%"), m.push(`linear-gradient(to bottom, ${e.join(", ")})`);
|
|
2788
|
+
}
|
|
2789
|
+
if (i) {
|
|
2790
|
+
let e = ["#000 0"];
|
|
2791
|
+
s && e.push(`transparent ${p}px`, `#000 calc(var(--mint-scroll-fade-left-size) + ${p}px)`), c ? e.push(`#000 calc(100% - var(--mint-scroll-fade-right-size) - ${d}px)`, `transparent calc(100% - ${d}px)`, "#000 100%") : e.push("#000 100%"), m.push(`linear-gradient(to right, ${e.join(", ")})`);
|
|
2792
|
+
}
|
|
2793
|
+
let h = a || o || s || c ? m.join(", ") : "none";
|
|
2794
|
+
e.style.maskImage = h, e.style.webkitMaskImage = h, e.style.maskClip = "border-box", e.style.webkitMaskClip = "border", m.length > 1 ? (e.style.maskComposite = "intersect", e.style.webkitMaskComposite = "source-in") : (e.style.removeProperty("mask-composite"), e.style.removeProperty("-webkit-mask-composite"));
|
|
2795
|
+
});
|
|
2796
|
+
};
|
|
2797
|
+
return e.addEventListener("scroll", o, { passive: !0 }), typeof ResizeObserver < "u" && (r = new ResizeObserver(o), r.observe(e), e.firstElementChild && r.observe(e.firstElementChild)), typeof MutationObserver < "u" && (i = new MutationObserver(o), i.observe(e, {
|
|
2798
|
+
childList: !0,
|
|
2799
|
+
subtree: !0,
|
|
2800
|
+
characterData: !0
|
|
2801
|
+
})), o(), () => {
|
|
2802
|
+
e.removeEventListener("scroll", o), r?.disconnect(), i?.disconnect(), cancelAnimationFrame(a);
|
|
2803
|
+
for (let t of [
|
|
2804
|
+
"mintScrollFadeTop",
|
|
2805
|
+
"mintScrollFadeBottom",
|
|
2806
|
+
"mintScrollFadeLeft",
|
|
2807
|
+
"mintScrollFadeRight"
|
|
2808
|
+
]) delete e.dataset[t];
|
|
2809
|
+
e.style.maskImage = "", e.style.webkitMaskImage = "", e.style.maskClip = "", e.style.webkitMaskClip = "", e.style.removeProperty("--mint-scroll-fade-size"), e.style.removeProperty("--mint-scroll-fade-top-size"), e.style.removeProperty("--mint-scroll-fade-bottom-size"), e.style.removeProperty("--mint-scroll-fade-left-size"), e.style.removeProperty("--mint-scroll-fade-right-size"), e.style.removeProperty("mask-composite"), e.style.removeProperty("-webkit-mask-composite");
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
var pn = class extends HTMLElement {
|
|
2813
|
+
constructor(...e) {
|
|
2814
|
+
super(...e), this._disposeFade = null, this._target = null, this._contentObserver = null;
|
|
2815
|
+
}
|
|
2816
|
+
static get observedAttributes() {
|
|
2817
|
+
return [
|
|
2818
|
+
"axis",
|
|
2819
|
+
"fade-size",
|
|
2820
|
+
"target"
|
|
2821
|
+
];
|
|
2822
|
+
}
|
|
2823
|
+
connectedCallback() {
|
|
2824
|
+
this._attachFade(), this._contentObserver = new MutationObserver(() => this._attachFade()), this._contentObserver.observe(this, {
|
|
2825
|
+
childList: !0,
|
|
2826
|
+
subtree: !0
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
disconnectedCallback() {
|
|
2830
|
+
this._contentObserver?.disconnect(), this._contentObserver = null, this._disposeFade?.(), this._disposeFade = null, this._target = null, this.removeAttribute("data-wraps-scrollport");
|
|
2831
|
+
}
|
|
2832
|
+
attributeChangedCallback() {
|
|
2833
|
+
this.isConnected && this._attachFade();
|
|
2834
|
+
}
|
|
2835
|
+
_attachFade() {
|
|
2836
|
+
let e = this.getAttribute("target"), t = null;
|
|
2837
|
+
if (e) try {
|
|
2838
|
+
t = this.querySelector(e);
|
|
2839
|
+
} catch {
|
|
2840
|
+
t = null;
|
|
2841
|
+
}
|
|
2842
|
+
let n = t || Array.from(this.querySelectorAll("*")).find((e) => {
|
|
2843
|
+
let t = getComputedStyle(e);
|
|
2844
|
+
return /(auto|scroll)/.test(`${t.overflowY} ${t.overflowX}`);
|
|
2845
|
+
}) || this;
|
|
2846
|
+
if (n === this._target) return;
|
|
2847
|
+
this._disposeFade?.(), this._target = n, this.toggleAttribute("data-wraps-scrollport", n !== this);
|
|
2848
|
+
let r = this.getAttribute("axis") || "vertical";
|
|
2849
|
+
this._disposeFade = I(n, [
|
|
2850
|
+
"vertical",
|
|
2851
|
+
"horizontal",
|
|
2852
|
+
"both"
|
|
2853
|
+
].includes(r) ? r : "vertical", this.getAttribute("fade-size") || "1.5rem");
|
|
2854
|
+
}
|
|
2855
|
+
};
|
|
2856
|
+
customElements.get("mint-scroll-fade") || a("mint-scroll-fade", pn);
|
|
2857
|
+
//#endregion
|
|
2778
2858
|
//#region src/components/popover/Popover.js
|
|
2779
|
-
var
|
|
2859
|
+
var mn = new Set([
|
|
2780
2860
|
"up",
|
|
2781
2861
|
"down",
|
|
2782
2862
|
"left",
|
|
2783
2863
|
"right"
|
|
2784
|
-
])
|
|
2864
|
+
]);
|
|
2865
|
+
function hn(e) {
|
|
2866
|
+
let t = e.getBoundingClientRect(), n = Math.max(0, t.top), r = Math.min(window.innerWidth, t.right), i = Math.min(window.innerHeight, t.bottom), a = Math.max(0, t.left);
|
|
2867
|
+
for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) {
|
|
2868
|
+
let e = getComputedStyle(t), o = t.getBoundingClientRect();
|
|
2869
|
+
/(auto|scroll|hidden|clip)/.test(e.overflowY) && (n = Math.max(n, o.top), i = Math.min(i, o.bottom)), /(auto|scroll|hidden|clip)/.test(e.overflowX) && (a = Math.max(a, o.left), r = Math.min(r, o.right));
|
|
2870
|
+
}
|
|
2871
|
+
return i > n && r > a;
|
|
2872
|
+
}
|
|
2873
|
+
var gn = class extends HTMLElement {
|
|
2785
2874
|
static get observedAttributes() {
|
|
2786
2875
|
return [
|
|
2787
2876
|
"direction",
|
|
@@ -2789,26 +2878,29 @@ var pn = new Set([
|
|
|
2789
2878
|
"trigger-id",
|
|
2790
2879
|
"trigger-toggle",
|
|
2791
2880
|
"trigger-align",
|
|
2881
|
+
"align-selected",
|
|
2792
2882
|
"padding",
|
|
2793
2883
|
"hover",
|
|
2794
2884
|
"distance"
|
|
2795
2885
|
];
|
|
2796
2886
|
}
|
|
2797
2887
|
constructor() {
|
|
2798
|
-
super(), this._trigger = null, this._triggerLookupTimer = null, this._clickHandler = null, this._hoverEnterHandler = null, this._hoverLeaveHandler = null, this._outsideHandler = null, this._escapeHandler = null, this._positionHandler = null, this._scrollHandler = null, this._resizeObserver = null, this._hoverCloseTimer = null, this._closeAnimationTimer = null, this._blobAnimation = null;
|
|
2888
|
+
super(), this._trigger = null, this._triggerLookupTimer = null, this._clickHandler = null, this._hoverEnterHandler = null, this._hoverLeaveHandler = null, this._outsideHandler = null, this._escapeHandler = null, this._positionHandler = null, this._scrollHandler = null, this._resizeObserver = null, this._hoverCloseTimer = null, this._closeAnimationTimer = null, this._blobAnimation = null, this._disposeScrollFade = null;
|
|
2799
2889
|
}
|
|
2800
2890
|
connectedCallback() {
|
|
2801
|
-
this.render(), this.
|
|
2891
|
+
this.render(), this._disposeScrollFade?.();
|
|
2892
|
+
let e = this.classList.contains("mint-select-popover") ? this.querySelector(".mint-select-options") : this;
|
|
2893
|
+
this._disposeScrollFade = I(e || this, e ? "vertical" : "both"), this._setupTrigger();
|
|
2802
2894
|
}
|
|
2803
2895
|
disconnectedCallback() {
|
|
2804
|
-
this._removeTrigger(), this._removeOpenListeners(), clearTimeout(this._hoverCloseTimer), clearTimeout(this._closeAnimationTimer), this._blobAnimation?.cancel();
|
|
2896
|
+
this._removeTrigger(), this._removeOpenListeners(), this._disposeScrollFade?.(), this._disposeScrollFade = null, clearTimeout(this._hoverCloseTimer), clearTimeout(this._closeAnimationTimer), this._blobAnimation?.cancel();
|
|
2805
2897
|
}
|
|
2806
2898
|
attributeChangedCallback(e, t, n) {
|
|
2807
2899
|
t === n || !this.isConnected || ((e === "trigger-id" || e === "trigger-toggle" || e === "hover") && this._setupTrigger(), this.render());
|
|
2808
2900
|
}
|
|
2809
2901
|
getDirection() {
|
|
2810
2902
|
let e = this.getAttribute("direction") || "down";
|
|
2811
|
-
return
|
|
2903
|
+
return mn.has(e) ? e : "down";
|
|
2812
2904
|
}
|
|
2813
2905
|
getTriggerId() {
|
|
2814
2906
|
return this.getAttribute("trigger-id") || "";
|
|
@@ -2868,10 +2960,19 @@ var pn = new Set([
|
|
|
2868
2960
|
}, this._scrollHandler = (e) => {
|
|
2869
2961
|
if (!this.isOpen()) return;
|
|
2870
2962
|
let t = e.target;
|
|
2871
|
-
t instanceof Node && (t === this || this.contains(t))
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2963
|
+
if (!(t instanceof Node && (t === this || this.contains(t)))) {
|
|
2964
|
+
if (this.classList.contains("mint-select-popover")) {
|
|
2965
|
+
!this._trigger || !hn(this._trigger) ? this.close() : this._position({
|
|
2966
|
+
allowViewportFlip: !1,
|
|
2967
|
+
clampToViewport: !1
|
|
2968
|
+
});
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
this._position({
|
|
2972
|
+
allowViewportFlip: !1,
|
|
2973
|
+
clampToViewport: !1
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2875
2976
|
}, typeof ResizeObserver < "u" && this._trigger) {
|
|
2876
2977
|
this._resizeObserver = new ResizeObserver(() => {
|
|
2877
2978
|
this.isOpen() && this._position();
|
|
@@ -2894,8 +2995,26 @@ var pn = new Set([
|
|
|
2894
2995
|
height: this.offsetHeight
|
|
2895
2996
|
}, o = this._distancePx(), s = e ? this.getDirection() : this.dataset.direction || this.getDirection(), c = 0, l = 0, u = this.getAttribute("trigger-align") || "center";
|
|
2896
2997
|
if (s === "down" || s === "up") {
|
|
2897
|
-
let
|
|
2898
|
-
e && s === "down" &&
|
|
2998
|
+
let n = i.bottom + o, r = i.top - a.height - o;
|
|
2999
|
+
e && s === "down" && n + a.height > innerHeight - 12 && r >= 12 ? s = "up" : e && s === "up" && r < 12 && n + a.height <= innerHeight - 12 && (s = "down");
|
|
3000
|
+
let d = this.hasAttribute("align-selected") ? this.querySelector("[role=\"option\"][aria-selected=\"true\"]") : null;
|
|
3001
|
+
if (d) {
|
|
3002
|
+
let e = d.closest("[role=\"listbox\"]"), n = Number.parseFloat(getComputedStyle(this).maxHeight);
|
|
3003
|
+
Math.min(Number.isFinite(n) ? n : innerHeight - 24, innerHeight - 24);
|
|
3004
|
+
let r = this.scrollHeight > this.clientHeight + 1;
|
|
3005
|
+
e && (e.style.paddingBlock = "0px");
|
|
3006
|
+
let o = d.offsetTop + d.offsetHeight / 2, s = i.top + i.height / 2, c = this.offsetHeight, f;
|
|
3007
|
+
if (f = s - o, r && f < 12) {
|
|
3008
|
+
f = 12;
|
|
3009
|
+
let e = s - f, t = Math.max(0, this.scrollHeight - this.clientHeight);
|
|
3010
|
+
this.scrollTop = Math.max(0, Math.min(t, o - e));
|
|
3011
|
+
} else f = Math.max(12, Math.min(f, innerHeight - c - 12));
|
|
3012
|
+
l = u === "start" ? i.left : u === "end" ? i.right - a.width : i.left + (i.width - a.width) / 2;
|
|
3013
|
+
let p = t ? Math.max(12, Math.min(l, innerWidth - a.width - 12)) : l;
|
|
3014
|
+
this.style.top = `${f}px`, this.style.left = `${p}px`, this.dataset.direction = "down", this.style.setProperty("--mint-popover-origin-x", `${i.left + i.width / 2 - p}px`), this.style.setProperty("--mint-popover-origin-y", `${s - f}px`);
|
|
3015
|
+
return;
|
|
3016
|
+
}
|
|
3017
|
+
c = s === "down" ? n : r, l = u === "start" ? i.left : u === "end" ? i.right - a.width : i.left + (i.width - a.width) / 2;
|
|
2899
3018
|
} else {
|
|
2900
3019
|
let t = i.right + o, n = i.left - a.width - o;
|
|
2901
3020
|
e && s === "right" && t + a.width > innerWidth - 12 && n >= 12 ? s = "left" : e && s === "left" && n < 12 && t + a.width <= innerWidth - 12 && (s = "right"), l = s === "right" ? t : n, c = u === "start" ? i.top : u === "end" ? i.bottom - a.height : i.top + (i.height - a.height) / 2;
|
|
@@ -2961,7 +3080,7 @@ var pn = new Set([
|
|
|
2961
3080
|
} else this.dataset.state = "closed";
|
|
2962
3081
|
}
|
|
2963
3082
|
};
|
|
2964
|
-
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover",
|
|
3083
|
+
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover", gn), s({
|
|
2965
3084
|
name: "check",
|
|
2966
3085
|
viewBox: "0 0 24 24",
|
|
2967
3086
|
path: "M5 13l4 4L19 7",
|
|
@@ -2971,7 +3090,7 @@ typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-po
|
|
|
2971
3090
|
});
|
|
2972
3091
|
//#endregion
|
|
2973
3092
|
//#region src/components/checkbox/Checkbox.js
|
|
2974
|
-
var
|
|
3093
|
+
var _n = class extends HTMLElement {
|
|
2975
3094
|
static get observedAttributes() {
|
|
2976
3095
|
return [
|
|
2977
3096
|
"checked",
|
|
@@ -3102,10 +3221,10 @@ var hn = class extends HTMLElement {
|
|
|
3102
3221
|
}
|
|
3103
3222
|
}
|
|
3104
3223
|
};
|
|
3105
|
-
typeof customElements < "u" && !customElements.get("mint-checkbox") && a("mint-checkbox",
|
|
3224
|
+
typeof customElements < "u" && !customElements.get("mint-checkbox") && a("mint-checkbox", _n);
|
|
3106
3225
|
//#endregion
|
|
3107
3226
|
//#region src/components/choice/Choice.js
|
|
3108
|
-
var
|
|
3227
|
+
var vn = class extends HTMLElement {
|
|
3109
3228
|
static get observedAttributes() {
|
|
3110
3229
|
return [
|
|
3111
3230
|
"checked",
|
|
@@ -3324,7 +3443,7 @@ var gn = class extends HTMLElement {
|
|
|
3324
3443
|
this.dispatchEvent(t);
|
|
3325
3444
|
}
|
|
3326
3445
|
}
|
|
3327
|
-
},
|
|
3446
|
+
}, yn = class extends HTMLElement {
|
|
3328
3447
|
static get observedAttributes() {
|
|
3329
3448
|
return [
|
|
3330
3449
|
"value",
|
|
@@ -3358,10 +3477,10 @@ var gn = class extends HTMLElement {
|
|
|
3358
3477
|
r || (r = document.createElement("span"), r.className = "mint-choice-option-label", n.appendChild(r)), r.textContent = this._labelText;
|
|
3359
3478
|
}
|
|
3360
3479
|
};
|
|
3361
|
-
typeof customElements < "u" && !customElements.get("mint-choice") && a("mint-choice",
|
|
3480
|
+
typeof customElements < "u" && !customElements.get("mint-choice") && a("mint-choice", vn), typeof customElements < "u" && !customElements.get("mint-choice-option") && a("mint-choice-option", yn);
|
|
3362
3481
|
//#endregion
|
|
3363
3482
|
//#region src/components/navigation/Navigation.js
|
|
3364
|
-
var
|
|
3483
|
+
var bn = 0, xn = class extends HTMLElement {
|
|
3365
3484
|
static get observedAttributes() {
|
|
3366
3485
|
return [
|
|
3367
3486
|
"brand",
|
|
@@ -3373,7 +3492,7 @@ var vn = 0, yn = class extends HTMLElement {
|
|
|
3373
3492
|
];
|
|
3374
3493
|
}
|
|
3375
3494
|
constructor() {
|
|
3376
|
-
super(), this._built = !1, this._brand = null, this._brandLink = null, this._leadingActions = null, this._items = null, this._toggle = null, this._toggleLabel = null, this._mobileActions = null, this._mobileActionNodes = [], this._instanceId = ++
|
|
3495
|
+
super(), this._built = !1, this._brand = null, this._brandLink = null, this._leadingActions = null, this._items = null, this._toggle = null, this._toggleLabel = null, this._mobileActions = null, this._mobileActionNodes = [], this._instanceId = ++bn, this._dropdowns = [], this._content = null, this._actions = null, this._activeDropdown = null, this._layoutObserver = null;
|
|
3377
3496
|
}
|
|
3378
3497
|
connectedCallback() {
|
|
3379
3498
|
this._built || this._build(), this._observeDropdowns(), this._syncResponsiveDropdowns(), this._syncMobileActions(), typeof ResizeObserver < "u" && (this._layoutObserver = new ResizeObserver(() => {
|
|
@@ -3533,7 +3652,7 @@ var vn = 0, yn = class extends HTMLElement {
|
|
|
3533
3652
|
this.hasAttribute("open") ? this.closeMenu() : this.openMenu();
|
|
3534
3653
|
}
|
|
3535
3654
|
};
|
|
3536
|
-
typeof customElements < "u" && !customElements.get("mint-navigation") && a("mint-navigation",
|
|
3655
|
+
typeof customElements < "u" && !customElements.get("mint-navigation") && a("mint-navigation", xn), s({
|
|
3537
3656
|
name: "info",
|
|
3538
3657
|
viewBox: "0 0 24 24",
|
|
3539
3658
|
path: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
@@ -3567,7 +3686,7 @@ typeof customElements < "u" && !customElements.get("mint-navigation") && a("mint
|
|
|
3567
3686
|
});
|
|
3568
3687
|
//#endregion
|
|
3569
3688
|
//#region src/components/alert/Alert.ts
|
|
3570
|
-
var
|
|
3689
|
+
var Sn = class extends HTMLElement {
|
|
3571
3690
|
static get observedAttributes() {
|
|
3572
3691
|
return [
|
|
3573
3692
|
"heading",
|
|
@@ -3683,10 +3802,10 @@ var bn = class extends HTMLElement {
|
|
|
3683
3802
|
}
|
|
3684
3803
|
}
|
|
3685
3804
|
};
|
|
3686
|
-
customElements.get("mint-alert") || a("mint-alert",
|
|
3805
|
+
customElements.get("mint-alert") || a("mint-alert", Sn);
|
|
3687
3806
|
//#endregion
|
|
3688
3807
|
//#region src/components/bottom-navigation/BottomNavigation.ts
|
|
3689
|
-
var
|
|
3808
|
+
var L = class extends HTMLElement {
|
|
3690
3809
|
constructor(...e) {
|
|
3691
3810
|
super(...e), this._lastScrollY = 0, this._scrollHandler = null;
|
|
3692
3811
|
}
|
|
@@ -3711,10 +3830,10 @@ var I = class extends HTMLElement {
|
|
|
3711
3830
|
this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
|
|
3712
3831
|
}
|
|
3713
3832
|
};
|
|
3714
|
-
customElements.get("mint-bottom-navigation") || a("mint-bottom-navigation",
|
|
3833
|
+
customElements.get("mint-bottom-navigation") || a("mint-bottom-navigation", L);
|
|
3715
3834
|
//#endregion
|
|
3716
3835
|
//#region src/components/bottom-navigation/BottomNavItem.ts
|
|
3717
|
-
var
|
|
3836
|
+
var Cn = class extends HTMLElement {
|
|
3718
3837
|
constructor(...e) {
|
|
3719
3838
|
super(...e), this._root = null;
|
|
3720
3839
|
}
|
|
@@ -3758,10 +3877,10 @@ var xn = class extends HTMLElement {
|
|
|
3758
3877
|
s.className = "mint-bottom-nav-label", s.textContent = t, i.appendChild(o), i.appendChild(s), this.replaceChildren(i), this._root = i;
|
|
3759
3878
|
}
|
|
3760
3879
|
};
|
|
3761
|
-
customElements.get("mint-bottom-nav-item") || a("mint-bottom-nav-item",
|
|
3880
|
+
customElements.get("mint-bottom-nav-item") || a("mint-bottom-nav-item", Cn);
|
|
3762
3881
|
//#endregion
|
|
3763
3882
|
//#region src/components/bottom-navigation/index.ts
|
|
3764
|
-
var
|
|
3883
|
+
var wn = L, Tn = class e extends HTMLElement {
|
|
3765
3884
|
static get observedAttributes() {
|
|
3766
3885
|
return [
|
|
3767
3886
|
"type",
|
|
@@ -5086,10 +5205,10 @@ var Sn = I, Cn = class e extends HTMLElement {
|
|
|
5086
5205
|
});
|
|
5087
5206
|
}
|
|
5088
5207
|
};
|
|
5089
|
-
customElements.get("mint-chart") || a("mint-chart",
|
|
5208
|
+
customElements.get("mint-chart") || a("mint-chart", Tn);
|
|
5090
5209
|
//#endregion
|
|
5091
5210
|
//#region src/components/chip/Chip.ts
|
|
5092
|
-
var
|
|
5211
|
+
var En = class extends HTMLElement {
|
|
5093
5212
|
constructor(...e) {
|
|
5094
5213
|
super(...e), this._root = null, this._label = null, this._dismissBtn = null, this._clickHandler = null;
|
|
5095
5214
|
}
|
|
@@ -5139,10 +5258,10 @@ var wn = class extends HTMLElement {
|
|
|
5139
5258
|
}, e.addEventListener("click", this._clickHandler), this._dismissBtn = e;
|
|
5140
5259
|
}
|
|
5141
5260
|
};
|
|
5142
|
-
customElements.get("mint-chip") || a("mint-chip",
|
|
5261
|
+
customElements.get("mint-chip") || a("mint-chip", En);
|
|
5143
5262
|
//#endregion
|
|
5144
5263
|
//#region src/components/clickable/Clickable.ts
|
|
5145
|
-
var
|
|
5264
|
+
var Dn = class extends HTMLElement {
|
|
5146
5265
|
constructor(...e) {
|
|
5147
5266
|
super(...e), this._clickHandler = null, this._keydownHandler = null, this._target = null, this._observer = null, this._managedRole = !1, this._managedTabindex = !1;
|
|
5148
5267
|
}
|
|
@@ -5201,10 +5320,10 @@ var Tn = class extends HTMLElement {
|
|
|
5201
5320
|
e === "disabled" && this.isConnected && this._syncTarget();
|
|
5202
5321
|
}
|
|
5203
5322
|
};
|
|
5204
|
-
customElements.get("mint-clickable") || a("mint-clickable",
|
|
5323
|
+
customElements.get("mint-clickable") || a("mint-clickable", Dn);
|
|
5205
5324
|
//#endregion
|
|
5206
5325
|
//#region src/components/collapsible/Collapsible.ts
|
|
5207
|
-
var
|
|
5326
|
+
var On = class extends HTMLElement {
|
|
5208
5327
|
static get observedAttributes() {
|
|
5209
5328
|
return [
|
|
5210
5329
|
"id",
|
|
@@ -5355,10 +5474,10 @@ var En = class extends HTMLElement {
|
|
|
5355
5474
|
}), this._contentAnimation.onfinish = o;
|
|
5356
5475
|
}
|
|
5357
5476
|
};
|
|
5358
|
-
customElements.get("mint-collapsible") || a("mint-collapsible",
|
|
5477
|
+
customElements.get("mint-collapsible") || a("mint-collapsible", On);
|
|
5359
5478
|
//#endregion
|
|
5360
5479
|
//#region src/components/confirm-action/ConfirmAction.ts
|
|
5361
|
-
var
|
|
5480
|
+
var kn = class extends HTMLElement {
|
|
5362
5481
|
constructor(...e) {
|
|
5363
5482
|
super(...e), this._modal = null, this._actionsFooter = null, this._confirmButton = null, this._cancelButton = null, this._pendingResolve = null, this._modalObserver = null, this._lastAction = null, this._onConfirmClick = null, this._onCancelClick = null;
|
|
5364
5483
|
}
|
|
@@ -5405,11 +5524,11 @@ var Dn = class extends HTMLElement {
|
|
|
5405
5524
|
}));
|
|
5406
5525
|
}
|
|
5407
5526
|
};
|
|
5408
|
-
customElements.get("mint-confirm-action") || a("mint-confirm-action",
|
|
5527
|
+
customElements.get("mint-confirm-action") || a("mint-confirm-action", kn);
|
|
5409
5528
|
//#endregion
|
|
5410
5529
|
//#region src/components/confirm-action/ConfirmActionApi.ts
|
|
5411
|
-
var
|
|
5412
|
-
function
|
|
5530
|
+
var R = [], z = !1;
|
|
5531
|
+
function An() {
|
|
5413
5532
|
return typeof document > "u" || document.body ? Promise.resolve() : new Promise((e) => {
|
|
5414
5533
|
if (typeof window > "u") {
|
|
5415
5534
|
e();
|
|
@@ -5418,48 +5537,48 @@ function On() {
|
|
|
5418
5537
|
window.addEventListener("DOMContentLoaded", () => e(), { once: !0 });
|
|
5419
5538
|
});
|
|
5420
5539
|
}
|
|
5421
|
-
async function
|
|
5422
|
-
if (await
|
|
5540
|
+
async function jn() {
|
|
5541
|
+
if (await An(), typeof document > "u") throw Error("mintui.confirm is only available in browser environments.");
|
|
5423
5542
|
let e = document.querySelector("mint-confirm-action[data-mint-confirm-action-root=\"true\"]");
|
|
5424
5543
|
if (e) return e;
|
|
5425
5544
|
let t = document.createElement("mint-confirm-action");
|
|
5426
5545
|
return t.setAttribute("data-mint-confirm-action-root", "true"), document.body.appendChild(t), t;
|
|
5427
5546
|
}
|
|
5428
|
-
function
|
|
5547
|
+
function Mn(e) {
|
|
5429
5548
|
let t = (e || "action").toString().trim().toLowerCase().replace(/^tone:\s*/, "");
|
|
5430
5549
|
return t === "action" || t === "info" || t === "warning" || t === "danger" ? t : "action";
|
|
5431
5550
|
}
|
|
5432
|
-
async function
|
|
5433
|
-
if (!
|
|
5434
|
-
|
|
5551
|
+
async function Nn() {
|
|
5552
|
+
if (!z) {
|
|
5553
|
+
z = !0;
|
|
5435
5554
|
try {
|
|
5436
|
-
for (;
|
|
5437
|
-
let e =
|
|
5438
|
-
e && (await (await
|
|
5555
|
+
for (; R.length > 0;) {
|
|
5556
|
+
let e = R.shift();
|
|
5557
|
+
e && (await (await jn()).showConfirm({
|
|
5439
5558
|
question: e.question,
|
|
5440
|
-
tone:
|
|
5559
|
+
tone: Mn(e.tone),
|
|
5441
5560
|
confirmLabel: e.confirmLabel || "Confirm",
|
|
5442
5561
|
cancelLabel: e.cancelLabel || "Cancel"
|
|
5443
5562
|
}) ? e.confirmed?.() : e.cancelled?.());
|
|
5444
5563
|
}
|
|
5445
5564
|
} finally {
|
|
5446
|
-
|
|
5565
|
+
z = !1;
|
|
5447
5566
|
}
|
|
5448
5567
|
}
|
|
5449
5568
|
}
|
|
5450
|
-
function
|
|
5451
|
-
typeof window > "u" || (
|
|
5569
|
+
function Pn(e, t, n, r = "action", i = "Confirm", a = "Cancel") {
|
|
5570
|
+
typeof window > "u" || (R.push({
|
|
5452
5571
|
question: e,
|
|
5453
5572
|
confirmed: t,
|
|
5454
5573
|
cancelled: n,
|
|
5455
5574
|
tone: r,
|
|
5456
5575
|
confirmLabel: i,
|
|
5457
5576
|
cancelLabel: a
|
|
5458
|
-
}),
|
|
5577
|
+
}), Nn());
|
|
5459
5578
|
}
|
|
5460
5579
|
if (typeof window < "u") {
|
|
5461
5580
|
let e = window.mintui || {};
|
|
5462
|
-
e.confirm =
|
|
5581
|
+
e.confirm = Pn, window.mintui = e;
|
|
5463
5582
|
}
|
|
5464
5583
|
s({
|
|
5465
5584
|
name: "calendar",
|
|
@@ -5494,7 +5613,7 @@ s({
|
|
|
5494
5613
|
});
|
|
5495
5614
|
//#endregion
|
|
5496
5615
|
//#region src/components/input/Input.ts
|
|
5497
|
-
var
|
|
5616
|
+
var Fn = class extends HTMLElement {
|
|
5498
5617
|
static get observedAttributes() {
|
|
5499
5618
|
return [
|
|
5500
5619
|
"type",
|
|
@@ -5819,10 +5938,10 @@ var Nn = class extends HTMLElement {
|
|
|
5819
5938
|
}
|
|
5820
5939
|
}
|
|
5821
5940
|
};
|
|
5822
|
-
customElements.get("mint-input") || a("mint-input",
|
|
5941
|
+
customElements.get("mint-input") || a("mint-input", Fn);
|
|
5823
5942
|
//#endregion
|
|
5824
5943
|
//#region src/components/date-picker/DatePicker.ts
|
|
5825
|
-
var
|
|
5944
|
+
var In = class extends HTMLElement {
|
|
5826
5945
|
static get observedAttributes() {
|
|
5827
5946
|
return [
|
|
5828
5947
|
"value",
|
|
@@ -5884,6 +6003,18 @@ var Pn = class extends HTMLElement {
|
|
|
5884
6003
|
getValue() {
|
|
5885
6004
|
return this.getAttribute("value") || "";
|
|
5886
6005
|
}
|
|
6006
|
+
getPopoverElement() {
|
|
6007
|
+
return this._popover;
|
|
6008
|
+
}
|
|
6009
|
+
getPopoverContentElement() {
|
|
6010
|
+
return this._popover?.querySelector(".popover-content") || null;
|
|
6011
|
+
}
|
|
6012
|
+
getDisplayElement() {
|
|
6013
|
+
return this._displayEl;
|
|
6014
|
+
}
|
|
6015
|
+
refreshCalendar() {
|
|
6016
|
+
this._buildCalendar();
|
|
6017
|
+
}
|
|
5887
6018
|
setValue(e) {
|
|
5888
6019
|
e ? (this.setAttribute("value", e), this._textInput && (this._textInput.value = e), this._parseValue(e)) : (this.removeAttribute("value"), this._textInput && (this._textInput.value = ""), this._selectedStartDate = null, this._selectedEndDate = null), this._buildCalendar(), this._updateDisplayText();
|
|
5889
6020
|
}
|
|
@@ -6965,7 +7096,7 @@ var Pn = class extends HTMLElement {
|
|
|
6965
7096
|
else {
|
|
6966
7097
|
this._selectedStartDate = r, this._selectedEndDate = null;
|
|
6967
7098
|
let e = this._formatDate(r, t);
|
|
6968
|
-
this.setValue(e), this._textInput && (this._textInput.value = e), this._popover && typeof this._popover.close == "function" && this._popover.close();
|
|
7099
|
+
this.setValue(e), this._textInput && (this._textInput.value = e), !this.hasAttribute("keep-open-on-select") && this._popover && typeof this._popover.close == "function" && this._popover.close();
|
|
6969
7100
|
}
|
|
6970
7101
|
this._buildCalendar(), this._updateDisplayText(), this._exitInputMode();
|
|
6971
7102
|
let a = new Event("input", {
|
|
@@ -7068,160 +7199,742 @@ var Pn = class extends HTMLElement {
|
|
|
7068
7199
|
this._focusTrapHandler &&= (document.removeEventListener("keydown", this._focusTrapHandler, !0), null), this._escapeHandler &&= (document.removeEventListener("keydown", this._escapeHandler, !0), null);
|
|
7069
7200
|
}
|
|
7070
7201
|
};
|
|
7071
|
-
customElements.get("mint-date-picker") || a("mint-date-picker",
|
|
7072
|
-
name: "upload",
|
|
7073
|
-
viewBox: "0 0 24 24",
|
|
7074
|
-
path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
|
|
7075
|
-
strokeLinecap: "round",
|
|
7076
|
-
strokeLinejoin: "round"
|
|
7077
|
-
}), s({
|
|
7078
|
-
name: "attach",
|
|
7079
|
-
viewBox: "0 0 24 24",
|
|
7080
|
-
path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
|
|
7081
|
-
strokeLinecap: "round",
|
|
7082
|
-
strokeLinejoin: "round"
|
|
7083
|
-
});
|
|
7202
|
+
customElements.get("mint-date-picker") || a("mint-date-picker", In);
|
|
7084
7203
|
//#endregion
|
|
7085
|
-
//#region src/components/
|
|
7086
|
-
var
|
|
7204
|
+
//#region src/components/time-picker/TimePicker.ts
|
|
7205
|
+
var Ln = class extends HTMLElement {
|
|
7206
|
+
constructor(...e) {
|
|
7207
|
+
super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._triggerClickObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
|
|
7208
|
+
hour: 9,
|
|
7209
|
+
minute: 0,
|
|
7210
|
+
second: 0,
|
|
7211
|
+
meridiem: "AM"
|
|
7212
|
+
}, this._rangeStart = {
|
|
7213
|
+
hour: 9,
|
|
7214
|
+
minute: 0,
|
|
7215
|
+
second: 0,
|
|
7216
|
+
meridiem: "AM"
|
|
7217
|
+
}, this._rangeEnd = {
|
|
7218
|
+
hour: 5,
|
|
7219
|
+
minute: 0,
|
|
7220
|
+
second: 0,
|
|
7221
|
+
meridiem: "PM"
|
|
7222
|
+
}, this._invalidFromInput = !1;
|
|
7223
|
+
}
|
|
7087
7224
|
static get observedAttributes() {
|
|
7088
7225
|
return [
|
|
7226
|
+
"value",
|
|
7227
|
+
"inline",
|
|
7089
7228
|
"label",
|
|
7090
|
-
"
|
|
7091
|
-
"multiple",
|
|
7092
|
-
"width",
|
|
7093
|
-
"height",
|
|
7229
|
+
"info",
|
|
7094
7230
|
"disabled",
|
|
7231
|
+
"id",
|
|
7095
7232
|
"name",
|
|
7233
|
+
"required",
|
|
7234
|
+
"readonly",
|
|
7235
|
+
"range",
|
|
7236
|
+
"hours",
|
|
7237
|
+
"minutes",
|
|
7238
|
+
"seconds",
|
|
7096
7239
|
"error",
|
|
7097
|
-
"error-message"
|
|
7098
|
-
"loading",
|
|
7099
|
-
"aria-label",
|
|
7100
|
-
"aria-describedby"
|
|
7240
|
+
"error-message"
|
|
7101
7241
|
];
|
|
7102
7242
|
}
|
|
7103
|
-
constructor() {
|
|
7104
|
-
super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
|
|
7105
|
-
}
|
|
7106
7243
|
connectedCallback() {
|
|
7107
|
-
this.classList.add("mint-
|
|
7244
|
+
this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
|
|
7108
7245
|
}
|
|
7109
7246
|
disconnectedCallback() {
|
|
7110
|
-
|
|
7111
|
-
let e = this.closest("form");
|
|
7112
|
-
e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
|
|
7113
|
-
}
|
|
7247
|
+
this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null);
|
|
7114
7248
|
}
|
|
7115
7249
|
attributeChangedCallback(e, t, n) {
|
|
7116
7250
|
if (t !== n) {
|
|
7117
|
-
if (e === "
|
|
7118
|
-
this.
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7251
|
+
if (e === "value") {
|
|
7252
|
+
this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
7253
|
+
{
|
|
7254
|
+
let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
7255
|
+
e && this._buildPopoverContent(e);
|
|
7256
|
+
}
|
|
7123
7257
|
return;
|
|
7124
7258
|
}
|
|
7125
|
-
this.render();
|
|
7259
|
+
e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
|
|
7126
7260
|
}
|
|
7127
7261
|
}
|
|
7128
|
-
|
|
7129
|
-
return this.
|
|
7262
|
+
get value() {
|
|
7263
|
+
return this.getValue();
|
|
7130
7264
|
}
|
|
7131
|
-
|
|
7132
|
-
|
|
7265
|
+
set value(e) {
|
|
7266
|
+
this.setValue(e || "");
|
|
7133
7267
|
}
|
|
7134
|
-
|
|
7135
|
-
return this.getAttribute("
|
|
7268
|
+
getValue() {
|
|
7269
|
+
return this.getAttribute("value") || "";
|
|
7136
7270
|
}
|
|
7137
|
-
|
|
7138
|
-
|
|
7271
|
+
setValue(e) {
|
|
7272
|
+
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
7139
7273
|
}
|
|
7140
|
-
|
|
7141
|
-
return this.getAttribute("
|
|
7274
|
+
isRange() {
|
|
7275
|
+
return this.getAttribute("range") === "true";
|
|
7142
7276
|
}
|
|
7143
|
-
|
|
7144
|
-
let
|
|
7145
|
-
|
|
7146
|
-
this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
|
|
7147
|
-
let e = t.querySelector(".mint-dropzone-skeleton");
|
|
7148
|
-
e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
|
|
7149
|
-
} else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
|
|
7277
|
+
isHoursEnabled() {
|
|
7278
|
+
let e = this.getAttribute("hours");
|
|
7279
|
+
return e === null ? !0 : e !== "false";
|
|
7150
7280
|
}
|
|
7151
|
-
|
|
7152
|
-
|
|
7281
|
+
isMinutesEnabled() {
|
|
7282
|
+
let e = this.getAttribute("minutes");
|
|
7283
|
+
return e === null ? !0 : e !== "false";
|
|
7153
7284
|
}
|
|
7154
|
-
|
|
7285
|
+
isSecondsEnabled() {
|
|
7286
|
+
let e = this.getAttribute("seconds");
|
|
7287
|
+
return e === null ? !1 : e !== "false";
|
|
7288
|
+
}
|
|
7289
|
+
isDisabled() {
|
|
7290
|
+
return this.getAttribute("disabled") === "true";
|
|
7291
|
+
}
|
|
7292
|
+
isReadonly() {
|
|
7293
|
+
return this.getAttribute("readonly") === "true";
|
|
7294
|
+
}
|
|
7295
|
+
isRequired() {
|
|
7296
|
+
return this.getAttribute("required") === "true";
|
|
7297
|
+
}
|
|
7298
|
+
hasExternalError() {
|
|
7155
7299
|
return this.getAttribute("error") === "true";
|
|
7156
7300
|
}
|
|
7157
|
-
|
|
7301
|
+
getExternalErrorMessage() {
|
|
7158
7302
|
return this.getAttribute("error-message") || "";
|
|
7159
7303
|
}
|
|
7160
|
-
|
|
7161
|
-
return this.getAttribute("
|
|
7304
|
+
getLabel() {
|
|
7305
|
+
return this.getAttribute("label") || "";
|
|
7162
7306
|
}
|
|
7163
|
-
|
|
7164
|
-
return this.getAttribute("
|
|
7307
|
+
getInfo() {
|
|
7308
|
+
return this.getAttribute("info") || "";
|
|
7165
7309
|
}
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
|
|
7169
|
-
else {
|
|
7170
|
-
this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
|
|
7171
|
-
let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
|
|
7172
|
-
n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7173
|
-
}
|
|
7174
|
-
this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
|
|
7175
|
-
let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
|
|
7176
|
-
u && u.remove(), d && d.remove();
|
|
7177
|
-
let f = document.createElement("div");
|
|
7178
|
-
f.className = "mint-dropzone-icon";
|
|
7179
|
-
let p = document.createElement("mint-icon");
|
|
7180
|
-
if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
|
|
7181
|
-
let e = document.createElement("div");
|
|
7182
|
-
e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
|
|
7183
|
-
}
|
|
7184
|
-
this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
|
|
7310
|
+
getName() {
|
|
7311
|
+
return this.getAttribute("name") || "";
|
|
7185
7312
|
}
|
|
7186
|
-
|
|
7187
|
-
|
|
7313
|
+
_getEffectiveError() {
|
|
7314
|
+
return {
|
|
7315
|
+
hasError: this.hasExternalError(),
|
|
7316
|
+
message: this.getExternalErrorMessage()
|
|
7317
|
+
};
|
|
7188
7318
|
}
|
|
7189
|
-
|
|
7190
|
-
let n = this.
|
|
7191
|
-
|
|
7192
|
-
this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
|
|
7193
|
-
let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
7194
|
-
n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7195
|
-
}
|
|
7319
|
+
_formatParts(e) {
|
|
7320
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
|
|
7321
|
+
return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
|
|
7196
7322
|
}
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7323
|
+
_to24Hour(e) {
|
|
7324
|
+
let t = e.hour % 12;
|
|
7325
|
+
return e.meridiem === "PM" && (t += 12), {
|
|
7326
|
+
hour: t,
|
|
7327
|
+
minute: e.minute,
|
|
7328
|
+
second: e.second
|
|
7329
|
+
};
|
|
7201
7330
|
}
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7331
|
+
_formatParts24(e) {
|
|
7332
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
|
|
7333
|
+
return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
|
|
7334
|
+
}
|
|
7335
|
+
_getDisplayValue() {
|
|
7336
|
+
return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
|
|
7337
|
+
}
|
|
7338
|
+
_getOutputValue() {
|
|
7339
|
+
return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
|
|
7340
|
+
}
|
|
7341
|
+
_getExpectedFormat() {
|
|
7342
|
+
let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
|
|
7343
|
+
e && r.push("h"), t && r.push("mm"), n && r.push("ss");
|
|
7344
|
+
let i = e ? `${r.join(":")} am/pm` : r.join(":");
|
|
7345
|
+
return this.isRange() ? `${i} - ${i}` : i;
|
|
7346
|
+
}
|
|
7347
|
+
_syncHiddenInput() {
|
|
7348
|
+
this._hiddenInput && (this._hiddenInput.value = this.getValue() || this._getOutputValue());
|
|
7349
|
+
}
|
|
7350
|
+
_syncInputValue() {
|
|
7351
|
+
this._inputEl && (this._inputEl.value = this._getDisplayValue(), typeof this._inputEl.render == "function" && this._inputEl.render());
|
|
7352
|
+
}
|
|
7353
|
+
_emitChangeFromPicker() {
|
|
7354
|
+
let e = this._getOutputValue();
|
|
7355
|
+
this._invalidFromInput = !1, this.setAttribute("value", e), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
7356
|
+
bubbles: !0,
|
|
7357
|
+
composed: !0
|
|
7358
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7359
|
+
}
|
|
7360
|
+
_parseSingle(e) {
|
|
7361
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
7362
|
+
if (t) {
|
|
7363
|
+
let e = i.match(/^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*(am|pm)$/i);
|
|
7364
|
+
if (!e) return null;
|
|
7365
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0), s = e[4].toUpperCase();
|
|
7366
|
+
return t < 1 || t > 12 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59) ? null : {
|
|
7367
|
+
hour: t,
|
|
7368
|
+
minute: a,
|
|
7369
|
+
second: o,
|
|
7370
|
+
meridiem: s
|
|
7371
|
+
};
|
|
7372
|
+
}
|
|
7373
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
7374
|
+
if (!a) return null;
|
|
7375
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
7376
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
7377
|
+
hour: 12,
|
|
7378
|
+
minute: o,
|
|
7379
|
+
second: s,
|
|
7380
|
+
meridiem: "AM"
|
|
7381
|
+
};
|
|
7382
|
+
}
|
|
7383
|
+
_parseSingleOutput24(e) {
|
|
7384
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
7385
|
+
if (t) {
|
|
7386
|
+
let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
|
|
7387
|
+
if (!e) return null;
|
|
7388
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
|
|
7389
|
+
if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
|
|
7390
|
+
let s = t >= 12 ? "PM" : "AM";
|
|
7391
|
+
return {
|
|
7392
|
+
hour: t % 12 == 0 ? 12 : t % 12,
|
|
7393
|
+
minute: a,
|
|
7394
|
+
second: o,
|
|
7395
|
+
meridiem: s
|
|
7396
|
+
};
|
|
7397
|
+
}
|
|
7398
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
7399
|
+
if (!a) return null;
|
|
7400
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
7401
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
7402
|
+
hour: 12,
|
|
7403
|
+
minute: o,
|
|
7404
|
+
second: s,
|
|
7405
|
+
meridiem: "AM"
|
|
7406
|
+
};
|
|
7407
|
+
}
|
|
7408
|
+
_parseAndApplyValue(e) {
|
|
7409
|
+
if (!e) return !1;
|
|
7410
|
+
if (this.isRange()) {
|
|
7411
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingleOutput24(t || ""), i = this._parseSingleOutput24(n || "");
|
|
7412
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
7413
|
+
}
|
|
7414
|
+
let t = this._parseSingleOutput24(e);
|
|
7415
|
+
return t ? (this._single = t, !0) : !1;
|
|
7416
|
+
}
|
|
7417
|
+
_parseAndApplyDisplayValue(e) {
|
|
7418
|
+
if (!e) return !1;
|
|
7419
|
+
if (this.isRange()) {
|
|
7420
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
|
|
7421
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
7422
|
+
}
|
|
7423
|
+
let t = this._parseSingle(e);
|
|
7424
|
+
return t ? (this._single = t, !0) : !1;
|
|
7425
|
+
}
|
|
7426
|
+
_handleTypedValue(e) {
|
|
7427
|
+
let t = e.trim();
|
|
7428
|
+
if (!t) {
|
|
7429
|
+
this._invalidFromInput = !1, this.removeAttribute("value"), this._syncHiddenInput(), this._syncInputValue();
|
|
7430
|
+
return;
|
|
7431
|
+
}
|
|
7432
|
+
if (!this._parseAndApplyDisplayValue(t)) {
|
|
7433
|
+
this._invalidFromInput = !0, this.removeAttribute("value"), this._inputEl && (this._inputEl.value = ""), this._syncHiddenInput(), this.render(), this.dispatchEvent(new Event("input", {
|
|
7434
|
+
bubbles: !0,
|
|
7435
|
+
composed: !0
|
|
7436
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7437
|
+
return;
|
|
7438
|
+
}
|
|
7439
|
+
this._invalidFromInput = !1;
|
|
7440
|
+
let n = this._getOutputValue();
|
|
7441
|
+
this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
7442
|
+
bubbles: !0,
|
|
7443
|
+
composed: !0
|
|
7444
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7445
|
+
}
|
|
7446
|
+
_buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
|
|
7447
|
+
let o = document.createElement("div");
|
|
7448
|
+
return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
|
|
7449
|
+
let r = document.createElement("button");
|
|
7450
|
+
r.type = "button";
|
|
7451
|
+
let i = e === t;
|
|
7452
|
+
r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
|
|
7453
|
+
}), o;
|
|
7454
|
+
}
|
|
7455
|
+
_centerSelectedInColumn(e) {
|
|
7456
|
+
let t = e.querySelector("button[data-selected=\"true\"]");
|
|
7457
|
+
if (!t) return;
|
|
7458
|
+
let n = t.offsetTop - e.offsetTop - (e.clientHeight / 2 - t.offsetHeight / 2), r = Math.max(0, Math.min(e.scrollHeight - e.clientHeight, n));
|
|
7459
|
+
e.scrollTo({
|
|
7460
|
+
top: r,
|
|
7461
|
+
behavior: "instant"
|
|
7462
|
+
});
|
|
7463
|
+
}
|
|
7464
|
+
_centerAllColumnsInPopoverBody() {
|
|
7465
|
+
let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
7466
|
+
e && Array.from(e.querySelectorAll(".mint-time-picker-column")).forEach((e) => this._centerSelectedInColumn(e));
|
|
7467
|
+
}
|
|
7468
|
+
_setupPopoverOpenObserver() {
|
|
7469
|
+
this._popover && (this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._popoverObserver = new MutationObserver(() => {
|
|
7470
|
+
this._popover?.getAttribute("open") === "true" && requestAnimationFrame(() => {
|
|
7471
|
+
requestAnimationFrame(() => {
|
|
7472
|
+
this._centerAllColumnsInPopoverBody();
|
|
7473
|
+
});
|
|
7474
|
+
});
|
|
7475
|
+
}), this._popoverObserver.observe(this._popover, {
|
|
7476
|
+
attributes: !0,
|
|
7477
|
+
attributeFilter: ["open"]
|
|
7478
|
+
}));
|
|
7479
|
+
}
|
|
7480
|
+
_buildPickerSet(e, t, n) {
|
|
7481
|
+
let r = this.isHoursEnabled(), i = this.isMinutesEnabled(), a = this.isSecondsEnabled(), o = document.createElement("div"), s = (r ? 1 : 0) + (i ? 1 : 0) + (a ? 1 : 0) + (r ? 1 : 0);
|
|
7482
|
+
o.className = "mint-time-picker-wheel", o.style.gridTemplateColumns = `repeat(${Math.max(s, 1)}, minmax(0, 1fr))`;
|
|
7483
|
+
let c = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), l = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), u = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), d = ["AM", "PM"], f = [];
|
|
7484
|
+
r && f.push(this._buildColumn(c, t.hour.toString().padStart(2, "0"), (e) => {
|
|
7485
|
+
n({
|
|
7486
|
+
...t,
|
|
7487
|
+
hour: Number(e)
|
|
7488
|
+
});
|
|
7489
|
+
}, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
|
|
7490
|
+
n({
|
|
7491
|
+
...t,
|
|
7492
|
+
minute: Number(e)
|
|
7493
|
+
});
|
|
7494
|
+
}, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
|
|
7495
|
+
n({
|
|
7496
|
+
...t,
|
|
7497
|
+
second: Number(e)
|
|
7498
|
+
});
|
|
7499
|
+
}, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
|
|
7500
|
+
n({
|
|
7501
|
+
...t,
|
|
7502
|
+
meridiem: e
|
|
7503
|
+
});
|
|
7504
|
+
}, !0, "tall", "Meridiem")), f.forEach((e, t) => {
|
|
7505
|
+
t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
|
|
7506
|
+
}), e.appendChild(o);
|
|
7507
|
+
}
|
|
7508
|
+
_buildPopoverContent(e) {
|
|
7509
|
+
if (e.innerHTML = "", !this.isRange()) {
|
|
7510
|
+
this._buildPickerSet(e, this._single, (t) => {
|
|
7511
|
+
this._single = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7512
|
+
}), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody());
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
let t = document.createElement("div");
|
|
7516
|
+
t.className = "mint-time-picker-range";
|
|
7517
|
+
let n = document.createElement("div"), r = document.createElement("mint-text");
|
|
7518
|
+
r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
|
|
7519
|
+
this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7520
|
+
});
|
|
7521
|
+
let i = document.createElement("div"), a = document.createElement("mint-text");
|
|
7522
|
+
a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
|
|
7523
|
+
this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7524
|
+
}), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
|
|
7525
|
+
this._centerAllColumnsInPopoverBody();
|
|
7526
|
+
});
|
|
7527
|
+
}
|
|
7528
|
+
render() {
|
|
7529
|
+
let e = this.isDisabled(), t = this.isReadonly(), n = this._getEffectiveError();
|
|
7530
|
+
this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null), this.innerHTML = "";
|
|
7531
|
+
let r = document.createElement("div");
|
|
7532
|
+
r.className = "mint-time-picker-control";
|
|
7533
|
+
let i = this.getAttribute("inline") === "true";
|
|
7534
|
+
i || (this._inputEl = document.createElement("mint-input"), this._inputEl.id = this._triggerId, this._inputEl.classList.add("mint-time-picker-trigger"), this._inputEl.setAttribute("type", "text"), this._inputEl.setAttribute("icon", "clock"), this._inputEl.setAttribute("placeholder", this._getExpectedFormat()), this._inputEl.setAttribute("label", this.getLabel()), this._inputEl.setAttribute("info", this.getInfo()), this._inputEl.setAttribute("value", this._getDisplayValue()), this._inputEl.setAttribute("error", n.hasError ? "true" : "false"), this._inputEl.setAttribute("error-message", n.message || ""), e && this._inputEl.setAttribute("disabled", "true"), t && this._inputEl.setAttribute("readonly", "true"), this._inputEl.addEventListener("change", (n) => {
|
|
7535
|
+
if (e || t) return;
|
|
7536
|
+
let r = n.target;
|
|
7537
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
7538
|
+
}), this._inputEl.addEventListener("blur", (n) => {
|
|
7539
|
+
if (e || t) return;
|
|
7540
|
+
let r = n.target;
|
|
7541
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
7542
|
+
}, !0), r.appendChild(this._inputEl)), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput();
|
|
7543
|
+
let a = document.createElement("div");
|
|
7544
|
+
if (a.setAttribute("data-mint-time-picker-body", "true"), a.className = "mint-time-picker-popover", this._buildPopoverContent(a), i ? (this._popover = null, r.appendChild(a), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody())) : (this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false"), this._popover.appendChild(a), r.appendChild(this._popover), this._setupPopoverOpenObserver()), this.appendChild(r), !i && this._inputEl) {
|
|
7545
|
+
let e = this._inputEl;
|
|
7546
|
+
this._triggerClickObserver = (t) => {
|
|
7547
|
+
t.composedPath().includes(e) && requestAnimationFrame(() => {
|
|
7548
|
+
requestAnimationFrame(() => {
|
|
7549
|
+
this._popover?.getAttribute("open") === "true" && this._centerAllColumnsInPopoverBody();
|
|
7550
|
+
});
|
|
7551
|
+
});
|
|
7552
|
+
}, document.addEventListener("click", this._triggerClickObserver, !0);
|
|
7553
|
+
}
|
|
7554
|
+
}
|
|
7555
|
+
};
|
|
7556
|
+
customElements.get("mint-time-picker") || a("mint-time-picker", Ln);
|
|
7557
|
+
//#endregion
|
|
7558
|
+
//#region src/components/datetime-picker/DateTimePicker.ts
|
|
7559
|
+
var Rn = class extends HTMLElement {
|
|
7560
|
+
constructor(...e) {
|
|
7561
|
+
super(...e), this._datePicker = null, this._timePicker = null, this._content = null, this._popoverContent = null, this._popoverObserver = null, this._hiddenInput = null, this._dateValue = "", this._timeValue = "", this._dateStageComplete = !1, this._ready = !1, this._writingValue = !1, this._displayControlBound = !1;
|
|
7562
|
+
}
|
|
7563
|
+
static get observedAttributes() {
|
|
7564
|
+
return [
|
|
7565
|
+
"value",
|
|
7566
|
+
"label",
|
|
7567
|
+
"info",
|
|
7568
|
+
"name",
|
|
7569
|
+
"required",
|
|
7570
|
+
"disabled",
|
|
7571
|
+
"readonly",
|
|
7572
|
+
"format",
|
|
7573
|
+
"display-format",
|
|
7574
|
+
"min",
|
|
7575
|
+
"max",
|
|
7576
|
+
"shortcuts",
|
|
7577
|
+
"hours",
|
|
7578
|
+
"minutes",
|
|
7579
|
+
"seconds",
|
|
7580
|
+
"error",
|
|
7581
|
+
"error-message"
|
|
7582
|
+
];
|
|
7583
|
+
}
|
|
7584
|
+
connectedCallback() {
|
|
7585
|
+
this.classList.add("mint-datetime-picker"), this._readValue(this.getAttribute("value") || ""), this.render(), this._ready = !0;
|
|
7586
|
+
}
|
|
7587
|
+
attributeChangedCallback(e, t, n) {
|
|
7588
|
+
if (!(t === n || !this._ready || e === "value" && this._writingValue)) {
|
|
7589
|
+
if (e === "value") {
|
|
7590
|
+
this._readValue(n || ""), this.render();
|
|
7591
|
+
return;
|
|
7592
|
+
}
|
|
7593
|
+
if (e === "error" || e === "error-message") {
|
|
7594
|
+
this._syncState();
|
|
7595
|
+
return;
|
|
7596
|
+
}
|
|
7597
|
+
this.render();
|
|
7598
|
+
}
|
|
7599
|
+
}
|
|
7600
|
+
get value() {
|
|
7601
|
+
return this.getAttribute("value") || "";
|
|
7602
|
+
}
|
|
7603
|
+
set value(e) {
|
|
7604
|
+
this.setValue(e || "");
|
|
7605
|
+
}
|
|
7606
|
+
getValue() {
|
|
7607
|
+
return this.getAttribute("value") || "";
|
|
7608
|
+
}
|
|
7609
|
+
setValue(e) {
|
|
7610
|
+
this._readValue(e), this._writingValue = !0, e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._writingValue = !1, this.render(), this._syncState();
|
|
7611
|
+
}
|
|
7612
|
+
_parseDate(e, t) {
|
|
7613
|
+
let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
7614
|
+
if (n) return new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3]));
|
|
7615
|
+
let r = {
|
|
7616
|
+
yyyy: "(\\d{4})",
|
|
7617
|
+
yy: "(\\d{2})",
|
|
7618
|
+
Y: "(\\d{4})",
|
|
7619
|
+
y: "(\\d{2})",
|
|
7620
|
+
mm: "(\\d{1,2})",
|
|
7621
|
+
m: "(\\d{1,2})",
|
|
7622
|
+
n: "(\\d{1,2})",
|
|
7623
|
+
dd: "(\\d{1,2})",
|
|
7624
|
+
d: "(\\d{1,2})",
|
|
7625
|
+
j: "(\\d{1,2})",
|
|
7626
|
+
M: "([A-Za-z]+)",
|
|
7627
|
+
F: "([A-Za-z]+)"
|
|
7628
|
+
}, i = Object.keys(r).sort((e, t) => t.length - e.length), a = [], o = "^";
|
|
7629
|
+
for (let e = 0; e < t.length;) {
|
|
7630
|
+
let n = i.find((n) => t.startsWith(n, e));
|
|
7631
|
+
n ? (o += r[n], a.push(n), e += n.length) : (o += t[e].replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), e++);
|
|
7632
|
+
}
|
|
7633
|
+
let s = e.match(RegExp(`${o}$`, "i"));
|
|
7634
|
+
if (!s) return null;
|
|
7635
|
+
let c = 2e3, l = 1, u = 1;
|
|
7636
|
+
a.forEach((e, t) => {
|
|
7637
|
+
let n = s[t + 1];
|
|
7638
|
+
if (e === "Y" || e === "yyyy") c = Number(n);
|
|
7639
|
+
else if (e === "y" || e === "yy") c = Number(n) + 2e3;
|
|
7640
|
+
else if (e === "m" || e === "mm" || e === "n") l = Number(n);
|
|
7641
|
+
else if (e === "d" || e === "dd" || e === "j") u = Number(n);
|
|
7642
|
+
else if (e === "M" || e === "F") {
|
|
7643
|
+
let e = (/* @__PURE__ */ new Date(`${n} 1, 2000`)).getMonth();
|
|
7644
|
+
Number.isNaN(e) || (l = e + 1);
|
|
7645
|
+
}
|
|
7646
|
+
});
|
|
7647
|
+
let d = new Date(c, l - 1, u);
|
|
7648
|
+
return d.getFullYear() === c && d.getMonth() === l - 1 && d.getDate() === u ? d : null;
|
|
7649
|
+
}
|
|
7650
|
+
_formatDate(e, t) {
|
|
7651
|
+
let n = (e) => String(e).padStart(2, "0"), r = {
|
|
7652
|
+
Y: String(e.getFullYear()),
|
|
7653
|
+
yyyy: String(e.getFullYear()),
|
|
7654
|
+
yy: String(e.getFullYear()).slice(-2),
|
|
7655
|
+
y: String(e.getFullYear()).slice(-2),
|
|
7656
|
+
mm: n(e.getMonth() + 1),
|
|
7657
|
+
m: n(e.getMonth() + 1),
|
|
7658
|
+
n: String(e.getMonth() + 1),
|
|
7659
|
+
dd: n(e.getDate()),
|
|
7660
|
+
d: n(e.getDate()),
|
|
7661
|
+
j: String(e.getDate()),
|
|
7662
|
+
M: e.toLocaleString(void 0, { month: "short" }),
|
|
7663
|
+
F: e.toLocaleString(void 0, { month: "long" })
|
|
7664
|
+
};
|
|
7665
|
+
return t.replace(/yyyy|yy|mm|dd|Y|y|m|n|d|j|M|F/g, (e) => r[e]);
|
|
7666
|
+
}
|
|
7667
|
+
_readValue(e) {
|
|
7668
|
+
let [t = "", n = ""] = e.split(/[T ]/), r = this._parseDate(t, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7669
|
+
this._dateValue = r ? this._formatDate(r, this.getAttribute("format") || "mm/dd/yyyy") : "", this._timeValue = n || "", this._dateStageComplete = !!r;
|
|
7670
|
+
}
|
|
7671
|
+
_toISODate() {
|
|
7672
|
+
let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7673
|
+
return e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : "";
|
|
7674
|
+
}
|
|
7675
|
+
_syncValue(e = !1) {
|
|
7676
|
+
let t = this._toISODate(), n = this._timeValue, r = t && n ? `${t}T${n}` : "";
|
|
7677
|
+
this._writingValue = !0, r ? this.setAttribute("value", r) : this.removeAttribute("value"), this._writingValue = !1, this._hiddenInput && (this._hiddenInput.value = r), e && r && (this.dispatchEvent(new Event("input", {
|
|
7678
|
+
bubbles: !0,
|
|
7679
|
+
composed: !0
|
|
7680
|
+
})), this.dispatchEvent(new CustomEvent("change", {
|
|
7681
|
+
detail: { value: r },
|
|
7682
|
+
bubbles: !0,
|
|
7683
|
+
composed: !0
|
|
7684
|
+
})));
|
|
7685
|
+
}
|
|
7686
|
+
_syncState() {
|
|
7687
|
+
this._datePicker && (this._datePicker.setAttribute("value", this._dateValue), this._datePicker.setAttribute("error", this.getAttribute("error") || "false"), this._datePicker.setAttribute("error-message", this.getAttribute("error-message") || ""), this._timePicker?.setAttribute("error", this.getAttribute("error") || "false"), this._timePicker?.setAttribute("error-message", this.getAttribute("error-message") || ""), this._hiddenInput && (this._hiddenInput.value = this.getValue()), this._syncCombinedDisplay());
|
|
7688
|
+
}
|
|
7689
|
+
render() {
|
|
7690
|
+
let e = this.getAttribute("label") || "", t = this.getAttribute("info") || "", n = this.getAttribute("format") || "mm/dd/yyyy", r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
|
|
7691
|
+
this._displayControlBound = !1;
|
|
7692
|
+
let a = document.createElement("mint-date-picker");
|
|
7693
|
+
a.setAttribute("class", "mint-datetime-picker-date"), a.setAttribute("keep-open-on-select", "true"), a.setAttribute("format", n), a.setAttribute("value", this._dateValue), a.setAttribute("label", e), a.setAttribute("info", t), a.setAttribute("display-format", this.getAttribute("display-format") || "F j, Y");
|
|
7694
|
+
for (let e of [
|
|
7695
|
+
"min",
|
|
7696
|
+
"max",
|
|
7697
|
+
"shortcuts"
|
|
7698
|
+
]) this.hasAttribute(e) && a.setAttribute(e, this.getAttribute(e) || "");
|
|
7699
|
+
r && a.setAttribute("disabled", "true"), i && a.setAttribute("readonly", "true"), this.hasAttribute("required") && a.setAttribute("required", this.getAttribute("required") || "true"), this.hasAttribute("error") && a.setAttribute("error", this.getAttribute("error") || "false"), this.hasAttribute("error-message") && a.setAttribute("error-message", this.getAttribute("error-message") || ""), a.addEventListener("change", (e) => {
|
|
7700
|
+
e.stopPropagation();
|
|
7701
|
+
let t = e.detail?.value || a.value || "";
|
|
7702
|
+
this._parseDate(t, n) && (this._dateValue = t, this._dateStageComplete = !0, this._syncValue(!1), this._syncCombinedDisplay(), this._openTimeStage());
|
|
7703
|
+
}), this._datePicker = a, this._bindCombinedDisplayControl();
|
|
7704
|
+
let o = document.createElement("div");
|
|
7705
|
+
o.className = "mint-datetime-picker-content", this._content = o, this.innerHTML = "", this.appendChild(o), o.appendChild(a), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getAttribute("name") || "", this._hiddenInput.value = this.getValue(), this.appendChild(this._hiddenInput), this._waitForPopover();
|
|
7706
|
+
}
|
|
7707
|
+
_getPopover() {
|
|
7708
|
+
let e = this._datePicker, t = e?.getPopoverElement?.() || e?._popover;
|
|
7709
|
+
if (t) return t;
|
|
7710
|
+
let n = e?.querySelector?.(".mint-date-picker-icon-button")?.id;
|
|
7711
|
+
return n ? document.querySelector(`mint-popover[trigger-id="${CSS.escape(n)}"]`) : null;
|
|
7712
|
+
}
|
|
7713
|
+
_getPopoverContent(e) {
|
|
7714
|
+
return e.querySelector(".popover-content") || e;
|
|
7715
|
+
}
|
|
7716
|
+
_waitForPopover(e = 0) {
|
|
7717
|
+
let t = this._getPopover();
|
|
7718
|
+
if (!t) {
|
|
7719
|
+
e < 120 && requestAnimationFrame(() => this._waitForPopover(e + 1));
|
|
7720
|
+
return;
|
|
7721
|
+
}
|
|
7722
|
+
this._popoverContent = this._datePicker?.getPopoverContentElement?.() || this._getPopoverContent(t), this._bindCombinedDisplayControl(), this._popoverObserver?.disconnect(), this._popoverObserver = new MutationObserver(() => {
|
|
7723
|
+
t.getAttribute("open") === "true" && this._dateStageComplete && requestAnimationFrame(() => requestAnimationFrame(() => this._renderTimeStage()));
|
|
7724
|
+
}), this._popoverObserver.observe(t, {
|
|
7725
|
+
attributes: !0,
|
|
7726
|
+
attributeFilter: ["open"]
|
|
7727
|
+
}), t.getAttribute("open") === "true" && this._dateStageComplete && this._renderTimeStage();
|
|
7728
|
+
}
|
|
7729
|
+
_bindCombinedDisplayControl() {
|
|
7730
|
+
if (this._displayControlBound || !this._datePicker) return;
|
|
7731
|
+
this._displayControlBound = !0;
|
|
7732
|
+
let e = (e) => {
|
|
7733
|
+
if (!e.target?.closest(".mint-date-picker-field") || this.getAttribute("disabled") === "true" || this.getAttribute("readonly") === "true" || e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ") return;
|
|
7734
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
7735
|
+
let t = this._getPopover();
|
|
7736
|
+
t?.open ? t.open() : t?.setAttribute("open", "true");
|
|
7737
|
+
};
|
|
7738
|
+
this._datePicker.addEventListener("click", e, !0), this._datePicker.addEventListener("keydown", e, !0);
|
|
7739
|
+
}
|
|
7740
|
+
_openTimeStage() {
|
|
7741
|
+
queueMicrotask(() => this._renderTimeStage());
|
|
7742
|
+
}
|
|
7743
|
+
_renderTimeStage() {
|
|
7744
|
+
if (!this._popoverContent || !this._dateStageComplete) return;
|
|
7745
|
+
let e = document.createElement("div");
|
|
7746
|
+
e.className = "mint-datetime-picker-panel";
|
|
7747
|
+
let t = document.createElement("button");
|
|
7748
|
+
t.type = "button", t.className = "mint-datetime-picker-time-heading", t.setAttribute("aria-label", `Change date, ${this._dateValue}`), t.textContent = this._getFormattedDate(), t.addEventListener("click", () => {
|
|
7749
|
+
let e = this._datePicker;
|
|
7750
|
+
typeof e?.refreshCalendar == "function" ? e.refreshCalendar() : e?._buildCalendar?.();
|
|
7751
|
+
});
|
|
7752
|
+
let n = document.createElement("mint-time-picker"), r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
|
|
7753
|
+
n.setAttribute("inline", "true"), n.setAttribute("value", this._timeValue || "09:00"), n.setAttribute("label", "");
|
|
7754
|
+
for (let e of [
|
|
7755
|
+
"hours",
|
|
7756
|
+
"minutes",
|
|
7757
|
+
"seconds"
|
|
7758
|
+
]) this.hasAttribute(e) && n.setAttribute(e, this.getAttribute(e) || "");
|
|
7759
|
+
r && n.setAttribute("disabled", "true"), i && n.setAttribute("readonly", "true"), n.addEventListener("change", () => {
|
|
7760
|
+
this._timeValue = n.getValue?.() || n.getAttribute("value") || "", this._syncValue(!0), this._syncCombinedDisplay();
|
|
7761
|
+
}), n.addEventListener("change", (e) => e.stopPropagation()), n.addEventListener("input", (e) => e.stopPropagation()), this._timePicker = n, e.appendChild(t), e.appendChild(n), this._popoverContent.replaceChildren(e);
|
|
7762
|
+
}
|
|
7763
|
+
_syncCombinedDisplay() {
|
|
7764
|
+
let e = this._datePicker?.getDisplayElement?.() || this._datePicker?.querySelector(".mint-date-picker-display");
|
|
7765
|
+
if (!e || !this._dateValue) return;
|
|
7766
|
+
let t = this._getFormattedDate();
|
|
7767
|
+
e.textContent = this._timeValue ? `${t} · ${this._formatTime(this._timeValue)}` : t, e.setAttribute("aria-label", `${this.getAttribute("label") || "Date and time"}: ${e.textContent}`);
|
|
7768
|
+
}
|
|
7769
|
+
_getFormattedDate() {
|
|
7770
|
+
let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7771
|
+
return e ? this._formatDate(e, this.getAttribute("display-format") || "F j, Y") : this._dateValue;
|
|
7772
|
+
}
|
|
7773
|
+
_formatTime(e) {
|
|
7774
|
+
let [t = "00", n = "00", r] = e.split(":"), i = Number(t), a = this.getAttribute("hours") !== "false", o = this.getAttribute("minutes") !== "false", s = this.getAttribute("seconds") === "true";
|
|
7775
|
+
if (!a) return [o ? n : "", s ? r || "00" : ""].filter(Boolean).join(":");
|
|
7776
|
+
let c = i % 12 || 12;
|
|
7777
|
+
return `${[
|
|
7778
|
+
String(c),
|
|
7779
|
+
o ? n : "",
|
|
7780
|
+
s ? r || "00" : ""
|
|
7781
|
+
].filter(Boolean).join(":")} ${i >= 12 ? "pm" : "am"}`;
|
|
7782
|
+
}
|
|
7783
|
+
};
|
|
7784
|
+
customElements.get("mint-datetime-picker") || a("mint-datetime-picker", Rn), s({
|
|
7785
|
+
name: "upload",
|
|
7786
|
+
viewBox: "0 0 24 24",
|
|
7787
|
+
path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
|
|
7788
|
+
strokeLinecap: "round",
|
|
7789
|
+
strokeLinejoin: "round"
|
|
7790
|
+
}), s({
|
|
7791
|
+
name: "attach",
|
|
7792
|
+
viewBox: "0 0 24 24",
|
|
7793
|
+
path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
|
|
7794
|
+
strokeLinecap: "round",
|
|
7795
|
+
strokeLinejoin: "round"
|
|
7796
|
+
});
|
|
7797
|
+
//#endregion
|
|
7798
|
+
//#region src/components/dropzone/Dropzone.ts
|
|
7799
|
+
var zn = class extends HTMLElement {
|
|
7800
|
+
static get observedAttributes() {
|
|
7801
|
+
return [
|
|
7802
|
+
"label",
|
|
7803
|
+
"accept",
|
|
7804
|
+
"multiple",
|
|
7805
|
+
"width",
|
|
7806
|
+
"height",
|
|
7807
|
+
"disabled",
|
|
7808
|
+
"name",
|
|
7809
|
+
"error",
|
|
7810
|
+
"error-message",
|
|
7811
|
+
"loading",
|
|
7812
|
+
"aria-label",
|
|
7813
|
+
"aria-describedby"
|
|
7814
|
+
];
|
|
7815
|
+
}
|
|
7816
|
+
constructor() {
|
|
7817
|
+
super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
|
|
7818
|
+
}
|
|
7819
|
+
connectedCallback() {
|
|
7820
|
+
this.classList.add("mint-dropzone"), this.render(), this._attachFormResetListener();
|
|
7821
|
+
}
|
|
7822
|
+
disconnectedCallback() {
|
|
7823
|
+
if (this.removeEventListeners(), this._cleanupPreviewUrls(), this._resetHandler) {
|
|
7824
|
+
let e = this.closest("form");
|
|
7825
|
+
e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
|
|
7826
|
+
}
|
|
7827
|
+
}
|
|
7828
|
+
attributeChangedCallback(e, t, n) {
|
|
7829
|
+
if (t !== n) {
|
|
7830
|
+
if (e === "error" || e === "error-message") {
|
|
7831
|
+
this._updateDragStateClass(), this._renderErrorState(this.hasError(), this.getErrorMessage());
|
|
7832
|
+
return;
|
|
7833
|
+
}
|
|
7834
|
+
if (e === "loading") {
|
|
7835
|
+
this.render();
|
|
7836
|
+
return;
|
|
7837
|
+
}
|
|
7838
|
+
this.render();
|
|
7839
|
+
}
|
|
7840
|
+
}
|
|
7841
|
+
getLabel() {
|
|
7842
|
+
return this.getAttribute("label") || "";
|
|
7843
|
+
}
|
|
7844
|
+
getAccept() {
|
|
7845
|
+
return this.getAttribute("accept") || "";
|
|
7846
|
+
}
|
|
7847
|
+
isMultiple() {
|
|
7848
|
+
return this.getAttribute("multiple") === "true";
|
|
7849
|
+
}
|
|
7850
|
+
getWidth() {
|
|
7851
|
+
return this.getAttribute("width") || "200px";
|
|
7852
|
+
}
|
|
7853
|
+
getHeight() {
|
|
7854
|
+
return this.getAttribute("height") || "200px";
|
|
7855
|
+
}
|
|
7856
|
+
_renderSkeleton(e) {
|
|
7857
|
+
let t = this.querySelector(".mint-dropzone-skeleton-container"), n = this._dropzone;
|
|
7858
|
+
if (e) {
|
|
7859
|
+
this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
|
|
7860
|
+
let e = t.querySelector(".mint-dropzone-skeleton");
|
|
7861
|
+
e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
|
|
7862
|
+
} else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
|
|
7863
|
+
}
|
|
7864
|
+
getName() {
|
|
7865
|
+
return this.getAttribute("name") || "";
|
|
7866
|
+
}
|
|
7867
|
+
hasError() {
|
|
7868
|
+
return this.getAttribute("error") === "true";
|
|
7869
|
+
}
|
|
7870
|
+
getErrorMessage() {
|
|
7871
|
+
return this.getAttribute("error-message") || "";
|
|
7872
|
+
}
|
|
7873
|
+
isDisabled() {
|
|
7874
|
+
return this.getAttribute("disabled") === "true";
|
|
7875
|
+
}
|
|
7876
|
+
isLoading() {
|
|
7877
|
+
return this.getAttribute("loading") === "true";
|
|
7878
|
+
}
|
|
7879
|
+
render() {
|
|
7880
|
+
let e = this.isLoading(), t = this.getLabel(), n = this.getAccept(), r = this.isMultiple(), i = this.isDisabled(), a = this.getWidth(), o = this.getHeight(), s = this.getName(), c = this.hasError(), l = this.getErrorMessage();
|
|
7881
|
+
if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
|
|
7882
|
+
else {
|
|
7883
|
+
this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
|
|
7884
|
+
let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
|
|
7885
|
+
n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7886
|
+
}
|
|
7887
|
+
this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
|
|
7888
|
+
let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
|
|
7889
|
+
u && u.remove(), d && d.remove();
|
|
7890
|
+
let f = document.createElement("div");
|
|
7891
|
+
f.className = "mint-dropzone-icon";
|
|
7892
|
+
let p = document.createElement("mint-icon");
|
|
7893
|
+
if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
|
|
7894
|
+
let e = document.createElement("div");
|
|
7895
|
+
e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
|
|
7896
|
+
}
|
|
7897
|
+
this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
|
|
7898
|
+
}
|
|
7899
|
+
_updateDragState() {
|
|
7900
|
+
this._dropzone && this._updateDragStateClass();
|
|
7901
|
+
}
|
|
7902
|
+
_renderErrorState(e, t) {
|
|
7903
|
+
let n = this.querySelector(".mint-dropzone-error");
|
|
7904
|
+
if (e && t ? (n || (n = document.createElement("div"), n.className = "mint-dropzone-error", this.appendChild(n)), n.textContent = t) : n && n.remove(), this._dropzone) {
|
|
7905
|
+
this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
|
|
7906
|
+
let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
7907
|
+
n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7908
|
+
}
|
|
7909
|
+
}
|
|
7910
|
+
_updateDragStateClass() {
|
|
7911
|
+
if (!this._dropzone) return;
|
|
7912
|
+
let e = this.isDisabled(), t = this.hasError();
|
|
7913
|
+
this._dropzone.className = "mint-dropzone-target", this._dropzone.classList.toggle("has-files", this._selectedFiles.length > 0), this._dropzone.classList.toggle("is-dragging", this._isDragging), this._dropzone.classList.toggle("has-error", t), this._dropzone.classList.toggle("is-disabled", e);
|
|
7914
|
+
}
|
|
7915
|
+
setupEventListeners() {
|
|
7916
|
+
this._listenersInitialized || (this._listenersInitialized = !0, this.removeEventListeners(), !(!this._dropzone || !this._fileInput || this.isDisabled()) && (this._onDropzoneClick ||= (e) => {
|
|
7917
|
+
if (!(this.isDisabled() || !this._fileInput) && e.target !== this._fileInput && (e.stopPropagation(), e.preventDefault(), e.isTrusted)) try {
|
|
7918
|
+
this._fileInput.click();
|
|
7919
|
+
} catch (e) {
|
|
7920
|
+
console.debug("File chooser blocked:", e);
|
|
7921
|
+
}
|
|
7922
|
+
}, this._onDragOver ||= (e) => {
|
|
7923
|
+
e.preventDefault(), e.stopPropagation(), this.isDisabled() || this._isDragging || (this._isDragging = !0, this._wasDragging = !0, this._updateDragState());
|
|
7924
|
+
}, this._onDragLeave ||= (e) => {
|
|
7925
|
+
e.preventDefault(), e.stopPropagation();
|
|
7926
|
+
let t = this._dropzone?.getBoundingClientRect();
|
|
7927
|
+
t && (e.clientX < t.left || e.clientX > t.right || e.clientY < t.top || e.clientY > t.bottom) && this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState());
|
|
7928
|
+
}, this._onDrop ||= (e) => {
|
|
7929
|
+
if (e.preventDefault(), e.stopPropagation(), this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState()), this.isDisabled()) return;
|
|
7930
|
+
let t = e.dataTransfer?.files;
|
|
7931
|
+
t && t.length > 0 && this._handleFiles(t);
|
|
7932
|
+
}, this._onFileInputInput ||= (e) => {
|
|
7933
|
+
e.stopImmediatePropagation(), e.stopPropagation();
|
|
7934
|
+
}, this._onKeyDown ||= (e) => {
|
|
7935
|
+
if (!(this.isDisabled() || !this._fileInput) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.isTrusted)) try {
|
|
7936
|
+
this._fileInput.click();
|
|
7937
|
+
} catch (e) {
|
|
7225
7938
|
console.debug("File chooser blocked:", e);
|
|
7226
7939
|
}
|
|
7227
7940
|
}, this._onFocus ||= (e) => {
|
|
@@ -7401,10 +8114,10 @@ var Fn = class extends HTMLElement {
|
|
|
7401
8114
|
return this._selectedFiles.some((t) => t.name === e.name && t.size === e.size && t.lastModified === e.lastModified);
|
|
7402
8115
|
}
|
|
7403
8116
|
};
|
|
7404
|
-
customElements.get("mint-dropzone") || a("mint-dropzone",
|
|
8117
|
+
customElements.get("mint-dropzone") || a("mint-dropzone", zn);
|
|
7405
8118
|
//#endregion
|
|
7406
8119
|
//#region src/components/form/Form.ts
|
|
7407
|
-
var
|
|
8120
|
+
var Bn = class extends HTMLElement {
|
|
7408
8121
|
static get observedAttributes() {
|
|
7409
8122
|
return [
|
|
7410
8123
|
"action",
|
|
@@ -7759,6 +8472,7 @@ var In = class extends HTMLElement {
|
|
|
7759
8472
|
"mint-input[name]",
|
|
7760
8473
|
"mint-select[name]",
|
|
7761
8474
|
"mint-date-picker[name]",
|
|
8475
|
+
"mint-datetime-picker[name]",
|
|
7762
8476
|
"mint-time-picker[name]",
|
|
7763
8477
|
"mint-dropzone[name]",
|
|
7764
8478
|
"mint-checkbox[name]",
|
|
@@ -8085,7 +8799,7 @@ var In = class extends HTMLElement {
|
|
|
8085
8799
|
});
|
|
8086
8800
|
}
|
|
8087
8801
|
_resetCustomFields() {
|
|
8088
|
-
this.querySelectorAll("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8802
|
+
this.querySelectorAll("mint-input, mint-date-picker, mint-datetime-picker, mint-time-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8089
8803
|
e.removeAttribute("error"), e.removeAttribute("error-message");
|
|
8090
8804
|
let t = e.tagName;
|
|
8091
8805
|
if (t === "MINT-INPUT") try {
|
|
@@ -8123,7 +8837,7 @@ var In = class extends HTMLElement {
|
|
|
8123
8837
|
let t = e.closest("mint-choice");
|
|
8124
8838
|
if (t) return t;
|
|
8125
8839
|
}
|
|
8126
|
-
return e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
|
|
8840
|
+
return e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
|
|
8127
8841
|
}
|
|
8128
8842
|
_setupBlurValidation() {
|
|
8129
8843
|
if (!this._form) return;
|
|
@@ -8134,7 +8848,7 @@ var In = class extends HTMLElement {
|
|
|
8134
8848
|
if (!n) return;
|
|
8135
8849
|
let r = this._getFieldName(n);
|
|
8136
8850
|
if (!r || !this._collectValidationRules()[r]) return;
|
|
8137
|
-
let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker");
|
|
8851
|
+
let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker, mint-datetime-picker");
|
|
8138
8852
|
(a || o || s || c || l) && setTimeout(() => {
|
|
8139
8853
|
this._validateField(r);
|
|
8140
8854
|
}, 0);
|
|
@@ -8193,7 +8907,7 @@ var In = class extends HTMLElement {
|
|
|
8193
8907
|
this._form.addEventListener("change", t, !0), this._form.addEventListener("input", t, !0), this._form.addEventListener("tags-change", t, !0), this._form.addEventListener("choice-change", t, !0), this._fieldChangeHandlers.set(this._form, t);
|
|
8194
8908
|
}
|
|
8195
8909
|
_findFieldElement(e) {
|
|
8196
|
-
let t = e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
|
|
8910
|
+
let t = e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
|
|
8197
8911
|
if (t && t.hasAttribute("name")) return t;
|
|
8198
8912
|
if (e.hasAttribute("name") && (e.tagName.startsWith("MINT-") || e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) || (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) && e.hasAttribute("name")) return e;
|
|
8199
8913
|
let n = e;
|
|
@@ -8245,11 +8959,11 @@ var In = class extends HTMLElement {
|
|
|
8245
8959
|
this._restoreSubmittingAttributeState();
|
|
8246
8960
|
return;
|
|
8247
8961
|
}
|
|
8248
|
-
this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8962
|
+
this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8249
8963
|
let t = e.getAttribute("disabled") === "true";
|
|
8250
8964
|
this._attrSubmittingMintFields.set(e, t), t || e.setAttribute("disabled", "true"), typeof e.render == "function" && e.render();
|
|
8251
8965
|
}), this._form.querySelectorAll("input, textarea, select").forEach((e) => {
|
|
8252
|
-
if (e.closest("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
|
|
8966
|
+
if (e.closest("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
|
|
8253
8967
|
let t = e.disabled;
|
|
8254
8968
|
this._attrSubmittingNativeFields.set(e, t), t || (e.disabled = !0);
|
|
8255
8969
|
}), Array.from(this.querySelectorAll("mint-button")).forEach((e) => {
|
|
@@ -8261,7 +8975,7 @@ var In = class extends HTMLElement {
|
|
|
8261
8975
|
let r = (e.getAttribute("type") || e.getAttribute("button-type") || "default") === "submit";
|
|
8262
8976
|
t || e.setAttribute("disabled", "true"), r && !n && e.setAttribute("loading", "true"), typeof e.render == "function" && e.render();
|
|
8263
8977
|
}), Array.from(this.querySelectorAll("button")).forEach((e) => {
|
|
8264
|
-
if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
|
|
8978
|
+
if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
|
|
8265
8979
|
let t = e.disabled;
|
|
8266
8980
|
this._attrSubmittingNativeButtons.set(e, t), t || (e.disabled = !0);
|
|
8267
8981
|
}));
|
|
@@ -8281,7 +8995,7 @@ var In = class extends HTMLElement {
|
|
|
8281
8995
|
_propagateLoadingState() {
|
|
8282
8996
|
if (!this._form) return;
|
|
8283
8997
|
let e = this.getAttribute("loading"), t = e !== null && e !== "false";
|
|
8284
|
-
Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
|
|
8998
|
+
Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
|
|
8285
8999
|
t ? e.setAttribute("loading", "true") : e.removeAttribute("loading"), typeof e.render == "function" && e.render();
|
|
8286
9000
|
});
|
|
8287
9001
|
}
|
|
@@ -8379,7 +9093,7 @@ var In = class extends HTMLElement {
|
|
|
8379
9093
|
this._reactiveDataObserver !== null && (cancelAnimationFrame(this._reactiveDataObserver), this._reactiveDataObserver = null), this._reactiveDataProxy = null, this._lastDataSnapshot = null, this._lastAppliedDataSnapshot = null;
|
|
8380
9094
|
}
|
|
8381
9095
|
};
|
|
8382
|
-
customElements.get("mint-form") || a("mint-form",
|
|
9096
|
+
customElements.get("mint-form") || a("mint-form", Bn), typeof window < "u" && (window.mintForm = window.mintForm || {
|
|
8383
9097
|
defaults: { headers: { common: {} } },
|
|
8384
9098
|
interceptors: { response: { handlers: [] } }
|
|
8385
9099
|
}, window.mintForm.interceptors.response.use || (window.mintForm.interceptors.response.use = function(e, t) {
|
|
@@ -8390,7 +9104,7 @@ customElements.get("mint-form") || a("mint-form", In), typeof window < "u" && (w
|
|
|
8390
9104
|
}));
|
|
8391
9105
|
//#endregion
|
|
8392
9106
|
//#region src/components/off-canvas/OffCanvas.ts
|
|
8393
|
-
var
|
|
9107
|
+
var Vn = class extends HTMLElement {
|
|
8394
9108
|
static get observedAttributes() {
|
|
8395
9109
|
return [
|
|
8396
9110
|
"id",
|
|
@@ -8554,7 +9268,7 @@ var Ln = class extends HTMLElement {
|
|
|
8554
9268
|
}, 300);
|
|
8555
9269
|
}
|
|
8556
9270
|
};
|
|
8557
|
-
customElements.get("mint-off-canvas") || a("mint-off-canvas",
|
|
9271
|
+
customElements.get("mint-off-canvas") || a("mint-off-canvas", Vn), s({
|
|
8558
9272
|
name: "search",
|
|
8559
9273
|
viewBox: "0 0 24 24",
|
|
8560
9274
|
path: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
|
|
@@ -8563,7 +9277,7 @@ customElements.get("mint-off-canvas") || a("mint-off-canvas", Ln), s({
|
|
|
8563
9277
|
});
|
|
8564
9278
|
//#endregion
|
|
8565
9279
|
//#region src/components/resource-table/utility-aliases.js
|
|
8566
|
-
var
|
|
9280
|
+
var Hn = {
|
|
8567
9281
|
"-mr-1": "rtu-8956a4275",
|
|
8568
9282
|
"-translate-y-1/2": "rtu-36b381be4",
|
|
8569
9283
|
"[&>*]:m-0": "rtu-7b41b3d11",
|
|
@@ -8725,17 +9439,17 @@ var Rn = {
|
|
|
8725
9439
|
"z-10": "rtu-236812d64",
|
|
8726
9440
|
"z-20": "rtu-145745bf5",
|
|
8727
9441
|
"z-30": "rtu-0f2fff0ae"
|
|
8728
|
-
},
|
|
9442
|
+
}, Un = class extends HTMLElement {
|
|
8729
9443
|
constructor(...e) {
|
|
8730
|
-
super(...e), this._observer = null;
|
|
9444
|
+
super(...e), this._observer = null, this._disposeScrollFade = null;
|
|
8731
9445
|
}
|
|
8732
9446
|
connectedCallback() {
|
|
8733
|
-
this.classList.add("mint-table-host"), this._observeChanges(), this._applyStyles(), requestAnimationFrame(() => {
|
|
9447
|
+
this.classList.add("mint-table-host"), this._disposeScrollFade = I(this, "both"), this._observeChanges(), this._applyStyles(), requestAnimationFrame(() => {
|
|
8734
9448
|
this._applyStyles(), setTimeout(() => this._applyStyles(), 0);
|
|
8735
9449
|
});
|
|
8736
9450
|
}
|
|
8737
9451
|
disconnectedCallback() {
|
|
8738
|
-
this._observer?.disconnect(), this._observer = null;
|
|
9452
|
+
this._observer?.disconnect(), this._observer = null, this._disposeScrollFade?.(), this._disposeScrollFade = null;
|
|
8739
9453
|
}
|
|
8740
9454
|
_observeChanges() {
|
|
8741
9455
|
this._observer = new MutationObserver(() => this._applyStyles()), this._observer.observe(this, {
|
|
@@ -8785,10 +9499,10 @@ var Rn = {
|
|
|
8785
9499
|
e.dataset.mtProcessed = "", e.innerHTML = n, Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n));
|
|
8786
9500
|
}
|
|
8787
9501
|
};
|
|
8788
|
-
customElements.get("mint-table") || a("mint-table",
|
|
9502
|
+
customElements.get("mint-table") || a("mint-table", Un);
|
|
8789
9503
|
//#endregion
|
|
8790
9504
|
//#region src/components/resource-table/ResourceTable.ts
|
|
8791
|
-
var
|
|
9505
|
+
var Wn = class extends HTMLElement {
|
|
8792
9506
|
static get observedAttributes() {
|
|
8793
9507
|
return [
|
|
8794
9508
|
"configuration",
|
|
@@ -8806,7 +9520,7 @@ var Bn = class extends HTMLElement {
|
|
|
8806
9520
|
return e !== null && e !== "false";
|
|
8807
9521
|
}
|
|
8808
9522
|
constructor() {
|
|
8809
|
-
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
9523
|
+
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
8810
9524
|
}
|
|
8811
9525
|
get inMintCard() {
|
|
8812
9526
|
return this._inMintCard;
|
|
@@ -9408,7 +10122,7 @@ var Bn = class extends HTMLElement {
|
|
|
9408
10122
|
}
|
|
9409
10123
|
}
|
|
9410
10124
|
_detachVirtualScroll() {
|
|
9411
|
-
this._virtualScrollHandler &&= (window.removeEventListener("scroll", this._virtualScrollHandler), this._virtualBodyScrollEl?.removeEventListener("scroll", this._virtualScrollHandler), null), this._virtualWindowResizeHandler &&= (window.removeEventListener("resize", this._virtualWindowResizeHandler), null), this._virtualResizeObserver &&= (this._virtualResizeObserver.disconnect(), null), this._virtualBodyScrollEl = null, this._virtualWindowRaf !== null && (window.cancelAnimationFrame(this._virtualWindowRaf), this._virtualWindowRaf = null), this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualAjaxPrefetchTimer !== null && (window.clearTimeout(this._virtualAjaxPrefetchTimer), this._virtualAjaxPrefetchTimer = null), this._virtualRangeFetching = !1;
|
|
10125
|
+
this._virtualScrollHandler &&= (window.removeEventListener("scroll", this._virtualScrollHandler), this._virtualBodyScrollEl?.removeEventListener("scroll", this._virtualScrollHandler), null), this._virtualWindowResizeHandler &&= (window.removeEventListener("resize", this._virtualWindowResizeHandler), null), this._virtualResizeObserver &&= (this._virtualResizeObserver.disconnect(), null), this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade?.(), this._disposeVirtualBodyFade = null, this._virtualWindowRaf !== null && (window.cancelAnimationFrame(this._virtualWindowRaf), this._virtualWindowRaf = null), this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualAjaxPrefetchTimer !== null && (window.clearTimeout(this._virtualAjaxPrefetchTimer), this._virtualAjaxPrefetchTimer = null), this._virtualRangeFetching = !1;
|
|
9412
10126
|
}
|
|
9413
10127
|
_scheduleVirtualAjaxPrefetch(e, t) {
|
|
9414
10128
|
if (this._type !== "ajax" || !this._virtualScrollActive() || !this._configuration) return;
|
|
@@ -9474,7 +10188,7 @@ var Bn = class extends HTMLElement {
|
|
|
9474
10188
|
let e = () => {
|
|
9475
10189
|
this._scheduleVirtualWindowSync();
|
|
9476
10190
|
};
|
|
9477
|
-
this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl?.addEventListener("scroll", e, { passive: !0 }), this._virtualBodyScrollEl && typeof ResizeObserver < "u" && (this._virtualResizeObserver = new ResizeObserver(() => this._scheduleVirtualWindowSync()), this._virtualResizeObserver.observe(this._virtualBodyScrollEl))) : window.addEventListener("scroll", e, { passive: !0 }), this._virtualWindowResizeHandler = () => this._scheduleVirtualWindowSync(), window.addEventListener("resize", this._virtualWindowResizeHandler, { passive: !0 }), this._scheduleVirtualWindowSync();
|
|
10191
|
+
this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl && (this._disposeVirtualBodyFade = I(this._virtualBodyScrollEl, "vertical")), this._virtualBodyScrollEl?.addEventListener("scroll", e, { passive: !0 }), this._virtualBodyScrollEl && typeof ResizeObserver < "u" && (this._virtualResizeObserver = new ResizeObserver(() => this._scheduleVirtualWindowSync()), this._virtualResizeObserver.observe(this._virtualBodyScrollEl))) : window.addEventListener("scroll", e, { passive: !0 }), this._virtualWindowResizeHandler = () => this._scheduleVirtualWindowSync(), window.addEventListener("resize", this._virtualWindowResizeHandler, { passive: !0 }), this._scheduleVirtualWindowSync();
|
|
9478
10192
|
}
|
|
9479
10193
|
_toggleSort(e) {
|
|
9480
10194
|
if (!this._configuration || !e.data || !e.sortable) return;
|
|
@@ -9698,7 +10412,7 @@ var Bn = class extends HTMLElement {
|
|
|
9698
10412
|
return e.class && n.push(e.class.trim()), e.align === "center" ? n.push("text-center") : e.align === "right" && n.push("text-right"), e.sortable && !t && n.push("cursor-pointer"), e.stickLeft && n.push("sticky-left"), e.stickRight && n.push("sticky-right"), n.join(" ");
|
|
9699
10413
|
}
|
|
9700
10414
|
_replaceUtilityClasses() {
|
|
9701
|
-
let e =
|
|
10415
|
+
let e = Hn, t = [this, ...Array.from(this.querySelectorAll("[class]"))];
|
|
9702
10416
|
for (let n of t) for (let t of Array.from(n.classList)) {
|
|
9703
10417
|
let r = e[t];
|
|
9704
10418
|
r && n.classList.replace(t, r);
|
|
@@ -9898,10 +10612,10 @@ var Bn = class extends HTMLElement {
|
|
|
9898
10612
|
e !== null && (this._currentPage = e, this._offset = (this._currentPage - 1) * this._perPage);
|
|
9899
10613
|
}
|
|
9900
10614
|
};
|
|
9901
|
-
customElements.get("mint-resource-table") || a("mint-resource-table",
|
|
10615
|
+
customElements.get("mint-resource-table") || a("mint-resource-table", Wn);
|
|
9902
10616
|
//#endregion
|
|
9903
10617
|
//#region src/components/resource-table/ResourceTableContextMenu.ts
|
|
9904
|
-
var
|
|
10618
|
+
var Gn = 550, Kn = 12, qn = { passive: !0 }, Jn = class extends HTMLElement {
|
|
9905
10619
|
constructor(...e) {
|
|
9906
10620
|
super(...e), this._table = null, this._anchor = null, this._popover = null, this._menuRoot = null, this._baseId = "", this._touchTimer = null, this._touchStart = null, this._slotObserver = null, this._scrollCloseTargets = [], this._onScrollClose = () => {
|
|
9907
10621
|
this._closePopover();
|
|
@@ -9928,7 +10642,7 @@ var Vn = 550, Hn = 12, Un = { passive: !0 }, Wn = class extends HTMLElement {
|
|
|
9928
10642
|
let t = e.touches[0];
|
|
9929
10643
|
if (!t) return;
|
|
9930
10644
|
let n = t.clientX - this._touchStart.x, r = t.clientY - this._touchStart.y;
|
|
9931
|
-
n * n + r * r >
|
|
10645
|
+
n * n + r * r > Kn * Kn && (this._clearTouchTimer(), this._touchStart = null);
|
|
9932
10646
|
}, this._onTouchEnd = () => {
|
|
9933
10647
|
this._clearTouchTimer(), this._touchStart = null;
|
|
9934
10648
|
};
|
|
@@ -9951,7 +10665,7 @@ var Vn = 550, Hn = 12, Un = { passive: !0 }, Wn = class extends HTMLElement {
|
|
|
9951
10665
|
}
|
|
9952
10666
|
_longPressMs() {
|
|
9953
10667
|
let e = parseInt(this.getAttribute("long-press-ms") || "", 10);
|
|
9954
|
-
return !Number.isNaN(e) && e > 100 ? e :
|
|
10668
|
+
return !Number.isNaN(e) && e > 100 ? e : Gn;
|
|
9955
10669
|
}
|
|
9956
10670
|
_resolveTable() {
|
|
9957
10671
|
let e = this.getAttribute("for")?.trim();
|
|
@@ -10005,12 +10719,12 @@ var Vn = 550, Hn = 12, Un = { passive: !0 }, Wn = class extends HTMLElement {
|
|
|
10005
10719
|
return this._elementIsScrollContainer(e) && r(e), t;
|
|
10006
10720
|
}
|
|
10007
10721
|
_detachScrollCloseListeners() {
|
|
10008
|
-
for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose,
|
|
10722
|
+
for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, qn);
|
|
10009
10723
|
this._scrollCloseTargets = [];
|
|
10010
10724
|
}
|
|
10011
10725
|
_attachScrollCloseListeners(e) {
|
|
10012
10726
|
this._detachScrollCloseListeners(), this._scrollCloseTargets = this._collectScrollCloseTargets(e);
|
|
10013
|
-
for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose,
|
|
10727
|
+
for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, qn);
|
|
10014
10728
|
}
|
|
10015
10729
|
_closePopover() {
|
|
10016
10730
|
if (this._detachScrollCloseListeners(), !this._popover?.hasAttribute("open")) return;
|
|
@@ -10051,10 +10765,10 @@ var Vn = 550, Hn = 12, Un = { passive: !0 }, Wn = class extends HTMLElement {
|
|
|
10051
10765
|
l && this._attachScrollCloseListeners(l);
|
|
10052
10766
|
}
|
|
10053
10767
|
};
|
|
10054
|
-
customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu",
|
|
10768
|
+
customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu", Jn);
|
|
10055
10769
|
//#endregion
|
|
10056
10770
|
//#region src/components/search/Search.ts
|
|
10057
|
-
var
|
|
10771
|
+
var Yn = class e extends HTMLElement {
|
|
10058
10772
|
constructor(...e) {
|
|
10059
10773
|
super(...e), this._shell = null, this._desktopInput = null, this._panel = null, this._panelInner = null, this._resultsId = "", this._panelInput = null, this._panelFiltersWrap = null, this._panelFiltersMainRow = null, this._panelFiltersChips = null, this._panelFiltersShowAllWrap = null, this._panelFiltersShowAllBtn = null, this._panelFiltersMorePanel = null, this._filtersMoreOpen = !1, this._filterOverflowObserver = null, this._filterOverflowZeroWidthRetries = 0, this._desktopFilterWrap = null, this._mobileFilterWrap = null, this._resultsWrap = null, this._stateWrap = null, this._customResultsWrap = null, this._query = "", this._searchOpen = !1, this._selectedFilters = [], this._selectedFilterBackspaceArmed = !1, this._debounceId = null, this._abortController = null, this._docPointerDownHandler = null, this._globalKeydownHandler = null, this._focusOutHandler = null, this._resizeHandler = null, this._scrollHandler = null, this._desktopShortcutHint = null, this._panelSearchBar = null, this._contentObserver = null, this._renderFrame = null;
|
|
10060
10774
|
}
|
|
@@ -10626,7 +11340,7 @@ var Gn = class e extends HTMLElement {
|
|
|
10626
11340
|
let e = document.createElement("div");
|
|
10627
11341
|
e.className = "mint-search-panel-inner", this._panelInner = e;
|
|
10628
11342
|
let t = document.createElement("div");
|
|
10629
|
-
this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
|
|
11343
|
+
this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("icon", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
|
|
10630
11344
|
}
|
|
10631
11345
|
this._panel.parentElement !== document.body && document.body.appendChild(this._panel);
|
|
10632
11346
|
let t = this._hasSelectedFilters() ? "" : this._getPlaceholder();
|
|
@@ -10704,10 +11418,10 @@ var Gn = class e extends HTMLElement {
|
|
|
10704
11418
|
this._shell && this._shell.classList.toggle("is-collapsed", e), this._panelSearchBar && (this._panelSearchBar.classList.toggle("is-hidden", !e), this._panelSearchBar.classList.toggle("is-collapsed", e));
|
|
10705
11419
|
}
|
|
10706
11420
|
};
|
|
10707
|
-
customElements.get("mint-search") || a("mint-search",
|
|
11421
|
+
customElements.get("mint-search") || a("mint-search", Yn);
|
|
10708
11422
|
//#endregion
|
|
10709
|
-
//#region src/components/select/
|
|
10710
|
-
var
|
|
11423
|
+
//#region src/components/select/NativeSelect.ts
|
|
11424
|
+
var B = "data-mint-native-select-part", Xn = class extends HTMLElement {
|
|
10711
11425
|
static get observedAttributes() {
|
|
10712
11426
|
return [
|
|
10713
11427
|
"name",
|
|
@@ -10727,10 +11441,10 @@ var z = "data-mint-select-part", Kn = class extends HTMLElement {
|
|
|
10727
11441
|
];
|
|
10728
11442
|
}
|
|
10729
11443
|
constructor() {
|
|
10730
|
-
super(), this._select = null, this._wrapper = null, this._caretUpIcon = null, this._caretDownIcon = null, this._changeHandler = null, this._optionObserver = null, this._childrenObserver = null, this._hostOptionsObserverRaf = null, this._generatedControlId = `mint-select-${Math.random().toString(36).slice(2, 10)}`;
|
|
11444
|
+
super(), this._select = null, this._wrapper = null, this._caretUpIcon = null, this._caretDownIcon = null, this._changeHandler = null, this._optionObserver = null, this._childrenObserver = null, this._hostOptionsObserverRaf = null, this._generatedControlId = `mint-native-select-${Math.random().toString(36).slice(2, 10)}`;
|
|
10731
11445
|
}
|
|
10732
11446
|
connectedCallback() {
|
|
10733
|
-
this.classList.add("mint-select-host"), this.getLabel() || console.error("mint-select: The \"label\" attribute is required. Please provide a label for the select."), this.render(), this._childrenObserver && this._childrenObserver.disconnect(), this._childrenObserver = new MutationObserver((e) => {
|
|
11447
|
+
this.classList.add("mint-native-select-host"), this.getLabel() || console.error("mint-native-select: The \"label\" attribute is required. Please provide a label for the select."), this.render(), this._childrenObserver && this._childrenObserver.disconnect(), this._childrenObserver = new MutationObserver((e) => {
|
|
10734
11448
|
if (e.some((e) => {
|
|
10735
11449
|
let t = e.target;
|
|
10736
11450
|
if (this._select && (t === this._select || this._select.contains(t))) return !1;
|
|
@@ -10857,7 +11571,7 @@ var z = "data-mint-select-part", Kn = class extends HTMLElement {
|
|
|
10857
11571
|
}
|
|
10858
11572
|
getSelectClasses() {
|
|
10859
11573
|
return [
|
|
10860
|
-
"mint-select-control",
|
|
11574
|
+
"mint-native-select-control",
|
|
10861
11575
|
this.isMultiple() ? "is-multiple" : "",
|
|
10862
11576
|
this.hasError() ? "has-error" : ""
|
|
10863
11577
|
].filter(Boolean).join(" ");
|
|
@@ -10868,16 +11582,16 @@ var z = "data-mint-select-part", Kn = class extends HTMLElement {
|
|
|
10868
11582
|
this._select && Array.from(this._select.children).forEach((e) => {
|
|
10869
11583
|
(e.tagName === "OPTION" || e.tagName === "OPTGROUP") && r.push(e.cloneNode(!0));
|
|
10870
11584
|
}), Array.from(this.children).forEach((e) => {
|
|
10871
|
-
e instanceof HTMLElement && e.hasAttribute(
|
|
11585
|
+
e instanceof HTMLElement && e.hasAttribute(B) && e.remove();
|
|
10872
11586
|
}), this._wrapper = null, this._select = null;
|
|
10873
11587
|
let i = Array.from(this.children).filter((e) => e.tagName === "OPTION" || e.tagName === "OPTGROUP").map((e) => e.cloneNode(!0)), a = this.getLabel(), o = this.getInfo(), s = this.getId() || this._generatedControlId, c = this.getName(), l = this.isDisabled(), u = this.hasError();
|
|
10874
11588
|
if (a) {
|
|
10875
11589
|
let e = document.createElement("label");
|
|
10876
|
-
e.setAttribute(
|
|
11590
|
+
e.setAttribute(B, "label"), e.className = "mint-native-select-label", s && e.setAttribute("for", s);
|
|
10877
11591
|
let t = document.createTextNode(a);
|
|
10878
11592
|
e.appendChild(t), this.appendChild(e);
|
|
10879
11593
|
}
|
|
10880
|
-
this._wrapper = document.createElement("div"), this._wrapper.setAttribute(
|
|
11594
|
+
this._wrapper = document.createElement("div"), this._wrapper.setAttribute(B, "wrapper"), this._wrapper.className = "mint-native-select-control-wrap", this.appendChild(this._wrapper), this._select = document.createElement("select"), this._select.className = this.getSelectClasses(), s && (this._select.id = s), c && (this._select.name = c), l && (this._select.disabled = !0), this._select.required = this.isRequired(), t && (this._select.multiple = !0), this._select.setAttribute("aria-invalid", u ? "true" : "false");
|
|
10881
11595
|
let d = this.getAttribute("aria-label")?.trim(), f = this.getAttribute("aria-labelledby")?.trim();
|
|
10882
11596
|
f ? this._select.setAttribute("aria-labelledby", f) : a ? this._select.removeAttribute("aria-label") : this._select.setAttribute("aria-label", d || "Select an option");
|
|
10883
11597
|
let p = i.length > 0 ? i : r;
|
|
@@ -10940,38 +11654,331 @@ var z = "data-mint-select-part", Kn = class extends HTMLElement {
|
|
|
10940
11654
|
}), this._wrapper.appendChild(this._select), t) this._caretUpIcon = null, this._caretDownIcon = null;
|
|
10941
11655
|
else {
|
|
10942
11656
|
let e = document.createElement("div");
|
|
10943
|
-
e.className = "mint-select-caret", this._caretUpIcon = document.createElement("mint-icon"), this._caretUpIcon.setAttribute("name", "caret-up"), this._caretUpIcon.className = "mint-select-caret-up", this._caretUpIcon.setAttribute("aria-hidden", "true"), e.appendChild(this._caretUpIcon), this._caretDownIcon = document.createElement("mint-icon"), this._caretDownIcon.setAttribute("name", "caret-down"), this._caretDownIcon.className = "mint-select-caret-down", this._caretDownIcon.setAttribute("aria-hidden", "true"), e.appendChild(this._caretDownIcon), this._wrapper.appendChild(e);
|
|
11657
|
+
e.className = "mint-native-select-caret", this._caretUpIcon = document.createElement("mint-icon"), this._caretUpIcon.setAttribute("name", "caret-up"), this._caretUpIcon.className = "mint-native-select-caret-up", this._caretUpIcon.setAttribute("aria-hidden", "true"), e.appendChild(this._caretUpIcon), this._caretDownIcon = document.createElement("mint-icon"), this._caretDownIcon.setAttribute("name", "caret-down"), this._caretDownIcon.className = "mint-native-select-caret-down", this._caretDownIcon.setAttribute("aria-hidden", "true"), e.appendChild(this._caretDownIcon), this._wrapper.appendChild(e);
|
|
10944
11658
|
}
|
|
10945
11659
|
if (o) {
|
|
10946
11660
|
let e = document.createElement("div");
|
|
10947
|
-
e.setAttribute(
|
|
11661
|
+
e.setAttribute(B, "info"), e.className = "mint-native-select-info", e.textContent = o, this.appendChild(e);
|
|
10948
11662
|
}
|
|
10949
11663
|
this._renderErrorState(), this._syncSelectAccessibility(), this._renderSkeleton(e);
|
|
10950
11664
|
}
|
|
10951
11665
|
_renderSkeleton(e) {
|
|
10952
|
-
let t = this.querySelector(".mint-select-skeleton-container"), n = this._wrapper;
|
|
11666
|
+
let t = this.querySelector(".mint-native-select-skeleton-container"), n = this._wrapper;
|
|
10953
11667
|
if (e) {
|
|
10954
|
-
t || (t = document.createElement("div"), t.className = "mint-select-skeleton-container", t.setAttribute("aria-hidden", "true"), n ? n.appendChild(t) : this.appendChild(t));
|
|
10955
|
-
let e = t.querySelector(".mint-select-skeleton");
|
|
11668
|
+
t || (t = document.createElement("div"), t.className = "mint-native-select-skeleton-container", t.setAttribute("aria-hidden", "true"), n ? n.appendChild(t) : this.appendChild(t));
|
|
11669
|
+
let e = t.querySelector(".mint-native-select-skeleton");
|
|
10956
11670
|
e || (e = document.createElement("div"), t.appendChild(e));
|
|
10957
11671
|
let r = this.isMultiple();
|
|
10958
11672
|
e.classList.toggle("is-multiple", r), e.style.height = r ? "5rem" : "2rem", t.style.display = "block", this._select && (this._select.style.opacity = "0", this._select.style.pointerEvents = "none", this._select.setAttribute("aria-busy", "true"));
|
|
10959
11673
|
} else t && (t.style.display = "none"), this._select && (this._select.style.opacity = "1", this._select.style.pointerEvents = "auto", this._select.removeAttribute("aria-busy"));
|
|
10960
11674
|
}
|
|
10961
11675
|
_renderErrorState() {
|
|
10962
|
-
let e = this.hasError(), t = this.getErrorMessage(), n = this.querySelector(".mint-select-error");
|
|
10963
|
-
e && t ? (n ? n.hasAttribute(
|
|
11676
|
+
let e = this.hasError(), t = this.getErrorMessage(), n = this.querySelector(".mint-native-select-error");
|
|
11677
|
+
e && t ? (n ? n.hasAttribute(B) || n.setAttribute(B, "error") : (n = document.createElement("div"), n.setAttribute(B, "error"), n.className = "mint-native-select-error", this.appendChild(n)), n.textContent = t) : n && n.remove();
|
|
11678
|
+
}
|
|
11679
|
+
_syncSelectAccessibility() {
|
|
11680
|
+
if (!this._select) return;
|
|
11681
|
+
let e = this._select.id || this._generatedControlId, t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(`[${B}="info"]`), r = this.querySelector(".mint-native-select-error");
|
|
11682
|
+
n && (n.id = `${e}-info`, t.push(n.id)), r && (r.id = `${e}-error`, t.push(r.id)), t.length ? this._select.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._select.removeAttribute("aria-describedby");
|
|
11683
|
+
}
|
|
11684
|
+
};
|
|
11685
|
+
customElements.get("mint-native-select") || a("mint-native-select", Xn);
|
|
11686
|
+
//#endregion
|
|
11687
|
+
//#region src/components/select/Select.ts
|
|
11688
|
+
var V = "data-mint-select-part", Zn = class extends HTMLElement {
|
|
11689
|
+
constructor(...e) {
|
|
11690
|
+
super(...e), this._native = null, this._trigger = null, this._popover = null, this._list = null, this._observer = null, this._syncing = !1, this._typeahead = "", this._typeaheadTimer = null, this._id = `mint-select-${Math.random().toString(36).slice(2, 10)}`;
|
|
11691
|
+
}
|
|
11692
|
+
static get observedAttributes() {
|
|
11693
|
+
return [
|
|
11694
|
+
"name",
|
|
11695
|
+
"value",
|
|
11696
|
+
"values",
|
|
11697
|
+
"multiple",
|
|
11698
|
+
"disabled",
|
|
11699
|
+
"id",
|
|
11700
|
+
"required",
|
|
11701
|
+
"label",
|
|
11702
|
+
"info",
|
|
11703
|
+
"error",
|
|
11704
|
+
"error-message",
|
|
11705
|
+
"loading",
|
|
11706
|
+
"placeholder",
|
|
11707
|
+
"aria-label",
|
|
11708
|
+
"aria-labelledby",
|
|
11709
|
+
"aria-describedby",
|
|
11710
|
+
"form"
|
|
11711
|
+
];
|
|
11712
|
+
}
|
|
11713
|
+
connectedCallback() {
|
|
11714
|
+
this.classList.add("mint-select-host"), this.render(), this._observer?.disconnect(), this._observer = new MutationObserver((e) => {
|
|
11715
|
+
this._syncing || e.some((e) => {
|
|
11716
|
+
let t = e.target instanceof Element ? e.target : e.target.parentElement;
|
|
11717
|
+
return t === this || t?.closest(`[${V}]`) ? !1 : e.type === "attributes" ? [
|
|
11718
|
+
"value",
|
|
11719
|
+
"label",
|
|
11720
|
+
"disabled",
|
|
11721
|
+
"selected"
|
|
11722
|
+
].includes(e.attributeName) : t instanceof HTMLOptionElement || t instanceof HTMLOptGroupElement || [...e.addedNodes, ...e.removedNodes].some((e) => e instanceof HTMLOptionElement || e instanceof HTMLOptGroupElement);
|
|
11723
|
+
}) && this.render();
|
|
11724
|
+
}), this._observer.observe(this, {
|
|
11725
|
+
childList: !0,
|
|
11726
|
+
subtree: !0,
|
|
11727
|
+
attributes: !0,
|
|
11728
|
+
attributeFilter: [
|
|
11729
|
+
"value",
|
|
11730
|
+
"label",
|
|
11731
|
+
"disabled",
|
|
11732
|
+
"selected"
|
|
11733
|
+
]
|
|
11734
|
+
});
|
|
11735
|
+
}
|
|
11736
|
+
disconnectedCallback() {
|
|
11737
|
+
this._observer?.disconnect(), this._observer = null, this._typeaheadTimer !== null && window.clearTimeout(this._typeaheadTimer);
|
|
11738
|
+
}
|
|
11739
|
+
attributeChangedCallback(e, t, n) {
|
|
11740
|
+
if (!(t === n || !this.isConnected)) {
|
|
11741
|
+
if (e === "values" && this._native && this.isMultiple()) {
|
|
11742
|
+
this._applyValues(this.parseValues(n)), this.updateDisplay();
|
|
11743
|
+
return;
|
|
11744
|
+
}
|
|
11745
|
+
if (e === "multiple" && this._native) {
|
|
11746
|
+
this.render();
|
|
11747
|
+
return;
|
|
11748
|
+
}
|
|
11749
|
+
if (e === "value" && this._native) {
|
|
11750
|
+
this.isMultiple() ? this._applyValues(n ? [n] : []) : this._native.value = n || "", this.updateDisplay();
|
|
11751
|
+
return;
|
|
11752
|
+
}
|
|
11753
|
+
this.render();
|
|
11754
|
+
}
|
|
11755
|
+
}
|
|
11756
|
+
get value() {
|
|
11757
|
+
return this.isMultiple() ? this.values : this._native?.value || this.getAttribute("value") || "";
|
|
11758
|
+
}
|
|
11759
|
+
set value(e) {
|
|
11760
|
+
this.setValue(e);
|
|
11761
|
+
}
|
|
11762
|
+
get values() {
|
|
11763
|
+
return this._native && this.isMultiple() ? Array.from(this._native.selectedOptions, (e) => e.value) : this.parseValues(this.getAttribute("values"));
|
|
11764
|
+
}
|
|
11765
|
+
set values(e) {
|
|
11766
|
+
this.setValue(e);
|
|
11767
|
+
}
|
|
11768
|
+
getValue() {
|
|
11769
|
+
return this.value;
|
|
11770
|
+
}
|
|
11771
|
+
setValue(e) {
|
|
11772
|
+
if (this.isMultiple()) {
|
|
11773
|
+
let t = Array.isArray(e) ? e.map(String) : e == null || e === "" ? [] : [String(e)];
|
|
11774
|
+
this.setAttribute("values", JSON.stringify(t)), this._applyValues(t);
|
|
11775
|
+
} else {
|
|
11776
|
+
let t = e == null ? "" : String(e);
|
|
11777
|
+
this.setAttribute("value", t), this._native && (this._native.value = t);
|
|
11778
|
+
}
|
|
11779
|
+
this.updateDisplay();
|
|
11780
|
+
}
|
|
11781
|
+
isDisabled() {
|
|
11782
|
+
return this.hasAttribute("disabled") && this.getAttribute("disabled") !== "false";
|
|
11783
|
+
}
|
|
11784
|
+
isLoading() {
|
|
11785
|
+
let e = this.getAttribute("loading");
|
|
11786
|
+
return e !== null && e !== "false";
|
|
11787
|
+
}
|
|
11788
|
+
isRequired() {
|
|
11789
|
+
return this.hasAttribute("required") && this.getAttribute("required") !== "false";
|
|
11790
|
+
}
|
|
11791
|
+
isMultiple() {
|
|
11792
|
+
return this.hasAttribute("multiple") && this.getAttribute("multiple") !== "false";
|
|
11793
|
+
}
|
|
11794
|
+
hasError() {
|
|
11795
|
+
return this.getAttribute("error") === "true";
|
|
11796
|
+
}
|
|
11797
|
+
parseValues(e) {
|
|
11798
|
+
if (!e) return [];
|
|
11799
|
+
try {
|
|
11800
|
+
let t = JSON.parse(e);
|
|
11801
|
+
if (Array.isArray(t)) {
|
|
11802
|
+
if (t.length === 1 && typeof t[0] == "string" && t[0].trim().startsWith("[")) try {
|
|
11803
|
+
let e = JSON.parse(t[0]);
|
|
11804
|
+
if (Array.isArray(e)) return e.map(String);
|
|
11805
|
+
} catch {}
|
|
11806
|
+
return t.map(String);
|
|
11807
|
+
}
|
|
11808
|
+
} catch {}
|
|
11809
|
+
return [e];
|
|
11810
|
+
}
|
|
11811
|
+
_applyValues(e) {
|
|
11812
|
+
if (!this._native) return;
|
|
11813
|
+
let t = new Set(e);
|
|
11814
|
+
Array.from(this._native.options).forEach((e) => {
|
|
11815
|
+
e.selected = t.has(e.value);
|
|
11816
|
+
});
|
|
11817
|
+
}
|
|
11818
|
+
options() {
|
|
11819
|
+
return Array.from(this.querySelectorAll(":scope > option, :scope > optgroup > option"));
|
|
11820
|
+
}
|
|
11821
|
+
selectedOption() {
|
|
11822
|
+
return this._native?.selectedOptions[0] || this.options().find((e) => e.value === this.value);
|
|
11823
|
+
}
|
|
11824
|
+
render() {
|
|
11825
|
+
let e = this._native?.value ?? this.getAttribute("value") ?? "", t = this._native && this._native.multiple ? Array.from(this._native.selectedOptions, (e) => e.value) : this.parseValues(this.getAttribute("values"));
|
|
11826
|
+
this._syncing = !0, Array.from(this.children).forEach((e) => {
|
|
11827
|
+
e.hasAttribute(V) && e.remove();
|
|
11828
|
+
});
|
|
11829
|
+
let n = this.getAttribute("label")?.trim() || "", r = this.getAttribute("id") || this._id;
|
|
11830
|
+
if (n) {
|
|
11831
|
+
let e = document.createElement("label");
|
|
11832
|
+
e.setAttribute(V, "label"), e.className = "mint-select-label", e.htmlFor = `${r}-trigger`, e.textContent = n, this.append(e);
|
|
11833
|
+
}
|
|
11834
|
+
let i = document.createElement("div");
|
|
11835
|
+
i.setAttribute(V, "wrap"), i.className = "mint-select-control-wrap", this.append(i);
|
|
11836
|
+
let a = document.createElement("button");
|
|
11837
|
+
a.type = "button", a.id = `${r}-trigger`, a.className = "mint-select-trigger", a.disabled = this.isDisabled() || this.isLoading(), a.setAttribute("role", "combobox"), a.setAttribute("aria-busy", String(this.isLoading())), a.setAttribute("aria-haspopup", "listbox"), a.setAttribute("aria-expanded", "false"), a.setAttribute("aria-required", String(this.isRequired())), a.setAttribute("aria-invalid", String(this.hasError()));
|
|
11838
|
+
let o = this.getAttribute("aria-labelledby"), s = this.getAttribute("aria-label")?.trim();
|
|
11839
|
+
if (o ? a.setAttribute("aria-labelledby", o) : !n && s ? a.setAttribute("aria-label", s) : n && a.setAttribute("aria-labelledby", `${r}-label`), n) {
|
|
11840
|
+
let e = this.querySelector(`[${V}="label"]`);
|
|
11841
|
+
e && (e.id = `${r}-label`);
|
|
11842
|
+
}
|
|
11843
|
+
let c = document.createElement("span");
|
|
11844
|
+
c.className = "mint-select-value", a.append(c);
|
|
11845
|
+
let l = document.createElement("span");
|
|
11846
|
+
l.className = "mint-select-caret", l.setAttribute("aria-hidden", "true"), l.innerHTML = "<mint-icon name=\"caret-up\"></mint-icon><mint-icon name=\"caret-down\"></mint-icon>", a.append(l), i.append(a);
|
|
11847
|
+
let u = document.createElement("select");
|
|
11848
|
+
u.setAttribute(V, "native"), u.className = "mint-select-native-control", u.id = `${r}-native`, u.name = this.getAttribute("name") || "", u.multiple = this.isMultiple(), this.hasAttribute("form") && u.setAttribute("form", this.getAttribute("form") || ""), u.required = this.isRequired(), u.disabled = this.isDisabled(), u.tabIndex = -1, u.setAttribute("aria-hidden", "true"), u.setAttribute("aria-invalid", String(this.hasError()));
|
|
11849
|
+
let d = [
|
|
11850
|
+
this.getAttribute("aria-describedby"),
|
|
11851
|
+
n ? `${r}-label` : "",
|
|
11852
|
+
this.getAttribute("info") ? `${r}-info` : "",
|
|
11853
|
+
this.getAttribute("error-message") ? `${r}-error` : ""
|
|
11854
|
+
].filter(Boolean).join(" ");
|
|
11855
|
+
if (d && u.setAttribute("aria-describedby", d), this.options().forEach((e) => u.append(e.cloneNode(!0))), !u.options.length) {
|
|
11856
|
+
let e = document.createElement("option");
|
|
11857
|
+
e.value = "", e.textContent = this.getAttribute("placeholder") || "Select an option", e.disabled = !0, u.append(e);
|
|
11858
|
+
}
|
|
11859
|
+
if (u.multiple) {
|
|
11860
|
+
let n = t.length ? t : this.parseValues(this.getAttribute("values")).length ? this.parseValues(this.getAttribute("values")) : e ? [e] : [];
|
|
11861
|
+
n.length && Array.from(u.options).forEach((e) => {
|
|
11862
|
+
e.selected = n.includes(e.value);
|
|
11863
|
+
});
|
|
11864
|
+
} else u.value = e;
|
|
11865
|
+
i.append(u), this._native = u, this._trigger = a;
|
|
11866
|
+
let f = document.createElement("mint-popover");
|
|
11867
|
+
f.className = "mint-select-popover", f.setAttribute(V, "popover"), f.setAttribute("trigger-id", a.id), f.setAttribute("trigger-toggle", "false"), f.setAttribute("direction", "down"), f.setAttribute("trigger-align", "start"), f.setAttribute("align-selected", "true"), f.setAttribute("distance", "4"), f.setAttribute("padding", "0"), f.setAttribute("aria-label", n ? `${n} options` : "Select options");
|
|
11868
|
+
let p = document.createElement("div");
|
|
11869
|
+
p.className = "mint-select-options", p.id = `${r}-listbox`, p.setAttribute("role", "listbox"), p.setAttribute("aria-multiselectable", String(this.isMultiple())), a.setAttribute("aria-controls", p.id), f.append(p), this.append(f), this._popover = f, this._list = p, this.renderOptions(), this.updateDisplay(), this.bindEvents();
|
|
11870
|
+
let m = this.getAttribute("info");
|
|
11871
|
+
if (m) {
|
|
11872
|
+
let e = document.createElement("div");
|
|
11873
|
+
e.setAttribute(V, "info"), e.className = "mint-select-info", e.id = `${r}-info`, e.textContent = m, this.append(e);
|
|
11874
|
+
}
|
|
11875
|
+
let h = this.getAttribute("error-message");
|
|
11876
|
+
if (this.hasError() && h) {
|
|
11877
|
+
let e = document.createElement("div");
|
|
11878
|
+
e.setAttribute(V, "error"), e.className = "mint-select-error", e.id = `${r}-error`, e.textContent = h, this.append(e);
|
|
11879
|
+
}
|
|
11880
|
+
this._syncing = !1;
|
|
11881
|
+
}
|
|
11882
|
+
renderOptions() {
|
|
11883
|
+
this._list && (this._list.replaceChildren(), Array.from(this.children).filter((e) => e.tagName === "OPTION" || e.tagName === "OPTGROUP").forEach((e) => {
|
|
11884
|
+
if (e instanceof HTMLOptGroupElement) {
|
|
11885
|
+
let t = document.createElement("div");
|
|
11886
|
+
t.className = "mint-select-group-label", t.setAttribute("role", "presentation"), t.textContent = e.label, this._list.append(t), Array.from(e.children).forEach((t) => this.addOption(t, e.disabled));
|
|
11887
|
+
} else this.addOption(e, !1);
|
|
11888
|
+
}));
|
|
11889
|
+
}
|
|
11890
|
+
addOption(e, t) {
|
|
11891
|
+
if (!this._list) return;
|
|
11892
|
+
let n = document.createElement("button");
|
|
11893
|
+
n.type = "button", n.className = "mint-select-option", n.dataset.value = e.value, n.setAttribute("role", "option"), n.setAttribute("aria-selected", String(this.isMultiple() ? this.values.includes(e.value) : e.value === this.value)), n.disabled = e.disabled || t || this.isDisabled(), n.tabIndex = -1;
|
|
11894
|
+
let r = document.createElement("span");
|
|
11895
|
+
r.textContent = e.label || e.textContent || "", n.append(r);
|
|
11896
|
+
let i = document.createElement("mint-icon");
|
|
11897
|
+
i.setAttribute("name", "check"), i.setAttribute("aria-hidden", "true"), i.className = "mint-select-option-check", n.append(i), this._list.append(n);
|
|
11898
|
+
}
|
|
11899
|
+
updateDisplay() {
|
|
11900
|
+
if (!this._native || !this._trigger) return;
|
|
11901
|
+
let e = this.selectedOption(), t = this.values, n = this.isMultiple() ? t.map((e) => this.options().find((t) => t.value === e)?.label || e) : [], r = this._trigger.querySelector(".mint-select-value");
|
|
11902
|
+
r && (r.textContent = this.isMultiple() ? n.join(", ") || this.getAttribute("placeholder") || "Select an option" : e?.label || e?.textContent?.trim() || this.getAttribute("placeholder") || "Select an option", r.classList.toggle("is-placeholder", this.isMultiple() ? t.length === 0 : !e || e.value === "")), this._trigger.setAttribute("aria-invalid", String(this.hasError())), this._trigger.setAttribute("aria-haspopup", "listbox"), this._list?.setAttribute("aria-multiselectable", String(this.isMultiple())), this._list?.querySelectorAll("[role=\"option\"]").forEach((e) => e.setAttribute("aria-selected", String(this.isMultiple() ? t.includes(e.dataset.value || "") : e.dataset.value === this._native.value)));
|
|
11903
|
+
}
|
|
11904
|
+
bindEvents() {
|
|
11905
|
+
!this._trigger || !this._popover || !this._native || !this._list || (this._trigger.onclick = () => {
|
|
11906
|
+
this._popover.style.setProperty("--mint-select-popover-width", `${this._trigger.getBoundingClientRect().width}px`), this._popover.hasAttribute("open") ? this._popover.close() : this._popover.open();
|
|
11907
|
+
}, this._trigger.onkeydown = (e) => {
|
|
11908
|
+
let t = Array.from(this._list.querySelectorAll("[role=\"option\"]:not(:disabled)"));
|
|
11909
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
11910
|
+
e.preventDefault(), this._popover.hasAttribute("open") || this._popover.open();
|
|
11911
|
+
let n = t.findIndex((e) => e.dataset.value === (this.isMultiple() ? this.values[0] : this._native.value));
|
|
11912
|
+
t[e.key === "ArrowDown" ? Math.min(t.length - 1, n + 1) : Math.max(0, n <= 0 ? 0 : n - 1)]?.focus();
|
|
11913
|
+
} else if (e.key === "Enter" || e.key === " ") if (this._popover.hasAttribute("open")) {
|
|
11914
|
+
e.preventDefault();
|
|
11915
|
+
let t = this._list.querySelector("[role=\"option\"]:focus");
|
|
11916
|
+
t ? this.selectOption(t.dataset.value || "") : this._popover.open();
|
|
11917
|
+
} else e.key === " " && (e.preventDefault(), this._popover.open());
|
|
11918
|
+
else e.key === "Escape" && this._popover.hasAttribute("open") ? (e.preventDefault(), this._popover.close(), this._trigger.focus()) : e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && this.typeahead(e.key);
|
|
11919
|
+
}, this._list.onclick = (e) => {
|
|
11920
|
+
let t = e.target.closest("[role=\"option\"]");
|
|
11921
|
+
t && !t.disabled && this.selectOption(t.dataset.value || "");
|
|
11922
|
+
}, this._list.onkeydown = (e) => {
|
|
11923
|
+
let t = Array.from(this._list.querySelectorAll("[role=\"option\"]:not(:disabled)")), n = t.indexOf(e.target), r = n;
|
|
11924
|
+
if (e.key === "ArrowDown") r = Math.min(t.length - 1, n + 1);
|
|
11925
|
+
else if (e.key === "ArrowUp") r = Math.max(0, n - 1);
|
|
11926
|
+
else if (e.key === "Home") r = 0;
|
|
11927
|
+
else if (e.key === "End") r = t.length - 1;
|
|
11928
|
+
else if (e.key === "Escape") {
|
|
11929
|
+
e.preventDefault(), this._popover.close(), this._trigger.focus();
|
|
11930
|
+
return;
|
|
11931
|
+
} else if (e.key === "Enter" || e.key === " ") {
|
|
11932
|
+
e.preventDefault(), this.selectOption(e.target.dataset.value || "");
|
|
11933
|
+
return;
|
|
11934
|
+
} else if (e.key.length === 1) {
|
|
11935
|
+
this.typeahead(e.key);
|
|
11936
|
+
return;
|
|
11937
|
+
} else return;
|
|
11938
|
+
e.preventDefault(), t[r]?.focus();
|
|
11939
|
+
}, this._native.onchange = () => {
|
|
11940
|
+
this.isMultiple() ? this.setAttribute("values", JSON.stringify(this.values)) : this.setAttribute("value", this._native.value), this.updateDisplay(), this.dispatchSelectionEvents();
|
|
11941
|
+
});
|
|
11942
|
+
}
|
|
11943
|
+
selectOption(e) {
|
|
11944
|
+
if (this._native) {
|
|
11945
|
+
if (this.isMultiple()) {
|
|
11946
|
+
let t = new Set(this.values);
|
|
11947
|
+
t.has(e) ? t.delete(e) : t.add(e);
|
|
11948
|
+
let n = [...t];
|
|
11949
|
+
this._applyValues(n), this.setAttribute("values", JSON.stringify(n)), this.updateDisplay(), this.dispatchSelectionEvents();
|
|
11950
|
+
return;
|
|
11951
|
+
}
|
|
11952
|
+
this._native.value = e, this.setAttribute("value", e), this.updateDisplay(), this._popover?.close(), this._trigger?.focus(), this.dispatchSelectionEvents();
|
|
11953
|
+
}
|
|
11954
|
+
}
|
|
11955
|
+
dispatchSelectionEvents() {
|
|
11956
|
+
let e = this.isMultiple() ? this.values : this._native?.value || "", t = this.isMultiple() ? {
|
|
11957
|
+
value: e,
|
|
11958
|
+
values: e
|
|
11959
|
+
} : { value: e };
|
|
11960
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
11961
|
+
bubbles: !0,
|
|
11962
|
+
composed: !0,
|
|
11963
|
+
detail: t
|
|
11964
|
+
})), this.dispatchEvent(new CustomEvent("change", {
|
|
11965
|
+
bubbles: !0,
|
|
11966
|
+
composed: !0,
|
|
11967
|
+
detail: t
|
|
11968
|
+
}));
|
|
10964
11969
|
}
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
11970
|
+
typeahead(e) {
|
|
11971
|
+
this._typeahead += e.toLocaleLowerCase(), this._typeaheadTimer !== null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => {
|
|
11972
|
+
this._typeahead = "";
|
|
11973
|
+
}, 700);
|
|
11974
|
+
let t = Array.from(this._list?.querySelectorAll("[role=\"option\"]:not(:disabled)") || []).find((e) => e.textContent?.trim().toLocaleLowerCase().startsWith(this._typeahead));
|
|
11975
|
+
t && (this._popover?.hasAttribute("open") || this._popover?.open(), t.focus());
|
|
10969
11976
|
}
|
|
10970
11977
|
};
|
|
10971
|
-
customElements.get("mint-select") || a("mint-select",
|
|
11978
|
+
customElements.get("mint-select") || a("mint-select", Zn);
|
|
10972
11979
|
//#endregion
|
|
10973
11980
|
//#region src/components/side-navigation/SideNavigationLink.ts
|
|
10974
|
-
var
|
|
11981
|
+
var Qn = class extends HTMLElement {
|
|
10975
11982
|
constructor(...e) {
|
|
10976
11983
|
super(...e), this._trigger = null, this._submenuContainer = null, this._contentObserver = null, this._renderFrame = null;
|
|
10977
11984
|
}
|
|
@@ -11105,10 +12112,10 @@ var qn = class extends HTMLElement {
|
|
|
11105
12112
|
this._hasSubmenu() && !this._isSubmenuItem() ? this._buildDropdownLink() : this._buildSimpleLink();
|
|
11106
12113
|
}
|
|
11107
12114
|
};
|
|
11108
|
-
customElements.get("mint-sidenav-link") || a("mint-sidenav-link",
|
|
12115
|
+
customElements.get("mint-sidenav-link") || a("mint-sidenav-link", Qn);
|
|
11109
12116
|
//#endregion
|
|
11110
12117
|
//#region src/components/side-navigation/SideNavigationLinks.ts
|
|
11111
|
-
var
|
|
12118
|
+
var $n = class extends HTMLElement {
|
|
11112
12119
|
constructor(...e) {
|
|
11113
12120
|
super(...e), this._container = null, this._title = null, this._titleLabel = null, this._titleCaret = null, this._titleIsInteractive = null, this._list = null, this._titleClickHandler = null, this._listenerCounts = /* @__PURE__ */ new Map();
|
|
11114
12121
|
}
|
|
@@ -11171,10 +12178,10 @@ var Jn = class extends HTMLElement {
|
|
|
11171
12178
|
});
|
|
11172
12179
|
}
|
|
11173
12180
|
};
|
|
11174
|
-
customElements.get("mint-sidenav-links") || a("mint-sidenav-links",
|
|
12181
|
+
customElements.get("mint-sidenav-links") || a("mint-sidenav-links", $n);
|
|
11175
12182
|
//#endregion
|
|
11176
12183
|
//#region src/components/side-navigation/SideNavigationActionLinks.ts
|
|
11177
|
-
var
|
|
12184
|
+
var er = class extends HTMLElement {
|
|
11178
12185
|
static get observedAttributes() {
|
|
11179
12186
|
return ["separated"];
|
|
11180
12187
|
}
|
|
@@ -11191,10 +12198,10 @@ var Yn = class extends HTMLElement {
|
|
|
11191
12198
|
this.className = this._isSeparated() ? "mint-sidenav-action-links is-separated" : "mint-sidenav-action-links";
|
|
11192
12199
|
}
|
|
11193
12200
|
};
|
|
11194
|
-
customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links",
|
|
12201
|
+
customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links", er);
|
|
11195
12202
|
//#endregion
|
|
11196
12203
|
//#region src/components/side-navigation/SideNavigationActionMenu.ts
|
|
11197
|
-
var
|
|
12204
|
+
var tr = class extends HTMLElement {
|
|
11198
12205
|
constructor(...e) {
|
|
11199
12206
|
super(...e), this._wrapper = null, this._trigger = null, this._popover = null, this._triggerId = "", this._contentObserver = null, this._renderFrame = null;
|
|
11200
12207
|
}
|
|
@@ -11261,15 +12268,15 @@ var Xn = class extends HTMLElement {
|
|
|
11261
12268
|
}) : a.appendChild(this._createDefaultGroup()), this._popover.appendChild(a), this._wrapper.appendChild(this._trigger), this._wrapper.appendChild(this._popover);
|
|
11262
12269
|
}
|
|
11263
12270
|
};
|
|
11264
|
-
customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu",
|
|
12271
|
+
customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu", tr);
|
|
11265
12272
|
//#endregion
|
|
11266
12273
|
//#region src/components/side-navigation/SideNavigation.ts
|
|
11267
|
-
var
|
|
11268
|
-
function
|
|
12274
|
+
var H = "mint:url-change";
|
|
12275
|
+
function nr() {
|
|
11269
12276
|
if (window.__mintUrlChangePatched) return;
|
|
11270
12277
|
window.__mintUrlChangePatched = !0;
|
|
11271
12278
|
let e = () => {
|
|
11272
|
-
window.dispatchEvent(new Event(
|
|
12279
|
+
window.dispatchEvent(new Event(H));
|
|
11273
12280
|
}, t = (t) => {
|
|
11274
12281
|
let n = history[t].bind(history);
|
|
11275
12282
|
history[t] = ((...t) => {
|
|
@@ -11279,9 +12286,9 @@ function Zn() {
|
|
|
11279
12286
|
};
|
|
11280
12287
|
t("pushState"), t("replaceState");
|
|
11281
12288
|
}
|
|
11282
|
-
var
|
|
12289
|
+
var rr = class extends HTMLElement {
|
|
11283
12290
|
constructor(...e) {
|
|
11284
|
-
super(...e), this._backdrop = null, this._container = null, this._header = null, this._content = null, this._footer = null, this._escapeHandler = null, this._mediaQuery = null, this._mediaListener = null, this._accordionHandler = null, this._urlChangeHandler = null, this._contentObserver = null, this._renderFrame = null, this._onMobileNavNavigateClick = (e) => {
|
|
12291
|
+
super(...e), this._backdrop = null, this._container = null, this._header = null, this._content = null, this._disposeContentFade = null, this._footer = null, this._escapeHandler = null, this._mediaQuery = null, this._mediaListener = null, this._accordionHandler = null, this._urlChangeHandler = null, this._contentObserver = null, this._renderFrame = null, this._onMobileNavNavigateClick = (e) => {
|
|
11285
12292
|
if (this._mediaQuery?.matches) return;
|
|
11286
12293
|
let t = e.target;
|
|
11287
12294
|
if (!(t instanceof Element)) return;
|
|
@@ -11304,7 +12311,7 @@ var Qn = class extends HTMLElement {
|
|
|
11304
12311
|
this._attachEscapeListener(), this._attachMediaListener(), this._attachAccordionListener(), this._attachUrlChangeListener(), this._observeContentMutations(), this.render();
|
|
11305
12312
|
}
|
|
11306
12313
|
disconnectedCallback() {
|
|
11307
|
-
this._detachEscapeListener(), this._detachMediaListener(), this._detachAccordionListener(), this._detachUrlChangeListener(), this._contentObserver &&= (this._contentObserver.disconnect(), null), this._renderFrame !== null && (cancelAnimationFrame(this._renderFrame), this._renderFrame = null);
|
|
12314
|
+
this._detachEscapeListener(), this._detachMediaListener(), this._detachAccordionListener(), this._detachUrlChangeListener(), this._contentObserver &&= (this._contentObserver.disconnect(), null), this._disposeContentFade?.(), this._disposeContentFade = null, this._renderFrame !== null && (cancelAnimationFrame(this._renderFrame), this._renderFrame = null);
|
|
11308
12315
|
}
|
|
11309
12316
|
attributeChangedCallback(e, t, n) {
|
|
11310
12317
|
t !== n && this.render();
|
|
@@ -11342,12 +12349,12 @@ var Qn = class extends HTMLElement {
|
|
|
11342
12349
|
this._accordionHandler &&= (this.removeEventListener("mint-sidenav-accordion", this._accordionHandler), null);
|
|
11343
12350
|
}
|
|
11344
12351
|
_attachUrlChangeListener() {
|
|
11345
|
-
this._urlChangeHandler || (
|
|
12352
|
+
this._urlChangeHandler || (nr(), this._urlChangeHandler = () => {
|
|
11346
12353
|
this._mediaQuery?.matches || this._isOpen() && this.removeAttribute("open");
|
|
11347
|
-
}, window.addEventListener("popstate", this._urlChangeHandler), window.addEventListener("hashchange", this._urlChangeHandler), window.addEventListener(
|
|
12354
|
+
}, window.addEventListener("popstate", this._urlChangeHandler), window.addEventListener("hashchange", this._urlChangeHandler), window.addEventListener(H, this._urlChangeHandler));
|
|
11348
12355
|
}
|
|
11349
12356
|
_detachUrlChangeListener() {
|
|
11350
|
-
this._urlChangeHandler &&= (window.removeEventListener("popstate", this._urlChangeHandler), window.removeEventListener("hashchange", this._urlChangeHandler), window.removeEventListener(
|
|
12357
|
+
this._urlChangeHandler &&= (window.removeEventListener("popstate", this._urlChangeHandler), window.removeEventListener("hashchange", this._urlChangeHandler), window.removeEventListener(H, this._urlChangeHandler), null);
|
|
11351
12358
|
}
|
|
11352
12359
|
_observeContentMutations() {
|
|
11353
12360
|
this._contentObserver ||= new MutationObserver(() => {
|
|
@@ -11393,7 +12400,7 @@ var Qn = class extends HTMLElement {
|
|
|
11393
12400
|
e.replaceChildren(...n);
|
|
11394
12401
|
}
|
|
11395
12402
|
_buildContent() {
|
|
11396
|
-
this._container && (this._content || (this._content = document.createElement("div"), this._content.className = "mint-sidenav-content", this._container.appendChild(this._content)), this._replaceSlottedChildren(this._content, "links"));
|
|
12403
|
+
this._container && (this._content || (this._content = document.createElement("div"), this._content.className = "mint-sidenav-content", this._container.appendChild(this._content)), this._replaceSlottedChildren(this._content, "links"), this._disposeContentFade ||= I(this._content, "vertical"));
|
|
11397
12404
|
}
|
|
11398
12405
|
_buildFooter() {
|
|
11399
12406
|
if (!this._container) return;
|
|
@@ -11405,10 +12412,10 @@ var Qn = class extends HTMLElement {
|
|
|
11405
12412
|
this._ensureBackdrop(), this._ensureContainer(), this._syncShell(), this._buildUserHeader(), this._buildContent(), this._buildFooter();
|
|
11406
12413
|
}
|
|
11407
12414
|
};
|
|
11408
|
-
customElements.get("mint-side-navigation") || a("mint-side-navigation",
|
|
12415
|
+
customElements.get("mint-side-navigation") || a("mint-side-navigation", rr);
|
|
11409
12416
|
//#endregion
|
|
11410
12417
|
//#region src/components/side-navigation/index.ts
|
|
11411
|
-
var
|
|
12418
|
+
var ir = rr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", ar = class e extends HTMLElement {
|
|
11412
12419
|
static get observedAttributes() {
|
|
11413
12420
|
return [
|
|
11414
12421
|
"direction",
|
|
@@ -11479,7 +12486,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11479
12486
|
let i = e.children[r];
|
|
11480
12487
|
if (i.nodeType !== Node.ELEMENT_NODE) continue;
|
|
11481
12488
|
let a = i;
|
|
11482
|
-
a.classList.contains(
|
|
12489
|
+
a.classList.contains(U) || a.hasAttribute("data-mint-sortable-status") || n.push(a.getAttribute(t) ?? "");
|
|
11483
12490
|
}
|
|
11484
12491
|
return n;
|
|
11485
12492
|
}
|
|
@@ -11505,7 +12512,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11505
12512
|
_syncKeyboardAccessibility() {
|
|
11506
12513
|
let e = this._resolveListRoot();
|
|
11507
12514
|
e.hasAttribute("role") || e.setAttribute("role", "list"), this._sortStatus || (this._sortStatus = document.createElement("div"), this._sortStatus.className = "mint-sortable-status", this._sortStatus.setAttribute("role", "status"), this._sortStatus.setAttribute("aria-live", "polite"), this._sortStatus.setAttribute("aria-atomic", "true"), this._sortStatus.setAttribute("data-mint-sortable-status", ""), this.appendChild(this._sortStatus)), this._getLayoutChildren().forEach((e) => {
|
|
11508
|
-
e.classList.contains(
|
|
12515
|
+
e.classList.contains(U) || (e.hasAttribute("role") || e.setAttribute("role", "listitem"), e.hasAttribute("tabindex") || (e.tabIndex = 0), e.setAttribute("aria-keyshortcuts", "Alt+ArrowUp Alt+ArrowDown"), e.hasAttribute("aria-roledescription") || e.setAttribute("aria-roledescription", "sortable item"));
|
|
11509
12516
|
});
|
|
11510
12517
|
}
|
|
11511
12518
|
_onKeyboardReorder(e) {
|
|
@@ -11514,7 +12521,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11514
12521
|
if (n && n !== this) return;
|
|
11515
12522
|
let r = t ? this._closestSortableItem(t) : null;
|
|
11516
12523
|
if (!r || r.hasAttribute("data-sortable-disabled")) return;
|
|
11517
|
-
let i = this._getLayoutChildren().filter((e) => !e.classList.contains(
|
|
12524
|
+
let i = this._getLayoutChildren().filter((e) => !e.classList.contains(U)), a = i.indexOf(r), o = a + (e.key === "ArrowUp" ? -1 : 1);
|
|
11518
12525
|
if (a < 0 || o < 0 || o >= i.length) return;
|
|
11519
12526
|
e.preventDefault();
|
|
11520
12527
|
let s = i[o];
|
|
@@ -11589,7 +12596,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11589
12596
|
for (; t && t !== this._listRoot;) {
|
|
11590
12597
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
11591
12598
|
let e = t;
|
|
11592
|
-
if (e.classList.contains(
|
|
12599
|
+
if (e.classList.contains(U) || e.classList.contains(W)) return null;
|
|
11593
12600
|
if (t.parentElement === this._listRoot) return e;
|
|
11594
12601
|
}
|
|
11595
12602
|
t = t.parentElement;
|
|
@@ -11601,7 +12608,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11601
12608
|
let n = t.getBoundingClientRect();
|
|
11602
12609
|
this._pointerStartX = e.clientX, this._pointerStartY = e.clientY;
|
|
11603
12610
|
let r = document.createElement("div");
|
|
11604
|
-
r.className =
|
|
12611
|
+
r.className = U, r.style.minHeight = `${n.height}px`, r.style.minWidth = `${n.width}px`, r.setAttribute("aria-hidden", "true"), this._placeholder = r, this._listRoot.insertBefore(r, t), t.classList.add(W), t.style.position = "fixed", t.style.left = `${n.left}px`, t.style.top = `${n.top}px`, t.style.width = `${n.width}px`, t.style.height = `${n.height}px`, t.style.margin = "0", t.style.zIndex = "10000", t.style.boxSizing = "border-box", t.style.pointerEvents = "none", t.style.touchAction = "none", t.style.transform = "translate3d(0, 0, 0) scale(1.015)", t.style.transformOrigin = "center center", t.style.willChange = "transform", t.setPointerCapture(e.pointerId);
|
|
11605
12612
|
let i = this._collectOrderedKeys(), a = {
|
|
11606
12613
|
index: this._startIndex,
|
|
11607
12614
|
keys: i
|
|
@@ -11622,7 +12629,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11622
12629
|
let r = this._listRoot.children[n];
|
|
11623
12630
|
if (r.nodeType !== Node.ELEMENT_NODE) continue;
|
|
11624
12631
|
let i = r;
|
|
11625
|
-
if (!i.classList.contains(
|
|
12632
|
+
if (!i.classList.contains(U)) {
|
|
11626
12633
|
if (i === e) return t;
|
|
11627
12634
|
t++;
|
|
11628
12635
|
}
|
|
@@ -11774,7 +12781,7 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11774
12781
|
let e = this._originListRoot ?? this._listRoot, n = this._originNextSibling ?? this._restoreAfter;
|
|
11775
12782
|
n && n.parentNode === e ? e.insertBefore(t, n) : e.appendChild(t);
|
|
11776
12783
|
} else n?.parentNode && n.parentNode.insertBefore(t, n);
|
|
11777
|
-
n?.remove(), this._placeholder = null, t.classList.remove(
|
|
12784
|
+
n?.remove(), this._placeholder = null, t.classList.remove(W), t.style.cssText = "";
|
|
11778
12785
|
let d = u ? s : r._indexOfItem(t);
|
|
11779
12786
|
this._pointerId = null, this._dragEl = null, this._restoreAfter = null, this._originListRoot = null, this._originNextSibling = null, this._dropList = null, this._dropAtEnd = !1, this._dropRejected = !1;
|
|
11780
12787
|
let f = this._collectOrderedKeys(), p = r._collectOrderedKeys(), m = !u && (!u && a !== o || d !== s), h = t.getAttribute(this._getItemKeyAttribute()) || "", g = {
|
|
@@ -11820,15 +12827,15 @@ var $n = Qn, V = "mint-sortable-placeholder", H = "mint-sortable-dragging", er =
|
|
|
11820
12827
|
try {
|
|
11821
12828
|
this._pointerId !== null && this._dragEl.releasePointerCapture(this._pointerId);
|
|
11822
12829
|
} catch {}
|
|
11823
|
-
this._dragEl.classList.remove(
|
|
12830
|
+
this._dragEl.classList.remove(W), this._dragEl.style.cssText = "";
|
|
11824
12831
|
}
|
|
11825
12832
|
this._placeholder?.remove(), this._placeholder = null, this._dragEl = null, this._pointerId = null, this._restoreAfter = null, this._originListRoot = null, this._originNextSibling = null, this._dropList = null, this._dropRejected = !1;
|
|
11826
12833
|
}
|
|
11827
12834
|
};
|
|
11828
|
-
customElements.get("mint-sortable") || a("mint-sortable",
|
|
12835
|
+
customElements.get("mint-sortable") || a("mint-sortable", ar);
|
|
11829
12836
|
//#endregion
|
|
11830
12837
|
//#region src/components/tabs/Tab.ts
|
|
11831
|
-
var
|
|
12838
|
+
var or = class extends HTMLElement {
|
|
11832
12839
|
static get observedAttributes() {
|
|
11833
12840
|
return [
|
|
11834
12841
|
"active",
|
|
@@ -11887,10 +12894,10 @@ var tr = class extends HTMLElement {
|
|
|
11887
12894
|
})));
|
|
11888
12895
|
}
|
|
11889
12896
|
};
|
|
11890
|
-
customElements.get("mint-tab") || a("mint-tab",
|
|
12897
|
+
customElements.get("mint-tab") || a("mint-tab", or);
|
|
11891
12898
|
//#endregion
|
|
11892
12899
|
//#region src/components/tabs/TabList.ts
|
|
11893
|
-
var
|
|
12900
|
+
var sr = class extends HTMLElement {
|
|
11894
12901
|
static get observedAttributes() {
|
|
11895
12902
|
return ["position"];
|
|
11896
12903
|
}
|
|
@@ -11910,10 +12917,10 @@ var nr = class extends HTMLElement {
|
|
|
11910
12917
|
this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical");
|
|
11911
12918
|
}
|
|
11912
12919
|
};
|
|
11913
|
-
customElements.get("mint-tab-list") || a("mint-tab-list",
|
|
12920
|
+
customElements.get("mint-tab-list") || a("mint-tab-list", sr);
|
|
11914
12921
|
//#endregion
|
|
11915
12922
|
//#region src/components/tabs/TabContent.ts
|
|
11916
|
-
var
|
|
12923
|
+
var cr = class extends HTMLElement {
|
|
11917
12924
|
static get observedAttributes() {
|
|
11918
12925
|
return ["id"];
|
|
11919
12926
|
}
|
|
@@ -11951,10 +12958,10 @@ var rr = class extends HTMLElement {
|
|
|
11951
12958
|
this.setAttribute("role", "tabpanel"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0");
|
|
11952
12959
|
}
|
|
11953
12960
|
};
|
|
11954
|
-
customElements.get("mint-tab-content") || a("mint-tab-content",
|
|
12961
|
+
customElements.get("mint-tab-content") || a("mint-tab-content", cr);
|
|
11955
12962
|
//#endregion
|
|
11956
12963
|
//#region src/components/tabs/Tabs.ts
|
|
11957
|
-
var
|
|
12964
|
+
var lr = class e extends HTMLElement {
|
|
11958
12965
|
static {
|
|
11959
12966
|
this._id = 0;
|
|
11960
12967
|
}
|
|
@@ -12060,10 +13067,10 @@ var ir = class e extends HTMLElement {
|
|
|
12060
13067
|
});
|
|
12061
13068
|
}
|
|
12062
13069
|
};
|
|
12063
|
-
customElements.get("mint-tabs") || a("mint-tabs",
|
|
13070
|
+
customElements.get("mint-tabs") || a("mint-tabs", lr);
|
|
12064
13071
|
//#endregion
|
|
12065
13072
|
//#region src/components/tags/Tags.ts
|
|
12066
|
-
var
|
|
13073
|
+
var ur = class extends HTMLElement {
|
|
12067
13074
|
constructor(...e) {
|
|
12068
13075
|
super(...e), this._container = null, this._chipsWrap = null, this._input = null, this._tags = [], this._predefinedTags = [], this._placeholder = "Add tag", this._predefinedPopoverOpenListenersAttached = !1, this._predefinedBlurCloseTimer = null, this._suppressNextPredefinedBlurClose = !1, this._dragIndex = null, this._dragChip = null, this._isPointerDragging = !1, this._pointerMoveHandler = null, this._pointerUpHandler = null, this._containerFocusRingListeners = !1, this._predefinedFieldResizeObserver = null, this._predefinedPopoverBodyEl = null;
|
|
12069
13076
|
}
|
|
@@ -12370,457 +13377,116 @@ var ar = class extends HTMLElement {
|
|
|
12370
13377
|
}
|
|
12371
13378
|
_focusLastChip() {
|
|
12372
13379
|
let e = this._chipsWrap?.querySelectorAll("mint-chip");
|
|
12373
|
-
e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
|
|
12374
|
-
}
|
|
12375
|
-
_focusInput() {
|
|
12376
|
-
setTimeout(() => {
|
|
12377
|
-
this._input?.focus({ preventScroll: !0 });
|
|
12378
|
-
}, 10);
|
|
12379
|
-
}
|
|
12380
|
-
_wireInputBackspace() {
|
|
12381
|
-
this._input && this._input.addEventListener("keydown", (e) => {
|
|
12382
|
-
e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
|
|
12383
|
-
});
|
|
12384
|
-
}
|
|
12385
|
-
_setupChipEvents(e, t) {
|
|
12386
|
-
e.tabIndex = 0, e.addEventListener("keydown", (e) => {
|
|
12387
|
-
(e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
|
|
12388
|
-
});
|
|
12389
|
-
}
|
|
12390
|
-
_onContainerPointerDown(e) {
|
|
12391
|
-
if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
|
|
12392
|
-
let t = e.composedPath();
|
|
12393
|
-
if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
|
|
12394
|
-
this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
|
|
12395
|
-
try {
|
|
12396
|
-
this._input.focus({ preventScroll: !0 });
|
|
12397
|
-
} catch {}
|
|
12398
|
-
this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
|
|
12399
|
-
}
|
|
12400
|
-
}
|
|
12401
|
-
_onDragStart(e, t) {
|
|
12402
|
-
this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
|
|
12403
|
-
}
|
|
12404
|
-
_reorderTags(e, t) {
|
|
12405
|
-
if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
|
|
12406
|
-
let n = [...this._tags], [r] = n.splice(e, 1);
|
|
12407
|
-
n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
|
|
12408
|
-
}
|
|
12409
|
-
_onDragOverInput(e) {
|
|
12410
|
-
this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
|
|
12411
|
-
}
|
|
12412
|
-
_onDragOverChip(e, t) {
|
|
12413
|
-
if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
|
|
12414
|
-
let n = t.getBoundingClientRect();
|
|
12415
|
-
if (e.clientX < n.left + n.width * .5) {
|
|
12416
|
-
if (this._dragChip.nextSibling === t) return;
|
|
12417
|
-
this._chipsWrap.insertBefore(this._dragChip, t);
|
|
12418
|
-
} else {
|
|
12419
|
-
if (t.nextSibling === this._dragChip) return;
|
|
12420
|
-
let e = t.nextSibling;
|
|
12421
|
-
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
12422
|
-
}
|
|
12423
|
-
}
|
|
12424
|
-
_onDrop(e) {
|
|
12425
|
-
this.hasAttribute("sortable") && e.preventDefault();
|
|
12426
|
-
}
|
|
12427
|
-
_onDragEnd() {
|
|
12428
|
-
this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
12429
|
-
}
|
|
12430
|
-
_syncOrderFromDom() {
|
|
12431
|
-
if (!this._chipsWrap) return;
|
|
12432
|
-
let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
|
|
12433
|
-
if (e.length === 0) return;
|
|
12434
|
-
let t = [];
|
|
12435
|
-
e.forEach((e) => {
|
|
12436
|
-
let n = e.dataset.value;
|
|
12437
|
-
if (!n) return;
|
|
12438
|
-
let r = this._tags.find((e) => e.value === n);
|
|
12439
|
-
r && t.push(r);
|
|
12440
|
-
}), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
|
|
12441
|
-
}
|
|
12442
|
-
_onPointerDown(e, t) {
|
|
12443
|
-
if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
|
|
12444
|
-
this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
|
|
12445
|
-
try {
|
|
12446
|
-
t.setPointerCapture(e.pointerId);
|
|
12447
|
-
} catch {}
|
|
12448
|
-
t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
|
|
12449
|
-
}
|
|
12450
|
-
}
|
|
12451
|
-
_onPointerMove(e) {
|
|
12452
|
-
if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
|
|
12453
|
-
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
12454
|
-
if (!t) return;
|
|
12455
|
-
let n = t.closest("mint-chip");
|
|
12456
|
-
if (n && n !== this._dragChip) {
|
|
12457
|
-
let t = n.getBoundingClientRect();
|
|
12458
|
-
if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
|
|
12459
|
-
else if (n.nextSibling !== this._dragChip) {
|
|
12460
|
-
let e = n.nextSibling;
|
|
12461
|
-
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
12462
|
-
}
|
|
12463
|
-
return;
|
|
12464
|
-
}
|
|
12465
|
-
this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
|
|
12466
|
-
}
|
|
12467
|
-
_onPointerUp(e) {
|
|
12468
|
-
if (this._isPointerDragging) {
|
|
12469
|
-
if (this._isPointerDragging = !1, this._dragChip) {
|
|
12470
|
-
try {
|
|
12471
|
-
this._dragChip.releasePointerCapture(e.pointerId);
|
|
12472
|
-
} catch {}
|
|
12473
|
-
this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
|
|
12474
|
-
}
|
|
12475
|
-
this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
12476
|
-
}
|
|
12477
|
-
}
|
|
12478
|
-
};
|
|
12479
|
-
customElements.get("mint-tags") || a("mint-tags", ar);
|
|
12480
|
-
//#endregion
|
|
12481
|
-
//#region src/components/time-picker/TimePicker.ts
|
|
12482
|
-
var or = class extends HTMLElement {
|
|
12483
|
-
constructor(...e) {
|
|
12484
|
-
super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
|
|
12485
|
-
hour: 9,
|
|
12486
|
-
minute: 0,
|
|
12487
|
-
second: 0,
|
|
12488
|
-
meridiem: "AM"
|
|
12489
|
-
}, this._rangeStart = {
|
|
12490
|
-
hour: 9,
|
|
12491
|
-
minute: 0,
|
|
12492
|
-
second: 0,
|
|
12493
|
-
meridiem: "AM"
|
|
12494
|
-
}, this._rangeEnd = {
|
|
12495
|
-
hour: 5,
|
|
12496
|
-
minute: 0,
|
|
12497
|
-
second: 0,
|
|
12498
|
-
meridiem: "PM"
|
|
12499
|
-
}, this._invalidFromInput = !1;
|
|
12500
|
-
}
|
|
12501
|
-
static get observedAttributes() {
|
|
12502
|
-
return [
|
|
12503
|
-
"value",
|
|
12504
|
-
"label",
|
|
12505
|
-
"info",
|
|
12506
|
-
"disabled",
|
|
12507
|
-
"id",
|
|
12508
|
-
"name",
|
|
12509
|
-
"required",
|
|
12510
|
-
"readonly",
|
|
12511
|
-
"range",
|
|
12512
|
-
"hours",
|
|
12513
|
-
"minutes",
|
|
12514
|
-
"seconds",
|
|
12515
|
-
"error",
|
|
12516
|
-
"error-message"
|
|
12517
|
-
];
|
|
12518
|
-
}
|
|
12519
|
-
connectedCallback() {
|
|
12520
|
-
this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
|
|
12521
|
-
}
|
|
12522
|
-
disconnectedCallback() {
|
|
12523
|
-
this._popoverObserver &&= (this._popoverObserver.disconnect(), null);
|
|
12524
|
-
}
|
|
12525
|
-
attributeChangedCallback(e, t, n) {
|
|
12526
|
-
if (t !== n) {
|
|
12527
|
-
if (e === "value") {
|
|
12528
|
-
if (this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue(), this._popover) {
|
|
12529
|
-
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
12530
|
-
e && this._buildPopoverContent(e);
|
|
12531
|
-
}
|
|
12532
|
-
return;
|
|
12533
|
-
}
|
|
12534
|
-
e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
|
|
12535
|
-
}
|
|
12536
|
-
}
|
|
12537
|
-
get value() {
|
|
12538
|
-
return this.getValue();
|
|
12539
|
-
}
|
|
12540
|
-
set value(e) {
|
|
12541
|
-
this.setValue(e || "");
|
|
12542
|
-
}
|
|
12543
|
-
getValue() {
|
|
12544
|
-
return this.getAttribute("value") || "";
|
|
12545
|
-
}
|
|
12546
|
-
setValue(e) {
|
|
12547
|
-
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
12548
|
-
}
|
|
12549
|
-
isRange() {
|
|
12550
|
-
return this.getAttribute("range") === "true";
|
|
12551
|
-
}
|
|
12552
|
-
isHoursEnabled() {
|
|
12553
|
-
let e = this.getAttribute("hours");
|
|
12554
|
-
return e === null ? !0 : e !== "false";
|
|
12555
|
-
}
|
|
12556
|
-
isMinutesEnabled() {
|
|
12557
|
-
let e = this.getAttribute("minutes");
|
|
12558
|
-
return e === null ? !0 : e !== "false";
|
|
12559
|
-
}
|
|
12560
|
-
isSecondsEnabled() {
|
|
12561
|
-
let e = this.getAttribute("seconds");
|
|
12562
|
-
return e === null ? !1 : e !== "false";
|
|
12563
|
-
}
|
|
12564
|
-
isDisabled() {
|
|
12565
|
-
return this.getAttribute("disabled") === "true";
|
|
12566
|
-
}
|
|
12567
|
-
isReadonly() {
|
|
12568
|
-
return this.getAttribute("readonly") === "true";
|
|
12569
|
-
}
|
|
12570
|
-
isRequired() {
|
|
12571
|
-
return this.getAttribute("required") === "true";
|
|
12572
|
-
}
|
|
12573
|
-
hasExternalError() {
|
|
12574
|
-
return this.getAttribute("error") === "true";
|
|
12575
|
-
}
|
|
12576
|
-
getExternalErrorMessage() {
|
|
12577
|
-
return this.getAttribute("error-message") || "";
|
|
12578
|
-
}
|
|
12579
|
-
getLabel() {
|
|
12580
|
-
return this.getAttribute("label") || "";
|
|
12581
|
-
}
|
|
12582
|
-
getInfo() {
|
|
12583
|
-
return this.getAttribute("info") || "";
|
|
12584
|
-
}
|
|
12585
|
-
getName() {
|
|
12586
|
-
return this.getAttribute("name") || "";
|
|
12587
|
-
}
|
|
12588
|
-
_getEffectiveError() {
|
|
12589
|
-
return {
|
|
12590
|
-
hasError: this.hasExternalError(),
|
|
12591
|
-
message: this.getExternalErrorMessage()
|
|
12592
|
-
};
|
|
12593
|
-
}
|
|
12594
|
-
_formatParts(e) {
|
|
12595
|
-
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
|
|
12596
|
-
return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
|
|
12597
|
-
}
|
|
12598
|
-
_to24Hour(e) {
|
|
12599
|
-
let t = e.hour % 12;
|
|
12600
|
-
return e.meridiem === "PM" && (t += 12), {
|
|
12601
|
-
hour: t,
|
|
12602
|
-
minute: e.minute,
|
|
12603
|
-
second: e.second
|
|
12604
|
-
};
|
|
12605
|
-
}
|
|
12606
|
-
_formatParts24(e) {
|
|
12607
|
-
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
|
|
12608
|
-
return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
|
|
12609
|
-
}
|
|
12610
|
-
_getDisplayValue() {
|
|
12611
|
-
return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
|
|
12612
|
-
}
|
|
12613
|
-
_getOutputValue() {
|
|
12614
|
-
return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
|
|
12615
|
-
}
|
|
12616
|
-
_getExpectedFormat() {
|
|
12617
|
-
let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
|
|
12618
|
-
e && r.push("h"), t && r.push("mm"), n && r.push("ss");
|
|
12619
|
-
let i = e ? `${r.join(":")} am/pm` : r.join(":");
|
|
12620
|
-
return this.isRange() ? `${i} - ${i}` : i;
|
|
13380
|
+
e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
|
|
12621
13381
|
}
|
|
12622
|
-
|
|
12623
|
-
|
|
13382
|
+
_focusInput() {
|
|
13383
|
+
setTimeout(() => {
|
|
13384
|
+
this._input?.focus({ preventScroll: !0 });
|
|
13385
|
+
}, 10);
|
|
12624
13386
|
}
|
|
12625
|
-
|
|
12626
|
-
this.
|
|
13387
|
+
_wireInputBackspace() {
|
|
13388
|
+
this._input && this._input.addEventListener("keydown", (e) => {
|
|
13389
|
+
e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
|
|
13390
|
+
});
|
|
12627
13391
|
}
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
composed: !0
|
|
12633
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
13392
|
+
_setupChipEvents(e, t) {
|
|
13393
|
+
e.tabIndex = 0, e.addEventListener("keydown", (e) => {
|
|
13394
|
+
(e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
|
|
13395
|
+
});
|
|
12634
13396
|
}
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
second: o,
|
|
12645
|
-
meridiem: s
|
|
12646
|
-
};
|
|
13397
|
+
_onContainerPointerDown(e) {
|
|
13398
|
+
if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
|
|
13399
|
+
let t = e.composedPath();
|
|
13400
|
+
if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
|
|
13401
|
+
this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
|
|
13402
|
+
try {
|
|
13403
|
+
this._input.focus({ preventScroll: !0 });
|
|
13404
|
+
} catch {}
|
|
13405
|
+
this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
|
|
12647
13406
|
}
|
|
12648
|
-
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
12649
|
-
if (!a) return null;
|
|
12650
|
-
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
12651
|
-
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
12652
|
-
hour: 12,
|
|
12653
|
-
minute: o,
|
|
12654
|
-
second: s,
|
|
12655
|
-
meridiem: "AM"
|
|
12656
|
-
};
|
|
12657
13407
|
}
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
if (t) {
|
|
12661
|
-
let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
|
|
12662
|
-
if (!e) return null;
|
|
12663
|
-
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
|
|
12664
|
-
if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
|
|
12665
|
-
let s = t >= 12 ? "PM" : "AM";
|
|
12666
|
-
return {
|
|
12667
|
-
hour: t % 12 == 0 ? 12 : t % 12,
|
|
12668
|
-
minute: a,
|
|
12669
|
-
second: o,
|
|
12670
|
-
meridiem: s
|
|
12671
|
-
};
|
|
12672
|
-
}
|
|
12673
|
-
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
12674
|
-
if (!a) return null;
|
|
12675
|
-
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
12676
|
-
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
12677
|
-
hour: 12,
|
|
12678
|
-
minute: o,
|
|
12679
|
-
second: s,
|
|
12680
|
-
meridiem: "AM"
|
|
12681
|
-
};
|
|
13408
|
+
_onDragStart(e, t) {
|
|
13409
|
+
this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
|
|
12682
13410
|
}
|
|
12683
|
-
|
|
12684
|
-
if (
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
12688
|
-
}
|
|
12689
|
-
let t = this._parseSingleOutput24(e);
|
|
12690
|
-
return t ? (this._single = t, !0) : !1;
|
|
13411
|
+
_reorderTags(e, t) {
|
|
13412
|
+
if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
|
|
13413
|
+
let n = [...this._tags], [r] = n.splice(e, 1);
|
|
13414
|
+
n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
|
|
12691
13415
|
}
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
if (this.isRange()) {
|
|
12695
|
-
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
|
|
12696
|
-
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
12697
|
-
}
|
|
12698
|
-
let t = this._parseSingle(e);
|
|
12699
|
-
return t ? (this._single = t, !0) : !1;
|
|
13416
|
+
_onDragOverInput(e) {
|
|
13417
|
+
this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
|
|
12700
13418
|
}
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
return;
|
|
12706
|
-
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
12712
|
-
return;
|
|
13419
|
+
_onDragOverChip(e, t) {
|
|
13420
|
+
if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
|
|
13421
|
+
let n = t.getBoundingClientRect();
|
|
13422
|
+
if (e.clientX < n.left + n.width * .5) {
|
|
13423
|
+
if (this._dragChip.nextSibling === t) return;
|
|
13424
|
+
this._chipsWrap.insertBefore(this._dragChip, t);
|
|
13425
|
+
} else {
|
|
13426
|
+
if (t.nextSibling === this._dragChip) return;
|
|
13427
|
+
let e = t.nextSibling;
|
|
13428
|
+
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
12713
13429
|
}
|
|
12714
|
-
this._invalidFromInput = !1;
|
|
12715
|
-
let n = this._getOutputValue();
|
|
12716
|
-
this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
12717
|
-
bubbles: !0,
|
|
12718
|
-
composed: !0
|
|
12719
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
12720
|
-
}
|
|
12721
|
-
_buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
|
|
12722
|
-
let o = document.createElement("div");
|
|
12723
|
-
return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
|
|
12724
|
-
let r = document.createElement("button");
|
|
12725
|
-
r.type = "button";
|
|
12726
|
-
let i = e === t;
|
|
12727
|
-
r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
|
|
12728
|
-
}), o;
|
|
12729
13430
|
}
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
if (!n) return;
|
|
12733
|
-
let r = n.offsetTop - (e.clientHeight / 2 - n.clientHeight / 2) - t;
|
|
12734
|
-
e.scrollTop = Math.max(0, r);
|
|
13431
|
+
_onDrop(e) {
|
|
13432
|
+
this.hasAttribute("sortable") && e.preventDefault();
|
|
12735
13433
|
}
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
12739
|
-
if (!e) return;
|
|
12740
|
-
let t = Array.from(e.querySelectorAll(".mint-time-picker-column")), n = this.isRange() ? 20 : 0;
|
|
12741
|
-
t.forEach((e) => this._centerSelectedInColumn(e, n));
|
|
13434
|
+
_onDragEnd() {
|
|
13435
|
+
this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
12742
13436
|
}
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
}));
|
|
13437
|
+
_syncOrderFromDom() {
|
|
13438
|
+
if (!this._chipsWrap) return;
|
|
13439
|
+
let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
|
|
13440
|
+
if (e.length === 0) return;
|
|
13441
|
+
let t = [];
|
|
13442
|
+
e.forEach((e) => {
|
|
13443
|
+
let n = e.dataset.value;
|
|
13444
|
+
if (!n) return;
|
|
13445
|
+
let r = this._tags.find((e) => e.value === n);
|
|
13446
|
+
r && t.push(r);
|
|
13447
|
+
}), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
|
|
12754
13448
|
}
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
});
|
|
12764
|
-
}, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
|
|
12765
|
-
n({
|
|
12766
|
-
...t,
|
|
12767
|
-
minute: Number(e)
|
|
12768
|
-
});
|
|
12769
|
-
}, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
|
|
12770
|
-
n({
|
|
12771
|
-
...t,
|
|
12772
|
-
second: Number(e)
|
|
12773
|
-
});
|
|
12774
|
-
}, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
|
|
12775
|
-
n({
|
|
12776
|
-
...t,
|
|
12777
|
-
meridiem: e
|
|
12778
|
-
});
|
|
12779
|
-
}, !0, "compact", "Meridiem")), f.forEach((e, t) => {
|
|
12780
|
-
t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
|
|
12781
|
-
}), e.appendChild(o);
|
|
13449
|
+
_onPointerDown(e, t) {
|
|
13450
|
+
if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
|
|
13451
|
+
this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
|
|
13452
|
+
try {
|
|
13453
|
+
t.setPointerCapture(e.pointerId);
|
|
13454
|
+
} catch {}
|
|
13455
|
+
t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
|
|
13456
|
+
}
|
|
12782
13457
|
}
|
|
12783
|
-
|
|
12784
|
-
if (
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
|
|
13458
|
+
_onPointerMove(e) {
|
|
13459
|
+
if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
|
|
13460
|
+
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
13461
|
+
if (!t) return;
|
|
13462
|
+
let n = t.closest("mint-chip");
|
|
13463
|
+
if (n && n !== this._dragChip) {
|
|
13464
|
+
let t = n.getBoundingClientRect();
|
|
13465
|
+
if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
|
|
13466
|
+
else if (n.nextSibling !== this._dragChip) {
|
|
13467
|
+
let e = n.nextSibling;
|
|
13468
|
+
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
13469
|
+
}
|
|
12788
13470
|
return;
|
|
12789
13471
|
}
|
|
12790
|
-
|
|
12791
|
-
t.className = "mint-time-picker-range";
|
|
12792
|
-
let n = document.createElement("div"), r = document.createElement("mint-text");
|
|
12793
|
-
r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
|
|
12794
|
-
this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
12795
|
-
});
|
|
12796
|
-
let i = document.createElement("div"), a = document.createElement("mint-text");
|
|
12797
|
-
a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
|
|
12798
|
-
this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
12799
|
-
}), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
|
|
12800
|
-
this._centerAllColumnsInPopoverBody();
|
|
12801
|
-
});
|
|
13472
|
+
this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
|
|
12802
13473
|
}
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
let r = n.target;
|
|
12814
|
-
this._handleTypedValue((r?.value || "").toString());
|
|
12815
|
-
}, !0), r.appendChild(this._inputEl), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput(), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false");
|
|
12816
|
-
let i = document.createElement("div");
|
|
12817
|
-
i.setAttribute("data-mint-time-picker-body", "true"), i.className = "mint-time-picker-popover", this._buildPopoverContent(i), this._popover.appendChild(i), r.appendChild(this._popover), this._setupPopoverOpenObserver(), this.appendChild(r);
|
|
13474
|
+
_onPointerUp(e) {
|
|
13475
|
+
if (this._isPointerDragging) {
|
|
13476
|
+
if (this._isPointerDragging = !1, this._dragChip) {
|
|
13477
|
+
try {
|
|
13478
|
+
this._dragChip.releasePointerCapture(e.pointerId);
|
|
13479
|
+
} catch {}
|
|
13480
|
+
this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
|
|
13481
|
+
}
|
|
13482
|
+
this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
13483
|
+
}
|
|
12818
13484
|
}
|
|
12819
13485
|
};
|
|
12820
|
-
customElements.get("mint-
|
|
13486
|
+
customElements.get("mint-tags") || a("mint-tags", ur);
|
|
12821
13487
|
//#endregion
|
|
12822
13488
|
//#region src/components/toast/Toast.ts
|
|
12823
|
-
var
|
|
13489
|
+
var dr = class extends HTMLElement {
|
|
12824
13490
|
constructor(...e) {
|
|
12825
13491
|
super(...e), this._messageEl = null, this._hideTimer = null, this._hideResolve = null, this._bottomNavObserver = null, this._bodyObserver = null;
|
|
12826
13492
|
}
|
|
@@ -12897,11 +13563,11 @@ var sr = class extends HTMLElement {
|
|
|
12897
13563
|
this.classList.toggle("mint-toast-is-open", e), this._messageEl ||= (this.innerHTML = "<div class=\"mint-toast-surface\">\n <span data-mint-toast-message></span>\n </div>", this.querySelector("[data-mint-toast-message]")), this._messageEl && (this._messageEl.textContent = t);
|
|
12898
13564
|
}
|
|
12899
13565
|
};
|
|
12900
|
-
customElements.get("mint-toast") || a("mint-toast",
|
|
13566
|
+
customElements.get("mint-toast") || a("mint-toast", dr);
|
|
12901
13567
|
//#endregion
|
|
12902
13568
|
//#region src/components/toast/ToastApi.ts
|
|
12903
|
-
var
|
|
12904
|
-
function
|
|
13569
|
+
var fr = 2200, pr = [], G = !1, K = null;
|
|
13570
|
+
function mr() {
|
|
12905
13571
|
return typeof document > "u" || document.body ? Promise.resolve() : new Promise((e) => {
|
|
12906
13572
|
if (typeof window > "u") {
|
|
12907
13573
|
e();
|
|
@@ -12912,47 +13578,47 @@ function lr() {
|
|
|
12912
13578
|
}, { once: !0 });
|
|
12913
13579
|
});
|
|
12914
13580
|
}
|
|
12915
|
-
async function
|
|
12916
|
-
if (await
|
|
13581
|
+
async function hr() {
|
|
13582
|
+
if (await mr(), typeof document > "u") throw Error("mintui.toast is only available in browser environments.");
|
|
12917
13583
|
let e = document.querySelector("mint-toast[data-mint-toast-root=\"true\"]");
|
|
12918
13584
|
if (e) return e;
|
|
12919
13585
|
let t = document.createElement("mint-toast");
|
|
12920
13586
|
return t.setAttribute("data-mint-toast-root", "true"), document.body.appendChild(t), t;
|
|
12921
13587
|
}
|
|
12922
|
-
async function
|
|
12923
|
-
if (!
|
|
12924
|
-
|
|
13588
|
+
async function gr() {
|
|
13589
|
+
if (!G) {
|
|
13590
|
+
G = !0;
|
|
12925
13591
|
try {
|
|
12926
|
-
for (;
|
|
12927
|
-
let e =
|
|
13592
|
+
for (; pr.length > 0;) {
|
|
13593
|
+
let e = pr.shift();
|
|
12928
13594
|
if (!e) continue;
|
|
12929
13595
|
let t = e.message.trim().slice(0, 120);
|
|
12930
13596
|
if (!t) continue;
|
|
12931
|
-
let n = await
|
|
12932
|
-
|
|
12933
|
-
let r = e.options?.duration ??
|
|
13597
|
+
let n = await hr();
|
|
13598
|
+
K = n;
|
|
13599
|
+
let r = e.options?.duration ?? fr, i = e.options?.type ?? "neutral";
|
|
12934
13600
|
await n.showToast(t, r, i);
|
|
12935
13601
|
}
|
|
12936
13602
|
} finally {
|
|
12937
|
-
|
|
13603
|
+
G = !1, K = null;
|
|
12938
13604
|
}
|
|
12939
13605
|
}
|
|
12940
13606
|
}
|
|
12941
|
-
function
|
|
12942
|
-
typeof window > "u" || (
|
|
13607
|
+
function _r(e, t) {
|
|
13608
|
+
typeof window > "u" || (pr.push({
|
|
12943
13609
|
message: e,
|
|
12944
13610
|
options: t
|
|
12945
|
-
}),
|
|
13611
|
+
}), G && K && K.hideToast(), gr());
|
|
12946
13612
|
}
|
|
12947
|
-
var
|
|
13613
|
+
var vr = { toast: _r };
|
|
12948
13614
|
if (typeof window < "u") {
|
|
12949
13615
|
let e = window.mintui || {};
|
|
12950
|
-
e.toast =
|
|
13616
|
+
e.toast = _r, window.mintui = e;
|
|
12951
13617
|
}
|
|
12952
13618
|
//#endregion
|
|
12953
13619
|
//#region src/components/tree/tree-utils.js
|
|
12954
13620
|
function q(e = []) {
|
|
12955
|
-
|
|
13621
|
+
xr(e);
|
|
12956
13622
|
let t = (e) => e.map((e) => ({
|
|
12957
13623
|
...e,
|
|
12958
13624
|
children: Array.isArray(e.children) ? t(e.children) : []
|
|
@@ -12981,11 +13647,11 @@ function Y(e, t, n = null) {
|
|
|
12981
13647
|
}
|
|
12982
13648
|
return null;
|
|
12983
13649
|
}
|
|
12984
|
-
function
|
|
13650
|
+
function yr(e, t, n = 0) {
|
|
12985
13651
|
let r = String(t);
|
|
12986
13652
|
for (let t of e) {
|
|
12987
13653
|
if (String(t.id) === r) return n;
|
|
12988
|
-
let e =
|
|
13654
|
+
let e = yr(t.children || [], r, n + 1);
|
|
12989
13655
|
if (e >= 0) return e;
|
|
12990
13656
|
}
|
|
12991
13657
|
return -1;
|
|
@@ -12994,10 +13660,10 @@ function X(e) {
|
|
|
12994
13660
|
let t = Array.isArray(e?.children) ? e.children : [];
|
|
12995
13661
|
return t.length ? 1 + Math.max(...t.map(X)) : 1;
|
|
12996
13662
|
}
|
|
12997
|
-
function
|
|
12998
|
-
return String(e.id) === String(t) ? !0 : (e.children || []).some((e) =>
|
|
13663
|
+
function br(e, t) {
|
|
13664
|
+
return String(e.id) === String(t) ? !0 : (e.children || []).some((e) => br(e, t));
|
|
12999
13665
|
}
|
|
13000
|
-
function
|
|
13666
|
+
function xr(e) {
|
|
13001
13667
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
13002
13668
|
for (let r of e) {
|
|
13003
13669
|
if (r.id === null || r.id === void 0 || String(r.id) === "") throw Error("Every tree item must have a non-empty identifier.");
|
|
@@ -13008,13 +13674,13 @@ function hr(e) {
|
|
|
13008
13674
|
};
|
|
13009
13675
|
n(e);
|
|
13010
13676
|
}
|
|
13011
|
-
function
|
|
13677
|
+
function Sr(e, t, n, r, i = {}) {
|
|
13012
13678
|
let a = q(e), o = Y(a, t);
|
|
13013
13679
|
if (!o) throw Error(`Tree item ${t} was not found.`);
|
|
13014
13680
|
if (o.item.disabled || o.item.draggable === !1) throw Error("Disabled tree items cannot be moved.");
|
|
13015
13681
|
let s = n == null || n === "" ? null : J(a, n);
|
|
13016
13682
|
if (n != null && n !== "" && !s) throw Error(`Target parent ${n} was not found.`);
|
|
13017
|
-
if (s &&
|
|
13683
|
+
if (s && br(o.item, s.id)) throw Error("A tree item cannot be moved inside itself or one of its descendants.");
|
|
13018
13684
|
if (s?.disabled) throw Error("Disabled tree items cannot contain children.");
|
|
13019
13685
|
if (i.allowNesting === !1 && s) throw Error("Nesting is disabled for this tree.");
|
|
13020
13686
|
if (s?.canHaveChildren === !1) throw Error("The target item cannot contain children.");
|
|
@@ -13022,7 +13688,7 @@ function gr(e, t, n, r, i = {}) {
|
|
|
13022
13688
|
let c = s ? s.children : a, l = o.siblings.findIndex((e) => String(e.id) === String(t)), [u] = o.siblings.splice(l, 1), d = Math.min(Math.max(0, Number.isFinite(r) ? Math.trunc(r) : c.length), c.length);
|
|
13023
13689
|
c.splice(d, 0, u);
|
|
13024
13690
|
let f = Number.isFinite(i.maxDepth) ? Math.max(1, Math.trunc(i.maxDepth)) : Infinity;
|
|
13025
|
-
if ((s ?
|
|
13691
|
+
if ((s ? yr(a, s.id) + 1 : 0) + X(u) > f) throw Error(`Moving this branch would exceed the maximum tree depth of ${f}.`);
|
|
13026
13692
|
return {
|
|
13027
13693
|
items: a,
|
|
13028
13694
|
item: u,
|
|
@@ -13034,7 +13700,7 @@ function gr(e, t, n, r, i = {}) {
|
|
|
13034
13700
|
}
|
|
13035
13701
|
//#endregion
|
|
13036
13702
|
//#region src/components/tree/Tree.ts
|
|
13037
|
-
var
|
|
13703
|
+
var Cr = 0;
|
|
13038
13704
|
function Z(e, t, n) {
|
|
13039
13705
|
e.dispatchEvent(new CustomEvent(t, {
|
|
13040
13706
|
bubbles: !0,
|
|
@@ -13042,7 +13708,7 @@ function Z(e, t, n) {
|
|
|
13042
13708
|
detail: n
|
|
13043
13709
|
}));
|
|
13044
13710
|
}
|
|
13045
|
-
function
|
|
13711
|
+
function wr(e, t) {
|
|
13046
13712
|
let n = e.getAttribute(t);
|
|
13047
13713
|
return n === "" || n === "true";
|
|
13048
13714
|
}
|
|
@@ -13051,7 +13717,7 @@ function Q(e) {
|
|
|
13051
13717
|
}
|
|
13052
13718
|
var $ = class extends HTMLElement {
|
|
13053
13719
|
constructor(...e) {
|
|
13054
|
-
super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++
|
|
13720
|
+
super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++Cr}`, this._liveRegion = null, this._dragExpansion = null, this._autoExpandedIds = /* @__PURE__ */ new Set(), this._dragHoverExpandedId = null, this._keyboardFocusRestore = null, this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer = null, this._onClick = (e) => {
|
|
13055
13721
|
let t = e.target instanceof Element ? e.target.closest("[data-tree-command]") : null;
|
|
13056
13722
|
if (!t || !this.contains(t)) return;
|
|
13057
13723
|
let n = t.getAttribute("data-tree-command"), r = t.getAttribute("data-tree-id");
|
|
@@ -13072,8 +13738,13 @@ var $ = class extends HTMLElement {
|
|
|
13072
13738
|
else if (n === "toggle" && r) {
|
|
13073
13739
|
let e = !this._expandedIds.has(r);
|
|
13074
13740
|
this._setExpanded(r, e, !0);
|
|
13075
|
-
} else if (n === "select" && r)
|
|
13076
|
-
|
|
13741
|
+
} else if (n === "select" && r) {
|
|
13742
|
+
if (this.classList.contains("mint-tree-drag-active") || this._suppressSelectionClick) {
|
|
13743
|
+
e.preventDefault(), this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer !== null && window.clearTimeout(this._selectionClickSuppressionTimer), this._selectionClickSuppressionTimer = null;
|
|
13744
|
+
return;
|
|
13745
|
+
}
|
|
13746
|
+
this._select(r);
|
|
13747
|
+
} else if (n === "create-child" && r) this._closeItemPopover(t), Z(this, "mint-tree-create", {
|
|
13077
13748
|
parentId: r,
|
|
13078
13749
|
items: this.items
|
|
13079
13750
|
});
|
|
@@ -13162,7 +13833,9 @@ var $ = class extends HTMLElement {
|
|
|
13162
13833
|
this._dragExpansion?.childList === n && (n.classList.add("mint-tree-drag-collapse"), n.style.height = "0px", i && r && (i.style.minHeight = `${r.getBoundingClientRect().height}px`));
|
|
13163
13834
|
});
|
|
13164
13835
|
}, this._onSortableEnd = (e) => {
|
|
13165
|
-
this.classList.remove("mint-tree-drag-active")
|
|
13836
|
+
this.classList.remove("mint-tree-drag-active"), this._suppressSelectionClick = !0, this._selectionClickSuppressionTimer !== null && window.clearTimeout(this._selectionClickSuppressionTimer), this._selectionClickSuppressionTimer = window.setTimeout(() => {
|
|
13837
|
+
this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer = null;
|
|
13838
|
+
}, 300);
|
|
13166
13839
|
let t = e.detail, n = t && !t.cancelled ? Q(t.newParentId) : null;
|
|
13167
13840
|
for (let e of this._autoExpandedIds) {
|
|
13168
13841
|
if (e === n) continue;
|
|
@@ -13287,7 +13960,7 @@ var $ = class extends HTMLElement {
|
|
|
13287
13960
|
this._root || (this._selectedId = Q(this.getAttribute("selected-id")), this._expandedIds = this.hasAttribute("expanded-ids") ? this._readExpandedIds(this.getAttribute("expanded-ids")) : this._defaultExpandedIds(this._items), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeydown, !0), this.addEventListener("mint-sortable-start", this._onSortableStart), this.addEventListener("mint-sortable-end", this._onSortableEnd), this.addEventListener("mint-sortable-drag", this._onSortableDrag), this.addEventListener("mint-sortable-drag-over", this._onSortableDragOver), this.addEventListener("mint-sortable-before-drop", this._onSortableBeforeDrop), this.addEventListener("mint-sortable-change", this._onSortableChange), this._render());
|
|
13288
13961
|
}
|
|
13289
13962
|
disconnectedCallback() {
|
|
13290
|
-
this._dragExpansion?.timer !== null && this._dragExpansion?.timer !== void 0 && window.clearTimeout(this._dragExpansion.timer), this._keyboardFocusRestore && window.clearTimeout(this._keyboardFocusRestore.timer), this._keyboardFocusRestore = null, this._dragExpansion = null, this._autoExpandedIds.clear(), this._dragHoverExpandedId = null, this.classList.remove("mint-tree-drag-active"), this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeydown, !0), this.removeEventListener("mint-sortable-start", this._onSortableStart), this.removeEventListener("mint-sortable-end", this._onSortableEnd), this.removeEventListener("mint-sortable-drag", this._onSortableDrag), this.removeEventListener("mint-sortable-drag-over", this._onSortableDragOver), this.removeEventListener("mint-sortable-before-drop", this._onSortableBeforeDrop), this.removeEventListener("mint-sortable-change", this._onSortableChange), this._root = null;
|
|
13963
|
+
this._dragExpansion?.timer !== null && this._dragExpansion?.timer !== void 0 && window.clearTimeout(this._dragExpansion.timer), this._keyboardFocusRestore && window.clearTimeout(this._keyboardFocusRestore.timer), this._selectionClickSuppressionTimer !== null && window.clearTimeout(this._selectionClickSuppressionTimer), this._selectionClickSuppressionTimer = null, this._suppressSelectionClick = !1, this._keyboardFocusRestore = null, this._dragExpansion = null, this._autoExpandedIds.clear(), this._dragHoverExpandedId = null, this.classList.remove("mint-tree-drag-active"), this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeydown, !0), this.removeEventListener("mint-sortable-start", this._onSortableStart), this.removeEventListener("mint-sortable-end", this._onSortableEnd), this.removeEventListener("mint-sortable-drag", this._onSortableDrag), this.removeEventListener("mint-sortable-drag-over", this._onSortableDragOver), this.removeEventListener("mint-sortable-before-drop", this._onSortableBeforeDrop), this.removeEventListener("mint-sortable-change", this._onSortableChange), this._root = null;
|
|
13291
13964
|
}
|
|
13292
13965
|
attributeChangedCallback(e, t, n) {
|
|
13293
13966
|
if (!(t === n || !this.isConnected)) {
|
|
@@ -13348,13 +14021,13 @@ var $ = class extends HTMLElement {
|
|
|
13348
14021
|
return Number.isFinite(e) && e > 0 ? e : Infinity;
|
|
13349
14022
|
}
|
|
13350
14023
|
_allowNesting() {
|
|
13351
|
-
return !this.hasAttribute("allow-nesting") ||
|
|
14024
|
+
return !this.hasAttribute("allow-nesting") || wr(this, "allow-nesting");
|
|
13352
14025
|
}
|
|
13353
14026
|
_disabled() {
|
|
13354
|
-
return
|
|
14027
|
+
return wr(this, "disabled");
|
|
13355
14028
|
}
|
|
13356
14029
|
_isLoading() {
|
|
13357
|
-
return
|
|
14030
|
+
return wr(this, "loading");
|
|
13358
14031
|
}
|
|
13359
14032
|
_render() {
|
|
13360
14033
|
let e = document.activeElement instanceof HTMLElement ? document.activeElement.closest("[data-mint-tree-row]") : null, t = e && this.contains(e) ? e.getAttribute("data-tree-id") : null;
|
|
@@ -13505,7 +14178,7 @@ var $ = class extends HTMLElement {
|
|
|
13505
14178
|
i = e.parentId, a = e.siblings.findIndex((e) => String(e.id) === n.parentId) + 1;
|
|
13506
14179
|
} else return;
|
|
13507
14180
|
try {
|
|
13508
|
-
let t =
|
|
14181
|
+
let t = Sr(this._items, e, i, a, {
|
|
13509
14182
|
maxDepth: this._maxDepth(),
|
|
13510
14183
|
allowNesting: this._allowNesting()
|
|
13511
14184
|
});
|
|
@@ -13529,6 +14202,7 @@ var $ = class extends HTMLElement {
|
|
|
13529
14202
|
}), Z(this, t.oldParentId === t.newParentId ? "mint-tree-reorder" : "mint-tree-reparent", t), this._announce(`${t.item.label} moved${t.newParentId ? ` into ${J(this._items, t.newParentId)?.label || "a group"}` : " to the top level"}.`);
|
|
13530
14203
|
}
|
|
13531
14204
|
_select(e) {
|
|
14205
|
+
if (this.classList.contains("mint-tree-drag-active")) return;
|
|
13532
14206
|
let t = J(this._items, e);
|
|
13533
14207
|
!t || t.disabled || this._disabled() || (this._selectedId = e, this.setAttribute("selected-id", e), this._syncSelectionDOM(), Z(this, "mint-tree-select", {
|
|
13534
14208
|
item: { ...t },
|
|
@@ -13639,7 +14313,7 @@ var $ = class extends HTMLElement {
|
|
|
13639
14313
|
if (!t || t.siblings.indexOf(t.item) <= 0) return;
|
|
13640
14314
|
let n = t.siblings[t.siblings.indexOf(t.item) - 1];
|
|
13641
14315
|
try {
|
|
13642
|
-
let t =
|
|
14316
|
+
let t = Sr(this._items, e, n.id, (n.children || []).length, {
|
|
13643
14317
|
maxDepth: this._maxDepth(),
|
|
13644
14318
|
allowNesting: this._allowNesting()
|
|
13645
14319
|
});
|
|
@@ -13661,7 +14335,7 @@ var $ = class extends HTMLElement {
|
|
|
13661
14335
|
if (!n) return;
|
|
13662
14336
|
let r = n.siblings.findIndex((e) => String(e.id) === t.parentId) + 1;
|
|
13663
14337
|
try {
|
|
13664
|
-
let t =
|
|
14338
|
+
let t = Sr(this._items, e, n.parentId, r, {
|
|
13665
14339
|
maxDepth: this._maxDepth(),
|
|
13666
14340
|
allowNesting: this._allowNesting()
|
|
13667
14341
|
});
|
|
@@ -13682,4 +14356,4 @@ var $ = class extends HTMLElement {
|
|
|
13682
14356
|
};
|
|
13683
14357
|
customElements.get("mint-tree") || a("mint-tree", $);
|
|
13684
14358
|
//#endregion
|
|
13685
|
-
export {
|
|
14359
|
+
export { Sn as Alert, cn as BackButton, wn as BottomNavigation, M as Button, M as default, an as Card, Tn as Chart, _n as Checkbox, En as Chip, vn as Choice, Dn as Clickable, On as Collapsible, kn as ConfirmAction, In as DatePicker, Rn as DateTimePicker, zn as Dropzone, Bn as Form, un as Grid, l as Icon, Fn as Input, on as Link, Cn as MintBottomNavItem, L as MintBottomNavigation, er as MintSidenavActionLinks, tr as MintSidenavActionMenu, Qn as MintSidenavLink, $n as MintSidenavLinks, $ as MintTree, $ as Tree, fn as Modal, Xn as NativeSelect, xn as Navigation, Vn as OffCanvas, ln as Page, gn as Popover, Wn as ResourceTable, pn as ScrollFade, Yn as Search, Zn as Select, ir as SideNavigation, ar as Sortable, en as Spinner, rn as Stack, tn as Switch, or as Tab, cr as TabContent, sr as TabList, Un as Table, lr as Tabs, ur as Tags, nn as Text, Ln as TimePicker, dr as Toast, Pn as confirm, vr as mintui, I as observeScrollFade, _r as toast };
|