monobill-mintui 0.6.714 → 0.6.716

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.
@@ -143,6 +143,7 @@ var n = {
143
143
  "pl-0": "rtu-d569803f7",
144
144
  "pointer-events-none": "rtu-a4326536b",
145
145
  "pr-4": "rtu-ba64a7c03",
146
+ "pt-1.5": "rtu-6874bf95d",
146
147
  "pt-3": "rtu-ce335a8e4",
147
148
  "px-1": "rtu-d8e0e382c",
148
149
  "px-2": "rtu-d5eab218a",
@@ -158,6 +159,7 @@ var n = {
158
159
  "rounded-md": "rtu-421ac2be5",
159
160
  "rounded-t-none": "rtu-79ee0e356",
160
161
  "shrink-0": "rtu-012fbd121",
162
+ "space-y-2": "rtu-6f7e013d6",
161
163
  sticky: "rtu-3e0fd166d",
162
164
  table: "rtu-c3ee137d4",
163
165
  "table-fixed": "rtu-604d60250",
@@ -200,7 +202,7 @@ var n = {
200
202
  return e !== null && e !== "false";
201
203
  }
202
204
  constructor() {
203
- 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._boundMobileListViewportListener = null, this._initialMobileLayoutRaf = null, this._lastRenderedMobileLayout = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
205
+ 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._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;
204
206
  }
205
207
  get inMintCard() {
206
208
  return this._inMintCard;
@@ -220,7 +222,7 @@ var n = {
220
222
  }), this._inMintCard = this.closest("mint-card") !== null, this._configuration || this._parseConfiguration(), this._initializeColumns(), this._loadPageFromUrl(), this._attachRowClickHandler(), this.render();
221
223
  }
222
224
  disconnectedCallback() {
223
- 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);
225
+ this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._detachMobileListMql(), this._initialMobileLayoutRaf !== null && (window.cancelAnimationFrame(this._initialMobileLayoutRaf), this._initialMobileLayoutRaf = null), this._initialMobileLayoutTimer !== null && (window.clearTimeout(this._initialMobileLayoutTimer), this._initialMobileLayoutTimer = null), this._utilityClassObserver?.disconnect(), this._utilityClassObserver = null, this._rowClickHandler &&= (this.removeEventListener("click", this._rowClickHandler, !0), null), this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
224
226
  }
225
227
  attributeChangedCallback(e, t, n) {
226
228
  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();
@@ -464,17 +466,27 @@ var n = {
464
466
  }, this._mobileListMql.addEventListener("change", this._boundMobileListMqlListener)), this._boundMobileListViewportListener || (this._boundMobileListViewportListener = () => {
465
467
  let e = this._lastRenderedMobileLayout;
466
468
  e !== null && this._configuration && this.isConnected && this._scheduleInitialMobileLayoutSync(e);
467
- }, window.addEventListener("resize", this._boundMobileListViewportListener, { passive: !0 }), window.addEventListener("orientationchange", this._boundMobileListViewportListener, { passive: !0 }), window.visualViewport?.addEventListener("resize", this._boundMobileListViewportListener, { passive: !0 })));
469
+ }, window.addEventListener("resize", this._boundMobileListViewportListener, { passive: !0 }), window.addEventListener("orientationchange", this._boundMobileListViewportListener, { passive: !0 }), window.visualViewport?.addEventListener("resize", this._boundMobileListViewportListener, { passive: !0 })), !this._mobileLayoutResizeObserver && typeof ResizeObserver < "u" && document.documentElement && (this._mobileLayoutResizeObserver = new ResizeObserver((e) => {
470
+ let t = e[0]?.contentRect.width;
471
+ if (t === void 0 || t === this._lastMobileViewportObservedWidth) return;
472
+ this._lastMobileViewportObservedWidth = t;
473
+ let n = this._lastRenderedMobileLayout;
474
+ n !== null && this._configuration && this.isConnected && this._scheduleInitialMobileLayoutSync(n);
475
+ }), this._mobileLayoutResizeObserver.observe(document.documentElement)));
468
476
  }
469
477
  _detachMobileListMql() {
470
- this._mobileListMql && this._boundMobileListMqlListener && this._mobileListMql.removeEventListener("change", this._boundMobileListMqlListener), this._mobileListMql = null, this._boundMobileListMqlListener = 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;
478
+ 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;
471
479
  }
