@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.
Files changed (66) hide show
  1. package/README.md +47 -1253
  2. package/dist/BoolEditor.cjs +1 -1
  3. package/dist/BoolEditor.js +235 -222
  4. package/dist/DateEditor.cjs +1 -1
  5. package/dist/DateEditor.js +297 -273
  6. package/dist/DateFilter.cjs +1 -1
  7. package/dist/DateFilter.js +65 -63
  8. package/dist/NumberFilter.cjs +1 -1
  9. package/dist/NumberFilter.js +104 -102
  10. package/dist/NumericEditor.cjs +1 -1
  11. package/dist/NumericEditor.js +296 -277
  12. package/dist/SelectEditor.cjs +42 -0
  13. package/dist/SelectEditor.js +6703 -0
  14. package/dist/StringFilter.cjs +1 -1
  15. package/dist/StringFilter.js +121 -119
  16. package/dist/TextEditor.cjs +2 -0
  17. package/dist/TextEditor.js +2972 -0
  18. package/dist/base.css +1 -1
  19. package/dist/community-package-manifest.json +3 -1
  20. package/dist/components/ui/input.d.ts +2 -0
  21. package/dist/components/ui/input.d.ts.map +1 -1
  22. package/dist/editors/BoolEditor.d.ts +1 -1
  23. package/dist/editors/BoolEditor.d.ts.map +1 -1
  24. package/dist/editors/DateEditor.d.ts +1 -1
  25. package/dist/editors/DateEditor.d.ts.map +1 -1
  26. package/dist/editors/NumericEditor.d.ts +1 -1
  27. package/dist/editors/NumericEditor.d.ts.map +1 -1
  28. package/dist/editors/SelectEditor.d.ts +27 -0
  29. package/dist/editors/SelectEditor.d.ts.map +1 -0
  30. package/dist/editors/TextEditor.d.ts +27 -0
  31. package/dist/editors/TextEditor.d.ts.map +1 -0
  32. package/dist/editors/editorTypes.d.ts +24 -0
  33. package/dist/editors/editorTypes.d.ts.map +1 -1
  34. package/dist/editors/index.d.ts +5 -0
  35. package/dist/editors/index.d.ts.map +1 -1
  36. package/dist/grid/ReactDataGrid.d.ts.map +1 -1
  37. package/dist/grid/components/GridBody.d.ts.map +1 -1
  38. package/dist/grid/components/GridContextMenuLayer.d.ts.map +1 -1
  39. package/dist/grid/hooks/useGridEditing.d.ts.map +1 -1
  40. package/dist/grid/menuRuntime.d.ts +27 -0
  41. package/dist/grid/menuRuntime.d.ts.map +1 -0
  42. package/dist/index.cjs +13 -13
  43. package/dist/index.css +1 -1
  44. package/dist/index.js +9435 -9164
  45. package/dist/main.d.ts +2 -2
  46. package/dist/main.d.ts.map +1 -1
  47. package/dist/style/theme/amber-dark/index.css +1 -1
  48. package/dist/style/theme/amber-light/index.css +1 -1
  49. package/dist/style/theme/blue-dark/index.css +1 -1
  50. package/dist/style/theme/blue-light/index.css +1 -1
  51. package/dist/style/theme/default-dark/index.css +1 -1
  52. package/dist/style/theme/default-light/index.css +1 -1
  53. package/dist/style/theme/green-dark/index.css +1 -1
  54. package/dist/style/theme/green-light/index.css +1 -1
  55. package/dist/style/theme/pink-dark/index.css +1 -1
  56. package/dist/style/theme/pink-light/index.css +1 -1
  57. package/dist/toolbar/RDGToolbar.d.ts.map +1 -1
  58. package/dist/toolbar/icons.d.ts +0 -2
  59. package/dist/toolbar/icons.d.ts.map +1 -1
  60. package/dist/toolbar/runtime.d.ts +7 -0
  61. package/dist/toolbar/runtime.d.ts.map +1 -1
  62. package/dist/toolbar.css +1 -1
  63. package/dist/toolbar.js +548 -651
  64. package/dist/types.d.ts +7 -0
  65. package/dist/types.d.ts.map +1 -1
  66. 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 ye from "react";
