monobill-mintui 0.3.28 → 0.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/Button.d.ts +1 -0
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/popover/Popover.d.ts.map +1 -1
- package/dist/index.cjs +17 -6
- package/dist/index.js +274 -236
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
class
|
|
1
|
+
import { g as G } from "./caret-right-DsNN5Epe.js";
|
|
2
|
+
class K extends HTMLElement {
|
|
3
3
|
constructor() {
|
|
4
4
|
super(), this._darkModeObserver = null;
|
|
5
5
|
}
|
|
@@ -86,8 +86,8 @@ class q extends HTMLElement {
|
|
|
86
86
|
this.innerHTML = l.trim();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
customElements.get("mint-spinner") || customElements.define("mint-spinner",
|
|
90
|
-
class
|
|
89
|
+
customElements.get("mint-spinner") || customElements.define("mint-spinner", K);
|
|
90
|
+
class X extends HTMLElement {
|
|
91
91
|
constructor() {
|
|
92
92
|
super(), this._darkModeObserver = null;
|
|
93
93
|
}
|
|
@@ -139,7 +139,7 @@ class O extends HTMLElement {
|
|
|
139
139
|
this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "";
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
const e =
|
|
142
|
+
const e = G(t);
|
|
143
143
|
if (!e) {
|
|
144
144
|
console.warn(`Icon "${t}" not found. Make sure you've imported the icon: import '@monobill-mintui/icon/icons/${t}'`), this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "";
|
|
145
145
|
return;
|
|
@@ -166,27 +166,42 @@ class O extends HTMLElement {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
customElements.get("mint-icon") || customElements.define("mint-icon",
|
|
170
|
-
class
|
|
169
|
+
customElements.get("mint-icon") || customElements.define("mint-icon", X);
|
|
170
|
+
const W = class W extends HTMLElement {
|
|
171
171
|
constructor() {
|
|
172
172
|
super(), this._button = null, this._clickHandler = null, this._isHandlingClick = !1, this._handleMouseDown = () => {
|
|
173
173
|
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
174
174
|
}, this._handleMouseUp = () => {
|
|
175
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
175
|
+
this._button && (this.isActive() || this._button.classList.remove("mint-button-active"));
|
|
176
176
|
}, this._handleMouseLeave = () => {
|
|
177
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
177
|
+
this._button && (this.isActive() || this._button.classList.remove("mint-button-active"));
|
|
178
178
|
}, this._handleTouchStart = () => {
|
|
179
179
|
this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
|
|
180
180
|
}, this._handleTouchEnd = () => {
|
|
181
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
181
|
+
this._button && (this.isActive() || this._button.classList.remove("mint-button-active"));
|
|
182
182
|
}, this._handleTouchCancel = () => {
|
|
183
|
-
this._button && this._button.classList.remove("mint-button-active");
|
|
183
|
+
this._button && (this.isActive() || this._button.classList.remove("mint-button-active"));
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
static get observedAttributes() {
|
|
187
187
|
return ["variant", "tone", "disabled", "loading", "button-type", "type", "full-width", "icon-position", "icon", "active"];
|
|
188
188
|
}
|
|
189
189
|
connectedCallback() {
|
|
190
|
+
if (!W._activeShadowStyleInjected) {
|
|
191
|
+
const t = document.createElement("style");
|
|
192
|
+
t.textContent = `
|
|
193
|
+
mint-button .mint-button-active {
|
|
194
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
|
|
195
|
+
}
|
|
196
|
+
mint-button[data-variant="solid"][data-tone="neutral"] .mint-button-active,
|
|
197
|
+
mint-button[data-variant="ghost"] .mint-button-active {
|
|
198
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
|
|
199
|
+
}
|
|
200
|
+
mint-button[data-variant="link"] .mint-button-active {
|
|
201
|
+
box-shadow: none !important;
|
|
202
|
+
}
|
|
203
|
+
`, document.head.appendChild(t), W._activeShadowStyleInjected = !0;
|
|
204
|
+
}
|
|
190
205
|
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "inline-block"), this.render(), this._button && this.setupEventListeners(), this.isFullWidth() && this.classList.add("w-full");
|
|
191
206
|
}
|
|
192
207
|
disconnectedCallback() {
|
|
@@ -777,7 +792,7 @@ class B extends HTMLElement {
|
|
|
777
792
|
_ && (l ? (_.classList.remove("mr-2"), _.classList.add("mr-0")) : _.classList.contains("mr-2") || (_.classList.remove("mr-0"), _.classList.add("mr-2")));
|
|
778
793
|
}
|
|
779
794
|
const c = this.getButtonClasses();
|
|
780
|
-
this._button.className = c;
|
|
795
|
+
this._button.className = c, this.setAttribute("data-variant", this.getVariant()), this.setAttribute("data-tone", this.getTone()), this.isActive() ? this._button.classList.add("mint-button-active") : this._button.classList.remove("mint-button-active");
|
|
781
796
|
}
|
|
782
797
|
setupEventListeners() {
|
|
783
798
|
this._button && !this._clickHandler && (this._clickHandler = this.handleClick.bind(this), this._clickHandler && 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));
|
|
@@ -816,9 +831,11 @@ class B extends HTMLElement {
|
|
|
816
831
|
this._isHandlingClick = !1;
|
|
817
832
|
});
|
|
818
833
|
}
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
834
|
+
};
|
|
835
|
+
W._activeShadowStyleInjected = !1;
|
|
836
|
+
let Y = W;
|
|
837
|
+
customElements.get("mint-button") || customElements.define("mint-button", Y);
|
|
838
|
+
class Z extends HTMLElement {
|
|
822
839
|
constructor() {
|
|
823
840
|
super(), this._button = null, this._checked = !1;
|
|
824
841
|
}
|
|
@@ -1019,8 +1036,8 @@ class z extends HTMLElement {
|
|
|
1019
1036
|
t && e ? (i || (i = document.createElement("div"), i.className = "mint-switch-error mt-1 text-xs text-red-600 dark:text-red-400", this.appendChild(i)), i.textContent = e) : i && i.remove(), this._button && (this._button.className = this.getSwitchClasses());
|
|
1020
1037
|
}
|
|
1021
1038
|
}
|
|
1022
|
-
customElements.get("mint-switch") || customElements.define("mint-switch",
|
|
1023
|
-
class
|
|
1039
|
+
customElements.get("mint-switch") || customElements.define("mint-switch", Z);
|
|
1040
|
+
class Q extends HTMLElement {
|
|
1024
1041
|
// Store classes set via class attribute
|
|
1025
1042
|
constructor() {
|
|
1026
1043
|
super(), this._darkModeObserver = null, this._userClasses = /* @__PURE__ */ new Set();
|
|
@@ -1130,8 +1147,8 @@ class R extends HTMLElement {
|
|
|
1130
1147
|
this.style.setProperty("font-size", o);
|
|
1131
1148
|
}
|
|
1132
1149
|
}
|
|
1133
|
-
customElements.get("mint-text") || customElements.define("mint-text",
|
|
1134
|
-
class
|
|
1150
|
+
customElements.get("mint-text") || customElements.define("mint-text", Q);
|
|
1151
|
+
class tt extends HTMLElement {
|
|
1135
1152
|
constructor() {
|
|
1136
1153
|
super(), this._childObserver = null;
|
|
1137
1154
|
}
|
|
@@ -1236,8 +1253,8 @@ class V extends HTMLElement {
|
|
|
1236
1253
|
});
|
|
1237
1254
|
}
|
|
1238
1255
|
}
|
|
1239
|
-
customElements.get("mint-stack") || customElements.define("mint-stack",
|
|
1240
|
-
class
|
|
1256
|
+
customElements.get("mint-stack") || customElements.define("mint-stack", tt);
|
|
1257
|
+
class et extends HTMLElement {
|
|
1241
1258
|
constructor() {
|
|
1242
1259
|
super(), this._headingElement = null;
|
|
1243
1260
|
}
|
|
@@ -1268,8 +1285,8 @@ class W extends HTMLElement {
|
|
|
1268
1285
|
t ? (this._headingElement || (this._headingElement = document.createElement("mint-text"), this._headingElement.setAttribute("size", "sub-heading"), this.insertBefore(this._headingElement, this.firstChild)), this._headingElement.textContent = t) : this._headingElement && this._headingElement.parentNode && (this._headingElement.remove(), this._headingElement = null);
|
|
1269
1286
|
}
|
|
1270
1287
|
}
|
|
1271
|
-
customElements.get("mint-card") || customElements.define("mint-card",
|
|
1272
|
-
class
|
|
1288
|
+
customElements.get("mint-card") || customElements.define("mint-card", et);
|
|
1289
|
+
class it extends HTMLElement {
|
|
1273
1290
|
constructor() {
|
|
1274
1291
|
super(), this._link = null, this._contentObserver = null;
|
|
1275
1292
|
}
|
|
@@ -1335,8 +1352,8 @@ class j extends HTMLElement {
|
|
|
1335
1352
|
});
|
|
1336
1353
|
}
|
|
1337
1354
|
}
|
|
1338
|
-
customElements.get("mint-link") || customElements.define("mint-link",
|
|
1339
|
-
class
|
|
1355
|
+
customElements.get("mint-link") || customElements.define("mint-link", it);
|
|
1356
|
+
class st extends HTMLElement {
|
|
1340
1357
|
constructor() {
|
|
1341
1358
|
super(), this._button = null;
|
|
1342
1359
|
}
|
|
@@ -1394,8 +1411,8 @@ class Y extends HTMLElement {
|
|
|
1394
1411
|
this._button || (this._button = document.createElement("mint-button"), this._button.setAttribute("variant", "neutral"), this._button.setAttribute("icon", "arrow-left"), this._button.addEventListener("click", (t) => this.handleClick(t)), this.appendChild(this._button));
|
|
1395
1412
|
}
|
|
1396
1413
|
}
|
|
1397
|
-
customElements.get("mint-back-button") || customElements.define("mint-back-button",
|
|
1398
|
-
class
|
|
1414
|
+
customElements.get("mint-back-button") || customElements.define("mint-back-button", st);
|
|
1415
|
+
class rt extends HTMLElement {
|
|
1399
1416
|
constructor() {
|
|
1400
1417
|
super(), this._pageContainer = null, this._header = null, this._titleElement = null, this._headingText = null, this._actionsSlot = null, this._bodySlot = null, this._darkModeObserver = null, this._backButton = null, this._backButtonHandler = null;
|
|
1401
1418
|
}
|
|
@@ -1471,8 +1488,8 @@ class U extends HTMLElement {
|
|
|
1471
1488
|
this._backButtonHandler && (this.removeEventListener("back", this._backButtonHandler, !0), this._backButtonHandler = null);
|
|
1472
1489
|
}
|
|
1473
1490
|
}
|
|
1474
|
-
customElements.get("mint-page") || customElements.define("mint-page",
|
|
1475
|
-
class
|
|
1491
|
+
customElements.get("mint-page") || customElements.define("mint-page", rt);
|
|
1492
|
+
class nt extends HTMLElement {
|
|
1476
1493
|
static get observedAttributes() {
|
|
1477
1494
|
return ["columns", "sm", "md", "lg", "xl", "gap"];
|
|
1478
1495
|
}
|
|
@@ -1525,8 +1542,8 @@ class J extends HTMLElement {
|
|
|
1525
1542
|
});
|
|
1526
1543
|
}
|
|
1527
1544
|
}
|
|
1528
|
-
customElements.get("mint-grid") || customElements.define("mint-grid",
|
|
1529
|
-
class
|
|
1545
|
+
customElements.get("mint-grid") || customElements.define("mint-grid", nt);
|
|
1546
|
+
class at extends HTMLElement {
|
|
1530
1547
|
constructor() {
|
|
1531
1548
|
super(), this._overlay = null, this._modal = null, this._header = null, this._headingSlot = null, this._bodySlot = null, this._actionsSlot = null, this._closeButton = null, this._darkModeObserver = null;
|
|
1532
1549
|
}
|
|
@@ -1621,8 +1638,8 @@ class G extends HTMLElement {
|
|
|
1621
1638
|
}, 200);
|
|
1622
1639
|
}
|
|
1623
1640
|
}
|
|
1624
|
-
customElements.get("mint-modal") || customElements.define("mint-modal",
|
|
1625
|
-
class
|
|
1641
|
+
customElements.get("mint-modal") || customElements.define("mint-modal", at);
|
|
1642
|
+
class ot extends HTMLElement {
|
|
1626
1643
|
constructor() {
|
|
1627
1644
|
super(), this._overlay = null, this._popover = null, this._triggerElement = null, this._darkModeObserver = null, this._clickOutsideHandler = null, this._triggerClickHandler = null, this._triggerHoverEnterHandler = null, this._triggerHoverLeaveHandler = null, this._popoverHoverEnterHandler = null, this._popoverHoverLeaveHandler = null, this._hoverCloseTimeout = null, this._scrollHandler = null, this._resizeHandler = null;
|
|
1628
1645
|
}
|
|
@@ -1633,7 +1650,7 @@ class K extends HTMLElement {
|
|
|
1633
1650
|
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "fixed", "top-0", "left-0", "z-50", "pointer-events-none"), this.isOpen() || this.classList.add("hidden"), this.render(), this._setupTrigger(), this._observeDarkMode();
|
|
1634
1651
|
}
|
|
1635
1652
|
disconnectedCallback() {
|
|
1636
|
-
this._darkModeObserver && (this._darkModeObserver.disconnect(), this._darkModeObserver = null), this._clickOutsideHandler && (document.removeEventListener("click", this._clickOutsideHandler), this._clickOutsideHandler = null), this._triggerClickHandler && this._triggerElement && (this._triggerElement.removeEventListener("click", this._triggerClickHandler, !0), this._triggerClickHandler = null), this._removeHoverListeners(), this._scrollHandler && (window.removeEventListener("scroll", this._scrollHandler, !0), this._scrollHandler = null), this._resizeHandler && (window.removeEventListener("resize", this._resizeHandler), this._resizeHandler = null);
|
|
1653
|
+
this._triggerElement && this._triggerElement.tagName === "MINT-BUTTON" && this._triggerElement.removeAttribute("active"), this._darkModeObserver && (this._darkModeObserver.disconnect(), this._darkModeObserver = null), this._clickOutsideHandler && (document.removeEventListener("click", this._clickOutsideHandler), this._clickOutsideHandler = null), this._triggerClickHandler && this._triggerElement && (this._triggerElement.removeEventListener("click", this._triggerClickHandler, !0), this._triggerClickHandler = null), this._removeHoverListeners(), this._scrollHandler && (window.removeEventListener("scroll", this._scrollHandler, !0), this._scrollHandler = null), this._resizeHandler && (window.removeEventListener("resize", this._resizeHandler), this._resizeHandler = null);
|
|
1637
1654
|
}
|
|
1638
1655
|
attributeChangedCallback(t, e, i) {
|
|
1639
1656
|
e !== i && (this.render(), (t === "trigger-id" || t === "hover") && this._setupTrigger(), t === "open" && this.isOpen() && this._closeOtherPopovers());
|
|
@@ -1770,7 +1787,13 @@ class K extends HTMLElement {
|
|
|
1770
1787
|
render() {
|
|
1771
1788
|
const t = this.getId(), e = this.isOpen(), i = this.getPadding();
|
|
1772
1789
|
if (t && (this.id = t), e) {
|
|
1773
|
-
if (this.classList.remove("hidden"), this.style.pointerEvents = "auto",
|
|
1790
|
+
if (this.classList.remove("hidden"), this.style.pointerEvents = "auto", this._triggerElement && this._triggerElement.tagName === "MINT-BUTTON" && requestAnimationFrame(() => {
|
|
1791
|
+
this._triggerElement.setAttribute("active", "true");
|
|
1792
|
+
const r = this._triggerElement;
|
|
1793
|
+
typeof r.render == "function" && requestAnimationFrame(() => {
|
|
1794
|
+
r.render();
|
|
1795
|
+
});
|
|
1796
|
+
}), !this._clickOutsideHandler) {
|
|
1774
1797
|
const r = this;
|
|
1775
1798
|
this._clickOutsideHandler = function(a) {
|
|
1776
1799
|
const o = a.composedPath(), l = o.includes(r);
|
|
@@ -1783,7 +1806,13 @@ class K extends HTMLElement {
|
|
|
1783
1806
|
}, 100);
|
|
1784
1807
|
}
|
|
1785
1808
|
} else
|
|
1786
|
-
this.classList.add("hidden"), this.style.pointerEvents = "none", this.
|
|
1809
|
+
this.classList.add("hidden"), this.style.pointerEvents = "none", this._triggerElement && this._triggerElement.tagName === "MINT-BUTTON" && requestAnimationFrame(() => {
|
|
1810
|
+
this._triggerElement.removeAttribute("active");
|
|
1811
|
+
const r = this._triggerElement;
|
|
1812
|
+
typeof r.render == "function" && requestAnimationFrame(() => {
|
|
1813
|
+
r.render();
|
|
1814
|
+
});
|
|
1815
|
+
}), this._clickOutsideHandler && (document.removeEventListener("click", this._clickOutsideHandler, !1), this._clickOutsideHandler = null);
|
|
1787
1816
|
this._overlay || (this._overlay = document.createElement("div"), this._overlay.className = "fixed inset-0 pointer-events-none z-40", this.appendChild(this._overlay)), this._popover || (this._popover = document.createElement("div"), this._popover.className = "fixed z-50 pointer-events-auto", this.appendChild(this._popover)), this.isHoverEnabled() && this._attachHoverListeners();
|
|
1788
1817
|
let s = this._popover.querySelector(".popover-content");
|
|
1789
1818
|
if (!s)
|
|
@@ -1858,8 +1887,8 @@ class K extends HTMLElement {
|
|
|
1858
1887
|
});
|
|
1859
1888
|
}
|
|
1860
1889
|
}
|
|
1861
|
-
customElements.get("mint-popover") || customElements.define("mint-popover",
|
|
1862
|
-
class
|
|
1890
|
+
customElements.get("mint-popover") || customElements.define("mint-popover", ot);
|
|
1891
|
+
class lt extends HTMLElement {
|
|
1863
1892
|
constructor() {
|
|
1864
1893
|
super(), this._checkbox = null, this._checked = !1, this._clickHandler = null, this._changeHandler = null, this._mousedownHandler = null, this._mouseupHandler = null, this._mouseleaveHandler = null, this._touchstartHandler = null, this._touchendHandler = null, this._focusHandler = null, this._blurHandler = null;
|
|
1865
1894
|
}
|
|
@@ -2077,8 +2106,8 @@ class X extends HTMLElement {
|
|
|
2077
2106
|
n && (n.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`);
|
|
2078
2107
|
}
|
|
2079
2108
|
}
|
|
2080
|
-
customElements.get("mint-checkbox") || customElements.define("mint-checkbox",
|
|
2081
|
-
class
|
|
2109
|
+
customElements.get("mint-checkbox") || customElements.define("mint-checkbox", lt);
|
|
2110
|
+
class ct extends HTMLElement {
|
|
2082
2111
|
constructor() {
|
|
2083
2112
|
super(), this._radio = null, this._checked = !1, this._changeHandler = null, this._clickHandler = null, this._focusHandler = null, this._blurHandler = null, this._keydownHandler = null;
|
|
2084
2113
|
}
|
|
@@ -2318,8 +2347,8 @@ class Z extends HTMLElement {
|
|
|
2318
2347
|
}
|
|
2319
2348
|
}
|
|
2320
2349
|
}
|
|
2321
|
-
customElements.get("mint-choice-option") || customElements.define("mint-choice-option",
|
|
2322
|
-
class
|
|
2350
|
+
customElements.get("mint-choice-option") || customElements.define("mint-choice-option", ct);
|
|
2351
|
+
class ht extends HTMLElement {
|
|
2323
2352
|
constructor() {
|
|
2324
2353
|
super(), this._optionsContainer = null;
|
|
2325
2354
|
}
|
|
@@ -2441,8 +2470,8 @@ class Q extends HTMLElement {
|
|
|
2441
2470
|
t && e ? (i || (i = document.createElement("div"), i.className = "mint-choice-error mt-1 text-xs text-red-600 dark:text-red-400", this.appendChild(i)), i.textContent = e) : i && i.remove();
|
|
2442
2471
|
}
|
|
2443
2472
|
}
|
|
2444
|
-
customElements.get("mint-choice") || customElements.define("mint-choice",
|
|
2445
|
-
class
|
|
2473
|
+
customElements.get("mint-choice") || customElements.define("mint-choice", ht);
|
|
2474
|
+
class dt extends HTMLElement {
|
|
2446
2475
|
constructor() {
|
|
2447
2476
|
super(), this._input = null, this._textarea = null, this._element = null, this._wrapper = null, this._icon = null, this._colorPicker = null, this._colorTextInput = null, this._colorContainer = null, this._colorPickerWrapper = null, this._numberSpinnerContainer = null, this._numberIncrementButton = null, this._numberDecrementButton = null, this._focusHandler = null, this._blurHandler = null, this._clickHandler = null, this._clickOutsideHandler = null;
|
|
2448
2477
|
}
|
|
@@ -2574,52 +2603,52 @@ class tt extends HTMLElement {
|
|
|
2574
2603
|
return this.hasAttribute("loading");
|
|
2575
2604
|
}
|
|
2576
2605
|
render() {
|
|
2577
|
-
var b,
|
|
2606
|
+
var b, v, x, S;
|
|
2578
2607
|
this.getType();
|
|
2579
2608
|
const t = this._getNormalizedType(), e = this._isTextarea(), i = this._isMoney(), s = this._isColor(), n = this.getPlaceholder(), r = this.isDisabled(), a = this.isReadonly(), o = this.isRequired(), l = this.getId(), c = this.getName(), d = this.getAttribute("value") || (s ? "#000000" : ""), u = this.getRows(), h = this.getIcon(), f = this.getLabel(), p = this.getInfo(), m = this.isLoading();
|
|
2580
2609
|
if (this._renderSkeleton(m), s) {
|
|
2581
2610
|
this._input && (this._input.remove(), this._input = null), this._textarea && (this._textarea.remove(), this._textarea = null), this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "relative w-full", this.appendChild(this._wrapper)), this._colorContainer && (this._colorContainer.remove(), this._colorContainer = null), this._colorPickerWrapper && !s && (this._colorPickerWrapper.remove(), this._colorPickerWrapper = null), this._colorPickerWrapper || (this._colorPickerWrapper = document.createElement("div"), this._colorPickerWrapper.className = "mint-color-picker-wrapper absolute left-[.65rem] top-1/2 -translate-y-1/2 w-6 h-6 rounded cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", this._colorPickerWrapper.style.backgroundColor = d || "#000000", this._wrapper.appendChild(this._colorPickerWrapper), this._colorPicker = document.createElement("input"), this._colorPicker.type = "color", this._colorPicker.className = "absolute inset-0 w-full h-full opacity-0 cursor-pointer", this._colorPicker.style.cssText = "position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0; border: none;", this._colorPickerWrapper.appendChild(this._colorPicker), this._focusHandler = (y) => {
|
|
2582
2611
|
this._colorPickerWrapper && this._colorPicker && this._colorPicker.matches(":focus-visible") && requestAnimationFrame(() => {
|
|
2583
|
-
var
|
|
2584
|
-
this._colorPicker && this._colorPicker.matches(":focus-visible") && ((
|
|
2612
|
+
var E;
|
|
2613
|
+
this._colorPicker && this._colorPicker.matches(":focus-visible") && ((E = this._colorPickerWrapper) == null || E.classList.add("ring-2", "ring-offset-1", "ring-gray-400", "dark:ring-gray-500"));
|
|
2585
2614
|
});
|
|
2586
2615
|
}, this._blurHandler = () => {
|
|
2587
2616
|
this._colorPickerWrapper && this._colorPickerWrapper.classList.remove("ring-2", "ring-offset-1", "ring-gray-400", "dark:ring-gray-500");
|
|
2588
2617
|
}, this._colorPicker.addEventListener("focus", this._focusHandler), this._colorPicker.addEventListener("blur", this._blurHandler), this._colorPicker.addEventListener("input", () => {
|
|
2589
|
-
var
|
|
2590
|
-
const y = ((
|
|
2618
|
+
var E;
|
|
2619
|
+
const y = ((E = this._colorPicker) == null ? void 0 : E.value) || "#000000";
|
|
2591
2620
|
this._colorPickerWrapper && (this._colorPickerWrapper.style.backgroundColor = y), this._colorTextInput && (this._colorTextInput.value = y), this.setAttribute("value", y), this.dispatchEvent(new CustomEvent("input", {
|
|
2592
2621
|
detail: { value: y },
|
|
2593
2622
|
bubbles: !0,
|
|
2594
2623
|
cancelable: !0
|
|
2595
2624
|
}));
|
|
2596
2625
|
}), this._colorPicker.addEventListener("change", () => {
|
|
2597
|
-
var
|
|
2598
|
-
const y = ((
|
|
2626
|
+
var E;
|
|
2627
|
+
const y = ((E = this._colorPicker) == null ? void 0 : E.value) || "#000000";
|
|
2599
2628
|
this._colorPickerWrapper && (this._colorPickerWrapper.style.backgroundColor = y), this.setAttribute("value", y), this.dispatchEvent(new CustomEvent("change", {
|
|
2600
2629
|
detail: { value: y },
|
|
2601
2630
|
bubbles: !0,
|
|
2602
2631
|
cancelable: !0
|
|
2603
2632
|
}));
|
|
2604
2633
|
})), this._colorTextInput || (this._colorTextInput = document.createElement("input"), this._colorTextInput.type = "text", this._colorTextInput.className = this.getInputClasses(), this._colorTextInput.placeholder = n || "#000000", this._colorTextInput.pattern = "^#[0-9A-Fa-f]{6}$", this._wrapper.appendChild(this._colorTextInput), this._colorTextInput.addEventListener("input", () => {
|
|
2605
|
-
var
|
|
2606
|
-
const y = ((
|
|
2634
|
+
var E;
|
|
2635
|
+
const y = ((E = this._colorTextInput) == null ? void 0 : E.value) || "";
|
|
2607
2636
|
/^#[0-9A-Fa-f]{6}$/.test(y) && (this._colorPicker && (this._colorPicker.value = y), this.setAttribute("value", y), this.dispatchEvent(new CustomEvent("input", {
|
|
2608
2637
|
detail: { value: y },
|
|
2609
2638
|
bubbles: !0,
|
|
2610
2639
|
cancelable: !0
|
|
2611
2640
|
})));
|
|
2612
2641
|
}), this._colorTextInput.addEventListener("blur", () => {
|
|
2613
|
-
var
|
|
2614
|
-
const y = ((
|
|
2642
|
+
var E, I;
|
|
2643
|
+
const y = ((E = this._colorTextInput) == null ? void 0 : E.value) || "";
|
|
2615
2644
|
/^#[0-9A-Fa-f]{6}$/.test(y) ? (this._colorPicker && (this._colorPicker.value = y), this.setAttribute("value", y)) : this._colorPicker && this._colorTextInput && (this._colorTextInput.value = this._colorPicker.value), this.dispatchEvent(new CustomEvent("change", {
|
|
2616
|
-
detail: { value: ((
|
|
2645
|
+
detail: { value: ((I = this._colorPicker) == null ? void 0 : I.value) || "#000000" },
|
|
2617
2646
|
bubbles: !0,
|
|
2618
2647
|
cancelable: !0
|
|
2619
2648
|
}));
|
|
2620
2649
|
}));
|
|
2621
|
-
const
|
|
2622
|
-
if (this._colorPicker && this._colorPicker.value !==
|
|
2650
|
+
const k = d || "#000000";
|
|
2651
|
+
if (this._colorPicker && this._colorPicker.value !== k && (this._colorPicker.value = k), this._colorPickerWrapper && (this._colorPickerWrapper.style.backgroundColor = k), this._colorTextInput && this._colorTextInput.value !== k && (this._colorTextInput.value = k), this._colorPicker && (this._colorPicker.disabled = r), this._colorPickerWrapper && (r ? (this._colorPickerWrapper.classList.add("opacity-40", "cursor-not-allowed"), this._colorPickerWrapper.classList.remove("cursor-pointer")) : (this._colorPickerWrapper.classList.remove("opacity-40", "cursor-not-allowed"), this._colorPickerWrapper.classList.add("cursor-pointer"))), this._colorTextInput && (this._colorTextInput.disabled = r, this._colorTextInput.readOnly = a, this._colorTextInput.required = o), this._colorTextInput) {
|
|
2623
2652
|
const y = this._colorTextInput;
|
|
2624
2653
|
l ? y.id = l : y.removeAttribute("id"), c ? y.name = c : y.removeAttribute("name"), y.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), this._element = y;
|
|
2625
2654
|
}
|
|
@@ -2629,20 +2658,20 @@ class tt extends HTMLElement {
|
|
|
2629
2658
|
if (this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "relative w-full", this.appendChild(this._wrapper)), this._colorContainer && (this._colorContainer.remove(), this._colorContainer = null, this._colorPicker = null, this._colorTextInput = null), this._colorPickerWrapper && !s && (this._colorPickerWrapper.remove(), this._colorPickerWrapper = null, this._colorPicker = null, this._colorTextInput = null), h && !e ? this._icon ? this._icon.setAttribute("name", h) : (this._icon = document.createElement("mint-icon"), this._icon.setAttribute("name", h), this._icon.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none", this._wrapper.appendChild(this._icon)) : this._icon && (this._icon.remove(), this._icon = null), this._isNumber() && !e) {
|
|
2630
2659
|
if (!this._numberSpinnerContainer) {
|
|
2631
2660
|
this._numberSpinnerContainer = document.createElement("div"), this._numberSpinnerContainer.className = "absolute right-1 top-1/2 -translate-y-1/2 flex flex-col h-8 pointer-events-none", this._wrapper.appendChild(this._numberSpinnerContainer), this._numberIncrementButton = document.createElement("button"), this._numberIncrementButton.type = "button", this._numberIncrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed transition-colors pointer-events-auto bg-gray-100 dark:bg-gray-600 active:bg-gray-200 dark:active:bg-gray-500 rounded";
|
|
2632
|
-
const
|
|
2633
|
-
|
|
2661
|
+
const k = document.createElement("mint-icon");
|
|
2662
|
+
k.setAttribute("name", "caret-up"), k.className = "w-[1rem] h-[1rem]", this._numberIncrementButton.appendChild(k), this._numberSpinnerContainer.appendChild(this._numberIncrementButton), this._numberDecrementButton = document.createElement("button"), this._numberDecrementButton.type = "button", this._numberDecrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed transition-colors pointer-events-auto bg-gray-100 dark:bg-gray-600 active:bg-gray-200 dark:active:bg-gray-500 rounded";
|
|
2634
2663
|
const y = document.createElement("mint-icon");
|
|
2635
|
-
y.setAttribute("name", "caret-down"), y.className = "w-[1rem] h-[1rem]", this._numberDecrementButton.appendChild(y), this._numberSpinnerContainer.appendChild(this._numberDecrementButton), this._numberIncrementButton.addEventListener("click", (
|
|
2636
|
-
if (
|
|
2637
|
-
const
|
|
2638
|
-
let
|
|
2639
|
-
|
|
2664
|
+
y.setAttribute("name", "caret-down"), y.className = "w-[1rem] h-[1rem]", this._numberDecrementButton.appendChild(y), this._numberSpinnerContainer.appendChild(this._numberDecrementButton), this._numberIncrementButton.addEventListener("click", (E) => {
|
|
2665
|
+
if (E.preventDefault(), E.stopPropagation(), this._input && !this._input.disabled && !this._input.readOnly) {
|
|
2666
|
+
const I = parseFloat(this._input.value) || 0, V = parseFloat(this._input.step) || 1, O = this._input.min ? parseFloat(this._input.min) : void 0, F = this._input.max ? parseFloat(this._input.max) : void 0;
|
|
2667
|
+
let D = I + V;
|
|
2668
|
+
F !== void 0 && D > F && (D = F), O !== void 0 && D < O && (D = O), this._input.value = D.toString(), this.setAttribute("value", D.toString()), this._input.dispatchEvent(new Event("input", { bubbles: !0 })), this._input.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2640
2669
|
}
|
|
2641
|
-
}), this._numberDecrementButton.addEventListener("click", (
|
|
2642
|
-
if (
|
|
2643
|
-
const
|
|
2644
|
-
let
|
|
2645
|
-
|
|
2670
|
+
}), this._numberDecrementButton.addEventListener("click", (E) => {
|
|
2671
|
+
if (E.preventDefault(), E.stopPropagation(), this._input && !this._input.disabled && !this._input.readOnly) {
|
|
2672
|
+
const I = parseFloat(this._input.value) || 0, V = parseFloat(this._input.step) || 1, O = this._input.min ? parseFloat(this._input.min) : void 0, F = this._input.max ? parseFloat(this._input.max) : void 0;
|
|
2673
|
+
let D = I - V;
|
|
2674
|
+
O !== void 0 && D < O && (D = O), F !== void 0 && D > F && (D = F), this._input.value = D.toString(), this.setAttribute("value", D.toString()), this._input.dispatchEvent(new Event("input", { bubbles: !0 })), this._input.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2646
2675
|
}
|
|
2647
2676
|
});
|
|
2648
2677
|
}
|
|
@@ -2650,28 +2679,28 @@ class tt extends HTMLElement {
|
|
|
2650
2679
|
} else this._numberSpinnerContainer && (this._numberSpinnerContainer.remove(), this._numberSpinnerContainer = null, this._numberIncrementButton = null, this._numberDecrementButton = null);
|
|
2651
2680
|
if (e) {
|
|
2652
2681
|
if (this._input && (this._input.remove(), this._input = null), this._textarea || (this._textarea = document.createElement("textarea"), this._wrapper.appendChild(this._textarea), this.setupEventListeners()), this._element = this._textarea, this._textarea.placeholder = n, this._textarea.disabled = r, this._textarea.readOnly = a, this._textarea.required = o, this._textarea.rows = u, this._textarea.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), d !== this._textarea.value && (this._textarea.value = d), l ? this._textarea.id = l : this._textarea.removeAttribute("id"), c ? this._textarea.name = c : this._textarea.removeAttribute("name"), this._textarea.className = this.getInputClasses(), this.firstChild && this.firstChild !== this._wrapper && this.firstChild.nodeType === Node.TEXT_NODE) {
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2682
|
+
const k = this.firstChild.textContent;
|
|
2683
|
+
k && !this._textarea.value && (this._textarea.value = k.trim()), this.removeChild(this.firstChild);
|
|
2655
2684
|
}
|
|
2656
2685
|
} else if (this._textarea && (this._textarea.remove(), this._textarea = null), this._input || (this._input = document.createElement("input"), this._wrapper.appendChild(this._input), this.setupEventListeners()), this._element = this._input, this._input.type = t, this._input.placeholder = n, this._input.disabled = r, this._input.readOnly = a, this._input.required = o, this._input.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), i ? (this._input.inputMode = "decimal", this._input.pattern = "[0-9]*\\.?[0-9]*") : (this._input.removeAttribute("inputmode"), this._input.removeAttribute("pattern")), d !== this._input.value && (this._input.value = d), l ? this._input.id = l : this._input.removeAttribute("id"), c ? this._input.name = c : this._input.removeAttribute("name"), this._input.className = this.getInputClasses(), this.firstChild && this.firstChild !== this._wrapper && this.firstChild.nodeType === Node.TEXT_NODE) {
|
|
2657
|
-
const
|
|
2658
|
-
|
|
2686
|
+
const k = this.firstChild.textContent;
|
|
2687
|
+
k && !this._input.value && (this._input.value = k.trim()), this.removeChild(this.firstChild);
|
|
2659
2688
|
}
|
|
2660
2689
|
let g = this.querySelector(".mint-input-label-container");
|
|
2661
2690
|
if (f || p) {
|
|
2662
2691
|
g || (g = document.createElement("div"), g.className = "mint-input-label-container flex flex-col gap-0.5 mb-[.25rem]", this._wrapper && this._wrapper.parentElement === this ? this.insertBefore(g, this._wrapper) : this.insertBefore(g, this.firstChild));
|
|
2663
|
-
let
|
|
2692
|
+
let k = g.querySelector(".mint-input-label");
|
|
2664
2693
|
if (f) {
|
|
2665
|
-
|
|
2666
|
-
const
|
|
2667
|
-
if (
|
|
2668
|
-
|
|
2694
|
+
k || (k = document.createElement("label"), k.className = "mint-input-label text-sm font-medium text-gray-900 dark:text-gray-100 select-none", g.insertBefore(k, g.firstChild)), k.textContent = f;
|
|
2695
|
+
const E = l || ((b = this._element) == null ? void 0 : b.id) || ((v = this._colorTextInput) == null ? void 0 : v.id) || ((x = this._input) == null ? void 0 : x.id) || ((S = this._textarea) == null ? void 0 : S.id);
|
|
2696
|
+
if (E)
|
|
2697
|
+
k.setAttribute("for", E);
|
|
2669
2698
|
else {
|
|
2670
|
-
const
|
|
2671
|
-
this._element ? this._element.id =
|
|
2699
|
+
const I = `mint-input-${Math.random().toString(36).substr(2, 9)}`;
|
|
2700
|
+
this._element ? this._element.id = I : this._colorTextInput ? this._colorTextInput.id = I : this._input ? this._input.id = I : this._textarea && (this._textarea.id = I), k.setAttribute("for", I);
|
|
2672
2701
|
}
|
|
2673
|
-
r ?
|
|
2674
|
-
} else
|
|
2702
|
+
r ? k.classList.add("opacity-40") : k.classList.remove("opacity-40");
|
|
2703
|
+
} else k && k.remove();
|
|
2675
2704
|
let y = g.querySelector(".mint-input-info");
|
|
2676
2705
|
p ? (y || (y = document.createElement("span"), y.className = "mint-input-info text-xs text-gray-500 dark:text-gray-400 select-none", g.appendChild(y)), y.textContent = p, r ? y.classList.add("opacity-40") : y.classList.remove("opacity-40")) : y && y.remove();
|
|
2677
2706
|
} else g && g.remove();
|
|
@@ -2733,8 +2762,8 @@ class tt extends HTMLElement {
|
|
|
2733
2762
|
e && (e.style.display = "none"), this._element && (this._element.style.opacity = "1", this._element.style.pointerEvents = "auto"), this._colorTextInput && (this._colorTextInput.style.opacity = "1", this._colorTextInput.style.pointerEvents = "auto");
|
|
2734
2763
|
}
|
|
2735
2764
|
}
|
|
2736
|
-
customElements.get("mint-input") || customElements.define("mint-input",
|
|
2737
|
-
class
|
|
2765
|
+
customElements.get("mint-input") || customElements.define("mint-input", dt);
|
|
2766
|
+
class ut extends HTMLElement {
|
|
2738
2767
|
constructor() {
|
|
2739
2768
|
super(), this._input = null, this._textInput = null, this._popover = null, this._calendarContainer = null, this._iconButton = null, this._hiddenInput = null, this._startPartInputs = [], this._endPartInputs = [], this._displayEl = null, this._inputsWrapperEl = null, this._fieldsContainer = null, this._resetHandler = null, this._isInputMode = !1, this._currentMonth = (/* @__PURE__ */ new Date()).getMonth(), this._currentYear = (/* @__PURE__ */ new Date()).getFullYear(), this._viewMode = "calendar", this._selectedStartDate = null, this._selectedEndDate = null, this._isRange = !1, this._popoverObserver = null, this._focusTrapHandler = null, this._escapeHandler = null;
|
|
2740
2769
|
}
|
|
@@ -2983,22 +3012,22 @@ class et extends HTMLElement {
|
|
|
2983
3012
|
if (i.test(t)) {
|
|
2984
3013
|
const m = t.split(i).filter((g) => g.length > 0), _ = e.split(/[\/\-\.\s]+/).filter((g) => g.length > 0);
|
|
2985
3014
|
if (m.length === _.length) {
|
|
2986
|
-
let g = 0, b = 0,
|
|
3015
|
+
let g = 0, b = 0, v = 0;
|
|
2987
3016
|
for (let x = 0; x < _.length; x++) {
|
|
2988
|
-
const
|
|
2989
|
-
if (
|
|
2990
|
-
g = parseInt(
|
|
2991
|
-
else if (
|
|
2992
|
-
b = parseInt(
|
|
2993
|
-
else if (
|
|
2994
|
-
let y = parseInt(
|
|
2995
|
-
const
|
|
2996
|
-
|
|
3017
|
+
const S = _[x].toLowerCase(), k = m[x];
|
|
3018
|
+
if (S.includes("d"))
|
|
3019
|
+
g = parseInt(k, 10);
|
|
3020
|
+
else if (S.includes("m"))
|
|
3021
|
+
b = parseInt(k, 10) - 1;
|
|
3022
|
+
else if (S.includes("y")) {
|
|
3023
|
+
let y = parseInt(k, 10);
|
|
3024
|
+
const E = S.length, I = k.length;
|
|
3025
|
+
I === 2 && E === 4 ? y = Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 100) * 100 + y : I === 2 && E === 2 && (y = Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 100) * 100 + y), v = y;
|
|
2997
3026
|
}
|
|
2998
3027
|
}
|
|
2999
|
-
if (g && b >= 0 && b <= 11 &&
|
|
3000
|
-
const x = new Date(
|
|
3001
|
-
if (!isNaN(x.getTime()) && x.getDate() === g && x.getMonth() === b && x.getFullYear() ===
|
|
3028
|
+
if (g && b >= 0 && b <= 11 && v) {
|
|
3029
|
+
const x = new Date(v, b, g);
|
|
3030
|
+
if (!isNaN(x.getTime()) && x.getDate() === g && x.getMonth() === b && x.getFullYear() === v)
|
|
3002
3031
|
return x;
|
|
3003
3032
|
}
|
|
3004
3033
|
}
|
|
@@ -3022,9 +3051,9 @@ class et extends HTMLElement {
|
|
|
3022
3051
|
if (g.length === 0) return null;
|
|
3023
3052
|
u = parseInt(g, 10) - 1, f += g.length;
|
|
3024
3053
|
} else if (m.char === "y") {
|
|
3025
|
-
const _ = r.lastIndexOf("y") - r.indexOf("y") + 1, g = n.substr(f), b = Math.min(_, g.length),
|
|
3026
|
-
if (
|
|
3027
|
-
let x = parseInt(
|
|
3054
|
+
const _ = r.lastIndexOf("y") - r.indexOf("y") + 1, g = n.substr(f), b = Math.min(_, g.length), v = g.substr(0, b);
|
|
3055
|
+
if (v.length === 0) return null;
|
|
3056
|
+
let x = parseInt(v, 10);
|
|
3028
3057
|
b === 2 && _ === 4 ? x = Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 100) * 100 + x : b === 2 && _ === 2 && (x = Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 100) * 100 + x), h = x, f += b;
|
|
3029
3058
|
}
|
|
3030
3059
|
if (!d || u < 0 || u > 11 || !h) return null;
|
|
@@ -3102,8 +3131,8 @@ class et extends HTMLElement {
|
|
|
3102
3131
|
h || (h = document.createElement("div"), h.className = "mint-date-picker-label-container flex flex-col gap-0.5 mb-[.25rem]", this.contains(this._input) ? this.insertBefore(h, this._input) : this.appendChild(h));
|
|
3103
3132
|
let b = h.querySelector(".mint-date-picker-label");
|
|
3104
3133
|
e ? (b || (b = document.createElement("label"), b.className = "mint-date-picker-label text-sm font-medium text-gray-900 dark:text-gray-100 select-none", h.insertBefore(b, h.firstChild)), b.textContent = e, o && this._textInput && b.setAttribute("for", o)) : b && b.remove();
|
|
3105
|
-
let
|
|
3106
|
-
i ? (
|
|
3134
|
+
let v = h.querySelector(".mint-date-picker-info");
|
|
3135
|
+
i ? (v || (v = document.createElement("span"), v.className = "mint-date-picker-info text-xs text-gray-500 dark:text-gray-400 select-none", h.appendChild(v)), v.textContent = i) : v && v.remove();
|
|
3107
3136
|
} else h && h.remove();
|
|
3108
3137
|
this._hiddenInput || (this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.value = s || "", this._textInput = this._hiddenInput, this._input.appendChild(this._hiddenInput)), o && (this._hiddenInput.id = o), l && (this._hiddenInput.name = l), this._hiddenInput.value = s || "", this._hiddenInput.setAttribute("aria-invalid", d ? "true" : "false");
|
|
3109
3138
|
let f = this._input.querySelector(".mint-date-fields");
|
|
@@ -3117,16 +3146,16 @@ class et extends HTMLElement {
|
|
|
3117
3146
|
const m = this._getFormatTokens(c);
|
|
3118
3147
|
this._startPartInputs = [], this._endPartInputs = [];
|
|
3119
3148
|
const _ = (b) => {
|
|
3120
|
-
const
|
|
3149
|
+
const v = document.createDocumentFragment();
|
|
3121
3150
|
return m.forEach((x) => {
|
|
3122
3151
|
if (x.type === "sep") {
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3152
|
+
const S = document.createElement("span");
|
|
3153
|
+
S.textContent = x.value, S.className = "text-gray-400 dark:text-gray-500 select-none", v.appendChild(S);
|
|
3125
3154
|
} else {
|
|
3126
|
-
const
|
|
3127
|
-
b === "start" ? this._startPartInputs.push(
|
|
3155
|
+
const S = x.part === "d" ? "dd" : x.part === "m" ? "mm" : x.len === 2 ? "yy" : "yyyy", k = this._createPartInput(x.len, S, n, r, a);
|
|
3156
|
+
b === "start" ? this._startPartInputs.push(k) : this._endPartInputs.push(k), v.appendChild(k);
|
|
3128
3157
|
}
|
|
3129
|
-
}),
|
|
3158
|
+
}), v;
|
|
3130
3159
|
};
|
|
3131
3160
|
if (this._inputsWrapperEl.appendChild(_("start")), this._isRange) {
|
|
3132
3161
|
const b = document.createElement("span");
|
|
@@ -3141,8 +3170,8 @@ class et extends HTMLElement {
|
|
|
3141
3170
|
this._iconButton = document.createElement("button"), this._iconButton.type = "button", this._iconButton.tabIndex = 0, this._iconButton.className = "absolute left-2 top-[.55rem] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer z-10 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500 pointer-events-auto disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center rounded-sm";
|
|
3142
3171
|
const b = `date-icon-${Math.random().toString(36).substr(2, 9)}`;
|
|
3143
3172
|
this._iconButton.id = b;
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3173
|
+
const v = document.createElement("mint-icon");
|
|
3174
|
+
v.setAttribute("name", "calendar"), v.className = "w-4 h-4 pointer-events-none", this._iconButton.appendChild(v), this._iconButton.addEventListener("click", () => {
|
|
3146
3175
|
n || r || this._enterInputMode();
|
|
3147
3176
|
}), this._input.prepend(this._iconButton), this._iconButton.disabled = n || r;
|
|
3148
3177
|
}
|
|
@@ -3329,38 +3358,47 @@ class et extends HTMLElement {
|
|
|
3329
3358
|
this._currentMonth === 11 ? (this._currentMonth = 0, this._currentYear++) : this._currentMonth++, this._buildCalendar();
|
|
3330
3359
|
}), l.appendChild(p);
|
|
3331
3360
|
const _ = document.createElement("div");
|
|
3332
|
-
_.className = "grid grid-cols-7 mb-2", s.forEach((
|
|
3333
|
-
const
|
|
3334
|
-
|
|
3361
|
+
_.className = "grid grid-cols-7 mb-2", s.forEach((w) => {
|
|
3362
|
+
const T = document.createElement("div");
|
|
3363
|
+
T.className = "text-xs font-medium text-gray-500 dark:text-gray-400 text-center py-1", T.textContent = w, _.appendChild(T);
|
|
3335
3364
|
});
|
|
3336
3365
|
const g = document.createElement("div");
|
|
3337
3366
|
g.className = "grid grid-cols-7";
|
|
3338
|
-
|
|
3339
|
-
const
|
|
3340
|
-
|
|
3341
|
-
}
|
|
3342
|
-
const b = this.getMin() ? this._parseDateString(this.getMin(), this.getFormat()) : null, k = this.getMax() ? this._parseDateString(this.getMax(), this.getFormat()) : null;
|
|
3343
|
-
for (let x = 1; x <= t; x++) {
|
|
3344
|
-
const E = new Date(this._currentYear, this._currentMonth, x), v = this._isToday(E), y = this._isDateSelected(E), w = this._isDateInRange(E), A = b && E < b || k && E > k;
|
|
3345
|
-
let I = "rounded-md";
|
|
3367
|
+
const b = this.getMin() ? this._parseDateString(this.getMin(), this.getFormat()) : null, v = this.getMax() ? this._parseDateString(this.getMax(), this.getFormat()) : null, x = this._currentMonth === 0 ? 11 : this._currentMonth - 1, S = this._currentMonth === 0 ? this._currentYear - 1 : this._currentYear, k = this._getDaysInMonth(x, S), y = this._currentMonth === 11 ? 0 : this._currentMonth + 1, E = this._currentMonth === 11 ? this._currentYear + 1 : this._currentYear, I = e + t, F = Math.ceil(I / 7) * 7 - I, D = (w, T, A) => {
|
|
3368
|
+
const R = this._isToday(w), $ = this._isDateSelected(w), q = this._isDateInRange(w), P = b && w < b || v && w > v;
|
|
3369
|
+
let N = "rounded-md";
|
|
3346
3370
|
if (this._isRange && this._selectedStartDate && this._selectedEndDate) {
|
|
3347
|
-
const
|
|
3348
|
-
|
|
3349
|
-
} else
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3371
|
+
const H = this._isSameDate(w, this._selectedStartDate), L = this._isSameDate(w, this._selectedEndDate);
|
|
3372
|
+
H && L ? N = "rounded-md" : H ? N = "rounded-l-md" : L ? N = "rounded-r-md" : q && (N = "rounded-none");
|
|
3373
|
+
} else $ && !this._isRange && (N = "rounded-md");
|
|
3374
|
+
const M = document.createElement("button");
|
|
3375
|
+
M.type = "button", M.disabled = !!P, M.tabIndex = P ? -1 : 0;
|
|
3376
|
+
let B = `w-full h-8 ${N} border-0 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500`;
|
|
3377
|
+
return A ? B += $ ? " bg-slate-800 dark:bg-slate-600 text-white" : q ? " bg-slate-100 dark:bg-slate-700 text-slate-800 dark:text-slate-200" : R ? " text-gray-900 dark:text-gray-100 font-semibold" : " text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700" : B += $ ? " bg-slate-800 dark:bg-slate-600 text-white" : q ? " bg-slate-100 dark:bg-slate-700 text-slate-800 dark:text-slate-200" : " text-gray-400 dark:text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700", B += P ? " opacity-40 cursor-not-allowed" : "", M.className = B, M.textContent = T.toString(), P || M.addEventListener("click", () => {
|
|
3378
|
+
this._handleDateClick(w);
|
|
3379
|
+
}), M;
|
|
3380
|
+
};
|
|
3381
|
+
for (let w = e - 1; w >= 0; w--) {
|
|
3382
|
+
const T = k - w, A = new Date(S, x, T), R = D(A, T, !1);
|
|
3383
|
+
g.appendChild(R);
|
|
3384
|
+
}
|
|
3385
|
+
for (let w = 1; w <= t; w++) {
|
|
3386
|
+
const T = new Date(this._currentYear, this._currentMonth, w), A = D(T, w, !0);
|
|
3387
|
+
g.appendChild(A);
|
|
3388
|
+
}
|
|
3389
|
+
for (let w = 1; w <= F; w++) {
|
|
3390
|
+
const T = new Date(E, y, w), A = D(T, w, !1);
|
|
3391
|
+
g.appendChild(A);
|
|
3354
3392
|
}
|
|
3355
3393
|
if (r) {
|
|
3356
|
-
const
|
|
3357
|
-
|
|
3358
|
-
const
|
|
3359
|
-
|
|
3360
|
-
const
|
|
3361
|
-
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3394
|
+
const w = document.createElement("div");
|
|
3395
|
+
w.className = "mb-4 pb-4 border-b border-gray-200 dark:border-gray-700 md:mb-0 md:pb-0 md:border-b-0 md:border-r md:border-r-gray-200 dark:md:border-r-gray-700 md:pr-6 md:mr-0 md:w-32 md:flex-shrink-0 md:h-full md:flex md:flex-col";
|
|
3396
|
+
const T = document.createElement("div");
|
|
3397
|
+
T.className = "relative md:relative md:flex-1 md:min-h-0";
|
|
3398
|
+
const A = document.createElement("div");
|
|
3399
|
+
A.className = "flex gap-2 overflow-x-auto pb-1 md:flex-col md:overflow-x-visible md:overflow-y-auto md:pb-0 md:gap-2", A.style.scrollbarWidth = "none", A.style.msOverflowStyle = "none", A.style.setProperty("-webkit-overflow-scrolling", "touch");
|
|
3400
|
+
const R = document.createElement("style");
|
|
3401
|
+
R.textContent = `
|
|
3364
3402
|
.mint-date-shortcuts-row::-webkit-scrollbar {
|
|
3365
3403
|
display: none;
|
|
3366
3404
|
}
|
|
@@ -3384,37 +3422,37 @@ class et extends HTMLElement {
|
|
|
3384
3422
|
background: rgba(255, 255, 255, 0.2);
|
|
3385
3423
|
}
|
|
3386
3424
|
}
|
|
3387
|
-
`,
|
|
3388
|
-
const
|
|
3389
|
-
|
|
3390
|
-
const
|
|
3391
|
-
|
|
3392
|
-
const
|
|
3393
|
-
|
|
3394
|
-
const
|
|
3395
|
-
|
|
3396
|
-
const
|
|
3425
|
+
`, A.classList.add("mint-date-shortcuts-row"), document.head.querySelector("style[data-mint-date-shortcuts]") || (R.setAttribute("data-mint-date-shortcuts", "true"), document.head.appendChild(R));
|
|
3426
|
+
const $ = document.createElement("div");
|
|
3427
|
+
$.className = "absolute left-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-r from-white dark:from-gray-800 to-transparent opacity-0 transition-opacity duration-200 md:hidden", T.appendChild($);
|
|
3428
|
+
const q = document.createElement("div");
|
|
3429
|
+
q.className = "absolute right-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-l from-white dark:from-gray-800 to-transparent opacity-100 transition-opacity duration-200 md:hidden", T.appendChild(q);
|
|
3430
|
+
const P = document.createElement("div");
|
|
3431
|
+
P.className = "hidden md:block absolute top-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-b from-white dark:from-gray-800 to-transparent opacity-0 transition-opacity duration-200", T.appendChild(P);
|
|
3432
|
+
const N = document.createElement("div");
|
|
3433
|
+
N.className = "hidden md:block absolute bottom-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-t from-white dark:from-gray-800 to-transparent opacity-100 transition-opacity duration-200", T.appendChild(N);
|
|
3434
|
+
const M = () => {
|
|
3397
3435
|
if (window.innerWidth >= 768) {
|
|
3398
|
-
const H =
|
|
3399
|
-
H > 0 ?
|
|
3436
|
+
const H = A.scrollTop, L = A.scrollHeight, z = A.clientHeight;
|
|
3437
|
+
H > 0 ? P.style.opacity = "1" : P.style.opacity = "0", H + z < L - 1 ? N.style.opacity = "1" : N.style.opacity = "0", $.style.opacity = "0", q.style.opacity = "0";
|
|
3400
3438
|
} else {
|
|
3401
|
-
const H =
|
|
3402
|
-
H > 0 ?
|
|
3439
|
+
const H = A.scrollLeft, L = A.scrollWidth, z = A.clientWidth;
|
|
3440
|
+
H > 0 ? $.style.opacity = "1" : $.style.opacity = "0", H + z < L - 1 ? q.style.opacity = "1" : q.style.opacity = "0", P.style.opacity = "0", N.style.opacity = "0";
|
|
3403
3441
|
}
|
|
3404
3442
|
};
|
|
3405
|
-
|
|
3443
|
+
A.addEventListener("scroll", M), window.addEventListener("resize", M), setTimeout(M, 0), n.forEach((B) => {
|
|
3406
3444
|
const H = document.createElement("button");
|
|
3407
|
-
H.type = "button", H.tabIndex = 0, H.className = "px-3 py-1.5 text-xs font-medium rounded-md bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors whitespace-nowrap flex-shrink-0 md:w-full md:text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", H.textContent =
|
|
3408
|
-
const
|
|
3409
|
-
if (
|
|
3410
|
-
if (this._isRange && "start" in
|
|
3411
|
-
this._selectedStartDate =
|
|
3412
|
-
const
|
|
3413
|
-
this.setValue(
|
|
3414
|
-
} else if (
|
|
3415
|
-
this._selectedStartDate =
|
|
3416
|
-
const
|
|
3417
|
-
this.setValue(
|
|
3445
|
+
H.type = "button", H.tabIndex = 0, H.className = "px-3 py-1.5 text-xs font-medium rounded-md bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors whitespace-nowrap flex-shrink-0 md:w-full md:text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", H.textContent = B.label, H.setAttribute("data-keep-popover-open", "true"), H.addEventListener("click", () => {
|
|
3446
|
+
const L = B.action();
|
|
3447
|
+
if (L) {
|
|
3448
|
+
if (this._isRange && "start" in L && "end" in L) {
|
|
3449
|
+
this._selectedStartDate = L.start, this._selectedEndDate = L.end;
|
|
3450
|
+
const z = this.getFormat(), j = this._formatDate(L.start, z), U = this._formatDate(L.end, z), J = `${j} - ${U}`;
|
|
3451
|
+
this.setValue(J), this._currentMonth = L.start.getMonth(), this._currentYear = L.start.getFullYear();
|
|
3452
|
+
} else if (L instanceof Date) {
|
|
3453
|
+
this._selectedStartDate = L, this._selectedEndDate = null;
|
|
3454
|
+
const z = this.getFormat(), j = this._formatDate(L, z);
|
|
3455
|
+
this.setValue(j), this._currentMonth = L.getMonth(), this._currentYear = L.getFullYear();
|
|
3418
3456
|
}
|
|
3419
3457
|
this._buildCalendar(), this._popover && typeof this._popover.close == "function" && this._popover.close(), this.dispatchEvent(new CustomEvent("input", {
|
|
3420
3458
|
detail: { value: this.getValue() },
|
|
@@ -3426,8 +3464,8 @@ class et extends HTMLElement {
|
|
|
3426
3464
|
cancelable: !0
|
|
3427
3465
|
}));
|
|
3428
3466
|
}
|
|
3429
|
-
}),
|
|
3430
|
-
}),
|
|
3467
|
+
}), A.appendChild(H);
|
|
3468
|
+
}), T.appendChild(A), w.appendChild(T), a.appendChild(w);
|
|
3431
3469
|
}
|
|
3432
3470
|
o.appendChild(l), o.appendChild(_), o.appendChild(g), a.appendChild(o), this._calendarContainer.appendChild(a);
|
|
3433
3471
|
}
|
|
@@ -3622,8 +3660,8 @@ class et extends HTMLElement {
|
|
|
3622
3660
|
this._focusTrapHandler && (document.removeEventListener("keydown", this._focusTrapHandler, !0), this._focusTrapHandler = null), this._escapeHandler && (document.removeEventListener("keydown", this._escapeHandler, !0), this._escapeHandler = null);
|
|
3623
3661
|
}
|
|
3624
3662
|
}
|
|
3625
|
-
customElements.get("mint-date-picker") || customElements.define("mint-date-picker",
|
|
3626
|
-
class
|
|
3663
|
+
customElements.get("mint-date-picker") || customElements.define("mint-date-picker", ut);
|
|
3664
|
+
class pt extends HTMLElement {
|
|
3627
3665
|
constructor() {
|
|
3628
3666
|
super(), this._select = null, this._wrapper = null, this._caretUpIcon = null, this._caretDownIcon = null, this._changeHandler = null;
|
|
3629
3667
|
}
|
|
@@ -3789,8 +3827,8 @@ class it extends HTMLElement {
|
|
|
3789
3827
|
t && e ? (i || (i = document.createElement("div"), i.className = "mint-select-error mt-1 text-xs text-red-600 dark:text-red-400", this.appendChild(i)), i.textContent = e) : i && i.remove();
|
|
3790
3828
|
}
|
|
3791
3829
|
}
|
|
3792
|
-
customElements.get("mint-select") || customElements.define("mint-select",
|
|
3793
|
-
class
|
|
3830
|
+
customElements.get("mint-select") || customElements.define("mint-select", pt);
|
|
3831
|
+
class ft extends HTMLElement {
|
|
3794
3832
|
constructor() {
|
|
3795
3833
|
super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null;
|
|
3796
3834
|
}
|
|
@@ -4114,8 +4152,8 @@ class st extends HTMLElement {
|
|
|
4114
4152
|
);
|
|
4115
4153
|
}
|
|
4116
4154
|
}
|
|
4117
|
-
customElements.get("mint-dropzone") || customElements.define("mint-dropzone",
|
|
4118
|
-
class
|
|
4155
|
+
customElements.get("mint-dropzone") || customElements.define("mint-dropzone", ft);
|
|
4156
|
+
class mt extends HTMLElement {
|
|
4119
4157
|
constructor() {
|
|
4120
4158
|
super(), this._form = null, this._submitHandler = null, this._hostSubmitHandler = null, this._errors = {}, this._fieldBlurHandlers = /* @__PURE__ */ new Map(), this._fieldChangeHandlers = /* @__PURE__ */ new Map(), this._observer = null, this._formData = null, this._headers = null, this._buttonStates = /* @__PURE__ */ new Map(), this._reactiveDataProxy = null, this._reactiveDataObserver = null, this._lastDataSnapshot = null;
|
|
4121
4159
|
}
|
|
@@ -4319,10 +4357,10 @@ class rt extends HTMLElement {
|
|
|
4319
4357
|
} catch {
|
|
4320
4358
|
}
|
|
4321
4359
|
try {
|
|
4322
|
-
const
|
|
4360
|
+
const v = { status: _, ok: !0, data: b }, x = await c._applySuccessInterceptors(v);
|
|
4323
4361
|
f(x);
|
|
4324
|
-
} catch (
|
|
4325
|
-
p(
|
|
4362
|
+
} catch (v) {
|
|
4363
|
+
p(v);
|
|
4326
4364
|
}
|
|
4327
4365
|
} else {
|
|
4328
4366
|
let b = g;
|
|
@@ -4331,10 +4369,10 @@ class rt extends HTMLElement {
|
|
|
4331
4369
|
} catch {
|
|
4332
4370
|
}
|
|
4333
4371
|
try {
|
|
4334
|
-
const
|
|
4372
|
+
const v = { status: _, data: b, response: { status: _, data: b } }, x = await c._applyErrorInterceptors(v);
|
|
4335
4373
|
p(x);
|
|
4336
|
-
} catch (
|
|
4337
|
-
p(
|
|
4374
|
+
} catch (v) {
|
|
4375
|
+
p(v);
|
|
4338
4376
|
}
|
|
4339
4377
|
}
|
|
4340
4378
|
}, m.onerror = async function() {
|
|
@@ -4985,7 +5023,7 @@ class rt extends HTMLElement {
|
|
|
4985
5023
|
this._reactiveDataObserver !== null && (cancelAnimationFrame(this._reactiveDataObserver), this._reactiveDataObserver = null), this._reactiveDataProxy = null, this._lastDataSnapshot = null;
|
|
4986
5024
|
}
|
|
4987
5025
|
}
|
|
4988
|
-
customElements.get("mint-form") || customElements.define("mint-form",
|
|
5026
|
+
customElements.get("mint-form") || customElements.define("mint-form", mt);
|
|
4989
5027
|
typeof window < "u" && (window.mintForm = window.mintForm || {
|
|
4990
5028
|
defaults: {
|
|
4991
5029
|
headers: {
|
|
@@ -5003,7 +5041,7 @@ typeof window < "u" && (window.mintForm = window.mintForm || {
|
|
|
5003
5041
|
rejected: t
|
|
5004
5042
|
}), window.mintForm.interceptors.response.handlers.length - 1;
|
|
5005
5043
|
}));
|
|
5006
|
-
class
|
|
5044
|
+
class gt extends HTMLElement {
|
|
5007
5045
|
constructor() {
|
|
5008
5046
|
super(...arguments), this._observer = null;
|
|
5009
5047
|
}
|
|
@@ -5214,8 +5252,8 @@ class nt extends HTMLElement {
|
|
|
5214
5252
|
`, document.head.appendChild(t);
|
|
5215
5253
|
}
|
|
5216
5254
|
}
|
|
5217
|
-
customElements.get("mint-table") || customElements.define("mint-table",
|
|
5218
|
-
class
|
|
5255
|
+
customElements.get("mint-table") || customElements.define("mint-table", gt);
|
|
5256
|
+
class _t extends HTMLElement {
|
|
5219
5257
|
constructor() {
|
|
5220
5258
|
super(...arguments), this._root = null, this._textWrap = null, this._dismissBtn = null, this._clickHandler = null;
|
|
5221
5259
|
}
|
|
@@ -5290,8 +5328,8 @@ class at extends HTMLElement {
|
|
|
5290
5328
|
}, t.addEventListener("click", this._clickHandler), this._dismissBtn = t;
|
|
5291
5329
|
}
|
|
5292
5330
|
}
|
|
5293
|
-
customElements.get("mint-chip") || customElements.define("mint-chip",
|
|
5294
|
-
class
|
|
5331
|
+
customElements.get("mint-chip") || customElements.define("mint-chip", _t);
|
|
5332
|
+
class bt extends HTMLElement {
|
|
5295
5333
|
constructor() {
|
|
5296
5334
|
super(...arguments), this._container = null, this._chipsWrap = null, this._input = null, this._tags = [], this._placeholder = "Add tag", this._dragIndex = null, this._dragChip = null, this._isPointerDragging = !1, this._pointerMoveHandler = null, this._pointerUpHandler = null;
|
|
5297
5335
|
}
|
|
@@ -5614,8 +5652,8 @@ class ot extends HTMLElement {
|
|
|
5614
5652
|
}
|
|
5615
5653
|
}
|
|
5616
5654
|
}
|
|
5617
|
-
customElements.get("mint-tags") || customElements.define("mint-tags",
|
|
5618
|
-
class
|
|
5655
|
+
customElements.get("mint-tags") || customElements.define("mint-tags", bt);
|
|
5656
|
+
class vt extends HTMLElement {
|
|
5619
5657
|
constructor() {
|
|
5620
5658
|
super(...arguments), this._clickHandler = null, this._keydownHandler = null;
|
|
5621
5659
|
}
|
|
@@ -5671,8 +5709,8 @@ class lt extends HTMLElement {
|
|
|
5671
5709
|
t === "disabled" && (i !== null ? (this.classList.remove("cursor-pointer"), this.classList.add("opacity-50", "cursor-not-allowed"), this.setAttribute("aria-disabled", "true")) : (this.classList.remove("opacity-50", "cursor-not-allowed"), this.classList.add("cursor-pointer"), this.removeAttribute("aria-disabled")));
|
|
5672
5710
|
}
|
|
5673
5711
|
}
|
|
5674
|
-
customElements.get("mint-clickable") || customElements.define("mint-clickable",
|
|
5675
|
-
class
|
|
5712
|
+
customElements.get("mint-clickable") || customElements.define("mint-clickable", vt);
|
|
5713
|
+
class yt extends HTMLElement {
|
|
5676
5714
|
constructor() {
|
|
5677
5715
|
super(), this._headingElement = null, this._iconElement = null, this._dismissButton = null, this._headerWrapper = null, this._bodyWrapper = null, this._dismissHandler = null;
|
|
5678
5716
|
}
|
|
@@ -5787,8 +5825,8 @@ class ct extends HTMLElement {
|
|
|
5787
5825
|
}), this.appendChild(this._headerWrapper), this.appendChild(this._bodyWrapper);
|
|
5788
5826
|
}
|
|
5789
5827
|
}
|
|
5790
|
-
customElements.get("mint-alert") || customElements.define("mint-alert",
|
|
5791
|
-
class
|
|
5828
|
+
customElements.get("mint-alert") || customElements.define("mint-alert", yt);
|
|
5829
|
+
class kt extends HTMLElement {
|
|
5792
5830
|
constructor() {
|
|
5793
5831
|
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._rowsToShow = 15, this._loaded = !1, this._fetching = !1, this._loading = !1, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumn = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1;
|
|
5794
5832
|
}
|
|
@@ -5892,20 +5930,20 @@ class ht extends HTMLElement {
|
|
|
5892
5930
|
const g = await fetch(`${n}?${m.toString()}`, _);
|
|
5893
5931
|
if (!g.ok)
|
|
5894
5932
|
throw new Error(`HTTP error! status: ${g.status}`);
|
|
5895
|
-
const b = await g.json(),
|
|
5933
|
+
const b = await g.json(), v = ((o = b.content) == null ? void 0 : o.rows) || [], x = ((l = b.content) == null ? void 0 : l.total) || 0;
|
|
5896
5934
|
if (this._configuration.loadMore && a !== 0)
|
|
5897
|
-
this._rows = this._rows.concat(
|
|
5935
|
+
this._rows = this._rows.concat(v);
|
|
5898
5936
|
else {
|
|
5899
|
-
let
|
|
5900
|
-
this._configuration.predefinedData ? (
|
|
5937
|
+
let E = v;
|
|
5938
|
+
this._configuration.predefinedData ? (E = [...this._configuration.predefinedData, ...v], this._totalRows = x + this._configuration.predefinedData.length) : this._totalRows = x, this._rows = E;
|
|
5901
5939
|
}
|
|
5902
|
-
const
|
|
5903
|
-
this._configuration.loadMore || (((c = b.content) == null ? void 0 : c.current_page) !== void 0 && b.content.current_page ===
|
|
5904
|
-
const
|
|
5905
|
-
if (
|
|
5906
|
-
if (
|
|
5907
|
-
const
|
|
5908
|
-
this._loading = !1, this._fetching = !1, this._updateTableBody(), this._loading =
|
|
5940
|
+
const S = Math.floor(a / r) + 1;
|
|
5941
|
+
this._configuration.loadMore || (((c = b.content) == null ? void 0 : c.current_page) !== void 0 && b.content.current_page === S ? this._currentPage = b.content.current_page : this._currentPage = S, this._offset = (this._currentPage - 1) * r), this._lastPage = ((d = b.content) == null ? void 0 : d.last_page) || 1, this._fetching = !1, this._loaded = !0, this._loading = !1, this._fetchError = null, this._searching = !1;
|
|
5942
|
+
const k = this._sorting;
|
|
5943
|
+
if (k && this._updateSortIcons(), this._sorting = !1, this._sortingColumn = null, k && this._updateSortIcons(), this.dispatchEvent(new CustomEvent("loaded", { detail: { rows: this._rows } })), this._updateSearchIcon(), (h = (u = this.querySelector(`#${this._tableId}`)) == null ? void 0 : u.closest("table")) == null ? void 0 : h.querySelector("tbody")) {
|
|
5944
|
+
if (k) {
|
|
5945
|
+
const E = this._loading, I = this._fetching;
|
|
5946
|
+
this._loading = !1, this._fetching = !1, this._updateTableBody(), this._loading = E, this._fetching = I;
|
|
5909
5947
|
} else
|
|
5910
5948
|
this._updateTableBody();
|
|
5911
5949
|
this._updatePagination();
|
|
@@ -6048,15 +6086,15 @@ class ht extends HTMLElement {
|
|
|
6048
6086
|
const m = `actions-popover-${this._tableId}-${c}`, _ = `actions-button-${this._tableId}-${c}`;
|
|
6049
6087
|
r += `<mint-button id="${_}" variant="link" icon="ellipsis">`, r += "</mint-button>", r += `<mint-popover id="${m}" trigger-id="${_}" direction="down">`, h.actions.forEach((g, b) => {
|
|
6050
6088
|
if (!g.show || g.show(this, l)) {
|
|
6051
|
-
const
|
|
6052
|
-
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700" data-action="row-action" data-row-index="${c}" data-action-index="${b}" data-column-key="${this._configuration.columns.indexOf(h)}">${
|
|
6089
|
+
const v = typeof g.label == "function" ? g.label(this, l) : g.label;
|
|
6090
|
+
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700" data-action="row-action" data-row-index="${c}" data-action-index="${b}" data-column-key="${this._configuration.columns.indexOf(h)}">${v}</div>`;
|
|
6053
6091
|
}
|
|
6054
6092
|
}), r += "</mint-popover>";
|
|
6055
6093
|
} else
|
|
6056
6094
|
h.actions.forEach((m, _) => {
|
|
6057
6095
|
if (!m.show || m.show(this, l)) {
|
|
6058
|
-
const g = m.label ? typeof m.label == "function" ? m.label(this, l) : m.label : "", b = m.icon ? ` icon="${this._escapeHtml(m.icon)}"` : "",
|
|
6059
|
-
r += `<mint-button variant="link" class="${m.classes || ""}" data-action="row-action" data-row-index="${c}" data-action-index="${_}" data-column-key="${this._configuration.columns.indexOf(h)}"${b}${
|
|
6096
|
+
const g = m.label ? typeof m.label == "function" ? m.label(this, l) : m.label : "", b = m.icon ? ` icon="${this._escapeHtml(m.icon)}"` : "", v = m.tone ? ` tone="${this._escapeHtml(m.tone)}"` : "";
|
|
6097
|
+
r += `<mint-button variant="link" class="${m.classes || ""}" data-action="row-action" data-row-index="${c}" data-action-index="${_}" data-column-key="${this._configuration.columns.indexOf(h)}"${b}${v}>`, g && (r += this._escapeHtml(String(g))), r += "</mint-button>";
|
|
6060
6098
|
}
|
|
6061
6099
|
});
|
|
6062
6100
|
else typeof h.format == "function" ? r += h.format(this, l) : h.data && (r += this._escapeHtml(String(l[h.data] || "")));
|
|
@@ -6070,15 +6108,15 @@ class ht extends HTMLElement {
|
|
|
6070
6108
|
const m = `actions-popover-${this._tableId}-${c}`, _ = `actions-button-${this._tableId}-${c}`;
|
|
6071
6109
|
r += `<mint-button id="${_}" variant="link" icon="ellipsis">`, r += "</mint-button>", r += `<mint-popover id="${m}" trigger-id="${_}" direction="down">`, h.actions.forEach((g, b) => {
|
|
6072
6110
|
if (!g.show || g.show(this, l)) {
|
|
6073
|
-
const
|
|
6074
|
-
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700" data-action="row-action" data-row-index="${c}" data-action-index="${b}" data-column-key="${this._configuration.columns.indexOf(h)}">${
|
|
6111
|
+
const v = typeof g.label == "function" ? g.label(this, l) : g.label;
|
|
6112
|
+
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700" data-action="row-action" data-row-index="${c}" data-action-index="${b}" data-column-key="${this._configuration.columns.indexOf(h)}">${v}</div>`;
|
|
6075
6113
|
}
|
|
6076
6114
|
}), r += "</mint-popover>";
|
|
6077
6115
|
} else
|
|
6078
6116
|
h.actions.forEach((m, _) => {
|
|
6079
6117
|
if (!m.show || m.show(this, l)) {
|
|
6080
|
-
const g = m.label ? typeof m.label == "function" ? m.label(this, l) : m.label : "", b = m.icon ? ` icon="${this._escapeHtml(m.icon)}"` : "",
|
|
6081
|
-
r += `<mint-button variant="link" class="${m.classes || ""}" data-action="row-action" data-row-index="${c}" data-action-index="${_}" data-column-key="${this._configuration.columns.indexOf(h)}"${b}${
|
|
6118
|
+
const g = m.label ? typeof m.label == "function" ? m.label(this, l) : m.label : "", b = m.icon ? ` icon="${this._escapeHtml(m.icon)}"` : "", v = m.tone ? ` tone="${this._escapeHtml(m.tone)}"` : "";
|
|
6119
|
+
r += `<mint-button variant="link" class="${m.classes || ""}" data-action="row-action" data-row-index="${c}" data-action-index="${_}" data-column-key="${this._configuration.columns.indexOf(h)}"${b}${v}>`, g && (r += this._escapeHtml(String(g))), r += "</mint-button>";
|
|
6082
6120
|
}
|
|
6083
6121
|
});
|
|
6084
6122
|
else typeof h.format == "function" ? r += this._escapeHtml(h.format(this, l)) : h.data && (r += this._escapeHtml(String(l[h.data] || "")));
|
|
@@ -6423,33 +6461,33 @@ class ht extends HTMLElement {
|
|
|
6423
6461
|
return e.textContent = t, e.innerHTML;
|
|
6424
6462
|
}
|
|
6425
6463
|
}
|
|
6426
|
-
customElements.get("mint-resource-table") || customElements.define("mint-resource-table",
|
|
6464
|
+
customElements.get("mint-resource-table") || customElements.define("mint-resource-table", kt);
|
|
6427
6465
|
export {
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6466
|
+
yt as Alert,
|
|
6467
|
+
st as BackButton,
|
|
6468
|
+
Y as Button,
|
|
6469
|
+
et as Card,
|
|
6470
|
+
lt as Checkbox,
|
|
6471
|
+
_t as Chip,
|
|
6472
|
+
ht as Choice,
|
|
6473
|
+
vt as Clickable,
|
|
6474
|
+
ut as DatePicker,
|
|
6475
|
+
ft as Dropzone,
|
|
6476
|
+
mt as Form,
|
|
6477
|
+
nt as Grid,
|
|
6478
|
+
X as Icon,
|
|
6479
|
+
dt as Input,
|
|
6480
|
+
it as Link,
|
|
6481
|
+
at as Modal,
|
|
6482
|
+
rt as Page,
|
|
6483
|
+
ot as Popover,
|
|
6484
|
+
kt as ResourceTable,
|
|
6485
|
+
pt as Select,
|
|
6486
|
+
K as Spinner,
|
|
6487
|
+
tt as Stack,
|
|
6488
|
+
Z as Switch,
|
|
6489
|
+
gt as Table,
|
|
6490
|
+
bt as Tags,
|
|
6491
|
+
Q as Text,
|
|
6492
|
+
Y as default
|
|
6455
6493
|
};
|