@toolbox-web/grid-react 1.0.0 → 1.1.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.
@@ -7,11 +7,11 @@ function w(t, e) {
7
7
  }
8
8
  function g(t, e) {
9
9
  if (e) return e;
10
- const n = t.closest("tbw-grid");
11
- if (n) return n;
10
+ const o = t.closest("tbw-grid");
11
+ if (o) return o;
12
12
  if (r.size === 1) return r.keys().next().value;
13
13
  }
14
- function f(t) {
14
+ function u(t) {
15
15
  const e = c.get(t);
16
16
  if (e) {
17
17
  try {
@@ -21,19 +21,19 @@ function f(t) {
21
21
  c.delete(t);
22
22
  }
23
23
  }
24
- function b(t, e, n, u) {
25
- const o = n ?? `p-${m++}`, s = g(t, u), l = s ? r.get(s) : void 0;
26
- if (l)
27
- f(o), s && i.set(o, s), l.renderPortal(o, t, e);
24
+ function b(t, e, o, l) {
25
+ const n = o ?? `p-${m++}`, s = g(t, l), f = s ? r.get(s) : void 0;
26
+ if (f)
27
+ u(n), s && i.set(n, s), f.renderPortal(n, t, e);
28
28
  else {
29
- let a = c.get(o);
30
- a || (a = p(t), c.set(o, a)), d(() => a.render(e));
29
+ let a = c.get(n);
30
+ a || (a = p(t), c.set(n, a)), d(() => a.render(e));
31
31
  }
32
- return o;
32
+ return n;
33
33
  }
34
- function x(t) {
35
- const e = i.get(t);
36
- (e ? r.get(e) : void 0)?.removePortal(t), i.delete(t), f(t);
34
+ function x(t, e) {
35
+ const o = i.get(t);
36
+ (o ? r.get(o) : void 0)?.removePortal(t, e?.sync), i.delete(t), u(t);
37
37
  }
38
38
  export {
39
39
  b as a,
@@ -1,6 +1,6 @@
1
1
  import { FilteringPlugin as F } from "@toolbox-web/grid/plugins/filtering";
2
2
  import { useContext as G, useCallback as n } from "react";
3
- import { r as h, a as k } from "../chunks/portal-bridge-B0mjqzak.js";
3
+ import { r as h, a as k } from "../chunks/portal-bridge-DZ4yQkmm.js";
4
4
  import { registerFeature as E } from "@toolbox-web/grid/features/registry";
5
5
  import { G as R } from "../chunks/grid-element-context-BU3WvNtM.js";
6
6
  E("filtering", (l) => {
@@ -1,5 +1,5 @@
1
1
  import { GroupingColumnsPlugin as u } from "@toolbox-web/grid/plugins/grouping-columns";
2
- import { a as s } from "../chunks/portal-bridge-B0mjqzak.js";
2
+ import { a as s } from "../chunks/portal-bridge-DZ4yQkmm.js";
3
3
  import { registerFeature as i } from "@toolbox-web/grid/features/registry";
4
4
  function p(n) {
5
5
  const e = /* @__PURE__ */ new WeakMap();
@@ -1,5 +1,5 @@
1
1
  import { GroupingRowsPlugin as n } from "@toolbox-web/grid/plugins/grouping-rows";
2
- import { a as c } from "../chunks/portal-bridge-B0mjqzak.js";
2
+ import { a as c } from "../chunks/portal-bridge-DZ4yQkmm.js";
3
3
  import { registerFeature as a } from "@toolbox-web/grid/features/registry";
4
4
  a("groupingRows", (r) => {
5
5
  if (typeof r == "boolean") return new n();
@@ -1,6 +1,6 @@
1
1
  import "@toolbox-web/grid/features/pinned-rows";
2
2
  import { PinnedRowsPlugin as o } from "@toolbox-web/grid/plugins/pinned-rows";
3
- import { a as u } from "../chunks/portal-bridge-B0mjqzak.js";
3
+ import { a as u } from "../chunks/portal-bridge-DZ4yQkmm.js";
4
4
  import { registerFeature as p } from "@toolbox-web/grid/features/registry";
5
5
  p("pinnedRows", (n) => {
6
6
  if (typeof n == "boolean") return new o();
package/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { jsx as b, Fragment as re, jsxs as Pe } from "react/jsx-runtime";
1
+ import { jsx as b, Fragment as ne, jsxs as Pe } from "react/jsx-runtime";
2
2
  import { DataGridElement as be } from "@toolbox-web/grid";
3
- import { createContext as ye, useContext as O, useRef as E, useCallback as S, useEffect as P, forwardRef as he, useReducer as Ee, useImperativeHandle as ve, useMemo as D, useLayoutEffect as ke, Children as Se, isValidElement as De, useState as ue } from "react";
4
- import { a as w, r as H, s as fe } from "./chunks/portal-bridge-B0mjqzak.js";
5
- import { createPortal as Ge, flushSync as ge } from "react-dom";
3
+ import { createContext as me, useContext as O, useRef as E, useCallback as S, useEffect as P, forwardRef as he, useReducer as Ee, useImperativeHandle as ve, useMemo as D, useLayoutEffect as ke, Children as Se, isValidElement as De, useState as fe } from "react";
4
+ import { a as w, r as H, s as ge } from "./chunks/portal-bridge-DZ4yQkmm.js";
5
+ import { flushSync as W, createPortal as Ge } from "react-dom";
6
6
  import { createPluginsFromFeatures as Ae } from "@toolbox-web/grid/features/registry";
7
- import { G as xe } from "./chunks/grid-element-context-BU3WvNtM.js";
8
- function Te(n) {
7
+ import { G as Te } from "./chunks/grid-element-context-BU3WvNtM.js";
8
+ function xe(n) {
9
9
  return n.charAt(0).toUpperCase() + n.slice(1);
10
10
  }
11
11
  function pe(n) {
12
- return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Te).join(" ");
12
+ return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(xe).join(" ");
13
13
  }
14
14
  const Ke = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
15
15
  function Ne(n) {
@@ -33,7 +33,7 @@ function Ne(n) {
33
33
  function Fe(n) {
34
34
  return n.map((e) => typeof e == "string" ? Ne(e) : e);
35
35
  }
36
- const W = {
36
+ const B = {
37
37
  onCellClick: "cell-click",
38
38
  onRowClick: "row-click",
39
39
  onCellActivate: "cell-activate",
@@ -58,31 +58,32 @@ const W = {
58
58
  onUndoRedo: "undo-redo",
59
59
  onExportComplete: "export-complete",
60
60
  onPrintStart: "print-start",
61
- onPrintComplete: "print-complete"
62
- }, ne = ye(null), Ie = ({ icons: n, children: e }) => /* @__PURE__ */ b(ne.Provider, { value: n, children: e });
61
+ onPrintComplete: "print-complete",
62
+ onTbwScroll: "tbw-scroll"
63
+ }, oe = me(null), Ie = ({ icons: n, children: e }) => /* @__PURE__ */ b(oe.Provider, { value: n, children: e });
63
64
  function pt() {
64
- return O(ne);
65
+ return O(oe);
65
66
  }
66
- const Le = ne, J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new Map();
67
+ const Le = oe, Y = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new Map();
67
68
  function Ce(n) {
68
69
  const e = n.querySelector("tbw-grid-responsive-card");
69
70
  if (e) {
70
- const r = J.get(e);
71
+ const r = Y.get(e);
71
72
  if (r) return r;
72
73
  }
73
74
  const t = n.id || n.getAttribute("data-grid-id");
74
75
  if (t)
75
- return Y.get(t);
76
+ return Z.get(t);
76
77
  }
77
78
  function Me(n) {
78
79
  const { children: e, cardRowHeight: t = "auto" } = n, r = E(null), o = S(
79
80
  (c) => {
80
81
  if (r.current = c, !c) return;
81
- J.set(c, e);
82
+ Y.set(c, e);
82
83
  const a = c.closest("tbw-grid");
83
84
  if (a) {
84
85
  const f = a.id || a.getAttribute("data-grid-id");
85
- f && Y.set(f, e);
86
+ f && Z.set(f, e);
86
87
  }
87
88
  },
88
89
  [e]
@@ -90,11 +91,11 @@ function Me(n) {
90
91
  P(() => () => {
91
92
  const c = r.current;
92
93
  if (c) {
93
- J.delete(c);
94
+ Y.delete(c);
94
95
  const a = c.closest("tbw-grid");
95
96
  if (a) {
96
97
  const f = a.id || a.getAttribute("data-grid-id");
97
- f && Y.delete(f);
98
+ f && Z.delete(f);
98
99
  }
99
100
  }
100
101
  }, []);
@@ -102,17 +103,17 @@ function Me(n) {
102
103
  return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: s });
103
104
  }
104
105
  Me.displayName = "GridResponsiveCard";
105
- const z = ye(null), He = ({ defaults: n, children: e }) => /* @__PURE__ */ b(z.Provider, { value: n, children: e });
106
- function mt() {
106
+ const z = me(null), He = ({ defaults: n, children: e }) => /* @__PURE__ */ b(z.Provider, { value: n, children: e });
107
+ function yt() {
107
108
  return O(z);
108
109
  }
109
- function yt(n) {
110
+ function mt(n) {
110
111
  return O(z)?.[n];
111
112
  }
112
113
  const Oe = z, je = he(function(e, t) {
113
114
  const r = E(/* @__PURE__ */ new Map()), [, o] = Ee((g) => g + 1, 0), s = E(!1), c = E(0), a = () => {
114
115
  s.current || (s.current = !0, queueMicrotask(() => {
115
- s.current = !1, ge(o), f();
116
+ s.current = !1, W(o), f();
116
117
  }));
117
118
  }, f = () => {
118
119
  c.current || (c.current = requestAnimationFrame(() => {
@@ -120,7 +121,7 @@ const Oe = z, je = he(function(e, t) {
120
121
  let g = !1;
121
122
  for (const [C, R] of r.current)
122
123
  R.container.isConnected || (r.current.delete(C), g = !0);
123
- g && ge(o);
124
+ g && W(o);
124
125
  }));
125
126
  };
126
127
  ve(
@@ -129,8 +130,8 @@ const Oe = z, je = he(function(e, t) {
129
130
  renderPortal(g, C, R) {
130
131
  r.current.set(g, { container: C, element: R }), a();
131
132
  },
132
- removePortal(g) {
133
- r.current.delete(g) && a();
133
+ removePortal(g, C) {
134
+ r.current.delete(g) && (C ? W(o) : a());
134
135
  },
135
136
  clear() {
136
137
  r.current.size > 0 && (r.current.clear(), c.current && (cancelAnimationFrame(c.current), c.current = 0), a());
@@ -143,8 +144,8 @@ const Oe = z, je = he(function(e, t) {
143
144
  const d = [];
144
145
  for (const [g, { container: C, element: R }] of r.current)
145
146
  d.push(Ge(R, C, g));
146
- return /* @__PURE__ */ b(re, { children: d });
147
- }), B = /* @__PURE__ */ Symbol("reactProcessed"), G = [];
147
+ return /* @__PURE__ */ b(ne, { children: d });
148
+ }), U = /* @__PURE__ */ Symbol("reactProcessed"), G = [];
148
149
  function ze(n) {
149
150
  for (let e = G.length - 1; e >= 0; e--) {
150
151
  const t = G[e];
@@ -203,7 +204,7 @@ function We(n) {
203
204
  }
204
205
  function Re(n) {
205
206
  if (!n) return;
206
- if (n[B]) return n;
207
+ if (n[U]) return n;
207
208
  if (n.loadingRenderer && typeof n.loadingRenderer == "function") {
208
209
  const r = n.loadingRenderer;
209
210
  n = {
@@ -213,7 +214,7 @@ function Re(n) {
213
214
  }
214
215
  if (!n.columns) {
215
216
  const r = n;
216
- return r[B] = !0, r;
217
+ return r[U] = !0, r;
217
218
  }
218
219
  const e = n.columns.map((r) => {
219
220
  const { renderer: o, editor: s, headerRenderer: c, headerLabelRenderer: a, ...f } = r, d = { ...f };
@@ -222,28 +223,28 @@ function Re(n) {
222
223
  ...n,
223
224
  columns: e
224
225
  };
225
- return t[B] = !0, t;
226
+ return t[U] = !0, t;
226
227
  }
227
- const Z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new Map();
228
+ const Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new Map();
228
229
  function Be(n) {
229
230
  const e = n.querySelector("tbw-grid-detail");
230
231
  if (e) {
231
- const r = Z.get(e);
232
+ const r = Q.get(e);
232
233
  if (r) return r;
233
234
  }
234
235
  const t = n.id || n.getAttribute("data-grid-id");
235
236
  if (t)
236
- return Q.get(t);
237
+ return X.get(t);
237
238
  }
238
239
  function Ue(n) {
239
240
  const { children: e, showExpandColumn: t = !0, animation: r = "slide" } = n, o = E(null), s = S(
240
241
  (a) => {
241
242
  if (o.current = a, !a) return;
242
- Z.set(a, e);
243
+ Q.set(a, e);
243
244
  const f = a.closest("tbw-grid");
244
245
  if (f) {
245
246
  const d = f.id || f.getAttribute("data-grid-id");
246
- d && Q.set(d, e);
247
+ d && X.set(d, e);
247
248
  }
248
249
  },
249
250
  [e]
@@ -251,11 +252,11 @@ function Ue(n) {
251
252
  return P(() => () => {
252
253
  const a = o.current;
253
254
  if (a) {
254
- Z.delete(a);
255
+ Q.delete(a);
255
256
  const f = a.closest("tbw-grid");
256
257
  if (f) {
257
258
  const g = f.id || f.getAttribute("data-grid-id");
258
- g && Q.delete(g);
259
+ g && X.delete(g);
259
260
  }
260
261
  const d = a.parentNode;
261
262
  d && d.contains(a);
@@ -270,24 +271,24 @@ function Ue(n) {
270
271
  );
271
272
  }
272
273
  Ue.displayName = "GridDetailPanel";
273
- const X = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new Map();
274
+ const ee = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new Map();
274
275
  function Je(n) {
275
- const e = X.get(n);
276
+ const e = ee.get(n);
276
277
  if (e) return e;
277
278
  const t = n.id;
278
279
  if (t)
279
- return ee.get(t);
280
+ return te.get(t);
280
281
  }
281
282
  function ht(n) {
282
283
  const { id: e, title: t, icon: r, tooltip: o, order: s = 100, children: c } = n, a = E(null), f = S(
283
284
  (d) => {
284
- a.current = d, d && (X.set(d, c), e && ee.set(e, c));
285
+ a.current = d, d && (ee.set(d, c), e && te.set(e, c));
285
286
  },
286
287
  [c, e]
287
288
  );
288
289
  return P(() => () => {
289
290
  const d = a.current;
290
- d && (X.delete(d), e && ee.delete(e));
291
+ d && (ee.delete(d), e && te.delete(e));
291
292
  }, [e]), /* @__PURE__ */ b(
292
293
  "tbw-grid-tool-panel",
293
294
  {
@@ -300,26 +301,26 @@ function ht(n) {
300
301
  }
301
302
  );
302
303
  }
303
- const A = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new Map();
304
+ const A = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new Map();
304
305
  function Ye(n, e) {
305
306
  const t = n.getAttribute("field"), r = A.get(n) ?? {};
306
307
  if (r.renderer = e, A.set(n, r), t) {
307
- const o = x.get(t) ?? {};
308
- o.renderer = e, x.set(t, o);
308
+ const o = T.get(t) ?? {};
309
+ o.renderer = e, T.set(t, o);
309
310
  }
310
311
  }
311
312
  function Ze(n, e) {
312
313
  const t = n.getAttribute("field"), r = A.get(n) ?? {};
313
314
  if (r.editor = e, A.set(n, r), t) {
314
- const o = x.get(t) ?? {};
315
- o.editor = e, x.set(t, o);
315
+ const o = T.get(t) ?? {};
316
+ o.editor = e, T.set(t, o);
316
317
  }
317
318
  }
318
319
  function Qe(n) {
319
320
  let e = A.get(n)?.renderer;
320
321
  if (!e) {
321
322
  const t = n.getAttribute("field");
322
- t && (e = x.get(t)?.renderer);
323
+ t && (e = T.get(t)?.renderer);
323
324
  }
324
325
  return e;
325
326
  }
@@ -327,7 +328,7 @@ function Xe(n) {
327
328
  let e = A.get(n)?.editor;
328
329
  if (!e) {
329
330
  const t = n.getAttribute("field");
330
- t && (e = x.get(t)?.editor);
331
+ t && (e = T.get(t)?.editor);
331
332
  }
332
333
  return e;
333
334
  }
@@ -364,7 +365,7 @@ class et {
364
365
  const t = e.getAttribute("field");
365
366
  let r = A.get(e);
366
367
  if (!r && t) {
367
- const c = x.get(t);
368
+ const c = T.get(t);
368
369
  c && (c.renderer || c.editor) && (r = c, A.set(e, r));
369
370
  }
370
371
  const o = r?.renderer !== void 0, s = r?.editor !== void 0;
@@ -495,7 +496,7 @@ class et {
495
496
  grid: r ?? o
496
497
  }), void 0, r ?? void 0);
497
498
  return this.trackPortal(c, o, !1), () => {
498
- H(c), this.untrackPortal(c);
499
+ H(c, { sync: !0 }), this.untrackPortal(c);
499
500
  };
500
501
  };
501
502
  }
@@ -587,7 +588,7 @@ class et {
587
588
  destroy() {
588
589
  for (const e of this.allPortalKeys)
589
590
  H(e);
590
- this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(), x.clear();
591
+ this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(), T.clear();
591
592
  }
592
593
  /**
593
594
  * Called when a cell's content is about to be wiped.
@@ -634,11 +635,11 @@ function nt(n) {
634
635
  r === void 0 || r === !1 || e.push(t);
635
636
  return rt(e), Ae(n);
636
637
  }
637
- let me = !1, U = null;
638
- function te() {
639
- return me || (U = new et(), be.registerAdapter(U), me = !0), U;
638
+ let ye = !1, J = null;
639
+ function re() {
640
+ return ye || (J = new et(), be.registerAdapter(J), ye = !0), J;
640
641
  }
641
- te();
642
+ re();
642
643
  function ot(n) {
643
644
  const t = n.getPluginByName?.("masterDetail");
644
645
  t && typeof t.refreshDetailRenderer == "function" && t.refreshDetailRenderer();
@@ -686,14 +687,14 @@ const vt = he(function(e, t) {
686
687
  style: p,
687
688
  children: v,
688
689
  // Plugin props
689
- plugins: y,
690
+ plugins: m,
690
691
  // SSR mode
691
692
  ssr: k,
692
693
  // Legacy event handlers
693
- onRowsChange: T,
694
+ onRowsChange: x,
694
695
  // Feature props and event props are in ...rest
695
696
  ...h
696
- } = e, u = E(null), j = E(null), oe = O(Oe), q = O(Le), ie = [
697
+ } = e, u = E(null), j = E(null), ie = O(Oe), q = O(Le), se = [
697
698
  "selection",
698
699
  "editing",
699
700
  "filtering",
@@ -717,21 +718,21 @@ const vt = he(function(e, t) {
717
718
  "pivot",
718
719
  "serverSide",
719
720
  "tooltip"
720
- ], we = D(() => ie.map((i) => {
721
+ ], we = D(() => se.map((i) => {
721
722
  const l = h[i];
722
723
  return l !== void 0 ? `${i}:${JSON.stringify(l)}` : "";
723
- }).filter(Boolean).join("|"), [h]), se = D(() => {
724
+ }).filter(Boolean).join("|"), [h]), ce = D(() => {
724
725
  const i = {};
725
- for (const l of ie)
726
+ for (const l of se)
726
727
  l in h && h[l] !== void 0 && (i[l] = h[l]);
727
728
  return i;
728
- }, [we]), ce = D(() => st(v), [v]), ae = D(() => ({ ...ce, ...se }), [se, ce]), _ = D(() => y || k ? [] : nt(ae), [ae, y, k]), N = D(() => {
729
- if (y) {
730
- const i = new Set(y.map((m) => m.name)), l = _.filter((m) => !i.has(m.name));
731
- return [...y, ...l];
729
+ }, [we]), ae = D(() => st(v), [v]), le = D(() => ({ ...ae, ...ce }), [ce, ae]), _ = D(() => m || k ? [] : nt(le), [le, m, k]), N = D(() => {
730
+ if (m) {
731
+ const i = new Set(m.map((y) => y.name)), l = _.filter((y) => !i.has(y.name));
732
+ return [...m, ...l];
732
733
  }
733
734
  return _;
734
- }, [y, _]), F = D(() => {
735
+ }, [m, _]), F = D(() => {
735
736
  if (!s) return s;
736
737
  const i = Fe(s);
737
738
  return c ? i.map((l) => ({
@@ -742,22 +743,22 @@ const vt = he(function(e, t) {
742
743
  }, [s, c]), I = D(() => {
743
744
  const i = Re(o), l = {};
744
745
  if (f !== void 0 && (l.sortable = f), d !== void 0 && (l.filterable = d), g !== void 0 && (l.selectable = g), q) {
745
- const m = i?.icons || o?.icons || {};
746
- l.icons = { ...q, ...m };
746
+ const y = i?.icons || o?.icons || {};
747
+ l.icons = { ...q, ...y };
747
748
  }
748
749
  if (N.length > 0 && i) {
749
- const m = i.plugins || [], L = new Set(m.map((M) => M.name)), V = N.filter((M) => !L.has(M.name));
750
+ const y = i.plugins || [], L = new Set(y.map((M) => M.name)), V = N.filter((M) => !L.has(M.name));
750
751
  return {
751
752
  ...i,
752
753
  ...l,
753
- plugins: [...m, ...V]
754
+ plugins: [...y, ...V]
754
755
  };
755
756
  }
756
757
  return N.length > 0 && !i ? { ...l, plugins: N } : Object.keys(l).length > 0 ? { ...i, ...l } : i;
757
758
  }, [o, N, f, d, g, q]);
758
759
  P(() => {
759
- te().setTypeDefaults(oe);
760
- }, [oe]), P(() => {
760
+ re().setTypeDefaults(ie);
761
+ }, [ie]), P(() => {
761
762
  u.current && (u.current.rows = r);
762
763
  }, [r]), P(() => {
763
764
  u.current && I && (u.current.gridConfig = I);
@@ -770,49 +771,49 @@ const vt = he(function(e, t) {
770
771
  }, [C]), P(() => {
771
772
  const i = u.current;
772
773
  if (!i) return;
773
- const l = te();
774
+ const l = re();
774
775
  i.__frameworkAdapter = l, ot(i), it(i, l);
775
- let m = !1;
776
+ let y = !1;
776
777
  const L = requestAnimationFrame(() => {
777
- m || (typeof i.refreshColumns == "function" && i.refreshColumns(), typeof i.refreshShellHeader == "function" && i.refreshShellHeader());
778
+ y || (typeof i.refreshColumns == "function" && i.refreshColumns(), typeof i.refreshShellHeader == "function" && i.refreshShellHeader());
778
779
  });
779
780
  return () => {
780
- m = !0, cancelAnimationFrame(L);
781
+ y = !0, cancelAnimationFrame(L);
781
782
  };
782
783
  }, []), P(() => {
783
784
  if (!u.current || !R) return;
784
785
  const i = u.current, l = "react-custom-styles";
785
- let m = !0;
786
+ let y = !0;
786
787
  return i.ready?.().then(() => {
787
- m && R && (i.registerStyles?.(l, R), j.current = l);
788
+ y && R && (i.registerStyles?.(l, R), j.current = l);
788
789
  }), () => {
789
- m = !1, j.current && (i.unregisterStyles?.(j.current), j.current = null);
790
+ y = !1, j.current && (i.unregisterStyles?.(j.current), j.current = null);
790
791
  };
791
792
  }, [R]), P(() => {
792
793
  const i = u.current;
793
794
  if (!i) return;
794
795
  const l = [];
795
- return T && l.push(i.on("rows-change", (m) => T(m.rows))), () => {
796
- l.forEach((m) => m());
796
+ return x && l.push(i.on("rows-change", (y) => x(y.rows))), () => {
797
+ l.forEach((y) => y());
797
798
  };
798
- }, [T]);
799
- const le = D(() => Object.keys(W).filter((i) => typeof h[i] == "function").sort().join("|"), [h]), de = E({});
800
- for (const i of Object.keys(W))
801
- de.current[i] = h[i];
799
+ }, [x]);
800
+ const de = D(() => Object.keys(B).filter((i) => typeof h[i] == "function").sort().join("|"), [h]), ue = E({});
801
+ for (const i of Object.keys(B))
802
+ ue.current[i] = h[i];
802
803
  P(() => {
803
804
  const i = u.current;
804
805
  if (!i) return;
805
806
  const l = [];
806
- for (const [m, L] of Object.entries(W))
807
- le.includes(m) && l.push(
807
+ for (const [y, L] of Object.entries(B))
808
+ de.includes(y) && l.push(
808
809
  i.on(L, (V, M) => {
809
- de.current[m]?.(V, M);
810
+ ue.current[y]?.(V, M);
810
811
  })
811
812
  );
812
813
  return () => {
813
- l.forEach((m) => m());
814
+ l.forEach((y) => y());
814
815
  };
815
- }, [le]), ve(
816
+ }, [de]), ve(
816
817
  t,
817
818
  () => ({
818
819
  get element() {
@@ -839,8 +840,8 @@ const vt = he(function(e, t) {
839
840
  setRowLoading(i, l) {
840
841
  u.current?.setRowLoading?.(i, l);
841
842
  },
842
- setCellLoading(i, l, m) {
843
- u.current?.setCellLoading?.(i, l, m);
843
+ setCellLoading(i, l, y) {
844
+ u.current?.setCellLoading?.(i, l, y);
844
845
  },
845
846
  isRowLoading(i) {
846
847
  return u.current?.isRowLoading?.(i) ?? !1;
@@ -857,10 +858,10 @@ const vt = he(function(e, t) {
857
858
  const $ = E(null);
858
859
  return ke(() => {
859
860
  const i = u.current;
860
- return i && $.current && fe(i, $.current), () => {
861
- i && fe(i, null);
861
+ return i && $.current && ge(i, $.current), () => {
862
+ i && ge(i, null);
862
863
  };
863
- }, []), /* @__PURE__ */ Pe(re, { children: [
864
+ }, []), /* @__PURE__ */ Pe(ne, { children: [
864
865
  /* @__PURE__ */ b(je, { ref: $ }),
865
866
  /* @__PURE__ */ b(
866
867
  "tbw-grid",
@@ -873,7 +874,7 @@ const vt = he(function(e, t) {
873
874
  },
874
875
  class: K,
875
876
  style: p,
876
- children: /* @__PURE__ */ b(xe.Provider, { value: u, children: v })
877
+ children: /* @__PURE__ */ b(Te.Provider, { value: u, children: v })
877
878
  }
878
879
  )
879
880
  ] });
@@ -895,44 +896,44 @@ function Ct(n) {
895
896
  options: K,
896
897
  multi: p,
897
898
  format: v
898
- } = n, y = E(null), k = S(
899
+ } = n, m = E(null), k = S(
899
900
  (u) => {
900
- y.current = u, u && (C && Ye(u, C), R && Ze(u, R));
901
+ m.current = u, u && (C && Ye(u, C), R && Ze(u, R));
901
902
  },
902
903
  [C, R, e]
903
- ), T = typeof a == "number" ? `${a}px` : a, h = {
904
+ ), x = typeof a == "number" ? `${a}px` : a, h = {
904
905
  field: e,
905
906
  ref: k
906
907
  };
907
- return t !== void 0 && (h.header = t), r !== void 0 && (h.type = r), o !== void 0 && (h.editable = o), s !== void 0 && (h.sortable = s), c !== void 0 && (h.resizable = c), T !== void 0 && (h.width = T), f !== void 0 && (h["min-width"] = f), d !== void 0 && (h.hidden = d), g !== void 0 && (h["lock-visible"] = g), p !== void 0 && (h.multi = p), v && (h["data-has-format"] = "true"), K && (h["data-has-options"] = "true"), /* @__PURE__ */ b("tbw-grid-column", { ...h });
908
+ return t !== void 0 && (h.header = t), r !== void 0 && (h.type = r), o !== void 0 && (h.editable = o), s !== void 0 && (h.sortable = s), c !== void 0 && (h.resizable = c), x !== void 0 && (h.width = x), f !== void 0 && (h["min-width"] = f), d !== void 0 && (h.hidden = d), g !== void 0 && (h["lock-visible"] = g), p !== void 0 && (h.multi = p), v && (h["data-has-format"] = "true"), K && (h["data-has-options"] = "true"), /* @__PURE__ */ b("tbw-grid-column", { ...h });
908
909
  }
909
910
  function Rt({ children: n }) {
910
911
  return /* @__PURE__ */ b("tbw-grid-tool-buttons", { children: n });
911
912
  }
912
913
  const wt = ({ icons: n, defaults: e, children: t }) => {
913
914
  let r = t;
914
- return e && (r = /* @__PURE__ */ b(He, { defaults: e, children: r })), n && (r = /* @__PURE__ */ b(Ie, { icons: n, children: r })), /* @__PURE__ */ b(re, { children: r });
915
+ return e && (r = /* @__PURE__ */ b(He, { defaults: e, children: r })), n && (r = /* @__PURE__ */ b(Ie, { icons: n, children: r })), /* @__PURE__ */ b(ne, { children: r });
915
916
  };
916
917
  function Pt(n) {
917
- const e = E(null), [t, r] = ue(!1), [o, s] = ue(null), c = E(null), a = S(() => n ? (c.current ??= document.querySelector(n), c.current) : e.current?.element ?? null, [n]);
918
+ const e = E(null), [t, r] = fe(!1), [o, s] = fe(null), c = E(null), a = S(() => n ? (c.current ??= document.querySelector(n), c.current) : e.current?.element ?? null, [n]);
918
919
  P(() => {
919
920
  let p = !0;
920
921
  return (async () => {
921
922
  try {
922
923
  if (n) {
923
- const y = document.querySelector(n);
924
- if (!y) return;
925
- if (c.current = y, await y.ready?.(), p) {
924
+ const m = document.querySelector(n);
925
+ if (!m) return;
926
+ if (c.current = m, await m.ready?.(), p) {
926
927
  r(!0);
927
- const k = await y.getConfig?.();
928
+ const k = await m.getConfig?.();
928
929
  p && k && s(k);
929
930
  }
930
931
  } else {
931
- const y = e.current;
932
- if (!y) return;
933
- if (await y.ready?.(), p) {
932
+ const m = e.current;
933
+ if (!m) return;
934
+ if (await m.ready?.(), p) {
934
935
  r(!0);
935
- const k = await y.getConfig?.();
936
+ const k = await m.getConfig?.();
936
937
  p && k && s(k);
937
938
  }
938
939
  }
@@ -963,15 +964,15 @@ function Pt(n) {
963
964
  await v.toggleGroup?.(p);
964
965
  return;
965
966
  }
966
- const y = e.current;
967
- y && await y.toggleGroup?.(p);
967
+ const m = e.current;
968
+ m && await m.toggleGroup?.(p);
968
969
  },
969
970
  [a]
970
971
  ), C = S(
971
972
  (p, v) => {
972
- const y = a();
973
- if (y) {
974
- y.registerStyles?.(p, v);
973
+ const m = a();
974
+ if (m) {
975
+ m.registerStyles?.(p, v);
975
976
  return;
976
977
  }
977
978
  e.current?.registerStyles?.(p, v);
@@ -1014,6 +1015,6 @@ export {
1014
1015
  He as GridTypeProvider,
1015
1016
  Pt as useGrid,
1016
1017
  pt as useGridIcons,
1017
- mt as useGridTypeDefaults,
1018
- yt as useTypeDefault
1018
+ yt as useGridTypeDefaults,
1019
+ mt as useTypeDefault
1019
1020
  };
@@ -1,4 +1,4 @@
1
- import { CellActivateDetail, CellChangeDetail, CellClickDetail, CellCommitDetail, ChangedRowsResetDetail, ColumnMoveDetail, ColumnResizeDetail, ColumnVisibilityDetail, CopyDetail, DetailExpandDetail, ExportCompleteDetail, FilterChangeDetail, GridColumnState, GroupToggleDetail, PasteDetail, PrintCompleteDetail, PrintStartDetail, ResponsiveChangeDetail, RowClickDetail, RowCommitDetail, RowMoveDetail, SelectionChangeDetail, SortChangeDetail, TreeExpandDetail, UndoRedoDetail } from '@toolbox-web/grid/all';
1
+ import { CellActivateDetail, CellChangeDetail, CellClickDetail, CellCommitDetail, ChangedRowsResetDetail, ColumnMoveDetail, ColumnResizeDetail, ColumnVisibilityDetail, CopyDetail, DetailExpandDetail, ExportCompleteDetail, FilterChangeDetail, GridColumnState, GroupToggleDetail, PasteDetail, PrintCompleteDetail, PrintStartDetail, ResponsiveChangeDetail, RowClickDetail, RowCommitDetail, RowMoveDetail, SelectionChangeDetail, SortChangeDetail, TbwScrollDetail, TreeExpandDetail, UndoRedoDetail } from '@toolbox-web/grid/all';
2
2
  /**
3
3
  * Event handler type with unwrapped detail.
4
4
  * Pattern: `(detail: T, event?: CustomEvent) => void`
@@ -303,6 +303,23 @@ export interface EventProps<TRow = unknown> {
303
303
  * ```
304
304
  */
305
305
  onPrintComplete?: EventHandler<PrintCompleteDetail>;
306
+ /**
307
+ * Fired (rAF-batched) when the grid's viewport scrolls vertically.
308
+ *
309
+ * For server-side pagination of large datasets prefer `ServerSidePlugin`
310
+ * — this event is the lower-level primitive for custom load-more
311
+ * triggers, deferring heavy cell content, dismissing overlays, etc.
312
+ *
313
+ * @example
314
+ * ```tsx
315
+ * onTbwScroll={(detail) => {
316
+ * if (detail.scrollTop + detail.clientHeight >= detail.scrollHeight - 200) {
317
+ * loadMore();
318
+ * }
319
+ * }}
320
+ * ```
321
+ */
322
+ onTbwScroll?: EventHandler<TbwScrollDetail>;
306
323
  }
307
324
  /**
308
325
  * Map of event handler prop names to their corresponding event names.
@@ -1 +1 @@
1
- {"version":3,"file":"event-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/event-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK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,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAM1C;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAMtD;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAE9C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAMpD;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,MAAM,CA2B3D,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,MAAM,UAAU,CAAC,EAAE,CAExD"}
@@ -30,8 +30,14 @@ export declare function getPortalManager(gridEl?: HTMLElement): PortalManagerHan
30
30
  export declare function renderToContainer(container: HTMLElement, element: ReactNode, existingKey?: string, gridEl?: HTMLElement): string;
31
31
  /**
32
32
  * Remove a portal (or fallback root) by key.
33
+ *
34
+ * @param options.sync - When true, flush the removal synchronously so the
35
+ * caller can safely clear the container DOM immediately after (e.g.,
36
+ * tool panel accordion collapse sets `innerHTML = ''`).
33
37
  */
34
- export declare function removeFromContainer(key: string): void;
38
+ export declare function removeFromContainer(key: string, options?: {
39
+ sync?: boolean;
40
+ }): void;
35
41
  /**
36
42
  * Remove all portals and fallback roots for a specific grid.
37
43
  * Preferred over `clearAllContainers()` in multi-grid scenarios.
@@ -1 +1 @@
1
- {"version":3,"file":"portal-bridge.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC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SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CAoBR;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAQnF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAWhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAczC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC"}
@@ -9,8 +9,15 @@ export interface PortalManagerHandle {
9
9
  * a single React commit via `flushSync`.
10
10
  */
11
11
  renderPortal(key: string, container: HTMLElement, element: ReactNode): void;
12
- /** Remove a portal by key. */
13
- removePortal(key: string): void;
12
+ /**
13
+ * Remove a portal by key.
14
+ * @param key unique key of the portal to remove
15
+ * @param sync - When true, flush the removal synchronously via `flushSync`
16
+ * so the caller can safely mutate the container DOM immediately after.
17
+ * Use this in cleanup callbacks that precede external DOM clearing
18
+ * (e.g., tool panel accordion collapse sets `innerHTML = ''`).
19
+ */
20
+ removePortal(key: string, sync?: boolean): void;
14
21
  /** Remove all portals. */
15
22
  clear(): void;
16
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"portal-manager.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-manager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAuD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU5F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAE5E,8BAA8B;IAC9B,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,0BAA0B;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,+FA+ExB,CAAC"}
1
+ {"version":3,"file":"portal-manager.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-manager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAuD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU5F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAE5E;;;;;;;OAOG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEhD,0BAA0B;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,+FAsFxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,IAAI,cAAc,EAE5B,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAmC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmB7F;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,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GG;IACH,OAAO,CAAC,yBAAyB;IAmBjC,oDAAoD;IACpD,OAAO,CAAC,WAAW;IAQnB,sDAAsD;IACtD,OAAO,CAAC,aAAa;IAQrB;;;OAGG;IACH,OAAO,IAAI,IAAI;IAWf;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAYtC;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;CAStC"}
1
+ {"version":3,"file":"react-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,IAAI,cAAc,EAE5B,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAmC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmB7F;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAaN;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,CAAC,GAAG,SAAS,CAYvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE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AAG,OAAO,EAC/B,aAAa,EAAE,OAAO,GACrB,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,GAAG,SAAS;IAOtE;;;OAGG;IACH,4BAA4B,CAAC,IAAI,GAAG,OAAO,EACzC,WAAW,EAAE,WAAW,GACvB,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,SAAS;IAyB7D;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,SAAS;IA0B5G;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS;IAmCjG;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAiB1B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAmBjC,oDAAoD;IACpD,OAAO,CAAC,WAAW;IAQnB,sDAAsD;IACtD,OAAO,CAAC,aAAa;IAQrB;;;OAGG;IACH,OAAO,IAAI,IAAI;IAWf;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAYtC;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;CAStC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid-react",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "React adapter for @toolbox-web/grid data grid component",
5
5
  "type": "module",
6
6
  "main": "./index.js",