@toolbox-web/grid-react 1.1.1 → 1.2.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.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
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 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";
3
+ import { createContext as ye, useContext as O, useRef as k, useCallback as E, useEffect as P, forwardRef as he, useReducer as Ee, useImperativeHandle as ve, useMemo as S, useLayoutEffect as ke, Children as Se, isValidElement as De, useState as fe } from "react";
4
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";
5
+ import { flushSync as V, createPortal as Ge } from "react-dom";
6
6
  import { createPluginsFromFeatures as Ae } from "@toolbox-web/grid/features/registry";
7
7
  import { G as Te } from "./chunks/grid-element-context-BU3WvNtM.js";
8
8
  function xe(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 B = {
36
+ const W = {
37
37
  onCellClick: "cell-click",
38
38
  onRowClick: "row-click",
39
39
  onCellActivate: "cell-activate",
@@ -60,7 +60,7 @@ const B = {
60
60
  onPrintStart: "print-start",
61
61
  onPrintComplete: "print-complete",
62
62
  onTbwScroll: "tbw-scroll"
63
- }, oe = me(null), Ie = ({ icons: n, children: e }) => /* @__PURE__ */ b(oe.Provider, { value: n, children: e });
63
+ }, oe = ye(null), Ie = ({ icons: n, children: e }) => /* @__PURE__ */ b(oe.Provider, { value: n, children: e });
64
64
  function pt() {
65
65
  return O(oe);
66
66
  }
@@ -76,65 +76,65 @@ function Ce(n) {
76
76
  return Z.get(t);
77
77
  }
78
78
  function Me(n) {
79
- const { children: e, cardRowHeight: t = "auto" } = n, r = E(null), o = S(
80
- (c) => {
81
- if (r.current = c, !c) return;
82
- Y.set(c, e);
83
- const a = c.closest("tbw-grid");
84
- if (a) {
85
- const f = a.id || a.getAttribute("data-grid-id");
86
- f && Z.set(f, e);
79
+ const { children: e, cardRowHeight: t = "auto" } = n, r = k(null), o = E(
80
+ (a) => {
81
+ if (r.current = a, !a) return;
82
+ Y.set(a, e);
83
+ const s = a.closest("tbw-grid");
84
+ if (s) {
85
+ const g = s.id || s.getAttribute("data-grid-id");
86
+ g && Z.set(g, e);
87
87
  }
88
88
  },
89
89
  [e]
90
90
  );
91
91
  P(() => () => {
92
- const c = r.current;
93
- if (c) {
94
- Y.delete(c);
95
- const a = c.closest("tbw-grid");
96
- if (a) {
97
- const f = a.id || a.getAttribute("data-grid-id");
98
- f && Z.delete(f);
92
+ const a = r.current;
93
+ if (a) {
94
+ Y.delete(a);
95
+ const s = a.closest("tbw-grid");
96
+ if (s) {
97
+ const g = s.id || s.getAttribute("data-grid-id");
98
+ g && Z.delete(g);
99
99
  }
100
100
  }
101
101
  }, []);
102
- const s = t === "auto" ? "auto" : String(t);
103
- return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: s });
102
+ const c = t === "auto" ? "auto" : String(t);
103
+ return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: c });
104
104
  }
105
105
  Me.displayName = "GridResponsiveCard";
106
- const z = me(null), He = ({ defaults: n, children: e }) => /* @__PURE__ */ b(z.Provider, { value: n, children: e });
107
- function yt() {
106
+ const z = ye(null), He = ({ defaults: n, children: e }) => /* @__PURE__ */ b(z.Provider, { value: n, children: e });
107
+ function mt() {
108
108
  return O(z);
109
109
  }
110
- function mt(n) {
110
+ function yt(n) {
111
111
  return O(z)?.[n];
112
112
  }
113
113
  const Oe = z, je = he(function(e, t) {
114
- const r = E(/* @__PURE__ */ new Map()), [, o] = Ee((g) => g + 1, 0), s = E(!1), c = E(0), a = () => {
115
- s.current || (s.current = !0, queueMicrotask(() => {
116
- s.current = !1, W(o), f();
114
+ const r = k(/* @__PURE__ */ new Map()), [, o] = Ee((p) => p + 1, 0), c = k(!1), a = k(0), s = () => {
115
+ c.current || (c.current = !0, queueMicrotask(() => {
116
+ c.current = !1, V(o), g();
117
117
  }));
118
- }, f = () => {
119
- c.current || (c.current = requestAnimationFrame(() => {
120
- c.current = 0;
121
- let g = !1;
118
+ }, g = () => {
119
+ a.current || (a.current = requestAnimationFrame(() => {
120
+ a.current = 0;
121
+ let p = !1;
122
122
  for (const [C, R] of r.current)
123
- R.container.isConnected || (r.current.delete(C), g = !0);
124
- g && W(o);
123
+ R.container.isConnected || (r.current.delete(C), p = !0);
124
+ p && V(o);
125
125
  }));
126
126
  };
127
127
  ve(
128
128
  t,
129
129
  () => ({
130
- renderPortal(g, C, R) {
131
- r.current.set(g, { container: C, element: R }), a();
130
+ renderPortal(p, C, R) {
131
+ r.current.set(p, { container: C, element: R }), s();
132
132
  },
133
- removePortal(g, C) {
134
- r.current.delete(g) && (C ? W(o) : a());
133
+ removePortal(p, C) {
134
+ r.current.delete(p) && (C ? V(o) : s());
135
135
  },
136
136
  clear() {
137
- r.current.size > 0 && (r.current.clear(), c.current && (cancelAnimationFrame(c.current), c.current = 0), a());
137
+ r.current.size > 0 && (r.current.clear(), a.current && (cancelAnimationFrame(a.current), a.current = 0), s());
138
138
  }
139
139
  }),
140
140
  // forceRender is stable (useReducer dispatch), refs are stable
@@ -142,14 +142,14 @@ const Oe = z, je = he(function(e, t) {
142
142
  []
143
143
  );
144
144
  const d = [];
145
- for (const [g, { container: C, element: R }] of r.current)
146
- d.push(Ge(R, C, g));
145
+ for (const [p, { container: C, element: R }] of r.current)
146
+ d.push(Ge(R, C, p));
147
147
  return /* @__PURE__ */ b(ne, { children: d });
148
- }), U = /* @__PURE__ */ Symbol("reactProcessed"), G = [];
148
+ }), U = /* @__PURE__ */ Symbol("reactProcessed"), D = [];
149
149
  function ze(n) {
150
- for (let e = G.length - 1; e >= 0; e--) {
151
- const t = G[e];
152
- n.contains(t.container) && t.container.classList.contains("react-cell-editor") && (H(t.key), G.splice(e, 1));
150
+ for (let e = D.length - 1; e >= 0; e--) {
151
+ const t = D[e];
152
+ n.contains(t.container) && t.container.classList.contains("react-cell-editor") && (H(t.key), D.splice(e, 1));
153
153
  }
154
154
  }
155
155
  function qe(n) {
@@ -157,14 +157,14 @@ function qe(n) {
157
157
  return (t) => {
158
158
  const r = t.cellEl;
159
159
  if (r) {
160
- const c = e.get(r);
161
- if (c)
162
- return w(c.container, n(t), c.portalKey), c.container;
160
+ const a = e.get(r);
161
+ if (a)
162
+ return w(a.container, n(t), a.portalKey), a.container;
163
163
  }
164
164
  const o = document.createElement("div");
165
165
  o.className = "react-cell-renderer", o.style.display = "contents";
166
- const s = w(o, n(t));
167
- return r && e.set(r, { portalKey: s, container: o }), G.push({ key: s, container: o }), o;
166
+ const c = w(o, n(t));
167
+ return r && e.set(r, { portalKey: c, container: o }), D.push({ key: c, container: o }), o;
168
168
  };
169
169
  }
170
170
  function _e(n) {
@@ -172,7 +172,7 @@ function _e(n) {
172
172
  const t = document.createElement("div");
173
173
  t.className = "react-cell-editor", t.style.display = "contents";
174
174
  const r = w(t, n(e));
175
- return G.push({ key: r, container: t }), t;
175
+ return D.push({ key: r, container: t }), t;
176
176
  };
177
177
  }
178
178
  function $e(n) {
@@ -180,18 +180,18 @@ function $e(n) {
180
180
  const t = document.createElement("div");
181
181
  t.className = "react-header-renderer", t.style.display = "contents";
182
182
  const r = w(t, n(e));
183
- return G.push({ key: r, container: t }), t;
183
+ return D.push({ key: r, container: t }), t;
184
184
  };
185
185
  }
186
- function Ve(n) {
186
+ function Be(n) {
187
187
  return (e) => {
188
188
  const t = document.createElement("div");
189
189
  t.className = "react-header-label-renderer", t.style.display = "contents";
190
190
  const r = w(t, n(e));
191
- return G.push({ key: r, container: t }), t;
191
+ return D.push({ key: r, container: t }), t;
192
192
  };
193
193
  }
194
- function We(n) {
194
+ function Ve(n) {
195
195
  return (e) => {
196
196
  const t = n(e);
197
197
  if (t instanceof HTMLElement || typeof t == "string")
@@ -199,7 +199,7 @@ function We(n) {
199
199
  const r = document.createElement("div");
200
200
  r.className = "react-loading-renderer", r.style.display = "contents";
201
201
  const o = w(r, t);
202
- return G.push({ key: o, container: r }), r;
202
+ return D.push({ key: o, container: r }), r;
203
203
  };
204
204
  }
205
205
  function Re(n) {
@@ -209,7 +209,7 @@ function Re(n) {
209
209
  const r = n.loadingRenderer;
210
210
  n = {
211
211
  ...n,
212
- loadingRenderer: We(r)
212
+ loadingRenderer: Ve(r)
213
213
  };
214
214
  }
215
215
  if (!n.columns) {
@@ -217,8 +217,8 @@ function Re(n) {
217
217
  return r[U] = !0, r;
218
218
  }
219
219
  const e = n.columns.map((r) => {
220
- const { renderer: o, editor: s, headerRenderer: c, headerLabelRenderer: a, ...f } = r, d = { ...f };
221
- return o && (d.renderer = qe(o)), s && (d.editor = _e(s)), c && (d.headerRenderer = $e(c)), a && (d.headerLabelRenderer = Ve(a)), d;
220
+ const { renderer: o, editor: c, headerRenderer: a, headerLabelRenderer: s, ...g } = r, d = { ...g };
221
+ return o && (d.renderer = qe(o)), c && (d.editor = _e(c)), a && (d.headerRenderer = $e(a)), s && (d.headerLabelRenderer = Be(s)), d;
222
222
  }), t = {
223
223
  ...n,
224
224
  columns: e
@@ -226,7 +226,7 @@ function Re(n) {
226
226
  return t[U] = !0, t;
227
227
  }
228
228
  const Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new Map();
229
- function Be(n) {
229
+ function We(n) {
230
230
  const e = n.querySelector("tbw-grid-detail");
231
231
  if (e) {
232
232
  const r = Q.get(e);
@@ -237,34 +237,34 @@ function Be(n) {
237
237
  return X.get(t);
238
238
  }
239
239
  function Ue(n) {
240
- const { children: e, showExpandColumn: t = !0, animation: r = "slide" } = n, o = E(null), s = S(
241
- (a) => {
242
- if (o.current = a, !a) return;
243
- Q.set(a, e);
244
- const f = a.closest("tbw-grid");
245
- if (f) {
246
- const d = f.id || f.getAttribute("data-grid-id");
240
+ const { children: e, showExpandColumn: t = !0, animation: r = "slide" } = n, o = k(null), c = E(
241
+ (s) => {
242
+ if (o.current = s, !s) return;
243
+ Q.set(s, e);
244
+ const g = s.closest("tbw-grid");
245
+ if (g) {
246
+ const d = g.id || g.getAttribute("data-grid-id");
247
247
  d && X.set(d, e);
248
248
  }
249
249
  },
250
250
  [e]
251
251
  );
252
252
  return P(() => () => {
253
- const a = o.current;
254
- if (a) {
255
- Q.delete(a);
256
- const f = a.closest("tbw-grid");
257
- if (f) {
258
- const g = f.id || f.getAttribute("data-grid-id");
259
- g && X.delete(g);
253
+ const s = o.current;
254
+ if (s) {
255
+ Q.delete(s);
256
+ const g = s.closest("tbw-grid");
257
+ if (g) {
258
+ const p = g.id || g.getAttribute("data-grid-id");
259
+ p && X.delete(p);
260
260
  }
261
- const d = a.parentNode;
262
- d && d.contains(a);
261
+ const d = s.parentNode;
262
+ d && d.contains(s);
263
263
  }
264
264
  }, []), /* @__PURE__ */ b(
265
265
  "tbw-grid-detail",
266
266
  {
267
- ref: s,
267
+ ref: c,
268
268
  showExpandColumn: t ? void 0 : "false",
269
269
  animation: r === !1 ? "false" : r
270
270
  }
@@ -280,55 +280,55 @@ function Je(n) {
280
280
  return te.get(t);
281
281
  }
282
282
  function ht(n) {
283
- const { id: e, title: t, icon: r, tooltip: o, order: s = 100, children: c } = n, a = E(null), f = S(
283
+ const { id: e, title: t, icon: r, tooltip: o, order: c = 100, children: a } = n, s = k(null), g = E(
284
284
  (d) => {
285
- a.current = d, d && (ee.set(d, c), e && te.set(e, c));
285
+ s.current = d, d && (ee.set(d, a), e && te.set(e, a));
286
286
  },
287
- [c, e]
287
+ [a, e]
288
288
  );
289
289
  return P(() => () => {
290
- const d = a.current;
290
+ const d = s.current;
291
291
  d && (ee.delete(d), e && te.delete(e));
292
292
  }, [e]), /* @__PURE__ */ b(
293
293
  "tbw-grid-tool-panel",
294
294
  {
295
- ref: f,
295
+ ref: g,
296
296
  id: e,
297
297
  title: t,
298
298
  icon: r,
299
299
  tooltip: o,
300
- order: s?.toString()
300
+ order: c?.toString()
301
301
  }
302
302
  );
303
303
  }
304
- const A = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new Map();
304
+ const G = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new Map();
305
305
  function Ye(n, e) {
306
- const t = n.getAttribute("field"), r = A.get(n) ?? {};
307
- if (r.renderer = e, A.set(n, r), t) {
308
- const o = T.get(t) ?? {};
309
- o.renderer = e, T.set(t, o);
306
+ const t = n.getAttribute("field"), r = G.get(n) ?? {};
307
+ if (r.renderer = e, G.set(n, r), t) {
308
+ const o = A.get(t) ?? {};
309
+ o.renderer = e, A.set(t, o);
310
310
  }
311
311
  }
312
312
  function Ze(n, e) {
313
- const t = n.getAttribute("field"), r = A.get(n) ?? {};
314
- if (r.editor = e, A.set(n, r), t) {
315
- const o = T.get(t) ?? {};
316
- o.editor = e, T.set(t, o);
313
+ const t = n.getAttribute("field"), r = G.get(n) ?? {};
314
+ if (r.editor = e, G.set(n, r), t) {
315
+ const o = A.get(t) ?? {};
316
+ o.editor = e, A.set(t, o);
317
317
  }
318
318
  }
319
319
  function Qe(n) {
320
- let e = A.get(n)?.renderer;
320
+ let e = G.get(n)?.renderer;
321
321
  if (!e) {
322
322
  const t = n.getAttribute("field");
323
- t && (e = T.get(t)?.renderer);
323
+ t && (e = A.get(t)?.renderer);
324
324
  }
325
325
  return e;
326
326
  }
327
327
  function Xe(n) {
328
- let e = A.get(n)?.editor;
328
+ let e = G.get(n)?.editor;
329
329
  if (!e) {
330
330
  const t = n.getAttribute("field");
331
- t && (e = T.get(t)?.editor);
331
+ t && (e = A.get(t)?.editor);
332
332
  }
333
333
  return e;
334
334
  }
@@ -363,13 +363,13 @@ class et {
363
363
  */
364
364
  canHandle(e) {
365
365
  const t = e.getAttribute("field");
366
- let r = A.get(e);
366
+ let r = G.get(e);
367
367
  if (!r && t) {
368
- const c = T.get(t);
369
- c && (c.renderer || c.editor) && (r = c, A.set(e, r));
368
+ const a = A.get(t);
369
+ a && (a.renderer || a.editor) && (r = a, G.set(e, r));
370
370
  }
371
- const o = r?.renderer !== void 0, s = r?.editor !== void 0;
372
- return r !== void 0 && (o || s);
371
+ const o = r?.renderer !== void 0, c = r?.editor !== void 0;
372
+ return r !== void 0 && (o || c);
373
373
  }
374
374
  /**
375
375
  * Creates a view renderer function that renders a React component
@@ -387,31 +387,31 @@ class et {
387
387
  if (!t)
388
388
  return;
389
389
  const r = e.closest("tbw-grid"), o = /* @__PURE__ */ new WeakMap();
390
- return (s) => {
391
- const c = s.cellEl;
392
- if (c) {
393
- const d = o.get(c);
390
+ return (c) => {
391
+ const a = c.cellEl;
392
+ if (a) {
393
+ const d = o.get(a);
394
394
  if (d)
395
- return w(d.container, t(s), d.portalKey), d.container;
396
- const g = document.createElement("div");
397
- g.className = "react-cell-renderer", g.style.display = "contents";
395
+ return w(d.container, t(c), d.portalKey), d.container;
396
+ const p = document.createElement("div");
397
+ p.className = "react-cell-renderer", p.style.display = "contents";
398
398
  const C = w(
399
- g,
400
- t(s),
399
+ p,
400
+ t(c),
401
401
  void 0,
402
402
  r ?? void 0
403
403
  );
404
- return o.set(c, { portalKey: C, container: g }), this.trackPortal(C, g, !1), g;
404
+ return o.set(a, { portalKey: C, container: p }), this.trackPortal(C, p, !1), p;
405
405
  }
406
- const a = document.createElement("div");
407
- a.className = "react-cell-renderer", a.style.display = "contents";
408
- const f = w(
409
- a,
410
- t(s),
406
+ const s = document.createElement("div");
407
+ s.className = "react-cell-renderer", s.style.display = "contents";
408
+ const g = w(
409
+ s,
410
+ t(c),
411
411
  void 0,
412
412
  r ?? void 0
413
413
  );
414
- return this.trackPortal(f, a, !1), a;
414
+ return this.trackPortal(g, s, !1), s;
415
415
  };
416
416
  }
417
417
  /**
@@ -424,15 +424,15 @@ class et {
424
424
  return () => document.createElement("div");
425
425
  const r = e.closest("tbw-grid") ?? void 0;
426
426
  return (o) => {
427
- const s = document.createElement("div");
428
- s.className = "react-cell-editor", s.style.display = "contents";
429
- const c = w(
430
- s,
427
+ const c = document.createElement("div");
428
+ c.className = "react-cell-editor", c.style.display = "contents";
429
+ const a = w(
430
+ c,
431
431
  t(o),
432
432
  void 0,
433
433
  r
434
434
  );
435
- return this.trackPortal(c, s, !0), s;
435
+ return this.trackPortal(a, c, !0), c;
436
436
  };
437
437
  }
438
438
  /**
@@ -440,18 +440,18 @@ class et {
440
440
  * Renders React components for expandable detail rows.
441
441
  */
442
442
  createDetailRenderer(e) {
443
- const t = Be(e);
443
+ const t = We(e);
444
444
  if (t)
445
445
  return (r, o) => {
446
- const s = document.createElement("div");
447
- s.className = "react-detail-panel";
448
- const a = w(
449
- s,
446
+ const c = document.createElement("div");
447
+ c.className = "react-detail-panel";
448
+ const s = w(
449
+ c,
450
450
  t({ row: r, rowIndex: o }),
451
451
  void 0,
452
452
  e
453
453
  );
454
- return this.trackPortal(a, s, !1), s;
454
+ return this.trackPortal(s, c, !1), c;
455
455
  };
456
456
  }
457
457
  /**
@@ -471,17 +471,30 @@ class et {
471
471
  const t = Ce(e);
472
472
  if (t)
473
473
  return (r, o) => {
474
- const s = document.createElement("div");
475
- s.className = "react-responsive-card";
476
- const a = w(
477
- s,
474
+ const c = document.createElement("div");
475
+ c.className = "react-responsive-card";
476
+ const s = w(
477
+ c,
478
478
  t({ row: r, index: o }),
479
479
  void 0,
480
480
  e
481
481
  );
482
- return this.trackPortal(a, s, !1), s;
482
+ return this.trackPortal(s, c, !1), c;
483
483
  };
484
484
  }
485
+ /**
486
+ * FrameworkAdapter hook called by ResponsivePlugin during attach().
487
+ * Parses the `<tbw-grid-responsive-card>` element and delegates to
488
+ * {@link createResponsiveCardRenderer}. Needed for parity with the Vue
489
+ * and Angular adapters so ResponsivePlugin's standard lookup path works
490
+ * for React users as well, not just via the imperative
491
+ * `refreshResponsiveCardRenderer` hook in DataGrid.
492
+ */
493
+ parseResponsiveCardElement(e) {
494
+ const t = e.closest("tbw-grid");
495
+ if (t)
496
+ return this.createResponsiveCardRenderer(t);
497
+ }
485
498
  /**
486
499
  * Creates a tool panel renderer from a light DOM element.
487
500
  * Renders React components into tool panel containers.
@@ -492,11 +505,11 @@ class et {
492
505
  return;
493
506
  const r = e.closest("tbw-grid");
494
507
  return (o) => {
495
- const c = w(o, t({
508
+ const a = w(o, t({
496
509
  grid: r ?? o
497
510
  }), void 0, r ?? void 0);
498
- return this.trackPortal(c, o, !1), () => {
499
- H(c, { sync: !0 }), this.untrackPortal(c);
511
+ return this.trackPortal(a, o, !1), () => {
512
+ H(a, { sync: !0 }), this.untrackPortal(a);
500
513
  };
501
514
  };
502
515
  }
@@ -543,8 +556,8 @@ class et {
543
556
  return (r) => {
544
557
  const o = document.createElement("span");
545
558
  o.style.display = "contents";
546
- const s = r.cellEl?.closest("tbw-grid") ?? t, c = w(o, e(r), void 0, s);
547
- return this.trackPortal(c, o, !1), o;
559
+ const c = r.cellEl?.closest("tbw-grid") ?? t, a = w(o, e(r), void 0, c);
560
+ return this.trackPortal(a, o, !1), o;
548
561
  };
549
562
  }
550
563
  /**
@@ -555,8 +568,8 @@ class et {
555
568
  return (r) => {
556
569
  const o = document.createElement("span");
557
570
  o.style.display = "contents";
558
- const s = w(o, e(r), void 0, t);
559
- return this.trackPortal(s, o, !0), o;
571
+ const c = w(o, e(r), void 0, t);
572
+ return this.trackPortal(c, o, !0), o;
560
573
  };
561
574
  }
562
575
  /**
@@ -565,10 +578,10 @@ class et {
565
578
  */
566
579
  createFilterPanelRenderer(e, t) {
567
580
  return (r, o) => {
568
- const s = document.createElement("div");
569
- s.style.display = "contents";
570
- const c = r.closest("tbw-grid") ?? t, a = w(s, e(o), void 0, c);
571
- this.trackPortal(a, s, !1), r.appendChild(s);
581
+ const c = document.createElement("div");
582
+ c.style.display = "contents";
583
+ const a = r.closest("tbw-grid") ?? t, s = w(c, e(o), void 0, a);
584
+ this.trackPortal(s, c, !1), r.appendChild(c);
572
585
  };
573
586
  }
574
587
  // #region Portal tracking helpers
@@ -588,7 +601,7 @@ class et {
588
601
  destroy() {
589
602
  for (const e of this.allPortalKeys)
590
603
  H(e);
591
- this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(), T.clear();
604
+ this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(), A.clear();
592
605
  }
593
606
  /**
594
607
  * Called when a cell's content is about to be wiped.
@@ -635,9 +648,9 @@ function nt(n) {
635
648
  r === void 0 || r === !1 || e.push(t);
636
649
  return rt(e), Ae(n);
637
650
  }
638
- let ye = !1, J = null;
651
+ let me = !1, J = null;
639
652
  function re() {
640
- return ye || (J = new et(), be.registerAdapter(J), ye = !0), J;
653
+ return me || (J = new et(), be.registerAdapter(J), me = !0), J;
641
654
  }
642
655
  re();
643
656
  function ot(n) {
@@ -647,10 +660,10 @@ function ot(n) {
647
660
  function it(n, e) {
648
661
  const t = n;
649
662
  if (!n.querySelector("tbw-grid-responsive-card") || !Ce(n)) return;
650
- const s = t.getPluginByName?.("responsive");
651
- if (s && typeof s.setCardRenderer == "function") {
652
- const c = e.createResponsiveCardRenderer(n);
653
- c && s.setCardRenderer(c);
663
+ const c = t.getPluginByName?.("responsive");
664
+ if (c && typeof c.setCardRenderer == "function") {
665
+ const a = e.createResponsiveCardRenderer(n);
666
+ a && c.setCardRenderer(a);
654
667
  }
655
668
  }
656
669
  function st(n) {
@@ -675,26 +688,26 @@ const vt = he(function(e, t) {
675
688
  // Core props
676
689
  rows: r,
677
690
  gridConfig: o,
678
- columns: s,
679
- columnDefaults: c,
680
- fitMode: a,
681
- sortable: f,
691
+ columns: c,
692
+ columnDefaults: a,
693
+ fitMode: s,
694
+ sortable: g,
682
695
  filterable: d,
683
- selectable: g,
696
+ selectable: p,
684
697
  loading: C,
685
698
  customStyles: R,
686
699
  className: K,
687
- style: p,
688
- children: v,
700
+ style: x,
701
+ children: T,
689
702
  // Plugin props
690
- plugins: m,
703
+ plugins: u,
691
704
  // SSR mode
692
- ssr: k,
705
+ ssr: h,
693
706
  // Legacy event handlers
694
- onRowsChange: x,
707
+ onRowsChange: v,
695
708
  // Feature props and event props are in ...rest
696
- ...h
697
- } = e, u = E(null), j = E(null), ie = O(Oe), q = O(Le), se = [
709
+ ...m
710
+ } = e, f = k(null), j = k(null), ie = O(Oe), q = O(Le), se = [
698
711
  "selection",
699
712
  "editing",
700
713
  "filtering",
@@ -718,58 +731,58 @@ const vt = he(function(e, t) {
718
731
  "pivot",
719
732
  "serverSide",
720
733
  "tooltip"
721
- ], we = D(() => se.map((i) => {
722
- const l = h[i];
734
+ ], we = S(() => se.map((i) => {
735
+ const l = m[i];
723
736
  return l !== void 0 ? `${i}:${JSON.stringify(l)}` : "";
724
- }).filter(Boolean).join("|"), [h]), ce = D(() => {
737
+ }).filter(Boolean).join("|"), [m]), ce = S(() => {
725
738
  const i = {};
726
739
  for (const l of se)
727
- l in h && h[l] !== void 0 && (i[l] = h[l]);
740
+ l in m && m[l] !== void 0 && (i[l] = m[l]);
728
741
  return i;
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];
742
+ }, [we]), ae = S(() => st(T), [T]), le = S(() => ({ ...ae, ...ce }), [ce, ae]), _ = S(() => u || h ? [] : nt(le), [le, u, h]), N = S(() => {
743
+ if (u) {
744
+ const i = new Set(u.map((y) => y.name)), l = _.filter((y) => !i.has(y.name));
745
+ return [...u, ...l];
733
746
  }
734
747
  return _;
735
- }, [m, _]), F = D(() => {
736
- if (!s) return s;
737
- const i = Fe(s);
738
- return c ? i.map((l) => ({
739
- ...c,
748
+ }, [u, _]), F = S(() => {
749
+ if (!c) return c;
750
+ const i = Fe(c);
751
+ return a ? i.map((l) => ({
752
+ ...a,
740
753
  ...l
741
754
  // Individual column props override defaults
742
755
  })) : i;
743
- }, [s, c]), I = D(() => {
756
+ }, [c, a]), I = S(() => {
744
757
  const i = Re(o), l = {};
745
- if (f !== void 0 && (l.sortable = f), d !== void 0 && (l.filterable = d), g !== void 0 && (l.selectable = g), q) {
758
+ if (g !== void 0 && (l.sortable = g), d !== void 0 && (l.filterable = d), p !== void 0 && (l.selectable = p), q) {
746
759
  const y = i?.icons || o?.icons || {};
747
760
  l.icons = { ...q, ...y };
748
761
  }
749
762
  if (N.length > 0 && i) {
750
- const y = i.plugins || [], L = new Set(y.map((M) => M.name)), V = N.filter((M) => !L.has(M.name));
763
+ const y = i.plugins || [], L = new Set(y.map((M) => M.name)), B = N.filter((M) => !L.has(M.name));
751
764
  return {
752
765
  ...i,
753
766
  ...l,
754
- plugins: [...y, ...V]
767
+ plugins: [...y, ...B]
755
768
  };
756
769
  }
757
770
  return N.length > 0 && !i ? { ...l, plugins: N } : Object.keys(l).length > 0 ? { ...i, ...l } : i;
758
- }, [o, N, f, d, g, q]);
771
+ }, [o, N, g, d, p, q]);
759
772
  P(() => {
760
773
  re().setTypeDefaults(ie);
761
774
  }, [ie]), P(() => {
762
- u.current && (u.current.rows = r);
775
+ f.current && (f.current.rows = r);
763
776
  }, [r]), P(() => {
764
- u.current && I && (u.current.gridConfig = I);
777
+ f.current && I && (f.current.gridConfig = I);
765
778
  }, [I]), P(() => {
766
- u.current && F && (u.current.columns = F);
779
+ f.current && F && (f.current.columns = F);
767
780
  }, [F]), P(() => {
768
- u.current && a !== void 0 && (u.current.fitMode = a);
769
- }, [a]), P(() => {
770
- u.current && C !== void 0 && (u.current.loading = C);
781
+ f.current && s !== void 0 && (f.current.fitMode = s);
782
+ }, [s]), P(() => {
783
+ f.current && C !== void 0 && (f.current.loading = C);
771
784
  }, [C]), P(() => {
772
- const i = u.current;
785
+ const i = f.current;
773
786
  if (!i) return;
774
787
  const l = re();
775
788
  i.__frameworkAdapter = l, ot(i), it(i, l);
@@ -781,8 +794,8 @@ const vt = he(function(e, t) {
781
794
  y = !0, cancelAnimationFrame(L);
782
795
  };
783
796
  }, []), P(() => {
784
- if (!u.current || !R) return;
785
- const i = u.current, l = "react-custom-styles";
797
+ if (!f.current || !R) return;
798
+ const i = f.current, l = "react-custom-styles";
786
799
  let y = !0;
787
800
  return i.ready?.().then(() => {
788
801
  y && R && (i.registerStyles?.(l, R), j.current = l);
@@ -790,24 +803,24 @@ const vt = he(function(e, t) {
790
803
  y = !1, j.current && (i.unregisterStyles?.(j.current), j.current = null);
791
804
  };
792
805
  }, [R]), P(() => {
793
- const i = u.current;
806
+ const i = f.current;
794
807
  if (!i) return;
795
808
  const l = [];
796
- return x && l.push(i.on("rows-change", (y) => x(y.rows))), () => {
809
+ return v && l.push(i.on("rows-change", (y) => v(y.rows))), () => {
797
810
  l.forEach((y) => y());
798
811
  };
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];
812
+ }, [v]);
813
+ const de = S(() => Object.keys(W).filter((i) => typeof m[i] == "function").sort().join("|"), [m]), ue = k({});
814
+ for (const i of Object.keys(W))
815
+ ue.current[i] = m[i];
803
816
  P(() => {
804
- const i = u.current;
817
+ const i = f.current;
805
818
  if (!i) return;
806
819
  const l = [];
807
- for (const [y, L] of Object.entries(B))
820
+ for (const [y, L] of Object.entries(W))
808
821
  de.includes(y) && l.push(
809
- i.on(L, (V, M) => {
810
- ue.current[y]?.(V, M);
822
+ i.on(L, (B, M) => {
823
+ ue.current[y]?.(B, M);
811
824
  })
812
825
  );
813
826
  return () => {
@@ -817,47 +830,47 @@ const vt = he(function(e, t) {
817
830
  t,
818
831
  () => ({
819
832
  get element() {
820
- return u.current;
833
+ return f.current;
821
834
  },
822
835
  async getConfig() {
823
- return u.current?.getConfig?.() ?? {};
836
+ return f.current?.getConfig?.() ?? {};
824
837
  },
825
838
  async ready() {
826
- return u.current?.ready?.();
839
+ return f.current?.ready?.();
827
840
  },
828
841
  async forceLayout() {
829
- return u.current?.forceLayout?.();
842
+ return f.current?.forceLayout?.();
830
843
  },
831
844
  async toggleGroup(i) {
832
- return u.current?.toggleGroup?.(i);
845
+ return f.current?.toggleGroup?.(i);
833
846
  },
834
847
  registerStyles(i, l) {
835
- u.current?.registerStyles?.(i, l);
848
+ f.current?.registerStyles?.(i, l);
836
849
  },
837
850
  unregisterStyles(i) {
838
- u.current?.unregisterStyles?.(i);
851
+ f.current?.unregisterStyles?.(i);
839
852
  },
840
853
  setRowLoading(i, l) {
841
- u.current?.setRowLoading?.(i, l);
854
+ f.current?.setRowLoading?.(i, l);
842
855
  },
843
856
  setCellLoading(i, l, y) {
844
- u.current?.setCellLoading?.(i, l, y);
857
+ f.current?.setCellLoading?.(i, l, y);
845
858
  },
846
859
  isRowLoading(i) {
847
- return u.current?.isRowLoading?.(i) ?? !1;
860
+ return f.current?.isRowLoading?.(i) ?? !1;
848
861
  },
849
862
  isCellLoading(i, l) {
850
- return u.current?.isCellLoading?.(i, l) ?? !1;
863
+ return f.current?.isCellLoading?.(i, l) ?? !1;
851
864
  },
852
865
  clearAllLoading() {
853
- u.current?.clearAllLoading?.();
866
+ f.current?.clearAllLoading?.();
854
867
  }
855
868
  }),
856
869
  []
857
870
  );
858
- const $ = E(null);
871
+ const $ = k(null);
859
872
  return ke(() => {
860
- const i = u.current;
873
+ const i = f.current;
861
874
  return i && $.current && ge(i, $.current), () => {
862
875
  i && ge(i, null);
863
876
  };
@@ -867,14 +880,14 @@ const vt = he(function(e, t) {
867
880
  "tbw-grid",
868
881
  {
869
882
  ref: (i) => {
870
- if (u.current = i, i) {
883
+ if (f.current = i, i) {
871
884
  const l = i;
872
885
  I && (l.gridConfig = I), r && (l.rows = r), F && (l.columns = F);
873
886
  }
874
887
  },
875
888
  class: K,
876
- style: p,
877
- children: /* @__PURE__ */ b(Te.Provider, { value: u, children: v })
889
+ style: x,
890
+ children: /* @__PURE__ */ b(Te.Provider, { value: f, children: T })
878
891
  }
879
892
  )
880
893
  ] });
@@ -885,27 +898,27 @@ function Ct(n) {
885
898
  header: t,
886
899
  type: r,
887
900
  editable: o,
888
- sortable: s,
889
- resizable: c,
890
- width: a,
891
- minWidth: f,
901
+ sortable: c,
902
+ resizable: a,
903
+ width: s,
904
+ minWidth: g,
892
905
  hidden: d,
893
- lockVisible: g,
906
+ lockVisible: p,
894
907
  children: C,
895
908
  editor: R,
896
909
  options: K,
897
- multi: p,
898
- format: v
899
- } = n, m = E(null), k = S(
900
- (u) => {
901
- m.current = u, u && (C && Ye(u, C), R && Ze(u, R));
910
+ multi: x,
911
+ format: T
912
+ } = n, u = k(null), h = E(
913
+ (f) => {
914
+ u.current = f, f && (C && Ye(f, C), R && Ze(f, R));
902
915
  },
903
916
  [C, R, e]
904
- ), x = typeof a == "number" ? `${a}px` : a, h = {
917
+ ), v = typeof s == "number" ? `${s}px` : s, m = {
905
918
  field: e,
906
- ref: k
919
+ ref: h
907
920
  };
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 });
921
+ return t !== void 0 && (m.header = t), r !== void 0 && (m.type = r), o !== void 0 && (m.editable = o), c !== void 0 && (m.sortable = c), a !== void 0 && (m.resizable = a), v !== void 0 && (m.width = v), g !== void 0 && (m["min-width"] = g), d !== void 0 && (m.hidden = d), p !== void 0 && (m["lock-visible"] = p), x !== void 0 && (m.multi = x), T && (m["data-has-format"] = "true"), K && (m["data-has-options"] = "true"), /* @__PURE__ */ b("tbw-grid-column", { ...m });
909
922
  }
910
923
  function Rt({ children: n }) {
911
924
  return /* @__PURE__ */ b("tbw-grid-tool-buttons", { children: n });
@@ -915,91 +928,99 @@ const wt = ({ icons: n, defaults: e, children: t }) => {
915
928
  return e && (r = /* @__PURE__ */ b(He, { defaults: e, children: r })), n && (r = /* @__PURE__ */ b(Ie, { icons: n, children: r })), /* @__PURE__ */ b(ne, { children: r });
916
929
  };
917
930
  function Pt(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]);
931
+ const e = k(null), [t, r] = fe(!1), [o, c] = fe(null), a = k(null), s = E(() => n ? (a.current ??= document.querySelector(n), a.current) : e.current?.element ?? null, [n]);
919
932
  P(() => {
920
- let p = !0;
933
+ let u = !0;
921
934
  return (async () => {
922
935
  try {
923
936
  if (n) {
924
- const m = document.querySelector(n);
925
- if (!m) return;
926
- if (c.current = m, await m.ready?.(), p) {
937
+ const v = document.querySelector(n);
938
+ if (!v) return;
939
+ if (a.current = v, await v.ready?.(), u) {
927
940
  r(!0);
928
- const k = await m.getConfig?.();
929
- p && k && s(k);
941
+ const m = await v.getConfig?.();
942
+ u && m && c(m);
930
943
  }
931
944
  } else {
932
- const m = e.current;
933
- if (!m) return;
934
- if (await m.ready?.(), p) {
945
+ const v = e.current;
946
+ if (!v) return;
947
+ if (await v.ready?.(), u) {
935
948
  r(!0);
936
- const k = await m.getConfig?.();
937
- p && k && s(k);
949
+ const m = await v.getConfig?.();
950
+ u && m && c(m);
938
951
  }
939
952
  }
940
953
  } catch {
941
954
  }
942
955
  })(), () => {
943
- p = !1;
956
+ u = !1;
944
957
  };
945
958
  }, [n]);
946
- const f = S(async () => {
947
- const p = a();
948
- if (p)
949
- return await p.getConfig?.() ?? null;
950
- const v = e.current;
951
- return v ? await v.getConfig?.() ?? null : null;
952
- }, [a]), d = S(async () => {
953
- const p = a();
954
- if (p) {
955
- await p.forceLayout?.();
959
+ const g = E(async () => {
960
+ const u = s();
961
+ if (u)
962
+ return await u.getConfig?.() ?? null;
963
+ const h = e.current;
964
+ return h ? await h.getConfig?.() ?? null : null;
965
+ }, [s]), d = E(async () => {
966
+ const u = s();
967
+ if (u) {
968
+ await u.forceLayout?.();
956
969
  return;
957
970
  }
958
- const v = e.current;
959
- v && await v.forceLayout?.();
960
- }, [a]), g = S(
961
- async (p) => {
962
- const v = a();
963
- if (v) {
964
- await v.toggleGroup?.(p);
971
+ const h = e.current;
972
+ h && await h.forceLayout?.();
973
+ }, [s]), p = E(
974
+ async (u) => {
975
+ const h = s();
976
+ if (h) {
977
+ await h.toggleGroup?.(u);
965
978
  return;
966
979
  }
967
- const m = e.current;
968
- m && await m.toggleGroup?.(p);
980
+ const v = e.current;
981
+ v && await v.toggleGroup?.(u);
969
982
  },
970
- [a]
971
- ), C = S(
972
- (p, v) => {
973
- const m = a();
974
- if (m) {
975
- m.registerStyles?.(p, v);
983
+ [s]
984
+ ), C = E(
985
+ (u) => s()?.getPlugin?.(u),
986
+ [s]
987
+ ), R = E(
988
+ ((u) => s()?.getPluginByName?.(u)),
989
+ [s]
990
+ ), K = E(
991
+ (u, h) => {
992
+ const v = s();
993
+ if (v) {
994
+ v.registerStyles?.(u, h);
976
995
  return;
977
996
  }
978
- e.current?.registerStyles?.(p, v);
997
+ e.current?.registerStyles?.(u, h);
979
998
  },
980
- [a]
981
- ), R = S(
982
- (p) => {
983
- const v = a();
984
- if (v) {
985
- v.unregisterStyles?.(p);
999
+ [s]
1000
+ ), x = E(
1001
+ (u) => {
1002
+ const h = s();
1003
+ if (h) {
1004
+ h.unregisterStyles?.(u);
986
1005
  return;
987
1006
  }
988
- e.current?.unregisterStyles?.(p);
1007
+ e.current?.unregisterStyles?.(u);
989
1008
  },
990
- [a]
991
- ), K = S(() => o?.columns ? o.columns.filter((p) => !p.hidden) : [], [o]);
1009
+ [s]
1010
+ ), T = E(() => o?.columns ? o.columns.filter((u) => !u.hidden) : [], [o]);
992
1011
  return {
993
1012
  ref: e,
994
- element: a(),
1013
+ element: s(),
995
1014
  isReady: t,
996
1015
  config: o,
997
- getConfig: f,
1016
+ getConfig: g,
998
1017
  forceLayout: d,
999
- toggleGroup: g,
1000
- registerStyles: C,
1001
- unregisterStyles: R,
1002
- getVisibleColumns: K
1018
+ toggleGroup: p,
1019
+ getPlugin: C,
1020
+ getPluginByName: R,
1021
+ registerStyles: K,
1022
+ unregisterStyles: x,
1023
+ getVisibleColumns: T
1003
1024
  };
1004
1025
  }
1005
1026
  export {
@@ -1015,6 +1036,6 @@ export {
1015
1036
  He as GridTypeProvider,
1016
1037
  Pt as useGrid,
1017
1038
  pt as useGridIcons,
1018
- yt as useGridTypeDefaults,
1019
- mt as useTypeDefault
1039
+ mt as useGridTypeDefaults,
1040
+ yt as useTypeDefault
1020
1041
  };
@@ -120,6 +120,15 @@ export declare class GridAdapter implements FrameworkAdapter {
120
120
  * Renders React components for card layout in responsive mode.
121
121
  */
122
122
  createResponsiveCardRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
123
+ /**
124
+ * FrameworkAdapter hook called by ResponsivePlugin during attach().
125
+ * Parses the `<tbw-grid-responsive-card>` element and delegates to
126
+ * {@link createResponsiveCardRenderer}. Needed for parity with the Vue
127
+ * and Angular adapters so ResponsivePlugin's standard lookup path works
128
+ * for React users as well, not just via the imperative
129
+ * `refreshResponsiveCardRenderer` hook in DataGrid.
130
+ */
131
+ parseResponsiveCardElement<TRow = unknown>(cardElement: Element): ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
123
132
  /**
124
133
  * Creates a tool panel renderer from a light DOM element.
125
134
  * Renders React components into tool panel containers.
@@ -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,EAC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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/lib/use-grid.d.ts CHANGED
@@ -18,6 +18,13 @@ export interface UseGridReturn<TRow = unknown> {
18
18
  forceLayout: () => Promise<void>;
19
19
  /** Toggle a group row */
20
20
  toggleGroup: (key: string) => Promise<void>;
21
+ /** Get a plugin by its class */
22
+ getPlugin: <T>(pluginClass: new (...args: unknown[]) => T) => T | undefined;
23
+ /**
24
+ * Get a plugin by its registered name (preferred).
25
+ * Uses the type-safe PluginNameMap for auto-completion and return type narrowing.
26
+ */
27
+ getPluginByName: DataGridElement['getPluginByName'];
21
28
  /** Register custom styles */
22
29
  registerStyles: (id: string, css: string) => void;
23
30
  /** Unregister custom styles */
@@ -1 +1 @@
1
- {"version":3,"file":"use-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/use-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO;IAC3C,2EAA2E;IAC3E,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/C,qFAAqF;IACrF,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,iCAAiC;IACjC,MAAM,EAAE,UAAU,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,CAAC;IACjB,iCAAiC;IACjC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,sCAAsC;IACtC,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAClD,mCAAmC;IACnC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,yBAAyB;IACzB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,gCAAgC;IAChC,SAAS,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAC5E;;;OAGG;IACH,eAAe,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;IACpD,6BAA6B;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,+BAA+B;IAC/B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,iBAAiB,EAAE,MAAM,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,OAAO,CAAC,IAAI,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CA8J9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid-react",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "React adapter for @toolbox-web/grid data grid component",
5
5
  "type": "module",
6
6
  "main": "./index.js",