@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
|
@@ -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>', S = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -7,8 +7,8 @@ const m = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
|
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
9
|
toolPanel: "☰",
|
|
10
|
-
filter:
|
|
11
|
-
filterActive:
|
|
10
|
+
filter: b,
|
|
11
|
+
filterActive: b,
|
|
12
12
|
print: "🖨️"
|
|
13
13
|
};
|
|
14
14
|
class E {
|
|
@@ -208,10 +208,19 @@ class E {
|
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* Request a re-render of the grid.
|
|
211
|
+
* Uses ROWS phase - does NOT trigger processColumns hooks.
|
|
211
212
|
*/
|
|
212
213
|
requestRender() {
|
|
213
214
|
this.grid?.requestRender?.();
|
|
214
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Request a columns re-render of the grid.
|
|
218
|
+
* Uses COLUMNS phase - triggers processColumns hooks.
|
|
219
|
+
* Use this when your plugin needs to reprocess column configuration.
|
|
220
|
+
*/
|
|
221
|
+
requestColumnsRender() {
|
|
222
|
+
this.grid?.requestColumnsRender?.();
|
|
223
|
+
}
|
|
215
224
|
/**
|
|
216
225
|
* Request a re-render and restore focus styling afterward.
|
|
217
226
|
* Use this when a plugin action (like expand/collapse) triggers a render
|
|
@@ -368,7 +377,7 @@ class E {
|
|
|
368
377
|
}
|
|
369
378
|
// #endregion
|
|
370
379
|
}
|
|
371
|
-
function
|
|
380
|
+
function R(o, e, t) {
|
|
372
381
|
return o.id !== void 0 ? String(o.id) : t ? `${t}-${e}` : String(e);
|
|
373
382
|
}
|
|
374
383
|
function y(o, e) {
|
|
@@ -378,7 +387,7 @@ function y(o, e) {
|
|
|
378
387
|
function w(o, e, t = null, n = 0) {
|
|
379
388
|
const r = e.childrenField ?? "children", s = /* @__PURE__ */ new Set();
|
|
380
389
|
for (let i = 0; i < o.length; i++) {
|
|
381
|
-
const l = o[i], a =
|
|
390
|
+
const l = o[i], a = R(l, i, t), d = l[r];
|
|
382
391
|
if (Array.isArray(d) && d.length > 0) {
|
|
383
392
|
s.add(a);
|
|
384
393
|
const h = w(d, e, a, n + 1);
|
|
@@ -390,15 +399,15 @@ function w(o, e, t = null, n = 0) {
|
|
|
390
399
|
function A() {
|
|
391
400
|
return /* @__PURE__ */ new Set();
|
|
392
401
|
}
|
|
393
|
-
function
|
|
402
|
+
function v(o, e, t, n = null, r = 0) {
|
|
394
403
|
const s = t.childrenField ?? "children";
|
|
395
404
|
for (let i = 0; i < o.length; i++) {
|
|
396
|
-
const l = o[i], a =
|
|
405
|
+
const l = o[i], a = R(l, i, n);
|
|
397
406
|
if (a === e)
|
|
398
407
|
return [a];
|
|
399
408
|
const d = l[s];
|
|
400
409
|
if (Array.isArray(d) && d.length > 0) {
|
|
401
|
-
const h =
|
|
410
|
+
const h = v(d, e, t, a, r + 1);
|
|
402
411
|
if (h)
|
|
403
412
|
return [a, ...h];
|
|
404
413
|
}
|
|
@@ -406,7 +415,7 @@ function K(o, e, t, n = null, r = 0) {
|
|
|
406
415
|
return null;
|
|
407
416
|
}
|
|
408
417
|
function C(o, e, t, n) {
|
|
409
|
-
const r =
|
|
418
|
+
const r = v(o, e, t);
|
|
410
419
|
if (!r) return n;
|
|
411
420
|
const s = new Set(n);
|
|
412
421
|
for (let i = 0; i < r.length - 1; i++)
|
|
@@ -570,8 +579,8 @@ class T extends E {
|
|
|
570
579
|
const t = [...e];
|
|
571
580
|
if (t.length === 0) return t;
|
|
572
581
|
const n = t[0], r = n.viewRenderer, s = () => this.config, i = this.setIcon.bind(this), l = this.resolveIcon.bind(this), a = (d) => {
|
|
573
|
-
const { row: h, value: u } = d, { showExpandIcons:
|
|
574
|
-
if (f.className = "tree-cell-wrapper", f.style.setProperty("--tbw-tree-depth", String(_)),
|
|
582
|
+
const { row: h, value: u } = d, { showExpandIcons: K = !0, indentWidth: m } = s(), g = h, _ = g.__treeDepth ?? 0, f = document.createElement("span");
|
|
583
|
+
if (f.className = "tree-cell-wrapper", f.style.setProperty("--tbw-tree-depth", String(_)), m !== void 0 && f.style.setProperty("--tbw-tree-indent-width", `${m}px`), K)
|
|
575
584
|
if (g.__treeHasChildren) {
|
|
576
585
|
const c = document.createElement("span");
|
|
577
586
|
c.className = `tree-toggle${g.__treeExpanded ? " expanded" : ""}`, i(c, l(g.__treeExpanded ? "collapse" : "expand")), c.setAttribute("data-tree-key", String(g.__treeKey ?? "")), f.appendChild(c);
|