@toolbox-web/grid 1.16.1 → 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 +1 -1
- package/all.js.map +1 -1
- package/index.js +376 -357
- 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/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/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 +19 -19
- 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/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,7 +1110,7 @@ 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
1115
|
if (i < 0 || o < 0) return;
|
|
1115
1116
|
t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
|
|
@@ -1140,7 +1141,7 @@ function ye(t, e, i, o) {
|
|
|
1140
1141
|
cell: c !== void 0 && h !== void 0 && c >= 0 && h >= 0 ? { row: c, col: h } : void 0
|
|
1141
1142
|
};
|
|
1142
1143
|
}
|
|
1143
|
-
function
|
|
1144
|
+
function Nt(t, e, i) {
|
|
1144
1145
|
const o = ye(t, e, i, "mousedown");
|
|
1145
1146
|
(t._dispatchCellMouseDown?.(o) ?? !1) && ie.set(t, !0);
|
|
1146
1147
|
}
|
|
@@ -1159,7 +1160,7 @@ function Wt(t, e, i) {
|
|
|
1159
1160
|
"mousedown",
|
|
1160
1161
|
(o) => {
|
|
1161
1162
|
const n = o.target.closest(".cell[data-col]");
|
|
1162
|
-
n && (n.classList.contains("editing") || (o.preventDefault(),
|
|
1163
|
+
n && (n.classList.contains("editing") || (o.preventDefault(), It(t, n)));
|
|
1163
1164
|
},
|
|
1164
1165
|
{ signal: i }
|
|
1165
1166
|
), e.addEventListener(
|
|
@@ -1182,7 +1183,7 @@ function Wt(t, e, i) {
|
|
|
1182
1183
|
);
|
|
1183
1184
|
}
|
|
1184
1185
|
function Ft(t, e, i, o) {
|
|
1185
|
-
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 });
|
|
1186
1187
|
}
|
|
1187
1188
|
function Ut(t, e) {
|
|
1188
1189
|
return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
|
|
@@ -1237,10 +1238,10 @@ function Z(t, e, i, o) {
|
|
|
1237
1238
|
o.classList.add("sortable"), o.tabIndex = 0;
|
|
1238
1239
|
const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
|
|
1239
1240
|
o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
|
|
1240
|
-
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r,
|
|
1241
|
+
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, e, o) || ze(t, e);
|
|
1241
1242
|
}), o.addEventListener("keydown", (r) => {
|
|
1242
1243
|
if (r.key === "Enter" || r.key === " ") {
|
|
1243
|
-
if (r.preventDefault(), t._dispatchHeaderClick?.(r,
|
|
1244
|
+
if (r.preventDefault(), t._dispatchHeaderClick?.(r, e, o)) return;
|
|
1244
1245
|
ze(t, e);
|
|
1245
1246
|
}
|
|
1246
1247
|
});
|
|
@@ -1612,7 +1613,7 @@ function di(t) {
|
|
|
1612
1613
|
}
|
|
1613
1614
|
return t.position === "left" && r ? (e.appendChild(r), e.appendChild(n)) : (e.appendChild(n), r && e.appendChild(r)), e;
|
|
1614
1615
|
}
|
|
1615
|
-
function
|
|
1616
|
+
function N(t) {
|
|
1616
1617
|
return t ? typeof t == "string" ? t : t.outerHTML : "";
|
|
1617
1618
|
}
|
|
1618
1619
|
function hi() {
|
|
@@ -1638,7 +1639,7 @@ function st(t) {
|
|
|
1638
1639
|
return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
|
|
1639
1640
|
}
|
|
1640
1641
|
function ui(t, e, i = "☰") {
|
|
1641
|
-
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];
|
|
1642
1643
|
for (const d of l)
|
|
1643
1644
|
a.has(d.id) || c.push(d);
|
|
1644
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));
|
|
@@ -1659,7 +1660,7 @@ function ui(t, e, i = "☰") {
|
|
|
1659
1660
|
</div>
|
|
1660
1661
|
`;
|
|
1661
1662
|
}
|
|
1662
|
-
function
|
|
1663
|
+
function Ie(t, e) {
|
|
1663
1664
|
const i = t.querySelector("tbw-grid-header");
|
|
1664
1665
|
if (!i) return;
|
|
1665
1666
|
if (!e.lightDomTitle) {
|
|
@@ -1669,7 +1670,7 @@ function Ne(t, e) {
|
|
|
1669
1670
|
const o = i.querySelectorAll("tbw-grid-header-content");
|
|
1670
1671
|
o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
|
|
1671
1672
|
}
|
|
1672
|
-
function
|
|
1673
|
+
function Ne(t, e, i) {
|
|
1673
1674
|
const o = t.querySelector(":scope > tbw-grid-tool-buttons");
|
|
1674
1675
|
if (!o) return;
|
|
1675
1676
|
e.hasToolButtonsContainer = !0;
|
|
@@ -1747,7 +1748,18 @@ function fi(t, e, i, o) {
|
|
|
1747
1748
|
}
|
|
1748
1749
|
});
|
|
1749
1750
|
}
|
|
1750
|
-
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) {
|
|
1751
1763
|
const o = t.querySelector(".tbw-tool-panel"), n = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
|
|
1752
1764
|
if (!o || !n || !r)
|
|
1753
1765
|
return () => {
|
|
@@ -1803,9 +1815,9 @@ function ge(t, e) {
|
|
|
1803
1815
|
c && e.headerContentCleanups.set(s.id, c);
|
|
1804
1816
|
}
|
|
1805
1817
|
}
|
|
1806
|
-
function
|
|
1818
|
+
function wi(t, e, i) {
|
|
1807
1819
|
if (!e.isPanelOpen) return;
|
|
1808
|
-
const o =
|
|
1820
|
+
const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
|
|
1809
1821
|
for (const [r, s] of e.toolPanels) {
|
|
1810
1822
|
const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
|
|
1811
1823
|
if (!a || !c) continue;
|
|
@@ -1837,7 +1849,7 @@ function he(t) {
|
|
|
1837
1849
|
e();
|
|
1838
1850
|
t.toolbarContentCleanups.clear();
|
|
1839
1851
|
}
|
|
1840
|
-
function
|
|
1852
|
+
function bi(t) {
|
|
1841
1853
|
for (const e of t.headerContentCleanups.values())
|
|
1842
1854
|
e();
|
|
1843
1855
|
t.headerContentCleanups.clear();
|
|
@@ -1854,7 +1866,7 @@ function wi(t) {
|
|
|
1854
1866
|
t.toolPanels.get(e)?.onClose?.();
|
|
1855
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;
|
|
1856
1868
|
}
|
|
1857
|
-
function
|
|
1869
|
+
function mi(t, e) {
|
|
1858
1870
|
let i = !1;
|
|
1859
1871
|
const o = {
|
|
1860
1872
|
get isInitialized() {
|
|
@@ -1883,7 +1895,7 @@ function bi(t, e) {
|
|
|
1883
1895
|
s && t.expandedSections.add(s.id);
|
|
1884
1896
|
}
|
|
1885
1897
|
const n = e.getShadow();
|
|
1886
|
-
$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 });
|
|
1887
1899
|
},
|
|
1888
1900
|
closeToolPanel() {
|
|
1889
1901
|
if (!t.isPanelOpen) return;
|
|
@@ -1919,7 +1931,7 @@ function bi(t, e) {
|
|
|
1919
1931
|
const f = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
|
|
1920
1932
|
f && (f.innerHTML = "");
|
|
1921
1933
|
}
|
|
1922
|
-
t.expandedSections.add(n), ue(s, n, !0),
|
|
1934
|
+
t.expandedSections.add(n), ue(s, n, !0), vi(s, t, n);
|
|
1923
1935
|
}
|
|
1924
1936
|
e.emit("tool-panel-section-toggle", { id: n, expanded: !l });
|
|
1925
1937
|
},
|
|
@@ -1977,7 +1989,7 @@ function ue(t, e, i) {
|
|
|
1977
1989
|
const o = t.querySelector(`[data-section="${e}"]`);
|
|
1978
1990
|
o && o.classList.toggle("expanded", i);
|
|
1979
1991
|
}
|
|
1980
|
-
function
|
|
1992
|
+
function vi(t, e, i) {
|
|
1981
1993
|
const o = e.toolPanels.get(i);
|
|
1982
1994
|
if (!o?.render) return;
|
|
1983
1995
|
const n = t.querySelector(`[data-section="${i}"] .tbw-accordion-content`);
|
|
@@ -1985,7 +1997,7 @@ function mi(t, e, i) {
|
|
|
1985
1997
|
const r = o.render(n);
|
|
1986
1998
|
r && e.panelCleanups.set(i, r);
|
|
1987
1999
|
}
|
|
1988
|
-
function
|
|
2000
|
+
function Ci(t, e, i, o) {
|
|
1989
2001
|
const n = st(e), r = [], s = [
|
|
1990
2002
|
"tbw-grid-header",
|
|
1991
2003
|
"tbw-grid-tool-buttons",
|
|
@@ -2000,7 +2012,7 @@ function vi(t, e, i, o) {
|
|
|
2000
2012
|
for (const l of r)
|
|
2001
2013
|
t.appendChild(l);
|
|
2002
2014
|
if (n) {
|
|
2003
|
-
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 = {
|
|
2004
2016
|
title: e?.header?.title ?? void 0,
|
|
2005
2017
|
hasPanels: g.length > 0,
|
|
2006
2018
|
isPanelOpen: i.isPanelOpen,
|
|
@@ -2019,7 +2031,7 @@ function vi(t, e, i, o) {
|
|
|
2019
2031
|
panels: g.map((_) => ({
|
|
2020
2032
|
id: _.id,
|
|
2021
2033
|
title: _.title,
|
|
2022
|
-
icon:
|
|
2034
|
+
icon: N(_.icon),
|
|
2023
2035
|
isExpanded: i.expandedSections.has(_.id)
|
|
2024
2036
|
}))
|
|
2025
2037
|
}, w = ci(u), v = di(d), b = ke({
|
|
@@ -2037,25 +2049,25 @@ function vi(t, e, i, o) {
|
|
|
2037
2049
|
const Fe = "tbw-grid-styles";
|
|
2038
2050
|
let te = "";
|
|
2039
2051
|
const pe = /* @__PURE__ */ new Map();
|
|
2040
|
-
function
|
|
2052
|
+
function yi() {
|
|
2041
2053
|
let t = document.getElementById(Fe);
|
|
2042
2054
|
return t || (t = document.createElement("style"), t.id = Fe, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
|
|
2043
2055
|
}
|
|
2044
2056
|
function we() {
|
|
2045
|
-
const t =
|
|
2057
|
+
const t = yi(), e = Array.from(pe.values()).join(`
|
|
2046
2058
|
`);
|
|
2047
2059
|
t.textContent = `${te}
|
|
2048
2060
|
|
|
2049
2061
|
/* Plugin Styles */
|
|
2050
2062
|
${e}`;
|
|
2051
2063
|
}
|
|
2052
|
-
function
|
|
2064
|
+
function _i(t) {
|
|
2053
2065
|
let e = !1;
|
|
2054
2066
|
for (const { name: i, styles: o } of t)
|
|
2055
2067
|
pe.has(i) || (pe.set(i, o), e = !0);
|
|
2056
2068
|
return e && we(), e;
|
|
2057
2069
|
}
|
|
2058
|
-
function
|
|
2070
|
+
function Ei() {
|
|
2059
2071
|
try {
|
|
2060
2072
|
for (const t of Array.from(document.styleSheets))
|
|
2061
2073
|
try {
|
|
@@ -2071,7 +2083,7 @@ function _i() {
|
|
|
2071
2083
|
}
|
|
2072
2084
|
return null;
|
|
2073
2085
|
}
|
|
2074
|
-
async function
|
|
2086
|
+
async function Si(t) {
|
|
2075
2087
|
if (te)
|
|
2076
2088
|
return;
|
|
2077
2089
|
if (typeof t == "string" && t.length > 0) {
|
|
@@ -2079,14 +2091,14 @@ async function Ei(t) {
|
|
|
2079
2091
|
return;
|
|
2080
2092
|
}
|
|
2081
2093
|
await new Promise((i) => setTimeout(i, 50));
|
|
2082
|
-
const e =
|
|
2094
|
+
const e = Ei();
|
|
2083
2095
|
e ? (te = e, we()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
|
|
2084
2096
|
"[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
|
|
2085
2097
|
"Available stylesheets:",
|
|
2086
2098
|
Array.from(document.styleSheets).map((i) => i.href || "(inline)")
|
|
2087
2099
|
);
|
|
2088
2100
|
}
|
|
2089
|
-
function
|
|
2101
|
+
function Ri() {
|
|
2090
2102
|
return {
|
|
2091
2103
|
startY: null,
|
|
2092
2104
|
startX: null,
|
|
@@ -2100,19 +2112,19 @@ function Si() {
|
|
|
2100
2112
|
momentumRaf: 0
|
|
2101
2113
|
};
|
|
2102
2114
|
}
|
|
2103
|
-
function
|
|
2115
|
+
function Ai(t) {
|
|
2104
2116
|
t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
|
|
2105
2117
|
}
|
|
2106
2118
|
function lt(t) {
|
|
2107
2119
|
t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
|
|
2108
2120
|
}
|
|
2109
|
-
function
|
|
2121
|
+
function Ti(t, e, i) {
|
|
2110
2122
|
if (t.touches.length !== 1) return;
|
|
2111
2123
|
lt(e);
|
|
2112
2124
|
const o = t.touches[0];
|
|
2113
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;
|
|
2114
2126
|
}
|
|
2115
|
-
function
|
|
2127
|
+
function xi(t, e, i) {
|
|
2116
2128
|
if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
|
|
2117
2129
|
return !1;
|
|
2118
2130
|
const o = t.touches[0], n = o.clientY, r = o.clientX, s = performance.now(), l = e.startY - n, a = e.startX - r;
|
|
@@ -2129,10 +2141,10 @@ function Ti(t, e, i) {
|
|
|
2129
2141
|
}
|
|
2130
2142
|
return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), u && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || u;
|
|
2131
2143
|
}
|
|
2132
|
-
function xi(t, e) {
|
|
2133
|
-
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Hi(t, e), Ri(t);
|
|
2134
|
-
}
|
|
2135
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) {
|
|
2136
2148
|
const n = () => {
|
|
2137
2149
|
t.velocityY *= 0.95, t.velocityX *= 0.95;
|
|
2138
2150
|
const r = t.velocityY * 16, s = t.velocityX * 16;
|
|
@@ -2140,19 +2152,19 @@ function Hi(t, e) {
|
|
|
2140
2152
|
};
|
|
2141
2153
|
t.momentumRaf = requestAnimationFrame(n);
|
|
2142
2154
|
}
|
|
2143
|
-
function
|
|
2144
|
-
t.addEventListener("touchstart", (n) =>
|
|
2155
|
+
function Pi(t, e, i, o) {
|
|
2156
|
+
t.addEventListener("touchstart", (n) => Ti(n, e, i), {
|
|
2145
2157
|
passive: !0,
|
|
2146
2158
|
signal: o
|
|
2147
2159
|
}), t.addEventListener(
|
|
2148
2160
|
"touchmove",
|
|
2149
2161
|
(n) => {
|
|
2150
|
-
|
|
2162
|
+
xi(n, e, i) && n.preventDefault();
|
|
2151
2163
|
},
|
|
2152
2164
|
{ passive: !1, signal: o }
|
|
2153
|
-
), t.addEventListener("touchend", () =>
|
|
2165
|
+
), t.addEventListener("touchend", () => Hi(e, i), { passive: !0, signal: o });
|
|
2154
2166
|
}
|
|
2155
|
-
const
|
|
2167
|
+
const zi = [
|
|
2156
2168
|
{
|
|
2157
2169
|
property: "editable",
|
|
2158
2170
|
pluginName: "editing",
|
|
@@ -2192,7 +2204,7 @@ const Pi = [
|
|
|
2192
2204
|
description: 'the "sticky" column property (deprecated, use "pinned")',
|
|
2193
2205
|
isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
|
|
2194
2206
|
}
|
|
2195
|
-
],
|
|
2207
|
+
], Di = [
|
|
2196
2208
|
{
|
|
2197
2209
|
property: "columnGroups",
|
|
2198
2210
|
pluginName: "groupingColumns",
|
|
@@ -2201,11 +2213,11 @@ const Pi = [
|
|
|
2201
2213
|
isUsed: (t) => Array.isArray(t) && t.length > 0
|
|
2202
2214
|
}
|
|
2203
2215
|
];
|
|
2204
|
-
function
|
|
2216
|
+
function Oi(t) {
|
|
2205
2217
|
return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
2206
2218
|
}
|
|
2207
2219
|
function be(t) {
|
|
2208
|
-
return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${
|
|
2220
|
+
return `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${Oi(t)}';`;
|
|
2209
2221
|
}
|
|
2210
2222
|
function D(t) {
|
|
2211
2223
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
@@ -2213,8 +2225,8 @@ function D(t) {
|
|
|
2213
2225
|
function Ue(t, e) {
|
|
2214
2226
|
return t.some((i) => i.name === e);
|
|
2215
2227
|
}
|
|
2216
|
-
function
|
|
2217
|
-
const i =
|
|
2228
|
+
function Mi(t, e) {
|
|
2229
|
+
const i = zi, o = Di, n = /* @__PURE__ */ new Map();
|
|
2218
2230
|
function r(l, a, c, h, f = !1) {
|
|
2219
2231
|
n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty: f });
|
|
2220
2232
|
const p = n.get(l);
|
|
@@ -2264,7 +2276,7 @@ This validation helps catch misconfigurations early. The properties listed above
|
|
|
2264
2276
|
);
|
|
2265
2277
|
}
|
|
2266
2278
|
}
|
|
2267
|
-
function
|
|
2279
|
+
function ki(t) {
|
|
2268
2280
|
const e = [], i = [];
|
|
2269
2281
|
for (const o of t) {
|
|
2270
2282
|
const r = o.constructor.manifest;
|
|
@@ -2287,7 +2299,7 @@ ${e.join(`
|
|
|
2287
2299
|
|
|
2288
2300
|
`)}`);
|
|
2289
2301
|
}
|
|
2290
|
-
function
|
|
2302
|
+
function Ii(t, e) {
|
|
2291
2303
|
const i = t.name, n = t.constructor.dependencies ?? [];
|
|
2292
2304
|
for (const r of n) {
|
|
2293
2305
|
const s = r.name, l = r.required ?? !0, a = r.reason;
|
|
@@ -2335,24 +2347,24 @@ ${D(o.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
|
|
|
2335
2347
|
function at(t, e) {
|
|
2336
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;
|
|
2337
2349
|
}
|
|
2338
|
-
function
|
|
2350
|
+
function qi(t, e, i) {
|
|
2339
2351
|
const o = at(e, i);
|
|
2340
2352
|
if (typeof o == "string")
|
|
2341
2353
|
return t.byKey.get(o);
|
|
2342
2354
|
if (o && typeof o == "object")
|
|
2343
2355
|
return t.byRef.get(o);
|
|
2344
2356
|
}
|
|
2345
|
-
function
|
|
2357
|
+
function $i(t, e, i, o) {
|
|
2346
2358
|
const n = at(e, o);
|
|
2347
2359
|
typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
|
|
2348
2360
|
}
|
|
2349
|
-
function
|
|
2361
|
+
function Wi(t, e, i, o, n) {
|
|
2350
2362
|
const r = new Array(t.length);
|
|
2351
2363
|
let s = 0;
|
|
2352
2364
|
for (let l = 0; l < t.length; l++) {
|
|
2353
2365
|
const a = t[l];
|
|
2354
2366
|
let c = n?.(a, l), h = c !== void 0;
|
|
2355
|
-
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;
|
|
2356
2368
|
}
|
|
2357
2369
|
return r;
|
|
2358
2370
|
}
|
|
@@ -2365,7 +2377,7 @@ function me(t, e, i) {
|
|
|
2365
2377
|
t[r].offset += n;
|
|
2366
2378
|
}
|
|
2367
2379
|
}
|
|
2368
|
-
function
|
|
2380
|
+
function Fi(t) {
|
|
2369
2381
|
if (t.length === 0) return 0;
|
|
2370
2382
|
const e = t[t.length - 1];
|
|
2371
2383
|
return e.offset + e.height;
|
|
@@ -2385,19 +2397,19 @@ function Ve(t, e) {
|
|
|
2385
2397
|
}
|
|
2386
2398
|
return Math.max(0, Math.min(i, t.length - 1));
|
|
2387
2399
|
}
|
|
2388
|
-
function
|
|
2400
|
+
function Ui(t, e) {
|
|
2389
2401
|
let i = 0, o = 0;
|
|
2390
2402
|
for (const n of t)
|
|
2391
2403
|
n.measured && (i += n.height, o++);
|
|
2392
2404
|
return o > 0 ? i / o : e;
|
|
2393
2405
|
}
|
|
2394
|
-
function
|
|
2406
|
+
function Vi(t) {
|
|
2395
2407
|
let e = 0;
|
|
2396
2408
|
for (const i of t)
|
|
2397
2409
|
i.measured && e++;
|
|
2398
2410
|
return e;
|
|
2399
2411
|
}
|
|
2400
|
-
function
|
|
2412
|
+
function Bi(t, e) {
|
|
2401
2413
|
const { positionCache: i, heightCache: o, rows: n, start: r, end: s, getPluginHeight: l, getRowId: a } = t;
|
|
2402
2414
|
let c = !1;
|
|
2403
2415
|
e.forEach((p) => {
|
|
@@ -2414,13 +2426,13 @@ function Vi(t, e) {
|
|
|
2414
2426
|
const v = p.offsetHeight;
|
|
2415
2427
|
if (v > 0) {
|
|
2416
2428
|
const b = i[u];
|
|
2417
|
-
(!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);
|
|
2418
2430
|
}
|
|
2419
2431
|
});
|
|
2420
|
-
const h = c ?
|
|
2432
|
+
const h = c ? Vi(i) : 0, f = c ? Ui(i, t.defaultHeight) : 0;
|
|
2421
2433
|
return { hasChanges: c, measuredCount: h, averageHeight: f };
|
|
2422
2434
|
}
|
|
2423
|
-
function
|
|
2435
|
+
function Gi(t, e, i, o) {
|
|
2424
2436
|
let n = 0, r = 0;
|
|
2425
2437
|
for (let s = 0; s < t.length; s++) {
|
|
2426
2438
|
const l = t[s];
|
|
@@ -2431,7 +2443,7 @@ function Bi(t, e, i, o) {
|
|
|
2431
2443
|
averageHeight: n > 0 ? r / n : i
|
|
2432
2444
|
};
|
|
2433
2445
|
}
|
|
2434
|
-
function
|
|
2446
|
+
function ro(t) {
|
|
2435
2447
|
const { totalRows: e, viewportHeight: i, scrollTop: o, rowHeight: n, overscan: r } = t, s = Math.ceil(i / n);
|
|
2436
2448
|
let l = Math.floor(o / n) - r;
|
|
2437
2449
|
l < 0 && (l = 0);
|
|
@@ -2443,7 +2455,7 @@ function no(t) {
|
|
|
2443
2455
|
totalHeight: e * n
|
|
2444
2456
|
};
|
|
2445
2457
|
}
|
|
2446
|
-
function
|
|
2458
|
+
function so(t, e) {
|
|
2447
2459
|
return t <= e;
|
|
2448
2460
|
}
|
|
2449
2461
|
class ne {
|
|
@@ -2466,7 +2478,7 @@ class ne {
|
|
|
2466
2478
|
this.attach(i);
|
|
2467
2479
|
}
|
|
2468
2480
|
attach(e) {
|
|
2469
|
-
if (
|
|
2481
|
+
if (Ii(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
|
|
2470
2482
|
for (const [i, o] of Object.entries(e.cellRenderers))
|
|
2471
2483
|
this.cellRenderers.set(i, o);
|
|
2472
2484
|
if (e.headerRenderers)
|
|
@@ -2731,7 +2743,7 @@ class ne {
|
|
|
2731
2743
|
return e.sort((i, o) => (i.content.order ?? 0) - (o.content.order ?? 0));
|
|
2732
2744
|
}
|
|
2733
2745
|
}
|
|
2734
|
-
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 = `/**
|
|
2735
2747
|
* tbw-grid Light DOM Styles
|
|
2736
2748
|
*
|
|
2737
2749
|
* This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
|
|
@@ -2750,19 +2762,19 @@ const Gi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--t
|
|
|
2750
2762
|
/* Declare layer order - earlier layers have lower priority */
|
|
2751
2763
|
@layer tbw-base, tbw-plugins, tbw-theme;
|
|
2752
2764
|
|
|
2753
|
-
${
|
|
2754
|
-
${Xi}
|
|
2765
|
+
${to}
|
|
2755
2766
|
${Yi}
|
|
2756
|
-
${
|
|
2767
|
+
${ji}
|
|
2757
2768
|
${Zi}
|
|
2758
2769
|
${Ji}
|
|
2759
|
-
${
|
|
2760
|
-
${Gi}
|
|
2770
|
+
${eo}
|
|
2761
2771
|
${Ki}
|
|
2772
|
+
${Xi}
|
|
2773
|
+
${Qi}
|
|
2762
2774
|
`;
|
|
2763
2775
|
class k extends HTMLElement {
|
|
2764
2776
|
static tagName = "tbw-grid";
|
|
2765
|
-
static version = "1.
|
|
2777
|
+
static version = "1.17.0";
|
|
2766
2778
|
static #l = 0;
|
|
2767
2779
|
static adapters = [];
|
|
2768
2780
|
static registerAdapter(e) {
|
|
@@ -2785,7 +2797,7 @@ class k extends HTMLElement {
|
|
|
2785
2797
|
#h;
|
|
2786
2798
|
#a = [];
|
|
2787
2799
|
get #o() {
|
|
2788
|
-
return this.#
|
|
2800
|
+
return this.#i?.effective ?? {};
|
|
2789
2801
|
}
|
|
2790
2802
|
#f = !1;
|
|
2791
2803
|
#w = !1;
|
|
@@ -2802,12 +2814,12 @@ class k extends HTMLElement {
|
|
|
2802
2814
|
#x = !1;
|
|
2803
2815
|
#m = 0;
|
|
2804
2816
|
#z;
|
|
2805
|
-
#
|
|
2817
|
+
#I = Ri();
|
|
2806
2818
|
#b;
|
|
2807
2819
|
#y;
|
|
2808
2820
|
#p;
|
|
2809
2821
|
#S;
|
|
2810
|
-
#
|
|
2822
|
+
#ee = {
|
|
2811
2823
|
scrollTop: 0,
|
|
2812
2824
|
scrollLeft: 0,
|
|
2813
2825
|
scrollHeight: 0,
|
|
@@ -2815,23 +2827,24 @@ class k extends HTMLElement {
|
|
|
2815
2827
|
clientHeight: 0,
|
|
2816
2828
|
clientWidth: 0
|
|
2817
2829
|
};
|
|
2818
|
-
#
|
|
2830
|
+
#t;
|
|
2819
2831
|
#_;
|
|
2820
|
-
#
|
|
2832
|
+
#N = !1;
|
|
2821
2833
|
#D;
|
|
2822
|
-
#
|
|
2834
|
+
#B;
|
|
2823
2835
|
#O;
|
|
2824
|
-
#
|
|
2825
|
-
#
|
|
2836
|
+
#i;
|
|
2837
|
+
#e = hi();
|
|
2826
2838
|
#c;
|
|
2827
2839
|
#q;
|
|
2840
|
+
#$;
|
|
2828
2841
|
#M = !1;
|
|
2829
2842
|
#E = /* @__PURE__ */ new Set();
|
|
2830
2843
|
#H = /* @__PURE__ */ new Map();
|
|
2831
|
-
|
|
2844
|
+
#W;
|
|
2832
2845
|
#R = /* @__PURE__ */ new Map();
|
|
2833
2846
|
_rows = [];
|
|
2834
|
-
#
|
|
2847
|
+
#G = [];
|
|
2835
2848
|
get _columns() {
|
|
2836
2849
|
return this.#o.columns ?? [];
|
|
2837
2850
|
}
|
|
@@ -2875,16 +2888,16 @@ class k extends HTMLElement {
|
|
|
2875
2888
|
__rowRenderEpoch = 0;
|
|
2876
2889
|
__didInitialAutoSize = !1;
|
|
2877
2890
|
get __lightDomColumnsCache() {
|
|
2878
|
-
return this.#
|
|
2891
|
+
return this.#i?.lightDomColumnsCache;
|
|
2879
2892
|
}
|
|
2880
2893
|
set __lightDomColumnsCache(e) {
|
|
2881
|
-
this.#
|
|
2894
|
+
this.#i && (this.#i.lightDomColumnsCache = e);
|
|
2882
2895
|
}
|
|
2883
2896
|
get __originalColumnNodes() {
|
|
2884
|
-
return this.#
|
|
2897
|
+
return this.#i?.originalColumnNodes;
|
|
2885
2898
|
}
|
|
2886
2899
|
set __originalColumnNodes(e) {
|
|
2887
|
-
this.#
|
|
2900
|
+
this.#i && (this.#i.originalColumnNodes = e);
|
|
2888
2901
|
}
|
|
2889
2902
|
__originalOrder = [];
|
|
2890
2903
|
__frameworkAdapter;
|
|
@@ -2894,7 +2907,7 @@ class k extends HTMLElement {
|
|
|
2894
2907
|
}
|
|
2895
2908
|
set rows(e) {
|
|
2896
2909
|
const i = this.#a;
|
|
2897
|
-
this.#a = e, i !== e && this.#
|
|
2910
|
+
this.#a = e, i !== e && this.#V("rows");
|
|
2898
2911
|
}
|
|
2899
2912
|
get sourceRows() {
|
|
2900
2913
|
return this.#a;
|
|
@@ -2903,38 +2916,38 @@ class k extends HTMLElement {
|
|
|
2903
2916
|
return [...this._columns];
|
|
2904
2917
|
}
|
|
2905
2918
|
set columns(e) {
|
|
2906
|
-
const i = this.#
|
|
2907
|
-
this.#
|
|
2919
|
+
const i = this.#i?.getColumns();
|
|
2920
|
+
this.#i?.setColumns(e), i !== e && this.#V("columns");
|
|
2908
2921
|
}
|
|
2909
2922
|
get gridConfig() {
|
|
2910
2923
|
return this.#o;
|
|
2911
2924
|
}
|
|
2912
2925
|
set gridConfig(e) {
|
|
2913
|
-
const i = this.#
|
|
2914
|
-
this.#
|
|
2926
|
+
const i = this.#i?.getGridConfig();
|
|
2927
|
+
this.#i?.setGridConfig(e), i !== e && (this.#i.clearLightDomCache(), this.#V("gridConfig"));
|
|
2915
2928
|
}
|
|
2916
2929
|
get fitMode() {
|
|
2917
2930
|
return this.#o.fitMode ?? "stretch";
|
|
2918
2931
|
}
|
|
2919
2932
|
set fitMode(e) {
|
|
2920
|
-
const i = this.#
|
|
2921
|
-
this.#
|
|
2933
|
+
const i = this.#i?.getFitMode();
|
|
2934
|
+
this.#i?.setFitMode(e), i !== e && this.#V("fitMode");
|
|
2922
2935
|
}
|
|
2923
2936
|
get loading() {
|
|
2924
2937
|
return this.#M;
|
|
2925
2938
|
}
|
|
2926
2939
|
set loading(e) {
|
|
2927
2940
|
const i = this.#M;
|
|
2928
|
-
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();
|
|
2929
2942
|
}
|
|
2930
2943
|
setRowLoading(e, i) {
|
|
2931
2944
|
const o = this.#E.has(e);
|
|
2932
|
-
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);
|
|
2933
2946
|
}
|
|
2934
2947
|
setCellLoading(e, i, o) {
|
|
2935
2948
|
let n = this.#H.get(e);
|
|
2936
2949
|
const r = n?.has(i) ?? !1;
|
|
2937
|
-
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);
|
|
2938
2951
|
}
|
|
2939
2952
|
isRowLoading(e) {
|
|
2940
2953
|
return this.#E.has(e);
|
|
@@ -2945,11 +2958,11 @@ class k extends HTMLElement {
|
|
|
2945
2958
|
clearAllLoading() {
|
|
2946
2959
|
this.loading = !1;
|
|
2947
2960
|
for (const e of this.#E)
|
|
2948
|
-
this.#
|
|
2961
|
+
this.#K(e, !1);
|
|
2949
2962
|
this.#E.clear();
|
|
2950
2963
|
for (const [e, i] of this.#H)
|
|
2951
2964
|
for (const o of i)
|
|
2952
|
-
this.#
|
|
2965
|
+
this.#fe(e, o, !1);
|
|
2953
2966
|
this.#H.clear();
|
|
2954
2967
|
}
|
|
2955
2968
|
get effectiveConfig() {
|
|
@@ -2959,28 +2972,28 @@ class k extends HTMLElement {
|
|
|
2959
2972
|
return this.#b || (this.#b = new AbortController()), this.#b.signal;
|
|
2960
2973
|
}
|
|
2961
2974
|
constructor() {
|
|
2962
|
-
super(), this.#
|
|
2975
|
+
super(), this.#me(), this.#d = new Promise((e) => this.#h = e), this.#s = new ti({
|
|
2963
2976
|
mergeConfig: () => {
|
|
2964
|
-
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];
|
|
2965
2978
|
},
|
|
2966
|
-
processColumns: () => this.#
|
|
2967
|
-
processRows: () => this.#
|
|
2979
|
+
processColumns: () => this.#He(),
|
|
2980
|
+
processRows: () => this.#Pe(),
|
|
2968
2981
|
renderHeader: () => oe(this),
|
|
2969
2982
|
updateTemplate: () => V(this),
|
|
2970
2983
|
renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
|
|
2971
2984
|
afterRender: () => {
|
|
2972
|
-
this.#
|
|
2985
|
+
this.#t?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
|
|
2973
2986
|
if (!this._virtualization.totalHeightEl) return;
|
|
2974
2987
|
const i = this.#T(this._rows.length);
|
|
2975
2988
|
this._virtualization.totalHeightEl.style.height = `${i}px`;
|
|
2976
|
-
}), 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(() => {
|
|
2977
2990
|
requestAnimationFrame(() => {
|
|
2978
|
-
this.#
|
|
2991
|
+
this.#Ce();
|
|
2979
2992
|
});
|
|
2980
|
-
})), this.#M && this.#
|
|
2993
|
+
})), this.#M && this.#ue();
|
|
2981
2994
|
},
|
|
2982
2995
|
isConnected: () => this.isConnected && this.#f
|
|
2983
|
-
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c =
|
|
2996
|
+
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = mi(this.#e, {
|
|
2984
2997
|
getShadow: () => this.#n,
|
|
2985
2998
|
getShellConfig: () => this.#o?.shell,
|
|
2986
2999
|
getAccordionIcons: () => ({
|
|
@@ -2989,7 +3002,7 @@ class k extends HTMLElement {
|
|
|
2989
3002
|
}),
|
|
2990
3003
|
emit: (e, i) => this.#L(e, i),
|
|
2991
3004
|
refreshShellHeader: () => this.refreshShellHeader()
|
|
2992
|
-
}), this.#
|
|
3005
|
+
}), this.#i = new Lt({
|
|
2993
3006
|
getRows: () => this.#a,
|
|
2994
3007
|
getSortState: () => this._sortState,
|
|
2995
3008
|
setSortState: (e) => {
|
|
@@ -3010,23 +3023,23 @@ class k extends HTMLElement {
|
|
|
3010
3023
|
setRowHeight: (e) => {
|
|
3011
3024
|
this._virtualization.rowHeight = e;
|
|
3012
3025
|
},
|
|
3013
|
-
applyAnimationConfig: (e) => this.#
|
|
3014
|
-
getShellLightDomTitle: () => this.#
|
|
3015
|
-
getShellToolPanels: () => this.#
|
|
3016
|
-
getShellHeaderContents: () => this.#
|
|
3017
|
-
getShellToolbarContents: () => this.#
|
|
3018
|
-
getShellLightDomHeaderContent: () => this.#
|
|
3019
|
-
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
|
|
3020
3033
|
});
|
|
3021
3034
|
}
|
|
3022
|
-
async #
|
|
3023
|
-
await
|
|
3035
|
+
async #me() {
|
|
3036
|
+
await Si(io);
|
|
3024
3037
|
}
|
|
3025
3038
|
getPlugin(e) {
|
|
3026
|
-
return this.#
|
|
3039
|
+
return this.#t?.getPlugin(e);
|
|
3027
3040
|
}
|
|
3028
3041
|
getPluginByName(e) {
|
|
3029
|
-
return this.#
|
|
3042
|
+
return this.#t?.getPluginByName(e);
|
|
3030
3043
|
}
|
|
3031
3044
|
requestRender() {
|
|
3032
3045
|
this.#s.requestPhase(A.ROWS, "plugin:requestRender");
|
|
@@ -3043,16 +3056,16 @@ class k extends HTMLElement {
|
|
|
3043
3056
|
requestAfterRender() {
|
|
3044
3057
|
this.#s.requestPhase(A.STYLE, "plugin:requestAfterRender");
|
|
3045
3058
|
}
|
|
3046
|
-
#
|
|
3047
|
-
this.#
|
|
3059
|
+
#te() {
|
|
3060
|
+
this.#t = new ne(this);
|
|
3048
3061
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
3049
|
-
this.#
|
|
3062
|
+
this.#t.attachAll(i);
|
|
3050
3063
|
}
|
|
3051
|
-
#
|
|
3052
|
-
const e = this.#
|
|
3053
|
-
|
|
3064
|
+
#F() {
|
|
3065
|
+
const e = this.#t?.getPluginStyles() ?? [];
|
|
3066
|
+
_i(e);
|
|
3054
3067
|
}
|
|
3055
|
-
#
|
|
3068
|
+
#ie() {
|
|
3056
3069
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
3057
3070
|
if (this.#_ === i)
|
|
3058
3071
|
return;
|
|
@@ -3060,38 +3073,38 @@ class k extends HTMLElement {
|
|
|
3060
3073
|
this.#_ = i;
|
|
3061
3074
|
return;
|
|
3062
3075
|
}
|
|
3063
|
-
this.#
|
|
3064
|
-
for (const n of this.#
|
|
3065
|
-
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);
|
|
3066
3079
|
if (!r && !s) {
|
|
3067
|
-
const l = this.#
|
|
3068
|
-
l && (l(), this.#
|
|
3080
|
+
const l = this.#e.panelCleanups.get(n);
|
|
3081
|
+
l && (l(), this.#e.panelCleanups.delete(n)), this.#e.toolPanels.delete(n);
|
|
3069
3082
|
}
|
|
3070
3083
|
}
|
|
3071
|
-
for (const n of this.#
|
|
3072
|
-
const r = this.#
|
|
3073
|
-
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);
|
|
3074
3087
|
}
|
|
3075
|
-
this.#
|
|
3088
|
+
this.#te(), this.#F(), this.#_ = i, this.#se(), this.#oe();
|
|
3076
3089
|
const o = this.#g;
|
|
3077
|
-
if (this.#g = this.#
|
|
3090
|
+
if (this.#g = this.#t?.getAll().some((n) => n.onScroll) ?? !1, !o && this.#g) {
|
|
3078
3091
|
const r = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3079
|
-
this.#
|
|
3092
|
+
this.#X(r);
|
|
3080
3093
|
}
|
|
3081
3094
|
}
|
|
3082
|
-
#
|
|
3083
|
-
this.#
|
|
3095
|
+
#ve() {
|
|
3096
|
+
this.#t?.detachAll();
|
|
3084
3097
|
}
|
|
3085
|
-
#
|
|
3086
|
-
if (!this.#
|
|
3087
|
-
const e = this.#
|
|
3098
|
+
#oe() {
|
|
3099
|
+
if (!this.#t) return;
|
|
3100
|
+
const e = this.#t.getToolPanels();
|
|
3088
3101
|
for (const { panel: o } of e)
|
|
3089
|
-
this.#
|
|
3090
|
-
const i = this.#
|
|
3102
|
+
this.#e.toolPanels.has(o.id) || this.#e.toolPanels.set(o.id, o);
|
|
3103
|
+
const i = this.#t.getHeaderContents();
|
|
3091
3104
|
for (const { content: o } of i)
|
|
3092
|
-
this.#
|
|
3105
|
+
this.#e.headerContents.has(o.id) || this.#e.headerContents.set(o.id, o);
|
|
3093
3106
|
}
|
|
3094
|
-
#
|
|
3107
|
+
#ne() {
|
|
3095
3108
|
const e = k.getAdapters();
|
|
3096
3109
|
if (e.length === 0 && !this.__frameworkAdapter) return;
|
|
3097
3110
|
const i = this.__frameworkAdapter;
|
|
@@ -3108,17 +3121,17 @@ class k extends HTMLElement {
|
|
|
3108
3121
|
};
|
|
3109
3122
|
}
|
|
3110
3123
|
connectedCallback() {
|
|
3111
|
-
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();
|
|
3112
3125
|
const e = this.#o?.plugins;
|
|
3113
|
-
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(
|
|
3114
3127
|
() => {
|
|
3115
|
-
this.#
|
|
3128
|
+
this.#Ie();
|
|
3116
3129
|
},
|
|
3117
3130
|
{ timeout: 100 }
|
|
3118
3131
|
);
|
|
3119
3132
|
}
|
|
3120
3133
|
disconnectedCallback() {
|
|
3121
|
-
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;
|
|
3122
3135
|
for (const e of this._rowPool)
|
|
3123
3136
|
e.remove();
|
|
3124
3137
|
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
|
|
@@ -3139,25 +3152,25 @@ class k extends HTMLElement {
|
|
|
3139
3152
|
}
|
|
3140
3153
|
else e === "fit-mode" && (this.fitMode = o);
|
|
3141
3154
|
}
|
|
3142
|
-
#
|
|
3155
|
+
#re() {
|
|
3143
3156
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3144
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) {
|
|
3145
|
-
ge(this.#n, this.#
|
|
3158
|
+
ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
|
|
3146
3159
|
const n = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3147
|
-
n && this.#
|
|
3160
|
+
n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
|
|
3148
3161
|
}
|
|
3149
|
-
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)
|
|
3150
3163
|
return;
|
|
3151
|
-
this.#
|
|
3164
|
+
this.#N = !0;
|
|
3152
3165
|
const o = this.disconnectSignal;
|
|
3153
|
-
Ft(this, this, this.#n, o), this.#
|
|
3154
|
-
}
|
|
3155
|
-
#re() {
|
|
3156
|
-
const e = this.#o.rowHeight, i = this.#e.hasRowHeightPlugin();
|
|
3157
|
-
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");
|
|
3158
3167
|
}
|
|
3159
3168
|
#se() {
|
|
3160
|
-
|
|
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())
|
|
3161
3174
|
return;
|
|
3162
3175
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3163
3176
|
if (!e) return;
|
|
@@ -3170,7 +3183,7 @@ class k extends HTMLElement {
|
|
|
3170
3183
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3171
3184
|
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(A.VIRTUALIZATION, "measureRowHeight"));
|
|
3172
3185
|
}
|
|
3173
|
-
#
|
|
3186
|
+
#Ce() {
|
|
3174
3187
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3175
3188
|
if (!e) return;
|
|
3176
3189
|
const i = e.querySelectorAll(".cell");
|
|
@@ -3180,15 +3193,15 @@ class k extends HTMLElement {
|
|
|
3180
3193
|
l > o && (o = l);
|
|
3181
3194
|
});
|
|
3182
3195
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3183
|
-
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)) {
|
|
3184
3197
|
const l = this.#T(this._rows.length);
|
|
3185
3198
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3186
3199
|
}
|
|
3187
3200
|
}
|
|
3188
|
-
#
|
|
3201
|
+
#X(e) {
|
|
3189
3202
|
this.#D?.abort(), this.#D = new AbortController();
|
|
3190
3203
|
const i = this.#D.signal, o = e?.querySelector(".faux-vscroll"), n = e?.querySelector(".rows");
|
|
3191
|
-
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) {
|
|
3192
3205
|
o.addEventListener(
|
|
3193
3206
|
"scroll",
|
|
3194
3207
|
() => {
|
|
@@ -3209,21 +3222,21 @@ class k extends HTMLElement {
|
|
|
3209
3222
|
n.style.transform = `translateY(${g}px)`;
|
|
3210
3223
|
}
|
|
3211
3224
|
this.#r = a, this.#C || (this.#C = requestAnimationFrame(() => {
|
|
3212
|
-
this.#C = 0, this.#r !== null && (this.#
|
|
3225
|
+
this.#C = 0, this.#r !== null && (this.#Oe(this.#r), this.#r = null);
|
|
3213
3226
|
}));
|
|
3214
3227
|
},
|
|
3215
3228
|
{ passive: !0, signal: i }
|
|
3216
3229
|
);
|
|
3217
3230
|
const r = this.#n.querySelector(".tbw-scroll-area");
|
|
3218
|
-
this.#
|
|
3231
|
+
this.#B = r, this._virtualization.scrollAreaEl = r, r && this.#g && r.addEventListener(
|
|
3219
3232
|
"scroll",
|
|
3220
3233
|
() => {
|
|
3221
|
-
const a = this.#
|
|
3222
|
-
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);
|
|
3223
3236
|
},
|
|
3224
3237
|
{ passive: !0, signal: i }
|
|
3225
3238
|
);
|
|
3226
|
-
const s = this.#n.querySelector(".tbw-grid-content"), l = this.#
|
|
3239
|
+
const s = this.#n.querySelector(".tbw-grid-content"), l = this.#B;
|
|
3227
3240
|
s && (s.addEventListener(
|
|
3228
3241
|
"wheel",
|
|
3229
3242
|
(a) => {
|
|
@@ -3237,9 +3250,9 @@ class k extends HTMLElement {
|
|
|
3237
3250
|
}
|
|
3238
3251
|
},
|
|
3239
3252
|
{ passive: !1, signal: i }
|
|
3240
|
-
),
|
|
3253
|
+
), Pi(
|
|
3241
3254
|
s,
|
|
3242
|
-
this.#
|
|
3255
|
+
this.#I,
|
|
3243
3256
|
{ fauxScrollbar: o, scrollArea: l },
|
|
3244
3257
|
i
|
|
3245
3258
|
));
|
|
@@ -3261,12 +3274,12 @@ class k extends HTMLElement {
|
|
|
3261
3274
|
{ signal: i }
|
|
3262
3275
|
);
|
|
3263
3276
|
}
|
|
3264
|
-
#
|
|
3265
|
-
#
|
|
3266
|
-
if (this.#
|
|
3277
|
+
#U = !1;
|
|
3278
|
+
#ye() {
|
|
3279
|
+
if (this.#U) return;
|
|
3267
3280
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
3268
|
-
e && (this.#
|
|
3269
|
-
this.#
|
|
3281
|
+
e && (this.#U = !0, this.#p?.disconnect(), this.#p = new ResizeObserver(() => {
|
|
3282
|
+
this.#le();
|
|
3270
3283
|
}), this.#p.observe(e));
|
|
3271
3284
|
}
|
|
3272
3285
|
addEventListener(e, i, o) {
|
|
@@ -3278,7 +3291,7 @@ class k extends HTMLElement {
|
|
|
3278
3291
|
#L(e, i) {
|
|
3279
3292
|
this.dispatchEvent(new CustomEvent(e, { detail: i, bubbles: !0, composed: !0 }));
|
|
3280
3293
|
}
|
|
3281
|
-
#
|
|
3294
|
+
#_e() {
|
|
3282
3295
|
this._bodyEl?.querySelectorAll(".data-grid-row")?.forEach((i, o) => {
|
|
3283
3296
|
const n = o === this._focusRow;
|
|
3284
3297
|
i.setAttribute("aria-selected", String(n)), i.querySelectorAll(".cell").forEach((r, s) => {
|
|
@@ -3286,10 +3299,10 @@ class k extends HTMLElement {
|
|
|
3286
3299
|
});
|
|
3287
3300
|
});
|
|
3288
3301
|
}
|
|
3289
|
-
#
|
|
3290
|
-
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()));
|
|
3291
3304
|
}
|
|
3292
|
-
#
|
|
3305
|
+
#Ee() {
|
|
3293
3306
|
if (!this.#w || !this.#f) {
|
|
3294
3307
|
this.#w = !1;
|
|
3295
3308
|
return;
|
|
@@ -3301,69 +3314,69 @@ class k extends HTMLElement {
|
|
|
3301
3314
|
gridConfig: !1,
|
|
3302
3315
|
fitMode: !1
|
|
3303
3316
|
}, e.gridConfig) {
|
|
3304
|
-
this.#
|
|
3317
|
+
this.#Te(), e.rows && this.#ae();
|
|
3305
3318
|
return;
|
|
3306
3319
|
}
|
|
3307
|
-
e.columns && this.#
|
|
3320
|
+
e.columns && this.#Re(), e.rows && this.#ae(), e.fitMode && this.#Ae();
|
|
3308
3321
|
}
|
|
3309
|
-
#
|
|
3310
|
-
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");
|
|
3311
3324
|
}
|
|
3312
|
-
#
|
|
3325
|
+
#Y() {
|
|
3313
3326
|
this.#R.clear();
|
|
3314
3327
|
const e = this.#o.getRowId;
|
|
3315
3328
|
this._rows.forEach((i, o) => {
|
|
3316
|
-
const n = this.#
|
|
3329
|
+
const n = this.#ce(i, e);
|
|
3317
3330
|
n !== void 0 && this.#R.set(n, { row: i, index: o });
|
|
3318
3331
|
});
|
|
3319
3332
|
}
|
|
3320
|
-
#
|
|
3333
|
+
#ce(e, i) {
|
|
3321
3334
|
if (i)
|
|
3322
3335
|
return i(e);
|
|
3323
3336
|
const o = e;
|
|
3324
3337
|
if ("id" in o && o.id != null) return String(o.id);
|
|
3325
3338
|
if ("_id" in o && o._id != null) return String(o._id);
|
|
3326
3339
|
}
|
|
3327
|
-
#
|
|
3328
|
-
const o = this.#
|
|
3340
|
+
#Se(e, i) {
|
|
3341
|
+
const o = this.#ce(e, i);
|
|
3329
3342
|
if (o === void 0)
|
|
3330
3343
|
throw new Error(
|
|
3331
3344
|
'[tbw-grid] Cannot determine row ID. Configure getRowId in gridConfig or ensure rows have an "id" property.'
|
|
3332
3345
|
);
|
|
3333
3346
|
return o;
|
|
3334
3347
|
}
|
|
3335
|
-
#Se() {
|
|
3336
|
-
Y(this), this.#t.merge(), this.#P();
|
|
3337
|
-
}
|
|
3338
3348
|
#Re() {
|
|
3339
|
-
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) => {
|
|
3340
3353
|
!i.__userResized && i.__autoSized && delete i.width;
|
|
3341
3354
|
}), V(this));
|
|
3342
3355
|
}
|
|
3343
|
-
#
|
|
3344
|
-
|
|
3356
|
+
#Te() {
|
|
3357
|
+
Ie(this, this.#e), Ne(this, this.#e);
|
|
3345
3358
|
const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
|
|
3346
|
-
this.#
|
|
3359
|
+
this.#i.parseLightDomColumns(this), this.#i.merge(), this.#ie(), qe(this, this.#e, this.#ne()), this.#i.markSourcesChanged(), this.#i.merge();
|
|
3347
3360
|
const n = st(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
|
|
3348
3361
|
if (e !== n || !i && r || i && s !== o) {
|
|
3349
|
-
he(this.#
|
|
3362
|
+
he(this.#e), this.#J(), this.#F(), this.#re(), this.#Y();
|
|
3350
3363
|
return;
|
|
3351
3364
|
}
|
|
3352
|
-
e && this.#
|
|
3365
|
+
e && this.#xe(), this.#Y(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
|
|
3353
3366
|
}
|
|
3354
|
-
#
|
|
3367
|
+
#xe() {
|
|
3355
3368
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3356
3369
|
if (!e) return;
|
|
3357
|
-
const i = this.#o.shell?.header?.title ?? this.#
|
|
3370
|
+
const i = this.#o.shell?.header?.title ?? this.#e.lightDomTitle;
|
|
3358
3371
|
let o = e.querySelector(".tbw-shell-title");
|
|
3359
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();
|
|
3360
3373
|
}
|
|
3361
|
-
#
|
|
3362
|
-
if (this.#
|
|
3363
|
-
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]);
|
|
3364
3377
|
if (n !== i) {
|
|
3365
3378
|
const r = new Set(n.map((l) => l.field));
|
|
3366
|
-
!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(
|
|
3367
3380
|
e,
|
|
3368
3381
|
n,
|
|
3369
3382
|
o
|
|
@@ -3372,7 +3385,7 @@ class k extends HTMLElement {
|
|
|
3372
3385
|
this._columns = [...e];
|
|
3373
3386
|
}
|
|
3374
3387
|
}
|
|
3375
|
-
#
|
|
3388
|
+
#Le(e, i, o) {
|
|
3376
3389
|
if (o.length === 0) return i;
|
|
3377
3390
|
const n = /* @__PURE__ */ new Map();
|
|
3378
3391
|
for (const a of i)
|
|
@@ -3387,12 +3400,12 @@ class k extends HTMLElement {
|
|
|
3387
3400
|
}
|
|
3388
3401
|
return l.push(...s), l;
|
|
3389
3402
|
}
|
|
3390
|
-
#
|
|
3403
|
+
#Pe() {
|
|
3391
3404
|
Y(this);
|
|
3392
|
-
const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#
|
|
3393
|
-
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();
|
|
3394
3407
|
}
|
|
3395
|
-
#
|
|
3408
|
+
#ze(e) {
|
|
3396
3409
|
const i = {
|
|
3397
3410
|
...ft,
|
|
3398
3411
|
...e.animation
|
|
@@ -3400,29 +3413,29 @@ class k extends HTMLElement {
|
|
|
3400
3413
|
let n = 1;
|
|
3401
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;
|
|
3402
3415
|
}
|
|
3403
|
-
#
|
|
3404
|
-
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)
|
|
3405
3418
|
for (const n of this.#E)
|
|
3406
|
-
this.#
|
|
3419
|
+
this.#K(n, !0);
|
|
3407
3420
|
}
|
|
3408
|
-
#
|
|
3409
|
-
#
|
|
3410
|
-
dt(this.#
|
|
3421
|
+
#de = ct();
|
|
3422
|
+
#he(e, i) {
|
|
3423
|
+
dt(this.#de, this.__rowsBodyEl, this._bodyEl, e, i);
|
|
3411
3424
|
}
|
|
3412
|
-
#
|
|
3413
|
-
ut(this.#
|
|
3425
|
+
#De() {
|
|
3426
|
+
ut(this.#de, this.__rowsBodyEl, this.#o, this.#e);
|
|
3414
3427
|
}
|
|
3415
|
-
#
|
|
3428
|
+
#ue() {
|
|
3416
3429
|
const e = this.querySelector(".tbw-grid-root");
|
|
3417
|
-
e && (this.#M ? (this
|
|
3430
|
+
e && (this.#M ? (this.#W || (this.#W = Kt(this.#o?.loadingRenderer)), Qt(e, this.#W)) : Zt(this.#W));
|
|
3418
3431
|
}
|
|
3419
|
-
#
|
|
3432
|
+
#K(e, i) {
|
|
3420
3433
|
const o = this.#R.get(e);
|
|
3421
3434
|
if (!o) return;
|
|
3422
3435
|
const n = this.findRenderedRowElement?.(o.index);
|
|
3423
3436
|
n && Jt(n, i);
|
|
3424
3437
|
}
|
|
3425
|
-
#
|
|
3438
|
+
#fe(e, i, o) {
|
|
3426
3439
|
const n = this.#R.get(e);
|
|
3427
3440
|
if (!n) return;
|
|
3428
3441
|
const r = this.findRenderedRowElement?.(n.index);
|
|
@@ -3434,26 +3447,26 @@ class k extends HTMLElement {
|
|
|
3434
3447
|
}
|
|
3435
3448
|
#P() {
|
|
3436
3449
|
if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
|
|
3437
|
-
if (this.#
|
|
3450
|
+
if (this.#i.parseLightDomColumns(this), this.#O) {
|
|
3438
3451
|
const e = this.#O;
|
|
3439
|
-
this.#O = void 0, this.#
|
|
3440
|
-
const i = this.#
|
|
3441
|
-
this.#
|
|
3452
|
+
this.#O = void 0, this.#i.merge();
|
|
3453
|
+
const i = this.#t?.getAll() ?? [];
|
|
3454
|
+
this.#i.applyState(e, i);
|
|
3442
3455
|
}
|
|
3443
3456
|
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(A.FULL, "setup");
|
|
3444
3457
|
}
|
|
3445
3458
|
}
|
|
3446
|
-
#
|
|
3459
|
+
#Oe(e) {
|
|
3447
3460
|
let i = 0, o = 0, n = 0, r = 0, s = 0;
|
|
3448
3461
|
if (this.#g) {
|
|
3449
|
-
const a = this._virtualization.container, c = this.#
|
|
3462
|
+
const a = this._virtualization.container, c = this.#B;
|
|
3450
3463
|
i = c?.scrollLeft ?? 0, o = a?.scrollHeight ?? 0, n = c?.scrollWidth ?? 0, r = a?.clientHeight ?? 0, s = c?.clientWidth ?? 0;
|
|
3451
3464
|
}
|
|
3452
|
-
if (this.refreshVirtualWindow(!1) && this.#
|
|
3453
|
-
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);
|
|
3454
3467
|
}, 100)), this.#g) {
|
|
3455
|
-
const a = this.#
|
|
3456
|
-
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);
|
|
3457
3470
|
}
|
|
3458
3471
|
}
|
|
3459
3472
|
findHeaderRow() {
|
|
@@ -3475,6 +3488,7 @@ class k extends HTMLElement {
|
|
|
3475
3488
|
detail: {
|
|
3476
3489
|
rowIndex: i,
|
|
3477
3490
|
colIndex: o,
|
|
3491
|
+
column: s,
|
|
3478
3492
|
field: l,
|
|
3479
3493
|
value: a,
|
|
3480
3494
|
row: r,
|
|
@@ -3489,11 +3503,12 @@ class k extends HTMLElement {
|
|
|
3489
3503
|
row: r,
|
|
3490
3504
|
rowIndex: i,
|
|
3491
3505
|
colIndex: o,
|
|
3506
|
+
column: s,
|
|
3492
3507
|
field: l,
|
|
3493
3508
|
value: a,
|
|
3494
3509
|
cellEl: n,
|
|
3495
3510
|
originalEvent: e
|
|
3496
|
-
}, f = this.#
|
|
3511
|
+
}, f = this.#t?.onCellClick(h) ?? !1;
|
|
3497
3512
|
return this.#L("cell-click", h), f;
|
|
3498
3513
|
}
|
|
3499
3514
|
_dispatchRowClick(e, i, o, n) {
|
|
@@ -3503,53 +3518,52 @@ class k extends HTMLElement {
|
|
|
3503
3518
|
row: o,
|
|
3504
3519
|
rowEl: n,
|
|
3505
3520
|
originalEvent: e
|
|
3506
|
-
}, s = this.#
|
|
3521
|
+
}, s = this.#t?.onRowClick(r) ?? !1;
|
|
3507
3522
|
return this.#L("row-click", r), s;
|
|
3508
3523
|
}
|
|
3509
3524
|
_dispatchHeaderClick(e, i, o) {
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
column: n,
|
|
3525
|
+
if (!i) return !1;
|
|
3526
|
+
const n = {
|
|
3527
|
+
colIndex: this._columns.indexOf(i),
|
|
3528
|
+
field: i.field,
|
|
3529
|
+
column: i,
|
|
3516
3530
|
headerEl: o,
|
|
3517
3531
|
originalEvent: e
|
|
3518
3532
|
};
|
|
3519
|
-
return this.#
|
|
3533
|
+
return this.#t?.onHeaderClick(n) ?? !1;
|
|
3520
3534
|
}
|
|
3521
3535
|
_dispatchKeyDown(e) {
|
|
3522
|
-
return this.#
|
|
3536
|
+
return this.#t?.onKeyDown(e) ?? !1;
|
|
3523
3537
|
}
|
|
3524
3538
|
_getHorizontalScrollOffsets(e, i) {
|
|
3525
|
-
return this.#
|
|
3539
|
+
return this.#t?.getHorizontalScrollOffsets(e, i) ?? { left: 0, right: 0 };
|
|
3526
3540
|
}
|
|
3527
3541
|
queryPlugins(e) {
|
|
3528
|
-
return this.#
|
|
3542
|
+
return this.#t?.queryPlugins(e) ?? [];
|
|
3529
3543
|
}
|
|
3530
3544
|
query(e, i) {
|
|
3531
|
-
return this.#
|
|
3545
|
+
return this.#t?.queryPlugins({ type: e, context: i }) ?? [];
|
|
3532
3546
|
}
|
|
3533
3547
|
_dispatchCellMouseDown(e) {
|
|
3534
|
-
return this.#
|
|
3548
|
+
return this.#t?.onCellMouseDown(e) ?? !1;
|
|
3535
3549
|
}
|
|
3536
3550
|
_dispatchCellMouseMove(e) {
|
|
3537
|
-
this.#
|
|
3551
|
+
this.#t?.onCellMouseMove(e);
|
|
3538
3552
|
}
|
|
3539
3553
|
_dispatchCellMouseUp(e) {
|
|
3540
|
-
this.#
|
|
3554
|
+
this.#t?.onCellMouseUp(e);
|
|
3541
3555
|
}
|
|
3542
3556
|
_afterCellRender(e) {
|
|
3543
|
-
this.#
|
|
3557
|
+
this.#t?.afterCellRender(e);
|
|
3544
3558
|
}
|
|
3545
3559
|
_hasAfterCellRenderHook() {
|
|
3546
|
-
return this.#
|
|
3560
|
+
return this.#t?.hasAfterCellRenderHook() ?? !1;
|
|
3547
3561
|
}
|
|
3548
3562
|
_afterRowRender(e) {
|
|
3549
|
-
this.#
|
|
3563
|
+
this.#t?.afterRowRender(e);
|
|
3550
3564
|
}
|
|
3551
3565
|
_hasAfterRowRenderHook() {
|
|
3552
|
-
return this.#
|
|
3566
|
+
return this.#t?.hasAfterRowRenderHook() ?? !1;
|
|
3553
3567
|
}
|
|
3554
3568
|
async ready() {
|
|
3555
3569
|
return this.#d;
|
|
@@ -3561,7 +3575,7 @@ class k extends HTMLElement {
|
|
|
3561
3575
|
return Object.freeze({ ...this.#o || {} });
|
|
3562
3576
|
}
|
|
3563
3577
|
getRowId(e) {
|
|
3564
|
-
return this.#
|
|
3578
|
+
return this.#Se(e, this.#o.getRowId);
|
|
3565
3579
|
}
|
|
3566
3580
|
getRow(e) {
|
|
3567
3581
|
return this.#R.get(e)?.row;
|
|
@@ -3625,50 +3639,50 @@ class k extends HTMLElement {
|
|
|
3625
3639
|
return ai(this, e, i);
|
|
3626
3640
|
}
|
|
3627
3641
|
setColumnVisible(e, i) {
|
|
3628
|
-
const o = this.#
|
|
3642
|
+
const o = this.#i.setColumnVisible(e, i);
|
|
3629
3643
|
return o && this.requestStateChange(), o;
|
|
3630
3644
|
}
|
|
3631
3645
|
toggleColumnVisibility(e) {
|
|
3632
|
-
const i = this.#
|
|
3646
|
+
const i = this.#i.toggleColumnVisibility(e);
|
|
3633
3647
|
return i && this.requestStateChange(), i;
|
|
3634
3648
|
}
|
|
3635
3649
|
isColumnVisible(e) {
|
|
3636
|
-
return this.#
|
|
3650
|
+
return this.#i.isColumnVisible(e);
|
|
3637
3651
|
}
|
|
3638
3652
|
showAllColumns() {
|
|
3639
|
-
this.#
|
|
3653
|
+
this.#i.showAllColumns(), this.requestStateChange();
|
|
3640
3654
|
}
|
|
3641
3655
|
getAllColumns() {
|
|
3642
|
-
return this.#
|
|
3656
|
+
return this.#i.getAllColumns();
|
|
3643
3657
|
}
|
|
3644
3658
|
setColumnOrder(e) {
|
|
3645
|
-
this.#
|
|
3659
|
+
this.#i.setColumnOrder(e), this.requestStateChange();
|
|
3646
3660
|
}
|
|
3647
3661
|
getColumnOrder() {
|
|
3648
|
-
return this.#
|
|
3662
|
+
return this.#i.getColumnOrder();
|
|
3649
3663
|
}
|
|
3650
3664
|
getColumnState() {
|
|
3651
|
-
const e = this.#
|
|
3652
|
-
return this.#
|
|
3665
|
+
const e = this.#t?.getAll() ?? [];
|
|
3666
|
+
return this.#i.collectState(e);
|
|
3653
3667
|
}
|
|
3654
3668
|
set columnState(e) {
|
|
3655
|
-
e && (this.#O = e, this.#
|
|
3669
|
+
e && (this.#O = e, this.#i.initialColumnState = e, this.#u && this.#Me(e));
|
|
3656
3670
|
}
|
|
3657
3671
|
get columnState() {
|
|
3658
3672
|
return this.getColumnState();
|
|
3659
3673
|
}
|
|
3660
|
-
#
|
|
3661
|
-
const i = this.#
|
|
3662
|
-
this.#
|
|
3674
|
+
#Me(e) {
|
|
3675
|
+
const i = this.#t?.getAll() ?? [];
|
|
3676
|
+
this.#i.applyState(e, i), this.#P();
|
|
3663
3677
|
}
|
|
3664
3678
|
requestStateChange() {
|
|
3665
|
-
const e = this.#
|
|
3666
|
-
this.#
|
|
3679
|
+
const e = this.#t?.getAll() ?? [];
|
|
3680
|
+
this.#i.requestStateChange(e);
|
|
3667
3681
|
}
|
|
3668
3682
|
resetColumnState() {
|
|
3669
3683
|
this.#O = void 0, this.__originalOrder = [];
|
|
3670
|
-
const e = this.#
|
|
3671
|
-
this.#
|
|
3684
|
+
const e = this.#t?.getAll() ?? [];
|
|
3685
|
+
this.#i.resetState(e), this.#i.merge(), this.#P();
|
|
3672
3686
|
}
|
|
3673
3687
|
get isToolPanelOpen() {
|
|
3674
3688
|
return this.#c.isPanelOpen;
|
|
@@ -3695,10 +3709,10 @@ class k extends HTMLElement {
|
|
|
3695
3709
|
return this.#c.getToolPanels();
|
|
3696
3710
|
}
|
|
3697
3711
|
registerToolPanel(e) {
|
|
3698
|
-
this.#
|
|
3712
|
+
this.#e.apiToolPanelIds.add(e.id), this.#c.registerToolPanel(e);
|
|
3699
3713
|
}
|
|
3700
3714
|
unregisterToolPanel(e) {
|
|
3701
|
-
this.#
|
|
3715
|
+
this.#e.apiToolPanelIds.delete(e), this.#c.unregisterToolPanel(e);
|
|
3702
3716
|
}
|
|
3703
3717
|
getHeaderContents() {
|
|
3704
3718
|
return this.#c.getHeaderContents();
|
|
@@ -3718,71 +3732,71 @@ class k extends HTMLElement {
|
|
|
3718
3732
|
unregisterToolbarContent(e) {
|
|
3719
3733
|
this.#c.unregisterToolbarContent(e);
|
|
3720
3734
|
}
|
|
3721
|
-
#
|
|
3735
|
+
#Q = !1;
|
|
3722
3736
|
refreshShellHeader() {
|
|
3723
|
-
this.#
|
|
3724
|
-
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());
|
|
3725
3739
|
}));
|
|
3726
3740
|
}
|
|
3727
|
-
#
|
|
3741
|
+
#ke() {
|
|
3728
3742
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3729
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) {
|
|
3730
|
-
ge(this.#n, this.#
|
|
3744
|
+
ge(this.#n, this.#e), de(this.#n, this.#o?.shell, this.#e);
|
|
3731
3745
|
const o = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3732
|
-
o && this.#
|
|
3746
|
+
o && this.#e.toolPanels.has(o) && (this.openToolPanel(), this.#e.expandedSections.add(o));
|
|
3733
3747
|
}
|
|
3734
|
-
this._resizeController = Me(this), this.#
|
|
3748
|
+
this._resizeController = Me(this), this.#X(i), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
|
|
3735
3749
|
}
|
|
3736
3750
|
#A = /* @__PURE__ */ new Map();
|
|
3737
3751
|
registerStyles(e, i) {
|
|
3738
3752
|
let o = this.#A.get(e);
|
|
3739
|
-
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();
|
|
3740
3754
|
}
|
|
3741
3755
|
unregisterStyles(e) {
|
|
3742
|
-
this.#A.delete(e) && this.#
|
|
3756
|
+
this.#A.delete(e) && this.#ge();
|
|
3743
3757
|
}
|
|
3744
3758
|
getRegisteredStyles() {
|
|
3745
3759
|
return Array.from(this.#A.keys());
|
|
3746
3760
|
}
|
|
3747
|
-
#
|
|
3761
|
+
#ge() {
|
|
3748
3762
|
const e = Array.from(this.#A.values()), i = document.adoptedStyleSheets.filter(
|
|
3749
3763
|
(o) => !Array.from(this.#A.values()).includes(o)
|
|
3750
3764
|
);
|
|
3751
3765
|
document.adoptedStyleSheets = [...i, ...e];
|
|
3752
3766
|
}
|
|
3753
3767
|
#k() {
|
|
3754
|
-
|
|
3768
|
+
Ie(this, this.#e), Ne(this, this.#e), qe(this, this.#e, this.#ne());
|
|
3755
3769
|
}
|
|
3756
|
-
#
|
|
3770
|
+
#pe() {
|
|
3757
3771
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3758
3772
|
if (!e) return;
|
|
3759
|
-
he(this.#
|
|
3773
|
+
he(this.#e);
|
|
3760
3774
|
const i = ui(
|
|
3761
3775
|
this.#o.shell,
|
|
3762
|
-
this.#
|
|
3776
|
+
this.#e,
|
|
3763
3777
|
this.#o.icons?.toolPanel
|
|
3764
3778
|
), o = document.createElement("div");
|
|
3765
3779
|
o.innerHTML = i;
|
|
3766
3780
|
const n = o.firstElementChild;
|
|
3767
|
-
n && (e.replaceWith(n), this.#
|
|
3781
|
+
n && (e.replaceWith(n), this.#be(), de(this.#n, this.#o?.shell, this.#e));
|
|
3768
3782
|
}
|
|
3769
|
-
#
|
|
3783
|
+
#Ie() {
|
|
3770
3784
|
const e = () => {
|
|
3771
|
-
const o = this.#
|
|
3785
|
+
const o = this.#e.lightDomTitle, n = this.#e.hasToolButtonsContainer;
|
|
3772
3786
|
this.#k();
|
|
3773
|
-
const r = this.#
|
|
3774
|
-
(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());
|
|
3775
3789
|
}, i = () => {
|
|
3776
3790
|
this.__lightDomColumnsCache = void 0, this.#P();
|
|
3777
3791
|
};
|
|
3778
|
-
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);
|
|
3779
3793
|
}
|
|
3780
3794
|
refreshColumns() {
|
|
3781
|
-
this.__lightDomColumnsCache = void 0, Y(this), this.#
|
|
3782
|
-
const e = this.#
|
|
3795
|
+
this.__lightDomColumnsCache = void 0, Y(this), this.#i.parseLightDomColumns(this);
|
|
3796
|
+
const e = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
|
|
3783
3797
|
this.#k();
|
|
3784
|
-
const o = this.#
|
|
3785
|
-
(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");
|
|
3786
3800
|
}
|
|
3787
3801
|
#Ne() {
|
|
3788
3802
|
const e = this._virtualization.container, i = this._virtualization.viewportEl ?? e;
|
|
@@ -3800,18 +3814,18 @@ class k extends HTMLElement {
|
|
|
3800
3814
|
n = o.cachedFauxHeight, r = o.cachedViewportHeight, s = o.cachedScrollAreaHeight || n;
|
|
3801
3815
|
const l = s - r, a = Math.max(0, n - s);
|
|
3802
3816
|
let c, h = 0;
|
|
3803
|
-
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;
|
|
3804
3818
|
}
|
|
3805
|
-
#
|
|
3819
|
+
#Z() {
|
|
3806
3820
|
if (!this._virtualization.variableHeights) return;
|
|
3807
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;
|
|
3808
|
-
this._virtualization.positionCache =
|
|
3822
|
+
this._virtualization.positionCache = Wi(
|
|
3809
3823
|
e,
|
|
3810
3824
|
this._virtualization.heightCache,
|
|
3811
3825
|
i,
|
|
3812
3826
|
{ rowId: r },
|
|
3813
3827
|
(l, a) => {
|
|
3814
|
-
const c = this.#
|
|
3828
|
+
const c = this.#t?.getRowHeight?.(l, a);
|
|
3815
3829
|
if (c !== void 0) return c;
|
|
3816
3830
|
if (o) {
|
|
3817
3831
|
const h = o(l, a);
|
|
@@ -3819,11 +3833,11 @@ class k extends HTMLElement {
|
|
|
3819
3833
|
}
|
|
3820
3834
|
}
|
|
3821
3835
|
);
|
|
3822
|
-
const s =
|
|
3836
|
+
const s = Gi(
|
|
3823
3837
|
this._virtualization.positionCache,
|
|
3824
3838
|
e,
|
|
3825
3839
|
i,
|
|
3826
|
-
(l, a) => this.#
|
|
3840
|
+
(l, a) => this.#t?.getRowHeight?.(l, a)
|
|
3827
3841
|
);
|
|
3828
3842
|
this._virtualization.measuredCount = s.measuredCount, s.measuredCount > 0 && (this._virtualization.averageHeight = s.averageHeight);
|
|
3829
3843
|
}
|
|
@@ -3831,16 +3845,16 @@ class k extends HTMLElement {
|
|
|
3831
3845
|
if (!this._virtualization.variableHeights || !this._virtualization.positionCache || e < 0 || e >= this._rows.length) return;
|
|
3832
3846
|
const o = this._virtualization.positionCache, n = this._rows[e];
|
|
3833
3847
|
let r = i;
|
|
3834
|
-
r === void 0 && (r = this.#
|
|
3848
|
+
r === void 0 && (r = this.#t?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
|
|
3835
3849
|
const s = o[e];
|
|
3836
3850
|
if (!(!s || Math.abs(s.height - r) < 1) && (me(o, e, r), this._virtualization.totalHeightEl)) {
|
|
3837
3851
|
const l = this.#T(this._rows.length);
|
|
3838
3852
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3839
3853
|
}
|
|
3840
3854
|
}
|
|
3841
|
-
#
|
|
3855
|
+
#we(e, i) {
|
|
3842
3856
|
if (!this._virtualization.variableHeights || !this._virtualization.positionCache || !this._bodyEl) return;
|
|
3843
|
-
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(
|
|
3844
3858
|
{
|
|
3845
3859
|
positionCache: this._virtualization.positionCache,
|
|
3846
3860
|
heightCache: this._virtualization.heightCache,
|
|
@@ -3848,7 +3862,7 @@ class k extends HTMLElement {
|
|
|
3848
3862
|
defaultHeight: this._virtualization.rowHeight,
|
|
3849
3863
|
start: e,
|
|
3850
3864
|
end: i,
|
|
3851
|
-
getPluginHeight: (s, l) => this.#
|
|
3865
|
+
getPluginHeight: (s, l) => this.#t?.getRowHeight?.(s, l),
|
|
3852
3866
|
getRowId: n ? (s) => n(s) : void 0
|
|
3853
3867
|
},
|
|
3854
3868
|
o
|
|
@@ -3862,9 +3876,9 @@ class k extends HTMLElement {
|
|
|
3862
3876
|
if (!this._bodyEl) return !1;
|
|
3863
3877
|
const o = this._rows.length;
|
|
3864
3878
|
if (!this._virtualization.enabled)
|
|
3865
|
-
return this.#
|
|
3879
|
+
return this.#j(0, o), i || this.#t?.afterRender(), !0;
|
|
3866
3880
|
if (this._rows.length <= this._virtualization.bypassThreshold)
|
|
3867
|
-
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;
|
|
3868
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;
|
|
3869
3883
|
let c;
|
|
3870
3884
|
const h = this._virtualization.positionCache;
|
|
@@ -3875,13 +3889,13 @@ class k extends HTMLElement {
|
|
|
3875
3889
|
let b = 0;
|
|
3876
3890
|
const _ = 10;
|
|
3877
3891
|
for (; b < _; ) {
|
|
3878
|
-
const R = this.#
|
|
3892
|
+
const R = this.#t?.getExtraHeightBefore?.(c) ?? 0, E = Math.floor((a - R) / l);
|
|
3879
3893
|
if (E >= c || E < 0) break;
|
|
3880
3894
|
c = E, b++;
|
|
3881
3895
|
}
|
|
3882
3896
|
}
|
|
3883
3897
|
c = c - c % 2, c < 0 && (c = 0);
|
|
3884
|
-
const f = this.#
|
|
3898
|
+
const f = this.#t?.adjustVirtualStart(c, a, l);
|
|
3885
3899
|
f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
|
|
3886
3900
|
let p;
|
|
3887
3901
|
if (this._virtualization.variableHeights && h && h.length > 0) {
|
|
@@ -3915,45 +3929,50 @@ class k extends HTMLElement {
|
|
|
3915
3929
|
if (this._virtualization.variableHeights && h && h[c])
|
|
3916
3930
|
w = h[c].offset;
|
|
3917
3931
|
else {
|
|
3918
|
-
const b = this.#
|
|
3932
|
+
const b = this.#t?.getExtraHeightBefore?.(c) ?? 0;
|
|
3919
3933
|
w = c * l + b;
|
|
3920
3934
|
}
|
|
3921
3935
|
const v = -(a - w);
|
|
3922
|
-
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(() => {
|
|
3923
3937
|
if (!this._virtualization.totalHeightEl) return;
|
|
3924
3938
|
const b = this.#T(o);
|
|
3925
3939
|
this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${b}px`);
|
|
3926
3940
|
})), !0;
|
|
3927
3941
|
}
|
|
3928
|
-
#
|
|
3929
|
-
this.#k(), this.#
|
|
3942
|
+
#J() {
|
|
3943
|
+
this.#k(), this.#i.markSourcesChanged(), this.#i.merge();
|
|
3930
3944
|
const e = this.#o?.shell;
|
|
3931
|
-
|
|
3945
|
+
Ci(
|
|
3932
3946
|
this.#n,
|
|
3933
3947
|
e,
|
|
3934
|
-
{ isPanelOpen: this.#
|
|
3948
|
+
{ isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
|
|
3935
3949
|
this.#o?.icons
|
|
3936
|
-
) && (this.#
|
|
3950
|
+
) && (this.#be(), this.#c.setInitialized(!0));
|
|
3937
3951
|
}
|
|
3938
|
-
#
|
|
3939
|
-
fi(this.#n, this.#o?.shell, this.#
|
|
3952
|
+
#be() {
|
|
3953
|
+
fi(this.#n, this.#o?.shell, this.#e, {
|
|
3940
3954
|
onPanelToggle: () => this.toggleToolPanel(),
|
|
3941
3955
|
onSectionToggle: (e) => this.toggleToolPanelSection(e)
|
|
3942
|
-
}), this.#q?.(), this.#q =
|
|
3956
|
+
}), this.#q?.(), this.#q = pi(this.#n, this.#o?.shell, (e) => {
|
|
3943
3957
|
this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
|
|
3944
|
-
})
|
|
3958
|
+
}), this.#$?.(), this.#$ = gi(
|
|
3959
|
+
this,
|
|
3960
|
+
this.#o?.shell,
|
|
3961
|
+
this.#e,
|
|
3962
|
+
() => this.closeToolPanel()
|
|
3963
|
+
);
|
|
3945
3964
|
}
|
|
3946
3965
|
}
|
|
3947
3966
|
customElements.get(k.tagName) || customElements.define(k.tagName, k);
|
|
3948
3967
|
globalThis.DataGridElement = k;
|
|
3949
|
-
const
|
|
3968
|
+
const lo = {
|
|
3950
3969
|
CAN_MOVE_COLUMN: "canMoveColumn",
|
|
3951
3970
|
GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
|
|
3952
3971
|
};
|
|
3953
|
-
class
|
|
3972
|
+
class ao {
|
|
3954
3973
|
static dependencies;
|
|
3955
3974
|
static manifest;
|
|
3956
|
-
version = "1.
|
|
3975
|
+
version = "1.17.0";
|
|
3957
3976
|
styles;
|
|
3958
3977
|
cellRenderers;
|
|
3959
3978
|
headerRenderers;
|
|
@@ -4092,7 +4111,7 @@ const H = {
|
|
|
4092
4111
|
GROUP_KEY: "data-group-key",
|
|
4093
4112
|
TREE_LEVEL: "data-tree-level",
|
|
4094
4113
|
STICKY: "data-sticky"
|
|
4095
|
-
},
|
|
4114
|
+
}, co = {
|
|
4096
4115
|
ROOT: `.${H.ROOT}`,
|
|
4097
4116
|
HEADER: `.${H.HEADER}`,
|
|
4098
4117
|
HEADER_ROW: `.${H.HEADER_ROW}`,
|
|
@@ -4107,7 +4126,7 @@ const H = {
|
|
|
4107
4126
|
CELL_AT: (t, e) => `.${H.DATA_ROW}[${ee.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${ee.COL_INDEX}="${e}"]`,
|
|
4108
4127
|
SELECTED_ROWS: `.${H.DATA_ROW}.${H.SELECTED}`,
|
|
4109
4128
|
EDITING_CELL: `.${H.DATA_CELL}.${H.EDITING}`
|
|
4110
|
-
},
|
|
4129
|
+
}, ho = {
|
|
4111
4130
|
COLOR_BG: "--tbw-color-bg",
|
|
4112
4131
|
COLOR_FG: "--tbw-color-fg",
|
|
4113
4132
|
COLOR_FG_MUTED: "--tbw-color-fg-muted",
|
|
@@ -4126,14 +4145,14 @@ const H = {
|
|
|
4126
4145
|
BORDER_RADIUS: "--tbw-border-radius",
|
|
4127
4146
|
FOCUS_OUTLINE: "--tbw-focus-outline"
|
|
4128
4147
|
};
|
|
4129
|
-
function
|
|
4148
|
+
function uo(t) {
|
|
4130
4149
|
const e = document.createElement("tbw-grid");
|
|
4131
4150
|
return t && (e.gridConfig = t), e;
|
|
4132
4151
|
}
|
|
4133
|
-
function
|
|
4152
|
+
function fo(t, e = document) {
|
|
4134
4153
|
return e.querySelector(t);
|
|
4135
4154
|
}
|
|
4136
|
-
const
|
|
4155
|
+
const go = {
|
|
4137
4156
|
CELL_CHANGE: "cell-change",
|
|
4138
4157
|
CELL_COMMIT: "cell-commit",
|
|
4139
4158
|
ROW_COMMIT: "row-commit",
|
|
@@ -4148,7 +4167,7 @@ const fo = {
|
|
|
4148
4167
|
CELL_ACTIVATE: "cell-activate",
|
|
4149
4168
|
GROUP_TOGGLE: "group-toggle",
|
|
4150
4169
|
COLUMN_STATE_CHANGE: "column-state-change"
|
|
4151
|
-
},
|
|
4170
|
+
}, po = {
|
|
4152
4171
|
SELECTION_CHANGE: "selection-change",
|
|
4153
4172
|
TREE_EXPAND: "tree-expand",
|
|
4154
4173
|
FILTER_CHANGE: "filter-change",
|
|
@@ -4207,50 +4226,50 @@ const fo = {
|
|
|
4207
4226
|
first: (t) => t[0] ?? 0,
|
|
4208
4227
|
last: (t) => t[t.length - 1] ?? 0
|
|
4209
4228
|
};
|
|
4210
|
-
function
|
|
4229
|
+
function oo(t) {
|
|
4211
4230
|
return Be[t] ?? Be.sum;
|
|
4212
4231
|
}
|
|
4213
|
-
function
|
|
4214
|
-
return
|
|
4232
|
+
function wo(t, e) {
|
|
4233
|
+
return oo(t)(e);
|
|
4215
4234
|
}
|
|
4216
|
-
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);
|
|
4217
4236
|
export {
|
|
4218
|
-
|
|
4237
|
+
ao as BaseGridPlugin,
|
|
4219
4238
|
ft as DEFAULT_ANIMATION_CONFIG,
|
|
4220
4239
|
M as DEFAULT_GRID_ICONS,
|
|
4221
|
-
|
|
4240
|
+
go as DGEvents,
|
|
4222
4241
|
k as DataGridElement,
|
|
4223
4242
|
Je as F,
|
|
4224
4243
|
G as FitModeEnum,
|
|
4225
|
-
|
|
4244
|
+
ho as GridCSSVars,
|
|
4226
4245
|
H as GridClasses,
|
|
4227
4246
|
ee as GridDataAttrs,
|
|
4228
4247
|
k as GridElement,
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4248
|
+
co as GridSelectors,
|
|
4249
|
+
lo as PLUGIN_QUERIES,
|
|
4250
|
+
po as PluginEvents,
|
|
4232
4251
|
ne as PluginManager,
|
|
4233
4252
|
A as RenderPhase,
|
|
4234
4253
|
Xe as a,
|
|
4235
4254
|
O as aggregatorRegistry,
|
|
4236
4255
|
W as b,
|
|
4237
4256
|
Vt as builtInSort,
|
|
4238
|
-
|
|
4239
|
-
|
|
4257
|
+
ro as c,
|
|
4258
|
+
uo as createGrid,
|
|
4240
4259
|
Ke as d,
|
|
4241
4260
|
Ut as defaultComparator,
|
|
4242
4261
|
$ as e,
|
|
4243
4262
|
Ce as f,
|
|
4244
4263
|
zt as g,
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
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
|
|
4255
4274
|
};
|
|
4256
4275
|
//# sourceMappingURL=index.js.map
|