@toolbox-web/grid-react 1.10.0 → 2.0.0-beta.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.
package/README.md CHANGED
@@ -683,7 +683,6 @@ import type {
683
683
  DataGridProps,
684
684
  // Feature props
685
685
  FeatureProps,
686
- SSRProps,
687
686
  // Type-level defaults (TypeDefault is primary)
688
687
  TypeDefault,
689
688
  TypeDefaultsMap,
@@ -705,7 +704,6 @@ import type {
705
704
  | `gridConfig` | `GridConfig` | Full configuration object |
706
705
  | `fitMode` | `'stretch' \| 'fit-columns' \| 'auto-fit'` | Column sizing mode |
707
706
  | `customStyles` | `string` | CSS injected via `document.adoptedStyleSheets` |
708
- | `ssr` | `boolean` | **Deprecated** — no-op, will be removed |
709
707
  | `onRowsChange` | `(rows: TRow[]) => void` | Rows changed callback |
710
708
  | `onCellEdit` | `(event: CustomEvent) => void` | Cell edited callback |
711
709
  | `onRowClick` | `(event: CustomEvent) => void` | Row clicked callback |
@@ -1,16 +1,16 @@
1
- import { useRef as w, useCallback as K, useEffect as T } from "react";
2
- import { p as E, n as k, c as B } from "./react-column-config-BOe_PgL1.js";
3
- import { jsx as D } from "react/jsx-runtime";
4
- import { a as u, r as g, b as M, e as A } from "./portal-bridge-CvxNt40O.js";
5
- const h = /* @__PURE__ */ new Set();
6
- let p = null;
7
- function S(o) {
8
- h.has(o) || (h.add(o), p = null);
1
+ import { useRef as k, useCallback as B, useEffect as D } from "react";
2
+ import { p as M, n as A, c as S } from "./react-column-config-BOe_PgL1.js";
3
+ import { jsx as F } from "react/jsx-runtime";
4
+ import { a as f, r as p, b as N, e as U } from "./portal-bridge-CvxNt40O.js";
5
+ const v = /* @__PURE__ */ new Set();
6
+ let b = null;
7
+ function x(n) {
8
+ v.has(n) || (v.add(n), b = null);
9
9
  }
10
- function j() {
11
- return p === null && (p = Object.freeze(Array.from(h))), p;
10
+ function J() {
11
+ return b === null && (b = Object.freeze(Array.from(v))), b;
12
12
  }
13
- const F = [
13
+ const G = [
14
14
  "selection",
15
15
  "editing",
16
16
  "filtering",
@@ -18,8 +18,6 @@ const F = [
18
18
  "clipboard",
19
19
  "contextMenu",
20
20
  "reorderColumns",
21
- // @deprecated v1.x — remove in `@toolbox-web/grid-react` 2.0.0 (gh #261 / #263). Superseded by `rowDragDrop`.
22
- "reorderRows",
23
21
  "rowDragDrop",
24
22
  "visibility",
25
23
  "undoRedo",
@@ -37,80 +35,120 @@ const F = [
37
35
  "serverSide",
38
36
  "tooltip"
39
37
  ];
40
- for (const o of F)
41
- S(o);
42
- const P = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new Map();
43
- function U(o) {
44
- const e = P.get(o);
38
+ for (const n of G)
39
+ x(n);
40
+ const R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new Map();
41
+ function I(n) {
42
+ const e = R.get(n);
45
43
  if (e) return e;
46
- const t = o.id;
44
+ const t = n.id;
47
45
  if (t)
48
- return b.get(t);
46
+ return P.get(t);
49
47
  }
50
- function z(o) {
51
- const { id: e, title: t, icon: r, tooltip: n, order: s = 100, children: i } = o, l = w(null), y = K(
48
+ function Q(n) {
49
+ const { id: e, title: t, icon: r, tooltip: i, order: s = 100, children: o } = n, d = k(null), c = B(
52
50
  (a) => {
53
- l.current = a, a && (P.set(a, i), e && b.set(e, i));
51
+ d.current = a, a && (R.set(a, o), e && P.set(e, o));
54
52
  },
55
- [i, e]
53
+ [o, e]
56
54
  );
57
- return T(() => () => {
58
- const a = l.current;
59
- a && (P.delete(a), e && b.delete(e));
60
- }, [e]), /* @__PURE__ */ D(
55
+ return D(() => () => {
56
+ const a = d.current;
57
+ a && (R.delete(a), e && P.delete(e));
58
+ }, [e]), /* @__PURE__ */ F(
61
59
  "tbw-grid-tool-panel",
62
60
  {
63
- ref: y,
61
+ ref: c,
64
62
  id: e,
65
63
  title: t,
66
64
  icon: r,
67
- tooltip: n,
65
+ tooltip: i,
68
66
  order: s?.toString()
69
67
  }
70
68
  );
71
69
  }
72
- let C = null, m = null, R = null;
73
- function O(o) {
74
- C = o;
70
+ let m = null, K = null, w = null;
71
+ function X(n) {
72
+ m = n;
75
73
  }
76
- function q(o) {
77
- m = o;
74
+ function Z(n) {
75
+ K = n;
78
76
  }
79
- function H(o) {
80
- R = o;
77
+ function $(n) {
78
+ w = n;
81
79
  }
82
- const d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new Map();
83
- function L(o, e) {
84
- const t = o.getAttribute("field"), r = d.get(o) ?? {};
85
- if (r.renderer = e, d.set(o, r), t) {
86
- const n = c.get(t) ?? {};
87
- n.renderer = e, c.set(t, n);
80
+ const l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Set();
81
+ function O(n) {
82
+ return n.closest("tbw-grid, [data-tbw-grid]") ?? void 0;
83
+ }
84
+ function y(n, e) {
85
+ const t = O(n);
86
+ if (!t)
87
+ return W;
88
+ const r = T.get(t);
89
+ if (r || !e)
90
+ return r;
91
+ const i = /* @__PURE__ */ new Map();
92
+ return T.set(t, i), i;
93
+ }
94
+ function h(n) {
95
+ return n.tagName.toLowerCase() === "tbw-grid-type" ? n.getAttribute("name") : n.closest("tbw-grid-type")?.getAttribute("name") ?? null;
96
+ }
97
+ function ee(n, e) {
98
+ const t = n.getAttribute("field"), r = l.get(n) ?? {};
99
+ if (r.renderer = e, l.set(n, r), t) {
100
+ const i = u.get(t) ?? {};
101
+ i.renderer = e, u.set(t, i);
88
102
  }
89
103
  }
90
- function V(o, e) {
91
- const t = o.getAttribute("field"), r = d.get(o) ?? {};
92
- if (r.editor = e, d.set(o, r), t) {
93
- const n = c.get(t) ?? {};
94
- n.editor = e, c.set(t, n);
104
+ function te(n, e) {
105
+ const t = n.getAttribute("field"), r = l.get(n) ?? {};
106
+ if (r.editor = e, l.set(n, r), t) {
107
+ const i = u.get(t) ?? {};
108
+ i.editor = e, u.set(t, i);
95
109
  }
96
110
  }
97
- function x(o) {
98
- let e = d.get(o)?.renderer;
111
+ function _(n) {
112
+ let e = l.get(n)?.renderer;
99
113
  if (!e) {
100
- const t = o.getAttribute("field");
101
- t && (e = c.get(t)?.renderer);
114
+ const t = n.getAttribute("field");
115
+ t && (e = u.get(t)?.renderer);
102
116
  }
103
117
  return e;
104
118
  }
105
- function G(o) {
106
- let e = d.get(o)?.editor;
119
+ function j(n) {
120
+ let e = l.get(n)?.editor;
107
121
  if (!e) {
108
- const t = o.getAttribute("field");
109
- t && (e = c.get(t)?.editor);
122
+ const t = n.getAttribute("field");
123
+ t && (e = u.get(t)?.editor);
110
124
  }
111
125
  return e;
112
126
  }
113
- class Y {
127
+ function re(n, e) {
128
+ const t = h(n);
129
+ if (!t) return;
130
+ const r = y(n, !0);
131
+ if (!r) return;
132
+ const i = r.get(t) ?? {};
133
+ i.renderer = e, r.set(t, i), E.add(t);
134
+ }
135
+ function z(n) {
136
+ const e = h(n);
137
+ return e ? y(n, !1)?.get(e)?.renderer : void 0;
138
+ }
139
+ function ne(n, e) {
140
+ const t = h(n);
141
+ if (!t) return;
142
+ const r = y(n, !0);
143
+ if (!r) return;
144
+ const i = r.get(t) ?? {};
145
+ i.editor = e, r.set(t, i), E.add(t);
146
+ }
147
+ function L(n) {
148
+ const e = h(n);
149
+ return e ? y(n, !1)?.get(e)?.editor : void 0;
150
+ }
151
+ class ie {
114
152
  /** Portal keys for all managed portals (for cleanup on destroy). */
115
153
  allPortalKeys = /* @__PURE__ */ new Set();
116
154
  /** Portal keys for editor-specific portals (for per-cell cleanup via releaseCell). */
@@ -165,7 +203,7 @@ class Y {
165
203
  * Converts React renderer/editor functions to DOM-returning functions.
166
204
  */
167
205
  processConfig(e) {
168
- return E(e) ?? e;
206
+ return M(e) ?? e;
169
207
  }
170
208
  /**
171
209
  * Determines if this adapter can handle the given element.
@@ -173,13 +211,16 @@ class Y {
173
211
  */
174
212
  canHandle(e) {
175
213
  const t = e.getAttribute("field");
176
- let r = d.get(e);
214
+ let r = l.get(e);
177
215
  if (!r && t) {
178
- const i = c.get(t);
179
- i && (i.renderer || i.editor) && (r = i, d.set(e, r));
216
+ const c = u.get(t);
217
+ c && (c.renderer || c.editor) && (r = c, l.set(e, r));
180
218
  }
181
- const n = r?.renderer !== void 0, s = r?.editor !== void 0;
182
- return r !== void 0 && (n || s);
219
+ const i = r?.renderer !== void 0, s = r?.editor !== void 0;
220
+ if (r !== void 0 && (i || s))
221
+ return !0;
222
+ const o = h(e), d = o ? y(e, !1)?.get(o) : void 0;
223
+ return !!d && (d.renderer !== void 0 || d.editor !== void 0);
183
224
  }
184
225
  /**
185
226
  * Creates a view renderer function that renders a React component
@@ -193,38 +234,38 @@ class Y {
193
234
  * allowing the grid to use its default rendering.
194
235
  */
195
236
  createRenderer(e) {
196
- const t = x(e);
237
+ const t = _(e) ?? z(e);
197
238
  if (!t)
198
239
  return;
199
- const r = e.closest("tbw-grid, [data-tbw-grid]"), n = /* @__PURE__ */ new WeakMap();
240
+ const r = e.closest("tbw-grid, [data-tbw-grid]"), i = /* @__PURE__ */ new WeakMap();
200
241
  return (s) => {
201
- const i = s.cellEl;
202
- if (i) {
203
- const a = n.get(i);
242
+ const o = s.cellEl;
243
+ if (o) {
244
+ const a = i.get(o);
204
245
  if (a) {
205
- if (i.contains(a.container))
206
- return u(a.container, t(s), a.portalKey), a.container;
207
- g(a.portalKey, { sync: !0 }), this.untrackPortal(a.portalKey), n.delete(i);
246
+ if (o.contains(a.container))
247
+ return f(a.container, t(s), a.portalKey), a.container;
248
+ p(a.portalKey, { sync: !0 }), this.untrackPortal(a.portalKey), i.delete(o);
208
249
  }
209
- const f = document.createElement("div");
210
- f.className = "react-cell-renderer", f.style.display = "contents";
211
- const v = u(
212
- f,
250
+ const g = document.createElement("div");
251
+ g.className = "react-cell-renderer", g.style.display = "contents";
252
+ const C = f(
253
+ g,
213
254
  t(s),
214
255
  void 0,
215
256
  r ?? void 0
216
257
  );
217
- return n.set(i, { portalKey: v, container: f }), this.trackPortal(v, f, !1), f;
258
+ return i.set(o, { portalKey: C, container: g }), this.trackPortal(C, g, !1), g;
218
259
  }
219
- const l = document.createElement("div");
220
- l.className = "react-cell-renderer", l.style.display = "contents";
221
- const y = u(
222
- l,
260
+ const d = document.createElement("div");
261
+ d.className = "react-cell-renderer", d.style.display = "contents";
262
+ const c = f(
263
+ d,
223
264
  t(s),
224
265
  void 0,
225
266
  r ?? void 0
226
267
  );
227
- return this.trackPortal(y, l, !1), l;
268
+ return this.trackPortal(c, d, !1), d;
228
269
  };
229
270
  }
230
271
  /**
@@ -232,20 +273,20 @@ class Y {
232
273
  * with commit/cancel callbacks passed as props.
233
274
  */
234
275
  createEditor(e) {
235
- const t = G(e);
276
+ const t = j(e) ?? L(e);
236
277
  if (!t)
237
278
  return () => document.createElement("div");
238
279
  const r = e.closest("tbw-grid, [data-tbw-grid]") ?? void 0;
239
- return (n) => {
280
+ return (i) => {
240
281
  const s = document.createElement("div");
241
282
  s.className = "react-cell-editor", s.style.display = "contents";
242
- const i = u(
283
+ const o = f(
243
284
  s,
244
- t(n),
285
+ t(i),
245
286
  void 0,
246
287
  r
247
288
  );
248
- return this.trackPortal(i, s, !0), r && this.editorBeforeCloseUnsubs.set(i, k(s, r)), s;
289
+ return this.trackPortal(o, s, !0), r && this.editorBeforeCloseUnsubs.set(o, A(s, r)), s;
249
290
  };
250
291
  }
251
292
  /**
@@ -256,7 +297,7 @@ class Y {
256
297
  * was registered for this grid.
257
298
  */
258
299
  createDetailRenderer(e) {
259
- return C?.(e, this.bridgeContext);
300
+ return m?.(e, this.bridgeContext);
260
301
  }
261
302
  /**
262
303
  * Framework adapter hook called by MasterDetailPlugin during attach().
@@ -275,7 +316,7 @@ class Y {
275
316
  * was registered for this grid.
276
317
  */
277
318
  createResponsiveCardRenderer(e) {
278
- return m?.(e, this.bridgeContext);
319
+ return K?.(e, this.bridgeContext);
279
320
  }
280
321
  /**
281
322
  * FrameworkAdapter hook called by ResponsivePlugin during attach().
@@ -295,16 +336,16 @@ class Y {
295
336
  * Renders React components into tool panel containers.
296
337
  */
297
338
  createToolPanelRenderer(e) {
298
- const t = U(e);
339
+ const t = I(e);
299
340
  if (!t)
300
341
  return;
301
342
  const r = e.closest("tbw-grid, [data-tbw-grid]");
302
- return (n) => {
303
- const i = u(n, t({
304
- grid: r ?? n
343
+ return (i) => {
344
+ const o = f(i, t({
345
+ grid: r ?? i
305
346
  }), void 0, r ?? void 0);
306
- return this.trackPortal(i, n, !1), () => {
307
- g(i, { sync: !0 }), this.untrackPortal(i);
347
+ return this.trackPortal(o, i, !1), () => {
348
+ p(o, { sync: !0 }), this.untrackPortal(o);
308
349
  };
309
350
  };
310
351
  }
@@ -338,14 +379,14 @@ class Y {
338
379
  const r = this.typeDefaults[e];
339
380
  if (!r)
340
381
  return;
341
- const n = {
382
+ const i = {
342
383
  editorParams: r.editorParams
343
384
  };
344
- return r.renderer && (n.renderer = this.createTypeRenderer(r.renderer, t)), r.editor && (n.editor = this.createTypeEditor(r.editor, t)), r.filterPanelRenderer && R && (n.filterPanelRenderer = R(
385
+ return r.renderer && (i.renderer = this.createTypeRenderer(r.renderer, t)), r.editor && (i.editor = this.createTypeEditor(r.editor, t)), r.filterPanelRenderer && w && (i.filterPanelRenderer = w(
345
386
  r.filterPanelRenderer,
346
387
  t,
347
388
  this.bridgeContext
348
- )), n;
389
+ )), i;
349
390
  }
350
391
  /**
351
392
  * Creates a renderer function from a React render function for type defaults.
@@ -353,10 +394,10 @@ class Y {
353
394
  */
354
395
  createTypeRenderer(e, t) {
355
396
  return (r) => {
356
- const n = document.createElement("span");
357
- n.style.display = "contents";
358
- const s = r.cellEl?.closest("tbw-grid, [data-tbw-grid]") ?? t, i = u(n, e(r), void 0, s);
359
- return this.trackPortal(i, n, !1), n;
397
+ const i = document.createElement("span");
398
+ i.style.display = "contents";
399
+ const s = r.cellEl?.closest("tbw-grid, [data-tbw-grid]") ?? t, o = f(i, e(r), void 0, s);
400
+ return this.trackPortal(o, i, !1), i;
360
401
  };
361
402
  }
362
403
  /**
@@ -365,10 +406,10 @@ class Y {
365
406
  */
366
407
  createTypeEditor(e, t) {
367
408
  return (r) => {
368
- const n = document.createElement("span");
369
- n.style.display = "contents";
370
- const s = u(n, e(r), void 0, t);
371
- return this.trackPortal(s, n, !0), n;
409
+ const i = document.createElement("span");
410
+ i.style.display = "contents";
411
+ const s = f(i, e(r), void 0, t);
412
+ return this.trackPortal(s, i, !0), i;
372
413
  };
373
414
  }
374
415
  // #region Portal tracking helpers
@@ -399,10 +440,10 @@ class Y {
399
440
  */
400
441
  destroy() {
401
442
  for (const e of this.allPortalKeys)
402
- g(e);
443
+ p(e);
403
444
  this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear();
404
445
  for (const e of this.editorBeforeCloseUnsubs.values()) e();
405
- this.editorBeforeCloseUnsubs.clear(), c.clear();
446
+ this.editorBeforeCloseUnsubs.clear(), u.clear();
406
447
  }
407
448
  /**
408
449
  * Called when a cell's content is about to be wiped.
@@ -429,17 +470,17 @@ class Y {
429
470
  releaseCell(e) {
430
471
  const t = e.querySelectorAll(".react-cell-renderer, .react-cell-editor");
431
472
  for (const r of t) {
432
- const n = this.containerToKey.get(r);
433
- n && (g(n, { sync: !0 }), this.untrackPortal(n));
473
+ const i = this.containerToKey.get(r);
474
+ i && (p(i, { sync: !0 }), this.untrackPortal(i));
434
475
  }
435
- B(e);
476
+ S(e);
436
477
  }
437
478
  /**
438
479
  * Unmount a specific container (called when cell is recycled).
439
480
  */
440
481
  unmount(e) {
441
482
  const t = this.containerToKey.get(e);
442
- t && (g(t), this.untrackPortal(t));
483
+ t && (p(t), this.untrackPortal(t));
443
484
  }
444
485
  /**
445
486
  * Open a teardown batch on the PortalManager. Grid core wraps multi-cell
@@ -450,7 +491,7 @@ class Y {
450
491
  * grouping changes (#330).
451
492
  */
452
493
  beginBatch(e) {
453
- M(e);
494
+ N(e);
454
495
  }
455
496
  /**
456
497
  * Close a teardown batch opened by {@link beginBatch}. Caller is
@@ -459,17 +500,19 @@ class Y {
459
500
  * filter then prunes them silently.
460
501
  */
461
502
  endBatch(e) {
462
- A(e);
503
+ U(e);
463
504
  }
464
505
  }
465
506
  export {
466
- Y as G,
467
- O as a,
468
- q as b,
469
- L as c,
470
- V as d,
471
- z as e,
472
- S as f,
473
- j as g,
474
- H as r
507
+ ie as G,
508
+ X as a,
509
+ Z as b,
510
+ ee as c,
511
+ te as d,
512
+ re as e,
513
+ ne as f,
514
+ J as g,
515
+ Q as h,
516
+ x as i,
517
+ $ as r
475
518
  };
@@ -3,7 +3,7 @@ import { useContext as h, useCallback as n } from "react";
3
3
  import { registerFeature as E } from "@toolbox-web/grid/features/registry";
4
4
  import { G as k } from "../chunks/grid-element-context-BU3WvNtM.js";
5
5
  import { r as v, a as m } from "../chunks/portal-bridge-CvxNt40O.js";
6
- import { r as C } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
6
+ import { r as C } from "../chunks/react-grid-adapter-BhC9x425.js";
7
7
  E(
8
8
  "filtering",
9
9
  (l) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,aAAa,CAAC;AACrB,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AACrB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC;AACjB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,WAAW,CAAC;AACnB,OAAO,QAAQ,CAAC;AAChB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,aAAa,CAAC;AACrB,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AACrB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC;AACjB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,WAAW,CAAC;AACnB,OAAO,QAAQ,CAAC;AAChB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC"}
package/features/index.js CHANGED
@@ -15,7 +15,6 @@ import "./pinned-rows.js";
15
15
  import "@toolbox-web/grid/features/pivot";
16
16
  import "@toolbox-web/grid/features/print";
17
17
  import "@toolbox-web/grid/features/reorder-columns";
18
- import "@toolbox-web/grid/features/reorder-rows";
19
18
  import "./responsive.js";
20
19
  import "@toolbox-web/grid/features/row-drag-drop";
21
20
  import "@toolbox-web/grid/features/selection";
@@ -4,7 +4,7 @@ import { registerFeature as m } from "@toolbox-web/grid/features/registry";
4
4
  import { g as f } from "../chunks/grid-detail-panel-BZFcujsZ.js";
5
5
  import { r as p, a as d } from "../chunks/portal-bridge-CvxNt40O.js";
6
6
  import { r as g } from "../chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
7
- import { a as y } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
7
+ import { a as y } from "../chunks/react-grid-adapter-BhC9x425.js";
8
8
  y((t, { trackPortal: e }) => {
9
9
  const n = f(t);
10
10
  if (n)
@@ -1 +1 @@
1
- {"version":3,"file":"pinned-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/pinned-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,wCAAwC,CAAC;AAIhD,YAAY,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAevG,YAAY,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,gBAAgB,EAEhB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"pinned-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/pinned-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,wCAAwC,CAAC;AAIhD,YAAY,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAevG,YAAY,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,gBAAgB,EAEhB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
@@ -1,23 +1,23 @@
1
1
  import "@toolbox-web/grid/features/pinned-rows";
2
2
  import { PinnedRowsPlugin as u } from "@toolbox-web/grid/plugins/pinned-rows";
3
- import { registerFeature as m } from "@toolbox-web/grid/features/registry";
4
- import { a as p, r as y } from "../chunks/portal-bridge-CvxNt40O.js";
3
+ import { registerFeature as d } from "@toolbox-web/grid/features/registry";
4
+ import { a as f, r as l } from "../chunks/portal-bridge-CvxNt40O.js";
5
5
  function c(e, n) {
6
6
  let r = null, t = !1;
7
- return (a) => {
8
- const o = e(a);
7
+ return (i) => {
8
+ const o = e(i);
9
9
  if (o == null || o === !1) return null;
10
10
  if (o instanceof HTMLElement) return o;
11
11
  if (!r) {
12
12
  const s = document.createElement("div");
13
13
  s.style.display = "contents", r = { host: s, portalKey: null };
14
14
  }
15
- return r.portalKey = p(r.host, o, r.portalKey ?? void 0), t || (t = !0, n(() => {
16
- r?.portalKey && y(r.portalKey, { sync: !1 }), r = null;
15
+ return r.portalKey = f(r.host, o, r.portalKey ?? void 0), t || (t = !0, n(() => {
16
+ r?.portalKey && l(r.portalKey, { sync: !1 }), r = null;
17
17
  })), r.host;
18
18
  };
19
19
  }
20
- function h(e, n) {
20
+ function p(e, n) {
21
21
  if (!("render" in e) || e.render == null) return e;
22
22
  if (Array.isArray(e.render)) {
23
23
  const r = e.render.map((t) => typeof t?.render != "function" ? t : { zone: t.zone, render: c(t.render, n) });
@@ -25,7 +25,7 @@ function h(e, n) {
25
25
  }
26
26
  return typeof e.render == "function" ? { ...e, render: c(e.render, n) } : e;
27
27
  }
28
- class P extends u {
28
+ class h extends u {
29
29
  #e;
30
30
  constructor(n, r) {
31
31
  super(n), this.#e = r;
@@ -40,23 +40,15 @@ class P extends u {
40
40
  this.#e.length = 0;
41
41
  }
42
42
  }
43
- m(
43
+ d(
44
44
  "pinnedRows",
45
45
  (e) => {
46
46
  if (typeof e == "boolean") return new u();
47
47
  if (!e) return new u();
48
- const n = e, { slots: r, customPanels: t, ...a } = n, o = { ...a }, s = [], d = (i) => {
49
- s.push(i);
48
+ const n = e, { slots: r, ...t } = n, i = { ...t }, o = [], s = (a) => {
49
+ o.push(a);
50
50
  };
51
- return Array.isArray(t) && (o.customPanels = t.map((i) => {
52
- if (typeof i.render != "function") return i;
53
- const f = c(i.render, d);
54
- return {
55
- ...i,
56
- // customPanels expect HTMLElement (not nullable); coerce null → empty wrapper.
57
- render: (l) => f(l) ?? document.createElement("div")
58
- };
59
- })), Array.isArray(r) && (o.slots = r.map((i) => h(i, d))), new P(o, s);
51
+ return Array.isArray(r) && (i.slots = r.map((a) => p(a, s))), new h(i, o);
60
52
  },
61
53
  { override: !0 }
62
54
  );
@@ -4,7 +4,7 @@ import { registerFeature as l } from "@toolbox-web/grid/features/registry";
4
4
  import { g as p } from "../chunks/grid-responsive-card-CSZhDCoN.js";
5
5
  import { r as v, a as f } from "../chunks/portal-bridge-CvxNt40O.js";
6
6
  import { r as R } from "../chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
7
- import { b as y } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
7
+ import { b as y } from "../chunks/react-grid-adapter-BhC9x425.js";
8
8
  y((e, { trackPortal: r }) => {
9
9
  const t = p(e);
10
10
  if (t)
package/index.d.ts CHANGED
@@ -8,7 +8,9 @@ export { GridResponsiveCard, type GridResponsiveCardProps, type ResponsiveCardCo
8
8
  export { GridToolButtons, type GridToolButtonsProps } from './lib/grid-tool-button';
9
9
  export { GridToolPanel, type GridToolPanelProps, type ToolPanelContext } from './lib/grid-tool-panel';
10
10
  export { GridToolbarContent, type GridToolbarContentProps } from './lib/grid-toolbar-content';
11
- export type { AllFeatureProps, ColumnGroupDefinition, FeatureProps, FilterConfig, GroupingColumnsConfig, GroupingRowsConfig, MasterDetailConfig, PanelRender, PanelSlot, PinnedRowSlot, PinnedRowsConfig, ReactColumnGroupDefinition, ReactFilterConfig, ReactGroupingColumnsConfig, ReactGroupingRowsConfig, ReactPanelRender, ReactPanelSlot, ReactPinnedRowSlot, ReactPinnedRowsConfig, ReactZonedPanelRender, ResponsivePluginConfig, SSRProps, ZonedPanelRender, } from './lib/feature-props';
11
+ export { GridType } from './lib/grid-type';
12
+ export type { GridTypeProps } from './lib/grid-type';
13
+ export type { AllFeatureProps, ColumnGroupDefinition, FeatureProps, FilterConfig, GroupingColumnsConfig, GroupingRowsConfig, MasterDetailConfig, PanelRender, PanelSlot, PinnedRowSlot, PinnedRowsConfig, ReactColumnGroupDefinition, ReactFilterConfig, ReactGroupingColumnsConfig, ReactGroupingRowsConfig, ReactPanelRender, ReactPanelSlot, ReactPinnedRowSlot, ReactPinnedRowsConfig, ReactZonedPanelRender, ResponsivePluginConfig, ZonedPanelRender, } from './lib/feature-props';
12
14
  export { applyColumnDefaults, hasColumnShorthands, normalizeColumns, parseColumnShorthand, } from './lib/column-shorthand';
13
15
  export type { ColumnShorthand } from './lib/column-shorthand';
14
16
  export type { EventHandler, EventProps } from './lib/event-props';
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../libs/grid-react/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eA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