monobill-mintui 0.6.705 → 0.6.707
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/form/Form.d.ts.map +1 -1
- package/dist/components/form/browser.js +25 -8
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +25 -8
- package/dist/components/resource-table/ResourceTable.d.ts +2 -0
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +50 -43
- package/dist/components/resource-table/index.cjs +2 -2
- package/dist/components/resource-table/index.js +50 -43
- package/dist/index.cjs +2 -2
- package/dist/index.js +75 -51
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9066,8 +9066,9 @@ var Vn = class extends HTMLElement {
|
|
|
9066
9066
|
o ? (this._errors[e] = o, this._flagFieldError(i, o)) : (this._clearFieldError(i), delete this._errors[e]);
|
|
9067
9067
|
}
|
|
9068
9068
|
_validateRules(e, t) {
|
|
9069
|
-
|
|
9070
|
-
|
|
9069
|
+
let n = t.some((e) => e.split(":")[0].trim() === "number");
|
|
9070
|
+
for (let r of t) {
|
|
9071
|
+
let [t, i] = r.split(":");
|
|
9071
9072
|
switch (t) {
|
|
9072
9073
|
case "required":
|
|
9073
9074
|
if (e == null || e === !1 || typeof e == "string" && e.trim() === "" || e instanceof FileList && e.length === 0 || Array.isArray(e) && e.length === 0) return "This field is required.";
|
|
@@ -9084,21 +9085,37 @@ var Vn = class extends HTMLElement {
|
|
|
9084
9085
|
break;
|
|
9085
9086
|
}
|
|
9086
9087
|
case "min": {
|
|
9087
|
-
let t = Number(
|
|
9088
|
+
let t = Number(i);
|
|
9088
9089
|
if (Number.isNaN(t)) break;
|
|
9089
|
-
if (typeof e == "string" &&
|
|
9090
|
+
if (typeof e == "string" && !n) {
|
|
9091
|
+
if (e.trim().length < t) return `Must be at least ${t} characters.`;
|
|
9092
|
+
break;
|
|
9093
|
+
}
|
|
9094
|
+
if (typeof e == "string" && n) {
|
|
9095
|
+
let n = Number(e);
|
|
9096
|
+
if (!Number.isNaN(n) && n < t) return `Must be at least ${t}.`;
|
|
9097
|
+
break;
|
|
9098
|
+
}
|
|
9090
9099
|
if (Array.isArray(e) && e.length < t) return `Select at least ${t}.`;
|
|
9091
9100
|
if (e instanceof FileList && e.length < t) return `Upload at least ${t} files.`;
|
|
9092
|
-
if (e
|
|
9101
|
+
if (typeof e == "number" && e < t) return `Must be at least ${t}.`;
|
|
9093
9102
|
break;
|
|
9094
9103
|
}
|
|
9095
9104
|
case "max": {
|
|
9096
|
-
let t = Number(
|
|
9105
|
+
let t = Number(i);
|
|
9097
9106
|
if (Number.isNaN(t)) break;
|
|
9098
|
-
if (typeof e == "string" &&
|
|
9107
|
+
if (typeof e == "string" && !n) {
|
|
9108
|
+
if (e.trim().length > t) return `Must be at most ${t} characters.`;
|
|
9109
|
+
break;
|
|
9110
|
+
}
|
|
9111
|
+
if (typeof e == "string" && n) {
|
|
9112
|
+
let n = Number(e);
|
|
9113
|
+
if (!Number.isNaN(n) && n > t) return `Must be at most ${t}.`;
|
|
9114
|
+
break;
|
|
9115
|
+
}
|
|
9099
9116
|
if (Array.isArray(e) && e.length > t) return `Select no more than ${t}.`;
|
|
9100
9117
|
if (e instanceof FileList && e.length > t) return `Upload no more than ${t} files.`;
|
|
9101
|
-
if (e
|
|
9118
|
+
if (typeof e == "number" && e > t) return `Must be at most ${t}.`;
|
|
9102
9119
|
break;
|
|
9103
9120
|
}
|
|
9104
9121
|
default: break;
|
|
@@ -10083,7 +10100,7 @@ var Gn = class extends HTMLElement {
|
|
|
10083
10100
|
return e !== null && e !== "false";
|
|
10084
10101
|
}
|
|
10085
10102
|
constructor() {
|
|
10086
|
-
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
10103
|
+
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumnData = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._disposeVirtualBodyFade = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._initialMobileLayoutRaf = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
10087
10104
|
}
|
|
10088
10105
|
get inMintCard() {
|
|
10089
10106
|
return this._inMintCard;
|
|
@@ -10103,7 +10120,7 @@ var Gn = class extends HTMLElement {
|
|
|
10103
10120
|
}), this._inMintCard = this.closest("mint-card") !== null, this._configuration || this._parseConfiguration(), this._initializeColumns(), this._loadPageFromUrl(), this._attachRowClickHandler(), this.render();
|
|
10104
10121
|
}
|
|
10105
10122
|
disconnectedCallback() {
|
|
10106
|
-
this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._detachMobileListMql(), this._utilityClassObserver?.disconnect(), this._utilityClassObserver = null, this._rowClickHandler &&= (this.removeEventListener("click", this._rowClickHandler, !0), null), this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
|
|
10123
|
+
this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._detachMobileListMql(), this._initialMobileLayoutRaf !== null && (window.cancelAnimationFrame(this._initialMobileLayoutRaf), this._initialMobileLayoutRaf = null), this._utilityClassObserver?.disconnect(), this._utilityClassObserver = null, this._rowClickHandler &&= (this.removeEventListener("click", this._rowClickHandler, !0), null), this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
|
|
10107
10124
|
}
|
|
10108
10125
|
attributeChangedCallback(e, t, n) {
|
|
10109
10126
|
e === "configuration" && t !== n ? (!this._configuration || typeof n == "string") && (this._parseConfiguration(), this.render()) : t !== n && (e === "loading" || e === "virtual-scroll" || e === "virtual-scroll-root" || e === "virtual-row-height" || e === "virtual-max-height" || e === "fixed-header" || e === "fixed-controls") && this._configuration && this.isConnected && this.render();
|
|
@@ -10350,7 +10367,12 @@ var Gn = class extends HTMLElement {
|
|
|
10350
10367
|
this._mobileListMql && this._boundMobileListMqlListener && this._mobileListMql.removeEventListener("change", this._boundMobileListMqlListener), this._mobileListMql = null, this._boundMobileListMqlListener = null;
|
|
10351
10368
|
}
|
|
10352
10369
|
_useMobileListLayout() {
|
|
10353
|
-
return
|
|
10370
|
+
return this._mobileListMql ? this._mobileListMql.matches : typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(max-width: 767px)").matches : !1;
|
|
10371
|
+
}
|
|
10372
|
+
_scheduleInitialMobileLayoutSync(e) {
|
|
10373
|
+
this._initialMobileLayoutRaf !== null || typeof window.requestAnimationFrame != "function" || (this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
|
|
10374
|
+
this._initialMobileLayoutRaf = null, this.isConnected && this._configuration && this._useMobileListLayout() !== e && this.render();
|
|
10375
|
+
}));
|
|
10354
10376
|
}
|
|
10355
10377
|
_paginationHostPlaceholderHtml() {
|
|
10356
10378
|
if (!this._configuration?.perPage || this._virtualScrollActive()) return "";
|
|
@@ -10503,7 +10525,7 @@ var Gn = class extends HTMLElement {
|
|
|
10503
10525
|
}
|
|
10504
10526
|
_buildTableCellInnerHtml(e, t, n, r = "table") {
|
|
10505
10527
|
if (!this._configuration) return "";
|
|
10506
|
-
let i = n, a = "";
|
|
10528
|
+
let i = n, a = "", o = r === "mobile" ? "mobile" : "desktop";
|
|
10507
10529
|
if (!(!e.show || e.show(this, t))) return "";
|
|
10508
10530
|
if (e.raw) if (e.action) {
|
|
10509
10531
|
if (!e.action.show || e.action.show(this, t)) {
|
|
@@ -10511,7 +10533,7 @@ var Gn = class extends HTMLElement {
|
|
|
10511
10533
|
a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${this._escapeHtml(String(n))}</mint-button>`;
|
|
10512
10534
|
}
|
|
10513
10535
|
} else if (e.actions) if (e.actionStyle !== "buttons") {
|
|
10514
|
-
let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
|
|
10536
|
+
let n = `actions-popover-${this._tableId}-${o}-${i}`, r = `actions-button-${this._tableId}-${o}-${i}`;
|
|
10515
10537
|
a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
|
|
10516
10538
|
if (!n.show || n.show(this, t)) {
|
|
10517
10539
|
let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "", u = (typeof n.active == "function" ? n.active(this, t) : n.active) ? " active=\"true\"" : "";
|
|
@@ -10527,7 +10549,7 @@ var Gn = class extends HTMLElement {
|
|
|
10527
10549
|
else typeof e.format == "function" ? a += e.format(this, t) : e.data && (a += this._escapeHtml(String(t[e.data] || "")));
|
|
10528
10550
|
else if (e.action) (!e.action.show || e.action.show(this, t)) && (a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${e.action.label}</mint-button>`);
|
|
10529
10551
|
else if (e.actions) if (e.actionStyle !== "buttons") {
|
|
10530
|
-
let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
|
|
10552
|
+
let n = `actions-popover-${this._tableId}-${o}-${i}`, r = `actions-button-${this._tableId}-${o}-${i}`;
|
|
10531
10553
|
a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
|
|
10532
10554
|
if (!n.show || n.show(this, t)) {
|
|
10533
10555
|
let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "", u = (typeof n.active == "function" ? n.active(this, t) : n.active) ? " active=\"true\"" : "";
|
|
@@ -11030,12 +11052,14 @@ var Gn = class extends HTMLElement {
|
|
|
11030
11052
|
return;
|
|
11031
11053
|
}
|
|
11032
11054
|
this._ensureMobileListMql();
|
|
11033
|
-
let e =
|
|
11034
|
-
|
|
11035
|
-
let t =
|
|
11055
|
+
let e = this._useMobileListLayout();
|
|
11056
|
+
this._scheduleInitialMobileLayoutSync(e);
|
|
11057
|
+
let t = String(this._configuration.id || "").trim();
|
|
11058
|
+
t && (this.id = t), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._virtualScrollActive() || this._virtualRowCache.clear();
|
|
11059
|
+
let n = !this._loaded || this._rows.length > 0 || this._search.length > 0 || this._searching || this._configuration.showSearch !== !1 || !!this._configuration.buttons?.length, r = this._getRows();
|
|
11036
11060
|
this._lastPage || Math.ceil(this._rows.length / this._perPage);
|
|
11037
|
-
let
|
|
11038
|
-
if (
|
|
11061
|
+
let i = this._isExternalLoading(), a = "";
|
|
11062
|
+
if (n) {
|
|
11039
11063
|
let e = this._fixedControls(), t = [
|
|
11040
11064
|
"flex",
|
|
11041
11065
|
"items-center",
|
|
@@ -11043,60 +11067,60 @@ var Gn = class extends HTMLElement {
|
|
|
11043
11067
|
this._inMintCard ? "p-3.5" : "mb-3",
|
|
11044
11068
|
e ? "sticky top-0 z-20 bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider" : ""
|
|
11045
11069
|
].filter(Boolean).join(" ");
|
|
11046
|
-
if (
|
|
11070
|
+
if (a += `<div id="mint-rt-fixed-controls-${this._tableId}" class="${t}">`, a += "<div class=\"flex min-w-0 flex-1 items-center gap-2\">", a += this._buildMobileSortToolbarHtml(), a += this._toolbarButtonsHtml("left"), this._configuration.showSearch !== !1) {
|
|
11047
11071
|
let e = `search-${this._tableId}`, t = this._escapeHtml(this._configuration.searchPlaceholder || "Search...");
|
|
11048
|
-
|
|
11072
|
+
a += `<mint-input id="${e}" type="search" label="" placeholder="${t}" class="min-w-0 flex-1" icon="search" value="${this._escapeHtml(this._search)}"></mint-input>`;
|
|
11049
11073
|
}
|
|
11050
|
-
|
|
11074
|
+
a += this._toolbarButtonsHtml("right"), a += "</div>", a += "</div>";
|
|
11051
11075
|
}
|
|
11052
|
-
if ((this._type === "ajax" && !this._loaded || this._type === "provided" &&
|
|
11076
|
+
if ((this._type === "ajax" && !this._loaded || this._type === "provided" && i) && !this._fetchError && !this._sorting) {
|
|
11053
11077
|
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 ";
|
|
11054
|
-
|
|
11078
|
+
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>", this._configuration.columns.forEach((e, t) => {
|
|
11055
11079
|
if (e.hidden) return;
|
|
11056
11080
|
let n = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
|
|
11057
|
-
if (
|
|
11058
|
-
if (
|
|
11081
|
+
if (a += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`, e.showLabel !== !1) {
|
|
11082
|
+
if (a += "<div class=\"flex items-center\" data-mint-rt-sort-label>", a += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable) {
|
|
11059
11083
|
let t = this._getSortClass(e);
|
|
11060
|
-
t === "spinner" ?
|
|
11084
|
+
t === "spinner" ? a += "<div class=\"ml-2 flex items-center\" data-mint-rt-sort-icon><mint-spinner class=\"w-4 h-4\"></mint-spinner></div>" : (t === "caret-up" || t === "caret-down") && (a += `<div class="ml-2 flex items-center" data-mint-rt-sort-icon><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`);
|
|
11061
11085
|
}
|
|
11062
|
-
|
|
11086
|
+
a += "</div>";
|
|
11063
11087
|
}
|
|
11064
|
-
|
|
11065
|
-
}),
|
|
11066
|
-
for (let e = 0; e < 4; e++)
|
|
11088
|
+
a += "</th>";
|
|
11089
|
+
}), a += "</tr></thead>", a += "<tbody>";
|
|
11090
|
+
for (let e = 0; e < 4; e++) a += "<tr>", this._configuration.columns.forEach((e) => {
|
|
11067
11091
|
if (!e.hidden) {
|
|
11068
|
-
if (
|
|
11092
|
+
if (a += `<td style="${this._getStyle(e)}" class="${this._getClasses(e, !0)}">`, e.thumbnail) {
|
|
11069
11093
|
let t = this._thumbnailDesktopPx(e);
|
|
11070
|
-
|
|
11071
|
-
} else
|
|
11072
|
-
|
|
11094
|
+
a += `<div class="rounded-md bg-gray-200 dark:bg-white/15 animate-pulse" style="width:${t}px;height:${t}px;box-sizing:border-box"></div>`;
|
|
11095
|
+
} else a += "<div class=\"h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15 animate-pulse\"></div>";
|
|
11096
|
+
a += "</td>";
|
|
11073
11097
|
}
|
|
11074
|
-
}),
|
|
11075
|
-
|
|
11098
|
+
}), a += "</tr>";
|
|
11099
|
+
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += this._paginationHostPlaceholderHtml();
|
|
11076
11100
|
} else {
|
|
11077
|
-
let e = this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax" && this._loaded && !this._fetchError), t = e && this._virtualScrollRoot() === "table-body",
|
|
11101
|
+
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 = `mint-resource-table-mobile-list m-0 min-h-0 w-full list-none border-collapse overflow-x-hidden ${this._inMintCard ? "px-3.5 py-3.5" : "py-3"} md:hidden`, d = "";
|
|
11078
11102
|
if (t) {
|
|
11079
11103
|
let e = this._renderColgroupHtml();
|
|
11080
|
-
|
|
11081
|
-
} else
|
|
11082
|
-
if (
|
|
11083
|
-
d += this._buildMobileListItemHtml(e, t, t ===
|
|
11084
|
-
let
|
|
11085
|
-
|
|
11104
|
+
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=\"hidden min-h-0 min-w-0 md:block\">", 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);
|
|
11105
|
+
} else a += "<div class=\"hidden min-h-0 min-w-0 md:block\">", a += `<mint-table class="${l}"${c}>`, a += `<table id="${this._tableId}">`, e && (a += this._renderColgroupHtml()), a += this._renderTheadHtml(!0, !0, !!e, s);
|
|
11106
|
+
if (a += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !i && !e && r.forEach((e, t) => {
|
|
11107
|
+
d += this._buildMobileListItemHtml(e, t, t === r.length - 1);
|
|
11108
|
+
let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
|
|
11109
|
+
a += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, this._configuration.columns.forEach((n) => {
|
|
11086
11110
|
if (n.hidden) return;
|
|
11087
11111
|
let r = !n.show || n.show(this, e);
|
|
11088
|
-
|
|
11089
|
-
}),
|
|
11090
|
-
}), !this._fetching && !this._loading && !
|
|
11112
|
+
a += `<td style="${this._getStyle(n)}" class="${this._getClasses(n, !0)}">`, r && (a += this._buildTableCellInnerHtml(n, e, t, "table")), a += "</td>";
|
|
11113
|
+
}), a += "</tr>";
|
|
11114
|
+
}), !this._fetching && !this._loading && !i && r.length === 0) if (this._fetchError) {
|
|
11091
11115
|
let e = this._configuration.columns.filter((e) => !e.hidden).length;
|
|
11092
|
-
|
|
11116
|
+
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>`, d += `<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>`;
|
|
11093
11117
|
} else {
|
|
11094
11118
|
let e = this._configuration.columns.filter((e) => !e.hidden).length;
|
|
11095
|
-
|
|
11119
|
+
a += `<tr><td colspan="${e}" class="text-center py-8">No data available.</td></tr>`, d += "<li class=\"list-none px-4 py-8 text-center text-sm\">No data available.</li>";
|
|
11096
11120
|
}
|
|
11097
|
-
|
|
11121
|
+
a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += `<ul class="${u}" data-mint-rt-mobile-list="${this._tableId}">${e && r.length > 0 ? "" : d}</ul>`, e || (a += this._paginationHostPlaceholderHtml()), t && (a += "</div>");
|
|
11098
11122
|
}
|
|
11099
|
-
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 =
|
|
11123
|
+
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) => {
|
|
11100
11124
|
e.render && e.render();
|
|
11101
11125
|
}), this.querySelectorAll("mint-button[data-mint-rt-toolbar]").forEach((e) => {
|
|
11102
11126
|
e.render && e.render();
|