@geovi/the-datagrid 0.0.13 → 0.1.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/dist/base.css +1 -1
- package/dist/components.js +7 -5
- package/dist/grid/ReactDataGrid.d.ts.map +1 -1
- package/dist/grid/components/ColumnGroupHeaderCell.d.ts.map +1 -1
- package/dist/grid/components/FilterCell.d.ts.map +1 -1
- package/dist/grid/components/GridBody.d.ts.map +1 -1
- package/dist/grid/components/GridHeader.d.ts.map +1 -1
- package/dist/grid/components/HeaderCell.d.ts +6 -0
- package/dist/grid/components/HeaderCell.d.ts.map +1 -1
- package/dist/grid/hooks/useGridColumnResize.d.ts +3 -1
- package/dist/grid/hooks/useGridColumnResize.d.ts.map +1 -1
- package/dist/grid/utils/columnGroups.d.ts +8 -1
- package/dist/grid/utils/columnGroups.d.ts.map +1 -1
- package/dist/grid/utils/liveColumnResize.d.ts +21 -1
- package/dist/grid/utils/liveColumnResize.d.ts.map +1 -1
- package/dist/grid/utils/lockedColumns.d.ts +37 -2
- package/dist/grid/utils/lockedColumns.d.ts.map +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.css +1 -1
- package/dist/index.js +9429 -9235
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/style/theme/amber-dark/index.css +1 -1
- package/dist/style/theme/amber-light/index.css +1 -1
- package/dist/style/theme/blue-dark/index.css +1 -1
- package/dist/style/theme/blue-light/index.css +1 -1
- package/dist/style/theme/default-dark/index.css +1 -1
- package/dist/style/theme/default-light/index.css +1 -1
- package/dist/style/theme/green-dark/index.css +1 -1
- package/dist/style/theme/green-light/index.css +1 -1
- package/dist/style/theme/pink-dark/index.css +1 -1
- package/dist/style/theme/pink-light/index.css +1 -1
- package/dist/toolbar/RDGToolbar.d.ts +2 -15
- package/dist/toolbar/RDGToolbar.d.ts.map +1 -1
- package/dist/toolbar/RDGToolbarProvider.d.ts +12 -0
- package/dist/toolbar/RDGToolbarProvider.d.ts.map +1 -1
- package/dist/toolbar/api.d.ts +65 -0
- package/dist/toolbar/api.d.ts.map +1 -0
- package/dist/toolbar/columns.d.ts +12 -0
- package/dist/toolbar/columns.d.ts.map +1 -0
- package/dist/toolbar/export.d.ts +57 -0
- package/dist/toolbar/export.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +4 -2
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/store.d.ts +14 -0
- package/dist/toolbar/store.d.ts.map +1 -1
- package/dist/toolbar.js +510 -418
- package/package.json +1 -1
package/dist/toolbar.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./toolbar.css";
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
3
|
+
import * as ce from "react";
|
|
4
|
+
import Me from "./index.js";
|
|
5
|
+
const Ie = ce, p = Ie.default ?? ce, ue = p.Children, Ve = p.Component, de = p.Fragment, ke = p.PureComponent, fe = p.cloneElement, Y = p.createContext, l = p.createElement, Ge = p.createRef, je = p.forwardRef, G = p.isValidElement, Pe = p.lazy, Ue = p.memo, q = p.useCallback, pe = p.useContext, Be = p.useDebugValue, $e = p.useDeferredValue, D = p.useEffect, W = p.useId, me = p.useImperativeHandle, Xe = p.useInsertionEffect, ge = p.useLayoutEffect, R = p.useMemo, He = p.useReducer, K = p.useRef, A = p.useState, We = p.use, Ke = p.version, ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
6
|
__proto__: null,
|
|
7
|
-
Children:
|
|
8
|
-
Component:
|
|
9
|
-
Fragment:
|
|
10
|
-
PureComponent:
|
|
11
|
-
cloneElement:
|
|
12
|
-
createContext:
|
|
7
|
+
Children: ue,
|
|
8
|
+
Component: Ve,
|
|
9
|
+
Fragment: de,
|
|
10
|
+
PureComponent: ke,
|
|
11
|
+
cloneElement: fe,
|
|
12
|
+
createContext: Y,
|
|
13
13
|
createElement: l,
|
|
14
|
-
createRef:
|
|
15
|
-
default:
|
|
16
|
-
forwardRef:
|
|
14
|
+
createRef: Ge,
|
|
15
|
+
default: p,
|
|
16
|
+
forwardRef: je,
|
|
17
17
|
isValidElement: G,
|
|
18
|
-
lazy:
|
|
19
|
-
memo:
|
|
20
|
-
use:
|
|
21
|
-
useCallback:
|
|
22
|
-
useContext:
|
|
23
|
-
useDebugValue:
|
|
24
|
-
useDeferredValue:
|
|
25
|
-
useEffect:
|
|
18
|
+
lazy: Pe,
|
|
19
|
+
memo: Ue,
|
|
20
|
+
use: We,
|
|
21
|
+
useCallback: q,
|
|
22
|
+
useContext: pe,
|
|
23
|
+
useDebugValue: Be,
|
|
24
|
+
useDeferredValue: $e,
|
|
25
|
+
useEffect: D,
|
|
26
26
|
useId: W,
|
|
27
|
-
useImperativeHandle:
|
|
28
|
-
useInsertionEffect:
|
|
29
|
-
useLayoutEffect:
|
|
30
|
-
useMemo:
|
|
31
|
-
useReducer:
|
|
27
|
+
useImperativeHandle: me,
|
|
28
|
+
useInsertionEffect: Xe,
|
|
29
|
+
useLayoutEffect: ge,
|
|
30
|
+
useMemo: R,
|
|
31
|
+
useReducer: He,
|
|
32
32
|
useRef: K,
|
|
33
33
|
useState: A,
|
|
34
|
-
version:
|
|
34
|
+
version: Ke
|
|
35
35
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
36
|
-
let
|
|
37
|
-
function
|
|
38
|
-
const [t] = A(() => (
|
|
36
|
+
let ee = 0;
|
|
37
|
+
function Ye(e) {
|
|
38
|
+
const [t] = A(() => (ee += 1, `${e}-${ee}`));
|
|
39
39
|
return t;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
return
|
|
41
|
+
const qe = typeof W == "function" ? (e) => `${e}-${W()}` : Ye;
|
|
42
|
+
function k(e = "tdg") {
|
|
43
|
+
return qe(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const { children: t, className:
|
|
45
|
+
function j(e) {
|
|
46
|
+
const { children: t, className: r } = e;
|
|
47
47
|
return /* @__PURE__ */ l(
|
|
48
48
|
"svg",
|
|
49
49
|
{
|
|
50
50
|
"aria-hidden": "true",
|
|
51
51
|
focusable: "false",
|
|
52
|
-
className:
|
|
52
|
+
className: r,
|
|
53
53
|
viewBox: "0 0 24 24",
|
|
54
54
|
fill: "none",
|
|
55
55
|
stroke: "currentColor",
|
|
@@ -60,388 +60,493 @@ function P(e) {
|
|
|
60
60
|
t
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return /* @__PURE__ */ l(
|
|
63
|
+
function te(e) {
|
|
64
|
+
return /* @__PURE__ */ l(j, { className: e.className }, /* @__PURE__ */ l("path", { d: "M12 3v12" }), /* @__PURE__ */ l("path", { d: "m7 10 5 5 5-5" }), /* @__PURE__ */ l("path", { d: "M4 21h16" }));
|
|
65
|
+
}
|
|
66
|
+
function Je(e) {
|
|
67
|
+
return /* @__PURE__ */ l(j, { className: e.className }, /* @__PURE__ */ l("path", { d: "M3 4h18l-7 8v8l-4-2v-6z" }));
|
|
65
68
|
}
|
|
66
69
|
function Qe(e) {
|
|
67
|
-
return /* @__PURE__ */ l(
|
|
70
|
+
return /* @__PURE__ */ l(j, { className: e.className }, /* @__PURE__ */ l("path", { d: "M3 4h18l-7 8v8l-4-2v-6z" }), /* @__PURE__ */ l("path", { d: "m16 16 5 5" }), /* @__PURE__ */ l("path", { d: "m21 16-5 5" }));
|
|
68
71
|
}
|
|
69
72
|
function Ze(e) {
|
|
70
|
-
return /* @__PURE__ */ l(
|
|
71
|
-
}
|
|
72
|
-
function et(e) {
|
|
73
|
-
return /* @__PURE__ */ l(P, { className: e.className }, /* @__PURE__ */ l("path", { d: "M3 12a9 9 0 1 0 3-6.7" }), /* @__PURE__ */ l("path", { d: "M3 4v5h5" }));
|
|
73
|
+
return /* @__PURE__ */ l(j, { className: e.className }, /* @__PURE__ */ l("path", { d: "M3 12a9 9 0 1 0 3-6.7" }), /* @__PURE__ */ l("path", { d: "M3 4v5h5" }));
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
themeName:
|
|
78
|
-
themeBase:
|
|
75
|
+
const v = "default";
|
|
76
|
+
Y({
|
|
77
|
+
themeName: v,
|
|
78
|
+
themeBase: v,
|
|
79
79
|
portalContainer: null
|
|
80
80
|
});
|
|
81
|
-
function
|
|
82
|
-
const t = String(e ??
|
|
83
|
-
return t.length > 0 ? t :
|
|
81
|
+
function he(e) {
|
|
82
|
+
const t = String(e ?? v).trim();
|
|
83
|
+
return t.length > 0 ? t : v;
|
|
84
|
+
}
|
|
85
|
+
function et(e) {
|
|
86
|
+
return he(e).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || v;
|
|
84
87
|
}
|
|
85
88
|
function tt(e) {
|
|
86
|
-
|
|
89
|
+
const t = et(e);
|
|
90
|
+
return t === v ? v : t === "dark" || t.endsWith("-dark") || t.endsWith("_dark") ? "dark" : t === "light" || t.endsWith("-light") || t.endsWith("_light") ? "light" : v;
|
|
87
91
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
return t === R ? R : t === "dark" || t.endsWith("-dark") || t.endsWith("_dark") ? "dark" : t === "light" || t.endsWith("-light") || t.endsWith("_light") ? "light" : R;
|
|
92
|
+
function F(e) {
|
|
93
|
+
return String(e.id ?? e.name ?? "");
|
|
91
94
|
}
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
function be(e, t) {
|
|
96
|
+
const r = /* @__PURE__ */ new Map();
|
|
97
|
+
for (const n of e) {
|
|
98
|
+
const s = F(n);
|
|
99
|
+
s && !r.has(s) && r.set(s, n);
|
|
100
|
+
}
|
|
101
|
+
const o = [];
|
|
102
|
+
for (const n of t) {
|
|
103
|
+
const s = r.get(n);
|
|
104
|
+
s && (o.push(s), r.delete(n));
|
|
105
|
+
}
|
|
106
|
+
return o.push(...r.values()), o;
|
|
107
|
+
}
|
|
108
|
+
const nt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Ee = "yyyy-mm-dd hh:mm";
|
|
109
|
+
class rt extends Error {
|
|
94
110
|
constructor(t) {
|
|
95
111
|
super(
|
|
96
112
|
'XLSX export needs the optional "xlsx" peer dependency. Install it with `npm install xlsx`, or drop "xlsx" from the toolbar\'s exportFormats.'
|
|
97
113
|
), this.name = "MissingXlsxDependencyError", this.cause = t;
|
|
98
114
|
}
|
|
99
115
|
}
|
|
100
|
-
class
|
|
101
|
-
constructor(t,
|
|
116
|
+
class ot extends Error {
|
|
117
|
+
constructor(t, r) {
|
|
102
118
|
super(
|
|
103
119
|
`Writing the XLSX workbook failed. If exportDateFormat is set it must be an Excel number format code the writer accepts - dot separators are rejected, so prefer "yyyy-mm-dd hh:mm" or "dd/mm/yyyy hh:mm" over "dd.mm.yyyy hh:mm". Received ${JSON.stringify(t)}. Format the value with column.exportValue instead when you need exact text.`
|
|
104
|
-
), this.name = "XlsxWriteError", this.cause =
|
|
120
|
+
), this.name = "XlsxWriteError", this.cause = r;
|
|
105
121
|
}
|
|
106
122
|
}
|
|
107
|
-
function
|
|
123
|
+
function st(e) {
|
|
108
124
|
const t = e.replace(/[[\]:*?/\\]/g, " ").trim();
|
|
109
125
|
return t ? t.slice(0, 31) : "Export";
|
|
110
126
|
}
|
|
111
|
-
async function
|
|
127
|
+
async function at() {
|
|
112
128
|
try {
|
|
113
129
|
return await import("xlsx");
|
|
114
130
|
} catch (e) {
|
|
115
|
-
throw new
|
|
131
|
+
throw new rt(e);
|
|
116
132
|
}
|
|
117
133
|
}
|
|
118
|
-
async function
|
|
119
|
-
const { dateFormat:
|
|
134
|
+
async function lt(e, t = {}) {
|
|
135
|
+
const { dateFormat: r = Ee, sheetName: o = "Export" } = t, n = await at(), s = {
|
|
120
136
|
cellDates: !0,
|
|
121
|
-
dateNF:
|
|
137
|
+
dateNF: r
|
|
122
138
|
};
|
|
123
139
|
try {
|
|
124
|
-
const
|
|
140
|
+
const i = n.utils.aoa_to_sheet(
|
|
125
141
|
[e.headers, ...e.rows],
|
|
126
142
|
s
|
|
127
|
-
),
|
|
128
|
-
return
|
|
143
|
+
), u = n.utils.book_new();
|
|
144
|
+
return n.utils.book_append_sheet(u, i, st(o)), n.write(u, {
|
|
129
145
|
bookType: "xlsx",
|
|
130
146
|
type: "array",
|
|
131
147
|
...s
|
|
132
148
|
});
|
|
133
|
-
} catch (
|
|
134
|
-
throw new
|
|
149
|
+
} catch (i) {
|
|
150
|
+
throw new ot(r, i);
|
|
135
151
|
}
|
|
136
152
|
}
|
|
137
|
-
const ct = `\r
|
|
138
|
-
`,
|
|
153
|
+
const it = "grid-export", ct = "view", ut = `\r
|
|
154
|
+
`, dt = "\uFEFF";
|
|
139
155
|
function z(e) {
|
|
140
156
|
return String(e.id ?? e.name ?? "");
|
|
141
157
|
}
|
|
142
|
-
function
|
|
158
|
+
function J(e) {
|
|
143
159
|
return String(e.name ?? e.id ?? "");
|
|
144
160
|
}
|
|
145
|
-
function
|
|
161
|
+
function ft(e) {
|
|
146
162
|
return typeof e.header == "string" && e.header.trim() ? e.header : typeof e.header == "number" ? String(e.header) : z(e);
|
|
147
163
|
}
|
|
148
|
-
function
|
|
149
|
-
const { columns: t, columnOrder:
|
|
150
|
-
for (const
|
|
151
|
-
const
|
|
152
|
-
|
|
164
|
+
function ye(e) {
|
|
165
|
+
const { columns: t, columnOrder: r, columnVisibilityMap: o } = e, n = /* @__PURE__ */ new Map();
|
|
166
|
+
for (const i of t) {
|
|
167
|
+
const u = z(i);
|
|
168
|
+
u && !n.has(u) && n.set(u, i);
|
|
153
169
|
}
|
|
154
170
|
const s = [];
|
|
155
|
-
for (const
|
|
156
|
-
const
|
|
157
|
-
|
|
171
|
+
for (const i of r) {
|
|
172
|
+
const u = n.get(i);
|
|
173
|
+
u && (s.push(u), n.delete(i));
|
|
158
174
|
}
|
|
159
|
-
return s.push(...
|
|
175
|
+
return s.push(...n.values()), s.filter((i) => i.exportable === !1 || !J(i) ? !1 : i.exportWhenHidden ? !0 : o[z(i)] !== !1);
|
|
160
176
|
}
|
|
161
|
-
function
|
|
177
|
+
function pt(e, t) {
|
|
162
178
|
if (!(typeof e != "object" || e == null))
|
|
163
179
|
return e[t];
|
|
164
180
|
}
|
|
165
|
-
function
|
|
166
|
-
const
|
|
167
|
-
if (typeof e.exportValue != "function") return
|
|
181
|
+
function mt(e, t) {
|
|
182
|
+
const r = pt(t, J(e));
|
|
183
|
+
if (typeof e.exportValue != "function") return r;
|
|
168
184
|
try {
|
|
169
|
-
return e.exportValue({ value:
|
|
185
|
+
return e.exportValue({ value: r, data: t, column: e });
|
|
170
186
|
} catch {
|
|
171
|
-
return
|
|
187
|
+
return r;
|
|
172
188
|
}
|
|
173
189
|
}
|
|
174
|
-
function
|
|
190
|
+
function gt(e, t) {
|
|
175
191
|
return {
|
|
176
|
-
headers: e.map(
|
|
177
|
-
fields: e.map(
|
|
192
|
+
headers: e.map(ft),
|
|
193
|
+
fields: e.map(J),
|
|
178
194
|
rows: t.map(
|
|
179
|
-
(
|
|
195
|
+
(r) => e.map((o) => mt(o, r))
|
|
180
196
|
)
|
|
181
197
|
};
|
|
182
198
|
}
|
|
183
|
-
function
|
|
199
|
+
function ht(e) {
|
|
184
200
|
return e == null ? "" : e instanceof Date ? Number.isNaN(e.getTime()) ? "" : e.toISOString() : typeof e == "object" ? JSON.stringify(e) ?? "" : String(e);
|
|
185
201
|
}
|
|
186
|
-
function
|
|
187
|
-
const t =
|
|
202
|
+
function ne(e) {
|
|
203
|
+
const t = ht(e);
|
|
188
204
|
return /["\n\r,]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t;
|
|
189
205
|
}
|
|
190
|
-
function
|
|
206
|
+
function bt(e) {
|
|
191
207
|
const t = [
|
|
192
|
-
e.headers.map(
|
|
193
|
-
...e.rows.map((
|
|
208
|
+
e.headers.map(ne).join(","),
|
|
209
|
+
...e.rows.map((r) => r.map(ne).join(","))
|
|
194
210
|
];
|
|
195
|
-
return `${
|
|
211
|
+
return `${dt}${t.join(ut)}`;
|
|
196
212
|
}
|
|
197
|
-
function
|
|
213
|
+
function Et(e) {
|
|
198
214
|
const t = e.rows.map(
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
e.fields[
|
|
215
|
+
(r) => Object.fromEntries(
|
|
216
|
+
r.map((o, n) => [
|
|
217
|
+
e.fields[n],
|
|
202
218
|
o === void 0 ? null : o
|
|
203
219
|
])
|
|
204
220
|
)
|
|
205
221
|
);
|
|
206
222
|
return JSON.stringify(t, null, 2);
|
|
207
223
|
}
|
|
208
|
-
const
|
|
224
|
+
const P = {
|
|
209
225
|
csv: {
|
|
210
226
|
label: "CSV",
|
|
211
227
|
extension: "csv",
|
|
212
228
|
mimeType: "text/csv;charset=utf-8",
|
|
213
|
-
createContent: (e) =>
|
|
229
|
+
createContent: (e) => bt(e)
|
|
214
230
|
},
|
|
215
231
|
json: {
|
|
216
232
|
label: "JSON",
|
|
217
233
|
extension: "json",
|
|
218
234
|
mimeType: "application/json;charset=utf-8",
|
|
219
|
-
createContent: (e) =>
|
|
235
|
+
createContent: (e) => Et(e)
|
|
220
236
|
},
|
|
221
237
|
xlsx: {
|
|
222
238
|
label: "Excel",
|
|
223
239
|
extension: "xlsx",
|
|
224
240
|
mimeType: nt,
|
|
225
|
-
createContent: (e, t) =>
|
|
241
|
+
createContent: (e, t) => lt(e, t)
|
|
226
242
|
}
|
|
227
243
|
}, yt = ["csv", "json"];
|
|
228
|
-
function
|
|
244
|
+
function St(e, t, r) {
|
|
229
245
|
if (typeof document > "u" || typeof URL > "u") return 0;
|
|
230
|
-
const o = new Blob([t], { type:
|
|
231
|
-
return s.href =
|
|
246
|
+
const o = new Blob([t], { type: r }), n = URL.createObjectURL(o), s = document.createElement("a");
|
|
247
|
+
return s.href = n, s.download = e, s.rel = "noopener", document.body.append(s), s.click(), s.remove(), URL.revokeObjectURL(n), o.size;
|
|
232
248
|
}
|
|
233
|
-
function
|
|
249
|
+
function Se(...e) {
|
|
250
|
+
const t = {};
|
|
251
|
+
for (const r of e)
|
|
252
|
+
r && (t.scope ??= r.scope, t.fileName ??= r.fileName, t.dateFormat ??= r.dateFormat, t.sheetName ??= r.sheetName);
|
|
253
|
+
return t;
|
|
254
|
+
}
|
|
255
|
+
async function xe(e, t, r = {}) {
|
|
256
|
+
const o = P[t];
|
|
257
|
+
if (!o) return null;
|
|
258
|
+
const n = ye(e);
|
|
259
|
+
if (n.length === 0) return null;
|
|
260
|
+
const s = r.scope ?? ct, i = s === "all" ? e.getAllRows() : e.getViewRows(), u = gt(n, i), f = {
|
|
261
|
+
format: t,
|
|
262
|
+
scope: s,
|
|
263
|
+
rowCount: u.rows.length,
|
|
264
|
+
columnCount: u.headers.length
|
|
265
|
+
}, E = typeof r.fileName == "function" ? r.fileName(f) : r.fileName ?? it, S = await o.createContent(u, {
|
|
266
|
+
dateFormat: r.dateFormat ?? Ee,
|
|
267
|
+
sheetName: r.sheetName ?? E
|
|
268
|
+
}), d = `${E}.${o.extension}`, h = St(d, S, o.mimeType);
|
|
269
|
+
return { ...f, fileName: d, byteLength: h };
|
|
270
|
+
}
|
|
271
|
+
function xt(e) {
|
|
234
272
|
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
235
273
|
var t = e.default;
|
|
236
274
|
if (typeof t == "function") {
|
|
237
|
-
var
|
|
238
|
-
var
|
|
275
|
+
var r = function o() {
|
|
276
|
+
var n = !1;
|
|
239
277
|
try {
|
|
240
|
-
|
|
278
|
+
n = this instanceof o;
|
|
241
279
|
} catch {
|
|
242
280
|
}
|
|
243
|
-
return
|
|
281
|
+
return n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
244
282
|
};
|
|
245
|
-
|
|
246
|
-
} else
|
|
247
|
-
return Object.defineProperty(
|
|
248
|
-
var
|
|
249
|
-
Object.defineProperty(
|
|
283
|
+
r.prototype = t.prototype;
|
|
284
|
+
} else r = {};
|
|
285
|
+
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
|
|
286
|
+
var n = Object.getOwnPropertyDescriptor(e, o);
|
|
287
|
+
Object.defineProperty(r, o, n.get ? n : {
|
|
250
288
|
enumerable: !0,
|
|
251
289
|
get: function() {
|
|
252
290
|
return e[o];
|
|
253
291
|
}
|
|
254
292
|
});
|
|
255
|
-
}),
|
|
256
|
-
}
|
|
257
|
-
var I = { exports: {} },
|
|
258
|
-
const
|
|
259
|
-
var
|
|
260
|
-
function
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
var e =
|
|
264
|
-
function t(
|
|
265
|
-
return
|
|
293
|
+
}), r;
|
|
294
|
+
}
|
|
295
|
+
var I = { exports: {} }, X = {};
|
|
296
|
+
const _e = /* @__PURE__ */ xt(ze);
|
|
297
|
+
var re;
|
|
298
|
+
function _t() {
|
|
299
|
+
if (re) return X;
|
|
300
|
+
re = 1;
|
|
301
|
+
var e = _e;
|
|
302
|
+
function t(d, h) {
|
|
303
|
+
return d === h && (d !== 0 || 1 / d === 1 / h) || d !== d && h !== h;
|
|
266
304
|
}
|
|
267
|
-
var
|
|
268
|
-
function d
|
|
269
|
-
var
|
|
305
|
+
var r = typeof Object.is == "function" ? Object.is : t, o = e.useState, n = e.useEffect, s = e.useLayoutEffect, i = e.useDebugValue;
|
|
306
|
+
function u(d, h) {
|
|
307
|
+
var c = h(), m = o({ inst: { value: c, getSnapshot: h } }), g = m[0].inst, y = m[1];
|
|
270
308
|
return s(
|
|
271
309
|
function() {
|
|
272
|
-
|
|
310
|
+
g.value = c, g.getSnapshot = h, f(g) && y({ inst: g });
|
|
273
311
|
},
|
|
274
|
-
[
|
|
275
|
-
),
|
|
312
|
+
[d, c, h]
|
|
313
|
+
), n(
|
|
276
314
|
function() {
|
|
277
|
-
return
|
|
278
|
-
|
|
315
|
+
return f(g) && y({ inst: g }), d(function() {
|
|
316
|
+
f(g) && y({ inst: g });
|
|
279
317
|
});
|
|
280
318
|
},
|
|
281
|
-
[
|
|
282
|
-
), c
|
|
319
|
+
[d]
|
|
320
|
+
), i(c), c;
|
|
283
321
|
}
|
|
284
|
-
function
|
|
285
|
-
var h =
|
|
286
|
-
|
|
322
|
+
function f(d) {
|
|
323
|
+
var h = d.getSnapshot;
|
|
324
|
+
d = d.value;
|
|
287
325
|
try {
|
|
288
|
-
var
|
|
289
|
-
return !
|
|
326
|
+
var c = h();
|
|
327
|
+
return !r(d, c);
|
|
290
328
|
} catch {
|
|
291
329
|
return !0;
|
|
292
330
|
}
|
|
293
331
|
}
|
|
294
|
-
function E(
|
|
332
|
+
function E(d, h) {
|
|
295
333
|
return h();
|
|
296
334
|
}
|
|
297
|
-
var
|
|
298
|
-
return
|
|
299
|
-
}
|
|
300
|
-
var
|
|
301
|
-
var
|
|
302
|
-
function
|
|
303
|
-
return
|
|
304
|
-
function e(
|
|
305
|
-
return
|
|
335
|
+
var S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? E : u;
|
|
336
|
+
return X.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : S, X;
|
|
337
|
+
}
|
|
338
|
+
var H = {};
|
|
339
|
+
var oe;
|
|
340
|
+
function Ot() {
|
|
341
|
+
return oe || (oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
342
|
+
function e(c, m) {
|
|
343
|
+
return c === m && (c !== 0 || 1 / c === 1 / m) || c !== c && m !== m;
|
|
306
344
|
}
|
|
307
|
-
function t(
|
|
308
|
-
|
|
345
|
+
function t(c, m) {
|
|
346
|
+
S || n.startTransition === void 0 || (S = !0, console.error(
|
|
309
347
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
310
348
|
));
|
|
311
|
-
var
|
|
312
|
-
if (!
|
|
313
|
-
var
|
|
314
|
-
s(
|
|
349
|
+
var g = m();
|
|
350
|
+
if (!d) {
|
|
351
|
+
var y = m();
|
|
352
|
+
s(g, y) || (console.error(
|
|
315
353
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
316
|
-
),
|
|
354
|
+
), d = !0);
|
|
317
355
|
}
|
|
318
|
-
|
|
319
|
-
inst: { value:
|
|
356
|
+
y = i({
|
|
357
|
+
inst: { value: g, getSnapshot: m }
|
|
320
358
|
});
|
|
321
|
-
var a =
|
|
322
|
-
return
|
|
359
|
+
var a = y[0].inst, _ = y[1];
|
|
360
|
+
return f(
|
|
323
361
|
function() {
|
|
324
|
-
a.value =
|
|
362
|
+
a.value = g, a.getSnapshot = m, r(a) && _({ inst: a });
|
|
325
363
|
},
|
|
326
|
-
[
|
|
327
|
-
),
|
|
364
|
+
[c, g, m]
|
|
365
|
+
), u(
|
|
328
366
|
function() {
|
|
329
|
-
return
|
|
330
|
-
|
|
367
|
+
return r(a) && _({ inst: a }), c(function() {
|
|
368
|
+
r(a) && _({ inst: a });
|
|
331
369
|
});
|
|
332
370
|
},
|
|
333
|
-
[
|
|
334
|
-
), E(
|
|
371
|
+
[c]
|
|
372
|
+
), E(g), g;
|
|
335
373
|
}
|
|
336
|
-
function
|
|
337
|
-
var
|
|
338
|
-
|
|
374
|
+
function r(c) {
|
|
375
|
+
var m = c.getSnapshot;
|
|
376
|
+
c = c.value;
|
|
339
377
|
try {
|
|
340
|
-
var
|
|
341
|
-
return !s(
|
|
378
|
+
var g = m();
|
|
379
|
+
return !s(c, g);
|
|
342
380
|
} catch {
|
|
343
381
|
return !0;
|
|
344
382
|
}
|
|
345
383
|
}
|
|
346
|
-
function o(
|
|
347
|
-
return
|
|
384
|
+
function o(c, m) {
|
|
385
|
+
return m();
|
|
348
386
|
}
|
|
349
387
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
})()),
|
|
388
|
+
var n = _e, s = typeof Object.is == "function" ? Object.is : e, i = n.useState, u = n.useEffect, f = n.useLayoutEffect, E = n.useDebugValue, S = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : t;
|
|
389
|
+
H.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
390
|
+
})()), H;
|
|
353
391
|
}
|
|
354
|
-
var
|
|
355
|
-
function
|
|
356
|
-
return
|
|
392
|
+
var se;
|
|
393
|
+
function Tt() {
|
|
394
|
+
return se || (se = 1, process.env.NODE_ENV === "production" ? I.exports = _t() : I.exports = Ot()), I.exports;
|
|
357
395
|
}
|
|
358
|
-
var
|
|
359
|
-
const
|
|
360
|
-
|
|
396
|
+
var Oe = Tt();
|
|
397
|
+
const Rt = Object.keys(
|
|
398
|
+
P
|
|
399
|
+
);
|
|
400
|
+
function vt(e) {
|
|
401
|
+
let t = null, r = null;
|
|
402
|
+
const o = () => {
|
|
403
|
+
const n = e.getSnapshot();
|
|
404
|
+
return t === n && r || (t = n, r = {
|
|
405
|
+
attached: e.isAttached(),
|
|
406
|
+
columns: be(n.columns, n.columnOrder),
|
|
407
|
+
columnVisibilityMap: n.columnVisibilityMap,
|
|
408
|
+
theme: n.theme,
|
|
409
|
+
filteringEnabled: n.filteringEnabled,
|
|
410
|
+
canToggleFiltering: n.canToggleFiltering,
|
|
411
|
+
filtered: n.filtered
|
|
412
|
+
}), r;
|
|
413
|
+
};
|
|
414
|
+
return {
|
|
415
|
+
async exportGrid(n, s) {
|
|
416
|
+
return xe(
|
|
417
|
+
e.getSnapshot(),
|
|
418
|
+
n,
|
|
419
|
+
Se(s, e.getExportDefaults())
|
|
420
|
+
);
|
|
421
|
+
},
|
|
422
|
+
getExportFormats: () => Rt,
|
|
423
|
+
getColumns: () => o().columns,
|
|
424
|
+
isColumnVisible(n) {
|
|
425
|
+
const s = e.getSnapshot();
|
|
426
|
+
return s.columnVisibilityMap[n] === !1 ? !1 : s.columns.some(
|
|
427
|
+
(i) => F(i) === n
|
|
428
|
+
);
|
|
429
|
+
},
|
|
430
|
+
setColumnVisible(n, s) {
|
|
431
|
+
e.getSnapshot().setColumnVisible(n, s);
|
|
432
|
+
},
|
|
433
|
+
isFilteringEnabled: () => e.getSnapshot().filteringEnabled,
|
|
434
|
+
canToggleFiltering: () => e.getSnapshot().canToggleFiltering,
|
|
435
|
+
setFilteringEnabled(n) {
|
|
436
|
+
e.getSnapshot().setFilteringEnabled(n);
|
|
437
|
+
},
|
|
438
|
+
isFiltered: () => e.getSnapshot().filtered,
|
|
439
|
+
clearAllFilters() {
|
|
440
|
+
e.getSnapshot().clearAllFilters();
|
|
441
|
+
},
|
|
442
|
+
getViewRows: () => e.getSnapshot().getViewRows(),
|
|
443
|
+
getAllRows: () => e.getSnapshot().getAllRows(),
|
|
444
|
+
getState: o,
|
|
445
|
+
subscribe: (n) => e.subscribe(n)
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
const wt = [], Ct = [], Lt = {}, Ft = [], Dt = () => {
|
|
361
449
|
}, At = () => {
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
450
|
+
}, Nt = () => {
|
|
451
|
+
}, ae = () => Ft, L = {
|
|
452
|
+
columns: wt,
|
|
453
|
+
columnOrder: Ct,
|
|
454
|
+
columnVisibilityMap: Lt,
|
|
366
455
|
theme: "default",
|
|
367
|
-
setColumnVisible:
|
|
456
|
+
setColumnVisible: Dt,
|
|
368
457
|
filteringEnabled: !1,
|
|
369
458
|
canToggleFiltering: !1,
|
|
370
|
-
setFilteringEnabled:
|
|
459
|
+
setFilteringEnabled: At,
|
|
371
460
|
filtered: !1,
|
|
372
|
-
clearAllFilters:
|
|
373
|
-
getViewRows:
|
|
374
|
-
getAllRows:
|
|
461
|
+
clearAllFilters: Nt,
|
|
462
|
+
getViewRows: ae,
|
|
463
|
+
getAllRows: ae
|
|
375
464
|
};
|
|
376
|
-
function
|
|
377
|
-
return e === t || e.length === t.length && e.every((
|
|
465
|
+
function le(e, t) {
|
|
466
|
+
return e === t || e.length === t.length && e.every((r, o) => r === t[o]);
|
|
378
467
|
}
|
|
379
|
-
function
|
|
468
|
+
function Mt(e, t) {
|
|
380
469
|
if (e === t) return !0;
|
|
381
|
-
const
|
|
382
|
-
return
|
|
383
|
-
(
|
|
470
|
+
const r = Object.keys(e), o = Object.keys(t);
|
|
471
|
+
return r.length === o.length && r.every(
|
|
472
|
+
(n) => Object.prototype.hasOwnProperty.call(t, n) && e[n] === t[n]
|
|
384
473
|
);
|
|
385
474
|
}
|
|
386
475
|
function It(e, t) {
|
|
387
|
-
return
|
|
388
|
-
}
|
|
389
|
-
function
|
|
390
|
-
let e = null, t =
|
|
391
|
-
const
|
|
392
|
-
It(t,
|
|
393
|
-
}
|
|
476
|
+
return le(e.columns, t.columns) && le(e.columnOrder, t.columnOrder) && Mt(e.columnVisibilityMap, t.columnVisibilityMap) && e.theme === t.theme && e.setColumnVisible === t.setColumnVisible && e.filteringEnabled === t.filteringEnabled && e.canToggleFiltering === t.canToggleFiltering && e.setFilteringEnabled === t.setFilteringEnabled && e.filtered === t.filtered && e.clearAllFilters === t.clearAllFilters && e.getViewRows === t.getViewRows && e.getAllRows === t.getAllRows;
|
|
477
|
+
}
|
|
478
|
+
function Vt() {
|
|
479
|
+
let e = null, t = L, r;
|
|
480
|
+
const o = /* @__PURE__ */ new Set(), n = (f) => {
|
|
481
|
+
It(t, f) || (t = f, o.forEach((E) => E()));
|
|
482
|
+
}, s = () => t, i = () => r, u = (f) => (o.add(f), () => {
|
|
483
|
+
o.delete(f);
|
|
484
|
+
});
|
|
394
485
|
return {
|
|
486
|
+
api: vt({
|
|
487
|
+
getSnapshot: s,
|
|
488
|
+
subscribe: u,
|
|
489
|
+
getExportDefaults: i,
|
|
490
|
+
isAttached: () => t !== L
|
|
491
|
+
}),
|
|
395
492
|
createTargetRegistration() {
|
|
396
|
-
const
|
|
397
|
-
let
|
|
493
|
+
const f = /* @__PURE__ */ Symbol("rdg-toolbar-target");
|
|
494
|
+
let E = !1, S = null;
|
|
398
495
|
return {
|
|
399
496
|
controller: {
|
|
400
497
|
publish(d) {
|
|
401
|
-
|
|
498
|
+
S = d, E && e === f && n(d);
|
|
402
499
|
}
|
|
403
500
|
},
|
|
404
501
|
attach() {
|
|
405
|
-
if (e !== null && e !==
|
|
502
|
+
if (e !== null && e !== f)
|
|
406
503
|
throw new Error(
|
|
407
504
|
"RDGToolbarProvider supports one ReactDataGrid target. Use a separate provider for each grid."
|
|
408
505
|
);
|
|
409
|
-
return
|
|
410
|
-
|
|
506
|
+
return E = !0, e = f, S && n(S), () => {
|
|
507
|
+
E && (E = !1, e === f && (e = null, n(L)));
|
|
411
508
|
};
|
|
412
509
|
}
|
|
413
510
|
};
|
|
414
511
|
},
|
|
415
512
|
dispose() {
|
|
416
|
-
e = null, t =
|
|
513
|
+
e = null, t = L, r = void 0, o.clear();
|
|
417
514
|
},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
515
|
+
getExportDefaults: i,
|
|
516
|
+
getSnapshot: s,
|
|
517
|
+
getServerSnapshot: () => L,
|
|
518
|
+
setExportDefaults(f) {
|
|
519
|
+
r = f;
|
|
520
|
+
},
|
|
521
|
+
subscribe: u
|
|
423
522
|
};
|
|
424
523
|
}
|
|
425
|
-
const
|
|
524
|
+
const Te = Y(
|
|
426
525
|
null
|
|
427
526
|
);
|
|
428
|
-
function
|
|
429
|
-
const e =
|
|
527
|
+
function U() {
|
|
528
|
+
const e = pe(Te);
|
|
430
529
|
if (!e)
|
|
431
530
|
throw new Error(
|
|
432
531
|
"RDG toolbar components must be rendered inside RDGToolbarProvider."
|
|
433
532
|
);
|
|
434
533
|
return e;
|
|
435
534
|
}
|
|
436
|
-
function
|
|
437
|
-
const e =
|
|
438
|
-
return
|
|
535
|
+
function kt() {
|
|
536
|
+
const e = U();
|
|
537
|
+
return Oe.useSyncExternalStore(
|
|
439
538
|
e.subscribe,
|
|
440
539
|
e.getSnapshot,
|
|
441
540
|
e.getServerSnapshot
|
|
442
541
|
);
|
|
443
542
|
}
|
|
444
|
-
|
|
543
|
+
function zt() {
|
|
544
|
+
return U().api;
|
|
545
|
+
}
|
|
546
|
+
function Yt(e) {
|
|
547
|
+
return Oe.useSyncExternalStore(e.subscribe, e.getState, e.getState);
|
|
548
|
+
}
|
|
549
|
+
const V = {
|
|
445
550
|
export: "Export",
|
|
446
551
|
showFilters: "Show filters",
|
|
447
552
|
hideFilters: "Hide filters",
|
|
@@ -450,109 +555,91 @@ const N = {
|
|
|
450
555
|
exportSingle: {},
|
|
451
556
|
filteringControlledHint: "The grid owns its filter row through the enableFiltering prop."
|
|
452
557
|
};
|
|
453
|
-
function
|
|
454
|
-
return
|
|
455
|
-
}
|
|
456
|
-
function Vt(e) {
|
|
457
|
-
return typeof e.header == "string" && e.header.trim() || typeof e.header == "number" ? e.header : k(e);
|
|
458
|
-
}
|
|
459
|
-
function kt(e, t) {
|
|
460
|
-
const n = /* @__PURE__ */ new Map();
|
|
461
|
-
for (const r of e) {
|
|
462
|
-
const s = k(r);
|
|
463
|
-
s && !n.has(s) && n.set(s, r);
|
|
464
|
-
}
|
|
465
|
-
const o = [];
|
|
466
|
-
for (const r of t) {
|
|
467
|
-
const s = n.get(r);
|
|
468
|
-
s && (o.push(s), n.delete(r));
|
|
469
|
-
}
|
|
470
|
-
return o.push(...n.values()), o;
|
|
558
|
+
function Gt(e) {
|
|
559
|
+
return typeof e.header == "string" && e.header.trim() || typeof e.header == "number" ? e.header : F(e);
|
|
471
560
|
}
|
|
472
|
-
function
|
|
561
|
+
function qt(e) {
|
|
473
562
|
const {
|
|
474
563
|
children: t,
|
|
475
|
-
ariaLabel:
|
|
564
|
+
ariaLabel: r = "Visible column toggles",
|
|
476
565
|
title: o = "Visible columns",
|
|
477
|
-
description:
|
|
566
|
+
description: n = "Choose which columns are visible in the grid.",
|
|
478
567
|
showColumnToggles: s = !0,
|
|
479
|
-
showExport:
|
|
480
|
-
showFilterToggle:
|
|
481
|
-
showClearFilters:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
568
|
+
showExport: i = !1,
|
|
569
|
+
showFilterToggle: u = !1,
|
|
570
|
+
showClearFilters: f = !1,
|
|
571
|
+
// No literal defaults here: one would be indistinguishable from a passed
|
|
572
|
+
// value and would outrank the provider's `exportDefaults`.
|
|
573
|
+
exportScope: E,
|
|
574
|
+
exportFormats: S = yt,
|
|
575
|
+
exportFileName: d,
|
|
576
|
+
exportDateFormat: h,
|
|
577
|
+
exportSheetName: c,
|
|
578
|
+
onExportSuccess: m,
|
|
579
|
+
onExportError: g,
|
|
580
|
+
labels: y,
|
|
490
581
|
className: a
|
|
491
|
-
} = e, [
|
|
582
|
+
} = e, [_, O] = A(!1), C = U(), N = k("tdg-toolbar-title"), B = k("tdg-toolbar-description"), b = kt(), Q = he(b.theme), Ce = tt(Q), w = R(
|
|
492
583
|
() => ({
|
|
493
|
-
...
|
|
494
|
-
...
|
|
584
|
+
...V,
|
|
585
|
+
...y,
|
|
495
586
|
// A caller passing `exportFormats: undefined` out of a conditional would
|
|
496
587
|
// otherwise defeat the spread and leave the lookups below without a map.
|
|
497
|
-
exportFormats:
|
|
498
|
-
exportSingle:
|
|
499
|
-
filteringControlledHint:
|
|
588
|
+
exportFormats: y?.exportFormats ?? V.exportFormats,
|
|
589
|
+
exportSingle: y?.exportSingle ?? V.exportSingle,
|
|
590
|
+
filteringControlledHint: y?.filteringControlledHint ?? V.filteringControlledHint
|
|
500
591
|
}),
|
|
501
|
-
[
|
|
502
|
-
),
|
|
503
|
-
() =>
|
|
504
|
-
[
|
|
505
|
-
),
|
|
506
|
-
() =>
|
|
507
|
-
[
|
|
508
|
-
),
|
|
509
|
-
(
|
|
592
|
+
[y]
|
|
593
|
+
), $ = R(
|
|
594
|
+
() => be(b.columns, b.columnOrder),
|
|
595
|
+
[b.columnOrder, b.columns]
|
|
596
|
+
), Le = R(
|
|
597
|
+
() => $.filter((T) => T.hideable !== !1),
|
|
598
|
+
[$]
|
|
599
|
+
), Fe = $.reduce(
|
|
600
|
+
(T, x) => T + (b.columnVisibilityMap[F(x)] === !1 ? 0 : 1),
|
|
510
601
|
0
|
|
511
|
-
),
|
|
512
|
-
() =>
|
|
513
|
-
(
|
|
602
|
+
), Z = R(
|
|
603
|
+
() => S.filter(
|
|
604
|
+
(T) => P[T] != null
|
|
514
605
|
),
|
|
515
|
-
[
|
|
516
|
-
), De =
|
|
517
|
-
() =>
|
|
518
|
-
[
|
|
519
|
-
) === 0 ||
|
|
520
|
-
async (
|
|
521
|
-
|
|
522
|
-
if (!v) return;
|
|
523
|
-
const C = ae(g);
|
|
524
|
-
if (C.length === 0) return;
|
|
525
|
-
const B = E === "all" ? g.getAllRows() : g.getViewRows(), $ = mt(C, B), te = {
|
|
526
|
-
format: _,
|
|
527
|
-
scope: E,
|
|
528
|
-
rowCount: $.rows.length,
|
|
529
|
-
columnCount: $.headers.length
|
|
530
|
-
}, re = typeof f == "function" ? f(te) : f;
|
|
531
|
-
x(!0);
|
|
606
|
+
[S]
|
|
607
|
+
), De = R(
|
|
608
|
+
() => i ? ye(b).length : 0,
|
|
609
|
+
[i, b]
|
|
610
|
+
) === 0 || Z.length === 0, Ae = q(
|
|
611
|
+
async (T) => {
|
|
612
|
+
O(!0);
|
|
532
613
|
try {
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
614
|
+
const x = await xe(
|
|
615
|
+
b,
|
|
616
|
+
T,
|
|
617
|
+
Se(
|
|
618
|
+
{
|
|
619
|
+
scope: E,
|
|
620
|
+
fileName: d,
|
|
621
|
+
dateFormat: h,
|
|
622
|
+
sheetName: c
|
|
623
|
+
},
|
|
624
|
+
C.getExportDefaults()
|
|
625
|
+
)
|
|
540
626
|
);
|
|
541
|
-
|
|
542
|
-
} catch (
|
|
543
|
-
|
|
627
|
+
x && m?.(x);
|
|
628
|
+
} catch (x) {
|
|
629
|
+
g?.(x), g || console.error(x);
|
|
544
630
|
} finally {
|
|
545
|
-
|
|
631
|
+
O(!1);
|
|
546
632
|
}
|
|
547
633
|
},
|
|
548
634
|
[
|
|
549
635
|
h,
|
|
550
|
-
|
|
636
|
+
d,
|
|
551
637
|
E,
|
|
552
|
-
|
|
638
|
+
c,
|
|
639
|
+
g,
|
|
553
640
|
m,
|
|
554
|
-
|
|
555
|
-
|
|
641
|
+
b,
|
|
642
|
+
C
|
|
556
643
|
]
|
|
557
644
|
);
|
|
558
645
|
return /* @__PURE__ */ l(
|
|
@@ -560,238 +647,243 @@ function Wt(e) {
|
|
|
560
647
|
{
|
|
561
648
|
className: a ? `tdg-toolbar-root ${a}` : "tdg-toolbar-root",
|
|
562
649
|
"data-slot": "rdg-toolbar",
|
|
563
|
-
"data-theme":
|
|
564
|
-
"data-theme-base":
|
|
650
|
+
"data-theme": Q,
|
|
651
|
+
"data-theme-base": Ce,
|
|
565
652
|
role: o != null ? "region" : void 0,
|
|
566
|
-
"aria-labelledby": o != null ?
|
|
567
|
-
"aria-describedby":
|
|
653
|
+
"aria-labelledby": o != null ? N : void 0,
|
|
654
|
+
"aria-describedby": n != null ? B : void 0
|
|
568
655
|
},
|
|
569
|
-
o != null ||
|
|
656
|
+
o != null || n != null ? /* @__PURE__ */ l("div", { "data-slot": "rdg-toolbar-heading" }, o != null ? /* @__PURE__ */ l(
|
|
570
657
|
"div",
|
|
571
658
|
{
|
|
572
|
-
id:
|
|
659
|
+
id: N,
|
|
573
660
|
"data-slot": "rdg-toolbar-title",
|
|
574
661
|
role: "heading",
|
|
575
662
|
"aria-level": 2
|
|
576
663
|
},
|
|
577
664
|
o
|
|
578
|
-
) : null,
|
|
665
|
+
) : null, n != null ? /* @__PURE__ */ l("div", { id: B, "data-slot": "rdg-toolbar-description" }, n) : null) : null,
|
|
579
666
|
/* @__PURE__ */ l("div", { "data-slot": "rdg-toolbar-body" }, s ? /* @__PURE__ */ l(
|
|
580
667
|
"div",
|
|
581
668
|
{
|
|
582
669
|
role: "group",
|
|
583
|
-
"aria-label":
|
|
584
|
-
"aria-describedby":
|
|
670
|
+
"aria-label": r,
|
|
671
|
+
"aria-describedby": n != null ? B : void 0,
|
|
585
672
|
"data-slot": "rdg-column-toggle-list"
|
|
586
673
|
},
|
|
587
|
-
|
|
588
|
-
const
|
|
674
|
+
Le.map((T) => {
|
|
675
|
+
const x = F(T), M = b.columnVisibilityMap[x] !== !1, Ne = M && Fe <= 1;
|
|
589
676
|
return /* @__PURE__ */ l(
|
|
590
677
|
"button",
|
|
591
678
|
{
|
|
592
|
-
key:
|
|
679
|
+
key: x,
|
|
593
680
|
type: "button",
|
|
594
|
-
"aria-pressed":
|
|
595
|
-
disabled:
|
|
596
|
-
"data-state":
|
|
681
|
+
"aria-pressed": M,
|
|
682
|
+
disabled: Ne,
|
|
683
|
+
"data-state": M ? "on" : "off",
|
|
597
684
|
"data-slot": "rdg-column-toggle",
|
|
598
|
-
"data-column-id":
|
|
599
|
-
onClick: () =>
|
|
685
|
+
"data-column-id": x,
|
|
686
|
+
onClick: () => b.setColumnVisible(x, !M)
|
|
600
687
|
},
|
|
601
|
-
|
|
688
|
+
Gt(T)
|
|
602
689
|
);
|
|
603
690
|
})
|
|
604
|
-
) : null,
|
|
605
|
-
|
|
691
|
+
) : null, i || u || f || t != null ? /* @__PURE__ */ l("div", { "data-slot": "rdg-toolbar-actions" }, i ? /* @__PURE__ */ l(
|
|
692
|
+
jt,
|
|
606
693
|
{
|
|
607
|
-
disabled: De ||
|
|
608
|
-
formats:
|
|
694
|
+
disabled: De || _,
|
|
695
|
+
formats: Z,
|
|
609
696
|
label: w.export,
|
|
610
697
|
formatLabels: w.exportFormats,
|
|
611
698
|
singleLabels: w.exportSingle,
|
|
612
699
|
onExport: Ae
|
|
613
700
|
}
|
|
614
|
-
) : null,
|
|
701
|
+
) : null, u ? /* @__PURE__ */ l(
|
|
615
702
|
"button",
|
|
616
703
|
{
|
|
617
704
|
type: "button",
|
|
618
|
-
"aria-pressed":
|
|
619
|
-
"data-state":
|
|
705
|
+
"aria-pressed": b.filteringEnabled,
|
|
706
|
+
"data-state": b.filteringEnabled ? "on" : "off",
|
|
620
707
|
"data-slot": "rdg-toolbar-filter-toggle",
|
|
621
|
-
disabled: !
|
|
622
|
-
title:
|
|
623
|
-
onClick: () =>
|
|
708
|
+
disabled: !b.canToggleFiltering,
|
|
709
|
+
title: b.canToggleFiltering ? void 0 : w.filteringControlledHint,
|
|
710
|
+
onClick: () => b.setFilteringEnabled(!b.filteringEnabled)
|
|
624
711
|
},
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
) : null,
|
|
712
|
+
b.filteringEnabled ? /* @__PURE__ */ l(Qe, null) : /* @__PURE__ */ l(Je, null),
|
|
713
|
+
b.filteringEnabled ? w.hideFilters : w.showFilters
|
|
714
|
+
) : null, f ? /* @__PURE__ */ l(
|
|
628
715
|
"button",
|
|
629
716
|
{
|
|
630
717
|
type: "button",
|
|
631
718
|
"data-slot": "rdg-toolbar-clear-filters",
|
|
632
|
-
disabled: !
|
|
633
|
-
onClick: () =>
|
|
719
|
+
disabled: !b.filtered,
|
|
720
|
+
onClick: () => b.clearAllFilters()
|
|
634
721
|
},
|
|
635
|
-
/* @__PURE__ */ l(
|
|
722
|
+
/* @__PURE__ */ l(Ze, null),
|
|
636
723
|
w.clearFilters
|
|
637
724
|
) : null, t) : null)
|
|
638
725
|
);
|
|
639
726
|
}
|
|
640
|
-
function
|
|
641
|
-
const { disabled: t, formats:
|
|
642
|
-
|
|
643
|
-
if (!
|
|
644
|
-
const a = (
|
|
645
|
-
const
|
|
646
|
-
|
|
727
|
+
function jt(e) {
|
|
728
|
+
const { disabled: t, formats: r, label: o, formatLabels: n, singleLabels: s, onExport: i } = e, [u, f] = A(!1), E = K(null), S = K(null), d = k("tdg-toolbar-export-menu"), h = k("tdg-toolbar-export-trigger"), c = r.length === 1 ? r[0] : null, m = (a) => n[a] ?? P[a].label;
|
|
729
|
+
D(() => {
|
|
730
|
+
if (!u) return;
|
|
731
|
+
const a = (_) => {
|
|
732
|
+
const O = E.current;
|
|
733
|
+
O && !O.contains(_.target) && f(!1);
|
|
647
734
|
};
|
|
648
735
|
return document.addEventListener("pointerdown", a, !0), () => document.removeEventListener("pointerdown", a, !0);
|
|
649
|
-
}, [
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
}, []),
|
|
653
|
-
const
|
|
736
|
+
}, [u]);
|
|
737
|
+
const g = q(() => {
|
|
738
|
+
f(!1), S.current?.focus();
|
|
739
|
+
}, []), y = (a, _) => {
|
|
740
|
+
const O = Array.from(
|
|
654
741
|
E.current?.querySelectorAll(
|
|
655
742
|
'[data-slot="rdg-toolbar-export-format"]'
|
|
656
743
|
) ?? []
|
|
657
744
|
);
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
|
|
745
|
+
if (O.length === 0) return;
|
|
746
|
+
const C = O.indexOf(a), N = C < 0 ? 0 : (C + _ + O.length) % O.length;
|
|
747
|
+
O[N]?.focus();
|
|
661
748
|
};
|
|
662
|
-
return
|
|
749
|
+
return c ? /* @__PURE__ */ l(
|
|
663
750
|
"button",
|
|
664
751
|
{
|
|
665
752
|
type: "button",
|
|
666
753
|
"data-slot": "rdg-toolbar-export",
|
|
667
|
-
"data-export-format":
|
|
754
|
+
"data-export-format": c,
|
|
668
755
|
disabled: t,
|
|
669
756
|
onClick: () => {
|
|
670
|
-
c
|
|
757
|
+
i(c);
|
|
671
758
|
}
|
|
672
759
|
},
|
|
673
|
-
/* @__PURE__ */ l(
|
|
674
|
-
s[
|
|
760
|
+
/* @__PURE__ */ l(te, null),
|
|
761
|
+
s[c] ?? /* @__PURE__ */ l(de, null, o, " ", m(c))
|
|
675
762
|
) : /* @__PURE__ */ l("div", { "data-slot": "rdg-toolbar-export-wrapper", ref: E }, /* @__PURE__ */ l(
|
|
676
763
|
"button",
|
|
677
764
|
{
|
|
678
765
|
type: "button",
|
|
679
|
-
ref:
|
|
766
|
+
ref: S,
|
|
680
767
|
id: h,
|
|
681
768
|
"data-slot": "rdg-toolbar-export",
|
|
682
|
-
"data-state":
|
|
769
|
+
"data-state": u ? "on" : "off",
|
|
683
770
|
"aria-haspopup": "menu",
|
|
684
|
-
"aria-expanded":
|
|
685
|
-
"aria-controls":
|
|
771
|
+
"aria-expanded": u,
|
|
772
|
+
"aria-controls": u ? d : void 0,
|
|
686
773
|
disabled: t,
|
|
687
|
-
onClick: () =>
|
|
774
|
+
onClick: () => f((a) => !a),
|
|
688
775
|
onKeyDown: (a) => {
|
|
689
|
-
(a.key === "ArrowDown" || a.key === "ArrowUp") && (a.preventDefault(),
|
|
776
|
+
(a.key === "ArrowDown" || a.key === "ArrowUp") && (a.preventDefault(), f(!0));
|
|
690
777
|
}
|
|
691
778
|
},
|
|
692
|
-
/* @__PURE__ */ l(
|
|
779
|
+
/* @__PURE__ */ l(te, null),
|
|
693
780
|
o
|
|
694
|
-
),
|
|
781
|
+
), u ? /* @__PURE__ */ l(
|
|
695
782
|
"div",
|
|
696
783
|
{
|
|
697
|
-
id:
|
|
784
|
+
id: d,
|
|
698
785
|
role: "menu",
|
|
699
786
|
"aria-labelledby": h,
|
|
700
787
|
"data-slot": "rdg-toolbar-export-menu",
|
|
701
788
|
onKeyDown: (a) => {
|
|
702
789
|
if (a.key === "Escape") {
|
|
703
|
-
a.stopPropagation(),
|
|
790
|
+
a.stopPropagation(), g();
|
|
704
791
|
return;
|
|
705
792
|
}
|
|
706
793
|
if (a.key === "ArrowDown") {
|
|
707
|
-
a.preventDefault(),
|
|
794
|
+
a.preventDefault(), y(a.target, 1);
|
|
708
795
|
return;
|
|
709
796
|
}
|
|
710
|
-
a.key === "ArrowUp" && (a.preventDefault(),
|
|
797
|
+
a.key === "ArrowUp" && (a.preventDefault(), y(a.target, -1));
|
|
711
798
|
}
|
|
712
799
|
},
|
|
713
|
-
|
|
800
|
+
r.map((a, _) => /* @__PURE__ */ l(
|
|
714
801
|
"button",
|
|
715
802
|
{
|
|
716
803
|
key: a,
|
|
717
804
|
type: "button",
|
|
718
805
|
role: "menuitem",
|
|
719
|
-
autoFocus:
|
|
806
|
+
autoFocus: _ === 0,
|
|
720
807
|
"data-slot": "rdg-toolbar-export-format",
|
|
721
808
|
"data-export-format": a,
|
|
722
809
|
onClick: () => {
|
|
723
|
-
|
|
810
|
+
g(), i(a);
|
|
724
811
|
}
|
|
725
812
|
},
|
|
726
|
-
|
|
813
|
+
m(a)
|
|
727
814
|
))
|
|
728
815
|
) : null);
|
|
729
816
|
}
|
|
730
|
-
const
|
|
731
|
-
function
|
|
732
|
-
return typeof e != "function" && typeof e != "object" || !e ? !1 : e ===
|
|
817
|
+
const Pt = /* @__PURE__ */ Symbol.for("@geovi/the-datagrid/toolbar-target");
|
|
818
|
+
function Re(e) {
|
|
819
|
+
return typeof e != "function" && typeof e != "object" || !e ? !1 : e === Me || e[Pt] === !0;
|
|
733
820
|
}
|
|
734
|
-
const
|
|
821
|
+
const Ut = /* @__PURE__ */ Symbol.for(
|
|
735
822
|
"@geovi/the-datagrid/search-target-component"
|
|
736
|
-
),
|
|
823
|
+
), ve = /* @__PURE__ */ Symbol.for(
|
|
737
824
|
"@geovi/the-datagrid/toolbar-target-component"
|
|
738
825
|
);
|
|
739
|
-
function
|
|
826
|
+
function ie(e, t) {
|
|
740
827
|
return typeof e != "function" && typeof e != "object" || !e ? !1 : e[t] === !0;
|
|
741
828
|
}
|
|
742
|
-
function
|
|
743
|
-
return
|
|
829
|
+
function Bt(e) {
|
|
830
|
+
return ie(e, Ut) || ie(e, ve);
|
|
744
831
|
}
|
|
745
|
-
function
|
|
746
|
-
let
|
|
832
|
+
function $t(e, t) {
|
|
833
|
+
let r = e;
|
|
747
834
|
const o = /* @__PURE__ */ new Set();
|
|
748
|
-
for (; !o.has(
|
|
749
|
-
if (o.add(
|
|
750
|
-
return
|
|
751
|
-
if (!
|
|
752
|
-
const
|
|
753
|
-
if (!G(
|
|
754
|
-
|
|
835
|
+
for (; !o.has(r); ) {
|
|
836
|
+
if (o.add(r), t(r.type))
|
|
837
|
+
return r;
|
|
838
|
+
if (!Bt(r.type)) return null;
|
|
839
|
+
const n = r.props.children;
|
|
840
|
+
if (!G(n)) return null;
|
|
841
|
+
r = n;
|
|
755
842
|
}
|
|
756
843
|
return null;
|
|
757
844
|
}
|
|
758
|
-
function
|
|
845
|
+
function Xt(e, t) {
|
|
759
846
|
typeof e != "function" && typeof e != "object" || !e || Object.defineProperty(e, t, { value: !0 });
|
|
760
847
|
}
|
|
761
|
-
function
|
|
762
|
-
const { children: t } = e,
|
|
848
|
+
function we(e) {
|
|
849
|
+
const { children: t } = e, r = e.__rdgSearchController, o = U(), n = R(
|
|
763
850
|
() => o.createTargetRegistration(),
|
|
764
851
|
[o]
|
|
765
852
|
);
|
|
766
|
-
if (
|
|
853
|
+
if (D(() => n.attach(), [n]), !G(t))
|
|
767
854
|
throw new Error(
|
|
768
855
|
"RDGToolbarTarget expects exactly one ReactDataGrid child."
|
|
769
856
|
);
|
|
770
|
-
if (
|
|
857
|
+
if (!$t(t, Re))
|
|
771
858
|
throw new Error("RDGToolbarTarget expects a ReactDataGrid child.");
|
|
772
859
|
const s = {
|
|
773
|
-
__rdgToolbarController:
|
|
860
|
+
__rdgToolbarController: n.controller
|
|
774
861
|
};
|
|
775
|
-
return
|
|
862
|
+
return r !== void 0 && (s.__rdgSearchController = r), fe(
|
|
776
863
|
t,
|
|
777
864
|
s
|
|
778
865
|
);
|
|
779
866
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
()
|
|
867
|
+
Xt(we, ve);
|
|
868
|
+
const Ht = typeof window > "u" ? D : ge;
|
|
869
|
+
function Jt(e) {
|
|
870
|
+
const { children: t, apiRef: r, exportDefaults: o } = e, [n] = A(Vt);
|
|
871
|
+
D(() => () => n.dispose(), [n]), Ht(() => {
|
|
872
|
+
n.setExportDefaults(o);
|
|
873
|
+
}, [n, o]), me(r, () => n.api, [n]);
|
|
874
|
+
const s = R(
|
|
875
|
+
() => ue.map(
|
|
786
876
|
t,
|
|
787
|
-
(
|
|
877
|
+
(i) => G(i) && Re(i.type) ? /* @__PURE__ */ l(we, null, i) : i
|
|
788
878
|
),
|
|
789
879
|
[t]
|
|
790
880
|
);
|
|
791
|
-
return /* @__PURE__ */ l(
|
|
881
|
+
return /* @__PURE__ */ l(Te.Provider, { value: n }, s);
|
|
792
882
|
}
|
|
793
883
|
export {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
884
|
+
qt as RDGToolbar,
|
|
885
|
+
Jt as RDGToolbarProvider,
|
|
886
|
+
we as RDGToolbarTarget,
|
|
887
|
+
zt as useRDGToolbarApi,
|
|
888
|
+
Yt as useRDGToolbarApiState
|
|
797
889
|
};
|