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