mig-schema-table 5.0.18 → 5.0.19

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.
@@ -1,386 +1,427 @@
1
- import { jsx as r, jsxs as F, Fragment as Qt } from "react/jsx-runtime";
2
- import * as zt from "react";
1
+ import { jsx as s, jsxs as B, Fragment as en } from "react/jsx-runtime";
2
+ import * as tn from "react";
3
3
  import e from "react";
4
- import { createPortal as Ut } from "react-dom";
5
- import { VariableSizeGrid as ut, VariableSizeList as Pt } from "react-window";
6
- import { format as Jt, endOfDay as Zt, differenceInSeconds as Gt } from "date-fns";
7
- import { nl as qt } from "date-fns/locale";
8
- import { unCamel as Xt, emptyFn as ye, timeZone as xe, localeFormatInTimeZone as xt, parseLocationHash as dt, serializeLocationHash as Je } from "mig-data-tools";
9
- import { range as Ht, debounce as Vt, difference as Yt, isEqual as nt, isFinite as Kt, sum as en } from "lodash";
10
- import mt from "react-datepicker";
11
- import ht from "react-select";
12
- import { nl as ft } from "date-fns/locale/nl";
13
- import { TZDate as Ze } from "@date-fns/tz";
14
- import { useFloating as gt, flip as bt } from "@floating-ui/react-dom";
15
- import tn from "react-window-infinite-loader";
16
- import { saveAs as nn } from "file-saver";
17
- const rt = (t, a) => (
4
+ import { createPortal as nn } from "react-dom";
5
+ import { VariableSizeGrid as Ct, VariableSizeList as rn } from "react-window";
6
+ import { format as sn, endOfDay as on, differenceInSeconds as an } from "date-fns";
7
+ import { nl as ln } from "date-fns/locale";
8
+ import { unCamel as cn, emptyFn as be, timeZone as Ne, localeFormatInTimeZone as Rt, parseLocationHash as wt, serializeLocationHash as He } from "mig-data-tools";
9
+ import { range as un, debounce as dn, difference as mn, isEqual as Xe, isFinite as hn, sum as fn } from "lodash";
10
+ import vt from "react-datepicker";
11
+ import yt from "react-select";
12
+ import { nl as kt } from "date-fns/locale/nl";
13
+ import { TZDate as Ve } from "@date-fns/tz";
14
+ import { useFloating as Dt, flip as xt } from "@floating-ui/react-dom";
15
+ import gn from "react-window-infinite-loader";
16
+ import { saveAs as bn } from "file-saver";
17
+ const ut = (n, o) => (
18
18
  // replace jan. with jan
19
- Jt(t, a, { locale: qt }).replace(".", "")
20
- ), rn = {
19
+ sn(n, o, { locale: ln }).replace(".", "")
20
+ ), pn = {
21
21
  "Europe/Amsterdam": "AMS",
22
22
  "Europe/Berlin": "AMS",
23
23
  "Asia/Jakarta": "JKT",
24
24
  "Asia/Bangkok": "JKT",
25
25
  showingFilteredCountOfTotalCount: "Showing {0} of {1}"
26
26
  };
27
- function pt(t, ...a) {
28
- let h = rn[t] || Xt(t);
29
- return a.forEach((b, p) => {
30
- h = h.replace(`{${p}}`, `${b}`);
27
+ function Tt(n, ...o) {
28
+ let h = pn[n] || cn(n);
29
+ return o.forEach((p, _) => {
30
+ h = h.replace(`{${_}}`, `${p}`);
31
31
  }), h;
32
32
  }
33
- const ee = "SELECT_ALL_COLUMN_NAME", _t = 40, Dt = "dd MMM yyyy", Ge = "dd MMM yyyy HH:mm", Tt = 25, Ct = 50, sn = 3;
34
- var ge = /* @__PURE__ */ ((t) => (t.GT = "GT", t.LT = "LT", t.EQ = "EQ", t))(ge || {});
35
- const yt = /* @__PURE__ */ new Map([
33
+ const ee = "SELECT_ALL_COLUMN_NAME", Mt = 40, we = "__drag_handle__", At = 32, $t = "dd MMM yyyy", Ye = "dd MMM yyyy HH:mm", Ot = 25, Et = 50, _n = 3;
34
+ var pe = /* @__PURE__ */ ((n) => (n.GT = "GT", n.LT = "LT", n.EQ = "EQ", n))(pe || {});
35
+ const Lt = /* @__PURE__ */ new Map([
36
36
  [!0, "✓"],
37
37
  [!1, "✕"],
38
38
  [null, "?"]
39
39
  ]);
40
- var Oe = /* @__PURE__ */ ((t) => (t.UNAVAILABLE = "UNAVAILABLE", t.AVAILABLE = "AVAILABLE", t.ACTIVE = "ACTIVE", t))(Oe || {});
41
- const De = zt.createContext({
40
+ var Qe = /* @__PURE__ */ ((n) => (n.UNAVAILABLE = "UNAVAILABLE", n.AVAILABLE = "AVAILABLE", n.ACTIVE = "ACTIVE", n))(Qe || {});
41
+ const Ie = tn.createContext({
42
42
  checkedIndexes: [],
43
43
  columnNames: [],
44
44
  columnWidths: new Uint16Array(),
45
45
  config: {},
46
46
  disabledCheckedIndexes: [],
47
47
  dropTargetIndex: -1,
48
+ isDraggable: !1,
48
49
  isColumnFilterable: !1,
49
50
  isItemLoaded: () => !1,
50
51
  isSortable: !1,
52
+ onRowDrop: be,
51
53
  properties: {},
52
54
  required: [],
53
- setCustomColumnNames: ye,
54
- setCustomColumnWidths: ye,
55
- setDropTargetIndex: ye,
56
- setFilterSortColumn: ye,
57
- setLastCheckChangedRowIndex: ye,
58
- setMenuConfig: ye,
55
+ rowDropTargetRowIndex: -1,
56
+ setCustomColumnNames: be,
57
+ setCustomColumnWidths: be,
58
+ setDropTargetIndex: be,
59
+ setFilterSortColumn: be,
60
+ setLastCheckChangedRowIndex: be,
61
+ setMenuConfig: be,
62
+ setRowDropTargetRowIndex: be,
59
63
  tableDataState: {
60
64
  searchQuery: "",
61
65
  columnFilterMap: {},
62
66
  sortColumn: "",
63
67
  sortAsc: !1
64
68
  },
65
- translate: ye
66
- }), on = { type: "boolean" }, an = ({ columnIndex: t, rowIndex: a, style: h }) => {
69
+ translate: be
70
+ }), Cn = { type: "boolean" }, wn = ({ columnIndex: n, rowIndex: o, style: h }) => {
67
71
  const {
68
- checkedIndexes: b,
69
- columnNames: p,
72
+ checkedIndexes: p,
73
+ columnNames: _,
70
74
  config: f,
71
- disabledCheckedIndexes: L,
72
- displayTimezone: _,
73
- getRowClassName: R,
74
- getRowSelected: N,
75
- isItemLoaded: T,
76
- lastCheckChangedRowIndex: O,
77
- onRowClick: D,
78
- onRowDoubleClick: x,
79
- properties: I,
80
- setCheckedIndexes: Z,
81
- setLastCheckChangedRowIndex: te,
82
- sortedRenderData: A,
83
- sourceData: o,
84
- translate: l
85
- } = e.useContext(De), s = p[t], C = s === ee ? on : I[s], Q = f ? f[s] : void 0, ne = e.useCallback(
86
- (W) => {
87
- Z && Z((w) => w && w.includes(W) ? w.filter((B) => B !== W) : w ? [...w, W] : [W]);
75
+ disabledCheckedIndexes: E,
76
+ displayTimezone: C,
77
+ getRowClassName: O,
78
+ getRowSelected: L,
79
+ isItemLoaded: N,
80
+ lastCheckChangedRowIndex: $,
81
+ onRowClick: M,
82
+ onRowDoubleClick: D,
83
+ onRowDrop: I,
84
+ properties: Y,
85
+ rowDropTargetRowIndex: te,
86
+ setCheckedIndexes: q,
87
+ setLastCheckChangedRowIndex: b,
88
+ setRowDropTargetRowIndex: u,
89
+ sortedRenderData: r,
90
+ sourceData: g,
91
+ translate: oe
92
+ } = e.useContext(Ie), W = _[n], ce = W === ee ? Cn : Y[W], G = f ? f[W] : void 0, v = e.useCallback(
93
+ (w) => {
94
+ q && q((T) => T && T.includes(w) ? T.filter((x) => x !== w) : T ? [...T, w] : [w]);
88
95
  },
89
- [Z]
90
- ), ce = T(a), re = e.useCallback(
91
- (W) => {
92
- if (!o || !A || !D || !ce)
96
+ [q]
97
+ ), J = N(o), ne = e.useCallback(
98
+ (w) => {
99
+ if (!g || !r || !M || !J)
93
100
  return;
94
- const { rowIndex: w } = W.currentTarget.dataset;
95
- if (!w)
101
+ const { rowIndex: T } = w.currentTarget.dataset;
102
+ if (!T)
96
103
  return;
97
- const j = A[parseInt(w, 10)];
98
- D(o[j._index], j._index, W);
104
+ const A = r[parseInt(T, 10)];
105
+ M(g[A._index], A._index, w);
99
106
  },
100
- [ce, D, A, o]
101
- ), y = e.useCallback(
102
- (W) => {
103
- if (!o || !A || !x || !T)
107
+ [J, M, r, g]
108
+ ), re = e.useCallback(
109
+ (w) => {
110
+ if (!g || !r || !D || !J)
104
111
  return;
105
- const { rowIndex: w } = W.currentTarget.dataset;
106
- if (!w)
112
+ const { rowIndex: T } = w.currentTarget.dataset;
113
+ if (!T)
107
114
  return;
108
- const j = A[parseInt(w, 10)];
109
- x(o[j._index], j._index, W);
115
+ const A = r[parseInt(T, 10)];
116
+ D(g[A._index], A._index, w);
110
117
  },
111
- [T, x, A, o]
112
- ), E = A ? A[a] : void 0, { showTimezones: oe, TdBody: G } = Q || {}, se = e.useMemo(() => _ ? null : xe.startsWith("Europe/") ? "Asia/Jakarta" : "Europe/Amsterdam", [_]), q = e.useMemo(() => {
113
- if (!E || !A)
118
+ [J, D, r, g]
119
+ ), S = r ? r[o] : void 0, { showTimezones: ae, TdBody: Z } = G || {}, ue = e.useMemo(() => C ? null : Ne.startsWith("Europe/") ? "Asia/Jakarta" : "Europe/Amsterdam", [C]), j = e.useMemo(() => {
120
+ if (!S || !r)
114
121
  return;
115
- let W = s === ee ? void 0 : E[s];
116
- if (C?.format && C.format === "date-time" && oe !== !1) {
117
- const j = o ? o[E._index] : void 0, B = j ? j[s] : void 0, S = B ? new Date(B) : void 0;
118
- S && se && (W = `${xt(
119
- S,
120
- se,
121
- Ge
122
- )} (${l(se)})`);
122
+ let w = W === ee ? void 0 : S[W];
123
+ if (ce?.format && ce.format === "date-time" && ae !== !1) {
124
+ const A = g ? g[S._index] : void 0, x = A ? A[W] : void 0, Q = x ? new Date(x) : void 0;
125
+ Q && ue && (w = `${Rt(
126
+ Q,
127
+ ue,
128
+ Ye
129
+ )} (${oe(ue)})`);
123
130
  }
124
- const w = [
131
+ const T = [
125
132
  "mig-schema-table__td",
126
- `mig-schema-table__td--${a % 2 ? "odd" : "even"}`,
127
- `mig-schema-table__td--prop-${s}`
133
+ `mig-schema-table__td--${o % 2 ? "odd" : "even"}`,
134
+ `mig-schema-table__td--prop-${W}`
128
135
  ];
129
- switch (o && N && N(o[E._index], E._index) && w.push("mig-schema-table__td--selected"), o && R && w.push(
130
- R(o[E._index], E._index, A)
131
- ), C?.type) {
136
+ switch (o === te && T.push("mig-schema-table__td--row-drop-target"), g && L && L(g[S._index], S._index) && T.push("mig-schema-table__td--selected"), g && O && T.push(
137
+ O(g[S._index], S._index, r)
138
+ ), ce?.type) {
132
139
  case "boolean":
133
- w.push(`text-${Q?.align || "center"}`);
140
+ T.push(`text-${G?.align || "center"}`);
134
141
  break;
135
142
  case "number":
136
143
  case "integer":
137
- w.push(`text-${Q?.align || "end"}`);
144
+ T.push(`text-${G?.align || "end"}`);
138
145
  break;
139
146
  default:
140
- Q?.align && w.push(`text-${Q.align}`);
147
+ G?.align && T.push(`text-${G.align}`);
141
148
  }
142
149
  return {
143
- "data-row-index": a,
144
- "data-column-index": t,
150
+ "data-row-index": o,
151
+ "data-column-index": n,
145
152
  style: h,
146
- className: w.join(" "),
147
- title: W,
148
- onClick: s === ee ? void 0 : re,
149
- onDoubleClick: s === ee ? void 0 : y
153
+ className: T.join(" "),
154
+ title: w,
155
+ onClick: W === ee ? void 0 : ne,
156
+ onDoubleClick: W === ee ? void 0 : re
150
157
  };
151
158
  }, [
152
- E,
153
- A,
154
- s,
155
- C,
156
- oe,
157
- a,
159
+ S,
160
+ r,
161
+ W,
162
+ ce,
163
+ ae,
158
164
  o,
159
- N,
160
- R,
161
- t,
165
+ te,
166
+ g,
167
+ L,
168
+ O,
169
+ n,
162
170
  h,
171
+ ne,
163
172
  re,
164
- y,
165
- se,
166
- l,
167
- Q
168
- ]), z = e.useCallback(
169
- (W) => {
170
- if (!ne || !E)
173
+ ue,
174
+ oe,
175
+ G
176
+ ]), he = e.useCallback(
177
+ (w) => {
178
+ if (!v || !S)
171
179
  return;
172
- const w = parseInt(W.currentTarget.dataset.rowIndex);
173
- if (W.shiftKey && O !== void 0) {
174
- const j = b?.includes(O) ? O : void 0;
175
- if (j !== void 0 && A) {
176
- const B = a;
177
- for (const S of Ht(
178
- B > j ? j + 1 : B,
179
- B > j ? B + 1 : j
180
+ const T = parseInt(w.currentTarget.dataset.rowIndex);
181
+ if (w.shiftKey && $ !== void 0) {
182
+ const A = p?.includes($) ? $ : void 0;
183
+ if (A !== void 0 && r) {
184
+ const x = o;
185
+ for (const Q of un(
186
+ x > A ? A + 1 : x,
187
+ x > A ? x + 1 : A
180
188
  )) {
181
- const he = A[S]._index;
182
- (!L || !L.includes(he)) && ne(he);
189
+ const Me = r[Q]._index;
190
+ (!E || !E.includes(Me)) && v(Me);
183
191
  }
184
192
  }
185
193
  } else
186
- ne(E._index);
187
- te(w), ue.current?.focus();
194
+ v(S._index);
195
+ b(T), ve.current?.focus();
188
196
  },
189
197
  [
190
- b,
191
- L,
192
- O,
193
- ne,
198
+ p,
194
199
  E,
195
- a,
196
- te,
197
- A
200
+ $,
201
+ v,
202
+ S,
203
+ o,
204
+ b,
205
+ r
198
206
  ]
199
- ), ue = e.useRef(null);
200
- if (!E || !q)
207
+ ), ve = e.useRef(null);
208
+ if (!S || !j)
201
209
  return null;
202
- if (!T || o && !o[E._index])
203
- return /* @__PURE__ */ r("div", { ...q, children: "loading" });
204
- if (s === ee)
205
- return /* @__PURE__ */ r("div", { ...q, onMouseDown: z, children: /* @__PURE__ */ r("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ r(
210
+ if (!N || g && !g[S._index])
211
+ return /* @__PURE__ */ s("div", { ...j, children: "loading" });
212
+ if (W === we)
213
+ return /* @__PURE__ */ s(
214
+ "div",
215
+ {
216
+ ...j,
217
+ className: `${j.className} mig-schema-table__td--drag-handle`,
218
+ draggable: !0,
219
+ onDragStart: (w) => {
220
+ w.dataTransfer.effectAllowed = "move", w.dataTransfer.setData("row-drag-index", String(o));
221
+ },
222
+ onDragOver: (w) => {
223
+ w.preventDefault(), w.dataTransfer.dropEffect = "move", u(o);
224
+ },
225
+ onDragEnd: () => u(-1),
226
+ onDrop: (w) => {
227
+ w.preventDefault(), u(-1);
228
+ const T = parseInt(
229
+ w.dataTransfer.getData("row-drag-index"),
230
+ 10
231
+ );
232
+ isNaN(T) || I(T, o);
233
+ },
234
+ children: /* @__PURE__ */ s("span", { className: "mig-schema-table__td--drag-handle__icon", children: "⠿" })
235
+ }
236
+ );
237
+ if (W === ee)
238
+ return /* @__PURE__ */ s("div", { ...j, onMouseDown: he, children: /* @__PURE__ */ s("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ s(
206
239
  "input",
207
240
  {
208
- ref: ue,
241
+ ref: ve,
209
242
  type: "checkbox",
210
243
  readOnly: !0,
211
- checked: b?.includes(E._index),
212
- disabled: L?.includes(E._index)
244
+ checked: p?.includes(S._index),
245
+ disabled: E?.includes(S._index)
213
246
  }
214
247
  ) }) });
215
- if (G && o)
216
- return /* @__PURE__ */ r("div", { ...q, children: /* @__PURE__ */ r(
217
- G,
248
+ if (Z && g)
249
+ return /* @__PURE__ */ s("div", { ...j, children: /* @__PURE__ */ s(
250
+ Z,
218
251
  {
219
- dataIndex: E._index,
220
- rowData: o[E._index],
221
- rowIndex: a,
222
- ...Q?.tdBodyProps
252
+ dataIndex: S._index,
253
+ rowData: g[S._index],
254
+ rowIndex: o,
255
+ ...G?.tdBodyProps
223
256
  }
224
257
  ) });
225
- const V = E[s];
226
- return C?.format === "url" && V ? /* @__PURE__ */ r(
258
+ const se = S[W];
259
+ return ce?.format === "url" && se ? /* @__PURE__ */ s(
227
260
  "a",
228
261
  {
229
- href: V,
262
+ href: se,
230
263
  target: "_blank",
231
264
  rel: "noopener noreferrer",
232
- ...q,
233
- children: V
265
+ ...j,
266
+ children: se
234
267
  }
235
- ) : /* @__PURE__ */ r("div", { ...q, children: V });
236
- }, wt = e.memo(an);
237
- function ln() {
238
- const { checkedIndexes: t, disabledCheckedIndexes: a, sortedRenderData: h } = e.useContext(De);
268
+ ) : /* @__PURE__ */ s("div", { ...j, children: se });
269
+ }, Nt = e.memo(wn);
270
+ function vn() {
271
+ const { checkedIndexes: n, disabledCheckedIndexes: o, sortedRenderData: h } = e.useContext(Ie);
239
272
  return e.useMemo(() => {
240
- const b = [...h || []].filter(
241
- (p) => (t ? t.includes(p._index) : !0) || (a ? !a.includes(p._index) : !0)
273
+ const p = [...h || []].filter(
274
+ (_) => (n ? n.includes(_._index) : !0) || (o ? !o.includes(_._index) : !0)
242
275
  );
243
- return t?.length !== 0 && b.length === t?.length;
244
- }, [t, a, h]);
276
+ return n?.length !== 0 && p.length === n?.length;
277
+ }, [n, o, h]);
245
278
  }
246
- function Mt(t, a, h) {
247
- return !!(t && h?.isSortable !== !1 && (a || h?.renderData || h?.sort));
279
+ function Wt(n, o, h) {
280
+ return !!(n && h?.isSortable !== !1 && (o || h?.renderData || h?.sort));
248
281
  }
249
- function At() {
250
- const { setCustomColumnWidths: t, settingsStorageKey: a } = e.useContext(De);
282
+ function jt() {
283
+ const { setCustomColumnWidths: n, settingsStorageKey: o } = e.useContext(Ie);
251
284
  return e.useCallback(
252
285
  (h) => {
253
- a && localStorage.setItem(
254
- `${a}.columnWidths`,
286
+ o && localStorage.setItem(
287
+ `${o}.columnWidths`,
255
288
  JSON.stringify(Array.from(h))
256
- ), t(h);
289
+ ), n(h);
257
290
  },
258
- [t, a]
291
+ [n, o]
259
292
  );
260
293
  }
261
- const cn = ({ index: t, style: a }) => {
294
+ const yn = ({ index: n, style: o }) => {
262
295
  const {
263
296
  checkedIndexes: h,
264
- columnNames: b,
265
- columnWidths: p,
297
+ columnNames: p,
298
+ columnWidths: _,
266
299
  config: f,
267
- disabledCheckedIndexes: L,
268
- dropTargetIndex: _,
269
- isColumnFilterable: R,
270
- isSortable: N,
271
- setCheckedIndexes: T,
272
- properties: O,
273
- required: D,
274
- setCustomColumnNames: x,
300
+ disabledCheckedIndexes: E,
301
+ dropTargetIndex: C,
302
+ isColumnFilterable: O,
303
+ isSortable: L,
304
+ setCheckedIndexes: N,
305
+ properties: $,
306
+ required: M,
307
+ setCustomColumnNames: D,
275
308
  setDropTargetIndex: I,
276
- setFilterSortColumn: Z,
309
+ setFilterSortColumn: Y,
277
310
  setMenuConfig: te,
278
- settingsStorageKey: A,
279
- tableDataState: o,
280
- sortedRenderData: l,
281
- translate: s,
282
- displayTimezone: C
283
- } = e.useContext(De), [Q, ne] = e.useState(!1), ce = t === _, re = At(), y = b[t], E = y === ee ? { type: "boolean" } : O[y], oe = o.sortColumn === y ? o.sortAsc : void 0, G = f ? f[y] : void 0;
284
- let se = R && (E || G?.FilterMenu) && G?.isFilterable !== !1 ? Oe.AVAILABLE : Oe.UNAVAILABLE;
285
- o.columnFilterMap && o.columnFilterMap[y] !== void 0 && (se = Oe.ACTIVE);
286
- const q = Mt(
287
- N,
288
- E,
289
- G
290
- ), z = [
311
+ settingsStorageKey: q,
312
+ tableDataState: b,
313
+ sortedRenderData: u,
314
+ translate: r,
315
+ displayTimezone: g
316
+ } = e.useContext(Ie), [oe, W] = e.useState(!1), ce = n === C, G = jt(), v = p[n], J = v === ee ? { type: "boolean" } : $[v], ne = b.sortColumn === v ? b.sortAsc : void 0, re = f ? f[v] : void 0;
317
+ let S = O && (J || re?.FilterMenu) && re?.isFilterable !== !1 ? Qe.AVAILABLE : Qe.UNAVAILABLE;
318
+ b.columnFilterMap && b.columnFilterMap[v] !== void 0 && (S = Qe.ACTIVE);
319
+ const ae = Wt(
320
+ L,
321
+ J,
322
+ re
323
+ ), Z = [
291
324
  "mig-schema-table__th",
292
- `mig-schema-table__th--filter-${se}`,
293
- `mig-schema-table__th--prop-${y}`
325
+ `mig-schema-table__th--filter-${S}`,
326
+ `mig-schema-table__th--prop-${v}`
294
327
  ];
295
- z.push(
296
- q ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable"
297
- ), oe !== void 0 && z.push("mig-schema-table__th--sorted"), Q && z.push("mig-schema-table__th--dragging"), ce && z.push("mig-schema-table__th--drop-target");
298
- const { format: ue } = E || {}, {
299
- align: V,
300
- defaultSortDesc: W,
301
- showTimezones: w = !C,
302
- title: j
303
- } = G || {}, B = e.useCallback(() => {
304
- if (q) {
305
- if (oe === void 0) {
306
- Z(y, !W);
328
+ Z.push(
329
+ ae ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable"
330
+ ), ne !== void 0 && Z.push("mig-schema-table__th--sorted"), oe && Z.push("mig-schema-table__th--dragging"), ce && Z.push("mig-schema-table__th--drop-target");
331
+ const { format: ue } = J || {}, {
332
+ align: j,
333
+ defaultSortDesc: he,
334
+ showTimezones: ve = !g,
335
+ title: se
336
+ } = re || {}, w = e.useCallback(() => {
337
+ if (ae) {
338
+ if (ne === void 0) {
339
+ Y(v, !he);
307
340
  return;
308
341
  }
309
- Z(y, !oe);
342
+ Y(v, !ne);
310
343
  }
311
344
  }, [
312
- q,
313
- W,
314
- y,
315
- Z,
316
- oe
317
- ]), S = D.includes(y), he = e.useCallback(
318
- (v) => {
319
- const ae = v.currentTarget;
320
- te((pe) => {
321
- if (pe?.propName !== y)
345
+ ae,
346
+ he,
347
+ v,
348
+ Y,
349
+ ne
350
+ ]), T = M.includes(v), A = e.useCallback(
351
+ (z) => {
352
+ const fe = z.currentTarget;
353
+ te((ye) => {
354
+ if (ye?.propName !== v)
322
355
  return {
323
- propConfig: G,
324
- propIsRequired: S,
325
- propName: y,
326
- referenceElement: ae
356
+ propConfig: re,
357
+ propIsRequired: T,
358
+ propName: v,
359
+ referenceElement: fe
327
360
  };
328
361
  });
329
362
  },
330
- [G, S, y, te]
331
- ), Te = e.useMemo(() => j !== void 0 ? j : ue === "date-time" && w ? `${s(y)} (${s(C || xe)})` : s(y), [j, ue, w, s, y, C]), Y = e.useCallback(
332
- (v, ae) => {
333
- if (!b || !p)
363
+ [re, T, v, te]
364
+ ), x = e.useMemo(() => se !== void 0 ? se : ue === "date-time" && ve ? `${r(v)} (${r(g || Ne)})` : r(v), [se, ue, ve, r, v, g]), Q = e.useCallback(
365
+ (z, fe) => {
366
+ if (!p || !_)
334
367
  return;
335
- const pe = b.indexOf(v), _e = [...b];
336
- _e.splice(pe, 1);
337
- const X = _e.indexOf(ae);
338
- _e.splice(X + 1, 0, v), x(_e);
339
- const k = [...p], Le = k[pe];
340
- k.splice(pe, 1), k.splice(X + 1, 0, Le), re(new Uint16Array(k)), A && localStorage.setItem(
341
- `${A}.columnNames`,
342
- JSON.stringify(_e)
368
+ const ye = p.indexOf(z), ke = [...p];
369
+ ke.splice(ye, 1);
370
+ const H = ke.indexOf(fe);
371
+ ke.splice(H + 1, 0, z), D(ke);
372
+ const _e = [..._], Oe = _e[ye];
373
+ _e.splice(ye, 1), _e.splice(H + 1, 0, Oe), G(new Uint16Array(_e)), q && localStorage.setItem(
374
+ `${q}.columnNames`,
375
+ JSON.stringify(ke)
343
376
  );
344
377
  },
345
378
  [
346
- b,
347
379
  p,
348
- re,
349
- A,
350
- x
380
+ _,
381
+ G,
382
+ q,
383
+ D
351
384
  ]
352
- ), Re = e.useCallback(
353
- (v) => {
354
- Y && (ne(!0), v.dataTransfer.effectAllowed = "move", v.dataTransfer.dropEffect = "move", v.dataTransfer.setData("text/plain", y));
385
+ ), Me = e.useCallback(
386
+ (z) => {
387
+ Q && (W(!0), z.dataTransfer.effectAllowed = "move", z.dataTransfer.dropEffect = "move", z.dataTransfer.setData("text/plain", v));
355
388
  },
356
- [Y, y]
357
- ), Me = e.useCallback(() => {
358
- Y && (ne(!1), I(-1));
359
- }, [Y, I]), We = e.useCallback(
360
- (v) => {
361
- Y && (v.preventDefault(), I(t));
389
+ [Q, v]
390
+ ), Se = e.useCallback(() => {
391
+ Q && (W(!1), I(-1));
392
+ }, [Q, I]), ze = e.useCallback(
393
+ (z) => {
394
+ Q && (z.preventDefault(), I(n));
362
395
  },
363
- [t, Y, I]
364
- ), qe = e.useCallback(
365
- (v) => {
366
- if (I(-1), !Y || !y)
396
+ [n, Q, I]
397
+ ), Re = e.useCallback(
398
+ (z) => {
399
+ if (I(-1), !Q || !v)
367
400
  return;
368
- const ae = v.dataTransfer.getData("text/plain");
369
- !ae || ae === y || Y(ae, y);
401
+ const fe = z.dataTransfer.getData("text/plain");
402
+ !fe || fe === v || Q(fe, v);
370
403
  },
371
- [Y, y, I]
372
- ), Ae = ln(), Xe = e.useCallback(() => {
373
- !T || !l || T(
374
- Ae ? [] : l.map((v) => v._index).filter((v) => !L?.includes(v))
404
+ [Q, v, I]
405
+ ), Ae = vn(), Ke = e.useCallback(() => {
406
+ !N || !u || N(
407
+ Ae ? [] : u.map((z) => z._index).filter((z) => !E?.includes(z))
375
408
  );
376
409
  }, [
377
- T,
378
- l,
410
+ N,
411
+ u,
379
412
  Ae,
380
- L
413
+ E
381
414
  ]);
382
- if (y === ee)
383
- return /* @__PURE__ */ r("div", { style: a, className: z.join(" "), children: /* @__PURE__ */ r(
415
+ if (v === we)
416
+ return /* @__PURE__ */ s(
417
+ "div",
418
+ {
419
+ style: o,
420
+ className: "mig-schema-table__th mig-schema-table__th--drag-handle"
421
+ }
422
+ );
423
+ if (v === ee)
424
+ return /* @__PURE__ */ s("div", { style: o, className: Z.join(" "), children: /* @__PURE__ */ s(
384
425
  "div",
385
426
  {
386
427
  style: {
@@ -388,65 +429,65 @@ const cn = ({ index: t, style: a }) => {
388
429
  textAlign: "center"
389
430
  },
390
431
  title: `${h?.length || 0} selected`,
391
- children: /* @__PURE__ */ r(
432
+ children: /* @__PURE__ */ s(
392
433
  "input",
393
434
  {
394
435
  type: "checkbox",
395
436
  name: "selectAll",
396
437
  checked: Ae,
397
- onChange: Xe
438
+ onChange: Ke
398
439
  }
399
440
  )
400
441
  }
401
442
  ) });
402
- switch (E?.type) {
443
+ switch (J?.type) {
403
444
  case "boolean":
404
- z.push(
405
- `text-${V || "center"}`,
406
- `justify-content-${V || "center"}`
445
+ Z.push(
446
+ `text-${j || "center"}`,
447
+ `justify-content-${j || "center"}`
407
448
  );
408
449
  break;
409
450
  case "integer":
410
451
  case "number":
411
- z.push(
412
- `text-${V || "end"}`,
413
- `justify-content-${V || "end"}`
452
+ Z.push(
453
+ `text-${j || "end"}`,
454
+ `justify-content-${j || "end"}`
414
455
  );
415
456
  break;
416
457
  default:
417
- V && z.push(`text-${V}`);
458
+ j && Z.push(`text-${j}`);
418
459
  }
419
- let Ee = G?.hoverTitle;
420
- return !Ee && typeof Te == "string" && (Ee = Te), /* @__PURE__ */ F(
460
+ let $e = re?.hoverTitle;
461
+ return !$e && typeof x == "string" && ($e = x), /* @__PURE__ */ B(
421
462
  "div",
422
463
  {
423
- className: z.join(" "),
424
- style: a,
425
- title: Ee,
464
+ className: Z.join(" "),
465
+ style: o,
466
+ title: $e,
426
467
  draggable: !0,
427
- onDragStart: Re,
428
- onDragEnd: Me,
429
- onDragOver: We,
430
- onDrop: qe,
468
+ onDragStart: Me,
469
+ onDragEnd: Se,
470
+ onDragOver: ze,
471
+ onDrop: Re,
431
472
  children: [
432
- /* @__PURE__ */ F(
473
+ /* @__PURE__ */ B(
433
474
  "div",
434
475
  {
435
476
  className: "mig-schema-table__th__label-body",
436
477
  style: { lineHeight: "44px" },
437
- onClick: B,
478
+ onClick: w,
438
479
  children: [
439
- /* @__PURE__ */ r("span", { className: "mig-schema-table__th__label-body-text", children: Te }),
440
- oe === void 0 ? null : /* @__PURE__ */ r("span", { className: "mig-schema-table__th__sort-icon", children: oe ? "↓" : "↑" })
480
+ /* @__PURE__ */ s("span", { className: "mig-schema-table__th__label-body-text", children: x }),
481
+ ne === void 0 ? null : /* @__PURE__ */ s("span", { className: "mig-schema-table__th__sort-icon", children: ne ? "↓" : "↑" })
441
482
  ]
442
483
  }
443
484
  ),
444
- q || se !== Oe.UNAVAILABLE ? /* @__PURE__ */ r(
485
+ ae || S !== Qe.UNAVAILABLE ? /* @__PURE__ */ s(
445
486
  "button",
446
487
  {
447
488
  className: "mig-schema-table__th__trigger-el",
448
- onClick: he,
449
- children: /* @__PURE__ */ r(
489
+ onClick: A,
490
+ children: /* @__PURE__ */ s(
450
491
  "svg",
451
492
  {
452
493
  xmlns: "http://www.w3.org/2000/svg",
@@ -458,7 +499,7 @@ const cn = ({ index: t, style: a }) => {
458
499
  strokeWidth: "2",
459
500
  strokeLinecap: "round",
460
501
  strokeLinejoin: "round",
461
- children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" })
502
+ children: /* @__PURE__ */ s("polyline", { points: "6 9 12 15 18 9" })
462
503
  }
463
504
  )
464
505
  }
@@ -466,49 +507,49 @@ const cn = ({ index: t, style: a }) => {
466
507
  ]
467
508
  }
468
509
  );
469
- }, un = e.memo(cn), dn = {
470
- [ge.GT]: ">",
471
- [ge.LT]: "<",
472
- [ge.EQ]: "="
473
- }, mn = e.memo(
510
+ }, kn = e.memo(yn), Dn = {
511
+ [pe.GT]: ">",
512
+ [pe.LT]: "<",
513
+ [pe.EQ]: "="
514
+ }, xn = e.memo(
474
515
  ({
475
- columnFilterValue: t,
476
- onChange: a,
516
+ columnFilterValue: n,
517
+ onChange: o,
477
518
  onInputKeyDown: h,
478
- propIsRequired: b,
479
- propName: p,
519
+ propIsRequired: p,
520
+ propName: _,
480
521
  propSchema: f,
481
- translate: L
522
+ translate: E
482
523
  }) => {
483
- const { displayTimezone: _ } = e.useContext(De), { type: R, format: N, minimum: T, maximum: O } = f || {}, D = t, x = N === "date-time";
484
- let I, Z;
485
- switch (R) {
524
+ const { displayTimezone: C } = e.useContext(Ie), { type: O, format: L, minimum: N, maximum: $ } = f || {}, M = n, D = L === "date-time";
525
+ let I, Y;
526
+ switch (O) {
486
527
  case "number":
487
528
  case "integer":
488
- return I = D || {}, Z = (o, l, s) => {
489
- const C = {
529
+ return I = M || {}, Y = (b, u, r) => {
530
+ const g = {
490
531
  ...I,
491
- [o]: l.value === "" ? void 0 : parseInt(l.value)
492
- }, Q = Object.values(C).find(
493
- (ne) => isFinite(ne)
532
+ [b]: u.value === "" ? void 0 : parseInt(u.value)
533
+ }, oe = Object.values(g).find(
534
+ (W) => isFinite(W)
494
535
  );
495
- a(
496
- Q !== void 0 && (T === void 0 || Q >= T) ? C : void 0,
497
- s
536
+ o(
537
+ oe !== void 0 && (N === void 0 || oe >= N) ? g : void 0,
538
+ r
498
539
  );
499
- }, /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
500
- b ? null : /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
501
- /* @__PURE__ */ F("label", { className: "d-flex", children: [
502
- /* @__PURE__ */ r(
540
+ }, /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
541
+ p ? null : /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
542
+ /* @__PURE__ */ B("label", { className: "d-flex", children: [
543
+ /* @__PURE__ */ s(
503
544
  "input",
504
545
  {
505
546
  type: "checkbox",
506
547
  style: { marginRight: 14 },
507
548
  checked: !!I.filterEmpty,
508
549
  onChange: () => {
509
- const { filterEmpty: o, ...l } = I;
510
- o || (l.filterEmpty = !0), a(
511
- Object.keys(l).length ? l : void 0,
550
+ const { filterEmpty: b, ...u } = I;
551
+ b || (u.filterEmpty = !0), o(
552
+ Object.keys(u).length ? u : void 0,
512
553
  !0
513
554
  );
514
555
  }
@@ -516,73 +557,73 @@ const cn = ({ index: t, style: a }) => {
516
557
  ),
517
558
  "Hide empty values"
518
559
  ] }),
519
- /* @__PURE__ */ r("hr", {})
560
+ /* @__PURE__ */ s("hr", {})
520
561
  ] }),
521
- Object.keys(ge).map((o) => {
522
- const l = I[o];
523
- return /* @__PURE__ */ F("li", { children: [
524
- /* @__PURE__ */ r("label", { style: { width: 40, paddingLeft: 16 }, children: dn[o] }),
525
- /* @__PURE__ */ r(
562
+ Object.keys(pe).map((b) => {
563
+ const u = I[b];
564
+ return /* @__PURE__ */ B("li", { children: [
565
+ /* @__PURE__ */ s("label", { style: { width: 40, paddingLeft: 16 }, children: Dn[b] }),
566
+ /* @__PURE__ */ s(
526
567
  "input",
527
568
  {
528
569
  className: "form-control",
529
570
  style: { width: 120 },
530
571
  type: "number",
531
- value: l !== void 0 ? l : "",
532
- "data-prop-name": p,
533
- onChange: (s) => {
534
- Z(
535
- o,
536
- s.currentTarget,
572
+ value: u !== void 0 ? u : "",
573
+ "data-prop-name": _,
574
+ onChange: (r) => {
575
+ Y(
576
+ b,
577
+ r.currentTarget,
537
578
  !1
538
579
  );
539
580
  },
540
- onBlur: (s) => {
541
- Z(
542
- o,
543
- s.currentTarget,
581
+ onBlur: (r) => {
582
+ Y(
583
+ b,
584
+ r.currentTarget,
544
585
  !0
545
586
  );
546
587
  },
547
588
  onKeyDown: h,
548
- min: T,
549
- max: O
589
+ min: N,
590
+ max: $
550
591
  }
551
592
  )
552
- ] }, o);
593
+ ] }, b);
553
594
  })
554
595
  ] });
555
596
  case "boolean":
556
597
  const te = [!0, !1];
557
- b || te.push(null);
558
- const A = D ? D.map((o) => ({
559
- value: o,
560
- label: yt.get(o)
598
+ p || te.push(null);
599
+ const q = M ? M.map((b) => ({
600
+ value: b,
601
+ label: Lt.get(b)
561
602
  })) : null;
562
- return /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
563
- ht,
603
+ return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
604
+ yt,
564
605
  {
565
606
  autoFocus: !0,
566
607
  menuIsOpen: !0,
567
608
  isClearable: !0,
568
609
  isMulti: !0,
569
- placeholder: L("All"),
610
+ placeholder: E("All"),
570
611
  className: "react-select-container",
571
612
  classNamePrefix: "react-select",
572
- value: A,
573
- options: te.map((o) => ({
574
- value: o,
575
- label: yt.get(o)
613
+ value: q,
614
+ options: te.map((b) => ({
615
+ value: b,
616
+ label: Lt.get(b)
576
617
  })),
577
618
  styles: {
578
- menu: (o) => ({
579
- ...o,
619
+ menu: (b) => ({
620
+ ...b,
580
621
  marginTop: 0
581
622
  })
582
623
  },
583
- onChange: (o) => {
584
- const l = o && o.length ? o.map(({ value: s }) => s) : void 0;
585
- a(l, !0);
624
+ onChange: (b) => {
625
+ const u = b && b.length ? b.map(({ value: r }) => r) : void 0;
626
+ o(u, !0);
586
627
  },
587
628
  onKeyDown: h
588
629
  }
@@ -590,57 +631,57 @@ const cn = ({ index: t, style: a }) => {
590
631
  // @ts-expect-error falls through
591
632
  case "string":
592
633
  if (f?.enum) {
593
- const o = f.enum.map((s) => ({
594
- value: s,
595
- label: L(s)
596
- })), l = o.filter(
597
- (s) => (D || []).includes(s.value)
634
+ const b = f.enum.map((r) => ({
635
+ value: r,
636
+ label: E(r)
637
+ })), u = b.filter(
638
+ (r) => (M || []).includes(r.value)
598
639
  );
599
- return /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
600
- ht,
640
+ return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
641
+ yt,
601
642
  {
602
643
  isMulti: !0,
603
644
  autoFocus: !0,
604
645
  menuIsOpen: !0,
605
646
  className: "react-select-container",
606
647
  classNamePrefix: "react-select",
607
- value: l,
608
- options: o,
648
+ value: u,
649
+ options: b,
609
650
  styles: {
610
- menu: (s) => ({
611
- ...s,
651
+ menu: (r) => ({
652
+ ...r,
612
653
  marginTop: 0
613
654
  })
614
655
  },
615
- onChange: (s) => {
616
- const C = s ? s.map(
617
- (Q) => Q.value
656
+ onChange: (r) => {
657
+ const g = r ? r.map(
658
+ (oe) => oe.value
618
659
  ) : [];
619
- a(C.length ? C : void 0, !0);
660
+ o(g.length ? g : void 0, !0);
620
661
  },
621
662
  onKeyDown: h,
622
- placeholder: L("Select...")
663
+ placeholder: E("Select...")
623
664
  }
624
665
  ) }) });
625
666
  }
626
- if (x || N === "date") {
627
- const o = x ? Ge : Dt, l = t || {
667
+ if (D || L === "date") {
668
+ const b = D ? Ye : $t, u = n || {
628
669
  from: void 0,
629
670
  to: void 0,
630
671
  filterEmpty: void 0
631
672
  };
632
- return /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
633
- b ? null : /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
634
- /* @__PURE__ */ F("label", { className: "d-flex", children: [
635
- /* @__PURE__ */ r(
673
+ return /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
674
+ p ? null : /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
675
+ /* @__PURE__ */ B("label", { className: "d-flex", children: [
676
+ /* @__PURE__ */ s(
636
677
  "input",
637
678
  {
638
679
  type: "checkbox",
639
- checked: !!l.filterEmpty,
680
+ checked: !!u.filterEmpty,
640
681
  onChange: () => {
641
- const { filterEmpty: s, ...C } = l;
642
- s || (C.filterEmpty = !0), a(
643
- Object.keys(C).length ? C : void 0,
682
+ const { filterEmpty: r, ...g } = u;
683
+ r || (g.filterEmpty = !0), o(
684
+ Object.keys(g).length ? g : void 0,
644
685
  !0
645
686
  );
646
687
  }
@@ -648,84 +689,84 @@ const cn = ({ index: t, style: a }) => {
648
689
  ),
649
690
  "Hide empty values"
650
691
  ] }),
651
- /* @__PURE__ */ r("hr", {})
692
+ /* @__PURE__ */ s("hr", {})
652
693
  ] }),
653
- /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
654
- /* @__PURE__ */ r("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
655
- /* @__PURE__ */ r(
656
- mt,
694
+ /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
695
+ /* @__PURE__ */ s("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
696
+ /* @__PURE__ */ s(
697
+ vt,
657
698
  {
658
- dateFormat: o,
659
- "data-prop-name": p,
660
- locale: ft,
661
- selected: l.from ? new Ze(l.from).withTimeZone(
662
- _ || xe
699
+ dateFormat: b,
700
+ "data-prop-name": _,
701
+ locale: kt,
702
+ selected: u.from ? new Ve(u.from).withTimeZone(
703
+ C || Ne
663
704
  ) : null,
664
- onChange: (s) => {
665
- if (!s && !l.to) {
666
- a(void 0, !0);
705
+ onChange: (r) => {
706
+ if (!r && !u.to) {
707
+ o(void 0, !0);
667
708
  return;
668
709
  }
669
- if (l.to && s && s > l.to)
710
+ if (u.to && r && r > u.to)
670
711
  return;
671
- const C = s ? Ze.tz(_ || xe, s) : void 0;
672
- a(
712
+ const g = r ? Ve.tz(C || Ne, r) : void 0;
713
+ o(
673
714
  {
674
- ...t,
675
- from: C
715
+ ...n,
716
+ from: g
676
717
  },
677
718
  !0
678
719
  );
679
720
  },
680
- placeholderText: o,
721
+ placeholderText: b,
681
722
  isClearable: !0,
682
723
  selectsStart: !0,
683
- showTimeSelect: x,
684
- showTimeInput: x,
724
+ showTimeSelect: D,
725
+ showTimeInput: D,
685
726
  showMonthDropdown: !0,
686
727
  showYearDropdown: !0,
687
728
  timeIntervals: 15,
688
- shouldCloseOnSelect: !x
729
+ shouldCloseOnSelect: !D
689
730
  }
690
731
  )
691
732
  ] }),
692
- /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
693
- /* @__PURE__ */ r("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
694
- /* @__PURE__ */ r(
695
- mt,
733
+ /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
734
+ /* @__PURE__ */ s("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
735
+ /* @__PURE__ */ s(
736
+ vt,
696
737
  {
697
738
  id: "filter-date",
698
- dateFormat: o,
699
- "data-prop-name": p,
700
- locale: ft,
739
+ dateFormat: b,
740
+ "data-prop-name": _,
741
+ locale: kt,
701
742
  selectsEnd: !0,
702
- selected: l.to ? new Ze(l.to).withTimeZone(
703
- _ || xe
743
+ selected: u.to ? new Ve(u.to).withTimeZone(
744
+ C || Ne
704
745
  ) : null,
705
746
  showMonthDropdown: !0,
706
747
  showYearDropdown: !0,
707
- onChange: (s) => {
708
- if (!s && !l.from) {
709
- a(void 0, !0);
748
+ onChange: (r) => {
749
+ if (!r && !u.from) {
750
+ o(void 0, !0);
710
751
  return;
711
752
  }
712
- const C = s ? x ? Ze.tz(_ || xe, s) : Zt(s) : void 0;
713
- l.from && C && C < l.from || a(
753
+ const g = r ? D ? Ve.tz(C || Ne, r) : on(r) : void 0;
754
+ u.from && g && g < u.from || o(
714
755
  {
715
- ...t,
716
- to: C
756
+ ...n,
757
+ to: g
717
758
  },
718
759
  !0
719
760
  );
720
761
  },
721
- placeholderText: o,
762
+ placeholderText: b,
722
763
  isClearable: !0,
723
- startDate: l.from,
724
- endDate: l.to,
725
- showTimeInput: x,
726
- showTimeSelect: x,
764
+ startDate: u.from,
765
+ endDate: u.to,
766
+ showTimeInput: D,
767
+ showTimeSelect: D,
727
768
  timeIntervals: 15,
728
- shouldCloseOnSelect: !x
769
+ shouldCloseOnSelect: !D
729
770
  }
730
771
  )
731
772
  ] })
@@ -733,28 +774,28 @@ const cn = ({ index: t, style: a }) => {
733
774
  }
734
775
  // falls through
735
776
  default:
736
- return /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
777
+ return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
737
778
  "input",
738
779
  {
739
780
  autoFocus: !0,
740
781
  type: "search",
741
782
  className: "form-control",
742
- placeholder: `Search ${p}`,
743
- "aria-label": `Search ${p}`,
744
- value: Array.isArray(D) ? D.join(",") : D || "",
745
- "data-prop-name": p,
746
- onChange: (o) => {
747
- const l = o.currentTarget.value, s = l ? l.split(",") : [];
748
- a(
749
- (s.length > 1 ? s : s[0]) || void 0,
783
+ placeholder: `Search ${_}`,
784
+ "aria-label": `Search ${_}`,
785
+ value: Array.isArray(M) ? M.join(",") : M || "",
786
+ "data-prop-name": _,
787
+ onChange: (b) => {
788
+ const u = b.currentTarget.value, r = u ? u.split(",") : [];
789
+ o(
790
+ (r.length > 1 ? r : r[0]) || void 0,
750
791
  !1
751
792
  );
752
793
  },
753
794
  onKeyDown: h,
754
- onBlur: (o) => {
755
- const l = o.currentTarget.value, s = l ? l.split(",") : [];
756
- a(
757
- (s.length > 1 ? s : s[0]) || void 0,
795
+ onBlur: (b) => {
796
+ const u = b.currentTarget.value, r = u ? u.split(",") : [];
797
+ o(
798
+ (r.length > 1 ? r : r[0]) || void 0,
758
799
  !0
759
800
  );
760
801
  }
@@ -762,761 +803,788 @@ const cn = ({ index: t, style: a }) => {
762
803
  ) }) });
763
804
  }
764
805
  }
765
- ), hn = ({
766
- isSortable: t,
767
- isFilterable: a,
806
+ ), Tn = ({
807
+ isSortable: n,
808
+ isFilterable: o,
768
809
  onChange: h,
769
- onClose: b,
770
- onInputKeyDown: p,
810
+ onClose: p,
811
+ onInputKeyDown: _,
771
812
  propConfig: f,
772
- propIsRequired: L,
773
- propName: _,
774
- propSchema: R,
775
- referenceElement: N,
776
- setFilterSortColumn: T,
777
- translate: O,
778
- value: D
813
+ propIsRequired: E,
814
+ propName: C,
815
+ propSchema: O,
816
+ referenceElement: L,
817
+ setFilterSortColumn: N,
818
+ translate: $,
819
+ value: M
779
820
  }) => {
780
- const x = gt({
821
+ const D = Dt({
781
822
  placement: "bottom-start",
782
823
  elements: {
783
- reference: N
824
+ reference: L
784
825
  },
785
- middleware: [bt()]
786
- }), I = gt({
826
+ middleware: [xt()]
827
+ }), I = Dt({
787
828
  placement: "right-start",
788
- middleware: [bt()]
829
+ middleware: [xt()]
789
830
  });
790
831
  e.useEffect(() => {
791
- const l = (s) => {
792
- if (!x.elements.floating)
832
+ const u = (r) => {
833
+ if (!D.elements.floating)
793
834
  return;
794
- let C = s.target;
795
- for (; C && x.elements.floating; ) {
796
- if (C === x.elements.floating || C === I.elements.floating)
835
+ let g = r.target;
836
+ for (; g && D.elements.floating; ) {
837
+ if (g === D.elements.floating || g === I.elements.floating)
797
838
  return;
798
- C = C.parentNode === window.document ? null : C.parentNode;
839
+ g = g.parentNode === window.document ? null : g.parentNode;
799
840
  }
800
- b(s);
841
+ p(r);
801
842
  };
802
- return window.addEventListener("click", l, { capture: !0 }), () => {
803
- window.removeEventListener("click", l, { capture: !0 });
843
+ return window.addEventListener("click", u, { capture: !0 }), () => {
844
+ window.removeEventListener("click", u, { capture: !0 });
804
845
  };
805
846
  }, [
806
- x.elements.floating,
807
- b,
847
+ D.elements.floating,
848
+ p,
808
849
  I.elements.floating
809
850
  ]);
810
- const Z = f?.FilterMenu || mn, te = e.useCallback(
811
- (l) => {
812
- T(_, !0), b(l);
851
+ const Y = f?.FilterMenu || xn, te = e.useCallback(
852
+ (u) => {
853
+ N(C, !0), p(u);
813
854
  },
814
- [b, _, T]
815
- ), A = e.useCallback(
816
- (l) => {
817
- T(_, !1), b(l);
855
+ [p, C, N]
856
+ ), q = e.useCallback(
857
+ (u) => {
858
+ N(C, !1), p(u);
818
859
  },
819
- [b, _, T]
820
- ), o = e.useCallback(() => {
860
+ [p, C, N]
861
+ ), b = e.useCallback(() => {
821
862
  h(void 0, !0);
822
863
  }, [h]);
823
- return !t && !a ? null : /* @__PURE__ */ F(Qt, { children: [
824
- /* @__PURE__ */ r(
864
+ return !n && !o ? null : /* @__PURE__ */ B(en, { children: [
865
+ /* @__PURE__ */ s(
825
866
  "div",
826
867
  {
827
868
  className: "mig-schema-table mig-schema-table__th-menu",
828
- ref: x.refs.setFloating,
829
- style: x.floatingStyles,
830
- children: /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu", children: [
831
- t ? /* @__PURE__ */ F("li", { onClick: te, style: { padding: 8 }, children: [
832
- /* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
869
+ ref: D.refs.setFloating,
870
+ style: D.floatingStyles,
871
+ children: /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu", children: [
872
+ n ? /* @__PURE__ */ B("li", { onClick: te, style: { padding: 8 }, children: [
873
+ /* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
833
874
  " ",
834
- O("sortAscending")
875
+ $("sortAscending")
835
876
  ] }) : null,
836
- t ? /* @__PURE__ */ F("li", { onClick: A, style: { padding: 8 }, children: [
837
- /* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
877
+ n ? /* @__PURE__ */ B("li", { onClick: q, style: { padding: 8 }, children: [
878
+ /* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
838
879
  " ",
839
- O("sortDescending")
880
+ $("sortDescending")
840
881
  ] }) : null,
841
- a ? /* @__PURE__ */ F(
882
+ o ? /* @__PURE__ */ B(
842
883
  "li",
843
884
  {
844
885
  style: { padding: 8 },
845
- onMouseOver: (l) => {
846
- I.refs.setReference(l.currentTarget);
886
+ onMouseOver: (u) => {
887
+ I.refs.setReference(u.currentTarget);
847
888
  },
848
889
  children: [
849
- /* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ r(
890
+ /* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ s(
850
891
  "input",
851
892
  {
852
893
  type: "checkbox",
853
894
  id: "mig-schema-table__th-menu__filters",
854
- checked: D !== void 0,
855
- disabled: D === void 0,
856
- onChange: o
895
+ checked: M !== void 0,
896
+ disabled: M === void 0,
897
+ onChange: b
857
898
  }
858
899
  ) }),
859
- /* @__PURE__ */ r("label", { htmlFor: "mig-schema-table__th-menu__filters", children: O("filters") }),
860
- /* @__PURE__ */ r("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
900
+ /* @__PURE__ */ s("label", { htmlFor: "mig-schema-table__th-menu__filters", children: $("filters") }),
901
+ /* @__PURE__ */ s("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
861
902
  ]
862
903
  }
863
904
  ) : null
864
905
  ] })
865
906
  }
866
907
  ),
867
- I.elements.reference ? /* @__PURE__ */ r(
908
+ I.elements.reference ? /* @__PURE__ */ s(
868
909
  "div",
869
910
  {
870
911
  className: "mig-schema-table mig-schema-table__th-menu__sub-menu",
871
912
  ref: I.refs.setFloating,
872
913
  style: I.floatingStyles,
873
- children: /* @__PURE__ */ r(
874
- Z,
914
+ children: /* @__PURE__ */ s(
915
+ Y,
875
916
  {
876
- columnFilterValue: D,
917
+ columnFilterValue: M,
877
918
  onChange: h,
878
- onInputKeyDown: p,
879
- propIsRequired: L,
880
- propName: _,
881
- propSchema: R,
882
- translate: O
919
+ onInputKeyDown: _,
920
+ propIsRequired: E,
921
+ propName: C,
922
+ propSchema: O,
923
+ translate: $
883
924
  }
884
925
  )
885
926
  }
886
927
  ) : null
887
928
  ] });
888
- }, fn = e.memo(hn), gn = ({
889
- columnWidths: t,
890
- resizeColumnIndex: a,
929
+ }, Mn = e.memo(Tn), An = ({
930
+ columnWidths: n,
931
+ resizeColumnIndex: o,
891
932
  setResizeColumnIndex: h,
892
- tableBodyHeight: b
933
+ tableBodyHeight: p
893
934
  }) => {
894
- const [p, f] = e.useState(0), L = At(), _ = e.useCallback(
895
- (O) => {
896
- const D = t.map(
897
- (x, I) => I === a ? Math.max(x + O, Tt) : x
935
+ const [_, f] = e.useState(0), E = jt(), C = e.useCallback(
936
+ ($) => {
937
+ const M = n.map(
938
+ (D, I) => I === o ? Math.max(D + $, Ot) : D
898
939
  );
899
- L(D);
940
+ E(M);
900
941
  },
901
- [t, a, L]
942
+ [n, o, E]
902
943
  );
903
- let R = 0;
904
- const N = e.useCallback(
905
- (O) => {
906
- h(parseInt(O.currentTarget.dataset.columnIndex)), f(O.clientX);
944
+ let O = 0;
945
+ const L = e.useCallback(
946
+ ($) => {
947
+ h(parseInt($.currentTarget.dataset.columnIndex)), f($.clientX);
907
948
  },
908
949
  [h]
909
- ), T = e.useCallback(
910
- (O) => {
911
- _(O.clientX - p), f(0), h(-1);
950
+ ), N = e.useCallback(
951
+ ($) => {
952
+ C($.clientX - _), f(0), h(-1);
912
953
  },
913
- [p, _, h]
954
+ [_, C, h]
914
955
  );
915
- return /* @__PURE__ */ r("div", { children: [...t].map((O, D) => {
916
- R += O;
917
- const x = ["mig-schema-table__column_resizer"];
918
- return D === a && x.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ r(
956
+ return /* @__PURE__ */ s("div", { children: [...n].map(($, M) => {
957
+ O += $;
958
+ const D = ["mig-schema-table__column_resizer"];
959
+ return M === o && D.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ s(
919
960
  "div",
920
961
  {
921
- style: { left: R - sn, bottom: b },
922
- className: x.join(" "),
962
+ style: { left: O - _n, bottom: p },
963
+ className: D.join(" "),
923
964
  draggable: "true",
924
- "data-column-index": D,
925
- onDragStart: N,
926
- onDragEnd: T
965
+ "data-column-index": M,
966
+ onDragStart: L,
967
+ onDragEnd: N
927
968
  },
928
- D
969
+ M
929
970
  );
930
971
  }) });
931
- }, vt = (t) => {
932
- const [a, h] = e.useState({ width: 0, height: 0 }), b = e.useMemo(
933
- () => Vt(h, 100),
972
+ }, It = (n) => {
973
+ const [o, h] = e.useState({ width: 0, height: 0 }), p = e.useMemo(
974
+ () => dn(h, 100),
934
975
  []
935
976
  );
936
977
  return e.useEffect(() => {
937
- if (!t)
978
+ if (!n)
938
979
  return;
939
- const p = new ResizeObserver((f) => {
940
- for (const L of f) {
941
- const { blockSize: _, inlineSize: R } = L.borderBoxSize[0];
942
- b(
943
- (N) => R && _ && (N.width !== R || N.height !== _) ? { width: R, height: _ } : N
980
+ const _ = new ResizeObserver((f) => {
981
+ for (const E of f) {
982
+ const { blockSize: C, inlineSize: O } = E.borderBoxSize[0];
983
+ p(
984
+ (L) => O && C && (L.width !== O || L.height !== C) ? { width: O, height: C } : L
944
985
  );
945
986
  }
946
987
  });
947
- return p.observe(t), () => {
948
- p.disconnect();
988
+ return _.observe(n), () => {
989
+ _.disconnect();
949
990
  };
950
- }, [b, t]), a;
951
- }, bn = () => new Promise((t, a) => {
991
+ }, [p, n]), o;
992
+ }, En = () => new Promise((n, o) => {
952
993
  if (window.ExcelJS) {
953
- t(window.ExcelJS);
994
+ n(window.ExcelJS);
954
995
  return;
955
996
  }
956
997
  const h = document.createElement("script");
957
998
  h.src = "https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.bare.min.js", h.onload = () => {
958
- t(window.ExcelJS);
999
+ n(window.ExcelJS);
959
1000
  }, h.onerror = () => {
960
- a(new Error("Failed to load ExcelJS library"));
1001
+ o(new Error("Failed to load ExcelJS library"));
961
1002
  }, document.head.appendChild(h);
962
- }), pn = async (t) => {
963
- const { Workbook: a } = await bn(), h = new a(), b = h.addWorksheet("Data");
964
- t.length && (b.addRow(
965
- Yt(Object.keys(t[0]), [
1003
+ }), Ln = async (n) => {
1004
+ const { Workbook: o } = await En(), h = new o(), p = h.addWorksheet("Data");
1005
+ n.length && (p.addRow(
1006
+ mn(Object.keys(n[0]), [
966
1007
  "_index",
967
1008
  "SELECT_ALL_COLUMN_NAME"
968
1009
  ])
969
- ), b.getRow(1).font = { bold: !0 }, b.addRows(
970
- t.map((p) => {
971
- const { _index: f, SELECT_ALL_COLUMN_NAME: L, ..._ } = p;
972
- return Object.values(_);
1010
+ ), p.getRow(1).font = { bold: !0 }, p.addRows(
1011
+ n.map((_) => {
1012
+ const { _index: f, SELECT_ALL_COLUMN_NAME: E, ...C } = _;
1013
+ return Object.values(C);
973
1014
  })
974
- ), h.xlsx.writeBuffer().then((p) => {
975
- const f = new Blob([p], {
1015
+ ), h.xlsx.writeBuffer().then((_) => {
1016
+ const f = new Blob([_], {
976
1017
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
977
1018
  });
978
- nn(f, "export.xlsx");
979
- }).catch((p) => {
980
- console.error("Error generating Excel file:", p);
1019
+ bn(f, "export.xlsx");
1020
+ }).catch((_) => {
1021
+ console.error("Error generating Excel file:", _);
981
1022
  }));
982
- }, kt = /* @__PURE__ */ new Date("1000-01-01 00:00:00Z"), _n = new Intl.NumberFormat("nl-NL"), Cn = new Intl.NumberFormat("nl-NL", {
1023
+ }, St = /* @__PURE__ */ new Date("1000-01-01 00:00:00Z"), Nn = new Intl.NumberFormat("nl-NL"), In = new Intl.NumberFormat("nl-NL", {
983
1024
  style: "currency",
984
1025
  currency: "EUR"
985
1026
  });
986
- function yn(t, a) {
987
- const { TdBody: h, sortByValue: b } = a || {};
988
- if (b !== void 0)
989
- return b;
990
- if (!t)
1027
+ function Sn(n, o) {
1028
+ const { TdBody: h, sortByValue: p } = o || {};
1029
+ if (p !== void 0)
1030
+ return p;
1031
+ if (!n)
991
1032
  return !1;
992
- const { format: p, type: f } = t;
993
- return p?.startsWith("date") || f === "boolean" || f === "integer" || f === "number" || !!h;
1033
+ const { format: _, type: f } = n;
1034
+ return _?.startsWith("date") || f === "boolean" || f === "integer" || f === "number" || !!h;
994
1035
  }
995
- const wn = ({
996
- CustomElement: t,
997
- CustomSearchInput: a,
998
- Heading: h = Pt,
999
- autoRender: b,
1000
- checkedIndexes: p,
1036
+ function ct(n) {
1037
+ return n ? [...n.keys()] : void 0;
1038
+ }
1039
+ const Rn = ({
1040
+ CustomElement: n,
1041
+ CustomSearchInput: o,
1042
+ Heading: h = rn,
1043
+ autoRender: p,
1044
+ checkedIndexes: _,
1001
1045
  config: f,
1002
- customElementProps: L,
1003
- data: _,
1004
- defaultColumnFilters: R,
1005
- defaultSortAsc: N = !1,
1006
- defaultSortColumn: T,
1007
- disabledCheckedIndexes: O,
1008
- displayTimezone: D,
1009
- enableAutoFocus: x = !0,
1046
+ customElementProps: E,
1047
+ data: C,
1048
+ defaultColumnFilters: O,
1049
+ defaultSortAsc: L = !1,
1050
+ defaultSortColumn: N,
1051
+ disabledCheckedIndexes: $,
1052
+ displayTimezone: M,
1053
+ enableAutoFocus: D = !0,
1010
1054
  enableRowCounter: I = !0,
1011
- getRowClassName: Z,
1055
+ getRowClassName: Y,
1012
1056
  getRowSelected: te,
1013
- getSearchQueryFilterResult: A,
1014
- infiniteLoaderRef: o,
1015
- isColumnFilterable: l = !0,
1016
- isExportable: s = !0,
1017
- isResizable: C = !0,
1018
- isSearchable: Q = !0,
1019
- isSortable: ne = !0,
1020
- itemCount: ce,
1021
- loadMoreItems: re,
1022
- maxHeight: y,
1023
- onRowClick: E,
1024
- onRowDoubleClick: oe,
1025
- onSearchEnter: G,
1026
- onTableDataStateChange: se,
1027
- onFilteredSortedDataChange: q,
1028
- rowHeight: z = 36,
1029
- schema: ue,
1030
- searchPlaceholder: V,
1031
- setCheckedIndexes: W,
1057
+ getSearchQueryFilterResult: q,
1058
+ infiniteLoaderRef: b,
1059
+ isDraggable: u = !1,
1060
+ isColumnFilterable: r = !0,
1061
+ isExportable: g = !0,
1062
+ isResizable: oe = !0,
1063
+ isSearchable: W = !0,
1064
+ isSortable: ce = !0,
1065
+ itemCount: G,
1066
+ loadMoreItems: v,
1067
+ maxHeight: J,
1068
+ onRowClick: ne,
1069
+ onRowDoubleClick: re,
1070
+ onRowOrderChange: S,
1071
+ onSearchEnter: ae,
1072
+ onTableDataStateChange: Z,
1073
+ onFilteredSortedDataChange: ue,
1074
+ rowHeight: j = 36,
1075
+ schema: he,
1076
+ searchPlaceholder: ve,
1077
+ setCheckedIndexes: se,
1032
1078
  settingsStorageKey: w,
1033
- style: j,
1034
- translate: B = pt,
1035
- useFilterStateHash: S,
1036
- width: he
1037
- }, Te) => {
1038
- const [Y, Re] = e.useState(), [Me, We] = e.useState(), [qe, Ae] = e.useState(-1), [Xe, Ee] = e.useState(-1), [v, ae] = e.useState(), [pe, _e] = e.useState(), X = _ instanceof Function, [k, Le] = e.useState(
1039
- X ? void 0 : _
1040
- ), [Ce, He] = e.useState(), [c, we] = e.useState({
1079
+ style: T,
1080
+ translate: A = Tt,
1081
+ useFilterStateHash: x,
1082
+ width: Q
1083
+ }, Me) => {
1084
+ const [Se, ze] = e.useState(), [Re, Ae] = e.useState(), [Ke, $e] = e.useState(-1), [z, fe] = e.useState(-1), [ye, ke] = e.useState(-1), H = C instanceof Function, [_e, Oe] = e.useState(
1085
+ H ? void 0 : ct(C)
1086
+ ), [X, et] = e.useState(), [Ft, Bt] = e.useState(), [y, tt] = e.useState(
1087
+ H ? void 0 : C
1088
+ ), [De, nt] = e.useState(), [c, xe] = e.useState({
1041
1089
  searchQuery: "",
1042
- columnFilterMap: R || {},
1043
- sortColumn: T,
1044
- sortAsc: N
1045
- }), [P, Et] = e.useState(
1046
- S ? dt(window.location.hash) : null
1090
+ columnFilterMap: O || {},
1091
+ sortColumn: N,
1092
+ sortAsc: L
1093
+ }), [U, Qt] = e.useState(
1094
+ x ? wt(window.location.hash) : null
1047
1095
  );
1048
1096
  e.useEffect(() => {
1049
- X || Le(_);
1050
- }, [_, X]), e.useEffect(() => {
1051
- !X || k !== void 0 || _(
1052
- P && Object.keys(P).length !== 0 ? {
1053
- ...P,
1054
- columnFilterMap: P.columnFilterMap || {}
1097
+ H || (tt(C), Oe(ct(C)));
1098
+ }, [C, H]), e.useEffect(() => {
1099
+ !H || y !== void 0 || C(
1100
+ U && Object.keys(U).length !== 0 ? {
1101
+ ...U,
1102
+ columnFilterMap: U.columnFilterMap || {}
1055
1103
  } : c
1056
- ).then(Le);
1057
- }, [_, X, P, k, c]), e.useEffect(() => {
1058
- Ce || He(c);
1059
- }, [c, Ce]), e.useEffect(() => {
1060
- if (!S)
1104
+ ).then((t) => {
1105
+ tt(t), Oe(ct(t));
1106
+ });
1107
+ }, [C, H, U, y, c]), e.useEffect(() => {
1108
+ De || nt(c);
1109
+ }, [c, De]), e.useEffect(() => {
1110
+ if (!x)
1061
1111
  return;
1062
- const n = () => {
1063
- Et(dt(window.location.hash));
1112
+ const t = () => {
1113
+ Qt(wt(window.location.hash));
1064
1114
  };
1065
- return window.addEventListener("hashchange", n), () => {
1066
- window.removeEventListener("hashchange", n);
1115
+ return window.addEventListener("hashchange", t), () => {
1116
+ window.removeEventListener("hashchange", t);
1067
1117
  };
1068
- }, [S]), e.useEffect(() => {
1069
- if (!S)
1118
+ }, [x]);
1119
+ const dt = e.useRef(O);
1120
+ dt.current = O, e.useEffect(() => {
1121
+ if (!x)
1070
1122
  return;
1071
- const { columnFilterMap: n, searchQuery: u, sortAsc: m, sortColumn: i } = P || {}, g = {
1072
- searchQuery: u || "",
1073
- columnFilterMap: n || R || {},
1074
- sortAsc: m === void 0 ? N : m,
1075
- sortColumn: i === void 0 ? T : i
1123
+ const { columnFilterMap: t, searchQuery: a, sortAsc: l, sortColumn: i } = U || {}, d = {
1124
+ searchQuery: a || "",
1125
+ columnFilterMap: t || dt.current || {},
1126
+ sortAsc: l === void 0 ? L : l,
1127
+ sortColumn: i === void 0 ? N : i
1076
1128
  };
1077
- we(
1078
- (M) => nt(g, M) ? M : g
1129
+ xe(
1130
+ (k) => Xe(d, k) ? k : d
1079
1131
  );
1080
- }, [
1081
- P,
1082
- S,
1083
- R,
1084
- N,
1085
- T
1086
- ]), e.useEffect(() => {
1087
- se && se(c);
1088
- }, [se, c]);
1089
- const je = e.useRef(null), st = e.useRef(null), ot = e.useRef(null), Be = vt(st.current), at = vt(
1090
- ot.current
1091
- ), Ne = e.useMemo(
1092
- () => he || Math.floor(Be.width || 0),
1093
- [Be.width, he]
1094
- ), Ie = e.useMemo(() => !nt(c, Ce) && X, [c, Ce, X]), { properties: ie, required: Lt } = e.useMemo(
1132
+ }, [U, x, L, N]), e.useEffect(() => {
1133
+ Z && Z(c);
1134
+ }, [Z, c]);
1135
+ const Ue = e.useRef(null), mt = e.useRef(null), ht = e.useRef(null), Pe = It(mt.current), ft = It(
1136
+ ht.current
1137
+ ), We = e.useMemo(
1138
+ () => Q || Math.floor(Pe.width || 0),
1139
+ [Pe.width, Q]
1140
+ ), je = e.useMemo(() => !Xe(c, De) && H, [c, De, H]), { properties: ie, required: zt } = e.useMemo(
1095
1141
  () => ({
1096
1142
  properties: {},
1097
1143
  required: [],
1098
- ...ue
1144
+ ...he
1099
1145
  }),
1100
- [ue]
1101
- ), Fe = w ? localStorage.getItem(`${w}.columnNames`) : null, Qe = w ? localStorage.getItem(`${w}.columnWidths`) : null, K = e.useMemo(() => {
1102
- if (Y)
1103
- return Y;
1104
- const n = Fe ? JSON.parse(Fe) : void 0;
1105
- let u = Object.keys(ie);
1106
- if (W && u.unshift(ee), f) {
1146
+ [he]
1147
+ ), Je = w ? localStorage.getItem(`${w}.columnNames`) : null, Ge = w ? localStorage.getItem(`${w}.columnWidths`) : null, K = e.useMemo(() => {
1148
+ if (Se)
1149
+ return Se;
1150
+ const t = Je ? JSON.parse(Je) : void 0;
1151
+ let a = Object.keys(ie);
1152
+ if (se && a.unshift(ee), u && a.unshift(we), f) {
1107
1153
  Object.keys(f).forEach((i) => {
1108
- u.includes(i) || u.push(i);
1154
+ a.includes(i) || a.push(i);
1109
1155
  });
1110
- const m = Object.entries(f).reduce(
1111
- (i, [g, M]) => (M.hidden && i.push(g), i),
1156
+ const l = Object.entries(f).reduce(
1157
+ (i, [d, k]) => (k.hidden && i.push(d), i),
1112
1158
  []
1113
1159
  );
1114
- u = u.filter((i) => !m.includes(i)).sort((i, g) => {
1115
- let M = f[i] ? f[i].order : void 0;
1116
- M === void 0 && (M = Object.keys(ie).findIndex(
1117
- (H) => H === i
1160
+ a = a.filter((i) => !l.includes(i)).sort((i, d) => {
1161
+ let k = f[i] ? f[i].order : void 0;
1162
+ k === void 0 && (k = Object.keys(ie).findIndex(
1163
+ (V) => V === i
1118
1164
  ));
1119
- let d = f[g] ? f[g].order : void 0;
1120
- return d === void 0 && (d = Object.keys(ie).findIndex(
1121
- (H) => H === g
1122
- )), g === ee || i === ee ? 0 : M === -1 ? 1 : d === -1 ? -1 : M - d;
1165
+ let m = f[d] ? f[d].order : void 0;
1166
+ return m === void 0 && (m = Object.keys(ie).findIndex(
1167
+ (V) => V === d
1168
+ )), d === ee || i === ee || d === we || i === we ? 0 : k === -1 ? 1 : m === -1 ? -1 : k - m;
1123
1169
  });
1124
1170
  }
1125
- return n?.length === u.length ? n : u;
1171
+ return t?.length === a.length ? t : a;
1126
1172
  }, [
1127
1173
  f,
1128
- Y,
1129
- W,
1174
+ Se,
1175
+ u,
1176
+ se,
1130
1177
  ie,
1131
- Fe
1132
- ]), ze = e.useMemo(
1133
- () => k && K ? k.map(
1134
- (n, u) => K.reduce(
1135
- (m, i) => {
1136
- const g = ie[i], M = f ? f[i] : void 0;
1137
- if (M?.renderData)
1138
- return m[i] = M.renderData(n, u), m;
1139
- if (!g || i === ee)
1140
- return m[i] = "", m;
1141
- const d = n ? n[i] : "";
1142
- switch (g.type) {
1178
+ Je
1179
+ ]), Te = e.useMemo(
1180
+ () => y && K ? y.map(
1181
+ (t, a) => K.reduce(
1182
+ (l, i) => {
1183
+ const d = ie[i], k = f ? f[i] : void 0;
1184
+ if (k?.renderData)
1185
+ return l[i] = k.renderData(t, a), l;
1186
+ if (!d || i === ee || i === we)
1187
+ return l[i] = "", l;
1188
+ const m = t ? t[i] : "";
1189
+ switch (d.type) {
1143
1190
  case "array":
1144
- return m[i] = g.items?.type === "string" && d ? d.map((H) => B(H)).join(", ") : JSON.stringify(d), m;
1191
+ return l[i] = d.items?.type === "string" && m ? m.map((V) => A(V)).join(", ") : JSON.stringify(m), l;
1145
1192
  case "boolean":
1146
- return m[i] = d === void 0 ? "?" : d ? "✓" : "✕", m;
1193
+ return l[i] = m === void 0 ? "?" : m ? "✓" : "✕", l;
1147
1194
  case "number":
1148
1195
  case "integer":
1149
- return d === void 0 ? (m[i] = "", m) : (m[i] = g.format === "currency" ? Cn.format(d) : _n.format(d), m);
1196
+ return m === void 0 ? (l[i] = "", l) : (l[i] = d.format === "currency" ? In.format(m) : Nn.format(m), l);
1150
1197
  // @ts-expect-error investigate
1151
1198
  case "string":
1152
- if (g.format === "date" && d)
1153
- return m[i] = ["2999-12-31", "1970-01-01"].includes(
1154
- d
1155
- ) ? "-" : rt(
1156
- new Date(d),
1157
- M?.dateFormat || Dt
1158
- ), m;
1159
- if (g.format === "date-time" && d)
1160
- return m[i] = D ? xt(
1161
- new Date(d),
1162
- D,
1163
- Ge
1164
- ) : rt(
1165
- new Date(d),
1166
- M?.dateFormat || Ge
1167
- ), m;
1168
- if (g.enum)
1169
- return m[i] = d ? B(d) : "", m;
1199
+ if (d.format === "date" && m)
1200
+ return l[i] = ["2999-12-31", "1970-01-01"].includes(
1201
+ m
1202
+ ) ? "-" : ut(
1203
+ new Date(m),
1204
+ k?.dateFormat || $t
1205
+ ), l;
1206
+ if (d.format === "date-time" && m)
1207
+ return l[i] = M ? Rt(
1208
+ new Date(m),
1209
+ M,
1210
+ Ye
1211
+ ) : ut(
1212
+ new Date(m),
1213
+ k?.dateFormat || Ye
1214
+ ), l;
1215
+ if (d.enum)
1216
+ return l[i] = m ? A(m) : "", l;
1170
1217
  // fallthrough
1171
1218
  default:
1172
- return m[i] = d ? `${d}` : "", m;
1219
+ return l[i] = m ? `${m}` : "", l;
1173
1220
  }
1174
1221
  },
1175
- { _index: u }
1222
+ { _index: a }
1176
1223
  )
1177
1224
  ) : void 0,
1178
- [k, K, ie, f, B, D]
1179
- ), ve = K ? K.length : 0, { dynamicWidthColumnCount: Ve, fixedWidthColumnsWidth: Ye } = e.useMemo(() => {
1180
- let n = 0, u = 0;
1181
- return (K || []).forEach((m) => {
1182
- if (m === ee) {
1183
- n += _t;
1225
+ [y, K, ie, f, A, M]
1226
+ ), Ee = K ? K.length : 0, { dynamicWidthColumnCount: rt, fixedWidthColumnsWidth: st } = e.useMemo(() => {
1227
+ let t = 0, a = 0;
1228
+ return (K || []).forEach((l) => {
1229
+ if (l === ee) {
1230
+ t += Mt;
1231
+ return;
1232
+ }
1233
+ if (l === we) {
1234
+ t += At;
1184
1235
  return;
1185
1236
  }
1186
- const i = f ? f[m] : void 0;
1187
- i?.width ? n += i.width : u += 1;
1188
- }, 0), { dynamicWidthColumnCount: u, fixedWidthColumnsWidth: n };
1237
+ const i = f ? f[l] : void 0;
1238
+ i?.width ? t += i.width : a += 1;
1239
+ }, 0), { dynamicWidthColumnCount: a, fixedWidthColumnsWidth: t };
1189
1240
  }, [K, f]), le = e.useMemo(() => {
1190
- if (Me)
1191
- return new Uint16Array(Me);
1192
- const n = Qe ? new Uint16Array(JSON.parse(Qe)) : void 0, u = Math.max(
1241
+ if (Re)
1242
+ return new Uint16Array(Re);
1243
+ const t = Ge ? new Uint16Array(JSON.parse(Ge)) : void 0, a = Math.max(
1193
1244
  Math.floor(
1194
- (Ne - Ye) / Ve
1245
+ (We - st) / rt
1195
1246
  ),
1196
- Tt
1247
+ Ot
1197
1248
  );
1198
- let m = (Ne - Ye) % Ve;
1249
+ let l = (We - st) % rt;
1199
1250
  const i = new Uint16Array(
1200
- K.map((g) => {
1201
- if (g === ee)
1202
- return _t;
1203
- const M = f ? f[g] : void 0;
1204
- return M?.width ? M?.width : m ? (m -= 1, u + 1) : u;
1251
+ K.map((d) => {
1252
+ if (d === ee)
1253
+ return Mt;
1254
+ if (d === we)
1255
+ return At;
1256
+ const k = f ? f[d] : void 0;
1257
+ return k?.width ? k?.width : l ? (l -= 1, a + 1) : a;
1205
1258
  })
1206
1259
  );
1207
- return n?.length === i.length ? n : i;
1260
+ return t?.length === i.length ? t : i;
1208
1261
  }, [
1209
1262
  K,
1210
1263
  f,
1211
- Me,
1212
- Ve,
1213
- Ye,
1214
- Qe,
1215
- Ne
1216
- ]), Ue = e.useCallback(
1217
- (n) => le ? le[n] : 1,
1264
+ Re,
1265
+ rt,
1266
+ st,
1267
+ Ge,
1268
+ We
1269
+ ]), Ze = e.useCallback(
1270
+ (t) => le ? le[t] : 1,
1218
1271
  [le]
1219
- ), Se = e.useMemo(() => {
1220
- if (!ze || !l && !Q || X)
1221
- return ze;
1222
- const { searchQuery: n } = c, u = n.toLowerCase() || "", m = (i) => k && A ? A(k[i._index], n) : !(K && !K.find(
1223
- (g) => `${i[g]}`.toLowerCase().includes(u)
1272
+ ), Fe = e.useMemo(() => {
1273
+ if (!Te || !r && !W || H)
1274
+ return Te;
1275
+ const { searchQuery: t } = c, a = t.toLowerCase() || "", l = (i) => y && q ? q(y[i._index], t) : !(K && !K.find(
1276
+ (d) => `${i[d]}`.toLowerCase().includes(a)
1224
1277
  ));
1225
- return ze.filter((i) => {
1226
- let g = m(i);
1227
- return !g || !c.columnFilterMap ? !1 : (Object.entries(c.columnFilterMap).forEach(
1228
- ([M, d]) => {
1229
- if (!g || d === void 0)
1278
+ return Te.filter((i) => {
1279
+ let d = l(i);
1280
+ return !d || !c.columnFilterMap ? !1 : (Object.entries(c.columnFilterMap).forEach(
1281
+ ([k, m]) => {
1282
+ if (!d || m === void 0)
1230
1283
  return;
1231
- const H = f ? f[M] : void 0;
1232
- if (k && H?.filter) {
1233
- g = H.filter(
1234
- k[i._index],
1235
- d
1284
+ const V = f ? f[k] : void 0;
1285
+ if (y && V?.filter) {
1286
+ d = V.filter(
1287
+ y[i._index],
1288
+ m
1236
1289
  );
1237
1290
  return;
1238
1291
  }
1239
- const me = ie[M], $ = k[i._index]?.[M];
1292
+ const me = ie[k], R = y[i._index]?.[k];
1240
1293
  switch (me?.type) {
1241
1294
  case "boolean":
1242
- if (d === void 0)
1295
+ if (m === void 0)
1243
1296
  return;
1244
- if (Array.isArray(d) && d.length) {
1245
- d.includes(
1246
- $ === void 0 ? null : $
1247
- ) || (g = !1);
1297
+ if (Array.isArray(m) && m.length) {
1298
+ m.includes(
1299
+ R === void 0 ? null : R
1300
+ ) || (d = !1);
1248
1301
  return;
1249
1302
  }
1250
- g = $ === d;
1303
+ d = R === m;
1251
1304
  break;
1252
1305
  case "number":
1253
1306
  case "integer":
1254
- if (d && typeof d == "object") {
1255
- d.filterEmpty && $ === void 0 && (g = !1);
1256
- for (const J of Object.keys(
1257
- ge
1307
+ if (m && typeof m == "object") {
1308
+ m.filterEmpty && R === void 0 && (d = !1);
1309
+ for (const P of Object.keys(
1310
+ pe
1258
1311
  )) {
1259
- const fe = d[J];
1260
- if (g && Kt(fe))
1261
- switch (J) {
1262
- case ge.EQ:
1263
- $ !== fe && (g = !1);
1312
+ const ge = m[P];
1313
+ if (d && hn(ge))
1314
+ switch (P) {
1315
+ case pe.EQ:
1316
+ R !== ge && (d = !1);
1264
1317
  break;
1265
- case ge.GT:
1266
- $ <= fe && (g = !1);
1318
+ case pe.GT:
1319
+ R <= ge && (d = !1);
1267
1320
  break;
1268
- case ge.LT:
1269
- $ >= fe && (g = !1);
1321
+ case pe.LT:
1322
+ R >= ge && (d = !1);
1270
1323
  break;
1271
1324
  }
1272
1325
  }
1273
1326
  } else {
1274
- if ($ === void 0 && d === null)
1327
+ if (R === void 0 && m === null)
1275
1328
  return !0;
1276
- g = $ === d;
1329
+ d = R === m;
1277
1330
  }
1278
1331
  break;
1279
1332
  // @ts-expect-error investigate
1280
1333
  case "string":
1281
- if (typeof d == "object" && !Array.isArray(d) && (me.format === "date" || me.format === "date-time")) {
1282
- const { from: J, to: fe, filterEmpty: ct } = d;
1283
- if (!$)
1284
- g = !ct;
1334
+ if (typeof m == "object" && !Array.isArray(m) && (me.format === "date" || me.format === "date-time")) {
1335
+ const { from: P, to: ge, filterEmpty: _t } = m;
1336
+ if (!R)
1337
+ d = !_t;
1285
1338
  else {
1286
- const Pe = $ ? new Date($) : void 0;
1287
- (ct === !1 || J && (!Pe || Pe < J) || fe && (!Pe || Pe > fe)) && (g = !1);
1339
+ const qe = R ? new Date(R) : void 0;
1340
+ (_t === !1 || P && (!qe || qe < P) || ge && (!qe || qe > ge)) && (d = !1);
1288
1341
  }
1289
1342
  return;
1290
1343
  }
1291
1344
  // fall through
1292
1345
  default:
1293
1346
  if (me?.enum) {
1294
- Array.isArray(d) ? g = d.includes($) : g = $ === d;
1347
+ Array.isArray(m) ? d = m.includes(R) : d = R === m;
1295
1348
  return;
1296
1349
  }
1297
- if (Array.isArray(d)) {
1298
- const J = `${i[M]}`.toLowerCase();
1299
- g = d.some(
1300
- (fe) => J.includes(`${fe}`.toLowerCase())
1350
+ if (Array.isArray(m)) {
1351
+ const P = `${i[k]}`.toLowerCase();
1352
+ d = m.some(
1353
+ (ge) => P.includes(`${ge}`.toLowerCase())
1301
1354
  );
1302
1355
  } else
1303
- g = `${i[M]}`.toLowerCase().includes(`${d}`.toLowerCase());
1356
+ d = `${i[k]}`.toLowerCase().includes(`${m}`.toLowerCase());
1304
1357
  }
1305
1358
  }
1306
- ), g);
1359
+ ), d);
1307
1360
  });
1308
1361
  }, [
1309
- ze,
1310
- l,
1311
- Q,
1312
- X,
1362
+ Te,
1363
+ r,
1364
+ W,
1365
+ H,
1313
1366
  c,
1314
- A,
1367
+ q,
1315
1368
  K,
1316
1369
  f,
1317
- k,
1370
+ y,
1318
1371
  ie
1319
- ]), U = e.useMemo(() => {
1320
- const { sortAsc: n, sortColumn: u } = c;
1321
- if (!u || !Se || !k || X)
1322
- return Se;
1323
- const m = ie[u], i = f ? f[u] : void 0, g = i?.sort;
1324
- if (g)
1325
- return Se.sort((H, me) => {
1326
- const $ = k[H._index], J = k[me._index];
1327
- return $ ? J ? g(
1328
- $,
1329
- J,
1330
- n === void 0 ? N : n
1372
+ ]), ot = e.useMemo(() => {
1373
+ const { sortAsc: t, sortColumn: a } = c;
1374
+ if (!a || !Fe || !y || H)
1375
+ return Fe;
1376
+ const l = ie[a], i = f ? f[a] : void 0, d = i?.sort;
1377
+ if (d)
1378
+ return Fe.sort((V, me) => {
1379
+ const R = y[V._index], P = y[me._index];
1380
+ return R ? P ? d(
1381
+ R,
1382
+ P,
1383
+ t === void 0 ? L : t
1331
1384
  ) : -1 : 1;
1332
1385
  });
1333
- const M = m && m.format?.startsWith("date"), d = yn(m, i);
1334
- return Se.sort((H, me) => {
1335
- let $ = d && k[H._index] ? k[H._index][u] : `${H[u]}`.toLowerCase(), J = d && k[me._index] ? k[me._index][u] : `${me[u]}`.toLowerCase();
1336
- return d && M && ($ = new Date($), isNaN($.getTime()) && ($ = kt), J = new Date(J), isNaN(J.getTime()) && (J = kt)), $ === J ? 0 : $ ? J ? ($ < J ? 1 : -1) * (n ? -1 : 1) : n ? 1 : -1 : n ? -1 : 1;
1386
+ const k = l && l.format?.startsWith("date"), m = Sn(l, i);
1387
+ return Fe.sort((V, me) => {
1388
+ let R = m && y[V._index] ? y[V._index][a] : `${V[a]}`.toLowerCase(), P = m && y[me._index] ? y[me._index][a] : `${me[a]}`.toLowerCase();
1389
+ return m && k && (R = new Date(R), isNaN(R.getTime()) && (R = St), P = new Date(P), isNaN(P.getTime()) && (P = St)), R === P ? 0 : R ? P ? (R < P ? 1 : -1) * (t ? -1 : 1) : t ? 1 : -1 : t ? -1 : 1;
1337
1390
  });
1338
1391
  }, [
1339
1392
  f,
1340
- N,
1341
- Se,
1342
- X,
1393
+ L,
1394
+ Fe,
1395
+ H,
1343
1396
  ie,
1344
- k,
1397
+ y,
1345
1398
  c
1346
- ]);
1399
+ ]), F = e.useMemo(() => !_e?.length || !Te || c.sortColumn ? ot : _e.map((t) => Te[t]), [_e, Te, ot, c.sortColumn]), Ut = e.useCallback(
1400
+ (t, a) => {
1401
+ if (!F || !y || t === a)
1402
+ return;
1403
+ const l = F.map((k) => k._index), [i] = l.splice(t, 1), d = t < a ? a - 1 : a;
1404
+ l.splice(d, 0, i), Oe(l), xe((k) => ({
1405
+ ...k,
1406
+ sortColumn: void 0,
1407
+ sortAsc: void 0
1408
+ })), S?.(l.map((k) => y[k]));
1409
+ },
1410
+ [F, y, S]
1411
+ );
1347
1412
  e.useImperativeHandle(
1348
- Te,
1413
+ Me,
1349
1414
  () => ({
1350
- getFilteredSortedData: () => U,
1351
- scrollToIndex: (n) => {
1352
- const u = je?.current, m = U?.findIndex((i) => i._index === n) || -1;
1353
- u && m >= 0 && u.scrollToItem({ rowIndex: m });
1415
+ getFilteredSortedData: () => F,
1416
+ scrollToIndex: (t) => {
1417
+ const a = Ue?.current, l = F?.findIndex((i) => i._index === t) || -1;
1418
+ a && l >= 0 && a.scrollToItem({ rowIndex: l });
1354
1419
  }
1355
1420
  }),
1356
- [U, je]
1357
- ), e.useEffect(() => {
1358
- q?.(U);
1359
- }, [U, q]);
1360
- const it = e.useCallback(
1361
- (n) => {
1362
- const u = { ...c.columnFilterMap };
1363
- delete u[n], we({
1421
+ [F, Ue]
1422
+ );
1423
+ const gt = e.useRef(void 0);
1424
+ e.useEffect(() => {
1425
+ const t = F?.map((l) => l._index), a = gt.current;
1426
+ a && a.sourceData === y && Xe(a.indices, t) || (gt.current = { sourceData: y, indices: t }, ue?.(F));
1427
+ }, [F, ue, y]);
1428
+ const bt = e.useCallback(
1429
+ (t) => {
1430
+ const a = { ...c.columnFilterMap };
1431
+ delete a[t], xe({
1364
1432
  ...c,
1365
- columnFilterMap: u
1433
+ columnFilterMap: a
1366
1434
  });
1367
1435
  },
1368
1436
  [c]
1369
- ), Ke = e.useCallback(
1370
- (n, u) => {
1371
- if (S) {
1372
- window.location.hash = Je({
1373
- ...P,
1374
- sortColumn: n,
1375
- sortAsc: u
1437
+ ), at = e.useCallback(
1438
+ (t, a) => {
1439
+ if (x) {
1440
+ window.location.hash = He({
1441
+ ...U,
1442
+ sortColumn: t,
1443
+ sortAsc: a
1376
1444
  });
1377
1445
  return;
1378
1446
  }
1379
- we({ ...c, sortColumn: n, sortAsc: u });
1447
+ xe({ ...c, sortColumn: t, sortAsc: a });
1380
1448
  },
1381
- [c, P, S]
1382
- ), Nt = e.useCallback(
1383
- (n) => {
1384
- we({
1449
+ [c, U, x]
1450
+ ), Pt = e.useCallback(
1451
+ (t) => {
1452
+ xe({
1385
1453
  ...c,
1386
- searchQuery: n.currentTarget.value
1454
+ searchQuery: t.currentTarget.value
1387
1455
  });
1388
1456
  },
1389
1457
  [c]
1390
- ), ke = e.useCallback(() => {
1391
- He(c), Le(void 0);
1458
+ ), Le = e.useCallback(() => {
1459
+ nt(c), tt(void 0);
1392
1460
  }, [c]);
1393
1461
  e.useEffect(() => {
1394
- if (!b || !P || !Ce || !S)
1462
+ if (!p || !U || !De || !x)
1395
1463
  return;
1396
- const n = Object.keys(P);
1397
- let u = !1;
1398
- for (const m of n) {
1399
- const i = P[m], g = Ce[m];
1400
- if (typeof i == "string" && i !== g) {
1401
- u = !0;
1464
+ const t = Object.keys(U);
1465
+ let a = !1;
1466
+ for (const l of t) {
1467
+ const i = U[l], d = De[l];
1468
+ if (typeof i == "string" && i !== d) {
1469
+ a = !0;
1402
1470
  break;
1403
1471
  }
1404
- if (typeof i == "object" && !nt(i, g)) {
1405
- u = !0;
1472
+ if (typeof i == "object" && !Xe(i, d)) {
1473
+ a = !0;
1406
1474
  break;
1407
1475
  }
1408
1476
  }
1409
- u && ke();
1477
+ a && Le();
1410
1478
  }, [
1411
- b,
1412
- P,
1413
- Ce,
1414
- ke,
1415
- S
1479
+ p,
1480
+ U,
1481
+ De,
1482
+ Le,
1483
+ x
1416
1484
  ]);
1417
- const lt = e.useCallback(
1418
- (n) => {
1419
- n.key === "Enter" && (ae(void 0), Ie && !S && ke(), G && n.currentTarget.className === "mig-schema-table__search" && G(c.searchQuery || ""));
1485
+ const pt = e.useCallback(
1486
+ (t) => {
1487
+ t.key === "Enter" && (et(void 0), je && !x && Le(), ae && t.currentTarget.className === "mig-schema-table__search" && ae(c.searchQuery || ""));
1420
1488
  },
1421
1489
  [
1422
- Ie,
1490
+ je,
1423
1491
  c.searchQuery,
1424
- G,
1425
- ke,
1426
- S
1492
+ ae,
1493
+ Le,
1494
+ x
1427
1495
  ]
1428
- ), et = e.useCallback(() => z, [z]), de = e.useMemo(() => en(le), [le]), $e = e.useMemo(
1429
- () => U ? U.length : 0,
1430
- [U]
1431
- ), be = e.useMemo(() => {
1432
- const n = z * $e;
1433
- let u;
1434
- if (y && (u = y === "100%" ? Be.height : y, !u))
1496
+ ), it = e.useCallback(() => j, [j]), de = e.useMemo(() => fn(le), [le]), Be = e.useMemo(
1497
+ () => F ? F.length : 0,
1498
+ [F]
1499
+ ), Ce = e.useMemo(() => {
1500
+ const t = j * Be;
1501
+ let a;
1502
+ if (J && (a = J === "100%" ? Pe.height : J, !a))
1435
1503
  return 0;
1436
- const m = u ? u - at.height - Ct : 0;
1437
- return m && m < n ? m : n;
1504
+ const l = a ? a - ft.height - Et : 0;
1505
+ return l && l < t ? l : t;
1438
1506
  }, [
1439
- z,
1440
- $e,
1441
- y,
1442
- at,
1443
- Be.height
1444
- ]), It = e.useCallback(
1445
- (n) => {
1446
- ae(void 0), n.preventDefault(), n.stopPropagation();
1507
+ j,
1508
+ Be,
1509
+ J,
1510
+ ft,
1511
+ Pe.height
1512
+ ]), Jt = e.useCallback(
1513
+ (t) => {
1514
+ et(void 0), t.preventDefault(), t.stopPropagation();
1447
1515
  },
1448
1516
  []
1449
- ), St = e.useCallback(
1450
- (n, u) => {
1451
- if (!v)
1517
+ ), Gt = e.useCallback(
1518
+ (t, a) => {
1519
+ if (!X)
1452
1520
  return;
1453
- if (S && u !== !1) {
1454
- window.location.hash = Je({
1455
- ...P,
1521
+ if (x && a !== !1) {
1522
+ window.location.hash = He({
1523
+ ...U,
1456
1524
  columnFilterMap: {
1457
1525
  ...c.columnFilterMap,
1458
- [v.propName]: n
1526
+ [X.propName]: t
1459
1527
  }
1460
1528
  });
1461
1529
  return;
1462
1530
  }
1463
- if (n === void 0) {
1464
- it(v.propName);
1531
+ if (t === void 0) {
1532
+ bt(X.propName);
1465
1533
  return;
1466
1534
  }
1467
- const m = {
1535
+ const l = {
1468
1536
  ...c.columnFilterMap,
1469
- [v.propName]: n
1537
+ [X.propName]: t
1470
1538
  };
1471
- we({
1539
+ xe({
1472
1540
  ...c,
1473
- columnFilterMap: m
1541
+ columnFilterMap: l
1474
1542
  });
1475
1543
  },
1476
1544
  [
1477
- it,
1545
+ bt,
1478
1546
  c,
1479
- P,
1480
- v,
1481
- S
1547
+ U,
1548
+ X,
1549
+ x
1482
1550
  ]
1483
- ), $t = e.useCallback(() => {
1484
- const n = {
1551
+ ), Zt = e.useCallback(() => {
1552
+ const t = {
1485
1553
  searchQuery: "",
1486
1554
  columnFilterMap: {},
1487
1555
  // Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
1488
- sortColumn: T,
1489
- sortAsc: N
1556
+ sortColumn: N,
1557
+ sortAsc: L
1490
1558
  };
1491
- S && (window.location.hash = Je(n)), He(n), we(n);
1492
- }, [S, N, T]), Ot = e.useCallback(() => {
1493
- const n = P?.searchQuery || "";
1494
- S && // prevent hash change for undefined vs empty string compare
1495
- (c.searchQuery || n) && c.searchQuery !== n && (window.location.hash = Je({
1496
- ...P,
1559
+ x && (window.location.hash = He(t)), nt(t), xe(t);
1560
+ }, [x, L, N]), qt = e.useCallback(() => {
1561
+ const t = U?.searchQuery || "";
1562
+ x && // prevent hash change for undefined vs empty string compare
1563
+ (c.searchQuery || t) && c.searchQuery !== t && (window.location.hash = He({
1564
+ ...U,
1497
1565
  searchQuery: c.searchQuery
1498
1566
  }));
1499
- }, [P, c.searchQuery, S]), Rt = e.useCallback(
1500
- async (n) => {
1501
- n.preventDefault(), n.stopPropagation(), U && await pn(U);
1567
+ }, [U, c.searchQuery, x]), Ht = e.useCallback(
1568
+ async (t) => {
1569
+ t.preventDefault(), t.stopPropagation(), F && await Ln(F);
1502
1570
  },
1503
- [U]
1504
- ), Wt = e.useCallback(() => {
1505
- w && (localStorage.removeItem(`${w}.columnNames`), localStorage.removeItem(`${w}.columnWidths`), Re(void 0), We(void 0));
1506
- }, [w]), tt = e.useCallback(
1507
- (n) => {
1508
- if (!U || !k || !re || !ce)
1571
+ [F]
1572
+ ), Xt = e.useCallback(() => {
1573
+ w && (localStorage.removeItem(`${w}.columnNames`), localStorage.removeItem(`${w}.columnWidths`), ze(void 0), Ae(void 0));
1574
+ }, [w]), lt = e.useCallback(
1575
+ (t) => {
1576
+ if (!F || !y || !v || !G)
1509
1577
  return !0;
1510
- const u = U[n];
1511
- return u && k[u._index] !== void 0;
1578
+ const a = F[t];
1579
+ return a && y[a._index] !== void 0;
1512
1580
  },
1513
- [ce, re, U, k]
1514
- ), jt = e.useMemo(() => be ? !(k && !Ie) && !re ? /* @__PURE__ */ r(
1581
+ [G, v, F, y]
1582
+ ), Vt = e.useMemo(() => Ce ? !(y && !je) && !v ? /* @__PURE__ */ s(
1515
1583
  "div",
1516
1584
  {
1517
1585
  style: {
1518
1586
  width: de,
1519
- height: Math.max(50, be),
1587
+ height: Math.max(50, Ce),
1520
1588
  border: "1px solid #BBB",
1521
1589
  textAlign: "center",
1522
1590
  display: "flex",
@@ -1524,249 +1592,253 @@ const wn = ({
1524
1592
  alignItems: "center",
1525
1593
  justifyContent: "center"
1526
1594
  },
1527
- children: Ie ? /* @__PURE__ */ r("button", { onClick: ke, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ r("div", { children: "⌛ Loading..." })
1595
+ children: je ? /* @__PURE__ */ s("button", { onClick: Le, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ s("div", { children: "⌛ Loading..." })
1528
1596
  }
1529
- ) : re && ce ? /* @__PURE__ */ r(
1530
- tn,
1597
+ ) : v && G ? /* @__PURE__ */ s(
1598
+ gn,
1531
1599
  {
1532
- ref: o,
1533
- isItemLoaded: tt,
1534
- itemCount: ce,
1535
- loadMoreItems: re,
1536
- children: ({ onItemsRendered: u, ref: m }) => /* @__PURE__ */ r(
1537
- ut,
1600
+ ref: b,
1601
+ isItemLoaded: lt,
1602
+ itemCount: G,
1603
+ loadMoreItems: v,
1604
+ children: ({ onItemsRendered: a, ref: l }) => /* @__PURE__ */ s(
1605
+ Ct,
1538
1606
  {
1539
1607
  className: "mig-schema-table__tbody",
1540
- estimatedRowHeight: z,
1541
- height: be,
1608
+ estimatedRowHeight: j,
1609
+ height: Ce,
1542
1610
  width: de,
1543
- columnWidth: Ue,
1544
- rowHeight: et,
1545
- columnCount: ve,
1546
- rowCount: $e,
1547
- ref: m,
1611
+ columnWidth: Ze,
1612
+ rowHeight: it,
1613
+ columnCount: Ee,
1614
+ rowCount: Be,
1615
+ ref: l,
1548
1616
  onItemsRendered: ({
1549
1617
  overscanRowStartIndex: i,
1550
- overscanRowStopIndex: g,
1551
- visibleRowStartIndex: M,
1552
- visibleRowStopIndex: d
1553
- }) => u({
1618
+ overscanRowStopIndex: d,
1619
+ visibleRowStartIndex: k,
1620
+ visibleRowStopIndex: m
1621
+ }) => a({
1554
1622
  overscanStartIndex: i,
1555
- overscanStopIndex: g,
1556
- visibleStartIndex: M,
1557
- visibleStopIndex: d
1623
+ overscanStopIndex: d,
1624
+ visibleStartIndex: k,
1625
+ visibleStopIndex: m
1558
1626
  }),
1559
- children: wt
1627
+ children: Nt
1560
1628
  },
1561
- `tbody_${be}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${ve}_${le.join(
1629
+ `tbody_${Ce}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${Ee}_${le.join(
1562
1630
  " "
1563
1631
  )}`
1564
1632
  )
1565
1633
  }
1566
- ) : /* @__PURE__ */ r(
1567
- ut,
1634
+ ) : /* @__PURE__ */ s(
1635
+ Ct,
1568
1636
  {
1569
1637
  className: "mig-schema-table__tbody",
1570
- estimatedRowHeight: z,
1571
- height: be,
1638
+ estimatedRowHeight: j,
1639
+ height: Ce,
1572
1640
  width: de,
1573
- columnWidth: Ue,
1574
- rowHeight: et,
1575
- columnCount: ve,
1576
- rowCount: $e,
1577
- ref: je,
1578
- children: wt
1641
+ columnWidth: Ze,
1642
+ rowHeight: it,
1643
+ columnCount: Ee,
1644
+ rowCount: Be,
1645
+ ref: Ue,
1646
+ children: Nt
1579
1647
  },
1580
- `tbody_${be}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${ve}_${le.join(
1648
+ `tbody_${Ce}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${Ee}_${le.join(
1581
1649
  " "
1582
1650
  )}`
1583
1651
  ) : null, [
1584
- ve,
1652
+ Ee,
1585
1653
  le,
1586
- Ue,
1587
- et,
1588
- o,
1589
- Ie,
1590
- tt,
1591
- ce,
1592
- re,
1593
- ke,
1594
- $e,
1595
- z,
1654
+ Ze,
1655
+ it,
1656
+ b,
1657
+ je,
1658
+ lt,
1659
+ G,
1660
+ v,
1661
+ Le,
1662
+ Be,
1663
+ j,
1596
1664
  de,
1597
1665
  c.searchQuery,
1598
1666
  c.sortAsc,
1599
1667
  c.sortColumn,
1600
- k,
1601
- be,
1602
- je
1603
- ]), Bt = e.useMemo(
1668
+ y,
1669
+ Ce,
1670
+ Ue
1671
+ ]), Yt = e.useMemo(
1604
1672
  () => ({
1605
- ...j,
1606
- width: he ? Math.min(de, Ne) : void 0,
1607
- height: y === "100%" ? "100%" : void 0,
1608
- maxHeight: y === "100%" ? "100%" : void 0
1673
+ ...T,
1674
+ width: Q ? Math.min(de, We) : void 0,
1675
+ height: J === "100%" ? "100%" : void 0,
1676
+ maxHeight: J === "100%" ? "100%" : void 0
1609
1677
  }),
1610
- [y, de, j, Ne, he]
1611
- ), Ft = a || "input";
1612
- return /* @__PURE__ */ r(
1613
- De.Provider,
1678
+ [J, de, T, We, Q]
1679
+ ), Kt = o || "input";
1680
+ return /* @__PURE__ */ s(
1681
+ Ie.Provider,
1614
1682
  {
1615
1683
  value: {
1616
- checkedIndexes: p,
1684
+ checkedIndexes: _,
1617
1685
  columnNames: K,
1618
1686
  columnWidths: le,
1619
1687
  config: f,
1620
- disabledCheckedIndexes: O,
1621
- displayTimezone: D,
1622
- dropTargetIndex: Xe,
1623
- getRowClassName: Z,
1688
+ disabledCheckedIndexes: $,
1689
+ displayTimezone: M,
1690
+ dropTargetIndex: z,
1691
+ getRowClassName: Y,
1624
1692
  getRowSelected: te,
1625
- isColumnFilterable: l,
1626
- isItemLoaded: tt,
1627
- isSortable: ne,
1628
- lastCheckChangedRowIndex: pe,
1629
- onRowClick: E,
1630
- onRowDoubleClick: oe,
1693
+ isDraggable: u,
1694
+ isColumnFilterable: r,
1695
+ isItemLoaded: lt,
1696
+ isSortable: ce,
1697
+ lastCheckChangedRowIndex: Ft,
1698
+ onRowClick: ne,
1699
+ onRowDoubleClick: re,
1700
+ onRowDrop: Ut,
1631
1701
  properties: ie,
1632
- required: Lt,
1633
- setCheckedIndexes: W,
1634
- setCustomColumnNames: Re,
1635
- setCustomColumnWidths: We,
1636
- setDropTargetIndex: Ee,
1637
- setFilterSortColumn: Ke,
1638
- setLastCheckChangedRowIndex: _e,
1639
- setMenuConfig: ae,
1702
+ required: zt,
1703
+ rowDropTargetRowIndex: ye,
1704
+ setCheckedIndexes: se,
1705
+ setCustomColumnNames: ze,
1706
+ setCustomColumnWidths: Ae,
1707
+ setDropTargetIndex: fe,
1708
+ setFilterSortColumn: at,
1709
+ setLastCheckChangedRowIndex: Bt,
1710
+ setMenuConfig: et,
1711
+ setRowDropTargetRowIndex: ke,
1640
1712
  settingsStorageKey: w,
1641
- sortedRenderData: U,
1642
- sourceData: k,
1713
+ sortedRenderData: F,
1714
+ sourceData: y,
1643
1715
  tableDataState: c,
1644
- translate: B || pt
1716
+ translate: A || Tt
1645
1717
  },
1646
- children: /* @__PURE__ */ F(
1718
+ children: /* @__PURE__ */ B(
1647
1719
  "div",
1648
1720
  {
1649
- className: `mig-schema-table${E ? " mig-schema-table--clickable-rows" : ""}`,
1650
- ref: st,
1651
- style: Bt,
1721
+ className: `mig-schema-table${ne ? " mig-schema-table--clickable-rows" : ""}`,
1722
+ ref: mt,
1723
+ style: Yt,
1652
1724
  role: "table",
1653
1725
  children: [
1654
- /* @__PURE__ */ F(
1726
+ /* @__PURE__ */ B(
1655
1727
  "div",
1656
1728
  {
1657
1729
  className: "mig-schema-table__action-container",
1658
- ref: ot,
1730
+ ref: ht,
1659
1731
  children: [
1660
- /* @__PURE__ */ r("div", { children: Q ? /* @__PURE__ */ r(
1661
- Ft,
1732
+ /* @__PURE__ */ s("div", { children: W ? /* @__PURE__ */ s(
1733
+ Kt,
1662
1734
  {
1663
1735
  className: "mig-schema-table__search",
1664
1736
  type: "search",
1665
1737
  name: "search",
1666
1738
  autoComplete: "off",
1667
- placeholder: V || B("search..."),
1739
+ placeholder: ve || A("search..."),
1668
1740
  value: c.searchQuery,
1669
- onChange: Nt,
1670
- onKeyDown: lt,
1671
- autoFocus: x,
1672
- onBlur: Ot
1741
+ onChange: Pt,
1742
+ onKeyDown: pt,
1743
+ autoFocus: D,
1744
+ onBlur: qt
1673
1745
  }
1674
1746
  ) : null }),
1675
- t ? /* @__PURE__ */ r(
1676
- t,
1747
+ n ? /* @__PURE__ */ s(
1748
+ n,
1677
1749
  {
1678
- ...L,
1679
- renderData: U
1750
+ ...E,
1751
+ renderData: ot
1680
1752
  }
1681
- ) : /* @__PURE__ */ r("div", { className: "mig-schema-table__custom_element_placeholder" }),
1682
- I && Array.isArray(_) ? /* @__PURE__ */ r("span", { className: "mig-schema-table__row_counter", children: B(
1753
+ ) : /* @__PURE__ */ s("div", { className: "mig-schema-table__custom_element_placeholder" }),
1754
+ I && Array.isArray(C) ? /* @__PURE__ */ s("span", { className: "mig-schema-table__row_counter", children: A(
1683
1755
  "showingFilteredCountOfTotalCount",
1684
- U?.length || 0,
1685
- _.length
1756
+ F?.length || 0,
1757
+ C.length
1686
1758
  ) }) : null,
1687
- s ? /* @__PURE__ */ r(
1759
+ g ? /* @__PURE__ */ s(
1688
1760
  "button",
1689
1761
  {
1690
- onClick: Rt,
1762
+ onClick: Ht,
1691
1763
  style: { marginLeft: 8 },
1692
- disabled: !U?.length,
1693
- children: B("exportData")
1764
+ disabled: !F?.length,
1765
+ children: A("exportData")
1694
1766
  }
1695
1767
  ) : null,
1696
- Q || l ? /* @__PURE__ */ r(
1768
+ W || r ? /* @__PURE__ */ s(
1697
1769
  "button",
1698
1770
  {
1699
- onClick: $t,
1771
+ onClick: Zt,
1700
1772
  style: { marginLeft: 8 },
1701
1773
  disabled: c.columnFilterMap && c.searchQuery ? Object.keys(c.columnFilterMap).length + c.searchQuery.length === 0 : !1,
1702
- children: B("clearFilters")
1774
+ children: A("clearFilters")
1703
1775
  }
1704
1776
  ) : null,
1705
- w ? /* @__PURE__ */ r(
1777
+ w ? /* @__PURE__ */ s(
1706
1778
  "button",
1707
1779
  {
1708
- onClick: Wt,
1780
+ onClick: Xt,
1709
1781
  style: { marginLeft: 8 },
1710
- disabled: !Fe && !Qe,
1711
- children: B("clearSettings")
1782
+ disabled: !Je && !Ge,
1783
+ children: A("clearSettings")
1712
1784
  }
1713
1785
  ) : null
1714
1786
  ]
1715
1787
  }
1716
1788
  ),
1717
- /* @__PURE__ */ F("div", { className: "mig-schema-table__column_resize_container", children: [
1718
- /* @__PURE__ */ r(
1789
+ /* @__PURE__ */ B("div", { className: "mig-schema-table__column_resize_container", children: [
1790
+ /* @__PURE__ */ s(
1719
1791
  h,
1720
1792
  {
1721
- height: Ct,
1722
- itemCount: ve,
1723
- itemSize: Ue,
1793
+ height: Et,
1794
+ itemCount: Ee,
1795
+ itemSize: Ze,
1724
1796
  layout: "horizontal",
1725
1797
  width: de,
1726
1798
  sortAsc: c.sortAsc,
1727
- setFilterSortColumn: Ke,
1799
+ setFilterSortColumn: at,
1728
1800
  sortColumn: c.sortColumn,
1729
- sortedRenderData: U,
1801
+ sortedRenderData: F,
1730
1802
  className: "mig-schema-table__th-row",
1731
- children: un
1803
+ children: kn
1732
1804
  },
1733
1805
  `thead_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${le.join(
1734
1806
  " "
1735
1807
  )}`
1736
1808
  ),
1737
- jt,
1738
- C ? /* @__PURE__ */ r(
1739
- gn,
1809
+ Vt,
1810
+ oe ? /* @__PURE__ */ s(
1811
+ An,
1740
1812
  {
1741
1813
  columnWidths: le,
1742
- resizeColumnIndex: qe,
1743
- setResizeColumnIndex: Ae,
1744
- tableBodyHeight: be
1814
+ resizeColumnIndex: Ke,
1815
+ setResizeColumnIndex: $e,
1816
+ tableBodyHeight: Ce
1745
1817
  }
1746
1818
  ) : null
1747
1819
  ] }),
1748
- k && k.length === 0 ? /* @__PURE__ */ r("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
1749
- v ? Ut(
1750
- /* @__PURE__ */ r(
1751
- fn,
1820
+ y && y.length === 0 ? /* @__PURE__ */ s("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
1821
+ X ? nn(
1822
+ /* @__PURE__ */ s(
1823
+ Mn,
1752
1824
  {
1753
- isFilterable: l && v.propConfig?.isFilterable !== !1,
1754
- isSortable: Mt(
1755
- ne,
1756
- ue.properties[v.propName],
1757
- v.propConfig
1825
+ isFilterable: r && X.propConfig?.isFilterable !== !1,
1826
+ isSortable: Wt(
1827
+ ce,
1828
+ he.properties[X.propName],
1829
+ X.propConfig
1758
1830
  ),
1759
- onChange: St,
1760
- onClose: It,
1761
- onInputKeyDown: lt,
1762
- propConfig: v.propConfig,
1763
- propIsRequired: v.propIsRequired,
1764
- propName: v.propName,
1765
- propSchema: ue.properties[v.propName],
1766
- referenceElement: v.referenceElement,
1767
- setFilterSortColumn: Ke,
1768
- translate: B,
1769
- value: c.columnFilterMap ? c.columnFilterMap[v.propName] : null
1831
+ onChange: Gt,
1832
+ onClose: Jt,
1833
+ onInputKeyDown: pt,
1834
+ propConfig: X.propConfig,
1835
+ propIsRequired: X.propIsRequired,
1836
+ propName: X.propName,
1837
+ propSchema: he.properties[X.propName],
1838
+ referenceElement: X.referenceElement,
1839
+ setFilterSortColumn: at,
1840
+ translate: A,
1841
+ value: c.columnFilterMap ? c.columnFilterMap[X.propName] : null
1770
1842
  }
1771
1843
  ),
1772
1844
  document.body
@@ -1776,43 +1848,43 @@ const wn = ({
1776
1848
  )
1777
1849
  }
1778
1850
  );
1779
- }, vn = e.forwardRef(wn), jn = e.memo(vn), Bn = e.memo(({ refresh: t, period: a = 60 }) => {
1780
- const [h, b] = e.useState(/* @__PURE__ */ new Date()), [p, f] = e.useState(/* @__PURE__ */ new Date()), L = e.useCallback(() => {
1781
- f(/* @__PURE__ */ new Date()), t();
1782
- }, [t]), _ = e.useMemo(
1783
- () => Gt(h, p),
1784
- [h, p]
1851
+ }, $n = e.forwardRef(Rn), Vn = e.memo($n), Yn = e.memo(({ refresh: n, period: o = 60 }) => {
1852
+ const [h, p] = e.useState(/* @__PURE__ */ new Date()), [_, f] = e.useState(/* @__PURE__ */ new Date()), E = e.useCallback(() => {
1853
+ f(/* @__PURE__ */ new Date()), n();
1854
+ }, [n]), C = e.useMemo(
1855
+ () => an(h, _),
1856
+ [h, _]
1785
1857
  );
1786
1858
  e.useEffect(() => {
1787
- _ > a && L();
1788
- }, [_, h, p, a, L]), e.useEffect(() => {
1789
- const T = setInterval(() => {
1790
- b(/* @__PURE__ */ new Date());
1859
+ C > o && E();
1860
+ }, [C, h, _, o, E]), e.useEffect(() => {
1861
+ const N = setInterval(() => {
1862
+ p(/* @__PURE__ */ new Date());
1791
1863
  }, 1e3);
1792
1864
  return () => {
1793
- clearInterval(T);
1865
+ clearInterval(N);
1794
1866
  };
1795
1867
  }, []);
1796
- const R = a - _;
1797
- return /* @__PURE__ */ F(
1868
+ const O = o - C;
1869
+ return /* @__PURE__ */ B(
1798
1870
  "div",
1799
1871
  {
1800
1872
  className: "mx-auto",
1801
- title: `Refresh ${R > 0 ? `in ${R} seconds` : "NOW"}`,
1873
+ title: `Refresh ${O > 0 ? `in ${O} seconds` : "NOW"}`,
1802
1874
  children: [
1803
1875
  "Last update ",
1804
- rt(p, "HH:mm")
1876
+ ut(_, "HH:mm")
1805
1877
  ]
1806
1878
  }
1807
1879
  );
1808
1880
  });
1809
1881
  export {
1810
- Dt as DEFAULT_DATE_FORMAT,
1811
- Ge as DEFAULT_DATE_TIME_FORMAT,
1812
- Oe as EColumnFilterStatus,
1813
- Tt as MINIMUM_COLUMN_WIDTH,
1814
- sn as RESIZER_WIDTH,
1815
- Bn as Refresher,
1816
- jn as SchemaTable,
1817
- un as Th
1882
+ $t as DEFAULT_DATE_FORMAT,
1883
+ Ye as DEFAULT_DATE_TIME_FORMAT,
1884
+ Qe as EColumnFilterStatus,
1885
+ Ot as MINIMUM_COLUMN_WIDTH,
1886
+ _n as RESIZER_WIDTH,
1887
+ Yn as Refresher,
1888
+ Vn as SchemaTable,
1889
+ kn as Th
1818
1890
  };