4
- import Ke from "./index.js";
5
- const We = ye, m = We.default ?? ye, Ee = m.Children, ze = m.Component, U = m.Fragment, Ye = m.PureComponent, Se = m.cloneElement, Z = m.createContext, r = m.createElement, qe = m.createRef, Je = m.forwardRef, B = m.isValidElement, Qe = m.lazy, Ze = m.memo, L = m.useCallback, xe = m.useContext, et = m.useDebugValue, tt = m.useDeferredValue, A = m.useEffect, J = m.useId, ve = m.useImperativeHandle, ot = m.useInsertionEffect, _e = m.useLayoutEffect, O = m.useMemo, nt = m.useReducer, N = m.useRef, C = m.useState, rt = m.use, at = m.version, lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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: Ee,
8
- Component: ze,
9
- Fragment: U,
10
- PureComponent: Ye,
11
- cloneElement: Se,
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: qe,
15
- default: m,
16
- forwardRef: Je,
17
- isValidElement: B,
18
- lazy: Qe,
19
- memo: Ze,
20
- use: rt,
21
- useCallback: L,
22
- useContext: xe,
23
- useDebugValue: et,
24
- useDeferredValue: tt,
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: ve,
28
- useInsertionEffect: ot,
29
- useLayoutEffect: _e,
30
- useMemo: O,
31
- useReducer: nt,
32
- useRef: N,
27
+ useImperativeHandle: Oe,
28
+ useInsertionEffect: ct,
29
+ useLayoutEffect: Ce,
30
+ useMemo: T,
31
+ useReducer: ut,
32
+ useRef: dt,
33
33
  useState: C,
34
- version: at
34
+ version: pt
35
35
  }, Symbol.toStringTag, { value: "Module" }));
