monobill-mintui 0.6.671 → 0.6.673
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 +4 -2
- package/dist/back-button.css +1 -1
- package/dist/button.css +1 -1
- package/dist/components/back-button/browser.js +1 -1
- package/dist/components/back-button/index.cjs +1 -1
- package/dist/components/back-button/index.js +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/browser.js +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/chunks/{back-button-TLWsaZZT.js → back-button-DM9ajnIB.js} +22 -6
- package/dist/components/chunks/back-button-E389glZH.js +1 -0
- package/dist/components/chunks/{button-By-fwuGE.js → button-D-NMERaG.js} +24 -7
- package/dist/components/chunks/{button-9OkdUt6p.js → button-WCO2Tpah.js} +1 -1
- package/dist/components/chunks/{confirm-action-CK6XNdUM.js → confirm-action-BMb31P5R.js} +1 -1
- package/dist/components/chunks/{confirm-action-DKgSfwTn.js → confirm-action-CgiQX3-2.js} +2 -2
- package/dist/components/chunks/{date-picker-Cg23wkta.js → date-picker-BSw2O7ZD.js} +1 -1
- package/dist/components/chunks/{date-picker-hKFa5ejZ.js → date-picker-BVZKsafj.js} +2 -2
- package/dist/components/chunks/{modal-CAhV008D.js → modal-7h_ECXDc.js} +1 -1
- package/dist/components/chunks/{modal-CM0ZoVGN.js → modal-lOXK_Bj-.js} +1 -1
- package/dist/components/chunks/{popover-W1D5b_8F.js → popover-BAXGWQgn.js} +6 -2
- package/dist/components/chunks/popover-eTECdkG7.js +1 -0
- package/dist/components/chunks/{time-picker-DVwP5uhJ.js → time-picker-CwHfWKcg.js} +1 -1
- package/dist/components/chunks/{time-picker-BPU5XKxH.js → time-picker-EefLx837.js} +1 -1
- package/dist/components/confirm-action/browser.js +1 -1
- package/dist/components/confirm-action/index.cjs +1 -1
- package/dist/components/confirm-action/index.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/browser.js +1 -1
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/datetime-picker/browser.js +2 -2
- package/dist/components/datetime-picker/index.cjs +1 -1
- package/dist/components/datetime-picker/index.js +2 -2
- package/dist/components/modal/browser.js +1 -1
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/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/off-canvas/browser.js +1 -1
- package/dist/components/off-canvas/index.cjs +1 -1
- package/dist/components/off-canvas/index.js +1 -1
- package/dist/components/page/Page.d.ts +19 -0
- package/dist/components/page/Page.d.ts.map +1 -1
- package/dist/components/page/browser.js +65 -4
- package/dist/components/page/index.cjs +49 -3
- package/dist/components/page/index.js +65 -4
- package/dist/components/popover/Popover.d.ts +1 -0
- 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 +9 -0
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +26 -34
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +26 -34
- package/dist/components/resource-table/utility-aliases.d.ts +0 -2
- package/dist/components/resource-table/utility-aliases.d.ts.map +1 -1
- package/dist/components/search/browser.js +1 -1
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/select/browser.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/side-navigation/browser.js +1 -1
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +1 -1
- package/dist/components/tags/browser.js +2 -2
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +2 -2
- package/dist/components/time-picker/browser.js +1 -1
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/tree/browser.js +3 -3
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +3 -3
- package/dist/confirm-action.css +1 -1
- package/dist/index.cjs +52 -6
- package/dist/index.css +7 -7
- package/dist/index.js +396 -311
- package/dist/modal.css +1 -1
- package/dist/navigation.css +1 -1
- package/dist/page.css +1 -1
- package/dist/resource-table.css +1 -1
- package/package.json +1 -1
- package/dist/components/chunks/back-button-VEcRfWEx.js +0 -1
- package/dist/components/chunks/popover-BaO9pKei.js +0 -1
package/dist/index.js
CHANGED
|
@@ -2041,7 +2041,7 @@ var M = class extends HTMLElement {
|
|
|
2041
2041
|
let e = document.createElement("span");
|
|
2042
2042
|
e.className = "mint-button-spinner-wrap";
|
|
2043
2043
|
let t = document.createElement("mint-spinner");
|
|
2044
|
-
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "
|
|
2044
|
+
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "1em", t.style.height = "1em", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
|
|
2045
2045
|
}
|
|
2046
2046
|
else r && r.parentElement?.remove();
|
|
2047
2047
|
for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
|
|
@@ -2081,14 +2081,31 @@ var M = class extends HTMLElement {
|
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
2083
|
let c = this.isIconOnly();
|
|
2084
|
-
|
|
2084
|
+
a && (a.classList.contains("mint-button-icon") || a.classList.add("mint-button-icon"), e ? a.style.display = "none" : a.style.display = "", a.setAttribute("data-position", o), a.toggleAttribute("data-icon-only", c), c && (a.tagName === "MINT-ICON" ? (a.style.width = "1em", a.style.height = "1em", a.style.maxWidth = "1em", a.style.maxHeight = "1em", a.style.flexShrink = "0") : (a.style.maxWidth = "1em", a.style.maxHeight = "1em", a.style.flexShrink = "0", a.tagName === "svg" && (a.style.width = "1em", a.style.height = "1em"))));
|
|
2085
|
+
let l = this._button.querySelector(".mint-button-spinner-wrap"), u = a ?? this._button.querySelector(":scope > .mint-button-icon, :scope > [slot=\"icon\"]");
|
|
2086
|
+
if (e && l && u) {
|
|
2087
|
+
l.setAttribute("data-position", o);
|
|
2088
|
+
let e = window.getComputedStyle(u), t = e.width, n = e.height;
|
|
2089
|
+
if (t !== "auto" && t !== "0px") {
|
|
2090
|
+
l.style.width = t, l.style.flexBasis = t;
|
|
2091
|
+
let e = l.querySelector("mint-spinner");
|
|
2092
|
+
e && (e.style.width = t);
|
|
2093
|
+
}
|
|
2094
|
+
if (n !== "auto" && n !== "0px") {
|
|
2095
|
+
l.style.height = n;
|
|
2096
|
+
let e = l.querySelector("mint-spinner");
|
|
2097
|
+
e && (e.style.height = n);
|
|
2098
|
+
}
|
|
2099
|
+
u.parentElement === this._button && u.insertAdjacentElement("beforebegin", l);
|
|
2100
|
+
}
|
|
2101
|
+
if (e) {
|
|
2085
2102
|
let e = this._button.querySelector("mint-spinner")?.parentElement;
|
|
2086
|
-
e && (c ? e.setAttribute("data-icon-only", "true") : e.removeAttribute("data-icon-only"));
|
|
2103
|
+
e && (e.setAttribute("data-position", o), c ? e.setAttribute("data-icon-only", "true") : e.removeAttribute("data-icon-only"));
|
|
2087
2104
|
}
|
|
2088
|
-
let
|
|
2089
|
-
this._button.className =
|
|
2090
|
-
let
|
|
2091
|
-
if (
|
|
2105
|
+
let d = this.getButtonClasses();
|
|
2106
|
+
this._button.className = d;
|
|
2107
|
+
let f = this.getAttribute("aria-label")?.trim();
|
|
2108
|
+
if (f) this._button.setAttribute("aria-label", f);
|
|
2092
2109
|
else if (this.isIconOnly()) {
|
|
2093
2110
|
let e = this.getIcon().split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
2094
2111
|
this._button.setAttribute("aria-label", e || "Action");
|
|
@@ -2594,9 +2611,9 @@ var cn = class extends HTMLElement {
|
|
|
2594
2611
|
if (this.isLoading()) if (n) n.setAttribute("data-button-variant", this.getVariant()), n.setAttribute("data-button-tone", this.getTone()), n.render();
|
|
2595
2612
|
else {
|
|
2596
2613
|
let e = document.createElement("span");
|
|
2597
|
-
e.className = "mint-spinner-wrap";
|
|
2614
|
+
e.className = "mint-button-spinner-wrap";
|
|
2598
2615
|
let t = document.createElement("mint-spinner");
|
|
2599
|
-
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "
|
|
2616
|
+
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "1em", t.style.height = "1em", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
|
|
2600
2617
|
}
|
|
2601
2618
|
else n && n.parentElement?.remove();
|
|
2602
2619
|
for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
|
|
@@ -2627,10 +2644,26 @@ var cn = class extends HTMLElement {
|
|
|
2627
2644
|
e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, this._button.firstChild);
|
|
2628
2645
|
}
|
|
2629
2646
|
}
|
|
2630
|
-
let s = this.
|
|
2631
|
-
i && (i.
|
|
2632
|
-
|
|
2633
|
-
|
|
2647
|
+
let s = this._button.querySelector(".mint-button-spinner-wrap");
|
|
2648
|
+
if (i && (i.style.display = this.isLoading() ? "none" : "", this.isLoading() && s)) {
|
|
2649
|
+
s.setAttribute("data-position", a);
|
|
2650
|
+
let e = window.getComputedStyle(i), t = e.width, n = e.height;
|
|
2651
|
+
if (t !== "auto" && t !== "0px") {
|
|
2652
|
+
s.style.width = t, s.style.flexBasis = t;
|
|
2653
|
+
let e = s.querySelector("mint-spinner");
|
|
2654
|
+
e && (e.style.width = t);
|
|
2655
|
+
}
|
|
2656
|
+
if (n !== "auto" && n !== "0px") {
|
|
2657
|
+
s.style.height = n;
|
|
2658
|
+
let e = s.querySelector("mint-spinner");
|
|
2659
|
+
e && (e.style.height = n);
|
|
2660
|
+
}
|
|
2661
|
+
i.parentElement === this._button && i.insertAdjacentElement("beforebegin", s);
|
|
2662
|
+
}
|
|
2663
|
+
let c = this.isIconOnly();
|
|
2664
|
+
this.isLoading() && s && (s.setAttribute("data-position", a), c ? s.setAttribute("data-icon-only", "true") : s.removeAttribute("data-icon-only")), i && (i.classList.contains("mint-button-icon") || i.classList.add("mint-button-icon"), i.classList.remove("mint-icon-leading", "mint-icon-trailing"), c ? i.tagName === "MINT-ICON" ? (i.style.width = "1rem", i.style.height = "1rem", i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0") : (i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0", i.tagName === "svg" && (i.style.width = "1rem", i.style.height = "1rem")) : a === "left" ? i.classList.add("mint-icon-leading") : i.classList.add("mint-icon-trailing"));
|
|
2665
|
+
let l = this.getButtonClasses();
|
|
2666
|
+
this._button.className = l;
|
|
2634
2667
|
}
|
|
2635
2668
|
setupEventListeners() {
|
|
2636
2669
|
this._button && !this._clickHandler && (this._clickHandler = this.handleClick.bind(this), this._button.addEventListener("click", this._clickHandler, !0), this._button.addEventListener("mousedown", this._handleMouseDown), this._button.addEventListener("mouseup", this._handleMouseUp), this._button.addEventListener("mouseleave", this._handleMouseLeave), this._button.addEventListener("touchstart", this._handleTouchStart), this._button.addEventListener("touchend", this._handleTouchEnd), this._button.addEventListener("touchcancel", this._handleTouchCancel));
|
|
@@ -2724,256 +2757,8 @@ var ln = class extends HTMLElement {
|
|
|
2724
2757
|
};
|
|
2725
2758
|
typeof customElements < "u" && !customElements.get("mint-back-button") && a("mint-back-button", ln);
|
|
2726
2759
|
//#endregion
|
|
2727
|
-
//#region src/components/page/Page.js
|
|
2728
|
-
var un = class extends HTMLElement {
|
|
2729
|
-
static get observedAttributes() {
|
|
2730
|
-
return [
|
|
2731
|
-
"heading",
|
|
2732
|
-
"fallback-href",
|
|
2733
|
-
"show-back-button",
|
|
2734
|
-
"containered"
|
|
2735
|
-
];
|
|
2736
|
-
}
|
|
2737
|
-
constructor() {
|
|
2738
|
-
super(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n .mint-page-back mint-button { display: inline-block; vertical-align: middle; }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\"><slot name=\"actions\"></slot></div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
2739
|
-
}
|
|
2740
|
-
connectedCallback() {
|
|
2741
|
-
this.render();
|
|
2742
|
-
}
|
|
2743
|
-
attributeChangedCallback(e, t, n) {
|
|
2744
|
-
t !== n && this.isConnected && this.render();
|
|
2745
|
-
}
|
|
2746
|
-
getHeading() {
|
|
2747
|
-
return this.getAttribute("heading") || "";
|
|
2748
|
-
}
|
|
2749
|
-
getFallbackHref() {
|
|
2750
|
-
return this.getAttribute("fallback-href") || "/";
|
|
2751
|
-
}
|
|
2752
|
-
shouldShowBackButton() {
|
|
2753
|
-
return this.getAttribute("show-back-button") === "true";
|
|
2754
|
-
}
|
|
2755
|
-
isContainered() {
|
|
2756
|
-
return this.hasAttribute("containered") && this.getAttribute("containered") !== "false";
|
|
2757
|
-
}
|
|
2758
|
-
render() {
|
|
2759
|
-
this._headingElement.textContent = this.getHeading(), this._backButton.setAttribute("fallback-href", this.getFallbackHref()), this._backButton.hidden = !this.shouldShowBackButton();
|
|
2760
|
-
}
|
|
2761
|
-
_handleBack(e) {
|
|
2762
|
-
e.preventDefault(), e.stopPropagation();
|
|
2763
|
-
let t = document.referrer, n = !!(t && (() => {
|
|
2764
|
-
try {
|
|
2765
|
-
return new URL(t).origin === window.location.origin;
|
|
2766
|
-
} catch {
|
|
2767
|
-
return !1;
|
|
2768
|
-
}
|
|
2769
|
-
})()), r = {
|
|
2770
|
-
url: n ? t : this.getFallbackHref(),
|
|
2771
|
-
isFromReferrer: n,
|
|
2772
|
-
referrer: t || null,
|
|
2773
|
-
fallbackHref: this.getFallbackHref()
|
|
2774
|
-
}, i = new CustomEvent("back", {
|
|
2775
|
-
detail: r,
|
|
2776
|
-
bubbles: !0,
|
|
2777
|
-
cancelable: !0,
|
|
2778
|
-
composed: !0
|
|
2779
|
-
});
|
|
2780
|
-
this.dispatchEvent(i) && (n && window.history.length > 1 ? window.history.back() : window.location.href = this.getFallbackHref());
|
|
2781
|
-
}
|
|
2782
|
-
};
|
|
2783
|
-
typeof customElements < "u" && !customElements.get("mint-page") && a("mint-page", un);
|
|
2784
|
-
//#endregion
|
|
2785
|
-
//#region src/components/grid/Grid.js
|
|
2786
|
-
var dn = class extends HTMLElement {
|
|
2787
|
-
constructor() {
|
|
2788
|
-
super();
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
typeof customElements < "u" && !customElements.get("mint-grid") && a("mint-grid", dn);
|
|
2792
|
-
//#endregion
|
|
2793
|
-
//#region src/components/modal/Modal.js
|
|
2794
|
-
var N = /* @__PURE__ */ new Set(), P = null;
|
|
2795
|
-
function fn(e) {
|
|
2796
|
-
if (!N.has(e)) {
|
|
2797
|
-
if (N.size === 0) {
|
|
2798
|
-
let e = document.documentElement;
|
|
2799
|
-
P = {
|
|
2800
|
-
scrollY: window.scrollY || window.pageYOffset || 0,
|
|
2801
|
-
rootOverflow: e.style.overflow,
|
|
2802
|
-
rootOverscrollBehavior: e.style.overscrollBehavior
|
|
2803
|
-
}, e.style.overflow = "hidden", e.style.overscrollBehavior = "none";
|
|
2804
|
-
}
|
|
2805
|
-
N.add(e);
|
|
2806
|
-
}
|
|
2807
|
-
}
|
|
2808
|
-
function F(e) {
|
|
2809
|
-
if (!N.delete(e) || N.size > 0 || !P) return;
|
|
2810
|
-
let t = P;
|
|
2811
|
-
P = null;
|
|
2812
|
-
let n = document.documentElement;
|
|
2813
|
-
n.style.overflow = t.rootOverflow, n.style.overscrollBehavior = t.rootOverscrollBehavior, window.scrollTo({
|
|
2814
|
-
left: 0,
|
|
2815
|
-
top: t.scrollY,
|
|
2816
|
-
behavior: "instant"
|
|
2817
|
-
});
|
|
2818
|
-
}
|
|
2819
|
-
var pn = class extends HTMLElement {
|
|
2820
|
-
static get observedAttributes() {
|
|
2821
|
-
return [
|
|
2822
|
-
"id",
|
|
2823
|
-
"heading",
|
|
2824
|
-
"open",
|
|
2825
|
-
"size"
|
|
2826
|
-
];
|
|
2827
|
-
}
|
|
2828
|
-
constructor() {
|
|
2829
|
-
super(), this._overlay = null, this._modal = null, this._header = null, this._headingSlot = null, this._bodySlot = null, this._actionsSlot = null, this._closeButton = null, this._triggerElement = null, this._triggerPoint = null, this._renderedOpen = !1, this._lastPointerPoint = null, this._pointerDownHandler = null, this._darkModeObserver = null, this._exitTimer = null, this._backdropTimer = null;
|
|
2830
|
-
}
|
|
2831
|
-
connectedCallback() {
|
|
2832
|
-
this.isOpen() || this.classList.add("mint-hidden"), this.render(), this._observeDarkMode(), this._pointerDownHandler = (e) => {
|
|
2833
|
-
this._lastPointerPoint = {
|
|
2834
|
-
x: e.clientX,
|
|
2835
|
-
y: e.clientY,
|
|
2836
|
-
target: e.target,
|
|
2837
|
-
time: Date.now()
|
|
2838
|
-
};
|
|
2839
|
-
}, document.addEventListener("pointerdown", this._pointerDownHandler, !0);
|
|
2840
|
-
}
|
|
2841
|
-
disconnectedCallback() {
|
|
2842
|
-
F(this), this._pointerDownHandler &&= (document.removeEventListener("pointerdown", this._pointerDownHandler, !0), null), this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
2843
|
-
}
|
|
2844
|
-
attributeChangedCallback(e, t, n) {
|
|
2845
|
-
t !== n && (e === "open" && n !== null && !this._triggerElement && (this._triggerElement = this._findTriggerElement(), this._triggerPoint = this._findTriggerPoint(this._triggerElement)), this.render());
|
|
2846
|
-
}
|
|
2847
|
-
getId() {
|
|
2848
|
-
return this.getAttribute("id") || "";
|
|
2849
|
-
}
|
|
2850
|
-
getHeading() {
|
|
2851
|
-
return this.getAttribute("heading") || "";
|
|
2852
|
-
}
|
|
2853
|
-
getSize() {
|
|
2854
|
-
let e = this.getAttribute("size");
|
|
2855
|
-
return e === "small" || e === "large" ? e : "default";
|
|
2856
|
-
}
|
|
2857
|
-
isOpen() {
|
|
2858
|
-
return this.hasAttribute("open");
|
|
2859
|
-
}
|
|
2860
|
-
open(e) {
|
|
2861
|
-
this._triggerElement = this._findTriggerElement(e), this._triggerPoint = this._findTriggerPoint(this._triggerElement), this.setAttribute("open", "");
|
|
2862
|
-
}
|
|
2863
|
-
close() {
|
|
2864
|
-
this.removeAttribute("open");
|
|
2865
|
-
}
|
|
2866
|
-
render() {
|
|
2867
|
-
let e = this.getId(), t = this.getHeading(), n = this.isOpen(), r = this.getSize();
|
|
2868
|
-
if (e && (this.id = e), this._overlay || (this._overlay = document.createElement("div"), this._overlay.className = "mint-modal-overlay", this._overlay.addEventListener("click", () => this.close()), this.appendChild(this._overlay)), this._modal || (this._modal = document.createElement("div"), this._modal.className = "mint-modal-shell", this.appendChild(this._modal)), n) {
|
|
2869
|
-
let e = this._modal.querySelector(".modal-content");
|
|
2870
|
-
e || (e = document.createElement("div"), e.className = "modal-content", this._modal.appendChild(e)), this._renderedOpen || (this._renderedOpen = !0, fn(this), this._animateEnter());
|
|
2871
|
-
} else this._renderedOpen && (this._renderedOpen = !1, this._animateExit());
|
|
2872
|
-
let i = this._modal.querySelector(".modal-content");
|
|
2873
|
-
i || (i = document.createElement("div"), i.className = "modal-content", this._modal.appendChild(i)), i.classList.remove("modal-content--small", "modal-content--large"), r !== "default" && i.classList.add(`modal-content--${r}`), this._header || (this._header = document.createElement("div"), this._header.className = "mint-modal-header", i.appendChild(this._header)), this._headingSlot || (this._headingSlot = document.createElement("div"), this._headingSlot.className = "mint-modal-heading", this._headingSlot.setAttribute("slot", "heading"), this._header.appendChild(this._headingSlot));
|
|
2874
|
-
let a = this._headingSlot.querySelector("mint-text");
|
|
2875
|
-
t ? (a || (a = document.createElement("mint-text"), a.setAttribute("size", "sub-heading"), a.setAttribute("bold", ""), this._headingSlot.appendChild(a)), a.textContent = t) : a && a.remove(), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._headingSlot && e.getAttribute("slot") === "heading").forEach((e) => {
|
|
2876
|
-
e.parentElement !== this._headingSlot && this._headingSlot.appendChild(e);
|
|
2877
|
-
}), this._closeButton || (this._closeButton = document.createElement("mint-button"), this._closeButton.classList.add("mint-modal-close-button"), this._closeButton.setAttribute("variant", "ghost"), this._closeButton.setAttribute("icon", "close"), this._closeButton.addEventListener("click", () => this.close()), this._header.appendChild(this._closeButton)), this._bodySlot || (this._bodySlot = document.createElement("div"), this._bodySlot.className = "mint-modal-body", this._bodySlot.setAttribute("slot", "body"), i.appendChild(this._bodySlot)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._bodySlot && e.getAttribute("slot") === "body").forEach((e) => {
|
|
2878
|
-
e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
2879
|
-
});
|
|
2880
|
-
let o = Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._actionsSlot && e.getAttribute("slot") === "actions"), s = this._actionsSlot?.querySelector("mint-stack"), c = !!s && s.children.length > 0;
|
|
2881
|
-
if (o.length || c) {
|
|
2882
|
-
this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-mint-divider", this._actionsSlot.setAttribute("slot", "actions"), i.appendChild(this._actionsSlot));
|
|
2883
|
-
let e = this._actionsSlot.querySelector("mint-stack");
|
|
2884
|
-
e || (e = document.createElement("mint-stack"), e.setAttribute("direction", "horizontal"), e.setAttribute("align-content", "right"), e.className = "mint-actions-stack", this._actionsSlot.appendChild(e)), o.forEach((t) => {
|
|
2885
|
-
Array.from(t.children).forEach((t) => e.appendChild(t)), t.remove();
|
|
2886
|
-
});
|
|
2887
|
-
} else this._actionsSlot &&= (this._actionsSlot.remove(), null);
|
|
2888
|
-
Array.from(this.children).forEach((e) => {
|
|
2889
|
-
e !== this._overlay && e !== this._modal && e.getAttribute("slot") !== "heading" && e.getAttribute("slot") !== "body" && e.getAttribute("slot") !== "actions" && e !== this._headingSlot && e !== this._bodySlot && e !== this._actionsSlot && e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
2890
|
-
}), this._updateBackgroundColor();
|
|
2891
|
-
}
|
|
2892
|
-
_updateBackgroundColor() {
|
|
2893
|
-
if (!this._modal) return;
|
|
2894
|
-
document.documentElement?.classList.contains("dark") || document.documentElement?.dataset.mintTheme;
|
|
2895
|
-
let e = this._modal.querySelector(".modal-content");
|
|
2896
|
-
e && (e.style.background = "var(--mint-color-surface-raised)");
|
|
2897
|
-
}
|
|
2898
|
-
_observeDarkMode() {
|
|
2899
|
-
if (!this._darkModeObserver) {
|
|
2900
|
-
if (this._darkModeObserver = new MutationObserver(() => {
|
|
2901
|
-
this._updateBackgroundColor();
|
|
2902
|
-
}), !document.documentElement) return;
|
|
2903
|
-
this._darkModeObserver.observe(document.documentElement, {
|
|
2904
|
-
attributes: !0,
|
|
2905
|
-
attributeFilter: ["class", "data-mint-theme"]
|
|
2906
|
-
});
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
_animateEnter() {
|
|
2910
|
-
let e = this._modal?.querySelector(".modal-content");
|
|
2911
|
-
e && (this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this.classList.remove("mint-modal-closing"), this.classList.remove("mint-modal-open"), this.classList.add("mint-modal-open"), this.classList.remove("mint-hidden"), e.style.transform = "none", e.style.opacity = "0", e.style.transition = "none", requestAnimationFrame(() => {
|
|
2912
|
-
if (!this.isOpen()) return;
|
|
2913
|
-
let t = window.getComputedStyle(e).borderRadius;
|
|
2914
|
-
this._setTransformOrigin(e), e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", e.getBoundingClientRect(), e.style.transition = "opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)", requestAnimationFrame(() => {
|
|
2915
|
-
this.isOpen() && (e.style.transform = "scale(1)", e.style.opacity = "1", e.style.borderRadius = t, window.setTimeout(() => {
|
|
2916
|
-
this.isOpen() && (e.style.transition = "", e.style.transform = "none");
|
|
2917
|
-
}, 380));
|
|
2918
|
-
});
|
|
2919
|
-
}));
|
|
2920
|
-
}
|
|
2921
|
-
_findTriggerElement(e) {
|
|
2922
|
-
if (typeof e == "string") {
|
|
2923
|
-
let t = document.getElementById(e);
|
|
2924
|
-
return t && !this.contains(t) ? t : null;
|
|
2925
|
-
}
|
|
2926
|
-
if (e instanceof HTMLElement) return e.isConnected && !this.contains(e) ? e : null;
|
|
2927
|
-
let t = this.getAttribute("trigger-id");
|
|
2928
|
-
if (t) {
|
|
2929
|
-
let e = document.getElementById(t);
|
|
2930
|
-
if (e && !this.contains(e)) return e;
|
|
2931
|
-
}
|
|
2932
|
-
let n = document.activeElement;
|
|
2933
|
-
return n instanceof HTMLElement && n.isConnected && n !== document.body && !this.contains(n) ? n : null;
|
|
2934
|
-
}
|
|
2935
|
-
_findTriggerPoint(e) {
|
|
2936
|
-
if (!e) return null;
|
|
2937
|
-
let t = this._lastPointerPoint;
|
|
2938
|
-
if (!t || Date.now() - t.time > 1e3) return null;
|
|
2939
|
-
let n = t.target instanceof Node ? t.target : null;
|
|
2940
|
-
return n === e || n && e.contains(n) ? {
|
|
2941
|
-
x: t.x,
|
|
2942
|
-
y: t.y
|
|
2943
|
-
} : null;
|
|
2944
|
-
}
|
|
2945
|
-
_setTransformOrigin(e) {
|
|
2946
|
-
let t = this._findTriggerElement(this._triggerElement);
|
|
2947
|
-
this._triggerElement = t;
|
|
2948
|
-
let n = this._findTriggerPoint(t);
|
|
2949
|
-
if (n) {
|
|
2950
|
-
let t = e.getBoundingClientRect();
|
|
2951
|
-
e.style.transformOrigin = `${n.x - t.left}px ${n.y - t.top}px`, this._triggerPoint = n;
|
|
2952
|
-
return;
|
|
2953
|
-
}
|
|
2954
|
-
this._triggerPoint = {
|
|
2955
|
-
x: window.innerWidth / 2,
|
|
2956
|
-
y: 0
|
|
2957
|
-
};
|
|
2958
|
-
let r = e.getBoundingClientRect();
|
|
2959
|
-
e.style.transformOrigin = `${this._triggerPoint.x - r.left}px ${this._triggerPoint.y - r.top}px`;
|
|
2960
|
-
}
|
|
2961
|
-
_animateExit() {
|
|
2962
|
-
this.classList.remove("mint-modal-open"), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null);
|
|
2963
|
-
let e = this._modal?.querySelector(".modal-content");
|
|
2964
|
-
if (!e) {
|
|
2965
|
-
this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing"), F(this);
|
|
2966
|
-
return;
|
|
2967
|
-
}
|
|
2968
|
-
this._exitTimer && clearTimeout(this._exitTimer), this.classList.add("mint-modal-closing"), e.style.transition = "opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)", e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", this._exitTimer = setTimeout(() => {
|
|
2969
|
-
this._exitTimer = null, !this.isOpen() && (this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing"), e.style.transform = "", e.style.opacity = "", e.style.borderRadius = "", e.style.transition = "", F(this));
|
|
2970
|
-
}, 280);
|
|
2971
|
-
}
|
|
2972
|
-
};
|
|
2973
|
-
typeof customElements < "u" && !customElements.get("mint-modal") && a("mint-modal", pn);
|
|
2974
|
-
//#endregion
|
|
2975
2760
|
//#region src/components/scroll-fade/ScrollFade.ts
|
|
2976
|
-
function
|
|
2761
|
+
function N(e, t = "vertical", n = "1.5rem") {
|
|
2977
2762
|
let r = null, i = null, a = 0, o = () => {
|
|
2978
2763
|
cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
2979
2764
|
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;
|
|
@@ -3006,7 +2791,7 @@ function I(e, t = "vertical", n = "1.5rem") {
|
|
|
3006
2791
|
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");
|
|
3007
2792
|
};
|
|
3008
2793
|
}
|
|
3009
|
-
var
|
|
2794
|
+
var un = class extends HTMLElement {
|
|
3010
2795
|
constructor(...e) {
|
|
3011
2796
|
super(...e), this._disposeFade = null, this._target = null, this._contentObserver = null;
|
|
3012
2797
|
}
|
|
@@ -3043,23 +2828,23 @@ var mn = class extends HTMLElement {
|
|
|
3043
2828
|
if (n === this._target) return;
|
|
3044
2829
|
this._disposeFade?.(), this._target = n, this.toggleAttribute("data-wraps-scrollport", n !== this);
|
|
3045
2830
|
let r = this.getAttribute("axis") || "vertical";
|
|
3046
|
-
this._disposeFade =
|
|
2831
|
+
this._disposeFade = N(n, [
|
|
3047
2832
|
"vertical",
|
|
3048
2833
|
"horizontal",
|
|
3049
2834
|
"both"
|
|
3050
2835
|
].includes(r) ? r : "vertical", this.getAttribute("fade-size") || "1.5rem");
|
|
3051
2836
|
}
|
|
3052
2837
|
};
|
|
3053
|
-
customElements.get("mint-scroll-fade") || a("mint-scroll-fade",
|
|
2838
|
+
customElements.get("mint-scroll-fade") || a("mint-scroll-fade", un);
|
|
3054
2839
|
//#endregion
|
|
3055
2840
|
//#region src/components/popover/Popover.js
|
|
3056
|
-
var
|
|
2841
|
+
var dn = new Set([
|
|
3057
2842
|
"up",
|
|
3058
2843
|
"down",
|
|
3059
2844
|
"left",
|
|
3060
2845
|
"right"
|
|
3061
2846
|
]);
|
|
3062
|
-
function
|
|
2847
|
+
function fn(e) {
|
|
3063
2848
|
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);
|
|
3064
2849
|
for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) {
|
|
3065
2850
|
let e = getComputedStyle(t), o = t.getBoundingClientRect();
|
|
@@ -3067,7 +2852,7 @@ function gn(e) {
|
|
|
3067
2852
|
}
|
|
3068
2853
|
return i > n && r > a;
|
|
3069
2854
|
}
|
|
3070
|
-
var
|
|
2855
|
+
var pn = class extends HTMLElement {
|
|
3071
2856
|
static get observedAttributes() {
|
|
3072
2857
|
return [
|
|
3073
2858
|
"direction",
|
|
@@ -3087,7 +2872,7 @@ var _n = class extends HTMLElement {
|
|
|
3087
2872
|
connectedCallback() {
|
|
3088
2873
|
this.render(), this._disposeScrollFade?.();
|
|
3089
2874
|
let e = this.classList.contains("mint-select-popover") ? this.querySelector(".mint-select-options") : this;
|
|
3090
|
-
this._disposeScrollFade =
|
|
2875
|
+
this._disposeScrollFade = N(e || this, e ? "vertical" : "both"), this._setupTrigger();
|
|
3091
2876
|
}
|
|
3092
2877
|
disconnectedCallback() {
|
|
3093
2878
|
this._removeTrigger(), this._removeOpenListeners(), this._disposeScrollFade?.(), this._disposeScrollFade = null, clearTimeout(this._hoverCloseTimer), clearTimeout(this._closeAnimationTimer), this._blobAnimation?.cancel();
|
|
@@ -3097,11 +2882,15 @@ var _n = class extends HTMLElement {
|
|
|
3097
2882
|
}
|
|
3098
2883
|
getDirection() {
|
|
3099
2884
|
let e = this.getAttribute("direction") || "down";
|
|
3100
|
-
return
|
|
2885
|
+
return dn.has(e) ? e : "down";
|
|
3101
2886
|
}
|
|
3102
2887
|
getTriggerId() {
|
|
3103
2888
|
return this.getAttribute("trigger-id") || "";
|
|
3104
2889
|
}
|
|
2890
|
+
_findTrigger(e) {
|
|
2891
|
+
let t = this.getRootNode();
|
|
2892
|
+
return t instanceof ShadowRoot ? t.querySelector(`#${CSS.escape(e)}`) : document.getElementById(e);
|
|
2893
|
+
}
|
|
3105
2894
|
isOpen() {
|
|
3106
2895
|
return this.hasAttribute("open") && this.getAttribute("open") !== "false";
|
|
3107
2896
|
}
|
|
@@ -3124,7 +2913,7 @@ var _n = class extends HTMLElement {
|
|
|
3124
2913
|
this._removeTrigger();
|
|
3125
2914
|
let e = this.getTriggerId();
|
|
3126
2915
|
if (e) {
|
|
3127
|
-
if (this._trigger =
|
|
2916
|
+
if (this._trigger = this._findTrigger(e), !this._trigger) {
|
|
3128
2917
|
this._triggerLookupTimer = setTimeout(() => {
|
|
3129
2918
|
this.isConnected && this.getTriggerId() === e && !this._trigger && this._setupTrigger();
|
|
3130
2919
|
}, 40);
|
|
@@ -3159,7 +2948,7 @@ var _n = class extends HTMLElement {
|
|
|
3159
2948
|
let t = e.target;
|
|
3160
2949
|
if (!(t instanceof Node && (t === this || this.contains(t)))) {
|
|
3161
2950
|
if (this.classList.contains("mint-select-popover")) {
|
|
3162
|
-
!this._trigger || !
|
|
2951
|
+
!this._trigger || !fn(this._trigger) ? this.close() : (this._position({
|
|
3163
2952
|
allowViewportFlip: !1,
|
|
3164
2953
|
clampToViewport: !1
|
|
3165
2954
|
}), this._alignSelectedOptionToTrigger());
|
|
@@ -3183,7 +2972,7 @@ var _n = class extends HTMLElement {
|
|
|
3183
2972
|
}
|
|
3184
2973
|
}
|
|
3185
2974
|
_position({ allowViewportFlip: e = !0, clampToViewport: t = !0 } = {}) {
|
|
3186
|
-
let n =
|
|
2975
|
+
let n = this._findTrigger(this.getTriggerId());
|
|
3187
2976
|
n && n !== this._trigger && this._setupTrigger();
|
|
3188
2977
|
let r = n || this._trigger;
|
|
3189
2978
|
if (!r) return;
|
|
@@ -3279,7 +3068,311 @@ var _n = class extends HTMLElement {
|
|
|
3279
3068
|
} else this.dataset.state = "closed";
|
|
3280
3069
|
}
|
|
3281
3070
|
};
|
|
3282
|
-
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover",
|
|
3071
|
+
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover", pn);
|
|
3072
|
+
//#endregion
|
|
3073
|
+
//#region src/components/page/Page.js
|
|
3074
|
+
var mn = class extends HTMLElement {
|
|
3075
|
+
static get observedAttributes() {
|
|
3076
|
+
return [
|
|
3077
|
+
"heading",
|
|
3078
|
+
"fallback-href",
|
|
3079
|
+
"show-back-button",
|
|
3080
|
+
"containered"
|
|
3081
|
+
];
|
|
3082
|
+
}
|
|
3083
|
+
constructor() {
|
|
3084
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n .mint-page-back mint-button { display: inline-block; vertical-align: middle; }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
3085
|
+
}
|
|
3086
|
+
connectedCallback() {
|
|
3087
|
+
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
3088
|
+
e.some((e) => e.type === "childList" || e.attributeName === "importance" || e.attributeName === "slot" && !["actions", "overflow-actions"].includes(e.target.getAttribute("slot") || "")) && this._scheduleActionGrouping();
|
|
3089
|
+
}), this._actionsMutationObserver.observe(this, {
|
|
3090
|
+
childList: !0,
|
|
3091
|
+
attributes: !0,
|
|
3092
|
+
attributeFilter: ["slot", "importance"]
|
|
3093
|
+
}), this._scheduleActionGrouping();
|
|
3094
|
+
}
|
|
3095
|
+
disconnectedCallback() {
|
|
3096
|
+
this._actionsResizeObserver?.disconnect(), this._actionsMutationObserver?.disconnect(), this._actionsFrame !== null && cancelAnimationFrame(this._actionsFrame), this._actionsFrame = null;
|
|
3097
|
+
}
|
|
3098
|
+
attributeChangedCallback(e, t, n) {
|
|
3099
|
+
t !== n && this.isConnected && this.render();
|
|
3100
|
+
}
|
|
3101
|
+
getHeading() {
|
|
3102
|
+
return this.getAttribute("heading") || "";
|
|
3103
|
+
}
|
|
3104
|
+
getFallbackHref() {
|
|
3105
|
+
return this.getAttribute("fallback-href") || "/";
|
|
3106
|
+
}
|
|
3107
|
+
shouldShowBackButton() {
|
|
3108
|
+
return this.getAttribute("show-back-button") === "true";
|
|
3109
|
+
}
|
|
3110
|
+
isContainered() {
|
|
3111
|
+
return this.hasAttribute("containered") && this.getAttribute("containered") !== "false";
|
|
3112
|
+
}
|
|
3113
|
+
render() {
|
|
3114
|
+
this._headingElement.textContent = this.getHeading(), this._backButton.setAttribute("fallback-href", this.getFallbackHref()), this._backButton.hidden = !this.shouldShowBackButton();
|
|
3115
|
+
}
|
|
3116
|
+
_scheduleActionGrouping() {
|
|
3117
|
+
this._actionsFrame !== null || !this.isConnected || (this._actionsFrame = requestAnimationFrame(() => {
|
|
3118
|
+
this._actionsFrame = null, this._groupActions();
|
|
3119
|
+
}));
|
|
3120
|
+
}
|
|
3121
|
+
_groupActions() {
|
|
3122
|
+
if (this._groupingActions) return;
|
|
3123
|
+
this._groupingActions = !0;
|
|
3124
|
+
let e = Array.from(this.children).filter((e) => e instanceof HTMLElement && (e.getAttribute("slot") === "actions" || e.getAttribute("slot") === "overflow-actions"));
|
|
3125
|
+
if (this._actionsWrapper.hidden = e.length === 0, !e.length) {
|
|
3126
|
+
this._actionsTrigger.hidden = !0, this._actionsPopover.style.display = "none", this._actionsWrapper.hidden = !0, this._groupingActions = !1;
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3129
|
+
e.forEach((e) => this._setActionSlot(e, "actions")), this._syncOverflowButtonWidths([]), this._actionsPopover.style.display = "", this._actionsTrigger.hidden = !0;
|
|
3130
|
+
let t = this._root.querySelector(".mint-page-actions-primary"), n = this._root.querySelector(".mint-page-header"), r = this._root.querySelector(".mint-page-heading");
|
|
3131
|
+
this._actionsResizeObserver?.observe(t), e.forEach((e) => this._actionsResizeObserver?.observe(e));
|
|
3132
|
+
let i = n.clientWidth <= 767, a = e.reduce((e, t, n) => e + t.getBoundingClientRect().width + (n ? 8 : 0), 0), o = this._backButton.hidden ? 0 : this._backButton.getBoundingClientRect().width + 16, s = Math.min(n.clientWidth, r.scrollWidth + o), c = Math.max(0, n.clientWidth - s - 16), l = [], u = (e) => {
|
|
3133
|
+
let t = e.getAttribute("importance"), n = e.querySelector("[importance]")?.getAttribute("importance"), r = Number(t ?? n ?? 1);
|
|
3134
|
+
return Number.isFinite(r) && r > 0 ? r : 1;
|
|
3135
|
+
};
|
|
3136
|
+
!i && a > c && (c = Math.max(0, c - 48));
|
|
3137
|
+
let d = a;
|
|
3138
|
+
for (; i ? e.length > l.length : d > c && l.length < e.length;) {
|
|
3139
|
+
let t = e.filter((e) => !l.includes(e));
|
|
3140
|
+
t.sort((t, n) => u(n) - u(t) || e.indexOf(n) - e.indexOf(t));
|
|
3141
|
+
let n = t[0];
|
|
3142
|
+
if (!n) break;
|
|
3143
|
+
l.push(n), d -= n.getBoundingClientRect().width + (l.length < e.length ? 8 : 0);
|
|
3144
|
+
}
|
|
3145
|
+
let f = new Set(l);
|
|
3146
|
+
e.forEach((e) => this._setActionSlot(e, f.has(e) ? "overflow-actions" : "actions")), this._actionsTrigger.hidden = l.length === 0, this._actionsPopover.style.display = l.length === 0 ? "none" : "", this._syncOverflowButtonWidths(l), this._actionsResizeObserver?.observe(this._actionsTrigger), this._groupingActions = !1;
|
|
3147
|
+
}
|
|
3148
|
+
_setActionSlot(e, t) {
|
|
3149
|
+
e.getAttribute("slot") !== t && e.setAttribute("slot", t);
|
|
3150
|
+
}
|
|
3151
|
+
_syncOverflowButtonWidths(e) {
|
|
3152
|
+
let t = /* @__PURE__ */ new Set();
|
|
3153
|
+
e.forEach((e) => {
|
|
3154
|
+
e.matches("mint-button") && t.add(e), e.querySelectorAll("mint-button").forEach((e) => t.add(e));
|
|
3155
|
+
}), Array.from(this.querySelectorAll("mint-button[slot=\"actions\"], mint-button[slot=\"overflow-actions\"], [slot=\"actions\"] mint-button, [slot=\"overflow-actions\"] mint-button")).forEach((e) => {
|
|
3156
|
+
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), e.setAttribute("full-width", "true");
|
|
3157
|
+
else if (this._actionFullWidthOriginal.has(e)) {
|
|
3158
|
+
let t = this._actionFullWidthOriginal.get(e);
|
|
3159
|
+
t === null ? e.removeAttribute("full-width") : t !== void 0 && e.setAttribute("full-width", t), this._actionFullWidthOriginal.delete(e);
|
|
3160
|
+
}
|
|
3161
|
+
});
|
|
3162
|
+
}
|
|
3163
|
+
_handleBack(e) {
|
|
3164
|
+
e.preventDefault(), e.stopPropagation();
|
|
3165
|
+
let t = document.referrer, n = !!(t && (() => {
|
|
3166
|
+
try {
|
|
3167
|
+
return new URL(t).origin === window.location.origin;
|
|
3168
|
+
} catch {
|
|
3169
|
+
return !1;
|
|
3170
|
+
}
|
|
3171
|
+
})()), r = {
|
|
3172
|
+
url: n ? t : this.getFallbackHref(),
|
|
3173
|
+
isFromReferrer: n,
|
|
3174
|
+
referrer: t || null,
|
|
3175
|
+
fallbackHref: this.getFallbackHref()
|
|
3176
|
+
}, i = new CustomEvent("back", {
|
|
3177
|
+
detail: r,
|
|
3178
|
+
bubbles: !0,
|
|
3179
|
+
cancelable: !0,
|
|
3180
|
+
composed: !0
|
|
3181
|
+
});
|
|
3182
|
+
this.dispatchEvent(i) && (n && window.history.length > 1 ? window.history.back() : window.location.href = this.getFallbackHref());
|
|
3183
|
+
}
|
|
3184
|
+
};
|
|
3185
|
+
typeof customElements < "u" && !customElements.get("mint-page") && a("mint-page", mn);
|
|
3186
|
+
//#endregion
|
|
3187
|
+
//#region src/components/grid/Grid.js
|
|
3188
|
+
var hn = class extends HTMLElement {
|
|
3189
|
+
constructor() {
|
|
3190
|
+
super();
|
|
3191
|
+
}
|
|
3192
|
+
};
|
|
3193
|
+
typeof customElements < "u" && !customElements.get("mint-grid") && a("mint-grid", hn);
|
|
3194
|
+
//#endregion
|
|
3195
|
+
//#region src/components/modal/Modal.js
|
|
3196
|
+
var P = /* @__PURE__ */ new Set(), F = null;
|
|
3197
|
+
function gn(e) {
|
|
3198
|
+
if (!P.has(e)) {
|
|
3199
|
+
if (P.size === 0) {
|
|
3200
|
+
let e = document.documentElement;
|
|
3201
|
+
F = {
|
|
3202
|
+
scrollY: window.scrollY || window.pageYOffset || 0,
|
|
3203
|
+
rootOverflow: e.style.overflow,
|
|
3204
|
+
rootOverscrollBehavior: e.style.overscrollBehavior
|
|
3205
|
+
}, e.style.overflow = "hidden", e.style.overscrollBehavior = "none";
|
|
3206
|
+
}
|
|
3207
|
+
P.add(e);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
function I(e) {
|
|
3211
|
+
if (!P.delete(e) || P.size > 0 || !F) return;
|
|
3212
|
+
let t = F;
|
|
3213
|
+
F = null;
|
|
3214
|
+
let n = document.documentElement;
|
|
3215
|
+
n.style.overflow = t.rootOverflow, n.style.overscrollBehavior = t.rootOverscrollBehavior, window.scrollTo({
|
|
3216
|
+
left: 0,
|
|
3217
|
+
top: t.scrollY,
|
|
3218
|
+
behavior: "instant"
|
|
3219
|
+
});
|
|
3220
|
+
}
|
|
3221
|
+
var _n = class extends HTMLElement {
|
|
3222
|
+
static get observedAttributes() {
|
|
3223
|
+
return [
|
|
3224
|
+
"id",
|
|
3225
|
+
"heading",
|
|
3226
|
+
"open",
|
|
3227
|
+
"size"
|
|
3228
|
+
];
|
|
3229
|
+
}
|
|
3230
|
+
constructor() {
|
|
3231
|
+
super(), this._overlay = null, this._modal = null, this._header = null, this._headingSlot = null, this._bodySlot = null, this._actionsSlot = null, this._closeButton = null, this._triggerElement = null, this._triggerPoint = null, this._renderedOpen = !1, this._lastPointerPoint = null, this._pointerDownHandler = null, this._darkModeObserver = null, this._exitTimer = null, this._backdropTimer = null;
|
|
3232
|
+
}
|
|
3233
|
+
connectedCallback() {
|
|
3234
|
+
this.isOpen() || this.classList.add("mint-hidden"), this.render(), this._observeDarkMode(), this._pointerDownHandler = (e) => {
|
|
3235
|
+
this._lastPointerPoint = {
|
|
3236
|
+
x: e.clientX,
|
|
3237
|
+
y: e.clientY,
|
|
3238
|
+
target: e.target,
|
|
3239
|
+
time: Date.now()
|
|
3240
|
+
};
|
|
3241
|
+
}, document.addEventListener("pointerdown", this._pointerDownHandler, !0);
|
|
3242
|
+
}
|
|
3243
|
+
disconnectedCallback() {
|
|
3244
|
+
I(this), this._pointerDownHandler &&= (document.removeEventListener("pointerdown", this._pointerDownHandler, !0), null), this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
3245
|
+
}
|
|
3246
|
+
attributeChangedCallback(e, t, n) {
|
|
3247
|
+
t !== n && (e === "open" && n !== null && !this._triggerElement && (this._triggerElement = this._findTriggerElement(), this._triggerPoint = this._findTriggerPoint(this._triggerElement)), this.render());
|
|
3248
|
+
}
|
|
3249
|
+
getId() {
|
|
3250
|
+
return this.getAttribute("id") || "";
|
|
3251
|
+
}
|
|
3252
|
+
getHeading() {
|
|
3253
|
+
return this.getAttribute("heading") || "";
|
|
3254
|
+
}
|
|
3255
|
+
getSize() {
|
|
3256
|
+
let e = this.getAttribute("size");
|
|
3257
|
+
return e === "small" || e === "large" ? e : "default";
|
|
3258
|
+
}
|
|
3259
|
+
isOpen() {
|
|
3260
|
+
return this.hasAttribute("open");
|
|
3261
|
+
}
|
|
3262
|
+
open(e) {
|
|
3263
|
+
this._triggerElement = this._findTriggerElement(e), this._triggerPoint = this._findTriggerPoint(this._triggerElement), this.setAttribute("open", "");
|
|
3264
|
+
}
|
|
3265
|
+
close() {
|
|
3266
|
+
this.removeAttribute("open");
|
|
3267
|
+
}
|
|
3268
|
+
render() {
|
|
3269
|
+
let e = this.getId(), t = this.getHeading(), n = this.isOpen(), r = this.getSize();
|
|
3270
|
+
if (e && (this.id = e), this._overlay || (this._overlay = document.createElement("div"), this._overlay.className = "mint-modal-overlay", this._overlay.addEventListener("click", () => this.close()), this.appendChild(this._overlay)), this._modal || (this._modal = document.createElement("div"), this._modal.className = "mint-modal-shell", this.appendChild(this._modal)), n) {
|
|
3271
|
+
let e = this._modal.querySelector(".modal-content");
|
|
3272
|
+
e || (e = document.createElement("div"), e.className = "modal-content", this._modal.appendChild(e)), this._renderedOpen || (this._renderedOpen = !0, gn(this), this._animateEnter());
|
|
3273
|
+
} else this._renderedOpen && (this._renderedOpen = !1, this._animateExit());
|
|
3274
|
+
let i = this._modal.querySelector(".modal-content");
|
|
3275
|
+
i || (i = document.createElement("div"), i.className = "modal-content", this._modal.appendChild(i)), i.classList.remove("modal-content--small", "modal-content--large"), r !== "default" && i.classList.add(`modal-content--${r}`), this._header || (this._header = document.createElement("div"), this._header.className = "mint-modal-header", i.appendChild(this._header)), this._headingSlot || (this._headingSlot = document.createElement("div"), this._headingSlot.className = "mint-modal-heading", this._headingSlot.setAttribute("slot", "heading"), this._header.appendChild(this._headingSlot));
|
|
3276
|
+
let a = this._headingSlot.querySelector("mint-text");
|
|
3277
|
+
t ? (a || (a = document.createElement("mint-text"), a.setAttribute("size", "sub-heading"), a.setAttribute("bold", ""), this._headingSlot.appendChild(a)), a.textContent = t) : a && a.remove(), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._headingSlot && e.getAttribute("slot") === "heading").forEach((e) => {
|
|
3278
|
+
e.parentElement !== this._headingSlot && this._headingSlot.appendChild(e);
|
|
3279
|
+
}), this._closeButton || (this._closeButton = document.createElement("mint-button"), this._closeButton.classList.add("mint-modal-close-button"), this._closeButton.setAttribute("variant", "ghost"), this._closeButton.setAttribute("icon", "close"), this._closeButton.addEventListener("click", () => this.close()), this._header.appendChild(this._closeButton)), this._bodySlot || (this._bodySlot = document.createElement("div"), this._bodySlot.className = "mint-modal-body", this._bodySlot.setAttribute("slot", "body"), i.appendChild(this._bodySlot)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._bodySlot && e.getAttribute("slot") === "body").forEach((e) => {
|
|
3280
|
+
e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
3281
|
+
});
|
|
3282
|
+
let o = Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._actionsSlot && e.getAttribute("slot") === "actions"), s = this._actionsSlot?.querySelector("mint-stack"), c = !!s && s.children.length > 0;
|
|
3283
|
+
if (o.length || c) {
|
|
3284
|
+
this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-mint-divider", this._actionsSlot.setAttribute("slot", "actions"), i.appendChild(this._actionsSlot));
|
|
3285
|
+
let e = this._actionsSlot.querySelector("mint-stack");
|
|
3286
|
+
e || (e = document.createElement("mint-stack"), e.setAttribute("direction", "horizontal"), e.setAttribute("align-content", "right"), e.className = "mint-actions-stack", this._actionsSlot.appendChild(e)), o.forEach((t) => {
|
|
3287
|
+
Array.from(t.children).forEach((t) => e.appendChild(t)), t.remove();
|
|
3288
|
+
});
|
|
3289
|
+
} else this._actionsSlot &&= (this._actionsSlot.remove(), null);
|
|
3290
|
+
Array.from(this.children).forEach((e) => {
|
|
3291
|
+
e !== this._overlay && e !== this._modal && e.getAttribute("slot") !== "heading" && e.getAttribute("slot") !== "body" && e.getAttribute("slot") !== "actions" && e !== this._headingSlot && e !== this._bodySlot && e !== this._actionsSlot && e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
3292
|
+
}), this._updateBackgroundColor();
|
|
3293
|
+
}
|
|
3294
|
+
_updateBackgroundColor() {
|
|
3295
|
+
if (!this._modal) return;
|
|
3296
|
+
document.documentElement?.classList.contains("dark") || document.documentElement?.dataset.mintTheme;
|
|
3297
|
+
let e = this._modal.querySelector(".modal-content");
|
|
3298
|
+
e && (e.style.background = "var(--mint-color-surface-raised)");
|
|
3299
|
+
}
|
|
3300
|
+
_observeDarkMode() {
|
|
3301
|
+
if (!this._darkModeObserver) {
|
|
3302
|
+
if (this._darkModeObserver = new MutationObserver(() => {
|
|
3303
|
+
this._updateBackgroundColor();
|
|
3304
|
+
}), !document.documentElement) return;
|
|
3305
|
+
this._darkModeObserver.observe(document.documentElement, {
|
|
3306
|
+
attributes: !0,
|
|
3307
|
+
attributeFilter: ["class", "data-mint-theme"]
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
_animateEnter() {
|
|
3312
|
+
let e = this._modal?.querySelector(".modal-content");
|
|
3313
|
+
e && (this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this.classList.remove("mint-modal-closing"), this.classList.remove("mint-modal-open"), this.classList.add("mint-modal-open"), this.classList.remove("mint-hidden"), e.style.transform = "none", e.style.opacity = "0", e.style.transition = "none", requestAnimationFrame(() => {
|
|
3314
|
+
if (!this.isOpen()) return;
|
|
3315
|
+
let t = window.getComputedStyle(e).borderRadius;
|
|
3316
|
+
this._setTransformOrigin(e), e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", e.getBoundingClientRect(), e.style.transition = "opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)", requestAnimationFrame(() => {
|
|
3317
|
+
this.isOpen() && (e.style.transform = "scale(1)", e.style.opacity = "1", e.style.borderRadius = t, window.setTimeout(() => {
|
|
3318
|
+
this.isOpen() && (e.style.transition = "", e.style.transform = "none");
|
|
3319
|
+
}, 380));
|
|
3320
|
+
});
|
|
3321
|
+
}));
|
|
3322
|
+
}
|
|
3323
|
+
_findTriggerElement(e) {
|
|
3324
|
+
if (typeof e == "string") {
|
|
3325
|
+
let t = document.getElementById(e);
|
|
3326
|
+
return t && !this.contains(t) ? t : null;
|
|
3327
|
+
}
|
|
3328
|
+
if (e instanceof HTMLElement) return e.isConnected && !this.contains(e) ? e : null;
|
|
3329
|
+
let t = this.getAttribute("trigger-id");
|
|
3330
|
+
if (t) {
|
|
3331
|
+
let e = document.getElementById(t);
|
|
3332
|
+
if (e && !this.contains(e)) return e;
|
|
3333
|
+
}
|
|
3334
|
+
let n = document.activeElement;
|
|
3335
|
+
return n instanceof HTMLElement && n.isConnected && n !== document.body && !this.contains(n) ? n : null;
|
|
3336
|
+
}
|
|
3337
|
+
_findTriggerPoint(e) {
|
|
3338
|
+
if (!e) return null;
|
|
3339
|
+
let t = this._lastPointerPoint;
|
|
3340
|
+
if (!t || Date.now() - t.time > 1e3) return null;
|
|
3341
|
+
let n = t.target instanceof Node ? t.target : null;
|
|
3342
|
+
return n === e || n && e.contains(n) ? {
|
|
3343
|
+
x: t.x,
|
|
3344
|
+
y: t.y
|
|
3345
|
+
} : null;
|
|
3346
|
+
}
|
|
3347
|
+
_setTransformOrigin(e) {
|
|
3348
|
+
let t = this._findTriggerElement(this._triggerElement);
|
|
3349
|
+
this._triggerElement = t;
|
|
3350
|
+
let n = this._findTriggerPoint(t);
|
|
3351
|
+
if (n) {
|
|
3352
|
+
let t = e.getBoundingClientRect();
|
|
3353
|
+
e.style.transformOrigin = `${n.x - t.left}px ${n.y - t.top}px`, this._triggerPoint = n;
|
|
3354
|
+
return;
|
|
3355
|
+
}
|
|
3356
|
+
this._triggerPoint = {
|
|
3357
|
+
x: window.innerWidth / 2,
|
|
3358
|
+
y: 0
|
|
3359
|
+
};
|
|
3360
|
+
let r = e.getBoundingClientRect();
|
|
3361
|
+
e.style.transformOrigin = `${this._triggerPoint.x - r.left}px ${this._triggerPoint.y - r.top}px`;
|
|
3362
|
+
}
|
|
3363
|
+
_animateExit() {
|
|
3364
|
+
this.classList.remove("mint-modal-open"), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null);
|
|
3365
|
+
let e = this._modal?.querySelector(".modal-content");
|
|
3366
|
+
if (!e) {
|
|
3367
|
+
this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing"), I(this);
|
|
3368
|
+
return;
|
|
3369
|
+
}
|
|
3370
|
+
this._exitTimer && clearTimeout(this._exitTimer), this.classList.add("mint-modal-closing"), e.style.transition = "opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)", e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", this._exitTimer = setTimeout(() => {
|
|
3371
|
+
this._exitTimer = null, !this.isOpen() && (this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing"), e.style.transform = "", e.style.opacity = "", e.style.borderRadius = "", e.style.transition = "", I(this));
|
|
3372
|
+
}, 280);
|
|
3373
|
+
}
|
|
3374
|
+
};
|
|
3375
|
+
typeof customElements < "u" && !customElements.get("mint-modal") && a("mint-modal", _n), s({
|
|
3283
3376
|
name: "check",
|
|
3284
3377
|
viewBox: "0 0 24 24",
|
|
3285
3378
|
path: "M5 13l4 4L19 7",
|
|
@@ -7021,7 +7114,7 @@ var Ln = class extends HTMLElement {
|
|
|
7021
7114
|
detail: { value: this.getValue() },
|
|
7022
7115
|
bubbles: !0,
|
|
7023
7116
|
cancelable: !0
|
|
7024
|
-
}));
|
|
7117
|
+
})), this._dispatchDateChangeEvent();
|
|
7025
7118
|
}
|
|
7026
7119
|
};
|
|
7027
7120
|
t.addEventListener("click", r), t.addEventListener("touchend", (e) => {
|
|
@@ -9596,8 +9689,6 @@ var Un = {
|
|
|
9596
9689
|
"min-w-0": "rtu-7e0b7cdf1",
|
|
9597
9690
|
"min-w-[11rem]": "rtu-46b2fd2eb",
|
|
9598
9691
|
"ml-2": "rtu-c68af9986",
|
|
9599
|
-
"mr-0": "rtu-719fceda9",
|
|
9600
|
-
"mr-2": "rtu-d2347e849",
|
|
9601
9692
|
"mx-auto": "rtu-0e12dc7de",
|
|
9602
9693
|
"overflow-hidden": "rtu-2cd02d11d",
|
|
9603
9694
|
"overflow-x-auto": "rtu-1384f66f4",
|
|
@@ -9657,7 +9748,7 @@ var Un = {
|
|
|
9657
9748
|
super(...e), this._observer = null, this._disposeScrollFade = null;
|
|
9658
9749
|
}
|
|
9659
9750
|
connectedCallback() {
|
|
9660
|
-
this.classList.add("mint-table-host"), this._disposeScrollFade =
|
|
9751
|
+
this.classList.add("mint-table-host"), this._disposeScrollFade = N(this, "both"), this._observeChanges(), this._applyStyles(), requestAnimationFrame(() => {
|
|
9661
9752
|
this._applyStyles(), setTimeout(() => this._applyStyles(), 0);
|
|
9662
9753
|
});
|
|
9663
9754
|
}
|
|
@@ -9761,6 +9852,17 @@ var Gn = class extends HTMLElement {
|
|
|
9761
9852
|
refresh() {
|
|
9762
9853
|
this._configuration && (this._type === "ajax" ? this._fetchData(void 0, !0, this._perPage, this._offset) : (Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._rows.length), this.render()));
|
|
9763
9854
|
}
|
|
9855
|
+
exportCSV() {
|
|
9856
|
+
this._downloadCSV();
|
|
9857
|
+
}
|
|
9858
|
+
getRequestState() {
|
|
9859
|
+
return {
|
|
9860
|
+
search: this._search,
|
|
9861
|
+
sortBy: this._configuration?.sortBy || "id",
|
|
9862
|
+
sort: this._configuration?.sort || "asc",
|
|
9863
|
+
searchColumns: [...this._searchColumns]
|
|
9864
|
+
};
|
|
9865
|
+
}
|
|
9764
9866
|
setData(e) {
|
|
9765
9867
|
if (this._configuration) {
|
|
9766
9868
|
if (this._configuration.data = e, this._type = typeof e == "string" ? "ajax" : "provided", this._currentPage = 1, this._offset = 0, this._updatePageInUrl(1), this._fetchError = null, this._searching = !1, this._loadingPage = null, this._sortTimeoutId &&= (clearTimeout(this._sortTimeoutId), null), this._searchTimeoutId &&= (clearTimeout(this._searchTimeoutId), null), this._virtualScrollActive() && (this._virtualRowCache.clear(), this._virtualInvalidate()), this._type === "ajax") {
|
|
@@ -10011,7 +10113,7 @@ var Gn = class extends HTMLElement {
|
|
|
10011
10113
|
}
|
|
10012
10114
|
_paginationPageButtonLi(e) {
|
|
10013
10115
|
let t = this._currentPage === e, n = this._loadingPage === e;
|
|
10014
|
-
return `<li class="shrink-0"><mint-button variant="solid" size="sm"${t ? " active=\"true\"" : ""}${this._loading || this._fetching ? " disabled=\"true\"" : ""}${n ? " loading=\"true\"" : ""} data-action="page" data-page="${e}">${
|
|
10116
|
+
return `<li class="shrink-0"><mint-button variant="solid" size="sm"${t ? " active=\"true\"" : ""}${this._loading || this._fetching ? " disabled=\"true\"" : ""}${n ? " loading=\"true\"" : ""}${` aria-label="Page ${e}"`} data-action="page" data-page="${e}">${`${e}`}</mint-button></li>`;
|
|
10015
10117
|
}
|
|
10016
10118
|
_paginationHtmlCompactMiddle(e) {
|
|
10017
10119
|
let t = "", n = this._currentPage;
|
|
@@ -10405,7 +10507,7 @@ var Gn = class extends HTMLElement {
|
|
|
10405
10507
|
let e = () => {
|
|
10406
10508
|
this._scheduleVirtualWindowSync();
|
|
10407
10509
|
};
|
|
10408
|
-
this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl && (this._disposeVirtualBodyFade =
|
|
10510
|
+
this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl && (this._disposeVirtualBodyFade = N(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();
|
|
10409
10511
|
}
|
|
10410
10512
|
_toggleSort(e) {
|
|
10411
10513
|
if (!this._configuration || !e.data || !e.sortable) return;
|
|
@@ -10548,29 +10650,7 @@ var Gn = class extends HTMLElement {
|
|
|
10548
10650
|
let r = this._buildPaginationNavMarkup(e);
|
|
10549
10651
|
n.innerHTML = r, setTimeout(() => {
|
|
10550
10652
|
this._attachPaginationListeners(), n.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
|
|
10551
|
-
|
|
10552
|
-
if (r) if (n) {
|
|
10553
|
-
let e = [], t = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null), n;
|
|
10554
|
-
for (; n = t.nextNode();) e.push(n);
|
|
10555
|
-
e.forEach((e) => e.parentNode?.removeChild(e));
|
|
10556
|
-
let i = r.querySelector(".mint-button-content");
|
|
10557
|
-
if (i) {
|
|
10558
|
-
let e = i.textContent?.trim();
|
|
10559
|
-
e && /^\d+$/.test(e) && i.remove();
|
|
10560
|
-
}
|
|
10561
|
-
let a = r.querySelector("span.mr-2");
|
|
10562
|
-
a && a.querySelector("mint-spinner") && (a.classList.remove("mr-2"), a.classList.add("mr-0"));
|
|
10563
|
-
} else {
|
|
10564
|
-
let e = r.textContent?.trim();
|
|
10565
|
-
if (!e || !/^\d+$/.test(e)) {
|
|
10566
|
-
let e = t || "", n = r.querySelector("mint-spinner");
|
|
10567
|
-
r.innerHTML = "", n && r.appendChild(n), r.appendChild(document.createTextNode(e));
|
|
10568
|
-
}
|
|
10569
|
-
}
|
|
10570
|
-
if ("render" in e && typeof e.render == "function" && (e.render(), n && r)) {
|
|
10571
|
-
let e = r.querySelector("span.mr-2");
|
|
10572
|
-
e && e.querySelector("mint-spinner") && (e.classList.remove("mr-2"), e.classList.add("mr-0"));
|
|
10573
|
-
}
|
|
10653
|
+
"render" in e && typeof e.render == "function" && e.render();
|
|
10574
10654
|
}), n.querySelectorAll("mint-button[data-action=\"page-prev\"], mint-button[data-action=\"page-next\"]").forEach((e) => {
|
|
10575
10655
|
"render" in e && typeof e.render == "function" && e.render();
|
|
10576
10656
|
}), this._loadingPage !== null && !this._loading && !this._fetching && this._updatePagination();
|
|
@@ -10585,15 +10665,20 @@ var Gn = class extends HTMLElement {
|
|
|
10585
10665
|
if (!this.isConnected) return;
|
|
10586
10666
|
let e = this._useMobileListLayout() ? this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`) : null, t = this.querySelector(`#${this._tableId}`)?.closest("table"), n = e?.querySelector(":scope > li") || t?.querySelector("tbody tr[data-row-index=\"0\"]");
|
|
10587
10667
|
if (!n) return;
|
|
10588
|
-
let r = this.
|
|
10589
|
-
if (
|
|
10590
|
-
let e =
|
|
10591
|
-
|
|
10592
|
-
|
|
10668
|
+
let r = this._findVerticalScrollContainer(n);
|
|
10669
|
+
if (!r) {
|
|
10670
|
+
let e = this.getBoundingClientRect();
|
|
10671
|
+
if (e.top >= 0 && e.bottom <= window.innerHeight) return;
|
|
10672
|
+
}
|
|
10673
|
+
let i = this._virtualScrollStickyOverlapPx(t), a = n.getBoundingClientRect();
|
|
10674
|
+
if (r) {
|
|
10675
|
+
let e = r.getBoundingClientRect();
|
|
10676
|
+
r.scrollTo({
|
|
10677
|
+
top: r.scrollTop + a.top - e.top - i - 8,
|
|
10593
10678
|
behavior: "smooth"
|
|
10594
10679
|
});
|
|
10595
10680
|
} else window.scrollTo({
|
|
10596
|
-
top: Math.max(0, window.scrollY + a.top -
|
|
10681
|
+
top: Math.max(0, window.scrollY + a.top - i - 8),
|
|
10597
10682
|
behavior: "smooth"
|
|
10598
10683
|
});
|
|
10599
10684
|
}));
|
|
@@ -12647,7 +12732,7 @@ var ir = class extends HTMLElement {
|
|
|
12647
12732
|
e.replaceChildren(...n);
|
|
12648
12733
|
}
|
|
12649
12734
|
_buildContent() {
|
|
12650
|
-
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 ||=
|
|
12735
|
+
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 ||= N(this._content, "vertical"));
|
|
12651
12736
|
}
|
|
12652
12737
|
_buildFooter() {
|
|
12653
12738
|
if (!this._container) return;
|
|
@@ -14623,4 +14708,4 @@ var $ = class extends HTMLElement {
|
|
|
14623
14708
|
};
|
|
14624
14709
|
customElements.get("mint-tree") || a("mint-tree", $);
|
|
14625
14710
|
//#endregion
|
|
14626
|
-
export { Cn as Alert, ln as BackButton, Tn as BottomNavigation, M as Button, M as default, on as Card, En as Chart, vn as Checkbox, Dn as Chip, yn as Choice, On as Clickable, kn as Collapsible, An as ConfirmAction, Ln as DatePicker, zn as DateTimePicker, Bn as Dropzone, Vn as Form,
|
|
14711
|
+
export { Cn as Alert, ln as BackButton, Tn as BottomNavigation, M as Button, M as default, on as Card, En as Chart, vn as Checkbox, Dn as Chip, yn as Choice, On as Clickable, kn as Collapsible, An as ConfirmAction, Ln as DatePicker, zn as DateTimePicker, Bn as Dropzone, Vn as Form, hn as Grid, l as Icon, In as Input, sn as Link, wn as MintBottomNavItem, L as MintBottomNavigation, tr as MintSidenavActionLinks, nr as MintSidenavActionMenu, $n as MintSidenavLink, er as MintSidenavLinks, $ as MintTree, $ as Tree, _n as Modal, Zn as NativeSelect, Sn as Navigation, Hn as OffCanvas, mn as Page, pn as Popover, Gn as ResourceTable, un as ScrollFade, Xn as Search, Qn as Select, ar as SideNavigation, or as Sortable, tn as Spinner, an as Stack, nn as Switch, sr as Tab, lr as TabContent, cr as TabList, Wn as Table, ur as Tabs, dr as Tags, rn as Text, Rn as TimePicker, fr as Toast, Fn as confirm, yr as mintui, N as observeScrollFade, vr as toast };
|