@toolbox-web/grid 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.js +13 -13
- package/all.js.map +1 -1
- package/index.js +384 -359
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/event-delegation.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +11 -0
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +1 -0
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +8 -1
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/copy.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +55 -55
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +31 -31
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +20 -20
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +10 -10
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +4 -4
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
package/index.js
CHANGED
|
@@ -63,8 +63,8 @@ function gt(t) {
|
|
|
63
63
|
g && (h.__editorName = g), u && (h.__rendererName = u);
|
|
64
64
|
const d = i.getAttribute("options");
|
|
65
65
|
d && (h.options = d.split(",").map((m) => {
|
|
66
|
-
const [x,
|
|
67
|
-
return { value: x.trim(), label:
|
|
66
|
+
const [x, I] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
|
|
67
|
+
return { value: x.trim(), label: I?.trim() || x.trim() };
|
|
68
68
|
}));
|
|
69
69
|
const w = i.querySelector("tbw-grid-column-view"), v = i.querySelector("tbw-grid-column-editor"), b = i.querySelector("tbw-grid-column-header");
|
|
70
70
|
w && (h.__viewTemplate = w), v && (h.__editorTemplate = v), b && (h.__headerTemplate = b);
|
|
@@ -349,7 +349,7 @@ class Lt {
|
|
|
349
349
|
const e = (this.#o.columns?.length ?? 0) > 0;
|
|
350
350
|
if (!this.#f && e)
|
|
351
351
|
return;
|
|
352
|
-
const i = this.#
|
|
352
|
+
const i = this.#I();
|
|
353
353
|
this.#f = !1, this.#a = i, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#o = this.#x(this.#a), this.#m();
|
|
354
354
|
}
|
|
355
355
|
#x(e) {
|
|
@@ -378,7 +378,7 @@ class Lt {
|
|
|
378
378
|
n && (!o.renderer && !o.viewRenderer && n.renderer && (o.renderer = n.renderer), !o.format && n.format && (o.format = n.format), !o.editor && n.editor && (o.editor = n.editor), !o.editorParams && n.editorParams && (o.editorParams = n.editorParams));
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
#
|
|
381
|
+
#I() {
|
|
382
382
|
const e = this.#l ? { ...this.#l } : {}, i = Array.isArray(e.columns) ? [...e.columns] : [], o = (this.#d ?? []).map((s) => ({
|
|
383
383
|
...s
|
|
384
384
|
}));
|
|
@@ -646,7 +646,7 @@ function zt(t) {
|
|
|
646
646
|
function He(t) {
|
|
647
647
|
return zt(t) === "rtl";
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function no(t, e) {
|
|
650
650
|
return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
|
|
651
651
|
}
|
|
652
652
|
function Qe(t, e) {
|
|
@@ -743,12 +743,12 @@ function Mt(t, e, i, o, n) {
|
|
|
743
743
|
}
|
|
744
744
|
const x = d.classList.contains("changed");
|
|
745
745
|
y !== x && d.classList.toggle("changed", y);
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
746
|
+
const I = t.effectiveConfig?.rowClass;
|
|
747
|
+
if (I) {
|
|
748
748
|
const S = d.getAttribute("data-dynamic-classes");
|
|
749
749
|
S && S.split(" ").forEach((L) => L && d.classList.remove(L));
|
|
750
750
|
try {
|
|
751
|
-
const L =
|
|
751
|
+
const L = I(u);
|
|
752
752
|
if (L && L.length > 0) {
|
|
753
753
|
const re = L.filter((X) => X && typeof X == "string");
|
|
754
754
|
re.forEach((X) => d.classList.add(X)), d.setAttribute("data-dynamic-classes", re.join(" "));
|
|
@@ -818,8 +818,8 @@ function ae(t, e, i, o) {
|
|
|
818
818
|
try {
|
|
819
819
|
const m = i[d.field], x = _(m, i, d);
|
|
820
820
|
if (x && x.length > 0) {
|
|
821
|
-
const
|
|
822
|
-
|
|
821
|
+
const I = x.filter((S) => S && typeof S == "string");
|
|
822
|
+
I.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", I.join(" "));
|
|
823
823
|
} else
|
|
824
824
|
w.removeAttribute("data-dynamic-classes");
|
|
825
825
|
} catch (m) {
|
|
@@ -1033,6 +1033,7 @@ function kt(t, e) {
|
|
|
1033
1033
|
), v = {
|
|
1034
1034
|
rowIndex: h,
|
|
1035
1035
|
colIndex: f,
|
|
1036
|
+
column: p,
|
|
1036
1037
|
field: u,
|
|
1037
1038
|
value: d,
|
|
1038
1039
|
row: g,
|
|
@@ -1109,9 +1110,12 @@ function $(t, e) {
|
|
|
1109
1110
|
}
|
|
1110
1111
|
}
|
|
1111
1112
|
const ie = /* @__PURE__ */ new WeakMap();
|
|
1112
|
-
function
|
|
1113
|
+
function It(t, e) {
|
|
1113
1114
|
const i = Ke(e), o = Pt(e);
|
|
1114
|
-
i < 0 || o < 0
|
|
1115
|
+
if (i < 0 || o < 0) return;
|
|
1116
|
+
t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
|
|
1117
|
+
const n = e.closest("tbw-grid");
|
|
1118
|
+
n && document.activeElement !== n && n.focus({ preventScroll: !0 });
|
|
1115
1119
|
}
|
|
1116
1120
|
function ye(t, e, i, o) {
|
|
1117
1121
|
let n = null;
|
|
@@ -1137,7 +1141,7 @@ function ye(t, e, i, o) {
|
|
|
1137
1141
|
cell: c !== void 0 && h !== void 0 && c >= 0 && h >= 0 ? { row: c, col: h } : void 0
|
|
1138
1142
|
};
|
|
1139
1143
|
}
|
|
1140
|
-
function
|
|
1144
|
+
function Nt(t, e, i) {
|
|
1141
1145
|
const o = ye(t, e, i, "mousedown");
|
|
1142
1146
|
(t._dispatchCellMouseDown?.(o) ?? !1) && ie.set(t, !0);
|
|
1143
1147
|
}
|
|
@@ -1156,14 +1160,17 @@ function Wt(t, e, i) {
|
|
|
1156
1160
|
"mousedown",
|
|
1157
1161
|
(o) => {
|
|
1158
1162
|
const n = o.target.closest(".cell[data-col]");
|
|
1159
|
-
n && (n.classList.contains("editing") ||
|
|
1163
|
+
n && (n.classList.contains("editing") || (o.preventDefault(), It(t, n)));
|
|
1160
1164
|
},
|
|
1161
1165
|
{ signal: i }
|
|
1162
1166
|
), e.addEventListener(
|
|
1163
1167
|
"click",
|
|
1164
1168
|
(o) => {
|
|
1165
1169
|
const n = o.target.closest(".data-grid-row");
|
|
1166
|
-
n && Le(t, o, n)
|
|
1170
|
+
if (n && Le(t, o, n), !document.activeElement?.closest(".cell.editing")) {
|
|
1171
|
+
const r = o.target.closest("tbw-grid");
|
|
1172
|
+
r && r.focus({ preventScroll: !0 });
|
|
1173
|
+
}
|
|
1167
1174
|
},
|
|
1168
1175
|
{ signal: i }
|
|
1169
1176
|
), e.addEventListener(
|
|
@@ -1176,7 +1183,7 @@ function Wt(t, e, i) {
|
|
|
1176
1183
|
);
|
|
1177
1184
|
}
|
|
1178
1185
|
function Ft(t, e, i, o) {
|
|
1179
|
-
e.addEventListener("keydown", (n) => kt(t, n), { signal: o }), i.addEventListener("mousedown", (n) =>
|
|
1186
|
+
e.addEventListener("keydown", (n) => kt(t, n), { signal: o }), i.addEventListener("mousedown", (n) => Nt(t, i, n), { signal: o }), document.addEventListener("mousemove", (n) => qt(t, i, n), { signal: o }), document.addEventListener("mouseup", (n) => $t(t, i, n), { signal: o });
|
|
1180
1187
|
}
|
|
1181
1188
|
function Ut(t, e) {
|
|
1182
1189
|
return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
|
|
@@ -1231,10 +1238,10 @@ function Z(t, e, i, o) {
|
|
|
1231
1238
|
o.classList.add("sortable"), o.tabIndex = 0;
|
|
1232
1239
|
const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
|
|
1233
1240
|
o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
|
|
1234
|
-
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r,
|
|
1241
|
+
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, e, o) || ze(t, e);
|
|
1235
1242
|
}), o.addEventListener("keydown", (r) => {
|
|
1236
1243
|
if (r.key === "Enter" || r.key === " ") {
|
|
1237
|
-
if (r.preventDefault(), t._dispatchHeaderClick?.(r,
|
|
1244
|
+
if (r.preventDefault(), t._dispatchHeaderClick?.(r, e, o)) return;
|
|
1238
1245
|
ze(t, e);
|
|
1239
1246
|
}
|
|
1240
1247
|
});
|
|
@@ -1606,7 +1613,7 @@ function di(t) {
|
|
|
1606
1613
|
}
|
|
1607
1614
|
return t.position === "left" && r ? (e.appendChild(r), e.appendChild(n)) : (e.appendChild(n), r && e.appendChild(r)), e;
|
|
1608
1615
|
}
|
|
1609
|
-
function
|
|
1616
|
+
function N(t) {
|
|
1610
1617
|
return t ? typeof t == "string" ? t : t.outerHTML : "";
|
|
1611
1618
|
}
|
|
1612
1619
|
function hi() {
|
|
@@ -1632,7 +1639,7 @@ function st(t) {
|
|
|
1632
1639
|
return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
|
|
1633
1640
|
}
|
|
1634
1641
|
function ui(t, e, i = "☰") {
|
|
1635
|
-
const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r =
|
|
1642
|
+
const o = t?.header?.title ?? e.lightDomTitle ?? "", n = !!o, r = N(i), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((d) => d.id)), c = [...s];
|
|
1636
1643
|
for (const d of l)
|
|
1637
1644
|
a.has(d.id) || c.push(d);
|
|
1638
1645
|
const h = c.length > 0, f = e.toolPanels.size > 0, p = h && f, g = [...c].sort((d, w) => (d.order ?? 0) - (w.order ?? 0));
|
|
@@ -1653,7 +1660,7 @@ function ui(t, e, i = "☰") {
|
|
|
1653
1660
|
</div>
|
|
1654
1661
|
`;
|
|
1655
1662
|
}
|
|
1656
|
-
function
|
|
1663
|
+
function Ie(t, e) {
|
|
1657
1664
|
const i = t.querySelector("tbw-grid-header");
|
|
1658
1665
|
if (!i) return;
|
|
1659
1666
|
if (!e.lightDomTitle) {
|
|
@@ -1663,7 +1670,7 @@ function Ne(t, e) {
|
|
|
1663
1670
|
const o = i.querySelectorAll("tbw-grid-header-content");
|
|
1664
1671
|
o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
|
|
1665
1672
|
}
|
|
1666
|
-
function
|
|
1673
|
+
function Ne(t, e, i) {
|
|
1667
1674
|
const o = t.querySelector(":scope > tbw-grid-tool-buttons");
|
|
1668
1675
|
if (!o) return;
|
|
1669
1676
|
e.hasToolButtonsContainer = !0;
|
|
@@ -1741,7 +1748,18 @@ function fi(t, e, i, o) {
|
|
|
1741
1748
|
}
|
|
1742
1749
|
});
|
|
1743
1750
|
}
|
|
1744
|
-
function gi(t, e, i) {
|
|
1751
|
+
function gi(t, e, i, o) {
|
|
1752
|
+
if (!e?.toolPanel?.closeOnClickOutside)
|
|
1753
|
+
return () => {
|
|
1754
|
+
};
|
|
1755
|
+
const n = (r) => {
|
|
1756
|
+
if (!i.isPanelOpen) return;
|
|
1757
|
+
const s = r.target;
|
|
1758
|
+
s && (s.closest(".tbw-tool-panel") || s.closest("[data-panel-toggle]") || o());
|
|
1759
|
+
};
|
|
1760
|
+
return t.addEventListener("mousedown", n), () => t.removeEventListener("mousedown", n);
|
|
1761
|
+
}
|
|
1762
|
+
function pi(t, e, i) {
|
|
1745
1763
|
const o = t.querySelector(".tbw-tool-panel"), n = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
|
|
1746
1764
|
if (!o || !n || !r)
|
|
1747
1765
|
return () => {
|
|
@@ -1797,9 +1815,9 @@ function ge(t, e) {
|
|
|
1797
1815
|
c && e.headerContentCleanups.set(s.id, c);
|
|
1798
1816
|
}
|
|
1799
1817
|
}
|
|
1800
|
-
function
|
|
1818
|
+
function wi(t, e, i) {
|
|
1801
1819
|
if (!e.isPanelOpen) return;
|
|
1802
|
-
const o =
|
|
1820
|
+
const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
|
|
1803
1821
|
for (const [r, s] of e.toolPanels) {
|
|
1804
1822
|
const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
|
|
1805
1823
|
if (!a || !c) continue;
|
|
@@ -1831,7 +1849,7 @@ function he(t) {
|
|
|
1831
1849
|
e();
|
|
1832
1850
|
t.toolbarContentCleanups.clear();
|
|
1833
1851
|
}
|
|
1834
|
-
function
|
|
1852
|
+
function bi(t) {
|
|
1835
1853
|
for (const e of t.headerContentCleanups.values())
|
|
1836
1854
|
e();
|
|
1837
1855
|
t.headerContentCleanups.clear();
|
|
@@ -1848,7 +1866,7 @@ function wi(t) {
|
|
|
1848
1866
|
t.toolPanels.get(e)?.onClose?.();
|
|
1849
1867
|
t.isPanelOpen = !1, t.expandedSections.clear(), t.toolPanels.clear(), t.headerContents.clear(), t.toolbarContents.clear(), t.lightDomHeaderContent = [], t.lightDomToolPanelIds.clear(), t.lightDomToolbarContentIds.clear(), t.lightDomContentMoved = !1;
|
|
1850
1868
|
}
|
|
1851
|
-
function
|
|
1869
|
+
function mi(t, e) {
|
|
1852
1870
|
let i = !1;
|
|
1853
1871
|
const o = {
|
|
1854
1872
|
get isInitialized() {
|
|
@@ -1877,7 +1895,7 @@ function bi(t, e) {
|
|
|
1877
1895
|
s && t.expandedSections.add(s.id);
|
|
1878
1896
|
}
|
|
1879
1897
|
const n = e.getShadow();
|
|
1880
|
-
$e(n, t), We(n, t),
|
|
1898
|
+
$e(n, t), We(n, t), wi(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
|
|
1881
1899
|
},
|
|
1882
1900
|
closeToolPanel() {
|
|
1883
1901
|
if (!t.isPanelOpen) return;
|
|
@@ -1913,7 +1931,7 @@ function bi(t, e) {
|
|
|
1913
1931
|
const f = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
|
|
1914
1932
|
f && (f.innerHTML = "");
|
|
1915
1933
|
}
|
|
1916
|
-
t.expandedSections.add(n), ue(s, n, !0),
|
|
1934
|
+
t.expandedSections.add(n), ue(s, n, !0), vi(s, t, n);
|
|
1917
1935
|
}
|
|
1918
1936
|
e.emit("tool-panel-section-toggle", { id: n, expanded: !l });
|
|
1919
1937
|
},
|
|
@@ -1971,7 +1989,7 @@ function ue(t, e, i) {
|
|
|
1971
1989
|
const o = t.querySelector(`[data-section="${e}"]`);
|
|
1972
1990
|
o && o.classList.toggle("expanded", i);
|
|
1973
1991
|
}
|
|
1974
|
-
function
|
|
1992
|
+
function vi(t, e, i) {
|
|
1975
1993
|
const o = e.toolPanels.get(i);
|
|
1976
1994
|
if (!o?.render) return;
|
|
1977
1995
|
const n = t.querySelector(`[data-section="${i}"] .tbw-accordion-content`);
|
|
@@ -1979,7 +1997,7 @@ function mi(t, e, i) {
|
|
|
1979
1997
|
const r = o.render(n);
|
|
1980
1998
|
r && e.panelCleanups.set(i, r);
|
|
1981
1999
|
}
|
|
1982
|
-
function
|
|
2000
|
+
function Ci(t, e, i, o) {
|
|
1983
2001
|
const n = st(e), r = [], s = [
|
|
1984
2002
|
"tbw-grid-header",
|
|
1985
2003
|
"tbw-grid-tool-buttons",
|
|
@@ -1994,7 +2012,7 @@ function vi(t, e, i, o) {
|
|
|
1994
2012
|
for (const l of r)
|
|
1995
2013
|
t.appendChild(l);
|
|
1996
2014
|
if (n) {
|
|
1997
|
-
const l =
|
|
2015
|
+
const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((_, R) => (_.order ?? 0) - (R.order ?? 0)), g = [...e?.toolPanels ?? []].sort((_, R) => (_.order ?? 100) - (R.order ?? 100)), u = {
|
|
1998
2016
|
title: e?.header?.title ?? void 0,
|
|
1999
2017
|
hasPanels: g.length > 0,
|
|
2000
2018
|
isPanelOpen: i.isPanelOpen,
|
|
@@ -2013,7 +2031,7 @@ function vi(t, e, i, o) {
|
|
|
2013
2031
|
panels: g.map((_) => ({
|
|
2014
2032
|
id: _.id,
|
|
2015
2033
|
title: _.title,
|
|
2016
|
-
icon:
|
|
2034
|
+
icon: N(_.icon),
|
|
2017
2035
|
isExpanded: i.expandedSections.has(_.id)
|
|
2018
2036
|
}))
|
|
2019
2037
|
}, w = ci(u), v = di(d), b = ke({
|
|
@@ -2031,25 +2049,25 @@ function vi(t, e, i, o) {
|
|
|
2031
2049
|
const Fe = "tbw-grid-styles";
|
|
2032
2050
|
let te = "";
|
|
2033
2051
|
const pe = /* @__PURE__ */ new Map();
|
|
2034
|
-
function
|
|
2052
|
+
function yi() {
|
|
2035
2053
|
let t = document.getElementById(Fe);
|
|
2036
2054
|
return t || (t = document.createElement("style"), t.id = Fe, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
|
|
2037
2055
|
}
|
|
2038
2056
|
function we() {
|
|
2039
|
-
const t =
|
|
2057
|
+
const t = yi(), e = Array.from(pe.values()).join(`
|
|
2040
2058
|
`);
|
|
2041
2059
|
t.textContent = `${te}
|
|
2042
2060
|
|
|
2043
2061
|
/* Plugin Styles */
|
|
2044
2062
|
${e}`;
|
|
2045
2063
|
}
|
|
2046
|
-
function
|
|
2064
|
+
function _i(t) {
|
|
2047
2065
|
let e = !1;
|
|
2048
2066
|
for (const { name: i, styles: o } of t)
|
|
2049
2067
|
pe.has(i) || (pe.set(i, o), e = !0);
|
|
2050
2068
|
return e && we(), e;
|
|
2051
2069
|
}
|
|
2052
|
-
function
|
|
2070
|
+
function Ei() {
|
|
2053
2071
|
try {
|
|
2054
2072
|
for (const t of Array.from(document.styleSheets))
|
|
2055
2073
|
try {
|
|
@@ -2065,7 +2083,7 @@ function _i() {
|
|
|
2065
2083
|
}
|
|
2066
2084
|
return null;
|
|
2067
2085
|
}
|
|
2068
|
-
async function
|
|
2086
|
+
async function Si(t) {
|
|
2069
2087
|
if (te)
|
|
2070
2088
|
return;
|
|
2071
2089
|
if (typeof t == "string" && t.length > 0) {
|
|
@@ -2073,14 +2091,14 @@ async function Ei(t) {
|
|
|
2073
2091
|
return;
|
|
2074
2092
|
}
|
|
2075
2093
|
await new Promise((i) => setTimeout(i, 50));
|
|
2076
|
-
const e =
|
|
2094
|
+
const e = Ei();
|
|
2077
2095
|
e ? (te = e, we()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
|
|
2078
2096
|
"[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
|
|
2079
2097
|
"Available stylesheets:",
|
|
2080
2098
|
Array.from(document.styleSheets).map((i) => i.href || "(inline)")
|
|
2081
2099
|
);
|
|
2082
2100
|
}
|
|
2083
|
-
function
|
|
2101
|
+
function Ri() {
|
|
2084
2102
|
return {
|
|
2085
2103
|
startY: null,
|
|
2086
2104
|
startX: null,
|
|
@@ -2094,19 +2112,19 @@ function Si() {
|
|
|
2094
2112
|
momentumRaf: 0
|
|
2095
2113
|
};
|
|
2096
2114
|
}
|
|
2097
|
-
function
|
|
2115
|
+
function Ai(t) {
|
|
2098
2116
|
t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
|
|
2099
2117
|
}
|
|
2100
2118
|
function lt(t) {
|
|
2101
2119
|
t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
|
|
2102
2120
|
}
|
|
2103
|
-
function
|
|
2121
|
+
function Ti(t, e, i) {
|
|
2104
2122
|
if (t.touches.length !== 1) return;
|
|
2105
2123
|
lt(e);
|
|
2106
2124
|
const o = t.touches[0];
|
|
2107
2125
|
e.startY = o.clientY, e.startX = o.clientX, e.lastY = o.clientY, e.lastX = o.clientX, e.lastTime = performance.now(), e.scrollTop = i.fauxScrollbar.scrollTop, e.scrollLeft = i.scrollArea?.scrollLeft ?? 0, e.velocityY = 0, e.velocityX = 0;
|
|
2108
2126
|
}
|
|
2109
|
-
function
|
|
2127
|
+
function xi(t, e, i) {
|
|
2110
2128
|
if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
|
|
2111
2129
|
return !1;
|
|
2112
2130
|
const o = t.touches[0], n = o.clientY, r = o.clientX, s = performance.now(), l = e.startY - n, a = e.startX - r;
|
|
@@ -2123,10 +2141,10 @@ function Ti(t, e, i) {
|
|
|
2123
2141
|
}
|
|
2124
2142
|
return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), u && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || u;
|
|
2125
2143
|
}
|
|
2126
|
-
function xi(t, e) {
|
|
2127
|
-
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Hi(t, e), Ri(t);
|
|
2128
|
-
}
|
|
2129
2144
|
function Hi(t, e) {
|
|
2145
|
+
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Li(t, e), Ai(t);
|
|
2146
|
+
}
|
|
2147
|
+
function Li(t, e) {
|
|
2130
2148
|
const n = () => {
|
|
2131
2149
|
t.velocityY *= 0.95, t.velocityX *= 0.95;
|
|
2132
2150
|
const r = t.velocityY * 16, s = t.velocityX * 16;
|
|
@@ -2134,19 +2152,19 @@ function Hi(t, e) {
|
|
|
2134
2152
|
};
|
|
2135
2153
|
t.momentumRaf = requestAnimationFrame(n);
|
|
2136
2154
|
}
|
|
2137
|
-
function
|
|
2138
|
-
t.addEventListener("touchstart", (n) =>
|
|
2155
|
+
function Pi(t, e, i, o) {
|
|
2156
|
+
t.addEventListener("touchstart", (n) => Ti(n, e, i), {
|
|
2139
2157
|
passive: !0,
|
|
2140
2158
|
signal: o
|
|
2141
2159
|
}), t.addEventListener(
|
|
2142
2160
|
"touchmove",
|
|
2143
2161
|
(n) => {
|
|
2144
|
-
|
|
2162
|
+
xi(n, e, i) && n.preventDefault();
|
|
2145
2163
|
},
|
|
2146
2164
|
{ passive: !1, signal: o }
|
|
2147
|
-
), t.addEventListener("touchend", () =>
|
|
2165
|
+
), t.addEventListener("touchend", () => Hi(e, i), { passive: !0, signal: o });
|
|
2148
2166
|
}
|
|
2149
|
-
const
|
|
2167
|
+
const zi = [
|
|
2150
2168
|
{
|
|
2151
2169
|
property: "editable",
|
|
2152
2170
|
pluginName: "editing",
|
|
@@ -2186,7 +2204,7 @@ const Pi = [
|
|
|
2186
2204
|
description: 'the "sticky" column property (deprecated, use "pinned")',
|
|
2187
2205
|
isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
|
|
2188
2206
|
}
|
|
2189
|
-
],
|
|
2207
|
+
], Di = [
|
|
2190
2208
|
{
|
|
2191
2209
|
property: "columnGroups",
|
|
2192
2210
|
pluginName: "groupingColumns",
|
|
@@ -2195,11 +2213,11 @@ const Pi = [
|
|
|
2195
2213
|
isUsed: (t) => Array.isArray(t) && t.length > 0
|
|
2196
2214
|
}
|
|
2197
2215
|
];
|
|
2198
|
-
function
|
|
2216
|
+
function Oi(t) {
|
|
2199
2217
|
return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
2200
2218
|
}
|
|
2201
2219
|
function be(t) {
|
|
2202
|
-
return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${
|
|
2220
|
+
return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Oi(t)}';`;
|
|
2203
2221
|
}
|
|
2204
2222
|
function D(t) {
|
|
2205
2223
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
@@ -2207,8 +2225,8 @@ function D(t) {
|
|
|
2207
2225
|
function Ue(t, e) {
|
|
2208
2226
|
return t.some((i) => i.name === e);
|
|
2209
2227
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const i =
|
|
2228
|
+
function Mi(t, e) {
|
|
2229
|
+
const i = zi, o = Di, n = /* @__PURE__ */ new Map();
|
|
2212
2230
|
function r(l, a, c, h, f = !1) {
|
|
2213
2231
|
n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty: f });
|
|
2214
2232
|
const p = n.get(l);
|
|
@@ -2258,7 +2276,7 @@ This validation helps catch misconfigurations early. The properties listed above
|
|
|
2258
2276
|
);
|
|
2259
2277
|
}
|
|
2260
2278
|
}
|
|
2261
|
-
function
|
|
2279
|
+
function ki(t) {
|
|
2262
2280
|
const e = [], i = [];
|
|
2263
2281
|
for (const o of t) {
|
|
2264
2282
|
const r = o.constructor.manifest;
|
|
@@ -2281,7 +2299,7 @@ ${e.join(`
|
|
|
2281
2299
|
|
|
2282
2300
|
`)}`);
|
|
2283
2301
|
}
|
|
2284
|
-
function
|
|
2302
|
+
function Ii(t, e) {
|
|
2285
2303
|
const i = t.name, n = t.constructor.dependencies ?? [];
|
|
2286
2304
|
for (const r of n) {
|
|
2287
2305
|
const s = r.name, l = r.required ?? !0, a = r.reason;
|
|
@@ -2329,24 +2347,24 @@ ${D(o.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
|
|
|
2329
2347
|
function at(t, e) {
|
|
2330
2348
|
return !t || typeof t != "object" ? t : "__rowCacheKey" in t ? t.__rowCacheKey : "rowId" in t && t.rowId != null ? `id:${t.rowId}` : e ? `id:${e(t)}` : t;
|
|
2331
2349
|
}
|
|
2332
|
-
function
|
|
2350
|
+
function qi(t, e, i) {
|
|
2333
2351
|
const o = at(e, i);
|
|
2334
2352
|
if (typeof o == "string")
|
|
2335
2353
|
return t.byKey.get(o);
|
|
2336
2354
|
if (o && typeof o == "object")
|
|
2337
2355
|
return t.byRef.get(o);
|
|
2338
2356
|
}
|
|
2339
|
-
function
|
|
2357
|
+
function $i(t, e, i, o) {
|
|
2340
2358
|
const n = at(e, o);
|
|
2341
2359
|
typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
|
|
2342
2360
|
}
|
|
2343
|
-
function
|
|
2361
|
+
function Wi(t, e, i, o, n) {
|
|
2344
2362
|
const r = new Array(t.length);
|
|
2345
2363
|
let s = 0;
|
|
2346
2364
|
for (let l = 0; l < t.length; l++) {
|
|
2347
2365
|
const a = t[l];
|
|
2348
2366
|
let c = n?.(a, l), h = c !== void 0;
|
|
2349
|
-
c === void 0 && (c =
|
|
2367
|
+
c === void 0 && (c = qi(e, a, o.rowId), h = c !== void 0), c === void 0 && (c = i, h = !1), r[l] = { offset: s, height: c, measured: h }, s += c;
|
|
2350
2368
|
}
|
|
2351
2369
|
return r;
|
|
2352
2370
|
}
|
|
@@ -2359,7 +2377,7 @@ function me(t, e, i) {
|
|
|
2359
2377
|
t[r].offset += n;
|
|
2360
2378
|
}
|
|
2361
2379
|
}
|
|
2362
|
-
function
|
|
2380
|
+
function Fi(t) {
|
|
2363
2381
|
if (t.length === 0) return 0;
|
|
2364
2382
|
const e = t[t.length - 1];
|
|
2365
2383
|
return e.offset + e.height;
|
|
@@ -2379,19 +2397,19 @@ function Ve(t, e) {
|
|
|
2379
2397
|
}
|
|
2380
2398
|
return Math.max(0, Math.min(i, t.length - 1));
|
|
2381
2399
|
}
|
|
2382
|
-
function
|
|
2400
|
+
function Ui(t, e) {
|
|
2383
2401
|
let i = 0, o = 0;
|
|
2384
2402
|
for (const n of t)
|
|
2385
2403
|
n.measured && (i += n.height, o++);
|
|
2386
2404
|
return o > 0 ? i / o : e;
|
|
2387
2405
|
}
|
|
2388
|
-
function
|
|
2406
|
+
function Vi(t) {
|
|
2389
2407
|
let e = 0;
|
|
2390
2408
|
for (const i of t)
|
|
2391
2409
|
i.measured && e++;
|
|
2392
2410
|
return e;
|
|
2393
2411
|
}
|
|
2394
|
-
function
|
|
2412
|
+
function Bi(t, e) {
|
|
2395
2413
|
const { positionCache: i, heightCache: o, rows: n, start: r, end: s, getPluginHeight: l, getRowId: a } = t;
|
|
2396
2414
|
let c = !1;
|
|
2397
2415
|
e.forEach((p) => {
|
|
@@ -2408,13 +2426,13 @@ function Vi(t, e) {
|
|
|
2408
2426
|
const v = p.offsetHeight;
|
|
2409
2427
|
if (v > 0) {
|
|
2410
2428
|
const b = i[u];
|
|
2411
|
-
(!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v),
|
|
2429
|
+
(!b.measured || Math.abs(b.height - v) > 1) && (me(i, u, v), $i(o, d, v, a), c = !0);
|
|
2412
2430
|
}
|
|
2413
2431
|
});
|
|
2414
|
-
const h = c ?
|
|
2432
|
+
const h = c ? Vi(i) : 0, f = c ? Ui(i, t.defaultHeight) : 0;
|
|
2415
2433
|
return { hasChanges: c, measuredCount: h, averageHeight: f };
|
|
2416
2434
|
}
|
|
2417
|
-
function
|
|
2435
|
+
function Gi(t, e, i, o) {
|
|
2418
2436
|
let n = 0, r = 0;
|
|
2419
2437
|
for (let s = 0; s < t.length; s++) {
|
|
2420
2438
|
const l = t[s];
|
|
@@ -2425,7 +2443,7 @@ function Bi(t, e, i, o) {
|
|
|
2425
2443
|
averageHeight: n > 0 ? r / n : i
|
|
2426
2444
|
};
|
|
2427
2445
|
}
|
|
2428
|
-
function
|
|
2446
|
+
function ro(t) {
|
|
2429
2447
|
const { totalRows: e, viewportHeight: i, scrollTop: o, rowHeight: n, overscan: r } = t, s = Math.ceil(i / n);
|
|
2430
2448
|
let l = Math.floor(o / n) - r;
|
|
2431
2449
|
l < 0 && (l = 0);
|
|
@@ -2437,7 +2455,7 @@ function no(t) {
|
|
|
2437
2455
|
totalHeight: e * n
|
|
2438
2456
|
};
|
|
2439
2457
|
}
|
|
2440
|
-
function
|
|
2458
|
+
function so(t, e) {
|
|
2441
2459
|
return t <= e;
|
|
2442
2460
|
}
|
|
2443
2461
|
class ne {
|
|
@@ -2460,7 +2478,7 @@ class ne {
|
|
|
2460
2478
|
this.attach(i);
|
|
2461
2479
|
}
|
|
2462
2480
|
attach(e) {
|
|
2463
|
-
if (
|
|
2481
|
+
if (Ii(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
|
|
2464
2482
|
for (const [i, o] of Object.entries(e.cellRenderers))
|
|
2465
2483
|
this.cellRenderers.set(i, o);
|
|
2466
2484
|
if (e.headerRenderers)
|
|
@@ -2725,7 +2743,7 @@ class ne {
|
|
|
2725
2743
|
return e.sort((i, o) => (i.content.order ?? 0) - (o.content.order ?? 0));
|
|
2726
2744
|
}
|
|
2727
2745
|
}
|
|
2728
|
-
const Gi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-spin{to{transform:rotate(360deg)}}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}", Xi = '@layer tbw-base{tbw-grid{color-scheme:inherit;position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);font-feature-settings:"tnum","lnum";background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.tbw-grid-root{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}}}', Yi = '@layer tbw-base{tbw-grid{.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}}}', ji = '@layer tbw-base{.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none}.tbw-row-loading-overlay{position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out;pointer-events:none;display:flex;align-items:center}.tbw-row-loading-spinner{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);margin-left:var(--tbw-spacing-md);width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:27}}}', Ki = "@layer tbw-base{@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}}", Qi = "@layer tbw-base{tbw-grid{.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}}}", Zi = "@layer tbw-base{tbw-grid{.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}}}", Ji = "@layer tbw-base{tbw-grid{.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:start;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}}}", eo = "@layer tbw-base{tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-v: var(--tbw-spacing-xs);--tbw-cell-padding-h: var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-cell-padding-v) var(--tbw-cell-padding-h);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-width: 1px;--tbw-border-style: solid;--tbw-border-input: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-strong);--tbw-border-header: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-header);--tbw-row-divider: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline-width: 2px;--tbw-focus-outline: var(--tbw-focus-outline-width) var(--tbw-border-style) var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm)}}", to = `/**
|
|
2746
|
+
const Xi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-spin{to{transform:rotate(360deg)}}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}", Yi = '@layer tbw-base{tbw-grid{color-scheme:inherit;position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);font-feature-settings:"tnum","lnum";background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.tbw-grid-root{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}}}', ji = '@layer tbw-base{tbw-grid{.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}}}', Ki = '@layer tbw-base{.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none}.tbw-row-loading-overlay{position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out;pointer-events:none;display:flex;align-items:center}.tbw-row-loading-spinner{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);margin-left:var(--tbw-spacing-md);width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:26;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:27}}}', Qi = "@layer tbw-base{@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}}", Zi = "@layer tbw-base{tbw-grid{.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}}}", Ji = "@layer tbw-base{tbw-grid{.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}}}", eo = "@layer tbw-base{tbw-grid{.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:start;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}}}", to = "@layer tbw-base{tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-v: var(--tbw-spacing-xs);--tbw-cell-padding-h: var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-cell-padding-v) var(--tbw-cell-padding-h);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-width: 1px;--tbw-border-style: solid;--tbw-border-input: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-strong);--tbw-border-header: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-header);--tbw-row-divider: var(--tbw-border-width) var(--tbw-border-style) var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline-width: 2px;--tbw-focus-outline: var(--tbw-focus-outline-width) var(--tbw-border-style) var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm)}}", io = `/**
|
|
2729
2747
|
* tbw-grid Light DOM Styles
|
|
2730
2748
|
*
|
|
2731
2749
|
* This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
|
|
@@ -2744,19 +2762,19 @@ const Gi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--t
|
|
|
2744
2762
|
/* Declare layer order - earlier layers have lower priority */
|
|
2745
2763
|
@layer tbw-base, tbw-plugins, tbw-theme;
|
|
2746
2764
|
|
|
2747
|
-
${
|
|
2748
|
-
${Xi}
|
|
2765
|
+
${to}
|
|
2749
2766
|
${Yi}
|
|
2750
|
-
${
|
|
2767
|
+
${ji}
|
|
2751
2768
|
${Zi}
|
|
2752
2769
|
${Ji}
|
|
2753
|
-
${
|
|
2754
|
-
${Gi}
|
|
2770
|
+
${eo}
|
|
2755
2771
|
${Ki}
|
|
2772
|
+
${Xi}
|
|
2773
|
+
${Qi}
|
|
2756
2774
|
`;
|
|
2757
2775
|
class k extends HTMLElement {
|
|
2758
2776
|
static tagName = "tbw-grid";
|
|
2759
|
-
static version = "1.
|
|
2777
|
+
static version = "1.17.0";
|
|
2760
2778
|
static #l = 0;
|
|
2761
2779
|
static adapters = [];
|
|
2762
2780
|
static registerAdapter(e) {
|
|
@@ -2779,7 +2797,7 @@ class k extends HTMLElement {
|
|
|
2779
2797
|
#h;
|
|
2780
2798
|
#a = [];
|
|
2781
2799
|
get #o() {
|
|
2782
|
-
return this.#
|
|
2800
|
+
return this.#i?.effective ?? {};
|
|
2783
2801
|
}
|
|
2784
2802
|
#f = !1;
|
|
2785
2803
|
#w = !1;
|
|
@@ -2796,12 +2814,12 @@ class k extends HTMLElement {
|
|
|
2796
2814
|
#x = !1;
|
|
2797
2815
|
#m = 0;
|
|
2798
2816
|
#z;
|
|
2799
|
-
#
|
|
2817
|
+
#I = Ri();
|
|
2800
2818
|
#b;
|
|
2801
2819
|
#y;
|
|
2802
2820
|
#p;
|
|
2803
2821
|
#S;
|
|
2804
|
-
#
|
|
2822
|
+
#ee = {
|
|
2805
2823
|
scrollTop: 0,
|
|
2806
2824
|
scrollLeft: 0,
|
|
2807
2825
|
scrollHeight: 0,
|
|
@@ -2809,23 +2827,24 @@ class k extends HTMLElement {
|
|
|
2809
2827
|
clientHeight: 0,
|
|
2810
2828
|
clientWidth: 0
|
|
2811
2829
|
};
|
|
2812
|
-
#
|
|
2830
|
+
#t;
|
|
2813
2831
|
#_;
|
|
2814
|
-
#
|
|
2832
|
+
#N = !1;
|
|
2815
2833
|
#D;
|
|
2816
|
-
#
|
|
2834
|
+
#B;
|
|
2817
2835
|
#O;
|
|
2818
|
-
#
|
|
2819
|
-
#
|
|
2836
|
+
#i;
|
|
2837
|
+
#e = hi();
|
|
2820
2838
|
#c;
|
|
2821
2839
|
#q;
|
|
2840
|
+
#$;
|
|
2822
2841
|
#M = !1;
|
|
2823
2842
|
#E = /* @__PURE__ */ new Set();
|
|
2824
2843
|
#H = /* @__PURE__ */ new Map();
|
|
2825
|
-
|
|
2844
|
+
#W;
|
|
2826
2845
|
#R = /* @__PURE__ */ new Map();
|
|
2827
2846
|
_rows = [];
|
|
2828
|
-
#
|
|
2847
|
+
#G = [];
|
|
2829
2848
|
get _columns() {
|
|
2830
2849
|
return this.#o.columns ?? [];
|
|
2831
2850
|
}
|
|
@@ -2869,16 +2888,16 @@ class k extends HTMLElement {
|
|
|
2869
2888
|
__rowRenderEpoch = 0;
|
|
2870
2889
|
__didInitialAutoSize = !1;
|
|
2871
2890
|
get __lightDomColumnsCache() {
|
|
2872
|
-
return this.#
|
|
2891
|
+
return this.#i?.lightDomColumnsCache;
|
|
2873
2892
|
}
|
|
2874
2893
|
set __lightDomColumnsCache(e) {
|
|
2875
|
-
this.#
|
|
2894
|
+
this.#i && (this.#i.lightDomColumnsCache = e);
|
|
2876
2895
|
}
|
|
2877
2896
|
get __originalColumnNodes() {
|
|
2878
|
-
return this.#
|
|
2897
|
+
return this.#i?.originalColumnNodes;
|
|
2879
2898
|
}
|
|
2880
2899
|
set __originalColumnNodes(e) {
|
|
2881
|
-
this.#
|
|
2900
|
+
this.#i && (this.#i.originalColumnNodes = e);
|
|
2882
2901
|
}
|
|
2883
2902
|
__originalOrder = [];
|
|
2884
2903
|
__frameworkAdapter;
|
|
@@ -2888,7 +2907,7 @@ class k extends HTMLElement {
|
|
|
2888
2907
|
}
|
|
2889
2908
|
set rows(e) {
|
|
2890
2909
|
const i = this.#a;
|
|
2891
|
-
this.#a = e, i !== e && this.#
|
|
2910
|
+
this.#a = e, i !== e && this.#V("rows");
|
|
2892
2911
|
}
|
|
2893
2912
|
get sourceRows() {
|
|
2894
2913
|
return this.#a;
|
|
@@ -2897,38 +2916,38 @@ class k extends HTMLElement {
|
|
|
2897
2916
|
return [...this._columns];
|
|
2898
2917
|
}
|
|
2899
2918
|
set columns(e) {
|
|
2900
|
-
const i = this.#
|
|
2901
|
-
this.#
|
|
2919
|
+
const i = this.#i?.getColumns();
|
|
2920
|
+
this.#i?.setColumns(e), i !== e && this.#V("columns");
|
|
2902
2921
|
}
|
|
2903
2922
|
get gridConfig() {
|
|
2904
2923
|
return this.#o;
|
|
2905
2924
|
}
|
|
2906
2925
|
set gridConfig(e) {
|
|
2907
|
-
const i = this.#
|
|
2908
|
-
this.#
|
|
2926
|
+
const i = this.#i?.getGridConfig();
|
|
2927
|
+
this.#i?.setGridConfig(e), i !== e && (this.#i.clearLightDomCache(), this.#V("gridConfig"));
|
|
2909
2928
|
}
|
|
2910
2929
|
get fitMode() {
|
|
2911
2930
|
return this.#o.fitMode ?? "stretch";
|
|
2912
2931
|
}
|
|
2913
2932
|
set fitMode(e) {
|
|
2914
|
-
const i = this.#
|
|
2915
|
-
this.#
|
|
2933
|
+
const i = this.#i?.getFitMode();
|
|
2934
|
+
this.#i?.setFitMode(e), i !== e && this.#V("fitMode");
|
|
2916
2935
|
}
|
|
2917
2936
|
get loading() {
|
|
2918
2937
|
return this.#M;
|
|
2919
2938
|
}
|
|
2920
2939
|
set loading(e) {
|
|
2921
2940
|
const i = this.#M;
|
|
2922
|
-
this.#M = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#
|
|
2941
|
+
this.#M = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#ue();
|
|
2923
2942
|
}
|
|
2924
2943
|
setRowLoading(e, i) {
|
|
2925
2944
|
const o = this.#E.has(e);
|
|
2926
|
-
i ? this.#E.add(e) : this.#E.delete(e), o !== i && this.#
|
|
2945
|
+
i ? this.#E.add(e) : this.#E.delete(e), o !== i && this.#K(e, i);
|
|
2927
2946
|
}
|
|
2928
2947
|
setCellLoading(e, i, o) {
|
|
2929
2948
|
let n = this.#H.get(e);
|
|
2930
2949
|
const r = n?.has(i) ?? !1;
|
|
2931
|
-
o ? (n || (n = /* @__PURE__ */ new Set(), this.#H.set(e, n)), n.add(i)) : (n?.delete(i), n?.size === 0 && this.#H.delete(e)), r !== o && this.#
|
|
2950
|
+
o ? (n || (n = /* @__PURE__ */ new Set(), this.#H.set(e, n)), n.add(i)) : (n?.delete(i), n?.size === 0 && this.#H.delete(e)), r !== o && this.#fe(e, i, o);
|
|
2932
2951
|
}
|
|
2933
2952
|
isRowLoading(e) {
|
|
2934
2953
|
return this.#E.has(e);
|
|
@@ -2939,11 +2958,11 @@ class k extends HTMLElement {
|
|
|
2939
2958
|
clearAllLoading() {
|
|
2940
2959
|
this.loading = !1;
|
|
2941
2960
|
for (const e of this.#E)
|
|
2942
|
-
this.#
|
|
2961
|
+
this.#K(e, !1);
|
|
2943
2962
|
this.#E.clear();
|
|
2944
2963
|
for (const [e, i] of this.#H)
|
|
2945
2964
|
for (const o of i)
|
|
2946
|
-
this.#
|
|
2965
|
+
this.#fe(e, o, !1);
|
|
2947
2966
|
this.#H.clear();
|
|
2948
2967
|
}
|
|
2949
2968
|
get effectiveConfig() {
|
|
@@ -2953,28 +2972,28 @@ class k extends HTMLElement {
|
|
|
2953
2972
|
return this.#b || (this.#b = new AbortController()), this.#b.signal;
|
|
2954
2973
|
}
|
|
2955
2974
|
constructor() {
|
|
2956
|
-
super(), this.#
|
|
2975
|
+
super(), this.#me(), this.#d = new Promise((e) => this.#h = e), this.#s = new ti({
|
|
2957
2976
|
mergeConfig: () => {
|
|
2958
|
-
this.#
|
|
2977
|
+
this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), Mi(this.#o, this.#t?.getPlugins() ?? []), ki(this.#t?.getPlugins() ?? []), Ni(this.#t?.getPlugins() ?? []), this.#De(), this.#G = [...this._columns];
|
|
2959
2978
|
},
|
|
2960
|
-
processColumns: () => this.#
|
|
2961
|
-
processRows: () => this.#
|
|
2979
|
+
processColumns: () => this.#He(),
|
|
2980
|
+
processRows: () => this.#Pe(),
|
|
2962
2981
|
renderHeader: () => oe(this),
|
|
2963
2982
|
updateTemplate: () => V(this),
|
|
2964
2983
|
renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
|
|
2965
2984
|
afterRender: () => {
|
|
2966
|
-
this.#
|
|
2985
|
+
this.#t?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
|
|
2967
2986
|
if (!this._virtualization.totalHeightEl) return;
|
|
2968
2987
|
const i = this.#T(this._rows.length);
|
|
2969
2988
|
this._virtualization.totalHeightEl.style.height = `${i}px`;
|
|
2970
|
-
}), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Re(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#
|
|
2989
|
+
}), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Re(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#U && this.#ye(), this.#x && (this.#x = !1, requestAnimationFrame(() => {
|
|
2971
2990
|
requestAnimationFrame(() => {
|
|
2972
|
-
this.#
|
|
2991
|
+
this.#Ce();
|
|
2973
2992
|
});
|
|
2974
|
-
})), this.#M && this.#
|
|
2993
|
+
})), this.#M && this.#ue();
|
|
2975
2994
|
},
|
|
2976
2995
|
isConnected: () => this.isConnected && this.#f
|
|
2977
|
-
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c =
|
|
2996
|
+
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = mi(this.#e, {
|
|
2978
2997
|
getShadow: () => this.#n,
|
|
2979
2998
|
getShellConfig: () => this.#o?.shell,
|
|
2980
2999
|
getAccordionIcons: () => ({
|
|
@@ -2983,7 +3002,7 @@ class k extends HTMLElement {
|
|
|
2983
3002
|
}),
|
|
2984
3003
|
emit: (e, i) => this.#L(e, i),
|
|
2985
3004
|
refreshShellHeader: () => this.refreshShellHeader()
|
|
2986
|
-
}), this.#
|
|
3005
|
+
}), this.#i = new Lt({
|
|
2987
3006
|
getRows: () => this.#a,
|
|
2988
3007
|
getSortState: () => this._sortState,
|
|
2989
3008
|
setSortState: (e) => {
|
|
@@ -3004,23 +3023,23 @@ class k extends HTMLElement {
|
|
|
3004
3023
|
setRowHeight: (e) => {
|
|
3005
3024
|
this._virtualization.rowHeight = e;
|
|
3006
3025
|
},
|
|
3007
|
-
applyAnimationConfig: (e) => this.#
|
|
3008
|
-
getShellLightDomTitle: () => this.#
|
|
3009
|
-
getShellToolPanels: () => this.#
|
|
3010
|
-
getShellHeaderContents: () => this.#
|
|
3011
|
-
getShellToolbarContents: () => this.#
|
|
3012
|
-
getShellLightDomHeaderContent: () => this.#
|
|
3013
|
-
getShellHasToolButtonsContainer: () => this.#
|
|
3026
|
+
applyAnimationConfig: (e) => this.#ze(e),
|
|
3027
|
+
getShellLightDomTitle: () => this.#e.lightDomTitle,
|
|
3028
|
+
getShellToolPanels: () => this.#e.toolPanels,
|
|
3029
|
+
getShellHeaderContents: () => this.#e.headerContents,
|
|
3030
|
+
getShellToolbarContents: () => this.#e.toolbarContents,
|
|
3031
|
+
getShellLightDomHeaderContent: () => this.#e.lightDomHeaderContent,
|
|
3032
|
+
getShellHasToolButtonsContainer: () => this.#e.hasToolButtonsContainer
|
|
3014
3033
|
});
|
|
3015
3034
|
}
|
|
3016
|
-
async #
|
|
3017
|
-
await
|
|
3035
|
+
async #me() {
|
|
3036
|
+
await Si(io);
|
|
3018
3037
|
}
|
|
3019
3038
|
getPlugin(e) {
|
|
3020
|
-
return this.#
|
|
3039
|
+
return this.#t?.getPlugin(e);
|
|
3021
3040
|
}
|
|
3022
3041
|
getPluginByName(e) {
|
|
3023
|
-
return this.#
|
|
3042
|
+
return this.#t?.getPluginByName(e);
|
|
3024
3043
|
}
|
|
3025
3044
|
requestRender() {
|
|
3026
3045
|
this.#s.requestPhase(A.ROWS, "plugin:requestRender");
|
|
@@ -3037,16 +3056,16 @@ class k extends HTMLElement {
|
|
|
3037
3056
|
requestAfterRender() {
|
|
3038
3057
|
this.#s.requestPhase(A.STYLE, "plugin:requestAfterRender");
|
|
3039
3058
|
}
|
|
3040
|
-
#
|
|
3041
|
-
this.#
|
|
3059
|
+
#te() {
|
|
3060
|
+
this.#t = new ne(this);
|
|
3042
3061
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
3043
|
-
this.#
|
|
3062
|
+
this.#t.attachAll(i);
|
|
3044
3063
|
}
|
|
3045
|
-
#
|
|
3046
|
-
const e = this.#
|
|
3047
|
-
|
|
3064
|
+
#F() {
|
|
3065
|
+
const e = this.#t?.getPluginStyles() ?? [];
|
|
3066
|
+
_i(e);
|
|
3048
3067
|
}
|
|
3049
|
-
#
|
|
3068
|
+
#ie() {
|
|
3050
3069
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
3051
3070
|
if (this.#_ === i)
|
|
3052
3071
|
return;
|
|
@@ -3054,38 +3073,38 @@ class k extends HTMLElement {
|
|
|
3054
3073
|
this.#_ = i;
|
|
3055
3074
|
return;
|
|
3056
3075
|
}
|
|
3057
|
-
this.#
|
|
3058
|
-
for (const n of this.#
|
|
3059
|
-
const r = this.#
|
|
3076
|
+
this.#t && this.#t.detachAll();
|
|
3077
|
+
for (const n of this.#e.toolPanels.keys()) {
|
|
3078
|
+
const r = this.#e.lightDomToolPanelIds.has(n), s = this.#e.apiToolPanelIds.has(n);
|
|
3060
3079
|
if (!r && !s) {
|
|
3061
|
-
const l = this.#
|
|
3062
|
-
l && (l(), this.#
|
|
3080
|
+
const l = this.#e.panelCleanups.get(n);
|
|
3081
|
+
l && (l(), this.#e.panelCleanups.delete(n)), this.#e.toolPanels.delete(n);
|
|
3063
3082
|
}
|
|
3064
3083
|
}
|
|
3065
|
-
for (const n of this.#
|
|
3066
|
-
const r = this.#
|
|
3067
|
-
r && (r(), this.#
|
|
3084
|
+
for (const n of this.#e.headerContents.keys()) {
|
|
3085
|
+
const r = this.#e.headerContentCleanups.get(n);
|
|
3086
|
+
r && (r(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
|
|
3068
3087
|
}
|
|
3069
|
-
this.#
|
|
3088
|
+
this.#te(), this.#F(), this.#_ = i, this.#se(), this.#oe();
|
|
3070
3089
|
const o = this.#g;
|
|
3071
|
-
if (this.#g = this.#
|
|
3090
|
+
if (this.#g = this.#t?.getAll().some((n) => n.onScroll) ?? !1, !o && this.#g) {
|
|
3072
3091
|
const r = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3073
|
-
this.#
|
|
3092
|
+
this.#X(r);
|
|
3074
3093
|
}
|
|
3075
3094
|
}
|
|
3076
|
-
#
|
|
3077
|
-
this.#
|
|
3095
|
+
#ve() {
|
|
3096
|
+
this.#t?.detachAll();
|
|
3078
3097
|
}
|
|
3079
|
-
#
|
|
3080
|
-
if (!this.#
|
|
3081
|
-
const e = this.#
|
|
3098
|
+
#oe() {
|
|
3099
|
+
if (!this.#t) return;
|
|
3100
|
+
const e = this.#t.getToolPanels();
|
|
3082
3101
|
for (const { panel: o } of e)
|
|
3083
|
-
this.#
|
|
3084
|
-
const i = this.#
|
|
3102
|
+
this.#e.toolPanels.has(o.id) || this.#e.toolPanels.set(o.id, o);
|
|
3103
|
+
const i = this.#t.getHeaderContents();
|
|
3085
3104
|
for (const { content: o } of i)
|
|
3086
|
-
this.#
|
|
3105
|
+
this.#e.headerContents.has(o.id) || this.#e.headerContents.set(o.id, o);
|
|
3087
3106
|
}
|
|
3088
|
-
#
|
|
3107
|
+
#ne() {
|
|
3089
3108
|
const e = k.getAdapters();
|
|
3090
3109
|
if (e.length === 0 && !this.__frameworkAdapter) return;
|
|
3091
3110
|
const i = this.__frameworkAdapter;
|
|
@@ -3102,17 +3121,17 @@ class k extends HTMLElement {
|
|
|
3102
3121
|
};
|
|
3103
3122
|
}
|
|
3104
3123
|
connectedCallback() {
|
|
3105
|
-
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#
|
|
3124
|
+
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#N = !1), this.#b = new AbortController(), this.#S && (Oe(this.#S), this.#S = void 0), this.#k(), this.#i.parseLightDomColumns(this), this.#i.merge(), this.#te();
|
|
3106
3125
|
const e = this.#o?.plugins;
|
|
3107
|
-
this.#_ = Array.isArray(e) ? e : [], this.#
|
|
3126
|
+
this.#_ = Array.isArray(e) ? e : [], this.#oe(), this.#u || (this.#J(), this.#F(), this.#u = !0), this.#re(), this.#S = Xt(
|
|
3108
3127
|
() => {
|
|
3109
|
-
this.#
|
|
3128
|
+
this.#Ie();
|
|
3110
3129
|
},
|
|
3111
3130
|
{ timeout: 100 }
|
|
3112
3131
|
);
|
|
3113
3132
|
}
|
|
3114
3133
|
disconnectedCallback() {
|
|
3115
|
-
this.#S && (Oe(this.#S), this.#S = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#
|
|
3134
|
+
this.#S && (Oe(this.#S), this.#S = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#ve(), bi(this.#e), this.#c.setInitialized(!1), this.#q?.(), this.#q = void 0, this.#$?.(), this.#$ = void 0, lt(this.#I), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#N = !1, this._resizeController && this._resizeController.dispose(), this.#y && (this.#y.disconnect(), this.#y = void 0), this.#p && (this.#p.disconnect(), this.#p = void 0, this.#U = !1), Y(this), this.#A.clear(), this.#_ = void 0;
|
|
3116
3135
|
for (const e of this._rowPool)
|
|
3117
3136
|
e.remove();
|
|
3118
3137
|
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
|
|
@@ -3133,25 +3152,25 @@ class k extends HTMLElement {
|
|
|
3133
3152
|
}
|
|
3134
3153
|
else e === "fit-mode" && (this.fitMode = o);
|
|
3135
3154
|
}
|
|
3136
|
-
#
|
|
3155
|
+
#re() {
|
|
3137
3156
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3138
3157
|
if (this._headerRowEl = i?.querySelector(".header-row"), this._virtualization.totalHeightEl = i?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = i?.querySelector(".rows-viewport"), this._bodyEl = i?.querySelector(".rows"), this.__rowsBodyEl = i?.querySelector(".rows-body"), this.#c.isInitialized) {
|
|
3139
|
-
ge(this.#n, this.#
|
|
3158
|
+
ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
|
|
3140
3159
|
const n = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3141
|
-
n && this.#
|
|
3160
|
+
n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
|
|
3142
3161
|
}
|
|
3143
|
-
if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#
|
|
3162
|
+
if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Me(this), this.#P(), this.#X(i), this.#N)
|
|
3144
3163
|
return;
|
|
3145
|
-
this.#
|
|
3164
|
+
this.#N = !0;
|
|
3146
3165
|
const o = this.disconnectSignal;
|
|
3147
|
-
Ft(this, this, this.#n, o), this.#
|
|
3148
|
-
}
|
|
3149
|
-
#re() {
|
|
3150
|
-
const e = this.#o.rowHeight, i = this.#e.hasRowHeightPlugin();
|
|
3151
|
-
typeof e == "function" || i ? this._virtualization.variableHeights || (this._virtualization.variableHeights = !0, this._virtualization.rowHeight = typeof e == "number" && e > 0 ? e : this._virtualization.rowHeight || 28, this.#Q(), typeof e != "function" && (this.#x = !0)) : !i && typeof e != "function" && this._virtualization.variableHeights ? (this._virtualization.variableHeights = !1, this._virtualization.positionCache = null) : typeof e == "number" && e > 0 ? (this._virtualization.rowHeight = e, this._virtualization.variableHeights = !1) : requestAnimationFrame(() => this.#se());
|
|
3166
|
+
Ft(this, this, this.#n, o), this.#se(), queueMicrotask(() => this.#_e()), this.#s.requestPhase(A.FULL, "afterConnect");
|
|
3152
3167
|
}
|
|
3153
3168
|
#se() {
|
|
3154
|
-
|
|
3169
|
+
const e = this.#o.rowHeight, i = this.#t.hasRowHeightPlugin();
|
|
3170
|
+
typeof e == "function" || i ? this._virtualization.variableHeights || (this._virtualization.variableHeights = !0, this._virtualization.rowHeight = typeof e == "number" && e > 0 ? e : this._virtualization.rowHeight || 28, this.#Z(), typeof e != "function" && (this.#x = !0)) : !i && typeof e != "function" && this._virtualization.variableHeights ? (this._virtualization.variableHeights = !1, this._virtualization.positionCache = null) : typeof e == "number" && e > 0 ? (this._virtualization.rowHeight = e, this._virtualization.variableHeights = !1) : requestAnimationFrame(() => this.#le());
|
|
3171
|
+
}
|
|
3172
|
+
#le() {
|
|
3173
|
+
if (this.#t.hasExtraHeight())
|
|
3155
3174
|
return;
|
|
3156
3175
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3157
3176
|
if (!e) return;
|
|
@@ -3164,7 +3183,7 @@ class k extends HTMLElement {
|
|
|
3164
3183
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3165
3184
|
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(A.VIRTUALIZATION, "measureRowHeight"));
|
|
3166
3185
|
}
|
|
3167
|
-
#
|
|
3186
|
+
#Ce() {
|
|
3168
3187
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3169
3188
|
if (!e) return;
|
|
3170
3189
|
const i = e.querySelectorAll(".cell");
|
|
@@ -3174,15 +3193,15 @@ class k extends HTMLElement {
|
|
|
3174
3193
|
l > o && (o = l);
|
|
3175
3194
|
});
|
|
3176
3195
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3177
|
-
if (r > 0 && (Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r), this.#
|
|
3196
|
+
if (r > 0 && (Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r), this.#Z(), this._virtualization.totalHeightEl)) {
|
|
3178
3197
|
const l = this.#T(this._rows.length);
|
|
3179
3198
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3180
3199
|
}
|
|
3181
3200
|
}
|
|
3182
|
-
#
|
|
3201
|
+
#X(e) {
|
|
3183
3202
|
this.#D?.abort(), this.#D = new AbortController();
|
|
3184
3203
|
const i = this.#D.signal, o = e?.querySelector(".faux-vscroll"), n = e?.querySelector(".rows");
|
|
3185
|
-
if (this._virtualization.container = o ?? this, this.#g = this.#
|
|
3204
|
+
if (this._virtualization.container = o ?? this, this.#g = this.#t?.getAll().some((r) => r.onScroll) ?? !1, o && n) {
|
|
3186
3205
|
o.addEventListener(
|
|
3187
3206
|
"scroll",
|
|
3188
3207
|
() => {
|
|
@@ -3203,21 +3222,21 @@ class k extends HTMLElement {
|
|
|
3203
3222
|
n.style.transform = `translateY(${g}px)`;
|
|
3204
3223
|
}
|
|
3205
3224
|
this.#r = a, this.#C || (this.#C = requestAnimationFrame(() => {
|
|
3206
|
-
this.#C = 0, this.#r !== null && (this.#
|
|
3225
|
+
this.#C = 0, this.#r !== null && (this.#Oe(this.#r), this.#r = null);
|
|
3207
3226
|
}));
|
|
3208
3227
|
},
|
|
3209
3228
|
{ passive: !0, signal: i }
|
|
3210
3229
|
);
|
|
3211
3230
|
const r = this.#n.querySelector(".tbw-scroll-area");
|
|
3212
|
-
this.#
|
|
3231
|
+
this.#B = r, this._virtualization.scrollAreaEl = r, r && this.#g && r.addEventListener(
|
|
3213
3232
|
"scroll",
|
|
3214
3233
|
() => {
|
|
3215
|
-
const a = this.#
|
|
3216
|
-
a.scrollTop = o.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = o.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = o.clientHeight, a.clientWidth = r.clientWidth, this.#
|
|
3234
|
+
const a = this.#ee;
|
|
3235
|
+
a.scrollTop = o.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = o.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = o.clientHeight, a.clientWidth = r.clientWidth, this.#t?.onScroll(a);
|
|
3217
3236
|
},
|
|
3218
3237
|
{ passive: !0, signal: i }
|
|
3219
3238
|
);
|
|
3220
|
-
const s = this.#n.querySelector(".tbw-grid-content"), l = this.#
|
|
3239
|
+
const s = this.#n.querySelector(".tbw-grid-content"), l = this.#B;
|
|
3221
3240
|
s && (s.addEventListener(
|
|
3222
3241
|
"wheel",
|
|
3223
3242
|
(a) => {
|
|
@@ -3231,9 +3250,9 @@ class k extends HTMLElement {
|
|
|
3231
3250
|
}
|
|
3232
3251
|
},
|
|
3233
3252
|
{ passive: !1, signal: i }
|
|
3234
|
-
),
|
|
3253
|
+
), Pi(
|
|
3235
3254
|
s,
|
|
3236
|
-
this.#
|
|
3255
|
+
this.#I,
|
|
3237
3256
|
{ fauxScrollbar: o, scrollArea: l },
|
|
3238
3257
|
i
|
|
3239
3258
|
));
|
|
@@ -3255,12 +3274,12 @@ class k extends HTMLElement {
|
|
|
3255
3274
|
{ signal: i }
|
|
3256
3275
|
);
|
|
3257
3276
|
}
|
|
3258
|
-
#
|
|
3259
|
-
#
|
|
3260
|
-
if (this.#
|
|
3277
|
+
#U = !1;
|
|
3278
|
+
#ye() {
|
|
3279
|
+
if (this.#U) return;
|
|
3261
3280
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3262
|
-
e && (this.#
|
|
3263
|
-
this.#
|
|
3281
|
+
e && (this.#U = !0, this.#p?.disconnect(), this.#p = new ResizeObserver(() => {
|
|
3282
|
+
this.#le();
|
|
3264
3283
|
}), this.#p.observe(e));
|
|
3265
3284
|
}
|
|
3266
3285
|
addEventListener(e, i, o) {
|
|
@@ -3272,7 +3291,7 @@ class k extends HTMLElement {
|
|
|
3272
3291
|
#L(e, i) {
|
|
3273
3292
|
this.dispatchEvent(new CustomEvent(e, { detail: i, bubbles: !0, composed: !0 }));
|
|
3274
3293
|
}
|
|
3275
|
-
#
|
|
3294
|
+
#_e() {
|
|
3276
3295
|
this._bodyEl?.querySelectorAll(".data-grid-row")?.forEach((i, o) => {
|
|
3277
3296
|
const n = o === this._focusRow;
|
|
3278
3297
|
i.setAttribute("aria-selected", String(n)), i.querySelectorAll(".cell").forEach((r, s) => {
|
|
@@ -3280,10 +3299,10 @@ class k extends HTMLElement {
|
|
|
3280
3299
|
});
|
|
3281
3300
|
});
|
|
3282
3301
|
}
|
|
3283
|
-
#
|
|
3284
|
-
this.#v[e] = !0, !this.#w && (this.#w = !0, queueMicrotask(() => this.#
|
|
3302
|
+
#V(e) {
|
|
3303
|
+
this.#v[e] = !0, !this.#w && (this.#w = !0, queueMicrotask(() => this.#Ee()));
|
|
3285
3304
|
}
|
|
3286
|
-
#
|
|
3305
|
+
#Ee() {
|
|
3287
3306
|
if (!this.#w || !this.#f) {
|
|
3288
3307
|
this.#w = !1;
|
|
3289
3308
|
return;
|
|
@@ -3295,69 +3314,69 @@ class k extends HTMLElement {
|
|
|
3295
3314
|
gridConfig: !1,
|
|
3296
3315
|
fitMode: !1
|
|
3297
3316
|
}, e.gridConfig) {
|
|
3298
|
-
this.#
|
|
3317
|
+
this.#Te(), e.rows && this.#ae();
|
|
3299
3318
|
return;
|
|
3300
3319
|
}
|
|
3301
|
-
e.columns && this.#
|
|
3320
|
+
e.columns && this.#Re(), e.rows && this.#ae(), e.fitMode && this.#Ae();
|
|
3302
3321
|
}
|
|
3303
|
-
#
|
|
3304
|
-
this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#
|
|
3322
|
+
#ae() {
|
|
3323
|
+
this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#Y(), this.#s.requestPhase(A.ROWS, "applyRowsUpdate");
|
|
3305
3324
|
}
|
|
3306
|
-
#
|
|
3325
|
+
#Y() {
|
|
3307
3326
|
this.#R.clear();
|
|
3308
3327
|
const e = this.#o.getRowId;
|
|
3309
3328
|
this._rows.forEach((i, o) => {
|
|
3310
|
-
const n = this.#
|
|
3329
|
+
const n = this.#ce(i, e);
|
|
3311
3330
|
n !== void 0 && this.#R.set(n, { row: i, index: o });
|
|
3312
3331
|
});
|
|
3313
3332
|
}
|
|
3314
|
-
#
|
|
3333
|
+
#ce(e, i) {
|
|
3315
3334
|
if (i)
|
|
3316
3335
|
return i(e);
|
|
3317
3336
|
const o = e;
|
|
3318
3337
|
if ("id" in o && o.id != null) return String(o.id);
|
|
3319
3338
|
if ("_id" in o && o._id != null) return String(o._id);
|
|
3320
3339
|
}
|
|
3321
|
-
#
|
|
3322
|
-
const o = this.#
|
|
3340
|
+
#Se(e, i) {
|
|
3341
|
+
const o = this.#ce(e, i);
|
|
3323
3342
|
if (o === void 0)
|
|
3324
3343
|
throw new Error(
|
|
3325
3344
|
'[tbw-grid] Cannot determine row ID. Configure getRowId in gridConfig or ensure rows have an "id" property.'
|
|
3326
3345
|
);
|
|
3327
3346
|
return o;
|
|
3328
3347
|
}
|
|
3329
|
-
#Se() {
|
|
3330
|
-
Y(this), this.#t.merge(), this.#P();
|
|
3331
|
-
}
|
|
3332
3348
|
#Re() {
|
|
3333
|
-
this
|
|
3349
|
+
Y(this), this.#i.merge(), this.#P();
|
|
3350
|
+
}
|
|
3351
|
+
#Ae() {
|
|
3352
|
+
this.#i.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Re(this)) : (this._columns.forEach((i) => {
|
|
3334
3353
|
!i.__userResized && i.__autoSized && delete i.width;
|
|
3335
3354
|
}), V(this));
|
|
3336
3355
|
}
|
|
3337
|
-
#
|
|
3338
|
-
|
|
3356
|
+
#Te() {
|
|
3357
|
+
Ie(this, this.#e), Ne(this, this.#e);
|
|
3339
3358
|
const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
|
|
3340
|
-
this.#
|
|
3359
|
+
this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), qe(this, this.#e, this.#ne()), this.#i.markSourcesChanged(), this.#i.merge();
|
|
3341
3360
|
const n = st(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
|
|
3342
3361
|
if (e !== n || !i && r || i && s !== o) {
|
|
3343
|
-
he(this.#
|
|
3362
|
+
he(this.#e), this.#J(), this.#F(), this.#re(), this.#Y();
|
|
3344
3363
|
return;
|
|
3345
3364
|
}
|
|
3346
|
-
e && this.#
|
|
3365
|
+
e && this.#xe(), this.#Y(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
|
|
3347
3366
|
}
|
|
3348
|
-
#
|
|
3367
|
+
#xe() {
|
|
3349
3368
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3350
3369
|
if (!e) return;
|
|
3351
|
-
const i = this.#o.shell?.header?.title ?? this.#
|
|
3370
|
+
const i = this.#o.shell?.header?.title ?? this.#e.lightDomTitle;
|
|
3352
3371
|
let o = e.querySelector(".tbw-shell-title");
|
|
3353
3372
|
i ? (o || (o = document.createElement("h2"), o.className = "tbw-shell-title", o.setAttribute("part", "shell-title"), e.insertBefore(o, e.firstChild)), o.textContent = i) : o && o.remove();
|
|
3354
3373
|
}
|
|
3355
|
-
#
|
|
3356
|
-
if (this.#
|
|
3357
|
-
const e = this.#
|
|
3374
|
+
#He() {
|
|
3375
|
+
if (this.#t) {
|
|
3376
|
+
const e = this.#G.length > 0 ? this.#G : this._columns, i = e.filter((r) => !r.hidden), o = e.filter((r) => r.hidden), n = this.#t.processColumns([...i]);
|
|
3358
3377
|
if (n !== i) {
|
|
3359
3378
|
const r = new Set(n.map((l) => l.field));
|
|
3360
|
-
!i.some((l) => r.has(l.field)) && n.length > 0 ? this._columns = [...n, ...o] : this._columns = this.#
|
|
3379
|
+
!i.some((l) => r.has(l.field)) && n.length > 0 ? this._columns = [...n, ...o] : this._columns = this.#Le(
|
|
3361
3380
|
e,
|
|
3362
3381
|
n,
|
|
3363
3382
|
o
|
|
@@ -3366,7 +3385,7 @@ class k extends HTMLElement {
|
|
|
3366
3385
|
this._columns = [...e];
|
|
3367
3386
|
}
|
|
3368
3387
|
}
|
|
3369
|
-
#
|
|
3388
|
+
#Le(e, i, o) {
|
|
3370
3389
|
if (o.length === 0) return i;
|
|
3371
3390
|
const n = /* @__PURE__ */ new Map();
|
|
3372
3391
|
for (const a of i)
|
|
@@ -3381,12 +3400,12 @@ class k extends HTMLElement {
|
|
|
3381
3400
|
}
|
|
3382
3401
|
return l.push(...s), l;
|
|
3383
3402
|
}
|
|
3384
|
-
#
|
|
3403
|
+
#Pe() {
|
|
3385
3404
|
Y(this);
|
|
3386
|
-
const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#
|
|
3387
|
-
this._rows = i, this._virtualization.variableHeights && this.#
|
|
3405
|
+
const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#t?.processRows(e) ?? e;
|
|
3406
|
+
this._rows = i, this._virtualization.variableHeights && this.#Z();
|
|
3388
3407
|
}
|
|
3389
|
-
#
|
|
3408
|
+
#ze(e) {
|
|
3390
3409
|
const i = {
|
|
3391
3410
|
...ft,
|
|
3392
3411
|
...e.animation
|
|
@@ -3394,29 +3413,29 @@ class k extends HTMLElement {
|
|
|
3394
3413
|
let n = 1;
|
|
3395
3414
|
o === !1 || o === "off" ? n = 0 : (o === !0 || o === "on") && (n = 1), this.style.setProperty("--tbw-animation-duration", `${i.duration}ms`), this.style.setProperty("--tbw-animation-easing", i.easing ?? "ease-out"), this.style.setProperty("--tbw-animation-enabled", String(n)), this.dataset.animationMode = typeof o == "boolean" ? o ? "on" : "off" : o;
|
|
3396
3415
|
}
|
|
3397
|
-
#
|
|
3398
|
-
if (this.#z || (this.#z = (n, r, s) => this.#
|
|
3416
|
+
#j(e, i, o = this.__rowRenderEpoch) {
|
|
3417
|
+
if (this.#z || (this.#z = (n, r, s) => this.#t?.renderRow(n, r, s) ?? !1), Mt(this, e, i, o, this.#z), this.#E.size > 0)
|
|
3399
3418
|
for (const n of this.#E)
|
|
3400
|
-
this.#
|
|
3419
|
+
this.#K(n, !0);
|
|
3401
3420
|
}
|
|
3402
|
-
#
|
|
3403
|
-
#
|
|
3404
|
-
dt(this.#
|
|
3421
|
+
#de = ct();
|
|
3422
|
+
#he(e, i) {
|
|
3423
|
+
dt(this.#de, this.__rowsBodyEl, this._bodyEl, e, i);
|
|
3405
3424
|
}
|
|
3406
|
-
#
|
|
3407
|
-
ut(this.#
|
|
3425
|
+
#De() {
|
|
3426
|
+
ut(this.#de, this.__rowsBodyEl, this.#o, this.#e);
|
|
3408
3427
|
}
|
|
3409
|
-
#
|
|
3428
|
+
#ue() {
|
|
3410
3429
|
const e = this.querySelector(".tbw-grid-root");
|
|
3411
|
-
e && (this.#M ? (this
|
|
3430
|
+
e && (this.#M ? (this.#W || (this.#W = Kt(this.#o?.loadingRenderer)), Qt(e, this.#W)) : Zt(this.#W));
|
|
3412
3431
|
}
|
|
3413
|
-
#
|
|
3432
|
+
#K(e, i) {
|
|
3414
3433
|
const o = this.#R.get(e);
|
|
3415
3434
|
if (!o) return;
|
|
3416
3435
|
const n = this.findRenderedRowElement?.(o.index);
|
|
3417
3436
|
n && Jt(n, i);
|
|
3418
3437
|
}
|
|
3419
|
-
#
|
|
3438
|
+
#fe(e, i, o) {
|
|
3420
3439
|
const n = this.#R.get(e);
|
|
3421
3440
|
if (!n) return;
|
|
3422
3441
|
const r = this.findRenderedRowElement?.(n.index);
|
|
@@ -3428,26 +3447,26 @@ class k extends HTMLElement {
|
|
|
3428
3447
|
}
|
|
3429
3448
|
#P() {
|
|
3430
3449
|
if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
|
|
3431
|
-
if (this.#
|
|
3450
|
+
if (this.#i.parseLightDomColumns(this), this.#O) {
|
|
3432
3451
|
const e = this.#O;
|
|
3433
|
-
this.#O = void 0, this.#
|
|
3434
|
-
const i = this.#
|
|
3435
|
-
this.#
|
|
3452
|
+
this.#O = void 0, this.#i.merge();
|
|
3453
|
+
const i = this.#t?.getAll() ?? [];
|
|
3454
|
+
this.#i.applyState(e, i);
|
|
3436
3455
|
}
|
|
3437
3456
|
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(A.FULL, "setup");
|
|
3438
3457
|
}
|
|
3439
3458
|
}
|
|
3440
|
-
#
|
|
3459
|
+
#Oe(e) {
|
|
3441
3460
|
let i = 0, o = 0, n = 0, r = 0, s = 0;
|
|
3442
3461
|
if (this.#g) {
|
|
3443
|
-
const a = this._virtualization.container, c = this.#
|
|
3462
|
+
const a = this._virtualization.container, c = this.#B;
|
|
3444
3463
|
i = c?.scrollLeft ?? 0, o = a?.scrollHeight ?? 0, n = c?.scrollWidth ?? 0, r = a?.clientHeight ?? 0, s = c?.clientWidth ?? 0;
|
|
3445
3464
|
}
|
|
3446
|
-
if (this.refreshVirtualWindow(!1) && this.#
|
|
3447
|
-
this.#m = 0, this.#
|
|
3465
|
+
if (this.refreshVirtualWindow(!1) && this.#t?.onScrollRender(), this._virtualization.variableHeights && (this.#m && clearTimeout(this.#m), this.#m = window.setTimeout(() => {
|
|
3466
|
+
this.#m = 0, this.#we(this._virtualization.start, this._virtualization.end);
|
|
3448
3467
|
}, 100)), this.#g) {
|
|
3449
|
-
const a = this.#
|
|
3450
|
-
a.scrollTop = e, a.scrollLeft = i, a.scrollHeight = o, a.scrollWidth = n, a.clientHeight = r, a.clientWidth = s, this.#
|
|
3468
|
+
const a = this.#ee;
|
|
3469
|
+
a.scrollTop = e, a.scrollLeft = i, a.scrollHeight = o, a.scrollWidth = n, a.clientHeight = r, a.clientWidth = s, this.#t?.onScroll(a);
|
|
3451
3470
|
}
|
|
3452
3471
|
}
|
|
3453
3472
|
findHeaderRow() {
|
|
@@ -3469,6 +3488,7 @@ class k extends HTMLElement {
|
|
|
3469
3488
|
detail: {
|
|
3470
3489
|
rowIndex: i,
|
|
3471
3490
|
colIndex: o,
|
|
3491
|
+
column: s,
|
|
3472
3492
|
field: l,
|
|
3473
3493
|
value: a,
|
|
3474
3494
|
row: r,
|
|
@@ -3483,11 +3503,12 @@ class k extends HTMLElement {
|
|
|
3483
3503
|
row: r,
|
|
3484
3504
|
rowIndex: i,
|
|
3485
3505
|
colIndex: o,
|
|
3506
|
+
column: s,
|
|
3486
3507
|
field: l,
|
|
3487
3508
|
value: a,
|
|
3488
3509
|
cellEl: n,
|
|
3489
3510
|
originalEvent: e
|
|
3490
|
-
}, f = this.#
|
|
3511
|
+
}, f = this.#t?.onCellClick(h) ?? !1;
|
|
3491
3512
|
return this.#L("cell-click", h), f;
|
|
3492
3513
|
}
|
|
3493
3514
|
_dispatchRowClick(e, i, o, n) {
|
|
@@ -3497,53 +3518,52 @@ class k extends HTMLElement {
|
|
|
3497
3518
|
row: o,
|
|
3498
3519
|
rowEl: n,
|
|
3499
3520
|
originalEvent: e
|
|
3500
|
-
}, s = this.#
|
|
3521
|
+
}, s = this.#t?.onRowClick(r) ?? !1;
|
|
3501
3522
|
return this.#L("row-click", r), s;
|
|
3502
3523
|
}
|
|
3503
3524
|
_dispatchHeaderClick(e, i, o) {
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
column: n,
|
|
3525
|
+
if (!i) return !1;
|
|
3526
|
+
const n = {
|
|
3527
|
+
colIndex: this._columns.indexOf(i),
|
|
3528
|
+
field: i.field,
|
|
3529
|
+
column: i,
|
|
3510
3530
|
headerEl: o,
|
|
3511
3531
|
originalEvent: e
|
|
3512
3532
|
};
|
|
3513
|
-
return this.#
|
|
3533
|
+
return this.#t?.onHeaderClick(n) ?? !1;
|
|
3514
3534
|
}
|
|
3515
3535
|
_dispatchKeyDown(e) {
|
|
3516
|
-
return this.#
|
|
3536
|
+
return this.#t?.onKeyDown(e) ?? !1;
|
|
3517
3537
|
}
|
|
3518
3538
|
_getHorizontalScrollOffsets(e, i) {
|
|
3519
|
-
return this.#
|
|
3539
|
+
return this.#t?.getHorizontalScrollOffsets(e, i) ?? { left: 0, right: 0 };
|
|
3520
3540
|
}
|
|
3521
3541
|
queryPlugins(e) {
|
|
3522
|
-
return this.#
|
|
3542
|
+
return this.#t?.queryPlugins(e) ?? [];
|
|
3523
3543
|
}
|
|
3524
3544
|
query(e, i) {
|
|
3525
|
-
return this.#
|
|
3545
|
+
return this.#t?.queryPlugins({ type: e, context: i }) ?? [];
|
|
3526
3546
|
}
|
|
3527
3547
|
_dispatchCellMouseDown(e) {
|
|
3528
|
-
return this.#
|
|
3548
|
+
return this.#t?.onCellMouseDown(e) ?? !1;
|
|
3529
3549
|
}
|
|
3530
3550
|
_dispatchCellMouseMove(e) {
|
|
3531
|
-
this.#
|
|
3551
|
+
this.#t?.onCellMouseMove(e);
|
|
3532
3552
|
}
|
|
3533
3553
|
_dispatchCellMouseUp(e) {
|
|
3534
|
-
this.#
|
|
3554
|
+
this.#t?.onCellMouseUp(e);
|
|
3535
3555
|
}
|
|
3536
3556
|
_afterCellRender(e) {
|
|
3537
|
-
this.#
|
|
3557
|
+
this.#t?.afterCellRender(e);
|
|
3538
3558
|
}
|
|
3539
3559
|
_hasAfterCellRenderHook() {
|
|
3540
|
-
return this.#
|
|
3560
|
+
return this.#t?.hasAfterCellRenderHook() ?? !1;
|
|
3541
3561
|
}
|
|
3542
3562
|
_afterRowRender(e) {
|
|
3543
|
-
this.#
|
|
3563
|
+
this.#t?.afterRowRender(e);
|
|
3544
3564
|
}
|
|
3545
3565
|
_hasAfterRowRenderHook() {
|
|
3546
|
-
return this.#
|
|
3566
|
+
return this.#t?.hasAfterRowRenderHook() ?? !1;
|
|
3547
3567
|
}
|
|
3548
3568
|
async ready() {
|
|
3549
3569
|
return this.#d;
|
|
@@ -3555,7 +3575,7 @@ class k extends HTMLElement {
|
|
|
3555
3575
|
return Object.freeze({ ...this.#o || {} });
|
|
3556
3576
|
}
|
|
3557
3577
|
getRowId(e) {
|
|
3558
|
-
return this.#
|
|
3578
|
+
return this.#Se(e, this.#o.getRowId);
|
|
3559
3579
|
}
|
|
3560
3580
|
getRow(e) {
|
|
3561
3581
|
return this.#R.get(e)?.row;
|
|
@@ -3619,50 +3639,50 @@ class k extends HTMLElement {
|
|
|
3619
3639
|
return ai(this, e, i);
|
|
3620
3640
|
}
|
|
3621
3641
|
setColumnVisible(e, i) {
|
|
3622
|
-
const o = this.#
|
|
3642
|
+
const o = this.#i.setColumnVisible(e, i);
|
|
3623
3643
|
return o && this.requestStateChange(), o;
|
|
3624
3644
|
}
|
|
3625
3645
|
toggleColumnVisibility(e) {
|
|
3626
|
-
const i = this.#
|
|
3646
|
+
const i = this.#i.toggleColumnVisibility(e);
|
|
3627
3647
|
return i && this.requestStateChange(), i;
|
|
3628
3648
|
}
|
|
3629
3649
|
isColumnVisible(e) {
|
|
3630
|
-
return this.#
|
|
3650
|
+
return this.#i.isColumnVisible(e);
|
|
3631
3651
|
}
|
|
3632
3652
|
showAllColumns() {
|
|
3633
|
-
this.#
|
|
3653
|
+
this.#i.showAllColumns(), this.requestStateChange();
|
|
3634
3654
|
}
|
|
3635
3655
|
getAllColumns() {
|
|
3636
|
-
return this.#
|
|
3656
|
+
return this.#i.getAllColumns();
|
|
3637
3657
|
}
|
|
3638
3658
|
setColumnOrder(e) {
|
|
3639
|
-
this.#
|
|
3659
|
+
this.#i.setColumnOrder(e), this.requestStateChange();
|
|
3640
3660
|
}
|
|
3641
3661
|
getColumnOrder() {
|
|
3642
|
-
return this.#
|
|
3662
|
+
return this.#i.getColumnOrder();
|
|
3643
3663
|
}
|
|
3644
3664
|
getColumnState() {
|
|
3645
|
-
const e = this.#
|
|
3646
|
-
return this.#
|
|
3665
|
+
const e = this.#t?.getAll() ?? [];
|
|
3666
|
+
return this.#i.collectState(e);
|
|
3647
3667
|
}
|
|
3648
3668
|
set columnState(e) {
|
|
3649
|
-
e && (this.#O = e, this.#
|
|
3669
|
+
e && (this.#O = e, this.#i.initialColumnState = e, this.#u && this.#Me(e));
|
|
3650
3670
|
}
|
|
3651
3671
|
get columnState() {
|
|
3652
3672
|
return this.getColumnState();
|
|
3653
3673
|
}
|
|
3654
|
-
#
|
|
3655
|
-
const i = this.#
|
|
3656
|
-
this.#
|
|
3674
|
+
#Me(e) {
|
|
3675
|
+
const i = this.#t?.getAll() ?? [];
|
|
3676
|
+
this.#i.applyState(e, i), this.#P();
|
|
3657
3677
|
}
|
|
3658
3678
|
requestStateChange() {
|
|
3659
|
-
const e = this.#
|
|
3660
|
-
this.#
|
|
3679
|
+
const e = this.#t?.getAll() ?? [];
|
|
3680
|
+
this.#i.requestStateChange(e);
|
|
3661
3681
|
}
|
|
3662
3682
|
resetColumnState() {
|
|
3663
3683
|
this.#O = void 0, this.__originalOrder = [];
|
|
3664
|
-
const e = this.#
|
|
3665
|
-
this.#
|
|
3684
|
+
const e = this.#t?.getAll() ?? [];
|
|
3685
|
+
this.#i.resetState(e), this.#i.merge(), this.#P();
|
|
3666
3686
|
}
|
|
3667
3687
|
get isToolPanelOpen() {
|
|
3668
3688
|
return this.#c.isPanelOpen;
|
|
@@ -3689,10 +3709,10 @@ class k extends HTMLElement {
|
|
|
3689
3709
|
return this.#c.getToolPanels();
|
|
3690
3710
|
}
|
|
3691
3711
|
registerToolPanel(e) {
|
|
3692
|
-
this.#
|
|
3712
|
+
this.#e.apiToolPanelIds.add(e.id), this.#c.registerToolPanel(e);
|
|
3693
3713
|
}
|
|
3694
3714
|
unregisterToolPanel(e) {
|
|
3695
|
-
this.#
|
|
3715
|
+
this.#e.apiToolPanelIds.delete(e), this.#c.unregisterToolPanel(e);
|
|
3696
3716
|
}
|
|
3697
3717
|
getHeaderContents() {
|
|
3698
3718
|
return this.#c.getHeaderContents();
|
|
@@ -3712,71 +3732,71 @@ class k extends HTMLElement {
|
|
|
3712
3732
|
unregisterToolbarContent(e) {
|
|
3713
3733
|
this.#c.unregisterToolbarContent(e);
|
|
3714
3734
|
}
|
|
3715
|
-
#
|
|
3735
|
+
#Q = !1;
|
|
3716
3736
|
refreshShellHeader() {
|
|
3717
|
-
this.#
|
|
3718
|
-
this.#
|
|
3737
|
+
this.#Q || (this.#Q = !0, queueMicrotask(() => {
|
|
3738
|
+
this.#Q = !1, this.isConnected && (this.#k(), this.#i.markSourcesChanged(), this.#i.merge(), he(this.#e), this.#J(), this.#F(), this.#ke());
|
|
3719
3739
|
}));
|
|
3720
3740
|
}
|
|
3721
|
-
#
|
|
3741
|
+
#ke() {
|
|
3722
3742
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3723
3743
|
if (this._headerRowEl = i?.querySelector(".header-row"), this._virtualization.totalHeightEl = i?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = i?.querySelector(".rows-viewport"), this._bodyEl = i?.querySelector(".rows"), this.__rowsBodyEl = i?.querySelector(".rows-body"), this.#c.isInitialized) {
|
|
3724
|
-
ge(this.#n, this.#
|
|
3744
|
+
ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
|
|
3725
3745
|
const o = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3726
|
-
o && this.#
|
|
3746
|
+
o && this.#e.toolPanels.has(o) && (this.openToolPanel(), this.#e.expandedSections.add(o));
|
|
3727
3747
|
}
|
|
3728
|
-
this._resizeController = Me(this), this.#
|
|
3748
|
+
this._resizeController = Me(this), this.#X(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
|
|
3729
3749
|
}
|
|
3730
3750
|
#A = /* @__PURE__ */ new Map();
|
|
3731
3751
|
registerStyles(e, i) {
|
|
3732
3752
|
let o = this.#A.get(e);
|
|
3733
|
-
o || (o = new CSSStyleSheet(), this.#A.set(e, o)), o.replaceSync(i), this.#
|
|
3753
|
+
o || (o = new CSSStyleSheet(), this.#A.set(e, o)), o.replaceSync(i), this.#ge();
|
|
3734
3754
|
}
|
|
3735
3755
|
unregisterStyles(e) {
|
|
3736
|
-
this.#A.delete(e) && this.#
|
|
3756
|
+
this.#A.delete(e) && this.#ge();
|
|
3737
3757
|
}
|
|
3738
3758
|
getRegisteredStyles() {
|
|
3739
3759
|
return Array.from(this.#A.keys());
|
|
3740
3760
|
}
|
|
3741
|
-
#
|
|
3761
|
+
#ge() {
|
|
3742
3762
|
const e = Array.from(this.#A.values()), i = document.adoptedStyleSheets.filter(
|
|
3743
3763
|
(o) => !Array.from(this.#A.values()).includes(o)
|
|
3744
3764
|
);
|
|
3745
3765
|
document.adoptedStyleSheets = [...i, ...e];
|
|
3746
3766
|
}
|
|
3747
3767
|
#k() {
|
|
3748
|
-
|
|
3768
|
+
Ie(this, this.#e), Ne(this, this.#e), qe(this, this.#e, this.#ne());
|
|
3749
3769
|
}
|
|
3750
|
-
#
|
|
3770
|
+
#pe() {
|
|
3751
3771
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3752
3772
|
if (!e) return;
|
|
3753
|
-
he(this.#
|
|
3773
|
+
he(this.#e);
|
|
3754
3774
|
const i = ui(
|
|
3755
3775
|
this.#o.shell,
|
|
3756
|
-
this.#
|
|
3776
|
+
this.#e,
|
|
3757
3777
|
this.#o.icons?.toolPanel
|
|
3758
3778
|
), o = document.createElement("div");
|
|
3759
3779
|
o.innerHTML = i;
|
|
3760
3780
|
const n = o.firstElementChild;
|
|
3761
|
-
n && (e.replaceWith(n), this.#
|
|
3781
|
+
n && (e.replaceWith(n), this.#be(), de(this.#n, this.#o?.shell, this.#e));
|
|
3762
3782
|
}
|
|
3763
|
-
#
|
|
3783
|
+
#Ie() {
|
|
3764
3784
|
const e = () => {
|
|
3765
|
-
const o = this.#
|
|
3785
|
+
const o = this.#e.lightDomTitle, n = this.#e.hasToolButtonsContainer;
|
|
3766
3786
|
this.#k();
|
|
3767
|
-
const r = this.#
|
|
3768
|
-
(r && !o || s && !n) && (this.#
|
|
3787
|
+
const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
|
|
3788
|
+
(r && !o || s && !n) && (this.#i.markSourcesChanged(), this.#i.merge(), this.#pe());
|
|
3769
3789
|
}, i = () => {
|
|
3770
3790
|
this.__lightDomColumnsCache = void 0, this.#P();
|
|
3771
3791
|
};
|
|
3772
|
-
this.#
|
|
3792
|
+
this.#i.registerLightDomHandler("tbw-grid-header", e), this.#i.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#i.registerLightDomHandler("tbw-grid-tool-panel", e), this.#i.registerLightDomHandler("tbw-grid-column", i), this.#i.registerLightDomHandler("tbw-grid-detail", i), this.#i.observeLightDOM(this);
|
|
3773
3793
|
}
|
|
3774
3794
|
refreshColumns() {
|
|
3775
|
-
this.__lightDomColumnsCache = void 0, Y(this), this.#
|
|
3776
|
-
const e = this.#
|
|
3795
|
+
this.__lightDomColumnsCache = void 0, Y(this), this.#i.parseLightDomColumns(this);
|
|
3796
|
+
const e = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
|
|
3777
3797
|
this.#k();
|
|
3778
|
-
const o = this.#
|
|
3779
|
-
(o && !e || n && !i) && (this.#
|
|
3798
|
+
const o = this.#e.lightDomTitle, n = this.#e.hasToolButtonsContainer;
|
|
3799
|
+
(o && !e || n && !i) && (this.#i.markSourcesChanged(), this.#i.merge(), this.#pe()), this.#s.requestPhase(A.COLUMNS, "refreshColumns");
|
|
3780
3800
|
}
|
|
3781
3801
|
#Ne() {
|
|
3782
3802
|
const e = this._virtualization.container, i = this._virtualization.viewportEl ?? e;
|
|
@@ -3794,18 +3814,18 @@ class k extends HTMLElement {
|
|
|
3794
3814
|
n = o.cachedFauxHeight, r = o.cachedViewportHeight, s = o.cachedScrollAreaHeight || n;
|
|
3795
3815
|
const l = s - r, a = Math.max(0, n - s);
|
|
3796
3816
|
let c, h = 0;
|
|
3797
|
-
return o.variableHeights && o.positionCache ? c =
|
|
3817
|
+
return o.variableHeights && o.positionCache ? c = Fi(o.positionCache) : (c = e * o.rowHeight, h = this.#t?.getExtraHeight() ?? 0), c + l + h + a;
|
|
3798
3818
|
}
|
|
3799
|
-
#
|
|
3819
|
+
#Z() {
|
|
3800
3820
|
if (!this._virtualization.variableHeights) return;
|
|
3801
3821
|
const e = this._rows, i = this._virtualization.rowHeight || 28, o = this.#o.rowHeight, n = this.#o.getRowId, r = n ? (l) => n(l) : void 0;
|
|
3802
|
-
this._virtualization.positionCache =
|
|
3822
|
+
this._virtualization.positionCache = Wi(
|
|
3803
3823
|
e,
|
|
3804
3824
|
this._virtualization.heightCache,
|
|
3805
3825
|
i,
|
|
3806
3826
|
{ rowId: r },
|
|
3807
3827
|
(l, a) => {
|
|
3808
|
-
const c = this.#
|
|
3828
|
+
const c = this.#t?.getRowHeight?.(l, a);
|
|
3809
3829
|
if (c !== void 0) return c;
|
|
3810
3830
|
if (o) {
|
|
3811
3831
|
const h = o(l, a);
|
|
@@ -3813,11 +3833,11 @@ class k extends HTMLElement {
|
|
|
3813
3833
|
}
|
|
3814
3834
|
}
|
|
3815
3835
|
);
|
|
3816
|
-
const s =
|
|
3836
|
+
const s = Gi(
|
|
3817
3837
|
this._virtualization.positionCache,
|
|
3818
3838
|
e,
|
|
3819
3839
|
i,
|
|
3820
|
-
(l, a) => this.#
|
|
3840
|
+
(l, a) => this.#t?.getRowHeight?.(l, a)
|
|
3821
3841
|
);
|
|
3822
3842
|
this._virtualization.measuredCount = s.measuredCount, s.measuredCount > 0 && (this._virtualization.averageHeight = s.averageHeight);
|
|
3823
3843
|
}
|
|
@@ -3825,16 +3845,16 @@ class k extends HTMLElement {
|
|
|
3825
3845
|
if (!this._virtualization.variableHeights || !this._virtualization.positionCache || e < 0 || e >= this._rows.length) return;
|
|
3826
3846
|
const o = this._virtualization.positionCache, n = this._rows[e];
|
|
3827
3847
|
let r = i;
|
|
3828
|
-
r === void 0 && (r = this.#
|
|
3848
|
+
r === void 0 && (r = this.#t?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
|
|
3829
3849
|
const s = o[e];
|
|
3830
3850
|
if (!(!s || Math.abs(s.height - r) < 1) && (me(o, e, r), this._virtualization.totalHeightEl)) {
|
|
3831
3851
|
const l = this.#T(this._rows.length);
|
|
3832
3852
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3833
3853
|
}
|
|
3834
3854
|
}
|
|
3835
|
-
#
|
|
3855
|
+
#we(e, i) {
|
|
3836
3856
|
if (!this._virtualization.variableHeights || !this._virtualization.positionCache || !this._bodyEl) return;
|
|
3837
|
-
const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r =
|
|
3857
|
+
const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Bi(
|
|
3838
3858
|
{
|
|
3839
3859
|
positionCache: this._virtualization.positionCache,
|
|
3840
3860
|
heightCache: this._virtualization.heightCache,
|
|
@@ -3842,7 +3862,7 @@ class k extends HTMLElement {
|
|
|
3842
3862
|
defaultHeight: this._virtualization.rowHeight,
|
|
3843
3863
|
start: e,
|
|
3844
3864
|
end: i,
|
|
3845
|
-
getPluginHeight: (s, l) => this.#
|
|
3865
|
+
getPluginHeight: (s, l) => this.#t?.getRowHeight?.(s, l),
|
|
3846
3866
|
getRowId: n ? (s) => n(s) : void 0
|
|
3847
3867
|
},
|
|
3848
3868
|
o
|
|
@@ -3856,9 +3876,9 @@ class k extends HTMLElement {
|
|
|
3856
3876
|
if (!this._bodyEl) return !1;
|
|
3857
3877
|
const o = this._rows.length;
|
|
3858
3878
|
if (!this._virtualization.enabled)
|
|
3859
|
-
return this.#
|
|
3879
|
+
return this.#j(0, o), i || this.#t?.afterRender(), !0;
|
|
3860
3880
|
if (this._rows.length <= this._virtualization.bypassThreshold)
|
|
3861
|
-
return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#
|
|
3881
|
+
return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#j(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#T(o, !0)}px`), this.#he(o, this._visibleColumns.length), i || this.#t?.afterRender(), !0;
|
|
3862
3882
|
const n = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? n, s = e ? this._virtualization.cachedViewportHeight = r.clientHeight : this._virtualization.cachedViewportHeight || (this._virtualization.cachedViewportHeight = r.clientHeight), l = this._virtualization.rowHeight, a = n.scrollTop;
|
|
3863
3883
|
let c;
|
|
3864
3884
|
const h = this._virtualization.positionCache;
|
|
@@ -3869,13 +3889,13 @@ class k extends HTMLElement {
|
|
|
3869
3889
|
let b = 0;
|
|
3870
3890
|
const _ = 10;
|
|
3871
3891
|
for (; b < _; ) {
|
|
3872
|
-
const R = this.#
|
|
3892
|
+
const R = this.#t?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
|
|
3873
3893
|
if (E >= c || E < 0) break;
|
|
3874
3894
|
c = E, b++;
|
|
3875
3895
|
}
|
|
3876
3896
|
}
|
|
3877
3897
|
c = c - c % 2, c < 0 && (c = 0);
|
|
3878
|
-
const f = this.#
|
|
3898
|
+
const f = this.#t?.adjustVirtualStart(c, a, l);
|
|
3879
3899
|
f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
|
|
3880
3900
|
let p;
|
|
3881
3901
|
if (this._virtualization.variableHeights && h && h.length > 0) {
|
|
@@ -3909,45 +3929,50 @@ class k extends HTMLElement {
|
|
|
3909
3929
|
if (this._virtualization.variableHeights && h && h[c])
|
|
3910
3930
|
w = h[c].offset;
|
|
3911
3931
|
else {
|
|
3912
|
-
const b = this.#
|
|
3932
|
+
const b = this.#t?.getExtraHeightBefore?.(c) ?? 0;
|
|
3913
3933
|
w = c * l + b;
|
|
3914
3934
|
}
|
|
3915
3935
|
const v = -(a - w);
|
|
3916
|
-
return this._bodyEl.style.transform = `translateY(${v}px)`, this.#
|
|
3936
|
+
return this._bodyEl.style.transform = `translateY(${v}px)`, this.#j(c, p, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#we(c, p), this.#he(o, this._visibleColumns.length), e && !i && (this.#t?.afterRender(), queueMicrotask(() => {
|
|
3917
3937
|
if (!this._virtualization.totalHeightEl) return;
|
|
3918
3938
|
const b = this.#T(o);
|
|
3919
3939
|
this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${b}px`);
|
|
3920
3940
|
})), !0;
|
|
3921
3941
|
}
|
|
3922
|
-
#
|
|
3923
|
-
this.#k(), this.#
|
|
3942
|
+
#J() {
|
|
3943
|
+
this.#k(), this.#i.markSourcesChanged(), this.#i.merge();
|
|
3924
3944
|
const e = this.#o?.shell;
|
|
3925
|
-
|
|
3945
|
+
Ci(
|
|
3926
3946
|
this.#n,
|
|
3927
3947
|
e,
|
|
3928
|
-
{ isPanelOpen: this.#
|
|
3948
|
+
{ isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
|
|
3929
3949
|
this.#o?.icons
|
|
3930
|
-
) && (this.#
|
|
3950
|
+
) && (this.#be(), this.#c.setInitialized(!0));
|
|
3931
3951
|
}
|
|
3932
|
-
#
|
|
3933
|
-
fi(this.#n, this.#o?.shell, this.#
|
|
3952
|
+
#be() {
|
|
3953
|
+
fi(this.#n, this.#o?.shell, this.#e, {
|
|
3934
3954
|
onPanelToggle: () => this.toggleToolPanel(),
|
|
3935
3955
|
onSectionToggle: (e) => this.toggleToolPanelSection(e)
|
|
3936
|
-
}), this.#q?.(), this.#q =
|
|
3956
|
+
}), this.#q?.(), this.#q = pi(this.#n, this.#o?.shell, (e) => {
|
|
3937
3957
|
this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
|
|
3938
|
-
})
|
|
3958
|
+
}), this.#$?.(), this.#$ = gi(
|
|
3959
|
+
this,
|
|
3960
|
+
this.#o?.shell,
|
|
3961
|
+
this.#e,
|
|
3962
|
+
() => this.closeToolPanel()
|
|
3963
|
+
);
|
|
3939
3964
|
}
|
|
3940
3965
|
}
|
|
3941
3966
|
customElements.get(k.tagName) || customElements.define(k.tagName, k);
|
|
3942
3967
|
globalThis.DataGridElement = k;
|
|
3943
|
-
const
|
|
3968
|
+
const lo = {
|
|
3944
3969
|
CAN_MOVE_COLUMN: "canMoveColumn",
|
|
3945
3970
|
GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
|
|
3946
3971
|
};
|
|
3947
|
-
class
|
|
3972
|
+
class ao {
|
|
3948
3973
|
static dependencies;
|
|
3949
3974
|
static manifest;
|
|
3950
|
-
version = "1.
|
|
3975
|
+
version = "1.17.0";
|
|
3951
3976
|
styles;
|
|
3952
3977
|
cellRenderers;
|
|
3953
3978
|
headerRenderers;
|
|
@@ -4086,7 +4111,7 @@ const H = {
|
|
|
4086
4111
|
GROUP_KEY: "data-group-key",
|
|
4087
4112
|
TREE_LEVEL: "data-tree-level",
|
|
4088
4113
|
STICKY: "data-sticky"
|
|
4089
|
-
},
|
|
4114
|
+
}, co = {
|
|
4090
4115
|
ROOT: `.${H.ROOT}`,
|
|
4091
4116
|
HEADER: `.${H.HEADER}`,
|
|
4092
4117
|
HEADER_ROW: `.${H.HEADER_ROW}`,
|
|
@@ -4101,7 +4126,7 @@ const H = {
|
|
|
4101
4126
|
CELL_AT: (t, e) => `.${H.DATA_ROW}[${ee.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${ee.COL_INDEX}="${e}"]`,
|
|
4102
4127
|
SELECTED_ROWS: `.${H.DATA_ROW}.${H.SELECTED}`,
|
|
4103
4128
|
EDITING_CELL: `.${H.DATA_CELL}.${H.EDITING}`
|
|
4104
|
-
},
|
|
4129
|
+
}, ho = {
|
|
4105
4130
|
COLOR_BG: "--tbw-color-bg",
|
|
4106
4131
|
COLOR_FG: "--tbw-color-fg",
|
|
4107
4132
|
COLOR_FG_MUTED: "--tbw-color-fg-muted",
|
|
@@ -4120,14 +4145,14 @@ const H = {
|
|
|
4120
4145
|
BORDER_RADIUS: "--tbw-border-radius",
|
|
4121
4146
|
FOCUS_OUTLINE: "--tbw-focus-outline"
|
|
4122
4147
|
};
|
|
4123
|
-
function
|
|
4148
|
+
function uo(t) {
|
|
4124
4149
|
const e = document.createElement("tbw-grid");
|
|
4125
4150
|
return t && (e.gridConfig = t), e;
|
|
4126
4151
|
}
|
|
4127
|
-
function
|
|
4152
|
+
function fo(t, e = document) {
|
|
4128
4153
|
return e.querySelector(t);
|
|
4129
4154
|
}
|
|
4130
|
-
const
|
|
4155
|
+
const go = {
|
|
4131
4156
|
CELL_CHANGE: "cell-change",
|
|
4132
4157
|
CELL_COMMIT: "cell-commit",
|
|
4133
4158
|
ROW_COMMIT: "row-commit",
|
|
@@ -4142,7 +4167,7 @@ const fo = {
|
|
|
4142
4167
|
CELL_ACTIVATE: "cell-activate",
|
|
4143
4168
|
GROUP_TOGGLE: "group-toggle",
|
|
4144
4169
|
COLUMN_STATE_CHANGE: "column-state-change"
|
|
4145
|
-
},
|
|
4170
|
+
}, po = {
|
|
4146
4171
|
SELECTION_CHANGE: "selection-change",
|
|
4147
4172
|
TREE_EXPAND: "tree-expand",
|
|
4148
4173
|
FILTER_CHANGE: "filter-change",
|
|
@@ -4201,50 +4226,50 @@ const fo = {
|
|
|
4201
4226
|
first: (t) => t[0] ?? 0,
|
|
4202
4227
|
last: (t) => t[t.length - 1] ?? 0
|
|
4203
4228
|
};
|
|
4204
|
-
function
|
|
4229
|
+
function oo(t) {
|
|
4205
4230
|
return Be[t] ?? Be.sum;
|
|
4206
4231
|
}
|
|
4207
|
-
function
|
|
4208
|
-
return
|
|
4232
|
+
function wo(t, e) {
|
|
4233
|
+
return oo(t)(e);
|
|
4209
4234
|
}
|
|
4210
|
-
const
|
|
4235
|
+
const bo = O.register.bind(O), mo = O.unregister.bind(O), vo = O.get.bind(O), Co = O.run.bind(O), yo = O.list.bind(O);
|
|
4211
4236
|
export {
|
|
4212
|
-
|
|
4237
|
+
ao as BaseGridPlugin,
|
|
4213
4238
|
ft as DEFAULT_ANIMATION_CONFIG,
|
|
4214
4239
|
M as DEFAULT_GRID_ICONS,
|
|
4215
|
-
|
|
4240
|
+
go as DGEvents,
|
|
4216
4241
|
k as DataGridElement,
|
|
4217
4242
|
Je as F,
|
|
4218
4243
|
G as FitModeEnum,
|
|
4219
|
-
|
|
4244
|
+
ho as GridCSSVars,
|
|
4220
4245
|
H as GridClasses,
|
|
4221
4246
|
ee as GridDataAttrs,
|
|
4222
4247
|
k as GridElement,
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4248
|
+
co as GridSelectors,
|
|
4249
|
+
lo as PLUGIN_QUERIES,
|
|
4250
|
+
po as PluginEvents,
|
|
4226
4251
|
ne as PluginManager,
|
|
4227
4252
|
A as RenderPhase,
|
|
4228
4253
|
Xe as a,
|
|
4229
4254
|
O as aggregatorRegistry,
|
|
4230
4255
|
W as b,
|
|
4231
4256
|
Vt as builtInSort,
|
|
4232
|
-
|
|
4233
|
-
|
|
4257
|
+
ro as c,
|
|
4258
|
+
uo as createGrid,
|
|
4234
4259
|
Ke as d,
|
|
4235
4260
|
Ut as defaultComparator,
|
|
4236
4261
|
$ as e,
|
|
4237
4262
|
Ce as f,
|
|
4238
4263
|
zt as g,
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4264
|
+
vo as getAggregator,
|
|
4265
|
+
oo as getValueAggregator,
|
|
4266
|
+
yo as listAggregators,
|
|
4267
|
+
fo as queryGrid,
|
|
4268
|
+
no as r,
|
|
4269
|
+
bo as registerAggregator,
|
|
4270
|
+
Co as runAggregator,
|
|
4271
|
+
wo as runValueAggregator,
|
|
4272
|
+
so as s,
|
|
4273
|
+
mo as unregisterAggregator
|
|
4249
4274
|
};
|
|
4250
4275
|
//# sourceMappingURL=index.js.map
|