@toolbox-web/grid-react 1.9.0 → 1.10.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,69 +1,69 @@
1
- import { jsx as x, Fragment as U, jsxs as he } from "react/jsx-runtime";
2
- import { DataGridElement as ue } from "@toolbox-web/grid";
3
- import { Children as ve, isValidElement as we, createContext as ae, useContext as T, forwardRef as le, useRef as P, useReducer as Re, useImperativeHandle as fe, useLayoutEffect as de, Component as be, useMemo as F, useEffect as b, createElement as Pe, useCallback as D, useId as ge, useState as N } from "react";
4
- import { g as te, G as Ge, c as Se, d as xe } from "./chunks/react-grid-adapter-LBf2Mqhn.js";
5
- import { e as hr, f as vr } from "./chunks/react-grid-adapter-LBf2Mqhn.js";
6
- import { s as ne, r as pe, a as me } from "./chunks/portal-bridge-CvxNt40O.js";
7
- import { flushSync as oe, createPortal as Ee } from "react-dom";
8
- import { n as De } from "./chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
9
- import { r as Rr } from "./chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
10
- import { p as Fe } from "./chunks/react-column-config-BOe_PgL1.js";
11
- import { r as Pr } from "./chunks/react-column-config-BOe_PgL1.js";
12
- import { createPluginsFromFeatures as Te } from "@toolbox-web/grid/features/registry";
13
- import { G as O } from "./chunks/grid-element-context-BU3WvNtM.js";
14
- import { G as Sr } from "./chunks/grid-detail-panel-BZFcujsZ.js";
15
- import { G as Er } from "./chunks/grid-responsive-card-CSZhDCoN.js";
16
- const q = /* @__PURE__ */ new Map();
17
- function Ce(t, r) {
18
- q.set(t, r);
1
+ import { jsx as E, Fragment as W, jsxs as ve } from "react/jsx-runtime";
2
+ import { DataGridElement as ae } from "@toolbox-web/grid";
3
+ import { Children as we, isValidElement as Re, createContext as le, useContext as k, forwardRef as fe, useRef as G, useReducer as be, useImperativeHandle as de, useLayoutEffect as ge, Component as Pe, useMemo as T, useEffect as P, createElement as Ge, useCallback as F, useId as pe, useState as O } from "react";
4
+ import { g as ne, G as Se, c as xe, d as Ee } from "./chunks/react-grid-adapter-LBf2Mqhn.js";
5
+ import { e as vr, f as wr } from "./chunks/react-grid-adapter-LBf2Mqhn.js";
6
+ import { s as oe, r as me, a as Ce } from "./chunks/portal-bridge-CvxNt40O.js";
7
+ import { flushSync as ie, createPortal as De } from "react-dom";
8
+ import { n as Fe } from "./chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
9
+ import { r as br } from "./chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
10
+ import { p as Te } from "./chunks/react-column-config-BOe_PgL1.js";
11
+ import { r as Gr } from "./chunks/react-column-config-BOe_PgL1.js";
12
+ import { createPluginsFromFeatures as ke } from "@toolbox-web/grid/features/registry";
13
+ import { G as H } from "./chunks/grid-element-context-BU3WvNtM.js";
14
+ import { G as xr } from "./chunks/grid-detail-panel-BZFcujsZ.js";
15
+ import { G as Dr } from "./chunks/grid-responsive-card-CSZhDCoN.js";
16
+ const V = /* @__PURE__ */ new Map();
17
+ function ye(t, r) {
18
+ V.set(t, r);
19
19
  }
20
- function ke(t) {
20
+ function Ie(t) {
21
21
  const r = {};
22
- return q.size === 0 || ve.forEach(t, (d) => {
23
- if (!we(d)) return;
22
+ return V.size === 0 || we.forEach(t, (d) => {
23
+ if (!Re(d)) return;
24
24
  const n = d.type, s = typeof n == "string" ? void 0 : n?.displayName;
25
25
  if (typeof s != "string") return;
26
- const g = q.get(s);
26
+ const g = V.get(s);
27
27
  if (!g) return;
28
28
  const l = g(d);
29
29
  l && Object.assign(r, l);
30
30
  }), r;
31
31
  }
32
- function Ie(t) {
32
+ function Le(t) {
33
33
  return t.charAt(0).toUpperCase() + t.slice(1);
34
34
  }
35
- function ie(t) {
36
- return t.toLowerCase() === "id" ? "ID" : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Ie).join(" ");
35
+ function se(t) {
36
+ return t.toLowerCase() === "id" ? "ID" : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Le).join(" ");
37
37
  }
38
- const Le = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
39
- function Ae(t) {
38
+ const Ae = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
39
+ function Me(t) {
40
40
  const r = t.lastIndexOf(":");
41
41
  if (r > 0) {
42
42
  const d = t.slice(r + 1).toLowerCase();
43
- if (Le.has(d)) {
43
+ if (Ae.has(d)) {
44
44
  const n = t.slice(0, r);
45
45
  return {
46
46
  field: n,
47
- header: ie(n),
47
+ header: se(n),
48
48
  type: d
49
49
  };
50
50
  }
51
51
  }
52
52
  return {
53
53
  field: t,
54
- header: ie(t)
54
+ header: se(t)
55
55
  };
56
56
  }
57
- function Me(t) {
58
- return t.map((r) => typeof r == "string" ? Ae(r) : r);
57
+ function Ne(t) {
58
+ return t.map((r) => typeof r == "string" ? Me(r) : r);
59
59
  }
60
- function Ne(t, r) {
60
+ function Oe(t, r) {
61
61
  return r ? t.map((d) => ({ ...r, ...d })) : t;
62
62
  }
63
- function or(t) {
63
+ function ir(t) {
64
64
  return t.some((r) => typeof r == "string");
65
65
  }
66
- const K = {
66
+ const _ = {
67
67
  onCellClick: "cell-click",
68
68
  onRowClick: "row-click",
69
69
  onCellActivate: "cell-activate",
@@ -106,19 +106,19 @@ const K = {
106
106
  onPrintComplete: "print-complete",
107
107
  onTbwScroll: "tbw-scroll",
108
108
  onRender: "render"
109
- }, W = ae(null), Oe = ({ icons: t, children: r }) => /* @__PURE__ */ x(W.Provider, { value: t, children: r });
110
- function ir() {
111
- return T(W);
112
- }
113
- const He = W, H = ae(null), $e = ({ defaults: t, children: r }) => /* @__PURE__ */ x(H.Provider, { value: t, children: r });
109
+ }, J = le(null), He = ({ icons: t, children: r }) => /* @__PURE__ */ E(J.Provider, { value: t, children: r });
114
110
  function sr() {
115
- return T(H);
111
+ return k(J);
116
112
  }
117
- function cr(t) {
118
- return T(H)?.[t];
113
+ const $e = J, $ = le(null), je = ({ defaults: t, children: r }) => /* @__PURE__ */ E($.Provider, { value: t, children: r });
114
+ function cr() {
115
+ return k($);
119
116
  }
120
- const je = H;
121
- class Be extends be {
117
+ function ur(t) {
118
+ return k($)?.[t];
119
+ }
120
+ const Be = $;
121
+ class ze extends Pe {
122
122
  state = { failed: !1 };
123
123
  static getDerivedStateFromError() {
124
124
  return { failed: !0 };
@@ -130,85 +130,85 @@ class Be extends be {
130
130
  return this.state.failed ? null : this.props.children;
131
131
  }
132
132
  }
133
- const ze = le(function(r, d) {
134
- const n = P(/* @__PURE__ */ new Map()), [, s] = Re((C) => C + 1, 0), g = P(!1), l = P(0), u = P(0), v = P(!1), f = P(!1), w = () => {
133
+ const Ke = fe(function(r, d) {
134
+ const n = G(/* @__PURE__ */ new Map()), [, s] = be((m) => m + 1, 0), g = G(!1), l = G(0), a = G(0), w = G(!1), f = G(!1), h = () => {
135
135
  g.current || (g.current = !0, queueMicrotask(() => {
136
- g.current = !1, !f.current && (oe(s), R());
136
+ g.current = !1, !f.current && (ie(s), b());
137
137
  }));
138
- }, R = () => {
138
+ }, b = () => {
139
139
  l.current || (l.current = requestAnimationFrame(() => {
140
140
  l.current = 0, !f.current && s();
141
141
  }));
142
- }, y = (C, o) => {
143
- console.error(`[grid-react] Portal "${C}" crashed; dropping.`, o), n.current.delete(C), R();
142
+ }, C = (m, i) => {
143
+ console.error(`[grid-react] Portal "${m}" crashed; dropping.`, i), n.current.delete(m), b();
144
144
  };
145
- fe(
145
+ de(
146
146
  d,
147
147
  () => ({
148
- renderPortal(C, o, m) {
149
- f.current || (n.current.set(C, { container: o, element: m }), w());
148
+ renderPortal(m, i, p) {
149
+ f.current || (n.current.set(m, { container: i, element: p }), h());
150
150
  },
151
- removePortal(C, o) {
151
+ removePortal(m, i) {
152
152
  if (f.current) {
153
- n.current.delete(C);
153
+ n.current.delete(m);
154
154
  return;
155
155
  }
156
- n.current.delete(C) && (u.current > 0 ? v.current = !0 : o ? oe(s) : w());
156
+ n.current.delete(m) && (a.current > 0 ? w.current = !0 : i ? ie(s) : h());
157
157
  },
158
158
  beginBatch() {
159
- u.current++;
159
+ a.current++;
160
160
  },
161
161
  endBatch() {
162
- u.current !== 0 && (u.current--, u.current === 0 && v.current && (v.current = !1, s()));
162
+ a.current !== 0 && (a.current--, a.current === 0 && w.current && (w.current = !1, s()));
163
163
  },
164
164
  clear() {
165
165
  if (f.current) {
166
166
  n.current.clear();
167
167
  return;
168
168
  }
169
- n.current.size > 0 && (n.current.clear(), l.current && (cancelAnimationFrame(l.current), l.current = 0), w());
169
+ n.current.size > 0 && (n.current.clear(), l.current && (cancelAnimationFrame(l.current), l.current = 0), h());
170
170
  }
171
171
  }),
172
172
  // forceRender is stable (useReducer dispatch), refs are stable
173
173
  // eslint-disable-next-line react-hooks/exhaustive-deps
174
174
  []
175
- ), de(() => {
175
+ ), ge(() => {
176
176
  f.current = !1;
177
- const C = n.current;
177
+ const m = n.current;
178
178
  return () => {
179
- f.current = !0, l.current && (cancelAnimationFrame(l.current), l.current = 0), C.clear();
179
+ f.current = !0, l.current && (cancelAnimationFrame(l.current), l.current = 0), m.clear();
180
180
  };
181
181
  }, []);
182
- const G = [];
182
+ const R = [];
183
183
  let S = null;
184
- for (const [C, { container: o, element: m }] of n.current) {
185
- if (!o.isConnected) {
186
- (S ??= []).push(C);
184
+ for (const [m, { container: i, element: p }] of n.current) {
185
+ if (!i.isConnected) {
186
+ (S ??= []).push(m);
187
187
  continue;
188
188
  }
189
- G.push(
190
- Ee(
191
- /* @__PURE__ */ x(Be, { portalKey: C, onError: y, children: m }),
192
- o,
193
- C
189
+ R.push(
190
+ De(
191
+ /* @__PURE__ */ E(ze, { portalKey: m, onError: C, children: p }),
192
+ i,
193
+ m
194
194
  )
195
195
  );
196
196
  }
197
197
  if (S) {
198
- const C = S;
198
+ const m = S;
199
199
  queueMicrotask(() => {
200
- for (const o of C) n.current.delete(o);
200
+ for (const i of m) n.current.delete(i);
201
201
  });
202
202
  }
203
- return /* @__PURE__ */ x(U, { children: G });
204
- }), Ke = {
203
+ return /* @__PURE__ */ E(W, { children: R });
204
+ }), _e = {
205
205
  undoRedo: ["editing"],
206
206
  clipboard: ["selection"]
207
207
  };
208
- function _e(t) {
208
+ function qe(t) {
209
209
  const r = new Set(t);
210
210
  for (const d of t) {
211
- const n = Ke[d];
211
+ const n = _e[d];
212
212
  if (n)
213
213
  for (const s of n)
214
214
  r.has(s) || console.warn(
@@ -216,24 +216,24 @@ function _e(t) {
216
216
  );
217
217
  }
218
218
  }
219
- function qe(t) {
219
+ function Ve(t) {
220
220
  const r = [];
221
221
  for (const [d, n] of Object.entries(t))
222
222
  n === void 0 || n === !1 || r.push(d);
223
- return _e(r), Te(t);
223
+ return qe(r), ke(t);
224
224
  }
225
- let se = !1, _ = null;
226
- function V() {
227
- return se || (_ = new Ge(), ue.registerAdapter(_), se = !0), _;
225
+ let ce = !1, q = null;
226
+ function U() {
227
+ return ce || (q = new Se(), ae.registerAdapter(q), ce = !0), q;
228
228
  }
229
- V();
230
- const ce = /* @__PURE__ */ new WeakMap();
231
- let Ve = 0;
232
- function Ue(t) {
233
- let r = ce.get(t);
234
- return r === void 0 && (r = ++Ve, ce.set(t, r)), r;
229
+ U();
230
+ const ue = /* @__PURE__ */ new WeakMap();
231
+ let Ue = 0;
232
+ function We(t) {
233
+ let r = ue.get(t);
234
+ return r === void 0 && (r = ++Ue, ue.set(t, r)), r;
235
235
  }
236
- Ce("GridDetailPanel", (t) => {
236
+ ye("GridDetailPanel", (t) => {
237
237
  const r = t.props;
238
238
  return {
239
239
  masterDetail: {
@@ -243,204 +243,207 @@ Ce("GridDetailPanel", (t) => {
243
243
  }
244
244
  };
245
245
  });
246
- Ce("GridResponsiveCard", () => ({
246
+ ye("GridResponsiveCard", () => ({
247
247
  // GridResponsiveCard only carries cardRowHeight; breakpoint is set via the
248
248
  // responsive prop. Enable the plugin with defaults — user can override.
249
249
  responsive: !0
250
250
  }));
251
- const ur = le(function(r, d) {
251
+ const ar = fe(function(r, d) {
252
252
  const {
253
253
  // Core props
254
254
  rows: n,
255
255
  gridConfig: s,
256
256
  columns: g,
257
257
  columnDefaults: l,
258
- fitMode: u,
259
- sortable: v,
260
- filterable: f,
261
- selectable: w,
262
- loading: R,
263
- customStyles: y,
264
- className: G,
265
- style: S,
266
- children: C,
258
+ fitMode: a,
259
+ columnInference: w,
260
+ sortable: f,
261
+ filterable: h,
262
+ selectable: b,
263
+ loading: C,
264
+ customStyles: R,
265
+ className: S,
266
+ style: m,
267
+ children: i,
267
268
  // Plugin props
268
- plugins: o,
269
+ plugins: p,
269
270
  // SSR mode (deprecated - see SSRProps)
270
- ssr: m,
271
+ ssr: v,
271
272
  // Legacy event handlers
272
- onRowsChange: h,
273
+ onRowsChange: x,
273
274
  // Feature props and event props are in ...rest
274
- ...p
275
- } = r, a = P(null), M = P(null), J = P(!1), Y = T(je), $ = T(He), ye = F(() => te().map((e) => {
276
- const i = p[e];
277
- if (i === void 0) return "";
278
- let c;
275
+ ...y
276
+ } = r, c = G(null), N = G(null), Y = G(!1), Z = k(Be), j = k($e), he = T(() => ne().map((e) => {
277
+ const o = y[e];
278
+ if (o === void 0) return "";
279
+ let u;
279
280
  try {
280
- c = JSON.stringify(i) ?? "undefined";
281
+ u = JSON.stringify(o) ?? "undefined";
281
282
  } catch {
282
- c = typeof i == "object" && i !== null ? `ref#${Ue(i)}` : `prim:${String(i)}`;
283
+ u = typeof o == "object" && o !== null ? `ref#${We(o)}` : `prim:${String(o)}`;
283
284
  }
284
- return `${e}:${c}`;
285
- }).filter(Boolean).join("|"), [p]), Z = F(() => {
286
- const e = {}, i = p;
287
- for (const c of te()) {
288
- const E = i[c];
289
- E !== void 0 && (e[c] = E);
285
+ return `${e}:${u}`;
286
+ }).filter(Boolean).join("|"), [y]), Q = T(() => {
287
+ const e = {}, o = y;
288
+ for (const u of ne()) {
289
+ const D = o[u];
290
+ D !== void 0 && (e[u] = D);
290
291
  }
291
292
  return e;
292
- }, [ye]), Q = F(() => ke(C), [C]), X = F(() => {
293
- const e = s?.features, i = {};
294
- for (const [c, E] of Object.entries(Q))
295
- e && c in e && e[c] !== void 0 && e[c] !== !1 || (i[c] = E);
296
- return { ...i, ...Z };
297
- }, [Z, Q, s]), j = F(() => o || m ? [] : qe(X), [X, o, m]), k = F(() => {
298
- if (o) {
299
- const e = new Set(o.map((c) => c.name)), i = j.filter((c) => !e.has(c.name));
300
- return [...o, ...i];
293
+ }, [he]), X = T(() => Ie(i), [i]), ee = T(() => {
294
+ const e = s?.features, o = {};
295
+ for (const [u, D] of Object.entries(X))
296
+ e && u in e && e[u] !== void 0 && e[u] !== !1 || (o[u] = D);
297
+ return { ...o, ...Q };
298
+ }, [Q, X, s]), B = T(() => p || v ? [] : Ve(ee), [ee, p, v]), I = T(() => {
299
+ if (p) {
300
+ const e = new Set(p.map((u) => u.name)), o = B.filter((u) => !e.has(u.name));
301
+ return [...p, ...o];
301
302
  }
302
- return j;
303
- }, [o, j]), I = F(() => g && Ne(Me(g), l), [g, l]), L = F(() => {
304
- const e = Fe(s), i = {};
305
- if (v !== void 0 && (i.sortable = v), f !== void 0 && (i.filterable = f), w !== void 0 && (i.selectable = w), $) {
306
- const c = e?.icons || s?.icons || {};
307
- i.icons = { ...$, ...c };
303
+ return B;
304
+ }, [p, B]), L = T(() => g && Oe(Ne(g), l), [g, l]), A = T(() => {
305
+ const e = Te(s), o = {};
306
+ if (f !== void 0 && (o.sortable = f), h !== void 0 && (o.filterable = h), b !== void 0 && (o.selectable = b), j) {
307
+ const u = e?.icons || s?.icons || {};
308
+ o.icons = { ...j, ...u };
308
309
  }
309
- if (k.length > 0 && e) {
310
- const c = e.plugins || [], E = new Set(c.map((A) => A.name)), z = k.filter((A) => !E.has(A.name));
310
+ if (I.length > 0 && e) {
311
+ const u = e.plugins || [], D = new Set(u.map((M) => M.name)), K = I.filter((M) => !D.has(M.name));
311
312
  return {
312
313
  ...e,
313
- ...i,
314
- plugins: [...c, ...z]
314
+ ...o,
315
+ plugins: [...u, ...K]
315
316
  };
316
317
  }
317
- return k.length > 0 && !e ? { ...i, plugins: k } : Object.keys(i).length > 0 ? { ...e, ...i } : e;
318
- }, [s, k, v, f, w, $]);
319
- b(() => {
320
- V().setTypeDefaults(Y);
321
- }, [Y]), b(() => {
322
- a.current && (a.current.rows = n);
323
- }, [n]), b(() => {
324
- a.current && L && (a.current.gridConfig = L);
325
- }, [L]), b(() => {
326
- a.current && I && (a.current.columns = I);
327
- }, [I]), b(() => {
328
- a.current && u !== void 0 && (a.current.fitMode = u);
329
- }, [u]), b(() => {
330
- a.current && R !== void 0 && (a.current.loading = R);
331
- }, [R]), b(() => {
332
- const e = a.current;
318
+ return I.length > 0 && !e ? { ...o, plugins: I } : Object.keys(o).length > 0 ? { ...e, ...o } : e;
319
+ }, [s, I, f, h, b, j]);
320
+ P(() => {
321
+ U().setTypeDefaults(Z);
322
+ }, [Z]), P(() => {
323
+ c.current && (c.current.rows = n);
324
+ }, [n]), P(() => {
325
+ c.current && A && (c.current.gridConfig = A);
326
+ }, [A]), P(() => {
327
+ c.current && L && (c.current.columns = L);
328
+ }, [L]), P(() => {
329
+ c.current && a !== void 0 && (c.current.fitMode = a);
330
+ }, [a]), P(() => {
331
+ c.current && (c.current.columnInference = w);
332
+ }, [w]), P(() => {
333
+ c.current && C !== void 0 && (c.current.loading = C);
334
+ }, [C]), P(() => {
335
+ const e = c.current;
333
336
  if (!e) return;
334
- const i = V();
335
- e.__frameworkAdapter = i, De(e);
336
- let c = !1;
337
- const E = requestAnimationFrame(() => {
338
- c || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
337
+ const o = U();
338
+ e.__frameworkAdapter = o, Fe(e);
339
+ let u = !1;
340
+ const D = requestAnimationFrame(() => {
341
+ u || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
339
342
  });
340
343
  return () => {
341
- c = !0, cancelAnimationFrame(E);
344
+ u = !0, cancelAnimationFrame(D);
342
345
  };
343
- }, []), b(() => {
344
- if (!a.current || !y) return;
345
- const e = a.current, i = "react-custom-styles";
346
- let c = !0;
346
+ }, []), P(() => {
347
+ if (!c.current || !R) return;
348
+ const e = c.current, o = "react-custom-styles";
349
+ let u = !0;
347
350
  return e.ready?.().then(() => {
348
- c && y && (e.registerStyles?.(i, y), M.current = i);
351
+ u && R && (e.registerStyles?.(o, R), N.current = o);
349
352
  }), () => {
350
- c = !1, M.current && (e.unregisterStyles?.(M.current), M.current = null);
353
+ u = !1, N.current && (e.unregisterStyles?.(N.current), N.current = null);
351
354
  };
352
- }, [y]), b(() => {
353
- const e = a.current;
355
+ }, [R]), P(() => {
356
+ const e = c.current;
354
357
  if (!e) return;
355
- const i = [];
356
- return h && i.push(e.on("rows-change", (c) => h(c.rows))), () => {
357
- i.forEach((c) => c());
358
+ const o = [];
359
+ return x && o.push(e.on("rows-change", (u) => x(u.rows))), () => {
360
+ o.forEach((u) => u());
358
361
  };
359
- }, [h]);
360
- const ee = F(() => Object.keys(K).filter((e) => typeof p[e] == "function").sort().join("|"), [p]), re = P({});
361
- for (const e of Object.keys(K))
362
- re.current[e] = p[e];
363
- b(() => {
364
- const e = a.current;
362
+ }, [x]);
363
+ const re = T(() => Object.keys(_).filter((e) => typeof y[e] == "function").sort().join("|"), [y]), te = G({});
364
+ for (const e of Object.keys(_))
365
+ te.current[e] = y[e];
366
+ P(() => {
367
+ const e = c.current;
365
368
  if (!e) return;
366
- const i = [];
367
- for (const [c, E] of Object.entries(K))
368
- ee.includes(c) && i.push(
369
- e.on(E, (z, A) => {
370
- re.current[c]?.(z, A);
369
+ const o = [];
370
+ for (const [u, D] of Object.entries(_))
371
+ re.includes(u) && o.push(
372
+ e.on(D, (K, M) => {
373
+ te.current[u]?.(K, M);
371
374
  })
372
375
  );
373
376
  return () => {
374
- i.forEach((c) => c());
377
+ o.forEach((u) => u());
375
378
  };
376
- }, [ee]), fe(
379
+ }, [re]), de(
377
380
  d,
378
381
  () => ({
379
382
  get element() {
380
- return a.current;
383
+ return c.current;
381
384
  },
382
385
  async getConfig() {
383
- return a.current?.getConfig?.() ?? {};
386
+ return c.current?.getConfig?.() ?? {};
384
387
  },
385
388
  async ready() {
386
- return a.current?.ready?.();
389
+ return c.current?.ready?.();
387
390
  },
388
391
  async forceLayout() {
389
- return a.current?.forceLayout?.();
392
+ return c.current?.forceLayout?.();
390
393
  },
391
394
  async toggleGroup(e) {
392
- return a.current?.toggleGroup?.(e);
395
+ return c.current?.toggleGroup?.(e);
393
396
  },
394
- registerStyles(e, i) {
395
- a.current?.registerStyles?.(e, i);
397
+ registerStyles(e, o) {
398
+ c.current?.registerStyles?.(e, o);
396
399
  },
397
400
  unregisterStyles(e) {
398
- a.current?.unregisterStyles?.(e);
401
+ c.current?.unregisterStyles?.(e);
399
402
  },
400
- setRowLoading(e, i) {
401
- a.current?.setRowLoading?.(e, i);
403
+ setRowLoading(e, o) {
404
+ c.current?.setRowLoading?.(e, o);
402
405
  },
403
- setCellLoading(e, i, c) {
404
- a.current?.setCellLoading?.(e, i, c);
406
+ setCellLoading(e, o, u) {
407
+ c.current?.setCellLoading?.(e, o, u);
405
408
  },
406
409
  isRowLoading(e) {
407
- return a.current?.isRowLoading?.(e) ?? !1;
410
+ return c.current?.isRowLoading?.(e) ?? !1;
408
411
  },
409
- isCellLoading(e, i) {
410
- return a.current?.isCellLoading?.(e, i) ?? !1;
412
+ isCellLoading(e, o) {
413
+ return c.current?.isCellLoading?.(e, o) ?? !1;
411
414
  },
412
415
  clearAllLoading() {
413
- a.current?.clearAllLoading?.();
416
+ c.current?.clearAllLoading?.();
414
417
  }
415
418
  }),
416
419
  []
417
420
  );
418
- const B = P(null);
419
- return de(() => {
420
- const e = a.current;
421
- return e && B.current && ne(e, B.current), () => {
422
- e && ne(e, null);
421
+ const z = G(null);
422
+ return ge(() => {
423
+ const e = c.current;
424
+ return e && z.current && oe(e, z.current), () => {
425
+ e && oe(e, null);
423
426
  };
424
- }, []), /* @__PURE__ */ he(U, { children: [
425
- /* @__PURE__ */ x(ze, { ref: B }),
426
- Pe(
427
- ue.activeTag,
427
+ }, []), /* @__PURE__ */ ve(W, { children: [
428
+ /* @__PURE__ */ E(Ke, { ref: z }),
429
+ Ge(
430
+ ae.activeTag,
428
431
  {
429
432
  ref: (e) => {
430
- if (a.current = e, e && !J.current) {
431
- J.current = !0;
432
- const i = e;
433
- L && (i.gridConfig = L), n && (i.rows = n), I && (i.columns = I);
433
+ if (c.current = e, e && !Y.current) {
434
+ Y.current = !0;
435
+ const o = e;
436
+ A && (o.gridConfig = A), n && (o.rows = n), L && (o.columns = L);
434
437
  }
435
438
  },
436
- class: G,
437
- style: S
439
+ class: S,
440
+ style: m
438
441
  },
439
- /* @__PURE__ */ x(O.Provider, { value: a, children: C })
442
+ /* @__PURE__ */ E(H.Provider, { value: c, children: i })
440
443
  )
441
444
  ] });
442
445
  });
443
- function ar(t) {
446
+ function lr(t) {
444
447
  const {
445
448
  field: r,
446
449
  header: d,
@@ -448,196 +451,197 @@ function ar(t) {
448
451
  editable: s,
449
452
  sortable: g,
450
453
  resizable: l,
451
- width: u,
452
- minWidth: v,
453
- hidden: f,
454
- lockVisible: w,
455
- children: R,
456
- editor: y,
457
- options: G,
458
- multi: S,
459
- format: C
460
- } = t, o = P(null), m = D(
461
- (a) => {
462
- o.current = a, a && (R && Se(a, R), y && xe(a, y));
454
+ width: a,
455
+ minWidth: w,
456
+ order: f,
457
+ hidden: h,
458
+ lockVisible: b,
459
+ children: C,
460
+ editor: R,
461
+ options: S,
462
+ multi: m,
463
+ format: i
464
+ } = t, p = G(null), v = F(
465
+ (c) => {
466
+ p.current = c, c && (C && xe(c, C), R && Ee(c, R));
463
467
  },
464
- [R, y]
465
- ), h = typeof u == "number" ? `${u}px` : u, p = {
468
+ [C, R]
469
+ ), x = typeof a == "number" ? `${a}px` : a, y = {
466
470
  field: r,
467
- ref: m
471
+ ref: v
468
472
  };
469
- return d !== void 0 && (p.header = d), n !== void 0 && (p.type = n), s !== void 0 && (p.editable = s), g !== void 0 && (p.sortable = g), l !== void 0 && (p.resizable = l), h !== void 0 && (p.width = h), v !== void 0 && (p["min-width"] = v), f !== void 0 && (p.hidden = f), w !== void 0 && (p["lock-visible"] = w), S !== void 0 && (p.multi = S), C && (p["data-has-format"] = "true"), G && (p["data-has-options"] = "true"), /* @__PURE__ */ x("tbw-grid-column", { ...p });
473
+ return d !== void 0 && (y.header = d), n !== void 0 && (y.type = n), s !== void 0 && (y.editable = s), g !== void 0 && (y.sortable = g), l !== void 0 && (y.resizable = l), x !== void 0 && (y.width = x), w !== void 0 && (y["min-width"] = w), f !== void 0 && (y.order = f), h !== void 0 && (y.hidden = h), b !== void 0 && (y["lock-visible"] = b), m !== void 0 && (y.multi = m), i && (y["data-has-format"] = "true"), S && (y["data-has-options"] = "true"), /* @__PURE__ */ E("tbw-grid-column", { ...y });
470
474
  }
471
- function lr({ id: t, order: r = 100, children: d }) {
472
- const n = ge(), s = t ?? `tbw-header-content-${n}`, g = T(O), [l, u] = N(null), v = P(null);
473
- return b(() => {
475
+ function fr({ id: t, order: r = 100, children: d }) {
476
+ const n = pe(), s = t ?? `tbw-header-content-${n}`, g = k(H), [l, a] = O(null), w = G(null);
477
+ return P(() => {
474
478
  const f = g?.current;
475
479
  if (!f) return;
476
- const w = v;
477
- let R = !1;
480
+ const h = w;
481
+ let b = !1;
478
482
  return (async () => {
479
483
  try {
480
484
  await f.ready?.();
481
485
  } catch {
482
486
  return;
483
487
  }
484
- if (R) return;
485
- const y = {
488
+ if (b) return;
489
+ const C = {
486
490
  id: s,
487
491
  order: r,
488
- render: (S) => (u(S), () => {
492
+ render: (S) => (a(S), () => {
489
493
  })
490
- }, G = f.getPluginByName?.("shell");
491
- G?.registerHeaderContent ? G.registerHeaderContent(y) : f.registerHeaderContent?.(y);
494
+ }, R = f.getPluginByName?.("shell");
495
+ R?.registerHeaderContent ? R.registerHeaderContent(C) : f.registerHeaderContent?.(C);
492
496
  })(), () => {
493
- R = !0;
494
- const y = f.getPluginByName?.("shell");
495
- y?.unregisterHeaderContent ? y.unregisterHeaderContent(s) : f.unregisterHeaderContent?.(s), w.current && (pe(w.current, { sync: !0 }), w.current = null), u(null);
497
+ b = !0;
498
+ const C = f.getPluginByName?.("shell");
499
+ C?.unregisterHeaderContent ? C.unregisterHeaderContent(s) : f.unregisterHeaderContent?.(s), h.current && (me(h.current, { sync: !0 }), h.current = null), a(null);
496
500
  };
497
- }, [g, s, r]), b(() => {
501
+ }, [g, s, r]), P(() => {
498
502
  if (!l) return;
499
503
  const f = g?.current ?? void 0;
500
- v.current = me(l, d, v.current ?? void 0, f);
504
+ w.current = Ce(l, d, w.current ?? void 0, f);
501
505
  }, [d, l, g]), null;
502
506
  }
503
- function fr({ children: t }) {
504
- return /* @__PURE__ */ x("tbw-grid-tool-buttons", { children: t });
507
+ function dr({ children: t }) {
508
+ return /* @__PURE__ */ E("tbw-grid-tool-buttons", { children: t });
505
509
  }
506
- function dr({ id: t, order: r = 100, children: d }) {
507
- const n = ge(), s = t ?? `tbw-toolbar-content-${n}`, g = T(O), [l, u] = N(null), v = P(null);
508
- return b(() => {
510
+ function gr({ id: t, order: r = 100, children: d }) {
511
+ const n = pe(), s = t ?? `tbw-toolbar-content-${n}`, g = k(H), [l, a] = O(null), w = G(null);
512
+ return P(() => {
509
513
  const f = g?.current;
510
514
  if (!f) return;
511
- const w = v;
512
- let R = !1;
515
+ const h = w;
516
+ let b = !1;
513
517
  return (async () => {
514
518
  try {
515
519
  await f.ready?.();
516
520
  } catch {
517
521
  return;
518
522
  }
519
- if (R) return;
520
- const y = {
523
+ if (b) return;
524
+ const C = {
521
525
  id: s,
522
526
  order: r,
523
- render: (S) => (u(S), () => {
527
+ render: (S) => (a(S), () => {
524
528
  })
525
- }, G = f.getPluginByName?.("shell");
526
- G?.registerToolbarContent ? G.registerToolbarContent(y) : f.registerToolbarContent?.(y);
529
+ }, R = f.getPluginByName?.("shell");
530
+ R?.registerToolbarContent ? R.registerToolbarContent(C) : f.registerToolbarContent?.(C);
527
531
  })(), () => {
528
- R = !0;
529
- const y = f.getPluginByName?.("shell");
530
- y?.unregisterToolbarContent ? y.unregisterToolbarContent(s) : f.unregisterToolbarContent?.(s), w.current && (pe(w.current, { sync: !0 }), w.current = null), u(null);
532
+ b = !0;
533
+ const C = f.getPluginByName?.("shell");
534
+ C?.unregisterToolbarContent ? C.unregisterToolbarContent(s) : f.unregisterToolbarContent?.(s), h.current && (me(h.current, { sync: !0 }), h.current = null), a(null);
531
535
  };
532
- }, [g, s, r]), b(() => {
536
+ }, [g, s, r]), P(() => {
533
537
  if (!l) return;
534
538
  const f = g?.current ?? void 0;
535
- v.current = me(l, d, v.current ?? void 0, f);
539
+ w.current = Ce(l, d, w.current ?? void 0, f);
536
540
  }, [d, l, g]), null;
537
541
  }
538
- const gr = ({ icons: t, defaults: r, children: d }) => {
542
+ const pr = ({ icons: t, defaults: r, children: d }) => {
539
543
  let n = d;
540
- return r && (n = /* @__PURE__ */ x($e, { defaults: r, children: n })), t && (n = /* @__PURE__ */ x(Oe, { icons: t, children: n })), /* @__PURE__ */ x(U, { children: n });
544
+ return r && (n = /* @__PURE__ */ E(je, { defaults: r, children: n })), t && (n = /* @__PURE__ */ E(He, { icons: t, children: n })), /* @__PURE__ */ E(W, { children: n });
541
545
  };
542
- function pr(t) {
543
- const r = P(null), [d, n] = N(!1), [s, g] = N(null), l = P(null), u = D(() => t ? (l.current ??= document.querySelector(t), l.current) : r.current?.element ?? null, [t]);
544
- b(() => {
545
- let o = !0;
546
+ function mr(t) {
547
+ const r = G(null), [d, n] = O(!1), [s, g] = O(null), l = G(null), a = F(() => t ? (l.current ??= document.querySelector(t), l.current) : r.current?.element ?? null, [t]);
548
+ P(() => {
549
+ let i = !0;
546
550
  return (async () => {
547
551
  try {
548
552
  if (t) {
549
- const h = document.querySelector(t);
550
- if (!h) return;
551
- if (l.current = h, await h.ready?.(), o) {
553
+ const v = document.querySelector(t);
554
+ if (!v) return;
555
+ if (l.current = v, await v.ready?.(), i) {
552
556
  n(!0);
553
- const p = await h.getConfig?.();
554
- o && p && g(p);
557
+ const x = await v.getConfig?.();
558
+ i && x && g(x);
555
559
  }
556
560
  } else {
557
- const h = r.current;
558
- if (!h) return;
559
- if (await h.ready?.(), o) {
561
+ const v = r.current;
562
+ if (!v) return;
563
+ if (await v.ready?.(), i) {
560
564
  n(!0);
561
- const p = await h.getConfig?.();
562
- o && p && g(p);
565
+ const x = await v.getConfig?.();
566
+ i && x && g(x);
563
567
  }
564
568
  }
565
569
  } catch {
566
570
  }
567
571
  })(), () => {
568
- o = !1;
572
+ i = !1;
569
573
  };
570
574
  }, [t]);
571
- const v = D(async () => {
572
- const o = u();
573
- if (o)
574
- return await o.getConfig?.() ?? null;
575
- const m = r.current;
576
- return m ? await m.getConfig?.() ?? null : null;
577
- }, [u]), f = D(async () => {
578
- const o = u();
579
- if (o) {
580
- await o.forceLayout?.();
575
+ const w = F(async () => {
576
+ const i = a();
577
+ if (i)
578
+ return await i.getConfig?.() ?? null;
579
+ const p = r.current;
580
+ return p ? await p.getConfig?.() ?? null : null;
581
+ }, [a]), f = F(async () => {
582
+ const i = a();
583
+ if (i) {
584
+ await i.forceLayout?.();
581
585
  return;
582
586
  }
583
- const m = r.current;
584
- m && await m.forceLayout?.();
585
- }, [u]), w = D(
586
- async (o) => {
587
- const m = u();
588
- if (m) {
589
- await m.toggleGroup?.(o);
587
+ const p = r.current;
588
+ p && await p.forceLayout?.();
589
+ }, [a]), h = F(
590
+ async (i) => {
591
+ const p = a();
592
+ if (p) {
593
+ await p.toggleGroup?.(i);
590
594
  return;
591
595
  }
592
- const h = r.current;
593
- h && await h.toggleGroup?.(o);
596
+ const v = r.current;
597
+ v && await v.toggleGroup?.(i);
594
598
  },
595
- [u]
596
- ), R = D(
597
- (o) => u()?.getPlugin?.(o),
598
- [u]
599
- ), y = D(
600
- ((o) => u()?.getPluginByName?.(o)),
601
- [u]
602
- ), G = D(
603
- (o, m) => {
604
- const h = u();
605
- if (h) {
606
- h.registerStyles?.(o, m);
599
+ [a]
600
+ ), b = F(
601
+ (i) => a()?.getPlugin?.(i),
602
+ [a]
603
+ ), C = F(
604
+ ((i) => a()?.getPluginByName?.(i)),
605
+ [a]
606
+ ), R = F(
607
+ (i, p) => {
608
+ const v = a();
609
+ if (v) {
610
+ v.registerStyles?.(i, p);
607
611
  return;
608
612
  }
609
- r.current?.registerStyles?.(o, m);
613
+ r.current?.registerStyles?.(i, p);
610
614
  },
611
- [u]
612
- ), S = D(
613
- (o) => {
614
- const m = u();
615
- if (m) {
616
- m.unregisterStyles?.(o);
615
+ [a]
616
+ ), S = F(
617
+ (i) => {
618
+ const p = a();
619
+ if (p) {
620
+ p.unregisterStyles?.(i);
617
621
  return;
618
622
  }
619
- r.current?.unregisterStyles?.(o);
623
+ r.current?.unregisterStyles?.(i);
620
624
  },
621
- [u]
622
- ), C = D(() => s?.columns ? s.columns.filter((o) => !o.hidden) : [], [s]);
625
+ [a]
626
+ ), m = F(() => s?.columns ? s.columns.filter((i) => !i.hidden) : [], [s]);
623
627
  return {
624
628
  ref: r,
625
- element: u(),
629
+ element: a(),
626
630
  isReady: d,
627
631
  config: s,
628
- getConfig: v,
632
+ getConfig: w,
629
633
  forceLayout: f,
630
- toggleGroup: w,
631
- getPlugin: R,
632
- getPluginByName: y,
633
- registerStyles: G,
634
+ toggleGroup: h,
635
+ getPlugin: b,
636
+ getPluginByName: C,
637
+ registerStyles: R,
634
638
  unregisterStyles: S,
635
- getVisibleColumns: C
639
+ getVisibleColumns: m
636
640
  };
637
641
  }
638
- function mr(t, r = {}) {
639
- const { open: d = !0, gridElement: n } = r, s = T(O);
640
- b(() => {
642
+ function Cr(t, r = {}) {
643
+ const { open: d = !0, gridElement: n } = r, s = k(H);
644
+ P(() => {
641
645
  if (!d) return;
642
646
  const g = t.current;
643
647
  if (!g) return;
@@ -649,29 +653,29 @@ function mr(t, r = {}) {
649
653
  }, [d, n, s, t]);
650
654
  }
651
655
  export {
652
- ur as DataGrid,
653
- Ge as GridAdapter,
654
- ar as GridColumn,
655
- Sr as GridDetailPanel,
656
- lr as GridHeaderContent,
657
- Oe as GridIconProvider,
658
- gr as GridProvider,
659
- Er as GridResponsiveCard,
660
- fr as GridToolButtons,
661
- hr as GridToolPanel,
662
- dr as GridToolbarContent,
663
- $e as GridTypeProvider,
664
- Ne as applyColumnDefaults,
665
- or as hasColumnShorthands,
666
- Me as normalizeColumns,
667
- Ae as parseColumnShorthand,
668
- Ce as registerChildFeatureDetector,
669
- Pr as registerEditorMountHook,
670
- vr as registerFeaturePropKey,
671
- Rr as registerPostMountRefresh,
672
- pr as useGrid,
673
- ir as useGridIcons,
674
- mr as useGridOverlay,
675
- sr as useGridTypeDefaults,
676
- cr as useTypeDefault
656
+ ar as DataGrid,
657
+ Se as GridAdapter,
658
+ lr as GridColumn,
659
+ xr as GridDetailPanel,
660
+ fr as GridHeaderContent,
661
+ He as GridIconProvider,
662
+ pr as GridProvider,
663
+ Dr as GridResponsiveCard,
664
+ dr as GridToolButtons,
665
+ vr as GridToolPanel,
666
+ gr as GridToolbarContent,
667
+ je as GridTypeProvider,
668
+ Oe as applyColumnDefaults,
669
+ ir as hasColumnShorthands,
670
+ Ne as normalizeColumns,
671
+ Me as parseColumnShorthand,
672
+ ye as registerChildFeatureDetector,
673
+ Gr as registerEditorMountHook,
674
+ wr as registerFeaturePropKey,
675
+ br as registerPostMountRefresh,
676
+ mr as useGrid,
677
+ sr as useGridIcons,
678
+ Cr as useGridOverlay,
679
+ cr as useGridTypeDefaults,
680
+ ur as useTypeDefault
677
681
  };
@@ -1,4 +1,4 @@
1
- import { BaseGridPlugin, DataGridElement } from '@toolbox-web/grid';
1
+ import { BaseGridPlugin, ColumnInferenceMode, DataGridElement } from '@toolbox-web/grid';
2
2
  import { ReactNode } from 'react';
3
3
  import { ColumnShorthand } from './column-shorthand';
4
4
  import { EventProps } from './event-props';
@@ -70,6 +70,13 @@ export interface DataGridProps<TRow = unknown> extends AllFeatureProps<TRow>, Ev
70
70
  columnDefaults?: Partial<ColumnConfig<TRow>>;
71
71
  /** Fit mode for column sizing */
72
72
  fitMode?: 'stretch' | 'fit-columns' | 'auto-fit';
73
+ /**
74
+ * How automatic column inference combines with explicitly provided columns.
75
+ *
76
+ * - `'auto'` (default): infer only when no columns are provided.
77
+ * - `'merge'`: always infer from data, then overlay provided columns by `field`.
78
+ */
79
+ columnInference?: ColumnInferenceMode;
73
80
  /**
74
81
  * Grid-wide sorting toggle.
75
82
  * When false, disables sorting for all columns regardless of their individual `sortable` setting.
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AAErB,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,iBAAiB,CAAC;AAO1E,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAwE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAC5F,0BAA0B;IAC1B,IAAI,EAAE,IAAI,EAAE,CAAC;IACb;;;;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,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,4CAA4C;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,yCAAyC;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,0CAA0C;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,uDAAuD;IACvD,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,eAAO,MAAM,QAAQ,EAsef,CAAC,IAAI,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,CAAC"}
@@ -20,6 +20,8 @@ export interface GridColumnProps<TRow = unknown, TValue = unknown> {
20
20
  width?: string | number;
21
21
  /** Minimum width for stretch mode */
22
22
  minWidth?: number;
23
+ /** Initial column display index */
24
+ order?: number;
23
25
  /** Whether the column is hidden */
24
26
  hidden?: boolean;
25
27
  /** Prevent column from being hidden */
@@ -1 +1 @@
1
- {"version":3,"file":"grid-column.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/grid-column.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,aAAa,CAAC;AAGrB;;GAEG;AACH,MAA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C,GAAG,EAAE,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,SAAS,CAAC;IAC/D;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,SAAS,CAAC;IAC/D,+BAA+B;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACnD,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK,MAAM,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CA2ErH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid-react",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "React adapter for @toolbox-web/grid data grid component",
5
5
  "type": "module",
6
6
  "main": "./index.js",