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