472
480
  _useMobileListLayout() {
473
- return typeof window > "u" ? !1 : (this._mobileListMql?.matches ?? (typeof window.matchMedia == "function" && window.matchMedia("(max-width: 767px)").matches)) || window.innerWidth <= 767 || (window.visualViewport?.width ?? Infinity) <= 767 ? !0 : (navigator.maxTouchPoints > 0 || "ontouchstart" in window) && typeof window.screen?.width == "number" && window.screen.width <= 767;
481
+ return typeof window > "u" ? !1 : (this._mobileListMql?.matches ?? (typeof window.matchMedia == "function" && window.matchMedia("(max-width: 767px)").matches)) || window.innerWidth <= 767 || (window.visualViewport?.width ?? Infinity) <= 767 ? !0 : (document.documentElement?.clientWidth ?? Infinity) <= 767;
474
482
  }
475
483
  _scheduleInitialMobileLayoutSync(e) {
476
- this._initialMobileLayoutRaf !== null || typeof window.requestAnimationFrame != "function" || (this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
477
- this._initialMobileLayoutRaf = null, this.isConnected && this._configuration && this._useMobileListLayout() !== e && this.render();
484
+ this._initialMobileLayoutRaf !== null || this._initialMobileLayoutTimer !== null || typeof window.requestAnimationFrame != "function" || (this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
485
+ this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
486
+ this._initialMobileLayoutRaf = null, this._initialMobileLayoutTimer = window.setTimeout(() => {
487
+ this._initialMobileLayoutTimer = null, this.isConnected && this._configuration && this._useMobileListLayout() !== e && this.render();
488
+ }, 100);
489
+ });
478
490
  }));
479
491
  }
