@toolbox-web/grid 1.2.0 → 1.3.1
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 +619 -571
- package/all.js.map +1 -1
- package/index.js +362 -302
- 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 +17 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +82 -76
- 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 +43 -41
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +24 -22
- 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 +83 -52
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +22 -20
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +160 -125
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +20 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +66 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +51 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +17 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +24 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +25 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +49 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +24 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +19 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +38 -36
- 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 +118 -85
- 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 +34 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +25 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +22 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +21 -19
- 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 +19 -19
- 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/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const A = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', P = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,11 @@ const L = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: A,
|
|
11
|
+
filterActive: A
|
|
10
12
|
};
|
|
11
|
-
class
|
|
13
|
+
class k {
|
|
12
14
|
/**
|
|
13
15
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
16
|
*
|
|
@@ -232,7 +234,7 @@ class P {
|
|
|
232
234
|
*/
|
|
233
235
|
get gridIcons() {
|
|
234
236
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
237
|
+
return { ...P, ...e };
|
|
236
238
|
}
|
|
237
239
|
// #region Animation Helpers
|
|
238
240
|
/**
|
|
@@ -358,7 +360,7 @@ const m = {
|
|
|
358
360
|
list() {
|
|
359
361
|
return [...Object.keys(m), ...f.keys()];
|
|
360
362
|
}
|
|
361
|
-
},
|
|
363
|
+
}, _ = {
|
|
362
364
|
sum: (i) => i.reduce((e, t) => e + t, 0),
|
|
363
365
|
avg: (i) => i.length ? i.reduce((e, t) => e + t, 0) / i.length : 0,
|
|
364
366
|
count: (i) => i.length,
|
|
@@ -367,24 +369,24 @@ const m = {
|
|
|
367
369
|
first: (i) => i[0] ?? 0,
|
|
368
370
|
last: (i) => i[i.length - 1] ?? 0
|
|
369
371
|
};
|
|
370
|
-
function
|
|
371
|
-
return
|
|
372
|
+
function N(i) {
|
|
373
|
+
return _[i] ?? _.sum;
|
|
372
374
|
}
|
|
373
375
|
g.register.bind(g);
|
|
374
376
|
g.unregister.bind(g);
|
|
375
377
|
g.get.bind(g);
|
|
376
378
|
g.run.bind(g);
|
|
377
379
|
g.list.bind(g);
|
|
378
|
-
const
|
|
379
|
-
function
|
|
380
|
+
const S = N;
|
|
381
|
+
function K(i) {
|
|
380
382
|
const e = [];
|
|
381
383
|
return !i.rowGroupFields?.length && !i.columnGroupFields?.length && e.push("At least one row or column group field is required"), i.valueFields?.length || e.push("At least one value field is required"), e;
|
|
382
384
|
}
|
|
383
385
|
function C(i, e) {
|
|
384
386
|
return [...i, e].join("|");
|
|
385
387
|
}
|
|
386
|
-
function
|
|
387
|
-
const t = e.rowGroupFields ?? [], o = e.columnGroupFields ?? [], r = e.valueFields ?? [], n =
|
|
388
|
+
function I(i, e) {
|
|
389
|
+
const t = e.rowGroupFields ?? [], o = e.columnGroupFields ?? [], r = e.valueFields ?? [], n = V(i, o), a = G(
|
|
388
390
|
i,
|
|
389
391
|
t,
|
|
390
392
|
o,
|
|
@@ -394,7 +396,7 @@ function K(i, e) {
|
|
|
394
396
|
// starting depth
|
|
395
397
|
""
|
|
396
398
|
// parent key prefix
|
|
397
|
-
), s =
|
|
399
|
+
), s = D(a, n, r), l = Object.values(s).reduce((d, c) => d + c, 0);
|
|
398
400
|
return {
|
|
399
401
|
rows: a,
|
|
400
402
|
columnKeys: n,
|
|
@@ -402,7 +404,7 @@ function K(i, e) {
|
|
|
402
404
|
grandTotal: l
|
|
403
405
|
};
|
|
404
406
|
}
|
|
405
|
-
function
|
|
407
|
+
function V(i, e) {
|
|
406
408
|
if (e.length === 0) return ["value"];
|
|
407
409
|
const t = /* @__PURE__ */ new Set();
|
|
408
410
|
for (const o of i) {
|
|
@@ -411,7 +413,7 @@ function I(i, e) {
|
|
|
411
413
|
}
|
|
412
414
|
return [...t].sort();
|
|
413
415
|
}
|
|
414
|
-
function
|
|
416
|
+
function z(i, e) {
|
|
415
417
|
const t = /* @__PURE__ */ new Map();
|
|
416
418
|
for (const o of i) {
|
|
417
419
|
const r = String(o[e] ?? ""), n = t.get(r);
|
|
@@ -419,10 +421,10 @@ function V(i, e) {
|
|
|
419
421
|
}
|
|
420
422
|
return t;
|
|
421
423
|
}
|
|
422
|
-
function
|
|
424
|
+
function G(i, e, t, o, r, n, a) {
|
|
423
425
|
const s = [];
|
|
424
426
|
if (e.length === 0) {
|
|
425
|
-
const u =
|
|
427
|
+
const u = R(i, t, o, r), h = T(u);
|
|
426
428
|
return s.push({
|
|
427
429
|
rowKey: a || "all",
|
|
428
430
|
rowLabel: a || "All",
|
|
@@ -433,11 +435,11 @@ function E(i, e, t, o, r, n, a) {
|
|
|
433
435
|
rowCount: i.length
|
|
434
436
|
}), s;
|
|
435
437
|
}
|
|
436
|
-
const l = e[0], d = e.slice(1), c = d.length > 0, p =
|
|
438
|
+
const l = e[0], d = e.slice(1), c = d.length > 0, p = z(i, l);
|
|
437
439
|
for (const [u, h] of p) {
|
|
438
|
-
const y = a ? `${a}|${u}` : u, x =
|
|
440
|
+
const y = a ? `${a}|${u}` : u, x = R(h, t, o, r), L = T(x);
|
|
439
441
|
let F;
|
|
440
|
-
c && (F =
|
|
442
|
+
c && (F = G(
|
|
441
443
|
h,
|
|
442
444
|
d,
|
|
443
445
|
t,
|
|
@@ -450,7 +452,7 @@ function E(i, e, t, o, r, n, a) {
|
|
|
450
452
|
rowLabel: u || "(blank)",
|
|
451
453
|
depth: n,
|
|
452
454
|
values: x,
|
|
453
|
-
total:
|
|
455
|
+
total: L,
|
|
454
456
|
isGroup: c,
|
|
455
457
|
children: F,
|
|
456
458
|
rowCount: h.length
|
|
@@ -458,22 +460,22 @@ function E(i, e, t, o, r, n, a) {
|
|
|
458
460
|
}
|
|
459
461
|
return s;
|
|
460
462
|
}
|
|
461
|
-
function
|
|
463
|
+
function R(i, e, t, o) {
|
|
462
464
|
const r = {};
|
|
463
465
|
for (const n of t)
|
|
464
466
|
for (const a of o) {
|
|
465
|
-
const l = (e.length > 0 ? i.filter((u) => e.map((h) => String(u[h] ?? "")).join("|") === n) : i).map((u) => Number(u[a.field]) || 0), d =
|
|
467
|
+
const l = (e.length > 0 ? i.filter((u) => e.map((h) => String(u[h] ?? "")).join("|") === n) : i).map((u) => Number(u[a.field]) || 0), d = S(a.aggFunc), c = l.length > 0 ? d(l) : null, p = C([n], a.field);
|
|
466
468
|
r[p] = c;
|
|
467
469
|
}
|
|
468
470
|
return r;
|
|
469
471
|
}
|
|
470
|
-
function
|
|
472
|
+
function T(i) {
|
|
471
473
|
let e = 0;
|
|
472
474
|
for (const t of Object.values(i))
|
|
473
475
|
e += t ?? 0;
|
|
474
476
|
return e;
|
|
475
477
|
}
|
|
476
|
-
function
|
|
478
|
+
function D(i, e, t) {
|
|
477
479
|
const o = {};
|
|
478
480
|
function r(n) {
|
|
479
481
|
for (const a of n)
|
|
@@ -487,7 +489,7 @@ function z(i, e, t) {
|
|
|
487
489
|
}
|
|
488
490
|
return r(i), o;
|
|
489
491
|
}
|
|
490
|
-
function
|
|
492
|
+
function M(i, e, t = !0) {
|
|
491
493
|
const o = [];
|
|
492
494
|
function r(n) {
|
|
493
495
|
o.push(n);
|
|
@@ -512,9 +514,9 @@ function q(i) {
|
|
|
512
514
|
return e;
|
|
513
515
|
}
|
|
514
516
|
const H = ["sum", "avg", "count", "min", "max", "first", "last"];
|
|
515
|
-
function
|
|
517
|
+
function O(i, e, t, o) {
|
|
516
518
|
const r = new AbortController(), n = { config: e, callbacks: o, signal: r.signal }, a = document.createElement("div");
|
|
517
|
-
return a.className = "tbw-pivot-panel", a.appendChild(b("Options", () => W(t, n))), a.appendChild(b("Row Groups", () =>
|
|
519
|
+
return a.className = "tbw-pivot-panel", a.appendChild(b("Options", () => W(t, n))), a.appendChild(b("Row Groups", () => E("rowGroups", n))), a.appendChild(b("Column Groups", () => E("columnGroups", n))), a.appendChild(b("Values", () => $(n))), a.appendChild(b("Available Fields", () => U(n))), i.appendChild(a), () => {
|
|
518
520
|
r.abort(), a.remove();
|
|
519
521
|
};
|
|
520
522
|
}
|
|
@@ -526,7 +528,7 @@ function b(i, e) {
|
|
|
526
528
|
const r = document.createElement("div");
|
|
527
529
|
return r.className = "tbw-pivot-section-content", r.appendChild(e()), t.appendChild(o), t.appendChild(r), t;
|
|
528
530
|
}
|
|
529
|
-
function
|
|
531
|
+
function E(i, e) {
|
|
530
532
|
const { config: t, callbacks: o, signal: r } = e, n = document.createElement("div");
|
|
531
533
|
n.className = "tbw-pivot-drop-zone", n.setAttribute("data-zone", i);
|
|
532
534
|
const a = i === "rowGroups" ? t.rowGroupFields ?? [] : t.columnGroupFields ?? [];
|
|
@@ -535,7 +537,7 @@ function T(i, e) {
|
|
|
535
537
|
s.className = "tbw-pivot-placeholder", s.textContent = "Drag fields here or click to add", n.appendChild(s);
|
|
536
538
|
} else
|
|
537
539
|
for (const s of a)
|
|
538
|
-
n.appendChild(
|
|
540
|
+
n.appendChild(Z(s, i, e));
|
|
539
541
|
return n.addEventListener(
|
|
540
542
|
"dragover",
|
|
541
543
|
(s) => {
|
|
@@ -558,7 +560,7 @@ function T(i, e) {
|
|
|
558
560
|
{ signal: r }
|
|
559
561
|
), n;
|
|
560
562
|
}
|
|
561
|
-
function
|
|
563
|
+
function Z(i, e, t) {
|
|
562
564
|
const { callbacks: o, signal: r } = t, n = document.createElement("div");
|
|
563
565
|
n.className = "tbw-pivot-field-chip", n.draggable = !0;
|
|
564
566
|
const a = o.getAvailableFields().find((d) => d.field === i), s = document.createElement("span");
|
|
@@ -584,7 +586,7 @@ function O(i, e, t) {
|
|
|
584
586
|
{ signal: r }
|
|
585
587
|
), n;
|
|
586
588
|
}
|
|
587
|
-
function
|
|
589
|
+
function $(i) {
|
|
588
590
|
const { config: e, callbacks: t, signal: o } = i, r = document.createElement("div");
|
|
589
591
|
r.className = "tbw-pivot-drop-zone tbw-pivot-values-zone", r.setAttribute("data-zone", "values");
|
|
590
592
|
const n = e.valueFields ?? [];
|
|
@@ -593,7 +595,7 @@ function Z(i) {
|
|
|
593
595
|
a.className = "tbw-pivot-placeholder", a.textContent = "Drag numeric fields here for aggregation", r.appendChild(a);
|
|
594
596
|
} else
|
|
595
597
|
for (const a of n)
|
|
596
|
-
r.appendChild(
|
|
598
|
+
r.appendChild(j(a, i));
|
|
597
599
|
return r.addEventListener(
|
|
598
600
|
"dragover",
|
|
599
601
|
(a) => {
|
|
@@ -616,7 +618,7 @@ function Z(i) {
|
|
|
616
618
|
{ signal: o }
|
|
617
619
|
), r;
|
|
618
620
|
}
|
|
619
|
-
function
|
|
621
|
+
function j(i, e) {
|
|
620
622
|
const { callbacks: t, signal: o } = e, r = document.createElement("div");
|
|
621
623
|
r.className = "tbw-pivot-field-chip tbw-pivot-value-chip";
|
|
622
624
|
const n = t.getAvailableFields().find((c) => c.field === i.field), a = document.createElement("div");
|
|
@@ -645,7 +647,7 @@ function $(i, e) {
|
|
|
645
647
|
{ signal: o }
|
|
646
648
|
), a.appendChild(s), a.appendChild(l), r.appendChild(a), r.appendChild(d), r;
|
|
647
649
|
}
|
|
648
|
-
function
|
|
650
|
+
function U(i) {
|
|
649
651
|
const { config: e, callbacks: t, signal: o } = i, r = document.createElement("div");
|
|
650
652
|
r.className = "tbw-pivot-available-fields";
|
|
651
653
|
const n = t.getAvailableFields(), a = /* @__PURE__ */ new Set([
|
|
@@ -714,7 +716,7 @@ function w(i, e, t, o) {
|
|
|
714
716
|
const a = document.createElement("span");
|
|
715
717
|
return a.textContent = i, r.appendChild(n), r.appendChild(a), r;
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function B(i, e, t) {
|
|
718
720
|
return e.className = "data-grid-row pivot-group-row", e.setAttribute("data-pivot-depth", String(i.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(i.__pivotRowKey ?? "")), e.setAttribute("role", "row"), e.innerHTML = "", t.columns.forEach((o, r) => {
|
|
719
721
|
const n = document.createElement("div");
|
|
720
722
|
if (n.className = "cell", n.setAttribute("data-col", String(r)), n.setAttribute("data-row", String(t.rowIndex)), n.setAttribute("role", "gridcell"), r === 0) {
|
|
@@ -735,7 +737,7 @@ function U(i, e, t) {
|
|
|
735
737
|
e.appendChild(n);
|
|
736
738
|
}), !0;
|
|
737
739
|
}
|
|
738
|
-
function
|
|
740
|
+
function J(i, e, t, o) {
|
|
739
741
|
return e.className = "data-grid-row pivot-leaf-row", e.setAttribute("data-pivot-depth", String(i.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(i.__pivotRowKey ?? "")), e.innerHTML = "", t.forEach((r, n) => {
|
|
740
742
|
const a = document.createElement("div");
|
|
741
743
|
if (a.className = "cell", a.setAttribute("data-col", String(n)), a.setAttribute("data-row", String(o)), a.setAttribute("role", "gridcell"), n === 0) {
|
|
@@ -750,7 +752,7 @@ function B(i, e, t, o) {
|
|
|
750
752
|
e.appendChild(a);
|
|
751
753
|
}), !0;
|
|
752
754
|
}
|
|
753
|
-
function
|
|
755
|
+
function Q(i, e, t) {
|
|
754
756
|
return e.className = "pivot-grand-total-row", e.setAttribute("role", "presentation"), e.innerHTML = "", t.forEach((o, r) => {
|
|
755
757
|
const n = document.createElement("div");
|
|
756
758
|
if (n.className = "cell", n.setAttribute("data-col", String(r)), r === 0) {
|
|
@@ -763,12 +765,12 @@ function J(i, e, t) {
|
|
|
763
765
|
e.appendChild(n);
|
|
764
766
|
}), !0;
|
|
765
767
|
}
|
|
766
|
-
const
|
|
767
|
-
class v extends
|
|
768
|
+
const X = '@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}}}';
|
|
769
|
+
class v extends k {
|
|
768
770
|
/** @internal */
|
|
769
771
|
name = "pivot";
|
|
770
772
|
/** @internal */
|
|
771
|
-
styles =
|
|
773
|
+
styles = X;
|
|
772
774
|
/** Tool panel ID for shell integration */
|
|
773
775
|
static PANEL_ID = "pivot";
|
|
774
776
|
/** @internal */
|
|
@@ -832,11 +834,11 @@ class v extends P {
|
|
|
832
834
|
processRows(e) {
|
|
833
835
|
if (!this.hasInitialized && this.config.active !== !1 && this.hasValidPivotConfig() && (this.hasInitialized = !0, this.isActive = !0), !this.isActive)
|
|
834
836
|
return [...e];
|
|
835
|
-
const t =
|
|
837
|
+
const t = K(this.config);
|
|
836
838
|
if (t.length > 0)
|
|
837
839
|
return this.warn(`Config errors: ${t.join(", ")}`), [...e];
|
|
838
|
-
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult =
|
|
839
|
-
const o = this.config.indentWidth ?? 20, r =
|
|
840
|
+
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult = I(e, this.config), this.expandedKeys.size === 0 && this.defaultExpanded && this.expandAllKeys();
|
|
841
|
+
const o = this.config.indentWidth ?? 20, r = M(
|
|
840
842
|
this.pivotResult.rows,
|
|
841
843
|
this.expandedKeys,
|
|
842
844
|
this.defaultExpanded
|
|
@@ -890,13 +892,13 @@ class v extends P {
|
|
|
890
892
|
/** @internal */
|
|
891
893
|
renderRow(e, t, o) {
|
|
892
894
|
const r = e;
|
|
893
|
-
return r.__pivotRowKey && r.__pivotHasChildren ?
|
|
895
|
+
return r.__pivotRowKey && r.__pivotHasChildren ? B(r, t, {
|
|
894
896
|
columns: this.gridColumns,
|
|
895
897
|
rowIndex: o,
|
|
896
898
|
onToggle: (n) => this.toggle(n),
|
|
897
899
|
resolveIcon: (n) => this.resolveIcon(n),
|
|
898
900
|
setIcon: (n, a) => this.setIcon(n, a)
|
|
899
|
-
}) : r.__pivotRowKey !== void 0 && this.isActive ?
|
|
901
|
+
}) : r.__pivotRowKey !== void 0 && this.isActive ? J(r, t, this.gridColumns, o) : (this.cleanupPivotStyling(t), !1);
|
|
900
902
|
}
|
|
901
903
|
/**
|
|
902
904
|
* Remove pivot-specific classes, attributes, and inline styles from a row element.
|
|
@@ -944,7 +946,7 @@ class v extends P {
|
|
|
944
946
|
__pivotTotal: this.pivotResult.grandTotal,
|
|
945
947
|
...this.pivotResult.totals
|
|
946
948
|
};
|
|
947
|
-
|
|
949
|
+
Q(o, this.grandTotalFooter, this.gridColumns);
|
|
948
950
|
}
|
|
949
951
|
/**
|
|
950
952
|
* Remove the grand total footer element.
|
|
@@ -1081,7 +1083,7 @@ class v extends P {
|
|
|
1081
1083
|
},
|
|
1082
1084
|
getAvailableFields: () => this.getAvailableFields()
|
|
1083
1085
|
};
|
|
1084
|
-
return
|
|
1086
|
+
return O(e, this.config, this.isActive, t);
|
|
1085
1087
|
}
|
|
1086
1088
|
refreshPanel() {
|
|
1087
1089
|
this.panelContainer && (this.panelContainer.innerHTML = "", this.renderPanel(this.panelContainer));
|