@toolbox-web/grid 1.9.0 → 1.9.2
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 +712 -692
- package/all.js.map +1 -1
- package/index.js +321 -300
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +9 -0
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +11 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +9 -0
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +3 -0
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +90 -57
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +9 -0
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js +9 -0
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +38 -29
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +14 -5
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +9 -0
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +63 -54
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +25 -16
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +13 -4
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +13 -4
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +9 -0
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +13 -4
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js +9 -0
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +13 -4
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +42 -33
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +10 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js +10 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +29 -20
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +20 -11
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +15 -6
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +9 -0
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +14 -14
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +14 -14
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/row-reorder.umd.js +1 -1
- package/umd/plugins/row-reorder.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -23,7 +23,7 @@ const R = /{{\s*([^}]+)\s*}}/g, u = "__DG_EMPTY__", E = /^[\w$. '?+\-*/%:()!<>=,
|
|
|
23
23
|
"plaintext",
|
|
24
24
|
"xmp",
|
|
25
25
|
"listing"
|
|
26
|
-
]),
|
|
26
|
+
]), f = /^on\w+$/i, C = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), _ = /^\s*(javascript|vbscript|data|blob):/i;
|
|
27
27
|
function A(n) {
|
|
28
28
|
if (!n || typeof n != "string") return "";
|
|
29
29
|
if (n.indexOf("<") === -1) return n;
|
|
@@ -39,7 +39,7 @@ function D(n) {
|
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
if ((s === "svg" || i.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(i.attributes).some(
|
|
42
|
-
(r) =>
|
|
42
|
+
(r) => f.test(r.name) || r.name === "href" || r.name === "xlink:href"
|
|
43
43
|
)) {
|
|
44
44
|
e.push(i);
|
|
45
45
|
continue;
|
|
@@ -47,7 +47,7 @@ function D(n) {
|
|
|
47
47
|
const l = [];
|
|
48
48
|
for (const o of i.attributes) {
|
|
49
49
|
const r = o.name.toLowerCase();
|
|
50
|
-
if (
|
|
50
|
+
if (f.test(r)) {
|
|
51
51
|
l.push(o.name);
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
@@ -302,10 +302,19 @@ class H {
|
|
|
302
302
|
}
|
|
303
303
|
/**
|
|
304
304
|
* Request a re-render of the grid.
|
|
305
|
+
* Uses ROWS phase - does NOT trigger processColumns hooks.
|
|
305
306
|
*/
|
|
306
307
|
requestRender() {
|
|
307
308
|
this.grid?.requestRender?.();
|
|
308
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Request a columns re-render of the grid.
|
|
312
|
+
* Uses COLUMNS phase - triggers processColumns hooks.
|
|
313
|
+
* Use this when your plugin needs to reprocess column configuration.
|
|
314
|
+
*/
|
|
315
|
+
requestColumnsRender() {
|
|
316
|
+
this.grid?.requestColumnsRender?.();
|
|
317
|
+
}
|
|
309
318
|
/**
|
|
310
319
|
* Request a re-render and restore focus styling afterward.
|
|
311
320
|
* Use this when a plugin action (like expand/collapse) triggers a render
|
|
@@ -493,15 +502,15 @@ function p(n, e) {
|
|
|
493
502
|
const t = new Set(n);
|
|
494
503
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
495
504
|
}
|
|
496
|
-
function
|
|
505
|
+
function q(n, e) {
|
|
497
506
|
const t = new Set(n);
|
|
498
507
|
return t.add(e), t;
|
|
499
508
|
}
|
|
500
|
-
function
|
|
509
|
+
function P(n, e) {
|
|
501
510
|
const t = new Set(n);
|
|
502
511
|
return t.delete(e), t;
|
|
503
512
|
}
|
|
504
|
-
function
|
|
513
|
+
function M(n, e) {
|
|
505
514
|
return n.has(e);
|
|
506
515
|
}
|
|
507
516
|
function F(n, e, t, i) {
|
|
@@ -569,17 +578,17 @@ class b extends H {
|
|
|
569
578
|
if (!t) return;
|
|
570
579
|
const i = e;
|
|
571
580
|
if (i.__frameworkAdapter?.parseDetailElement) {
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
574
|
-
this.config = { ...this.config, detailRenderer:
|
|
581
|
+
const g = i.__frameworkAdapter.parseDetailElement(t);
|
|
582
|
+
if (g) {
|
|
583
|
+
this.config = { ...this.config, detailRenderer: g };
|
|
575
584
|
return;
|
|
576
585
|
}
|
|
577
586
|
}
|
|
578
587
|
const s = t.getAttribute("animation"), l = t.getAttribute("show-expand-column"), o = t.getAttribute("expand-on-row-click"), r = t.getAttribute("collapse-on-click-outside"), a = t.getAttribute("height"), d = {};
|
|
579
588
|
s !== null && (d.animation = s === "false" ? !1 : s), l !== null && (d.showExpandColumn = l !== "false"), o !== null && (d.expandOnRowClick = o === "true"), r !== null && (d.collapseOnClickOutside = r === "true"), a !== null && (d.detailHeight = a === "auto" ? "auto" : parseInt(a, 10));
|
|
580
589
|
const c = t.innerHTML.trim();
|
|
581
|
-
c && !this.config.detailRenderer && (d.detailRenderer = (
|
|
582
|
-
const x = S(c, { value:
|
|
590
|
+
c && !this.config.detailRenderer && (d.detailRenderer = (g, G) => {
|
|
591
|
+
const x = S(c, { value: g, row: g });
|
|
583
592
|
return A(x);
|
|
584
593
|
}), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
|
|
585
594
|
}
|
|
@@ -762,8 +771,8 @@ class b extends H {
|
|
|
762
771
|
s.sort((r, a) => r.index - a.index);
|
|
763
772
|
let l = e, o = 0;
|
|
764
773
|
for (const { index: r, row: a } of s) {
|
|
765
|
-
const d = r * i + o, c = this.getDetailHeight(a),
|
|
766
|
-
o += c, !(r >= e) &&
|
|
774
|
+
const d = r * i + o, c = this.getDetailHeight(a), g = d + i + c;
|
|
775
|
+
o += c, !(r >= e) && g > t && r < l && (l = r);
|
|
767
776
|
}
|
|
768
777
|
return l;
|
|
769
778
|
}
|
|
@@ -775,7 +784,7 @@ class b extends H {
|
|
|
775
784
|
*/
|
|
776
785
|
expand(e) {
|
|
777
786
|
const t = this.rows[e];
|
|
778
|
-
t && (this.expandedRows =
|
|
787
|
+
t && (this.expandedRows = q(this.expandedRows, t), this.requestRender());
|
|
779
788
|
}
|
|
780
789
|
/**
|
|
781
790
|
* Collapse the detail row at the given index.
|
|
@@ -783,7 +792,7 @@ class b extends H {
|
|
|
783
792
|
*/
|
|
784
793
|
collapse(e) {
|
|
785
794
|
const t = this.rows[e];
|
|
786
|
-
t && (this.expandedRows =
|
|
795
|
+
t && (this.expandedRows = P(this.expandedRows, t), this.requestRender());
|
|
787
796
|
}
|
|
788
797
|
/**
|
|
789
798
|
* Toggle the detail row at the given index.
|
|
@@ -800,7 +809,7 @@ class b extends H {
|
|
|
800
809
|
*/
|
|
801
810
|
isExpanded(e) {
|
|
802
811
|
const t = this.rows[e];
|
|
803
|
-
return t ?
|
|
812
|
+
return t ? M(this.expandedRows, t) : !1;
|
|
804
813
|
}
|
|
805
814
|
/**
|
|
806
815
|
* Expand all detail rows.
|