@envisiongroup/porygon 1.0.0-rc.2 → 1.0.0-rc.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 +23 -20
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.js +28 -28
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.js +44 -44
- package/dist/react-components/tables/EFWTable/EFWTable.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/EFWTable.js +405 -344
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +59 -3
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +14 -13
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.d.ts +15 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js +253 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.types.d.ts +102 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/index.js +5 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +78 -64
- package/dist/react-components/tables/EFWTable/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/index.js +7 -4
- package/dist/react-components/tables/EFWTable/utils/cache.js +19 -19
- package/package.json +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.d.ts +0 -3
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.js +0 -66
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.types.d.ts +0 -16
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/index.d.ts +0 -2
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/index.js +0 -4
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController copy.d.ts +0 -4
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController copy.js +0 -178
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as v, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef 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 { generateId as
|
|
12
|
-
import { EFWTableCommandBar as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
1
|
+
import { jsx as v, jsxs as et } from "react/jsx-runtime";
|
|
2
|
+
import * as kt from "react";
|
|
3
|
+
import { useRef as L, useState as D, useCallback as w, useEffect as A, useMemo as H } from "react";
|
|
4
|
+
import { useReactTable as Tt, getSortedRowModel as At, getFilteredRowModel as Bt, getCoreRowModel as Ft } from "@tanstack/react-table";
|
|
5
|
+
import { makeStyles as Ot, tokens as ee, mergeClasses as Lt, Checkbox as tt, Card as Dt } from "@fluentui/react-components";
|
|
6
|
+
import { useTableSelection as Ht } from "./hooks/useTableSelection/useTableSelection.js";
|
|
7
|
+
import { renderCellContent as jt } from "./utils/index.js";
|
|
8
|
+
import { useDefaultAddButton as Pt } from "./hooks/useDefaultAddButton/useDefaultAddButton.js";
|
|
9
|
+
import { useDefaultUpdateButton as Yt } from "./hooks/useDefaultUpdateButton/useDefaultUpdateButton.js";
|
|
10
|
+
import { useDefaultDeleteButton as $t } from "./hooks/useDefaultDeleteButton/useDefaultDeleteButton.js";
|
|
11
|
+
import { generateId as M } from "./utils/general.js";
|
|
12
|
+
import { EFWTableCommandBar as qt } from "./components/EFWTableCommandBar/EFWTableCommandBar.js";
|
|
13
|
+
import { EFWTableOverlay as nt } from "./components/EFWTableOverlay/EFWTableOverlay.js";
|
|
14
|
+
import { EFWTableHeader as Gt } from "./components/EFWTableHeader/EFWTableHeader.js";
|
|
15
|
+
import { EFWTableBody as Xt } from "./components/EFWTableBody/EFWTableBody.js";
|
|
16
|
+
const Z = {}, Jt = /* @__PURE__ */ new Set(), st = [], Q = [], I = 120, B = 80, U = 2500, j = 48, fn = 48, Kt = Ot({
|
|
17
17
|
"efw-table": {},
|
|
18
18
|
/* Transición suave para el box-shadow en las celdas y cabeceras fijas */
|
|
19
19
|
"efw-table-scroll-container": {
|
|
@@ -23,7 +23,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
23
23
|
transform: "translateZ(0)"
|
|
24
24
|
},
|
|
25
25
|
"& .table-header": {
|
|
26
|
-
boxShadow: `0px 1px 0 0px ${
|
|
26
|
+
boxShadow: `0px 1px 0 0px ${ee.colorNeutralStroke2}`
|
|
27
27
|
},
|
|
28
28
|
"& .header-cell": {
|
|
29
29
|
"&.sticky-column": {
|
|
@@ -57,90 +57,97 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
61
|
-
appearance:
|
|
62
|
-
style:
|
|
63
|
-
className:
|
|
60
|
+
}), hn = ({
|
|
61
|
+
appearance: rt = "outline",
|
|
62
|
+
style: ct = {},
|
|
63
|
+
className: it = "",
|
|
64
64
|
fields: f,
|
|
65
|
-
items:
|
|
66
|
-
defaultItems:
|
|
67
|
-
height:
|
|
68
|
-
itemSize:
|
|
65
|
+
items: oe,
|
|
66
|
+
defaultItems: ot,
|
|
67
|
+
height: te = 700,
|
|
68
|
+
itemSize: at = 32,
|
|
69
69
|
// tableStyle = 'row',
|
|
70
|
-
enableSelection:
|
|
71
|
-
enableCommandBar:
|
|
72
|
-
defaultSelectedItems:
|
|
73
|
-
onSelectionChange:
|
|
74
|
-
onRowClick:
|
|
75
|
-
resizableColumns:
|
|
76
|
-
columnSizing: z =
|
|
77
|
-
useVirtualization:
|
|
78
|
-
autoSizeColumns:
|
|
79
|
-
tableRef:
|
|
80
|
-
onItemsChange:
|
|
81
|
-
onScroll:
|
|
82
|
-
addButtonConfig:
|
|
83
|
-
updateButtonConfig:
|
|
84
|
-
deleteButtonConfig:
|
|
85
|
-
alwaysButtons:
|
|
86
|
-
noSelectionButtons:
|
|
87
|
-
singleSelectionButtons:
|
|
88
|
-
multiSelectionButtons:
|
|
89
|
-
beforeAddItems:
|
|
90
|
-
beforeUpdateItems:
|
|
91
|
-
beforeDeleteItems:
|
|
92
|
-
columnRenderers:
|
|
93
|
-
useDefaultRendererAsFallback:
|
|
70
|
+
enableSelection: b = !0,
|
|
71
|
+
enableCommandBar: ne = !0,
|
|
72
|
+
defaultSelectedItems: lt = Jt,
|
|
73
|
+
onSelectionChange: ut,
|
|
74
|
+
onRowClick: se,
|
|
75
|
+
resizableColumns: re = !1,
|
|
76
|
+
columnSizing: z = Z,
|
|
77
|
+
useVirtualization: dt = !1,
|
|
78
|
+
autoSizeColumns: W = !1,
|
|
79
|
+
tableRef: ft,
|
|
80
|
+
onItemsChange: ae,
|
|
81
|
+
onScroll: le,
|
|
82
|
+
addButtonConfig: ht = Z,
|
|
83
|
+
updateButtonConfig: mt = Z,
|
|
84
|
+
deleteButtonConfig: pt = Z,
|
|
85
|
+
alwaysButtons: ue = Q,
|
|
86
|
+
noSelectionButtons: gt = Q,
|
|
87
|
+
singleSelectionButtons: St = Q,
|
|
88
|
+
multiSelectionButtons: de = Q,
|
|
89
|
+
beforeAddItems: P,
|
|
90
|
+
beforeUpdateItems: Y,
|
|
91
|
+
beforeDeleteItems: $,
|
|
92
|
+
columnRenderers: fe,
|
|
93
|
+
useDefaultRendererAsFallback: he = !0,
|
|
94
|
+
// Overlay state props
|
|
95
|
+
overlayState: me,
|
|
96
|
+
defaultOverlayState: wt,
|
|
97
|
+
onOverlayStateChange: _,
|
|
98
|
+
overlayCustomization: F
|
|
94
99
|
}) => {
|
|
95
|
-
const
|
|
100
|
+
const pe = Kt(), It = Lt(it, pe["efw-table"]), C = L(!1), ge = oe !== void 0, E = me !== void 0, [xt, q] = D(
|
|
101
|
+
() => wt || { state: "none" }
|
|
102
|
+
), G = E ? me : xt, [yt, bt] = D(() => (ot || st).map((t) => ({
|
|
96
103
|
...t,
|
|
97
|
-
|
|
98
|
-
}))),
|
|
104
|
+
_rowId: t._rowId || M()
|
|
105
|
+
}))), R = ge ? oe || st : yt, [S, X] = D(() => {
|
|
99
106
|
const e = {};
|
|
100
107
|
return f.forEach((t) => {
|
|
101
108
|
const n = z[t.internalName];
|
|
102
109
|
if (n?.width) {
|
|
103
|
-
const s = n.minWidth ??
|
|
110
|
+
const s = n.minWidth ?? B, r = n.maxWidth ?? U;
|
|
104
111
|
e[t.internalName] = Math.min(Math.max(n.width ?? 0, s), r);
|
|
105
112
|
}
|
|
106
113
|
}), e;
|
|
107
|
-
}),
|
|
108
|
-
rowSelection:
|
|
109
|
-
setRowSelection:
|
|
114
|
+
}), Se = L(z), [N, we] = D(0), {
|
|
115
|
+
rowSelection: k,
|
|
116
|
+
setRowSelection: Ie,
|
|
110
117
|
// selectedIndexes,
|
|
111
|
-
deselectAll:
|
|
112
|
-
selectSingle:
|
|
113
|
-
toggleMultiple:
|
|
118
|
+
deselectAll: xe,
|
|
119
|
+
selectSingle: ye,
|
|
120
|
+
toggleMultiple: zt,
|
|
114
121
|
// selectMultiple,
|
|
115
|
-
getSelectedItems:
|
|
116
|
-
getSelectedRows:
|
|
117
|
-
} =
|
|
118
|
-
initialSelection:
|
|
119
|
-
onSelectionChange:
|
|
120
|
-
enableSelection:
|
|
121
|
-
}),
|
|
122
|
-
|
|
123
|
-
}, []), p =
|
|
124
|
-
|
|
125
|
-
p.current =
|
|
126
|
-
}, [
|
|
127
|
-
const
|
|
122
|
+
getSelectedItems: be,
|
|
123
|
+
getSelectedRows: ze
|
|
124
|
+
} = Ht({
|
|
125
|
+
initialSelection: lt,
|
|
126
|
+
onSelectionChange: ut,
|
|
127
|
+
enableSelection: b
|
|
128
|
+
}), Ee = L(null), [J, Et] = D(null), _t = w((e) => {
|
|
129
|
+
Ee.current = e, Et(e);
|
|
130
|
+
}, []), p = L(R);
|
|
131
|
+
A(() => {
|
|
132
|
+
p.current = R;
|
|
133
|
+
}, [R]);
|
|
134
|
+
const ce = L(/* @__PURE__ */ new Set()), _e = H(() => {
|
|
128
135
|
const e = [], t = {};
|
|
129
136
|
let n = 0;
|
|
130
|
-
return
|
|
137
|
+
return b && (e.push("select"), t.select = n, n += j), f.forEach((s) => {
|
|
131
138
|
const r = z[s.internalName] || {};
|
|
132
139
|
if (!r.hidden && r.sticky) {
|
|
133
140
|
e.push(s.internalName), t[s.internalName] = n;
|
|
134
|
-
const
|
|
135
|
-
n +=
|
|
141
|
+
const c = S[s.internalName] || r.width || I;
|
|
142
|
+
n += c;
|
|
136
143
|
}
|
|
137
144
|
}), { stickyColumns: e, stickyPositions: t };
|
|
138
|
-
}, [f,
|
|
145
|
+
}, [f, b, z, S]), x = H(() => {
|
|
139
146
|
const e = [];
|
|
140
|
-
return
|
|
147
|
+
return b && e.push({
|
|
141
148
|
id: "select",
|
|
142
149
|
header: ({ table: t }) => /* @__PURE__ */ v(
|
|
143
|
-
|
|
150
|
+
tt,
|
|
144
151
|
{
|
|
145
152
|
shape: "circular",
|
|
146
153
|
checked: t.getIsAllRowsSelected(),
|
|
@@ -149,117 +156,117 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
149
156
|
}
|
|
150
157
|
),
|
|
151
158
|
cell: ({ row: t }) => /* @__PURE__ */ v(
|
|
152
|
-
|
|
159
|
+
tt,
|
|
153
160
|
{
|
|
154
161
|
shape: "circular",
|
|
155
162
|
checked: t.getIsSelected(),
|
|
156
163
|
onChange: (n) => {
|
|
157
|
-
n.stopPropagation(),
|
|
164
|
+
n.stopPropagation(), zt(t.index);
|
|
158
165
|
},
|
|
159
166
|
onClick: (n) => n.stopPropagation(),
|
|
160
167
|
"data-checkbox": "true"
|
|
161
168
|
}
|
|
162
169
|
),
|
|
163
|
-
size:
|
|
164
|
-
minSize:
|
|
165
|
-
maxSize:
|
|
170
|
+
size: j,
|
|
171
|
+
minSize: j,
|
|
172
|
+
maxSize: j,
|
|
166
173
|
enableResizing: !1
|
|
167
174
|
}), f.forEach((t) => {
|
|
168
175
|
const n = z[t.internalName] || {};
|
|
169
176
|
if (n.hidden)
|
|
170
177
|
return;
|
|
171
|
-
const s = t.typeAsString === "Note" ?
|
|
178
|
+
const s = t.typeAsString === "Note" ? I * 2 : I, r = n.width || s, c = n.minWidth || B, a = n.maxWidth || U;
|
|
172
179
|
e.push({
|
|
173
180
|
id: t.internalName,
|
|
174
181
|
accessorKey: t.internalName,
|
|
175
182
|
header: t.title || t.internalName,
|
|
176
|
-
cell: ({ row:
|
|
183
|
+
cell: ({ row: i }) => jt(
|
|
177
184
|
t,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
i.original[t.internalName],
|
|
186
|
+
i.original,
|
|
187
|
+
i.index,
|
|
188
|
+
fe,
|
|
189
|
+
he
|
|
183
190
|
),
|
|
184
|
-
size: Math.min(Math.max(r,
|
|
185
|
-
minSize:
|
|
191
|
+
size: Math.min(Math.max(r, c), a),
|
|
192
|
+
minSize: c,
|
|
186
193
|
maxSize: a,
|
|
187
|
-
enableResizing:
|
|
194
|
+
enableResizing: re
|
|
188
195
|
});
|
|
189
196
|
}), e;
|
|
190
197
|
}, [
|
|
191
198
|
f,
|
|
192
|
-
|
|
193
|
-
|
|
199
|
+
b,
|
|
200
|
+
re,
|
|
194
201
|
z,
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
fe,
|
|
203
|
+
he
|
|
197
204
|
]);
|
|
198
|
-
|
|
199
|
-
const e =
|
|
200
|
-
|
|
205
|
+
A(() => {
|
|
206
|
+
const e = Se.current;
|
|
207
|
+
X((t) => {
|
|
201
208
|
let n = !1;
|
|
202
|
-
const s = { ...t }, r = new Set(f.map((
|
|
203
|
-
return Object.keys(s).forEach((
|
|
204
|
-
r.has(
|
|
205
|
-
}), f.forEach((
|
|
206
|
-
const a =
|
|
207
|
-
if (
|
|
208
|
-
const u =
|
|
209
|
+
const s = { ...t }, r = new Set(f.map((c) => c.internalName));
|
|
210
|
+
return Object.keys(s).forEach((c) => {
|
|
211
|
+
r.has(c) || (delete s[c], n = !0);
|
|
212
|
+
}), f.forEach((c) => {
|
|
213
|
+
const a = c.internalName, i = z[a], o = e[a];
|
|
214
|
+
if (i?.width !== void 0) {
|
|
215
|
+
const u = i.minWidth ?? B, h = i.maxWidth ?? U, d = Math.min(Math.max(i.width, u), h);
|
|
209
216
|
s[a] !== d && (s[a] = d, n = !0);
|
|
210
217
|
} else o?.width !== void 0 && s[a] !== void 0 && (delete s[a], n = !0);
|
|
211
218
|
}), n ? s : t;
|
|
212
|
-
}),
|
|
219
|
+
}), Se.current = z;
|
|
213
220
|
}, [z, f]);
|
|
214
|
-
const
|
|
215
|
-
const s = f.find((
|
|
221
|
+
const K = H(() => x.reduce((e, t) => {
|
|
222
|
+
const s = f.find((c) => c.internalName === t.id)?.typeAsString === "Note" ? I * 2 : I, r = S[t.id] || (typeof t.size == "number" ? t.size : s);
|
|
216
223
|
return e + r;
|
|
217
|
-
}, 0), [
|
|
218
|
-
data:
|
|
219
|
-
columns:
|
|
224
|
+
}, 0), [x, S, f]), Re = Tt({
|
|
225
|
+
data: R,
|
|
226
|
+
columns: x,
|
|
220
227
|
state: {
|
|
221
|
-
rowSelection:
|
|
228
|
+
rowSelection: k,
|
|
222
229
|
columnSizing: S
|
|
223
230
|
},
|
|
224
|
-
onRowSelectionChange:
|
|
231
|
+
onRowSelectionChange: Ie,
|
|
225
232
|
onColumnSizingChange: (e) => {
|
|
226
|
-
|
|
233
|
+
X((t) => {
|
|
227
234
|
const n = typeof e == "function" ? e(t) : e, s = {};
|
|
228
235
|
return Object.keys(n).forEach((r) => {
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
const a =
|
|
232
|
-
|
|
236
|
+
const c = x.find((a) => a.id === r);
|
|
237
|
+
if (c) {
|
|
238
|
+
const a = c.minSize || B, i = c.maxSize || U;
|
|
239
|
+
C.current ? s[r] = Math.max(n[r], a) : s[r] = Math.min(Math.max(n[r], a), i);
|
|
233
240
|
}
|
|
234
241
|
}), { ...t, ...s };
|
|
235
242
|
});
|
|
236
243
|
},
|
|
237
244
|
//getRowId: row => row.id as string,
|
|
238
|
-
getCoreRowModel:
|
|
239
|
-
getFilteredRowModel:
|
|
240
|
-
getSortedRowModel:
|
|
245
|
+
getCoreRowModel: Ft(),
|
|
246
|
+
getFilteredRowModel: Bt(),
|
|
247
|
+
getSortedRowModel: At(),
|
|
241
248
|
columnResizeMode: "onChange",
|
|
242
249
|
enableRowSelection: !0,
|
|
243
|
-
enableMultiRowSelection:
|
|
250
|
+
enableMultiRowSelection: b
|
|
244
251
|
});
|
|
245
|
-
|
|
252
|
+
A(() => {
|
|
246
253
|
const e = /* @__PURE__ */ new Set();
|
|
247
|
-
Object.keys(
|
|
248
|
-
if (
|
|
254
|
+
Object.keys(k).forEach((t) => {
|
|
255
|
+
if (k[t]) {
|
|
249
256
|
const n = parseInt(t), s = p.current[n];
|
|
250
|
-
s?.
|
|
257
|
+
s?._rowId && e.add(s._rowId);
|
|
251
258
|
}
|
|
252
|
-
}),
|
|
253
|
-
}, [
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
}, [
|
|
259
|
+
}), ce.current = e;
|
|
260
|
+
}, [k]);
|
|
261
|
+
const Rt = w((e) => {
|
|
262
|
+
le?.(e);
|
|
263
|
+
}, [le]), ve = (e) => {
|
|
257
264
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
258
|
-
return Object.keys(
|
|
259
|
-
if (!
|
|
265
|
+
return Object.keys(k).forEach((r) => {
|
|
266
|
+
if (!k[r])
|
|
260
267
|
return;
|
|
261
|
-
const
|
|
262
|
-
a && (s.add(
|
|
268
|
+
const c = Number(r), a = e[c];
|
|
269
|
+
a && (s.add(c), a._rowId && t.add(a._rowId), n.add(a));
|
|
263
270
|
}), {
|
|
264
271
|
hasSelection: t.size > 0 || n.size > 0 || s.size > 0,
|
|
265
272
|
selectedIds: t,
|
|
@@ -267,39 +274,39 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
267
274
|
selectedIndexes: s,
|
|
268
275
|
sourceLength: e.length
|
|
269
276
|
};
|
|
270
|
-
},
|
|
277
|
+
}, Me = (e, t) => {
|
|
271
278
|
if (!t.hasSelection)
|
|
272
279
|
return;
|
|
273
280
|
const n = t.sourceLength !== e.length, s = {};
|
|
274
|
-
e.forEach((r,
|
|
281
|
+
e.forEach((r, c) => {
|
|
275
282
|
if (!r)
|
|
276
283
|
return;
|
|
277
|
-
const a = r.
|
|
278
|
-
(a ||
|
|
279
|
-
}),
|
|
284
|
+
const a = r._rowId ? t.selectedIds.has(r._rowId) : !1, i = t.selectedRefs.has(r), o = !r._rowId && !n && t.selectedIndexes.has(c);
|
|
285
|
+
(a || i || o) && (s[c.toString()] = !0);
|
|
286
|
+
}), Ie(s);
|
|
280
287
|
}, g = (e) => {
|
|
281
|
-
if (
|
|
282
|
-
const t =
|
|
288
|
+
if (ge) {
|
|
289
|
+
const t = R, n = typeof e == "function" ? e(t) : e;
|
|
283
290
|
p.current = n;
|
|
284
|
-
const s =
|
|
285
|
-
|
|
291
|
+
const s = ve(t);
|
|
292
|
+
ce.current = s.selectedIds, Me(n, s), ae?.(n);
|
|
286
293
|
return;
|
|
287
294
|
}
|
|
288
|
-
|
|
295
|
+
bt((t) => {
|
|
289
296
|
const n = typeof e == "function" ? e(t) : e;
|
|
290
297
|
p.current = n;
|
|
291
|
-
const s =
|
|
292
|
-
return
|
|
298
|
+
const s = ve(t);
|
|
299
|
+
return ce.current = s.selectedIds, Me(n, s), ae?.(n), n;
|
|
293
300
|
});
|
|
294
|
-
},
|
|
301
|
+
}, Ne = w(() => f, [f]), We = async (e) => {
|
|
295
302
|
try {
|
|
296
|
-
if (
|
|
297
|
-
const t = {
|
|
303
|
+
if (P) {
|
|
304
|
+
const t = { _rowId: M(), ...e }, n = await P([t], y);
|
|
298
305
|
if (n) {
|
|
299
306
|
if (n.successful.length > 0) {
|
|
300
307
|
const s = n.successful.map((r) => {
|
|
301
|
-
const
|
|
302
|
-
return
|
|
308
|
+
const c = r.item;
|
|
309
|
+
return c._rowId ? c : { ...c, _rowId: M() };
|
|
303
310
|
});
|
|
304
311
|
g((r) => [...s, ...r]);
|
|
305
312
|
}
|
|
@@ -310,7 +317,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
310
317
|
failed: []
|
|
311
318
|
};
|
|
312
319
|
} else {
|
|
313
|
-
const t = {
|
|
320
|
+
const t = { _rowId: M(), ...e };
|
|
314
321
|
return g((n) => [t, ...n]), {
|
|
315
322
|
successful: [{ index: 0, item: t }],
|
|
316
323
|
failed: []
|
|
@@ -329,16 +336,16 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
329
336
|
failed: []
|
|
330
337
|
};
|
|
331
338
|
try {
|
|
332
|
-
if (
|
|
339
|
+
if (P) {
|
|
333
340
|
const t = e.map((s) => ({
|
|
334
|
-
|
|
341
|
+
_rowId: M(),
|
|
335
342
|
...s
|
|
336
|
-
})), n = await
|
|
343
|
+
})), n = await P(t, y);
|
|
337
344
|
if (n) {
|
|
338
345
|
if (n.successful.length > 0) {
|
|
339
346
|
const s = n.successful.map((r) => {
|
|
340
|
-
const
|
|
341
|
-
return
|
|
347
|
+
const c = r.item;
|
|
348
|
+
return c._rowId ? c : { ...c, _rowId: M() };
|
|
342
349
|
});
|
|
343
350
|
g((r) => [...s, ...r]);
|
|
344
351
|
}
|
|
@@ -350,7 +357,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
350
357
|
};
|
|
351
358
|
} else {
|
|
352
359
|
const t = e.map((n) => ({
|
|
353
|
-
|
|
360
|
+
_rowId: M(),
|
|
354
361
|
...n
|
|
355
362
|
}));
|
|
356
363
|
return g((n) => [...t, ...n]), {
|
|
@@ -368,7 +375,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
368
375
|
}))
|
|
369
376
|
};
|
|
370
377
|
}
|
|
371
|
-
},
|
|
378
|
+
}, ke = async (e, t) => {
|
|
372
379
|
const n = p.current;
|
|
373
380
|
if (e < 0 || e >= n.length)
|
|
374
381
|
return {
|
|
@@ -376,19 +383,19 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
376
383
|
failed: [{ index: e, item: t, error: "Invalid index" }]
|
|
377
384
|
};
|
|
378
385
|
try {
|
|
379
|
-
if (
|
|
380
|
-
const r = await
|
|
386
|
+
if (Y) {
|
|
387
|
+
const r = await Y([{ index: e, item: t }], y);
|
|
381
388
|
if (r)
|
|
382
|
-
return r.successful.length && g((
|
|
383
|
-
const a = [...
|
|
384
|
-
return r.successful.forEach(({ index:
|
|
389
|
+
return r.successful.length && g((c) => {
|
|
390
|
+
const a = [...c];
|
|
391
|
+
return r.successful.forEach(({ index: i, item: o }) => a[i] = o), a;
|
|
385
392
|
}), r;
|
|
386
393
|
}
|
|
387
394
|
let s;
|
|
388
395
|
return g((r) => {
|
|
389
396
|
s = { ...r[e], ...t };
|
|
390
|
-
const
|
|
391
|
-
return
|
|
397
|
+
const c = [...r];
|
|
398
|
+
return c[e] = s, c;
|
|
392
399
|
}), { successful: [{ index: e, item: s }], failed: [] };
|
|
393
400
|
} catch (s) {
|
|
394
401
|
return {
|
|
@@ -396,44 +403,44 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
396
403
|
failed: [{ index: e, item: t, error: String(s) }]
|
|
397
404
|
};
|
|
398
405
|
}
|
|
399
|
-
},
|
|
406
|
+
}, Te = async (e) => {
|
|
400
407
|
if (!e.length) return { successful: [], failed: [] };
|
|
401
|
-
const t = p.current, n = (
|
|
408
|
+
const t = p.current, n = (c) => c >= 0 && c < t.length, s = e.filter(({ index: c }) => !n(c)).map(({ index: c, item: a }) => ({ index: c, item: a, error: "Invalid index" })), r = e.filter(({ index: c }) => n(c));
|
|
402
409
|
try {
|
|
403
|
-
if (
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
const o =
|
|
410
|
+
if (Y) {
|
|
411
|
+
const i = await Y(e, y);
|
|
412
|
+
if (i) {
|
|
413
|
+
const o = i.successful.filter(({ index: l }) => n(l));
|
|
407
414
|
o.length && g((l) => {
|
|
408
|
-
const
|
|
409
|
-
return o.forEach(({ index: m, item:
|
|
415
|
+
const T = [...l];
|
|
416
|
+
return o.forEach(({ index: m, item: O }) => T[m] = O), T;
|
|
410
417
|
});
|
|
411
|
-
const u = new Set(
|
|
418
|
+
const u = new Set(i.failed.map((l) => l.index)), h = [...i.failed];
|
|
412
419
|
return s.forEach((l) => {
|
|
413
420
|
u.has(l.index) || h.push(l);
|
|
414
|
-
}),
|
|
421
|
+
}), i.successful.filter(({ index: l }) => !n(l)).map(({ index: l, item: T }) => ({ index: l, item: T, error: "Invalid index" })).forEach((l) => {
|
|
415
422
|
u.has(l.index) || h.push(l);
|
|
416
423
|
}), { successful: o, failed: h };
|
|
417
424
|
}
|
|
418
425
|
}
|
|
419
|
-
const
|
|
420
|
-
return g((
|
|
421
|
-
const o = [...
|
|
426
|
+
const c = [], a = [...s];
|
|
427
|
+
return g((i) => {
|
|
428
|
+
const o = [...i];
|
|
422
429
|
return r.forEach(({ index: u, item: h }) => {
|
|
423
|
-
o[u] = { ...o[u], ...h },
|
|
430
|
+
o[u] = { ...o[u], ...h }, c.push({ index: u, item: o[u] });
|
|
424
431
|
}), o;
|
|
425
|
-
}), { successful:
|
|
426
|
-
} catch (
|
|
432
|
+
}), { successful: c, failed: a };
|
|
433
|
+
} catch (c) {
|
|
427
434
|
return {
|
|
428
435
|
successful: [],
|
|
429
|
-
failed: e.map(({ index: a, item:
|
|
436
|
+
failed: e.map(({ index: a, item: i }) => ({
|
|
430
437
|
index: a,
|
|
431
|
-
item:
|
|
432
|
-
error: String(
|
|
438
|
+
item: i,
|
|
439
|
+
error: String(c)
|
|
433
440
|
}))
|
|
434
441
|
};
|
|
435
442
|
}
|
|
436
|
-
},
|
|
443
|
+
}, Ae = async (e) => {
|
|
437
444
|
const t = p.current;
|
|
438
445
|
if (e < 0 || e >= t.length)
|
|
439
446
|
return {
|
|
@@ -441,33 +448,33 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
441
448
|
failed: [{ index: e, error: "Invalid index" }]
|
|
442
449
|
};
|
|
443
450
|
try {
|
|
444
|
-
if (
|
|
445
|
-
const s =
|
|
451
|
+
if ($) {
|
|
452
|
+
const s = R[e], r = await $([{ index: e, item: s }], y);
|
|
446
453
|
if (r)
|
|
447
|
-
return r.successful.length && g((
|
|
454
|
+
return r.successful.length && g((c) => c.filter((a, i) => i !== e)), r;
|
|
448
455
|
}
|
|
449
456
|
let n;
|
|
450
|
-
return g((s) => (n = s[e], s.filter((r,
|
|
457
|
+
return g((s) => (n = s[e], s.filter((r, c) => c !== e))), { successful: [{ index: e, item: n }], failed: [] };
|
|
451
458
|
} catch (n) {
|
|
452
459
|
return {
|
|
453
460
|
successful: [],
|
|
454
461
|
failed: [{ index: e, error: String(n) }]
|
|
455
462
|
};
|
|
456
463
|
}
|
|
457
|
-
},
|
|
464
|
+
}, Be = async (e) => {
|
|
458
465
|
if (!e.length) return { successful: [], failed: [] };
|
|
459
466
|
const t = p.current, n = Array.from(new Set(e)), { validIndexes: s, invalidFailures: r } = n.reduce(
|
|
460
|
-
(
|
|
467
|
+
(i, o) => (o >= 0 && o < t.length ? i.validIndexes.push(o) : i.invalidFailures.push({ index: o, error: "Invalid index" }), i),
|
|
461
468
|
{ validIndexes: [], invalidFailures: [] }
|
|
462
|
-
),
|
|
469
|
+
), c = n.map((i) => ({ index: i, item: R[i] })), a = new Set(s);
|
|
463
470
|
try {
|
|
464
|
-
if (
|
|
465
|
-
const u = await
|
|
471
|
+
if ($) {
|
|
472
|
+
const u = await $(c, y);
|
|
466
473
|
if (u) {
|
|
467
474
|
const h = u.successful.filter(({ index: m }) => a.has(m));
|
|
468
475
|
if (h.length) {
|
|
469
|
-
const m = new Set(h.map((
|
|
470
|
-
g((
|
|
476
|
+
const m = new Set(h.map((O) => O.index));
|
|
477
|
+
g((O) => O.filter((Vt, Ct) => !m.has(Ct)));
|
|
471
478
|
}
|
|
472
479
|
const d = new Set(u.failed.map((m) => m.index)), l = [...u.failed];
|
|
473
480
|
return r.forEach((m) => {
|
|
@@ -477,204 +484,258 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
|
|
|
477
484
|
}), { successful: h, failed: l };
|
|
478
485
|
}
|
|
479
486
|
}
|
|
480
|
-
const
|
|
487
|
+
const i = new Set(s), o = [];
|
|
481
488
|
return g((u) => {
|
|
482
489
|
const h = [];
|
|
483
490
|
return u.forEach((d, l) => {
|
|
484
|
-
|
|
491
|
+
i.has(l) ? o.push({ index: l, item: d }) : h.push(d);
|
|
485
492
|
}), h;
|
|
486
493
|
}), { successful: o, failed: r };
|
|
487
|
-
} catch (
|
|
494
|
+
} catch (i) {
|
|
488
495
|
return {
|
|
489
496
|
successful: [],
|
|
490
|
-
failed: n.map((o) => ({ index: o, error: String(
|
|
497
|
+
failed: n.map((o) => ({ index: o, error: String(i) }))
|
|
491
498
|
};
|
|
492
499
|
}
|
|
493
|
-
},
|
|
500
|
+
}, Fe = w((e) => p.current.find((t) => t._rowId === e), []), Oe = (e) => p.current[e], Le = (e) => {
|
|
494
501
|
g(
|
|
495
|
-
e.map((t) => ({ ...t,
|
|
502
|
+
e.map((t) => ({ ...t, _rowId: t._rowId ?? M() }))
|
|
496
503
|
);
|
|
497
|
-
},
|
|
504
|
+
}, De = () => {
|
|
498
505
|
g([]);
|
|
499
|
-
},
|
|
500
|
-
|
|
501
|
-
|
|
506
|
+
}, He = (e) => p.current.findIndex((t) => t._rowId === e), je = (e) => p.current.some((t) => t._rowId === e), Pe = () => p.current.length, Ye = () => [...p.current], $e = w(() => be(p.current), [be]), qe = w(() => ze(p.current), [ze]), Ge = w((e) => {
|
|
507
|
+
const t = {
|
|
508
|
+
state: "loading",
|
|
509
|
+
message: e
|
|
510
|
+
};
|
|
511
|
+
E || q(t), _?.(t);
|
|
512
|
+
}, [E, _]), Xe = w((e, t) => {
|
|
513
|
+
const n = {
|
|
514
|
+
state: "error",
|
|
515
|
+
message: e,
|
|
516
|
+
onRetry: t
|
|
517
|
+
};
|
|
518
|
+
E || q(n), _?.(n);
|
|
519
|
+
}, [E, _]), Je = w((e) => {
|
|
520
|
+
const t = {
|
|
521
|
+
state: e ? "partial-loading" : "none"
|
|
522
|
+
};
|
|
523
|
+
E || q(t), _?.(t);
|
|
524
|
+
}, [E, _]), Ke = w(() => {
|
|
525
|
+
const e = { state: "none" };
|
|
526
|
+
E || q(e), _?.(e);
|
|
527
|
+
}, [E, _]), Ve = w(() => G.state, [G.state]), y = H(() => ({
|
|
528
|
+
getFields: Ne,
|
|
529
|
+
addItem: We,
|
|
502
530
|
addItems: Ce,
|
|
503
|
-
updateItem:
|
|
504
|
-
updateItems:
|
|
505
|
-
deleteItem:
|
|
506
|
-
deleteItems:
|
|
507
|
-
getItem:
|
|
508
|
-
getItemByIndex:
|
|
509
|
-
getItems:
|
|
510
|
-
getItemsCount:
|
|
511
|
-
itemExists:
|
|
512
|
-
getItemIndex:
|
|
513
|
-
replaceAllItems:
|
|
514
|
-
clearItems:
|
|
515
|
-
deselectAllRows:
|
|
516
|
-
getSelectedItems:
|
|
517
|
-
getSelectedRows:
|
|
531
|
+
updateItem: ke,
|
|
532
|
+
updateItems: Te,
|
|
533
|
+
deleteItem: Ae,
|
|
534
|
+
deleteItems: Be,
|
|
535
|
+
getItem: Fe,
|
|
536
|
+
getItemByIndex: Oe,
|
|
537
|
+
getItems: Ye,
|
|
538
|
+
getItemsCount: Pe,
|
|
539
|
+
itemExists: je,
|
|
540
|
+
getItemIndex: He,
|
|
541
|
+
replaceAllItems: Le,
|
|
542
|
+
clearItems: De,
|
|
543
|
+
deselectAllRows: xe,
|
|
544
|
+
getSelectedItems: $e,
|
|
545
|
+
getSelectedRows: qe,
|
|
546
|
+
// Overlay methods
|
|
547
|
+
setLoading: Ge,
|
|
548
|
+
setError: Xe,
|
|
549
|
+
setPartialLoading: Je,
|
|
550
|
+
clearOverlay: Ke,
|
|
551
|
+
getOverlayState: Ve
|
|
518
552
|
}), [
|
|
519
|
-
Ee,
|
|
520
|
-
Ce,
|
|
521
|
-
_e,
|
|
522
|
-
Me,
|
|
523
|
-
Ne,
|
|
524
|
-
me,
|
|
525
|
-
f,
|
|
526
|
-
be,
|
|
527
553
|
We,
|
|
528
|
-
|
|
554
|
+
Ce,
|
|
555
|
+
De,
|
|
556
|
+
Ke,
|
|
529
557
|
Ae,
|
|
530
|
-
|
|
558
|
+
Be,
|
|
559
|
+
xe,
|
|
560
|
+
f,
|
|
561
|
+
Ne,
|
|
531
562
|
Fe,
|
|
563
|
+
Oe,
|
|
564
|
+
He,
|
|
565
|
+
Ye,
|
|
566
|
+
Pe,
|
|
567
|
+
Ve,
|
|
568
|
+
$e,
|
|
569
|
+
qe,
|
|
570
|
+
je,
|
|
532
571
|
Le,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
572
|
+
Xe,
|
|
573
|
+
Ge,
|
|
574
|
+
Je,
|
|
575
|
+
ke,
|
|
576
|
+
Te
|
|
538
577
|
]);
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
t?.target && t.target.closest('[data-checkbox="true"]') || (
|
|
542
|
-
}, [
|
|
543
|
-
const n = f.find((r) => r.internalName === e.id)?.typeAsString === "Note" ?
|
|
544
|
-
return e.id === "select" ? `${
|
|
545
|
-
}).join(" "), [
|
|
546
|
-
|
|
547
|
-
if (!
|
|
578
|
+
kt.useImperativeHandle(ft, () => y, [y]);
|
|
579
|
+
const vt = w((e, t) => {
|
|
580
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || (b && ye(e.index), se && se(e.original, e.index));
|
|
581
|
+
}, [b, se, ye]), Ze = H(() => x.map((e) => {
|
|
582
|
+
const n = f.find((r) => r.internalName === e.id)?.typeAsString === "Note" ? I * 2 : I, s = S[e.id] || (typeof e.size == "number" ? e.size : n);
|
|
583
|
+
return e.id === "select" ? `${j}px` : `${s}px`;
|
|
584
|
+
}).join(" "), [x, S, f]);
|
|
585
|
+
A(() => {
|
|
586
|
+
if (!J) return;
|
|
548
587
|
const e = new ResizeObserver((t) => {
|
|
549
588
|
for (const n of t)
|
|
550
|
-
|
|
589
|
+
we(n.contentRect.width);
|
|
551
590
|
});
|
|
552
|
-
return e.observe(
|
|
553
|
-
}, [
|
|
554
|
-
if (!
|
|
591
|
+
return e.observe(J), we(J.clientWidth), () => e.disconnect();
|
|
592
|
+
}, [J]), A(() => {
|
|
593
|
+
if (!W || N <= 0 || C.current) return;
|
|
555
594
|
let e = 0, t = 0;
|
|
556
595
|
const n = [];
|
|
557
|
-
if (
|
|
558
|
-
const h = f.find((m) => m.internalName === o.id)?.typeAsString === "Note" ?
|
|
596
|
+
if (x.forEach((o) => {
|
|
597
|
+
const h = f.find((m) => m.internalName === o.id)?.typeAsString === "Note" ? I * 2 : I, d = S[o.id] || (typeof o.size == "number" ? o.size : h);
|
|
559
598
|
!(o.id === "select") ? (t += d, n.push(o)) : e += d;
|
|
560
599
|
}), n.length === 0)
|
|
561
600
|
return;
|
|
562
601
|
const s = e + t;
|
|
563
|
-
if (Math.abs(s -
|
|
564
|
-
const r =
|
|
565
|
-
let
|
|
602
|
+
if (Math.abs(s - N) < 1) return;
|
|
603
|
+
const r = N - e, c = r / t, a = { ...S };
|
|
604
|
+
let i = 0;
|
|
566
605
|
n.forEach((o, u) => {
|
|
567
|
-
const h = S[o.id] || (typeof o.size == "number" ? o.size :
|
|
606
|
+
const h = S[o.id] || (typeof o.size == "number" ? o.size : I), d = o.minSize || B;
|
|
568
607
|
let l;
|
|
569
|
-
u === n.length - 1 ? l = r -
|
|
570
|
-
}),
|
|
571
|
-
|
|
608
|
+
u === n.length - 1 ? l = r - i : l = Math.round(h * c), l = Math.max(d, l), a[o.id] = l, i += l;
|
|
609
|
+
}), C.current = !0, X(a), requestAnimationFrame(() => {
|
|
610
|
+
C.current = !1;
|
|
572
611
|
});
|
|
573
|
-
}, [
|
|
574
|
-
if (
|
|
612
|
+
}, [W, N, x, f]), A(() => {
|
|
613
|
+
if (W || N <= 0)
|
|
575
614
|
return;
|
|
576
|
-
const e =
|
|
615
|
+
const e = N - K;
|
|
577
616
|
if (Math.abs(e) < 1)
|
|
578
617
|
return;
|
|
579
|
-
const t =
|
|
618
|
+
const t = x.filter((d) => d.id && d.id !== "select");
|
|
580
619
|
if (t.length === 0) return;
|
|
581
|
-
const n = t[t.length - 1], s = n.id,
|
|
582
|
-
Math.abs(h - u) < 1 || (
|
|
620
|
+
const n = t[t.length - 1], s = n.id, c = f.find((d) => d.internalName === s)?.typeAsString === "Note" ? I * 2 : I, i = (S[s] || (typeof n.size == "number" ? n.size : c)) + e, o = n.minSize || B, u = Math.max(o, i), h = S[s];
|
|
621
|
+
Math.abs(h - u) < 1 || (C.current = !0, X((d) => ({
|
|
583
622
|
...d,
|
|
584
623
|
[s]: u
|
|
585
|
-
})),
|
|
586
|
-
}, [
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
|
|
624
|
+
})), C.current = !1);
|
|
625
|
+
}, [W, N, K, x, f]);
|
|
626
|
+
const Qe = Pt(ht), Ue = Yt(mt), V = $t(pt), Mt = Qe ? [Qe, ...ue] : ue, ie = [];
|
|
627
|
+
Ue && ie.push(Ue), V && ie.push(V);
|
|
628
|
+
const Nt = [...ie, ...St], Wt = V ? [V, ...de] : de;
|
|
629
|
+
return /* @__PURE__ */ et(
|
|
630
|
+
Dt,
|
|
592
631
|
{
|
|
593
632
|
size: "small",
|
|
594
|
-
appearance:
|
|
595
|
-
className:
|
|
633
|
+
appearance: rt,
|
|
634
|
+
className: It,
|
|
596
635
|
style: {
|
|
597
|
-
backgroundColor:
|
|
636
|
+
backgroundColor: ee.colorNeutralBackground1,
|
|
598
637
|
maxWidth: "100%",
|
|
599
638
|
// margin: "20px 20px",
|
|
600
639
|
padding: "0px",
|
|
601
640
|
gap: "0px",
|
|
602
|
-
...
|
|
641
|
+
...ct
|
|
603
642
|
},
|
|
604
643
|
children: [
|
|
605
|
-
|
|
606
|
-
|
|
644
|
+
ne && /* @__PURE__ */ v(
|
|
645
|
+
qt,
|
|
607
646
|
{
|
|
608
647
|
tableMethods: y,
|
|
609
|
-
alwaysButtons:
|
|
610
|
-
noSelectionButtons:
|
|
611
|
-
singleSelectionButtons:
|
|
612
|
-
multiSelectionButtons:
|
|
648
|
+
alwaysButtons: Mt,
|
|
649
|
+
noSelectionButtons: gt,
|
|
650
|
+
singleSelectionButtons: Nt,
|
|
651
|
+
multiSelectionButtons: Wt,
|
|
613
652
|
selectedRows: y.getSelectedRows()
|
|
614
653
|
}
|
|
615
654
|
),
|
|
616
|
-
|
|
617
|
-
"
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
655
|
+
(() => {
|
|
656
|
+
const e = G.state !== "none" ? G : R.length === 0 ? {
|
|
657
|
+
state: "empty",
|
|
658
|
+
message: F?.empty?.title,
|
|
659
|
+
description: F?.empty?.description,
|
|
660
|
+
imageUrl: F?.empty?.imageUrl
|
|
661
|
+
} : { state: "none" }, t = /* @__PURE__ */ v(
|
|
662
|
+
"div",
|
|
663
|
+
{
|
|
664
|
+
ref: _t,
|
|
665
|
+
onScroll: Rt,
|
|
666
|
+
className: pe["efw-table-scroll-container"],
|
|
667
|
+
style: {
|
|
668
|
+
maxHeight: ne ? te - 40 : te,
|
|
669
|
+
overflowY: "auto",
|
|
670
|
+
overflowX: "auto",
|
|
671
|
+
border: `1px solid ${ee.colorNeutralStroke2}`,
|
|
672
|
+
borderTop: ne ? "none" : `1px solid ${ee.colorNeutralStroke2}`,
|
|
673
|
+
position: "relative"
|
|
674
|
+
},
|
|
675
|
+
children: /* @__PURE__ */ et(
|
|
676
|
+
"div",
|
|
677
|
+
{
|
|
678
|
+
className: "table-container",
|
|
679
|
+
style: {
|
|
680
|
+
minWidth: W ? "100%" : K,
|
|
681
|
+
width: W ? "100%" : Math.max(K, 300)
|
|
682
|
+
},
|
|
683
|
+
children: [
|
|
684
|
+
/* @__PURE__ */ v(
|
|
685
|
+
Gt,
|
|
686
|
+
{
|
|
687
|
+
table: Re,
|
|
688
|
+
gridTemplateColumns: Ze,
|
|
689
|
+
columnSizing: S,
|
|
690
|
+
stickyColumnsInfo: _e,
|
|
691
|
+
resizableColumns: re
|
|
692
|
+
}
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ v(
|
|
695
|
+
Xt,
|
|
696
|
+
{
|
|
697
|
+
table: Re,
|
|
698
|
+
fields: f,
|
|
699
|
+
tableContainerRef: Ee,
|
|
700
|
+
useVirtualization: dt,
|
|
701
|
+
enableSelection: b,
|
|
702
|
+
itemSize: at,
|
|
703
|
+
gridTemplateColumns: Ze,
|
|
704
|
+
columnSizing: S,
|
|
705
|
+
stickyColumnsInfo: _e,
|
|
706
|
+
onRowClick: vt
|
|
707
|
+
}
|
|
708
|
+
)
|
|
709
|
+
]
|
|
710
|
+
}
|
|
711
|
+
)
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
return e.state === "partial-loading" ? /* @__PURE__ */ v(
|
|
715
|
+
nt,
|
|
716
|
+
{
|
|
717
|
+
config: e,
|
|
718
|
+
customization: F,
|
|
719
|
+
children: t
|
|
720
|
+
}
|
|
721
|
+
) : e.state !== "none" ? /* @__PURE__ */ v(
|
|
722
|
+
nt,
|
|
723
|
+
{
|
|
724
|
+
config: e,
|
|
725
|
+
height: te,
|
|
726
|
+
customization: F
|
|
727
|
+
}
|
|
728
|
+
) : t;
|
|
729
|
+
})()
|
|
669
730
|
]
|
|
670
731
|
}
|
|
671
732
|
);
|
|
672
733
|
};
|
|
673
734
|
export {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
735
|
+
I as COLS_DEF_WIDTH,
|
|
736
|
+
U as COLS_MAX_WIDTH,
|
|
737
|
+
B as COLS_MIN_WIDTH,
|
|
738
|
+
hn as EFWTable,
|
|
739
|
+
fn as SELECTOR_CELL_HEIGHT,
|
|
740
|
+
j as SELECTOR_CELL_WIDTH
|
|
680
741
|
};
|