@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 b = '<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>', A = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,12 @@ const E = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: b,
|
|
11
|
+
filterActive: b,
|
|
12
|
+
print: "🖨️"
|
|
10
13
|
};
|
|
11
|
-
class
|
|
14
|
+
class R {
|
|
12
15
|
/**
|
|
13
16
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
17
|
*
|
|
@@ -232,7 +235,7 @@ class A {
|
|
|
232
235
|
*/
|
|
233
236
|
get gridIcons() {
|
|
234
237
|
const t = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
238
|
+
return { ...A, ...t };
|
|
236
239
|
}
|
|
237
240
|
// #region Animation Helpers
|
|
238
241
|
/**
|
|
@@ -361,10 +364,10 @@ const p = {
|
|
|
361
364
|
};
|
|
362
365
|
d.register.bind(d);
|
|
363
366
|
d.unregister.bind(d);
|
|
364
|
-
const
|
|
367
|
+
const w = d.get.bind(d);
|
|
365
368
|
d.run.bind(d);
|
|
366
369
|
d.list.bind(d);
|
|
367
|
-
function
|
|
370
|
+
function y(n) {
|
|
368
371
|
return typeof n == "object" && n !== null && "aggFunc" in n;
|
|
369
372
|
}
|
|
370
373
|
function m(n, t) {
|
|
@@ -389,7 +392,7 @@ function m(n, t) {
|
|
|
389
392
|
}
|
|
390
393
|
if (n.customPanels)
|
|
391
394
|
for (const i of n.customPanels) {
|
|
392
|
-
const a =
|
|
395
|
+
const a = S(i, t);
|
|
393
396
|
switch (i.position) {
|
|
394
397
|
case "left":
|
|
395
398
|
o.appendChild(a);
|
|
@@ -404,11 +407,11 @@ function m(n, t) {
|
|
|
404
407
|
}
|
|
405
408
|
return e.appendChild(o), e.appendChild(r), e.appendChild(s), e;
|
|
406
409
|
}
|
|
407
|
-
function
|
|
410
|
+
function C(n) {
|
|
408
411
|
const t = document.createElement("div");
|
|
409
412
|
return t.className = `tbw-aggregation-rows tbw-aggregation-rows-${n}`, t.setAttribute("role", "presentation"), t;
|
|
410
413
|
}
|
|
411
|
-
function
|
|
414
|
+
function v(n, t, e, o) {
|
|
412
415
|
n.innerHTML = "";
|
|
413
416
|
for (const r of t) {
|
|
414
417
|
const s = document.createElement("div");
|
|
@@ -422,11 +425,11 @@ function C(n, t, e, o) {
|
|
|
422
425
|
let l, u;
|
|
423
426
|
const h = r.aggregators?.[i.field];
|
|
424
427
|
if (h)
|
|
425
|
-
if (
|
|
426
|
-
const g =
|
|
428
|
+
if (y(h)) {
|
|
429
|
+
const g = w(h.aggFunc);
|
|
427
430
|
g && (l = g(o, i.field, i)), u = h.formatter;
|
|
428
431
|
} else {
|
|
429
|
-
const g =
|
|
432
|
+
const g = w(h);
|
|
430
433
|
g && (l = g(o, i.field, i));
|
|
431
434
|
}
|
|
432
435
|
else if (r.cells && Object.prototype.hasOwnProperty.call(r.cells, i.field)) {
|
|
@@ -438,13 +441,13 @@ function C(n, t, e, o) {
|
|
|
438
441
|
n.appendChild(s);
|
|
439
442
|
}
|
|
440
443
|
}
|
|
441
|
-
function
|
|
444
|
+
function S(n, t) {
|
|
442
445
|
const e = document.createElement("div");
|
|
443
446
|
e.className = "tbw-status-panel tbw-status-panel-custom", e.id = `status-panel-${n.id}`;
|
|
444
447
|
const o = n.render(t);
|
|
445
448
|
return typeof o == "string" ? e.innerHTML = o : e.appendChild(o), e;
|
|
446
449
|
}
|
|
447
|
-
function
|
|
450
|
+
function E(n, t, e, o, r) {
|
|
448
451
|
return {
|
|
449
452
|
totalRows: n.length,
|
|
450
453
|
filteredRows: r?.cachedResult?.length ?? n.length,
|
|
@@ -454,12 +457,12 @@ function v(n, t, e, o, r) {
|
|
|
454
457
|
grid: e
|
|
455
458
|
};
|
|
456
459
|
}
|
|
457
|
-
const
|
|
458
|
-
class
|
|
460
|
+
const B = "@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}}";
|
|
461
|
+
class x extends R {
|
|
459
462
|
/** @internal */
|
|
460
463
|
name = "pinnedRows";
|
|
461
464
|
/** @internal */
|
|
462
|
-
styles =
|
|
465
|
+
styles = B;
|
|
463
466
|
/** @internal */
|
|
464
467
|
get defaultConfig() {
|
|
465
468
|
return {
|
|
@@ -489,7 +492,7 @@ class B extends A {
|
|
|
489
492
|
const e = t.querySelector(".tbw-scroll-area") ?? t.querySelector(".tbw-grid-content") ?? t.children[0];
|
|
490
493
|
if (!e) return;
|
|
491
494
|
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);
|
|
492
|
-
const o = this.getSelectionState(), r = this.getFilterState(), s =
|
|
495
|
+
const o = this.getSelectionState(), r = this.getFilterState(), s = E(
|
|
493
496
|
this.rows,
|
|
494
497
|
this.columns,
|
|
495
498
|
this.grid,
|
|
@@ -498,11 +501,11 @@ class B extends A {
|
|
|
498
501
|
), i = this.config.aggregationRows || [], a = i.filter((c) => c.position === "top"), l = i.filter((c) => c.position !== "top");
|
|
499
502
|
if (a.length > 0) {
|
|
500
503
|
if (!this.topAggregationContainer) {
|
|
501
|
-
this.topAggregationContainer =
|
|
504
|
+
this.topAggregationContainer = C("top");
|
|
502
505
|
const c = t.querySelector(".header");
|
|
503
506
|
c && c.nextSibling ? e.insertBefore(this.topAggregationContainer, c.nextSibling) : e.appendChild(this.topAggregationContainer);
|
|
504
507
|
}
|
|
505
|
-
|
|
508
|
+
v(
|
|
506
509
|
this.topAggregationContainer,
|
|
507
510
|
a,
|
|
508
511
|
this.visibleColumns,
|
|
@@ -518,7 +521,7 @@ class B extends A {
|
|
|
518
521
|
this.infoBarElement.replaceWith(c), this.infoBarElement = c;
|
|
519
522
|
}
|
|
520
523
|
else this.config.position === "top" && this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null);
|
|
521
|
-
g ? (this.footerWrapper || (this.footerWrapper = document.createElement("div"), this.footerWrapper.className = "tbw-footer", e.appendChild(this.footerWrapper)), this.footerWrapper.innerHTML = "", l.length > 0 && (this.bottomAggregationContainer || (this.bottomAggregationContainer =
|
|
524
|
+
g ? (this.footerWrapper || (this.footerWrapper = document.createElement("div"), this.footerWrapper.className = "tbw-footer", e.appendChild(this.footerWrapper)), this.footerWrapper.innerHTML = "", l.length > 0 && (this.bottomAggregationContainer || (this.bottomAggregationContainer = C("bottom")), this.footerWrapper.appendChild(this.bottomAggregationContainer), v(
|
|
522
525
|
this.bottomAggregationContainer,
|
|
523
526
|
l,
|
|
524
527
|
this.visibleColumns,
|
|
@@ -561,7 +564,7 @@ class B extends A {
|
|
|
561
564
|
*/
|
|
562
565
|
getContext() {
|
|
563
566
|
const t = this.getSelectionState(), e = this.getFilterState();
|
|
564
|
-
return
|
|
567
|
+
return E(
|
|
565
568
|
this.rows,
|
|
566
569
|
this.columns,
|
|
567
570
|
this.grid,
|
|
@@ -600,6 +603,6 @@ class B extends A {
|
|
|
600
603
|
// #endregion
|
|
601
604
|
}
|
|
602
605
|
export {
|
|
603
|
-
|
|
606
|
+
x as PinnedRowsPlugin
|
|
604
607
|
};
|
|
605
608
|
//# sourceMappingURL=index.js.map
|