@toolbox-web/grid 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.js +1483 -1403
- package/all.js.map +1 -1
- package/index.js +11 -4
- package/index.js.map +1 -1
- package/lib/core/internal/row-animation.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +1 -1
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +44 -1
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +69 -8
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.d.ts +1 -1
- package/lib/plugins/clipboard/index.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +257 -192
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +31 -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/ContextMenuPlugin.d.ts +8 -0
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.js +75 -60
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/context-menu/types.d.ts +7 -0
- package/lib/plugins/context-menu/types.d.ts.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/editors.d.ts +2 -2
- package/lib/plugins/editing/editors.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +420 -381
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +6 -23
- package/lib/plugins/editing/types.d.ts.map +1 -1
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.js +75 -66
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.d.ts +1 -1
- package/lib/plugins/filtering/index.d.ts.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/PinnedRowsPlugin.d.ts +1 -0
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +118 -87
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pinned-rows/pinned-rows.d.ts +2 -1
- package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/types.d.ts +23 -2
- package/lib/plugins/pinned-rows/types.d.ts.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +147 -139
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/shared/data-collection.d.ts +33 -0
- package/lib/plugins/shared/data-collection.d.ts.map +1 -0
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +23 -23
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +2 -2
- 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/context-menu.umd.js +1 -1
- package/umd/plugins/context-menu.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/export.umd.js +7 -7
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -21,6 +21,7 @@ import { AggregationRowConfig, PinnedRowsConfig, PinnedRowsContext, PinnedRowsPa
|
|
|
21
21
|
* | `showRowCount` | `boolean` | `true` | Show total row count |
|
|
22
22
|
* | `showSelectedCount` | `boolean` | `true` | Show selected row count |
|
|
23
23
|
* | `showFilteredCount` | `boolean` | `true` | Show filtered row count |
|
|
24
|
+
* | `fullWidth` | `boolean` | `false` | Default fullWidth for aggregation rows |
|
|
24
25
|
* | `aggregationRows` | `AggregationRowConfig[]` | - | Aggregation row configs |
|
|
25
26
|
*
|
|
26
27
|
* ## Built-in Aggregation Functions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinnedRowsPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-rows/PinnedRowsPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1G
|
|
1
|
+
{"version":3,"file":"PinnedRowsPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-rows/PinnedRowsPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACpE,gBAAgB;IAChB,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAOhE;IAGD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,uBAAuB,CAA4B;IAC3D,OAAO,CAAC,0BAA0B,CAA4B;IAC9D,OAAO,CAAC,aAAa,CAA4B;IAIjD,gBAAgB;IACP,MAAM,IAAI,IAAI;IAqBvB,gBAAgB;IACP,WAAW,IAAI,IAAI;IA8H5B,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;OAGG;IACH,UAAU,IAAI,iBAAiB;IAa/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAQtC;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAO7B;;;OAGG;IACH,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI;IAQlD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAOvC"}
|
|
@@ -11,7 +11,7 @@ const b = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
|
|
|
11
11
|
filterActive: b,
|
|
12
12
|
print: "🖨️"
|
|
13
13
|
};
|
|
14
|
-
class
|
|
14
|
+
class y {
|
|
15
15
|
/**
|
|
16
16
|
* Plugin dependencies - declare other plugins this one requires.
|
|
17
17
|
*
|
|
@@ -146,8 +146,8 @@ class A {
|
|
|
146
146
|
* @returns `true` if the event was cancelled (preventDefault called), `false` otherwise
|
|
147
147
|
*/
|
|
148
148
|
emitCancelable(t, e) {
|
|
149
|
-
const
|
|
150
|
-
return this.grid?.dispatchEvent?.(
|
|
149
|
+
const r = new CustomEvent(t, { detail: e, bubbles: !0, cancelable: !0 });
|
|
150
|
+
return this.grid?.dispatchEvent?.(r), r.defaultPrevented;
|
|
151
151
|
}
|
|
152
152
|
// =========================================================================
|
|
153
153
|
// Event Bus - Plugin-to-Plugin Communication
|
|
@@ -342,8 +342,8 @@ class A {
|
|
|
342
342
|
get animationDuration() {
|
|
343
343
|
const t = this.gridElement;
|
|
344
344
|
if (t) {
|
|
345
|
-
const e = getComputedStyle(t).getPropertyValue("--tbw-animation-duration").trim(),
|
|
346
|
-
if (!isNaN(
|
|
345
|
+
const e = getComputedStyle(t).getPropertyValue("--tbw-animation-duration").trim(), r = parseInt(e, 10);
|
|
346
|
+
if (!isNaN(r)) return r;
|
|
347
347
|
}
|
|
348
348
|
return 200;
|
|
349
349
|
}
|
|
@@ -378,9 +378,9 @@ class A {
|
|
|
378
378
|
// #endregion
|
|
379
379
|
}
|
|
380
380
|
const p = {
|
|
381
|
-
sum: (n, t) => n.reduce((e,
|
|
381
|
+
sum: (n, t) => n.reduce((e, r) => e + (Number(r[t]) || 0), 0),
|
|
382
382
|
avg: (n, t) => {
|
|
383
|
-
const e = n.reduce((
|
|
383
|
+
const e = n.reduce((r, s) => r + (Number(s[t]) || 0), 0);
|
|
384
384
|
return n.length ? e / n.length : 0;
|
|
385
385
|
},
|
|
386
386
|
count: (n) => n.length,
|
|
@@ -388,147 +388,176 @@ const p = {
|
|
|
388
388
|
max: (n, t) => n.length ? Math.max(...n.map((e) => Number(e[t]) || -1 / 0)) : 0,
|
|
389
389
|
first: (n, t) => n[0]?.[t],
|
|
390
390
|
last: (n, t) => n[n.length - 1]?.[t]
|
|
391
|
-
},
|
|
391
|
+
}, h = /* @__PURE__ */ new Map(), g = {
|
|
392
392
|
/**
|
|
393
393
|
* Register a custom aggregator function.
|
|
394
394
|
*/
|
|
395
395
|
register(n, t) {
|
|
396
|
-
|
|
396
|
+
h.set(n, t);
|
|
397
397
|
},
|
|
398
398
|
/**
|
|
399
399
|
* Unregister a custom aggregator function.
|
|
400
400
|
*/
|
|
401
401
|
unregister(n) {
|
|
402
|
-
|
|
402
|
+
h.delete(n);
|
|
403
403
|
},
|
|
404
404
|
/**
|
|
405
405
|
* Get an aggregator function by reference.
|
|
406
406
|
*/
|
|
407
407
|
get(n) {
|
|
408
408
|
if (n !== void 0)
|
|
409
|
-
return typeof n == "function" ? n :
|
|
409
|
+
return typeof n == "function" ? n : h.get(n) ?? p[n];
|
|
410
410
|
},
|
|
411
411
|
/**
|
|
412
412
|
* Run an aggregator on a set of rows.
|
|
413
413
|
*/
|
|
414
|
-
run(n, t, e,
|
|
415
|
-
const
|
|
416
|
-
return
|
|
414
|
+
run(n, t, e, r) {
|
|
415
|
+
const s = this.get(n);
|
|
416
|
+
return s ? s(t, e, r) : void 0;
|
|
417
417
|
},
|
|
418
418
|
/**
|
|
419
419
|
* Check if an aggregator exists.
|
|
420
420
|
*/
|
|
421
421
|
has(n) {
|
|
422
|
-
return
|
|
422
|
+
return h.has(n) || n in p;
|
|
423
423
|
},
|
|
424
424
|
/**
|
|
425
425
|
* List all available aggregator names.
|
|
426
426
|
*/
|
|
427
427
|
list() {
|
|
428
|
-
return [...Object.keys(p), ...
|
|
428
|
+
return [...Object.keys(p), ...h.keys()];
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const w =
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
function
|
|
431
|
+
g.register.bind(g);
|
|
432
|
+
g.unregister.bind(g);
|
|
433
|
+
const w = g.get.bind(g);
|
|
434
|
+
g.run.bind(g);
|
|
435
|
+
g.list.bind(g);
|
|
436
|
+
function S(n) {
|
|
437
437
|
return typeof n == "object" && n !== null && "aggFunc" in n;
|
|
438
438
|
}
|
|
439
439
|
function m(n, t) {
|
|
440
440
|
const e = document.createElement("div");
|
|
441
441
|
e.className = "tbw-pinned-rows", e.setAttribute("role", "presentation"), e.setAttribute("aria-live", "polite");
|
|
442
|
-
const o = document.createElement("div");
|
|
443
|
-
o.className = "tbw-pinned-rows-left";
|
|
444
442
|
const r = document.createElement("div");
|
|
445
|
-
r.className = "tbw-pinned-rows-
|
|
443
|
+
r.className = "tbw-pinned-rows-left";
|
|
446
444
|
const s = document.createElement("div");
|
|
447
|
-
|
|
445
|
+
s.className = "tbw-pinned-rows-center";
|
|
446
|
+
const o = document.createElement("div");
|
|
447
|
+
if (o.className = "tbw-pinned-rows-right", n.showRowCount !== !1) {
|
|
448
448
|
const i = document.createElement("span");
|
|
449
|
-
i.className = "tbw-status-panel tbw-status-panel-row-count", i.textContent = `Total: ${t.totalRows} rows`,
|
|
449
|
+
i.className = "tbw-status-panel tbw-status-panel-row-count", i.textContent = `Total: ${t.totalRows} rows`, r.appendChild(i);
|
|
450
450
|
}
|
|
451
451
|
if (n.showFilteredCount && t.filteredRows !== t.totalRows) {
|
|
452
452
|
const i = document.createElement("span");
|
|
453
|
-
i.className = "tbw-status-panel tbw-status-panel-filtered-count", i.textContent = `Filtered: ${t.filteredRows}`,
|
|
453
|
+
i.className = "tbw-status-panel tbw-status-panel-filtered-count", i.textContent = `Filtered: ${t.filteredRows}`, r.appendChild(i);
|
|
454
454
|
}
|
|
455
455
|
if (n.showSelectedCount && t.selectedRows > 0) {
|
|
456
456
|
const i = document.createElement("span");
|
|
457
|
-
i.className = "tbw-status-panel tbw-status-panel-selected-count", i.textContent = `Selected: ${t.selectedRows}`,
|
|
457
|
+
i.className = "tbw-status-panel tbw-status-panel-selected-count", i.textContent = `Selected: ${t.selectedRows}`, o.appendChild(i);
|
|
458
458
|
}
|
|
459
459
|
if (n.customPanels)
|
|
460
460
|
for (const i of n.customPanels) {
|
|
461
|
-
const a =
|
|
461
|
+
const a = N(i, t);
|
|
462
462
|
switch (i.position) {
|
|
463
463
|
case "left":
|
|
464
|
-
|
|
464
|
+
r.appendChild(a);
|
|
465
465
|
break;
|
|
466
466
|
case "center":
|
|
467
|
-
|
|
467
|
+
s.appendChild(a);
|
|
468
468
|
break;
|
|
469
469
|
case "right":
|
|
470
|
-
|
|
470
|
+
o.appendChild(a);
|
|
471
471
|
break;
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
return e.appendChild(
|
|
474
|
+
return e.appendChild(r), e.appendChild(s), e.appendChild(o), e;
|
|
475
475
|
}
|
|
476
476
|
function C(n) {
|
|
477
477
|
const t = document.createElement("div");
|
|
478
478
|
return t.className = `tbw-aggregation-rows tbw-aggregation-rows-${n}`, t.setAttribute("role", "presentation"), t;
|
|
479
479
|
}
|
|
480
|
-
function v(n, t, e,
|
|
480
|
+
function v(n, t, e, r, s = !1) {
|
|
481
481
|
n.innerHTML = "";
|
|
482
|
-
for (const
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
482
|
+
for (const o of t) {
|
|
483
|
+
const i = document.createElement("div");
|
|
484
|
+
i.className = "tbw-aggregation-row", i.setAttribute("role", "presentation"), o.id && i.setAttribute("data-aggregation-id", o.id), o.fullWidth ?? s ? B(i, o, e, r) : x(i, o, e, r), n.appendChild(i);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function B(n, t, e, r) {
|
|
488
|
+
const s = document.createElement("div");
|
|
489
|
+
s.className = "tbw-aggregation-cell tbw-aggregation-cell-full", s.style.gridColumn = "1 / -1";
|
|
490
|
+
const o = typeof t.label == "function" ? t.label(r, e) : t.label;
|
|
491
|
+
if (o) {
|
|
492
|
+
const a = document.createElement("span");
|
|
493
|
+
a.className = "tbw-aggregation-label", a.textContent = o, s.appendChild(a);
|
|
494
|
+
}
|
|
495
|
+
const i = W(t, e, r);
|
|
496
|
+
i && s.appendChild(i), n.appendChild(s);
|
|
497
|
+
}
|
|
498
|
+
function x(n, t, e, r) {
|
|
499
|
+
for (const s of e) {
|
|
500
|
+
const o = document.createElement("div");
|
|
501
|
+
o.className = "tbw-aggregation-cell", o.setAttribute("data-field", s.field);
|
|
502
|
+
const { value: i, formatter: a } = A(t, s, r);
|
|
503
|
+
i != null ? o.textContent = a ? a(i, s.field, s) : String(i) : o.textContent = "", n.appendChild(o);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function A(n, t, e) {
|
|
507
|
+
let r, s;
|
|
508
|
+
const o = n.aggregators?.[t.field];
|
|
509
|
+
if (o)
|
|
510
|
+
if (S(o)) {
|
|
511
|
+
const i = w(o.aggFunc);
|
|
512
|
+
i && (r = i(e, t.field, t)), s = o.formatter;
|
|
513
|
+
} else {
|
|
514
|
+
const i = w(o);
|
|
515
|
+
i && (r = i(e, t.field, t));
|
|
516
|
+
}
|
|
517
|
+
else if (n.cells && Object.prototype.hasOwnProperty.call(n.cells, t.field)) {
|
|
518
|
+
const i = n.cells[t.field];
|
|
519
|
+
typeof i == "function" ? r = i(e, t.field, t) : r = i;
|
|
508
520
|
}
|
|
521
|
+
return { value: r, formatter: s };
|
|
509
522
|
}
|
|
510
|
-
function
|
|
523
|
+
function W(n, t, e) {
|
|
524
|
+
const r = n.aggregators && Object.keys(n.aggregators).length > 0, s = n.cells && Object.keys(n.cells).length > 0;
|
|
525
|
+
if (!r && !s) return null;
|
|
526
|
+
const o = document.createElement("span");
|
|
527
|
+
o.className = "tbw-aggregation-aggregates";
|
|
528
|
+
for (const i of t) {
|
|
529
|
+
const { value: a, formatter: d } = A(n, i, e);
|
|
530
|
+
if (a != null) {
|
|
531
|
+
const c = document.createElement("span");
|
|
532
|
+
c.className = "tbw-aggregation-aggregate", c.setAttribute("data-field", i.field);
|
|
533
|
+
const u = i.header ?? i.field, f = d ? d(a, i.field, i) : String(a);
|
|
534
|
+
c.textContent = `${u}: ${f}`, o.appendChild(c);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return o.children.length > 0 ? o : null;
|
|
538
|
+
}
|
|
539
|
+
function N(n, t) {
|
|
511
540
|
const e = document.createElement("div");
|
|
512
541
|
e.className = "tbw-status-panel tbw-status-panel-custom", e.id = `status-panel-${n.id}`;
|
|
513
|
-
const
|
|
514
|
-
return typeof
|
|
542
|
+
const r = n.render(t);
|
|
543
|
+
return typeof r == "string" ? e.innerHTML = r : e.appendChild(r), e;
|
|
515
544
|
}
|
|
516
|
-
function E(n, t, e,
|
|
545
|
+
function E(n, t, e, r, s) {
|
|
517
546
|
return {
|
|
518
547
|
totalRows: n.length,
|
|
519
|
-
filteredRows:
|
|
520
|
-
selectedRows:
|
|
548
|
+
filteredRows: s?.cachedResult?.length ?? n.length,
|
|
549
|
+
selectedRows: r?.selected?.size ?? 0,
|
|
521
550
|
columns: t,
|
|
522
551
|
rows: n,
|
|
523
552
|
grid: e
|
|
524
553
|
};
|
|
525
554
|
}
|
|
526
|
-
const
|
|
527
|
-
class
|
|
555
|
+
const P = "@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:block;align-items:center;align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;text-overflow:ellipsis;white-space:var(--tbw-cell-white-space, nowrap)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0;display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem)}.tbw-aggregation-label{white-space:nowrap}.tbw-aggregation-aggregates{display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem);font-weight:400;opacity:.85}.tbw-aggregation-aggregate{white-space:nowrap}}";
|
|
556
|
+
class F extends y {
|
|
528
557
|
/** @internal */
|
|
529
558
|
name = "pinnedRows";
|
|
530
559
|
/** @internal */
|
|
531
|
-
styles =
|
|
560
|
+
styles = P;
|
|
532
561
|
/** @internal */
|
|
533
562
|
get defaultConfig() {
|
|
534
563
|
return {
|
|
@@ -558,41 +587,43 @@ class x extends A {
|
|
|
558
587
|
const e = t.querySelector(".tbw-scroll-area") ?? t.querySelector(".tbw-grid-content") ?? t.children[0];
|
|
559
588
|
if (!e) return;
|
|
560
589
|
this.footerWrapper && !e.contains(this.footerWrapper) && (this.footerWrapper = null, this.bottomAggregationContainer = null, this.infoBarElement = null), this.topAggregationContainer && !e.contains(this.topAggregationContainer) && (this.topAggregationContainer = null), this.infoBarElement && !e.contains(this.infoBarElement) && (this.infoBarElement = null);
|
|
561
|
-
const
|
|
590
|
+
const r = this.getSelectionState(), s = this.getFilterState(), o = E(
|
|
562
591
|
this.sourceRows,
|
|
563
592
|
this.columns,
|
|
564
593
|
this.grid,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
), i = this.config.aggregationRows || [], a = i.filter((
|
|
594
|
+
r,
|
|
595
|
+
s
|
|
596
|
+
), i = this.config.aggregationRows || [], a = i.filter((l) => l.position === "top"), d = i.filter((l) => l.position !== "top");
|
|
568
597
|
if (a.length > 0) {
|
|
569
598
|
if (!this.topAggregationContainer) {
|
|
570
599
|
this.topAggregationContainer = C("top");
|
|
571
|
-
const
|
|
572
|
-
|
|
600
|
+
const l = t.querySelector(".header");
|
|
601
|
+
l && l.nextSibling ? e.insertBefore(this.topAggregationContainer, l.nextSibling) : e.appendChild(this.topAggregationContainer);
|
|
573
602
|
}
|
|
574
603
|
v(
|
|
575
604
|
this.topAggregationContainer,
|
|
576
605
|
a,
|
|
577
606
|
this.visibleColumns,
|
|
578
|
-
this.sourceRows
|
|
607
|
+
this.sourceRows,
|
|
608
|
+
this.config.fullWidth
|
|
579
609
|
);
|
|
580
610
|
} else this.topAggregationContainer && (this.topAggregationContainer.remove(), this.topAggregationContainer = null);
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
611
|
+
const c = this.config.showRowCount !== !1 || this.config.showSelectedCount && o.selectedRows > 0 || this.config.showFilteredCount && o.filteredRows !== o.totalRows || this.config.customPanels && this.config.customPanels.length > 0, u = c && this.config.position !== "top", f = d.length > 0 || u;
|
|
612
|
+
if (c && this.config.position === "top")
|
|
583
613
|
if (!this.infoBarElement)
|
|
584
|
-
this.infoBarElement = m(this.config,
|
|
614
|
+
this.infoBarElement = m(this.config, o), e.insertBefore(this.infoBarElement, e.firstChild);
|
|
585
615
|
else {
|
|
586
|
-
const
|
|
587
|
-
this.infoBarElement.replaceWith(
|
|
616
|
+
const l = m(this.config, o);
|
|
617
|
+
this.infoBarElement.replaceWith(l), this.infoBarElement = l;
|
|
588
618
|
}
|
|
589
619
|
else this.config.position === "top" && this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null);
|
|
590
|
-
|
|
620
|
+
f ? (this.footerWrapper || (this.footerWrapper = document.createElement("div"), this.footerWrapper.className = "tbw-footer", e.appendChild(this.footerWrapper)), this.footerWrapper.innerHTML = "", d.length > 0 && (this.bottomAggregationContainer || (this.bottomAggregationContainer = C("bottom")), this.footerWrapper.appendChild(this.bottomAggregationContainer), v(
|
|
591
621
|
this.bottomAggregationContainer,
|
|
592
|
-
|
|
622
|
+
d,
|
|
593
623
|
this.visibleColumns,
|
|
594
|
-
this.sourceRows
|
|
595
|
-
|
|
624
|
+
this.sourceRows,
|
|
625
|
+
this.config.fullWidth
|
|
626
|
+
)), u && (this.infoBarElement = m(this.config, o), this.footerWrapper.appendChild(this.infoBarElement))) : this.cleanupFooter();
|
|
596
627
|
}
|
|
597
628
|
// #endregion
|
|
598
629
|
// #region Private Methods
|
|
@@ -669,6 +700,6 @@ class x extends A {
|
|
|
669
700
|
// #endregion
|
|
670
701
|
}
|
|
671
702
|
export {
|
|
672
|
-
|
|
703
|
+
F as PinnedRowsPlugin
|
|
673
704
|
};
|
|
674
705
|
//# sourceMappingURL=index.js.map
|