36
- function st(e) {
36
+ function mt(e) {
37
37
  const [t, n] = C(!1);
38
38
  return A(() => {
39
- const a = window.matchMedia(e), o = () => n(a.matches);
40
- return o(), a.addEventListener("change", o), () => a.removeEventListener("change", 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 ce = 0;
44
- function it(e) {
45
- const [t] = C(() => (ce += 1, `${e}-${ce}`));
43
+ let fe = 0;
44
+ function ht(e) {
45
+ const [t] = C(() => (fe += 1, `${e}-${fe}`));
46
46
  return t;
47
47
  }
48
- const ct = typeof J == "function" ? (e) => `${e}-${J()}` : it;
49
- function F(e = "tdg") {
50
- return ct(e);
48
+ const bt = typeof J == "function" ? (e) => `${e}-${J()}` : ht;
49
+ function K(e = "tdg") {
50
+ return bt(e);
51
51
  }
52
- function D(e) {
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 ue(e) {
71
- return /* @__PURE__ */ r(D, { ...e }, /* @__PURE__ */ r("path", { d: "M12 3v12" }), /* @__PURE__ */ r("path", { d: "m7 10 5 5 5-5" }), /* @__PURE__ */ r("path", { d: "M4 21h16" }));
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 dt(e) {
77
- return /* @__PURE__ */ r(D, { ...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" }));
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 ft(e) {
80
- return /* @__PURE__ */ r(D, { ...e }, /* @__PURE__ */ r("path", { d: "M3 12a9 9 0 1 0 3-6.7" }), /* @__PURE__ */ r("path", { d: "M3 4v5h5" }));
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 pt(e) {
83
- return /* @__PURE__ */ r(D, { ...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" }));
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 gt(e) {
86
- return /* @__PURE__ */ r(D, { ...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" }));
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 mt(e) {
89
- return /* @__PURE__ */ r(D, { ...e }, /* @__PURE__ */ r("path", { d: "m5 12 4 4L19 6" }));
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(D, { ...e }, /* @__PURE__ */ r("path", { d: "m6 9 6 6 6-6" }));
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 Te(e) {
97
+ function Le(e) {
101
98
  const t = String(e ?? R).trim();
102
99
  return t.length > 0 ? t : R;
103
100
  }
104
- function bt(e) {
105
- return Te(e).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || R;
101
+ function _t(e) {
102
+ return Le(e).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || R;
106
103
  }
107
- function ht(e) {
108
- const t = bt(e);
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 V(e) {
108
+ function D(e) {
112
109
  return String(e.id ?? e.name ?? "");
113
110
  }
114
- function Oe(e, t) {
111
+ function Me(e, t) {
115
112
  const n = /* @__PURE__ */ new Map();
116
113
  for (const o of e) {
117
- const s = V(o);
118
- s && !n.has(s) && n.set(s, o);
114
+ const a = D(o);
115
+ a && !n.has(a) && n.set(a, o);
119
116
  }
120
- const a = [];
117
+ const l = [];
121
118
  for (const o of t) {
122
- const s = n.get(o);
123
- s && (a.push(s), n.delete(o));
119
+ const a = n.get(o);
120
+ a && (l.push(a), n.delete(o));
124
121
  }
125
- return a.push(...n.values()), a;
122
+ return l.push(...n.values()), l;
126
123
  }
127
- const yt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Re = "yyyy-mm-dd hh:mm";
128
- class Et extends Error {
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 St extends Error {
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 xt(e) {
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 vt() {
143
+ async function Lt() {
147
144
  try {
148
145
  return await import("xlsx");
149
146
  } catch (e) {
150
- throw new Et(e);
147
+ throw new Ot(e);
151
148
  }
152
149
  }
153
- async function _t(e, t = {}) {
154
- const { dateFormat: n = Re, sheetName: a = "Export" } = t, o = await vt(), s = {
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 c = o.utils.aoa_to_sheet(
156
+ const s = o.utils.aoa_to_sheet(
160
157
  [e.headers, ...e.rows],
161
- s
162
- ), d = o.utils.book_new();
163
- return o.utils.book_append_sheet(d, c, xt(a)), o.write(d, {
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
- ...s
163
+ ...a
167
164
  });
168
- } catch (c) {
169
- throw new St(n, c);
165
+ } catch (s) {
166
+ throw new Ct(n, s);
170
167
  }
171
168
  }
172
- const wt = "grid-export", Tt = "view", Ot = `\r
173
- `, Rt = "\uFEFF";
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 Ct(e) {
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 Ce(e) {
184
- const { columns: t, columnOrder: n, columnVisibilityMap: a } = e, o = /* @__PURE__ */ new Map();
185
- for (const c of t) {
186
- const d = Q(c);
187
- d && !o.has(d) && o.set(d, c);
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 s = [];
190
- for (const c of n) {
191
- const d = o.get(c);
192
- d && (s.push(d), o.delete(c));
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 s.push(...o.values()), s.filter((c) => c.exportable === !1 || !ee(c) ? !1 : c.exportWhenHidden ? !0 : a[Q(c)] !== !1);
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 Dt(e, t) {
193
+ function Vt(e, t) {
197
194
  if (!(typeof e != "object" || e == null))
198
195
  return e[t];
199
196
  }
200
- function Lt(e, t) {
201
- const n = Dt(t, ee(e));
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 At(e, t) {
206
+ function Pt(e, t) {
210
207
  return {
211
- headers: e.map(Ct),
208
+ headers: e.map(Nt),
212
209
  fields: e.map(ee),
213
210
  rows: t.map(
214
- (n) => e.map((a) => Lt(a, n))
211
+ (n) => e.map((l) => Gt(l, n))
215
212
  )
216
213
  };
217
214
  }
218
- function Ft(e) {
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 de(e) {
222
- const t = Ft(e);
218
+ function ge(e) {
219
+ const t = kt(e);
223
220
  return /["\n\r,]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t;
224
221
  }
225
- function It(e) {
222
+ function jt(e) {
226
223
  const t = [
227
- e.headers.map(de).join(","),
228
- ...e.rows.map((n) => n.map(de).join(","))
224
+ e.headers.map(ge).join(","),
225
+ ...e.rows.map((n) => n.map(ge).join(","))
229
226
  ];
230
- return `${Rt}${t.join(Ot)}`;
227
+ return `${It}${t.join(At)}`;
231
228
  }
232
- function Mt(e) {
229
+ function Ut(e) {
233
230
  const t = e.rows.map(
234
231
  (n) => Object.fromEntries(
235
- n.map((a, o) => [
232
+ n.map((l, o) => [
236
233
  e.fields[o],
237
- a === void 0 ? null : a
234
+ l === void 0 ? null : l
238
235
  ])
239
236
  )
240
237
  );
241
238
  return JSON.stringify(t, null, 2);
242
239
  }
243
- const H = {
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) => It(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) => Mt(e)
251
+ createContent: (e) => Ut(e)
255
252
  },
256
253
  xlsx: {
257
254
  label: "Excel",
258
255
  extension: "xlsx",
259
- mimeType: yt,
260
- createContent: (e, t) => _t(e, t)
256
+ mimeType: Rt,
257
+ createContent: (e, t) => Mt(e, t)
261
258
  }
262
- }, kt = ["csv", "json"];
263
- function Nt(e, t, n) {
259
+ }, Bt = ["csv", "json"];
260
+ function Ht(e, t, n) {
264
261
  if (typeof document > "u" || typeof URL > "u") return 0;
265
- const a = new Blob([t], { type: n }), o = URL.createObjectURL(a), s = document.createElement("a");
266
- return s.href = o, s.download = e, s.rel = "noopener", document.body.append(s), s.click(), s.remove(), URL.revokeObjectURL(o), a.size;
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 De(...e) {
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 Le(e, t, n = {}) {
275
- const a = H[t];
276
- if (!a) return null;
277
- const o = Ce(e);
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 s = n.scope ?? Tt, c = s === "all" ? e.getAllRows() : e.getViewRows(), d = At(o, c), p = {
276
+ const a = n.scope ?? Dt, s = a === "all" ? e.getAllRows() : e.getViewRows(), i = Pt(o, s), c = {
280
277
  format: t,
281
- scope: s,
282
- rowCount: d.rows.length,
283
- columnCount: d.headers.length
284
- }, y = typeof n.fileName == "function" ? n.fileName(p) : n.fileName ?? wt, x = await a.createContent(d, {
285
- dateFormat: n.dateFormat ?? Re,
286
- sheetName: n.sheetName ?? y
287
- }), f = `${y}.${a.extension}`, g = Nt(f, x, a.mimeType);
288
- return { ...p, fileName: f, byteLength: g };
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
- function Vt(e) {
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 a() {
307
+ var n = function l() {
295
308
  var o = !1;
296
309
  try {
297
- o = this instanceof a;
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(a) {
305
- var o = Object.getOwnPropertyDescriptor(e, a);
306
- Object.defineProperty(n, a, o.get ? o : {
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[a];
322
+ return e[l];
310
323
  }
311
324
  });
312
325
  }), n;
313
326
  }
314
- var P = { exports: {} }, Y = {};
315
- const Ae = /* @__PURE__ */ Vt(lt);
316
- var fe;
317
- function Gt() {
318
- if (fe) return Y;
319
- fe = 1;
320
- var e = Ae;
321
- function t(f, g) {
322
- return f === g && (f !== 0 || 1 / f === 1 / g) || f !== f && g !== g;
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, a = e.useState, o = e.useEffect, s = e.useLayoutEffect, c = e.useDebugValue;
325
- function d(f, g) {
326
- var u = g(), b = a({ inst: { value: u, getSnapshot: g } }), l = b[0].inst, h = b[1];
327
- return s(
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
- l.value = u, l.getSnapshot = g, p(l) && h({ inst: l });
342
+ S.value = f, S.getSnapshot = E, c(S) && y({ inst: S });
330
343
  },
331
- [f, u, g]
344
+ [d, f, E]
332
345
  ), o(
333
346
  function() {
334
- return p(l) && h({ inst: l }), f(function() {
335
- p(l) && h({ inst: l });
347
+ return c(S) && y({ inst: S }), d(function() {
348
+ c(S) && y({ inst: S });
336
349
  });
337
350
  },
338
- [f]
339
- ), c(u), u;
351
+ [d]
352
+ ), s(f), f;
340
353
  }
341
- function p(f) {
342
- var g = f.getSnapshot;
343
- f = f.value;
354
+ function c(d) {
355
+ var E = d.getSnapshot;
356
+ d = d.value;
344
357
  try {
345
- var u = g();
346
- return !n(f, u);
358
+ var f = E();
359
+ return !n(d, f);
347
360
  } catch {
348
361
  return !0;
349
362
  }
350
363
  }
351
- function y(f, g) {
352
- return g();
364
+ function m(d, E) {
365
+ return E();
353
366
  }
354
- var x = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : d;
355
- return Y.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : x, Y;
356
- }
357
- var q = {};
358
- var pe;
359
- function Pt() {
360
- return pe || (pe = 1, process.env.NODE_ENV !== "production" && (function() {
361
- function e(u, b) {
362
- return u === b && (u !== 0 || 1 / u === 1 / b) || u !== u && b !== b;
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(u, b) {
365
- x || o.startTransition === void 0 || (x = !0, console.error(
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 l = b();
369
- if (!f) {
370
- var h = b();
371
- s(l, h) || (console.error(
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
- ), f = !0);
386
+ ), d = !0);
374
387
  }
375
- h = c({
376
- inst: { value: l, getSnapshot: b }
388
+ y = s({
389
+ inst: { value: S, getSnapshot: b }
377
390
  });
378
- var i = h[0].inst, v = h[1];
379
- return p(
391
+ var x = y[0].inst, O = y[1];
392
+ return c(
380
393
  function() {
381
- i.value = l, i.getSnapshot = b, n(i) && v({ inst: i });
394
+ x.value = S, x.getSnapshot = b, n(x) && O({ inst: x });
382
395
  },
383
- [u, l, b]
384
- ), d(
396
+ [f, S, b]
397
+ ), i(
385
398
  function() {
386
- return n(i) && v({ inst: i }), u(function() {
387
- n(i) && v({ inst: i });
399
+ return n(x) && O({ inst: x }), f(function() {
400
+ n(x) && O({ inst: x });
388
401
  });
389
402
  },
390
- [u]
391
- ), y(l), l;
403
+ [f]
404
+ ), m(S), S;
392
405
  }
393
- function n(u) {
394
- var b = u.getSnapshot;
395
- u = u.value;
406
+ function n(f) {
407
+ var b = f.getSnapshot;
408
+ f = f.value;
396
409
  try {
397
- var l = b();
398
- return !s(u, l);
410
+ var S = b();
411
+ return !a(f, S);
399
412
  } catch {
400
413
  return !0;
401
414
  }
402
415
  }
403
- function a(u, b) {
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 = Ae, s = typeof Object.is == "function" ? Object.is : e, c = o.useState, d = o.useEffect, p = o.useLayoutEffect, y = o.useDebugValue, x = !1, f = !1, g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : t;
408
- q.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : g, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
409
- })()), q;
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 ge;
412
- function jt() {
413
- return ge || (ge = 1, process.env.NODE_ENV === "production" ? P.exports = Gt() : P.exports = Pt()), P.exports;
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 Fe = jt();
416
- const Ut = Object.keys(
417
- H
428
+ var Ge = zt();
429
+ const qt = Object.keys(
430
+ j
418
431
  );
419
- function Bt(e) {
432
+ function Jt(e) {
420
433
  let t = null, n = null;
421
- const a = () => {
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: Oe(o.columns, o.columnOrder),
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, s) {
435
- return Le(
447
+ async exportGrid(o, a) {
448
+ return Ie(
436
449
  e.getSnapshot(),
437
450
  o,
438
- De(s, e.getExportDefaults())
451
+ Ae(a, e.getExportDefaults())
439
452
  );
440
453
  },
441
- getExportFormats: () => Ut,
442
- getColumns: () => a().columns,
454
+ getExportFormats: () => qt,
455
+ getColumns: () => l().columns,
443
456
  isColumnVisible(o) {
444
- const s = e.getSnapshot();
445
- return s.columnVisibilityMap[o] === !1 ? !1 : s.columns.some(
446
- (c) => V(c) === o
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, s) {
450
- e.getSnapshot().setColumnVisible(o, s);
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: a,
476
+ getState: l,
464
477
  subscribe: (o) => e.subscribe(o)
465
478
  };
466
479
  }
467
- const Ht = [], $t = [], Xt = {}, Kt = [], Wt = () => {
468
- }, zt = () => {
469
- }, Yt = () => {
470
- }, me = () => Kt, k = {
471
- columns: Ht,
472
- columnOrder: $t,
473
- columnVisibilityMap: Xt,
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: Wt,
488
+ setColumnVisible: oo,
476
489
  filteringEnabled: !1,
477
490
  canToggleFiltering: !1,
478
- setFilteringEnabled: zt,
491
+ setFilteringEnabled: no,
479
492
  filtered: !1,
480
- clearAllFilters: Yt,
481
- getViewRows: me,
482
- getAllRows: me
493
+ clearAllFilters: ro,
494
+ getViewRows: Ee,
495
+ getAllRows: Ee
483
496
  };
484
- function be(e, t) {
485
- return e === t || e.length === t.length && e.every((n, a) => n === t[a]);
497
+ function Se(e, t) {
498
+ return e === t || e.length === t.length && e.every((n, l) => n === t[l]);
486
499
  }
487
- function qt(e, t) {
500
+ function lo(e, t) {
488
501
  if (e === t) return !0;
489
- const n = Object.keys(e), a = Object.keys(t);
490
- return n.length === a.length && n.every(
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 Jt(e, t) {
495
- return be(e.columns, t.columns) && be(e.columnOrder, t.columnOrder) && qt(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;
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 Qt() {
498
- let e = null, t = k, n;
499
- const a = /* @__PURE__ */ new Set(), o = (p) => {
500
- Jt(t, p) || (t = p, a.forEach((y) => y()));
501
- }, s = () => t, c = () => n, d = (p) => (a.add(p), () => {
502
- a.delete(p);
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: Bt({
506
- getSnapshot: s,
507
- subscribe: d,
508
- getExportDefaults: c,
509
- isAttached: () => t !== k
518
+ api: Jt({
519
+ getSnapshot: a,
520
+ subscribe: i,
521
+ getExportDefaults: s,
522
+ isAttached: () => t !== F
510
523
  }),
511
524
  createTargetRegistration() {
512
- const p = /* @__PURE__ */ Symbol("rdg-toolbar-target");
513
- let y = !1, x = null;
525
+ const c = /* @__PURE__ */ Symbol("rdg-toolbar-target");
526
+ let m = !1, h = null;
514
527
  return {
515
528
  controller: {
516
- publish(f) {
517
- x = f, y && e === p && o(f);
529
+ publish(d) {
530
+ h = d, m && e === c && o(d);
518
531
  }
519
532
  },
520
533
  attach() {
521
- if (e !== null && e !== p)
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 y = !0, e = p, x && o(x), () => {
526
- y && (y = !1, e === p && (e = null, o(k)));
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 = k, n = void 0, a.clear();
545
+ e = null, t = F, n = void 0, l.clear();
533
546
  },
534
- getExportDefaults: c,
535
- getSnapshot: s,
536
- getServerSnapshot: () => k,
537
- setExportDefaults(p) {
538
- n = p;
547
+ getExportDefaults: s,
548
+ getSnapshot: a,
549
+ getServerSnapshot: () => F,
550
+ setExportDefaults(c) {
551
+ n = c;
539
552
  },
540
- subscribe: d
553
+ subscribe: i
541
554
  };
542
555
  }
543
- const Ie = Z(
556
+ const Pe = Z(
544
557
  null
545
558
  );
546
- function $() {
547
- const e = xe(Ie);
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 Zt() {
555
- const e = $();
556
- return Fe.useSyncExternalStore(
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 fo() {
563
- return $().api;
575
+ function yo() {
576
+ return U().api;
564
577
  }
565
- function po(e) {
566
- return Fe.useSyncExternalStore(e.subscribe, e.getState, e.getState);
578
+ function xo(e) {
579
+ return Ge.useSyncExternalStore(e.subscribe, e.getState, e.getState);
567
580
  }
568
- const j = {
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 eo(e) {
581
- return typeof e.header == "string" && e.header.trim() || typeof e.header == "number" ? e.header : V(e);
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 go(e) {
596
+ function vo(e) {
584
597
  const {
585
598
  children: t,
586
599
  ariaLabel: n = "Visible column toggles",
587
- title: a = "Visible columns",
600
+ title: l = "Visible columns",
588
601
  description: o = "Choose which columns are visible in the grid.",
589
- collapsible: s = !1,
590
- showColumnToggles: c = !0,
591
- toolbarCollapsedColumnToggles: d = !1,
592
- disableMobileAutoToolbarCollapsedColumns: p = !1,
593
- showExport: y = !1,
594
- showFilterToggle: x = !1,
595
- showClearFilters: f = !1,
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: g,
599
- exportFormats: u = kt,
611
+ exportScope: E,
612
+ exportFormats: f = Bt,
600
613
  exportFileName: b,
601
- exportDateFormat: l,
602
- exportSheetName: h,
603
- onExportSuccess: i,
604
- onExportError: v,
605
- labels: _,
606
- className: I
607
- } = e, [X, te] = C(!1), oe = $(), ne = F("tdg-toolbar-title"), G = F("tdg-toolbar-description"), re = F("tdg-toolbar-collapsible-panel"), [M, Ve] = C(!1), Ge = st("(max-width: 1024px)"), Pe = d || Ge && !p, E = Zt(), ae = Te(E.theme), je = ht(ae), T = O(
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
- ...j,
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: _?.exportFormats ?? j.exportFormats,
614
- exportSingle: _?.exportSingle ?? j.exportSingle,
615
- filteringControlledHint: _?.filteringControlledHint ?? j.filteringControlledHint
628
+ exportFormats: L?.exportFormats ?? G.exportFormats,
629
+ exportSingle: L?.exportSingle ?? G.exportSingle,
630
+ filteringControlledHint: L?.filteringControlledHint ?? G.filteringControlledHint
616
631
  }),
617
- [_]
618
- ), K = O(
619
- () => Oe(E.columns, E.columnOrder),
620
- [E.columnOrder, E.columns]
621
- ), Ue = O(
622
- () => K.filter((S) => S.hideable !== !1),
623
- [K]
624
- ), Be = K.reduce(
625
- (S, w) => S + (E.columnVisibilityMap[V(w)] === !1 ? 0 : 1),
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
- ), le = Ue.map((S) => {
628
- const w = V(S), z = E.columnVisibilityMap[w] !== !1;
642
+ ), ie = ze.map((g) => {
643
+ const v = D(g), W = p.columnVisibilityMap[v] !== !1;
629
644
  return {
630
- columnId: w,
631
- disabled: z && Be <= 1,
632
- label: eo(S),
633
- onToggle: () => E.setColumnVisible(w, !z),
634
- visible: z
645
+ columnId: v,
646
+ disabled: W && qe <= 1,
647
+ label: co(g),
648
+ onToggle: () => p.setColumnVisible(v, !W),
649
+ visible: W
635
650
  };
636
- }), se = O(
637
- () => u.filter(
638
- (S) => H[S] != null
651
+ }), ce = T(
652
+ () => f.filter(
653
+ (g) => j[g] != null
639
654
  ),
640
- [u]
641
- ), He = O(
642
- () => y ? Ce(E).length : 0,
643
- [y, E]
644
- ) === 0 || se.length === 0, $e = L(
645
- async (S) => {
646
- te(!0);
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 w = await Le(
649
- E,
650
- S,
651
- De(
663
+ const v = await Ie(
664
+ p,
665
+ g,
666
+ Ae(
652
667
  {
653
- scope: g,
668
+ scope: E,
654
669
  fileName: b,
655
- dateFormat: l,
656
- sheetName: h
670
+ dateFormat: S,
671
+ sheetName: y
657
672
  },
658
- oe.getExportDefaults()
673
+ re.getExportDefaults()
659
674
  )
660
675
  );
661
- w && i?.(w);
662
- } catch (w) {
663
- v?.(w), v || console.error(w);
676
+ v && x?.(v);
677
+ } catch (v) {
678
+ O?.(v), O || console.error(v);
664
679
  } finally {
665
- te(!1);
680
+ ne(!1);
666
681
  }
667
682
  },
668
683
  [
669
- l,
684
+ S,
670
685
  b,
671
- g,
672
- h,
673
- v,
674
- i,
675
686
  E,
676
- oe
687
+ y,
688
+ O,
689
+ x,
690
+ p,
691
+ re
677
692
  ]
678
- ), W = a != null || o != null ? /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-heading" }, a != null ? /* @__PURE__ */ r(
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: ne,
696
+ id: le,
682
697
  "data-slot": "rdg-toolbar-title",
683
698
  role: "heading",
684
699
  "aria-level": 2
685
700
  },
686
- a
687
- ) : null, o != null ? /* @__PURE__ */ r("div", { id: G, "data-slot": "rdg-toolbar-description" }, o) : null) : null, ie = /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-body" }, c ? Pe ? /* @__PURE__ */ r(
688
- to,
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 ? G : void 0,
692
- items: le,
693
- label: T.columns
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
- role: "group",
699
- "aria-label": n,
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
- le.map((S) => /* @__PURE__ */ r(
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": S.visible,
709
- disabled: S.disabled,
710
- "data-state": S.visible ? "on" : "off",
711
- "data-slot": "rdg-column-toggle",
712
- "data-column-id": S.columnId,
713
- onClick: S.onToggle
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
- S.label
716
- ))
717
- ) : null, y || x || f || t != null ? /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-actions" }, y ? /* @__PURE__ */ r(
718
- oo,
719
- {
720
- disabled: He || X,
721
- formats: se,
722
- label: T.export,
723
- formatLabels: T.exportFormats,
724
- singleLabels: T.exportSingle,
725
- onExport: $e
726
- }
727
- ) : null, x ? /* @__PURE__ */ r(
728
- "button",
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
- className: I ? `tdg-toolbar-root ${I}` : "tdg-toolbar-root",
777
+ ref: We,
778
+ className: oe ? `tdg-toolbar-root ${oe}` : "tdg-toolbar-root",
755
779
  "data-slot": "rdg-toolbar",
756
- "data-collapsible": s ? "true" : void 0,
757
- "data-state": s ? M ? "open" : "closed" : void 0,
758
- "data-theme": ae,
759
- "data-theme-base": je,
760
- role: a != null ? "region" : void 0,
761
- "aria-labelledby": a != null ? ne : void 0,
762
- "aria-describedby": o != null ? G : void 0
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
- s ? /* @__PURE__ */ r(U, null, /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-header-row" }, W != null ? /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-collapsible-heading" }, W) : null, /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-disclosure-row" }, /* @__PURE__ */ r(
765
- "button",
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
- id: re,
781
- "aria-hidden": !M,
782
- "data-slot": "rdg-toolbar-collapsible-panel"
791
+ theme: H,
792
+ themeBase: se,
793
+ portalContainer: $e
783
794
  },
784
- /* @__PURE__ */ r("div", { "data-slot": "rdg-toolbar-collapsible-panel-inner" }, ie)
785
- )) : Xe
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 to(e) {
789
- const { ariaLabel: t, descriptionId: n, items: a, label: o } = e, [s, c] = C(!1), d = N(null), p = N(null), y = F("tdg-toolbar-column-toggle-menu"), x = a.findIndex((l) => !l.disabled);
790
- A(() => {
791
- if (!s) return;
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: a.length === 0,
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(gt, { "data-icon": "inline-start" }),
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
- ), s ? /* @__PURE__ */ r(
849
- "div",
838
+ ), /* @__PURE__ */ r(
839
+ a.Content,
850
840
  {
851
- id: y,
852
- role: "menu",
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("div", { "data-slot": "rdg-toolbar-column-toggle-menu-label" }, o),
881
- /* @__PURE__ */ r(
882
- "div",
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: l.columnId,
892
- type: "button",
893
- role: "menuitemcheckbox",
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": l.columnId,
901
- onClick: l.onToggle
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
- ) : null);
866
+ )));
914
867
  }
915
- function oo(e) {
916
- const { disabled: t, formats: n, label: a, formatLabels: o, singleLabels: s, onExport: c } = e, [d, p] = C(!1), y = N(null), x = N(null), f = F("tdg-toolbar-export-menu"), g = F("tdg-toolbar-export-trigger"), u = n.length === 1 ? n[0] : null, b = (i) => o[i] ?? H[i].label;
917
- A(() => {
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": u,
875
+ "data-export-format": c,
943
876
  disabled: t,
944
877
  onClick: () => {
945
- c(u);
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(ue, null),
968
- a
969
- ), d ? /* @__PURE__ */ r(
970
- "div",
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
- id: f,
973
- role: "menu",
974
- "aria-labelledby": g,
975
- "data-slot": "rdg-toolbar-export-menu",
976
- onKeyDown: (i) => {
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((i, v) => /* @__PURE__ */ r(
989
- "button",
892
+ n.map((h) => /* @__PURE__ */ r(
893
+ i.Item,
990
894
  {
991
- key: i,
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": i,
997
- onClick: () => {
998
- l(), c(i);
897
+ "data-export-format": h,
898
+ onSelect: () => {
899
+ s(h);
999
900
  }
1000
901
  },
1001
- b(i)
902
+ m(h)
1002
903
  ))
1003
- ) : null);
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 ro = /* @__PURE__ */ Symbol.for(
906
+ const po = /* @__PURE__ */ Symbol.for(
1010
907
  "@geovi/the-datagrid/search-target-component"
1011
- ), ke = /* @__PURE__ */ Symbol.for(
908
+ ), je = /* @__PURE__ */ Symbol.for(
1012
909
  "@geovi/the-datagrid/toolbar-target-component"
1013
910
  );
1014
- function he(e, t) {
911
+ function ye(e, t) {
1015
912
  return typeof e != "function" && typeof e != "object" || !e ? !1 : e[t] === !0;
1016
913
  }
1017
- function ao(e) {
1018
- return he(e, ro) || he(e, ke);
914
+ function go(e) {
915
+ return ye(e, po) || ye(e, je);
1019
916
  }
1020
- function lo(e, t) {
917
+ function mo(e, t) {
1021
918
  let n = e;
1022
- const a = /* @__PURE__ */ new Set();
1023
- for (; !a.has(n); ) {
1024
- if (a.add(n), t(n.type))
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 (!ao(n.type)) return null;
923
+ if (!go(n.type)) return null;
1027
924
  const o = n.props.children;
1028
- if (!B(o)) return null;
925
+ if (!k(o)) return null;
1029
926
  n = o;
1030
927
  }
1031
928
  return null;
1032
929
  }
1033
- function so(e, t) {
930
+ function ho(e, t) {
1034
931
  typeof e != "function" && typeof e != "object" || !e || Object.defineProperty(e, t, { value: !0 });
1035
932
  }
1036
- function Ne(e) {
1037
- const { children: t } = e, n = e.__rdgSearchController, a = $(), o = O(
1038
- () => a.createTargetRegistration(),
1039
- [a]
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]), !B(t))
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 (!lo(t, Me))
942
+ if (!mo(t, Ne))
1046
943
  throw new Error("RDGToolbarTarget expects a ReactDataGrid child.");
1047
- const s = {
944
+ const a = {
1048
945
  __rdgToolbarController: o.controller
1049
946
  };
1050
- return n !== void 0 && (s.__rdgSearchController = n), Se(
947
+ return n !== void 0 && (a.__rdgSearchController = n), Te(
1051
948
  t,
1052
- s
949
+ a
1053
950
  );
1054
951
  }
1055
- so(Ne, ke);
1056
- const io = typeof window > "u" ? A : _e;
1057
- function mo(e) {
1058
- const { children: t, apiRef: n, exportDefaults: a } = e, [o] = C(Qt);
1059
- A(() => () => o.dispose(), [o]), io(() => {
1060
- o.setExportDefaults(a);
1061
- }, [o, a]), ve(n, () => o.api, [o]);
1062
- const s = O(
1063
- () => Ee.map(
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
- (c) => B(c) && Me(c.type) ? /* @__PURE__ */ r(Ne, null, c) : c
962
+ (s) => k(s) && Ne(s.type) ? /* @__PURE__ */ r(Ue, null, s) : s
1066
963
  ),
1067
964
  [t]
1068
965
  );
1069
- return /* @__PURE__ */ r(Ie.Provider, { value: o }, s);
966
+ return /* @__PURE__ */ r(Pe.Provider, { value: o }, a);
1070
967
  }
1071
968
  export {
1072
- go as RDGToolbar,
1073
- mo as RDGToolbarProvider,
1074
- Ne as RDGToolbarTarget,
1075
- fo as useRDGToolbarApi,
1076
- po as useRDGToolbarApiState
969
+ vo as RDGToolbar,
970
+ _o as RDGToolbarProvider,
971
+ Ue as RDGToolbarTarget,
972
+ yo as useRDGToolbarApi,
973
+ xo as useRDGToolbarApiState
1077
974
  };