@envisiongroup/porygon 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -69
- package/dist/react-components/fields/TagPicker/EFWTagPicker.js +130 -126
- package/dist/react-components/fields/TagPicker/EFWTagPicker.types.d.ts +11 -6
- package/dist/react-components/forms/EFWForm/EFWForm.js +284 -290
- package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +26 -1
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +94 -65
- package/dist/react-components/forms/EFWForm/index.d.ts +4 -3
- package/dist/react-components/forms/EFWForm/index.js +10 -7
- package/dist/react-components/tables/EFWTable/EFWTable.js +767 -747
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +10 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +31 -9
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +39 -4
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.d.ts +8 -3
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.js +4 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +47 -15
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +52 -21
- package/dist/react-components/tables/EFWTable/utils/index.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/utils/index.js +19 -17
- package/dist/react-components/tables/EFWTable/utils/itemCompletion.d.ts +32 -0
- package/dist/react-components/tables/EFWTable/utils/itemCompletion.js +23 -0
- package/package.json +2 -2
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import { jsx as D, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { makeStyles as
|
|
6
|
-
import { useTableSelection as
|
|
7
|
-
import { renderCellContent as
|
|
8
|
-
import { useDefaultAddButton as
|
|
9
|
-
import { useDefaultUpdateButton as
|
|
10
|
-
import { useDefaultDeleteButton as
|
|
11
|
-
import { useDefaultFilterButton as
|
|
12
|
-
import { useStableColumnRenderers as
|
|
13
|
-
import { getFilterFn as
|
|
14
|
-
import { useTableLocaleText as
|
|
15
|
-
import { generateId as
|
|
16
|
-
import { addRowId as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsx as D, jsxs as lt } from "react/jsx-runtime";
|
|
2
|
+
import * as hr from "react";
|
|
3
|
+
import { useMemo as ce, useRef as x, useState as te, useCallback as m, useEffect as ne, useLayoutEffect as _n } from "react";
|
|
4
|
+
import { useReactTable as pr, getSortedRowModel as gr, getFilteredRowModel as Sr, getCoreRowModel as wr } from "@tanstack/react-table";
|
|
5
|
+
import { makeStyles as xr, tokens as $, mergeClasses as Ir, Card as br, Checkbox as Vn, Spinner as yr } from "@fluentui/react-components";
|
|
6
|
+
import { useTableSelection as Rr } from "./hooks/useTableSelection/useTableSelection.js";
|
|
7
|
+
import { renderCellContent as vr } from "./utils/index.js";
|
|
8
|
+
import { useDefaultAddButton as Cr } from "./hooks/useDefaultAddButton/useDefaultAddButton.js";
|
|
9
|
+
import { useDefaultUpdateButton as Tr } from "./hooks/useDefaultUpdateButton/useDefaultUpdateButton.js";
|
|
10
|
+
import { useDefaultDeleteButton as Er } from "./hooks/useDefaultDeleteButton/useDefaultDeleteButton.js";
|
|
11
|
+
import { useDefaultFilterButton as zr } from "./hooks/useDefaultFilterButton/useDefaultFilterButton.js";
|
|
12
|
+
import { useStableColumnRenderers as Fr } from "./hooks/useStableColumnRenderers/useStableColumnRenderers.js";
|
|
13
|
+
import { getFilterFn as Mr, isEmptyFilterValue as Ar } from "./utils/filterFunctions.js";
|
|
14
|
+
import { useTableLocaleText as Nr, PorygonI18nProvider as kr } from "../../i18n/PorygonI18nProvider.js";
|
|
15
|
+
import { generateId as at } from "./utils/general.js";
|
|
16
|
+
import { addRowId as De, ensureItemRowId as Wn } from "./utils/typeHelpers.js";
|
|
17
|
+
import { completeItemWithEmptyValues as fe } from "./utils/itemCompletion.js";
|
|
18
|
+
import { EFWTableCommandBar as Lr } from "./components/EFWTableCommandBar/EFWTableCommandBar.js";
|
|
19
|
+
import { EFWTableOverlay as Bn } from "./components/EFWTableOverlay/EFWTableOverlay.js";
|
|
20
|
+
import { EFWTableHeader as _r } from "./components/EFWTableHeader/EFWTableHeader.js";
|
|
21
|
+
import { EFWTableBody as Wr } from "./components/EFWTableBody/EFWTableBody.js";
|
|
22
|
+
const me = {}, Br = /* @__PURE__ */ new Set(), Dn = [], Oe = [], Dr = {}, Pe = (w) => w, Or = (w) => Object.entries(w).filter(([, g]) => !Ar(g)).map(([g, y]) => ({ id: g, value: y })), He = (w) => Object.fromEntries(
|
|
23
|
+
w.map((g) => [g.id, g.value])
|
|
24
|
+
), On = (w) => w.map(({ id: g, desc: y }) => ({ id: g, desc: y })), Ne = (w) => w.map(({ id: g, desc: y }) => ({ id: g, desc: y })), O = 121, ke = 40, ge = 120, je = 2500, Pn = 500, Pr = 20, Hr = (w) => {
|
|
25
|
+
switch (w) {
|
|
25
26
|
case "Date":
|
|
26
|
-
return (
|
|
27
|
-
const
|
|
27
|
+
return (g, y, i) => {
|
|
28
|
+
const T = g.getValue(i), C = y.getValue(i), M = T?.[0] ? new Date(T[0]).getTime() : 0, z = C?.[0] ? new Date(C[0]).getTime() : 0;
|
|
28
29
|
return M < z ? -1 : M > z ? 1 : 0;
|
|
29
30
|
};
|
|
30
31
|
case "Choice":
|
|
31
|
-
return (
|
|
32
|
-
const
|
|
32
|
+
return (g, y, i) => {
|
|
33
|
+
const T = g.getValue(i), C = y.getValue(i), M = T?.map((k) => k.text).join(", ") ?? "", z = C?.map((k) => k.text).join(", ") ?? "";
|
|
33
34
|
return M.localeCompare(z);
|
|
34
35
|
};
|
|
35
36
|
case "Number":
|
|
36
37
|
return "basic";
|
|
37
38
|
case "Boolean":
|
|
38
|
-
return (
|
|
39
|
-
const
|
|
40
|
-
return (
|
|
39
|
+
return (g, y, i) => {
|
|
40
|
+
const T = g.getValue(i), C = y.getValue(i);
|
|
41
|
+
return (T ? 1 : 0) - (C ? 1 : 0);
|
|
41
42
|
};
|
|
42
43
|
default:
|
|
43
44
|
return "alphanumeric";
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
|
-
function
|
|
47
|
-
return
|
|
47
|
+
function he(w, g, y) {
|
|
48
|
+
return g.length === 0 ? w : y === "start" ? [...g, ...w] : [...w, ...g];
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
return
|
|
52
|
-
index:
|
|
53
|
-
item:
|
|
50
|
+
function pe(w, g, y) {
|
|
51
|
+
const i = y === "start" ? 0 : g;
|
|
52
|
+
return w.map((T, C) => ({
|
|
53
|
+
index: i + C,
|
|
54
|
+
item: T
|
|
54
55
|
}));
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
-
table:
|
|
58
|
-
dense:
|
|
57
|
+
const jr = ({
|
|
58
|
+
table: w,
|
|
59
|
+
dense: g
|
|
59
60
|
}) => /* @__PURE__ */ D(
|
|
60
|
-
|
|
61
|
+
Vn,
|
|
61
62
|
{
|
|
62
63
|
shape: "circular",
|
|
63
|
-
checked:
|
|
64
|
-
onChange:
|
|
65
|
-
style:
|
|
64
|
+
checked: w.getIsAllRowsSelected(),
|
|
65
|
+
onChange: w.getToggleAllRowsSelectedHandler(),
|
|
66
|
+
style: g ? void 0 : { marginTop: "4px" },
|
|
66
67
|
"data-checkbox": "true"
|
|
67
68
|
}
|
|
68
|
-
),
|
|
69
|
-
row:
|
|
70
|
-
toggleMultiple:
|
|
69
|
+
), Vr = ({
|
|
70
|
+
row: w,
|
|
71
|
+
toggleMultiple: g,
|
|
71
72
|
dense: y
|
|
72
73
|
}) => /* @__PURE__ */ D(
|
|
73
|
-
|
|
74
|
+
Vn,
|
|
74
75
|
{
|
|
75
76
|
shape: "circular",
|
|
76
|
-
checked:
|
|
77
|
-
onChange: (
|
|
78
|
-
|
|
77
|
+
checked: w.getIsSelected(),
|
|
78
|
+
onChange: (i) => {
|
|
79
|
+
i.stopPropagation(), g(w.index);
|
|
79
80
|
},
|
|
80
|
-
onClick: (
|
|
81
|
+
onClick: (i) => i.stopPropagation(),
|
|
81
82
|
style: y ? void 0 : { marginTop: "6px" },
|
|
82
83
|
"data-checkbox": "true"
|
|
83
84
|
}
|
|
84
|
-
),
|
|
85
|
+
), Ur = xr({
|
|
85
86
|
"efw-table": {},
|
|
86
87
|
/* Transición suave para el box-shadow en las celdas y cabeceras fijas */
|
|
87
88
|
"efw-table-scroll-container": {
|
|
@@ -126,425 +127,429 @@ const Pr = ({
|
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
|
-
function
|
|
130
|
-
let
|
|
130
|
+
function Hn(w, g, y, i) {
|
|
131
|
+
let T = 0, C = 0;
|
|
131
132
|
const M = [];
|
|
132
|
-
if (
|
|
133
|
-
const G = y.find((
|
|
134
|
-
I.id === "select" ?
|
|
133
|
+
if (g.forEach((I) => {
|
|
134
|
+
const G = y.find((E) => E.internalName === I.id)?.typeAsString === "Note" ? O * 2 : O, V = i[I.id] || (typeof I.size == "number" ? I.size : G);
|
|
135
|
+
I.id === "select" ? T += V : (C += V, M.push(I));
|
|
135
136
|
}), M.length === 0) return null;
|
|
136
|
-
const z =
|
|
137
|
-
if (Math.abs(z -
|
|
138
|
-
const k =
|
|
139
|
-
let
|
|
137
|
+
const z = T + C;
|
|
138
|
+
if (Math.abs(z - w) < 1) return null;
|
|
139
|
+
const k = w - T, q = k / C, re = { ...i };
|
|
140
|
+
let ie = 0;
|
|
140
141
|
return M.forEach((I, Y) => {
|
|
141
|
-
const G =
|
|
142
|
-
let
|
|
143
|
-
Y === M.length - 1 ?
|
|
144
|
-
}),
|
|
142
|
+
const G = i[I.id] || (typeof I.size == "number" ? I.size : O), V = I.minSize || ge;
|
|
143
|
+
let E;
|
|
144
|
+
Y === M.length - 1 ? E = k - ie : E = Math.round(G * q), E = Math.max(V, E), re[I.id] = E, ie += E;
|
|
145
|
+
}), re;
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
-
const
|
|
148
|
-
if (Math.abs(
|
|
149
|
-
const M =
|
|
147
|
+
function jn(w, g, y, i, T) {
|
|
148
|
+
const C = w - T;
|
|
149
|
+
if (Math.abs(C) < 1) return null;
|
|
150
|
+
const M = g.filter((E) => E.id && E.id !== "select");
|
|
150
151
|
if (M.length === 0) return null;
|
|
151
|
-
const z = M[M.length - 1], k = z.id,
|
|
152
|
-
return
|
|
152
|
+
const z = M[M.length - 1], k = z.id, re = y.find((E) => E.internalName === k)?.typeAsString === "Note" ? O * 2 : O, I = (i[k] || (typeof z.size == "number" ? z.size : re)) + C, Y = z.minSize || ge, G = Math.max(Y, I), V = i[k];
|
|
153
|
+
return V !== void 0 && Math.abs(V - G) < 1 ? null : { [k]: G };
|
|
153
154
|
}
|
|
154
|
-
const
|
|
155
|
-
appearance:
|
|
156
|
-
style:
|
|
155
|
+
const ds = ({
|
|
156
|
+
appearance: w = "outline",
|
|
157
|
+
style: g = me,
|
|
157
158
|
className: y = "",
|
|
158
|
-
fields:
|
|
159
|
-
localeText:
|
|
160
|
-
items:
|
|
159
|
+
fields: i,
|
|
160
|
+
localeText: T,
|
|
161
|
+
items: C,
|
|
161
162
|
defaultItems: M,
|
|
162
163
|
height: z,
|
|
163
164
|
itemSize: k,
|
|
164
165
|
dense: q = !0,
|
|
165
|
-
rowAnimationConfig:
|
|
166
|
-
cellLineClamp:
|
|
166
|
+
rowAnimationConfig: re = Dr,
|
|
167
|
+
cellLineClamp: ie,
|
|
167
168
|
// tableStyle = 'row',
|
|
168
169
|
enableSelection: I = !0,
|
|
169
170
|
enableCommandBar: Y = !0,
|
|
170
|
-
defaultSelectedItems: G =
|
|
171
|
-
onSelectionChange:
|
|
172
|
-
onRowClick:
|
|
173
|
-
onRowDoubleClick:
|
|
174
|
-
resizableColumns:
|
|
175
|
-
columnConfig: P =
|
|
176
|
-
useVirtualization:
|
|
177
|
-
autoSizeColumns:
|
|
178
|
-
tableRef:
|
|
179
|
-
onItemsChange:
|
|
180
|
-
onScroll:
|
|
181
|
-
onScrollEnd:
|
|
182
|
-
scrollEndThreshold:
|
|
183
|
-
loadingMore:
|
|
184
|
-
addButtonConfig:
|
|
185
|
-
updateButtonConfig:
|
|
186
|
-
deleteButtonConfig:
|
|
187
|
-
filterButtonConfig:
|
|
188
|
-
alwaysButtons:
|
|
189
|
-
noSelectionButtons:
|
|
190
|
-
singleSelectionButtons:
|
|
191
|
-
multiSelectionButtons:
|
|
192
|
-
beforeAddItems:
|
|
193
|
-
beforeUpdateItems:
|
|
194
|
-
beforeDeleteItems:
|
|
195
|
-
defaultSorting:
|
|
196
|
-
onSortChange:
|
|
197
|
-
onFilterChange:
|
|
198
|
-
columnRenderers:
|
|
199
|
-
useDefaultRendererAsFallback:
|
|
171
|
+
defaultSelectedItems: G = Br,
|
|
172
|
+
onSelectionChange: V,
|
|
173
|
+
onRowClick: E,
|
|
174
|
+
onRowDoubleClick: Ve,
|
|
175
|
+
resizableColumns: Ue = !1,
|
|
176
|
+
columnConfig: P = me,
|
|
177
|
+
useVirtualization: ut = !1,
|
|
178
|
+
autoSizeColumns: le = !1,
|
|
179
|
+
tableRef: Un,
|
|
180
|
+
onItemsChange: dt,
|
|
181
|
+
onScroll: ft,
|
|
182
|
+
onScrollEnd: mt,
|
|
183
|
+
scrollEndThreshold: ht = Pn,
|
|
184
|
+
loadingMore: Se = !1,
|
|
185
|
+
addButtonConfig: $n = me,
|
|
186
|
+
updateButtonConfig: qn = me,
|
|
187
|
+
deleteButtonConfig: Yn = me,
|
|
188
|
+
filterButtonConfig: Gn = me,
|
|
189
|
+
alwaysButtons: pt = Oe,
|
|
190
|
+
noSelectionButtons: Kn = Oe,
|
|
191
|
+
singleSelectionButtons: gt = Oe,
|
|
192
|
+
multiSelectionButtons: St = Oe,
|
|
193
|
+
beforeAddItems: wt,
|
|
194
|
+
beforeUpdateItems: xt,
|
|
195
|
+
beforeDeleteItems: It,
|
|
196
|
+
defaultSorting: Xn,
|
|
197
|
+
onSortChange: $e,
|
|
198
|
+
onFilterChange: qe,
|
|
199
|
+
columnRenderers: Jn,
|
|
200
|
+
useDefaultRendererAsFallback: bt = !0,
|
|
200
201
|
// Overlay state props
|
|
201
|
-
overlayState:
|
|
202
|
-
defaultOverlayState:
|
|
202
|
+
overlayState: yt,
|
|
203
|
+
defaultOverlayState: Zn,
|
|
203
204
|
onOverlayStateChange: j,
|
|
204
|
-
overlayCustomization:
|
|
205
|
-
overlayHeight:
|
|
205
|
+
overlayCustomization: ae,
|
|
206
|
+
overlayHeight: Ye = 200
|
|
206
207
|
}) => {
|
|
207
|
-
const
|
|
208
|
+
const Rt = ce(() => {
|
|
208
209
|
const {
|
|
209
210
|
form: e,
|
|
210
211
|
fields: t,
|
|
211
212
|
buttons: n,
|
|
212
213
|
...r
|
|
213
|
-
} =
|
|
214
|
+
} = T ?? {}, s = Object.keys(r).length > 0 ? r : void 0, c = e || t || n ? {
|
|
214
215
|
...e ? { form: e } : {},
|
|
215
216
|
...t ? { fields: t } : {},
|
|
216
217
|
...n ? { buttons: n } : {}
|
|
217
218
|
} : void 0;
|
|
218
219
|
return {
|
|
219
|
-
tableOverrides:
|
|
220
|
+
tableOverrides: s,
|
|
220
221
|
i18nProviderLocale: c
|
|
221
222
|
};
|
|
222
|
-
}, [
|
|
223
|
-
|
|
223
|
+
}, [T]), W = Nr(Rt.tableOverrides), vt = Rt.i18nProviderLocale, Ct = Fr(Jn);
|
|
224
|
+
ut && z === void 0 && console.warn(
|
|
224
225
|
'[EFWTable] La prop "height" es requerida cuando "useVirtualization" está habilitado. La virtualización necesita una altura fija para calcular las filas visibles.'
|
|
225
226
|
);
|
|
226
|
-
const
|
|
227
|
+
const we = z !== void 0 ? Y ? z - 40 : z : void 0, Ge = k ?? (q ? 32 : 44), Tt = Ur(), Qn = Ir(
|
|
227
228
|
y,
|
|
228
229
|
"efw-table",
|
|
229
|
-
|
|
230
|
-
), K =
|
|
230
|
+
Tt["efw-table"]
|
|
231
|
+
), K = x(!1), xe = x(
|
|
231
232
|
null
|
|
232
|
-
),
|
|
233
|
-
() =>
|
|
234
|
-
),
|
|
233
|
+
), Ie = x(null), Ke = C !== void 0, H = yt !== void 0, [er, be] = te(
|
|
234
|
+
() => Zn || { state: "none" }
|
|
235
|
+
), Le = H ? yt : er, [tr, nr] = te(() => (M || Dn).map((t) => ({
|
|
235
236
|
...t,
|
|
236
|
-
_rowId: t._rowId ||
|
|
237
|
-
}))), X =
|
|
237
|
+
_rowId: t._rowId || at()
|
|
238
|
+
}))), X = Ke ? C || Dn : tr, Et = x(/* @__PURE__ */ new WeakMap()), _e = m(
|
|
238
239
|
(e, t) => {
|
|
239
240
|
if (e._rowId)
|
|
240
241
|
return String(e._rowId);
|
|
241
|
-
const n =
|
|
242
|
+
const n = Et.current.get(e);
|
|
242
243
|
if (n)
|
|
243
244
|
return n;
|
|
244
|
-
const r =
|
|
245
|
-
return
|
|
245
|
+
const r = at();
|
|
246
|
+
return Et.current.set(e, r), r;
|
|
246
247
|
},
|
|
247
248
|
[]
|
|
248
|
-
), [L,
|
|
249
|
+
), [L, ye] = te(() => {
|
|
249
250
|
const e = {};
|
|
250
|
-
return
|
|
251
|
+
return i.forEach((t) => {
|
|
251
252
|
const n = P[t.internalName];
|
|
252
253
|
if (n?.width) {
|
|
253
|
-
const r = n.minWidth ??
|
|
254
|
+
const r = n.minWidth ?? ge, s = n.maxWidth ?? je;
|
|
254
255
|
e[t.internalName] = Math.min(
|
|
255
256
|
Math.max(n.width ?? 0, r),
|
|
256
|
-
|
|
257
|
+
s
|
|
257
258
|
);
|
|
258
259
|
}
|
|
259
260
|
}), e;
|
|
260
|
-
}),
|
|
261
|
-
() =>
|
|
262
|
-
), [Z,
|
|
261
|
+
}), zt = x(P), [J, Xe] = te(
|
|
262
|
+
() => On(Xn ?? [])
|
|
263
|
+
), [Z, Je] = te(
|
|
263
264
|
[]
|
|
264
|
-
),
|
|
265
|
-
|
|
266
|
-
const [Q,
|
|
267
|
-
|
|
265
|
+
), Ft = x(Z);
|
|
266
|
+
Ft.current = Z;
|
|
267
|
+
const [Q, Mt] = te(0), [rr, sr] = te({}), Ze = x(re);
|
|
268
|
+
Ze.current = re;
|
|
268
269
|
const {
|
|
269
|
-
rowSelection:
|
|
270
|
-
setRowSelection:
|
|
270
|
+
rowSelection: ue,
|
|
271
|
+
setRowSelection: At,
|
|
271
272
|
// selectedIndexes,
|
|
272
|
-
deselectAll:
|
|
273
|
-
selectSingle:
|
|
274
|
-
toggleMultiple:
|
|
273
|
+
deselectAll: Nt,
|
|
274
|
+
selectSingle: kt,
|
|
275
|
+
toggleMultiple: Lt,
|
|
275
276
|
// selectMultiple,
|
|
276
|
-
getSelectedItems:
|
|
277
|
-
getSelectedRows:
|
|
278
|
-
} =
|
|
277
|
+
getSelectedItems: _t,
|
|
278
|
+
getSelectedRows: Wt
|
|
279
|
+
} = Rr({
|
|
279
280
|
initialSelection: G,
|
|
280
|
-
onSelectionChange:
|
|
281
|
+
onSelectionChange: V,
|
|
281
282
|
enableSelection: I,
|
|
282
283
|
items: X,
|
|
283
|
-
getRowId:
|
|
284
|
-
}),
|
|
284
|
+
getRowId: _e
|
|
285
|
+
}), se = x(null), de = x(
|
|
285
286
|
null
|
|
286
|
-
), [
|
|
287
|
-
|
|
288
|
-
}, []), ee =
|
|
289
|
-
if (
|
|
290
|
-
|
|
287
|
+
), [Qe, or] = te(null), cr = m((e) => {
|
|
288
|
+
se.current = e, or(e);
|
|
289
|
+
}, []), ee = m(() => {
|
|
290
|
+
if (tt.current && !Re.current) {
|
|
291
|
+
de.current = null;
|
|
291
292
|
return;
|
|
292
293
|
}
|
|
293
|
-
const e =
|
|
294
|
+
const e = se.current;
|
|
294
295
|
if (!e) {
|
|
295
|
-
|
|
296
|
+
de.current = null;
|
|
296
297
|
return;
|
|
297
298
|
}
|
|
298
|
-
|
|
299
|
+
de.current = {
|
|
299
300
|
top: e.scrollTop,
|
|
300
301
|
left: e.scrollLeft
|
|
301
302
|
};
|
|
302
|
-
}, []),
|
|
303
|
+
}, []), et = m(
|
|
303
304
|
(e, t) => {
|
|
304
305
|
e.scrollTop !== t.top && (e.scrollTop = t.top), e.scrollLeft !== t.left && (e.scrollLeft = t.left);
|
|
305
306
|
},
|
|
306
307
|
[]
|
|
307
|
-
), A =
|
|
308
|
+
), A = m(
|
|
308
309
|
(e, t, n) => {
|
|
309
|
-
!(n?.animateRows ?? (t === "add" ?
|
|
310
|
-
const c = { ...
|
|
311
|
-
return e.forEach(({ item: u },
|
|
310
|
+
!(n?.animateRows ?? (t === "add" ? Ze.current.addRows : Ze.current.updateRows)) || e.length === 0 || sr((s) => {
|
|
311
|
+
const c = { ...s };
|
|
312
|
+
return e.forEach(({ item: u }, o) => {
|
|
312
313
|
if (!u._rowId)
|
|
313
314
|
return;
|
|
314
|
-
const
|
|
315
|
-
c[
|
|
316
|
-
delay:
|
|
317
|
-
token: (c[
|
|
315
|
+
const l = String(u._rowId);
|
|
316
|
+
c[l] = {
|
|
317
|
+
delay: o * Pr,
|
|
318
|
+
token: (c[l]?.token ?? 0) + 1
|
|
318
319
|
};
|
|
319
320
|
}), c;
|
|
320
321
|
});
|
|
321
322
|
},
|
|
322
323
|
[]
|
|
323
|
-
),
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
ye.current = gt;
|
|
329
|
-
const Re = w(St);
|
|
330
|
-
Re.current = St;
|
|
331
|
-
const ve = w(wt);
|
|
324
|
+
), v = x(X), We = x(/* @__PURE__ */ new Map()), tt = x(Ke);
|
|
325
|
+
tt.current = Ke;
|
|
326
|
+
const Re = x(dt);
|
|
327
|
+
Re.current = dt;
|
|
328
|
+
const ve = x(wt);
|
|
332
329
|
ve.current = wt;
|
|
333
|
-
const
|
|
330
|
+
const Ce = x(xt);
|
|
331
|
+
Ce.current = xt;
|
|
332
|
+
const Te = x(It);
|
|
333
|
+
Te.current = It;
|
|
334
|
+
const oe = x(i);
|
|
335
|
+
ne(() => {
|
|
336
|
+
oe.current = i;
|
|
337
|
+
}, [i]);
|
|
338
|
+
const _ = x(
|
|
334
339
|
null
|
|
335
|
-
),
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
340
|
+
), Bt = x(Se);
|
|
341
|
+
Bt.current = Se;
|
|
342
|
+
const Dt = x(ft);
|
|
343
|
+
Dt.current = ft;
|
|
344
|
+
const nt = x(mt);
|
|
345
|
+
nt.current = mt;
|
|
346
|
+
const rt = x(ht);
|
|
347
|
+
rt.current = ht, ne(() => {
|
|
348
|
+
v.current = X;
|
|
344
349
|
const e = /* @__PURE__ */ new Map();
|
|
345
350
|
X.forEach((t, n) => {
|
|
346
351
|
t._rowId && e.set(String(t._rowId), n);
|
|
347
|
-
}),
|
|
348
|
-
}, [X]),
|
|
349
|
-
const e =
|
|
352
|
+
}), We.current = e;
|
|
353
|
+
}, [X]), _n(() => {
|
|
354
|
+
const e = de.current;
|
|
350
355
|
if (!e)
|
|
351
356
|
return;
|
|
352
|
-
|
|
353
|
-
const t =
|
|
357
|
+
de.current = null;
|
|
358
|
+
const t = se.current;
|
|
354
359
|
if (!t)
|
|
355
360
|
return;
|
|
356
|
-
|
|
361
|
+
et(t, e);
|
|
357
362
|
const n = requestAnimationFrame(() => {
|
|
358
|
-
const r =
|
|
359
|
-
r &&
|
|
363
|
+
const r = se.current;
|
|
364
|
+
r && et(r, e);
|
|
360
365
|
});
|
|
361
366
|
return () => {
|
|
362
367
|
cancelAnimationFrame(n);
|
|
363
368
|
};
|
|
364
|
-
}, [X,
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}, [
|
|
369
|
-
const
|
|
369
|
+
}, [X, et]);
|
|
370
|
+
const st = x(/* @__PURE__ */ new Set()), Ee = x(!1), Ot = x(0), Pt = x(0), Ht = x(!1);
|
|
371
|
+
ne(() => {
|
|
372
|
+
Se || (se.current?.scrollHeight ?? 0) > Pt.current && (Ee.current = !1);
|
|
373
|
+
}, [Se]);
|
|
374
|
+
const jt = ce(() => {
|
|
370
375
|
const e = [], t = {};
|
|
371
376
|
let n = 0;
|
|
372
|
-
return I && (e.push("select"), t.select = n, n +=
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
377
|
+
return I && (e.push("select"), t.select = n, n += ke), i.forEach((r) => {
|
|
378
|
+
const s = P[r.internalName] || {};
|
|
379
|
+
if (!s.hidden && s.sticky) {
|
|
375
380
|
e.push(r.internalName), t[r.internalName] = n;
|
|
376
|
-
const c = L[r.internalName] ||
|
|
381
|
+
const c = L[r.internalName] || s.width || O;
|
|
377
382
|
n += c;
|
|
378
383
|
}
|
|
379
384
|
}), { stickyColumns: e, stickyPositions: t };
|
|
380
|
-
}, [
|
|
385
|
+
}, [i, I, P, L]), B = ce(() => {
|
|
381
386
|
const e = [];
|
|
382
387
|
return I && e.push({
|
|
383
388
|
id: "select",
|
|
384
|
-
header: ({ table: t }) => /* @__PURE__ */ D(
|
|
389
|
+
header: ({ table: t }) => /* @__PURE__ */ D(jr, { table: t, dense: q }),
|
|
385
390
|
cell: ({ row: t }) => /* @__PURE__ */ D(
|
|
386
|
-
|
|
391
|
+
Vr,
|
|
387
392
|
{
|
|
388
393
|
row: t,
|
|
389
|
-
toggleMultiple:
|
|
394
|
+
toggleMultiple: Lt,
|
|
390
395
|
dense: q
|
|
391
396
|
}
|
|
392
397
|
),
|
|
393
|
-
size:
|
|
394
|
-
minSize:
|
|
395
|
-
maxSize:
|
|
398
|
+
size: ke,
|
|
399
|
+
minSize: ke,
|
|
400
|
+
maxSize: ke,
|
|
396
401
|
enableResizing: !1
|
|
397
|
-
}),
|
|
402
|
+
}), i.forEach((t) => {
|
|
398
403
|
const n = P[t.internalName] || {};
|
|
399
404
|
if (n.hidden)
|
|
400
405
|
return;
|
|
401
|
-
const r = t.typeAsString === "Note" ? O * 2 : O,
|
|
406
|
+
const r = t.typeAsString === "Note" ? O * 2 : O, s = n.width || r, c = n.minWidth || ge, u = n.maxWidth || je;
|
|
402
407
|
e.push({
|
|
403
408
|
id: t.internalName,
|
|
404
409
|
accessorKey: t.internalName,
|
|
405
410
|
header: t.title || t.internalName,
|
|
406
|
-
cell: ({ row:
|
|
411
|
+
cell: ({ row: o }) => vr(
|
|
407
412
|
t,
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
+
o.original[t.internalName],
|
|
414
|
+
o.original,
|
|
415
|
+
o.index,
|
|
416
|
+
Ct,
|
|
417
|
+
bt
|
|
413
418
|
),
|
|
414
|
-
size: Math.min(Math.max(
|
|
419
|
+
size: Math.min(Math.max(s, c), u),
|
|
415
420
|
minSize: c,
|
|
416
421
|
maxSize: u,
|
|
417
|
-
enableResizing:
|
|
422
|
+
enableResizing: Ue,
|
|
418
423
|
enableSorting: n.sortable !== !1,
|
|
419
|
-
sortingFn:
|
|
420
|
-
filterFn:
|
|
424
|
+
sortingFn: Hr(t.typeAsString),
|
|
425
|
+
filterFn: Mr(t.typeAsString),
|
|
421
426
|
meta: {
|
|
422
427
|
typeAsString: t.typeAsString,
|
|
423
|
-
cellLineClamp: n.cellLineClamp ??
|
|
428
|
+
cellLineClamp: n.cellLineClamp ?? ie
|
|
424
429
|
}
|
|
425
430
|
});
|
|
426
431
|
}), e;
|
|
427
432
|
}, [
|
|
428
|
-
|
|
433
|
+
i,
|
|
429
434
|
I,
|
|
430
|
-
|
|
435
|
+
Ue,
|
|
431
436
|
P,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
437
|
+
ie,
|
|
438
|
+
Ct,
|
|
439
|
+
bt,
|
|
440
|
+
Lt
|
|
436
441
|
]);
|
|
437
|
-
|
|
438
|
-
const e =
|
|
439
|
-
|
|
442
|
+
ne(() => {
|
|
443
|
+
const e = zt.current;
|
|
444
|
+
ye((t) => {
|
|
440
445
|
let n = !1;
|
|
441
|
-
const r = { ...t },
|
|
446
|
+
const r = { ...t }, s = new Set(i.map((c) => c.internalName));
|
|
442
447
|
return Object.keys(r).forEach((c) => {
|
|
443
|
-
|
|
444
|
-
}),
|
|
445
|
-
const u = c.internalName,
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
Math.max(
|
|
449
|
-
|
|
448
|
+
s.has(c) || (delete r[c], n = !0);
|
|
449
|
+
}), i.forEach((c) => {
|
|
450
|
+
const u = c.internalName, o = P[u], l = e[u];
|
|
451
|
+
if (o?.width !== void 0) {
|
|
452
|
+
const p = o.minWidth ?? ge, h = o.maxWidth ?? je, d = Math.min(
|
|
453
|
+
Math.max(o.width, p),
|
|
454
|
+
h
|
|
450
455
|
);
|
|
451
|
-
r[u] !==
|
|
452
|
-
} else
|
|
456
|
+
r[u] !== d && (r[u] = d, n = !0);
|
|
457
|
+
} else l?.width !== void 0 && r[u] !== void 0 && (delete r[u], n = !0);
|
|
453
458
|
}), n ? r : t;
|
|
454
|
-
}),
|
|
455
|
-
}, [P,
|
|
456
|
-
const
|
|
457
|
-
const r =
|
|
458
|
-
return e +
|
|
459
|
-
}, 0), [B, L,
|
|
460
|
-
() => Math.max(
|
|
461
|
-
[
|
|
462
|
-
),
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
459
|
+
}), zt.current = P;
|
|
460
|
+
}, [P, i]);
|
|
461
|
+
const ze = ce(() => B.reduce((e, t) => {
|
|
462
|
+
const r = i.find((c) => c.internalName === t.id)?.typeAsString === "Note" ? O * 2 : O, s = L[t.id] || (typeof t.size == "number" ? t.size : r);
|
|
463
|
+
return e + s;
|
|
464
|
+
}, 0), [B, L, i]), ir = ce(
|
|
465
|
+
() => Math.max(ze, Q || 0, 300),
|
|
466
|
+
[ze, Q]
|
|
467
|
+
), Fe = x($e);
|
|
468
|
+
Fe.current = $e;
|
|
469
|
+
const Me = x(qe);
|
|
470
|
+
Me.current = qe;
|
|
471
|
+
const ot = pr({
|
|
467
472
|
data: X,
|
|
468
473
|
columns: B,
|
|
469
474
|
state: {
|
|
470
|
-
rowSelection:
|
|
475
|
+
rowSelection: ue,
|
|
471
476
|
columnSizing: L,
|
|
472
477
|
sorting: J,
|
|
473
478
|
columnFilters: Z
|
|
474
479
|
},
|
|
475
|
-
onRowSelectionChange:
|
|
480
|
+
onRowSelectionChange: At,
|
|
476
481
|
onSortingChange: (e) => {
|
|
477
482
|
const t = typeof e == "function" ? e(J) : e;
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
Xe(t), Fe.current && Fe.current(
|
|
484
|
+
Ne(t),
|
|
480
485
|
_.current
|
|
481
486
|
);
|
|
482
487
|
},
|
|
483
488
|
onColumnFiltersChange: (e) => {
|
|
484
|
-
const t = typeof e == "function" ? e(
|
|
485
|
-
|
|
486
|
-
|
|
489
|
+
const t = typeof e == "function" ? e(Ft.current) : e;
|
|
490
|
+
Je(t), Me.current && Me.current(
|
|
491
|
+
He(t),
|
|
487
492
|
_.current
|
|
488
493
|
);
|
|
489
494
|
},
|
|
490
495
|
onColumnSizingChange: (e) => {
|
|
491
|
-
|
|
496
|
+
ye((t) => {
|
|
492
497
|
const n = typeof e == "function" ? e(t) : e, r = {};
|
|
493
|
-
return Object.keys(n).forEach((
|
|
494
|
-
const c = B.find((u) => u.id ===
|
|
498
|
+
return Object.keys(n).forEach((s) => {
|
|
499
|
+
const c = B.find((u) => u.id === s);
|
|
495
500
|
if (c) {
|
|
496
|
-
const u = c.minSize ||
|
|
497
|
-
K.current ? r[
|
|
498
|
-
Math.max(n[
|
|
499
|
-
|
|
501
|
+
const u = c.minSize || ge, o = c.maxSize || je;
|
|
502
|
+
K.current ? r[s] = Math.max(n[s], u) : r[s] = Math.min(
|
|
503
|
+
Math.max(n[s], u),
|
|
504
|
+
o
|
|
500
505
|
);
|
|
501
506
|
}
|
|
502
507
|
}), { ...t, ...r };
|
|
503
508
|
});
|
|
504
509
|
},
|
|
505
|
-
getRowId: (e, t) =>
|
|
506
|
-
getCoreRowModel:
|
|
507
|
-
getFilteredRowModel:
|
|
508
|
-
getSortedRowModel:
|
|
509
|
-
manualSorting:
|
|
510
|
-
manualFiltering: !!
|
|
510
|
+
getRowId: (e, t) => _e(e, t),
|
|
511
|
+
getCoreRowModel: wr(),
|
|
512
|
+
getFilteredRowModel: Sr(),
|
|
513
|
+
getSortedRowModel: gr(),
|
|
514
|
+
manualSorting: !!$e,
|
|
515
|
+
manualFiltering: !!qe,
|
|
511
516
|
columnResizeMode: "onChange",
|
|
512
517
|
enableRowSelection: !0,
|
|
513
518
|
enableMultiRowSelection: I
|
|
514
519
|
});
|
|
515
|
-
|
|
520
|
+
ne(() => {
|
|
516
521
|
const e = /* @__PURE__ */ new Set();
|
|
517
|
-
Object.keys(
|
|
518
|
-
|
|
519
|
-
}),
|
|
520
|
-
}, [
|
|
521
|
-
const
|
|
522
|
+
Object.keys(ue).forEach((t) => {
|
|
523
|
+
ue[t] && e.add(t);
|
|
524
|
+
}), st.current = e;
|
|
525
|
+
}, [ue]);
|
|
526
|
+
const lr = m(
|
|
522
527
|
(e) => {
|
|
523
|
-
if (
|
|
528
|
+
if (Dt.current?.(e), !nt.current || Bt.current)
|
|
524
529
|
return;
|
|
525
|
-
const t = e.currentTarget, n = Number.isFinite(
|
|
526
|
-
if (
|
|
527
|
-
|
|
530
|
+
const t = e.currentTarget, n = Number.isFinite(rt.current) ? Math.max(0, rt.current) : Pn, { scrollTop: r, scrollHeight: s, clientHeight: c } = t, o = s - r - c <= n, l = Ot.current;
|
|
531
|
+
if (Ot.current = s, s > l && !o) {
|
|
532
|
+
Ee.current = !1;
|
|
528
533
|
return;
|
|
529
534
|
}
|
|
530
|
-
if (!
|
|
531
|
-
|
|
535
|
+
if (!o) {
|
|
536
|
+
Ee.current = !1;
|
|
532
537
|
return;
|
|
533
538
|
}
|
|
534
|
-
|
|
539
|
+
Ee.current || (Ee.current = !0, Pt.current = s, nt.current());
|
|
535
540
|
},
|
|
536
541
|
[]
|
|
537
|
-
),
|
|
538
|
-
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(),
|
|
539
|
-
Object.keys(
|
|
542
|
+
), Vt = (e) => {
|
|
543
|
+
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = new Set(
|
|
544
|
+
Object.keys(ue).filter((o) => ue[o])
|
|
540
545
|
), c = e.map(
|
|
541
|
-
(
|
|
546
|
+
(o, l) => o ? _e(o, l) : ""
|
|
542
547
|
), u = new Set(c.filter(Boolean));
|
|
543
|
-
return e.forEach((
|
|
544
|
-
if (!
|
|
548
|
+
return e.forEach((o, l) => {
|
|
549
|
+
if (!o)
|
|
545
550
|
return;
|
|
546
|
-
const
|
|
547
|
-
!
|
|
551
|
+
const p = c[l], h = s.has(p), d = l.toString(), S = !u.has(d) && s.has(d);
|
|
552
|
+
!h && !S || (r.add(l), t.add(p), n.add(o));
|
|
548
553
|
}), {
|
|
549
554
|
hasSelection: t.size > 0 || n.size > 0 || r.size > 0,
|
|
550
555
|
selectedIds: t,
|
|
@@ -552,126 +557,134 @@ const ls = ({
|
|
|
552
557
|
selectedIndexes: r,
|
|
553
558
|
sourceLength: e.length
|
|
554
559
|
};
|
|
555
|
-
},
|
|
560
|
+
}, Ut = (e, t) => {
|
|
556
561
|
if (!t.hasSelection)
|
|
557
562
|
return;
|
|
558
563
|
const n = t.sourceLength !== e.length, r = {};
|
|
559
|
-
e.forEach((
|
|
560
|
-
if (!
|
|
564
|
+
e.forEach((s, c) => {
|
|
565
|
+
if (!s)
|
|
561
566
|
return;
|
|
562
|
-
const u =
|
|
563
|
-
(
|
|
564
|
-
}),
|
|
565
|
-
}, b =
|
|
567
|
+
const u = _e(s, c), o = t.selectedIds.has(u), l = t.selectedRefs.has(s), p = !n && t.selectedIndexes.has(c);
|
|
568
|
+
(o || l || p) && (r[u] = !0);
|
|
569
|
+
}), At(r);
|
|
570
|
+
}, b = m(
|
|
566
571
|
(e) => {
|
|
567
|
-
if (
|
|
568
|
-
if (!
|
|
569
|
-
return
|
|
572
|
+
if (tt.current) {
|
|
573
|
+
if (!Re.current)
|
|
574
|
+
return de.current = null, Ht.current || (console.warn(
|
|
570
575
|
"[EFWTable] Modo controlled detectado sin onItemsChange. Las operaciones CRUD locales no se aplicarán."
|
|
571
|
-
),
|
|
572
|
-
const t =
|
|
573
|
-
|
|
574
|
-
const r =
|
|
575
|
-
return
|
|
576
|
+
), Ht.current = !0), !1;
|
|
577
|
+
const t = v.current, n = typeof e == "function" ? e(t) : e;
|
|
578
|
+
v.current = n;
|
|
579
|
+
const r = Vt(t);
|
|
580
|
+
return st.current = r.selectedIds, Ut(n, r), Re.current(n), !0;
|
|
576
581
|
}
|
|
577
|
-
return
|
|
582
|
+
return nr((t) => {
|
|
578
583
|
const n = typeof e == "function" ? e(t) : e;
|
|
579
|
-
|
|
580
|
-
const r =
|
|
581
|
-
return
|
|
584
|
+
v.current = n;
|
|
585
|
+
const r = Vt(t);
|
|
586
|
+
return st.current = r.selectedIds, Ut(n, r), Re.current?.(n), n;
|
|
582
587
|
}), !0;
|
|
583
588
|
},
|
|
584
589
|
[]
|
|
585
|
-
),
|
|
586
|
-
const t =
|
|
587
|
-
|
|
588
|
-
|
|
590
|
+
), $t = m(() => i, [i]), qt = m(() => Ne(J), [J]), Yt = m(() => Ne(J)[0] ?? null, [J]), Gt = m(() => J.length > 0, [J]), Kt = m((e) => {
|
|
591
|
+
const t = On(e);
|
|
592
|
+
Xe(t), Fe.current?.(
|
|
593
|
+
Ne(t),
|
|
589
594
|
_.current
|
|
590
595
|
);
|
|
591
|
-
}, []),
|
|
596
|
+
}, []), Xt = m(() => {
|
|
592
597
|
const e = [];
|
|
593
|
-
|
|
594
|
-
|
|
598
|
+
Xe(e), Fe.current?.(
|
|
599
|
+
Ne(e),
|
|
595
600
|
_.current
|
|
596
601
|
);
|
|
597
|
-
}, []),
|
|
602
|
+
}, []), Jt = m(() => i.filter(
|
|
598
603
|
(e) => e.typeAsString !== "Attachments" && P?.[e.internalName]?.filterable !== !1
|
|
599
|
-
), [
|
|
600
|
-
const t =
|
|
601
|
-
|
|
602
|
-
|
|
604
|
+
), [i, P]), Zt = m(() => He(Z), [Z]), Qt = m(() => Z.length > 0, [Z]), en = m((e) => {
|
|
605
|
+
const t = Or(e);
|
|
606
|
+
Je(t), Me.current?.(
|
|
607
|
+
He(t),
|
|
603
608
|
_.current
|
|
604
609
|
);
|
|
605
|
-
}, []),
|
|
610
|
+
}, []), tn = m(() => {
|
|
606
611
|
const e = [];
|
|
607
|
-
|
|
608
|
-
|
|
612
|
+
Je(e), Me.current?.(
|
|
613
|
+
He(e),
|
|
609
614
|
_.current
|
|
610
615
|
);
|
|
611
|
-
}, []),
|
|
616
|
+
}, []), nn = m(
|
|
612
617
|
async (e, t = {}) => {
|
|
613
618
|
const { position: n = "end" } = t;
|
|
614
619
|
try {
|
|
615
|
-
if (
|
|
616
|
-
const r =
|
|
620
|
+
if (ve.current) {
|
|
621
|
+
const r = De(e), s = await ve.current(
|
|
617
622
|
[r],
|
|
618
623
|
_.current
|
|
619
624
|
);
|
|
620
|
-
if (
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
(
|
|
625
|
+
if (s) {
|
|
626
|
+
if (s.successful.length > 0) {
|
|
627
|
+
const p = v.current.length, h = s.successful.map(
|
|
628
|
+
(a) => fe(
|
|
629
|
+
oe.current,
|
|
630
|
+
Wn(a.item)
|
|
631
|
+
)
|
|
624
632
|
);
|
|
625
633
|
if (ee(), !b(
|
|
626
|
-
(
|
|
634
|
+
(a) => he(a, h, n)
|
|
627
635
|
))
|
|
628
636
|
return {
|
|
629
637
|
successful: [],
|
|
630
|
-
failed:
|
|
631
|
-
index:
|
|
632
|
-
item:
|
|
638
|
+
failed: h.map((a, R) => ({
|
|
639
|
+
index: R,
|
|
640
|
+
item: a,
|
|
633
641
|
error: "Controlled mode without onItemsChange"
|
|
634
642
|
}))
|
|
635
643
|
};
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
|
|
644
|
+
const S = pe(
|
|
645
|
+
h,
|
|
646
|
+
p,
|
|
639
647
|
n
|
|
640
648
|
);
|
|
641
|
-
return A(
|
|
642
|
-
...
|
|
643
|
-
successful:
|
|
649
|
+
return A(S, "add", t), {
|
|
650
|
+
...s,
|
|
651
|
+
successful: S
|
|
644
652
|
};
|
|
645
653
|
}
|
|
646
|
-
return { ...
|
|
654
|
+
return { ...s, successful: [] };
|
|
647
655
|
}
|
|
648
|
-
const c =
|
|
656
|
+
const c = fe(
|
|
657
|
+
oe.current,
|
|
658
|
+
r
|
|
659
|
+
), u = v.current.length;
|
|
649
660
|
if (ee(), !b(
|
|
650
|
-
(
|
|
661
|
+
(p) => he(p, [c], n)
|
|
651
662
|
))
|
|
652
663
|
return {
|
|
653
664
|
successful: [],
|
|
654
665
|
failed: [
|
|
655
666
|
{
|
|
656
667
|
index: -1,
|
|
657
|
-
item:
|
|
668
|
+
item: c,
|
|
658
669
|
error: "Controlled mode without onItemsChange"
|
|
659
670
|
}
|
|
660
671
|
]
|
|
661
672
|
};
|
|
662
|
-
const
|
|
663
|
-
[
|
|
664
|
-
|
|
673
|
+
const l = pe(
|
|
674
|
+
[c],
|
|
675
|
+
u,
|
|
665
676
|
n
|
|
666
677
|
);
|
|
667
|
-
return A(
|
|
668
|
-
successful:
|
|
678
|
+
return A(l, "add", t), {
|
|
679
|
+
successful: l,
|
|
669
680
|
failed: []
|
|
670
681
|
};
|
|
671
682
|
} else {
|
|
672
|
-
const r =
|
|
683
|
+
const r = De(
|
|
684
|
+
fe(oe.current, e)
|
|
685
|
+
), s = v.current.length;
|
|
673
686
|
if (ee(), !b(
|
|
674
|
-
(
|
|
687
|
+
(o) => he(o, [r], n)
|
|
675
688
|
))
|
|
676
689
|
return {
|
|
677
690
|
successful: [],
|
|
@@ -683,9 +696,9 @@ const ls = ({
|
|
|
683
696
|
}
|
|
684
697
|
]
|
|
685
698
|
};
|
|
686
|
-
const u =
|
|
699
|
+
const u = pe(
|
|
687
700
|
[r],
|
|
688
|
-
|
|
701
|
+
s,
|
|
689
702
|
n
|
|
690
703
|
);
|
|
691
704
|
return A(u, "add", t), {
|
|
@@ -707,7 +720,7 @@ const ls = ({
|
|
|
707
720
|
}
|
|
708
721
|
},
|
|
709
722
|
[b, ee, A]
|
|
710
|
-
),
|
|
723
|
+
), rn = m(
|
|
711
724
|
async (e, t = {}) => {
|
|
712
725
|
const { position: n = "end" } = t;
|
|
713
726
|
if (e.length === 0)
|
|
@@ -716,80 +729,87 @@ const ls = ({
|
|
|
716
729
|
failed: []
|
|
717
730
|
};
|
|
718
731
|
try {
|
|
719
|
-
if (
|
|
732
|
+
if (ve.current) {
|
|
720
733
|
const r = e.map(
|
|
721
|
-
(
|
|
722
|
-
),
|
|
734
|
+
(p) => De(p)
|
|
735
|
+
), s = await ve.current(
|
|
723
736
|
r,
|
|
724
737
|
_.current
|
|
725
738
|
);
|
|
726
|
-
if (
|
|
727
|
-
if (
|
|
728
|
-
const
|
|
729
|
-
(
|
|
739
|
+
if (s) {
|
|
740
|
+
if (s.successful.length > 0) {
|
|
741
|
+
const p = v.current.length, h = s.successful.map(
|
|
742
|
+
(a) => fe(
|
|
743
|
+
oe.current,
|
|
744
|
+
Wn(a.item)
|
|
745
|
+
)
|
|
730
746
|
);
|
|
731
747
|
if (ee(), !b(
|
|
732
|
-
(
|
|
748
|
+
(a) => he(a, h, n)
|
|
733
749
|
))
|
|
734
750
|
return {
|
|
735
751
|
successful: [],
|
|
736
|
-
failed:
|
|
737
|
-
index:
|
|
738
|
-
item:
|
|
752
|
+
failed: h.map((a, R) => ({
|
|
753
|
+
index: R,
|
|
754
|
+
item: a,
|
|
739
755
|
error: "Controlled mode without onItemsChange"
|
|
740
756
|
}))
|
|
741
757
|
};
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
|
|
758
|
+
const S = pe(
|
|
759
|
+
h,
|
|
760
|
+
p,
|
|
745
761
|
n
|
|
746
762
|
);
|
|
747
|
-
return A(
|
|
748
|
-
...
|
|
749
|
-
successful:
|
|
763
|
+
return A(S, "add", t), {
|
|
764
|
+
...s,
|
|
765
|
+
successful: S
|
|
750
766
|
};
|
|
751
767
|
}
|
|
752
|
-
return { ...
|
|
768
|
+
return { ...s, successful: [] };
|
|
753
769
|
}
|
|
754
|
-
const c =
|
|
770
|
+
const c = r.map(
|
|
771
|
+
(p) => fe(oe.current, p)
|
|
772
|
+
), u = v.current.length;
|
|
755
773
|
if (ee(), !b(
|
|
756
|
-
(
|
|
774
|
+
(p) => he(p, c, n)
|
|
757
775
|
))
|
|
758
776
|
return {
|
|
759
777
|
successful: [],
|
|
760
|
-
failed:
|
|
761
|
-
index:
|
|
762
|
-
item:
|
|
778
|
+
failed: c.map((p, h) => ({
|
|
779
|
+
index: h,
|
|
780
|
+
item: p,
|
|
763
781
|
error: "Controlled mode without onItemsChange"
|
|
764
782
|
}))
|
|
765
783
|
};
|
|
766
|
-
const
|
|
767
|
-
r,
|
|
784
|
+
const l = pe(
|
|
768
785
|
c,
|
|
786
|
+
u,
|
|
769
787
|
n
|
|
770
788
|
);
|
|
771
|
-
return A(
|
|
772
|
-
successful:
|
|
789
|
+
return A(l, "add", t), {
|
|
790
|
+
successful: l,
|
|
773
791
|
failed: []
|
|
774
792
|
};
|
|
775
793
|
} else {
|
|
776
794
|
const r = e.map(
|
|
777
|
-
(
|
|
778
|
-
|
|
795
|
+
(o) => De(
|
|
796
|
+
fe(oe.current, o)
|
|
797
|
+
)
|
|
798
|
+
), s = v.current.length;
|
|
779
799
|
if (ee(), !b(
|
|
780
|
-
(
|
|
800
|
+
(o) => he(o, r, n)
|
|
781
801
|
))
|
|
782
802
|
return {
|
|
783
803
|
successful: [],
|
|
784
|
-
failed: r.map((
|
|
785
|
-
index:
|
|
786
|
-
item:
|
|
804
|
+
failed: r.map((o, l) => ({
|
|
805
|
+
index: l,
|
|
806
|
+
item: o,
|
|
787
807
|
error: "Controlled mode without onItemsChange"
|
|
788
808
|
}))
|
|
789
809
|
};
|
|
790
|
-
const u =
|
|
810
|
+
const u = pe(
|
|
791
811
|
r,
|
|
792
|
-
|
|
812
|
+
s,
|
|
793
813
|
n
|
|
794
814
|
);
|
|
795
815
|
return A(u, "add", t), {
|
|
@@ -800,79 +820,79 @@ const ls = ({
|
|
|
800
820
|
} catch (r) {
|
|
801
821
|
return {
|
|
802
822
|
successful: [],
|
|
803
|
-
failed: e.map((
|
|
823
|
+
failed: e.map((s, c) => ({
|
|
804
824
|
index: c,
|
|
805
|
-
item:
|
|
825
|
+
item: s,
|
|
806
826
|
error: String(r)
|
|
807
827
|
}))
|
|
808
828
|
};
|
|
809
829
|
}
|
|
810
830
|
},
|
|
811
831
|
[b, ee, A]
|
|
812
|
-
),
|
|
832
|
+
), sn = m(
|
|
813
833
|
async (e, t, n = {}) => {
|
|
814
|
-
const r =
|
|
834
|
+
const r = v.current;
|
|
815
835
|
if (e < 0 || e >= r.length)
|
|
816
836
|
return {
|
|
817
837
|
successful: [],
|
|
818
838
|
failed: [{ index: e, item: t, error: "Invalid index" }]
|
|
819
839
|
};
|
|
820
840
|
try {
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
841
|
+
if (Ce.current) {
|
|
842
|
+
const o = await Ce.current(
|
|
823
843
|
[{ index: e, item: t }],
|
|
824
844
|
_.current
|
|
825
845
|
);
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
828
|
-
({ index:
|
|
829
|
-
).map(({ index:
|
|
830
|
-
const
|
|
846
|
+
if (o) {
|
|
847
|
+
const p = o.successful.filter(
|
|
848
|
+
({ index: a }) => a >= 0 && a < r.length
|
|
849
|
+
).map(({ index: a, item: R }) => {
|
|
850
|
+
const U = cn(
|
|
831
851
|
r,
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
852
|
+
a,
|
|
853
|
+
R,
|
|
854
|
+
a === e ? t : void 0
|
|
835
855
|
);
|
|
836
|
-
return
|
|
856
|
+
return U ? { index: a, item: U } : null;
|
|
837
857
|
}).filter(
|
|
838
|
-
(
|
|
858
|
+
(a) => a !== null
|
|
839
859
|
);
|
|
840
|
-
if (
|
|
841
|
-
if (!b((
|
|
842
|
-
const
|
|
843
|
-
return
|
|
844
|
-
|
|
845
|
-
}),
|
|
860
|
+
if (p.length) {
|
|
861
|
+
if (!b((R) => {
|
|
862
|
+
const U = [...R];
|
|
863
|
+
return p.forEach(({ index: f, item: N }) => {
|
|
864
|
+
U[f] = N;
|
|
865
|
+
}), U;
|
|
846
866
|
}))
|
|
847
867
|
return {
|
|
848
868
|
successful: [],
|
|
849
|
-
failed:
|
|
850
|
-
index:
|
|
851
|
-
item:
|
|
869
|
+
failed: p.map(({ index: R, item: U }) => ({
|
|
870
|
+
index: R,
|
|
871
|
+
item: U,
|
|
852
872
|
error: "Controlled mode without onItemsChange"
|
|
853
873
|
}))
|
|
854
874
|
};
|
|
855
|
-
A(
|
|
875
|
+
A(p, "update", n);
|
|
856
876
|
}
|
|
857
|
-
const
|
|
858
|
-
|
|
859
|
-
),
|
|
860
|
-
return
|
|
861
|
-
({ index:
|
|
862
|
-
).map(({ index:
|
|
863
|
-
index:
|
|
864
|
-
item:
|
|
877
|
+
const h = new Set(
|
|
878
|
+
o.failed.map((a) => a.index)
|
|
879
|
+
), d = [...o.failed];
|
|
880
|
+
return o.successful.filter(
|
|
881
|
+
({ index: a }) => a < 0 || a >= r.length
|
|
882
|
+
).map(({ index: a, item: R }) => ({
|
|
883
|
+
index: a,
|
|
884
|
+
item: R,
|
|
865
885
|
error: "Invalid index"
|
|
866
|
-
})).forEach((
|
|
867
|
-
|
|
868
|
-
}), { successful:
|
|
886
|
+
})).forEach((a) => {
|
|
887
|
+
h.has(a.index) || d.push(a);
|
|
888
|
+
}), { successful: p, failed: d };
|
|
869
889
|
}
|
|
870
890
|
}
|
|
871
|
-
let
|
|
872
|
-
if (!b((
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
return
|
|
891
|
+
let s;
|
|
892
|
+
if (!b((o) => {
|
|
893
|
+
s = { ...o[e], ...t };
|
|
894
|
+
const l = [...o];
|
|
895
|
+
return l[e] = s, l;
|
|
876
896
|
}))
|
|
877
897
|
return {
|
|
878
898
|
successful: [],
|
|
@@ -884,146 +904,146 @@ const ls = ({
|
|
|
884
904
|
}
|
|
885
905
|
]
|
|
886
906
|
};
|
|
887
|
-
const u = [{ index: e, item:
|
|
907
|
+
const u = [{ index: e, item: s }];
|
|
888
908
|
return A(u, "update", n), { successful: u, failed: [] };
|
|
889
|
-
} catch (
|
|
909
|
+
} catch (s) {
|
|
890
910
|
return {
|
|
891
911
|
successful: [],
|
|
892
|
-
failed: [{ index: e, item: t, error: String(
|
|
912
|
+
failed: [{ index: e, item: t, error: String(s) }]
|
|
893
913
|
};
|
|
894
914
|
}
|
|
895
915
|
},
|
|
896
916
|
[b, A]
|
|
897
|
-
),
|
|
917
|
+
), on = m(
|
|
898
918
|
async (e, t = {}) => {
|
|
899
919
|
if (!e.length) return { successful: [], failed: [] };
|
|
900
|
-
const n =
|
|
901
|
-
({ index:
|
|
920
|
+
const n = v.current, r = (o) => o >= 0 && o < n.length, s = e.filter(({ index: o }) => !r(o)).map(({ index: o, item: l }) => ({ index: o, item: l, error: "Invalid index" })), c = e.filter(
|
|
921
|
+
({ index: o }) => r(o)
|
|
902
922
|
), u = /* @__PURE__ */ new Map();
|
|
903
|
-
c.forEach(({ index:
|
|
904
|
-
u.set(
|
|
923
|
+
c.forEach(({ index: o, item: l }) => {
|
|
924
|
+
u.set(o, l);
|
|
905
925
|
});
|
|
906
926
|
try {
|
|
907
|
-
if (
|
|
908
|
-
const
|
|
927
|
+
if (Ce.current) {
|
|
928
|
+
const h = await Ce.current(
|
|
909
929
|
e,
|
|
910
930
|
_.current
|
|
911
931
|
);
|
|
912
|
-
if (
|
|
913
|
-
const
|
|
914
|
-
({ index:
|
|
915
|
-
).map(({ index:
|
|
916
|
-
const F =
|
|
932
|
+
if (h) {
|
|
933
|
+
const S = h.successful.filter(
|
|
934
|
+
({ index: f }) => r(f)
|
|
935
|
+
).map(({ index: f, item: N }) => {
|
|
936
|
+
const F = cn(
|
|
917
937
|
n,
|
|
918
|
-
|
|
938
|
+
f,
|
|
919
939
|
N,
|
|
920
|
-
u.get(
|
|
940
|
+
u.get(f)
|
|
921
941
|
);
|
|
922
|
-
return F ? { index:
|
|
942
|
+
return F ? { index: f, item: F } : null;
|
|
923
943
|
}).filter(
|
|
924
|
-
(
|
|
944
|
+
(f) => f !== null
|
|
925
945
|
);
|
|
926
|
-
if (
|
|
946
|
+
if (S.length) {
|
|
927
947
|
if (!b((N) => {
|
|
928
948
|
const F = [...N];
|
|
929
|
-
return
|
|
930
|
-
F[
|
|
949
|
+
return S.forEach(({ index: Ln, item: it }) => {
|
|
950
|
+
F[Ln] = it;
|
|
931
951
|
}), F;
|
|
932
952
|
}))
|
|
933
953
|
return {
|
|
934
954
|
successful: [],
|
|
935
|
-
failed:
|
|
955
|
+
failed: S.map(({ index: N, item: F }) => ({
|
|
936
956
|
index: N,
|
|
937
957
|
item: F,
|
|
938
958
|
error: "Controlled mode without onItemsChange"
|
|
939
959
|
}))
|
|
940
960
|
};
|
|
941
|
-
A(
|
|
961
|
+
A(S, "update", t);
|
|
942
962
|
}
|
|
943
|
-
const
|
|
944
|
-
return
|
|
945
|
-
|
|
946
|
-
}),
|
|
947
|
-
index:
|
|
963
|
+
const a = new Set(h.failed.map((f) => f.index)), R = [...h.failed];
|
|
964
|
+
return s.forEach((f) => {
|
|
965
|
+
a.has(f.index) || R.push(f);
|
|
966
|
+
}), h.successful.filter(({ index: f }) => !r(f)).map(({ index: f, item: N }) => ({
|
|
967
|
+
index: f,
|
|
948
968
|
item: N,
|
|
949
969
|
error: "Invalid index"
|
|
950
|
-
})).forEach((
|
|
951
|
-
|
|
952
|
-
}), { successful:
|
|
970
|
+
})).forEach((f) => {
|
|
971
|
+
a.has(f.index) || R.push(f);
|
|
972
|
+
}), { successful: S, failed: R };
|
|
953
973
|
}
|
|
954
974
|
}
|
|
955
|
-
const
|
|
956
|
-
return b((
|
|
957
|
-
const
|
|
958
|
-
return c.forEach(({ index:
|
|
959
|
-
|
|
960
|
-
}),
|
|
961
|
-
}) ? (A(
|
|
975
|
+
const o = [], l = [...s];
|
|
976
|
+
return b((h) => {
|
|
977
|
+
const d = [...h];
|
|
978
|
+
return c.forEach(({ index: S, item: a }) => {
|
|
979
|
+
d[S] = { ...d[S], ...a }, o.push({ index: S, item: d[S] });
|
|
980
|
+
}), d;
|
|
981
|
+
}) ? (A(o, "update", t), { successful: o, failed: l }) : {
|
|
962
982
|
successful: [],
|
|
963
|
-
failed: c.map(({ index:
|
|
964
|
-
index:
|
|
965
|
-
item:
|
|
983
|
+
failed: c.map(({ index: h, item: d }) => ({
|
|
984
|
+
index: h,
|
|
985
|
+
item: d,
|
|
966
986
|
error: "Controlled mode without onItemsChange"
|
|
967
987
|
}))
|
|
968
988
|
};
|
|
969
|
-
} catch (
|
|
989
|
+
} catch (o) {
|
|
970
990
|
return {
|
|
971
991
|
successful: [],
|
|
972
|
-
failed: e.map(({ index:
|
|
973
|
-
index:
|
|
974
|
-
item:
|
|
975
|
-
error: String(
|
|
992
|
+
failed: e.map(({ index: l, item: p }) => ({
|
|
993
|
+
index: l,
|
|
994
|
+
item: p,
|
|
995
|
+
error: String(o)
|
|
976
996
|
}))
|
|
977
997
|
};
|
|
978
998
|
}
|
|
979
999
|
},
|
|
980
1000
|
[b, A]
|
|
981
|
-
),
|
|
982
|
-
const
|
|
983
|
-
if (!
|
|
1001
|
+
), cn = (e, t, n, r) => {
|
|
1002
|
+
const s = e[t];
|
|
1003
|
+
if (!s)
|
|
984
1004
|
return null;
|
|
985
1005
|
const c = n ?? r;
|
|
986
1006
|
return c ? {
|
|
987
|
-
...
|
|
1007
|
+
...s,
|
|
988
1008
|
...c,
|
|
989
|
-
_rowId: c._rowId ??
|
|
990
|
-
} :
|
|
991
|
-
},
|
|
1009
|
+
_rowId: c._rowId ?? s._rowId
|
|
1010
|
+
} : s;
|
|
1011
|
+
}, ln = (e, t, n) => {
|
|
992
1012
|
const r = e[t];
|
|
993
1013
|
return r ? n ? {
|
|
994
1014
|
...r,
|
|
995
1015
|
...n,
|
|
996
1016
|
_rowId: n._rowId ?? r._rowId
|
|
997
1017
|
} : r : null;
|
|
998
|
-
},
|
|
1018
|
+
}, an = m(
|
|
999
1019
|
async (e) => {
|
|
1000
|
-
const t =
|
|
1020
|
+
const t = v.current;
|
|
1001
1021
|
if (e < 0 || e >= t.length)
|
|
1002
1022
|
return {
|
|
1003
1023
|
successful: [],
|
|
1004
1024
|
failed: [{ index: e, error: "Invalid index" }]
|
|
1005
1025
|
};
|
|
1006
1026
|
try {
|
|
1007
|
-
if (
|
|
1008
|
-
const
|
|
1009
|
-
[{ index: e, item:
|
|
1027
|
+
if (Te.current) {
|
|
1028
|
+
const s = t[e], c = await Te.current(
|
|
1029
|
+
[{ index: e, item: s }],
|
|
1010
1030
|
_.current
|
|
1011
1031
|
);
|
|
1012
1032
|
if (c) {
|
|
1013
|
-
const
|
|
1014
|
-
({ index:
|
|
1015
|
-
).map(({ index:
|
|
1016
|
-
const
|
|
1033
|
+
const o = c.successful.filter(
|
|
1034
|
+
({ index: d }) => d >= 0 && d < t.length
|
|
1035
|
+
).map(({ index: d, item: S }) => {
|
|
1036
|
+
const a = ln(
|
|
1017
1037
|
t,
|
|
1018
|
-
|
|
1019
|
-
|
|
1038
|
+
d,
|
|
1039
|
+
S
|
|
1020
1040
|
);
|
|
1021
|
-
return
|
|
1041
|
+
return a ? { index: d, item: a } : null;
|
|
1022
1042
|
}).filter(
|
|
1023
|
-
(
|
|
1043
|
+
(d) => d !== null
|
|
1024
1044
|
);
|
|
1025
|
-
if (
|
|
1026
|
-
(
|
|
1045
|
+
if (o.length && !b(
|
|
1046
|
+
(S) => S.filter((a, R) => R !== e)
|
|
1027
1047
|
))
|
|
1028
1048
|
return {
|
|
1029
1049
|
successful: [],
|
|
@@ -1031,22 +1051,22 @@ const ls = ({
|
|
|
1031
1051
|
{ index: e, error: "Controlled mode without onItemsChange" }
|
|
1032
1052
|
]
|
|
1033
1053
|
};
|
|
1034
|
-
const
|
|
1035
|
-
c.failed.map((
|
|
1036
|
-
),
|
|
1054
|
+
const l = new Set(
|
|
1055
|
+
c.failed.map((d) => d.index)
|
|
1056
|
+
), p = [...c.failed];
|
|
1037
1057
|
return c.successful.filter(
|
|
1038
|
-
({ index:
|
|
1039
|
-
).map(({ index:
|
|
1040
|
-
index:
|
|
1041
|
-
item:
|
|
1058
|
+
({ index: d }) => d < 0 || d >= t.length
|
|
1059
|
+
).map(({ index: d, item: S }) => ({
|
|
1060
|
+
index: d,
|
|
1061
|
+
item: S,
|
|
1042
1062
|
error: "Invalid index"
|
|
1043
|
-
})).forEach((
|
|
1044
|
-
|
|
1045
|
-
}), { successful:
|
|
1063
|
+
})).forEach((d) => {
|
|
1064
|
+
l.has(d.index) || p.push(d);
|
|
1065
|
+
}), { successful: o, failed: p };
|
|
1046
1066
|
}
|
|
1047
1067
|
}
|
|
1048
1068
|
let n;
|
|
1049
|
-
return b((
|
|
1069
|
+
return b((s) => (n = s[e], s.filter((c, u) => u !== e))) ? { successful: [{ index: e, item: n }], failed: [] } : {
|
|
1050
1070
|
successful: [],
|
|
1051
1071
|
failed: [{ index: e, error: "Controlled mode without onItemsChange" }]
|
|
1052
1072
|
};
|
|
@@ -1058,110 +1078,110 @@ const ls = ({
|
|
|
1058
1078
|
}
|
|
1059
1079
|
},
|
|
1060
1080
|
[b]
|
|
1061
|
-
),
|
|
1081
|
+
), un = m(
|
|
1062
1082
|
async (e) => {
|
|
1063
1083
|
if (!e.length) return { successful: [], failed: [] };
|
|
1064
|
-
const t =
|
|
1065
|
-
(
|
|
1084
|
+
const t = v.current, n = Array.from(new Set(e)), { validIndexes: r, invalidFailures: s } = n.reduce(
|
|
1085
|
+
(o, l) => (l >= 0 && l < t.length ? o.validIndexes.push(l) : o.invalidFailures.push({ index: l, error: "Invalid index" }), o),
|
|
1066
1086
|
{
|
|
1067
1087
|
validIndexes: [],
|
|
1068
1088
|
invalidFailures: []
|
|
1069
1089
|
}
|
|
1070
|
-
), c = n.map((
|
|
1071
|
-
index:
|
|
1072
|
-
item: t[
|
|
1090
|
+
), c = n.map((o) => ({
|
|
1091
|
+
index: o,
|
|
1092
|
+
item: t[o]
|
|
1073
1093
|
})), u = new Set(r);
|
|
1074
1094
|
try {
|
|
1075
|
-
if (
|
|
1076
|
-
const
|
|
1095
|
+
if (Te.current) {
|
|
1096
|
+
const h = await Te.current(
|
|
1077
1097
|
c,
|
|
1078
1098
|
_.current
|
|
1079
1099
|
);
|
|
1080
|
-
if (
|
|
1081
|
-
const
|
|
1082
|
-
({ index:
|
|
1083
|
-
),
|
|
1084
|
-
const F =
|
|
1100
|
+
if (h) {
|
|
1101
|
+
const d = h.successful.filter(
|
|
1102
|
+
({ index: f }) => u.has(f)
|
|
1103
|
+
), S = d.map(({ index: f, item: N }) => {
|
|
1104
|
+
const F = ln(
|
|
1085
1105
|
t,
|
|
1086
|
-
|
|
1106
|
+
f,
|
|
1087
1107
|
N
|
|
1088
1108
|
);
|
|
1089
|
-
return F ? { index:
|
|
1109
|
+
return F ? { index: f, item: F } : null;
|
|
1090
1110
|
}).filter(
|
|
1091
|
-
(
|
|
1111
|
+
(f) => f !== null
|
|
1092
1112
|
);
|
|
1093
|
-
if (
|
|
1094
|
-
const
|
|
1113
|
+
if (d.length) {
|
|
1114
|
+
const f = new Set(S.map((F) => F.index));
|
|
1095
1115
|
if (!b(
|
|
1096
|
-
(F) => F.filter((
|
|
1116
|
+
(F) => F.filter((Ln, it) => !f.has(it))
|
|
1097
1117
|
))
|
|
1098
1118
|
return {
|
|
1099
1119
|
successful: [],
|
|
1100
|
-
failed:
|
|
1120
|
+
failed: S.map(({ index: F }) => ({
|
|
1101
1121
|
index: F,
|
|
1102
1122
|
error: "Controlled mode without onItemsChange"
|
|
1103
1123
|
}))
|
|
1104
1124
|
};
|
|
1105
1125
|
}
|
|
1106
|
-
const
|
|
1107
|
-
return
|
|
1108
|
-
|
|
1109
|
-
}),
|
|
1110
|
-
index:
|
|
1126
|
+
const a = new Set(h.failed.map((f) => f.index)), R = [...h.failed];
|
|
1127
|
+
return s.forEach((f) => {
|
|
1128
|
+
a.has(f.index) || R.push(f);
|
|
1129
|
+
}), h.successful.filter(({ index: f }) => !u.has(f)).map(({ index: f, item: N }) => ({
|
|
1130
|
+
index: f,
|
|
1111
1131
|
item: N,
|
|
1112
1132
|
error: "Invalid index"
|
|
1113
|
-
})).forEach((
|
|
1114
|
-
|
|
1115
|
-
}), { successful:
|
|
1133
|
+
})).forEach((f) => {
|
|
1134
|
+
a.has(f.index) || R.push(f);
|
|
1135
|
+
}), { successful: S, failed: R };
|
|
1116
1136
|
}
|
|
1117
1137
|
}
|
|
1118
|
-
const
|
|
1119
|
-
return b((
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1122
|
-
|
|
1123
|
-
}),
|
|
1124
|
-
}) ? { successful:
|
|
1138
|
+
const o = new Set(r), l = [];
|
|
1139
|
+
return b((h) => {
|
|
1140
|
+
const d = [];
|
|
1141
|
+
return h.forEach((S, a) => {
|
|
1142
|
+
o.has(a) ? l.push({ index: a, item: S }) : d.push(S);
|
|
1143
|
+
}), d;
|
|
1144
|
+
}) ? { successful: l, failed: s } : {
|
|
1125
1145
|
successful: [],
|
|
1126
|
-
failed: r.map((
|
|
1127
|
-
index:
|
|
1146
|
+
failed: r.map((h) => ({
|
|
1147
|
+
index: h,
|
|
1128
1148
|
error: "Controlled mode without onItemsChange"
|
|
1129
1149
|
}))
|
|
1130
1150
|
};
|
|
1131
|
-
} catch (
|
|
1151
|
+
} catch (o) {
|
|
1132
1152
|
return {
|
|
1133
1153
|
successful: [],
|
|
1134
|
-
failed: n.map((
|
|
1135
|
-
index:
|
|
1136
|
-
error: String(
|
|
1154
|
+
failed: n.map((l) => ({
|
|
1155
|
+
index: l,
|
|
1156
|
+
error: String(o)
|
|
1137
1157
|
}))
|
|
1138
1158
|
};
|
|
1139
1159
|
}
|
|
1140
1160
|
},
|
|
1141
1161
|
[b]
|
|
1142
|
-
),
|
|
1143
|
-
const t =
|
|
1144
|
-
return t !== void 0 ?
|
|
1145
|
-
}, []),
|
|
1162
|
+
), dn = m((e) => {
|
|
1163
|
+
const t = We.current.get(String(e));
|
|
1164
|
+
return t !== void 0 ? v.current[t] : void 0;
|
|
1165
|
+
}, []), fn = m((e) => v.current[e], []), mn = m(
|
|
1146
1166
|
(e) => {
|
|
1147
1167
|
b(
|
|
1148
|
-
e.map((t) => ({ ...t, _rowId: t._rowId ??
|
|
1168
|
+
e.map((t) => ({ ...t, _rowId: t._rowId ?? at() }))
|
|
1149
1169
|
);
|
|
1150
1170
|
},
|
|
1151
1171
|
[b]
|
|
1152
|
-
),
|
|
1172
|
+
), hn = m(() => {
|
|
1153
1173
|
b([]);
|
|
1154
|
-
}, [b]),
|
|
1174
|
+
}, [b]), pn = m((e) => We.current.get(String(e)) ?? -1, []), gn = m((e) => We.current.has(String(e)), []), Sn = m(() => v.current.length, []), wn = m(() => [...v.current], []), xn = m(() => _t(v.current), [_t]), In = m(() => Wt(v.current), [Wt]), bn = m(
|
|
1155
1175
|
(e, t) => {
|
|
1156
1176
|
const n = e ? {
|
|
1157
1177
|
state: "loading",
|
|
1158
1178
|
message: t?.title,
|
|
1159
1179
|
description: t?.description
|
|
1160
1180
|
} : { state: "none" };
|
|
1161
|
-
H ||
|
|
1181
|
+
H || be(n), j?.(n);
|
|
1162
1182
|
},
|
|
1163
1183
|
[H, j]
|
|
1164
|
-
),
|
|
1184
|
+
), yn = m(
|
|
1165
1185
|
(e, t) => {
|
|
1166
1186
|
const n = e ? {
|
|
1167
1187
|
state: "error",
|
|
@@ -1170,20 +1190,20 @@ const ls = ({
|
|
|
1170
1190
|
onRetry: t?.onRetry,
|
|
1171
1191
|
retryButtonText: t?.retryButtonText
|
|
1172
1192
|
} : { state: "none" };
|
|
1173
|
-
H ||
|
|
1193
|
+
H || be(n), j?.(n);
|
|
1174
1194
|
},
|
|
1175
1195
|
[H, j]
|
|
1176
|
-
),
|
|
1196
|
+
), Rn = m(
|
|
1177
1197
|
(e, t) => {
|
|
1178
1198
|
const n = e ? {
|
|
1179
1199
|
state: "partial-loading",
|
|
1180
1200
|
message: t?.title,
|
|
1181
1201
|
description: t?.description
|
|
1182
1202
|
} : { state: "none" };
|
|
1183
|
-
H ||
|
|
1203
|
+
H || be(n), j?.(n);
|
|
1184
1204
|
},
|
|
1185
1205
|
[H, j]
|
|
1186
|
-
),
|
|
1206
|
+
), vn = m(
|
|
1187
1207
|
(e, t) => {
|
|
1188
1208
|
const n = e ? {
|
|
1189
1209
|
state: "empty",
|
|
@@ -1191,284 +1211,284 @@ const ls = ({
|
|
|
1191
1211
|
description: t?.description,
|
|
1192
1212
|
imageUrl: t?.imageUrl
|
|
1193
1213
|
} : { state: "none" };
|
|
1194
|
-
H ||
|
|
1214
|
+
H || be(n), j?.(n);
|
|
1195
1215
|
},
|
|
1196
1216
|
[H, j]
|
|
1197
|
-
),
|
|
1217
|
+
), Cn = m(() => {
|
|
1198
1218
|
const e = { state: "none" };
|
|
1199
|
-
H ||
|
|
1200
|
-
}, [H, j]),
|
|
1219
|
+
H || be(e), j?.(e);
|
|
1220
|
+
}, [H, j]), Tn = m(() => Le.state, [Le.state]), Ae = ce(
|
|
1201
1221
|
() => ({
|
|
1202
|
-
getFields:
|
|
1203
|
-
addItem:
|
|
1204
|
-
addItems:
|
|
1205
|
-
updateItem:
|
|
1206
|
-
updateItems:
|
|
1207
|
-
deleteItem:
|
|
1208
|
-
deleteItems:
|
|
1209
|
-
getItem:
|
|
1210
|
-
getItemByIndex:
|
|
1211
|
-
getItems:
|
|
1212
|
-
getItemsCount:
|
|
1213
|
-
itemExists:
|
|
1214
|
-
getItemIndex:
|
|
1215
|
-
replaceAllItems:
|
|
1216
|
-
clearItems:
|
|
1217
|
-
deselectAllRows:
|
|
1218
|
-
getSelectedItems:
|
|
1219
|
-
getSelectedRows:
|
|
1222
|
+
getFields: $t,
|
|
1223
|
+
addItem: nn,
|
|
1224
|
+
addItems: rn,
|
|
1225
|
+
updateItem: sn,
|
|
1226
|
+
updateItems: on,
|
|
1227
|
+
deleteItem: an,
|
|
1228
|
+
deleteItems: un,
|
|
1229
|
+
getItem: dn,
|
|
1230
|
+
getItemByIndex: fn,
|
|
1231
|
+
getItems: wn,
|
|
1232
|
+
getItemsCount: Sn,
|
|
1233
|
+
itemExists: gn,
|
|
1234
|
+
getItemIndex: pn,
|
|
1235
|
+
replaceAllItems: mn,
|
|
1236
|
+
clearItems: hn,
|
|
1237
|
+
deselectAllRows: Nt,
|
|
1238
|
+
getSelectedItems: xn,
|
|
1239
|
+
getSelectedRows: In,
|
|
1220
1240
|
// Overlay methods
|
|
1221
|
-
setLoading:
|
|
1222
|
-
setError:
|
|
1223
|
-
setPartialLoading:
|
|
1224
|
-
setEmpty:
|
|
1225
|
-
clearOverlay:
|
|
1226
|
-
getOverlayState:
|
|
1241
|
+
setLoading: bn,
|
|
1242
|
+
setError: yn,
|
|
1243
|
+
setPartialLoading: Rn,
|
|
1244
|
+
setEmpty: vn,
|
|
1245
|
+
clearOverlay: Cn,
|
|
1246
|
+
getOverlayState: Tn,
|
|
1227
1247
|
// Sorting methods
|
|
1228
|
-
getSortingState:
|
|
1229
|
-
getPrimarySortedColumn:
|
|
1230
|
-
hasActiveSorting:
|
|
1231
|
-
setSortingState:
|
|
1232
|
-
clearSorting:
|
|
1248
|
+
getSortingState: qt,
|
|
1249
|
+
getPrimarySortedColumn: Yt,
|
|
1250
|
+
hasActiveSorting: Gt,
|
|
1251
|
+
setSortingState: Kt,
|
|
1252
|
+
clearSorting: Xt,
|
|
1233
1253
|
// Filter methods
|
|
1234
|
-
getFilterableFields:
|
|
1235
|
-
getColumnFilters:
|
|
1236
|
-
hasActiveFilters:
|
|
1237
|
-
setColumnFilters:
|
|
1238
|
-
clearColumnFilters:
|
|
1254
|
+
getFilterableFields: Jt,
|
|
1255
|
+
getColumnFilters: Zt,
|
|
1256
|
+
hasActiveFilters: Qt,
|
|
1257
|
+
setColumnFilters: en,
|
|
1258
|
+
clearColumnFilters: tn
|
|
1239
1259
|
}),
|
|
1240
1260
|
[
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
cn,
|
|
1246
|
-
ln,
|
|
1247
|
-
Mt,
|
|
1248
|
-
a,
|
|
1249
|
-
Ut,
|
|
1261
|
+
nn,
|
|
1262
|
+
rn,
|
|
1263
|
+
hn,
|
|
1264
|
+
Cn,
|
|
1250
1265
|
an,
|
|
1251
1266
|
un,
|
|
1252
|
-
|
|
1253
|
-
|
|
1267
|
+
Nt,
|
|
1268
|
+
i,
|
|
1269
|
+
$t,
|
|
1270
|
+
dn,
|
|
1271
|
+
fn,
|
|
1254
1272
|
pn,
|
|
1255
|
-
vn,
|
|
1256
|
-
Sn,
|
|
1257
1273
|
wn,
|
|
1258
|
-
|
|
1259
|
-
|
|
1274
|
+
Sn,
|
|
1275
|
+
Tn,
|
|
1276
|
+
xn,
|
|
1277
|
+
In,
|
|
1260
1278
|
qt,
|
|
1261
|
-
|
|
1262
|
-
dn,
|
|
1279
|
+
Yt,
|
|
1263
1280
|
Gt,
|
|
1281
|
+
gn,
|
|
1282
|
+
mn,
|
|
1283
|
+
Xt,
|
|
1284
|
+
vn,
|
|
1264
1285
|
yn,
|
|
1265
|
-
In,
|
|
1266
|
-
xn,
|
|
1267
|
-
Yt,
|
|
1268
1286
|
bn,
|
|
1269
|
-
nn,
|
|
1270
|
-
rn,
|
|
1271
|
-
// Filter methods
|
|
1272
|
-
Qt,
|
|
1273
|
-
Xt,
|
|
1274
1287
|
Kt,
|
|
1288
|
+
Rn,
|
|
1289
|
+
sn,
|
|
1290
|
+
on,
|
|
1291
|
+
// Filter methods
|
|
1292
|
+
tn,
|
|
1293
|
+
Zt,
|
|
1275
1294
|
Jt,
|
|
1276
|
-
|
|
1295
|
+
Qt,
|
|
1296
|
+
en
|
|
1277
1297
|
]
|
|
1278
1298
|
);
|
|
1279
|
-
_.current =
|
|
1280
|
-
|
|
1299
|
+
_.current = Ae, hr.useImperativeHandle(Un, () => Ae, [
|
|
1300
|
+
Ae
|
|
1281
1301
|
]);
|
|
1282
|
-
const
|
|
1302
|
+
const ar = m(
|
|
1283
1303
|
(e, t) => {
|
|
1284
|
-
t?.target && t.target.closest('[data-checkbox="true"]') || (I &&
|
|
1304
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || (I && kt(e.index), E && E(e.original, e.index));
|
|
1285
1305
|
},
|
|
1286
|
-
[I,
|
|
1287
|
-
),
|
|
1306
|
+
[I, E, kt]
|
|
1307
|
+
), ur = m(
|
|
1288
1308
|
(e, t) => {
|
|
1289
|
-
t?.target && t.target.closest('[data-checkbox="true"]') ||
|
|
1309
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || Ve && Ve(e.original, e.index);
|
|
1290
1310
|
},
|
|
1291
|
-
[
|
|
1292
|
-
),
|
|
1293
|
-
const n =
|
|
1294
|
-
return e.id === "select" ? `${
|
|
1295
|
-
}).join(" "), [B, L,
|
|
1296
|
-
|
|
1297
|
-
if (
|
|
1298
|
-
const e =
|
|
1311
|
+
[Ve]
|
|
1312
|
+
), En = ce(() => B.map((e) => {
|
|
1313
|
+
const n = i.find((s) => s.internalName === e.id)?.typeAsString === "Note" ? O * 2 : O, r = L[e.id] || (typeof e.size == "number" ? e.size : n);
|
|
1314
|
+
return e.id === "select" ? `${ke}px` : `${r}px`;
|
|
1315
|
+
}).join(" "), [B, L, i]), zn = x(!1);
|
|
1316
|
+
_n(() => {
|
|
1317
|
+
if (zn.current) return;
|
|
1318
|
+
const e = se.current;
|
|
1299
1319
|
if (!e) return;
|
|
1300
1320
|
const t = e.clientWidth;
|
|
1301
1321
|
if (t <= 0) return;
|
|
1302
|
-
|
|
1303
|
-
const n =
|
|
1322
|
+
zn.current = !0, Mt(t);
|
|
1323
|
+
const n = le ? Hn(t, B, i, L) : jn(
|
|
1304
1324
|
t,
|
|
1305
1325
|
B,
|
|
1306
|
-
|
|
1326
|
+
i,
|
|
1307
1327
|
L,
|
|
1308
|
-
|
|
1328
|
+
ze
|
|
1309
1329
|
);
|
|
1310
|
-
n && (K.current = !0,
|
|
1311
|
-
(r) =>
|
|
1330
|
+
n && (K.current = !0, ye(
|
|
1331
|
+
(r) => le ? n : { ...r, ...n }
|
|
1312
1332
|
), requestAnimationFrame(() => {
|
|
1313
1333
|
K.current = !1;
|
|
1314
1334
|
}));
|
|
1315
|
-
}),
|
|
1316
|
-
if (!
|
|
1335
|
+
}), ne(() => {
|
|
1336
|
+
if (!Qe) return;
|
|
1317
1337
|
const e = new ResizeObserver((t) => {
|
|
1318
1338
|
for (const n of t)
|
|
1319
|
-
|
|
1339
|
+
Mt(n.contentRect.width);
|
|
1320
1340
|
});
|
|
1321
|
-
return e.observe(
|
|
1322
|
-
}, [
|
|
1323
|
-
if (!(!
|
|
1324
|
-
return
|
|
1325
|
-
const e =
|
|
1341
|
+
return e.observe(Qe), () => e.disconnect();
|
|
1342
|
+
}, [Qe]), ne(() => {
|
|
1343
|
+
if (!(!le || Q <= 0) && !K.current)
|
|
1344
|
+
return xe.current && clearTimeout(xe.current), xe.current = setTimeout(() => {
|
|
1345
|
+
const e = Hn(
|
|
1326
1346
|
Q,
|
|
1327
1347
|
B,
|
|
1328
|
-
|
|
1348
|
+
i,
|
|
1329
1349
|
L
|
|
1330
1350
|
);
|
|
1331
|
-
e && (K.current = !0,
|
|
1351
|
+
e && (K.current = !0, ye(e), requestAnimationFrame(() => {
|
|
1332
1352
|
K.current = !1;
|
|
1333
1353
|
}));
|
|
1334
1354
|
}, 50), () => {
|
|
1335
|
-
|
|
1355
|
+
xe.current && clearTimeout(xe.current);
|
|
1336
1356
|
};
|
|
1337
|
-
}, [
|
|
1338
|
-
if (!(
|
|
1339
|
-
return
|
|
1340
|
-
const e =
|
|
1357
|
+
}, [le, Q, B, i]), ne(() => {
|
|
1358
|
+
if (!(le || Q <= 0))
|
|
1359
|
+
return Ie.current && clearTimeout(Ie.current), Ie.current = setTimeout(() => {
|
|
1360
|
+
const e = jn(
|
|
1341
1361
|
Q,
|
|
1342
1362
|
B,
|
|
1343
|
-
|
|
1363
|
+
i,
|
|
1344
1364
|
L,
|
|
1345
|
-
|
|
1365
|
+
ze
|
|
1346
1366
|
);
|
|
1347
|
-
e && (K.current = !0,
|
|
1367
|
+
e && (K.current = !0, ye((t) => ({ ...t, ...e })), requestAnimationFrame(() => {
|
|
1348
1368
|
K.current = !1;
|
|
1349
1369
|
}));
|
|
1350
1370
|
}, 50), () => {
|
|
1351
|
-
|
|
1371
|
+
Ie.current && clearTimeout(Ie.current);
|
|
1352
1372
|
};
|
|
1353
|
-
}, [
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1373
|
+
}, [le, Q, ze, B, i]);
|
|
1374
|
+
const Fn = Cr($n, W), Mn = Tr(
|
|
1375
|
+
qn,
|
|
1356
1376
|
W
|
|
1357
|
-
),
|
|
1358
|
-
|
|
1377
|
+
), Be = Er(
|
|
1378
|
+
Yn,
|
|
1359
1379
|
W
|
|
1360
|
-
),
|
|
1361
|
-
|
|
1380
|
+
), An = zr(
|
|
1381
|
+
Gn,
|
|
1362
1382
|
W
|
|
1363
|
-
),
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1383
|
+
), Nn = An ? [...pt, An] : pt, dr = Fn ? [Fn, ...Nn] : Nn, ct = [];
|
|
1384
|
+
Mn && ct.push(Mn);
|
|
1385
|
+
const fr = Be ? [...ct, ...gt, Be] : [...ct, ...gt], mr = Be ? [...St, Be] : St, kn = /* @__PURE__ */ lt(
|
|
1386
|
+
br,
|
|
1367
1387
|
{
|
|
1368
1388
|
size: "small",
|
|
1369
|
-
appearance:
|
|
1370
|
-
className:
|
|
1389
|
+
appearance: w,
|
|
1390
|
+
className: Qn,
|
|
1371
1391
|
style: {
|
|
1372
1392
|
backgroundColor: $.colorNeutralBackground1,
|
|
1373
1393
|
maxWidth: "100%",
|
|
1374
1394
|
// margin: "20px 20px",
|
|
1375
1395
|
padding: "0px",
|
|
1376
1396
|
gap: "0px",
|
|
1377
|
-
...
|
|
1397
|
+
...g
|
|
1378
1398
|
},
|
|
1379
1399
|
children: [
|
|
1380
1400
|
Y && /* @__PURE__ */ D(
|
|
1381
|
-
|
|
1401
|
+
Lr,
|
|
1382
1402
|
{
|
|
1383
|
-
tableMethods:
|
|
1384
|
-
alwaysButtons:
|
|
1385
|
-
noSelectionButtons:
|
|
1386
|
-
singleSelectionButtons:
|
|
1387
|
-
|
|
1403
|
+
tableMethods: Ae,
|
|
1404
|
+
alwaysButtons: Pe(dr),
|
|
1405
|
+
noSelectionButtons: Pe(Kn),
|
|
1406
|
+
singleSelectionButtons: Pe(
|
|
1407
|
+
fr
|
|
1388
1408
|
),
|
|
1389
|
-
multiSelectionButtons:
|
|
1390
|
-
|
|
1409
|
+
multiSelectionButtons: Pe(
|
|
1410
|
+
mr
|
|
1391
1411
|
),
|
|
1392
|
-
selectedRows:
|
|
1412
|
+
selectedRows: Ae.getSelectedRows(),
|
|
1393
1413
|
localeText: W
|
|
1394
1414
|
}
|
|
1395
1415
|
),
|
|
1396
1416
|
(() => {
|
|
1397
|
-
const e =
|
|
1417
|
+
const e = ot.getRowModel().rows.length, t = Z.length > 0, n = Le.state !== "none" ? Le : t && e === 0 ? {
|
|
1398
1418
|
state: "empty",
|
|
1399
1419
|
message: W.filteredEmptyTitle,
|
|
1400
1420
|
description: W.filteredEmptyDescription,
|
|
1401
|
-
imageUrl:
|
|
1421
|
+
imageUrl: ae?.empty?.imageUrl
|
|
1402
1422
|
} : X.length === 0 ? {
|
|
1403
1423
|
state: "empty",
|
|
1404
|
-
message:
|
|
1405
|
-
description:
|
|
1406
|
-
imageUrl:
|
|
1407
|
-
} : { state: "none" }, r = /* @__PURE__ */
|
|
1424
|
+
message: ae?.empty?.title,
|
|
1425
|
+
description: ae?.empty?.description,
|
|
1426
|
+
imageUrl: ae?.empty?.imageUrl
|
|
1427
|
+
} : { state: "none" }, r = /* @__PURE__ */ lt(
|
|
1408
1428
|
"div",
|
|
1409
1429
|
{
|
|
1410
|
-
ref:
|
|
1411
|
-
onScroll:
|
|
1412
|
-
className:
|
|
1430
|
+
ref: cr,
|
|
1431
|
+
onScroll: lr,
|
|
1432
|
+
className: Tt["efw-table-scroll-container"],
|
|
1413
1433
|
style: {
|
|
1414
|
-
...
|
|
1415
|
-
maxHeight:
|
|
1434
|
+
...we !== void 0 && {
|
|
1435
|
+
maxHeight: we
|
|
1416
1436
|
},
|
|
1417
|
-
overflowY:
|
|
1437
|
+
overflowY: we !== void 0 ? "auto" : "visible",
|
|
1418
1438
|
overflowX: "auto",
|
|
1419
1439
|
border: `1px solid ${$.colorNeutralStroke2}`,
|
|
1420
1440
|
borderTop: Y ? "none" : `1px solid ${$.colorNeutralStroke2}`,
|
|
1421
1441
|
position: "relative"
|
|
1422
1442
|
},
|
|
1423
1443
|
children: [
|
|
1424
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ lt(
|
|
1425
1445
|
"div",
|
|
1426
1446
|
{
|
|
1427
1447
|
className: "table-container",
|
|
1428
1448
|
style: {
|
|
1429
1449
|
minWidth: "100%",
|
|
1430
|
-
width:
|
|
1450
|
+
width: ir
|
|
1431
1451
|
},
|
|
1432
1452
|
children: [
|
|
1433
1453
|
/* @__PURE__ */ D(
|
|
1434
|
-
|
|
1454
|
+
_r,
|
|
1435
1455
|
{
|
|
1436
|
-
table:
|
|
1437
|
-
gridTemplateColumns:
|
|
1456
|
+
table: ot,
|
|
1457
|
+
gridTemplateColumns: En,
|
|
1438
1458
|
columnSizing: L,
|
|
1439
1459
|
dense: q,
|
|
1440
|
-
stickyColumnsInfo:
|
|
1441
|
-
resizableColumns:
|
|
1460
|
+
stickyColumnsInfo: jt,
|
|
1461
|
+
resizableColumns: Ue,
|
|
1442
1462
|
localeText: W
|
|
1443
1463
|
}
|
|
1444
1464
|
),
|
|
1445
1465
|
/* @__PURE__ */ D(
|
|
1446
|
-
|
|
1466
|
+
Wr,
|
|
1447
1467
|
{
|
|
1448
|
-
table:
|
|
1449
|
-
fields:
|
|
1450
|
-
tableContainerRef:
|
|
1451
|
-
useVirtualization:
|
|
1468
|
+
table: ot,
|
|
1469
|
+
fields: i,
|
|
1470
|
+
tableContainerRef: se,
|
|
1471
|
+
useVirtualization: ut,
|
|
1452
1472
|
enableSelection: I,
|
|
1453
|
-
itemSize:
|
|
1473
|
+
itemSize: Ge,
|
|
1454
1474
|
dense: q,
|
|
1455
|
-
rowAnimationSignals:
|
|
1456
|
-
gridTemplateColumns:
|
|
1475
|
+
rowAnimationSignals: rr,
|
|
1476
|
+
gridTemplateColumns: En,
|
|
1457
1477
|
columnSizing: L,
|
|
1458
|
-
stickyColumnsInfo:
|
|
1459
|
-
onRowClick:
|
|
1460
|
-
onRowDoubleClick:
|
|
1478
|
+
stickyColumnsInfo: jt,
|
|
1479
|
+
onRowClick: ar,
|
|
1480
|
+
onRowDoubleClick: ur
|
|
1461
1481
|
}
|
|
1462
1482
|
)
|
|
1463
1483
|
]
|
|
1464
1484
|
}
|
|
1465
1485
|
),
|
|
1466
|
-
|
|
1486
|
+
Se && /* @__PURE__ */ D(
|
|
1467
1487
|
"div",
|
|
1468
1488
|
{
|
|
1469
1489
|
style: {
|
|
1470
|
-
height:
|
|
1471
|
-
minHeight:
|
|
1490
|
+
height: Ge,
|
|
1491
|
+
minHeight: Ge,
|
|
1472
1492
|
display: "flex",
|
|
1473
1493
|
alignItems: "center",
|
|
1474
1494
|
justifyContent: "center",
|
|
@@ -1484,7 +1504,7 @@ const ls = ({
|
|
|
1484
1504
|
"aria-live": "polite",
|
|
1485
1505
|
"aria-label": W.loadingMoreAriaLabel,
|
|
1486
1506
|
children: /* @__PURE__ */ D(
|
|
1487
|
-
|
|
1507
|
+
yr,
|
|
1488
1508
|
{
|
|
1489
1509
|
size: "tiny",
|
|
1490
1510
|
label: W.loadingMoreSpinnerLabel
|
|
@@ -1496,20 +1516,20 @@ const ls = ({
|
|
|
1496
1516
|
}
|
|
1497
1517
|
);
|
|
1498
1518
|
return n.state === "partial-loading" ? /* @__PURE__ */ D(
|
|
1499
|
-
|
|
1519
|
+
Bn,
|
|
1500
1520
|
{
|
|
1501
1521
|
config: n,
|
|
1502
|
-
customization:
|
|
1503
|
-
height:
|
|
1522
|
+
customization: ae,
|
|
1523
|
+
height: we !== void 0 ? Math.max(Ye, we) : Ye,
|
|
1504
1524
|
localeText: W,
|
|
1505
1525
|
children: r
|
|
1506
1526
|
}
|
|
1507
1527
|
) : n.state !== "none" ? /* @__PURE__ */ D(
|
|
1508
|
-
|
|
1528
|
+
Bn,
|
|
1509
1529
|
{
|
|
1510
1530
|
config: n,
|
|
1511
|
-
height:
|
|
1512
|
-
customization:
|
|
1531
|
+
height: Ye,
|
|
1532
|
+
customization: ae,
|
|
1513
1533
|
localeText: W
|
|
1514
1534
|
}
|
|
1515
1535
|
) : r;
|
|
@@ -1517,10 +1537,10 @@ const ls = ({
|
|
|
1517
1537
|
]
|
|
1518
1538
|
}
|
|
1519
1539
|
);
|
|
1520
|
-
return
|
|
1540
|
+
return vt ? /* @__PURE__ */ D(kr, { localeText: vt, children: kn }) : kn;
|
|
1521
1541
|
};
|
|
1522
1542
|
export {
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1543
|
+
je as COLS_MAX_WIDTH,
|
|
1544
|
+
ge as COLS_MIN_WIDTH,
|
|
1545
|
+
ds as EFWTable
|
|
1526
1546
|
};
|