monobill-mintui 0.6.645 → 0.6.646
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 +6 -1
- package/dist/back-button.css +1 -1
- package/dist/button.css +1 -1
- package/dist/components/back-button/BackButton.d.ts.map +1 -1
- package/dist/components/back-button/browser.js +2 -224
- package/dist/components/back-button/index.cjs +1 -1
- package/dist/components/back-button/index.js +2 -224
- 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/chip/browser.js +1 -1
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chunks/back-button-CDyPYehm.js +224 -0
- package/dist/components/chunks/back-button-SmmB1OdQ.js +1 -0
- package/dist/components/chunks/{button--a5GFBsq.js → button-BYkzR0uX.js} +1 -1
- package/dist/components/chunks/{button-BSQ2kbSp.js → button-DfY2Sr3-.js} +1 -1
- package/dist/components/chunks/{confirm-action-Bv8hCxqm.js → confirm-action-CjXJmqh4.js} +1 -1
- package/dist/components/chunks/{confirm-action-BecP6BE6.js → confirm-action-Et6i603N.js} +2 -2
- package/dist/components/chunks/{input-DpwjDKrY.js → input-4DeekhBC.js} +2 -2
- package/dist/components/chunks/{input-6-AalZ1Z.js → input-CF0QIi3N.js} +1 -1
- package/dist/components/chunks/{modal-f4myL8Ka.js → modal-CHLB5Td7.js} +1 -1
- package/dist/components/chunks/{modal-aq9VkzER.js → modal-DXviLYW_.js} +2 -2
- 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/browser.js +3 -3
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +3 -3
- 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/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 +3 -3
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/off-canvas/browser.js +2 -2
- package/dist/components/off-canvas/index.cjs +1 -1
- package/dist/components/off-canvas/index.js +2 -2
- package/dist/components/page/Page.d.ts.map +1 -1
- package/dist/components/page/browser.js +8 -3
- package/dist/components/page/index.cjs +41 -7
- package/dist/components/page/index.js +8 -3
- 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/browser.js +8 -8
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +8 -8
- package/dist/components/search/browser.js +4 -4
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +4 -4
- package/dist/components/select/browser.js +2 -2
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/side-navigation/browser.js +3 -3
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +3 -3
- 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/spinner/browser.js +1 -1
- package/dist/components/spinner/index.cjs +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/stack/browser.js +1 -1
- package/dist/components/stack/index.cjs +1 -1
- package/dist/components/stack/index.js +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 +3 -3
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +3 -3
- package/dist/components/time-picker/browser.js +2 -2
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -2
- package/dist/components/tree/browser.js +5 -5
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +5 -5
- package/dist/confirm-action.css +1 -1
- package/dist/index.cjs +42 -8
- package/dist/index.css +6 -6
- package/dist/index.js +238 -238
- package/dist/modal.css +1 -1
- package/dist/navigation.css +1 -1
- package/dist/page.css +1 -1
- package/package.json +1 -1
- /package/dist/components/chunks/{caret-down-CDnWVla1.js → caret-down-Ccvv5gwc.js} +0 -0
- /package/dist/components/chunks/{caret-down-Bc-42asv.js → caret-down-D1Qs39Av.js} +0 -0
- /package/dist/components/chunks/{caret-right-Dl7Btqeu.js → caret-right-C83pwBin.js} +0 -0
- /package/dist/components/chunks/{caret-right-pNDbqRU-.js → caret-right-IYvGg3-k.js} +0 -0
- /package/dist/components/chunks/{caret-up-B9fWmN80.js → caret-up-CqFNwOux.js} +0 -0
- /package/dist/components/chunks/{caret-up-DS_oo8YB.js → caret-up-CsT9c_xE.js} +0 -0
- /package/dist/components/chunks/{chip-mkhI7zxk.js → chip-CLCBimJI.js} +0 -0
- /package/dist/components/chunks/{chip-Bl9qQp6u.js → chip-Dfj3x__h.js} +0 -0
- /package/dist/components/chunks/{link-4LblIyiP.js → link-BsC3zT_I.js} +0 -0
- /package/dist/components/chunks/{link-DYbrI89a.js → link-dTjSvr4E.js} +0 -0
- /package/dist/components/chunks/{popover-Db9ZGHd9.js → popover-CNZ5u-MA.js} +0 -0
- /package/dist/components/chunks/{popover-CV-QCPjW.js → popover-DB1OaYVe.js} +0 -0
- /package/dist/components/chunks/{search-CYCZByVh.js → search-W2xBCOsc.js} +0 -0
- /package/dist/components/chunks/{search-DCUJFMBL.js → search-oWslgsR8.js} +0 -0
- /package/dist/components/chunks/{sortable-CparUKN_.js → sortable-B1nMJBah.js} +0 -0
- /package/dist/components/chunks/{sortable-DX2PwFLN.js → sortable-CXM-7eyL.js} +0 -0
- /package/dist/components/chunks/{spinner-BsaFHuS6.js → spinner-BjC3nA-C.js} +0 -0
- /package/dist/components/chunks/{spinner-DbTohC6i.js → spinner-DfPbEa2d.js} +0 -0
- /package/dist/components/chunks/{stack-CpmqyaNX.js → stack-Bdl46AdO.js} +0 -0
- /package/dist/components/chunks/{stack-_7V0Fcu0.js → stack-nq3AmcMG.js} +0 -0
- /package/dist/components/chunks/{table-CI11Mff-.js → table-2-0iNQJy.js} +0 -0
- /package/dist/components/chunks/{table-EgbYUKL8.js → table-DRdsVUJL.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -2317,10 +2317,226 @@ var on = class extends HTMLElement {
|
|
|
2317
2317
|
this._link.className = n.filter(Boolean).join(" ");
|
|
2318
2318
|
}
|
|
2319
2319
|
};
|
|
2320
|
-
typeof customElements < "u" && !customElements.get("mint-link") && a("mint-link", on)
|
|
2320
|
+
typeof customElements < "u" && !customElements.get("mint-link") && a("mint-link", on), s({
|
|
2321
|
+
name: "arrow-left",
|
|
2322
|
+
viewBox: "0 0 24 24",
|
|
2323
|
+
path: "M19 12H5m7-7l-7 7 7 7",
|
|
2324
|
+
strokeLinecap: "round",
|
|
2325
|
+
strokeLinejoin: "round"
|
|
2326
|
+
});
|
|
2321
2327
|
//#endregion
|
|
2322
|
-
//#region src/components/
|
|
2328
|
+
//#region src/components/button/Button.js
|
|
2323
2329
|
var sn = class extends HTMLElement {
|
|
2330
|
+
static get observedAttributes() {
|
|
2331
|
+
return [
|
|
2332
|
+
"variant",
|
|
2333
|
+
"tone",
|
|
2334
|
+
"disabled",
|
|
2335
|
+
"loading",
|
|
2336
|
+
"button-type",
|
|
2337
|
+
"type",
|
|
2338
|
+
"full-width",
|
|
2339
|
+
"icon-position",
|
|
2340
|
+
"icon"
|
|
2341
|
+
];
|
|
2342
|
+
}
|
|
2343
|
+
constructor() {
|
|
2344
|
+
super(), this._button = null, this._clickHandler = null, this._isHandlingClick = !1;
|
|
2345
|
+
}
|
|
2346
|
+
connectedCallback() {
|
|
2347
|
+
this.render(), this._button && this.setupEventListeners();
|
|
2348
|
+
}
|
|
2349
|
+
disconnectedCallback() {
|
|
2350
|
+
this.removeEventListeners();
|
|
2351
|
+
}
|
|
2352
|
+
attributeChangedCallback(e, t, n) {
|
|
2353
|
+
t !== n && this.render();
|
|
2354
|
+
}
|
|
2355
|
+
getVariant() {
|
|
2356
|
+
return this.getAttribute("variant") || "solid";
|
|
2357
|
+
}
|
|
2358
|
+
getTone() {
|
|
2359
|
+
return this.getAttribute("tone") || "neutral";
|
|
2360
|
+
}
|
|
2361
|
+
isDisabled() {
|
|
2362
|
+
return this.hasAttribute("disabled");
|
|
2363
|
+
}
|
|
2364
|
+
isLoading() {
|
|
2365
|
+
return this.hasAttribute("loading");
|
|
2366
|
+
}
|
|
2367
|
+
getType() {
|
|
2368
|
+
return (this.getAttribute("type") || this.getAttribute("button-type") || "default") === "submit" ? "submit" : "button";
|
|
2369
|
+
}
|
|
2370
|
+
isFullWidth() {
|
|
2371
|
+
return this.hasAttribute("full-width");
|
|
2372
|
+
}
|
|
2373
|
+
getIconPosition() {
|
|
2374
|
+
return this.getAttribute("icon-position") || "left";
|
|
2375
|
+
}
|
|
2376
|
+
getIcon() {
|
|
2377
|
+
return this.getAttribute("icon") || "";
|
|
2378
|
+
}
|
|
2379
|
+
isIconOnly() {
|
|
2380
|
+
if (!(this.getIcon() || this._button?.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon"))) return !1;
|
|
2381
|
+
let e = this._button?.querySelector(".mint-button-content");
|
|
2382
|
+
if (e && e.textContent.trim()) return !1;
|
|
2383
|
+
if (this._button) {
|
|
2384
|
+
for (let e = this._button.firstChild; e; e = e.nextSibling) if (e.nodeType === Node.TEXT_NODE && e.textContent.trim() || e.nodeType === Node.ELEMENT_NODE && e.tagName !== "MINT-ICON" && e.tagName !== "MINT-SPINNER" && !e.querySelector?.("mint-spinner") && !e.hasAttribute?.("slot") && e.className !== "mint-button-icon" && !(e.className === "mr-2" && e.querySelector("mint-spinner")) && e.textContent.trim()) return !1;
|
|
2385
|
+
}
|
|
2386
|
+
return !0;
|
|
2387
|
+
}
|
|
2388
|
+
getButtonClasses() {
|
|
2389
|
+
return [
|
|
2390
|
+
"mint-button-core",
|
|
2391
|
+
"mint-button-" + this.getVariant(),
|
|
2392
|
+
"mint-button-tone-" + this.getTone(),
|
|
2393
|
+
this.isIconOnly() ? "mint-button-icon-only" : "",
|
|
2394
|
+
this.isFullWidth() ? "mint-button-full-width" : ""
|
|
2395
|
+
].filter(Boolean).join(" ");
|
|
2396
|
+
}
|
|
2397
|
+
render() {
|
|
2398
|
+
let e = this.isDisabled() || this.isLoading(), t = this.getType();
|
|
2399
|
+
if (!this._button) {
|
|
2400
|
+
for (this._button = document.createElement("button"); this.firstChild;) this._button.appendChild(this.firstChild);
|
|
2401
|
+
this.appendChild(this._button), this.setupEventListeners();
|
|
2402
|
+
}
|
|
2403
|
+
this._button.type = t, this._button.disabled = e;
|
|
2404
|
+
let n = this._button.querySelector("mint-spinner");
|
|
2405
|
+
if (this.isLoading()) if (n) n.setAttribute("data-button-variant", this.getVariant()), n.setAttribute("data-button-tone", this.getTone()), n.render();
|
|
2406
|
+
else {
|
|
2407
|
+
let e = document.createElement("span");
|
|
2408
|
+
e.className = "mint-spinner-wrap";
|
|
2409
|
+
let t = document.createElement("mint-spinner");
|
|
2410
|
+
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "0.875rem", t.style.height = "0.875rem", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
|
|
2411
|
+
}
|
|
2412
|
+
else n && n.parentElement?.remove();
|
|
2413
|
+
for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
|
|
2414
|
+
let r = this.getIcon(), i = this._button.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon");
|
|
2415
|
+
r ? (i && i.tagName !== "MINT-ICON" && (i.remove(), i = null), !i || i.tagName !== "MINT-ICON" ? (i = document.createElement("mint-icon"), i.setAttribute("name", r), i.className = "mint-button-icon") : i.setAttribute("name", r)) : i && i.tagName === "MINT-ICON" && (i.remove(), i = null), i ||= this._button.querySelector("[slot=\"icon\"], .mint-button-icon");
|
|
2416
|
+
let a = this.getIconPosition(), o = this._button.querySelector(".mint-button-content");
|
|
2417
|
+
if (o) {
|
|
2418
|
+
let e = i && i.tagName === "MINT-ICON";
|
|
2419
|
+
if (i && !i.parentElement) {
|
|
2420
|
+
let t = this._button.querySelector("mint-spinner")?.parentElement;
|
|
2421
|
+
e || a === "left" ? t ? t.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o) : o.insertAdjacentElement("afterend", i);
|
|
2422
|
+
} else if (i && (e || a === "left") && i.nextSibling !== o) {
|
|
2423
|
+
i.remove();
|
|
2424
|
+
let e = this._button.querySelector("mint-spinner")?.parentElement;
|
|
2425
|
+
e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o);
|
|
2426
|
+
} else i && !e && a === "right" && i.previousSibling !== o && (i.remove(), o.insertAdjacentElement("afterend", i));
|
|
2427
|
+
} else {
|
|
2428
|
+
let e = [];
|
|
2429
|
+
for (let t = this._button.firstChild; t; t = t.nextSibling) t.tagName !== "MINT-SPINNER" && !t.querySelector?.("mint-spinner") && t !== i && !t.hasAttribute?.("slot") && !(t.className === "mr-2" && t.querySelector("mint-spinner")) && e.push(t);
|
|
2430
|
+
if (e.length > 0) {
|
|
2431
|
+
o = document.createElement("span"), o.className = "mint-button-content", e.forEach((e) => {
|
|
2432
|
+
o.appendChild(e);
|
|
2433
|
+
});
|
|
2434
|
+
let t = this._button.querySelector("mint-spinner")?.parentElement;
|
|
2435
|
+
i && a === "left" ? t ? (t.insertAdjacentElement("afterend", i), i.insertAdjacentElement("afterend", o)) : (this._button.insertBefore(i, this._button.firstChild), i.insertAdjacentElement("afterend", o)) : i && a === "right" ? t ? (t.insertAdjacentElement("afterend", o), o.insertAdjacentElement("afterend", i)) : (this._button.insertBefore(o, this._button.firstChild), o.insertAdjacentElement("afterend", i)) : t ? t.insertAdjacentElement("afterend", o) : this._button.insertBefore(o, this._button.firstChild);
|
|
2436
|
+
} else if (i && i.tagName === "MINT-ICON" && !i.parentElement) {
|
|
2437
|
+
let e = this._button.querySelector("mint-spinner")?.parentElement;
|
|
2438
|
+
e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, this._button.firstChild);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
let s = this.isIconOnly();
|
|
2442
|
+
i && (i.classList.contains("mint-button-icon") || i.classList.add("mint-button-icon"), i.classList.remove("mint-icon-leading", "mint-icon-trailing"), s ? 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"));
|
|
2443
|
+
let c = this.getButtonClasses();
|
|
2444
|
+
this._button.className = c;
|
|
2445
|
+
}
|
|
2446
|
+
setupEventListeners() {
|
|
2447
|
+
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));
|
|
2448
|
+
}
|
|
2449
|
+
removeEventListeners() {
|
|
2450
|
+
this._button && (this._clickHandler &&= (this._button.removeEventListener("click", this._clickHandler, !0), null), this._button.removeEventListener("mousedown", this._handleMouseDown), this._button.removeEventListener("mouseup", this._handleMouseUp), this._button.removeEventListener("mouseleave", this._handleMouseLeave), this._button.removeEventListener("touchstart", this._handleTouchStart), this._button.removeEventListener("touchend", this._handleTouchEnd), this._button.removeEventListener("touchcancel", this._handleTouchCancel));
|
|
2451
|
+
}
|
|
2452
|
+
_handleMouseDown = () => {
|
|
2453
|
+
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
2454
|
+
};
|
|
2455
|
+
_handleMouseUp = () => {
|
|
2456
|
+
this._button && this._button.classList.remove("mint-button-active");
|
|
2457
|
+
};
|
|
2458
|
+
_handleMouseLeave = () => {
|
|
2459
|
+
this._button && this._button.classList.remove("mint-button-active");
|
|
2460
|
+
};
|
|
2461
|
+
_handleTouchStart = () => {
|
|
2462
|
+
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
2463
|
+
};
|
|
2464
|
+
_handleTouchEnd = () => {
|
|
2465
|
+
this._button && this._button.classList.remove("mint-button-active");
|
|
2466
|
+
};
|
|
2467
|
+
_handleTouchCancel = () => {
|
|
2468
|
+
this._button && this._button.classList.remove("mint-button-active");
|
|
2469
|
+
};
|
|
2470
|
+
handleClick(e) {
|
|
2471
|
+
if (this.isDisabled() || this.isLoading()) {
|
|
2472
|
+
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
if (e.stopPropagation(), e.stopImmediatePropagation(), this._isHandlingClick) {
|
|
2476
|
+
e.preventDefault();
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
this._isHandlingClick = !0, e.preventDefault(), this.dispatchEvent(new CustomEvent("click", {
|
|
2480
|
+
detail: { originalEvent: e },
|
|
2481
|
+
bubbles: !0,
|
|
2482
|
+
cancelable: !0,
|
|
2483
|
+
composed: !0
|
|
2484
|
+
})), requestAnimationFrame(() => {
|
|
2485
|
+
this._isHandlingClick = !1;
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2489
|
+
typeof customElements < "u" && !customElements.get("mint-button") && a("mint-button", sn);
|
|
2490
|
+
//#endregion
|
|
2491
|
+
//#region src/components/back-button/BackButton.js
|
|
2492
|
+
var cn = class extends HTMLElement {
|
|
2493
|
+
static get observedAttributes() {
|
|
2494
|
+
return ["href", "fallback-href"];
|
|
2495
|
+
}
|
|
2496
|
+
constructor() {
|
|
2497
|
+
super(), this._historyDepth = 0, this._maxBackAttempts = 10, this._backAttempts = 0;
|
|
2498
|
+
}
|
|
2499
|
+
connectedCallback() {
|
|
2500
|
+
this.render(), this._setupHistoryTracking();
|
|
2501
|
+
}
|
|
2502
|
+
attributeChangedCallback(e, t, n) {
|
|
2503
|
+
t !== n && this.render();
|
|
2504
|
+
}
|
|
2505
|
+
_setupHistoryTracking() {
|
|
2506
|
+
window.addEventListener("popstate", () => {
|
|
2507
|
+
this._backAttempts = 0;
|
|
2508
|
+
}), this._historyDepth = window.history.length;
|
|
2509
|
+
}
|
|
2510
|
+
getFallbackHref() {
|
|
2511
|
+
return this.getAttribute("fallback-href") || this.getAttribute("href") || "/";
|
|
2512
|
+
}
|
|
2513
|
+
handleClick(e) {
|
|
2514
|
+
if (e.preventDefault(), e.stopPropagation(), window.history.length > 1 && this._backAttempts < this._maxBackAttempts && this._backAttempts === 0) {
|
|
2515
|
+
this._backAttempts++;
|
|
2516
|
+
let e = window.location.href, t = Date.now();
|
|
2517
|
+
window.history.back(), setTimeout(() => {
|
|
2518
|
+
Date.now() - t, window.location.href === e ? this._navigateToFallback() : setTimeout(() => {
|
|
2519
|
+
this._backAttempts = 0;
|
|
2520
|
+
}, 500);
|
|
2521
|
+
}, 200);
|
|
2522
|
+
} else this._navigateToFallback();
|
|
2523
|
+
}
|
|
2524
|
+
_navigateToFallback() {
|
|
2525
|
+
let e = this.getFallbackHref();
|
|
2526
|
+
if (this._backAttempts = 0, e.startsWith("/") && !e.startsWith("//")) try {
|
|
2527
|
+
window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
2528
|
+
return;
|
|
2529
|
+
} catch {}
|
|
2530
|
+
window.location.href = e;
|
|
2531
|
+
}
|
|
2532
|
+
render() {
|
|
2533
|
+
this._button || (this._button = document.createElement("mint-button"), this._button.setAttribute("variant", "solid"), this._button.setAttribute("tone", "neutral"), this._button.setAttribute("icon", "arrow-left"), this._button.setAttribute("aria-label", this.getAttribute("aria-label") || "Go back"), this._button.addEventListener("click", (e) => this.handleClick(e)), this.appendChild(this._button));
|
|
2534
|
+
}
|
|
2535
|
+
};
|
|
2536
|
+
typeof customElements < "u" && !customElements.get("mint-back-button") && a("mint-back-button", cn);
|
|
2537
|
+
//#endregion
|
|
2538
|
+
//#region src/components/page/Page.js
|
|
2539
|
+
var ln = class extends HTMLElement {
|
|
2324
2540
|
static get observedAttributes() {
|
|
2325
2541
|
return [
|
|
2326
2542
|
"heading",
|
|
@@ -2330,7 +2546,7 @@ var sn = class extends HTMLElement {
|
|
|
2330
2546
|
];
|
|
2331
2547
|
}
|
|
2332
2548
|
constructor() {
|
|
2333
|
-
super(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\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 <button part=\"back-button\" class=\"mint-page-back\"
|
|
2549
|
+
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: color-mix(in srgb, var(--mint-color-border-strong, #b9c5bc) 72%, white);\n border-left-color: color-mix(in srgb, var(--mint-color-border-strong, #b9c5bc) 72%, white);\n border-right-color: var(--mint-color-border, #dfe6e0);\n border-bottom-color: var(--mint-color-border, #dfe6e0);\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-color: var(--mint-color-border, #dfe6e0);\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);
|
|
2334
2550
|
}
|
|
2335
2551
|
connectedCallback() {
|
|
2336
2552
|
this.render();
|
|
@@ -2351,10 +2567,10 @@ var sn = class extends HTMLElement {
|
|
|
2351
2567
|
return this.hasAttribute("containered") && this.getAttribute("containered") !== "false";
|
|
2352
2568
|
}
|
|
2353
2569
|
render() {
|
|
2354
|
-
this._headingElement.textContent = this.getHeading(), this._backButton.hidden = !this.shouldShowBackButton();
|
|
2570
|
+
this._headingElement.textContent = this.getHeading(), this._backButton.setAttribute("fallback-href", this.getFallbackHref()), this._backButton.hidden = !this.shouldShowBackButton();
|
|
2355
2571
|
}
|
|
2356
2572
|
_handleBack(e) {
|
|
2357
|
-
e.preventDefault();
|
|
2573
|
+
e.preventDefault(), e.stopPropagation();
|
|
2358
2574
|
let t = document.referrer, n = !!(t && (() => {
|
|
2359
2575
|
try {
|
|
2360
2576
|
return new URL(t).origin === window.location.origin;
|
|
@@ -2375,19 +2591,19 @@ var sn = class extends HTMLElement {
|
|
|
2375
2591
|
this.dispatchEvent(i) && (n && window.history.length > 1 ? window.history.back() : window.location.href = this.getFallbackHref());
|
|
2376
2592
|
}
|
|
2377
2593
|
};
|
|
2378
|
-
typeof customElements < "u" && !customElements.get("mint-page") && a("mint-page",
|
|
2594
|
+
typeof customElements < "u" && !customElements.get("mint-page") && a("mint-page", ln);
|
|
2379
2595
|
//#endregion
|
|
2380
2596
|
//#region src/components/grid/Grid.js
|
|
2381
|
-
var
|
|
2597
|
+
var un = class extends HTMLElement {
|
|
2382
2598
|
constructor() {
|
|
2383
2599
|
super();
|
|
2384
2600
|
}
|
|
2385
2601
|
};
|
|
2386
|
-
typeof customElements < "u" && !customElements.get("mint-grid") && a("mint-grid",
|
|
2602
|
+
typeof customElements < "u" && !customElements.get("mint-grid") && a("mint-grid", un);
|
|
2387
2603
|
//#endregion
|
|
2388
2604
|
//#region src/components/modal/Modal.js
|
|
2389
2605
|
var N = /* @__PURE__ */ new Set(), P = null;
|
|
2390
|
-
function
|
|
2606
|
+
function dn(e) {
|
|
2391
2607
|
if (!N.has(e)) {
|
|
2392
2608
|
if (N.size === 0) {
|
|
2393
2609
|
let e = document.documentElement;
|
|
@@ -2411,7 +2627,7 @@ function F(e) {
|
|
|
2411
2627
|
behavior: "instant"
|
|
2412
2628
|
});
|
|
2413
2629
|
}
|
|
2414
|
-
var
|
|
2630
|
+
var fn = class extends HTMLElement {
|
|
2415
2631
|
static get observedAttributes() {
|
|
2416
2632
|
return [
|
|
2417
2633
|
"id",
|
|
@@ -2457,7 +2673,7 @@ var un = class extends HTMLElement {
|
|
|
2457
2673
|
let e = this.getId(), t = this.getHeading(), n = this.isOpen();
|
|
2458
2674
|
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) {
|
|
2459
2675
|
let e = this._modal.querySelector(".modal-content");
|
|
2460
|
-
e || (e = document.createElement("div"), e.className = "modal-content", this._modal.appendChild(e)), this._renderedOpen || (this._renderedOpen = !0,
|
|
2676
|
+
e || (e = document.createElement("div"), e.className = "modal-content", this._modal.appendChild(e)), this._renderedOpen || (this._renderedOpen = !0, dn(this), this._animateEnter());
|
|
2461
2677
|
} else this._renderedOpen && (this._renderedOpen = !1, this._animateExit());
|
|
2462
2678
|
let r = this._modal.querySelector(".modal-content");
|
|
2463
2679
|
r || (r = document.createElement("div"), r.className = "modal-content", this._modal.appendChild(r)), this._header || (this._header = document.createElement("div"), this._header.className = "mint-modal-header", r.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));
|
|
@@ -2557,15 +2773,15 @@ var un = class extends HTMLElement {
|
|
|
2557
2773
|
}, 280);
|
|
2558
2774
|
}
|
|
2559
2775
|
};
|
|
2560
|
-
typeof customElements < "u" && !customElements.get("mint-modal") && a("mint-modal",
|
|
2776
|
+
typeof customElements < "u" && !customElements.get("mint-modal") && a("mint-modal", fn);
|
|
2561
2777
|
//#endregion
|
|
2562
2778
|
//#region src/components/popover/Popover.js
|
|
2563
|
-
var
|
|
2779
|
+
var pn = new Set([
|
|
2564
2780
|
"up",
|
|
2565
2781
|
"down",
|
|
2566
2782
|
"left",
|
|
2567
2783
|
"right"
|
|
2568
|
-
]),
|
|
2784
|
+
]), mn = class extends HTMLElement {
|
|
2569
2785
|
static get observedAttributes() {
|
|
2570
2786
|
return [
|
|
2571
2787
|
"direction",
|
|
@@ -2592,7 +2808,7 @@ var dn = new Set([
|
|
|
2592
2808
|
}
|
|
2593
2809
|
getDirection() {
|
|
2594
2810
|
let e = this.getAttribute("direction") || "down";
|
|
2595
|
-
return
|
|
2811
|
+
return pn.has(e) ? e : "down";
|
|
2596
2812
|
}
|
|
2597
2813
|
getTriggerId() {
|
|
2598
2814
|
return this.getAttribute("trigger-id") || "";
|
|
@@ -2745,7 +2961,7 @@ var dn = new Set([
|
|
|
2745
2961
|
} else this.dataset.state = "closed";
|
|
2746
2962
|
}
|
|
2747
2963
|
};
|
|
2748
|
-
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover",
|
|
2964
|
+
typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-popover", mn), s({
|
|
2749
2965
|
name: "check",
|
|
2750
2966
|
viewBox: "0 0 24 24",
|
|
2751
2967
|
path: "M5 13l4 4L19 7",
|
|
@@ -2755,7 +2971,7 @@ typeof customElements < "u" && !customElements.get("mint-popover") && a("mint-po
|
|
|
2755
2971
|
});
|
|
2756
2972
|
//#endregion
|
|
2757
2973
|
//#region src/components/checkbox/Checkbox.js
|
|
2758
|
-
var
|
|
2974
|
+
var hn = class extends HTMLElement {
|
|
2759
2975
|
static get observedAttributes() {
|
|
2760
2976
|
return [
|
|
2761
2977
|
"checked",
|
|
@@ -2886,10 +3102,10 @@ var pn = class extends HTMLElement {
|
|
|
2886
3102
|
}
|
|
2887
3103
|
}
|
|
2888
3104
|
};
|
|
2889
|
-
typeof customElements < "u" && !customElements.get("mint-checkbox") && a("mint-checkbox",
|
|
3105
|
+
typeof customElements < "u" && !customElements.get("mint-checkbox") && a("mint-checkbox", hn);
|
|
2890
3106
|
//#endregion
|
|
2891
3107
|
//#region src/components/choice/Choice.js
|
|
2892
|
-
var
|
|
3108
|
+
var gn = class extends HTMLElement {
|
|
2893
3109
|
static get observedAttributes() {
|
|
2894
3110
|
return [
|
|
2895
3111
|
"checked",
|
|
@@ -3108,7 +3324,7 @@ var mn = class extends HTMLElement {
|
|
|
3108
3324
|
this.dispatchEvent(t);
|
|
3109
3325
|
}
|
|
3110
3326
|
}
|
|
3111
|
-
},
|
|
3327
|
+
}, _n = class extends HTMLElement {
|
|
3112
3328
|
static get observedAttributes() {
|
|
3113
3329
|
return [
|
|
3114
3330
|
"value",
|
|
@@ -3142,223 +3358,7 @@ var mn = class extends HTMLElement {
|
|
|
3142
3358
|
r || (r = document.createElement("span"), r.className = "mint-choice-option-label", n.appendChild(r)), r.textContent = this._labelText;
|
|
3143
3359
|
}
|
|
3144
3360
|
};
|
|
3145
|
-
typeof customElements < "u" && !customElements.get("mint-choice") && a("mint-choice",
|
|
3146
|
-
name: "arrow-left",
|
|
3147
|
-
viewBox: "0 0 24 24",
|
|
3148
|
-
path: "M19 12H5m7-7l-7 7 7 7",
|
|
3149
|
-
strokeLinecap: "round",
|
|
3150
|
-
strokeLinejoin: "round"
|
|
3151
|
-
});
|
|
3152
|
-
//#endregion
|
|
3153
|
-
//#region src/components/button/Button.js
|
|
3154
|
-
var gn = class extends HTMLElement {
|
|
3155
|
-
static get observedAttributes() {
|
|
3156
|
-
return [
|
|
3157
|
-
"variant",
|
|
3158
|
-
"tone",
|
|
3159
|
-
"disabled",
|
|
3160
|
-
"loading",
|
|
3161
|
-
"button-type",
|
|
3162
|
-
"type",
|
|
3163
|
-
"full-width",
|
|
3164
|
-
"icon-position",
|
|
3165
|
-
"icon"
|
|
3166
|
-
];
|
|
3167
|
-
}
|
|
3168
|
-
constructor() {
|
|
3169
|
-
super(), this._button = null, this._clickHandler = null, this._isHandlingClick = !1;
|
|
3170
|
-
}
|
|
3171
|
-
connectedCallback() {
|
|
3172
|
-
this.render(), this._button && this.setupEventListeners();
|
|
3173
|
-
}
|
|
3174
|
-
disconnectedCallback() {
|
|
3175
|
-
this.removeEventListeners();
|
|
3176
|
-
}
|
|
3177
|
-
attributeChangedCallback(e, t, n) {
|
|
3178
|
-
t !== n && this.render();
|
|
3179
|
-
}
|
|
3180
|
-
getVariant() {
|
|
3181
|
-
return this.getAttribute("variant") || "solid";
|
|
3182
|
-
}
|
|
3183
|
-
getTone() {
|
|
3184
|
-
return this.getAttribute("tone") || "neutral";
|
|
3185
|
-
}
|
|
3186
|
-
isDisabled() {
|
|
3187
|
-
return this.hasAttribute("disabled");
|
|
3188
|
-
}
|
|
3189
|
-
isLoading() {
|
|
3190
|
-
return this.hasAttribute("loading");
|
|
3191
|
-
}
|
|
3192
|
-
getType() {
|
|
3193
|
-
return (this.getAttribute("type") || this.getAttribute("button-type") || "default") === "submit" ? "submit" : "button";
|
|
3194
|
-
}
|
|
3195
|
-
isFullWidth() {
|
|
3196
|
-
return this.hasAttribute("full-width");
|
|
3197
|
-
}
|
|
3198
|
-
getIconPosition() {
|
|
3199
|
-
return this.getAttribute("icon-position") || "left";
|
|
3200
|
-
}
|
|
3201
|
-
getIcon() {
|
|
3202
|
-
return this.getAttribute("icon") || "";
|
|
3203
|
-
}
|
|
3204
|
-
isIconOnly() {
|
|
3205
|
-
if (!(this.getIcon() || this._button?.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon"))) return !1;
|
|
3206
|
-
let e = this._button?.querySelector(".mint-button-content");
|
|
3207
|
-
if (e && e.textContent.trim()) return !1;
|
|
3208
|
-
if (this._button) {
|
|
3209
|
-
for (let e = this._button.firstChild; e; e = e.nextSibling) if (e.nodeType === Node.TEXT_NODE && e.textContent.trim() || e.nodeType === Node.ELEMENT_NODE && e.tagName !== "MINT-ICON" && e.tagName !== "MINT-SPINNER" && !e.querySelector?.("mint-spinner") && !e.hasAttribute?.("slot") && e.className !== "mint-button-icon" && !(e.className === "mr-2" && e.querySelector("mint-spinner")) && e.textContent.trim()) return !1;
|
|
3210
|
-
}
|
|
3211
|
-
return !0;
|
|
3212
|
-
}
|
|
3213
|
-
getButtonClasses() {
|
|
3214
|
-
return [
|
|
3215
|
-
"mint-button-core",
|
|
3216
|
-
"mint-button-" + this.getVariant(),
|
|
3217
|
-
"mint-button-tone-" + this.getTone(),
|
|
3218
|
-
this.isIconOnly() ? "mint-button-icon-only" : "",
|
|
3219
|
-
this.isFullWidth() ? "mint-button-full-width" : ""
|
|
3220
|
-
].filter(Boolean).join(" ");
|
|
3221
|
-
}
|
|
3222
|
-
render() {
|
|
3223
|
-
let e = this.isDisabled() || this.isLoading(), t = this.getType();
|
|
3224
|
-
if (!this._button) {
|
|
3225
|
-
for (this._button = document.createElement("button"); this.firstChild;) this._button.appendChild(this.firstChild);
|
|
3226
|
-
this.appendChild(this._button), this.setupEventListeners();
|
|
3227
|
-
}
|
|
3228
|
-
this._button.type = t, this._button.disabled = e;
|
|
3229
|
-
let n = this._button.querySelector("mint-spinner");
|
|
3230
|
-
if (this.isLoading()) if (n) n.setAttribute("data-button-variant", this.getVariant()), n.setAttribute("data-button-tone", this.getTone()), n.render();
|
|
3231
|
-
else {
|
|
3232
|
-
let e = document.createElement("span");
|
|
3233
|
-
e.className = "mint-spinner-wrap";
|
|
3234
|
-
let t = document.createElement("mint-spinner");
|
|
3235
|
-
t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "0.875rem", t.style.height = "0.875rem", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
|
|
3236
|
-
}
|
|
3237
|
-
else n && n.parentElement?.remove();
|
|
3238
|
-
for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
|
|
3239
|
-
let r = this.getIcon(), i = this._button.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon");
|
|
3240
|
-
r ? (i && i.tagName !== "MINT-ICON" && (i.remove(), i = null), !i || i.tagName !== "MINT-ICON" ? (i = document.createElement("mint-icon"), i.setAttribute("name", r), i.className = "mint-button-icon") : i.setAttribute("name", r)) : i && i.tagName === "MINT-ICON" && (i.remove(), i = null), i ||= this._button.querySelector("[slot=\"icon\"], .mint-button-icon");
|
|
3241
|
-
let a = this.getIconPosition(), o = this._button.querySelector(".mint-button-content");
|
|
3242
|
-
if (o) {
|
|
3243
|
-
let e = i && i.tagName === "MINT-ICON";
|
|
3244
|
-
if (i && !i.parentElement) {
|
|
3245
|
-
let t = this._button.querySelector("mint-spinner")?.parentElement;
|
|
3246
|
-
e || a === "left" ? t ? t.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o) : o.insertAdjacentElement("afterend", i);
|
|
3247
|
-
} else if (i && (e || a === "left") && i.nextSibling !== o) {
|
|
3248
|
-
i.remove();
|
|
3249
|
-
let e = this._button.querySelector("mint-spinner")?.parentElement;
|
|
3250
|
-
e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o);
|
|
3251
|
-
} else i && !e && a === "right" && i.previousSibling !== o && (i.remove(), o.insertAdjacentElement("afterend", i));
|
|
3252
|
-
} else {
|
|
3253
|
-
let e = [];
|
|
3254
|
-
for (let t = this._button.firstChild; t; t = t.nextSibling) t.tagName !== "MINT-SPINNER" && !t.querySelector?.("mint-spinner") && t !== i && !t.hasAttribute?.("slot") && !(t.className === "mr-2" && t.querySelector("mint-spinner")) && e.push(t);
|
|
3255
|
-
if (e.length > 0) {
|
|
3256
|
-
o = document.createElement("span"), o.className = "mint-button-content", e.forEach((e) => {
|
|
3257
|
-
o.appendChild(e);
|
|
3258
|
-
});
|
|
3259
|
-
let t = this._button.querySelector("mint-spinner")?.parentElement;
|
|
3260
|
-
i && a === "left" ? t ? (t.insertAdjacentElement("afterend", i), i.insertAdjacentElement("afterend", o)) : (this._button.insertBefore(i, this._button.firstChild), i.insertAdjacentElement("afterend", o)) : i && a === "right" ? t ? (t.insertAdjacentElement("afterend", o), o.insertAdjacentElement("afterend", i)) : (this._button.insertBefore(o, this._button.firstChild), o.insertAdjacentElement("afterend", i)) : t ? t.insertAdjacentElement("afterend", o) : this._button.insertBefore(o, this._button.firstChild);
|
|
3261
|
-
} else if (i && i.tagName === "MINT-ICON" && !i.parentElement) {
|
|
3262
|
-
let e = this._button.querySelector("mint-spinner")?.parentElement;
|
|
3263
|
-
e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, this._button.firstChild);
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
let s = this.isIconOnly();
|
|
3267
|
-
i && (i.classList.contains("mint-button-icon") || i.classList.add("mint-button-icon"), i.classList.remove("mint-icon-leading", "mint-icon-trailing"), s ? 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"));
|
|
3268
|
-
let c = this.getButtonClasses();
|
|
3269
|
-
this._button.className = c;
|
|
3270
|
-
}
|
|
3271
|
-
setupEventListeners() {
|
|
3272
|
-
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));
|
|
3273
|
-
}
|
|
3274
|
-
removeEventListeners() {
|
|
3275
|
-
this._button && (this._clickHandler &&= (this._button.removeEventListener("click", this._clickHandler, !0), null), this._button.removeEventListener("mousedown", this._handleMouseDown), this._button.removeEventListener("mouseup", this._handleMouseUp), this._button.removeEventListener("mouseleave", this._handleMouseLeave), this._button.removeEventListener("touchstart", this._handleTouchStart), this._button.removeEventListener("touchend", this._handleTouchEnd), this._button.removeEventListener("touchcancel", this._handleTouchCancel));
|
|
3276
|
-
}
|
|
3277
|
-
_handleMouseDown = () => {
|
|
3278
|
-
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
3279
|
-
};
|
|
3280
|
-
_handleMouseUp = () => {
|
|
3281
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
3282
|
-
};
|
|
3283
|
-
_handleMouseLeave = () => {
|
|
3284
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
3285
|
-
};
|
|
3286
|
-
_handleTouchStart = () => {
|
|
3287
|
-
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
3288
|
-
};
|
|
3289
|
-
_handleTouchEnd = () => {
|
|
3290
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
3291
|
-
};
|
|
3292
|
-
_handleTouchCancel = () => {
|
|
3293
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
3294
|
-
};
|
|
3295
|
-
handleClick(e) {
|
|
3296
|
-
if (this.isDisabled() || this.isLoading()) {
|
|
3297
|
-
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
3298
|
-
return;
|
|
3299
|
-
}
|
|
3300
|
-
if (e.stopPropagation(), e.stopImmediatePropagation(), this._isHandlingClick) {
|
|
3301
|
-
e.preventDefault();
|
|
3302
|
-
return;
|
|
3303
|
-
}
|
|
3304
|
-
this._isHandlingClick = !0, e.preventDefault(), this.dispatchEvent(new CustomEvent("click", {
|
|
3305
|
-
detail: { originalEvent: e },
|
|
3306
|
-
bubbles: !0,
|
|
3307
|
-
cancelable: !0,
|
|
3308
|
-
composed: !0
|
|
3309
|
-
})), requestAnimationFrame(() => {
|
|
3310
|
-
this._isHandlingClick = !1;
|
|
3311
|
-
});
|
|
3312
|
-
}
|
|
3313
|
-
};
|
|
3314
|
-
typeof customElements < "u" && !customElements.get("mint-button") && a("mint-button", gn);
|
|
3315
|
-
//#endregion
|
|
3316
|
-
//#region src/components/back-button/BackButton.js
|
|
3317
|
-
var _n = class extends HTMLElement {
|
|
3318
|
-
static get observedAttributes() {
|
|
3319
|
-
return ["href", "fallback-href"];
|
|
3320
|
-
}
|
|
3321
|
-
constructor() {
|
|
3322
|
-
super(), this._historyDepth = 0, this._maxBackAttempts = 10, this._backAttempts = 0;
|
|
3323
|
-
}
|
|
3324
|
-
connectedCallback() {
|
|
3325
|
-
this.render(), this._setupHistoryTracking();
|
|
3326
|
-
}
|
|
3327
|
-
attributeChangedCallback(e, t, n) {
|
|
3328
|
-
t !== n && this.render();
|
|
3329
|
-
}
|
|
3330
|
-
_setupHistoryTracking() {
|
|
3331
|
-
window.addEventListener("popstate", () => {
|
|
3332
|
-
this._backAttempts = 0;
|
|
3333
|
-
}), this._historyDepth = window.history.length;
|
|
3334
|
-
}
|
|
3335
|
-
getFallbackHref() {
|
|
3336
|
-
return this.getAttribute("fallback-href") || this.getAttribute("href") || "/";
|
|
3337
|
-
}
|
|
3338
|
-
handleClick(e) {
|
|
3339
|
-
if (e.preventDefault(), e.stopPropagation(), window.history.length > 1 && this._backAttempts < this._maxBackAttempts && this._backAttempts === 0) {
|
|
3340
|
-
this._backAttempts++;
|
|
3341
|
-
let e = window.location.href, t = Date.now();
|
|
3342
|
-
window.history.back(), setTimeout(() => {
|
|
3343
|
-
Date.now() - t, window.location.href === e ? this._navigateToFallback() : setTimeout(() => {
|
|
3344
|
-
this._backAttempts = 0;
|
|
3345
|
-
}, 500);
|
|
3346
|
-
}, 200);
|
|
3347
|
-
} else this._navigateToFallback();
|
|
3348
|
-
}
|
|
3349
|
-
_navigateToFallback() {
|
|
3350
|
-
let e = this.getFallbackHref();
|
|
3351
|
-
if (this._backAttempts = 0, e.startsWith("/") && !e.startsWith("//")) try {
|
|
3352
|
-
window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3353
|
-
return;
|
|
3354
|
-
} catch {}
|
|
3355
|
-
window.location.href = e;
|
|
3356
|
-
}
|
|
3357
|
-
render() {
|
|
3358
|
-
this._button || (this._button = document.createElement("mint-button"), this._button.setAttribute("variant", "neutral"), this._button.setAttribute("icon", "arrow-left"), this._button.addEventListener("click", (e) => this.handleClick(e)), this.appendChild(this._button));
|
|
3359
|
-
}
|
|
3360
|
-
};
|
|
3361
|
-
typeof customElements < "u" && !customElements.get("mint-back-button") && a("mint-back-button", _n);
|
|
3361
|
+
typeof customElements < "u" && !customElements.get("mint-choice") && a("mint-choice", gn), typeof customElements < "u" && !customElements.get("mint-choice-option") && a("mint-choice-option", _n);
|
|
3362
3362
|
//#endregion
|
|
3363
3363
|
//#region src/components/navigation/Navigation.js
|
|
3364
3364
|
var vn = 0, yn = class extends HTMLElement {
|
|
@@ -13682,4 +13682,4 @@ var $ = class extends HTMLElement {
|
|
|
13682
13682
|
};
|
|
13683
13683
|
customElements.get("mint-tree") || a("mint-tree", $);
|
|
13684
13684
|
//#endregion
|
|
13685
|
-
export { bn as Alert,
|
|
13685
|
+
export { bn as Alert, cn as BackButton, Sn as BottomNavigation, M as Button, M as default, an as Card, Cn as Chart, hn as Checkbox, wn as Chip, gn as Choice, Tn as Clickable, En as Collapsible, Dn as ConfirmAction, Pn as DatePicker, Fn as Dropzone, In as Form, un as Grid, l as Icon, Nn as Input, on as Link, xn as MintBottomNavItem, I as MintBottomNavigation, Yn as MintSidenavActionLinks, Xn as MintSidenavActionMenu, qn as MintSidenavLink, Jn as MintSidenavLinks, $ as MintTree, $ as Tree, fn as Modal, yn as Navigation, Ln as OffCanvas, ln as Page, mn as Popover, Bn as ResourceTable, Gn as Search, Kn as Select, $n as SideNavigation, er as Sortable, en as Spinner, rn as Stack, tn as Switch, tr as Tab, rr as TabContent, nr as TabList, zn as Table, ir as Tabs, ar as Tags, nn as Text, or as TimePicker, sr as Toast, Mn as confirm, fr as mintui, K as toast };
|