@toolbox-web/grid 1.2.0 → 1.3.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/README.md +80 -22
- package/all.js +439 -416
- package/all.js.map +1 -1
- package/index.js +358 -300
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +64 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/row-animation.d.ts +37 -0
- package/lib/core/internal/row-animation.d.ts.map +1 -0
- package/lib/core/types.d.ts +13 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +73 -69
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -0
- package/lib/plugins/clipboard/types.d.ts.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/index.js +69 -40
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/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/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +1 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +95 -64
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +50 -6
- 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 +21 -4
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +18 -18
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +9 -9
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -5
- package/umd/plugins/clipboard.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/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
package/all.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { BaseGridPlugin as R, DEFAULT_GRID_ICONS as Ue, runAggregator as de, e as
|
|
2
|
-
import { DEFAULT_ANIMATION_CONFIG as
|
|
3
|
-
const Oe = "__tbw_expander",
|
|
1
|
+
import { BaseGridPlugin as R, DEFAULT_GRID_ICONS as Ue, a as Ye, runAggregator as de, e as Xe, s as Ze, PLUGIN_QUERIES as Ge, getAggregator as ce, getValueAggregator as Je, b as L, c as ue, g as Qe } from "./index.js";
|
|
2
|
+
import { DEFAULT_ANIMATION_CONFIG as fn, DGEvents as gn, DataGridElement as pn, FitModeEnum as mn, GridCSSVars as wn, GridClasses as bn, GridDataAttrs as vn, DataGridElement as yn, GridSelectors as Cn, PluginEvents as xn, PluginManager as Rn, RenderPhase as En, builtInSort as Sn, createGrid as kn, defaultComparator as An, queryGrid as _n } from "./index.js";
|
|
3
|
+
const Oe = "__tbw_expander", et = 32;
|
|
4
4
|
function re(s) {
|
|
5
5
|
return s.field === Oe;
|
|
6
6
|
}
|
|
7
7
|
function I(s) {
|
|
8
8
|
return s.meta?.utility === !0;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function tt(s) {
|
|
11
11
|
return s.find(re);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function it(s) {
|
|
14
14
|
return {
|
|
15
15
|
field: Oe,
|
|
16
16
|
header: "",
|
|
17
|
-
width:
|
|
17
|
+
width: et,
|
|
18
18
|
resizable: !1,
|
|
19
19
|
sortable: !1,
|
|
20
20
|
filterable: !1,
|
|
@@ -49,35 +49,39 @@ function he(s, e) {
|
|
|
49
49
|
}
|
|
50
50
|
return o.push(a), (o.length > 1 || o.some((d) => d.trim() !== "")) && r.push(o), r;
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function nt() {
|
|
53
53
|
try {
|
|
54
54
|
return await navigator.clipboard.readText();
|
|
55
55
|
} catch {
|
|
56
56
|
return "";
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function rt(s, e) {
|
|
60
60
|
const { rows: t, target: i, fields: n } = s;
|
|
61
61
|
if (!i) return;
|
|
62
|
-
const r = e.rows,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
const r = e.rows, o = e.effectiveConfig.columns ?? [], a = o.map((u) => u.field), l = /* @__PURE__ */ new Map();
|
|
63
|
+
o.forEach((u) => {
|
|
64
|
+
l.set(u.field, u.editable === !0);
|
|
65
|
+
});
|
|
66
|
+
const d = [...r], c = i.bounds ? i.bounds.endRow : 1 / 0;
|
|
67
|
+
t.forEach((u, h) => {
|
|
68
|
+
const f = i.row + h;
|
|
69
|
+
if (!(f > c)) {
|
|
66
70
|
if (i.bounds) {
|
|
67
|
-
if (
|
|
71
|
+
if (f >= d.length)
|
|
68
72
|
return;
|
|
69
|
-
} else for (;
|
|
73
|
+
} else for (; f >= d.length; ) {
|
|
70
74
|
const g = {};
|
|
71
|
-
a.forEach((
|
|
75
|
+
a.forEach((p) => g[p] = ""), d.push(g);
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
77
|
+
d[f] = { ...d[f] }, u.forEach((g, p) => {
|
|
78
|
+
const m = n[p];
|
|
79
|
+
m && l.get(m) && (d[f][m] = g);
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
|
-
}), e.rows =
|
|
82
|
+
}), e.rows = d;
|
|
79
83
|
}
|
|
80
|
-
class
|
|
84
|
+
class ji extends R {
|
|
81
85
|
static dependencies = [
|
|
82
86
|
{ name: "selection", required: !1, reason: "Enables copy/paste of selected cells instead of entire grid" }
|
|
83
87
|
];
|
|
@@ -141,19 +145,19 @@ class $i extends R {
|
|
|
141
145
|
const t = e.clipboardData?.getData("text/plain");
|
|
142
146
|
if (!t) return;
|
|
143
147
|
e.preventDefault();
|
|
144
|
-
const i = he(t, this.config), r = this.#i()?.getSelection(), o = r?.ranges?.[0], a = o?.from.row ?? 0, l = o?.from.col ?? 0, c = o && (r?.mode === "range" || r?.mode === "row") && (o.from.row !== o.to.row || o.from.col !== o.to.col) ? { endRow: o.to.row, endCol: o.to.col } : null, u = c?.endCol ?? this.columns.length - 1, h = this.columns[l],
|
|
148
|
+
const i = he(t, this.config), r = this.#i()?.getSelection(), o = r?.ranges?.[0], a = o?.from.row ?? 0, l = o?.from.col ?? 0, c = o && (r?.mode === "range" || r?.mode === "row") && (o.from.row !== o.to.row || o.from.col !== o.to.col) ? { endRow: o.to.row, endCol: o.to.col } : null, u = c?.endCol ?? this.columns.length - 1, h = this.columns[l], f = h ? { row: a, col: l, field: h.field, bounds: c } : null, g = [], p = i[0]?.length ?? 0;
|
|
145
149
|
for (let w = 0; w < p && l + w <= u; w++) {
|
|
146
150
|
const b = this.columns[l + w];
|
|
147
|
-
b && !b.hidden &&
|
|
151
|
+
b && !b.hidden && g.push(b.field);
|
|
148
152
|
}
|
|
149
|
-
const m = { rows: i, text: t, target:
|
|
153
|
+
const m = { rows: i, text: t, target: f, fields: g };
|
|
150
154
|
this.emit("paste", m), this.#o(m);
|
|
151
155
|
}
|
|
152
156
|
#o(e) {
|
|
153
157
|
if (!this.grid) return;
|
|
154
158
|
const { pasteHandler: t } = this.config;
|
|
155
159
|
if (t === null) return;
|
|
156
|
-
(t ??
|
|
160
|
+
(t ?? rt)(e, this.grid);
|
|
157
161
|
}
|
|
158
162
|
#i() {
|
|
159
163
|
try {
|
|
@@ -165,15 +169,15 @@ class $i extends R {
|
|
|
165
169
|
}
|
|
166
170
|
#n(e) {
|
|
167
171
|
const { startRow: t, startCol: i, endRow: n, endCol: r } = e, o = Math.min(t, n), a = Math.max(t, n), l = Math.min(i, r), d = Math.max(i, r), c = this.config.delimiter ?? " ", u = this.config.newline ?? `
|
|
168
|
-
`, h = [],
|
|
172
|
+
`, h = [], f = this.columns.slice(l, d + 1).filter((g) => !I(g));
|
|
169
173
|
if (this.config.includeHeaders) {
|
|
170
|
-
const
|
|
171
|
-
h.push(
|
|
174
|
+
const g = f.map((p) => p.header || p.field);
|
|
175
|
+
h.push(g.join(c));
|
|
172
176
|
}
|
|
173
|
-
for (let
|
|
174
|
-
const p = this.rows[
|
|
177
|
+
for (let g = o; g <= a; g++) {
|
|
178
|
+
const p = this.rows[g];
|
|
175
179
|
if (!p) continue;
|
|
176
|
-
const m =
|
|
180
|
+
const m = f.map((w) => {
|
|
177
181
|
const b = p[w.field];
|
|
178
182
|
return b == null ? "" : b instanceof Date ? b.toISOString() : String(b);
|
|
179
183
|
});
|
|
@@ -221,23 +225,23 @@ class $i extends R {
|
|
|
221
225
|
return await W(r.text), this.lastCopied = { text: r.text, timestamp: Date.now() }, r.text;
|
|
222
226
|
}
|
|
223
227
|
async paste() {
|
|
224
|
-
const e = await
|
|
228
|
+
const e = await nt();
|
|
225
229
|
return e ? he(e, this.config) : null;
|
|
226
230
|
}
|
|
227
231
|
getLastCopied() {
|
|
228
232
|
return this.lastCopied;
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
|
-
const
|
|
235
|
+
const fe = 100;
|
|
232
236
|
function oe(s) {
|
|
233
237
|
if (s == null)
|
|
234
|
-
return
|
|
238
|
+
return fe;
|
|
235
239
|
if (typeof s == "number")
|
|
236
240
|
return s;
|
|
237
241
|
const e = parseFloat(s);
|
|
238
|
-
return isNaN(e) ?
|
|
242
|
+
return isNaN(e) ? fe : e;
|
|
239
243
|
}
|
|
240
|
-
function
|
|
244
|
+
function ge(s) {
|
|
241
245
|
return s.map((e) => oe(e.width));
|
|
242
246
|
}
|
|
243
247
|
function pe(s) {
|
|
@@ -250,11 +254,11 @@ function pe(s) {
|
|
|
250
254
|
function me(s) {
|
|
251
255
|
return s.reduce((e, t) => e + oe(t.width), 0);
|
|
252
256
|
}
|
|
253
|
-
function
|
|
257
|
+
function ot(s, e, t, i, n) {
|
|
254
258
|
const r = t.length;
|
|
255
259
|
if (r === 0)
|
|
256
260
|
return { startCol: 0, endCol: 0, visibleColumns: [] };
|
|
257
|
-
let o =
|
|
261
|
+
let o = st(s, t, i);
|
|
258
262
|
o = Math.max(0, o - n);
|
|
259
263
|
const a = s + e;
|
|
260
264
|
let l = o;
|
|
@@ -271,7 +275,7 @@ function rt(s, e, t, i, n) {
|
|
|
271
275
|
d.push(c);
|
|
272
276
|
return { startCol: o, endCol: l, visibleColumns: d };
|
|
273
277
|
}
|
|
274
|
-
function
|
|
278
|
+
function st(s, e, t) {
|
|
275
279
|
let i = 0, n = e.length - 1;
|
|
276
280
|
for (; i < n; ) {
|
|
277
281
|
const r = Math.floor((i + n) / 2);
|
|
@@ -279,10 +283,10 @@ function ot(s, e, t) {
|
|
|
279
283
|
}
|
|
280
284
|
return i;
|
|
281
285
|
}
|
|
282
|
-
function
|
|
286
|
+
function at(s, e, t) {
|
|
283
287
|
return t ? s > e : !1;
|
|
284
288
|
}
|
|
285
|
-
class
|
|
289
|
+
class Ui extends R {
|
|
286
290
|
name = "columnVirtualization";
|
|
287
291
|
get defaultConfig() {
|
|
288
292
|
return {
|
|
@@ -301,16 +305,16 @@ class ji extends R {
|
|
|
301
305
|
attach(e) {
|
|
302
306
|
super.attach(e);
|
|
303
307
|
const t = this.columns;
|
|
304
|
-
this.columnWidths =
|
|
308
|
+
this.columnWidths = ge(t), this.columnOffsets = pe(t), this.totalWidth = me(t), this.endCol = t.length - 1;
|
|
305
309
|
}
|
|
306
310
|
detach() {
|
|
307
311
|
this.columnWidths = [], this.columnOffsets = [], this.isVirtualized = !1, this.startCol = 0, this.endCol = 0, this.scrollLeft = 0, this.totalWidth = 0;
|
|
308
312
|
}
|
|
309
313
|
processColumns(e) {
|
|
310
|
-
const t =
|
|
311
|
-
if (this.isVirtualized = t ?? !1, this.columnWidths =
|
|
314
|
+
const t = at(e.length, this.config.threshold ?? 30, this.config.autoEnable ?? !0);
|
|
315
|
+
if (this.isVirtualized = t ?? !1, this.columnWidths = ge(e), this.columnOffsets = pe(e), this.totalWidth = me(e), !t)
|
|
312
316
|
return this.startCol = 0, this.endCol = e.length - 1, [...e];
|
|
313
|
-
const i = this.grid.clientWidth || 800, n =
|
|
317
|
+
const i = this.grid.clientWidth || 800, n = ot(
|
|
314
318
|
this.scrollLeft,
|
|
315
319
|
i,
|
|
316
320
|
this.columnOffsets,
|
|
@@ -354,7 +358,7 @@ const $ = "@layer tbw-plugins{.tbw-context-menu{position:fixed;background:var(--
|
|
|
354
358
|
function te(s, e) {
|
|
355
359
|
return (typeof s == "function" ? s(e) : s).filter((i) => !(i.hidden === !0 || typeof i.hidden == "function" && i.hidden(e)));
|
|
356
360
|
}
|
|
357
|
-
function
|
|
361
|
+
function lt(s, e) {
|
|
358
362
|
return s.disabled === !0 ? !0 : typeof s.disabled == "function" ? s.disabled(e) : !1;
|
|
359
363
|
}
|
|
360
364
|
function ie(s, e, t, i = Ue.submenuArrow) {
|
|
@@ -368,7 +372,7 @@ function ie(s, e, t, i = Ue.submenuArrow) {
|
|
|
368
372
|
}
|
|
369
373
|
const o = document.createElement("div");
|
|
370
374
|
o.className = "tbw-context-menu-item", r.cssClass && o.classList.add(r.cssClass), o.setAttribute("role", "menuitem"), o.setAttribute("data-id", r.id);
|
|
371
|
-
const a =
|
|
375
|
+
const a = lt(r, e);
|
|
372
376
|
if (a && (o.classList.add("disabled"), o.setAttribute("aria-disabled", "true")), r.icon) {
|
|
373
377
|
const d = document.createElement("span");
|
|
374
378
|
d.className = "tbw-context-menu-icon", d.innerHTML = r.icon, o.appendChild(d);
|
|
@@ -420,7 +424,7 @@ const U = [
|
|
|
420
424
|
}
|
|
421
425
|
}
|
|
422
426
|
];
|
|
423
|
-
class
|
|
427
|
+
class Yi extends R {
|
|
424
428
|
name = "contextMenu";
|
|
425
429
|
get defaultConfig() {
|
|
426
430
|
return {
|
|
@@ -457,14 +461,14 @@ class Ui extends R {
|
|
|
457
461
|
const r = n.target, o = r.closest("[data-row][data-col]"), a = r.closest(".header-cell");
|
|
458
462
|
let l;
|
|
459
463
|
if (o) {
|
|
460
|
-
const c = parseInt(o.getAttribute("data-row") ?? "-1", 10), u = parseInt(o.getAttribute("data-col") ?? "-1", 10), h = this.columns[u],
|
|
464
|
+
const c = parseInt(o.getAttribute("data-row") ?? "-1", 10), u = parseInt(o.getAttribute("data-col") ?? "-1", 10), h = this.columns[u], f = this.rows[c];
|
|
461
465
|
l = {
|
|
462
|
-
row:
|
|
466
|
+
row: f,
|
|
463
467
|
rowIndex: c,
|
|
464
468
|
column: h,
|
|
465
469
|
columnIndex: u,
|
|
466
470
|
field: h?.field ?? "",
|
|
467
|
-
value:
|
|
471
|
+
value: f?.[h?.field] ?? null,
|
|
468
472
|
isHeader: !1,
|
|
469
473
|
event: n
|
|
470
474
|
};
|
|
@@ -521,12 +525,12 @@ class Ui extends R {
|
|
|
521
525
|
return this.isOpen;
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
|
-
const
|
|
525
|
-
function
|
|
528
|
+
const dt = "@layer tbw-plugins{tbw-grid{--tbw-editing-bg: var(--tbw-color-selection);--tbw-editing-row-bg: var(--tbw-editing-bg);--tbw-editing-border: var(--tbw-border-input, 1px solid var(--tbw-color-border-strong));--tbw-padding-editing-input: var(--tbw-cell-padding-input, 2px 6px);--tbw-font-size-editor: inherit;--tbw-editing-row-outline-color: var(--tbw-color-accent);--tbw-editing-row-outline-width: 1px;.data-grid-row:has(.editing){background:var(--tbw-editing-row-bg);outline:var(--tbw-editing-row-outline-width) solid var(--tbw-editing-row-outline-color);outline-offset:calc(-1 * var(--tbw-editing-row-outline-width))}.data-grid-row>.cell.editing{overflow:hidden;padding:0;display:flex;min-height:calc(var(--tbw-row-height) + 2px);align-items:center;justify-content:center}.data-grid-row>.cell.editing input:not([type=checkbox]),.data-grid-row>.cell.editing select,.data-grid-row>.cell.editing textarea{width:100%;height:100%;flex:1 1 auto;min-width:0;border:var(--tbw-editing-border);padding:var(--tbw-padding-editing-input);font-size:var(--tbw-font-size-editor)}.tbw-editor-host{display:contents}}}";
|
|
529
|
+
function ct(s) {
|
|
526
530
|
const e = s.options;
|
|
527
531
|
return e ? typeof e == "function" ? e() : e : [];
|
|
528
532
|
}
|
|
529
|
-
function
|
|
533
|
+
function ut(s) {
|
|
530
534
|
return (e) => {
|
|
531
535
|
const t = s.editorParams, i = document.createElement("input");
|
|
532
536
|
i.type = "number", i.value = e.value != null ? String(e.value) : "", t?.min !== void 0 && (i.min = String(t.min)), t?.max !== void 0 && (i.max = String(t.max)), t?.step !== void 0 && (i.step = String(t.step)), t?.placeholder && (i.placeholder = t.placeholder);
|
|
@@ -536,13 +540,13 @@ function ct(s) {
|
|
|
536
540
|
}), i;
|
|
537
541
|
};
|
|
538
542
|
}
|
|
539
|
-
function
|
|
543
|
+
function ht() {
|
|
540
544
|
return (s) => {
|
|
541
545
|
const e = document.createElement("input");
|
|
542
546
|
return e.type = "checkbox", e.checked = !!s.value, e.addEventListener("change", () => s.commit(e.checked)), e;
|
|
543
547
|
};
|
|
544
548
|
}
|
|
545
|
-
function
|
|
549
|
+
function ft(s) {
|
|
546
550
|
return (e) => {
|
|
547
551
|
const t = s.editorParams, i = document.createElement("input");
|
|
548
552
|
return i.type = "date", e.value instanceof Date && (i.valueAsDate = e.value), t?.min && (i.min = t.min), t?.max && (i.max = t.max), t?.placeholder && (i.placeholder = t.placeholder), i.addEventListener("change", () => e.commit(i.valueAsDate)), i.addEventListener("keydown", (n) => {
|
|
@@ -557,7 +561,7 @@ function gt(s) {
|
|
|
557
561
|
const o = document.createElement("option");
|
|
558
562
|
o.value = "", o.textContent = t.emptyLabel ?? "", i.appendChild(o);
|
|
559
563
|
}
|
|
560
|
-
|
|
564
|
+
ct(s).forEach((o) => {
|
|
561
565
|
const a = document.createElement("option");
|
|
562
566
|
a.value = String(o.value), a.textContent = o.label, (s.multi && Array.isArray(e.value) && e.value.includes(o.value) || !s.multi && e.value === o.value) && (a.selected = !0), i.appendChild(a);
|
|
563
567
|
});
|
|
@@ -573,7 +577,7 @@ function gt(s) {
|
|
|
573
577
|
}), i;
|
|
574
578
|
};
|
|
575
579
|
}
|
|
576
|
-
function
|
|
580
|
+
function pt(s) {
|
|
577
581
|
return (e) => {
|
|
578
582
|
const t = s.editorParams, i = document.createElement("input");
|
|
579
583
|
return i.type = "text", i.value = e.value != null ? String(e.value) : "", t?.maxLength !== void 0 && (i.maxLength = t.maxLength), t?.pattern && (i.pattern = t.pattern), t?.placeholder && (i.placeholder = t.placeholder), i.addEventListener("blur", () => e.commit(i.value)), i.addEventListener("keydown", (n) => {
|
|
@@ -581,22 +585,22 @@ function ft(s) {
|
|
|
581
585
|
}), i;
|
|
582
586
|
};
|
|
583
587
|
}
|
|
584
|
-
function
|
|
588
|
+
function mt(s) {
|
|
585
589
|
switch (s.type) {
|
|
586
590
|
case "number":
|
|
587
|
-
return
|
|
591
|
+
return ut(s);
|
|
588
592
|
case "boolean":
|
|
589
|
-
return
|
|
593
|
+
return ht();
|
|
590
594
|
case "date":
|
|
591
|
-
return
|
|
595
|
+
return ft(s);
|
|
592
596
|
case "select":
|
|
593
597
|
return gt(s);
|
|
594
598
|
default:
|
|
595
|
-
return
|
|
599
|
+
return pt(s);
|
|
596
600
|
}
|
|
597
601
|
}
|
|
598
602
|
const Y = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
599
|
-
function
|
|
603
|
+
function wt(s, e) {
|
|
600
604
|
if (e.editor) return e.editor;
|
|
601
605
|
if (e.__editorTemplate) return "template";
|
|
602
606
|
if (!e.type) return;
|
|
@@ -613,11 +617,11 @@ function mt(s, e) {
|
|
|
613
617
|
function K(s) {
|
|
614
618
|
return !(typeof s != "string" || s === "__proto__" || s === "constructor" || s === "prototype");
|
|
615
619
|
}
|
|
616
|
-
function
|
|
620
|
+
function bt(s) {
|
|
617
621
|
const e = (s.__editingCellCount ?? 0) + 1;
|
|
618
622
|
s.__editingCellCount = e, s.setAttribute("data-has-editing", "");
|
|
619
623
|
}
|
|
620
|
-
function
|
|
624
|
+
function vt(s) {
|
|
621
625
|
s.__editingCellCount = 0, s.removeAttribute("data-has-editing");
|
|
622
626
|
}
|
|
623
627
|
function N(s, e) {
|
|
@@ -625,13 +629,13 @@ function N(s, e) {
|
|
|
625
629
|
}
|
|
626
630
|
function be(s) {
|
|
627
631
|
}
|
|
628
|
-
function
|
|
632
|
+
function yt(s, e, t) {
|
|
629
633
|
const i = s.querySelector("input,textarea,select");
|
|
630
634
|
i && (i.addEventListener("blur", () => {
|
|
631
635
|
t(N(i, e));
|
|
632
636
|
}), i instanceof HTMLInputElement && i.type === "checkbox" ? i.addEventListener("change", () => t(i.checked)) : i instanceof HTMLSelectElement && i.addEventListener("change", () => t(N(i, e))));
|
|
633
637
|
}
|
|
634
|
-
class
|
|
638
|
+
class Xi extends R {
|
|
635
639
|
static manifest = {
|
|
636
640
|
ownedProperties: [
|
|
637
641
|
{
|
|
@@ -653,7 +657,7 @@ class Yi extends R {
|
|
|
653
657
|
]
|
|
654
658
|
};
|
|
655
659
|
name = "editing";
|
|
656
|
-
styles =
|
|
660
|
+
styles = dt;
|
|
657
661
|
get defaultConfig() {
|
|
658
662
|
return {
|
|
659
663
|
editOn: "click"
|
|
@@ -743,12 +747,12 @@ class Yi extends R {
|
|
|
743
747
|
}
|
|
744
748
|
});
|
|
745
749
|
this.gridElement.dispatchEvent(h);
|
|
746
|
-
const
|
|
750
|
+
const f = new CustomEvent("activate-cell", {
|
|
747
751
|
cancelable: !0,
|
|
748
752
|
bubbles: !0,
|
|
749
753
|
detail: { row: n, col: r }
|
|
750
754
|
});
|
|
751
|
-
return this.gridElement.dispatchEvent(
|
|
755
|
+
return this.gridElement.dispatchEvent(f), h.defaultPrevented || f.defaultPrevented ? (e.preventDefault(), !0) : (this.beginBulkEdit(n), !0);
|
|
752
756
|
}
|
|
753
757
|
return !1;
|
|
754
758
|
}
|
|
@@ -886,8 +890,8 @@ class Yi extends R {
|
|
|
886
890
|
if (!u) return;
|
|
887
891
|
const h = d.querySelector("input,textarea,select");
|
|
888
892
|
if (h) {
|
|
889
|
-
const
|
|
890
|
-
r[u.field] !==
|
|
893
|
+
const f = N(h, u);
|
|
894
|
+
r[u.field] !== f && this.#u(e, u, f, r);
|
|
891
895
|
}
|
|
892
896
|
}), t && n && r)
|
|
893
897
|
Object.keys(n).forEach((l) => {
|
|
@@ -902,13 +906,13 @@ class Yi extends R {
|
|
|
902
906
|
changed: l,
|
|
903
907
|
changedRows: this.changedRows,
|
|
904
908
|
changedRowIds: this.changedRowIds
|
|
905
|
-
});
|
|
909
|
+
}), l && this.isAnimationEnabled && i.animateRow?.(e, "change");
|
|
906
910
|
}
|
|
907
911
|
this.#o.delete(e), this.#e = -1, this.#t = -1, this.#l();
|
|
908
912
|
for (const l of this.#n)
|
|
909
913
|
l.startsWith(`${e}:`) && this.#n.delete(l);
|
|
910
914
|
o && (o.querySelectorAll(".cell.editing").forEach((l) => {
|
|
911
|
-
l.classList.remove("editing"),
|
|
915
|
+
l.classList.remove("editing"), vt(l.parentElement);
|
|
912
916
|
}), this.requestRender()), this.#s = !0, o || (this.#h(i), this.#s = !1);
|
|
913
917
|
}
|
|
914
918
|
#u(e, t, i, n) {
|
|
@@ -922,7 +926,7 @@ class Yi extends R {
|
|
|
922
926
|
l = this.grid.getRowId(n);
|
|
923
927
|
} catch {
|
|
924
928
|
}
|
|
925
|
-
const d = l ? !this.#i.has(l) : !0, c = l ? (
|
|
929
|
+
const d = l ? !this.#i.has(l) : !0, c = l ? (f) => this.grid.updateRow(l, f, "cascade") : be;
|
|
926
930
|
if (this.emitCancelable("cell-commit", {
|
|
927
931
|
row: n,
|
|
928
932
|
rowId: l ?? "",
|
|
@@ -937,7 +941,7 @@ class Yi extends R {
|
|
|
937
941
|
})) return;
|
|
938
942
|
n[r] = i, l && this.#i.add(l), this.#l();
|
|
939
943
|
const h = a.findRenderedRowElement?.(e);
|
|
940
|
-
h && h.classList.add("changed");
|
|
944
|
+
h && (h.classList.add("changed"), Ye(h, "change"));
|
|
941
945
|
}
|
|
942
946
|
#p(e, t, i, n, r, o) {
|
|
943
947
|
if (!i.editable || r.classList.contains("editing")) return;
|
|
@@ -949,23 +953,23 @@ class Yi extends R {
|
|
|
949
953
|
const l = a ? (v) => this.grid.updateRow(a, v, "cascade") : be, d = K(i.field) ? e[i.field] : void 0;
|
|
950
954
|
r.classList.add("editing"), this.#n.add(`${t}:${n}`);
|
|
951
955
|
const c = r.parentElement;
|
|
952
|
-
c &&
|
|
956
|
+
c && bt(c);
|
|
953
957
|
let u = !1;
|
|
954
958
|
const h = (v) => {
|
|
955
959
|
u || this.#e === -1 || this.#u(t, i, v, e);
|
|
956
|
-
},
|
|
960
|
+
}, f = () => {
|
|
957
961
|
u = !0, K(i.field) && (e[i.field] = d);
|
|
958
|
-
},
|
|
959
|
-
|
|
960
|
-
v.key === "Enter" && (v.stopPropagation(), v.preventDefault(), u = !0, this.#r(t, !1)), v.key === "Escape" && (v.stopPropagation(), v.preventDefault(),
|
|
962
|
+
}, g = document.createElement("div");
|
|
963
|
+
g.className = "tbw-editor-host", r.innerHTML = "", r.appendChild(g), g.addEventListener("keydown", (v) => {
|
|
964
|
+
v.key === "Enter" && (v.stopPropagation(), v.preventDefault(), u = !0, this.#r(t, !1)), v.key === "Escape" && (v.stopPropagation(), v.preventDefault(), f(), this.#r(t, !0));
|
|
961
965
|
});
|
|
962
|
-
const p = i, m = p.__editorTemplate, w =
|
|
966
|
+
const p = i, m = p.__editorTemplate, w = wt(this.grid, p) ?? mt(i), b = d;
|
|
963
967
|
if (w === "template" && m)
|
|
964
|
-
this.#a(
|
|
968
|
+
this.#a(g, p, e, d, h, f, o, t);
|
|
965
969
|
else if (typeof w == "string") {
|
|
966
970
|
const v = document.createElement(w);
|
|
967
|
-
v.value = b, v.addEventListener("change", () => h(v.value)),
|
|
968
|
-
|
|
971
|
+
v.value = b, v.addEventListener("change", () => h(v.value)), g.appendChild(v), o || queueMicrotask(() => {
|
|
972
|
+
g.querySelector(Y)?.focus({ preventScroll: !0 });
|
|
969
973
|
});
|
|
970
974
|
} else if (typeof w == "function") {
|
|
971
975
|
const v = {
|
|
@@ -975,34 +979,34 @@ class Yi extends R {
|
|
|
975
979
|
field: i.field,
|
|
976
980
|
column: i,
|
|
977
981
|
commit: h,
|
|
978
|
-
cancel:
|
|
982
|
+
cancel: f,
|
|
979
983
|
updateRow: l
|
|
980
|
-
},
|
|
981
|
-
typeof
|
|
982
|
-
|
|
984
|
+
}, S = w(v);
|
|
985
|
+
typeof S == "string" ? (g.innerHTML = S, yt(g, i, h)) : S instanceof Node && g.appendChild(S), o || queueMicrotask(() => {
|
|
986
|
+
g.querySelector(Y)?.focus({ preventScroll: !0 });
|
|
983
987
|
});
|
|
984
988
|
} else if (w && typeof w == "object") {
|
|
985
989
|
const v = document.createElement("div");
|
|
986
|
-
v.setAttribute("data-external-editor", ""), v.setAttribute("data-field", i.field),
|
|
987
|
-
const
|
|
990
|
+
v.setAttribute("data-external-editor", ""), v.setAttribute("data-field", i.field), g.appendChild(v);
|
|
991
|
+
const S = {
|
|
988
992
|
row: e,
|
|
989
993
|
rowId: a ?? "",
|
|
990
994
|
value: b,
|
|
991
995
|
field: i.field,
|
|
992
996
|
column: i,
|
|
993
997
|
commit: h,
|
|
994
|
-
cancel:
|
|
998
|
+
cancel: f,
|
|
995
999
|
updateRow: l
|
|
996
1000
|
};
|
|
997
1001
|
if (w.mount)
|
|
998
1002
|
try {
|
|
999
|
-
w.mount({ placeholder: v, context:
|
|
1003
|
+
w.mount({ placeholder: v, context: S, spec: w });
|
|
1000
1004
|
} catch (q) {
|
|
1001
1005
|
console.warn(`[tbw-grid] External editor mount error for column '${i.field}':`, q);
|
|
1002
1006
|
}
|
|
1003
1007
|
else
|
|
1004
1008
|
this.grid.dispatchEvent(
|
|
1005
|
-
new CustomEvent("mount-external-editor", { detail: { placeholder: v, spec: w, context:
|
|
1009
|
+
new CustomEvent("mount-external-editor", { detail: { placeholder: v, spec: w, context: S } })
|
|
1006
1010
|
);
|
|
1007
1011
|
}
|
|
1008
1012
|
}
|
|
@@ -1017,8 +1021,8 @@ class Yi extends R {
|
|
|
1017
1021
|
column: t,
|
|
1018
1022
|
commit: r,
|
|
1019
1023
|
cancel: o
|
|
1020
|
-
}) : c.querySelectorAll("*").forEach((
|
|
1021
|
-
|
|
1024
|
+
}) : c.querySelectorAll("*").forEach((f) => {
|
|
1025
|
+
f.childNodes.length === 1 && f.firstChild?.nodeType === Node.TEXT_NODE && (f.textContent = f.textContent?.replace(/{{\s*value\s*}}/g, n == null ? "" : String(n)).replace(/{{\s*row\.([a-zA-Z0-9_]+)\s*}}/g, (g, p) => {
|
|
1022
1026
|
if (!K(p)) return "";
|
|
1023
1027
|
const m = i[p];
|
|
1024
1028
|
return m == null ? "" : String(m);
|
|
@@ -1029,12 +1033,12 @@ class Yi extends R {
|
|
|
1029
1033
|
);
|
|
1030
1034
|
if (h) {
|
|
1031
1035
|
h instanceof HTMLInputElement && h.type === "checkbox" ? h.checked = !!n : h.value = String(n ?? "");
|
|
1032
|
-
let
|
|
1036
|
+
let f = !1;
|
|
1033
1037
|
h.addEventListener("blur", () => {
|
|
1034
|
-
|
|
1035
|
-
}), h.addEventListener("keydown", (
|
|
1036
|
-
const p =
|
|
1037
|
-
p.key === "Enter" && (p.stopPropagation(), p.preventDefault(),
|
|
1038
|
+
f || r(N(h, t));
|
|
1039
|
+
}), h.addEventListener("keydown", (g) => {
|
|
1040
|
+
const p = g;
|
|
1041
|
+
p.key === "Enter" && (p.stopPropagation(), p.preventDefault(), f = !0, r(N(h, t)), this.#r(l, !1)), p.key === "Escape" && (p.stopPropagation(), p.preventDefault(), o(), this.#r(l, !0));
|
|
1038
1042
|
}), h instanceof HTMLInputElement && h.type === "checkbox" && h.addEventListener("change", () => r(h.checked)), a || setTimeout(() => h.focus({ preventScroll: !0 }), 0);
|
|
1039
1043
|
}
|
|
1040
1044
|
e.appendChild(c);
|
|
@@ -1063,7 +1067,7 @@ function ve(s, e = !0) {
|
|
|
1063
1067
|
return e && (t.includes(",") || t.includes('"') || t.includes(`
|
|
1064
1068
|
`) || t.includes("\r")) ? `"${t.replace(/"/g, '""')}"` : t;
|
|
1065
1069
|
}
|
|
1066
|
-
function
|
|
1070
|
+
function Ct(s, e, t, i = {}) {
|
|
1067
1071
|
const n = i.delimiter ?? ",", r = i.newline ?? `
|
|
1068
1072
|
`, o = [], a = i.bom ? "\uFEFF" : "";
|
|
1069
1073
|
if (t.includeHeaders !== !1) {
|
|
@@ -1093,7 +1097,7 @@ function xt(s, e) {
|
|
|
1093
1097
|
function ye(s) {
|
|
1094
1098
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1095
1099
|
}
|
|
1096
|
-
function
|
|
1100
|
+
function Rt(s, e, t) {
|
|
1097
1101
|
let i = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1098
1102
|
<?mso-application progid="Excel.Sheet"?>
|
|
1099
1103
|
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
|
@@ -1125,13 +1129,13 @@ function Ct(s, e, t) {
|
|
|
1125
1129
|
</Worksheet>
|
|
1126
1130
|
</Workbook>`, i;
|
|
1127
1131
|
}
|
|
1128
|
-
function
|
|
1132
|
+
function Et(s, e) {
|
|
1129
1133
|
const t = e.endsWith(".xls") ? e : `${e}.xls`, i = new Blob([s], {
|
|
1130
1134
|
type: "application/vnd.ms-excel;charset=utf-8;"
|
|
1131
1135
|
});
|
|
1132
1136
|
se(i, t);
|
|
1133
1137
|
}
|
|
1134
|
-
class
|
|
1138
|
+
class Zi extends R {
|
|
1135
1139
|
name = "export";
|
|
1136
1140
|
get defaultConfig() {
|
|
1137
1141
|
return {
|
|
@@ -1168,21 +1172,21 @@ class Xi extends R {
|
|
|
1168
1172
|
try {
|
|
1169
1173
|
switch (e) {
|
|
1170
1174
|
case "csv": {
|
|
1171
|
-
const l =
|
|
1175
|
+
const l = Ct(o, r, n, { bom: !0 });
|
|
1172
1176
|
a = a.endsWith(".csv") ? a : `${a}.csv`, xt(l, a);
|
|
1173
1177
|
break;
|
|
1174
1178
|
}
|
|
1175
1179
|
case "excel": {
|
|
1176
|
-
const l =
|
|
1177
|
-
a = a.endsWith(".xls") ? a : `${a}.xls`,
|
|
1180
|
+
const l = Rt(o, r, n);
|
|
1181
|
+
a = a.endsWith(".xls") ? a : `${a}.xls`, Et(l, a);
|
|
1178
1182
|
break;
|
|
1179
1183
|
}
|
|
1180
1184
|
case "json": {
|
|
1181
1185
|
const l = o.map((u) => {
|
|
1182
1186
|
const h = {};
|
|
1183
|
-
for (const
|
|
1184
|
-
let
|
|
1185
|
-
n.processCell && (
|
|
1187
|
+
for (const f of r) {
|
|
1188
|
+
let g = u[f.field];
|
|
1189
|
+
n.processCell && (g = n.processCell(g, f.field, u)), h[f.field] = g;
|
|
1186
1190
|
}
|
|
1187
1191
|
return h;
|
|
1188
1192
|
}), d = JSON.stringify(l, null, 2);
|
|
@@ -1225,7 +1229,7 @@ class Xi extends R {
|
|
|
1225
1229
|
return this.lastExportInfo;
|
|
1226
1230
|
}
|
|
1227
1231
|
}
|
|
1228
|
-
function
|
|
1232
|
+
function St(s) {
|
|
1229
1233
|
const { totalRows: e, viewportHeight: t, scrollTop: i, rowHeight: n, overscan: r } = s, o = Math.ceil(t / n);
|
|
1230
1234
|
let a = Math.floor(i / n) - r;
|
|
1231
1235
|
a < 0 && (a = 0);
|
|
@@ -1240,7 +1244,7 @@ function Et(s) {
|
|
|
1240
1244
|
function kt(s, e) {
|
|
1241
1245
|
return s <= e;
|
|
1242
1246
|
}
|
|
1243
|
-
function
|
|
1247
|
+
function At(s, e, t = !1) {
|
|
1244
1248
|
const i = s[e.field];
|
|
1245
1249
|
if (e.operator === "blank")
|
|
1246
1250
|
return i == null || i === "";
|
|
@@ -1279,10 +1283,10 @@ function St(s, e, t = !1) {
|
|
|
1279
1283
|
return !0;
|
|
1280
1284
|
}
|
|
1281
1285
|
}
|
|
1282
|
-
function
|
|
1283
|
-
return e.length ? s.filter((i) => e.every((n) =>
|
|
1286
|
+
function _t(s, e, t = !1) {
|
|
1287
|
+
return e.length ? s.filter((i) => e.every((n) => At(i, n, t))) : s;
|
|
1284
1288
|
}
|
|
1285
|
-
function
|
|
1289
|
+
function Lt(s) {
|
|
1286
1290
|
return JSON.stringify(
|
|
1287
1291
|
s.map((e) => ({
|
|
1288
1292
|
field: e.field,
|
|
@@ -1292,7 +1296,7 @@ function _t(s) {
|
|
|
1292
1296
|
}))
|
|
1293
1297
|
);
|
|
1294
1298
|
}
|
|
1295
|
-
function
|
|
1299
|
+
function Ce(s, e) {
|
|
1296
1300
|
const t = /* @__PURE__ */ new Set();
|
|
1297
1301
|
for (const i of s) {
|
|
1298
1302
|
const n = i[e];
|
|
@@ -1300,10 +1304,10 @@ function xe(s, e) {
|
|
|
1300
1304
|
}
|
|
1301
1305
|
return [...t].sort((i, n) => typeof i == "number" && typeof n == "number" ? i - n : String(i).localeCompare(String(n)));
|
|
1302
1306
|
}
|
|
1303
|
-
const
|
|
1307
|
+
const Tt = '@layer tbw-plugins{tbw-grid{.tbw-quick-filter-input{flex:1;max-width:300px;height:var(--tbw-input-height, 1.75rem);padding:var(--tbw-input-padding, 0 .5rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);color:var(--tbw-color-fg);font-size:var(--tbw-font-size-sm, .8125rem);&:focus{outline:none;border-color:var(--tbw-color-accent)}}.header-cell.filtered:before{content:"";position:absolute;top:var(--tbw-spacing-xs, .25rem);right:var(--tbw-spacing-xs, .25rem);width:var(--tbw-indicator-size, .375rem);height:var(--tbw-indicator-size, .375rem);background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}.tbw-filter-btn{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:var(--tbw-spacing-xs, .25rem);opacity:.4;transition:opacity .15s;color:inherit;vertical-align:middle;&:hover,&.active{opacity:1}&.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}}}}', It = "@layer tbw-plugins{.tbw-filter-panel{position:fixed;background:var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));color:var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));border:1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-panel-radius, var(--tbw-border-radius, .25rem));box-shadow:0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3))));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));z-index:10000;min-width:200px;max-width:280px;max-height:350px;display:flex;flex-direction:column;font-family:var(--tbw-font-family, system-ui, sans-serif);font-size:var(--tbw-font-size, .8125rem);transform-origin:top center}.tbw-filter-panel.tbw-filter-panel-above{transform-origin:bottom center}.tbw-filter-panel.tbw-filter-panel-animated{animation:tbw-filter-panel-enter var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}.tbw-filter-panel.tbw-filter-panel-above.tbw-filter-panel-animated{animation:tbw-filter-panel-enter-above var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}@keyframes tbw-filter-panel-enter{0%{opacity:0;transform:scaleY(.3) translateY(-10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@keyframes tbw-filter-panel-enter-above{0%{opacity:0;transform:scaleY(.3) translateY(10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@supports (anchor-name: --test){.tbw-filter-panel{position-anchor:--tbw-filter-anchor;top:anchor(bottom);left:anchor(left);margin-top:4px;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.tbw-filter-search{margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-search-input{width:100%;padding:var(--tbw-button-padding, .375rem .625rem);background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-search-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-actions{display:flex;padding:var(--tbw-button-padding-sm, .25rem .125rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-action-btn{background:transparent;border:none;color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));cursor:pointer;font-size:var(--tbw-font-size-xs, .75rem);padding:2px 0}.tbw-filter-action-btn:hover{text-decoration:underline}.tbw-filter-values{flex:1;overflow-y:auto;margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));max-height:180px;position:relative}.tbw-filter-values-spacer{width:1px}.tbw-filter-values-content{position:absolute;top:0;left:0;right:0}.tbw-filter-value-item{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding-sm, .25rem .125rem);cursor:pointer;border-radius:3px}.tbw-filter-value-item:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-checkbox{margin:0;cursor:pointer;accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}.tbw-filter-no-match{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem)) 0;text-align:center;font-style:italic}.tbw-filter-buttons{display:flex;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding-top:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-top:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-apply-btn{flex:1;padding:var(--tbw-button-padding, .375rem .75rem);background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));color:var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));border:none;border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-filter-apply-btn:hover{filter:brightness(.9)}.tbw-filter-clear-btn{flex:1;padding:var(--tbw-button-padding, .375rem .75rem);background:transparent;color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-filter-clear-btn:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}}";
|
|
1304
1308
|
class A extends R {
|
|
1305
1309
|
name = "filtering";
|
|
1306
|
-
styles =
|
|
1310
|
+
styles = Tt;
|
|
1307
1311
|
get defaultConfig() {
|
|
1308
1312
|
return {
|
|
1309
1313
|
debounceMs: 300,
|
|
@@ -1339,10 +1343,10 @@ class A extends R {
|
|
|
1339
1343
|
if (!t.length) return [...e];
|
|
1340
1344
|
if (this.config.filterHandler)
|
|
1341
1345
|
return this.cachedResult ? this.cachedResult : [...e];
|
|
1342
|
-
const i =
|
|
1346
|
+
const i = Lt(t);
|
|
1343
1347
|
if (this.cacheKey === i && this.cachedResult)
|
|
1344
1348
|
return this.cachedResult;
|
|
1345
|
-
const n =
|
|
1349
|
+
const n = _t([...e], t, this.config.caseSensitive);
|
|
1346
1350
|
return this.cachedResult = n, this.cacheKey = i, n;
|
|
1347
1351
|
}
|
|
1348
1352
|
afterRender() {
|
|
@@ -1414,7 +1418,7 @@ class A extends R {
|
|
|
1414
1418
|
return this.getFilters();
|
|
1415
1419
|
}
|
|
1416
1420
|
getUniqueValues(e) {
|
|
1417
|
-
return
|
|
1421
|
+
return Ce(this.sourceRows, e);
|
|
1418
1422
|
}
|
|
1419
1423
|
injectGlobalStyles() {
|
|
1420
1424
|
if (this.globalStylesInjected) return;
|
|
@@ -1423,7 +1427,7 @@ class A extends R {
|
|
|
1423
1427
|
return;
|
|
1424
1428
|
}
|
|
1425
1429
|
const e = document.createElement("style");
|
|
1426
|
-
e.id = "tbw-filter-panel-styles", e.textContent =
|
|
1430
|
+
e.id = "tbw-filter-panel-styles", e.textContent = It, document.head.appendChild(e), this.globalStylesInjected = !0;
|
|
1427
1431
|
}
|
|
1428
1432
|
toggleFilterPanel(e, t, i) {
|
|
1429
1433
|
if (this.openPanelField === e) {
|
|
@@ -1438,7 +1442,7 @@ class A extends R {
|
|
|
1438
1442
|
});
|
|
1439
1443
|
return;
|
|
1440
1444
|
}
|
|
1441
|
-
const r =
|
|
1445
|
+
const r = Ce(this.sourceRows, e);
|
|
1442
1446
|
this.renderPanelContent(e, t, n, r), document.body.appendChild(n), this.positionPanel(n, i), this.setupPanelCloseHandler(n, i);
|
|
1443
1447
|
}
|
|
1444
1448
|
renderPanelContent(e, t, i, n) {
|
|
@@ -1512,7 +1516,7 @@ class A extends R {
|
|
|
1512
1516
|
const u = document.createElement("span");
|
|
1513
1517
|
u.textContent = "Select All", d.appendChild(c), d.appendChild(u), l.appendChild(d);
|
|
1514
1518
|
const h = () => {
|
|
1515
|
-
const y = [...m.values()], E = y.every((
|
|
1519
|
+
const y = [...m.values()], E = y.every((C) => C), _ = y.every((C) => !C);
|
|
1516
1520
|
c.checked = E, c.indeterminate = !E && !_;
|
|
1517
1521
|
};
|
|
1518
1522
|
c.addEventListener("change", () => {
|
|
@@ -1521,12 +1525,12 @@ class A extends R {
|
|
|
1521
1525
|
m.set(E, y);
|
|
1522
1526
|
h(), v();
|
|
1523
1527
|
}), e.appendChild(l);
|
|
1524
|
-
const g = document.createElement("div");
|
|
1525
|
-
g.className = "tbw-filter-values";
|
|
1526
1528
|
const f = document.createElement("div");
|
|
1527
|
-
f.className = "tbw-filter-values
|
|
1529
|
+
f.className = "tbw-filter-values";
|
|
1530
|
+
const g = document.createElement("div");
|
|
1531
|
+
g.className = "tbw-filter-values-spacer", f.appendChild(g);
|
|
1528
1532
|
const p = document.createElement("div");
|
|
1529
|
-
p.className = "tbw-filter-values-content",
|
|
1533
|
+
p.className = "tbw-filter-values-content", f.appendChild(p);
|
|
1530
1534
|
const m = /* @__PURE__ */ new Map();
|
|
1531
1535
|
i.forEach((y) => {
|
|
1532
1536
|
const E = y == null ? "__null__" : String(y);
|
|
@@ -1534,56 +1538,56 @@ class A extends R {
|
|
|
1534
1538
|
}), h();
|
|
1535
1539
|
let w = [];
|
|
1536
1540
|
const b = (y, E) => {
|
|
1537
|
-
const _ = y == null ? "(Blank)" : String(y),
|
|
1538
|
-
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
m.set(
|
|
1541
|
+
const _ = y == null ? "(Blank)" : String(y), C = y == null ? "__null__" : String(y), x = document.createElement("label");
|
|
1542
|
+
x.className = "tbw-filter-value-item", x.style.position = "absolute", x.style.top = `${E * A.LIST_ITEM_HEIGHT}px`, x.style.left = "0", x.style.right = "0", x.style.height = `${A.LIST_ITEM_HEIGHT}px`, x.style.boxSizing = "border-box";
|
|
1543
|
+
const k = document.createElement("input");
|
|
1544
|
+
k.type = "checkbox", k.className = "tbw-filter-checkbox", k.checked = m.get(C) ?? !0, k.dataset.value = C, k.addEventListener("change", () => {
|
|
1545
|
+
m.set(C, k.checked), h();
|
|
1542
1546
|
});
|
|
1543
1547
|
const le = document.createElement("span");
|
|
1544
|
-
return le.textContent = _,
|
|
1548
|
+
return le.textContent = _, x.appendChild(k), x.appendChild(le), x;
|
|
1545
1549
|
}, v = () => {
|
|
1546
|
-
const y = w.length, E =
|
|
1547
|
-
if (
|
|
1548
|
-
p.innerHTML = "", p.style.transform = "translateY(0px)", w.forEach((
|
|
1549
|
-
p.appendChild(b(
|
|
1550
|
+
const y = w.length, E = f.clientHeight, _ = f.scrollTop;
|
|
1551
|
+
if (g.style.height = `${y * A.LIST_ITEM_HEIGHT}px`, kt(y, A.LIST_BYPASS_THRESHOLD / 3)) {
|
|
1552
|
+
p.innerHTML = "", p.style.transform = "translateY(0px)", w.forEach((x, k) => {
|
|
1553
|
+
p.appendChild(b(x, k));
|
|
1550
1554
|
});
|
|
1551
1555
|
return;
|
|
1552
1556
|
}
|
|
1553
|
-
const
|
|
1557
|
+
const C = St({
|
|
1554
1558
|
totalRows: y,
|
|
1555
1559
|
viewportHeight: E,
|
|
1556
1560
|
scrollTop: _,
|
|
1557
1561
|
rowHeight: A.LIST_ITEM_HEIGHT,
|
|
1558
1562
|
overscan: A.LIST_OVERSCAN
|
|
1559
1563
|
});
|
|
1560
|
-
p.style.transform = `translateY(${
|
|
1561
|
-
for (let
|
|
1562
|
-
p.appendChild(b(w[
|
|
1563
|
-
},
|
|
1564
|
+
p.style.transform = `translateY(${C.offsetY}px)`, p.innerHTML = "";
|
|
1565
|
+
for (let x = C.start; x < C.end; x++)
|
|
1566
|
+
p.appendChild(b(w[x], x - C.start));
|
|
1567
|
+
}, S = (y) => {
|
|
1564
1568
|
const E = this.config.caseSensitive ?? !1, _ = E ? y : y.toLowerCase();
|
|
1565
|
-
if (w = i.filter((
|
|
1566
|
-
const
|
|
1567
|
-
return !y ||
|
|
1569
|
+
if (w = i.filter((C) => {
|
|
1570
|
+
const x = C == null ? "(Blank)" : String(C), k = E ? x : x.toLowerCase();
|
|
1571
|
+
return !y || k.includes(_);
|
|
1568
1572
|
}), w.length === 0) {
|
|
1569
|
-
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1573
|
+
g.style.height = "0px", p.innerHTML = "";
|
|
1574
|
+
const C = document.createElement("div");
|
|
1575
|
+
C.className = "tbw-filter-no-match", C.textContent = "No matching values", p.appendChild(C);
|
|
1572
1576
|
return;
|
|
1573
1577
|
}
|
|
1574
1578
|
v();
|
|
1575
1579
|
};
|
|
1576
|
-
|
|
1580
|
+
f.addEventListener(
|
|
1577
1581
|
"scroll",
|
|
1578
1582
|
() => {
|
|
1579
1583
|
w.length > 0 && v();
|
|
1580
1584
|
},
|
|
1581
1585
|
{ passive: !0 }
|
|
1582
|
-
),
|
|
1586
|
+
), S(a.value), e.appendChild(f);
|
|
1583
1587
|
let q;
|
|
1584
1588
|
a.addEventListener("input", () => {
|
|
1585
1589
|
clearTimeout(q), q = setTimeout(() => {
|
|
1586
|
-
this.searchText.set(r, a.value),
|
|
1590
|
+
this.searchText.set(r, a.value), S(a.value);
|
|
1587
1591
|
}, this.config.debounceMs ?? 150);
|
|
1588
1592
|
});
|
|
1589
1593
|
const z = document.createElement("div");
|
|
@@ -1596,8 +1600,8 @@ class A extends R {
|
|
|
1596
1600
|
if (E === "__null__")
|
|
1597
1601
|
y.push(null);
|
|
1598
1602
|
else {
|
|
1599
|
-
const
|
|
1600
|
-
y.push(
|
|
1603
|
+
const C = i.find((x) => String(x) === E);
|
|
1604
|
+
y.push(C !== void 0 ? C : E);
|
|
1601
1605
|
}
|
|
1602
1606
|
t.applySetFilter(y);
|
|
1603
1607
|
}), z.appendChild(G);
|
|
@@ -1670,7 +1674,7 @@ class A extends R {
|
|
|
1670
1674
|
this.filters.set(e, i), this.cachedResult = null, this.cacheKey = null;
|
|
1671
1675
|
}
|
|
1672
1676
|
}
|
|
1673
|
-
function
|
|
1677
|
+
function xe(s) {
|
|
1674
1678
|
if (!s.length) return [];
|
|
1675
1679
|
const e = /* @__PURE__ */ new Map(), t = [], i = (o, a) => {
|
|
1676
1680
|
if (!a.length) return;
|
|
@@ -1705,7 +1709,7 @@ function Ce(s) {
|
|
|
1705
1709
|
}, e.set(d, c), t.push(c)), c.columns.push(o);
|
|
1706
1710
|
}), n.length && i(r, n), t.length === 1 && t[0].implicit && t[0].columns.length === s.length ? [] : t;
|
|
1707
1711
|
}
|
|
1708
|
-
function
|
|
1712
|
+
function Dt(s, e, t) {
|
|
1709
1713
|
if (!e.length || !s) return;
|
|
1710
1714
|
const i = /* @__PURE__ */ new Map();
|
|
1711
1715
|
for (const r of e)
|
|
@@ -1721,7 +1725,7 @@ function It(s, e, t) {
|
|
|
1721
1725
|
a && a.classList.add("group-end");
|
|
1722
1726
|
}
|
|
1723
1727
|
}
|
|
1724
|
-
function
|
|
1728
|
+
function Ft(s, e) {
|
|
1725
1729
|
if (s.length === 0) return null;
|
|
1726
1730
|
const t = document.createElement("div");
|
|
1727
1731
|
t.className = "header-group-row", t.setAttribute("role", "row");
|
|
@@ -1733,11 +1737,11 @@ function Dt(s, e) {
|
|
|
1733
1737
|
}
|
|
1734
1738
|
return t;
|
|
1735
1739
|
}
|
|
1736
|
-
function
|
|
1740
|
+
function Mt(s) {
|
|
1737
1741
|
return s.some((e) => e.group != null);
|
|
1738
1742
|
}
|
|
1739
|
-
const
|
|
1740
|
-
class
|
|
1743
|
+
const Pt = "@layer tbw-plugins{.header-group-row{display:grid;grid-auto-flow:column;background:var(--tbw-grouping-columns-header-bg, var(--tbw-color-header-bg));border-bottom:1px solid var(--tbw-grouping-columns-border, var(--tbw-color-border))}.header-group-cell{display:flex;align-items:center;justify-content:center;padding:var(--tbw-button-padding-sm, .25rem .5rem);font-weight:600;font-size:var(--tbw-font-size-sm, .9em);text-transform:uppercase;letter-spacing:.5px;border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.header-group-cell:last-child{border-right:none}.header-row .cell.grouped{border-top:none}.header-row .cell.group-end{border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.header-row .cell.group-end:last-child{border-right:none}.rows .cell.group-end{border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.rows .cell.group-end:last-child{border-right:none}.header-group-row.no-borders{border-bottom:none}.header-group-row.no-borders .header-group-cell{border-right:none}.header-row.no-group-borders .cell.group-end{border-right:1px solid var(--tbw-color-border)}}";
|
|
1744
|
+
class Ji extends R {
|
|
1741
1745
|
static manifest = {
|
|
1742
1746
|
ownedProperties: [
|
|
1743
1747
|
{
|
|
@@ -1754,7 +1758,7 @@ class Zi extends R {
|
|
|
1754
1758
|
]
|
|
1755
1759
|
};
|
|
1756
1760
|
name = "groupingColumns";
|
|
1757
|
-
styles =
|
|
1761
|
+
styles = Pt;
|
|
1758
1762
|
get defaultConfig() {
|
|
1759
1763
|
return {
|
|
1760
1764
|
showGroupBorders: !0
|
|
@@ -1769,7 +1773,7 @@ class Zi extends R {
|
|
|
1769
1773
|
if (t?.columnGroups && Array.isArray(t.columnGroups) && t.columnGroups.length > 0)
|
|
1770
1774
|
return !0;
|
|
1771
1775
|
const i = t?.columns;
|
|
1772
|
-
return Array.isArray(i) ?
|
|
1776
|
+
return Array.isArray(i) ? Mt(i) : !1;
|
|
1773
1777
|
}
|
|
1774
1778
|
processColumns(e) {
|
|
1775
1779
|
const t = this.grid?.gridConfig?.columnGroups;
|
|
@@ -1785,7 +1789,7 @@ class Zi extends R {
|
|
|
1785
1789
|
});
|
|
1786
1790
|
} else
|
|
1787
1791
|
i = [...e];
|
|
1788
|
-
const n =
|
|
1792
|
+
const n = xe(i);
|
|
1789
1793
|
return n.length === 0 ? (this.isActive = !1, this.groups = [], i) : (this.isActive = !0, this.groups = n, i);
|
|
1790
1794
|
}
|
|
1791
1795
|
afterRender() {
|
|
@@ -1798,16 +1802,16 @@ class Zi extends R {
|
|
|
1798
1802
|
if (!e) return;
|
|
1799
1803
|
const t = e.querySelector(".header-group-row");
|
|
1800
1804
|
t && t.remove();
|
|
1801
|
-
const i = this.columns, n =
|
|
1805
|
+
const i = this.columns, n = xe(i);
|
|
1802
1806
|
if (n.length === 0) return;
|
|
1803
|
-
const r =
|
|
1807
|
+
const r = Ft(n, i);
|
|
1804
1808
|
if (r) {
|
|
1805
1809
|
r.classList.toggle("no-borders", !this.config.showGroupBorders);
|
|
1806
1810
|
const a = e.querySelector(".header-row");
|
|
1807
1811
|
a ? e.insertBefore(r, a) : e.appendChild(r);
|
|
1808
1812
|
}
|
|
1809
1813
|
const o = e.querySelector(".header-row");
|
|
1810
|
-
o && (o.classList.toggle("no-group-borders", !this.config.showGroupBorders),
|
|
1814
|
+
o && (o.classList.toggle("no-group-borders", !this.config.showGroupBorders), Dt(o, n)), this.#e(n);
|
|
1811
1815
|
}
|
|
1812
1816
|
#e(e) {
|
|
1813
1817
|
if (!this.config.showGroupBorders) return;
|
|
@@ -1838,7 +1842,7 @@ class Zi extends R {
|
|
|
1838
1842
|
this.requestRender();
|
|
1839
1843
|
}
|
|
1840
1844
|
}
|
|
1841
|
-
function
|
|
1845
|
+
function qt({ rows: s, config: e, expanded: t }) {
|
|
1842
1846
|
const i = e.groupOn;
|
|
1843
1847
|
if (typeof i != "function")
|
|
1844
1848
|
return [];
|
|
@@ -1848,9 +1852,9 @@ function Pt({ rows: s, config: e, expanded: t }) {
|
|
|
1848
1852
|
l == null || l === !1 ? l = ["__ungrouped__"] : Array.isArray(l) || (l = [l]);
|
|
1849
1853
|
let d = n;
|
|
1850
1854
|
l.forEach((c, u) => {
|
|
1851
|
-
const h = c == null ? "∅" : String(c),
|
|
1852
|
-
let
|
|
1853
|
-
|
|
1855
|
+
const h = c == null ? "∅" : String(c), f = d.key === "__root__" ? h : d.key + "||" + h;
|
|
1856
|
+
let g = d.children.get(h);
|
|
1857
|
+
g || (g = { key: f, value: c, depth: u, rows: [], children: /* @__PURE__ */ new Map(), parent: d }, d.children.set(h, g)), d = g;
|
|
1854
1858
|
}), d.rows.push(a);
|
|
1855
1859
|
}), n.children.size === 1 && n.children.has("__ungrouped__") && n.children.get("__ungrouped__").rows.length === s.length)
|
|
1856
1860
|
return [];
|
|
@@ -1871,26 +1875,26 @@ function Pt({ rows: s, config: e, expanded: t }) {
|
|
|
1871
1875
|
};
|
|
1872
1876
|
return o(n), r;
|
|
1873
1877
|
}
|
|
1874
|
-
function
|
|
1878
|
+
function Kt(s, e) {
|
|
1875
1879
|
const t = new Set(s);
|
|
1876
1880
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
1877
1881
|
}
|
|
1878
|
-
function
|
|
1882
|
+
function Ht(s) {
|
|
1879
1883
|
const e = /* @__PURE__ */ new Set();
|
|
1880
1884
|
for (const t of s)
|
|
1881
1885
|
t.kind === "group" && e.add(t.key);
|
|
1882
1886
|
return e;
|
|
1883
1887
|
}
|
|
1884
|
-
function
|
|
1888
|
+
function Nt() {
|
|
1885
1889
|
return /* @__PURE__ */ new Set();
|
|
1886
1890
|
}
|
|
1887
|
-
function
|
|
1891
|
+
function zt(s) {
|
|
1888
1892
|
return s.kind !== "group" ? 0 : s.rows.length;
|
|
1889
1893
|
}
|
|
1890
|
-
const
|
|
1891
|
-
class
|
|
1894
|
+
const Gt = "@layer tbw-plugins{.group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-grouping-rows-bg, var(--tbw-color-panel-bg));font-weight:500;border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height)}.group-row .cell{display:flex;align-items:center;padding:var(--tbw-cell-padding, .125rem .5rem)}.group-row:hover{background:var(--tbw-grouping-rows-bg-hover, var(--tbw-color-row-hover))}.group-toggle{cursor:pointer;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toggle-size, 1.25rem);height:var(--tbw-toggle-size, 1.25rem);margin-right:.25rem;background:none;border:0;font:inherit}.group-toggle:hover{background:var(--tbw-grouping-rows-toggle-hover, var(--tbw-color-row-hover));border-radius:var(--tbw-border-radius, .125rem)}.group-label{display:inline-flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.group-count{color:var(--tbw-grouping-rows-count-color, var(--tbw-color-fg-muted));font-size:var(--tbw-font-size-xs, .85em);font-weight:400}.group-row{padding-left:calc(var(--tbw-group-depth, 0) * var(--tbw-group-indent-width, 1.25em))}.data-grid-row.tbw-group-slide-in{animation:tbw-group-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.data-grid-row.tbw-group-fade-in{animation:tbw-group-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-fade-in{0%{opacity:0}to{opacity:1}}}";
|
|
1895
|
+
class Qi extends R {
|
|
1892
1896
|
name = "groupingRows";
|
|
1893
|
-
styles =
|
|
1897
|
+
styles = Gt;
|
|
1894
1898
|
get defaultConfig() {
|
|
1895
1899
|
return {
|
|
1896
1900
|
defaultExpanded: !1,
|
|
@@ -1918,7 +1922,7 @@ class Ji extends R {
|
|
|
1918
1922
|
const t = this.config;
|
|
1919
1923
|
if (typeof t.groupOn != "function")
|
|
1920
1924
|
return this.isActive = !1, this.flattenedRows = [], [...e];
|
|
1921
|
-
const i =
|
|
1925
|
+
const i = qt({
|
|
1922
1926
|
rows: [...e],
|
|
1923
1927
|
config: t,
|
|
1924
1928
|
expanded: this.expandedKeys
|
|
@@ -1939,7 +1943,7 @@ class Ji extends R {
|
|
|
1939
1943
|
__groupDepth: r.depth,
|
|
1940
1944
|
__groupRows: r.rows,
|
|
1941
1945
|
__groupExpanded: r.expanded,
|
|
1942
|
-
__groupRowCount:
|
|
1946
|
+
__groupRowCount: zt(r)
|
|
1943
1947
|
} : r.row);
|
|
1944
1948
|
}
|
|
1945
1949
|
onCellClick(e) {
|
|
@@ -2013,42 +2017,42 @@ class Ji extends R {
|
|
|
2013
2017
|
d && (t.style.display = "grid", t.style.gridTemplateColumns = d);
|
|
2014
2018
|
let c = !1;
|
|
2015
2019
|
o.forEach((u, h) => {
|
|
2016
|
-
const
|
|
2017
|
-
if (
|
|
2018
|
-
|
|
2020
|
+
const f = document.createElement("div");
|
|
2021
|
+
if (f.className = "cell group-cell", f.setAttribute("data-col", String(h)), f.setAttribute("role", "gridcell"), re(u)) {
|
|
2022
|
+
f.setAttribute("data-field", u.field), t.appendChild(f);
|
|
2019
2023
|
return;
|
|
2020
2024
|
}
|
|
2021
2025
|
if (c) {
|
|
2022
|
-
const
|
|
2023
|
-
if (
|
|
2024
|
-
const p = de(
|
|
2025
|
-
|
|
2026
|
+
const g = r[u.field];
|
|
2027
|
+
if (g) {
|
|
2028
|
+
const p = de(g, a, u.field, u);
|
|
2029
|
+
f.textContent = p != null ? String(p) : "";
|
|
2026
2030
|
} else
|
|
2027
|
-
|
|
2031
|
+
f.textContent = "";
|
|
2028
2032
|
} else {
|
|
2029
|
-
c = !0,
|
|
2030
|
-
const
|
|
2033
|
+
c = !0, f.appendChild(this.createToggleButton(e.__groupExpanded, i));
|
|
2034
|
+
const g = document.createElement("span"), p = r[u.field];
|
|
2031
2035
|
if (p) {
|
|
2032
2036
|
const m = de(p, a, u.field, u);
|
|
2033
|
-
|
|
2037
|
+
g.textContent = m != null ? String(m) : String(e.__groupValue);
|
|
2034
2038
|
} else
|
|
2035
|
-
|
|
2036
|
-
if (
|
|
2039
|
+
g.textContent = this.getGroupLabelText(e.__groupValue, e.__groupDepth || 0, e.__groupKey);
|
|
2040
|
+
if (f.appendChild(g), n.showRowCount !== !1) {
|
|
2037
2041
|
const m = document.createElement("span");
|
|
2038
|
-
m.className = "group-count", m.textContent = ` (${a.length})`,
|
|
2042
|
+
m.className = "group-count", m.textContent = ` (${a.length})`, f.appendChild(m);
|
|
2039
2043
|
}
|
|
2040
2044
|
}
|
|
2041
|
-
t.appendChild(
|
|
2045
|
+
t.appendChild(f);
|
|
2042
2046
|
});
|
|
2043
2047
|
}
|
|
2044
2048
|
expandAll() {
|
|
2045
|
-
this.expandedKeys =
|
|
2049
|
+
this.expandedKeys = Ht(this.flattenedRows), this.requestRender();
|
|
2046
2050
|
}
|
|
2047
2051
|
collapseAll() {
|
|
2048
|
-
this.expandedKeys =
|
|
2052
|
+
this.expandedKeys = Nt(), this.requestRender();
|
|
2049
2053
|
}
|
|
2050
2054
|
toggle(e) {
|
|
2051
|
-
this.expandedKeys =
|
|
2055
|
+
this.expandedKeys = Kt(this.expandedKeys, e);
|
|
2052
2056
|
const t = this.flattenedRows.find((i) => i.kind === "group" && i.key === e);
|
|
2053
2057
|
this.emit("group-toggle", {
|
|
2054
2058
|
key: e,
|
|
@@ -2101,18 +2105,18 @@ function Re(s, e) {
|
|
|
2101
2105
|
const t = new Set(s);
|
|
2102
2106
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
2103
2107
|
}
|
|
2104
|
-
function
|
|
2108
|
+
function Ot(s, e) {
|
|
2105
2109
|
const t = new Set(s);
|
|
2106
2110
|
return t.add(e), t;
|
|
2107
2111
|
}
|
|
2108
|
-
function
|
|
2112
|
+
function Bt(s, e) {
|
|
2109
2113
|
const t = new Set(s);
|
|
2110
2114
|
return t.delete(e), t;
|
|
2111
2115
|
}
|
|
2112
|
-
function
|
|
2116
|
+
function Vt(s, e) {
|
|
2113
2117
|
return s.has(e);
|
|
2114
2118
|
}
|
|
2115
|
-
function
|
|
2119
|
+
function Wt(s, e, t, i) {
|
|
2116
2120
|
const n = document.createElement("div");
|
|
2117
2121
|
n.className = "master-detail-row", n.setAttribute("data-detail-for", String(e)), n.setAttribute("role", "row");
|
|
2118
2122
|
const r = document.createElement("div");
|
|
@@ -2120,10 +2124,10 @@ function Vt(s, e, t, i) {
|
|
|
2120
2124
|
const o = t(s, e);
|
|
2121
2125
|
return typeof o == "string" ? r.innerHTML = o : o instanceof HTMLElement && r.appendChild(o), n.appendChild(r), n;
|
|
2122
2126
|
}
|
|
2123
|
-
const
|
|
2127
|
+
const $t = "@layer tbw-plugins{tbw-grid{.cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:center}.header-row .cell[data-field=__tbw_expander]{display:none}.header-row .cell[data-field=__tbw_expander]+.cell{grid-column:1 / 3}.master-detail-expander{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.master-detail-toggle{cursor:pointer;opacity:.7;user-select:none;display:inline-flex;align-items:center;justify-content:center}.master-detail-toggle:hover{opacity:1}.master-detail-row{grid-column:1 / -1;display:grid;background:var(--tbw-master-detail-bg, var(--tbw-color-row-alt));border-bottom:1px solid var(--tbw-master-detail-border, var(--tbw-color-border));overflow:hidden}.master-detail-cell{padding:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));overflow:auto}.master-detail-row.tbw-expanding{animation:tbw-detail-expand var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}.master-detail-row.tbw-collapsing{animation:tbw-detail-collapse var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}}@keyframes tbw-detail-expand{0%{opacity:0;max-height:0;padding-top:0;padding-bottom:0}to{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem);padding-top:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));padding-bottom:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem))}}@keyframes tbw-detail-collapse{0%{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem)}to{opacity:0;max-height:0}}}";
|
|
2124
2128
|
class Be extends R {
|
|
2125
2129
|
name = "masterDetail";
|
|
2126
|
-
styles =
|
|
2130
|
+
styles = $t;
|
|
2127
2131
|
get defaultConfig() {
|
|
2128
2132
|
return {
|
|
2129
2133
|
detailHeight: "auto",
|
|
@@ -2152,8 +2156,8 @@ class Be extends R {
|
|
|
2152
2156
|
n !== null && (d.animation = n === "false" ? !1 : n), r !== null && (d.showExpandColumn = r !== "false"), o !== null && (d.expandOnRowClick = o === "true"), a !== null && (d.collapseOnClickOutside = a === "true"), l !== null && (d.detailHeight = l === "auto" ? "auto" : parseInt(l, 10));
|
|
2153
2157
|
const c = t.innerHTML.trim();
|
|
2154
2158
|
c && !this.config.detailRenderer && (d.detailRenderer = (u, h) => {
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2159
|
+
const f = Xe(c, { value: u, row: u });
|
|
2160
|
+
return Ze(f);
|
|
2157
2161
|
}), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
|
|
2158
2162
|
}
|
|
2159
2163
|
get animationStyle() {
|
|
@@ -2200,9 +2204,9 @@ class Be extends R {
|
|
|
2200
2204
|
if (!(this.config.showExpandColumn === !0 || this.config.showExpandColumn !== !1 && !!this.config.detailRenderer))
|
|
2201
2205
|
return [...e];
|
|
2202
2206
|
const i = [...e];
|
|
2203
|
-
if (
|
|
2207
|
+
if (tt(i))
|
|
2204
2208
|
return i;
|
|
2205
|
-
const r =
|
|
2209
|
+
const r = it(this.name);
|
|
2206
2210
|
return r.viewRenderer = (o) => {
|
|
2207
2211
|
const { row: a } = o, l = this.expandedRows.has(a), d = document.createElement("span");
|
|
2208
2212
|
d.className = "master-detail-expander expander-cell";
|
|
@@ -2255,7 +2259,7 @@ class Be extends R {
|
|
|
2255
2259
|
d.previousElementSibling !== a && a.after(d);
|
|
2256
2260
|
continue;
|
|
2257
2261
|
}
|
|
2258
|
-
const c =
|
|
2262
|
+
const c = Wt(l, o, this.config.detailRenderer, n);
|
|
2259
2263
|
typeof this.config.detailHeight == "number" && (c.style.height = `${this.config.detailHeight}px`), a.after(c), this.detailElements.set(l, c), this.animateExpand(c);
|
|
2260
2264
|
}
|
|
2261
2265
|
}
|
|
@@ -2290,11 +2294,11 @@ class Be extends R {
|
|
|
2290
2294
|
}
|
|
2291
2295
|
expand(e) {
|
|
2292
2296
|
const t = this.rows[e];
|
|
2293
|
-
t && (this.expandedRows =
|
|
2297
|
+
t && (this.expandedRows = Ot(this.expandedRows, t), this.requestRender());
|
|
2294
2298
|
}
|
|
2295
2299
|
collapse(e) {
|
|
2296
2300
|
const t = this.rows[e];
|
|
2297
|
-
t && (this.expandedRows =
|
|
2301
|
+
t && (this.expandedRows = Bt(this.expandedRows, t), this.requestRender());
|
|
2298
2302
|
}
|
|
2299
2303
|
toggle(e) {
|
|
2300
2304
|
const t = this.rows[e];
|
|
@@ -2302,7 +2306,7 @@ class Be extends R {
|
|
|
2302
2306
|
}
|
|
2303
2307
|
isExpanded(e) {
|
|
2304
2308
|
const t = this.rows[e];
|
|
2305
|
-
return t ?
|
|
2309
|
+
return t ? Vt(this.expandedRows, t) : !1;
|
|
2306
2310
|
}
|
|
2307
2311
|
expandAll() {
|
|
2308
2312
|
for (const e of this.rows)
|
|
@@ -2332,20 +2336,20 @@ class Be extends R {
|
|
|
2332
2336
|
}
|
|
2333
2337
|
}
|
|
2334
2338
|
}
|
|
2335
|
-
function
|
|
2339
|
+
function jt(s, e, t) {
|
|
2336
2340
|
return e.length ? [...s].sort((i, n) => {
|
|
2337
2341
|
for (const r of e) {
|
|
2338
|
-
const a = t.find((u) => u.field === r.field)?.sortComparator ??
|
|
2342
|
+
const a = t.find((u) => u.field === r.field)?.sortComparator ?? Ut, l = i[r.field], d = n[r.field], c = a(l, d, i, n);
|
|
2339
2343
|
if (c !== 0)
|
|
2340
2344
|
return r.direction === "asc" ? c : -c;
|
|
2341
2345
|
}
|
|
2342
2346
|
return 0;
|
|
2343
2347
|
}) : [...s];
|
|
2344
2348
|
}
|
|
2345
|
-
function
|
|
2349
|
+
function Ut(s, e) {
|
|
2346
2350
|
return s == null && e == null ? 0 : s == null ? 1 : e == null ? -1 : typeof s == "number" && typeof e == "number" ? s - e : s instanceof Date && e instanceof Date ? s.getTime() - e.getTime() : typeof s == "boolean" && typeof e == "boolean" ? s === e ? 0 : s ? -1 : 1 : String(s).localeCompare(String(e));
|
|
2347
2351
|
}
|
|
2348
|
-
function
|
|
2352
|
+
function Yt(s, e, t, i) {
|
|
2349
2353
|
const n = s.find((r) => r.field === e);
|
|
2350
2354
|
return t ? n ? n.direction === "asc" ? s.map((r) => r.field === e ? { ...r, direction: "desc" } : r) : s.filter((r) => r.field !== e) : s.length < i ? [...s, { field: e, direction: "asc" }] : s : n?.direction === "asc" ? [{ field: e, direction: "desc" }] : n?.direction === "desc" ? [] : [{ field: e, direction: "asc" }];
|
|
2351
2355
|
}
|
|
@@ -2353,13 +2357,13 @@ function Ee(s, e) {
|
|
|
2353
2357
|
const t = s.findIndex((i) => i.field === e);
|
|
2354
2358
|
return t >= 0 ? t + 1 : void 0;
|
|
2355
2359
|
}
|
|
2356
|
-
function
|
|
2360
|
+
function Se(s, e) {
|
|
2357
2361
|
return s.find((t) => t.field === e)?.direction;
|
|
2358
2362
|
}
|
|
2359
|
-
const
|
|
2360
|
-
class
|
|
2363
|
+
const Xt = '@layer tbw-plugins{.header-cell[data-sort=asc]:after{content:"↑";margin-left:4px;opacity:.8}.header-cell[data-sort=desc]:after{content:"↓";margin-left:4px;opacity:.8}.sort-indicator{margin-left:4px;opacity:.8}.sort-index{font-size:10px;background:var(--tbw-multi-sort-badge-bg, var(--tbw-color-panel-bg));color:var(--tbw-multi-sort-badge-color, var(--tbw-color-fg));border-radius:50%;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;margin-left:2px;font-weight:600}}';
|
|
2364
|
+
class en extends R {
|
|
2361
2365
|
name = "multiSort";
|
|
2362
|
-
styles =
|
|
2366
|
+
styles = Xt;
|
|
2363
2367
|
get defaultConfig() {
|
|
2364
2368
|
return {
|
|
2365
2369
|
maxSortColumns: 3,
|
|
@@ -2371,12 +2375,12 @@ class Qi extends R {
|
|
|
2371
2375
|
this.sortModel = [];
|
|
2372
2376
|
}
|
|
2373
2377
|
processRows(e) {
|
|
2374
|
-
return this.sortModel.length === 0 ? [...e] :
|
|
2378
|
+
return this.sortModel.length === 0 ? [...e] : jt([...e], this.sortModel, [...this.columns]);
|
|
2375
2379
|
}
|
|
2376
2380
|
onHeaderClick(e) {
|
|
2377
2381
|
if (!this.columns.find((r) => r.field === e.field)?.sortable) return !1;
|
|
2378
2382
|
const i = e.originalEvent.shiftKey, n = this.config.maxSortColumns ?? 3;
|
|
2379
|
-
return this.sortModel =
|
|
2383
|
+
return this.sortModel = Yt(this.sortModel, e.field, i, n), this.emit("sort-change", { sortModel: [...this.sortModel] }), this.requestRender(), !0;
|
|
2380
2384
|
}
|
|
2381
2385
|
afterRender() {
|
|
2382
2386
|
const e = this.gridElement;
|
|
@@ -2385,15 +2389,15 @@ class Qi extends R {
|
|
|
2385
2389
|
e.querySelectorAll(".header-row .cell[data-field]").forEach((n) => {
|
|
2386
2390
|
const r = n.getAttribute("data-field");
|
|
2387
2391
|
if (!r) return;
|
|
2388
|
-
const o = Ee(this.sortModel, r), a =
|
|
2392
|
+
const o = Ee(this.sortModel, r), a = Se(this.sortModel, r);
|
|
2389
2393
|
if (n.querySelector(".sort-index")?.remove(), a) {
|
|
2390
2394
|
n.querySelector('[part~="sort-indicator"], .sort-indicator')?.remove(), n.setAttribute("data-sort", a);
|
|
2391
2395
|
const c = document.createElement("span");
|
|
2392
2396
|
c.className = "sort-indicator", this.setIcon(c, this.resolveIcon(a === "asc" ? "sortAsc" : "sortDesc"));
|
|
2393
|
-
const u = n.querySelector(".tbw-filter-btn"), h = n.querySelector(".resize-handle"),
|
|
2394
|
-
if (
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2397
|
+
const u = n.querySelector(".tbw-filter-btn"), h = n.querySelector(".resize-handle"), f = u ?? h;
|
|
2398
|
+
if (f ? n.insertBefore(c, f) : n.appendChild(c), t && this.sortModel.length > 1 && o !== void 0) {
|
|
2399
|
+
const g = document.createElement("span");
|
|
2400
|
+
g.className = "sort-index", g.textContent = String(o), c.nextSibling ? n.insertBefore(g, c.nextSibling) : n.appendChild(g);
|
|
2397
2401
|
}
|
|
2398
2402
|
} else
|
|
2399
2403
|
n.removeAttribute("data-sort");
|
|
@@ -2412,7 +2416,7 @@ class Qi extends R {
|
|
|
2412
2416
|
return Ee(this.sortModel, e);
|
|
2413
2417
|
}
|
|
2414
2418
|
getSortDirection(e) {
|
|
2415
|
-
return
|
|
2419
|
+
return Se(this.sortModel, e);
|
|
2416
2420
|
}
|
|
2417
2421
|
getColumnState(e) {
|
|
2418
2422
|
const t = this.sortModel.findIndex((n) => n.field === e);
|
|
@@ -2435,16 +2439,16 @@ class Qi extends R {
|
|
|
2435
2439
|
i !== -1 ? this.sortModel[i] = n : this.sortModel.splice(t.sort.priority, 0, n);
|
|
2436
2440
|
}
|
|
2437
2441
|
}
|
|
2438
|
-
function
|
|
2442
|
+
function Zt(s) {
|
|
2439
2443
|
return s.filter((e) => e.sticky === "left");
|
|
2440
2444
|
}
|
|
2441
|
-
function
|
|
2445
|
+
function Jt(s) {
|
|
2442
2446
|
return s.filter((e) => e.sticky === "right");
|
|
2443
2447
|
}
|
|
2444
2448
|
function X(s) {
|
|
2445
2449
|
return s.some((e) => e.sticky === "left" || e.sticky === "right");
|
|
2446
2450
|
}
|
|
2447
|
-
function
|
|
2451
|
+
function ke(s, e) {
|
|
2448
2452
|
const t = Array.from(s.querySelectorAll(".header-row .cell"));
|
|
2449
2453
|
if (!t.length) return;
|
|
2450
2454
|
const i = /* @__PURE__ */ new Map();
|
|
@@ -2473,7 +2477,7 @@ function Ae(s) {
|
|
|
2473
2477
|
t.classList.remove("sticky-left", "sticky-right"), t.style.position = "", t.style.left = "", t.style.right = "";
|
|
2474
2478
|
});
|
|
2475
2479
|
}
|
|
2476
|
-
class
|
|
2480
|
+
class tn extends R {
|
|
2477
2481
|
static manifest = {
|
|
2478
2482
|
ownedProperties: [
|
|
2479
2483
|
{
|
|
@@ -2510,7 +2514,7 @@ class en extends R {
|
|
|
2510
2514
|
return;
|
|
2511
2515
|
}
|
|
2512
2516
|
queueMicrotask(() => {
|
|
2513
|
-
|
|
2517
|
+
ke(e, t);
|
|
2514
2518
|
});
|
|
2515
2519
|
}
|
|
2516
2520
|
onPluginQuery(e) {
|
|
@@ -2528,15 +2532,15 @@ class en extends R {
|
|
|
2528
2532
|
}
|
|
2529
2533
|
refreshStickyOffsets() {
|
|
2530
2534
|
const e = [...this.columns];
|
|
2531
|
-
|
|
2535
|
+
ke(this.grid, e);
|
|
2532
2536
|
}
|
|
2533
2537
|
getLeftPinnedColumns() {
|
|
2534
2538
|
const e = [...this.columns];
|
|
2535
|
-
return
|
|
2539
|
+
return Zt(e);
|
|
2536
2540
|
}
|
|
2537
2541
|
getRightPinnedColumns() {
|
|
2538
2542
|
const e = [...this.columns];
|
|
2539
|
-
return
|
|
2543
|
+
return Jt(e);
|
|
2540
2544
|
}
|
|
2541
2545
|
clearStickyPositions() {
|
|
2542
2546
|
Ae(this.grid);
|
|
@@ -2560,7 +2564,7 @@ class en extends R {
|
|
|
2560
2564
|
return { left: i, right: n, skipScroll: r };
|
|
2561
2565
|
}
|
|
2562
2566
|
}
|
|
2563
|
-
function
|
|
2567
|
+
function Qt(s) {
|
|
2564
2568
|
return typeof s == "object" && s !== null && "aggFunc" in s;
|
|
2565
2569
|
}
|
|
2566
2570
|
function Z(s, e) {
|
|
@@ -2585,7 +2589,7 @@ function Z(s, e) {
|
|
|
2585
2589
|
}
|
|
2586
2590
|
if (s.customPanels)
|
|
2587
2591
|
for (const o of s.customPanels) {
|
|
2588
|
-
const a =
|
|
2592
|
+
const a = ei(o, e);
|
|
2589
2593
|
switch (o.position) {
|
|
2590
2594
|
case "left":
|
|
2591
2595
|
i.appendChild(a);
|
|
@@ -2618,7 +2622,7 @@ function Le(s, e, t, i) {
|
|
|
2618
2622
|
let l, d;
|
|
2619
2623
|
const c = n.aggregators?.[o.field];
|
|
2620
2624
|
if (c)
|
|
2621
|
-
if (
|
|
2625
|
+
if (Qt(c)) {
|
|
2622
2626
|
const u = ce(c.aggFunc);
|
|
2623
2627
|
u && (l = u(i, o.field, o)), d = c.formatter;
|
|
2624
2628
|
} else {
|
|
@@ -2634,7 +2638,7 @@ function Le(s, e, t, i) {
|
|
|
2634
2638
|
s.appendChild(r);
|
|
2635
2639
|
}
|
|
2636
2640
|
}
|
|
2637
|
-
function
|
|
2641
|
+
function ei(s, e) {
|
|
2638
2642
|
const t = document.createElement("div");
|
|
2639
2643
|
t.className = "tbw-status-panel tbw-status-panel-custom", t.id = `status-panel-${s.id}`;
|
|
2640
2644
|
const i = s.render(e);
|
|
@@ -2650,10 +2654,10 @@ function Te(s, e, t, i, n) {
|
|
|
2650
2654
|
grid: t
|
|
2651
2655
|
};
|
|
2652
2656
|
}
|
|
2653
|
-
const
|
|
2654
|
-
class
|
|
2657
|
+
const ti = "@layer tbw-plugins{.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg)}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;min-width:fit-content}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600)}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:flex;align-items:center;border-right:1px solid var(--tbw-color-border-cell)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0}}";
|
|
2658
|
+
class nn extends R {
|
|
2655
2659
|
name = "pinnedRows";
|
|
2656
|
-
styles =
|
|
2660
|
+
styles = ti;
|
|
2657
2661
|
get defaultConfig() {
|
|
2658
2662
|
return {
|
|
2659
2663
|
position: "bottom",
|
|
@@ -2757,16 +2761,16 @@ class tn extends R {
|
|
|
2757
2761
|
this.config.aggregationRows && (this.config.aggregationRows = this.config.aggregationRows.filter((t) => t.id !== e), this.requestRender());
|
|
2758
2762
|
}
|
|
2759
2763
|
}
|
|
2760
|
-
const
|
|
2761
|
-
function
|
|
2764
|
+
const ii = Je;
|
|
2765
|
+
function ni(s) {
|
|
2762
2766
|
const e = [];
|
|
2763
2767
|
return !s.rowGroupFields?.length && !s.columnGroupFields?.length && e.push("At least one row or column group field is required"), s.valueFields?.length || e.push("At least one value field is required"), e;
|
|
2764
2768
|
}
|
|
2765
2769
|
function ae(s, e) {
|
|
2766
2770
|
return [...s, e].join("|");
|
|
2767
2771
|
}
|
|
2768
|
-
function
|
|
2769
|
-
const t = e.rowGroupFields ?? [], i = e.columnGroupFields ?? [], n = e.valueFields ?? [], r =
|
|
2772
|
+
function ri(s, e) {
|
|
2773
|
+
const t = e.rowGroupFields ?? [], i = e.columnGroupFields ?? [], n = e.valueFields ?? [], r = oi(s, i), o = Ve(
|
|
2770
2774
|
s,
|
|
2771
2775
|
t,
|
|
2772
2776
|
i,
|
|
@@ -2774,7 +2778,7 @@ function ni(s, e) {
|
|
|
2774
2778
|
n,
|
|
2775
2779
|
0,
|
|
2776
2780
|
""
|
|
2777
|
-
), a =
|
|
2781
|
+
), a = ai(o, r, n), l = Object.values(a).reduce((d, c) => d + c, 0);
|
|
2778
2782
|
return {
|
|
2779
2783
|
rows: o,
|
|
2780
2784
|
columnKeys: r,
|
|
@@ -2782,7 +2786,7 @@ function ni(s, e) {
|
|
|
2782
2786
|
grandTotal: l
|
|
2783
2787
|
};
|
|
2784
2788
|
}
|
|
2785
|
-
function
|
|
2789
|
+
function oi(s, e) {
|
|
2786
2790
|
if (e.length === 0) return ["value"];
|
|
2787
2791
|
const t = /* @__PURE__ */ new Set();
|
|
2788
2792
|
for (const i of s) {
|
|
@@ -2791,7 +2795,7 @@ function ri(s, e) {
|
|
|
2791
2795
|
}
|
|
2792
2796
|
return [...t].sort();
|
|
2793
2797
|
}
|
|
2794
|
-
function
|
|
2798
|
+
function si(s, e) {
|
|
2795
2799
|
const t = /* @__PURE__ */ new Map();
|
|
2796
2800
|
for (const i of s) {
|
|
2797
2801
|
const n = String(i[e] ?? ""), r = t.get(n);
|
|
@@ -2802,38 +2806,38 @@ function oi(s, e) {
|
|
|
2802
2806
|
function Ve(s, e, t, i, n, r, o) {
|
|
2803
2807
|
const a = [];
|
|
2804
2808
|
if (e.length === 0) {
|
|
2805
|
-
const h = Ie(s, t, i, n),
|
|
2809
|
+
const h = Ie(s, t, i, n), f = De(h);
|
|
2806
2810
|
return a.push({
|
|
2807
2811
|
rowKey: o || "all",
|
|
2808
2812
|
rowLabel: o || "All",
|
|
2809
2813
|
depth: r,
|
|
2810
2814
|
values: h,
|
|
2811
|
-
total:
|
|
2815
|
+
total: f,
|
|
2812
2816
|
isGroup: !1,
|
|
2813
2817
|
rowCount: s.length
|
|
2814
2818
|
}), a;
|
|
2815
2819
|
}
|
|
2816
|
-
const l = e[0], d = e.slice(1), c = d.length > 0, u =
|
|
2817
|
-
for (const [h,
|
|
2818
|
-
const
|
|
2820
|
+
const l = e[0], d = e.slice(1), c = d.length > 0, u = si(s, l);
|
|
2821
|
+
for (const [h, f] of u) {
|
|
2822
|
+
const g = o ? `${o}|${h}` : h, p = Ie(f, t, i, n), m = De(p);
|
|
2819
2823
|
let w;
|
|
2820
2824
|
c && (w = Ve(
|
|
2821
|
-
|
|
2825
|
+
f,
|
|
2822
2826
|
d,
|
|
2823
2827
|
t,
|
|
2824
2828
|
i,
|
|
2825
2829
|
n,
|
|
2826
2830
|
r + 1,
|
|
2827
|
-
|
|
2831
|
+
g
|
|
2828
2832
|
)), a.push({
|
|
2829
|
-
rowKey:
|
|
2833
|
+
rowKey: g,
|
|
2830
2834
|
rowLabel: h || "(blank)",
|
|
2831
2835
|
depth: r,
|
|
2832
2836
|
values: p,
|
|
2833
2837
|
total: m,
|
|
2834
2838
|
isGroup: c,
|
|
2835
2839
|
children: w,
|
|
2836
|
-
rowCount:
|
|
2840
|
+
rowCount: f.length
|
|
2837
2841
|
});
|
|
2838
2842
|
}
|
|
2839
2843
|
return a;
|
|
@@ -2842,7 +2846,7 @@ function Ie(s, e, t, i) {
|
|
|
2842
2846
|
const n = {};
|
|
2843
2847
|
for (const r of t)
|
|
2844
2848
|
for (const o of i) {
|
|
2845
|
-
const l = (e.length > 0 ? s.filter((h) => e.map((
|
|
2849
|
+
const l = (e.length > 0 ? s.filter((h) => e.map((f) => String(h[f] ?? "")).join("|") === r) : s).map((h) => Number(h[o.field]) || 0), d = ii(o.aggFunc), c = l.length > 0 ? d(l) : null, u = ae([r], o.field);
|
|
2846
2850
|
n[u] = c;
|
|
2847
2851
|
}
|
|
2848
2852
|
return n;
|
|
@@ -2853,7 +2857,7 @@ function De(s) {
|
|
|
2853
2857
|
e += t ?? 0;
|
|
2854
2858
|
return e;
|
|
2855
2859
|
}
|
|
2856
|
-
function
|
|
2860
|
+
function ai(s, e, t) {
|
|
2857
2861
|
const i = {};
|
|
2858
2862
|
function n(r) {
|
|
2859
2863
|
for (const o of r)
|
|
@@ -2867,7 +2871,7 @@ function si(s, e, t) {
|
|
|
2867
2871
|
}
|
|
2868
2872
|
return n(s), i;
|
|
2869
2873
|
}
|
|
2870
|
-
function
|
|
2874
|
+
function li(s, e, t = !0) {
|
|
2871
2875
|
const i = [];
|
|
2872
2876
|
function n(r) {
|
|
2873
2877
|
i.push(r);
|
|
@@ -2880,7 +2884,7 @@ function ai(s, e, t = !0) {
|
|
|
2880
2884
|
n(r);
|
|
2881
2885
|
return i;
|
|
2882
2886
|
}
|
|
2883
|
-
function
|
|
2887
|
+
function di(s) {
|
|
2884
2888
|
const e = [];
|
|
2885
2889
|
function t(i) {
|
|
2886
2890
|
if (i.isGroup && e.push(i.rowKey), i.children)
|
|
@@ -2891,10 +2895,10 @@ function li(s) {
|
|
|
2891
2895
|
t(i);
|
|
2892
2896
|
return e;
|
|
2893
2897
|
}
|
|
2894
|
-
const
|
|
2895
|
-
function
|
|
2898
|
+
const ci = ["sum", "avg", "count", "min", "max", "first", "last"];
|
|
2899
|
+
function ui(s, e, t, i) {
|
|
2896
2900
|
const n = new AbortController(), r = { config: e, callbacks: i, signal: n.signal }, o = document.createElement("div");
|
|
2897
|
-
return o.className = "tbw-pivot-panel", o.appendChild(H("Options", () =>
|
|
2901
|
+
return o.className = "tbw-pivot-panel", o.appendChild(H("Options", () => mi(t, r))), o.appendChild(H("Row Groups", () => Fe("rowGroups", r))), o.appendChild(H("Column Groups", () => Fe("columnGroups", r))), o.appendChild(H("Values", () => fi(r))), o.appendChild(H("Available Fields", () => pi(r))), s.appendChild(o), () => {
|
|
2898
2902
|
n.abort(), o.remove();
|
|
2899
2903
|
};
|
|
2900
2904
|
}
|
|
@@ -2915,7 +2919,7 @@ function Fe(s, e) {
|
|
|
2915
2919
|
a.className = "tbw-pivot-placeholder", a.textContent = "Drag fields here or click to add", r.appendChild(a);
|
|
2916
2920
|
} else
|
|
2917
2921
|
for (const a of o)
|
|
2918
|
-
r.appendChild(
|
|
2922
|
+
r.appendChild(hi(a, s, e));
|
|
2919
2923
|
return r.addEventListener(
|
|
2920
2924
|
"dragover",
|
|
2921
2925
|
(a) => {
|
|
@@ -2938,7 +2942,7 @@ function Fe(s, e) {
|
|
|
2938
2942
|
{ signal: n }
|
|
2939
2943
|
), r;
|
|
2940
2944
|
}
|
|
2941
|
-
function
|
|
2945
|
+
function hi(s, e, t) {
|
|
2942
2946
|
const { callbacks: i, signal: n } = t, r = document.createElement("div");
|
|
2943
2947
|
r.className = "tbw-pivot-field-chip", r.draggable = !0;
|
|
2944
2948
|
const o = i.getAvailableFields().find((d) => d.field === s), a = document.createElement("span");
|
|
@@ -2964,7 +2968,7 @@ function ui(s, e, t) {
|
|
|
2964
2968
|
{ signal: n }
|
|
2965
2969
|
), r;
|
|
2966
2970
|
}
|
|
2967
|
-
function
|
|
2971
|
+
function fi(s) {
|
|
2968
2972
|
const { config: e, callbacks: t, signal: i } = s, n = document.createElement("div");
|
|
2969
2973
|
n.className = "tbw-pivot-drop-zone tbw-pivot-values-zone", n.setAttribute("data-zone", "values");
|
|
2970
2974
|
const r = e.valueFields ?? [];
|
|
@@ -3005,7 +3009,7 @@ function gi(s, e) {
|
|
|
3005
3009
|
a.className = "tbw-pivot-chip-label", a.textContent = r?.header ?? s.field;
|
|
3006
3010
|
const l = document.createElement("select");
|
|
3007
3011
|
l.className = "tbw-pivot-agg-select", l.title = "Aggregation function";
|
|
3008
|
-
for (const c of
|
|
3012
|
+
for (const c of ci) {
|
|
3009
3013
|
const u = document.createElement("option");
|
|
3010
3014
|
u.value = c, u.textContent = c.toUpperCase(), u.selected = c === s.aggFunc, l.appendChild(u);
|
|
3011
3015
|
}
|
|
@@ -3025,7 +3029,7 @@ function gi(s, e) {
|
|
|
3025
3029
|
{ signal: i }
|
|
3026
3030
|
), o.appendChild(a), o.appendChild(l), n.appendChild(o), n.appendChild(d), n;
|
|
3027
3031
|
}
|
|
3028
|
-
function
|
|
3032
|
+
function pi(s) {
|
|
3029
3033
|
const { config: e, callbacks: t, signal: i } = s, n = document.createElement("div");
|
|
3030
3034
|
n.className = "tbw-pivot-available-fields";
|
|
3031
3035
|
const r = t.getAvailableFields(), o = /* @__PURE__ */ new Set([
|
|
@@ -3055,7 +3059,7 @@ function fi(s) {
|
|
|
3055
3059
|
}
|
|
3056
3060
|
return n;
|
|
3057
3061
|
}
|
|
3058
|
-
function
|
|
3062
|
+
function mi(s, e) {
|
|
3059
3063
|
const { config: t, callbacks: i, signal: n } = e, r = document.createElement("div");
|
|
3060
3064
|
return r.className = "tbw-pivot-options", r.appendChild(
|
|
3061
3065
|
J(
|
|
@@ -3094,7 +3098,7 @@ function J(s, e, t, i) {
|
|
|
3094
3098
|
const o = document.createElement("span");
|
|
3095
3099
|
return o.textContent = s, n.appendChild(r), n.appendChild(o), n;
|
|
3096
3100
|
}
|
|
3097
|
-
function
|
|
3101
|
+
function wi(s, e, t) {
|
|
3098
3102
|
return e.className = "data-grid-row pivot-group-row", e.setAttribute("data-pivot-depth", String(s.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(s.__pivotRowKey ?? "")), e.setAttribute("role", "row"), e.innerHTML = "", t.columns.forEach((i, n) => {
|
|
3099
3103
|
const r = document.createElement("div");
|
|
3100
3104
|
if (r.className = "cell", r.setAttribute("data-col", String(n)), r.setAttribute("data-row", String(t.rowIndex)), r.setAttribute("role", "gridcell"), n === 0) {
|
|
@@ -3115,7 +3119,7 @@ function mi(s, e, t) {
|
|
|
3115
3119
|
e.appendChild(r);
|
|
3116
3120
|
}), !0;
|
|
3117
3121
|
}
|
|
3118
|
-
function
|
|
3122
|
+
function bi(s, e, t, i) {
|
|
3119
3123
|
return e.className = "data-grid-row pivot-leaf-row", e.setAttribute("data-pivot-depth", String(s.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(s.__pivotRowKey ?? "")), e.innerHTML = "", t.forEach((n, r) => {
|
|
3120
3124
|
const o = document.createElement("div");
|
|
3121
3125
|
if (o.className = "cell", o.setAttribute("data-col", String(r)), o.setAttribute("data-row", String(i)), o.setAttribute("role", "gridcell"), r === 0) {
|
|
@@ -3130,7 +3134,7 @@ function wi(s, e, t, i) {
|
|
|
3130
3134
|
e.appendChild(o);
|
|
3131
3135
|
}), !0;
|
|
3132
3136
|
}
|
|
3133
|
-
function
|
|
3137
|
+
function vi(s, e, t) {
|
|
3134
3138
|
return e.className = "pivot-grand-total-row", e.setAttribute("role", "presentation"), e.innerHTML = "", t.forEach((i, n) => {
|
|
3135
3139
|
const r = document.createElement("div");
|
|
3136
3140
|
if (r.className = "cell", r.setAttribute("data-col", String(n)), n === 0) {
|
|
@@ -3143,10 +3147,10 @@ function bi(s, e, t) {
|
|
|
3143
3147
|
e.appendChild(r);
|
|
3144
3148
|
}), !0;
|
|
3145
3149
|
}
|
|
3146
|
-
const
|
|
3150
|
+
const yi = '@layer tbw-plugins{.pivot-group-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:600;background:var(--tbw-pivot-group-bg, var(--tbw-color-row-alt));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-group-row:hover{background:var(--tbw-pivot-group-hover, var(--tbw-color-row-hover))}.pivot-leaf-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-pivot-leaf-bg, var(--tbw-color-bg));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-grand-total-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:700;background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-height:var(--tbw-row-height);border-top:2px solid var(--tbw-color-border-strong)}.pivot-grand-total-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-grand-total-row>.cell:last-child{border-right:0}.pivot-grand-total-footer{position:sticky;bottom:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-width:fit-content}.pivot-group-row>.cell,.pivot-leaf-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-group-row>.cell:last-child,.pivot-leaf-row>.cell:last-child{border-right:0}.pivot-toggle{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:6px;border:none;background:transparent;cursor:pointer;color:var(--tbw-pivot-toggle-color, var(--tbw-color-fg-muted));border-radius:var(--tbw-border-radius);transition:background .15s,color .15s}.pivot-toggle:hover{background:var(--tbw-pivot-toggle-hover-bg, var(--tbw-color-row-hover));color:var(--tbw-pivot-toggle-hover-color, var(--tbw-color-fg))}.pivot-toggle:focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}.pivot-label{font-weight:inherit}.pivot-count{color:var(--tbw-pivot-count-color, var(--tbw-color-fg-muted));font-size:.9em;font-weight:400}.pivot-total-row{font-weight:700;border-top:2px solid var(--tbw-pivot-border, var(--tbw-color-border-strong))}[data-pivot-depth="1"]{--tbw-pivot-depth: 1}[data-pivot-depth="2"]{--tbw-pivot-depth: 2}[data-pivot-depth="3"]{--tbw-pivot-depth: 3}[data-pivot-depth="4"]{--tbw-pivot-depth: 4}.tbw-pivot-panel{display:flex;flex-direction:column;gap:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));height:100%;overflow-y:auto;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-pivot-section{border:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-section-bg, var(--tbw-color-bg))}.tbw-pivot-section-header{padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));font-weight:600;background:var(--tbw-pivot-header-bg, var(--tbw-color-header-bg));border-bottom:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius) var(--tbw-border-radius) 0 0}.tbw-pivot-section-content{padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-toggle-wrapper{display:flex;align-items:center}.tbw-pivot-toggle-label{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-toggle-label input{width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);cursor:pointer}.tbw-pivot-drop-zone{min-height:60px;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border:2px dashed var(--tbw-pivot-drop-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-drop-bg, var(--tbw-color-row-alt));display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);align-content:flex-start;transition:all .15s ease}.tbw-pivot-drop-zone.drag-over{border-color:var(--tbw-color-accent);background:var(--tbw-pivot-drop-active, var(--tbw-focus-background))}.tbw-pivot-placeholder{color:var(--tbw-color-fg-muted);font-style:italic;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));text-align:center;width:100%}.tbw-pivot-field-chip{display:inline-flex;align-items:center;gap:var(--tbw-spacing-sm, .375rem);padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-pivot-chip-bg, var(--tbw-color-header-bg));border:1px solid var(--tbw-pivot-chip-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);cursor:grab;font-size:var(--tbw-font-size-xs, .75rem);transition:all .15s ease}.tbw-pivot-field-chip:hover{background:var(--tbw-pivot-chip-hover, var(--tbw-color-row-hover));border-color:var(--tbw-color-accent)}.tbw-pivot-field-chip.available{background:var(--tbw-color-bg)}.tbw-pivot-field-chip.dragging{opacity:.5;cursor:grabbing}.tbw-pivot-chip-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.tbw-pivot-chip-remove{display:flex;align-items:center;justify-content:center;width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);padding:0;border:none;background:transparent;color:var(--tbw-color-fg-muted);font-size:var(--tbw-font-size-sm, .875rem);font-weight:700;cursor:pointer;border-radius:50%;transition:all .15s ease}.tbw-pivot-chip-remove:hover{background:var(--tbw-pivot-chip-remove-hover-bg, var(--tbw-color-accent));color:var(--tbw-pivot-chip-remove-hover-fg, var(--tbw-color-accent-fg))}.tbw-pivot-value-chip{padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem))}.tbw-pivot-value-label-wrapper{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));flex:1;min-width:0}.tbw-pivot-agg-select{padding:var(--tbw-spacing-xs, .125rem) var(--tbw-spacing-xs, .25rem);font-size:var(--tbw-font-size-xs, .6875rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);cursor:pointer}.tbw-pivot-available-fields{display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);min-height:40px}.tbw-pivot-options{display:flex;flex-direction:column;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-checkbox{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-checkbox input{width:var(--tbw-icon-size-sm, .875rem);height:var(--tbw-icon-size-sm, .875rem);cursor:pointer}.pivot-group-row.tbw-pivot-slide-in,.pivot-leaf-row.tbw-pivot-slide-in{animation:tbw-pivot-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.pivot-group-row.tbw-pivot-fade-in,.pivot-leaf-row.tbw-pivot-fade-in{animation:tbw-pivot-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-fade-in{0%{opacity:0}to{opacity:1}}}';
|
|
3147
3151
|
class M extends R {
|
|
3148
3152
|
name = "pivot";
|
|
3149
|
-
styles =
|
|
3153
|
+
styles = yi;
|
|
3150
3154
|
static PANEL_ID = "pivot";
|
|
3151
3155
|
get defaultConfig() {
|
|
3152
3156
|
return {
|
|
@@ -3191,11 +3195,11 @@ class M extends R {
|
|
|
3191
3195
|
processRows(e) {
|
|
3192
3196
|
if (!this.hasInitialized && this.config.active !== !1 && this.hasValidPivotConfig() && (this.hasInitialized = !0, this.isActive = !0), !this.isActive)
|
|
3193
3197
|
return [...e];
|
|
3194
|
-
const t =
|
|
3198
|
+
const t = ni(this.config);
|
|
3195
3199
|
if (t.length > 0)
|
|
3196
3200
|
return this.warn(`Config errors: ${t.join(", ")}`), [...e];
|
|
3197
|
-
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult =
|
|
3198
|
-
const i = this.config.indentWidth ?? 20, n =
|
|
3201
|
+
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult = ri(e, this.config), this.expandedKeys.size === 0 && this.defaultExpanded && this.expandAllKeys();
|
|
3202
|
+
const i = this.config.indentWidth ?? 20, n = li(
|
|
3199
3203
|
this.pivotResult.rows,
|
|
3200
3204
|
this.expandedKeys,
|
|
3201
3205
|
this.defaultExpanded
|
|
@@ -3247,13 +3251,13 @@ class M extends R {
|
|
|
3247
3251
|
}
|
|
3248
3252
|
renderRow(e, t, i) {
|
|
3249
3253
|
const n = e;
|
|
3250
|
-
return n.__pivotRowKey && n.__pivotHasChildren ?
|
|
3254
|
+
return n.__pivotRowKey && n.__pivotHasChildren ? wi(n, t, {
|
|
3251
3255
|
columns: this.gridColumns,
|
|
3252
3256
|
rowIndex: i,
|
|
3253
3257
|
onToggle: (r) => this.toggle(r),
|
|
3254
3258
|
resolveIcon: (r) => this.resolveIcon(r),
|
|
3255
3259
|
setIcon: (r, o) => this.setIcon(r, o)
|
|
3256
|
-
}) : n.__pivotRowKey !== void 0 && this.isActive ?
|
|
3260
|
+
}) : n.__pivotRowKey !== void 0 && this.isActive ? bi(n, t, this.gridColumns, i) : (this.cleanupPivotStyling(t), !1);
|
|
3257
3261
|
}
|
|
3258
3262
|
cleanupPivotStyling(e) {
|
|
3259
3263
|
(e.classList.contains("pivot-group-row") || e.classList.contains("pivot-leaf-row") || e.classList.contains("pivot-grand-total-row")) && (e.classList.remove("pivot-group-row", "pivot-leaf-row", "pivot-grand-total-row"), e.classList.add("data-grid-row"), e.removeAttribute("data-pivot-depth"), e.innerHTML = "");
|
|
@@ -3291,7 +3295,7 @@ class M extends R {
|
|
|
3291
3295
|
__pivotTotal: this.pivotResult.grandTotal,
|
|
3292
3296
|
...this.pivotResult.totals
|
|
3293
3297
|
};
|
|
3294
|
-
|
|
3298
|
+
vi(i, this.grandTotalFooter, this.gridColumns);
|
|
3295
3299
|
}
|
|
3296
3300
|
cleanupGrandTotalFooter() {
|
|
3297
3301
|
this.grandTotalFooter && (this.grandTotalFooter.remove(), this.grandTotalFooter = null);
|
|
@@ -3313,7 +3317,7 @@ class M extends R {
|
|
|
3313
3317
|
}
|
|
3314
3318
|
expandAllKeys() {
|
|
3315
3319
|
if (!this.pivotResult) return;
|
|
3316
|
-
const e =
|
|
3320
|
+
const e = di(this.pivotResult.rows);
|
|
3317
3321
|
for (const t of e)
|
|
3318
3322
|
this.expandedKeys.add(t);
|
|
3319
3323
|
}
|
|
@@ -3398,7 +3402,7 @@ class M extends R {
|
|
|
3398
3402
|
},
|
|
3399
3403
|
getAvailableFields: () => this.getAvailableFields()
|
|
3400
3404
|
};
|
|
3401
|
-
return
|
|
3405
|
+
return ui(e, this.config, this.isActive, t);
|
|
3402
3406
|
}
|
|
3403
3407
|
refreshPanel() {
|
|
3404
3408
|
this.panelContainer && (this.panelContainer.innerHTML = "", this.renderPanel(this.panelContainer));
|
|
@@ -3431,7 +3435,7 @@ class M extends R {
|
|
|
3431
3435
|
n >= 0 && (i[n] = { ...i[n], aggFunc: t }, this.config.valueFields = [...i]), this.isActive && this.refresh();
|
|
3432
3436
|
}
|
|
3433
3437
|
}
|
|
3434
|
-
function
|
|
3438
|
+
function Ci(s) {
|
|
3435
3439
|
const e = s.meta ?? {};
|
|
3436
3440
|
return e.lockPosition !== !0 && e.suppressMovable !== !0;
|
|
3437
3441
|
}
|
|
@@ -3441,7 +3445,7 @@ function Me(s, e, t) {
|
|
|
3441
3445
|
return i.splice(t, 0, n), i;
|
|
3442
3446
|
}
|
|
3443
3447
|
const xi = '@layer tbw-plugins{.header-row>.cell[draggable=true]{cursor:grab;position:relative}.header-row>.cell.dragging{opacity:.5;cursor:grabbing}.header-row>.cell.drop-before:before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.header-row>.cell.drop-after:after{content:"";position:absolute;right:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.cell.flip-animating{transition:transform var(--tbw-animation-duration, .2s) ease-out;will-change:transform;z-index:1}@keyframes reorder-fade-in{0%{opacity:0}to{opacity:1}}.cell.fade-animating{animation:reorder-fade-in var(--tbw-animation-duration, .2s) ease-out backwards}}';
|
|
3444
|
-
class
|
|
3448
|
+
class rn extends R {
|
|
3445
3449
|
name = "reorder";
|
|
3446
3450
|
styles = xi;
|
|
3447
3451
|
get defaultConfig() {
|
|
@@ -3460,7 +3464,7 @@ class nn extends R {
|
|
|
3460
3464
|
draggedIndex = null;
|
|
3461
3465
|
dropIndex = null;
|
|
3462
3466
|
canMoveColumnWithPlugins(e) {
|
|
3463
|
-
return !e || !
|
|
3467
|
+
return !e || !Ci(e) ? !1 : !this.grid.queryPlugins({
|
|
3464
3468
|
type: Ge.CAN_MOVE_COLUMN,
|
|
3465
3469
|
context: e
|
|
3466
3470
|
}).includes(!1);
|
|
@@ -3510,13 +3514,13 @@ class nn extends R {
|
|
|
3510
3514
|
const l = this.draggedField, d = this.draggedIndex, c = this.dropIndex;
|
|
3511
3515
|
if (!this.isDragging || l === null || d === null || c === null)
|
|
3512
3516
|
return;
|
|
3513
|
-
const u = c > d ? c - 1 : c, h = this.getColumnOrder(),
|
|
3517
|
+
const u = c > d ? c - 1 : c, h = this.getColumnOrder(), f = Me(h, d, u), g = {
|
|
3514
3518
|
field: l,
|
|
3515
3519
|
fromIndex: d,
|
|
3516
3520
|
toIndex: u,
|
|
3517
|
-
columnOrder:
|
|
3521
|
+
columnOrder: f
|
|
3518
3522
|
};
|
|
3519
|
-
this.emitCancelable("column-move",
|
|
3523
|
+
this.emitCancelable("column-move", g) || this.updateColumnOrder(f);
|
|
3520
3524
|
}));
|
|
3521
3525
|
});
|
|
3522
3526
|
}
|
|
@@ -3636,11 +3640,11 @@ class nn extends R {
|
|
|
3636
3640
|
this.grid.requestStateChange?.();
|
|
3637
3641
|
}
|
|
3638
3642
|
}
|
|
3639
|
-
const
|
|
3640
|
-
class
|
|
3643
|
+
const Ri = 'tbw-grid[data-responsive-animate]{.data-grid-row,.data-grid-row>.cell{transition:opacity var(--tbw-responsive-duration, .2s) ease-out,transform var(--tbw-responsive-duration, .2s) ease-out}}tbw-grid[data-responsive][data-responsive-animate]{.data-grid-row{animation:responsive-card-enter var(--tbw-responsive-duration, .2s) ease-out}}@keyframes responsive-card-enter{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}tbw-grid[data-responsive]{.header{display:none!important}.footer-row{display:none}.tbw-scroll-area{overflow-x:hidden;min-width:0!important}.rows-body-wrapper{min-width:0!important}.data-grid-row:not(.group-row){display:block!important;grid-template-columns:none!important;padding:var(--tbw-cell-padding);padding-left:var(--tbw-spacing-xl);border-bottom:1px solid var(--tbw-color-border);min-height:auto!important;height:auto!important;contain:none!important;content-visibility:visible!important;background:var(--tbw-color-bg);position:relative;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}&[aria-selected=true]{background:var(--tbw-color-selection);&:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--tbw-color-accent)}}}.data-grid-row:not(.group-row)>.cell{display:flex!important;justify-content:space-between;align-items:center;padding:var(--tbw-spacing-xs) var(--tbw-spacing-md);width:100%!important;min-width:0!important;min-height:auto!important;height:auto!important;line-height:1.5!important;position:static!important;left:auto!important;right:auto!important;border:none!important;border-bottom:none!important;border-right:none!important;background:transparent!important;white-space:normal!important;overflow:visible!important;&:before{content:attr(data-header) ": ";font-weight:600;color:var(--tbw-color-header-fg);flex-shrink:0;margin-right:var(--tbw-spacing-md);min-width:100px}&:after{content:none}}.cell[data-utility]{display:none!important}}tbw-grid[data-responsive] .cell[data-responsive-hidden]{display:none!important}tbw-grid[data-responsive] .cell[data-responsive-value-only]{&:before{display:none!important}justify-content:flex-start!important;font-weight:500}tbw-grid:not([data-responsive]) .cell[data-responsive-hidden]{display:none!important}tbw-grid[data-responsive]{.tbw-footer,.tbw-pinned-rows,.tbw-aggregation-rows{display:none!important}.tbw-pinned-rows,.tbw-aggregation-rows,.tbw-aggregation-row{min-width:0!important}}tbw-grid[data-responsive] .data-grid-row.responsive-card{display:block!important;padding:var(--tbw-cell-padding);border-bottom:1px solid var(--tbw-color-border);>*{width:100%}.cell:before{display:none}}';
|
|
3644
|
+
class on extends R {
|
|
3641
3645
|
name = "responsive";
|
|
3642
3646
|
version = "1.0.0";
|
|
3643
|
-
styles =
|
|
3647
|
+
styles = Ri;
|
|
3644
3648
|
static manifest = {
|
|
3645
3649
|
incompatibleWith: [
|
|
3646
3650
|
{
|
|
@@ -3752,7 +3756,7 @@ class rn extends R {
|
|
|
3752
3756
|
const i = this.gridElement.querySelectorAll(".data-grid-row");
|
|
3753
3757
|
for (const n of i)
|
|
3754
3758
|
n.style.height = "", n.classList.remove("responsive-card");
|
|
3755
|
-
this.#a && this.#a > 0 && t._virtualization && (t._virtualization.rowHeight = this.#a, this.#a = void 0), this.#
|
|
3759
|
+
this.#a && this.#a > 0 && t._virtualization && (t._virtualization.rowHeight = this.#a, this.#a = void 0), this.#f = void 0, this.#g = void 0, this.#m = void 0;
|
|
3756
3760
|
}
|
|
3757
3761
|
}
|
|
3758
3762
|
renderRow(e, t, i) {
|
|
@@ -3792,17 +3796,17 @@ class rn extends R {
|
|
|
3792
3796
|
}
|
|
3793
3797
|
return !1;
|
|
3794
3798
|
}
|
|
3795
|
-
#g;
|
|
3796
3799
|
#f;
|
|
3800
|
+
#g;
|
|
3797
3801
|
#m;
|
|
3798
3802
|
#v() {
|
|
3799
|
-
if (this.#
|
|
3800
|
-
return this.#
|
|
3803
|
+
if (this.#f && this.#f > 0)
|
|
3804
|
+
return this.#f;
|
|
3801
3805
|
const e = this.config.cardRowHeight;
|
|
3802
3806
|
return typeof e == "number" && e > 0 ? e : 80;
|
|
3803
3807
|
}
|
|
3804
3808
|
#y() {
|
|
3805
|
-
return this.#
|
|
3809
|
+
return this.#g && this.#g > 0 ? this.#g : this.#a ?? 28;
|
|
3806
3810
|
}
|
|
3807
3811
|
#w() {
|
|
3808
3812
|
for (const e of this.rows)
|
|
@@ -3810,7 +3814,7 @@ class rn extends R {
|
|
|
3810
3814
|
return !0;
|
|
3811
3815
|
return !1;
|
|
3812
3816
|
}
|
|
3813
|
-
#
|
|
3817
|
+
#C() {
|
|
3814
3818
|
let e = 0, t = 0;
|
|
3815
3819
|
for (const i of this.rows)
|
|
3816
3820
|
i.__isGroupRow ? e++ : t++;
|
|
@@ -3819,7 +3823,7 @@ class rn extends R {
|
|
|
3819
3823
|
getExtraHeight() {
|
|
3820
3824
|
if (!this.#t || !this.config.cardRenderer || !this.#w())
|
|
3821
3825
|
return 0;
|
|
3822
|
-
const e = this.#a ?? 28, t = this.#y(), i = this.#v(), { groupCount: n, cardCount: r } = this.#
|
|
3826
|
+
const e = this.#a ?? 28, t = this.#y(), i = this.#v(), { groupCount: n, cardCount: r } = this.#C(), o = n * Math.max(0, t - e), a = r * Math.max(0, i - e);
|
|
3823
3827
|
return o + a;
|
|
3824
3828
|
}
|
|
3825
3829
|
getExtraHeightBefore(e) {
|
|
@@ -3832,7 +3836,7 @@ class rn extends R {
|
|
|
3832
3836
|
d[u].__isGroupRow ? a++ : l++;
|
|
3833
3837
|
return a * r + l * o;
|
|
3834
3838
|
}
|
|
3835
|
-
#
|
|
3839
|
+
#x() {
|
|
3836
3840
|
let e = 0;
|
|
3837
3841
|
for (const t of this.rows)
|
|
3838
3842
|
t.__isGroupRow || e++;
|
|
@@ -3843,28 +3847,28 @@ class rn extends R {
|
|
|
3843
3847
|
if (!this.#t || !this.config.cardRenderer)
|
|
3844
3848
|
return;
|
|
3845
3849
|
let e = !1;
|
|
3846
|
-
const t = this.grid, i = this.#w(), n = this.#
|
|
3850
|
+
const t = this.grid, i = this.#w(), n = this.#x();
|
|
3847
3851
|
if (n !== this.#m && (this.#m = n, e = !0), i) {
|
|
3848
3852
|
const o = this.gridElement.querySelector(".data-grid-row.group-row");
|
|
3849
3853
|
if (o) {
|
|
3850
3854
|
const a = o.getBoundingClientRect().height;
|
|
3851
|
-
a > 0 && a !== this.#
|
|
3855
|
+
a > 0 && a !== this.#g && (this.#g = a, e = !0);
|
|
3852
3856
|
}
|
|
3853
3857
|
}
|
|
3854
3858
|
const r = this.gridElement.querySelector(".data-grid-row.responsive-card");
|
|
3855
3859
|
if (r) {
|
|
3856
3860
|
const o = r.getBoundingClientRect().height;
|
|
3857
|
-
o > 0 && o !== this.#
|
|
3861
|
+
o > 0 && o !== this.#f && (this.#f = o, e = !0, !i && t._virtualization && (t._virtualization.rowHeight = o));
|
|
3858
3862
|
}
|
|
3859
3863
|
e && !this.#b && (this.#b = !0, queueMicrotask(() => {
|
|
3860
3864
|
this.#b = !1, this.grid && this.#t && this.grid.refreshVirtualWindow?.(!0, !0);
|
|
3861
3865
|
}));
|
|
3862
3866
|
}
|
|
3863
3867
|
}
|
|
3864
|
-
const
|
|
3865
|
-
class
|
|
3868
|
+
const Ei = '.dg-row-drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;user-select:none;color:var(--tbw-color-fg-muted, #999);transition:color .15s ease;font-size:14px;letter-spacing:-2px;&:hover{color:var(--tbw-color-fg, #333)}&:active{cursor:grabbing}}.data-grid-row.dragging{opacity:.6}.data-grid-row.drop-target{position:relative;&.drop-before:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background-color:var(--tbw-color-accent, #1976d2);z-index:10}&.drop-after:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--tbw-color-accent, #1976d2);z-index:10}}.data-grid-row.keyboard-moving{background-color:var(--tbw-color-bg-selected, #e3f2fd);box-shadow:0 0 0 1px var(--tbw-color-accent, #1976d2) inset}.data-grid-row.animate-flip{transition:transform var(--tbw-animation-duration, .2s) ease-out}', Si = "__tbw_row_drag";
|
|
3869
|
+
class sn extends R {
|
|
3866
3870
|
name = "rowReorder";
|
|
3867
|
-
styles =
|
|
3871
|
+
styles = Ei;
|
|
3868
3872
|
get defaultConfig() {
|
|
3869
3873
|
return {
|
|
3870
3874
|
enableKeyboard: !0,
|
|
@@ -3888,7 +3892,7 @@ class on extends R {
|
|
|
3888
3892
|
if (!this.config.showDragHandle)
|
|
3889
3893
|
return [...e];
|
|
3890
3894
|
const t = {
|
|
3891
|
-
field:
|
|
3895
|
+
field: Si,
|
|
3892
3896
|
header: "",
|
|
3893
3897
|
width: this.config.dragHandleWidth ?? 40,
|
|
3894
3898
|
resizable: !1,
|
|
@@ -4047,24 +4051,24 @@ function ki(s) {
|
|
|
4047
4051
|
function We(s) {
|
|
4048
4052
|
return s.map(ki);
|
|
4049
4053
|
}
|
|
4050
|
-
function
|
|
4054
|
+
function Ai(s, e, t) {
|
|
4051
4055
|
const i = V(t);
|
|
4052
4056
|
return s >= i.startRow && s <= i.endRow && e >= i.startCol && e <= i.endCol;
|
|
4053
4057
|
}
|
|
4054
4058
|
function Pe(s, e, t) {
|
|
4055
|
-
return t.some((i) =>
|
|
4059
|
+
return t.some((i) => Ai(s, e, i));
|
|
4056
4060
|
}
|
|
4057
|
-
function
|
|
4061
|
+
function _i(s) {
|
|
4058
4062
|
const e = [], t = V(s);
|
|
4059
4063
|
for (let i = t.startRow; i <= t.endRow; i++)
|
|
4060
4064
|
for (let n = t.startCol; n <= t.endCol; n++)
|
|
4061
4065
|
e.push({ row: i, col: n });
|
|
4062
4066
|
return e;
|
|
4063
4067
|
}
|
|
4064
|
-
function
|
|
4068
|
+
function Li(s) {
|
|
4065
4069
|
const e = /* @__PURE__ */ new Map();
|
|
4066
4070
|
for (const t of s)
|
|
4067
|
-
for (const i of
|
|
4071
|
+
for (const i of _i(t))
|
|
4068
4072
|
e.set(`${i.row},${i.col}`, i);
|
|
4069
4073
|
return [...e.values()];
|
|
4070
4074
|
}
|
|
@@ -4076,8 +4080,8 @@ function Q(s, e) {
|
|
|
4076
4080
|
endCol: e.col
|
|
4077
4081
|
};
|
|
4078
4082
|
}
|
|
4079
|
-
const
|
|
4080
|
-
function
|
|
4083
|
+
const Ti = "@layer tbw-plugins{tbw-grid{&.selecting .data-grid-row>.cell{user-select:none}&[data-has-focus] .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%))}&[data-selection-mode=row] .cell-focus{outline:none}.data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg);&.top{border-top:2px solid var(--tbw-range-border-color)}&.bottom{border-bottom:2px solid var(--tbw-range-border-color)}&.first{border-left:2px solid var(--tbw-range-border-color)}&.last{border-right:2px solid var(--tbw-range-border-color)}}.data-grid-row[data-selectable=false]{cursor:not-allowed;opacity:.6;&.row-focus{background-color:var(--tbw-color-row-alt)}}.data-grid-row>.cell[data-selectable=false]{cursor:not-allowed;opacity:.6;&.selected{background-color:var(--tbw-color-warning-bg, rgba(255, 243, 205, .5))}}.tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}}}";
|
|
4084
|
+
function Ii(s, e, t) {
|
|
4081
4085
|
if (s === "cell" && e.selectedCell)
|
|
4082
4086
|
return {
|
|
4083
4087
|
mode: s,
|
|
@@ -4097,7 +4101,7 @@ function Ti(s, e, t) {
|
|
|
4097
4101
|
}
|
|
4098
4102
|
return s === "range" && e.ranges.length > 0 ? { mode: s, ranges: We(e.ranges) } : { mode: s, ranges: [] };
|
|
4099
4103
|
}
|
|
4100
|
-
class
|
|
4104
|
+
class an extends R {
|
|
4101
4105
|
static manifest = {
|
|
4102
4106
|
configRules: [
|
|
4103
4107
|
{
|
|
@@ -4111,7 +4115,7 @@ class sn extends R {
|
|
|
4111
4115
|
]
|
|
4112
4116
|
};
|
|
4113
4117
|
name = "selection";
|
|
4114
|
-
styles =
|
|
4118
|
+
styles = Ti;
|
|
4115
4119
|
get defaultConfig() {
|
|
4116
4120
|
return {
|
|
4117
4121
|
mode: "cell",
|
|
@@ -4127,6 +4131,20 @@ class sn extends R {
|
|
|
4127
4131
|
isDragging = !1;
|
|
4128
4132
|
pendingKeyboardUpdate = null;
|
|
4129
4133
|
selectedCell = null;
|
|
4134
|
+
checkSelectable(e, t) {
|
|
4135
|
+
const { isSelectable: i } = this.config;
|
|
4136
|
+
if (!i) return !0;
|
|
4137
|
+
const n = this.rows[e];
|
|
4138
|
+
if (!n) return !1;
|
|
4139
|
+
const r = t !== void 0 ? this.columns[t] : void 0;
|
|
4140
|
+
return i(n, e, r, t);
|
|
4141
|
+
}
|
|
4142
|
+
isRowSelectable(e) {
|
|
4143
|
+
return this.checkSelectable(e);
|
|
4144
|
+
}
|
|
4145
|
+
isCellSelectable(e, t) {
|
|
4146
|
+
return this.checkSelectable(e, t);
|
|
4147
|
+
}
|
|
4130
4148
|
detach() {
|
|
4131
4149
|
this.selected.clear(), this.ranges = [], this.activeRange = null, this.cellAnchor = null, this.isDragging = !1, this.selectedCell = null, this.pendingKeyboardUpdate = null;
|
|
4132
4150
|
}
|
|
@@ -4136,11 +4154,11 @@ class sn extends R {
|
|
|
4136
4154
|
return !1;
|
|
4137
4155
|
const a = this.columns[i], l = a && I(a);
|
|
4138
4156
|
if (r === "cell")
|
|
4139
|
-
return l || (this.selectedCell = { row: t, col: i }, this.emit("selection-change", this.#t()), this.requestAfterRender()), !1;
|
|
4157
|
+
return l || !this.isCellSelectable(t, i) || (this.selectedCell = { row: t, col: i }, this.emit("selection-change", this.#t()), this.requestAfterRender()), !1;
|
|
4140
4158
|
if (r === "row")
|
|
4141
|
-
return this.selected.clear(), this.selected.add(t), this.lastSelected = t, this.emit("selection-change", this.#t()), this.requestAfterRender(), !1;
|
|
4159
|
+
return this.isRowSelectable(t) && (this.selected.clear(), this.selected.add(t), this.lastSelected = t, this.emit("selection-change", this.#t()), this.requestAfterRender()), !1;
|
|
4142
4160
|
if (r === "range") {
|
|
4143
|
-
if (l)
|
|
4161
|
+
if (l || !this.isCellSelectable(t, i))
|
|
4144
4162
|
return !1;
|
|
4145
4163
|
const d = n.shiftKey, c = n.ctrlKey || n.metaKey;
|
|
4146
4164
|
if (d && this.cellAnchor) {
|
|
@@ -4173,11 +4191,13 @@ class sn extends R {
|
|
|
4173
4191
|
return t === "cell" ? this.selectedCell = null : t === "row" ? (this.selected.clear(), this.anchor = null) : t === "range" && (this.ranges = [], this.activeRange = null, this.cellAnchor = null), this.emit("selection-change", this.#t()), this.requestAfterRender(), !0;
|
|
4174
4192
|
if (t === "cell" && n)
|
|
4175
4193
|
return queueMicrotask(() => {
|
|
4176
|
-
|
|
4194
|
+
const r = this.grid._focusRow, o = this.grid._focusCol;
|
|
4195
|
+
this.isCellSelectable(r, o) ? this.selectedCell = { row: r, col: o } : this.selectedCell = null, this.emit("selection-change", this.#t()), this.requestAfterRender();
|
|
4177
4196
|
}), !1;
|
|
4178
4197
|
if (t === "row" && (e.key === "ArrowUp" || e.key === "ArrowDown"))
|
|
4179
4198
|
return queueMicrotask(() => {
|
|
4180
|
-
|
|
4199
|
+
const r = this.grid._focusRow;
|
|
4200
|
+
this.isRowSelectable(r) ? (this.selected.clear(), this.selected.add(r), this.lastSelected = r) : this.selected.clear(), this.emit("selection-change", this.#t()), this.requestAfterRender();
|
|
4181
4201
|
}), !1;
|
|
4182
4202
|
if (t === "range" && n) {
|
|
4183
4203
|
const r = e.key === "Tab", o = e.shiftKey && !r;
|
|
@@ -4200,7 +4220,7 @@ class sn extends R {
|
|
|
4200
4220
|
onCellMouseDown(e) {
|
|
4201
4221
|
if (this.config.mode !== "range" || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
4202
4222
|
const t = this.columns[e.colIndex];
|
|
4203
|
-
if (t && I(t) || e.originalEvent.shiftKey && this.cellAnchor)
|
|
4223
|
+
if (t && I(t) || !this.isCellSelectable(e.rowIndex, e.colIndex) || e.originalEvent.shiftKey && this.cellAnchor)
|
|
4204
4224
|
return;
|
|
4205
4225
|
this.isDragging = !0;
|
|
4206
4226
|
const i = e.rowIndex, n = e.colIndex;
|
|
@@ -4231,29 +4251,32 @@ class sn extends R {
|
|
|
4231
4251
|
#e() {
|
|
4232
4252
|
const e = this.gridElement;
|
|
4233
4253
|
if (!e) return;
|
|
4234
|
-
const { mode: t } = this.config;
|
|
4235
|
-
e.querySelectorAll(".cell").forEach((
|
|
4236
|
-
|
|
4254
|
+
const { mode: t } = this.config, i = !!this.config.isSelectable;
|
|
4255
|
+
e.querySelectorAll(".cell").forEach((o) => {
|
|
4256
|
+
o.classList.remove("selected", "top", "bottom", "first", "last"), i && o.removeAttribute("data-selectable");
|
|
4237
4257
|
});
|
|
4238
|
-
const
|
|
4239
|
-
if (
|
|
4240
|
-
|
|
4241
|
-
}), t === "row" && (ue(e),
|
|
4242
|
-
const
|
|
4243
|
-
|
|
4244
|
-
})), t === "range" &&
|
|
4258
|
+
const r = e.querySelectorAll(".data-grid-row");
|
|
4259
|
+
if (r.forEach((o) => {
|
|
4260
|
+
o.classList.remove("selected", "row-focus"), i && o.removeAttribute("data-selectable");
|
|
4261
|
+
}), t === "row" && (ue(e), r.forEach((o) => {
|
|
4262
|
+
const a = o.querySelector(".cell[data-row]"), l = Qe(a);
|
|
4263
|
+
l >= 0 && (i && !this.isRowSelectable(l) && o.setAttribute("data-selectable", "false"), this.selected.has(l) && o.classList.add("selected", "row-focus"));
|
|
4264
|
+
})), (t === "cell" || t === "range") && i && e.querySelectorAll(".cell[data-row][data-col]").forEach((a) => {
|
|
4265
|
+
const l = parseInt(a.getAttribute("data-row") ?? "-1", 10), d = parseInt(a.getAttribute("data-col") ?? "-1", 10);
|
|
4266
|
+
l >= 0 && d >= 0 && (this.isCellSelectable(l, d) || a.setAttribute("data-selectable", "false"));
|
|
4267
|
+
}), t === "range" && this.ranges.length > 0) {
|
|
4245
4268
|
ue(e);
|
|
4246
|
-
const
|
|
4247
|
-
this.columns.length - 1, e.querySelectorAll(".cell[data-row][data-col]").forEach((
|
|
4248
|
-
const
|
|
4249
|
-
if (
|
|
4250
|
-
const
|
|
4251
|
-
if (
|
|
4269
|
+
const o = this.activeRange ? V(this.activeRange) : null, a = this.columns.findIndex((d) => !I(d));
|
|
4270
|
+
this.columns.length - 1, e.querySelectorAll(".cell[data-row][data-col]").forEach((d) => {
|
|
4271
|
+
const c = parseInt(d.getAttribute("data-row") ?? "-1", 10), u = parseInt(d.getAttribute("data-col") ?? "-1", 10);
|
|
4272
|
+
if (c >= 0 && u >= 0) {
|
|
4273
|
+
const h = this.columns[u];
|
|
4274
|
+
if (h && I(h))
|
|
4252
4275
|
return;
|
|
4253
|
-
if (Pe(
|
|
4254
|
-
|
|
4255
|
-
const g = Math.max(
|
|
4256
|
-
|
|
4276
|
+
if (Pe(c, u, this.ranges) && (d.classList.add("selected"), o)) {
|
|
4277
|
+
c === o.startRow && d.classList.add("top"), c === o.endRow && d.classList.add("bottom");
|
|
4278
|
+
const g = Math.max(o.startCol, a);
|
|
4279
|
+
u === g && d.classList.add("first"), u === o.endCol && d.classList.add("last");
|
|
4257
4280
|
}
|
|
4258
4281
|
}
|
|
4259
4282
|
});
|
|
@@ -4286,7 +4309,7 @@ class sn extends R {
|
|
|
4286
4309
|
};
|
|
4287
4310
|
}
|
|
4288
4311
|
getSelectedCells() {
|
|
4289
|
-
return
|
|
4312
|
+
return Li(this.ranges);
|
|
4290
4313
|
}
|
|
4291
4314
|
isCellSelected(e, t) {
|
|
4292
4315
|
return Pe(e, t, this.ranges);
|
|
@@ -4306,7 +4329,7 @@ class sn extends R {
|
|
|
4306
4329
|
}), this.requestAfterRender();
|
|
4307
4330
|
}
|
|
4308
4331
|
#t() {
|
|
4309
|
-
return
|
|
4332
|
+
return Ii(
|
|
4310
4333
|
this.config.mode,
|
|
4311
4334
|
{
|
|
4312
4335
|
selectedCell: this.selectedCell,
|
|
@@ -4320,20 +4343,20 @@ class sn extends R {
|
|
|
4320
4343
|
function B(s, e) {
|
|
4321
4344
|
return Math.floor(s / e);
|
|
4322
4345
|
}
|
|
4323
|
-
function
|
|
4346
|
+
function Di(s, e) {
|
|
4324
4347
|
return {
|
|
4325
4348
|
start: s * e,
|
|
4326
4349
|
end: (s + 1) * e
|
|
4327
4350
|
};
|
|
4328
4351
|
}
|
|
4329
|
-
function
|
|
4352
|
+
function Fi(s, e, t) {
|
|
4330
4353
|
const i = B(s, t), n = B(e - 1, t), r = [];
|
|
4331
4354
|
for (let o = i; o <= n; o++)
|
|
4332
4355
|
r.push(o);
|
|
4333
4356
|
return r;
|
|
4334
4357
|
}
|
|
4335
4358
|
async function qe(s, e, t, i) {
|
|
4336
|
-
const n =
|
|
4359
|
+
const n = Di(e, t);
|
|
4337
4360
|
return s.getRows({
|
|
4338
4361
|
startRow: n.start,
|
|
4339
4362
|
endRow: n.end,
|
|
@@ -4341,14 +4364,14 @@ async function qe(s, e, t, i) {
|
|
|
4341
4364
|
filterModel: i.filterModel
|
|
4342
4365
|
});
|
|
4343
4366
|
}
|
|
4344
|
-
function
|
|
4367
|
+
function Mi(s, e, t) {
|
|
4345
4368
|
const i = B(s, e), n = t.get(i);
|
|
4346
4369
|
if (!n) return;
|
|
4347
4370
|
const r = s % e;
|
|
4348
4371
|
return n[r];
|
|
4349
4372
|
}
|
|
4350
|
-
const
|
|
4351
|
-
class
|
|
4373
|
+
const Pi = 100;
|
|
4374
|
+
class ln extends R {
|
|
4352
4375
|
name = "serverSide";
|
|
4353
4376
|
get defaultConfig() {
|
|
4354
4377
|
return {
|
|
@@ -4368,7 +4391,7 @@ class an extends R {
|
|
|
4368
4391
|
}
|
|
4369
4392
|
loadRequiredBlocks() {
|
|
4370
4393
|
if (!this.dataSource) return;
|
|
4371
|
-
const e = this.grid, t = this.config.cacheBlockSize ?? 100, i = { startRow: e._virtualization.start, endRow: e._virtualization.end }, n =
|
|
4394
|
+
const e = this.grid, t = this.config.cacheBlockSize ?? 100, i = { startRow: e._virtualization.start, endRow: e._virtualization.end }, n = Fi(i.startRow, i.endRow, t);
|
|
4372
4395
|
for (const r of n)
|
|
4373
4396
|
if (!(this.loadedBlocks.has(r) || this.loadingBlocks.has(r))) {
|
|
4374
4397
|
if (this.loadingBlocks.size >= (this.config.maxConcurrentRequests ?? 2))
|
|
@@ -4384,7 +4407,7 @@ class an extends R {
|
|
|
4384
4407
|
if (!this.dataSource) return [...e];
|
|
4385
4408
|
const t = [];
|
|
4386
4409
|
for (let i = 0; i < this.totalRowCount; i++) {
|
|
4387
|
-
const n =
|
|
4410
|
+
const n = Mi(i, this.config.cacheBlockSize ?? 100, this.loadedBlocks);
|
|
4388
4411
|
t.push(n ?? { __loading: !0, __index: i });
|
|
4389
4412
|
}
|
|
4390
4413
|
return t;
|
|
@@ -4392,7 +4415,7 @@ class an extends R {
|
|
|
4392
4415
|
onScroll(e) {
|
|
4393
4416
|
this.dataSource && (this.loadRequiredBlocks(), this.scrollDebounceTimer && clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = setTimeout(() => {
|
|
4394
4417
|
this.loadRequiredBlocks();
|
|
4395
|
-
},
|
|
4418
|
+
}, Pi));
|
|
4396
4419
|
}
|
|
4397
4420
|
setDataSource(e) {
|
|
4398
4421
|
this.dataSource = e, this.loadedBlocks.clear(), this.loadingBlocks.clear();
|
|
@@ -4437,7 +4460,7 @@ function ne(s, e, t = null, i = 0) {
|
|
|
4437
4460
|
}
|
|
4438
4461
|
return r;
|
|
4439
4462
|
}
|
|
4440
|
-
function
|
|
4463
|
+
function qi() {
|
|
4441
4464
|
return /* @__PURE__ */ new Set();
|
|
4442
4465
|
}
|
|
4443
4466
|
function je(s, e, t, i = null, n = 0) {
|
|
@@ -4455,7 +4478,7 @@ function je(s, e, t, i = null, n = 0) {
|
|
|
4455
4478
|
}
|
|
4456
4479
|
return null;
|
|
4457
4480
|
}
|
|
4458
|
-
function
|
|
4481
|
+
function Ki(s, e, t, i) {
|
|
4459
4482
|
const n = je(s, e, t);
|
|
4460
4483
|
if (!n) return i;
|
|
4461
4484
|
const r = new Set(i);
|
|
@@ -4473,7 +4496,7 @@ function Ke(s, e = "children") {
|
|
|
4473
4496
|
}
|
|
4474
4497
|
return !1;
|
|
4475
4498
|
}
|
|
4476
|
-
function
|
|
4499
|
+
function Hi(s) {
|
|
4477
4500
|
if (!Array.isArray(s) || s.length === 0) return null;
|
|
4478
4501
|
const e = ["children", "items", "nodes", "subRows", "nested"];
|
|
4479
4502
|
for (const t of s)
|
|
@@ -4485,10 +4508,10 @@ function Ki(s) {
|
|
|
4485
4508
|
}
|
|
4486
4509
|
return null;
|
|
4487
4510
|
}
|
|
4488
|
-
const
|
|
4489
|
-
class
|
|
4511
|
+
const Ni = "@layer tbw-plugins{tbw-grid{.cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:flex-start}.header-row .cell[data-field=__tbw_expander]{display:none}.header-row .cell[data-field=__tbw_expander]+.cell{grid-column:1 / 3}.tree-cell-wrapper{display:inline-flex;align-items:center;padding-left:calc(var(--tbw-tree-depth, 0) * var(--tbw-tree-indent-width, var(--tbw-tree-toggle-size, 1.25em)))}.tree-expander{display:flex;align-items:center;justify-content:flex-start;width:100%;height:100%;box-sizing:border-box}.tree-toggle{cursor:pointer;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-tree-toggle-size, 1.25em);height:var(--tbw-tree-toggle-size, 1.25em);flex-shrink:0}.tree-toggle:hover{color:var(--tbw-tree-accent, var(--tbw-color-accent))}.tree-spacer{width:var(--tbw-tree-toggle-size, 1.25em);display:inline-block;flex-shrink:0}.data-grid-row.tbw-tree-slide-in{animation:tbw-tree-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}.data-grid-row.tbw-tree-fade-in{animation:tbw-tree-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}}@keyframes tbw-tree-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes tbw-tree-fade-in{0%{opacity:0}to{opacity:1}}}";
|
|
4512
|
+
class dn extends R {
|
|
4490
4513
|
name = "tree";
|
|
4491
|
-
styles =
|
|
4514
|
+
styles = Ni;
|
|
4492
4515
|
get defaultConfig() {
|
|
4493
4516
|
return {
|
|
4494
4517
|
childrenField: "children",
|
|
@@ -4514,7 +4537,7 @@ class ln extends R {
|
|
|
4514
4537
|
}
|
|
4515
4538
|
detect(e) {
|
|
4516
4539
|
if (!this.config.autoDetect) return !1;
|
|
4517
|
-
const t = e, i = this.config.childrenField ??
|
|
4540
|
+
const t = e, i = this.config.childrenField ?? Hi(t) ?? "children";
|
|
4518
4541
|
return Ke(t, i);
|
|
4519
4542
|
}
|
|
4520
4543
|
processRows(e) {
|
|
@@ -4575,11 +4598,11 @@ class ln extends R {
|
|
|
4575
4598
|
const t = [...e];
|
|
4576
4599
|
if (t.length === 0) return t;
|
|
4577
4600
|
const i = t[0], n = i.viewRenderer, r = () => this.config, o = this.setIcon.bind(this), a = this.resolveIcon.bind(this), l = (d) => {
|
|
4578
|
-
const { row: c, value: u } = d, { showExpandIcons: h = !0, indentWidth:
|
|
4579
|
-
if (m.className = "tree-cell-wrapper", m.style.setProperty("--tbw-tree-depth", String(p)),
|
|
4580
|
-
if (
|
|
4601
|
+
const { row: c, value: u } = d, { showExpandIcons: h = !0, indentWidth: f } = r(), g = c, p = g.__treeDepth ?? 0, m = document.createElement("span");
|
|
4602
|
+
if (m.className = "tree-cell-wrapper", m.style.setProperty("--tbw-tree-depth", String(p)), f !== void 0 && m.style.setProperty("--tbw-tree-indent-width", `${f}px`), h)
|
|
4603
|
+
if (g.__treeHasChildren) {
|
|
4581
4604
|
const b = document.createElement("span");
|
|
4582
|
-
b.className = `tree-toggle${
|
|
4605
|
+
b.className = `tree-toggle${g.__treeExpanded ? " expanded" : ""}`, o(b, a(g.__treeExpanded ? "collapse" : "expand")), b.setAttribute("data-tree-key", String(g.__treeKey ?? "")), m.appendChild(b);
|
|
4583
4606
|
} else {
|
|
4584
4607
|
const b = document.createElement("span");
|
|
4585
4608
|
b.className = "tree-spacer", m.appendChild(b);
|
|
@@ -4650,7 +4673,7 @@ class ln extends R {
|
|
|
4650
4673
|
this.expandedKeys = ne(this.rows, this.config), this.requestRender();
|
|
4651
4674
|
}
|
|
4652
4675
|
collapseAll() {
|
|
4653
|
-
this.expandedKeys =
|
|
4676
|
+
this.expandedKeys = qi(), this.requestRender();
|
|
4654
4677
|
}
|
|
4655
4678
|
isExpanded(e) {
|
|
4656
4679
|
return this.expandedKeys.has(e);
|
|
@@ -4665,10 +4688,10 @@ class ln extends R {
|
|
|
4665
4688
|
return this.rowKeyMap.get(e)?.data;
|
|
4666
4689
|
}
|
|
4667
4690
|
expandToKey(e) {
|
|
4668
|
-
this.expandedKeys =
|
|
4691
|
+
this.expandedKeys = Ki(this.rows, e, this.config, this.expandedKeys), this.requestRender();
|
|
4669
4692
|
}
|
|
4670
4693
|
}
|
|
4671
|
-
function
|
|
4694
|
+
function zi(s, e, t) {
|
|
4672
4695
|
const i = [...s.undoStack, e];
|
|
4673
4696
|
for (; i.length > t; )
|
|
4674
4697
|
i.shift();
|
|
@@ -4701,16 +4724,16 @@ function Ne(s) {
|
|
|
4701
4724
|
action: t
|
|
4702
4725
|
} : { newState: s, action: null };
|
|
4703
4726
|
}
|
|
4704
|
-
function
|
|
4727
|
+
function Gi(s) {
|
|
4705
4728
|
return s.undoStack.length > 0;
|
|
4706
4729
|
}
|
|
4707
|
-
function
|
|
4730
|
+
function Oi(s) {
|
|
4708
4731
|
return s.redoStack.length > 0;
|
|
4709
4732
|
}
|
|
4710
|
-
function
|
|
4733
|
+
function Bi() {
|
|
4711
4734
|
return { undoStack: [], redoStack: [] };
|
|
4712
4735
|
}
|
|
4713
|
-
function
|
|
4736
|
+
function Vi(s, e, t, i) {
|
|
4714
4737
|
return {
|
|
4715
4738
|
type: "cell-edit",
|
|
4716
4739
|
rowIndex: s,
|
|
@@ -4720,7 +4743,7 @@ function Bi(s, e, t, i) {
|
|
|
4720
4743
|
timestamp: Date.now()
|
|
4721
4744
|
};
|
|
4722
4745
|
}
|
|
4723
|
-
class
|
|
4746
|
+
class cn extends R {
|
|
4724
4747
|
static dependencies = [
|
|
4725
4748
|
{ name: "editing", required: !0, reason: "UndoRedoPlugin tracks cell edit history" }
|
|
4726
4749
|
];
|
|
@@ -4762,7 +4785,7 @@ class dn extends R {
|
|
|
4762
4785
|
return !1;
|
|
4763
4786
|
}
|
|
4764
4787
|
recordEdit(e, t, i, n) {
|
|
4765
|
-
const r =
|
|
4788
|
+
const r = Vi(e, t, i, n), o = zi(
|
|
4766
4789
|
{ undoStack: this.undoStack, redoStack: this.redoStack },
|
|
4767
4790
|
r,
|
|
4768
4791
|
this.config.maxHistorySize ?? 100
|
|
@@ -4786,13 +4809,13 @@ class dn extends R {
|
|
|
4786
4809
|
return e.action;
|
|
4787
4810
|
}
|
|
4788
4811
|
canUndo() {
|
|
4789
|
-
return
|
|
4812
|
+
return Gi({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
4790
4813
|
}
|
|
4791
4814
|
canRedo() {
|
|
4792
|
-
return
|
|
4815
|
+
return Oi({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
4793
4816
|
}
|
|
4794
4817
|
clearHistory() {
|
|
4795
|
-
const e =
|
|
4818
|
+
const e = Bi();
|
|
4796
4819
|
this.undoStack = e.undoStack, this.redoStack = e.redoStack;
|
|
4797
4820
|
}
|
|
4798
4821
|
getUndoStack() {
|
|
@@ -4802,7 +4825,7 @@ class dn extends R {
|
|
|
4802
4825
|
return [...this.redoStack];
|
|
4803
4826
|
}
|
|
4804
4827
|
}
|
|
4805
|
-
const
|
|
4828
|
+
const Wi = '@layer tbw-plugins{.tbw-visibility-content{display:flex;flex-direction:column;height:100%}.tbw-visibility-list{flex:1;overflow-y:auto;padding:var(--tbw-panel-padding, var(--tbw-spacing-md, .5rem))}.tbw-visibility-row{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-menu-item-padding, .375rem .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);border-radius:var(--tbw-border-radius, .25rem);position:relative}.tbw-visibility-row:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}.tbw-visibility-row input[type=checkbox]{cursor:pointer}.tbw-visibility-row.locked span{color:var(--tbw-color-fg-muted, #888)}.tbw-visibility-handle{cursor:grab;color:var(--tbw-color-fg-muted, #888);font-size:var(--tbw-font-size-2xs, .625rem);letter-spacing:-2px;user-select:none;flex-shrink:0}.tbw-visibility-row.reorderable:hover .tbw-visibility-handle{color:var(--tbw-color-fg, #1f2937)}.tbw-visibility-label{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));flex:1;cursor:pointer}.tbw-visibility-row.dragging{opacity:.5;cursor:grabbing}.tbw-visibility-row.drop-before:before{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-row.drop-after:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-show-all{margin:var(--tbw-panel-padding, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding, .5rem .75rem);border:1px solid var(--tbw-visibility-border, var(--tbw-color-border, #e5e7eb));border-radius:var(--tbw-border-radius, .25rem);background:var(--tbw-visibility-btn-bg, var(--tbw-color-header-bg, #f9fafb));color:var(--tbw-color-fg, #1f2937);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-visibility-show-all:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}}';
|
|
4806
4829
|
function ze(s) {
|
|
4807
4830
|
const e = s.meta ?? {};
|
|
4808
4831
|
return e.lockPosition !== !0 && e.suppressMovable !== !0;
|
|
@@ -4813,7 +4836,7 @@ class P extends R {
|
|
|
4813
4836
|
];
|
|
4814
4837
|
name = "visibility";
|
|
4815
4838
|
static PANEL_ID = "columns";
|
|
4816
|
-
styles =
|
|
4839
|
+
styles = Wi;
|
|
4817
4840
|
get defaultConfig() {
|
|
4818
4841
|
return {
|
|
4819
4842
|
allowHideAll: !1
|
|
@@ -4938,12 +4961,12 @@ class P extends R {
|
|
|
4938
4961
|
return;
|
|
4939
4962
|
const d = l > a ? l - 1 : l;
|
|
4940
4963
|
if (d !== a) {
|
|
4941
|
-
const c = this.grid.getAllColumns(), h = c.filter((p) => !p.utility)[d]?.field,
|
|
4964
|
+
const c = this.grid.getAllColumns(), h = c.filter((p) => !p.utility)[d]?.field, f = h ? c.findIndex((p) => p.field === h) : c.length, g = {
|
|
4942
4965
|
field: o,
|
|
4943
4966
|
fromIndex: a,
|
|
4944
|
-
toIndex:
|
|
4967
|
+
toIndex: f
|
|
4945
4968
|
};
|
|
4946
|
-
this.emit("column-reorder-request",
|
|
4969
|
+
this.emit("column-reorder-request", g), setTimeout(() => {
|
|
4947
4970
|
this.rebuildToggles(n);
|
|
4948
4971
|
}, 0);
|
|
4949
4972
|
}
|
|
@@ -4952,47 +4975,47 @@ class P extends R {
|
|
|
4952
4975
|
}
|
|
4953
4976
|
export {
|
|
4954
4977
|
R as BaseGridPlugin,
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4978
|
+
ji as ClipboardPlugin,
|
|
4979
|
+
Ui as ColumnVirtualizationPlugin,
|
|
4980
|
+
Yi as ContextMenuPlugin,
|
|
4981
|
+
fn as DEFAULT_ANIMATION_CONFIG,
|
|
4959
4982
|
Ue as DEFAULT_GRID_ICONS,
|
|
4960
4983
|
gn as DGEvents,
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4984
|
+
pn as DataGridElement,
|
|
4985
|
+
Xi as EditingPlugin,
|
|
4986
|
+
Zi as ExportPlugin,
|
|
4964
4987
|
A as FilteringPlugin,
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4988
|
+
mn as FitModeEnum,
|
|
4989
|
+
wn as GridCSSVars,
|
|
4990
|
+
bn as GridClasses,
|
|
4991
|
+
vn as GridDataAttrs,
|
|
4992
|
+
yn as GridElement,
|
|
4993
|
+
Cn as GridSelectors,
|
|
4994
|
+
Ji as GroupingColumnsPlugin,
|
|
4995
|
+
Qi as GroupingRowsPlugin,
|
|
4973
4996
|
Be as MasterDetailPlugin,
|
|
4974
|
-
|
|
4997
|
+
en as MultiSortPlugin,
|
|
4975
4998
|
Ge as PLUGIN_QUERIES,
|
|
4976
|
-
|
|
4977
|
-
|
|
4999
|
+
tn as PinnedColumnsPlugin,
|
|
5000
|
+
nn as PinnedRowsPlugin,
|
|
4978
5001
|
M as PivotPlugin,
|
|
4979
5002
|
xn as PluginEvents,
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
5003
|
+
Rn as PluginManager,
|
|
5004
|
+
Si as ROW_DRAG_HANDLE_FIELD,
|
|
5005
|
+
En as RenderPhase,
|
|
5006
|
+
rn as ReorderPlugin,
|
|
5007
|
+
on as ResponsivePlugin,
|
|
5008
|
+
sn as RowReorderPlugin,
|
|
5009
|
+
an as SelectionPlugin,
|
|
5010
|
+
ln as ServerSidePlugin,
|
|
5011
|
+
dn as TreePlugin,
|
|
5012
|
+
cn as UndoRedoPlugin,
|
|
4990
5013
|
P as VisibilityPlugin,
|
|
4991
|
-
|
|
5014
|
+
Sn as builtInSort,
|
|
4992
5015
|
kn as createGrid,
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
5016
|
+
An as defaultComparator,
|
|
5017
|
+
mt as defaultEditorFor,
|
|
5018
|
+
rt as defaultPasteHandler,
|
|
5019
|
+
_n as queryGrid
|
|
4997
5020
|
};
|
|
4998
5021
|
//# sourceMappingURL=all.js.map
|