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