@toolbox-web/grid-react 0.15.1 → 0.16.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.
Files changed (79) hide show
  1. package/chunks/{data-grid-O97pdLCY.js → data-grid-oxWjOqoA.js} +160 -173
  2. package/features/clipboard.d.ts +0 -17
  3. package/features/clipboard.d.ts.map +1 -1
  4. package/features/clipboard.js +1 -6
  5. package/features/column-virtualization.d.ts +0 -15
  6. package/features/column-virtualization.d.ts.map +1 -1
  7. package/features/column-virtualization.js +1 -6
  8. package/features/context-menu.d.ts +0 -15
  9. package/features/context-menu.d.ts.map +1 -1
  10. package/features/context-menu.js +1 -6
  11. package/features/editing.d.ts +0 -15
  12. package/features/editing.d.ts.map +1 -1
  13. package/features/editing.js +1 -3
  14. package/features/export.d.ts.map +1 -1
  15. package/features/export.js +9 -14
  16. package/features/filtering.js +15 -15
  17. package/features/grouping-columns.d.ts +0 -15
  18. package/features/grouping-columns.d.ts.map +1 -1
  19. package/features/grouping-columns.js +1 -6
  20. package/features/grouping-rows.d.ts +0 -15
  21. package/features/grouping-rows.d.ts.map +1 -1
  22. package/features/grouping-rows.js +1 -6
  23. package/features/index.js +21 -21
  24. package/features/master-detail.d.ts +0 -17
  25. package/features/master-detail.d.ts.map +1 -1
  26. package/features/master-detail.js +1 -6
  27. package/features/multi-sort.d.ts +0 -21
  28. package/features/multi-sort.d.ts.map +1 -1
  29. package/features/multi-sort.js +1 -3
  30. package/features/pinned-columns.d.ts +0 -15
  31. package/features/pinned-columns.d.ts.map +1 -1
  32. package/features/pinned-columns.js +1 -6
  33. package/features/pinned-rows.d.ts +0 -15
  34. package/features/pinned-rows.d.ts.map +1 -1
  35. package/features/pinned-rows.js +1 -6
  36. package/features/pivot.d.ts +0 -15
  37. package/features/pivot.d.ts.map +1 -1
  38. package/features/pivot.js +1 -3
  39. package/features/print.d.ts.map +1 -1
  40. package/features/print.js +10 -12
  41. package/features/reorder-columns.d.ts +1 -0
  42. package/features/reorder-columns.d.ts.map +1 -0
  43. package/features/reorder-columns.js +1 -0
  44. package/features/reorder-rows.d.ts +1 -0
  45. package/features/reorder-rows.d.ts.map +1 -0
  46. package/features/reorder-rows.js +1 -0
  47. package/features/reorder.d.ts +3 -13
  48. package/features/reorder.d.ts.map +1 -1
  49. package/features/reorder.js +1 -6
  50. package/features/responsive.d.ts +0 -15
  51. package/features/responsive.d.ts.map +1 -1
  52. package/features/responsive.js +1 -6
  53. package/features/row-reorder.d.ts +3 -13
  54. package/features/row-reorder.d.ts.map +1 -1
  55. package/features/row-reorder.js +1 -3
  56. package/features/selection.d.ts.map +1 -1
  57. package/features/selection.js +26 -28
  58. package/features/server-side.d.ts +0 -15
  59. package/features/server-side.d.ts.map +1 -1
  60. package/features/server-side.js +1 -3
  61. package/features/sorting.js +1 -1
  62. package/features/tree.d.ts +0 -15
  63. package/features/tree.d.ts.map +1 -1
  64. package/features/tree.js +1 -6
  65. package/features/undo-redo.d.ts.map +1 -1
  66. package/features/undo-redo.js +12 -17
  67. package/features/visibility.d.ts +0 -15
  68. package/features/visibility.d.ts.map +1 -1
  69. package/features/visibility.js +1 -6
  70. package/index.js +2 -2
  71. package/lib/data-grid.d.ts.map +1 -1
  72. package/lib/feature-props.d.ts +12 -4
  73. package/lib/feature-props.d.ts.map +1 -1
  74. package/lib/feature-registry.d.ts +13 -47
  75. package/lib/feature-registry.d.ts.map +1 -1
  76. package/lib/use-sync-plugins.d.ts +2 -1
  77. package/lib/use-sync-plugins.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/chunks/feature-registry-Y3KvnN54.js +0 -26
