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