480
492
  _paginationHostPlaceholderHtml() {
@@ -678,7 +690,16 @@ var n = {
678
690
  }
679
691
  _buildMobileListItemHtml(e, t, n = !1) {
680
692
  if (!this._configuration) return "";
681
- let r = t, i = typeof this._configuration.onRowClick == "function", 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;
693
+ let r = t, i = typeof this._configuration.onRowClick == "function", 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") : "";
694
+ if (typeof this._configuration.mobileRowFormat == "function") {
695
+ let t = this._configuration.mobileRowFormat(this, e, r, u), n = [
696
+ "list-none",
697
+ "mint-resource-table-mobile-row",
698
+ i ? "cursor-pointer" : ""
699
+ ].filter(Boolean).join(" ");
700
+ return `<li data-row-index="${r}" ${i ? "data-row-clickable=\"true\" " : ""}class="${n}">${t}</li>`;
701
+ }
702
+ let d = [], f = this._configuration.mobileShowLabels === !0;
682
703
  for (let t of this._configuration.columns) {
683
704
  if (t.hidden || a && t === a || o && t === o || s && t === s) continue;
684
705
  let n = this._columnPlainSummaryText(t, e);
@@ -1164,7 +1185,7 @@ var n = {
1164
1185
  }
1165
1186
  this._ensureMobileListMql();
1166
1187
  let e = this._useMobileListLayout();
1167
- this._lastRenderedMobileLayout = e, this.toggleAttribute("data-mint-rt-mobile-layout", e), this._scheduleInitialMobileLayoutSync(e);
1188
+ this._lastRenderedMobileLayout = e, this.toggleAttribute("data-mint-rt-mobile-layout", e), this.toggleAttribute("data-mint-rt-mobile-cards", typeof this._configuration.mobileRowFormat == "function"), this._scheduleInitialMobileLayoutSync(e);
1168
1189
  let t = String(this._configuration.id || "").trim();
1169
1190
  t && (this.id = t), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._virtualScrollActive() || this._virtualRowCache.clear();
1170
1191
  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();
@@ -1178,11 +1199,9 @@ var n = {
1178
1199
  this._inMintCard ? "p-3.5" : "mb-3",
1179
1200
  e ? "sticky top-0 z-20 bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider" : ""
1180
1201
  ].filter(Boolean).join(" ");
1181
- 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) {
1182
- let e = `search-${this._tableId}`, t = this._escapeHtml(this._configuration.searchPlaceholder || "Search...");
1183
- 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>`;
1184
- }
1185
- a += this._toolbarButtonsHtml("right"), a += "</div>", a += "</div>";
1202
+ a += `<div id="mint-rt-fixed-controls-${this._tableId}" class="${t}">`, a += "<div class=\"flex min-w-0 flex-1 items-center gap-2\">";
1203
+ let n = this._configuration.mobileSearchFirst === !0, r = this._configuration.showSearch === !1 ? "" : `<mint-input id="search-${this._tableId}" type="search" label="" placeholder="${this._escapeHtml(this._configuration.searchPlaceholder || "Search...")}" class="min-w-0 flex-1" icon="search" value="${this._escapeHtml(this._search)}"></mint-input>`;
1204
+ n && (a += r), a += this._buildMobileSortToolbarHtml(), a += this._toolbarButtonsHtml("left"), n || (a += r), a += this._toolbarButtonsHtml("right"), a += "</div>", a += "</div>";
1186
1205
  }
1187
1206
  if ((this._type === "ajax" && !this._loaded || this._type === "provided" && i) && !this._fetchError && !this._sorting) {
1188
1207
  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 ";
@@ -1209,13 +1228,13 @@ var n = {
1209
1228
  }), a += "</tr>";
1210
1229
  a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += this._paginationHostPlaceholderHtml();
1211
1230
  } else {
1212
- 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"}`, d = "";
1231
+ 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 = this._inMintCard ? "px-3.5 py-3.5" : "py-3", d = typeof this._configuration.mobileRowFormat == "function", f = d ? "space-y-2" : "", p = `mint-resource-table-mobile-list m-0 min-h-0 w-full list-none border-collapse overflow-x-hidden ${d && this._inMintCard ? "px-3.5 pt-1.5 pb-3.5" : u} ${f}`, m = "";
1213
1232
  if (t) {
1214
1233
  let e = this._renderColgroupHtml();
1215
1234
  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);
1216
1235
  } 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);
1217
1236
  if (a += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !i && !e && r.forEach((e, t) => {
1218
- d += this._buildMobileListItemHtml(e, t, t === r.length - 1);
1237
+ m += this._buildMobileListItemHtml(e, t, t === r.length - 1);
1219
1238
  let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
1220
1239
  a += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, this._configuration.columns.forEach((n) => {
1221
1240
  if (n.hidden) return;
@@ -1224,12 +1243,12 @@ var n = {
1224
1243
  }), a += "</tr>";
1225
1244
  }), !this._fetching && !this._loading && !i && r.length === 0) if (this._fetchError) {
1226
1245
  let e = this._configuration.columns.filter((e) => !e.hidden).length;
1227
- 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>`;
1246
+ 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>`, m += `<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>`;
1228
1247
  } else {
1229
1248
  let e = this._configuration.columns.filter((e) => !e.hidden).length;
1230
- 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>";
1249
+ a += `<tr><td colspan="${e}" class="text-center py-8">No data available.</td></tr>`, m += "<li class=\"list-none px-4 py-8 text-center text-sm\">No data available.</li>";
1231
1250
  }
1232
- 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>");
1251
+ a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += `<ul class="${p}" data-mint-rt-mobile-list="${this._tableId}">${e && r.length > 0 ? "" : m}</ul>`, e || (a += this._paginationHostPlaceholderHtml()), t && (a += "</div>");
1233
1252
  }
1234
1253
  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) => {
1235
1254
  e.render && e.render();
@@ -120,6 +120,7 @@ export const resourceTableUtilityAliases: {
120
120
  "pl-0": string;
121
121
  "pointer-events-none": string;
122
122
  "pr-4": string;
123
+ "pt-1.5": string;
123
124
  "pt-3": string;
124
125
  "px-1": string;
125
126
  "px-2": string;
@@ -135,6 +136,7 @@ export const resourceTableUtilityAliases: {
135
136
  "rounded-md": string;
136
137
  "rounded-t-none": string;
137
138
  "shrink-0": string;
139
+ "space-y-2": string;
138
140
  sticky: string;
139
141
  table: string;
140
142
  "table-fixed": string;
@@ -1 +1 @@
1
- {"version":3,"file":"utility-aliases.d.ts","sourceRoot":"","sources":["../../../src/components/resource-table/utility-aliases.js"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiKC"}
1
+ {"version":3,"file":"utility-aliases.d.ts","sourceRoot":"","sources":["../../../src/components/resource-table/utility-aliases.js"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmKC"}