@@ -1,14 +1,14 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import { DataGridElement as me } from "@toolbox-web/grid";
3
- import { createContext as Z, useContext as V, useRef as S, useCallback as Q, useEffect as p, forwardRef as he, useMemo as v, useImperativeHandle as ye, Children as we, isValidElement as ve } from "react";
3
+ import { createContext as Z, useContext as V, useRef as x, useCallback as Q, useEffect as p, forwardRef as he, useMemo as C, useImperativeHandle as ye, Children as we, isValidElement as Ce } from "react";
4
4
  import { flushSync as m } from "react-dom";
5
5
  import { createRoot as y } from "react-dom/client";
6
- import { c as Ce } from "./feature-registry-Y3KvnN54.js";
7
- function Re(n) {
6
+ import { createPluginsFromFeatures as Re } from "@toolbox-web/grid/features/registry";
7
+ function ve(n) {
8
8
  return n.charAt(0).toUpperCase() + n.slice(1);
9
9
  }
10
10
  function ae(n) {
11
- return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Re).join(" ");
11
+ return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(ve).join(" ");
12
12
  }
13
13
  const be = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
14
14
  function Ee(n) {
@@ -32,7 +32,7 @@ function Ee(n) {
32
32
  function Pe(n) {
33
33
  return n.map((t) => typeof t == "string" ? Ee(t) : t);
34
34
  }
35
- const _ = {
35
+ const z = {
36
36
  onCellClick: "cell-click",
37
37
  onRowClick: "row-click",
38
38
  onCellActivate: "cell-activate",
@@ -72,15 +72,15 @@ function le(n) {
72
72
  if (e)
73
73
  return q.get(e);
74
74
  }
75
- function Se(n) {
76
- const { children: t, cardRowHeight: e = "auto" } = n, r = S(null), o = Q(
75
+ function xe(n) {
76
+ const { children: t, cardRowHeight: e = "auto" } = n, r = x(null), o = Q(
77
77
  (s) => {
78
78
  if (r.current = s, !s) return;
79
79
  W.set(s, t);
80
- const a = s.closest("tbw-grid");
81
- if (a) {
82
- const l = a.id || a.getAttribute("data-grid-id");
83
- l && q.set(l, t);
80
+ const d = s.closest("tbw-grid");
81
+ if (d) {
82
+ const u = d.id || d.getAttribute("data-grid-id");
83
+ u && q.set(u, t);
84
84
  }
85
85
  },
86
86
  [t]
@@ -89,17 +89,17 @@ function Se(n) {
89
89
  const s = r.current;
90
90
  if (s) {
91
91
  W.delete(s);
92
- const a = s.closest("tbw-grid");
93
- if (a) {
94
- const l = a.id || a.getAttribute("data-grid-id");
95
- l && q.delete(l);
92
+ const d = s.closest("tbw-grid");
93
+ if (d) {
94
+ const u = d.id || d.getAttribute("data-grid-id");
95
+ u && q.delete(u);
96
96
  }
97
97
  }
98
98
  }, []);
99
99
  const c = e === "auto" ? "auto" : String(e);
100
100
  return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: c });
101
101
  }
102
- Se.displayName = "GridResponsiveCard";
102
+ xe.displayName = "GridResponsiveCard";
103
103
  const T = Z(null), Qe = ({ defaults: n, children: t }) => /* @__PURE__ */ b(T.Provider, { value: n, children: t });
104
104
  function Xe() {
105
105
  return V(T);
@@ -107,8 +107,8 @@ function Xe() {
107
107
  function et(n) {
108
108
  return V(T)?.[n];
109
109
  }
110
- const xe = T, I = [];
111
- function Ae(n) {
110
+ const Ae = T, I = [];
111
+ function Se(n) {
112
112
  for (let t = I.length - 1; t >= 0; t--) {
113
113
  const e = I[t];
114
114
  if (n.contains(e.container) && e.container.classList.contains("react-cell-editor")) {
@@ -172,30 +172,30 @@ function Ne(n) {
172
172
  if (e)
173
173
  return K.get(e);
174
174
  }
175
- function Le(n) {
176
- const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, o = S(null), c = Q(
177
- (a) => {
178
- if (o.current = a, !a) return;
179
- B.set(a, t);
180
- const l = a.closest("tbw-grid");
181
- if (l) {
182
- const g = l.id || l.getAttribute("data-grid-id");
175
+ function Fe(n) {
176
+ const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, o = x(null), c = Q(
177
+ (d) => {
178
+ if (o.current = d, !d) return;
179
+ B.set(d, t);
180
+ const u = d.closest("tbw-grid");
181
+ if (u) {
182
+ const g = u.id || u.getAttribute("data-grid-id");
183
183
  g && K.set(g, t);
184
184
  }
185
185
  },
186
186
  [t]
187
187
  );
188
188
  return p(() => () => {
189
- const a = o.current;
190
- if (a) {
191
- B.delete(a);
192
- const l = a.closest("tbw-grid");
193
- if (l) {
194
- const w = l.id || l.getAttribute("data-grid-id");
189
+ const d = o.current;
190
+ if (d) {
191
+ B.delete(d);
192
+ const u = d.closest("tbw-grid");
193
+ if (u) {
194
+ const w = u.id || u.getAttribute("data-grid-id");
195
195
  w && K.delete(w);
196
196
  }
197
- const g = a.parentNode;
198
- g && g.contains(a);
197
+ const g = d.parentNode;
198
+ g && g.contains(d);
199
199
  }
200
200
  }, []), /* @__PURE__ */ b(
201
201
  "tbw-grid-detail",
@@ -206,9 +206,9 @@ function Le(n) {
206
206
  }
207
207
  );
208
208
  }
209
- Le.displayName = "GridDetailPanel";
209
+ Fe.displayName = "GridDetailPanel";
210
210
  const U = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new Map();
211
- function Fe(n) {
211
+ function Le(n) {
212
212
  const t = U.get(n);
213
213
  if (t) return t;
214
214
  const e = n.id;
@@ -216,19 +216,19 @@ function Fe(n) {
216
216
  return J.get(e);
217
217
  }
218
218
  function tt(n) {
219
- const { id: t, title: e, icon: r, tooltip: o, order: c = 100, children: s } = n, a = S(null), l = Q(
219
+ const { id: t, title: e, icon: r, tooltip: o, order: c = 100, children: s } = n, d = x(null), u = Q(
220
220
  (g) => {
221
- a.current = g, g && (U.set(g, s), t && J.set(t, s));
221
+ d.current = g, g && (U.set(g, s), t && J.set(t, s));
222
222
  },
223
223
  [s, t]
224
224
  );
225
225
  return p(() => () => {
226
- const g = a.current;
226
+ const g = d.current;
227
227
  g && (U.delete(g), t && J.delete(t));
228
228
  }, [t]), /* @__PURE__ */ b(
229
229
  "tbw-grid-tool-panel",
230
230
  {
231
- ref: l,
231
+ ref: u,
232
232
  id: t,
233
233
  title: e,
234
234
  icon: r,
@@ -237,23 +237,23 @@ function tt(n) {
237
237
  }
238
238
  );
239
239
  }
240
- const R = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new Map();
240
+ const v = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new Map();
241
241
  function rt(n, t) {
242
- const e = n.getAttribute("field"), r = R.get(n) ?? {};
243
- if (r.renderer = t, R.set(n, r), e) {
242
+ const e = n.getAttribute("field"), r = v.get(n) ?? {};
243
+ if (r.renderer = t, v.set(n, r), e) {
244
244
  const o = E.get(e) ?? {};
245
245
  o.renderer = t, E.set(e, o);
246
246
  }
247
247
  }
248
248
  function nt(n, t) {
249
- const e = n.getAttribute("field"), r = R.get(n) ?? {};
250
- if (r.editor = t, R.set(n, r), e) {
249
+ const e = n.getAttribute("field"), r = v.get(n) ?? {};
250
+ if (r.editor = t, v.set(n, r), e) {
251
251
  const o = E.get(e) ?? {};
252
252
  o.editor = t, E.set(e, o);
253
253
  }
254
254
  }
255
255
  function Te(n) {
256
- let t = R.get(n)?.renderer;
256
+ let t = v.get(n)?.renderer;
257
257
  if (!t) {
258
258
  const e = n.getAttribute("field");
259
259
  e && (t = E.get(e)?.renderer);
@@ -261,7 +261,7 @@ function Te(n) {
261
261
  return t;
262
262
  }
263
263
  function ke(n) {
264
- let t = R.get(n)?.editor;
264
+ let t = v.get(n)?.editor;
265
265
  if (!t) {
266
266
  const e = n.getAttribute("field");
267
267
  e && (t = E.get(e)?.editor);
@@ -288,10 +288,10 @@ class ue {
288
288
  */
289
289
  canHandle(t) {
290
290
  const e = t.getAttribute("field");
291
- let r = R.get(t);
291
+ let r = v.get(t);
292
292
  if (!r && e) {
293
293
  const s = E.get(e);
294
- s && (s.renderer || s.editor) && (r = s, R.set(t, r));
294
+ s && (s.renderer || s.editor) && (r = s, v.set(t, r));
295
295
  }
296
296
  const o = r?.renderer !== void 0, c = r?.editor !== void 0;
297
297
  return r !== void 0 && (o || c);
@@ -315,11 +315,11 @@ class ue {
315
315
  return (o) => {
316
316
  const c = o.cellEl;
317
317
  if (c) {
318
- const l = r.get(c);
319
- if (l)
318
+ const u = r.get(c);
319
+ if (u)
320
320
  return m(() => {
321
- l.root.render(e(o));
322
- }), l.container;
321
+ u.root.render(e(o));
322
+ }), u.container;
323
323
  const g = document.createElement("div");
324
324
  g.className = "react-cell-renderer", g.style.display = "contents";
325
325
  const w = y(g);
@@ -329,10 +329,10 @@ class ue {
329
329
  }
330
330
  const s = document.createElement("div");
331
331
  s.className = "react-cell-renderer", s.style.display = "contents";
332
- const a = y(s);
332
+ const d = y(s);
333
333
  return m(() => {
334
- a.render(e(o));
335
- }), this.mountedViews.push({ root: a, container: s }), s;
334
+ d.render(e(o));
335
+ }), this.mountedViews.push({ root: d, container: s }), s;
336
336
  };
337
337
  }
338
338
  /**
@@ -360,10 +360,10 @@ class ue {
360
360
  return (r, o) => {
361
361
  const c = document.createElement("div");
362
362
  c.className = "react-detail-panel";
363
- const s = { row: r, rowIndex: o }, a = y(c);
363
+ const s = { row: r, rowIndex: o }, d = y(c);
364
364
  return m(() => {
365
- a.render(e(s));
366
- }), this.mountedViews.push({ root: a, container: c }), c;
365
+ d.render(e(s));
366
+ }), this.mountedViews.push({ root: d, container: c }), c;
367
367
  };
368
368
  }
369
369
  /**
@@ -385,10 +385,10 @@ class ue {
385
385
  return (r, o) => {
386
386
  const c = document.createElement("div");
387
387
  c.className = "react-responsive-card";
388
- const s = { row: r, index: o }, a = y(c);
388
+ const s = { row: r, index: o }, d = y(c);
389
389
  return m(() => {
390
- a.render(e(s));
391
- }), this.mountedViews.push({ root: a, container: c }), c;
390
+ d.render(e(s));
391
+ }), this.mountedViews.push({ root: d, container: c }), c;
392
392
  };
393
393
  }
394
394
  /**
@@ -396,7 +396,7 @@ class ue {
396
396
  * Renders React components into tool panel containers.
397
397
  */
398
398
  createToolPanelRenderer(t) {
399
- const e = Fe(t);
399
+ const e = Le(t);
400
400
  if (!e)
401
401
  return;
402
402
  const r = t.closest("tbw-grid");
@@ -407,14 +407,14 @@ class ue {
407
407
  return m(() => {
408
408
  s.render(e(c));
409
409
  }), this.mountedViews.push({ root: s, container: o }), () => {
410
- const a = this.mountedViews.findIndex((l) => l.container === o);
411
- if (a !== -1) {
412
- const { root: l } = this.mountedViews[a];
410
+ const d = this.mountedViews.findIndex((u) => u.container === o);
411
+ if (d !== -1) {
412
+ const { root: u } = this.mountedViews[d];
413
413
  try {
414
- l.unmount();
414
+ u.unmount();
415
415
  } catch {
416
416
  }
417
- this.mountedViews.splice(a, 1);
417
+ this.mountedViews.splice(d, 1);
418
418
  }
419
419
  };
420
420
  };
@@ -530,7 +530,7 @@ class ue {
530
530
  this.editorViews.splice(e, 1);
531
531
  }
532
532
  }
533
- Ae(t);
533
+ Se(t);
534
534
  }
535
535
  /**
536
536
  * Unmount a specific container (called when cell is recycled).
@@ -563,39 +563,22 @@ function Oe(n) {
563
563
  }
564
564
  }
565
565
  function je(n) {
566
- const t = [], e = [], r = { ...n };
567
- r.multiSort !== void 0 ? delete r.sorting : r.sorting !== void 0 && (r.multiSort = r.sorting, delete r.sorting);
568
- for (const [s, a] of Object.entries(r)) {
569
- if (a === void 0 || a === !1) continue;
570
- const l = s;
571
- e.push(l);
572
- }
573
- Oe(e);
574
- const o = [
575
- "selection",
576
- "editing",
577
- // Then everything else in the order they were specified
578
- ...e.filter((s) => s !== "selection" && s !== "editing")
579
- ], c = [...new Set(o)].filter((s) => e.includes(s));
580
- for (const s of c) {
581
- const a = n[s];
582
- if (a === void 0 || a === !1) continue;
583
- const l = Ce(s, a);
584
- l && t.push(l);
585
- }
586
- return t;
566
+ const t = [];
567
+ for (const [e, r] of Object.entries(n))
568
+ r === void 0 || r === !1 || t.push(e);
569
+ return Oe(t), Re(n);
587
570
  }
588
- let de = !1, $ = null;
571
+ let de = !1, _ = null;
589
572
  function Y() {
590
- return de || ($ = new ue(), me.registerAdapter($), de = !0), $;
573
+ return de || (_ = new ue(), me.registerAdapter(_), de = !0), _;
591
574
  }
592
575
  Y();
593
576
  const He = Z(null);
594
- function ze(n) {
577
+ function $e(n) {
595
578
  const e = n.getPluginByName?.("masterDetail");
596
579
  e && typeof e.refreshDetailRenderer == "function" && e.refreshDetailRenderer();
597
580
  }
598
- function _e(n, t) {
581
+ function ze(n, t) {
599
582
  const e = n;
600
583
  if (!n.querySelector("tbw-grid-responsive-card") || !le(n)) return;
601
584
  const c = e.getPluginByName?.("responsive");
@@ -604,10 +587,10 @@ function _e(n, t) {
604
587
  s && c.setCardRenderer(s);
605
588
  }
606
589
  }
607
- function $e(n) {
590
+ function _e(n) {
608
591
  const t = {};
609
592
  return we.forEach(n, (e) => {
610
- if (ve(e)) {
593
+ if (Ce(e)) {
611
594
  if (e.type && e.type.displayName === "GridDetailPanel") {
612
595
  const r = e.props;
613
596
  t.masterDetail = {
@@ -628,8 +611,8 @@ const it = he(function(t, e) {
628
611
  gridConfig: o,
629
612
  columns: c,
630
613
  columnDefaults: s,
631
- fitMode: a,
632
- sortable: l,
614
+ fitMode: d,
615
+ sortable: u,
633
616
  filterable: g,
634
617
  selectable: w,
635
618
  loading: k,
@@ -645,8 +628,8 @@ const it = he(function(t, e) {
645
628
  // Legacy event handlers
646
629
  onRowsChange: j,
647
630
  // Feature props and event props are in ...rest
648
- ...C
649
- } = t, u = S(null), L = S(null), te = V(xe), H = V(De), re = [
631
+ ...R
632
+ } = t, l = x(null), F = x(null), te = V(Ae), H = V(De), re = [
650
633
  "selection",
651
634
  "editing",
652
635
  "filtering",
@@ -655,8 +638,12 @@ const it = he(function(t, e) {
655
638
  // deprecated alias for multiSort
656
639
  "clipboard",
657
640
  "contextMenu",
641
+ "reorderColumns",
658
642
  "reorder",
643
+ // deprecated alias for reorderColumns
659
644
  "rowReorder",
645
+ // deprecated alias for reorderRows
646
+ "reorderRows",
660
647
  "visibility",
661
648
  "undoRedo",
662
649
  "tree",
@@ -671,63 +658,63 @@ const it = he(function(t, e) {
671
658
  "print",
672
659
  "pivot",
673
660
  "serverSide"
674
- ], pe = v(() => re.map((i) => {
675
- const d = C[i];
676
- return d !== void 0 ? `${i}:${JSON.stringify(d)}` : "";
677
- }).filter(Boolean).join("|"), [C]), ne = v(() => {
661
+ ], pe = C(() => re.map((i) => {
662
+ const a = R[i];
663
+ return a !== void 0 ? `${i}:${JSON.stringify(a)}` : "";
664
+ }).filter(Boolean).join("|"), [R]), ne = C(() => {
678
665
  const i = {};
679
- for (const d of re)
680
- d in C && C[d] !== void 0 && (i[d] = C[d]);
666
+ for (const a of re)
667
+ a in R && R[a] !== void 0 && (i[a] = R[a]);
681
668
  return i;
682
- }, [pe]), oe = v(() => $e(O), [O]), ie = v(() => ({ ...oe, ...ne }), [ne, oe]), z = v(() => P || ee ? [] : je(ie), [ie, P, ee]), x = v(() => {
669
+ }, [pe]), oe = C(() => _e(O), [O]), ie = C(() => ({ ...oe, ...ne }), [ne, oe]), $ = C(() => P || ee ? [] : je(ie), [ie, P, ee]), A = C(() => {
683
670
  if (P) {
684
- const i = new Set(P.map((f) => f.name)), d = z.filter((f) => !i.has(f.name));
685
- return [...P, ...d];
671
+ const i = new Set(P.map((f) => f.name)), a = $.filter((f) => !i.has(f.name));
672
+ return [...P, ...a];
686
673
  }
687
- return z;
688
- }, [P, z]), A = v(() => {
674
+ return $;
675
+ }, [P, $]), S = C(() => {
689
676
  if (!c) return c;
690
677
  const i = Pe(c);
691
- return s ? i.map((d) => ({
678
+ return s ? i.map((a) => ({
692
679
  ...s,
693
- ...d
680
+ ...a
694
681
  // Individual column props override defaults
695
682
  })) : i;
696
- }, [c, s]), G = v(() => {
697
- const i = Ve(o), d = {};
698
- if (l !== void 0 && (d.sortable = l), g !== void 0 && (d.filterable = g), w !== void 0 && (d.selectable = w), H) {
683
+ }, [c, s]), G = C(() => {
684
+ const i = Ve(o), a = {};
685
+ if (u !== void 0 && (a.sortable = u), g !== void 0 && (a.filterable = g), w !== void 0 && (a.selectable = w), H) {
699
686
  const f = i?.icons || o?.icons || {};
700
- d.icons = { ...H, ...f };
687
+ a.icons = { ...H, ...f };
701
688
  }
702
- if (x.length > 0 && i) {
703
- const f = i.plugins || [], h = new Set(f.map((D) => D.name)), F = x.filter((D) => !h.has(D.name));
689
+ if (A.length > 0 && i) {
690
+ const f = i.plugins || [], h = new Set(f.map((D) => D.name)), L = A.filter((D) => !h.has(D.name));
704
691
  return {
705
692
  ...i,
706
- ...d,
707
- plugins: [...f, ...F]
693
+ ...a,
694
+ plugins: [...f, ...L]
708
695
  };
709
696
  }
710
- return x.length > 0 && !i ? { ...d, plugins: x } : Object.keys(d).length > 0 ? { ...i, ...d } : i;
711
- }, [o, x, l, g, w, H]);
697
+ return A.length > 0 && !i ? { ...a, plugins: A } : Object.keys(a).length > 0 ? { ...i, ...a } : i;
698
+ }, [o, A, u, g, w, H]);
712
699
  p(() => {
713
700
  Y().setTypeDefaults(te);
714
701
  }, [te]), p(() => {
715
- u.current && (u.current.rows = r);
702
+ l.current && (l.current.rows = r);
716
703
  }, [r]), p(() => {
717
- u.current && G && (u.current.gridConfig = G);
704
+ l.current && G && (l.current.gridConfig = G);
718
705
  }, [G]), p(() => {
719
- u.current && A && (u.current.columns = A);
720
- }, [A]), p(() => {
721
- u.current && a !== void 0 && (u.current.fitMode = a);
722
- }, [a]), p(() => {
723
- u.current && M !== void 0 && (u.current.editOn = M);
706
+ l.current && S && (l.current.columns = S);
707
+ }, [S]), p(() => {
708
+ l.current && d !== void 0 && (l.current.fitMode = d);
709
+ }, [d]), p(() => {
710
+ l.current && M !== void 0 && (l.current.editOn = M);
724
711
  }, [M]), p(() => {
725
- u.current && k !== void 0 && (u.current.loading = k);
712
+ l.current && k !== void 0 && (l.current.loading = k);
726
713
  }, [k]), p(() => {
727
- const i = u.current;
714
+ const i = l.current;
728
715
  if (!i) return;
729
- const d = Y();
730
- i.__frameworkAdapter = d, ze(i), _e(i, d);
716
+ const a = Y();
717
+ i.__frameworkAdapter = a, $e(i), ze(i, a);
731
718
  let f = !1;
732
719
  const h = requestAnimationFrame(() => {
733
720
  f || (typeof i.refreshColumns == "function" && i.refreshColumns(), typeof i.refreshShellHeader == "function" && i.refreshShellHeader());
@@ -736,44 +723,44 @@ const it = he(function(t, e) {
736
723
  f = !0, cancelAnimationFrame(h);
737
724
  };
738
725
  }, []), p(() => {
739
- if (!u.current || !N) return;
740
- const i = u.current, d = "react-custom-styles";
726
+ if (!l.current || !N) return;
727
+ const i = l.current, a = "react-custom-styles";
741
728
  let f = !0;
742
729
  return i.ready?.().then(() => {
743
- f && N && (i.registerStyles?.(d, N), L.current = d);
730
+ f && N && (i.registerStyles?.(a, N), F.current = a);
744
731
  }), () => {
745
- f = !1, L.current && (i.unregisterStyles?.(L.current), L.current = null);
732
+ f = !1, F.current && (i.unregisterStyles?.(F.current), F.current = null);
746
733
  };
747
734
  }, [N]), p(() => {
748
- const i = u.current;
735
+ const i = l.current;
749
736
  if (!i) return;
750
- const d = [];
737
+ const a = [];
751
738
  if (j) {
752
739
  const f = ((h) => j(h.detail.rows));
753
- i.addEventListener("rows-change", f), d.push(["rows-change", f]);
740
+ i.addEventListener("rows-change", f), a.push(["rows-change", f]);
754
741
  }
755
742
  return () => {
756
- d.forEach(([f, h]) => {
743
+ a.forEach(([f, h]) => {
757
744
  i.removeEventListener(f, h);
758
745
  });
759
746
  };
760
747
  }, [j]);
761
- const se = v(() => Object.keys(_).filter((i) => typeof C[i] == "function").sort().join("|"), [C]), ce = S({});
762
- for (const i of Object.keys(_))
763
- ce.current[i] = C[i];
748
+ const se = C(() => Object.keys(z).filter((i) => typeof R[i] == "function").sort().join("|"), [R]), ce = x({});
749
+ for (const i of Object.keys(z))
750
+ ce.current[i] = R[i];
764
751
  return p(() => {
765
- const i = u.current;
752
+ const i = l.current;
766
753
  if (!i) return;
767
- const d = [];
768
- for (const [f, h] of Object.entries(_))
754
+ const a = [];
755
+ for (const [f, h] of Object.entries(z))
769
756
  if (se.includes(f)) {
770
- const F = ((D) => {
757
+ const L = ((D) => {
771
758
  ce.current[f]?.(D.detail, D);
772
759
  });
773
- i.addEventListener(h, F), d.push([h, F]);
760
+ i.addEventListener(h, L), a.push([h, L]);
774
761
  }
775
762
  return () => {
776
- d.forEach(([f, h]) => {
763
+ a.forEach(([f, h]) => {
777
764
  i.removeEventListener(f, h);
778
765
  });
779
766
  };
@@ -781,40 +768,40 @@ const it = he(function(t, e) {
781
768
  e,
782
769
  () => ({
783
770
  get element() {
784
- return u.current;
771
+ return l.current;
785
772
  },
786
773
  async getConfig() {
787
- return u.current?.getConfig?.() ?? {};
774
+ return l.current?.getConfig?.() ?? {};
788
775
  },
789
776
  async ready() {
790
- return u.current?.ready?.();
777
+ return l.current?.ready?.();
791
778
  },
792
779
  async forceLayout() {
793
- return u.current?.forceLayout?.();
780
+ return l.current?.forceLayout?.();
794
781
  },
795
782
  async toggleGroup(i) {
796
- return u.current?.toggleGroup?.(i);
783
+ return l.current?.toggleGroup?.(i);
797
784
  },
798
- registerStyles(i, d) {
799
- u.current?.registerStyles?.(i, d);
785
+ registerStyles(i, a) {
786
+ l.current?.registerStyles?.(i, a);
800
787
  },
801
788
  unregisterStyles(i) {
802
- u.current?.unregisterStyles?.(i);
789
+ l.current?.unregisterStyles?.(i);
803
790
  },
804
- setRowLoading(i, d) {
805
- u.current?.setRowLoading?.(i, d);
791
+ setRowLoading(i, a) {
792
+ l.current?.setRowLoading?.(i, a);
806
793
  },
807
- setCellLoading(i, d, f) {
808
- u.current?.setCellLoading?.(i, d, f);
794
+ setCellLoading(i, a, f) {
795
+ l.current?.setCellLoading?.(i, a, f);
809
796
  },
810
797
  isRowLoading(i) {
811
- return u.current?.isRowLoading?.(i) ?? !1;
798
+ return l.current?.isRowLoading?.(i) ?? !1;
812
799
  },
813
- isCellLoading(i, d) {
814
- return u.current?.isCellLoading?.(i, d) ?? !1;
800
+ isCellLoading(i, a) {
801
+ return l.current?.isCellLoading?.(i, a) ?? !1;
815
802
  },
816
803
  clearAllLoading() {
817
- u.current?.clearAllLoading?.();
804
+ l.current?.clearAllLoading?.();
818
805
  }
819
806
  }),
820
807
  []
@@ -822,14 +809,14 @@ const it = he(function(t, e) {
822
809
  "tbw-grid",
823
810
  {
824
811
  ref: (i) => {
825
- if (u.current = i, i) {
826
- const d = i;
827
- G && (d.gridConfig = G), r && (d.rows = r), A && (d.columns = A);
812
+ if (l.current = i, i) {
813
+ const a = i;
814
+ G && (a.gridConfig = G), r && (a.rows = r), S && (a.columns = S);
828
815
  }
829
816
  },
830
817
  class: fe,
831
818
  style: ge,
832
- children: /* @__PURE__ */ b(He.Provider, { value: u, children: O })
819
+ children: /* @__PURE__ */ b(He.Provider, { value: l, children: O })
833
820
  }
834
821
  );
835
822
  });
@@ -840,8 +827,8 @@ export {
840
827
  nt as a,
841
828
  Qe as b,
842
829
  Ye as c,
843
- Le as d,
844
- Se as e,
830
+ Fe as d,
831
+ xe as e,
845
832
  tt as f,
846
833
  et as g,
847
834
  Ze as h,
@@ -1,18 +1 @@
1
- /**
2
- * Clipboard feature for @toolbox-web/grid-react
3
- *
4
- * Import this module to enable the `clipboard` prop on DataGrid.
5
- * Requires the selection feature to be enabled.
6
- *
7
- * @example
8
- * ```tsx
9
- * import '@toolbox-web/grid-react/features/selection';
10
- * import '@toolbox-web/grid-react/features/clipboard';
11
- *
12
- * <DataGrid selection="range" clipboard />
13
- * ```
14
- *
15
- * @packageDocumentation
16
- */
17
- export {};
18
1
  //# sourceMappingURL=clipboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,sCAAsC,CAAC"}