@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 +360 -356
- package/lib/data-grid.d.ts +8 -1
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/grid-column.d.ts +2 -0
- package/lib/grid-column.d.ts.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { DataGridElement as
|
|
3
|
-
import { Children as
|
|
4
|
-
import { g as
|
|
5
|
-
import { e as
|
|
6
|
-
import { s as
|
|
7
|
-
import { flushSync as
|
|
8
|
-
import { n as
|
|
9
|
-
import { r as
|
|
10
|
-
import { p as
|
|
11
|
-
import { r as
|
|
12
|
-
import { createPluginsFromFeatures as
|
|
13
|
-
import { G as
|
|
14
|
-
import { G as
|
|
15
|
-
import { G as
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
|
|
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
|
|
20
|
+
function Ie(t) {
|
|
21
21
|
const r = {};
|
|
22
|
-
return
|
|
23
|
-
if (!
|
|
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 =
|
|
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
|
|
32
|
+
function Le(t) {
|
|
33
33
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return t.toLowerCase() === "id" ? "ID" : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(
|
|
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
|
|
39
|
-
function
|
|
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 (
|
|
43
|
+
if (Ae.has(d)) {
|
|
44
44
|
const n = t.slice(0, r);
|
|
45
45
|
return {
|
|
46
46
|
field: n,
|
|
47
|
-
header:
|
|
47
|
+
header: se(n),
|
|
48
48
|
type: d
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return {
|
|
53
53
|
field: t,
|
|
54
|
-
header:
|
|
54
|
+
header: se(t)
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return t.map((r) => typeof r == "string" ?
|
|
57
|
+
function Ne(t) {
|
|
58
|
+
return t.map((r) => typeof r == "string" ? Me(r) : r);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Oe(t, r) {
|
|
61
61
|
return r ? t.map((d) => ({ ...r, ...d })) : t;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function ir(t) {
|
|
64
64
|
return t.some((r) => typeof r == "string");
|
|
65
65
|
}
|
|
66
|
-
const
|
|
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
|
-
},
|
|
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
|
|
111
|
+
return k(J);
|
|
116
112
|
}
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
121
|
-
|
|
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
|
|
134
|
-
const n =
|
|
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 && (
|
|
136
|
+
g.current = !1, !f.current && (ie(s), b());
|
|
137
137
|
}));
|
|
138
|
-
},
|
|
138
|
+
}, b = () => {
|
|
139
139
|
l.current || (l.current = requestAnimationFrame(() => {
|
|
140
140
|
l.current = 0, !f.current && s();
|
|
141
141
|
}));
|
|
142
|
-
},
|
|
143
|
-
console.error(`[grid-react] Portal "${
|
|
142
|
+
}, C = (m, i) => {
|
|
143
|
+
console.error(`[grid-react] Portal "${m}" crashed; dropping.`, i), n.current.delete(m), b();
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
de(
|
|
146
146
|
d,
|
|
147
147
|
() => ({
|
|
148
|
-
renderPortal(
|
|
149
|
-
f.current || (n.current.set(
|
|
148
|
+
renderPortal(m, i, p) {
|
|
149
|
+
f.current || (n.current.set(m, { container: i, element: p }), h());
|
|
150
150
|
},
|
|
151
|
-
removePortal(
|
|
151
|
+
removePortal(m, i) {
|
|
152
152
|
if (f.current) {
|
|
153
|
-
n.current.delete(
|
|
153
|
+
n.current.delete(m);
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
n.current.delete(
|
|
156
|
+
n.current.delete(m) && (a.current > 0 ? w.current = !0 : i ? ie(s) : h());
|
|
157
157
|
},
|
|
158
158
|
beginBatch() {
|
|
159
|
-
|
|
159
|
+
a.current++;
|
|
160
160
|
},
|
|
161
161
|
endBatch() {
|
|
162
|
-
|
|
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),
|
|
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
|
-
),
|
|
175
|
+
), ge(() => {
|
|
176
176
|
f.current = !1;
|
|
177
|
-
const
|
|
177
|
+
const m = n.current;
|
|
178
178
|
return () => {
|
|
179
|
-
f.current = !0, l.current && (cancelAnimationFrame(l.current), l.current = 0),
|
|
179
|
+
f.current = !0, l.current && (cancelAnimationFrame(l.current), l.current = 0), m.clear();
|
|
180
180
|
};
|
|
181
181
|
}, []);
|
|
182
|
-
const
|
|
182
|
+
const R = [];
|
|
183
183
|
let S = null;
|
|
184
|
-
for (const [
|
|
185
|
-
if (!
|
|
186
|
-
(S ??= []).push(
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
|
|
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
|
|
198
|
+
const m = S;
|
|
199
199
|
queueMicrotask(() => {
|
|
200
|
-
for (const
|
|
200
|
+
for (const i of m) n.current.delete(i);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
return /* @__PURE__ */
|
|
204
|
-
}),
|
|
203
|
+
return /* @__PURE__ */ E(W, { children: R });
|
|
204
|
+
}), _e = {
|
|
205
205
|
undoRedo: ["editing"],
|
|
206
206
|
clipboard: ["selection"]
|
|
207
207
|
};
|
|
208
|
-
function
|
|
208
|
+
function qe(t) {
|
|
209
209
|
const r = new Set(t);
|
|
210
210
|
for (const d of t) {
|
|
211
|
-
const n =
|
|
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
|
|
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
|
|
223
|
+
return qe(r), ke(t);
|
|
224
224
|
}
|
|
225
|
-
let
|
|
226
|
-
function
|
|
227
|
-
return
|
|
225
|
+
let ce = !1, q = null;
|
|
226
|
+
function U() {
|
|
227
|
+
return ce || (q = new Se(), ae.registerAdapter(q), ce = !0), q;
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
let
|
|
232
|
-
function
|
|
233
|
-
let r =
|
|
234
|
-
return r === void 0 && (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
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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:
|
|
269
|
+
plugins: p,
|
|
269
270
|
// SSR mode (deprecated - see SSRProps)
|
|
270
|
-
ssr:
|
|
271
|
+
ssr: v,
|
|
271
272
|
// Legacy event handlers
|
|
272
|
-
onRowsChange:
|
|
273
|
+
onRowsChange: x,
|
|
273
274
|
// Feature props and event props are in ...rest
|
|
274
|
-
...
|
|
275
|
-
} = r,
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
let
|
|
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
|
-
|
|
281
|
+
u = JSON.stringify(o) ?? "undefined";
|
|
281
282
|
} catch {
|
|
282
|
-
|
|
283
|
+
u = typeof o == "object" && o !== null ? `ref#${We(o)}` : `prim:${String(o)}`;
|
|
283
284
|
}
|
|
284
|
-
return `${e}:${
|
|
285
|
-
}).filter(Boolean).join("|"), [
|
|
286
|
-
const e = {},
|
|
287
|
-
for (const
|
|
288
|
-
const
|
|
289
|
-
|
|
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
|
-
}, [
|
|
293
|
-
const e = s?.features,
|
|
294
|
-
for (const [
|
|
295
|
-
e &&
|
|
296
|
-
return { ...
|
|
297
|
-
}, [
|
|
298
|
-
if (
|
|
299
|
-
const e = new Set(
|
|
300
|
-
return [...
|
|
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
|
|
303
|
-
}, [
|
|
304
|
-
const e =
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
|
|
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 (
|
|
310
|
-
const
|
|
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
|
-
...
|
|
314
|
-
plugins: [...
|
|
314
|
+
...o,
|
|
315
|
+
plugins: [...u, ...K]
|
|
315
316
|
};
|
|
316
317
|
}
|
|
317
|
-
return
|
|
318
|
-
}, [s,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}, [
|
|
322
|
-
|
|
323
|
-
}, [n]),
|
|
324
|
-
|
|
325
|
-
}, [
|
|
326
|
-
|
|
327
|
-
}, [
|
|
328
|
-
|
|
329
|
-
}, [
|
|
330
|
-
|
|
331
|
-
}, [
|
|
332
|
-
|
|
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
|
|
335
|
-
e.__frameworkAdapter =
|
|
336
|
-
let
|
|
337
|
-
const
|
|
338
|
-
|
|
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
|
-
|
|
344
|
+
u = !0, cancelAnimationFrame(D);
|
|
342
345
|
};
|
|
343
|
-
}, []),
|
|
344
|
-
if (!
|
|
345
|
-
const e =
|
|
346
|
-
let
|
|
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
|
-
|
|
351
|
+
u && R && (e.registerStyles?.(o, R), N.current = o);
|
|
349
352
|
}), () => {
|
|
350
|
-
|
|
353
|
+
u = !1, N.current && (e.unregisterStyles?.(N.current), N.current = null);
|
|
351
354
|
};
|
|
352
|
-
}, [
|
|
353
|
-
const e =
|
|
355
|
+
}, [R]), P(() => {
|
|
356
|
+
const e = c.current;
|
|
354
357
|
if (!e) return;
|
|
355
|
-
const
|
|
356
|
-
return
|
|
357
|
-
|
|
358
|
+
const o = [];
|
|
359
|
+
return x && o.push(e.on("rows-change", (u) => x(u.rows))), () => {
|
|
360
|
+
o.forEach((u) => u());
|
|
358
361
|
};
|
|
359
|
-
}, [
|
|
360
|
-
const
|
|
361
|
-
for (const e of Object.keys(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const e =
|
|
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
|
|
367
|
-
for (const [
|
|
368
|
-
|
|
369
|
-
e.on(
|
|
370
|
-
|
|
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
|
-
|
|
377
|
+
o.forEach((u) => u());
|
|
375
378
|
};
|
|
376
|
-
}, [
|
|
379
|
+
}, [re]), de(
|
|
377
380
|
d,
|
|
378
381
|
() => ({
|
|
379
382
|
get element() {
|
|
380
|
-
return
|
|
383
|
+
return c.current;
|
|
381
384
|
},
|
|
382
385
|
async getConfig() {
|
|
383
|
-
return
|
|
386
|
+
return c.current?.getConfig?.() ?? {};
|
|
384
387
|
},
|
|
385
388
|
async ready() {
|
|
386
|
-
return
|
|
389
|
+
return c.current?.ready?.();
|
|
387
390
|
},
|
|
388
391
|
async forceLayout() {
|
|
389
|
-
return
|
|
392
|
+
return c.current?.forceLayout?.();
|
|
390
393
|
},
|
|
391
394
|
async toggleGroup(e) {
|
|
392
|
-
return
|
|
395
|
+
return c.current?.toggleGroup?.(e);
|
|
393
396
|
},
|
|
394
|
-
registerStyles(e,
|
|
395
|
-
|
|
397
|
+
registerStyles(e, o) {
|
|
398
|
+
c.current?.registerStyles?.(e, o);
|
|
396
399
|
},
|
|
397
400
|
unregisterStyles(e) {
|
|
398
|
-
|
|
401
|
+
c.current?.unregisterStyles?.(e);
|
|
399
402
|
},
|
|
400
|
-
setRowLoading(e,
|
|
401
|
-
|
|
403
|
+
setRowLoading(e, o) {
|
|
404
|
+
c.current?.setRowLoading?.(e, o);
|
|
402
405
|
},
|
|
403
|
-
setCellLoading(e,
|
|
404
|
-
|
|
406
|
+
setCellLoading(e, o, u) {
|
|
407
|
+
c.current?.setCellLoading?.(e, o, u);
|
|
405
408
|
},
|
|
406
409
|
isRowLoading(e) {
|
|
407
|
-
return
|
|
410
|
+
return c.current?.isRowLoading?.(e) ?? !1;
|
|
408
411
|
},
|
|
409
|
-
isCellLoading(e,
|
|
410
|
-
return
|
|
412
|
+
isCellLoading(e, o) {
|
|
413
|
+
return c.current?.isCellLoading?.(e, o) ?? !1;
|
|
411
414
|
},
|
|
412
415
|
clearAllLoading() {
|
|
413
|
-
|
|
416
|
+
c.current?.clearAllLoading?.();
|
|
414
417
|
}
|
|
415
418
|
}),
|
|
416
419
|
[]
|
|
417
420
|
);
|
|
418
|
-
const
|
|
419
|
-
return
|
|
420
|
-
const e =
|
|
421
|
-
return e &&
|
|
422
|
-
e &&
|
|
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__ */
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
|
|
427
|
-
|
|
427
|
+
}, []), /* @__PURE__ */ ve(W, { children: [
|
|
428
|
+
/* @__PURE__ */ E(Ke, { ref: z }),
|
|
429
|
+
Ge(
|
|
430
|
+
ae.activeTag,
|
|
428
431
|
{
|
|
429
432
|
ref: (e) => {
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
const
|
|
433
|
-
|
|
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:
|
|
437
|
-
style:
|
|
439
|
+
class: S,
|
|
440
|
+
style: m
|
|
438
441
|
},
|
|
439
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ E(H.Provider, { value: c, children: i })
|
|
440
443
|
)
|
|
441
444
|
] });
|
|
442
445
|
});
|
|
443
|
-
function
|
|
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:
|
|
452
|
-
minWidth:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
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
|
-
[
|
|
465
|
-
),
|
|
468
|
+
[C, R]
|
|
469
|
+
), x = typeof a == "number" ? `${a}px` : a, y = {
|
|
466
470
|
field: r,
|
|
467
|
-
ref:
|
|
471
|
+
ref: v
|
|
468
472
|
};
|
|
469
|
-
return d !== void 0 && (
|
|
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
|
|
472
|
-
const n =
|
|
473
|
-
return
|
|
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
|
|
477
|
-
let
|
|
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 (
|
|
485
|
-
const
|
|
488
|
+
if (b) return;
|
|
489
|
+
const C = {
|
|
486
490
|
id: s,
|
|
487
491
|
order: r,
|
|
488
|
-
render: (S) => (
|
|
492
|
+
render: (S) => (a(S), () => {
|
|
489
493
|
})
|
|
490
|
-
},
|
|
491
|
-
|
|
494
|
+
}, R = f.getPluginByName?.("shell");
|
|
495
|
+
R?.registerHeaderContent ? R.registerHeaderContent(C) : f.registerHeaderContent?.(C);
|
|
492
496
|
})(), () => {
|
|
493
|
-
|
|
494
|
-
const
|
|
495
|
-
|
|
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]),
|
|
501
|
+
}, [g, s, r]), P(() => {
|
|
498
502
|
if (!l) return;
|
|
499
503
|
const f = g?.current ?? void 0;
|
|
500
|
-
|
|
504
|
+
w.current = Ce(l, d, w.current ?? void 0, f);
|
|
501
505
|
}, [d, l, g]), null;
|
|
502
506
|
}
|
|
503
|
-
function
|
|
504
|
-
return /* @__PURE__ */
|
|
507
|
+
function dr({ children: t }) {
|
|
508
|
+
return /* @__PURE__ */ E("tbw-grid-tool-buttons", { children: t });
|
|
505
509
|
}
|
|
506
|
-
function
|
|
507
|
-
const n =
|
|
508
|
-
return
|
|
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
|
|
512
|
-
let
|
|
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 (
|
|
520
|
-
const
|
|
523
|
+
if (b) return;
|
|
524
|
+
const C = {
|
|
521
525
|
id: s,
|
|
522
526
|
order: r,
|
|
523
|
-
render: (S) => (
|
|
527
|
+
render: (S) => (a(S), () => {
|
|
524
528
|
})
|
|
525
|
-
},
|
|
526
|
-
|
|
529
|
+
}, R = f.getPluginByName?.("shell");
|
|
530
|
+
R?.registerToolbarContent ? R.registerToolbarContent(C) : f.registerToolbarContent?.(C);
|
|
527
531
|
})(), () => {
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
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]),
|
|
536
|
+
}, [g, s, r]), P(() => {
|
|
533
537
|
if (!l) return;
|
|
534
538
|
const f = g?.current ?? void 0;
|
|
535
|
-
|
|
539
|
+
w.current = Ce(l, d, w.current ?? void 0, f);
|
|
536
540
|
}, [d, l, g]), null;
|
|
537
541
|
}
|
|
538
|
-
const
|
|
542
|
+
const pr = ({ icons: t, defaults: r, children: d }) => {
|
|
539
543
|
let n = d;
|
|
540
|
-
return r && (n = /* @__PURE__ */
|
|
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
|
|
543
|
-
const r =
|
|
544
|
-
|
|
545
|
-
let
|
|
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
|
|
550
|
-
if (!
|
|
551
|
-
if (l.current =
|
|
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
|
|
554
|
-
|
|
557
|
+
const x = await v.getConfig?.();
|
|
558
|
+
i && x && g(x);
|
|
555
559
|
}
|
|
556
560
|
} else {
|
|
557
|
-
const
|
|
558
|
-
if (!
|
|
559
|
-
if (await
|
|
561
|
+
const v = r.current;
|
|
562
|
+
if (!v) return;
|
|
563
|
+
if (await v.ready?.(), i) {
|
|
560
564
|
n(!0);
|
|
561
|
-
const
|
|
562
|
-
|
|
565
|
+
const x = await v.getConfig?.();
|
|
566
|
+
i && x && g(x);
|
|
563
567
|
}
|
|
564
568
|
}
|
|
565
569
|
} catch {
|
|
566
570
|
}
|
|
567
571
|
})(), () => {
|
|
568
|
-
|
|
572
|
+
i = !1;
|
|
569
573
|
};
|
|
570
574
|
}, [t]);
|
|
571
|
-
const
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
574
|
-
return await
|
|
575
|
-
const
|
|
576
|
-
return
|
|
577
|
-
}, [
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
await
|
|
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
|
|
584
|
-
|
|
585
|
-
}, [
|
|
586
|
-
async (
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
await
|
|
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
|
|
593
|
-
|
|
596
|
+
const v = r.current;
|
|
597
|
+
v && await v.toggleGroup?.(i);
|
|
594
598
|
},
|
|
595
|
-
[
|
|
596
|
-
),
|
|
597
|
-
(
|
|
598
|
-
[
|
|
599
|
-
),
|
|
600
|
-
((
|
|
601
|
-
[
|
|
602
|
-
),
|
|
603
|
-
(
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
606
|
-
|
|
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?.(
|
|
613
|
+
r.current?.registerStyles?.(i, p);
|
|
610
614
|
},
|
|
611
|
-
[
|
|
612
|
-
), S =
|
|
613
|
-
(
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
|
|
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?.(
|
|
623
|
+
r.current?.unregisterStyles?.(i);
|
|
620
624
|
},
|
|
621
|
-
[
|
|
622
|
-
),
|
|
625
|
+
[a]
|
|
626
|
+
), m = F(() => s?.columns ? s.columns.filter((i) => !i.hidden) : [], [s]);
|
|
623
627
|
return {
|
|
624
628
|
ref: r,
|
|
625
|
-
element:
|
|
629
|
+
element: a(),
|
|
626
630
|
isReady: d,
|
|
627
631
|
config: s,
|
|
628
|
-
getConfig:
|
|
632
|
+
getConfig: w,
|
|
629
633
|
forceLayout: f,
|
|
630
|
-
toggleGroup:
|
|
631
|
-
getPlugin:
|
|
632
|
-
getPluginByName:
|
|
633
|
-
registerStyles:
|
|
634
|
+
toggleGroup: h,
|
|
635
|
+
getPlugin: b,
|
|
636
|
+
getPluginByName: C,
|
|
637
|
+
registerStyles: R,
|
|
634
638
|
unregisterStyles: S,
|
|
635
|
-
getVisibleColumns:
|
|
639
|
+
getVisibleColumns: m
|
|
636
640
|
};
|
|
637
641
|
}
|
|
638
|
-
function
|
|
639
|
-
const { open: d = !0, gridElement: n } = r, s =
|
|
640
|
-
|
|
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
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
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
|
};
|
package/lib/data-grid.d.ts
CHANGED
|
@@ -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.
|
package/lib/data-grid.d.ts.map
CHANGED
|
@@ -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;
|
|
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,mBAAmB,EAAE,eAAe,EAAE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AAE,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"}
|
package/lib/grid-column.d.ts
CHANGED
|
@@ -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 */
|
package/lib/grid-column.d.ts.map
CHANGED
|
@@ -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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