@toolbox-web/grid 1.12.1 → 1.13.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 +1160 -1012
- package/all.js.map +1 -1
- package/index.js +727 -736
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/sanitize.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts.map +1 -1
- package/lib/core/types.d.ts +4 -0
- 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/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/editors.d.ts.map +1 -1
- package/lib/plugins/editing/index.d.ts +1 -1
- package/lib/plugins/editing/index.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +187 -170
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +44 -0
- package/lib/plugins/editing/types.d.ts.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +9 -9
- 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 +57 -56
- package/lib/plugins/master-detail/index.js.map +1 -1
- 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 +40 -39
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +51 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +325 -131
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +18 -0
- package/lib/plugins/selection/types.d.ts.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/public.d.ts +2 -0
- package/public.d.ts.map +1 -1
- package/themes/dg-theme-bootstrap.css +192 -8
- package/themes/dg-theme-material.css +243 -0
- package/umd/grid.all.umd.js +42 -42
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +19 -19
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function lt() {
|
|
2
2
|
return {
|
|
3
3
|
rowCount: -1,
|
|
4
4
|
colCount: -1,
|
|
@@ -6,32 +6,32 @@ function st() {
|
|
|
6
6
|
ariaDescribedBy: void 0
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function at(t, e, i, o, n) {
|
|
10
10
|
if (o === t.rowCount && n === t.colCount)
|
|
11
11
|
return !1;
|
|
12
12
|
const r = t.rowCount;
|
|
13
13
|
return t.rowCount = o, t.colCount = n, e && (e.setAttribute("aria-rowcount", String(o)), e.setAttribute("aria-colcount", String(n))), o !== r && i && (o > 0 ? i.setAttribute("role", "rowgroup") : i.removeAttribute("role")), !0;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ct(t, e) {
|
|
16
16
|
const i = t?.gridAriaLabel;
|
|
17
17
|
return i || (t?.shell?.header?.title ?? e?.lightDomTitle ?? void 0);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function dt(t, e, i, o) {
|
|
20
20
|
if (!e) return !1;
|
|
21
21
|
let n = !1;
|
|
22
|
-
const r =
|
|
22
|
+
const r = ct(i, o);
|
|
23
23
|
r !== t.ariaLabel && (t.ariaLabel = r, r ? e.setAttribute("aria-label", r) : e.removeAttribute("aria-label"), n = !0);
|
|
24
24
|
const s = i?.gridAriaDescribedBy;
|
|
25
25
|
return s !== t.ariaDescribedBy && (t.ariaDescribedBy = s, s ? e.setAttribute("aria-describedby", s) : e.removeAttribute("aria-describedby"), n = !0), n;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const B = {
|
|
28
28
|
STRETCH: "stretch",
|
|
29
29
|
FIXED: "fixed"
|
|
30
|
-
},
|
|
30
|
+
}, ht = {
|
|
31
31
|
mode: "reduced-motion",
|
|
32
32
|
duration: 200,
|
|
33
33
|
easing: "ease-out"
|
|
34
|
-
},
|
|
34
|
+
}, _e = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', M = {
|
|
35
35
|
expand: "▶",
|
|
36
36
|
collapse: "▼",
|
|
37
37
|
sortAsc: "▲",
|
|
@@ -40,22 +40,22 @@ const V = {
|
|
|
40
40
|
submenuArrow: "▶",
|
|
41
41
|
dragHandle: "⋮⋮",
|
|
42
42
|
toolPanel: "☰",
|
|
43
|
-
filter:
|
|
44
|
-
filterActive:
|
|
43
|
+
filter: _e,
|
|
44
|
+
filterActive: _e,
|
|
45
45
|
print: "🖨️"
|
|
46
46
|
};
|
|
47
|
-
function
|
|
47
|
+
function ut(t) {
|
|
48
48
|
return Array.from(t.querySelectorAll("tbw-grid-column")).map((i) => {
|
|
49
49
|
const o = i.getAttribute("field") || "";
|
|
50
50
|
if (!o) return null;
|
|
51
|
-
const n = i.getAttribute("type") || void 0, s = n && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(n) ? n : void 0, l = i.getAttribute("header") || void 0, a = i.hasAttribute("sortable"), c = i.hasAttribute("editable"), d = { field: o, type: s, header: l, sortable: a, editable: c },
|
|
52
|
-
if (u) {
|
|
53
|
-
const b = parseFloat(u);
|
|
54
|
-
!isNaN(b) && /^\d+(\.\d+)?$/.test(u.trim()) ? d.width = b : d.width = u;
|
|
55
|
-
}
|
|
56
|
-
const f = i.getAttribute("minWidth") || i.getAttribute("min-width");
|
|
51
|
+
const n = i.getAttribute("type") || void 0, s = n && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(n) ? n : void 0, l = i.getAttribute("header") || void 0, a = i.hasAttribute("sortable"), c = i.hasAttribute("editable"), d = { field: o, type: s, header: l, sortable: a, editable: c }, f = i.getAttribute("width");
|
|
57
52
|
if (f) {
|
|
58
53
|
const b = parseFloat(f);
|
|
54
|
+
!isNaN(b) && /^\d+(\.\d+)?$/.test(f.trim()) ? d.width = b : d.width = f;
|
|
55
|
+
}
|
|
56
|
+
const u = i.getAttribute("minWidth") || i.getAttribute("min-width");
|
|
57
|
+
if (u) {
|
|
58
|
+
const b = parseFloat(u);
|
|
59
59
|
isNaN(b) || (d.minWidth = b);
|
|
60
60
|
}
|
|
61
61
|
i.hasAttribute("resizable") && (d.resizable = !0), i.hasAttribute("sizable") && (d.resizable = !0);
|
|
@@ -68,20 +68,20 @@ function ht(t) {
|
|
|
68
68
|
}));
|
|
69
69
|
const w = i.querySelector("tbw-grid-column-view"), C = i.querySelector("tbw-grid-column-editor"), m = i.querySelector("tbw-grid-column-header");
|
|
70
70
|
w && (d.__viewTemplate = w), C && (d.__editorTemplate = C), m && (d.__headerTemplate = m);
|
|
71
|
-
const
|
|
71
|
+
const S = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? i, v = S.find((b) => b.canHandle(A));
|
|
72
72
|
if (v) {
|
|
73
|
-
const b = v.createRenderer(
|
|
73
|
+
const b = v.createRenderer(A);
|
|
74
74
|
b && (d.viewRenderer = b);
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const E = C ?? i, _ = S.find((b) => b.canHandle(E));
|
|
77
77
|
if (_) {
|
|
78
|
-
const b = _.createEditor(
|
|
78
|
+
const b = _.createEditor(E);
|
|
79
79
|
b && (d.editor = b);
|
|
80
80
|
}
|
|
81
81
|
return d;
|
|
82
82
|
}).filter((i) => !!i);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ee(t, e) {
|
|
85
85
|
if ((!t || !t.length) && (!e || !e.length)) return [];
|
|
86
86
|
if (!t || !t.length) return e || [];
|
|
87
87
|
if (!e || !e.length) return t;
|
|
@@ -105,7 +105,7 @@ function _e(t, e) {
|
|
|
105
105
|
});
|
|
106
106
|
return Object.keys(i).forEach((n) => o.push(i[n])), o;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Ve(t, e) {
|
|
109
109
|
try {
|
|
110
110
|
t.part?.add?.(e);
|
|
111
111
|
} catch {
|
|
@@ -113,9 +113,9 @@ function Ue(t, e) {
|
|
|
113
113
|
const i = t.getAttribute("part");
|
|
114
114
|
i ? i.split(/\s+/).includes(e) || t.setAttribute("part", i + " " + e) : t.setAttribute("part", e);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
const e = t.effectiveConfig?.fitMode || t.fitMode ||
|
|
118
|
-
if (e !==
|
|
116
|
+
function Se(t) {
|
|
117
|
+
const e = t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH;
|
|
118
|
+
if (e !== B.STRETCH && e !== B.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
|
|
119
119
|
const i = Array.from(t._headerRowEl?.children || []);
|
|
120
120
|
if (!i.length) return;
|
|
121
121
|
let o = !1;
|
|
@@ -131,32 +131,32 @@ function Ee(t) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
l > 0 && (n.width = l + 2, n.__autoSized = !0, o = !0);
|
|
134
|
-
}), o &&
|
|
134
|
+
}), o && U(t), t.__didInitialAutoSize = !0;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
(t.effectiveConfig?.fitMode || t.fitMode ||
|
|
136
|
+
function U(t) {
|
|
137
|
+
(t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH) === B.STRETCH ? t._gridTemplate = t._visibleColumns.map((i) => {
|
|
138
138
|
if (i.width) return `${i.width}px`;
|
|
139
139
|
const o = i.minWidth;
|
|
140
140
|
return o != null ? `minmax(${o}px, 1fr)` : "1fr";
|
|
141
141
|
}).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((i) => i.width ? `${i.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ft(t) {
|
|
144
144
|
return t == null ? "string" : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t instanceof Date || typeof t == "string" && /\d{4}-\d{2}-\d{2}/.test(t) && !isNaN(Date.parse(t)) ? "date" : "string";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function gt(t, e) {
|
|
147
147
|
const i = t[0] || {}, o = Object.keys(i).map((r) => {
|
|
148
|
-
const s = i[r], l =
|
|
148
|
+
const s = i[r], l = ft(s);
|
|
149
149
|
return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
|
|
150
150
|
}), n = {};
|
|
151
151
|
return o.forEach((r) => {
|
|
152
152
|
n[r.field] = r.type || "string";
|
|
153
153
|
}), { columns: o, typeMap: n };
|
|
154
154
|
}
|
|
155
|
-
const
|
|
156
|
-
function
|
|
155
|
+
const pt = /{{\s*([^}]+)\s*}}/g, P = "__DG_EMPTY__", wt = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, bt = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
|
|
156
|
+
function mt(t) {
|
|
157
157
|
return !t || typeof t != "string" ? "" : t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const vt = /* @__PURE__ */ new Set([
|
|
160
160
|
"script",
|
|
161
161
|
"iframe",
|
|
162
162
|
"object",
|
|
@@ -181,23 +181,23 @@ const mt = /* @__PURE__ */ new Set([
|
|
|
181
181
|
"plaintext",
|
|
182
182
|
"xmp",
|
|
183
183
|
"listing"
|
|
184
|
-
]),
|
|
185
|
-
function
|
|
184
|
+
]), Re = /^on\w+$/i, Ct = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), yt = /^\s*(javascript|vbscript|data|blob):/i;
|
|
185
|
+
function $(t) {
|
|
186
186
|
if (!t || typeof t != "string") return "";
|
|
187
187
|
if (t.indexOf("<") === -1) return t;
|
|
188
188
|
const e = document.createElement("template");
|
|
189
|
-
return e.innerHTML = t,
|
|
189
|
+
return e.innerHTML = t, _t(e.content), e.innerHTML;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _t(t) {
|
|
192
192
|
const e = [], i = t.querySelectorAll("*");
|
|
193
193
|
for (const o of i) {
|
|
194
194
|
const n = o.tagName.toLowerCase();
|
|
195
|
-
if (
|
|
195
|
+
if (vt.has(n)) {
|
|
196
196
|
e.push(o);
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
199
|
if ((n === "svg" || o.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(o.attributes).some(
|
|
200
|
-
(l) =>
|
|
200
|
+
(l) => Re.test(l.name) || l.name === "href" || l.name === "xlink:href"
|
|
201
201
|
)) {
|
|
202
202
|
e.push(o);
|
|
203
203
|
continue;
|
|
@@ -205,11 +205,11 @@ function yt(t) {
|
|
|
205
205
|
const r = [];
|
|
206
206
|
for (const s of o.attributes) {
|
|
207
207
|
const l = s.name.toLowerCase();
|
|
208
|
-
if (
|
|
208
|
+
if (Re.test(l)) {
|
|
209
209
|
r.push(s.name);
|
|
210
210
|
continue;
|
|
211
211
|
}
|
|
212
|
-
if (
|
|
212
|
+
if (Ct.has(l) && yt.test(s.value)) {
|
|
213
213
|
r.push(s.name);
|
|
214
214
|
continue;
|
|
215
215
|
}
|
|
@@ -222,52 +222,48 @@ function yt(t) {
|
|
|
222
222
|
}
|
|
223
223
|
e.forEach((o) => o.remove());
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Be(t, e) {
|
|
226
226
|
if (!t || t.indexOf("{{") === -1) return t;
|
|
227
|
-
const i = [], o = t.replace(
|
|
228
|
-
const c =
|
|
227
|
+
const i = [], o = t.replace(pt, (l, a) => {
|
|
228
|
+
const c = Et(a, e);
|
|
229
229
|
return i.push({ expr: a.trim(), result: c }), c;
|
|
230
|
-
}), n =
|
|
231
|
-
return
|
|
230
|
+
}), n = St(o), r = i.length && i.every((l) => l.result === "" || l.result === P);
|
|
231
|
+
return I.test(t) || r ? "" : n;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
if (t = (t || "").trim(), !t ||
|
|
235
|
-
if (t === "value") return e.value == null ?
|
|
233
|
+
function Et(t, e) {
|
|
234
|
+
if (t = (t || "").trim(), !t || I.test(t)) return P;
|
|
235
|
+
if (t === "value") return e.value == null ? P : String(e.value);
|
|
236
236
|
if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
|
|
237
237
|
const o = t.slice(4), n = e.row ? e.row[o] : void 0;
|
|
238
|
-
return n == null ?
|
|
238
|
+
return n == null ? P : String(n);
|
|
239
239
|
}
|
|
240
|
-
if (t.length > 80 || !
|
|
240
|
+
if (t.length > 80 || !wt.test(t) || bt.test(t)) return P;
|
|
241
241
|
const i = t.match(/\./g);
|
|
242
|
-
if (i && i.length > 1) return
|
|
242
|
+
if (i && i.length > 1) return P;
|
|
243
243
|
try {
|
|
244
244
|
const n = new Function("value", "row", `return (${t});`)(e.value, e.row), r = n == null ? "" : String(n);
|
|
245
|
-
return
|
|
245
|
+
return I.test(r) ? P : r || P;
|
|
246
246
|
} catch {
|
|
247
|
-
return
|
|
247
|
+
return P;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
return t && t.replace(new RegExp(L, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
|
|
252
|
-
}
|
|
250
|
+
const I = /Reflect|Proxy|ownKeys/;
|
|
253
251
|
function St(t) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
(t.textContent || "").trim().length === 0 && (t.textContent = "");
|
|
252
|
+
return t && t.replace(new RegExp(P, "g"), "").replace(/Reflect\.[^<>{}\s]+|\bProxy\b|ownKeys\([^)]*\)/g, "");
|
|
253
|
+
}
|
|
254
|
+
function Rt(t) {
|
|
255
|
+
if (I.test(t.textContent || "")) {
|
|
256
|
+
for (const e of t.childNodes)
|
|
257
|
+
e.nodeType === Node.TEXT_NODE && I.test(e.textContent || "") && (e.textContent = "");
|
|
258
|
+
I.test(t.textContent || "") && (t.textContent = "");
|
|
263
259
|
}
|
|
264
260
|
}
|
|
265
|
-
function
|
|
266
|
-
const e =
|
|
261
|
+
function Ae(t) {
|
|
262
|
+
const e = I.test(t), i = ((o) => e ? "" : Be(t, o));
|
|
267
263
|
return i.__blocked = e, i;
|
|
268
264
|
}
|
|
269
|
-
const
|
|
270
|
-
class
|
|
265
|
+
const At = 100;
|
|
266
|
+
class Tt {
|
|
271
267
|
#l;
|
|
272
268
|
#n;
|
|
273
269
|
#u;
|
|
@@ -350,9 +346,9 @@ class xt {
|
|
|
350
346
|
if (!this.#f && e)
|
|
351
347
|
return;
|
|
352
348
|
const i = this.#k();
|
|
353
|
-
this.#f = !1, this.#a = i, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#o = this.#
|
|
349
|
+
this.#f = !1, this.#a = i, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#o = this.#T(this.#a), this.#m();
|
|
354
350
|
}
|
|
355
|
-
#
|
|
351
|
+
#T(e) {
|
|
356
352
|
const i = { ...e };
|
|
357
353
|
return e.columns && (i.columns = e.columns.map((o) => ({ ...o }))), e.shell && (i.shell = {
|
|
358
354
|
...e.shell,
|
|
@@ -382,19 +378,19 @@ class xt {
|
|
|
382
378
|
const e = this.#l ? { ...this.#l } : {}, i = Array.isArray(e.columns) ? [...e.columns] : [], o = (this.#d ?? []).map((s) => ({
|
|
383
379
|
...s
|
|
384
380
|
}));
|
|
385
|
-
let n =
|
|
381
|
+
let n = Ee(
|
|
386
382
|
i,
|
|
387
383
|
o
|
|
388
384
|
);
|
|
389
|
-
this.#n && this.#n.length && (n =
|
|
385
|
+
this.#n && this.#n.length && (n = Ee(
|
|
390
386
|
this.#n,
|
|
391
387
|
o
|
|
392
388
|
));
|
|
393
389
|
const r = this.#r.getRows();
|
|
394
|
-
return n.length === 0 && r.length && (n =
|
|
390
|
+
return n.length === 0 && r.length && (n = gt(r).columns), n.length && (n.forEach((s) => {
|
|
395
391
|
s.sortable === void 0 && (s.sortable = !0), s.resizable === void 0 && (s.resizable = !0), s.__originalWidth === void 0 && typeof s.width == "number" && (s.__originalWidth = s.width);
|
|
396
392
|
}), n.forEach((s) => {
|
|
397
|
-
s.__viewTemplate && !s.__compiledView && (s.__compiledView =
|
|
393
|
+
s.__viewTemplate && !s.__compiledView && (s.__compiledView = Ae(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = Ae(s.__editorTemplate.innerHTML));
|
|
398
394
|
}), e.columns = n), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#b(e), e.columnState && !this.#C && (this.#C = e.columnState), e;
|
|
399
395
|
}
|
|
400
396
|
#b(e) {
|
|
@@ -405,18 +401,18 @@ class xt {
|
|
|
405
401
|
o?.length > 0 && (e.shell.header.lightDomContent = o), this.#r.getShellHasToolButtonsContainer() && (e.shell.header.hasToolButtonsContainer = !0);
|
|
406
402
|
const n = this.#r.getShellToolPanels();
|
|
407
403
|
if (n.size > 0) {
|
|
408
|
-
const
|
|
409
|
-
|
|
404
|
+
const f = Array.from(n.values());
|
|
405
|
+
f.sort((u, g) => (u.order ?? 100) - (g.order ?? 100)), e.shell.toolPanels = f;
|
|
410
406
|
}
|
|
411
407
|
const r = this.#r.getShellHeaderContents();
|
|
412
408
|
if (r.size > 0) {
|
|
413
|
-
const
|
|
414
|
-
|
|
409
|
+
const f = Array.from(r.values());
|
|
410
|
+
f.sort((u, g) => (u.order ?? 100) - (g.order ?? 100)), e.shell.headerContents = f;
|
|
415
411
|
}
|
|
416
|
-
const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), a = this.#l?.shell?.header?.toolbarContents ?? [], c = new Set(a.map((
|
|
417
|
-
for (const
|
|
418
|
-
c.has(
|
|
419
|
-
d.sort((
|
|
412
|
+
const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), a = this.#l?.shell?.header?.toolbarContents ?? [], c = new Set(a.map((f) => f.id)), d = [...a];
|
|
413
|
+
for (const f of l)
|
|
414
|
+
c.has(f.id) || d.push(f);
|
|
415
|
+
d.sort((f, u) => (f.order ?? 0) - (u.order ?? 0)), e.shell.header.toolbarContents = d;
|
|
420
416
|
}
|
|
421
417
|
collectState(e) {
|
|
422
418
|
const i = this.columns, o = this.#y();
|
|
@@ -466,7 +462,7 @@ class xt {
|
|
|
466
462
|
l.applyColumnState(a.field, a);
|
|
467
463
|
}
|
|
468
464
|
resetState(e) {
|
|
469
|
-
this.#C = void 0, this.#r.setSortState(null), this.#o = this.#
|
|
465
|
+
this.#C = void 0, this.#r.setSortState(null), this.#o = this.#T(this.#a), this.#m();
|
|
470
466
|
for (const i of e)
|
|
471
467
|
if (i.applyColumnState)
|
|
472
468
|
for (const o of this.columns)
|
|
@@ -489,7 +485,7 @@ class xt {
|
|
|
489
485
|
this.#s = void 0;
|
|
490
486
|
const i = this.collectState(e);
|
|
491
487
|
this.#r.emit("column-state-change", i);
|
|
492
|
-
},
|
|
488
|
+
}, At);
|
|
493
489
|
}
|
|
494
490
|
setColumnVisible(e, i) {
|
|
495
491
|
const o = this.columns, n = o.find((s) => s.field === e);
|
|
@@ -537,7 +533,7 @@ class xt {
|
|
|
537
533
|
this.columns = o, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
|
|
538
534
|
}
|
|
539
535
|
parseLightDomColumns(e) {
|
|
540
|
-
this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ?
|
|
536
|
+
this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? ut(e) : []);
|
|
541
537
|
}
|
|
542
538
|
clearLightDomCache() {
|
|
543
539
|
this.#d = void 0;
|
|
@@ -590,7 +586,7 @@ class xt {
|
|
|
590
586
|
this.#v?.disconnect(), this.#w = [], this.#s && clearTimeout(this.#s);
|
|
591
587
|
}
|
|
592
588
|
}
|
|
593
|
-
function
|
|
589
|
+
function me() {
|
|
594
590
|
if (typeof window < "u" && window.location) {
|
|
595
591
|
const t = window.location.hostname;
|
|
596
592
|
if (t === "localhost" || t === "127.0.0.1" || t === "::1")
|
|
@@ -601,7 +597,7 @@ function be() {
|
|
|
601
597
|
function Ge(t) {
|
|
602
598
|
return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "🗹" : "☐"}</span>`;
|
|
603
599
|
}
|
|
604
|
-
function
|
|
600
|
+
function Xe(t) {
|
|
605
601
|
if (t == null || t === "") return "";
|
|
606
602
|
if (t instanceof Date)
|
|
607
603
|
return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
|
|
@@ -611,7 +607,7 @@ function Be(t) {
|
|
|
611
607
|
}
|
|
612
608
|
return "";
|
|
613
609
|
}
|
|
614
|
-
function
|
|
610
|
+
function Ye(t) {
|
|
615
611
|
if (!t) return -1;
|
|
616
612
|
const e = t.getAttribute("data-row");
|
|
617
613
|
if (e) return parseInt(e, 10);
|
|
@@ -624,15 +620,15 @@ function Xe(t) {
|
|
|
624
620
|
if (n[r] === i) return r;
|
|
625
621
|
return -1;
|
|
626
622
|
}
|
|
627
|
-
function
|
|
623
|
+
function xt(t) {
|
|
628
624
|
if (!t) return -1;
|
|
629
625
|
const e = t.getAttribute("data-col");
|
|
630
626
|
return e ? parseInt(e, 10) : -1;
|
|
631
627
|
}
|
|
632
|
-
function
|
|
628
|
+
function ve(t) {
|
|
633
629
|
t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
|
|
634
630
|
}
|
|
635
|
-
function
|
|
631
|
+
function Ht(t) {
|
|
636
632
|
try {
|
|
637
633
|
if (getComputedStyle(t).direction === "rtl") return "rtl";
|
|
638
634
|
} catch {
|
|
@@ -643,13 +639,13 @@ function Tt(t) {
|
|
|
643
639
|
}
|
|
644
640
|
return "ltr";
|
|
645
641
|
}
|
|
646
|
-
function
|
|
647
|
-
return
|
|
642
|
+
function Te(t) {
|
|
643
|
+
return Ht(t) === "rtl";
|
|
648
644
|
}
|
|
649
|
-
function
|
|
645
|
+
function eo(t, e) {
|
|
650
646
|
return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
|
|
651
647
|
}
|
|
652
|
-
function
|
|
648
|
+
function je(t, e) {
|
|
653
649
|
const i = e.renderer || e.viewRenderer;
|
|
654
650
|
if (i) return i;
|
|
655
651
|
if (!e.type) return;
|
|
@@ -660,7 +656,7 @@ function Ye(t, e) {
|
|
|
660
656
|
return n.renderer;
|
|
661
657
|
}
|
|
662
658
|
}
|
|
663
|
-
function
|
|
659
|
+
function Ke(t, e) {
|
|
664
660
|
if (e.format) return e.format;
|
|
665
661
|
if (!e.type) return;
|
|
666
662
|
const i = t.__frameworkAdapter;
|
|
@@ -670,122 +666,122 @@ function je(t, e) {
|
|
|
670
666
|
return o.format;
|
|
671
667
|
}
|
|
672
668
|
}
|
|
673
|
-
const
|
|
674
|
-
function
|
|
669
|
+
const Qe = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
670
|
+
function re(t) {
|
|
675
671
|
return (t.__editingCellCount ?? 0) > 0;
|
|
676
672
|
}
|
|
677
|
-
function
|
|
673
|
+
function se(t) {
|
|
678
674
|
t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((i) => i.classList.remove("editing"));
|
|
679
675
|
}
|
|
680
|
-
const Qe = document.createElement("template");
|
|
681
|
-
Qe.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
|
|
682
676
|
const Ze = document.createElement("template");
|
|
683
|
-
Ze.innerHTML = '<div class="
|
|
684
|
-
|
|
685
|
-
|
|
677
|
+
Ze.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
|
|
678
|
+
const Je = document.createElement("template");
|
|
679
|
+
Je.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
|
|
680
|
+
function Lt() {
|
|
681
|
+
return Ze.content.firstElementChild.cloneNode(!0);
|
|
686
682
|
}
|
|
687
683
|
function Pt() {
|
|
688
|
-
return
|
|
684
|
+
return Je.content.firstElementChild.cloneNode(!0);
|
|
689
685
|
}
|
|
690
|
-
function
|
|
686
|
+
function X(t) {
|
|
691
687
|
t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
|
|
692
688
|
}
|
|
693
|
-
function
|
|
689
|
+
function zt(t, e, i, o, n) {
|
|
694
690
|
const r = Math.max(0, i - e), s = t._bodyEl, l = t._visibleColumns, a = l.length;
|
|
695
691
|
let c = t.__cachedHeaderRowCount;
|
|
696
692
|
for (c === void 0 && (c = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = c); t._rowPool.length < r; ) {
|
|
697
|
-
const
|
|
698
|
-
t._rowPool.push(
|
|
693
|
+
const u = Pt();
|
|
694
|
+
t._rowPool.push(u);
|
|
699
695
|
}
|
|
700
696
|
if (t._rowPool.length > r) {
|
|
701
|
-
for (let
|
|
702
|
-
const g = t._rowPool[
|
|
697
|
+
for (let u = r; u < t._rowPool.length; u++) {
|
|
698
|
+
const g = t._rowPool[u];
|
|
703
699
|
g.parentNode === s && g.remove();
|
|
704
700
|
}
|
|
705
701
|
t._rowPool.length = r;
|
|
706
702
|
}
|
|
707
|
-
const d = n && t.__hasRenderRowPlugins !== !1,
|
|
708
|
-
for (let
|
|
709
|
-
const g = e +
|
|
703
|
+
const d = n && t.__hasRenderRowPlugins !== !1, f = t._hasAfterRowRenderHook?.() ?? !1;
|
|
704
|
+
for (let u = 0; u < r; u++) {
|
|
705
|
+
const g = e + u, p = t._rows[g], h = t._rowPool[u];
|
|
710
706
|
if (h.setAttribute("aria-rowindex", String(g + c + 1)), d && n(p, h, g)) {
|
|
711
707
|
h.__epoch = o, h.__rowDataRef = p, h.parentNode !== s && s.appendChild(h);
|
|
712
708
|
continue;
|
|
713
709
|
}
|
|
714
|
-
const w = h.__epoch, C = h.__rowDataRef, m = h.children.length,
|
|
710
|
+
const w = h.__epoch, C = h.__rowDataRef, m = h.children.length, S = w === o && m === a, A = C !== p;
|
|
715
711
|
let v = !1;
|
|
716
|
-
if (
|
|
712
|
+
if (S && A) {
|
|
717
713
|
for (let R = 0; R < a; R++)
|
|
718
714
|
if (l[R].externalView && !h.querySelector(`.cell[data-col="${R}"] [data-external-view]`)) {
|
|
719
715
|
v = !0;
|
|
720
716
|
break;
|
|
721
717
|
}
|
|
722
718
|
}
|
|
723
|
-
if (!
|
|
724
|
-
const R =
|
|
725
|
-
R && !
|
|
726
|
-
} else if (
|
|
727
|
-
const R =
|
|
728
|
-
R && !
|
|
719
|
+
if (!S || v) {
|
|
720
|
+
const R = re(h), T = t._activeEditRows === g;
|
|
721
|
+
R && !T ? (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : R && T ? (le(t, h, p, g), h.__rowDataRef = p) : (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p);
|
|
722
|
+
} else if (A) {
|
|
723
|
+
const R = re(h), T = t._activeEditRows === g;
|
|
724
|
+
R && !T ? (se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : (le(t, h, p, g), h.__rowDataRef = p);
|
|
729
725
|
} else {
|
|
730
|
-
const R =
|
|
731
|
-
R && !
|
|
726
|
+
const R = re(h), T = t._activeEditRows === g;
|
|
727
|
+
R && !T ? (se(h), V(t, h, p, g), h.__epoch = o, h.__rowDataRef = p) : le(t, h, p, g);
|
|
732
728
|
}
|
|
733
|
-
let
|
|
729
|
+
let E = !1;
|
|
734
730
|
const _ = t.changedRowIds;
|
|
735
731
|
if (_ && _.length > 0)
|
|
736
732
|
try {
|
|
737
733
|
const R = t.getRowId?.(p);
|
|
738
|
-
R && (
|
|
734
|
+
R && (E = _.includes(R));
|
|
739
735
|
} catch {
|
|
740
736
|
}
|
|
741
737
|
const b = h.classList.contains("changed");
|
|
742
|
-
|
|
738
|
+
E !== b && h.classList.toggle("changed", E);
|
|
743
739
|
const O = t.effectiveConfig?.rowClass;
|
|
744
740
|
if (O) {
|
|
745
741
|
const R = h.getAttribute("data-dynamic-classes");
|
|
746
|
-
R && R.split(" ").forEach((
|
|
742
|
+
R && R.split(" ").forEach((T) => T && h.classList.remove(T));
|
|
747
743
|
try {
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
|
|
744
|
+
const T = O(p);
|
|
745
|
+
if (T && T.length > 0) {
|
|
746
|
+
const ne = T.filter((G) => G && typeof G == "string");
|
|
747
|
+
ne.forEach((G) => h.classList.add(G)), h.setAttribute("data-dynamic-classes", ne.join(" "));
|
|
752
748
|
} else
|
|
753
749
|
h.removeAttribute("data-dynamic-classes");
|
|
754
|
-
} catch (
|
|
755
|
-
console.warn("[tbw-grid] rowClass callback error:",
|
|
750
|
+
} catch (T) {
|
|
751
|
+
console.warn("[tbw-grid] rowClass callback error:", T), h.removeAttribute("data-dynamic-classes");
|
|
756
752
|
}
|
|
757
753
|
}
|
|
758
|
-
|
|
754
|
+
f && t._afterRowRender?.({
|
|
759
755
|
row: p,
|
|
760
756
|
rowIndex: g,
|
|
761
757
|
rowElement: h
|
|
762
758
|
}), h.parentNode !== s && s.appendChild(h);
|
|
763
759
|
}
|
|
764
760
|
}
|
|
765
|
-
function
|
|
766
|
-
const n = e.children, r = t._visibleColumns, s = r.length, l = n.length, a = s < l ? s : l, c = t._focusRow, d = t._focusCol,
|
|
767
|
-
let
|
|
768
|
-
if (
|
|
769
|
-
|
|
761
|
+
function le(t, e, i, o) {
|
|
762
|
+
const n = e.children, r = t._visibleColumns, s = r.length, l = n.length, a = s < l ? s : l, c = t._focusRow, d = t._focusCol, f = t._hasAfterCellRenderHook?.() ?? !1;
|
|
763
|
+
let u = t.__hasSpecialColumns;
|
|
764
|
+
if (u === void 0) {
|
|
765
|
+
u = !1;
|
|
770
766
|
const p = t.__frameworkAdapter;
|
|
771
767
|
for (let h = 0; h < s; h++) {
|
|
772
768
|
const w = r[h];
|
|
773
769
|
if (w.__viewTemplate || w.__compiledView || w.renderer || w.viewRenderer || w.externalView || w.format || w.type === "date" || w.type === "boolean" || w.type && p?.getTypeDefault?.(w.type)?.renderer || w.type && p?.getTypeDefault?.(w.type)?.format) {
|
|
774
|
-
|
|
770
|
+
u = !0;
|
|
775
771
|
break;
|
|
776
772
|
}
|
|
777
773
|
}
|
|
778
|
-
t.__hasSpecialColumns =
|
|
774
|
+
t.__hasSpecialColumns = u;
|
|
779
775
|
}
|
|
780
776
|
const g = String(o);
|
|
781
|
-
if (!
|
|
777
|
+
if (!u) {
|
|
782
778
|
for (let p = 0; p < a; p++) {
|
|
783
779
|
const h = n[p];
|
|
784
780
|
if (h.classList.contains("editing")) continue;
|
|
785
781
|
const w = r[p], C = i[w.field];
|
|
786
782
|
h.textContent = C == null ? "" : String(C), h.getAttribute("data-row") !== g && h.setAttribute("data-row", g);
|
|
787
783
|
const m = c === o && d === p, y = h.classList.contains("cell-focus");
|
|
788
|
-
m !== y && (h.classList.toggle("cell-focus", m), h.setAttribute("aria-selected", String(m))),
|
|
784
|
+
m !== y && (h.classList.toggle("cell-focus", m), h.setAttribute("aria-selected", String(m))), f && t._afterCellRender?.({
|
|
789
785
|
row: i,
|
|
790
786
|
rowIndex: o,
|
|
791
787
|
column: w,
|
|
@@ -799,7 +795,7 @@ function se(t, e, i, o) {
|
|
|
799
795
|
}
|
|
800
796
|
for (let p = 0; p < a; p++)
|
|
801
797
|
if (r[p].externalView && !n[p].querySelector("[data-external-view]")) {
|
|
802
|
-
|
|
798
|
+
V(t, e, i, o);
|
|
803
799
|
return;
|
|
804
800
|
}
|
|
805
801
|
for (let p = 0; p < a; p++) {
|
|
@@ -814,8 +810,8 @@ function se(t, e, i, o) {
|
|
|
814
810
|
try {
|
|
815
811
|
const b = i[h.field], O = y(b, i, h);
|
|
816
812
|
if (O && O.length > 0) {
|
|
817
|
-
const R = O.filter((
|
|
818
|
-
R.forEach((
|
|
813
|
+
const R = O.filter((T) => T && typeof T == "string");
|
|
814
|
+
R.forEach((T) => w.classList.add(T)), w.setAttribute("data-dynamic-classes", R.join(" "));
|
|
819
815
|
} else
|
|
820
816
|
w.removeAttribute("data-dynamic-classes");
|
|
821
817
|
} catch (b) {
|
|
@@ -823,16 +819,16 @@ function se(t, e, i, o) {
|
|
|
823
819
|
}
|
|
824
820
|
}
|
|
825
821
|
if (w.classList.contains("editing")) continue;
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
828
|
-
const _ = i[h.field], b =
|
|
822
|
+
const S = je(t, h);
|
|
823
|
+
if (S) {
|
|
824
|
+
const _ = i[h.field], b = S({
|
|
829
825
|
row: i,
|
|
830
826
|
value: _,
|
|
831
827
|
field: h.field,
|
|
832
828
|
column: h,
|
|
833
829
|
cellEl: w
|
|
834
830
|
});
|
|
835
|
-
typeof b == "string" ? w.innerHTML =
|
|
831
|
+
typeof b == "string" ? w.innerHTML = $(b) : b instanceof Node ? b.parentElement !== w && (w.innerHTML = "", w.appendChild(b)) : b == null && (w.textContent = _ == null ? "" : String(_)), f && t._afterCellRender?.({
|
|
836
832
|
row: i,
|
|
837
833
|
rowIndex: o,
|
|
838
834
|
column: h,
|
|
@@ -845,57 +841,57 @@ function se(t, e, i, o) {
|
|
|
845
841
|
}
|
|
846
842
|
if (h.__viewTemplate || h.__compiledView || h.externalView)
|
|
847
843
|
continue;
|
|
848
|
-
const
|
|
844
|
+
const A = i[h.field];
|
|
849
845
|
let v;
|
|
850
|
-
const
|
|
851
|
-
if (
|
|
846
|
+
const E = Ke(t, h);
|
|
847
|
+
if (E) {
|
|
852
848
|
try {
|
|
853
|
-
const _ =
|
|
849
|
+
const _ = E(A, i);
|
|
854
850
|
v = _ == null ? "" : String(_);
|
|
855
851
|
} catch (_) {
|
|
856
|
-
console.warn(`[tbw-grid] Format error in column '${h.field}':`, _), v =
|
|
852
|
+
console.warn(`[tbw-grid] Format error in column '${h.field}':`, _), v = A == null ? "" : String(A);
|
|
857
853
|
}
|
|
858
854
|
w.textContent = v;
|
|
859
|
-
} else h.type === "date" ? (v =
|
|
860
|
-
|
|
855
|
+
} else h.type === "date" ? (v = Xe(A), w.textContent = v) : h.type === "boolean" ? w.innerHTML = Ge(!!A) : (v = A == null ? "" : String(A), w.textContent = v);
|
|
856
|
+
f && t._afterCellRender?.({
|
|
861
857
|
row: i,
|
|
862
858
|
rowIndex: o,
|
|
863
859
|
column: h,
|
|
864
860
|
colIndex: p,
|
|
865
|
-
value:
|
|
861
|
+
value: A,
|
|
866
862
|
cellElement: w,
|
|
867
863
|
rowElement: e
|
|
868
864
|
});
|
|
869
865
|
}
|
|
870
866
|
}
|
|
871
|
-
function
|
|
867
|
+
function V(t, e, i, o) {
|
|
872
868
|
e.innerHTML = "";
|
|
873
869
|
const n = t._visibleColumns, r = n.length, s = t._focusRow, l = t._focusCol, a = t, c = t._hasAfterCellRenderHook?.() ?? !1, d = document.createDocumentFragment();
|
|
874
|
-
for (let
|
|
875
|
-
const
|
|
876
|
-
g.setAttribute("aria-colindex", String(
|
|
877
|
-
let p = i[
|
|
878
|
-
const h =
|
|
870
|
+
for (let f = 0; f < r; f++) {
|
|
871
|
+
const u = n[f], g = Lt();
|
|
872
|
+
g.setAttribute("aria-colindex", String(f + 1)), g.setAttribute("data-col", String(f)), g.setAttribute("data-row", String(o)), g.setAttribute("data-field", u.field), g.setAttribute("data-header", u.header ?? u.field), u.type && g.setAttribute("data-type", u.type);
|
|
873
|
+
let p = i[u.field];
|
|
874
|
+
const h = Ke(t, u);
|
|
879
875
|
if (h)
|
|
880
876
|
try {
|
|
881
877
|
p = h(p, i);
|
|
882
878
|
} catch (v) {
|
|
883
|
-
console.warn(`[tbw-grid] Format error in column '${
|
|
879
|
+
console.warn(`[tbw-grid] Format error in column '${u.field}':`, v);
|
|
884
880
|
}
|
|
885
|
-
const w =
|
|
886
|
-
let
|
|
881
|
+
const w = u.__compiledView, C = u.__viewTemplate, m = je(t, u), y = u.externalView;
|
|
882
|
+
let S = !1;
|
|
887
883
|
if (m) {
|
|
888
|
-
const v = m({ row: i, value: p, field:
|
|
889
|
-
typeof v == "string" ? (g.innerHTML =
|
|
884
|
+
const v = m({ row: i, value: p, field: u.field, column: u, cellEl: g });
|
|
885
|
+
typeof v == "string" ? (g.innerHTML = $(v), S = !0) : v instanceof Node ? v.parentElement !== g && (g.textContent = "", g.appendChild(v)) : v == null && (g.textContent = p == null ? "" : String(p));
|
|
890
886
|
} else if (y) {
|
|
891
|
-
const v = y,
|
|
892
|
-
|
|
893
|
-
const _ = { row: i, value: p, field:
|
|
887
|
+
const v = y, E = document.createElement("div");
|
|
888
|
+
E.setAttribute("data-external-view", ""), E.setAttribute("data-field", u.field), g.appendChild(E);
|
|
889
|
+
const _ = { row: i, value: p, field: u.field, column: u };
|
|
894
890
|
if (v.mount)
|
|
895
891
|
try {
|
|
896
|
-
v.mount({ placeholder:
|
|
892
|
+
v.mount({ placeholder: E, context: _, spec: v });
|
|
897
893
|
} catch (b) {
|
|
898
|
-
console.warn(`[tbw-grid] External view mount error for column '${
|
|
894
|
+
console.warn(`[tbw-grid] External view mount error for column '${u.field}':`, b);
|
|
899
895
|
}
|
|
900
896
|
else
|
|
901
897
|
queueMicrotask(() => {
|
|
@@ -904,44 +900,44 @@ function U(t, e, i, o) {
|
|
|
904
900
|
new CustomEvent("mount-external-view", {
|
|
905
901
|
bubbles: !0,
|
|
906
902
|
composed: !0,
|
|
907
|
-
detail: { placeholder:
|
|
903
|
+
detail: { placeholder: E, spec: v, context: _ }
|
|
908
904
|
})
|
|
909
905
|
);
|
|
910
906
|
} catch (b) {
|
|
911
|
-
console.warn(`[tbw-grid] External view event dispatch error for column '${
|
|
907
|
+
console.warn(`[tbw-grid] External view event dispatch error for column '${u.field}':`, b);
|
|
912
908
|
}
|
|
913
909
|
});
|
|
914
|
-
|
|
910
|
+
E.setAttribute("data-mounted", "");
|
|
915
911
|
} else if (w) {
|
|
916
|
-
const v = w({ row: i, value: p, field:
|
|
917
|
-
g.innerHTML =
|
|
912
|
+
const v = w({ row: i, value: p, field: u.field, column: u }), E = w.__blocked;
|
|
913
|
+
g.innerHTML = E ? "" : $(v), S = !0, E && (g.textContent = "", g.setAttribute("data-blocked-template", ""));
|
|
918
914
|
} else if (C) {
|
|
919
915
|
const v = C.innerHTML;
|
|
920
|
-
/Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (g.textContent = "", g.setAttribute("data-blocked-template", "")) : (g.innerHTML =
|
|
916
|
+
/Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (g.textContent = "", g.setAttribute("data-blocked-template", "")) : (g.innerHTML = $(Be(v, { row: i, value: p })), S = !0);
|
|
921
917
|
} else
|
|
922
|
-
h ? g.textContent = p == null ? "" : String(p) :
|
|
923
|
-
if (
|
|
924
|
-
|
|
918
|
+
h ? g.textContent = p == null ? "" : String(p) : u.type === "date" ? g.textContent = Xe(p) : u.type === "boolean" ? g.innerHTML = Ge(!!p) : g.textContent = p == null ? "" : String(p);
|
|
919
|
+
if (S) {
|
|
920
|
+
Rt(g);
|
|
925
921
|
const v = g.textContent || "";
|
|
926
922
|
/Proxy|Reflect\.ownKeys/.test(v) && (g.textContent = v.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(g.textContent || "") && (g.textContent = ""));
|
|
927
923
|
}
|
|
928
|
-
g.hasAttribute("data-blocked-template") && (g.textContent || "").trim().length && (g.textContent = ""),
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
924
|
+
g.hasAttribute("data-blocked-template") && (g.textContent || "").trim().length && (g.textContent = ""), u.editable ? g.tabIndex = 0 : u.type === "boolean" && (g.hasAttribute("tabindex") || (g.tabIndex = 0)), s === o && l === f ? (g.classList.add("cell-focus"), g.setAttribute("aria-selected", "true")) : g.setAttribute("aria-selected", "false");
|
|
925
|
+
const A = u.cellClass;
|
|
926
|
+
if (A)
|
|
931
927
|
try {
|
|
932
|
-
const v = i[
|
|
933
|
-
if (
|
|
934
|
-
const _ =
|
|
928
|
+
const v = i[u.field], E = A(v, i, u);
|
|
929
|
+
if (E && E.length > 0) {
|
|
930
|
+
const _ = E.filter((b) => b && typeof b == "string");
|
|
935
931
|
_.forEach((b) => g.classList.add(b)), g.setAttribute("data-dynamic-classes", _.join(" "));
|
|
936
932
|
}
|
|
937
933
|
} catch (v) {
|
|
938
|
-
console.warn(`[tbw-grid] cellClass callback error for column '${
|
|
934
|
+
console.warn(`[tbw-grid] cellClass callback error for column '${u.field}':`, v);
|
|
939
935
|
}
|
|
940
936
|
c && t._afterCellRender?.({
|
|
941
937
|
row: i,
|
|
942
938
|
rowIndex: o,
|
|
943
|
-
column:
|
|
944
|
-
colIndex:
|
|
939
|
+
column: u,
|
|
940
|
+
colIndex: f,
|
|
945
941
|
value: p,
|
|
946
942
|
cellElement: g,
|
|
947
943
|
rowElement: e
|
|
@@ -949,9 +945,9 @@ function U(t, e, i, o) {
|
|
|
949
945
|
}
|
|
950
946
|
e.appendChild(d);
|
|
951
947
|
}
|
|
952
|
-
function
|
|
948
|
+
function xe(t, e, i) {
|
|
953
949
|
if (e.target?.closest(".resize-handle")) return;
|
|
954
|
-
const o = i.querySelector(".cell[data-row]"), n =
|
|
950
|
+
const o = i.querySelector(".cell[data-row]"), n = Ye(o);
|
|
955
951
|
if (n < 0) return;
|
|
956
952
|
const r = t._rows[n];
|
|
957
953
|
if (!r || t._dispatchRowClick?.(e, n, r, i))
|
|
@@ -964,30 +960,30 @@ function Ae(t, e, i) {
|
|
|
964
960
|
return;
|
|
965
961
|
const a = t._focusRow !== n || t._focusCol !== l;
|
|
966
962
|
if (t._focusRow = n, t._focusCol = l, s.classList.contains("editing")) {
|
|
967
|
-
a && (
|
|
968
|
-
const c = s.querySelector(
|
|
963
|
+
a && (ve(t._bodyEl ?? t), s.classList.add("cell-focus"));
|
|
964
|
+
const c = s.querySelector(Qe);
|
|
969
965
|
try {
|
|
970
966
|
c?.focus({ preventScroll: !0 });
|
|
971
967
|
} catch {
|
|
972
968
|
}
|
|
973
969
|
return;
|
|
974
970
|
}
|
|
975
|
-
|
|
971
|
+
q(t);
|
|
976
972
|
}
|
|
977
973
|
}
|
|
978
974
|
}
|
|
979
|
-
function
|
|
975
|
+
function Dt(t, e) {
|
|
980
976
|
if (t._dispatchKeyDown?.(e))
|
|
981
977
|
return;
|
|
982
978
|
const i = t._rows.length - 1, o = t._visibleColumns.length - 1, n = t._activeEditRows !== void 0 && t._activeEditRows !== -1, s = t._visibleColumns[t._focusCol]?.type, l = e.composedPath?.() ?? [], a = l.length ? l[0] : e.target, c = (d) => {
|
|
983
979
|
if (!d) return !1;
|
|
984
|
-
const
|
|
985
|
-
return !!(
|
|
980
|
+
const f = d.tagName;
|
|
981
|
+
return !!(f === "INPUT" || f === "SELECT" || f === "TEXTAREA" || d.isContentEditable);
|
|
986
982
|
};
|
|
987
983
|
if (!(c(a) && (e.key === "Home" || e.key === "End")) && !(c(a) && (e.key === "ArrowUp" || e.key === "ArrowDown") && a.tagName === "INPUT" && a.type === "number") && !(c(a) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) && !(c(a) && (e.key === "Enter" || e.key === "Escape")) && !(n && s === "select" && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
|
|
988
984
|
switch (e.key) {
|
|
989
985
|
case "Tab": {
|
|
990
|
-
e.preventDefault(), !e.shiftKey ? t._focusCol < o ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < i && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = o),
|
|
986
|
+
e.preventDefault(), !e.shiftKey ? t._focusCol < o ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < i && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = o), q(t);
|
|
991
987
|
return;
|
|
992
988
|
}
|
|
993
989
|
case "ArrowDown":
|
|
@@ -997,18 +993,18 @@ function zt(t, e) {
|
|
|
997
993
|
n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = Math.max(0, t._focusRow - 1), e.preventDefault();
|
|
998
994
|
break;
|
|
999
995
|
case "ArrowRight": {
|
|
1000
|
-
|
|
996
|
+
Te(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(o, t._focusCol + 1), e.preventDefault();
|
|
1001
997
|
break;
|
|
1002
998
|
}
|
|
1003
999
|
case "ArrowLeft": {
|
|
1004
|
-
|
|
1000
|
+
Te(t) ? t._focusCol = Math.min(o, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
|
|
1005
1001
|
break;
|
|
1006
1002
|
}
|
|
1007
1003
|
case "Home":
|
|
1008
|
-
(e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(),
|
|
1004
|
+
(e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), q(t, { forceScrollLeft: !0 });
|
|
1009
1005
|
return;
|
|
1010
1006
|
case "End":
|
|
1011
|
-
(e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(),
|
|
1007
|
+
(e.ctrlKey || e.metaKey) && (n && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = i), t._focusCol = o, e.preventDefault(), q(t, { forceScrollRight: !0 });
|
|
1012
1008
|
return;
|
|
1013
1009
|
case "PageDown":
|
|
1014
1010
|
t._focusRow = Math.min(i, t._focusRow + 20), e.preventDefault();
|
|
@@ -1017,11 +1013,11 @@ function zt(t, e) {
|
|
|
1017
1013
|
t._focusRow = Math.max(0, t._focusRow - 20), e.preventDefault();
|
|
1018
1014
|
break;
|
|
1019
1015
|
case "Enter": {
|
|
1020
|
-
const d = t._focusRow,
|
|
1021
|
-
`[data-row="${d}"][data-col="${
|
|
1016
|
+
const d = t._focusRow, f = t._focusCol, u = t._visibleColumns[f], g = t._rows[d], p = u?.field ?? "", h = p && g ? g[p] : void 0, w = t.querySelector(
|
|
1017
|
+
`[data-row="${d}"][data-col="${f}"]`
|
|
1022
1018
|
), C = {
|
|
1023
1019
|
rowIndex: d,
|
|
1024
|
-
colIndex:
|
|
1020
|
+
colIndex: f,
|
|
1025
1021
|
field: p,
|
|
1026
1022
|
value: h,
|
|
1027
1023
|
row: g,
|
|
@@ -1035,7 +1031,7 @@ function zt(t, e) {
|
|
|
1035
1031
|
t.dispatchEvent(m);
|
|
1036
1032
|
const y = new CustomEvent("activate-cell", {
|
|
1037
1033
|
cancelable: !0,
|
|
1038
|
-
detail: { row: d, col:
|
|
1034
|
+
detail: { row: d, col: f }
|
|
1039
1035
|
});
|
|
1040
1036
|
if (t.dispatchEvent(y), m.defaultPrevented || y.defaultPrevented) {
|
|
1041
1037
|
e.preventDefault();
|
|
@@ -1046,19 +1042,19 @@ function zt(t, e) {
|
|
|
1046
1042
|
default:
|
|
1047
1043
|
return;
|
|
1048
1044
|
}
|
|
1049
|
-
|
|
1045
|
+
q(t);
|
|
1050
1046
|
}
|
|
1051
1047
|
}
|
|
1052
|
-
function
|
|
1048
|
+
function q(t, e) {
|
|
1053
1049
|
if (t._virtualization?.enabled) {
|
|
1054
1050
|
const { rowHeight: s, container: l, viewportEl: a } = t._virtualization, c = l, d = a?.clientHeight ?? c?.clientHeight ?? 0;
|
|
1055
1051
|
if (c && d > 0) {
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1052
|
+
const f = t._focusRow * s;
|
|
1053
|
+
f < c.scrollTop ? c.scrollTop = f : f + s > c.scrollTop + d && (c.scrollTop = f - d + s);
|
|
1058
1054
|
}
|
|
1059
1055
|
}
|
|
1060
1056
|
const i = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
|
|
1061
|
-
i || t.refreshVirtualWindow(!1),
|
|
1057
|
+
i || t.refreshVirtualWindow(!1), ve(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
|
|
1062
1058
|
s.setAttribute("aria-selected", "false");
|
|
1063
1059
|
});
|
|
1064
1060
|
const o = t._focusRow, n = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
|
|
@@ -1076,12 +1072,12 @@ function I(t, e) {
|
|
|
1076
1072
|
else {
|
|
1077
1073
|
const c = t._getHorizontalScrollOffsets?.(s ?? void 0, l) ?? { left: 0, right: 0 };
|
|
1078
1074
|
if (!c.skipScroll) {
|
|
1079
|
-
const d = l.getBoundingClientRect(),
|
|
1080
|
-
|
|
1075
|
+
const d = l.getBoundingClientRect(), f = a.getBoundingClientRect(), u = d.left - f.left + a.scrollLeft, g = u + d.width, p = a.scrollLeft + c.left, h = a.scrollLeft + a.clientWidth - c.right;
|
|
1076
|
+
u < p ? a.scrollLeft = u - c.left : g > h && (a.scrollLeft = g - a.clientWidth + c.right);
|
|
1081
1077
|
}
|
|
1082
1078
|
}
|
|
1083
1079
|
if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
|
|
1084
|
-
const c = l.querySelector(
|
|
1080
|
+
const c = l.querySelector(Qe);
|
|
1085
1081
|
if (c && document.activeElement !== c)
|
|
1086
1082
|
try {
|
|
1087
1083
|
c.focus({ preventScroll: !0 });
|
|
@@ -1097,12 +1093,12 @@ function I(t, e) {
|
|
|
1097
1093
|
}
|
|
1098
1094
|
}
|
|
1099
1095
|
}
|
|
1100
|
-
const
|
|
1101
|
-
function
|
|
1102
|
-
const i =
|
|
1103
|
-
i < 0 || o < 0 || (t._focusRow = i, t._focusCol = o,
|
|
1096
|
+
const te = /* @__PURE__ */ new WeakMap();
|
|
1097
|
+
function Ot(t, e) {
|
|
1098
|
+
const i = Ye(e), o = xt(e);
|
|
1099
|
+
i < 0 || o < 0 || (t._focusRow = i, t._focusCol = o, ve(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
|
|
1104
1100
|
}
|
|
1105
|
-
function
|
|
1101
|
+
function Ce(t, e, i, o) {
|
|
1106
1102
|
let n = null;
|
|
1107
1103
|
const r = i.composedPath?.();
|
|
1108
1104
|
if (r && r.length > 0 ? n = r[0] : n = i.target, n && !e.contains(n)) {
|
|
@@ -1110,13 +1106,13 @@ function ve(t, e, i, o) {
|
|
|
1110
1106
|
h && (n = h);
|
|
1111
1107
|
}
|
|
1112
1108
|
const s = n?.closest?.("[data-col]"), l = n?.closest?.(".data-grid-row"), a = n?.closest?.(".header-row");
|
|
1113
|
-
let c, d,
|
|
1114
|
-
return s && (c = parseInt(s.getAttribute("data-row") ?? "-1", 10), d = parseInt(s.getAttribute("data-col") ?? "-1", 10), c >= 0 && d >= 0 && (
|
|
1109
|
+
let c, d, f, u, g, p;
|
|
1110
|
+
return s && (c = parseInt(s.getAttribute("data-row") ?? "-1", 10), d = parseInt(s.getAttribute("data-col") ?? "-1", 10), c >= 0 && d >= 0 && (f = t._rows[c], p = t._columns[d], u = p?.field, g = f && u ? f[u] : void 0)), {
|
|
1115
1111
|
type: o,
|
|
1116
|
-
row:
|
|
1112
|
+
row: f,
|
|
1117
1113
|
rowIndex: c !== void 0 && c >= 0 ? c : void 0,
|
|
1118
1114
|
colIndex: d !== void 0 && d >= 0 ? d : void 0,
|
|
1119
|
-
field:
|
|
1115
|
+
field: u,
|
|
1120
1116
|
value: g,
|
|
1121
1117
|
column: p,
|
|
1122
1118
|
originalEvent: i,
|
|
@@ -1126,61 +1122,61 @@ function ve(t, e, i, o) {
|
|
|
1126
1122
|
cell: c !== void 0 && d !== void 0 && c >= 0 && d >= 0 ? { row: c, col: d } : void 0
|
|
1127
1123
|
};
|
|
1128
1124
|
}
|
|
1129
|
-
function Ot(t, e, i) {
|
|
1130
|
-
const o = ve(t, e, i, "mousedown");
|
|
1131
|
-
(t._dispatchCellMouseDown?.(o) ?? !1) && ee.set(t, !0);
|
|
1132
|
-
}
|
|
1133
1125
|
function Mt(t, e, i) {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
t._dispatchCellMouseMove?.(o);
|
|
1126
|
+
const o = Ce(t, e, i, "mousedown");
|
|
1127
|
+
(t._dispatchCellMouseDown?.(o) ?? !1) && te.set(t, !0);
|
|
1137
1128
|
}
|
|
1138
1129
|
function kt(t, e, i) {
|
|
1139
|
-
if (!
|
|
1140
|
-
const o =
|
|
1141
|
-
t.
|
|
1130
|
+
if (!te.get(t)) return;
|
|
1131
|
+
const o = Ce(t, e, i, "mousemove");
|
|
1132
|
+
t._dispatchCellMouseMove?.(o);
|
|
1142
1133
|
}
|
|
1143
1134
|
function Nt(t, e, i) {
|
|
1135
|
+
if (!te.get(t)) return;
|
|
1136
|
+
const o = Ce(t, e, i, "mouseup");
|
|
1137
|
+
t._dispatchCellMouseUp?.(o), te.set(t, !1);
|
|
1138
|
+
}
|
|
1139
|
+
function It(t, e, i) {
|
|
1144
1140
|
e.addEventListener(
|
|
1145
1141
|
"mousedown",
|
|
1146
1142
|
(o) => {
|
|
1147
1143
|
const n = o.target.closest(".cell[data-col]");
|
|
1148
|
-
n && (n.classList.contains("editing") ||
|
|
1144
|
+
n && (n.classList.contains("editing") || Ot(t, n));
|
|
1149
1145
|
},
|
|
1150
1146
|
{ signal: i }
|
|
1151
1147
|
), e.addEventListener(
|
|
1152
1148
|
"click",
|
|
1153
1149
|
(o) => {
|
|
1154
1150
|
const n = o.target.closest(".data-grid-row");
|
|
1155
|
-
n &&
|
|
1151
|
+
n && xe(t, o, n);
|
|
1156
1152
|
},
|
|
1157
1153
|
{ signal: i }
|
|
1158
1154
|
), e.addEventListener(
|
|
1159
1155
|
"dblclick",
|
|
1160
1156
|
(o) => {
|
|
1161
1157
|
const n = o.target.closest(".data-grid-row");
|
|
1162
|
-
n &&
|
|
1158
|
+
n && xe(t, o, n);
|
|
1163
1159
|
},
|
|
1164
1160
|
{ signal: i }
|
|
1165
1161
|
);
|
|
1166
1162
|
}
|
|
1167
|
-
function
|
|
1168
|
-
e.addEventListener("keydown", (n) =>
|
|
1163
|
+
function qt(t, e, i, o) {
|
|
1164
|
+
e.addEventListener("keydown", (n) => Dt(t, n), { signal: o }), i.addEventListener("mousedown", (n) => Mt(t, i, n), { signal: o }), document.addEventListener("mousemove", (n) => kt(t, i, n), { signal: o }), document.addEventListener("mouseup", (n) => Nt(t, i, n), { signal: o });
|
|
1169
1165
|
}
|
|
1170
|
-
function
|
|
1166
|
+
function $t(t, e) {
|
|
1171
1167
|
return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
|
|
1172
1168
|
}
|
|
1173
|
-
function
|
|
1174
|
-
const n = i.find((l) => l.field === e.field)?.sortComparator ??
|
|
1169
|
+
function Wt(t, e, i) {
|
|
1170
|
+
const n = i.find((l) => l.field === e.field)?.sortComparator ?? $t, { field: r, direction: s } = e;
|
|
1175
1171
|
return [...t].sort((l, a) => n(l[r], a[r], l, a) * s);
|
|
1176
1172
|
}
|
|
1177
|
-
function
|
|
1178
|
-
t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1),
|
|
1173
|
+
function He(t, e, i, o) {
|
|
1174
|
+
t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), ie(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1179
1175
|
new CustomEvent("sort-change", { detail: { field: i.field, direction: o } })
|
|
1180
1176
|
), t.requestStateChange?.();
|
|
1181
1177
|
}
|
|
1182
|
-
function
|
|
1183
|
-
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Pe(t, e, 1)) : t._sortState.direction === 1 ? Pe(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((o) => o.__epoch = -1), t._rows = t.__originalOrder.slice(),
|
|
1178
|
+
function Le(t, e) {
|
|
1179
|
+
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Pe(t, e, 1)) : t._sortState.direction === 1 ? Pe(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((o) => o.__epoch = -1), t._rows = t.__originalOrder.slice(), ie(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((o) => {
|
|
1184
1180
|
o.getAttribute("aria-sort") ? (o.getAttribute("aria-sort") === "ascending" || o.getAttribute("aria-sort") === "descending") && (t._sortState || o.setAttribute("aria-sort", "none")) : o.setAttribute("aria-sort", "none");
|
|
1185
1181
|
}), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1186
1182
|
new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
|
|
@@ -1188,27 +1184,27 @@ function He(t, e) {
|
|
|
1188
1184
|
}
|
|
1189
1185
|
function Pe(t, e, i) {
|
|
1190
1186
|
t._sortState = { field: e.field, direction: i };
|
|
1191
|
-
const o = { field: e.field, direction: i }, n = t._columns, s = (t.effectiveConfig?.sortHandler ??
|
|
1187
|
+
const o = { field: e.field, direction: i }, n = t._columns, s = (t.effectiveConfig?.sortHandler ?? Wt)(t._rows, o, n);
|
|
1192
1188
|
s && typeof s.then == "function" ? s.then((l) => {
|
|
1193
|
-
|
|
1194
|
-
}) :
|
|
1189
|
+
He(t, l, e, i);
|
|
1190
|
+
}) : He(t, s, e, i);
|
|
1195
1191
|
}
|
|
1196
|
-
function
|
|
1192
|
+
function W(t, e) {
|
|
1197
1193
|
return t.effectiveConfig?.sortable !== !1 && e.sortable === !0;
|
|
1198
1194
|
}
|
|
1199
|
-
function
|
|
1195
|
+
function Y(t, e) {
|
|
1200
1196
|
return t.effectiveConfig?.resizable !== !1 && e.resizable !== !1;
|
|
1201
1197
|
}
|
|
1202
|
-
function
|
|
1198
|
+
function Ft(t, e) {
|
|
1203
1199
|
typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
|
|
1204
1200
|
}
|
|
1205
|
-
function
|
|
1201
|
+
function j(t, e) {
|
|
1206
1202
|
const i = document.createElement("span");
|
|
1207
|
-
|
|
1203
|
+
Ve(i, "sort-indicator");
|
|
1208
1204
|
const o = t._sortState?.field === e.field ? t._sortState.direction : 0, n = { ...M, ...t.icons }, r = o === 1 ? n.sortAsc : o === -1 ? n.sortDesc : n.sortNone;
|
|
1209
|
-
return
|
|
1205
|
+
return Ft(i, r), i;
|
|
1210
1206
|
}
|
|
1211
|
-
function
|
|
1207
|
+
function K(t, e, i) {
|
|
1212
1208
|
const o = document.createElement("div");
|
|
1213
1209
|
return o.className = "resize-handle", o.setAttribute("aria-hidden", "true"), o.addEventListener("mousedown", (n) => {
|
|
1214
1210
|
n.stopPropagation(), n.preventDefault(), t._resizeController.start(n, e, i);
|
|
@@ -1216,32 +1212,32 @@ function j(t, e, i) {
|
|
|
1216
1212
|
n.stopPropagation(), n.preventDefault(), t._resizeController.resetColumn(e);
|
|
1217
1213
|
}), o;
|
|
1218
1214
|
}
|
|
1219
|
-
function
|
|
1215
|
+
function Q(t, e, i, o) {
|
|
1220
1216
|
o.classList.add("sortable"), o.tabIndex = 0;
|
|
1221
1217
|
const n = t._sortState?.field === e.field ? t._sortState.direction : 0;
|
|
1222
1218
|
o.setAttribute("aria-sort", n === 0 ? "none" : n === 1 ? "ascending" : "descending"), o.addEventListener("click", (r) => {
|
|
1223
|
-
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, i, o) ||
|
|
1219
|
+
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, i, o) || Le(t, e);
|
|
1224
1220
|
}), o.addEventListener("keydown", (r) => {
|
|
1225
1221
|
if (r.key === "Enter" || r.key === " ") {
|
|
1226
1222
|
if (r.preventDefault(), t._dispatchHeaderClick?.(r, i, o)) return;
|
|
1227
|
-
|
|
1223
|
+
Le(t, e);
|
|
1228
1224
|
}
|
|
1229
1225
|
});
|
|
1230
1226
|
}
|
|
1231
|
-
function
|
|
1227
|
+
function Ut(t, e) {
|
|
1232
1228
|
if (e != null)
|
|
1233
1229
|
if (typeof e == "string") {
|
|
1234
1230
|
const i = document.createElement("span");
|
|
1235
|
-
for (i.innerHTML =
|
|
1231
|
+
for (i.innerHTML = $(e); i.firstChild; )
|
|
1236
1232
|
t.appendChild(i.firstChild);
|
|
1237
1233
|
} else e instanceof Node && t.appendChild(e);
|
|
1238
1234
|
}
|
|
1239
|
-
function
|
|
1235
|
+
function ie(t) {
|
|
1240
1236
|
t._headerRowEl = t.findHeaderRow();
|
|
1241
1237
|
const e = t._headerRowEl;
|
|
1242
1238
|
e && (e.innerHTML = "", t._visibleColumns.forEach((i, o) => {
|
|
1243
1239
|
const n = document.createElement("div");
|
|
1244
|
-
n.className = "cell",
|
|
1240
|
+
n.className = "cell", Ve(n, "header-cell"), n.setAttribute("role", "columnheader"), n.setAttribute("aria-colindex", String(o + 1)), n.setAttribute("data-field", i.field), n.setAttribute("data-col", String(o));
|
|
1245
1241
|
const r = i.header ?? i.field, s = t._sortState?.field === i.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
|
|
1246
1242
|
if (i.headerRenderer) {
|
|
1247
1243
|
const a = {
|
|
@@ -1250,30 +1246,30 @@ function te(t) {
|
|
|
1250
1246
|
sortState: l,
|
|
1251
1247
|
filterActive: !1,
|
|
1252
1248
|
cellEl: n,
|
|
1253
|
-
renderSortIcon: () =>
|
|
1249
|
+
renderSortIcon: () => W(t, i) ? j(t, i) : null,
|
|
1254
1250
|
renderFilterButton: () => null
|
|
1255
1251
|
}, c = i.headerRenderer(a);
|
|
1256
|
-
|
|
1252
|
+
Ut(n, c), W(t, i) && Q(t, i, o, n), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
|
|
1257
1253
|
} else if (i.headerLabelRenderer) {
|
|
1258
1254
|
const a = {
|
|
1259
1255
|
column: i,
|
|
1260
1256
|
value: r
|
|
1261
1257
|
}, c = i.headerLabelRenderer(a), d = document.createElement("span");
|
|
1262
|
-
c == null ? d.textContent = r : typeof c == "string" ? d.innerHTML =
|
|
1258
|
+
c == null ? d.textContent = r : typeof c == "string" ? d.innerHTML = $(c) : c instanceof Node && d.appendChild(c), n.appendChild(d), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
|
|
1263
1259
|
} else if (i.__headerTemplate)
|
|
1264
|
-
Array.from(i.__headerTemplate.childNodes).forEach((a) => n.appendChild(a.cloneNode(!0))),
|
|
1260
|
+
Array.from(i.__headerTemplate.childNodes).forEach((a) => n.appendChild(a.cloneNode(!0))), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
|
|
1265
1261
|
else {
|
|
1266
1262
|
const a = document.createElement("span");
|
|
1267
|
-
a.textContent = r, n.appendChild(a),
|
|
1263
|
+
a.textContent = r, n.appendChild(a), W(t, i) && (Q(t, i, o, n), n.appendChild(j(t, i))), Y(t, i) && (n.classList.add("resizable"), n.appendChild(K(t, o, n)));
|
|
1268
1264
|
}
|
|
1269
1265
|
e.appendChild(n);
|
|
1270
1266
|
}), e.querySelectorAll(".cell.sortable").forEach((i) => {
|
|
1271
1267
|
i.getAttribute("aria-sort") || i.setAttribute("aria-sort", "none");
|
|
1272
1268
|
}), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
|
|
1273
1269
|
}
|
|
1274
|
-
const
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1270
|
+
const et = typeof requestIdleCallback == "function";
|
|
1271
|
+
function Vt(t, e) {
|
|
1272
|
+
return et ? requestIdleCallback(t, e) : window.setTimeout(() => {
|
|
1277
1273
|
const i = Date.now();
|
|
1278
1274
|
t({
|
|
1279
1275
|
didTimeout: !1,
|
|
@@ -1281,10 +1277,10 @@ function Ut(t, e) {
|
|
|
1281
1277
|
});
|
|
1282
1278
|
}, 1);
|
|
1283
1279
|
}
|
|
1284
|
-
function
|
|
1285
|
-
|
|
1280
|
+
function ze(t) {
|
|
1281
|
+
et ? cancelIdleCallback(t) : clearTimeout(t);
|
|
1286
1282
|
}
|
|
1287
|
-
function
|
|
1283
|
+
function Bt(t) {
|
|
1288
1284
|
const e = document.createElement("div");
|
|
1289
1285
|
return e.className = `tbw-spinner tbw-spinner--${t}`, e.setAttribute("role", "progressbar"), e.setAttribute("aria-label", "Loading"), e;
|
|
1290
1286
|
}
|
|
@@ -1297,26 +1293,26 @@ function Gt(t, e) {
|
|
|
1297
1293
|
}
|
|
1298
1294
|
return o;
|
|
1299
1295
|
}
|
|
1300
|
-
return
|
|
1296
|
+
return Bt(t);
|
|
1301
1297
|
}
|
|
1302
|
-
function
|
|
1298
|
+
function Xt(t) {
|
|
1303
1299
|
const e = document.createElement("div");
|
|
1304
1300
|
return e.className = "tbw-loading-overlay", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.appendChild(Gt("large", t)), e;
|
|
1305
1301
|
}
|
|
1306
|
-
function
|
|
1302
|
+
function Yt(t, e) {
|
|
1307
1303
|
t.appendChild(e);
|
|
1308
1304
|
}
|
|
1309
|
-
function
|
|
1305
|
+
function jt(t) {
|
|
1310
1306
|
t?.remove();
|
|
1311
1307
|
}
|
|
1312
|
-
function
|
|
1308
|
+
function Kt(t, e) {
|
|
1313
1309
|
e ? (t.classList.add("tbw-row-loading"), t.setAttribute("aria-busy", "true")) : (t.classList.remove("tbw-row-loading"), t.removeAttribute("aria-busy"));
|
|
1314
1310
|
}
|
|
1315
|
-
function
|
|
1311
|
+
function Qt(t, e) {
|
|
1316
1312
|
e ? (t.classList.add("tbw-cell-loading"), t.setAttribute("aria-busy", "true")) : (t.classList.remove("tbw-cell-loading"), t.removeAttribute("aria-busy"));
|
|
1317
1313
|
}
|
|
1318
|
-
var
|
|
1319
|
-
class
|
|
1314
|
+
var x = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(x || {});
|
|
1315
|
+
class Zt {
|
|
1320
1316
|
#l;
|
|
1321
1317
|
#n = 0;
|
|
1322
1318
|
#u = 0;
|
|
@@ -1359,15 +1355,15 @@ class Qt {
|
|
|
1359
1355
|
this.#n = 0, e >= 5 && this.#l.mergeConfig(), e >= 4 && this.#l.processRows(), e >= 5 && (this.#l.processColumns(), this.#l.updateTemplate()), e >= 3 && this.#l.renderHeader(), e >= 2 && this.#l.renderVirtualWindow(), e >= 1 && this.#l.afterRender(), !this.#o && this.#a && (this.#o = !0, this.#a()), this.#h && (this.#h(), this.#h = null, this.#d = null);
|
|
1360
1356
|
}
|
|
1361
1357
|
}
|
|
1362
|
-
function
|
|
1358
|
+
function De(t) {
|
|
1363
1359
|
let e = null, i = null, o = null, n = null;
|
|
1364
1360
|
const r = (a) => {
|
|
1365
1361
|
if (!e) return;
|
|
1366
|
-
const c = a.clientX - e.startX, d = Math.max(40, e.startWidth + c),
|
|
1367
|
-
|
|
1362
|
+
const c = a.clientX - e.startX, d = Math.max(40, e.startWidth + c), f = t._visibleColumns[e.colIndex];
|
|
1363
|
+
f.width = d, f.__userResized = !0, f.__renderedWidth = d, i == null && (i = requestAnimationFrame(() => {
|
|
1368
1364
|
i = null, t.updateTemplate?.();
|
|
1369
1365
|
})), t.dispatchEvent(
|
|
1370
|
-
new CustomEvent("column-resize", { detail: { field:
|
|
1366
|
+
new CustomEvent("column-resize", { detail: { field: f.field, width: d } })
|
|
1371
1367
|
);
|
|
1372
1368
|
};
|
|
1373
1369
|
let s = !1;
|
|
@@ -1383,7 +1379,7 @@ function ze(t) {
|
|
|
1383
1379
|
},
|
|
1384
1380
|
start(a, c, d) {
|
|
1385
1381
|
a.preventDefault();
|
|
1386
|
-
const
|
|
1382
|
+
const f = t._visibleColumns[c], u = typeof f?.width == "number" ? f.width : void 0, g = f?.__renderedWidth ?? u ?? d.getBoundingClientRect().width;
|
|
1387
1383
|
e = { startX: a.clientX, colIndex: c, startWidth: g }, window.addEventListener("mousemove", r), window.addEventListener("mouseup", l), o === null && (o = document.documentElement.style.cursor), document.documentElement.style.cursor = "e-resize", n === null && (n = document.body.style.userSelect), document.body.style.userSelect = "none";
|
|
1388
1384
|
},
|
|
1389
1385
|
resetColumn(a) {
|
|
@@ -1397,55 +1393,55 @@ function ze(t) {
|
|
|
1397
1393
|
}
|
|
1398
1394
|
};
|
|
1399
1395
|
}
|
|
1400
|
-
const
|
|
1396
|
+
const ae = "data-animating", Jt = {
|
|
1401
1397
|
change: "--tbw-row-change-duration",
|
|
1402
1398
|
insert: "--tbw-row-insert-duration",
|
|
1403
1399
|
remove: "--tbw-row-remove-duration"
|
|
1404
|
-
},
|
|
1400
|
+
}, ei = {
|
|
1405
1401
|
change: 500,
|
|
1406
1402
|
insert: 300,
|
|
1407
1403
|
remove: 200
|
|
1408
1404
|
};
|
|
1409
|
-
function
|
|
1405
|
+
function ti(t) {
|
|
1410
1406
|
const e = t.trim().toLowerCase();
|
|
1411
1407
|
return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
|
|
1412
1408
|
}
|
|
1413
|
-
function
|
|
1414
|
-
const i =
|
|
1409
|
+
function ii(t, e) {
|
|
1410
|
+
const i = Jt[e], o = getComputedStyle(t).getPropertyValue(i);
|
|
1415
1411
|
if (o) {
|
|
1416
|
-
const n =
|
|
1412
|
+
const n = ti(o);
|
|
1417
1413
|
if (!isNaN(n) && n > 0)
|
|
1418
1414
|
return n;
|
|
1419
1415
|
}
|
|
1420
|
-
return
|
|
1416
|
+
return ei[e];
|
|
1421
1417
|
}
|
|
1422
|
-
function
|
|
1423
|
-
t.removeAttribute(
|
|
1424
|
-
const o =
|
|
1418
|
+
function oi(t, e, i) {
|
|
1419
|
+
t.removeAttribute(ae), t.offsetWidth, t.setAttribute(ae, e);
|
|
1420
|
+
const o = ii(t, e);
|
|
1425
1421
|
setTimeout(() => {
|
|
1426
|
-
e !== "remove" && t.removeAttribute(
|
|
1422
|
+
e !== "remove" && t.removeAttribute(ae);
|
|
1427
1423
|
}, o);
|
|
1428
1424
|
}
|
|
1429
|
-
function
|
|
1425
|
+
function ye(t, e, i) {
|
|
1430
1426
|
if (e < 0)
|
|
1431
1427
|
return !1;
|
|
1432
1428
|
const o = t.findRenderedRowElement?.(e);
|
|
1433
|
-
return o ? (
|
|
1429
|
+
return o ? (oi(o, i), !0) : !1;
|
|
1434
1430
|
}
|
|
1435
|
-
function
|
|
1431
|
+
function ni(t, e, i) {
|
|
1436
1432
|
let o = 0;
|
|
1437
1433
|
for (const n of e)
|
|
1438
|
-
|
|
1434
|
+
ye(t, n, i) && o++;
|
|
1439
1435
|
return o;
|
|
1440
1436
|
}
|
|
1441
|
-
function
|
|
1437
|
+
function ri(t, e, i) {
|
|
1442
1438
|
const o = t._rows ?? [], n = t.getRowId;
|
|
1443
1439
|
if (!n)
|
|
1444
1440
|
return !1;
|
|
1445
1441
|
const r = o.findIndex((s) => n(s) === e);
|
|
1446
|
-
return r < 0 ? !1 :
|
|
1442
|
+
return r < 0 ? !1 : ye(t, r, i);
|
|
1447
1443
|
}
|
|
1448
|
-
function
|
|
1444
|
+
function Z(t, e, i) {
|
|
1449
1445
|
const o = document.createElement(t);
|
|
1450
1446
|
if (e)
|
|
1451
1447
|
for (const n in e) {
|
|
@@ -1454,7 +1450,7 @@ function Q(t, e, i) {
|
|
|
1454
1450
|
}
|
|
1455
1451
|
return o;
|
|
1456
1452
|
}
|
|
1457
|
-
function
|
|
1453
|
+
function L(t, e) {
|
|
1458
1454
|
const i = document.createElement("div");
|
|
1459
1455
|
if (t && (i.className = t), e)
|
|
1460
1456
|
for (const o in e) {
|
|
@@ -1463,7 +1459,7 @@ function P(t, e) {
|
|
|
1463
1459
|
}
|
|
1464
1460
|
return i;
|
|
1465
1461
|
}
|
|
1466
|
-
function
|
|
1462
|
+
function tt(t, e, i) {
|
|
1467
1463
|
const o = document.createElement("button");
|
|
1468
1464
|
if (t && (o.className = t), e)
|
|
1469
1465
|
for (const n in e) {
|
|
@@ -1472,8 +1468,8 @@ function et(t, e, i) {
|
|
|
1472
1468
|
}
|
|
1473
1469
|
return o;
|
|
1474
1470
|
}
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1471
|
+
const it = document.createElement("template");
|
|
1472
|
+
it.innerHTML = `
|
|
1477
1473
|
<div class="tbw-scroll-area">
|
|
1478
1474
|
<div class="rows-body-wrapper">
|
|
1479
1475
|
<div class="rows-body" role="grid">
|
|
@@ -1492,38 +1488,38 @@ tt.innerHTML = `
|
|
|
1492
1488
|
<div class="faux-vscroll-spacer"></div>
|
|
1493
1489
|
</div>
|
|
1494
1490
|
`;
|
|
1495
|
-
function
|
|
1496
|
-
return
|
|
1491
|
+
function ot() {
|
|
1492
|
+
return it.content.cloneNode(!0);
|
|
1497
1493
|
}
|
|
1498
|
-
function
|
|
1499
|
-
const e = document.createDocumentFragment(), i =
|
|
1494
|
+
function Oe(t) {
|
|
1495
|
+
const e = document.createDocumentFragment(), i = L(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
|
|
1500
1496
|
if (t.hasShell && t.shellHeader && t.shellBody)
|
|
1501
1497
|
i.appendChild(t.shellHeader), i.appendChild(t.shellBody);
|
|
1502
1498
|
else {
|
|
1503
|
-
const o =
|
|
1504
|
-
o.appendChild(
|
|
1499
|
+
const o = L("tbw-grid-content");
|
|
1500
|
+
o.appendChild(ot()), i.appendChild(o);
|
|
1505
1501
|
}
|
|
1506
1502
|
return e.appendChild(i), e;
|
|
1507
1503
|
}
|
|
1508
|
-
function
|
|
1509
|
-
const e =
|
|
1504
|
+
function si(t) {
|
|
1505
|
+
const e = L("tbw-shell-header", { part: "shell-header", role: "presentation" });
|
|
1510
1506
|
if (t.title) {
|
|
1511
|
-
const r =
|
|
1507
|
+
const r = L("tbw-shell-title");
|
|
1512
1508
|
r.textContent = t.title, e.appendChild(r);
|
|
1513
1509
|
}
|
|
1514
|
-
const i =
|
|
1510
|
+
const i = L("tbw-shell-content", {
|
|
1515
1511
|
part: "shell-content",
|
|
1516
1512
|
role: "presentation",
|
|
1517
1513
|
"data-light-dom-header-content": ""
|
|
1518
1514
|
});
|
|
1519
1515
|
e.appendChild(i);
|
|
1520
|
-
const o =
|
|
1516
|
+
const o = L("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
|
|
1521
1517
|
for (const r of t.configButtons)
|
|
1522
|
-
r.hasRender && o.appendChild(
|
|
1518
|
+
r.hasRender && o.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
|
|
1523
1519
|
for (const r of t.apiButtons)
|
|
1524
|
-
r.hasRender && o.appendChild(
|
|
1525
|
-
if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && o.appendChild(
|
|
1526
|
-
const r =
|
|
1520
|
+
r.hasRender && o.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
|
|
1521
|
+
if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && o.appendChild(L("tbw-toolbar-separator")), t.hasPanels) {
|
|
1522
|
+
const r = tt(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
|
|
1527
1523
|
"data-panel-toggle": "",
|
|
1528
1524
|
title: "Settings",
|
|
1529
1525
|
"aria-label": "Toggle settings panel",
|
|
@@ -1534,12 +1530,12 @@ function ri(t) {
|
|
|
1534
1530
|
}
|
|
1535
1531
|
return e.appendChild(o), e;
|
|
1536
1532
|
}
|
|
1537
|
-
function
|
|
1538
|
-
const e =
|
|
1539
|
-
n.appendChild(
|
|
1533
|
+
function li(t) {
|
|
1534
|
+
const e = L("tbw-shell-body"), i = t.panels.length > 0, o = t.panels.length === 1, n = L("tbw-grid-content");
|
|
1535
|
+
n.appendChild(ot());
|
|
1540
1536
|
let r = null;
|
|
1541
1537
|
if (i) {
|
|
1542
|
-
r =
|
|
1538
|
+
r = Z("aside", {
|
|
1543
1539
|
class: t.isPanelOpen ? "tbw-tool-panel open" : "tbw-tool-panel",
|
|
1544
1540
|
part: "tool-panel",
|
|
1545
1541
|
"data-position": t.position,
|
|
@@ -1548,33 +1544,33 @@ function si(t) {
|
|
|
1548
1544
|
});
|
|
1549
1545
|
const s = t.position === "left" ? "right" : "left";
|
|
1550
1546
|
r.appendChild(
|
|
1551
|
-
|
|
1547
|
+
L("tbw-tool-panel-resize", {
|
|
1552
1548
|
"data-resize-handle": "",
|
|
1553
1549
|
"data-handle-position": s,
|
|
1554
1550
|
"aria-hidden": "true"
|
|
1555
1551
|
})
|
|
1556
1552
|
);
|
|
1557
|
-
const l =
|
|
1553
|
+
const l = L("tbw-tool-panel-content", { role: "presentation" }), a = L("tbw-accordion");
|
|
1558
1554
|
for (const c of t.panels) {
|
|
1559
|
-
const d = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`,
|
|
1555
|
+
const d = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${o ? " single" : ""}`, f = L(d, { "data-section": c.id }), u = tt("tbw-accordion-header", {
|
|
1560
1556
|
"aria-expanded": String(c.isExpanded),
|
|
1561
1557
|
"aria-controls": `tbw-section-${c.id}`
|
|
1562
1558
|
});
|
|
1563
|
-
if (o &&
|
|
1564
|
-
const p =
|
|
1565
|
-
p.innerHTML = c.icon,
|
|
1559
|
+
if (o && u.setAttribute("aria-disabled", "true"), c.icon) {
|
|
1560
|
+
const p = Z("span", { class: "tbw-accordion-icon" });
|
|
1561
|
+
p.innerHTML = c.icon, u.appendChild(p);
|
|
1566
1562
|
}
|
|
1567
|
-
const g =
|
|
1568
|
-
if (g.textContent = c.title,
|
|
1569
|
-
const p =
|
|
1570
|
-
p.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon,
|
|
1563
|
+
const g = Z("span", { class: "tbw-accordion-title" });
|
|
1564
|
+
if (g.textContent = c.title, u.appendChild(g), !o) {
|
|
1565
|
+
const p = Z("span", { class: "tbw-accordion-chevron" });
|
|
1566
|
+
p.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon, u.appendChild(p);
|
|
1571
1567
|
}
|
|
1572
|
-
|
|
1573
|
-
|
|
1568
|
+
f.appendChild(u), f.appendChild(
|
|
1569
|
+
L("tbw-accordion-content", {
|
|
1574
1570
|
id: `tbw-section-${c.id}`,
|
|
1575
1571
|
role: "presentation"
|
|
1576
1572
|
})
|
|
1577
|
-
), a.appendChild(
|
|
1573
|
+
), a.appendChild(f);
|
|
1578
1574
|
}
|
|
1579
1575
|
l.appendChild(a), r.appendChild(l);
|
|
1580
1576
|
}
|
|
@@ -1583,7 +1579,7 @@ function si(t) {
|
|
|
1583
1579
|
function N(t) {
|
|
1584
1580
|
return t ? typeof t == "string" ? t : t.outerHTML : "";
|
|
1585
1581
|
}
|
|
1586
|
-
function
|
|
1582
|
+
function ai() {
|
|
1587
1583
|
return {
|
|
1588
1584
|
toolPanels: /* @__PURE__ */ new Map(),
|
|
1589
1585
|
headerContents: /* @__PURE__ */ new Map(),
|
|
@@ -1602,24 +1598,24 @@ function li() {
|
|
|
1602
1598
|
lightDomContentMoved: !1
|
|
1603
1599
|
};
|
|
1604
1600
|
}
|
|
1605
|
-
function
|
|
1601
|
+
function nt(t) {
|
|
1606
1602
|
return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
|
|
1607
1603
|
}
|
|
1608
|
-
function
|
|
1604
|
+
function ci(t, e, i = "☰") {
|
|
1609
1605
|
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((h) => h.id)), c = [...s];
|
|
1610
1606
|
for (const h of l)
|
|
1611
1607
|
a.has(h.id) || c.push(h);
|
|
1612
|
-
const d = c.length > 0,
|
|
1608
|
+
const d = c.length > 0, f = e.toolPanels.size > 0, u = d && f, g = [...c].sort((h, w) => (h.order ?? 0) - (w.order ?? 0));
|
|
1613
1609
|
let p = "";
|
|
1614
1610
|
for (const h of g)
|
|
1615
1611
|
p += `<div class="tbw-toolbar-content-slot" data-toolbar-content="${h.id}"></div>`;
|
|
1616
|
-
if (
|
|
1612
|
+
if (u && (p += '<div class="tbw-toolbar-separator"></div>'), f) {
|
|
1617
1613
|
const h = e.isPanelOpen;
|
|
1618
1614
|
p += `<button class="${h ? "tbw-toolbar-btn active" : "tbw-toolbar-btn"}" data-panel-toggle title="Settings" aria-label="Toggle settings panel" aria-pressed="${h}" aria-controls="tbw-tool-panel">${r}</button>`;
|
|
1619
1615
|
}
|
|
1620
1616
|
return `
|
|
1621
1617
|
<div class="tbw-shell-header" part="shell-header" role="presentation">
|
|
1622
|
-
${n ? `<div class="tbw-shell-title">${
|
|
1618
|
+
${n ? `<div class="tbw-shell-title">${mt(o)}</div>` : ""}
|
|
1623
1619
|
<div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
|
|
1624
1620
|
<div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
|
|
1625
1621
|
${p}
|
|
@@ -1627,7 +1623,7 @@ function ai(t, e, i = "☰") {
|
|
|
1627
1623
|
</div>
|
|
1628
1624
|
`;
|
|
1629
1625
|
}
|
|
1630
|
-
function
|
|
1626
|
+
function Me(t, e) {
|
|
1631
1627
|
const i = t.querySelector("tbw-grid-header");
|
|
1632
1628
|
if (!i) return;
|
|
1633
1629
|
if (!e.lightDomTitle) {
|
|
@@ -1637,7 +1633,7 @@ function Oe(t, e) {
|
|
|
1637
1633
|
const o = i.querySelectorAll("tbw-grid-header-content");
|
|
1638
1634
|
o.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(o)), i.style.display = "none";
|
|
1639
1635
|
}
|
|
1640
|
-
function
|
|
1636
|
+
function ke(t, e, i) {
|
|
1641
1637
|
const o = t.querySelector(":scope > tbw-grid-tool-buttons");
|
|
1642
1638
|
if (!o) return;
|
|
1643
1639
|
e.hasToolButtonsContainer = !0;
|
|
@@ -1657,7 +1653,7 @@ function Me(t, e, i) {
|
|
|
1657
1653
|
};
|
|
1658
1654
|
e.toolbarContents.set(n, r), e.lightDomToolbarContentIds.add(n), o.style.display = "none";
|
|
1659
1655
|
}
|
|
1660
|
-
function
|
|
1656
|
+
function Ne(t, e, i) {
|
|
1661
1657
|
t.querySelectorAll(":scope > tbw-grid-tool-panel").forEach((n) => {
|
|
1662
1658
|
const r = n, s = r.getAttribute("id"), l = r.getAttribute("title");
|
|
1663
1659
|
if (!s || !l) {
|
|
@@ -1667,21 +1663,21 @@ function ke(t, e, i) {
|
|
|
1667
1663
|
return;
|
|
1668
1664
|
}
|
|
1669
1665
|
const a = r.getAttribute("icon") ?? void 0, c = r.getAttribute("tooltip") ?? void 0, d = parseInt(r.getAttribute("order") ?? "100", 10);
|
|
1670
|
-
let
|
|
1671
|
-
const
|
|
1672
|
-
if (
|
|
1673
|
-
|
|
1666
|
+
let f;
|
|
1667
|
+
const u = i?.(r);
|
|
1668
|
+
if (u)
|
|
1669
|
+
f = u;
|
|
1674
1670
|
else {
|
|
1675
1671
|
const h = r.innerHTML.trim();
|
|
1676
|
-
|
|
1672
|
+
f = (w) => {
|
|
1677
1673
|
const C = document.createElement("div");
|
|
1678
1674
|
return C.innerHTML = h, w.appendChild(C), () => C.remove();
|
|
1679
1675
|
};
|
|
1680
1676
|
}
|
|
1681
1677
|
const g = e.toolPanels.get(s);
|
|
1682
1678
|
if (g) {
|
|
1683
|
-
if (
|
|
1684
|
-
g.render =
|
|
1679
|
+
if (u) {
|
|
1680
|
+
g.render = f, g.order = d, g.icon = a, g.tooltip = c;
|
|
1685
1681
|
const h = e.panelCleanups.get(s);
|
|
1686
1682
|
h && (h(), e.panelCleanups.delete(s));
|
|
1687
1683
|
}
|
|
@@ -1693,12 +1689,12 @@ function ke(t, e, i) {
|
|
|
1693
1689
|
icon: a,
|
|
1694
1690
|
tooltip: c,
|
|
1695
1691
|
order: d,
|
|
1696
|
-
render:
|
|
1692
|
+
render: f
|
|
1697
1693
|
};
|
|
1698
1694
|
e.toolPanels.set(s, p), e.lightDomToolPanelIds.add(s), r.style.display = "none";
|
|
1699
1695
|
});
|
|
1700
1696
|
}
|
|
1701
|
-
function
|
|
1697
|
+
function di(t, e, i, o) {
|
|
1702
1698
|
const n = t.querySelector(".tbw-shell-toolbar");
|
|
1703
1699
|
n && n.addEventListener("click", (s) => {
|
|
1704
1700
|
if (s.target.closest("[data-panel-toggle]")) {
|
|
@@ -1715,31 +1711,31 @@ function ci(t, e, i, o) {
|
|
|
1715
1711
|
}
|
|
1716
1712
|
});
|
|
1717
1713
|
}
|
|
1718
|
-
function
|
|
1714
|
+
function hi(t, e, i) {
|
|
1719
1715
|
const o = t.querySelector(".tbw-tool-panel"), n = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
|
|
1720
1716
|
if (!o || !n || !r)
|
|
1721
1717
|
return () => {
|
|
1722
1718
|
};
|
|
1723
1719
|
const s = e?.toolPanel?.position ?? "right", l = 200;
|
|
1724
|
-
let a = 0, c = 0, d = 0,
|
|
1725
|
-
const
|
|
1726
|
-
if (!
|
|
1720
|
+
let a = 0, c = 0, d = 0, f = !1;
|
|
1721
|
+
const u = (h) => {
|
|
1722
|
+
if (!f) return;
|
|
1727
1723
|
h.preventDefault();
|
|
1728
1724
|
const w = s === "left" ? h.clientX - a : a - h.clientX, C = Math.min(d, Math.max(l, c + w));
|
|
1729
1725
|
o.style.width = `${C}px`;
|
|
1730
1726
|
}, g = () => {
|
|
1731
|
-
if (!
|
|
1732
|
-
|
|
1727
|
+
if (!f) return;
|
|
1728
|
+
f = !1, n.classList.remove("resizing"), o.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1733
1729
|
const h = o.getBoundingClientRect().width;
|
|
1734
|
-
i(h), document.removeEventListener("mousemove",
|
|
1730
|
+
i(h), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", g);
|
|
1735
1731
|
}, p = (h) => {
|
|
1736
|
-
h.preventDefault(),
|
|
1732
|
+
h.preventDefault(), f = !0, a = h.clientX, c = o.getBoundingClientRect().width, d = r.getBoundingClientRect().width - 20, n.classList.add("resizing"), o.style.transition = "none", document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", u), document.addEventListener("mouseup", g);
|
|
1737
1733
|
};
|
|
1738
1734
|
return n.addEventListener("mousedown", p), () => {
|
|
1739
|
-
n.removeEventListener("mousedown", p), document.removeEventListener("mousemove",
|
|
1735
|
+
n.removeEventListener("mousedown", p), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", g);
|
|
1740
1736
|
};
|
|
1741
1737
|
}
|
|
1742
|
-
function
|
|
1738
|
+
function ce(t, e, i) {
|
|
1743
1739
|
const o = e?.header?.toolbarContents ?? [], n = [...i.toolbarContents.values()], r = new Set(o.map((l) => l.id)), s = [...o];
|
|
1744
1740
|
for (const l of n)
|
|
1745
1741
|
r.has(l.id) || s.push(l);
|
|
@@ -1751,7 +1747,7 @@ function ae(t, e, i) {
|
|
|
1751
1747
|
c && i.toolbarContentCleanups.set(l.id, c);
|
|
1752
1748
|
}
|
|
1753
1749
|
}
|
|
1754
|
-
function
|
|
1750
|
+
function fe(t, e) {
|
|
1755
1751
|
const i = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, o = e.headerContents.size > 0;
|
|
1756
1752
|
if (!i && !o) return;
|
|
1757
1753
|
const n = t.querySelector(".tbw-shell-content");
|
|
@@ -1771,7 +1767,7 @@ function ue(t, e) {
|
|
|
1771
1767
|
c && e.headerContentCleanups.set(s.id, c);
|
|
1772
1768
|
}
|
|
1773
1769
|
}
|
|
1774
|
-
function
|
|
1770
|
+
function ui(t, e, i) {
|
|
1775
1771
|
if (!e.isPanelOpen) return;
|
|
1776
1772
|
const o = N(i?.expand ?? M.expand), n = N(i?.collapse ?? M.collapse);
|
|
1777
1773
|
for (const [r, s] of e.toolPanels) {
|
|
@@ -1780,32 +1776,32 @@ function hi(t, e, i) {
|
|
|
1780
1776
|
a.classList.toggle("expanded", l);
|
|
1781
1777
|
const d = a.querySelector(".tbw-accordion-header");
|
|
1782
1778
|
d && d.setAttribute("aria-expanded", String(l));
|
|
1783
|
-
const
|
|
1784
|
-
if (
|
|
1779
|
+
const f = a.querySelector(".tbw-accordion-chevron");
|
|
1780
|
+
if (f && (f.innerHTML = l ? n : o), l) {
|
|
1785
1781
|
if (c.children.length === 0) {
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1782
|
+
const u = s.render(c);
|
|
1783
|
+
u && e.panelCleanups.set(r, u);
|
|
1788
1784
|
}
|
|
1789
1785
|
} else {
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1786
|
+
const u = e.panelCleanups.get(r);
|
|
1787
|
+
u && (u(), e.panelCleanups.delete(r)), c.innerHTML = "";
|
|
1792
1788
|
}
|
|
1793
1789
|
}
|
|
1794
1790
|
}
|
|
1795
|
-
function
|
|
1791
|
+
function Ie(t, e) {
|
|
1796
1792
|
const i = t.querySelector("[data-panel-toggle]");
|
|
1797
1793
|
i && (i.classList.toggle("active", e.isPanelOpen), i.setAttribute("aria-pressed", String(e.isPanelOpen)));
|
|
1798
1794
|
}
|
|
1799
|
-
function
|
|
1795
|
+
function qe(t, e) {
|
|
1800
1796
|
const i = t.querySelector(".tbw-tool-panel");
|
|
1801
1797
|
i && (i.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (i.style.width = ""));
|
|
1802
1798
|
}
|
|
1803
|
-
function
|
|
1799
|
+
function de(t) {
|
|
1804
1800
|
for (const e of t.toolbarContentCleanups.values())
|
|
1805
1801
|
e();
|
|
1806
1802
|
t.toolbarContentCleanups.clear();
|
|
1807
1803
|
}
|
|
1808
|
-
function
|
|
1804
|
+
function fi(t) {
|
|
1809
1805
|
for (const e of t.headerContentCleanups.values())
|
|
1810
1806
|
e();
|
|
1811
1807
|
t.headerContentCleanups.clear();
|
|
@@ -1822,7 +1818,7 @@ function ui(t) {
|
|
|
1822
1818
|
t.toolPanels.get(e)?.onClose?.();
|
|
1823
1819
|
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;
|
|
1824
1820
|
}
|
|
1825
|
-
function
|
|
1821
|
+
function gi(t, e) {
|
|
1826
1822
|
let i = !1;
|
|
1827
1823
|
const o = {
|
|
1828
1824
|
get isInitialized() {
|
|
@@ -1851,7 +1847,7 @@ function fi(t, e) {
|
|
|
1851
1847
|
s && t.expandedSections.add(s.id);
|
|
1852
1848
|
}
|
|
1853
1849
|
const n = e.getShadow();
|
|
1854
|
-
|
|
1850
|
+
Ie(n, t), qe(n, t), ui(n, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: o.expandedSections });
|
|
1855
1851
|
},
|
|
1856
1852
|
closeToolPanel() {
|
|
1857
1853
|
if (!t.isPanelOpen) return;
|
|
@@ -1862,7 +1858,7 @@ function fi(t, e) {
|
|
|
1862
1858
|
r.onClose?.();
|
|
1863
1859
|
t.isPanelOpen = !1;
|
|
1864
1860
|
const n = e.getShadow();
|
|
1865
|
-
|
|
1861
|
+
Ie(n, t), qe(n, t), e.emit("tool-panel-close", {});
|
|
1866
1862
|
},
|
|
1867
1863
|
toggleToolPanel() {
|
|
1868
1864
|
t.isPanelOpen ? o.closeToolPanel() : o.openToolPanel();
|
|
@@ -1878,16 +1874,16 @@ function fi(t, e) {
|
|
|
1878
1874
|
const s = e.getShadow(), l = t.expandedSections.has(n);
|
|
1879
1875
|
if (l) {
|
|
1880
1876
|
const a = t.panelCleanups.get(n);
|
|
1881
|
-
a && (a(), t.panelCleanups.delete(n)), r.onClose?.(), t.expandedSections.delete(n),
|
|
1877
|
+
a && (a(), t.panelCleanups.delete(n)), r.onClose?.(), t.expandedSections.delete(n), he(s, n, !1);
|
|
1882
1878
|
} else {
|
|
1883
1879
|
for (const [a, c] of t.toolPanels)
|
|
1884
1880
|
if (a !== n && t.expandedSections.has(a)) {
|
|
1885
1881
|
const d = t.panelCleanups.get(a);
|
|
1886
|
-
d && (d(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a),
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1882
|
+
d && (d(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), he(s, a, !1);
|
|
1883
|
+
const f = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
|
|
1884
|
+
f && (f.innerHTML = "");
|
|
1889
1885
|
}
|
|
1890
|
-
t.expandedSections.add(n),
|
|
1886
|
+
t.expandedSections.add(n), he(s, n, !0), pi(s, t, n);
|
|
1891
1887
|
}
|
|
1892
1888
|
e.emit("tool-panel-section-toggle", { id: n, expanded: !l });
|
|
1893
1889
|
},
|
|
@@ -1916,7 +1912,7 @@ function fi(t, e) {
|
|
|
1916
1912
|
console.warn(`[tbw-grid] Header content "${n.id}" already registered`);
|
|
1917
1913
|
return;
|
|
1918
1914
|
}
|
|
1919
|
-
t.headerContents.set(n.id, n), i &&
|
|
1915
|
+
t.headerContents.set(n.id, n), i && fe(e.getShadow(), t);
|
|
1920
1916
|
},
|
|
1921
1917
|
unregisterHeaderContent(n) {
|
|
1922
1918
|
const r = t.headerContentCleanups.get(n);
|
|
@@ -1941,11 +1937,11 @@ function fi(t, e) {
|
|
|
1941
1937
|
};
|
|
1942
1938
|
return o;
|
|
1943
1939
|
}
|
|
1944
|
-
function
|
|
1940
|
+
function he(t, e, i) {
|
|
1945
1941
|
const o = t.querySelector(`[data-section="${e}"]`);
|
|
1946
1942
|
o && o.classList.toggle("expanded", i);
|
|
1947
1943
|
}
|
|
1948
|
-
function
|
|
1944
|
+
function pi(t, e, i) {
|
|
1949
1945
|
const o = e.toolPanels.get(i);
|
|
1950
1946
|
if (!o?.render) return;
|
|
1951
1947
|
const n = t.querySelector(`[data-section="${i}"] .tbw-accordion-content`);
|
|
@@ -1953,8 +1949,8 @@ function gi(t, e, i) {
|
|
|
1953
1949
|
const r = o.render(n);
|
|
1954
1950
|
r && e.panelCleanups.set(i, r);
|
|
1955
1951
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const n =
|
|
1952
|
+
function wi(t, e, i, o) {
|
|
1953
|
+
const n = nt(e), r = [], s = [
|
|
1958
1954
|
"tbw-grid-header",
|
|
1959
1955
|
"tbw-grid-tool-buttons",
|
|
1960
1956
|
"tbw-grid-tool-panel",
|
|
@@ -1968,12 +1964,12 @@ function pi(t, e, i, o) {
|
|
|
1968
1964
|
for (const l of r)
|
|
1969
1965
|
t.appendChild(l);
|
|
1970
1966
|
if (n) {
|
|
1971
|
-
const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse),
|
|
1967
|
+
const l = N(o?.toolPanel ?? M.toolPanel), a = N(o?.expand ?? M.expand), c = N(o?.collapse ?? M.collapse), f = [...e?.header?.toolbarContents ?? []].sort((y, S) => (y.order ?? 0) - (S.order ?? 0)), g = [...e?.toolPanels ?? []].sort((y, S) => (y.order ?? 100) - (S.order ?? 100)), p = {
|
|
1972
1968
|
title: e?.header?.title ?? void 0,
|
|
1973
1969
|
hasPanels: g.length > 0,
|
|
1974
1970
|
isPanelOpen: i.isPanelOpen,
|
|
1975
1971
|
toolPanelIcon: l,
|
|
1976
|
-
configButtons:
|
|
1972
|
+
configButtons: f.map((y) => ({
|
|
1977
1973
|
id: y.id,
|
|
1978
1974
|
hasElement: !1,
|
|
1979
1975
|
hasRender: !!y.render
|
|
@@ -1990,40 +1986,40 @@ function pi(t, e, i, o) {
|
|
|
1990
1986
|
icon: N(y.icon),
|
|
1991
1987
|
isExpanded: i.expandedSections.has(y.id)
|
|
1992
1988
|
}))
|
|
1993
|
-
}, w =
|
|
1989
|
+
}, w = si(p), C = li(h), m = Oe({
|
|
1994
1990
|
hasShell: !0,
|
|
1995
1991
|
shellHeader: w,
|
|
1996
1992
|
shellBody: C
|
|
1997
1993
|
});
|
|
1998
1994
|
t.appendChild(m);
|
|
1999
1995
|
} else {
|
|
2000
|
-
const l =
|
|
1996
|
+
const l = Oe({ hasShell: !1 });
|
|
2001
1997
|
t.appendChild(l);
|
|
2002
1998
|
}
|
|
2003
1999
|
return n;
|
|
2004
2000
|
}
|
|
2005
|
-
const
|
|
2006
|
-
let
|
|
2007
|
-
const
|
|
2008
|
-
function
|
|
2009
|
-
let t = document.getElementById(
|
|
2010
|
-
return t || (t = document.createElement("style"), t.id =
|
|
2001
|
+
const $e = "tbw-grid-styles";
|
|
2002
|
+
let ee = "";
|
|
2003
|
+
const ge = /* @__PURE__ */ new Map();
|
|
2004
|
+
function bi() {
|
|
2005
|
+
let t = document.getElementById($e);
|
|
2006
|
+
return t || (t = document.createElement("style"), t.id = $e, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
|
|
2011
2007
|
}
|
|
2012
|
-
function
|
|
2013
|
-
const t =
|
|
2008
|
+
function pe() {
|
|
2009
|
+
const t = bi(), e = Array.from(ge.values()).join(`
|
|
2014
2010
|
`);
|
|
2015
|
-
t.textContent = `${
|
|
2011
|
+
t.textContent = `${ee}
|
|
2016
2012
|
|
|
2017
2013
|
/* Plugin Styles */
|
|
2018
2014
|
${e}`;
|
|
2019
2015
|
}
|
|
2020
|
-
function
|
|
2016
|
+
function mi(t) {
|
|
2021
2017
|
let e = !1;
|
|
2022
2018
|
for (const { name: i, styles: o } of t)
|
|
2023
|
-
|
|
2024
|
-
return e &&
|
|
2019
|
+
ge.has(i) || (ge.set(i, o), e = !0);
|
|
2020
|
+
return e && pe(), e;
|
|
2025
2021
|
}
|
|
2026
|
-
function
|
|
2022
|
+
function vi() {
|
|
2027
2023
|
try {
|
|
2028
2024
|
for (const t of Array.from(document.styleSheets))
|
|
2029
2025
|
try {
|
|
@@ -2039,22 +2035,22 @@ function mi() {
|
|
|
2039
2035
|
}
|
|
2040
2036
|
return null;
|
|
2041
2037
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
if (
|
|
2038
|
+
async function Ci(t) {
|
|
2039
|
+
if (ee)
|
|
2044
2040
|
return;
|
|
2045
2041
|
if (typeof t == "string" && t.length > 0) {
|
|
2046
|
-
|
|
2042
|
+
ee = t, pe();
|
|
2047
2043
|
return;
|
|
2048
2044
|
}
|
|
2049
2045
|
await new Promise((i) => setTimeout(i, 50));
|
|
2050
|
-
const e =
|
|
2051
|
-
e ? (
|
|
2046
|
+
const e = vi();
|
|
2047
|
+
e ? (ee = e, pe()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
|
|
2052
2048
|
"[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
|
|
2053
2049
|
"Available stylesheets:",
|
|
2054
2050
|
Array.from(document.styleSheets).map((i) => i.href || "(inline)")
|
|
2055
2051
|
);
|
|
2056
2052
|
}
|
|
2057
|
-
function
|
|
2053
|
+
function yi() {
|
|
2058
2054
|
return {
|
|
2059
2055
|
startY: null,
|
|
2060
2056
|
startX: null,
|
|
@@ -2068,19 +2064,19 @@ function Ci() {
|
|
|
2068
2064
|
momentumRaf: 0
|
|
2069
2065
|
};
|
|
2070
2066
|
}
|
|
2071
|
-
function
|
|
2067
|
+
function _i(t) {
|
|
2072
2068
|
t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
|
|
2073
2069
|
}
|
|
2074
|
-
function
|
|
2070
|
+
function rt(t) {
|
|
2075
2071
|
t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
|
|
2076
2072
|
}
|
|
2077
|
-
function
|
|
2073
|
+
function Ei(t, e, i) {
|
|
2078
2074
|
if (t.touches.length !== 1) return;
|
|
2079
|
-
|
|
2075
|
+
rt(e);
|
|
2080
2076
|
const o = t.touches[0];
|
|
2081
2077
|
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;
|
|
2082
2078
|
}
|
|
2083
|
-
function
|
|
2079
|
+
function Si(t, e, i) {
|
|
2084
2080
|
if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
|
|
2085
2081
|
return !1;
|
|
2086
2082
|
const o = t.touches[0], n = o.clientY, r = o.clientX, s = performance.now(), l = e.startY - n, a = e.startX - r;
|
|
@@ -2089,7 +2085,7 @@ function Ei(t, e, i) {
|
|
|
2089
2085
|
h > 0 && (e.velocityY = (e.lastY - n) / h, e.velocityX = (e.lastX - r) / h);
|
|
2090
2086
|
}
|
|
2091
2087
|
e.lastY = n, e.lastX = r, e.lastTime = s;
|
|
2092
|
-
const { scrollTop: c, scrollHeight: d, clientHeight:
|
|
2088
|
+
const { scrollTop: c, scrollHeight: d, clientHeight: f } = i.fauxScrollbar, u = d - f, g = l > 0 && c < u || l < 0 && c > 0;
|
|
2093
2089
|
let p = !1;
|
|
2094
2090
|
if (i.scrollArea) {
|
|
2095
2091
|
const { scrollLeft: h, scrollWidth: w, clientWidth: C } = i.scrollArea, m = w - C;
|
|
@@ -2097,10 +2093,10 @@ function Ei(t, e, i) {
|
|
|
2097
2093
|
}
|
|
2098
2094
|
return g && (i.fauxScrollbar.scrollTop = e.scrollTop + l), p && i.scrollArea && (i.scrollArea.scrollLeft = e.scrollLeft + a), g || p;
|
|
2099
2095
|
}
|
|
2100
|
-
function Si(t, e) {
|
|
2101
|
-
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Ri(t, e), yi(t);
|
|
2102
|
-
}
|
|
2103
2096
|
function Ri(t, e) {
|
|
2097
|
+
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Ai(t, e), _i(t);
|
|
2098
|
+
}
|
|
2099
|
+
function Ai(t, e) {
|
|
2104
2100
|
const n = () => {
|
|
2105
2101
|
t.velocityY *= 0.95, t.velocityX *= 0.95;
|
|
2106
2102
|
const r = t.velocityY * 16, s = t.velocityX * 16;
|
|
@@ -2108,133 +2104,110 @@ function Ri(t, e) {
|
|
|
2108
2104
|
};
|
|
2109
2105
|
t.momentumRaf = requestAnimationFrame(n);
|
|
2110
2106
|
}
|
|
2111
|
-
function
|
|
2112
|
-
t.addEventListener("touchstart", (n) =>
|
|
2107
|
+
function Ti(t, e, i, o) {
|
|
2108
|
+
t.addEventListener("touchstart", (n) => Ei(n, e, i), {
|
|
2113
2109
|
passive: !0,
|
|
2114
2110
|
signal: o
|
|
2115
2111
|
}), t.addEventListener(
|
|
2116
2112
|
"touchmove",
|
|
2117
2113
|
(n) => {
|
|
2118
|
-
|
|
2114
|
+
Si(n, e, i) && n.preventDefault();
|
|
2119
2115
|
},
|
|
2120
2116
|
{ passive: !1, signal: o }
|
|
2121
|
-
), t.addEventListener("touchend", () =>
|
|
2117
|
+
), t.addEventListener("touchend", () => Ri(e, i), { passive: !0, signal: o });
|
|
2122
2118
|
}
|
|
2123
|
-
const
|
|
2119
|
+
const xi = [
|
|
2124
2120
|
{
|
|
2125
2121
|
property: "editable",
|
|
2126
2122
|
pluginName: "editing",
|
|
2127
2123
|
level: "column",
|
|
2128
2124
|
description: 'the "editable" column property',
|
|
2129
|
-
importHint: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
|
|
2130
2125
|
isUsed: (t) => t === !0
|
|
2131
2126
|
},
|
|
2132
2127
|
{
|
|
2133
2128
|
property: "editor",
|
|
2134
2129
|
pluginName: "editing",
|
|
2135
2130
|
level: "column",
|
|
2136
|
-
description: 'the "editor" column property'
|
|
2137
|
-
importHint: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';"
|
|
2131
|
+
description: 'the "editor" column property'
|
|
2138
2132
|
},
|
|
2139
2133
|
{
|
|
2140
2134
|
property: "editorParams",
|
|
2141
2135
|
pluginName: "editing",
|
|
2142
2136
|
level: "column",
|
|
2143
|
-
description: 'the "editorParams" column property'
|
|
2144
|
-
importHint: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';"
|
|
2137
|
+
description: 'the "editorParams" column property'
|
|
2145
2138
|
},
|
|
2146
2139
|
{
|
|
2147
2140
|
property: "group",
|
|
2148
2141
|
pluginName: "groupingColumns",
|
|
2149
2142
|
level: "column",
|
|
2150
|
-
description: 'the "group" column property'
|
|
2151
|
-
importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';"
|
|
2143
|
+
description: 'the "group" column property'
|
|
2152
2144
|
},
|
|
2153
2145
|
{
|
|
2154
2146
|
property: "sticky",
|
|
2155
2147
|
pluginName: "pinnedColumns",
|
|
2156
2148
|
level: "column",
|
|
2157
2149
|
description: 'the "sticky" column property',
|
|
2158
|
-
importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
|
|
2159
2150
|
isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
|
|
2160
2151
|
}
|
|
2161
|
-
],
|
|
2152
|
+
], Hi = [
|
|
2162
2153
|
{
|
|
2163
2154
|
property: "columnGroups",
|
|
2164
2155
|
pluginName: "groupingColumns",
|
|
2165
2156
|
level: "config",
|
|
2166
2157
|
description: 'the "columnGroups" config property',
|
|
2167
|
-
importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
|
|
2168
2158
|
isUsed: (t) => Array.isArray(t) && t.length > 0
|
|
2169
2159
|
}
|
|
2170
|
-
]
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
multiSort: "import { MultiSortPlugin } from '@toolbox-web/grid/plugins/multi-sort';",
|
|
2177
|
-
groupingRows: "import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';",
|
|
2178
|
-
groupingColumns: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
|
|
2179
|
-
tree: "import { TreePlugin } from '@toolbox-web/grid/plugins/tree';",
|
|
2180
|
-
masterDetail: "import { MasterDetailPlugin } from '@toolbox-web/grid/plugins/master-detail';",
|
|
2181
|
-
pinnedColumns: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
|
|
2182
|
-
pinnedRows: "import { PinnedRowsPlugin } from '@toolbox-web/grid/plugins/pinned-rows';",
|
|
2183
|
-
visibility: "import { VisibilityPlugin } from '@toolbox-web/grid/plugins/visibility';",
|
|
2184
|
-
undoRedo: "import { UndoRedoPlugin } from '@toolbox-web/grid/plugins/undo-redo';",
|
|
2185
|
-
export: "import { ExportPlugin } from '@toolbox-web/grid/plugins/export';",
|
|
2186
|
-
contextMenu: "import { ContextMenuPlugin } from '@toolbox-web/grid/plugins/context-menu';",
|
|
2187
|
-
pivot: "import { PivotPlugin } from '@toolbox-web/grid/plugins/pivot';",
|
|
2188
|
-
serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
|
|
2189
|
-
columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
|
|
2190
|
-
};
|
|
2191
|
-
function pe(t) {
|
|
2192
|
-
return Hi[t] ?? `import { ${z(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
|
|
2160
|
+
];
|
|
2161
|
+
function Li(t) {
|
|
2162
|
+
return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
2163
|
+
}
|
|
2164
|
+
function we(t) {
|
|
2165
|
+
return `import { ${z(t)}Plugin } from '@toolbox-web/grid/plugins/${Li(t)}';`;
|
|
2193
2166
|
}
|
|
2194
2167
|
function z(t) {
|
|
2195
2168
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
2196
2169
|
}
|
|
2197
|
-
function
|
|
2170
|
+
function We(t, e) {
|
|
2198
2171
|
return t.some((i) => i.name === e);
|
|
2199
2172
|
}
|
|
2200
2173
|
function Pi(t, e) {
|
|
2201
|
-
const i =
|
|
2202
|
-
function r(l, a, c, d,
|
|
2203
|
-
n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty:
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2174
|
+
const i = xi, o = Hi, n = /* @__PURE__ */ new Map();
|
|
2175
|
+
function r(l, a, c, d, f = !1) {
|
|
2176
|
+
n.has(l) || n.set(l, { description: a, importHint: c, fields: [], isConfigProperty: f });
|
|
2177
|
+
const u = n.get(l);
|
|
2178
|
+
u.fields.includes(d) || u.fields.push(d);
|
|
2206
2179
|
}
|
|
2207
2180
|
for (const l of o) {
|
|
2208
2181
|
const a = t[l.property];
|
|
2209
|
-
(l.isUsed ? l.isUsed(a) : a !== void 0) &&
|
|
2182
|
+
(l.isUsed ? l.isUsed(a) : a !== void 0) && !We(e, l.pluginName) && r(l.pluginName, l.description, we(l.pluginName), l.property, !0);
|
|
2210
2183
|
}
|
|
2211
2184
|
const s = t.columns;
|
|
2212
2185
|
if (s && s.length > 0)
|
|
2213
2186
|
for (const l of s)
|
|
2214
2187
|
for (const a of i) {
|
|
2215
2188
|
const c = l[a.property];
|
|
2216
|
-
if ((a.isUsed ? a.isUsed(c) : c !== void 0) &&
|
|
2217
|
-
const
|
|
2218
|
-
r(a.pluginName, a.description,
|
|
2189
|
+
if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !We(e, a.pluginName)) {
|
|
2190
|
+
const f = l.field || "<unknown>";
|
|
2191
|
+
r(a.pluginName, a.description, we(a.pluginName), f);
|
|
2219
2192
|
}
|
|
2220
2193
|
}
|
|
2221
2194
|
if (n.size > 0) {
|
|
2222
2195
|
const l = [];
|
|
2223
|
-
for (const [a, { description: c, importHint: d, fields:
|
|
2224
|
-
if (
|
|
2196
|
+
for (const [a, { description: c, importHint: d, fields: f, isConfigProperty: u }] of n)
|
|
2197
|
+
if (u)
|
|
2225
2198
|
l.push(
|
|
2226
2199
|
`Config uses ${c}, but the required plugin is not loaded.
|
|
2227
2200
|
→ Add the plugin to your gridConfig.plugins array:
|
|
2228
2201
|
${d}
|
|
2229
|
-
plugins: [new ${
|
|
2202
|
+
plugins: [new ${z(a)}Plugin(), ...]`
|
|
2230
2203
|
);
|
|
2231
2204
|
else {
|
|
2232
|
-
const g =
|
|
2205
|
+
const g = f.slice(0, 3).join(", ") + (f.length > 3 ? `, ... (${f.length} total)` : "");
|
|
2233
2206
|
l.push(
|
|
2234
2207
|
`Column(s) [${g}] use ${c}, but the required plugin is not loaded.
|
|
2235
2208
|
→ Add the plugin to your gridConfig.plugins array:
|
|
2236
2209
|
${d}
|
|
2237
|
-
plugins: [new ${
|
|
2210
|
+
plugins: [new ${z(a)}Plugin(), ...]`
|
|
2238
2211
|
);
|
|
2239
2212
|
}
|
|
2240
2213
|
throw new Error(
|
|
@@ -2248,7 +2221,7 @@ This validation helps catch misconfigurations early. The properties listed above
|
|
|
2248
2221
|
);
|
|
2249
2222
|
}
|
|
2250
2223
|
}
|
|
2251
|
-
function
|
|
2224
|
+
function zi(t) {
|
|
2252
2225
|
const e = [], i = [];
|
|
2253
2226
|
for (const o of t) {
|
|
2254
2227
|
const r = o.constructor.manifest;
|
|
@@ -2261,7 +2234,7 @@ function Li(t) {
|
|
|
2261
2234
|
}
|
|
2262
2235
|
}
|
|
2263
2236
|
}
|
|
2264
|
-
if (i.length > 0 &&
|
|
2237
|
+
if (i.length > 0 && me())
|
|
2265
2238
|
for (const o of i)
|
|
2266
2239
|
console.warn(o);
|
|
2267
2240
|
if (e.length > 0)
|
|
@@ -2271,12 +2244,12 @@ ${e.join(`
|
|
|
2271
2244
|
|
|
2272
2245
|
`)}`);
|
|
2273
2246
|
}
|
|
2274
|
-
function
|
|
2247
|
+
function Di(t, e) {
|
|
2275
2248
|
const i = t.name, n = t.constructor.dependencies ?? [];
|
|
2276
2249
|
for (const r of n) {
|
|
2277
2250
|
const s = r.name, l = r.required ?? !0, a = r.reason;
|
|
2278
2251
|
if (!e.some((d) => d.name === s)) {
|
|
2279
|
-
const d = a ?? `${z(i)}Plugin requires ${z(s)}Plugin`,
|
|
2252
|
+
const d = a ?? `${z(i)}Plugin requires ${z(s)}Plugin`, f = we(s);
|
|
2280
2253
|
if (l)
|
|
2281
2254
|
throw new Error(
|
|
2282
2255
|
`[tbw-grid] Plugin dependency error:
|
|
@@ -2284,7 +2257,7 @@ function zi(t, e) {
|
|
|
2284
2257
|
${d}.
|
|
2285
2258
|
|
|
2286
2259
|
→ Add the plugin to your gridConfig.plugins array BEFORE ${z(i)}Plugin:
|
|
2287
|
-
${
|
|
2260
|
+
${f}
|
|
2288
2261
|
plugins: [new ${z(s)}Plugin(), new ${z(i)}Plugin()]`
|
|
2289
2262
|
);
|
|
2290
2263
|
console.info(
|
|
@@ -2293,8 +2266,8 @@ ${d}.
|
|
|
2293
2266
|
}
|
|
2294
2267
|
}
|
|
2295
2268
|
}
|
|
2296
|
-
function
|
|
2297
|
-
if (!
|
|
2269
|
+
function Oi(t) {
|
|
2270
|
+
if (!me()) return;
|
|
2298
2271
|
const e = new Set(t.map((o) => o.name)), i = /* @__PURE__ */ new Set();
|
|
2299
2272
|
for (const o of t) {
|
|
2300
2273
|
const r = o.constructor.manifest;
|
|
@@ -2316,31 +2289,31 @@ ${z(o.name)}Plugin and ${z(s.name)}Plugin are both loaded, but they are currentl
|
|
|
2316
2289
|
}
|
|
2317
2290
|
}
|
|
2318
2291
|
}
|
|
2319
|
-
function
|
|
2292
|
+
function st(t, e) {
|
|
2320
2293
|
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;
|
|
2321
2294
|
}
|
|
2322
|
-
function
|
|
2323
|
-
const o =
|
|
2295
|
+
function Mi(t, e, i) {
|
|
2296
|
+
const o = st(e, i);
|
|
2324
2297
|
if (typeof o == "string")
|
|
2325
2298
|
return t.byKey.get(o);
|
|
2326
2299
|
if (o && typeof o == "object")
|
|
2327
2300
|
return t.byRef.get(o);
|
|
2328
2301
|
}
|
|
2329
|
-
function
|
|
2330
|
-
const n =
|
|
2302
|
+
function ki(t, e, i, o) {
|
|
2303
|
+
const n = st(e, o);
|
|
2331
2304
|
typeof n == "string" ? t.byKey.set(n, i) : n && typeof n == "object" && t.byRef.set(n, i);
|
|
2332
2305
|
}
|
|
2333
|
-
function
|
|
2306
|
+
function Ni(t, e, i, o, n) {
|
|
2334
2307
|
const r = new Array(t.length);
|
|
2335
2308
|
let s = 0;
|
|
2336
2309
|
for (let l = 0; l < t.length; l++) {
|
|
2337
2310
|
const a = t[l];
|
|
2338
2311
|
let c = n?.(a, l), d = c !== void 0;
|
|
2339
|
-
c === void 0 && (c =
|
|
2312
|
+
c === void 0 && (c = Mi(e, a, o.rowId), d = c !== void 0), c === void 0 && (c = i, d = !1), r[l] = { offset: s, height: c, measured: d }, s += c;
|
|
2340
2313
|
}
|
|
2341
2314
|
return r;
|
|
2342
2315
|
}
|
|
2343
|
-
function
|
|
2316
|
+
function be(t, e, i) {
|
|
2344
2317
|
if (e < 0 || e >= t.length) return;
|
|
2345
2318
|
const o = t[e], n = i - o.height;
|
|
2346
2319
|
if (n !== 0) {
|
|
@@ -2349,12 +2322,12 @@ function we(t, e, i) {
|
|
|
2349
2322
|
t[r].offset += n;
|
|
2350
2323
|
}
|
|
2351
2324
|
}
|
|
2352
|
-
function
|
|
2325
|
+
function Ii(t) {
|
|
2353
2326
|
if (t.length === 0) return 0;
|
|
2354
2327
|
const e = t[t.length - 1];
|
|
2355
2328
|
return e.offset + e.height;
|
|
2356
2329
|
}
|
|
2357
|
-
function
|
|
2330
|
+
function Fe(t, e) {
|
|
2358
2331
|
if (t.length === 0) return -1;
|
|
2359
2332
|
if (e <= 0) return 0;
|
|
2360
2333
|
let i = 0, o = t.length - 1;
|
|
@@ -2369,42 +2342,42 @@ function We(t, e) {
|
|
|
2369
2342
|
}
|
|
2370
2343
|
return Math.max(0, Math.min(i, t.length - 1));
|
|
2371
2344
|
}
|
|
2372
|
-
function
|
|
2345
|
+
function qi(t, e) {
|
|
2373
2346
|
let i = 0, o = 0;
|
|
2374
2347
|
for (const n of t)
|
|
2375
2348
|
n.measured && (i += n.height, o++);
|
|
2376
2349
|
return o > 0 ? i / o : e;
|
|
2377
2350
|
}
|
|
2378
|
-
function
|
|
2351
|
+
function $i(t) {
|
|
2379
2352
|
let e = 0;
|
|
2380
2353
|
for (const i of t)
|
|
2381
2354
|
i.measured && e++;
|
|
2382
2355
|
return e;
|
|
2383
2356
|
}
|
|
2384
|
-
function
|
|
2357
|
+
function Wi(t, e) {
|
|
2385
2358
|
const { positionCache: i, heightCache: o, rows: n, start: r, end: s, getPluginHeight: l, getRowId: a } = t;
|
|
2386
2359
|
let c = !1;
|
|
2387
|
-
e.forEach((
|
|
2388
|
-
const g =
|
|
2360
|
+
e.forEach((u) => {
|
|
2361
|
+
const g = u.dataset.rowIndex;
|
|
2389
2362
|
if (!g) return;
|
|
2390
2363
|
const p = parseInt(g, 10);
|
|
2391
2364
|
if (p < r || p >= s || p >= n.length) return;
|
|
2392
2365
|
const h = n[p], w = l?.(h, p);
|
|
2393
2366
|
if (w !== void 0) {
|
|
2394
2367
|
const m = i[p];
|
|
2395
|
-
(!m.measured || Math.abs(m.height - w) > 1) && (
|
|
2368
|
+
(!m.measured || Math.abs(m.height - w) > 1) && (be(i, p, w), c = !0);
|
|
2396
2369
|
return;
|
|
2397
2370
|
}
|
|
2398
|
-
const C =
|
|
2371
|
+
const C = u.offsetHeight;
|
|
2399
2372
|
if (C > 0) {
|
|
2400
2373
|
const m = i[p];
|
|
2401
|
-
(!m.measured || Math.abs(m.height - C) > 1) && (
|
|
2374
|
+
(!m.measured || Math.abs(m.height - C) > 1) && (be(i, p, C), ki(o, h, C, a), c = !0);
|
|
2402
2375
|
}
|
|
2403
2376
|
});
|
|
2404
|
-
const d = c ?
|
|
2405
|
-
return { hasChanges: c, measuredCount: d, averageHeight:
|
|
2377
|
+
const d = c ? $i(i) : 0, f = c ? qi(i, t.defaultHeight) : 0;
|
|
2378
|
+
return { hasChanges: c, measuredCount: d, averageHeight: f };
|
|
2406
2379
|
}
|
|
2407
|
-
function
|
|
2380
|
+
function Fi(t, e, i, o) {
|
|
2408
2381
|
let n = 0, r = 0;
|
|
2409
2382
|
for (let s = 0; s < t.length; s++) {
|
|
2410
2383
|
const l = t[s];
|
|
@@ -2415,7 +2388,7 @@ function Wi(t, e, i, o) {
|
|
|
2415
2388
|
averageHeight: n > 0 ? r / n : i
|
|
2416
2389
|
};
|
|
2417
2390
|
}
|
|
2418
|
-
function
|
|
2391
|
+
function to(t) {
|
|
2419
2392
|
const { totalRows: e, viewportHeight: i, scrollTop: o, rowHeight: n, overscan: r } = t, s = Math.ceil(i / n);
|
|
2420
2393
|
let l = Math.floor(o / n) - r;
|
|
2421
2394
|
l < 0 && (l = 0);
|
|
@@ -2427,10 +2400,10 @@ function eo(t) {
|
|
|
2427
2400
|
totalHeight: e * n
|
|
2428
2401
|
};
|
|
2429
2402
|
}
|
|
2430
|
-
function
|
|
2403
|
+
function io(t, e) {
|
|
2431
2404
|
return t <= e;
|
|
2432
2405
|
}
|
|
2433
|
-
class
|
|
2406
|
+
class oe {
|
|
2434
2407
|
constructor(e) {
|
|
2435
2408
|
this.grid = e;
|
|
2436
2409
|
}
|
|
@@ -2450,7 +2423,7 @@ class ie {
|
|
|
2450
2423
|
this.attach(i);
|
|
2451
2424
|
}
|
|
2452
2425
|
attach(e) {
|
|
2453
|
-
if (
|
|
2426
|
+
if (Di(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
|
|
2454
2427
|
for (const [i, o] of Object.entries(e.cellRenderers))
|
|
2455
2428
|
this.cellRenderers.set(i, o);
|
|
2456
2429
|
if (e.headerRenderers)
|
|
@@ -2473,9 +2446,9 @@ class ie {
|
|
|
2473
2446
|
}
|
|
2474
2447
|
warnDeprecatedHooks(e) {
|
|
2475
2448
|
const i = e.constructor;
|
|
2476
|
-
if (
|
|
2449
|
+
if (oe.deprecationWarned.has(i) || !me()) return;
|
|
2477
2450
|
const o = typeof e.getExtraHeight == "function" || typeof e.getExtraHeightBefore == "function", n = typeof e.getRowHeight == "function";
|
|
2478
|
-
o && !n && (
|
|
2451
|
+
o && !n && (oe.deprecationWarned.add(i), console.warn(
|
|
2479
2452
|
`[tbw-grid] Deprecation warning: "${e.name}" uses getExtraHeight() / getExtraHeightBefore() which are deprecated and will be removed in v3.0.
|
|
2480
2453
|
→ Migrate to getRowHeight(row, index) for better variable row height support.
|
|
2481
2454
|
→ See: https://toolbox-web.dev/docs/grid/plugins/migration#row-height-hooks`
|
|
@@ -2715,7 +2688,7 @@ class ie {
|
|
|
2715
2688
|
return e.sort((i, o) => (i.content.order ?? 0) - (o.content.order ?? 0));
|
|
2716
2689
|
}
|
|
2717
2690
|
}
|
|
2718
|
-
const Fi = "@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}}", Ui = '@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)}}}', Vi = '@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}}}}}', Gi = '@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;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);content:"";position:absolute;left:var(--tbw-spacing-md);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:11}}.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:10;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:11}}}', Bi = "@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}}}}", Xi = "@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}}}", Yi = "@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}}}", Ki = "@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: var(--tbw-spacing-xs) var(--tbw-spacing-md);--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-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid 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: 2px solid 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)}}", Qi = `/**
|
|
2691
|
+
const Ui = "@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}}", Vi = '@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)}}}', Bi = '@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}}}}}', Gi = '@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;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);content:"";position:absolute;left:var(--tbw-spacing-md);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:11}}.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:10;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:11}}}', Xi = "@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}}}}", Yi = "@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}}}", Ki = "@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}}}", Qi = "@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-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid 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: 2px solid 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)}}", Zi = `/**
|
|
2719
2692
|
* tbw-grid Light DOM Styles
|
|
2720
2693
|
*
|
|
2721
2694
|
* This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
|
|
@@ -2734,19 +2707,19 @@ const Fi = "@layer tbw-base{tbw-grid{.tbw-expanding{animation:tbw-expand var(--t
|
|
|
2734
2707
|
/* Declare layer order - earlier layers have lower priority */
|
|
2735
2708
|
@layer tbw-base, tbw-plugins, tbw-theme;
|
|
2736
2709
|
|
|
2737
|
-
${
|
|
2738
|
-
${Ui}
|
|
2710
|
+
${Qi}
|
|
2739
2711
|
${Vi}
|
|
2740
|
-
${
|
|
2712
|
+
${Bi}
|
|
2741
2713
|
${Yi}
|
|
2742
2714
|
${ji}
|
|
2715
|
+
${Ki}
|
|
2743
2716
|
${Gi}
|
|
2744
|
-
${
|
|
2745
|
-
${
|
|
2717
|
+
${Ui}
|
|
2718
|
+
${Xi}
|
|
2746
2719
|
`;
|
|
2747
2720
|
class k extends HTMLElement {
|
|
2748
2721
|
static tagName = "tbw-grid";
|
|
2749
|
-
static version = "1.
|
|
2722
|
+
static version = "1.13.0";
|
|
2750
2723
|
static #l = 0;
|
|
2751
2724
|
static adapters = [];
|
|
2752
2725
|
static registerAdapter(e) {
|
|
@@ -2783,10 +2756,10 @@ class k extends HTMLElement {
|
|
|
2783
2756
|
#C = 0;
|
|
2784
2757
|
#r = null;
|
|
2785
2758
|
#g = !1;
|
|
2786
|
-
#
|
|
2759
|
+
#T = !1;
|
|
2787
2760
|
#m = 0;
|
|
2788
2761
|
#z;
|
|
2789
|
-
#k =
|
|
2762
|
+
#k = yi();
|
|
2790
2763
|
#b;
|
|
2791
2764
|
#y;
|
|
2792
2765
|
#p;
|
|
@@ -2806,16 +2779,16 @@ class k extends HTMLElement {
|
|
|
2806
2779
|
#V;
|
|
2807
2780
|
#O;
|
|
2808
2781
|
#t;
|
|
2809
|
-
#i =
|
|
2782
|
+
#i = ai();
|
|
2810
2783
|
#c;
|
|
2811
2784
|
#I;
|
|
2812
2785
|
#q = !1;
|
|
2813
|
-
#
|
|
2786
|
+
#x = /* @__PURE__ */ new Set();
|
|
2814
2787
|
#H = /* @__PURE__ */ new Map();
|
|
2815
2788
|
#$;
|
|
2816
2789
|
#S = /* @__PURE__ */ new Map();
|
|
2817
2790
|
_rows = [];
|
|
2818
|
-
#
|
|
2791
|
+
#B = [];
|
|
2819
2792
|
get _columns() {
|
|
2820
2793
|
return this.#o.columns ?? [];
|
|
2821
2794
|
}
|
|
@@ -2847,7 +2820,9 @@ class k extends HTMLElement {
|
|
|
2847
2820
|
measuredCount: 0,
|
|
2848
2821
|
variableHeights: !1,
|
|
2849
2822
|
cachedViewportHeight: 0,
|
|
2850
|
-
cachedFauxHeight: 0
|
|
2823
|
+
cachedFauxHeight: 0,
|
|
2824
|
+
cachedScrollAreaHeight: 0,
|
|
2825
|
+
scrollAreaEl: null
|
|
2851
2826
|
};
|
|
2852
2827
|
_focusRow = 0;
|
|
2853
2828
|
_focusCol = 0;
|
|
@@ -2907,11 +2882,11 @@ class k extends HTMLElement {
|
|
|
2907
2882
|
}
|
|
2908
2883
|
set loading(e) {
|
|
2909
2884
|
const i = this.#q;
|
|
2910
|
-
this.#q = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#
|
|
2885
|
+
this.#q = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), i !== e && this.#Pe();
|
|
2911
2886
|
}
|
|
2912
2887
|
setRowLoading(e, i) {
|
|
2913
|
-
const o = this.#
|
|
2914
|
-
i ? this.#
|
|
2888
|
+
const o = this.#x.has(e);
|
|
2889
|
+
i ? this.#x.add(e) : this.#x.delete(e), o !== i && this.#de(e, i);
|
|
2915
2890
|
}
|
|
2916
2891
|
setCellLoading(e, i, o) {
|
|
2917
2892
|
let n = this.#H.get(e);
|
|
@@ -2919,16 +2894,16 @@ class k extends HTMLElement {
|
|
|
2919
2894
|
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.#he(e, i, o);
|
|
2920
2895
|
}
|
|
2921
2896
|
isRowLoading(e) {
|
|
2922
|
-
return this.#
|
|
2897
|
+
return this.#x.has(e);
|
|
2923
2898
|
}
|
|
2924
2899
|
isCellLoading(e, i) {
|
|
2925
2900
|
return this.#H.get(e)?.has(i) ?? !1;
|
|
2926
2901
|
}
|
|
2927
2902
|
clearAllLoading() {
|
|
2928
2903
|
this.loading = !1;
|
|
2929
|
-
for (const e of this.#
|
|
2904
|
+
for (const e of this.#x)
|
|
2930
2905
|
this.#de(e, !1);
|
|
2931
|
-
this.#
|
|
2906
|
+
this.#x.clear();
|
|
2932
2907
|
for (const [e, i] of this.#H)
|
|
2933
2908
|
for (const o of i)
|
|
2934
2909
|
this.#he(e, o, !1);
|
|
@@ -2941,53 +2916,53 @@ class k extends HTMLElement {
|
|
|
2941
2916
|
return this.#b || (this.#b = new AbortController()), this.#b.signal;
|
|
2942
2917
|
}
|
|
2943
2918
|
constructor() {
|
|
2944
|
-
super(), this.#we(), this.#d = new Promise((e) => this.#h = e), this.#s = new
|
|
2919
|
+
super(), this.#we(), this.#d = new Promise((e) => this.#h = e), this.#s = new Zt({
|
|
2945
2920
|
mergeConfig: () => {
|
|
2946
|
-
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), Pi(this.#o, this.#e?.getPlugins() ?? []),
|
|
2921
|
+
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), Pi(this.#o, this.#e?.getPlugins() ?? []), zi(this.#e?.getPlugins() ?? []), Oi(this.#e?.getPlugins() ?? []), this.#Le(), this.#B = [...this._columns];
|
|
2947
2922
|
},
|
|
2948
|
-
processColumns: () => this.#
|
|
2949
|
-
processRows: () => this.#
|
|
2950
|
-
renderHeader: () =>
|
|
2951
|
-
updateTemplate: () =>
|
|
2923
|
+
processColumns: () => this.#Te(),
|
|
2924
|
+
processRows: () => this.#xe(),
|
|
2925
|
+
renderHeader: () => ie(this),
|
|
2926
|
+
updateTemplate: () => U(this),
|
|
2952
2927
|
renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
|
|
2953
2928
|
afterRender: () => {
|
|
2954
2929
|
this.#e?.afterRender(), this._virtualization.enabled && this._virtualization.totalHeightEl && queueMicrotask(() => {
|
|
2955
2930
|
if (!this._virtualization.totalHeightEl) return;
|
|
2956
|
-
const i = this.#
|
|
2931
|
+
const i = this.#A(this._rows.length);
|
|
2957
2932
|
this._virtualization.totalHeightEl.style.height = `${i}px`;
|
|
2958
|
-
}), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0,
|
|
2933
|
+
}), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, Se(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, q(this)), this._virtualization.enabled && !this.#F && this.#ve(), this.#T && (this.#T = !1, requestAnimationFrame(() => {
|
|
2959
2934
|
requestAnimationFrame(() => {
|
|
2960
2935
|
this.#me();
|
|
2961
2936
|
});
|
|
2962
2937
|
}));
|
|
2963
2938
|
},
|
|
2964
2939
|
isConnected: () => this.isConnected && this.#f
|
|
2965
|
-
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c =
|
|
2940
|
+
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = gi(this.#i, {
|
|
2966
2941
|
getShadow: () => this.#n,
|
|
2967
2942
|
getShellConfig: () => this.#o?.shell,
|
|
2968
2943
|
getAccordionIcons: () => ({
|
|
2969
2944
|
expand: this.#o?.icons?.expand ?? M.expand,
|
|
2970
2945
|
collapse: this.#o?.icons?.collapse ?? M.collapse
|
|
2971
2946
|
}),
|
|
2972
|
-
emit: (e, i) => this.#
|
|
2947
|
+
emit: (e, i) => this.#L(e, i),
|
|
2973
2948
|
refreshShellHeader: () => this.refreshShellHeader()
|
|
2974
|
-
}), this.#t = new
|
|
2949
|
+
}), this.#t = new Tt({
|
|
2975
2950
|
getRows: () => this.#a,
|
|
2976
2951
|
getSortState: () => this._sortState,
|
|
2977
2952
|
setSortState: (e) => {
|
|
2978
2953
|
this._sortState = e;
|
|
2979
2954
|
},
|
|
2980
2955
|
onConfigChange: () => {
|
|
2981
|
-
this.#s.requestPhase(
|
|
2956
|
+
this.#s.requestPhase(x.FULL, "configChange");
|
|
2982
2957
|
},
|
|
2983
|
-
emit: (e, i) => this.#
|
|
2958
|
+
emit: (e, i) => this.#L(e, i),
|
|
2984
2959
|
clearRowPool: () => {
|
|
2985
2960
|
this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
|
|
2986
2961
|
},
|
|
2987
|
-
setup: () => this.#
|
|
2988
|
-
renderHeader: () =>
|
|
2989
|
-
updateTemplate: () =>
|
|
2990
|
-
refreshVirtualWindow: () => this.#s.requestPhase(
|
|
2962
|
+
setup: () => this.#P(),
|
|
2963
|
+
renderHeader: () => ie(this),
|
|
2964
|
+
updateTemplate: () => U(this),
|
|
2965
|
+
refreshVirtualWindow: () => this.#s.requestPhase(x.VIRTUALIZATION, "configManager"),
|
|
2991
2966
|
getVirtualization: () => this._virtualization,
|
|
2992
2967
|
setRowHeight: (e) => {
|
|
2993
2968
|
this._virtualization.rowHeight = e;
|
|
@@ -3002,7 +2977,7 @@ class k extends HTMLElement {
|
|
|
3002
2977
|
});
|
|
3003
2978
|
}
|
|
3004
2979
|
async #we() {
|
|
3005
|
-
await
|
|
2980
|
+
await Ci(Zi);
|
|
3006
2981
|
}
|
|
3007
2982
|
getPlugin(e) {
|
|
3008
2983
|
return this.#e?.getPlugin(e);
|
|
@@ -3011,28 +2986,28 @@ class k extends HTMLElement {
|
|
|
3011
2986
|
return this.#e?.getPluginByName(e);
|
|
3012
2987
|
}
|
|
3013
2988
|
requestRender() {
|
|
3014
|
-
this.#s.requestPhase(
|
|
2989
|
+
this.#s.requestPhase(x.ROWS, "plugin:requestRender");
|
|
3015
2990
|
}
|
|
3016
2991
|
requestColumnsRender() {
|
|
3017
|
-
this.#s.requestPhase(
|
|
2992
|
+
this.#s.requestPhase(x.COLUMNS, "plugin:requestColumnsRender");
|
|
3018
2993
|
}
|
|
3019
2994
|
requestRenderWithFocus() {
|
|
3020
|
-
this._restoreFocusAfterRender = !0, this.#s.requestPhase(
|
|
2995
|
+
this._restoreFocusAfterRender = !0, this.#s.requestPhase(x.ROWS, "plugin:requestRenderWithFocus");
|
|
3021
2996
|
}
|
|
3022
2997
|
updateTemplate() {
|
|
3023
|
-
|
|
2998
|
+
U(this);
|
|
3024
2999
|
}
|
|
3025
3000
|
requestAfterRender() {
|
|
3026
|
-
this.#s.requestPhase(
|
|
3001
|
+
this.#s.requestPhase(x.STYLE, "plugin:requestAfterRender");
|
|
3027
3002
|
}
|
|
3028
3003
|
#J() {
|
|
3029
|
-
this.#e = new
|
|
3004
|
+
this.#e = new oe(this);
|
|
3030
3005
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
3031
3006
|
this.#e.attachAll(i);
|
|
3032
3007
|
}
|
|
3033
3008
|
#W() {
|
|
3034
3009
|
const e = this.#e?.getPluginStyles() ?? [];
|
|
3035
|
-
|
|
3010
|
+
mi(e);
|
|
3036
3011
|
}
|
|
3037
3012
|
#ee() {
|
|
3038
3013
|
const e = this.#o?.plugins, i = Array.isArray(e) ? e : [];
|
|
@@ -3058,7 +3033,7 @@ class k extends HTMLElement {
|
|
|
3058
3033
|
const o = this.#g;
|
|
3059
3034
|
if (this.#g = this.#e?.getAll().some((n) => n.onScroll) ?? !1, !o && this.#g) {
|
|
3060
3035
|
const r = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3061
|
-
this.#
|
|
3036
|
+
this.#G(r);
|
|
3062
3037
|
}
|
|
3063
3038
|
}
|
|
3064
3039
|
#be() {
|
|
@@ -3090,9 +3065,9 @@ class k extends HTMLElement {
|
|
|
3090
3065
|
};
|
|
3091
3066
|
}
|
|
3092
3067
|
connectedCallback() {
|
|
3093
|
-
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.#E && (
|
|
3068
|
+
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.#E && (ze(this.#E), this.#E = void 0), this.#M(), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#J();
|
|
3094
3069
|
const e = this.#o?.plugins;
|
|
3095
|
-
this.#_ = Array.isArray(e) ? e : [], this.#te(), this.#u || (this.#Q(), this.#W(), this.#u = !0), this.#oe(), this.#E =
|
|
3070
|
+
this.#_ = Array.isArray(e) ? e : [], this.#te(), this.#u || (this.#Q(), this.#W(), this.#u = !0), this.#oe(), this.#E = Vt(
|
|
3096
3071
|
() => {
|
|
3097
3072
|
this.#Me();
|
|
3098
3073
|
},
|
|
@@ -3100,7 +3075,7 @@ class k extends HTMLElement {
|
|
|
3100
3075
|
);
|
|
3101
3076
|
}
|
|
3102
3077
|
disconnectedCallback() {
|
|
3103
|
-
this.#E && (
|
|
3078
|
+
this.#E && (ze(this.#E), this.#E = void 0), this.#m && (clearTimeout(this.#m), this.#m = 0), this.#be(), fi(this.#i), this.#c.setInitialized(!1), this.#I?.(), this.#I = void 0, rt(this.#k), 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.#F = !1), X(this), this.#R.clear(), this.#_ = void 0;
|
|
3104
3079
|
for (const e of this._rowPool)
|
|
3105
3080
|
e.remove();
|
|
3106
3081
|
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
|
|
@@ -3124,19 +3099,19 @@ class k extends HTMLElement {
|
|
|
3124
3099
|
#oe() {
|
|
3125
3100
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3126
3101
|
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) {
|
|
3127
|
-
|
|
3102
|
+
fe(this.#n, this.#i), ce(this.#n, this.#o?.shell, this.#i);
|
|
3128
3103
|
const n = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3129
3104
|
n && this.#i.toolPanels.has(n) && (this.openToolPanel(), this.#i.expandedSections.add(n));
|
|
3130
3105
|
}
|
|
3131
|
-
if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController =
|
|
3106
|
+
if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = De(this), this.#P(), this.#G(i), this.#N)
|
|
3132
3107
|
return;
|
|
3133
3108
|
this.#N = !0;
|
|
3134
3109
|
const o = this.disconnectSignal;
|
|
3135
|
-
|
|
3110
|
+
qt(this, this, this.#n, o), this.#ne(), queueMicrotask(() => this.#Ce()), this.#s.requestPhase(x.FULL, "afterConnect");
|
|
3136
3111
|
}
|
|
3137
3112
|
#ne() {
|
|
3138
3113
|
const e = this.#o.rowHeight, i = this.#e.hasRowHeightPlugin();
|
|
3139
|
-
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.#K(), typeof e != "function" && (this.#
|
|
3114
|
+
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.#K(), typeof e != "function" && (this.#T = !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.#re());
|
|
3140
3115
|
}
|
|
3141
3116
|
#re() {
|
|
3142
3117
|
if (this.#e.hasExtraHeight())
|
|
@@ -3150,7 +3125,7 @@ class k extends HTMLElement {
|
|
|
3150
3125
|
l > o && (o = l);
|
|
3151
3126
|
});
|
|
3152
3127
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3153
|
-
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(
|
|
3128
|
+
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(x.VIRTUALIZATION, "measureRowHeight"));
|
|
3154
3129
|
}
|
|
3155
3130
|
#me() {
|
|
3156
3131
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
@@ -3163,11 +3138,11 @@ class k extends HTMLElement {
|
|
|
3163
3138
|
});
|
|
3164
3139
|
const n = e.getBoundingClientRect(), r = Math.max(n.height, o);
|
|
3165
3140
|
if (r > 0 && (Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r), this.#K(), this._virtualization.totalHeightEl)) {
|
|
3166
|
-
const l = this.#
|
|
3141
|
+
const l = this.#A(this._rows.length);
|
|
3167
3142
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3168
3143
|
}
|
|
3169
3144
|
}
|
|
3170
|
-
#
|
|
3145
|
+
#G(e) {
|
|
3171
3146
|
this.#D?.abort(), this.#D = new AbortController();
|
|
3172
3147
|
const i = this.#D.signal, o = e?.querySelector(".faux-vscroll"), n = e?.querySelector(".rows");
|
|
3173
3148
|
if (this._virtualization.container = o ?? this, this.#g = this.#e?.getAll().some((r) => r.onScroll) ?? !1, o && n) {
|
|
@@ -3180,14 +3155,14 @@ class k extends HTMLElement {
|
|
|
3180
3155
|
n.style.transform = `translateY(${-a}px)`;
|
|
3181
3156
|
else {
|
|
3182
3157
|
const d = this._virtualization.positionCache;
|
|
3183
|
-
let
|
|
3158
|
+
let f, u;
|
|
3184
3159
|
if (this._virtualization.variableHeights && d && d.length > 0) {
|
|
3185
|
-
|
|
3186
|
-
const p =
|
|
3187
|
-
|
|
3160
|
+
f = Fe(d, a), f === -1 && (f = 0);
|
|
3161
|
+
const p = f - f % 2;
|
|
3162
|
+
u = d[p]?.offset ?? p * c;
|
|
3188
3163
|
} else
|
|
3189
|
-
|
|
3190
|
-
const g = -(a -
|
|
3164
|
+
f = Math.floor(a / c), u = (f - f % 2) * c;
|
|
3165
|
+
const g = -(a - u);
|
|
3191
3166
|
n.style.transform = `translateY(${g}px)`;
|
|
3192
3167
|
}
|
|
3193
3168
|
this.#r = a, this.#C || (this.#C = requestAnimationFrame(() => {
|
|
@@ -3197,7 +3172,7 @@ class k extends HTMLElement {
|
|
|
3197
3172
|
{ passive: !0, signal: i }
|
|
3198
3173
|
);
|
|
3199
3174
|
const r = this.#n.querySelector(".tbw-scroll-area");
|
|
3200
|
-
this.#V = r, r && this.#g && r.addEventListener(
|
|
3175
|
+
this.#V = r, this._virtualization.scrollAreaEl = r, r && this.#g && r.addEventListener(
|
|
3201
3176
|
"scroll",
|
|
3202
3177
|
() => {
|
|
3203
3178
|
const a = this.#Z;
|
|
@@ -3211,23 +3186,23 @@ class k extends HTMLElement {
|
|
|
3211
3186
|
(a) => {
|
|
3212
3187
|
const c = a.shiftKey || Math.abs(a.deltaX) > Math.abs(a.deltaY);
|
|
3213
3188
|
if (c && l) {
|
|
3214
|
-
const d = a.shiftKey ? a.deltaY : a.deltaX, { scrollLeft:
|
|
3215
|
-
(d > 0 &&
|
|
3189
|
+
const d = a.shiftKey ? a.deltaY : a.deltaX, { scrollLeft: f, scrollWidth: u, clientWidth: g } = l;
|
|
3190
|
+
(d > 0 && f < u - g || d < 0 && f > 0) && (a.preventDefault(), l.scrollLeft += d);
|
|
3216
3191
|
} else if (!c) {
|
|
3217
|
-
const { scrollTop: d, scrollHeight:
|
|
3218
|
-
(a.deltaY > 0 && d <
|
|
3192
|
+
const { scrollTop: d, scrollHeight: f, clientHeight: u } = o;
|
|
3193
|
+
(a.deltaY > 0 && d < f - u || a.deltaY < 0 && d > 0) && (a.preventDefault(), o.scrollTop += a.deltaY);
|
|
3219
3194
|
}
|
|
3220
3195
|
},
|
|
3221
3196
|
{ passive: !1, signal: i }
|
|
3222
|
-
),
|
|
3197
|
+
), Ti(
|
|
3223
3198
|
s,
|
|
3224
3199
|
this.#k,
|
|
3225
3200
|
{ fauxScrollbar: o, scrollArea: l },
|
|
3226
3201
|
i
|
|
3227
3202
|
));
|
|
3228
3203
|
}
|
|
3229
|
-
this._bodyEl &&
|
|
3230
|
-
this.#ke(), this.#s.requestPhase(
|
|
3204
|
+
this._bodyEl && It(this, this._bodyEl, i), this.#y?.disconnect(), this._virtualization.viewportEl && (this.#y = new ResizeObserver(() => {
|
|
3205
|
+
this.#ke(), this.#s.requestPhase(x.VIRTUALIZATION, "resize-observer");
|
|
3231
3206
|
}), this.#y.observe(this._virtualization.viewportEl)), this.#n.addEventListener(
|
|
3232
3207
|
"focusin",
|
|
3233
3208
|
() => {
|
|
@@ -3257,7 +3232,7 @@ class k extends HTMLElement {
|
|
|
3257
3232
|
removeEventListener(e, i, o) {
|
|
3258
3233
|
super.removeEventListener(e, i, o);
|
|
3259
3234
|
}
|
|
3260
|
-
#
|
|
3235
|
+
#L(e, i) {
|
|
3261
3236
|
this.dispatchEvent(new CustomEvent(e, { detail: i, bubbles: !0, composed: !0 }));
|
|
3262
3237
|
}
|
|
3263
3238
|
#Ce() {
|
|
@@ -3289,7 +3264,7 @@ class k extends HTMLElement {
|
|
|
3289
3264
|
e.columns && this.#Ee(), e.rows && this.#se(), e.fitMode && this.#Se();
|
|
3290
3265
|
}
|
|
3291
3266
|
#se() {
|
|
3292
|
-
this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(
|
|
3267
|
+
this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#X(), this.#s.requestPhase(x.ROWS, "applyRowsUpdate");
|
|
3293
3268
|
}
|
|
3294
3269
|
#X() {
|
|
3295
3270
|
this.#S.clear();
|
|
@@ -3315,34 +3290,34 @@ class k extends HTMLElement {
|
|
|
3315
3290
|
return o;
|
|
3316
3291
|
}
|
|
3317
3292
|
#Ee() {
|
|
3318
|
-
|
|
3293
|
+
X(this), this.#t.merge(), this.#P();
|
|
3319
3294
|
}
|
|
3320
3295
|
#Se() {
|
|
3321
|
-
this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1,
|
|
3296
|
+
this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, Se(this)) : (this._columns.forEach((i) => {
|
|
3322
3297
|
!i.__userResized && i.__autoSized && delete i.width;
|
|
3323
|
-
}),
|
|
3298
|
+
}), U(this));
|
|
3324
3299
|
}
|
|
3325
3300
|
#Re() {
|
|
3326
|
-
|
|
3301
|
+
Me(this, this.#i), ke(this, this.#i);
|
|
3327
3302
|
const e = !!this.#n.querySelector(".has-shell"), i = !!this.#n.querySelector(".tbw-tool-panel"), o = this.#n.querySelectorAll(".tbw-accordion-section").length;
|
|
3328
|
-
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(),
|
|
3329
|
-
const n =
|
|
3303
|
+
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), Ne(this, this.#i, this.#ie()), this.#t.markSourcesChanged(), this.#t.merge();
|
|
3304
|
+
const n = nt(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = this.#o?.shell?.toolPanels?.length ?? 0;
|
|
3330
3305
|
if (e !== n || !i && r || i && s !== o) {
|
|
3331
|
-
|
|
3306
|
+
de(this.#i), this.#Q(), this.#W(), this.#oe(), this.#X();
|
|
3332
3307
|
return;
|
|
3333
3308
|
}
|
|
3334
|
-
e && this.#
|
|
3309
|
+
e && this.#Ae(), this.#X(), this.#s.requestPhase(x.COLUMNS, "applyGridConfigUpdate");
|
|
3335
3310
|
}
|
|
3336
|
-
#
|
|
3311
|
+
#Ae() {
|
|
3337
3312
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3338
3313
|
if (!e) return;
|
|
3339
3314
|
const i = this.#o.shell?.header?.title ?? this.#i.lightDomTitle;
|
|
3340
3315
|
let o = e.querySelector(".tbw-shell-title");
|
|
3341
3316
|
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();
|
|
3342
3317
|
}
|
|
3343
|
-
#
|
|
3318
|
+
#Te() {
|
|
3344
3319
|
if (this.#e) {
|
|
3345
|
-
const e = this.#
|
|
3320
|
+
const e = this.#B.length > 0 ? this.#B : this._columns, i = e.filter((r) => !r.hidden), o = e.filter((r) => r.hidden), n = this.#e.processColumns([...i]);
|
|
3346
3321
|
if (n !== i) {
|
|
3347
3322
|
const r = new Set(n.map((l) => l.field));
|
|
3348
3323
|
!i.some((l) => r.has(l.field)) && n.length > 0 ? this._columns = [...n, ...o] : this._columns = [...n, ...o];
|
|
@@ -3350,38 +3325,38 @@ class k extends HTMLElement {
|
|
|
3350
3325
|
this._columns = [...e];
|
|
3351
3326
|
}
|
|
3352
3327
|
}
|
|
3353
|
-
#
|
|
3354
|
-
|
|
3328
|
+
#xe() {
|
|
3329
|
+
X(this);
|
|
3355
3330
|
const e = Array.isArray(this.#a) ? [...this.#a] : [], i = this.#e?.processRows(e) ?? e;
|
|
3356
3331
|
this._rows = i, this._virtualization.variableHeights && this.#K();
|
|
3357
3332
|
}
|
|
3358
3333
|
#He(e) {
|
|
3359
3334
|
const i = {
|
|
3360
|
-
...
|
|
3335
|
+
...ht,
|
|
3361
3336
|
...e.animation
|
|
3362
3337
|
}, o = i.mode ?? "reduced-motion";
|
|
3363
3338
|
let n = 1;
|
|
3364
3339
|
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;
|
|
3365
3340
|
}
|
|
3366
3341
|
#Y(e, i, o = this.__rowRenderEpoch) {
|
|
3367
|
-
this.#z || (this.#z = (n, r, s) => this.#e?.renderRow(n, r, s) ?? !1),
|
|
3342
|
+
this.#z || (this.#z = (n, r, s) => this.#e?.renderRow(n, r, s) ?? !1), zt(this, e, i, o, this.#z);
|
|
3368
3343
|
}
|
|
3369
|
-
#ae =
|
|
3344
|
+
#ae = lt();
|
|
3370
3345
|
#ce(e, i) {
|
|
3371
|
-
|
|
3372
|
-
}
|
|
3373
|
-
#Pe() {
|
|
3374
|
-
ct(this.#ae, this.__rowsBodyEl, this.#o, this.#i);
|
|
3346
|
+
at(this.#ae, this.__rowsBodyEl, this._bodyEl, e, i);
|
|
3375
3347
|
}
|
|
3376
3348
|
#Le() {
|
|
3349
|
+
dt(this.#ae, this.__rowsBodyEl, this.#o, this.#i);
|
|
3350
|
+
}
|
|
3351
|
+
#Pe() {
|
|
3377
3352
|
const e = this.querySelector(".tbw-grid-root");
|
|
3378
|
-
e && (this.#q ? (this.#$ || (this.#$ =
|
|
3353
|
+
e && (this.#q ? (this.#$ || (this.#$ = Xt(this.#o?.loadingRenderer)), Yt(e, this.#$)) : jt(this.#$));
|
|
3379
3354
|
}
|
|
3380
3355
|
#de(e, i) {
|
|
3381
3356
|
const o = this.#S.get(e);
|
|
3382
3357
|
if (!o) return;
|
|
3383
3358
|
const n = this.findRenderedRowElement?.(o.index);
|
|
3384
|
-
n &&
|
|
3359
|
+
n && Kt(n, i);
|
|
3385
3360
|
}
|
|
3386
3361
|
#he(e, i, o) {
|
|
3387
3362
|
const n = this.#S.get(e);
|
|
@@ -3391,9 +3366,9 @@ class k extends HTMLElement {
|
|
|
3391
3366
|
const s = this._visibleColumns.findIndex((a) => a.field === i);
|
|
3392
3367
|
if (s < 0) return;
|
|
3393
3368
|
const l = r.children[s];
|
|
3394
|
-
l &&
|
|
3369
|
+
l && Qt(l, o);
|
|
3395
3370
|
}
|
|
3396
|
-
#
|
|
3371
|
+
#P() {
|
|
3397
3372
|
if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
|
|
3398
3373
|
if (this.#t.parseLightDomColumns(this), this.#O) {
|
|
3399
3374
|
const e = this.#O;
|
|
@@ -3401,7 +3376,7 @@ class k extends HTMLElement {
|
|
|
3401
3376
|
const i = this.#e?.getAll() ?? [];
|
|
3402
3377
|
this.#t.applyState(e, i);
|
|
3403
3378
|
}
|
|
3404
|
-
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(
|
|
3379
|
+
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(x.FULL, "setup");
|
|
3405
3380
|
}
|
|
3406
3381
|
}
|
|
3407
3382
|
#ze(e) {
|
|
@@ -3454,8 +3429,8 @@ class k extends HTMLElement {
|
|
|
3454
3429
|
value: a,
|
|
3455
3430
|
cellEl: n,
|
|
3456
3431
|
originalEvent: e
|
|
3457
|
-
},
|
|
3458
|
-
return this.#
|
|
3432
|
+
}, f = this.#e?.onCellClick(d) ?? !1;
|
|
3433
|
+
return this.#L("cell-click", d), f;
|
|
3459
3434
|
}
|
|
3460
3435
|
_dispatchRowClick(e, i, o, n) {
|
|
3461
3436
|
if (!o) return !1;
|
|
@@ -3465,7 +3440,7 @@ class k extends HTMLElement {
|
|
|
3465
3440
|
rowEl: n,
|
|
3466
3441
|
originalEvent: e
|
|
3467
3442
|
}, s = this.#e?.onRowClick(r) ?? !1;
|
|
3468
|
-
return this.#
|
|
3443
|
+
return this.#L("row-click", r), s;
|
|
3469
3444
|
}
|
|
3470
3445
|
_dispatchHeaderClick(e, i, o) {
|
|
3471
3446
|
const n = this._columns[i];
|
|
@@ -3516,7 +3491,7 @@ class k extends HTMLElement {
|
|
|
3516
3491
|
return this.#d;
|
|
3517
3492
|
}
|
|
3518
3493
|
async forceLayout() {
|
|
3519
|
-
return this.#s.requestPhase(
|
|
3494
|
+
return this.#s.requestPhase(x.FULL, "forceLayout"), this.#s.whenReady();
|
|
3520
3495
|
}
|
|
3521
3496
|
async getConfig() {
|
|
3522
3497
|
return Object.freeze({ ...this.#o || {} });
|
|
@@ -3539,7 +3514,7 @@ class k extends HTMLElement {
|
|
|
3539
3514
|
d !== c && (l.push({ field: a, oldValue: d, newValue: c }), r[a] = c);
|
|
3540
3515
|
}
|
|
3541
3516
|
for (const { field: a, oldValue: c, newValue: d } of l)
|
|
3542
|
-
this.#
|
|
3517
|
+
this.#L("cell-change", {
|
|
3543
3518
|
row: r,
|
|
3544
3519
|
rowId: e,
|
|
3545
3520
|
rowIndex: s,
|
|
@@ -3549,7 +3524,7 @@ class k extends HTMLElement {
|
|
|
3549
3524
|
changes: i,
|
|
3550
3525
|
source: o
|
|
3551
3526
|
});
|
|
3552
|
-
l.length > 0 && this.#s.requestPhase(
|
|
3527
|
+
l.length > 0 && this.#s.requestPhase(x.ROWS, "updateRow");
|
|
3553
3528
|
}
|
|
3554
3529
|
updateRows(e, i = "api") {
|
|
3555
3530
|
let o = !1;
|
|
@@ -3561,29 +3536,29 @@ class k extends HTMLElement {
|
|
|
3561
3536
|
);
|
|
3562
3537
|
const { row: l, index: a } = s;
|
|
3563
3538
|
for (const [c, d] of Object.entries(r)) {
|
|
3564
|
-
const
|
|
3565
|
-
|
|
3539
|
+
const f = l[c];
|
|
3540
|
+
f !== d && (o = !0, l[c] = d, this.#L("cell-change", {
|
|
3566
3541
|
row: l,
|
|
3567
3542
|
rowId: n,
|
|
3568
3543
|
rowIndex: a,
|
|
3569
3544
|
field: c,
|
|
3570
|
-
oldValue:
|
|
3545
|
+
oldValue: f,
|
|
3571
3546
|
newValue: d,
|
|
3572
3547
|
changes: r,
|
|
3573
3548
|
source: i
|
|
3574
3549
|
}));
|
|
3575
3550
|
}
|
|
3576
3551
|
}
|
|
3577
|
-
o && this.#s.requestPhase(
|
|
3552
|
+
o && this.#s.requestPhase(x.ROWS, "updateRows");
|
|
3578
3553
|
}
|
|
3579
3554
|
animateRow(e, i) {
|
|
3580
|
-
|
|
3555
|
+
ye(this, e, i);
|
|
3581
3556
|
}
|
|
3582
3557
|
animateRows(e, i) {
|
|
3583
|
-
|
|
3558
|
+
ni(this, e, i);
|
|
3584
3559
|
}
|
|
3585
3560
|
animateRowById(e, i) {
|
|
3586
|
-
return
|
|
3561
|
+
return ri(this, e, i);
|
|
3587
3562
|
}
|
|
3588
3563
|
setColumnVisible(e, i) {
|
|
3589
3564
|
const o = this.#t.setColumnVisible(e, i);
|
|
@@ -3620,7 +3595,7 @@ class k extends HTMLElement {
|
|
|
3620
3595
|
}
|
|
3621
3596
|
#De(e) {
|
|
3622
3597
|
const i = this.#e?.getAll() ?? [];
|
|
3623
|
-
this.#t.applyState(e, i), this.#
|
|
3598
|
+
this.#t.applyState(e, i), this.#P();
|
|
3624
3599
|
}
|
|
3625
3600
|
requestStateChange() {
|
|
3626
3601
|
const e = this.#e?.getAll() ?? [];
|
|
@@ -3629,7 +3604,7 @@ class k extends HTMLElement {
|
|
|
3629
3604
|
resetColumnState() {
|
|
3630
3605
|
this.#O = void 0, this.__originalOrder = [];
|
|
3631
3606
|
const e = this.#e?.getAll() ?? [];
|
|
3632
|
-
this.#t.resetState(e), this.#t.merge(), this.#
|
|
3607
|
+
this.#t.resetState(e), this.#t.merge(), this.#P();
|
|
3633
3608
|
}
|
|
3634
3609
|
get isToolPanelOpen() {
|
|
3635
3610
|
return this.#c.isPanelOpen;
|
|
@@ -3682,17 +3657,17 @@ class k extends HTMLElement {
|
|
|
3682
3657
|
#j = !1;
|
|
3683
3658
|
refreshShellHeader() {
|
|
3684
3659
|
this.#j || (this.#j = !0, queueMicrotask(() => {
|
|
3685
|
-
this.#j = !1, this.isConnected && (this.#M(), this.#t.markSourcesChanged(), this.#t.merge(),
|
|
3660
|
+
this.#j = !1, this.isConnected && (this.#M(), this.#t.markSourcesChanged(), this.#t.merge(), de(this.#i), this.#Q(), this.#W(), this.#Oe());
|
|
3686
3661
|
}));
|
|
3687
3662
|
}
|
|
3688
3663
|
#Oe() {
|
|
3689
3664
|
const i = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3690
3665
|
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) {
|
|
3691
|
-
|
|
3666
|
+
fe(this.#n, this.#i), ce(this.#n, this.#o?.shell, this.#i);
|
|
3692
3667
|
const o = this.#o?.shell?.toolPanel?.defaultOpen;
|
|
3693
3668
|
o && this.#i.toolPanels.has(o) && (this.openToolPanel(), this.#i.expandedSections.add(o));
|
|
3694
3669
|
}
|
|
3695
|
-
this._resizeController =
|
|
3670
|
+
this._resizeController = De(this), this.#G(i), this.#s.requestPhase(x.COLUMNS, "shellRefresh");
|
|
3696
3671
|
}
|
|
3697
3672
|
#R = /* @__PURE__ */ new Map();
|
|
3698
3673
|
registerStyles(e, i) {
|
|
@@ -3712,20 +3687,20 @@ class k extends HTMLElement {
|
|
|
3712
3687
|
document.adoptedStyleSheets = [...i, ...e];
|
|
3713
3688
|
}
|
|
3714
3689
|
#M() {
|
|
3715
|
-
|
|
3690
|
+
Me(this, this.#i), ke(this, this.#i), Ne(this, this.#i, this.#ie());
|
|
3716
3691
|
}
|
|
3717
3692
|
#fe() {
|
|
3718
3693
|
const e = this.#n.querySelector(".tbw-shell-header");
|
|
3719
3694
|
if (!e) return;
|
|
3720
|
-
|
|
3721
|
-
const i =
|
|
3695
|
+
de(this.#i);
|
|
3696
|
+
const i = ci(
|
|
3722
3697
|
this.#o.shell,
|
|
3723
3698
|
this.#i,
|
|
3724
3699
|
this.#o.icons?.toolPanel
|
|
3725
3700
|
), o = document.createElement("div");
|
|
3726
3701
|
o.innerHTML = i;
|
|
3727
3702
|
const n = o.firstElementChild;
|
|
3728
|
-
n && (e.replaceWith(n), this.#pe(),
|
|
3703
|
+
n && (e.replaceWith(n), this.#pe(), ce(this.#n, this.#o?.shell, this.#i));
|
|
3729
3704
|
}
|
|
3730
3705
|
#Me() {
|
|
3731
3706
|
const e = () => {
|
|
@@ -3734,30 +3709,39 @@ class k extends HTMLElement {
|
|
|
3734
3709
|
const r = this.#i.lightDomTitle, s = this.#i.hasToolButtonsContainer;
|
|
3735
3710
|
(r && !o || s && !n) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#fe());
|
|
3736
3711
|
}, i = () => {
|
|
3737
|
-
this.__lightDomColumnsCache = void 0, this.#
|
|
3712
|
+
this.__lightDomColumnsCache = void 0, this.#P();
|
|
3738
3713
|
};
|
|
3739
3714
|
this.#t.registerLightDomHandler("tbw-grid-header", e), this.#t.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#t.registerLightDomHandler("tbw-grid-tool-panel", e), this.#t.registerLightDomHandler("tbw-grid-column", i), this.#t.registerLightDomHandler("tbw-grid-detail", i), this.#t.observeLightDOM(this);
|
|
3740
3715
|
}
|
|
3741
3716
|
refreshColumns() {
|
|
3742
|
-
this.__lightDomColumnsCache = void 0,
|
|
3717
|
+
this.__lightDomColumnsCache = void 0, X(this), this.#t.parseLightDomColumns(this);
|
|
3743
3718
|
const e = this.#i.lightDomTitle, i = this.#i.hasToolButtonsContainer;
|
|
3744
3719
|
this.#M();
|
|
3745
3720
|
const o = this.#i.lightDomTitle, n = this.#i.hasToolButtonsContainer;
|
|
3746
|
-
(o && !e || n && !i) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#fe()), this.#s.requestPhase(
|
|
3721
|
+
(o && !e || n && !i) && (this.#t.markSourcesChanged(), this.#t.merge(), this.#fe()), this.#s.requestPhase(x.COLUMNS, "refreshColumns");
|
|
3747
3722
|
}
|
|
3748
3723
|
#ke() {
|
|
3749
3724
|
const e = this._virtualization.container, i = this._virtualization.viewportEl ?? e;
|
|
3750
3725
|
i && (this._virtualization.cachedViewportHeight = i.clientHeight), e && (this._virtualization.cachedFauxHeight = e.clientHeight);
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3726
|
+
const o = this._virtualization.scrollAreaEl;
|
|
3727
|
+
o && (this._virtualization.cachedScrollAreaHeight = o.clientHeight);
|
|
3728
|
+
}
|
|
3729
|
+
#A(e, i = !1) {
|
|
3730
|
+
const o = this._virtualization;
|
|
3731
|
+
let n, r, s;
|
|
3732
|
+
if (i) {
|
|
3733
|
+
const u = o.container ?? this, g = o.viewportEl ?? u, p = o.scrollAreaEl;
|
|
3734
|
+
n = u.clientHeight, r = g.clientHeight, s = p ? p.clientHeight : n, o.cachedFauxHeight = n, o.cachedViewportHeight = r, o.cachedScrollAreaHeight = s;
|
|
3735
|
+
} else
|
|
3736
|
+
n = o.cachedFauxHeight, r = o.cachedViewportHeight, s = o.cachedScrollAreaHeight || n;
|
|
3737
|
+
const l = s - r, a = Math.max(0, n - s);
|
|
3738
|
+
let c, d = 0;
|
|
3739
|
+
return o.variableHeights && o.positionCache ? c = Ii(o.positionCache) : (c = e * o.rowHeight, d = this.#e?.getExtraHeight() ?? 0), c + l + d + a;
|
|
3756
3740
|
}
|
|
3757
3741
|
#K() {
|
|
3758
3742
|
if (!this._virtualization.variableHeights) return;
|
|
3759
3743
|
const e = this._rows, i = this._virtualization.rowHeight || 28, o = this.#o.rowHeight, n = this.#o.getRowId, r = n ? (l) => n(l) : void 0;
|
|
3760
|
-
this._virtualization.positionCache =
|
|
3744
|
+
this._virtualization.positionCache = Ni(
|
|
3761
3745
|
e,
|
|
3762
3746
|
this._virtualization.heightCache,
|
|
3763
3747
|
i,
|
|
@@ -3771,7 +3755,7 @@ class k extends HTMLElement {
|
|
|
3771
3755
|
}
|
|
3772
3756
|
}
|
|
3773
3757
|
);
|
|
3774
|
-
const s =
|
|
3758
|
+
const s = Fi(
|
|
3775
3759
|
this._virtualization.positionCache,
|
|
3776
3760
|
e,
|
|
3777
3761
|
i,
|
|
@@ -3785,14 +3769,14 @@ class k extends HTMLElement {
|
|
|
3785
3769
|
let r = i;
|
|
3786
3770
|
r === void 0 && (r = this.#e?.getRowHeight?.(n, e)), r === void 0 && (r = this._virtualization.rowHeight);
|
|
3787
3771
|
const s = o[e];
|
|
3788
|
-
if (!(!s || Math.abs(s.height - r) < 1) && (
|
|
3789
|
-
const l = this.#
|
|
3772
|
+
if (!(!s || Math.abs(s.height - r) < 1) && (be(o, e, r), this._virtualization.totalHeightEl)) {
|
|
3773
|
+
const l = this.#A(this._rows.length);
|
|
3790
3774
|
this._virtualization.totalHeightEl.style.height = `${l}px`;
|
|
3791
3775
|
}
|
|
3792
3776
|
}
|
|
3793
3777
|
#ge(e, i) {
|
|
3794
3778
|
if (!this._virtualization.variableHeights || !this._virtualization.positionCache || !this._bodyEl) return;
|
|
3795
|
-
const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r =
|
|
3779
|
+
const o = this._bodyEl.querySelectorAll(".data-grid-row"), n = this.#o.getRowId, r = Wi(
|
|
3796
3780
|
{
|
|
3797
3781
|
positionCache: this._virtualization.positionCache,
|
|
3798
3782
|
heightCache: this._virtualization.heightCache,
|
|
@@ -3806,7 +3790,7 @@ class k extends HTMLElement {
|
|
|
3806
3790
|
o
|
|
3807
3791
|
);
|
|
3808
3792
|
if (r.hasChanges && (this._virtualization.measuredCount = r.measuredCount, this._virtualization.averageHeight = r.averageHeight, this._virtualization.totalHeightEl)) {
|
|
3809
|
-
const s = this.#
|
|
3793
|
+
const s = this.#A(this._rows.length);
|
|
3810
3794
|
this._virtualization.totalHeightEl.style.height = `${s}px`;
|
|
3811
3795
|
}
|
|
3812
3796
|
}
|
|
@@ -3816,45 +3800,51 @@ class k extends HTMLElement {
|
|
|
3816
3800
|
if (!this._virtualization.enabled)
|
|
3817
3801
|
return this.#Y(0, o), i || this.#e?.afterRender(), !0;
|
|
3818
3802
|
if (this._rows.length <= this._virtualization.bypassThreshold)
|
|
3819
|
-
return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#Y(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#
|
|
3803
|
+
return this._virtualization.start = 0, this._virtualization.end = o, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#Y(0, o, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#A(o, !0)}px`), this.#ce(o, this._visibleColumns.length), i || this.#e?.afterRender(), !0;
|
|
3820
3804
|
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;
|
|
3821
3805
|
let c;
|
|
3822
3806
|
const d = this._virtualization.positionCache;
|
|
3823
3807
|
if (this._virtualization.variableHeights && d && d.length > 0)
|
|
3824
|
-
c =
|
|
3808
|
+
c = Fe(d, a), c === -1 && (c = 0);
|
|
3825
3809
|
else {
|
|
3826
3810
|
c = Math.floor(a / l);
|
|
3827
3811
|
let m = 0;
|
|
3828
3812
|
const y = 10;
|
|
3829
3813
|
for (; m < y; ) {
|
|
3830
|
-
const
|
|
3831
|
-
if (
|
|
3832
|
-
c =
|
|
3814
|
+
const S = this.#e?.getExtraHeightBefore?.(c) ?? 0, A = Math.floor((a - S) / l);
|
|
3815
|
+
if (A >= c || A < 0) break;
|
|
3816
|
+
c = A, m++;
|
|
3833
3817
|
}
|
|
3834
3818
|
}
|
|
3835
3819
|
c = c - c % 2, c < 0 && (c = 0);
|
|
3836
|
-
const
|
|
3837
|
-
|
|
3838
|
-
let
|
|
3820
|
+
const f = this.#e?.adjustVirtualStart(c, a, l);
|
|
3821
|
+
f !== void 0 && f < c && (c = f, c = c - c % 2, c < 0 && (c = 0));
|
|
3822
|
+
let u;
|
|
3839
3823
|
if (this._virtualization.variableHeights && d && d.length > 0) {
|
|
3840
3824
|
const m = s + l * 3;
|
|
3841
3825
|
let y = 0;
|
|
3842
|
-
for (
|
|
3843
|
-
y += d[
|
|
3844
|
-
const
|
|
3845
|
-
|
|
3826
|
+
for (u = c; u < o && y < m; )
|
|
3827
|
+
y += d[u].height, u++;
|
|
3828
|
+
const S = Math.ceil(s / l) + 3;
|
|
3829
|
+
u - c < S && (u = Math.min(c + S, o));
|
|
3846
3830
|
} else {
|
|
3847
3831
|
const m = Math.ceil(s / l) + 3;
|
|
3848
|
-
|
|
3832
|
+
u = c + m;
|
|
3849
3833
|
}
|
|
3850
|
-
|
|
3834
|
+
u > o && (u = o);
|
|
3851
3835
|
const g = this._virtualization.start, p = this._virtualization.end;
|
|
3852
|
-
if (!e && c === g &&
|
|
3836
|
+
if (!e && c === g && u === p)
|
|
3853
3837
|
return !1;
|
|
3854
|
-
|
|
3855
|
-
|
|
3838
|
+
this._virtualization.start = c, this._virtualization.end = u;
|
|
3839
|
+
const h = e ? this._virtualization.cachedFauxHeight = n.clientHeight : this._virtualization.cachedFauxHeight || (this._virtualization.cachedFauxHeight = n.clientHeight);
|
|
3840
|
+
if (e) {
|
|
3841
|
+
const m = this._virtualization.scrollAreaEl;
|
|
3842
|
+
m && (this._virtualization.cachedScrollAreaHeight = m.clientHeight);
|
|
3843
|
+
}
|
|
3844
|
+
if (h === 0 && s > 0)
|
|
3845
|
+
return this.#s.requestPhase(x.VIRTUALIZATION, "stale-refs-retry"), !1;
|
|
3856
3846
|
if (e && this._virtualization.totalHeightEl) {
|
|
3857
|
-
const m = this.#
|
|
3847
|
+
const m = this.#A(o);
|
|
3858
3848
|
this._virtualization.totalHeightEl.style.height = `${m}px`;
|
|
3859
3849
|
}
|
|
3860
3850
|
let w;
|
|
@@ -3865,17 +3855,16 @@ class k extends HTMLElement {
|
|
|
3865
3855
|
w = c * l + m;
|
|
3866
3856
|
}
|
|
3867
3857
|
const C = -(a - w);
|
|
3868
|
-
return this._bodyEl.style.transform = `translateY(${C}px)`, this.#Y(c,
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${E}px`);
|
|
3858
|
+
return this._bodyEl.style.transform = `translateY(${C}px)`, this.#Y(c, u, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), e && this._virtualization.variableHeights && this.#ge(c, u), this.#ce(o, this._visibleColumns.length), e && !i && (this.#e?.afterRender(), queueMicrotask(() => {
|
|
3859
|
+
if (!this._virtualization.totalHeightEl) return;
|
|
3860
|
+
const m = this.#A(o);
|
|
3861
|
+
this._virtualization.cachedFauxHeight === 0 && this._virtualization.cachedViewportHeight > 0 || (this._virtualization.totalHeightEl.style.height = `${m}px`);
|
|
3873
3862
|
})), !0;
|
|
3874
3863
|
}
|
|
3875
3864
|
#Q() {
|
|
3876
3865
|
this.#M(), this.#t.markSourcesChanged(), this.#t.merge();
|
|
3877
3866
|
const e = this.#o?.shell;
|
|
3878
|
-
|
|
3867
|
+
wi(
|
|
3879
3868
|
this.#n,
|
|
3880
3869
|
e,
|
|
3881
3870
|
{ isPanelOpen: this.#i.isPanelOpen, expandedSections: this.#i.expandedSections },
|
|
@@ -3883,24 +3872,24 @@ class k extends HTMLElement {
|
|
|
3883
3872
|
) && (this.#pe(), this.#c.setInitialized(!0));
|
|
3884
3873
|
}
|
|
3885
3874
|
#pe() {
|
|
3886
|
-
|
|
3875
|
+
di(this.#n, this.#o?.shell, this.#i, {
|
|
3887
3876
|
onPanelToggle: () => this.toggleToolPanel(),
|
|
3888
3877
|
onSectionToggle: (e) => this.toggleToolPanelSection(e)
|
|
3889
|
-
}), this.#I?.(), this.#I =
|
|
3878
|
+
}), this.#I?.(), this.#I = hi(this.#n, this.#o?.shell, (e) => {
|
|
3890
3879
|
this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
|
|
3891
3880
|
});
|
|
3892
3881
|
}
|
|
3893
3882
|
}
|
|
3894
3883
|
customElements.get(k.tagName) || customElements.define(k.tagName, k);
|
|
3895
3884
|
globalThis.DataGridElement = k;
|
|
3896
|
-
const
|
|
3885
|
+
const oo = {
|
|
3897
3886
|
CAN_MOVE_COLUMN: "canMoveColumn",
|
|
3898
3887
|
GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
|
|
3899
3888
|
};
|
|
3900
|
-
class
|
|
3889
|
+
class no {
|
|
3901
3890
|
static dependencies;
|
|
3902
3891
|
static manifest;
|
|
3903
|
-
version = "1.
|
|
3892
|
+
version = "1.13.0";
|
|
3904
3893
|
styles;
|
|
3905
3894
|
cellRenderers;
|
|
3906
3895
|
headerRenderers;
|
|
@@ -4032,14 +4021,14 @@ const H = {
|
|
|
4032
4021
|
GROUP_COUNT: "group-count",
|
|
4033
4022
|
RANGE_SELECTION: "range-selection",
|
|
4034
4023
|
SELECTION_OVERLAY: "selection-overlay"
|
|
4035
|
-
},
|
|
4024
|
+
}, J = {
|
|
4036
4025
|
ROW_INDEX: "data-row-index",
|
|
4037
4026
|
COL_INDEX: "data-col-index",
|
|
4038
4027
|
FIELD: "data-field",
|
|
4039
4028
|
GROUP_KEY: "data-group-key",
|
|
4040
4029
|
TREE_LEVEL: "data-tree-level",
|
|
4041
4030
|
STICKY: "data-sticky"
|
|
4042
|
-
},
|
|
4031
|
+
}, ro = {
|
|
4043
4032
|
ROOT: `.${H.ROOT}`,
|
|
4044
4033
|
HEADER: `.${H.HEADER}`,
|
|
4045
4034
|
HEADER_ROW: `.${H.HEADER_ROW}`,
|
|
@@ -4049,12 +4038,12 @@ const H = {
|
|
|
4049
4038
|
DATA_ROW: `.${H.DATA_ROW}`,
|
|
4050
4039
|
DATA_CELL: `.${H.DATA_CELL}`,
|
|
4051
4040
|
GROUP_ROW: `.${H.GROUP_ROW}`,
|
|
4052
|
-
ROW_BY_INDEX: (t) => `.${H.DATA_ROW}[${
|
|
4053
|
-
CELL_BY_FIELD: (t) => `.${H.DATA_CELL}[${
|
|
4054
|
-
CELL_AT: (t, e) => `.${H.DATA_ROW}[${
|
|
4041
|
+
ROW_BY_INDEX: (t) => `.${H.DATA_ROW}[${J.ROW_INDEX}="${t}"]`,
|
|
4042
|
+
CELL_BY_FIELD: (t) => `.${H.DATA_CELL}[${J.FIELD}="${t}"]`,
|
|
4043
|
+
CELL_AT: (t, e) => `.${H.DATA_ROW}[${J.ROW_INDEX}="${t}"] .${H.DATA_CELL}[${J.COL_INDEX}="${e}"]`,
|
|
4055
4044
|
SELECTED_ROWS: `.${H.DATA_ROW}.${H.SELECTED}`,
|
|
4056
4045
|
EDITING_CELL: `.${H.DATA_CELL}.${H.EDITING}`
|
|
4057
|
-
},
|
|
4046
|
+
}, so = {
|
|
4058
4047
|
COLOR_BG: "--tbw-color-bg",
|
|
4059
4048
|
COLOR_FG: "--tbw-color-fg",
|
|
4060
4049
|
COLOR_FG_MUTED: "--tbw-color-fg-muted",
|
|
@@ -4073,17 +4062,19 @@ const H = {
|
|
|
4073
4062
|
BORDER_RADIUS: "--tbw-border-radius",
|
|
4074
4063
|
FOCUS_OUTLINE: "--tbw-focus-outline"
|
|
4075
4064
|
};
|
|
4076
|
-
function
|
|
4065
|
+
function lo(t) {
|
|
4077
4066
|
const e = document.createElement("tbw-grid");
|
|
4078
4067
|
return t && (e.gridConfig = t), e;
|
|
4079
4068
|
}
|
|
4080
|
-
function
|
|
4069
|
+
function ao(t, e = document) {
|
|
4081
4070
|
return e.querySelector(t);
|
|
4082
4071
|
}
|
|
4083
|
-
const
|
|
4072
|
+
const co = {
|
|
4084
4073
|
CELL_CHANGE: "cell-change",
|
|
4085
4074
|
CELL_COMMIT: "cell-commit",
|
|
4086
4075
|
ROW_COMMIT: "row-commit",
|
|
4076
|
+
EDIT_OPEN: "edit-open",
|
|
4077
|
+
EDIT_CLOSE: "edit-close",
|
|
4087
4078
|
CHANGED_ROWS_RESET: "changed-rows-reset",
|
|
4088
4079
|
MOUNT_EXTERNAL_VIEW: "mount-external-view",
|
|
4089
4080
|
MOUNT_EXTERNAL_EDITOR: "mount-external-editor",
|
|
@@ -4093,7 +4084,7 @@ const ao = {
|
|
|
4093
4084
|
CELL_ACTIVATE: "cell-activate",
|
|
4094
4085
|
GROUP_TOGGLE: "group-toggle",
|
|
4095
4086
|
COLUMN_STATE_CHANGE: "column-state-change"
|
|
4096
|
-
},
|
|
4087
|
+
}, ho = {
|
|
4097
4088
|
SELECTION_CHANGE: "selection-change",
|
|
4098
4089
|
TREE_EXPAND: "tree-expand",
|
|
4099
4090
|
FILTER_CHANGE: "filter-change",
|
|
@@ -4111,7 +4102,7 @@ const ao = {
|
|
|
4111
4102
|
COLUMN_REORDER: "column-reorder",
|
|
4112
4103
|
DETAIL_EXPAND: "detail-expand",
|
|
4113
4104
|
GROUP_EXPAND: "group-expand"
|
|
4114
|
-
},
|
|
4105
|
+
}, ue = {
|
|
4115
4106
|
sum: (t, e) => t.reduce((i, o) => i + (Number(o[e]) || 0), 0),
|
|
4116
4107
|
avg: (t, e) => {
|
|
4117
4108
|
const i = t.reduce((o, n) => o + (Number(n[e]) || 0), 0);
|
|
@@ -4122,28 +4113,28 @@ const ao = {
|
|
|
4122
4113
|
max: (t, e) => t.length ? Math.max(...t.map((i) => Number(i[e]) || -1 / 0)) : 0,
|
|
4123
4114
|
first: (t, e) => t[0]?.[e],
|
|
4124
4115
|
last: (t, e) => t[t.length - 1]?.[e]
|
|
4125
|
-
},
|
|
4116
|
+
}, F = /* @__PURE__ */ new Map(), D = {
|
|
4126
4117
|
register(t, e) {
|
|
4127
|
-
|
|
4118
|
+
F.set(t, e);
|
|
4128
4119
|
},
|
|
4129
4120
|
unregister(t) {
|
|
4130
|
-
|
|
4121
|
+
F.delete(t);
|
|
4131
4122
|
},
|
|
4132
4123
|
get(t) {
|
|
4133
4124
|
if (t !== void 0)
|
|
4134
|
-
return typeof t == "function" ? t :
|
|
4125
|
+
return typeof t == "function" ? t : F.get(t) ?? ue[t];
|
|
4135
4126
|
},
|
|
4136
4127
|
run(t, e, i, o) {
|
|
4137
4128
|
const n = this.get(t);
|
|
4138
4129
|
return n ? n(e, i, o) : void 0;
|
|
4139
4130
|
},
|
|
4140
4131
|
has(t) {
|
|
4141
|
-
return
|
|
4132
|
+
return F.has(t) || t in ue;
|
|
4142
4133
|
},
|
|
4143
4134
|
list() {
|
|
4144
|
-
return [...Object.keys(
|
|
4135
|
+
return [...Object.keys(ue), ...F.keys()];
|
|
4145
4136
|
}
|
|
4146
|
-
},
|
|
4137
|
+
}, Ue = {
|
|
4147
4138
|
sum: (t) => t.reduce((e, i) => e + i, 0),
|
|
4148
4139
|
avg: (t) => t.length ? t.reduce((e, i) => e + i, 0) / t.length : 0,
|
|
4149
4140
|
count: (t) => t.length,
|
|
@@ -4152,50 +4143,50 @@ const ao = {
|
|
|
4152
4143
|
first: (t) => t[0] ?? 0,
|
|
4153
4144
|
last: (t) => t[t.length - 1] ?? 0
|
|
4154
4145
|
};
|
|
4155
|
-
function
|
|
4156
|
-
return
|
|
4146
|
+
function Ji(t) {
|
|
4147
|
+
return Ue[t] ?? Ue.sum;
|
|
4157
4148
|
}
|
|
4158
|
-
function
|
|
4159
|
-
return
|
|
4149
|
+
function uo(t, e) {
|
|
4150
|
+
return Ji(t)(e);
|
|
4160
4151
|
}
|
|
4161
|
-
const
|
|
4152
|
+
const fo = D.register.bind(D), go = D.unregister.bind(D), po = D.get.bind(D), wo = D.run.bind(D), bo = D.list.bind(D);
|
|
4162
4153
|
export {
|
|
4163
|
-
|
|
4164
|
-
|
|
4154
|
+
no as BaseGridPlugin,
|
|
4155
|
+
ht as DEFAULT_ANIMATION_CONFIG,
|
|
4165
4156
|
M as DEFAULT_GRID_ICONS,
|
|
4166
|
-
|
|
4157
|
+
co as DGEvents,
|
|
4167
4158
|
k as DataGridElement,
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4159
|
+
Qe as F,
|
|
4160
|
+
B as FitModeEnum,
|
|
4161
|
+
so as GridCSSVars,
|
|
4171
4162
|
H as GridClasses,
|
|
4172
|
-
|
|
4163
|
+
J as GridDataAttrs,
|
|
4173
4164
|
k as GridElement,
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4165
|
+
ro as GridSelectors,
|
|
4166
|
+
oo as PLUGIN_QUERIES,
|
|
4167
|
+
ho as PluginEvents,
|
|
4168
|
+
oe as PluginManager,
|
|
4169
|
+
x as RenderPhase,
|
|
4170
|
+
Be as a,
|
|
4180
4171
|
D as aggregatorRegistry,
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4172
|
+
$ as b,
|
|
4173
|
+
Wt as builtInSort,
|
|
4174
|
+
to as c,
|
|
4175
|
+
lo as createGrid,
|
|
4176
|
+
Ye as d,
|
|
4177
|
+
$t as defaultComparator,
|
|
4178
|
+
q as e,
|
|
4179
|
+
ve as f,
|
|
4180
|
+
Ht as g,
|
|
4181
|
+
po as getAggregator,
|
|
4182
|
+
Ji as getValueAggregator,
|
|
4183
|
+
bo as listAggregators,
|
|
4184
|
+
ao as queryGrid,
|
|
4185
|
+
eo as r,
|
|
4186
|
+
fo as registerAggregator,
|
|
4187
|
+
wo as runAggregator,
|
|
4188
|
+
uo as runValueAggregator,
|
|
4189
|
+
io as s,
|
|
4190
|
+
go as unregisterAggregator
|
|
4200
4191
|
};
|
|
4201
4192
|
//# sourceMappingURL=index.js.map
|