monobill-mintui 0.6.723 → 0.6.724

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.
@@ -113,19 +113,18 @@ var n = {
113
113
  "justify-end": "rtu-77c08e015",
114
114
  "leading-snug": "rtu-e25ca6535",
115
115
  "left-3": "rtu-22e59b722",
116
+ "lg:block": "rtu-d0ce7c24d",
117
+ "lg:border-t-0": "rtu-7d283214b",
118
+ "lg:hidden": "rtu-a327049ca",
119
+ "lg:justify-end": "rtu-64b07e15f",
120
+ "lg:mt-4": "rtu-010a34347",
121
+ "lg:pt-0": "rtu-0cd43c7f4",
122
+ "lg:py-0": "rtu-0df6beb59",
116
123
  "list-none": "rtu-b20d79b23",
117
- "m-0": "rtu-74f9876a6",
118
124
  "max-w-[95%]": "rtu-80fa57ccf",
119
125
  "max-w-none": "rtu-2191c1456",
120
126
  "max-w-xs": "rtu-3acf64d53",
121
127
  "mb-3": "rtu-1bb883263",
122
- "md:block": "rtu-9d60be3a6",
123
- "md:border-t-0": "rtu-f6099fc6b",
124
- "md:hidden": "rtu-e477a6af4",
125
- "md:justify-end": "rtu-70ce0294b",
126
- "md:mt-4": "rtu-ef9aeb563",
127
- "md:pt-0": "rtu-30dec114f",
128
- "md:py-0": "rtu-3957f1b8e",
129
128
  "min-h-0": "rtu-fb7302e53",
130
129
  "min-w-0": "rtu-7e0b7cdf1",
131
130
  "min-w-[11rem]": "rtu-46b2fd2eb",
@@ -133,7 +132,6 @@ var n = {
133
132
  "mx-auto": "rtu-0e12dc7de",
134
133
  "overflow-hidden": "rtu-2cd02d11d",
135
134
  "overflow-x-auto": "rtu-1384f66f4",
136
- "overflow-x-hidden": "rtu-e271e6ae1",
137
135
  "overflow-y-auto": "rtu-92bf82f49",
138
136
  "overflow-y-hidden": "rtu-b70fd23f6",
139
137
  "overscroll-x-contain": "rtu-63ccdaaca",
@@ -153,7 +151,6 @@ var n = {
153
151
  "py-0.5": "rtu-465609a24",
154
152
  "py-2": "rtu-03b4dd7f1",
155
153
  "py-3": "rtu-1b2d54a3f",
156
- "py-3.5": "rtu-69e76918f",
157
154
  "py-8": "rtu-a1f611f02",
158
155
  rounded: "rtu-07389a777",
159
156
  "rounded-full": "rtu-ac204c108",
@@ -202,7 +199,7 @@ var n = {
202
199
  return e !== null && e !== "false";
203
200
  }
204
201
  constructor() {
205
- 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;
202
+ 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;
206
203
  }
207
204
  get inMintCard() {
208
205
  return this._inMintCard;
@@ -273,6 +270,9 @@ var n = {
273
270
  }), this.querySelectorAll("tbody tr[data-row-index]").forEach((e) => {
274
271
  let t = this._getRowDataForEventIndex(Number(e.dataset.rowIndex)), n = t ? this._rowSelectionId(t) : null;
275
272
  e.classList.toggle("mint-rt-row-selected", n !== null && this._selectedRowIds.has(n));
273
+ }), this.querySelectorAll("li.mint-resource-table-mobile-row[data-row-index]").forEach((e) => {
274
+ let t = this._getRowDataForEventIndex(Number(e.dataset.rowIndex)), n = t ? this._rowSelectionId(t) : null;
275
+ e.classList.toggle("is-selected", n !== null && this._selectedRowIds.has(n));
276
276
  });
277
277
  }
278
278
  get configuration() {
@@ -282,7 +282,7 @@ var n = {
282
282
  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();
283
283
  }
284
284
  connectedCallback() {
285
- this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "block", "w-full"), this._utilityClassObserver = new MutationObserver(() => this._replaceUtilityClasses()), this._utilityClassObserver.observe(this, {
285
+ this.classList.add("box-border", "p-0", "border-0", "align-baseline", "block", "w-full"), this._utilityClassObserver = new MutationObserver(() => this._replaceUtilityClasses()), this._utilityClassObserver.observe(this, {
286
286
  attributes: !0,
287
287
  attributeFilter: ["class"],
288
288
  childList: !0,
@@ -535,7 +535,7 @@ var n = {
535
535
  return this._configuration ? Math.max(1, this._configuration.columns.filter((e) => !e.hidden).length) : 1;
536
536
  }
537
537
  _ensureMobileListMql() {
538
- typeof window > "u" || !window.matchMedia || (this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width: 767px)"), this._boundMobileListMqlListener = () => {
538
+ typeof window > "u" || !window.matchMedia || (this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width: 1023px)"), this._boundMobileListMqlListener = () => {
539
539
  this._configuration && this.isConnected && this.render();
540
540
  }, this._mobileListMql.addEventListener("change", this._boundMobileListMqlListener)), this._boundMobileListViewportListener || (this._boundMobileListViewportListener = () => {
541
541
  let e = this._lastRenderedMobileLayout;
@@ -552,7 +552,7 @@ var n = {
552
552
  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;
553
553
  }
554
554
  _useMobileListLayout() {
555
- 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;
555
+ 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;
556
556
  }
557
557
  _scheduleInitialMobileLayoutSync(e) {
558
558
  this._initialMobileLayoutRaf !== null || this._initialMobileLayoutTimer !== null || typeof window.requestAnimationFrame != "function" || (this._initialMobileLayoutRaf = window.requestAnimationFrame(() => {
@@ -570,8 +570,8 @@ var n = {
570
570
  let t = [
571
571
  "mint-rt-pagination-host",
572
572
  "w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain",
573
- "flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end",
574
- this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"
573
+ "flex justify-center [-webkit-overflow-scrolling:touch] lg:justify-end",
574
+ 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"
575
575
  ].join(" ");
576
576
  return `<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`;
577
577
  }
@@ -672,7 +672,7 @@ var n = {
672
672
  }
673
673
  _buildMobileSortToolbarHtml() {
674
674
  if (!this._hasSortableColumns()) return "";
675
- 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 md:hidden\">";
675
+ 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\">";
676
676
  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;
677
677
  }
678
678
  _stripHtml(e) {
@@ -764,7 +764,12 @@ var n = {
764
764
  }
765
765
  _buildMobileListItemHtml(e, t, n = !1) {
766
766
  if (!this._configuration) return "";
767
- 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;
767
+ let r = t, i = typeof this._configuration.onRowClick == "function";
768
+ if (typeof this._configuration.mobileCard == "function") {
769
+ let t = this._rowSelectionId(e), n = t !== null && this._selectedRowIds.has(t), a = this._configuration.mobileCard(this, e, r);
770
+ 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>`;
771
+ }
772
+ 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;
768
773
  for (let t of this._configuration.columns) {
769
774
  if (t.hidden || a && t === a || o && t === o || s && t === s) continue;
770
775
  let n = this._columnPlainSummaryText(t, e);
@@ -776,11 +781,6 @@ var n = {
776
781
  let p = d.join("<span class=\"text-gray-300 dark:text-gray-600\" aria-hidden=\"true\"> · </span>"), m = [
777
782
  "list-none",
778
783
  "mint-resource-table-mobile-row",
779
- ...n ? [] : [
780
- "border-b",
781
- "border-gray-200",
782
- "dark:border-mint-divider"
783
- ],
784
784
  i ? "cursor-pointer" : ""
785
785
  ].filter(Boolean).join(" "), h = `<div class="flex items-center gap-3 py-3 pr-4${a ? " pl-0" : " pl-4"}">`, g = this._rowSelectionId(e);
786
786
  if (g !== null && (h += `<div class="mint-rt-mobile-selection">${this._selectionControlHtml(g)}</div>`), a) {
@@ -893,12 +893,12 @@ var n = {
893
893
  this._virtualLastRangeStart = d, this._virtualLastRangeEnd = f, this._virtualLastRangeCacheSig = p;
894
894
  let m = d * a, h = Math.max(0, (i - f) * a), g = "";
895
895
  if (e) {
896
- g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${m}px"></li>`;
896
+ g += `<li aria-hidden="true" class="pointer-events-none block list-none border-0 p-0" style="height:${m}px"></li>`;
897
897
  for (let e = d; e < f; e++) {
898
898
  let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
899
899
  t ? g += this._buildMobileListItemHtml(t, e, n) : g += this._buildMobileListPlaceholderLi(e, a, n);
900
900
  }
901
- g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${h}px"></li>`;
901
+ g += `<li aria-hidden="true" class="pointer-events-none block list-none border-0 p-0" style="height:${h}px"></li>`;
902
902
  } else {
903
903
  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>`;
904
904
  for (let e = d; e < f; e++) {
@@ -1123,7 +1123,7 @@ var n = {
1123
1123
  this.render();
1124
1124
  return;
1125
1125
  }
1126
- 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] md:justify-end " + (this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"), e.insertAdjacentElement("afterend", n);
1126
+ 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);
1127
1127
  }
1128
1128
  let r = this._buildPaginationNavMarkup(e);
1129
1129
  n.innerHTML = r, setTimeout(() => {
@@ -1270,7 +1270,7 @@ var n = {
1270
1270
  }
1271
1271
  if ((this._type === "ajax" && !this._loaded || this._type === "provided" && i) && !this._fetchError && !this._sorting) {
1272
1272
  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 ";
1273
- 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) => {
1273
+ 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) => {
1274
1274
  if (e.hidden) return;
1275
1275
  let n = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
1276
1276
  if (a += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`, e.showLabel !== !1) {
@@ -1291,15 +1291,17 @@ var n = {
1291
1291
  a += "</td>";
1292
1292
  }
1293
1293
  }), a += "</tr>";
1294
- a += "</tbody>", a += "</table>", a += "</mint-table>", a += "</div>", a += this._paginationHostPlaceholderHtml();
1294
+ 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">`;
1295
+ 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>";
1296
+ a += "</ul>", a += this._paginationHostPlaceholderHtml();
1295
1297
  } else {
1296
- 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 = "";
1298
+ 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 = "";
1297
1299
  if (t) {
1298
1300
  let e = this._renderColgroupHtml();
1299
1301
  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);
1300
1302
  } 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);
1301
1303
  if (a += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !i && !e && r.forEach((e, t) => {
1302
- d += this._buildMobileListItemHtml(e, t, t === r.length - 1);
1304
+ u += this._buildMobileListItemHtml(e, t, t === r.length - 1);
1303
1305
  let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
1304
1306
  a += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, a += this._renderSelectionCell(e), this._configuration.columns.forEach((n) => {
1305
1307
  if (n.hidden) return;
@@ -1308,12 +1310,12 @@ var n = {
1308
1310
  }), a += "</tr>";
1309
1311
  }), !this._fetching && !this._loading && !i && r.length === 0) if (this._fetchError) {
1310
1312
  let e = this._configuration.columns.filter((e) => !e.hidden).length + (this._configuration.rowSelection ? 1 : 0);
1311
- 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>`;
1313
+ 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>`;
1312
1314
  } else {
1313
1315
  let e = this._configuration.columns.filter((e) => !e.hidden).length + (this._configuration.rowSelection ? 1 : 0);
1314
- 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>";
1316
+ 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>";
1315
1317
  }
1316
- 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>");
1318
+ 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>");
1317
1319
  }
1318
1320
  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) => {
1319
1321
  e.render && e.render();
@@ -1327,15 +1329,43 @@ var n = {
1327
1329
  this._rowClickHandler && this.removeEventListener("click", this._rowClickHandler, !0);
1328
1330
  let e = (e) => {
1329
1331
  let t = e.target;
1332
+ if (this._suppressMobileCardClick) {
1333
+ this._suppressMobileCardClick = !1, e.preventDefault(), e.stopImmediatePropagation();
1334
+ return;
1335
+ }
1336
+ let n = t.closest("li.mint-resource-table-mobile-row[data-row-index]");
1337
+ if (n && this._configuration?.rowSelection && this._selectedRowIds.size > 0 && !t.closest("mint-button, button, mint-popover, [data-action], [data-mint-rt-selection]")) {
1338
+ let t = this._getRowDataForEventIndex(Number(n.dataset.rowIndex)), r = t ? this._rowSelectionId(t) : null;
1339
+ if (r !== null) {
1340
+ e.preventDefault(), e.stopPropagation(), this.toggleRowSelection(r);
1341
+ return;
1342
+ }
1343
+ }
1330
1344
  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;
1331
- let n = t.closest("tr[data-row-clickable=\"true\"]") || t.closest("li[data-row-clickable=\"true\"]");
1332
- if (!n) return;
1333
- let r = n.getAttribute("data-row-index");
1345
+ let r = t.closest("tr[data-row-clickable=\"true\"]") || t.closest("li[data-row-clickable=\"true\"]");
1334
1346
  if (!r) return;
1335
- let i = parseInt(r), a = this._getRowDataForEventIndex(i);
1336
- !a || !this._configuration?.onRowClick || (this._configuration.onRowClick.length === 1 ? this._configuration.onRowClick(a) : this._configuration.onRowClick(this, a));
1347
+ let i = r.getAttribute("data-row-index");
1348
+ if (!i) return;
1349
+ let a = parseInt(i), o = this._getRowDataForEventIndex(a);
1350
+ !o || !this._configuration?.onRowClick || (this._configuration.onRowClick.length === 1 ? this._configuration.onRowClick(o) : this._configuration.onRowClick(this, o));
1337
1351
  };
1338
1352
  this.addEventListener("click", e, !0), this._rowClickHandler = e;
1353
+ let t = () => {
1354
+ this._mobileCardLongPressTimer !== null && window.clearTimeout(this._mobileCardLongPressTimer), this._mobileCardLongPressTimer = null;
1355
+ }, n = (e) => {
1356
+ if (!this._configuration?.rowSelection || !this._useMobileListLayout()) return;
1357
+ let n = e;
1358
+ if (n.button !== void 0 && n.button !== 0) return;
1359
+ let r = e.target;
1360
+ if (r.closest("mint-button, button, mint-popover, input, [data-action], [data-mint-rt-selection]")) return;
1361
+ let i = r.closest("li.mint-resource-table-mobile-row[data-row-index]");
1362
+ i && (t(), this._mobileCardLongPressTimer = window.setTimeout(() => {
1363
+ this._mobileCardLongPressTimer = null;
1364
+ let e = this._getRowDataForEventIndex(Number(i.dataset.rowIndex)), t = e ? this._rowSelectionId(e) : null;
1365
+ t !== null && (this._suppressMobileCardClick = !0, this.toggleRowSelection(t));
1366
+ }, 500));
1367
+ }, r = () => t(), i = this._mobileCardPointerDown, a = this._mobileCardPointerEnd;
1368
+ 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;
1339
1369
  }
1340
1370
  _attachPaginationListeners() {
1341
1371
  this.querySelectorAll("[data-action=\"page\"]").forEach((e) => {
@@ -88,19 +88,18 @@ export const resourceTableUtilityAliases: {
88
88
  "justify-end": string;
89
89
  "leading-snug": string;
90
90
  "left-3": string;
91
+ "lg:block": string;
92
+ "lg:border-t-0": string;
93
+ "lg:hidden": string;
94
+ "lg:justify-end": string;
95
+ "lg:mt-4": string;
96
+ "lg:pt-0": string;
97
+ "lg:py-0": string;
91
98
  "list-none": string;
92
- "m-0": string;
93
99
  "max-w-[95%]": string;
94
100
  "max-w-none": string;
95
101
  "max-w-xs": string;
96
102
  "mb-3": string;
97
- "md:block": string;
98
- "md:border-t-0": string;
99
- "md:hidden": string;
100
- "md:justify-end": string;
101
- "md:mt-4": string;
102
- "md:pt-0": string;
103
- "md:py-0": string;
104
103
  "min-h-0": string;
105
104
  "min-w-0": string;
106
105
  "min-w-[11rem]": string;
@@ -108,7 +107,6 @@ export const resourceTableUtilityAliases: {
108
107
  "mx-auto": string;
109
108
  "overflow-hidden": string;
110
109
  "overflow-x-auto": string;
111
- "overflow-x-hidden": string;
112
110
  "overflow-y-auto": string;
113
111
  "overflow-y-hidden": string;
114
112
  "overscroll-x-contain": string;
@@ -128,7 +126,6 @@ export const resourceTableUtilityAliases: {
128
126
  "py-0.5": string;
129
127
  "py-2": string;
130
128
  "py-3": string;
131
- "py-3.5": string;
132
129
  "py-8": string;
133
130
  rounded: string;
134
131
  "rounded-full": 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8JC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavigationLink.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation/SideNavigationLink.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,0BAA0B,CAAA;AAEjC,cAAM,eAAgB,SAAQ,WAAW;IACvC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,YAAY,CAAsB;IAE1C,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAW5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAS9F,OAAO,CAAC,eAAe;IAQvB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAuBhC,gGAAgG;IAChG,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,WAAW;IAInB,6FAA6F;IAC7F,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IAkG1B,MAAM,IAAI,IAAI;CAOf;AAMD,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"SideNavigationLink.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation/SideNavigationLink.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,0BAA0B,CAAA;AAEjC,cAAM,eAAgB,SAAQ,WAAW;IACvC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,YAAY,CAAsB;IAE1C,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAW5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAS9F,OAAO,CAAC,eAAe;IAQvB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAuBhC,gGAAgG;IAChG,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,WAAW;IAInB,6FAA6F;IAC7F,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IAmG1B,MAAM,IAAI,IAAI;CAOf;AAMD,eAAe,eAAe,CAAA"}
@@ -141,8 +141,8 @@ var n = class extends HTMLElement {
141
141
  let c = document.createElement("button");
142
142
  c.type = "button", c.className = "mint-sidenav-mobile-toggle", c.setAttribute("aria-label", `Toggle ${e} submenu`), c.setAttribute("aria-expanded", String(this._isSubmenuPanelVisible())), c.setAttribute("aria-controls", o), c.addEventListener("click", (e) => {
143
143
  e.preventDefault(), e.stopPropagation();
144
- let t = !this._isExpanded();
145
- this._setExpanded(t, t);
144
+ let t = !this._isSubmenuPanelVisible();
145
+ !t && this._isActive() && this.removeAttribute("active"), this._setExpanded(t, t);
146
146
  });
147
147
  let l = document.createElement("mint-icon");
148
148
  l.setAttribute("name", "caret-down"), l.className = `mint-sidenav-dropdown-caret${this._isSubmenuPanelVisible() ? " is-expanded" : ""}`, l.setAttribute("aria-hidden", "true"), c.appendChild(l), r.appendChild(i), r.appendChild(s), r.appendChild(c), a.appendChild(r), this._trigger = i;
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-B9P0jyS2.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cia9x_J2.js`),require(`../chunks/text-CfvRRKGZ.js`),require(`../chunks/caret-right-B8gOXLh9.js`),require(`../chunks/caret-down-DbFlPN-2.js`),require(`../chunks/popover-CWWKb7L1.js`);const t=require(`../chunks/ScrollFade-Dfq2B1Hm.js`);var n=class extends HTMLElement{constructor(...e){super(...e),this._trigger=null,this._submenuContainer=null,this._contentObserver=null,this._renderFrame=null}static get observedAttributes(){return[`label`,`icon`,`href`,`active`,`expanded`,`submenu-item`]}connectedCallback(){this.render(),this._observeSubmenuMutations()}disconnectedCallback(){this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&(this.render(),e===`active`&&this._isSubmenuItem()&&this._refreshDropdownAncestor())}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeSubmenuMutations(){this._contentObserver||=new MutationObserver(e=>{e.some(e=>[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].some(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`submenu`))&&this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`],subtree:!1})}_refreshDropdownAncestor(){let e=this.parentElement;for(;e;){if(e.tagName===`MINT-SIDENAV-LINK`&&e!==this){e.render();break}e=e.parentElement}}_isActive(){return this.getAttribute(`active`)===`true`}_isExpanded(){return this.getAttribute(`expanded`)===`true`}_isSubmenuPanelVisible(){return this._isExpanded()||this._isActive()}_isSubmenuItem(){return this.getAttribute(`submenu-item`)===`true`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}_getBaseClasses(){return`mint-sidenav-link-control${this._isActive()?` is-active`:``}${this._isSubmenuItem()?` is-submenu-item`:``}`}_hasSubmenu(){return this.querySelectorAll(`:scope > [slot="submenu"]`).length>0?!0:!!this._submenuContainer&&this._submenuContainer.children.length>0}_createRow(e,t){let n=document.createElement(`span`);if(n.className=`mint-sidenav-link-row`,t){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,t),e.className=`mint-sidenav-link-icon`,e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}let r=document.createElement(`span`);return r.className=`mint-sidenav-link-label`,r.textContent=e,n.appendChild(r),n}_buildSimpleLink(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=e?document.createElement(`a`):document.createElement(`button`);e?r.setAttribute(`href`,e):r.setAttribute(`type`,`button`),r.className=this._getBaseClasses(),r.setAttribute(`aria-label`,t||`Side navigation link`),r.appendChild(this._createRow(t,n)),this.replaceChildren(r),this._trigger=r}_emitAccordionExpand(){this.dispatchEvent(new CustomEvent(`mint-sidenav-accordion`,{bubbles:!0,composed:!0,detail:{source:this}}))}_setExpanded(e,t){this.setAttribute(`expanded`,String(e)),e&&t&&this._emitAccordionExpand()}_buildDropdownLink(){let e=this._getLabel(),t=this._getIcon(),n=this._getHref(),r=Array.from(this.querySelectorAll(`:scope > [slot="submenu"]`)),i=r.length>0?r:this._submenuContainer?Array.from(this._submenuContainer.children):[],a=document.createElement(`div`);a.className=`mint-sidenav-dropdown`,this._submenuContainer=document.createElement(`div`),this._submenuContainer.id=`mint-sidenav-submenu-${Math.random().toString(36).slice(2,11)}`;let o=this._submenuContainer.id;if(this._submenuContainer.className=`mint-sidenav-submenu${this._isSubmenuPanelVisible()?` is-expanded`:``}`,i.forEach(e=>{e.setAttribute(`submenu-item`,`true`),e.setAttribute(`slot`,`submenu`),this._submenuContainer?.appendChild(e)}),n){let r=document.createElement(`div`);r.className=`mint-sidenav-link-row-wrap`;let i=document.createElement(`a`);i.setAttribute(`href`,n),i.className=`${this._getBaseClasses()} mint-sidenav-desktop-link`,i.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),i.setAttribute(`aria-controls`,o),this._isActive()?i.setAttribute(`aria-current`,`page`):i.removeAttribute(`aria-current`),i.appendChild(this._createRow(e,t)),i.addEventListener(`click`,()=>{this._setExpanded(!0,!0)});let s=document.createElement(`a`);s.setAttribute(`href`,n),s.className=`${this._getBaseClasses()} mint-sidenav-mobile-link`,s.setAttribute(`aria-controls`,o),s.appendChild(this._createRow(e,t)),this._isActive()?s.setAttribute(`aria-current`,`page`):s.removeAttribute(`aria-current`);let c=document.createElement(`button`);c.type=`button`,c.className=`mint-sidenav-mobile-toggle`,c.setAttribute(`aria-label`,`Toggle ${e} submenu`),c.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),c.setAttribute(`aria-controls`,o),c.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation();let t=!this._isExpanded();this._setExpanded(t,t)});let l=document.createElement(`mint-icon`);l.setAttribute(`name`,`caret-down`),l.className=`mint-sidenav-dropdown-caret${this._isSubmenuPanelVisible()?` is-expanded`:``}`,l.setAttribute(`aria-hidden`,`true`),c.appendChild(l),r.appendChild(i),r.appendChild(s),r.appendChild(c),a.appendChild(r),this._trigger=i}else{let n=document.createElement(`button`);n.type=`button`,n.className=this._getBaseClasses(),n.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),n.setAttribute(`aria-controls`,o),n.appendChild(this._createRow(e,t)),n.onclick=()=>{let e=!this._isExpanded();this._setExpanded(e,e)},a.appendChild(n),this._trigger=n}a.appendChild(this._submenuContainer),this.replaceChildren(a)}render(){this._hasSubmenu()&&!this._isSubmenuItem()?this._buildDropdownLink():this._buildSimpleLink()}};customElements.get(`mint-sidenav-link`)||e.t(`mint-sidenav-link`,n);var r=class extends HTMLElement{constructor(...e){super(...e),this._container=null,this._title=null,this._titleLabel=null,this._titleCaret=null,this._titleIsInteractive=null,this._list=null,this._titleClickHandler=null,this._listenerCounts=new Map}static get observedAttributes(){return[`name`]}get onMintNameClick(){return this._onMintNameClick}set onMintNameClick(e){this._onMintNameClick=e,this.render()}addEventListener(e,t,n){super.addEventListener(e,t,n),this._trackListener(e,1)}removeEventListener(e,t,n){super.removeEventListener(e,t,n),this._trackListener(e,-1)}connectedCallback(){this.render(),this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.addEventListener(`click`,this._titleClickHandler)}disconnectedCallback(){this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.removeEventListener(`click`,this._titleClickHandler)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getName(){return this.getAttribute(`name`)||``}_trackListener(e,t){if(e!==`mint-name-click`)return;let n=this._listenerCounts.get(e)||0,r=Math.max(0,n+t);this._listenerCounts.set(e,r),this.render()}_isNameInteractive(){return(this._listenerCounts.get(`mint-name-click`)||0)>0||typeof this._onMintNameClick==`function`}_emitNameClick(e){let t=new CustomEvent(`mint-name-click`,{detail:{name:this._getName(),originalEvent:e},bubbles:!0,composed:!0});this.dispatchEvent(t),typeof this._onMintNameClick==`function`&&this._onMintNameClick(t)}render(){this._container||(this._container=document.createElement(`section`),this._container.className=`mint-sidenav-link-group`,this.appendChild(this._container));let e=this._getName(),t=e.trim().length>0,n=this._isNameInteractive();if(!this._title||this._titleIsInteractive!==n){this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.removeEventListener(`click`,this._titleClickHandler);let e=n?document.createElement(`button`):document.createElement(`div`);e instanceof HTMLButtonElement?(e.type=`button`,this._titleClickHandler=e=>this._emitNameClick(e),e.addEventListener(`click`,this._titleClickHandler)):(e.setAttribute(`role`,`heading`),e.setAttribute(`aria-level`,`3`),this._titleClickHandler=null),e.className=`mint-sidenav-group-trigger${n?` is-interactive`:``}`,this._titleLabel=document.createElement(`mint-text`),this._titleLabel.setAttribute(`size`,`small`),this._titleLabel.setAttribute(`bold`,`true`),this._titleLabel.className=n?`mint-sidenav-group-label is-interactive`:`mint-sidenav-group-label`,e.appendChild(this._titleLabel),this._titleCaret=null,n&&(this._titleCaret=document.createElement(`mint-icon`),this._titleCaret.setAttribute(`name`,`caret-right`),this._titleCaret.className=`mint-sidenav-group-caret`,this._titleCaret.setAttribute(`aria-hidden`,`true`),e.appendChild(this._titleCaret)),this._title?.parentElement===this._container?this._container.replaceChild(e,this._title):this._container.appendChild(e),this._title=e,this._titleIsInteractive=n}this._titleLabel&&(this._titleLabel.textContent=e,this._titleLabel.className=n?`mint-sidenav-group-label is-interactive`:`mint-sidenav-group-label`),this._title&&(this._title.className=`mint-sidenav-group-trigger${n?` is-interactive`:``}`),t?this._title.parentElement!==this._container&&this._container?.insertBefore(this._title,this._list):this._title.parentElement===this._container&&this._container?.removeChild(this._title),this._list||(this._list=document.createElement(`div`),this._list.className=`mint-sidenav-link-list`,this._container.appendChild(this._list)),Array.from(this.children).filter(e=>e!==this._container&&e.tagName===`MINT-SIDENAV-LINK`).forEach(e=>{this._list&&e.parentElement!==this._list&&this._list.appendChild(e)})}};customElements.get(`mint-sidenav-links`)||e.t(`mint-sidenav-links`,r);var i=class extends HTMLElement{static get observedAttributes(){return[`separated`]}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isSeparated(){return this.getAttribute(`separated`)===`true`}render(){this.className=this._isSeparated()?`mint-sidenav-action-links is-separated`:`mint-sidenav-action-links`}};customElements.get(`mint-sidenav-action-links`)||e.t(`mint-sidenav-action-links`,i);var a=class extends HTMLElement{constructor(...e){super(...e),this._wrapper=null,this._trigger=null,this._popover=null,this._triggerId=``,this._contentObserver=null,this._renderFrame=null}static get observedAttributes(){return[`title`,`subtitle`]}connectedCallback(){this._triggerId=this.id?`${this.id}-trigger`:`mint-sidenav-action-menu-${Math.random().toString(36).slice(2,9)}`,this.render(),this._observeContentMutations()}disconnectedCallback(){this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}_getTitle(){return this.getAttribute(`title`)||``}_getSubtitle(){return this.getAttribute(`subtitle`)||``}_createDefaultGroup(){let e=document.createElement(`mint-sidenav-action-links`),t=document.createElement(`div`);return t.appendChild(e),t}render(){let e=Array.from(this.children).filter(e=>e!==this._wrapper&&e.getAttribute(`slot`)===`action-links`);this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-sidenav-action-menu-wrap`,this.appendChild(this._wrapper)),this._wrapper.innerHTML=``,this._trigger=document.createElement(`button`),this._trigger.type=`button`,this._trigger.id=this._triggerId,this._trigger.className=`mint-sidenav-action-trigger`;let t=document.createElement(`div`);t.className=`mint-sidenav-avatar`,t.textContent=this._getTitle().split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase();let n=document.createElement(`div`);n.className=`mint-sidenav-action-text`;let r=document.createElement(`mint-text`);r.setAttribute(`size`,`body`),r.setAttribute(`bold`,`true`),r.className=`mint-sidenav-action-title`,r.textContent=this._getTitle();let i=document.createElement(`mint-text`);i.setAttribute(`size`,`small`),i.setAttribute(`variant`,`muted`),i.className=`mint-sidenav-action-subtitle`,i.textContent=this._getSubtitle(),n.appendChild(r),n.appendChild(i),this._trigger.appendChild(t),this._trigger.appendChild(n),this._popover=document.createElement(`mint-popover`),this._popover.setAttribute(`trigger-id`,this._triggerId),this._popover.setAttribute(`direction`,`right`),this._popover.setAttribute(`padding`,`0`);let a=document.createElement(`div`);a.className=`mint-sidenav-action-menu-content`,e.length>0?e.forEach(e=>{let t=e;t.setAttribute(`hidden`,`true`),t.style.display=`none`;let n=t.cloneNode(!0);n.removeAttribute(`hidden`),n.style.removeProperty(`display`),n.removeAttribute(`slot`),[...n.matches(`mint-button`)?[n]:[],...Array.from(n.querySelectorAll(`mint-button`))].forEach(e=>{let t=e.querySelector(`:scope > button`);for(;t;){let e=t.querySelector(`button`);if(!e)break;e.replaceWith(...Array.from(e.childNodes))}}),a.appendChild(n)}):a.appendChild(this._createDefaultGroup()),this._popover.appendChild(a),this._wrapper.appendChild(this._trigger),this._wrapper.appendChild(this._popover)}};customElements.get(`mint-sidenav-action-menu`)||e.t(`mint-sidenav-action-menu`,a);var o=`mint:url-change`;function s(){if(window.__mintUrlChangePatched)return;window.__mintUrlChangePatched=!0;let e=()=>{window.dispatchEvent(new Event(o))},t=t=>{let n=history[t].bind(history);history[t]=((...t)=>{let r=n(...t);return e(),r})};t(`pushState`),t(`replaceState`)}var c=class extends HTMLElement{constructor(...e){super(...e),this._backdrop=null,this._container=null,this._header=null,this._content=null,this._disposeContentFade=null,this._footer=null,this._escapeHandler=null,this._mediaQuery=null,this._mediaListener=null,this._accordionHandler=null,this._urlChangeHandler=null,this._contentObserver=null,this._renderFrame=null,this._onMobileNavNavigateClick=e=>{if(this._mediaQuery?.matches)return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`a[href]`);if(!(n instanceof HTMLAnchorElement)||!this._container?.contains(n))return;let r=n.getAttribute(`href`);!r||r===`#`||r.trim().toLowerCase().startsWith(`javascript:`)||this._isOpen()&&this.removeAttribute(`open`)}}static get observedAttributes(){return[`user-name`,`user-status`,`open`,`drawer-top-class`,`preview`]}connectedCallback(){this._attachEscapeListener(),this._attachMediaListener(),this._attachAccordionListener(),this._attachUrlChangeListener(),this._observeContentMutations(),this.render()}disconnectedCallback(){this._detachEscapeListener(),this._detachMediaListener(),this._detachAccordionListener(),this._detachUrlChangeListener(),this._contentObserver&&=(this._contentObserver.disconnect(),null),this._disposeContentFade?.(),this._disposeContentFade=null,this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_attachEscapeListener(){this._escapeHandler||(this._escapeHandler=e=>{e.key===`Escape`&&this.getAttribute(`open`)===`true`&&this.removeAttribute(`open`)},document.addEventListener(`keydown`,this._escapeHandler))}_detachEscapeListener(){this._escapeHandler&&=(document.removeEventListener(`keydown`,this._escapeHandler),null)}_attachMediaListener(){this._mediaListener||(this._mediaQuery=window.matchMedia(`(min-width: 1100px)`),this._mediaListener=()=>{this._mediaQuery?.matches&&this.removeAttribute(`open`)},this._mediaQuery.addEventListener(`change`,this._mediaListener))}_detachMediaListener(){this._mediaQuery&&this._mediaListener&&this._mediaQuery.removeEventListener(`change`,this._mediaListener),this._mediaQuery=null,this._mediaListener=null}_attachAccordionListener(){this._accordionHandler||(this._accordionHandler=e=>{let t=e.detail?.source;!(t instanceof HTMLElement)||t.tagName!==`MINT-SIDENAV-LINK`||this.contains(t)&&this.querySelectorAll(`mint-sidenav-link`).forEach(e=>{e!==t&&e.querySelector(`:scope .mint-sidenav-submenu`)&&e.setAttribute(`expanded`,`false`)})},this.addEventListener(`mint-sidenav-accordion`,this._accordionHandler))}_detachAccordionListener(){this._accordionHandler&&=(this.removeEventListener(`mint-sidenav-accordion`,this._accordionHandler),null)}_attachUrlChangeListener(){this._urlChangeHandler||(s(),this._urlChangeHandler=()=>{this._mediaQuery?.matches||this._isOpen()&&this.removeAttribute(`open`)},window.addEventListener(`popstate`,this._urlChangeHandler),window.addEventListener(`hashchange`,this._urlChangeHandler),window.addEventListener(o,this._urlChangeHandler))}_detachUrlChangeListener(){this._urlChangeHandler&&=(window.removeEventListener(`popstate`,this._urlChangeHandler),window.removeEventListener(`hashchange`,this._urlChangeHandler),window.removeEventListener(o,this._urlChangeHandler),null)}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}getUserName(){return this.getAttribute(`user-name`)||`Acme Inc`}getUserStatus(){return this.getAttribute(`user-status`)||`Enterprise`}_isOpen(){return this.getAttribute(`open`)===`true`}_ensureBackdrop(){this._backdrop||(this._backdrop=document.createElement(`div`),this._backdrop.setAttribute(`aria-hidden`,`true`),this._backdrop.addEventListener(`click`,()=>this.removeAttribute(`open`)),this.insertBefore(this._backdrop,this.firstChild))}_ensureContainer(){this._container||(this._container=document.createElement(`aside`),this._container.addEventListener(`click`,this._onMobileNavNavigateClick,!0),this.appendChild(this._container))}_syncShell(){let e=this._isOpen(),t=this.hasAttribute(`preview`);this._backdrop&&(this._backdrop.className=`mint-sidenav-backdrop${e&&!t?` is-open`:``}`),this._container&&(this._container.className=`mint-sidenav-panel${e?` is-open`:``}${t?` is-preview`:``}`)}_buildUserHeader(){if(!this._container)return;this._header||(this._header=document.createElement(`div`),this._header.className=`mint-sidenav-header`,this._container.appendChild(this._header));let e=Array.from(this.querySelectorAll(`[slot="action-header"]`)).find(e=>e!==this._backdrop&&e!==this._container);if(e){this._header.replaceChildren(e);return}let t=document.createElement(`mint-sidenav-action-menu`);t.setAttribute(`title`,this.getUserName()),t.setAttribute(`subtitle`,this.getUserStatus()),this._header.replaceChildren(t)}_replaceSlottedChildren(e,t){let n=Array.from(this.querySelectorAll(`[slot="${t}"]`)).filter(e=>e!==this._container&&e!==this._backdrop);e.replaceChildren(...n)}_buildContent(){this._container&&(this._content||(this._content=document.createElement(`div`),this._content.className=`mint-sidenav-content`,this._container.appendChild(this._content)),this._replaceSlottedChildren(this._content,`links`),this._disposeContentFade||=t.n(this._content,`vertical`))}_buildFooter(){if(!this._container)return;this._footer||(this._footer=document.createElement(`div`),this._footer.className=`mint-sidenav-footer`,this._container.appendChild(this._footer));let e=document.createElement(`div`);e.className=`mint-sidenav-footer-links`,this._replaceSlottedChildren(e,`bottom-links`),this._footer.innerHTML=``,this._footer.appendChild(e)}render(){this._ensureBackdrop(),this._ensureContainer(),this._syncShell(),this._buildUserHeader(),this._buildContent(),this._buildFooter()}};customElements.get(`mint-side-navigation`)||e.t(`mint-side-navigation`,c);var l=c;exports.MintSidenavActionLinks=i,exports.MintSidenavActionMenu=a,exports.MintSidenavLink=n,exports.MintSidenavLinks=r,exports.default=l;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-B9P0jyS2.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cia9x_J2.js`),require(`../chunks/text-CfvRRKGZ.js`),require(`../chunks/caret-right-B8gOXLh9.js`),require(`../chunks/caret-down-DbFlPN-2.js`),require(`../chunks/popover-CWWKb7L1.js`);const t=require(`../chunks/ScrollFade-Dfq2B1Hm.js`);var n=class extends HTMLElement{constructor(...e){super(...e),this._trigger=null,this._submenuContainer=null,this._contentObserver=null,this._renderFrame=null}static get observedAttributes(){return[`label`,`icon`,`href`,`active`,`expanded`,`submenu-item`]}connectedCallback(){this.render(),this._observeSubmenuMutations()}disconnectedCallback(){this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&(this.render(),e===`active`&&this._isSubmenuItem()&&this._refreshDropdownAncestor())}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeSubmenuMutations(){this._contentObserver||=new MutationObserver(e=>{e.some(e=>[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].some(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`submenu`))&&this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`],subtree:!1})}_refreshDropdownAncestor(){let e=this.parentElement;for(;e;){if(e.tagName===`MINT-SIDENAV-LINK`&&e!==this){e.render();break}e=e.parentElement}}_isActive(){return this.getAttribute(`active`)===`true`}_isExpanded(){return this.getAttribute(`expanded`)===`true`}_isSubmenuPanelVisible(){return this._isExpanded()||this._isActive()}_isSubmenuItem(){return this.getAttribute(`submenu-item`)===`true`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}_getBaseClasses(){return`mint-sidenav-link-control${this._isActive()?` is-active`:``}${this._isSubmenuItem()?` is-submenu-item`:``}`}_hasSubmenu(){return this.querySelectorAll(`:scope > [slot="submenu"]`).length>0?!0:!!this._submenuContainer&&this._submenuContainer.children.length>0}_createRow(e,t){let n=document.createElement(`span`);if(n.className=`mint-sidenav-link-row`,t){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,t),e.className=`mint-sidenav-link-icon`,e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}let r=document.createElement(`span`);return r.className=`mint-sidenav-link-label`,r.textContent=e,n.appendChild(r),n}_buildSimpleLink(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=e?document.createElement(`a`):document.createElement(`button`);e?r.setAttribute(`href`,e):r.setAttribute(`type`,`button`),r.className=this._getBaseClasses(),r.setAttribute(`aria-label`,t||`Side navigation link`),r.appendChild(this._createRow(t,n)),this.replaceChildren(r),this._trigger=r}_emitAccordionExpand(){this.dispatchEvent(new CustomEvent(`mint-sidenav-accordion`,{bubbles:!0,composed:!0,detail:{source:this}}))}_setExpanded(e,t){this.setAttribute(`expanded`,String(e)),e&&t&&this._emitAccordionExpand()}_buildDropdownLink(){let e=this._getLabel(),t=this._getIcon(),n=this._getHref(),r=Array.from(this.querySelectorAll(`:scope > [slot="submenu"]`)),i=r.length>0?r:this._submenuContainer?Array.from(this._submenuContainer.children):[],a=document.createElement(`div`);a.className=`mint-sidenav-dropdown`,this._submenuContainer=document.createElement(`div`),this._submenuContainer.id=`mint-sidenav-submenu-${Math.random().toString(36).slice(2,11)}`;let o=this._submenuContainer.id;if(this._submenuContainer.className=`mint-sidenav-submenu${this._isSubmenuPanelVisible()?` is-expanded`:``}`,i.forEach(e=>{e.setAttribute(`submenu-item`,`true`),e.setAttribute(`slot`,`submenu`),this._submenuContainer?.appendChild(e)}),n){let r=document.createElement(`div`);r.className=`mint-sidenav-link-row-wrap`;let i=document.createElement(`a`);i.setAttribute(`href`,n),i.className=`${this._getBaseClasses()} mint-sidenav-desktop-link`,i.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),i.setAttribute(`aria-controls`,o),this._isActive()?i.setAttribute(`aria-current`,`page`):i.removeAttribute(`aria-current`),i.appendChild(this._createRow(e,t)),i.addEventListener(`click`,()=>{this._setExpanded(!0,!0)});let s=document.createElement(`a`);s.setAttribute(`href`,n),s.className=`${this._getBaseClasses()} mint-sidenav-mobile-link`,s.setAttribute(`aria-controls`,o),s.appendChild(this._createRow(e,t)),this._isActive()?s.setAttribute(`aria-current`,`page`):s.removeAttribute(`aria-current`);let c=document.createElement(`button`);c.type=`button`,c.className=`mint-sidenav-mobile-toggle`,c.setAttribute(`aria-label`,`Toggle ${e} submenu`),c.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),c.setAttribute(`aria-controls`,o),c.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation();let t=!this._isSubmenuPanelVisible();!t&&this._isActive()&&this.removeAttribute(`active`),this._setExpanded(t,t)});let l=document.createElement(`mint-icon`);l.setAttribute(`name`,`caret-down`),l.className=`mint-sidenav-dropdown-caret${this._isSubmenuPanelVisible()?` is-expanded`:``}`,l.setAttribute(`aria-hidden`,`true`),c.appendChild(l),r.appendChild(i),r.appendChild(s),r.appendChild(c),a.appendChild(r),this._trigger=i}else{let n=document.createElement(`button`);n.type=`button`,n.className=this._getBaseClasses(),n.setAttribute(`aria-expanded`,String(this._isSubmenuPanelVisible())),n.setAttribute(`aria-controls`,o),n.appendChild(this._createRow(e,t)),n.onclick=()=>{let e=!this._isExpanded();this._setExpanded(e,e)},a.appendChild(n),this._trigger=n}a.appendChild(this._submenuContainer),this.replaceChildren(a)}render(){this._hasSubmenu()&&!this._isSubmenuItem()?this._buildDropdownLink():this._buildSimpleLink()}};customElements.get(`mint-sidenav-link`)||e.t(`mint-sidenav-link`,n);var r=class extends HTMLElement{constructor(...e){super(...e),this._container=null,this._title=null,this._titleLabel=null,this._titleCaret=null,this._titleIsInteractive=null,this._list=null,this._titleClickHandler=null,this._listenerCounts=new Map}static get observedAttributes(){return[`name`]}get onMintNameClick(){return this._onMintNameClick}set onMintNameClick(e){this._onMintNameClick=e,this.render()}addEventListener(e,t,n){super.addEventListener(e,t,n),this._trackListener(e,1)}removeEventListener(e,t,n){super.removeEventListener(e,t,n),this._trackListener(e,-1)}connectedCallback(){this.render(),this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.addEventListener(`click`,this._titleClickHandler)}disconnectedCallback(){this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.removeEventListener(`click`,this._titleClickHandler)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getName(){return this.getAttribute(`name`)||``}_trackListener(e,t){if(e!==`mint-name-click`)return;let n=this._listenerCounts.get(e)||0,r=Math.max(0,n+t);this._listenerCounts.set(e,r),this.render()}_isNameInteractive(){return(this._listenerCounts.get(`mint-name-click`)||0)>0||typeof this._onMintNameClick==`function`}_emitNameClick(e){let t=new CustomEvent(`mint-name-click`,{detail:{name:this._getName(),originalEvent:e},bubbles:!0,composed:!0});this.dispatchEvent(t),typeof this._onMintNameClick==`function`&&this._onMintNameClick(t)}render(){this._container||(this._container=document.createElement(`section`),this._container.className=`mint-sidenav-link-group`,this.appendChild(this._container));let e=this._getName(),t=e.trim().length>0,n=this._isNameInteractive();if(!this._title||this._titleIsInteractive!==n){this._title instanceof HTMLButtonElement&&this._titleClickHandler&&this._title.removeEventListener(`click`,this._titleClickHandler);let e=n?document.createElement(`button`):document.createElement(`div`);e instanceof HTMLButtonElement?(e.type=`button`,this._titleClickHandler=e=>this._emitNameClick(e),e.addEventListener(`click`,this._titleClickHandler)):(e.setAttribute(`role`,`heading`),e.setAttribute(`aria-level`,`3`),this._titleClickHandler=null),e.className=`mint-sidenav-group-trigger${n?` is-interactive`:``}`,this._titleLabel=document.createElement(`mint-text`),this._titleLabel.setAttribute(`size`,`small`),this._titleLabel.setAttribute(`bold`,`true`),this._titleLabel.className=n?`mint-sidenav-group-label is-interactive`:`mint-sidenav-group-label`,e.appendChild(this._titleLabel),this._titleCaret=null,n&&(this._titleCaret=document.createElement(`mint-icon`),this._titleCaret.setAttribute(`name`,`caret-right`),this._titleCaret.className=`mint-sidenav-group-caret`,this._titleCaret.setAttribute(`aria-hidden`,`true`),e.appendChild(this._titleCaret)),this._title?.parentElement===this._container?this._container.replaceChild(e,this._title):this._container.appendChild(e),this._title=e,this._titleIsInteractive=n}this._titleLabel&&(this._titleLabel.textContent=e,this._titleLabel.className=n?`mint-sidenav-group-label is-interactive`:`mint-sidenav-group-label`),this._title&&(this._title.className=`mint-sidenav-group-trigger${n?` is-interactive`:``}`),t?this._title.parentElement!==this._container&&this._container?.insertBefore(this._title,this._list):this._title.parentElement===this._container&&this._container?.removeChild(this._title),this._list||(this._list=document.createElement(`div`),this._list.className=`mint-sidenav-link-list`,this._container.appendChild(this._list)),Array.from(this.children).filter(e=>e!==this._container&&e.tagName===`MINT-SIDENAV-LINK`).forEach(e=>{this._list&&e.parentElement!==this._list&&this._list.appendChild(e)})}};customElements.get(`mint-sidenav-links`)||e.t(`mint-sidenav-links`,r);var i=class extends HTMLElement{static get observedAttributes(){return[`separated`]}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isSeparated(){return this.getAttribute(`separated`)===`true`}render(){this.className=this._isSeparated()?`mint-sidenav-action-links is-separated`:`mint-sidenav-action-links`}};customElements.get(`mint-sidenav-action-links`)||e.t(`mint-sidenav-action-links`,i);var a=class extends HTMLElement{constructor(...e){super(...e),this._wrapper=null,this._trigger=null,this._popover=null,this._triggerId=``,this._contentObserver=null,this._renderFrame=null}static get observedAttributes(){return[`title`,`subtitle`]}connectedCallback(){this._triggerId=this.id?`${this.id}-trigger`:`mint-sidenav-action-menu-${Math.random().toString(36).slice(2,9)}`,this.render(),this._observeContentMutations()}disconnectedCallback(){this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}_getTitle(){return this.getAttribute(`title`)||``}_getSubtitle(){return this.getAttribute(`subtitle`)||``}_createDefaultGroup(){let e=document.createElement(`mint-sidenav-action-links`),t=document.createElement(`div`);return t.appendChild(e),t}render(){let e=Array.from(this.children).filter(e=>e!==this._wrapper&&e.getAttribute(`slot`)===`action-links`);this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-sidenav-action-menu-wrap`,this.appendChild(this._wrapper)),this._wrapper.innerHTML=``,this._trigger=document.createElement(`button`),this._trigger.type=`button`,this._trigger.id=this._triggerId,this._trigger.className=`mint-sidenav-action-trigger`;let t=document.createElement(`div`);t.className=`mint-sidenav-avatar`,t.textContent=this._getTitle().split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase();let n=document.createElement(`div`);n.className=`mint-sidenav-action-text`;let r=document.createElement(`mint-text`);r.setAttribute(`size`,`body`),r.setAttribute(`bold`,`true`),r.className=`mint-sidenav-action-title`,r.textContent=this._getTitle();let i=document.createElement(`mint-text`);i.setAttribute(`size`,`small`),i.setAttribute(`variant`,`muted`),i.className=`mint-sidenav-action-subtitle`,i.textContent=this._getSubtitle(),n.appendChild(r),n.appendChild(i),this._trigger.appendChild(t),this._trigger.appendChild(n),this._popover=document.createElement(`mint-popover`),this._popover.setAttribute(`trigger-id`,this._triggerId),this._popover.setAttribute(`direction`,`right`),this._popover.setAttribute(`padding`,`0`);let a=document.createElement(`div`);a.className=`mint-sidenav-action-menu-content`,e.length>0?e.forEach(e=>{let t=e;t.setAttribute(`hidden`,`true`),t.style.display=`none`;let n=t.cloneNode(!0);n.removeAttribute(`hidden`),n.style.removeProperty(`display`),n.removeAttribute(`slot`),[...n.matches(`mint-button`)?[n]:[],...Array.from(n.querySelectorAll(`mint-button`))].forEach(e=>{let t=e.querySelector(`:scope > button`);for(;t;){let e=t.querySelector(`button`);if(!e)break;e.replaceWith(...Array.from(e.childNodes))}}),a.appendChild(n)}):a.appendChild(this._createDefaultGroup()),this._popover.appendChild(a),this._wrapper.appendChild(this._trigger),this._wrapper.appendChild(this._popover)}};customElements.get(`mint-sidenav-action-menu`)||e.t(`mint-sidenav-action-menu`,a);var o=`mint:url-change`;function s(){if(window.__mintUrlChangePatched)return;window.__mintUrlChangePatched=!0;let e=()=>{window.dispatchEvent(new Event(o))},t=t=>{let n=history[t].bind(history);history[t]=((...t)=>{let r=n(...t);return e(),r})};t(`pushState`),t(`replaceState`)}var c=class extends HTMLElement{constructor(...e){super(...e),this._backdrop=null,this._container=null,this._header=null,this._content=null,this._disposeContentFade=null,this._footer=null,this._escapeHandler=null,this._mediaQuery=null,this._mediaListener=null,this._accordionHandler=null,this._urlChangeHandler=null,this._contentObserver=null,this._renderFrame=null,this._onMobileNavNavigateClick=e=>{if(this._mediaQuery?.matches)return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`a[href]`);if(!(n instanceof HTMLAnchorElement)||!this._container?.contains(n))return;let r=n.getAttribute(`href`);!r||r===`#`||r.trim().toLowerCase().startsWith(`javascript:`)||this._isOpen()&&this.removeAttribute(`open`)}}static get observedAttributes(){return[`user-name`,`user-status`,`open`,`drawer-top-class`,`preview`]}connectedCallback(){this._attachEscapeListener(),this._attachMediaListener(),this._attachAccordionListener(),this._attachUrlChangeListener(),this._observeContentMutations(),this.render()}disconnectedCallback(){this._detachEscapeListener(),this._detachMediaListener(),this._detachAccordionListener(),this._detachUrlChangeListener(),this._contentObserver&&=(this._contentObserver.disconnect(),null),this._disposeContentFade?.(),this._disposeContentFade=null,this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){t!==n&&this.render()}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_attachEscapeListener(){this._escapeHandler||(this._escapeHandler=e=>{e.key===`Escape`&&this.getAttribute(`open`)===`true`&&this.removeAttribute(`open`)},document.addEventListener(`keydown`,this._escapeHandler))}_detachEscapeListener(){this._escapeHandler&&=(document.removeEventListener(`keydown`,this._escapeHandler),null)}_attachMediaListener(){this._mediaListener||(this._mediaQuery=window.matchMedia(`(min-width: 1100px)`),this._mediaListener=()=>{this._mediaQuery?.matches&&this.removeAttribute(`open`)},this._mediaQuery.addEventListener(`change`,this._mediaListener))}_detachMediaListener(){this._mediaQuery&&this._mediaListener&&this._mediaQuery.removeEventListener(`change`,this._mediaListener),this._mediaQuery=null,this._mediaListener=null}_attachAccordionListener(){this._accordionHandler||(this._accordionHandler=e=>{let t=e.detail?.source;!(t instanceof HTMLElement)||t.tagName!==`MINT-SIDENAV-LINK`||this.contains(t)&&this.querySelectorAll(`mint-sidenav-link`).forEach(e=>{e!==t&&e.querySelector(`:scope .mint-sidenav-submenu`)&&e.setAttribute(`expanded`,`false`)})},this.addEventListener(`mint-sidenav-accordion`,this._accordionHandler))}_detachAccordionListener(){this._accordionHandler&&=(this.removeEventListener(`mint-sidenav-accordion`,this._accordionHandler),null)}_attachUrlChangeListener(){this._urlChangeHandler||(s(),this._urlChangeHandler=()=>{this._mediaQuery?.matches||this._isOpen()&&this.removeAttribute(`open`)},window.addEventListener(`popstate`,this._urlChangeHandler),window.addEventListener(`hashchange`,this._urlChangeHandler),window.addEventListener(o,this._urlChangeHandler))}_detachUrlChangeListener(){this._urlChangeHandler&&=(window.removeEventListener(`popstate`,this._urlChangeHandler),window.removeEventListener(`hashchange`,this._urlChangeHandler),window.removeEventListener(o,this._urlChangeHandler),null)}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}getUserName(){return this.getAttribute(`user-name`)||`Acme Inc`}getUserStatus(){return this.getAttribute(`user-status`)||`Enterprise`}_isOpen(){return this.getAttribute(`open`)===`true`}_ensureBackdrop(){this._backdrop||(this._backdrop=document.createElement(`div`),this._backdrop.setAttribute(`aria-hidden`,`true`),this._backdrop.addEventListener(`click`,()=>this.removeAttribute(`open`)),this.insertBefore(this._backdrop,this.firstChild))}_ensureContainer(){this._container||(this._container=document.createElement(`aside`),this._container.addEventListener(`click`,this._onMobileNavNavigateClick,!0),this.appendChild(this._container))}_syncShell(){let e=this._isOpen(),t=this.hasAttribute(`preview`);this._backdrop&&(this._backdrop.className=`mint-sidenav-backdrop${e&&!t?` is-open`:``}`),this._container&&(this._container.className=`mint-sidenav-panel${e?` is-open`:``}${t?` is-preview`:``}`)}_buildUserHeader(){if(!this._container)return;this._header||(this._header=document.createElement(`div`),this._header.className=`mint-sidenav-header`,this._container.appendChild(this._header));let e=Array.from(this.querySelectorAll(`[slot="action-header"]`)).find(e=>e!==this._backdrop&&e!==this._container);if(e){this._header.replaceChildren(e);return}let t=document.createElement(`mint-sidenav-action-menu`);t.setAttribute(`title`,this.getUserName()),t.setAttribute(`subtitle`,this.getUserStatus()),this._header.replaceChildren(t)}_replaceSlottedChildren(e,t){let n=Array.from(this.querySelectorAll(`[slot="${t}"]`)).filter(e=>e!==this._container&&e!==this._backdrop);e.replaceChildren(...n)}_buildContent(){this._container&&(this._content||(this._content=document.createElement(`div`),this._content.className=`mint-sidenav-content`,this._container.appendChild(this._content)),this._replaceSlottedChildren(this._content,`links`),this._disposeContentFade||=t.n(this._content,`vertical`))}_buildFooter(){if(!this._container)return;this._footer||(this._footer=document.createElement(`div`),this._footer.className=`mint-sidenav-footer`,this._container.appendChild(this._footer));let e=document.createElement(`div`);e.className=`mint-sidenav-footer-links`,this._replaceSlottedChildren(e,`bottom-links`),this._footer.innerHTML=``,this._footer.appendChild(e)}render(){this._ensureBackdrop(),this._ensureContainer(),this._syncShell(),this._buildUserHeader(),this._buildContent(),this._buildFooter()}};customElements.get(`mint-side-navigation`)||e.t(`mint-side-navigation`,c);var l=c;exports.MintSidenavActionLinks=i,exports.MintSidenavActionMenu=a,exports.MintSidenavLink=n,exports.MintSidenavLinks=r,exports.default=l;
@@ -129,8 +129,8 @@ var n = class extends HTMLElement {
129
129
  let c = document.createElement("button");
130
130
  c.type = "button", c.className = "mint-sidenav-mobile-toggle", c.setAttribute("aria-label", `Toggle ${e} submenu`), c.setAttribute("aria-expanded", String(this._isSubmenuPanelVisible())), c.setAttribute("aria-controls", o), c.addEventListener("click", (e) => {
131
131
  e.preventDefault(), e.stopPropagation();
132
- let t = !this._isExpanded();
133
- this._setExpanded(t, t);
132
+ let t = !this._isSubmenuPanelVisible();
133
+ !t && this._isActive() && this.removeAttribute("active"), this._setExpanded(t, t);
134
134
  });
135
135
  let l = document.createElement("mint-icon");
136
136
  l.setAttribute("name", "caret-down"), l.className = `mint-sidenav-dropdown-caret${this._isSubmenuPanelVisible() ? " is-expanded" : ""}`, l.setAttribute("aria-hidden", "true"), c.appendChild(l), r.appendChild(i), r.appendChild(s), r.appendChild(c), a.appendChild(r), this._trigger = i;
package/dist/form.css CHANGED
@@ -1,2 +1,2 @@
1
1
  /* mint-ui component style: form */
2
- @layer theme, base, components, utilities;/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer utilities{.static{position:static}.hidden{display:none}.inline{display:inline}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@layer components{mint-form.mint-form-host{width:100%;display:block}mint-form .mint-form-content{gap:calc(var(--spacing,.25rem) * 4);flex-direction:column;display:flex}}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
2
+ @layer theme, base, components, utilities;/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer utilities{.static{position:static}.block{display:block}.hidden{display:none}.inline{display:inline}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@layer components{mint-form.mint-form-host{width:100%;display:block}mint-form .mint-form-content{gap:calc(var(--spacing,.25rem) * 4);flex-direction:column;display:flex}}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}