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