mig-schema-table 5.0.14 → 5.0.15

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