@toolbox-web/grid-react 1.7.0 → 1.8.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/README.md +12 -10
- package/chunks/post-mount-refresh-hooks-Dt7mPoZC.js +12 -0
- package/chunks/{react-grid-adapter-BuuCl9rO.js → react-grid-adapter-LBf2Mqhn.js} +83 -44
- package/features/filtering.js +1 -1
- package/features/master-detail.js +17 -13
- package/features/pinned-rows.d.ts +46 -0
- package/features/pinned-rows.d.ts.map +1 -1
- package/features/pinned-rows.js +49 -20
- package/features/reorder-rows.d.ts.map +1 -1
- package/features/responsive.js +22 -14
- package/index.d.ts +5 -1
- package/index.d.ts.map +1 -1
- package/index.js +466 -407
- package/lib/child-feature-detector.d.ts +33 -0
- package/lib/child-feature-detector.d.ts.map +1 -0
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/event-props.d.ts +22 -1
- package/lib/event-props.d.ts.map +1 -1
- package/lib/feature-prop-keys.d.ts +27 -0
- package/lib/feature-prop-keys.d.ts.map +1 -0
- package/lib/feature-props.d.ts +32 -2
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/feature-registry.d.ts +3 -3
- package/lib/feature-registry.d.ts.map +1 -1
- package/lib/grid-header-content.d.ts +41 -0
- package/lib/grid-header-content.d.ts.map +1 -0
- package/lib/grid-toolbar-content.d.ts +44 -0
- package/lib/grid-toolbar-content.d.ts.map +1 -0
- package/lib/post-mount-refresh-hooks.d.ts +49 -0
- package/lib/post-mount-refresh-hooks.d.ts.map +1 -0
- package/lib/react-grid-adapter.d.ts +6 -0
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -640,16 +640,18 @@ Inject custom CSS into the grid:
|
|
|
640
640
|
|
|
641
641
|
### Exported Components
|
|
642
642
|
|
|
643
|
-
| Component
|
|
644
|
-
|
|
|
645
|
-
| `DataGrid`
|
|
646
|
-
| `GridColumn`
|
|
647
|
-
| `GridDetailPanel`
|
|
648
|
-
| `GridToolPanel`
|
|
649
|
-
| `
|
|
650
|
-
| `
|
|
651
|
-
| `
|
|
652
|
-
| `
|
|
643
|
+
| Component | Description |
|
|
644
|
+
| -------------------- | -------------------------------------------- |
|
|
645
|
+
| `DataGrid` | Main grid component wrapper |
|
|
646
|
+
| `GridColumn` | Declarative column with render props |
|
|
647
|
+
| `GridDetailPanel` | Master-detail expandable panel |
|
|
648
|
+
| `GridToolPanel` | Custom sidebar panel |
|
|
649
|
+
| `GridHeaderContent` | Inject React content into shell header zone |
|
|
650
|
+
| `GridToolbarContent` | Inject React content into shell toolbar zone |
|
|
651
|
+
| `GridToolButtons` | Toolbar button container |
|
|
652
|
+
| `GridProvider` | Combined provider for icons & type defaults |
|
|
653
|
+
| `GridTypeProvider` | App-level type defaults context |
|
|
654
|
+
| `GridIconProvider` | App-level icon overrides context |
|
|
653
655
|
|
|
654
656
|
### Exported Hooks
|
|
655
657
|
|
|
@@ -1,26 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as u, r as g, b as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
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);
|
|
9
|
+
}
|
|
10
|
+
function j() {
|
|
11
|
+
return p === null && (p = Object.freeze(Array.from(h))), p;
|
|
12
|
+
}
|
|
13
|
+
const F = [
|
|
14
|
+
"selection",
|
|
15
|
+
"editing",
|
|
16
|
+
"filtering",
|
|
17
|
+
"multiSort",
|
|
18
|
+
"clipboard",
|
|
19
|
+
"contextMenu",
|
|
20
|
+
"reorderColumns",
|
|
21
|
+
// @deprecated v1.x — remove in `@toolbox-web/grid-react` 2.0.0 (gh #261 / #263). Superseded by `rowDragDrop`.
|
|
22
|
+
"reorderRows",
|
|
23
|
+
"rowDragDrop",
|
|
24
|
+
"visibility",
|
|
25
|
+
"undoRedo",
|
|
26
|
+
"tree",
|
|
27
|
+
"groupingRows",
|
|
28
|
+
"groupingColumns",
|
|
29
|
+
"pinnedColumns",
|
|
30
|
+
"pinnedRows",
|
|
31
|
+
"masterDetail",
|
|
32
|
+
"responsive",
|
|
33
|
+
"columnVirtualization",
|
|
34
|
+
"export",
|
|
35
|
+
"print",
|
|
36
|
+
"pivot",
|
|
37
|
+
"serverSide",
|
|
38
|
+
"tooltip"
|
|
39
|
+
];
|
|
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);
|
|
8
45
|
if (e) return e;
|
|
9
46
|
const t = o.id;
|
|
10
47
|
if (t)
|
|
11
|
-
return
|
|
48
|
+
return b.get(t);
|
|
12
49
|
}
|
|
13
|
-
function
|
|
14
|
-
const { id: e, title: t, icon: r, tooltip: n, order: s = 100, children: i } = o, l =
|
|
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(
|
|
15
52
|
(a) => {
|
|
16
|
-
l.current = a, a && (
|
|
53
|
+
l.current = a, a && (P.set(a, i), e && b.set(e, i));
|
|
17
54
|
},
|
|
18
55
|
[i, e]
|
|
19
56
|
);
|
|
20
|
-
return
|
|
57
|
+
return T(() => () => {
|
|
21
58
|
const a = l.current;
|
|
22
|
-
a && (
|
|
23
|
-
}, [e]), /* @__PURE__ */
|
|
59
|
+
a && (P.delete(a), e && b.delete(e));
|
|
60
|
+
}, [e]), /* @__PURE__ */ D(
|
|
24
61
|
"tbw-grid-tool-panel",
|
|
25
62
|
{
|
|
26
63
|
ref: y,
|
|
@@ -32,32 +69,32 @@ function W(o) {
|
|
|
32
69
|
}
|
|
33
70
|
);
|
|
34
71
|
}
|
|
35
|
-
let C = null,
|
|
36
|
-
function
|
|
72
|
+
let C = null, m = null, R = null;
|
|
73
|
+
function O(o) {
|
|
37
74
|
C = o;
|
|
38
75
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
76
|
+
function q(o) {
|
|
77
|
+
m = o;
|
|
41
78
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
79
|
+
function H(o) {
|
|
80
|
+
R = o;
|
|
44
81
|
}
|
|
45
82
|
const d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new Map();
|
|
46
|
-
function
|
|
83
|
+
function L(o, e) {
|
|
47
84
|
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
48
85
|
if (r.renderer = e, d.set(o, r), t) {
|
|
49
86
|
const n = c.get(t) ?? {};
|
|
50
87
|
n.renderer = e, c.set(t, n);
|
|
51
88
|
}
|
|
52
89
|
}
|
|
53
|
-
function
|
|
90
|
+
function V(o, e) {
|
|
54
91
|
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
55
92
|
if (r.editor = e, d.set(o, r), t) {
|
|
56
93
|
const n = c.get(t) ?? {};
|
|
57
94
|
n.editor = e, c.set(t, n);
|
|
58
95
|
}
|
|
59
96
|
}
|
|
60
|
-
function
|
|
97
|
+
function x(o) {
|
|
61
98
|
let e = d.get(o)?.renderer;
|
|
62
99
|
if (!e) {
|
|
63
100
|
const t = o.getAttribute("field");
|
|
@@ -65,7 +102,7 @@ function A(o) {
|
|
|
65
102
|
}
|
|
66
103
|
return e;
|
|
67
104
|
}
|
|
68
|
-
function
|
|
105
|
+
function G(o) {
|
|
69
106
|
let e = d.get(o)?.editor;
|
|
70
107
|
if (!e) {
|
|
71
108
|
const t = o.getAttribute("field");
|
|
@@ -73,7 +110,7 @@ function U(o) {
|
|
|
73
110
|
}
|
|
74
111
|
return e;
|
|
75
112
|
}
|
|
76
|
-
class
|
|
113
|
+
class Y {
|
|
77
114
|
/** Portal keys for all managed portals (for cleanup on destroy). */
|
|
78
115
|
allPortalKeys = /* @__PURE__ */ new Set();
|
|
79
116
|
/** Portal keys for editor-specific portals (for per-cell cleanup via releaseCell). */
|
|
@@ -128,7 +165,7 @@ class z {
|
|
|
128
165
|
* Converts React renderer/editor functions to DOM-returning functions.
|
|
129
166
|
*/
|
|
130
167
|
processConfig(e) {
|
|
131
|
-
return
|
|
168
|
+
return E(e) ?? e;
|
|
132
169
|
}
|
|
133
170
|
/**
|
|
134
171
|
* Determines if this adapter can handle the given element.
|
|
@@ -156,7 +193,7 @@ class z {
|
|
|
156
193
|
* allowing the grid to use its default rendering.
|
|
157
194
|
*/
|
|
158
195
|
createRenderer(e) {
|
|
159
|
-
const t =
|
|
196
|
+
const t = x(e);
|
|
160
197
|
if (!t)
|
|
161
198
|
return;
|
|
162
199
|
const r = e.closest("tbw-grid, [data-tbw-grid]"), n = /* @__PURE__ */ new WeakMap();
|
|
@@ -171,13 +208,13 @@ class z {
|
|
|
171
208
|
}
|
|
172
209
|
const f = document.createElement("div");
|
|
173
210
|
f.className = "react-cell-renderer", f.style.display = "contents";
|
|
174
|
-
const
|
|
211
|
+
const v = u(
|
|
175
212
|
f,
|
|
176
213
|
t(s),
|
|
177
214
|
void 0,
|
|
178
215
|
r ?? void 0
|
|
179
216
|
);
|
|
180
|
-
return n.set(i, { portalKey:
|
|
217
|
+
return n.set(i, { portalKey: v, container: f }), this.trackPortal(v, f, !1), f;
|
|
181
218
|
}
|
|
182
219
|
const l = document.createElement("div");
|
|
183
220
|
l.className = "react-cell-renderer", l.style.display = "contents";
|
|
@@ -195,7 +232,7 @@ class z {
|
|
|
195
232
|
* with commit/cancel callbacks passed as props.
|
|
196
233
|
*/
|
|
197
234
|
createEditor(e) {
|
|
198
|
-
const t =
|
|
235
|
+
const t = G(e);
|
|
199
236
|
if (!t)
|
|
200
237
|
return () => document.createElement("div");
|
|
201
238
|
const r = e.closest("tbw-grid, [data-tbw-grid]") ?? void 0;
|
|
@@ -208,7 +245,7 @@ class z {
|
|
|
208
245
|
void 0,
|
|
209
246
|
r
|
|
210
247
|
);
|
|
211
|
-
return this.trackPortal(i, s, !0), r && this.editorBeforeCloseUnsubs.set(i,
|
|
248
|
+
return this.trackPortal(i, s, !0), r && this.editorBeforeCloseUnsubs.set(i, k(s, r)), s;
|
|
212
249
|
};
|
|
213
250
|
}
|
|
214
251
|
/**
|
|
@@ -238,7 +275,7 @@ class z {
|
|
|
238
275
|
* was registered for this grid.
|
|
239
276
|
*/
|
|
240
277
|
createResponsiveCardRenderer(e) {
|
|
241
|
-
return
|
|
278
|
+
return m?.(e, this.bridgeContext);
|
|
242
279
|
}
|
|
243
280
|
/**
|
|
244
281
|
* FrameworkAdapter hook called by ResponsivePlugin during attach().
|
|
@@ -258,7 +295,7 @@ class z {
|
|
|
258
295
|
* Renders React components into tool panel containers.
|
|
259
296
|
*/
|
|
260
297
|
createToolPanelRenderer(e) {
|
|
261
|
-
const t =
|
|
298
|
+
const t = U(e);
|
|
262
299
|
if (!t)
|
|
263
300
|
return;
|
|
264
301
|
const r = e.closest("tbw-grid, [data-tbw-grid]");
|
|
@@ -304,7 +341,7 @@ class z {
|
|
|
304
341
|
const n = {
|
|
305
342
|
editorParams: r.editorParams
|
|
306
343
|
};
|
|
307
|
-
return r.renderer && (n.renderer = this.createTypeRenderer(r.renderer, t)), r.editor && (n.editor = this.createTypeEditor(r.editor, t)), r.filterPanelRenderer &&
|
|
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(
|
|
308
345
|
r.filterPanelRenderer,
|
|
309
346
|
t,
|
|
310
347
|
this.bridgeContext
|
|
@@ -395,7 +432,7 @@ class z {
|
|
|
395
432
|
const n = this.containerToKey.get(r);
|
|
396
433
|
n && (g(n, { sync: !0 }), this.untrackPortal(n));
|
|
397
434
|
}
|
|
398
|
-
|
|
435
|
+
B(e);
|
|
399
436
|
}
|
|
400
437
|
/**
|
|
401
438
|
* Unmount a specific container (called when cell is recycled).
|
|
@@ -413,7 +450,7 @@ class z {
|
|
|
413
450
|
* grouping changes (#330).
|
|
414
451
|
*/
|
|
415
452
|
beginBatch(e) {
|
|
416
|
-
|
|
453
|
+
M(e);
|
|
417
454
|
}
|
|
418
455
|
/**
|
|
419
456
|
* Close a teardown batch opened by {@link beginBatch}. Caller is
|
|
@@ -422,15 +459,17 @@ class z {
|
|
|
422
459
|
* filter then prunes them silently.
|
|
423
460
|
*/
|
|
424
461
|
endBatch(e) {
|
|
425
|
-
|
|
462
|
+
A(e);
|
|
426
463
|
}
|
|
427
464
|
}
|
|
428
465
|
export {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
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
|
|
436
475
|
};
|
package/features/filtering.js
CHANGED
|
@@ -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-
|
|
6
|
+
import { r as C } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
|
|
7
7
|
E(
|
|
8
8
|
"filtering",
|
|
9
9
|
(l) => {
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/master-detail";
|
|
2
|
-
import { g as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { g as s } from "../chunks/grid-detail-panel-BZFcujsZ.js";
|
|
3
|
+
import { a as m } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
|
+
import { r as c } from "../chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
|
|
5
|
+
import { a as l } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
|
|
6
|
+
l((e, { trackPortal: n }) => {
|
|
7
|
+
const t = s(e);
|
|
7
8
|
if (t)
|
|
8
|
-
return (
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
t({ row:
|
|
9
|
+
return (a, i) => {
|
|
10
|
+
const r = document.createElement("div");
|
|
11
|
+
r.className = "react-detail-panel";
|
|
12
|
+
const o = m(
|
|
13
|
+
r,
|
|
14
|
+
t({ row: a, rowIndex: i }),
|
|
14
15
|
void 0,
|
|
15
|
-
|
|
16
|
+
e
|
|
16
17
|
);
|
|
17
|
-
return n(
|
|
18
|
+
return n(o, r, !1), r;
|
|
18
19
|
};
|
|
19
20
|
});
|
|
21
|
+
c("masterDetail", ({ gridEl: e }) => {
|
|
22
|
+
e.getPluginByName("masterDetail")?.refreshDetailRenderer?.();
|
|
23
|
+
});
|
|
@@ -1 +1,47 @@
|
|
|
1
|
+
import { AggregationSlot, PanelZone, PinnedRowsConfig, PinnedRowsContext } from '@toolbox-web/grid/plugins/pinned-rows';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* React-typed render function for a pinned-row panel slot.
|
|
5
|
+
*
|
|
6
|
+
* @since 1.8.0
|
|
7
|
+
*/
|
|
8
|
+
export type ReactPanelRender = (ctx: PinnedRowsContext) => ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* React-typed zoned render entry.
|
|
11
|
+
*
|
|
12
|
+
* @since 1.8.0
|
|
13
|
+
*/
|
|
14
|
+
export interface ReactZonedPanelRender {
|
|
15
|
+
zone?: PanelZone;
|
|
16
|
+
render: ReactPanelRender;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React-typed panel slot — same shape as vanilla PanelSlot but with ReactNode render returns.
|
|
20
|
+
*
|
|
21
|
+
* @since 1.8.0
|
|
22
|
+
*/
|
|
23
|
+
export interface ReactPanelSlot {
|
|
24
|
+
id?: string;
|
|
25
|
+
position?: 'top' | 'bottom';
|
|
26
|
+
render: ReactPanelRender | ReactZonedPanelRender[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* React-typed slot — either a panel slot or an aggregation slot.
|
|
30
|
+
*
|
|
31
|
+
* @since 1.8.0
|
|
32
|
+
*/
|
|
33
|
+
export type ReactPinnedRowSlot = ReactPanelSlot | AggregationSlot;
|
|
34
|
+
/**
|
|
35
|
+
* Per-feature shape of `pinnedRows` accepted by the React adapter.
|
|
36
|
+
*
|
|
37
|
+
* @since 1.8.0
|
|
38
|
+
*/
|
|
39
|
+
export type ReactPinnedRowsConfig = Omit<PinnedRowsConfig, 'slots' | 'customPanels'> & {
|
|
40
|
+
slots?: ReactPinnedRowSlot[];
|
|
41
|
+
customPanels?: Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
position: PanelZone;
|
|
44
|
+
render: (ctx: PinnedRowsContext) => ReactNode;
|
|
45
|
+
}>;
|
|
46
|
+
};
|
|
1
47
|
//# sourceMappingURL=pinned-rows.d.ts.map
|
|
@@ -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"}
|
|
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;AAEhD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EAEd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC;AACrE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AACD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,MAAM,EAAE,gBAAgB,GAAG,qBAAqB,EAAE,CAAC;CACpD;AACD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,eAAe,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,cAAc,CAAC,GAAG;IACrF,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC;KAC/C,CAAC,CAAC;CACJ,CAAC"}
|
package/features/pinned-rows.js
CHANGED
|
@@ -1,33 +1,62 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/pinned-rows";
|
|
2
|
-
import { PinnedRowsPlugin as
|
|
2
|
+
import { PinnedRowsPlugin as u } from "@toolbox-web/grid/plugins/pinned-rows";
|
|
3
3
|
import { registerFeature as m } from "@toolbox-web/grid/features/registry";
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
import { a as p, r as y } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
5
|
+
function c(e, n) {
|
|
6
|
+
let r = null, t = !1;
|
|
7
|
+
return (a) => {
|
|
8
|
+
const o = e(a);
|
|
9
|
+
if (o == null || o === !1) return null;
|
|
10
|
+
if (o instanceof HTMLElement) return o;
|
|
11
|
+
if (!r) {
|
|
12
|
+
const s = document.createElement("div");
|
|
13
|
+
s.style.display = "contents", r = { host: s, portalKey: null };
|
|
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;
|
|
17
|
+
})), r.host;
|
|
18
|
+
};
|
|
7
19
|
}
|
|
8
|
-
function
|
|
9
|
-
if (!("render" in
|
|
10
|
-
if (Array.isArray(
|
|
11
|
-
const
|
|
12
|
-
return { ...
|
|
20
|
+
function h(e, n) {
|
|
21
|
+
if (!("render" in e) || e.render == null) return e;
|
|
22
|
+
if (Array.isArray(e.render)) {
|
|
23
|
+
const r = e.render.map((t) => typeof t?.render != "function" ? t : { zone: t.zone, render: c(t.render, n) });
|
|
24
|
+
return { ...e, render: r };
|
|
25
|
+
}
|
|
26
|
+
return typeof e.render == "function" ? { ...e, render: c(e.render, n) } : e;
|
|
27
|
+
}
|
|
28
|
+
class P extends u {
|
|
29
|
+
#e;
|
|
30
|
+
constructor(n, r) {
|
|
31
|
+
super(n), this.#e = r;
|
|
32
|
+
}
|
|
33
|
+
detach() {
|
|
34
|
+
super.detach();
|
|
35
|
+
for (const n of this.#e)
|
|
36
|
+
try {
|
|
37
|
+
n();
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
this.#e.length = 0;
|
|
13
41
|
}
|
|
14
|
-
return typeof r.render == "function" ? { ...r, render: u(r.render) } : r;
|
|
15
42
|
}
|
|
16
43
|
m(
|
|
17
44
|
"pinnedRows",
|
|
18
|
-
(
|
|
19
|
-
if (typeof
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
(e) => {
|
|
46
|
+
if (typeof e == "boolean") return new u();
|
|
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);
|
|
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);
|
|
25
54
|
return {
|
|
26
|
-
...
|
|
55
|
+
...i,
|
|
27
56
|
// customPanels expect HTMLElement (not nullable); coerce null → empty wrapper.
|
|
28
|
-
render: (
|
|
57
|
+
render: (l) => f(l) ?? document.createElement("div")
|
|
29
58
|
};
|
|
30
|
-
})), Array.isArray(
|
|
59
|
+
})), Array.isArray(r) && (o.slots = r.map((i) => h(i, d))), new P(o, s);
|
|
31
60
|
},
|
|
32
61
|
{ override: !0 }
|
|
33
62
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/reorder-rows.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reorder-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/reorder-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,yCAAyC,CAAC"}
|
package/features/responsive.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/responsive";
|
|
2
|
-
import { g as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { g as a } from "../chunks/grid-responsive-card-CSZhDCoN.js";
|
|
3
|
+
import { a as d } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
|
+
import { r as c } from "../chunks/post-mount-refresh-hooks-Dt7mPoZC.js";
|
|
5
|
+
import { b as p } from "../chunks/react-grid-adapter-LBf2Mqhn.js";
|
|
6
|
+
p((e, { trackPortal: s }) => {
|
|
7
|
+
const r = a(e);
|
|
8
|
+
if (r)
|
|
9
|
+
return (n, t) => {
|
|
10
|
+
const o = document.createElement("div");
|
|
11
|
+
o.className = "react-responsive-card";
|
|
12
|
+
const i = d(
|
|
13
|
+
o,
|
|
14
|
+
r({ row: n, index: t }),
|
|
14
15
|
void 0,
|
|
15
|
-
|
|
16
|
+
e
|
|
16
17
|
);
|
|
17
|
-
return
|
|
18
|
+
return s(i, o, !1), o;
|
|
18
19
|
};
|
|
19
20
|
});
|
|
21
|
+
c("responsive", ({ gridEl: e }) => {
|
|
22
|
+
if (!e.querySelector("tbw-grid-responsive-card") || !a(e)) return;
|
|
23
|
+
const r = e, n = r.getPluginByName("responsive");
|
|
24
|
+
if (!n?.setCardRenderer) return;
|
|
25
|
+
const t = r.__frameworkAdapter?.createResponsiveCardRenderer?.(e);
|
|
26
|
+
t && n.setCardRenderer(t);
|
|
27
|
+
});
|
package/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export type { DataGridProps, DataGridRef } from './lib/data-grid';
|
|
|
3
3
|
export { GridColumn } from './lib/grid-column';
|
|
4
4
|
export type { GridColumnProps } from './lib/grid-column';
|
|
5
5
|
export { GridDetailPanel, type DetailPanelContext, type GridDetailPanelProps } from './lib/grid-detail-panel';
|
|
6
|
+
export { GridHeaderContent, type GridHeaderContentProps } from './lib/grid-header-content';
|
|
6
7
|
export { GridResponsiveCard, type GridResponsiveCardProps, type ResponsiveCardContext, } from './lib/grid-responsive-card';
|
|
7
8
|
export { GridToolButtons, type GridToolButtonsProps } from './lib/grid-tool-button';
|
|
8
9
|
export { GridToolPanel, type GridToolPanelProps, type ToolPanelContext } from './lib/grid-tool-panel';
|
|
9
|
-
export
|
|
10
|
+
export { GridToolbarContent, type GridToolbarContentProps } from './lib/grid-toolbar-content';
|
|
11
|
+
export type { AllFeatureProps, FeatureProps, ReactColumnGroupDefinition, ReactFilterConfig, ReactGroupingColumnsConfig, ReactGroupingRowsConfig, SSRProps, } from './lib/feature-props';
|
|
10
12
|
export { applyColumnDefaults, hasColumnShorthands, normalizeColumns, parseColumnShorthand, } from './lib/column-shorthand';
|
|
11
13
|
export type { ColumnShorthand } from './lib/column-shorthand';
|
|
12
14
|
export type { EventHandler, EventProps } from './lib/event-props';
|
|
@@ -17,5 +19,7 @@ export type { ColumnConfig, GridConfig } from './lib/react-column-config';
|
|
|
17
19
|
export { useGrid, type UseGridReturn } from './lib/use-grid';
|
|
18
20
|
export { useGridOverlay, type UseGridOverlayOptions } from './lib/use-grid-overlay';
|
|
19
21
|
export { GridAdapter } from './lib/react-grid-adapter';
|
|
22
|
+
export { registerChildFeatureDetector, registerEditorMountHook, registerFeaturePropKey, registerPostMountRefresh, } from './lib/react-grid-adapter';
|
|
23
|
+
export type { ChildFeatureDetector, EditorMountHook, PostMountRefreshHook } from './lib/react-grid-adapter';
|
|
20
24
|
export type { GridCellContext, GridDetailContext, GridEditorContext, GridToolPanelContext } from './lib/context-types';
|
|
21
25
|
//# sourceMappingURL=index.d.ts.map
|
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,W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