monobill-mintui 0.6.723 → 0.6.725
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/choice.css +1 -1
- package/dist/components/choice/ChoiceOption.d.ts.map +1 -1
- package/dist/components/form/Form.d.ts +1 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/browser.js +34 -14
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +34 -14
- package/dist/components/resource-table/ResourceTable.d.ts +7 -3
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +68 -38
- package/dist/components/resource-table/index.cjs +2 -2
- package/dist/components/resource-table/index.d.ts +1 -0
- package/dist/components/resource-table/index.d.ts.map +1 -1
- package/dist/components/resource-table/index.js +68 -38
- package/dist/components/resource-table/utility-aliases.d.ts +7 -10
- package/dist/components/resource-table/utility-aliases.d.ts.map +1 -1
- package/dist/components/side-navigation/SideNavigationLink.d.ts.map +1 -1
- package/dist/components/side-navigation/browser.js +2 -2
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +2 -2
- package/dist/form.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +3 -3
- package/dist/index.js +105 -55
- package/dist/resource-table.css +1 -1
- package/package.json +1 -1
|
@@ -125,19 +125,18 @@ var n = {
|
|
|
125
125
|
"justify-end": "rtu-77c08e015",
|
|
126
126
|
"leading-snug": "rtu-e25ca6535",
|
|
127
127
|
"left-3": "rtu-22e59b722",
|
|
128
|
+
"lg:block": "rtu-d0ce7c24d",
|
|
129
|
+
"lg:border-t-0": "rtu-7d283214b",
|
|
130
|
+
"lg:hidden": "rtu-a327049ca",
|
|
131
|
+
"lg:justify-end": "rtu-64b07e15f",
|
|
132
|
+
"lg:mt-4": "rtu-010a34347",
|
|
133
|
+
"lg:pt-0": "rtu-0cd43c7f4",
|
|
134
|
+
"lg:py-0": "rtu-0df6beb59",
|
|
128
135
|
"list-none": "rtu-b20d79b23",
|
|
129
|
-
"m-0": "rtu-74f9876a6",
|
|
130
136
|
"max-w-[95%]": "rtu-80fa57ccf",
|
|
131
137
|
"max-w-none": "rtu-2191c1456",
|
|
132
138
|
"max-w-xs": "rtu-3acf64d53",
|
|
133
139
|
"mb-3": "rtu-1bb883263",
|
|
134
|
-
"md:block": "rtu-9d60be3a6",
|
|
135
|
-
"md:border-t-0": "rtu-f6099fc6b",
|
|
136
|
-
"md:hidden": "rtu-e477a6af4",
|
|
137
|
-
"md:justify-end": "rtu-70ce0294b",
|
|
138
|
-
"md:mt-4": "rtu-ef9aeb563",
|
|
139
|
-
"md:pt-0": "rtu-30dec114f",
|
|
140
|
-
"md:py-0": "rtu-3957f1b8e",
|
|
141
140
|
"min-h-0": "rtu-fb7302e53",
|
|
142
141
|
"min-w-0": "rtu-7e0b7cdf1",
|
|
143
142
|
"min-w-[11rem]": "rtu-46b2fd2eb",
|
|
@@ -145,7 +144,6 @@ var n = {
|
|
|
145
144
|
"mx-auto": "rtu-0e12dc7de",
|
|
146
145
|
"overflow-hidden": "rtu-2cd02d11d",
|
|
147
146
|
"overflow-x-auto": "rtu-1384f66f4",
|
|
148
|
-
"overflow-x-hidden": "rtu-e271e6ae1",
|
|
149
147
|
"overflow-y-auto": "rtu-92bf82f49",
|
|
150
148
|
"overflow-y-hidden": "rtu-b70fd23f6",
|
|
151
149
|
"overscroll-x-contain": "rtu-63ccdaaca",
|
|
@@ -165,7 +163,6 @@ var n = {
|
|
|
165
163
|
"py-0.5": "rtu-465609a24",
|
|
166
164
|
"py-2": "rtu-03b4dd7f1",
|
|
167
165
|
"py-3": "rtu-1b2d54a3f",
|
|
168
|
-
"py-3.5": "rtu-69e76918f",
|
|
169
166
|
"py-8": "rtu-a1f611f02",
|
|
170
167
|
rounded: "rtu-07389a777",
|
|
171
168
|
"rounded-full": "rtu-ac204c108",
|
|
@@ -214,7 +211,7 @@ var n = {
|
|
|
214
211
|
return e !== null && e !== "false";
|
|
215
212
|
}
|
|
216
213
|
constructor() {
|
|
217
|
-
super(), this._configuration = null, this._rows = [], this._selectedRowIds = /* @__PURE__ */ new Set(), this._selectedRowCache = /* @__PURE__ */ new Map(), this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._boundMobileListViewportListener = null, this._initialMobileLayoutRaf = null, this._initialMobileLayoutTimer = null, this._mobileLayoutResizeObserver = null, this._lastMobileViewportObservedWidth = null, this._lastRenderedMobileLayout = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
214
|
+
super(), this._configuration = null, this._rows = [], this._selectedRowIds = /* @__PURE__ */ new Set(), this._selectedRowCache = /* @__PURE__ */ new Map(), this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._boundMobileListViewportListener = null, this._initialMobileLayoutRaf = null, this._initialMobileLayoutTimer = null, this._mobileLayoutResizeObserver = null, this._lastMobileViewportObservedWidth = null, this._lastRenderedMobileLayout = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null, this._mobileCardLongPressTimer = null, this._suppressMobileCardClick = !1;
|
|
218
215
|
}
|
|
219
216
|
get inMintCard() {
|
|
220
217
|
return this._inMintCard;
|
|
@@ -285,6 +282,9 @@ var n = {
|
|
|
285
282
|
}), this.querySelectorAll("tbody tr[data-row-index]").forEach((e) => {
|
|
286
283
|
let t = this._getRowDataForEventIndex(Number(e.dataset.rowIndex)), n = t ? this._rowSelectionId(t) : null;
|
|
287
284
|
e.classList.toggle("mint-rt-row-selected", n !== null && this._selectedRowIds.has(n));
|
|
285
|
+
}), this.querySelectorAll("li.mint-resource-table-mobile-row[data-row-index]").forEach((e) => {
|
|
286
|
+
let t = this._getRowDataForEventIndex(Number(e.dataset.rowIndex)), n = t ? this._rowSelectionId(t) : null;
|
|
287
|
+
e.classList.toggle("is-selected", n !== null && this._selectedRowIds.has(n));
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
get configuration() {
|
|
@@ -294,7 +294,7 @@ var n = {
|
|
|
294
294
|
e && typeof e == "object" && !Array.isArray(e) ? (this._configuration = e, this._tableId = this._configuration.id || this._tableId || `mint-resource-table-${Date.now()}`, this._perPage = this._configuration.perPage || 15, this._type = typeof this._configuration.data == "string" ? "ajax" : "provided", this._loaded = !1, this._currentPage = 1, this._offset = 0, this._loadPageFromUrl(), this._loadSearchFromUrl(), this._type === "provided" && Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._configuration.data.length, this._rememberSelectedRows(this._rows)), this._initializeColumns(), this.isConnected && this.render()) : e == null ? this._configuration = null : this._parseConfiguration();
|
|
295
295
|
}
|
|
296
296
|
connectedCallback() {
|
|
297
|
-
this.classList.add("box-border", "
|
|
297
|
+
this.classList.add("box-border", "p-0", "border-0", "align-baseline", "block", "w-full"), this._utilityClassObserver = new MutationObserver(() => this._replaceUtilityClasses()), this._utilityClassObserver.observe(this, {
|
|
298
298
|
attributes: !0,
|
|
299
299
|
attributeFilter: ["class"],
|
|
300
300
|
childList: !0,
|
|
@@ -547,7 +547,7 @@ var n = {
|
|
|
547
547
|
return this._configuration ? Math.max(1, this._configuration.columns.filter((e) => !e.hidden).length) : 1;
|
|
548
548
|
}
|
|
549
549
|
_ensureMobileListMql() {
|
|
550
|
-
typeof window > "u" || !window.matchMedia || (this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width:
|
|
550
|
+
typeof window > "u" || !window.matchMedia || (this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width: 1023px)"), this._boundMobileListMqlListener = () => {
|
|
551
551
|
this._configuration && this.isConnected && this.render();
|
|
552
552
|
}, this._mobileListMql.addEventListener("change", this._boundMobileListMqlListener)), this._boundMobileListViewportListener || (this._boundMobileListViewportListener = () => {
|
|
553
553
|
let e = this._lastRenderedMobileLayout;
|
|
@@ -564,7 +564,7 @@ var n = {
|
|
|
564
564
|
this._mobileListMql && this._boundMobileListMqlListener && this._mobileListMql.removeEventListener("change", this._boundMobileListMqlListener), this._mobileListMql = null, this._boundMobileListMqlListener = null, this._mobileLayoutResizeObserver?.disconnect(), this._mobileLayoutResizeObserver = null, this._lastMobileViewportObservedWidth = null, this._boundMobileListViewportListener && typeof window < "u" && (window.removeEventListener("resize", this._boundMobileListViewportListener), window.removeEventListener("orientationchange", this._boundMobileListViewportListener), window.visualViewport?.removeEventListener("resize", this._boundMobileListViewportListener)), this._boundMobileListViewportListener = null;
|
|
565
565
|
}
|
|
566
566
|
_useMobileListLayout() {
|
|
567
|
-
return typeof window > "u" ? !1 : (this._mobileListMql?.matches ?? (typeof window.matchMedia == "function" && window.matchMedia("(max-width:
|
|
567
|
+
return typeof window > "u" ? !1 : (this._mobileListMql?.matches ?? (typeof window.matchMedia == "function" && window.matchMedia("(max-width: 1023px)").matches)) || window.innerWidth <= 1023 || (window.visualViewport?.width ?? Infinity) <= 1023 ? !0 : (document.documentElement?.clientWidth ?? Infinity) <= 1023;
|
|
568
568
|
}
|
|
569
569
|
_scheduleInitialMobileLayoutSync(e) {
|
|
570
570
|
this._initialMobileLayoutRaf !== null || this._initialMobileLayoutTimer !== null || typeof window.requestAnimationFrame != "function" || (this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
|
|
@@ -582,8 +582,8 @@ var n = {
|
|
|
582
582
|
let t = [
|
|
583
583
|
"mint-rt-pagination-host",
|
|
584
584
|
"w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain",
|
|
585
|
-
"flex justify-center [-webkit-overflow-scrolling:touch]
|
|
586
|
-
this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider
|
|
585
|
+
"flex justify-center [-webkit-overflow-scrolling:touch] lg:justify-end",
|
|
586
|
+
this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider lg:border-t-0 lg:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider lg:border-t-0 lg:py-0 lg:mt-4"
|
|
587
587
|
].join(" ");
|
|
588
588
|
return `<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`;
|
|
589
589
|
}
|
|
@@ -684,7 +684,7 @@ var n = {
|
|
|
684
684
|
}
|
|
685
685
|
_buildMobileSortToolbarHtml() {
|
|
686
686
|
if (!this._hasSortableColumns()) return "";
|
|
687
|
-
let e = `mint-rt-mobile-sort-btn-${this._tableId}`, t = `mint-rt-mobile-sort-popover-${this._tableId}`, n = this._sorting ? " loading=\"true\"" : "", r = ` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`, i = "<div class=\"flex shrink-0 items-center
|
|
687
|
+
let e = `mint-rt-mobile-sort-btn-${this._tableId}`, t = `mint-rt-mobile-sort-popover-${this._tableId}`, n = this._sorting ? " loading=\"true\"" : "", r = ` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`, i = "<div class=\"flex shrink-0 items-center lg:hidden\">";
|
|
688
688
|
return i += `<mint-button id="${e}" data-mint-rt-toolbar="mobile-sort" variant="solid" tone="neutral" size="sm"${n}${r}></mint-button>`, i += `<mint-popover id="${t}" trigger-id="${e}" direction="down" padding="0">`, i += this._buildMobileSortPopoverInnerHtml(), i += "</mint-popover></div>", i;
|
|
689
689
|
}
|
|
690
690
|
_stripHtml(e) {
|
|
@@ -776,7 +776,12 @@ var n = {
|
|
|
776
776
|
}
|
|
777
777
|
_buildMobileListItemHtml(e, t, n = !1) {
|
|
778
778
|
if (!this._configuration) return "";
|
|
779
|
-
let r = t, i = typeof this._configuration.onRowClick == "function"
|
|
779
|
+
let r = t, i = typeof this._configuration.onRowClick == "function";
|
|
780
|
+
if (typeof this._configuration.mobileCard == "function") {
|
|
781
|
+
let t = this._rowSelectionId(e), n = t !== null && this._selectedRowIds.has(t), a = this._configuration.mobileCard(this, e, r);
|
|
782
|
+
return `<li data-row-index="${r}"${i ? " data-row-clickable=\"true\"" : ""} class="mint-resource-table-mobile-row mint-resource-table-mobile-card mint-resource-table-mobile-card-custom${n ? " is-selected" : ""}">${a}</li>`;
|
|
783
|
+
}
|
|
784
|
+
let a = this._mobileThumbnailColumn(), o = this._mobilePrimaryColumn(), s = this._mobileActionsDropdownColumn(), c = a ? this._buildTableCellInnerHtml(a, e, r, "mobile") : "", l = o ? this._buildTableCellInnerHtml(o, e, r, "mobile") : "", u = s ? this._buildTableCellInnerHtml(s, e, r, "mobile") : "", d = [], f = this._configuration.mobileShowLabels === !0;
|
|
780
785
|
for (let t of this._configuration.columns) {
|
|
781
786
|
if (t.hidden || a && t === a || o && t === o || s && t === s) continue;
|
|
782
787
|
let n = this._columnPlainSummaryText(t, e);
|
|
@@ -788,11 +793,6 @@ var n = {
|
|
|
788
793
|
let p = d.join("<span class=\"text-gray-300 dark:text-gray-600\" aria-hidden=\"true\"> · </span>"), m = [
|
|
789
794
|
"list-none",
|
|
790
795
|
"mint-resource-table-mobile-row",
|
|
791
|
-
...n ? [] : [
|
|
792
|
-
"border-b",
|
|
793
|
-
"border-gray-200",
|
|
794
|
-
"dark:border-mint-divider"
|
|
795
|
-
],
|
|
796
796
|
i ? "cursor-pointer" : ""
|
|
797
797
|
].filter(Boolean).join(" "), h = `<div class="flex items-center gap-3 py-3 pr-4${a ? " pl-0" : " pl-4"}">`, g = this._rowSelectionId(e);
|
|
798
798
|
if (g !== null && (h += `<div class="mint-rt-mobile-selection">${this._selectionControlHtml(g)}</div>`), a) {
|
|
@@ -905,12 +905,12 @@ var n = {
|
|
|
905
905
|
this._virtualLastRangeStart = d, this._virtualLastRangeEnd = f, this._virtualLastRangeCacheSig = p;
|
|
906
906
|
let m = d * a, h = Math.max(0, (i - f) * a), g = "";
|
|
907
907
|
if (e) {
|
|
908
|
-
g += `<li aria-hidden="true" class="pointer-events-none
|
|
908
|
+
g += `<li aria-hidden="true" class="pointer-events-none block list-none border-0 p-0" style="height:${m}px"></li>`;
|
|
909
909
|
for (let e = d; e < f; e++) {
|
|
910
910
|
let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
|
|
911
911
|
t ? g += this._buildMobileListItemHtml(t, e, n) : g += this._buildMobileListPlaceholderLi(e, a, n);
|
|
912
912
|
}
|
|
913
|
-
g += `<li aria-hidden="true" class="pointer-events-none
|
|
913
|
+
g += `<li aria-hidden="true" class="pointer-events-none block list-none border-0 p-0" style="height:${h}px"></li>`;
|
|
914
914
|
} else {
|
|
915
915
|
g += `<tr data-mint-rt-spacer="top" aria-hidden="true"><td colspan="${o}" style="height:${m}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;
|
|
916
916
|
for (let e = d; e < f; e++) {
|
|
@@ -1135,7 +1135,7 @@ var n = {
|
|
|
1135
1135
|
this.render();
|
|
1136
1136
|
return;
|
|
1137
1137
|
}
|
|
1138
|
-
n = document.createElement("div"), n.id = `mint-rt-pagination-host-${this._tableId}`, n.setAttribute("data-mint-rt-pagination-wrap", ""), n.className = "mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch]
|
|
1138
|
+
n = document.createElement("div"), n.id = `mint-rt-pagination-host-${this._tableId}`, n.setAttribute("data-mint-rt-pagination-wrap", ""), n.className = "mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch] lg:justify-end " + (this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider lg:border-t-0 lg:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider lg:border-t-0 lg:py-0 lg:mt-4"), e.insertAdjacentElement("afterend", n);
|
|
1139
1139
|
}
|
|
1140
1140
|
let r = this._buildPaginationNavMarkup(e);
|
|
1141
1141
|
n.innerHTML = r, setTimeout(() => {
|
|
@@ -1282,7 +1282,7 @@ var n = {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
if ((this._type === "ajax" && !this._loaded || this._type === "provided" && i) && !this._fetchError && !this._sorting) {
|
|
1284
1284
|
let e = this._fixedHeader() ? " data-mint-rt-scroll-inner=\"\"" : "", t = this._fixedHeader() && this._fixedControls(), n = this._fixedHeader() ? t ? "sticky top-[var(--mint-rt-fixed-controls-h,0px)] z-30 " : "sticky top-0 z-30 " : "sticky top-0 z-10 ";
|
|
1285
|
-
a += "<div class=\"min-w-0\">", a += "<mint-table class=\"table-section" + (this._inMintCard ? " rounded-t-none" : "") + "\"" + e + ">", a += `<table id="${this._tableId}">`, a += "<thead class=\"" + n + "bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider\"><tr>", a += this._renderSelectionHeader(), this._configuration.columns.forEach((e, t) => {
|
|
1285
|
+
a += "<div class=\"mint-resource-table-desktop min-h-0 min-w-0\">", a += "<mint-table class=\"table-section" + (this._inMintCard ? " rounded-t-none" : "") + "\"" + e + ">", a += `<table id="${this._tableId}">`, a += "<thead class=\"" + n + "bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider\"><tr>", a += this._renderSelectionHeader(), this._configuration.columns.forEach((e, t) => {
|
|
1286
1286
|
if (e.hidden) return;
|
|
1287
1287
|
let n = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
|
|
1288
1288
|
if (a += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`, e.showLabel !== !1) {
|
|
@@ -1303,15 +1303,17 @@ var n = {
|
|
|
1303
1303
|
a += "</td>";
|
|
1304
1304
|
}
|
|
1305
1305
|
}), a += "</tr>";
|
|
1306
|
-
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += this.
|
|
1306
|
+
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += `<ul class="mint-resource-table-mobile-list min-h-0 w-full list-none" data-mint-rt-mobile-list="${this._tableId}" aria-hidden="true">`;
|
|
1307
|
+
for (let e = 0; e < 6; e++) a += "<li class=\"mint-resource-table-mobile-row mint-resource-table-mobile-skeleton-card\"><span></span><span></span><span></span></li>";
|
|
1308
|
+
a += "</ul>", a += this._paginationHostPlaceholderHtml();
|
|
1307
1309
|
} else {
|
|
1308
|
-
let e = this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax" && this._loaded && !this._fetchError), t = e && this._virtualScrollRoot() === "table-body", n = this._escapeHtml(this._virtualMaxHeightCss()), o = t || this._fixedHeader(), s = this._fixedHeader() && this._fixedControls(), c = o ? " data-mint-rt-scroll-inner=\"\"" : "", l = "table-section" + (this._inMintCard ? " rounded-t-none" : ""), u =
|
|
1310
|
+
let e = this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax" && this._loaded && !this._fetchError), t = e && this._virtualScrollRoot() === "table-body", n = this._escapeHtml(this._virtualMaxHeightCss()), o = t || this._fixedHeader(), s = this._fixedHeader() && this._fixedControls(), c = o ? " data-mint-rt-scroll-inner=\"\"" : "", l = "table-section" + (this._inMintCard ? " rounded-t-none" : ""), u = "";
|
|
1309
1311
|
if (t) {
|
|
1310
1312
|
let e = this._renderColgroupHtml();
|
|
1311
1313
|
a += `<div id="mint-rt-vscroll-${this._tableId}" class="overflow-y-auto overflow-x-auto min-h-0 w-full" style="max-height: ${n}; scrollbar-gutter: stable; overscroll-behavior-x: contain; overscroll-behavior-y: none; overflow-anchor: none;">`, a += "<div class=\"mint-resource-table-desktop min-h-0 min-w-0\">", a += `<mint-table class="${l}"${c}>`, a += `<table id="${this._tableId}" class="w-full min-w-0 table-fixed">`, a += e, a += this._renderTheadHtml(!0, !0, !0, s);
|
|
1312
1314
|
} else a += "<div class=\"mint-resource-table-desktop min-h-0 min-w-0\">", a += `<mint-table class="${l}"${c}>`, a += `<table id="${this._tableId}">`, e && (a += this._renderColgroupHtml()), a += this._renderTheadHtml(!0, !0, !!e, s);
|
|
1313
1315
|
if (a += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !i && !e && r.forEach((e, t) => {
|
|
1314
|
-
|
|
1316
|
+
u += this._buildMobileListItemHtml(e, t, t === r.length - 1);
|
|
1315
1317
|
let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
|
|
1316
1318
|
a += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, a += this._renderSelectionCell(e), this._configuration.columns.forEach((n) => {
|
|
1317
1319
|
if (n.hidden) return;
|
|
@@ -1320,12 +1322,12 @@ var n = {
|
|
|
1320
1322
|
}), a += "</tr>";
|
|
1321
1323
|
}), !this._fetching && !this._loading && !i && r.length === 0) if (this._fetchError) {
|
|
1322
1324
|
let e = this._configuration.columns.filter((e) => !e.hidden).length + (this._configuration.rowSelection ? 1 : 0);
|
|
1323
|
-
a += `<tr><td colspan="${e}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`,
|
|
1325
|
+
a += `<tr><td colspan="${e}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`, u += `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`;
|
|
1324
1326
|
} else {
|
|
1325
1327
|
let e = this._configuration.columns.filter((e) => !e.hidden).length + (this._configuration.rowSelection ? 1 : 0);
|
|
1326
|
-
a += `<tr><td colspan="${e}" class="text-center py-8">No data available.</td></tr>`,
|
|
1328
|
+
a += `<tr><td colspan="${e}" class="text-center py-8">No data available.</td></tr>`, u += "<li class=\"list-none px-4 py-8 text-center text-sm\">No data available.</li>";
|
|
1327
1329
|
}
|
|
1328
|
-
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += `<ul class="
|
|
1330
|
+
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += `<ul class="mint-resource-table-mobile-list min-h-0 w-full list-none border-collapse" data-mint-rt-mobile-list="${this._tableId}">${e && r.length > 0 ? "" : u}</ul>`, e || (a += this._paginationHostPlaceholderHtml()), t && (a += "</div>");
|
|
1329
1331
|
}
|
|
1330
1332
|
this._fixedHeader() ? this.setAttribute("data-mint-rt-fixed-header", "") : this.removeAttribute("data-mint-rt-fixed-header"), this._fixedControls() ? this.setAttribute("data-mint-rt-fixed-controls", "") : this.removeAttribute("data-mint-rt-fixed-controls"), this.innerHTML = a, this._replaceUtilityClasses(), this._updatePagination(), this.querySelectorAll("mint-button[data-action]").forEach((e) => {
|
|
1331
1333
|
e.render && e.render();
|
|
@@ -1339,15 +1341,43 @@ var n = {
|
|
|
1339
1341
|
this._rowClickHandler && this.removeEventListener("click", this._rowClickHandler, !0);
|
|
1340
1342
|
let e = (e) => {
|
|
1341
1343
|
let t = e.target;
|
|
1344
|
+
if (this._suppressMobileCardClick) {
|
|
1345
|
+
this._suppressMobileCardClick = !1, e.preventDefault(), e.stopImmediatePropagation();
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
let n = t.closest("li.mint-resource-table-mobile-row[data-row-index]");
|
|
1349
|
+
if (n && this._configuration?.rowSelection && this._selectedRowIds.size > 0 && !t.closest("mint-button, button, mint-popover, [data-action], [data-mint-rt-selection]")) {
|
|
1350
|
+
let t = this._getRowDataForEventIndex(Number(n.dataset.rowIndex)), r = t ? this._rowSelectionId(t) : null;
|
|
1351
|
+
if (r !== null) {
|
|
1352
|
+
e.preventDefault(), e.stopPropagation(), this.toggleRowSelection(r);
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1342
1356
|
if (t.tagName === "MINT-BUTTON" || t.tagName === "BUTTON" || t.closest("mint-button") || t.closest("button") || t.closest("mint-popover") || t.closest("[data-action]") || t.closest("[data-mint-rt-selection]")) return;
|
|
1343
|
-
let
|
|
1344
|
-
if (!n) return;
|
|
1345
|
-
let r = n.getAttribute("data-row-index");
|
|
1357
|
+
let r = t.closest("tr[data-row-clickable=\"true\"]") || t.closest("li[data-row-clickable=\"true\"]");
|
|
1346
1358
|
if (!r) return;
|
|
1347
|
-
let i =
|
|
1348
|
-
|
|
1359
|
+
let i = r.getAttribute("data-row-index");
|
|
1360
|
+
if (!i) return;
|
|
1361
|
+
let a = parseInt(i), o = this._getRowDataForEventIndex(a);
|
|
1362
|
+
!o || !this._configuration?.onRowClick || (this._configuration.onRowClick.length === 1 ? this._configuration.onRowClick(o) : this._configuration.onRowClick(this, o));
|
|
1349
1363
|
};
|
|
1350
1364
|
this.addEventListener("click", e, !0), this._rowClickHandler = e;
|
|
1365
|
+
let t = () => {
|
|
1366
|
+
this._mobileCardLongPressTimer !== null && window.clearTimeout(this._mobileCardLongPressTimer), this._mobileCardLongPressTimer = null;
|
|
1367
|
+
}, n = (e) => {
|
|
1368
|
+
if (!this._configuration?.rowSelection || !this._useMobileListLayout()) return;
|
|
1369
|
+
let n = e;
|
|
1370
|
+
if (n.button !== void 0 && n.button !== 0) return;
|
|
1371
|
+
let r = e.target;
|
|
1372
|
+
if (r.closest("mint-button, button, mint-popover, input, [data-action], [data-mint-rt-selection]")) return;
|
|
1373
|
+
let i = r.closest("li.mint-resource-table-mobile-row[data-row-index]");
|
|
1374
|
+
i && (t(), this._mobileCardLongPressTimer = window.setTimeout(() => {
|
|
1375
|
+
this._mobileCardLongPressTimer = null;
|
|
1376
|
+
let e = this._getRowDataForEventIndex(Number(i.dataset.rowIndex)), t = e ? this._rowSelectionId(e) : null;
|
|
1377
|
+
t !== null && (this._suppressMobileCardClick = !0, this.toggleRowSelection(t));
|
|
1378
|
+
}, 500));
|
|
1379
|
+
}, r = () => t(), i = this._mobileCardPointerDown, a = this._mobileCardPointerEnd;
|
|
1380
|
+
i && this.removeEventListener("pointerdown", i), a && (this.removeEventListener("pointerup", a), this.removeEventListener("pointercancel", a), this.removeEventListener("pointerleave", a)), this.addEventListener("pointerdown", n), this.addEventListener("pointerup", r), this.addEventListener("pointercancel", r), this.addEventListener("pointerleave", r), this._mobileCardPointerDown = n, this._mobileCardPointerEnd = r;
|
|
1351
1381
|
}
|
|
1352
1382
|
_attachPaginationListeners() {
|
|
1353
1383
|
this.querySelectorAll("[data-action=\"page\"]").forEach((e) => {
|