@lax-wp/design-system 0.13.55 → 0.13.57
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/components/data-display/infinite-table/body/rows/row.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.es.js +284 -281
- package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.es.js +38 -38
- package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
- package/dist/components/user-avatar/constants.cjs.js +1 -1
- package/dist/components/user-avatar/constants.cjs.js.map +1 -1
- package/dist/components/user-avatar/constants.es.js +1 -1
- package/dist/components/user-avatar/constants.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as Pi, useState as F, useRef as bi, useEffect as Ki, useCallback as Ii, useMemo as Ci, createElement as
|
|
3
|
-
import { getTableRowBgClassNamesByStatus as
|
|
4
|
-
import { useTableConfig as
|
|
1
|
+
import { jsx as t, jsxs as Di } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as Pi, useState as F, useRef as bi, useEffect as Ki, useCallback as Ii, useMemo as Ci, createElement as te } from "react";
|
|
3
|
+
import { getTableRowBgClassNamesByStatus as vi } from "../../../../../constants/table.es.js";
|
|
4
|
+
import { useTableConfig as le } from "../../../../../providers/design-system-provider/hooks.es.js";
|
|
5
5
|
import { useDraggable as ae, useDroppable as oe } from "@dnd-kit/core";
|
|
6
6
|
import { useSortable as de } from "@dnd-kit/sortable";
|
|
7
|
-
import { CSS as
|
|
7
|
+
import { CSS as se } from "@dnd-kit/utilities";
|
|
8
8
|
import { SubdirectoryArrowLeftRounded as Yi } from "@mui/icons-material";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import re from "@mui/icons-material/AddRounded";
|
|
10
|
+
import Oi from "../../../../../_virtual/index.es.js";
|
|
11
11
|
import { createPortal as ge } from "react-dom";
|
|
12
|
-
import { TableContext as
|
|
12
|
+
import { TableContext as Bi } from "../../context.es.js";
|
|
13
13
|
import { ActionCell as ce } from "../cell/ActionCell.es.js";
|
|
14
|
-
import { CheckboxCell as
|
|
15
|
-
import { DataCell as
|
|
14
|
+
import { CheckboxCell as me } from "../cell/CheckboxCell.es.js";
|
|
15
|
+
import { DataCell as ue } from "../cell/DataCell.es.js";
|
|
16
16
|
import { validateCellValue as qi } from "../../validateCell.es.js";
|
|
17
17
|
import { LoaderCell as _e } from "../cell/LoaderCell.es.js";
|
|
18
18
|
import { PendingEditCell as fe } from "../cell/PendingEditCell.es.js";
|
|
19
19
|
import { RowActionCell as pe } from "../cell/RowActionCell.es.js";
|
|
20
20
|
import { RowOptionsCell as be } from "../cell/RowOptionsCell.es.js";
|
|
21
|
-
const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M, style:
|
|
21
|
+
const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M, style: hi, level: e = 0, expandedRows: g, rows: ei }) => {
|
|
22
22
|
const {
|
|
23
23
|
lastNonStickyColumnIndex: H,
|
|
24
24
|
checkboxConfig: a,
|
|
@@ -27,86 +27,86 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
27
27
|
disableOptionsForRowIndex: W = null,
|
|
28
28
|
getSumOfNextVisibleColumnWidth: ni,
|
|
29
29
|
onRowEdit: $,
|
|
30
|
-
inlineEditColumns:
|
|
31
|
-
tableActions:
|
|
32
|
-
dndSortableUtils:
|
|
33
|
-
withSortable:
|
|
30
|
+
inlineEditColumns: yi,
|
|
31
|
+
tableActions: ti,
|
|
32
|
+
dndSortableUtils: li,
|
|
33
|
+
withSortable: u,
|
|
34
34
|
withDraggable: x,
|
|
35
35
|
getInnerRowData: ai,
|
|
36
36
|
showNewItem: j,
|
|
37
37
|
rawData: B,
|
|
38
38
|
dragConfig: p,
|
|
39
39
|
getFullRowDataOnClick: oi,
|
|
40
|
-
selectedRowId:
|
|
40
|
+
selectedRowId: s,
|
|
41
41
|
rowWrapper: U,
|
|
42
|
-
isCellClickDisabled:
|
|
43
|
-
rowAdditionalActions:
|
|
42
|
+
isCellClickDisabled: Ri,
|
|
43
|
+
rowAdditionalActions: N,
|
|
44
44
|
hoverConfig: di,
|
|
45
|
-
addPendingEdit:
|
|
45
|
+
addPendingEdit: D,
|
|
46
46
|
removePendingEdit: P,
|
|
47
|
-
fieldOperationLoading:
|
|
47
|
+
fieldOperationLoading: si,
|
|
48
48
|
clearRowPendingEdits: L,
|
|
49
49
|
saveRowPendingEdits: K,
|
|
50
50
|
pendingEdits: A
|
|
51
|
-
} = Pi(
|
|
52
|
-
|
|
53
|
-
}, [b, Y] = F(null), [
|
|
51
|
+
} = Pi(Bi), O = le(), ri = !!a, { activeInlineEdit: gi, setActiveInlineEdit: z } = Pi(Bi), l = gi?.rowId === i.original.id ? gi?.columnKey : null, c = !!l, ci = (n) => {
|
|
52
|
+
z?.(n === null ? null : { rowId: String(i.original.id), columnKey: n });
|
|
53
|
+
}, [b, Y] = F(null), [mi, m] = F(null), [y, q] = F(null), [C, R] = F(!1), [k, G] = F(!1), ui = bi(null);
|
|
54
54
|
Ki(() => {
|
|
55
|
-
const n =
|
|
56
|
-
if (n && !
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
55
|
+
const n = ui.current, r = l;
|
|
56
|
+
if (n && !r) {
|
|
57
|
+
const h = A?.[i.original.id]?.[n];
|
|
58
|
+
if (h) {
|
|
59
59
|
const d = i.cells?.find((_) => _.column?.key === n);
|
|
60
60
|
if (d) {
|
|
61
|
-
const _ = qi(
|
|
62
|
-
!_.isValid &&
|
|
63
|
-
...
|
|
61
|
+
const _ = qi(h.value, d.column);
|
|
62
|
+
!_.isValid && D && D(String(i.original.id), n, {
|
|
63
|
+
...h,
|
|
64
64
|
validationError: _.error
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
}, [
|
|
69
|
+
ui.current = r ?? null;
|
|
70
|
+
}, [l, i.original.id, i.cells, A, D]), Ki(() => {
|
|
71
71
|
if (B) {
|
|
72
72
|
const n = String(i?.original?.id);
|
|
73
73
|
q(B[n]?.[i?.cells[0].column.Header] || B[n]?.[0]);
|
|
74
74
|
}
|
|
75
75
|
}, [B, i?.original?.id, i?.cells]);
|
|
76
|
-
const o = de({ id: i.original.id, data: { ...i.original }, disabled: !
|
|
76
|
+
const o = de({ id: i.original.id, data: { ...i.original }, disabled: !u }), v = ae({ id: i.original.id, data: { ...i.original }, disabled: !!u }), { listeners: _i, transform: fi, setNodeRef: pi, isDragging: V, attributes: ki, active: T, over: I, ...Ji } = u ? o : v, { setNodeRef: Li } = oe({
|
|
77
77
|
id: `table-file-dropzone-${i?.original?.id}`,
|
|
78
78
|
data: { type: "table-file-dropzone", folderId: i?.original?.id, isFolder: i?.original?.type === "folder" }
|
|
79
79
|
}), Qi = {
|
|
80
|
-
transform:
|
|
81
|
-
transition:
|
|
82
|
-
cursor:
|
|
83
|
-
opacity:
|
|
84
|
-
}, Xi = () => !T || !I || !
|
|
85
|
-
|
|
80
|
+
transform: se.Transform.toString(fi),
|
|
81
|
+
transition: u ? Ji.transition : void 0,
|
|
82
|
+
cursor: V ? "grabbing" : "grab",
|
|
83
|
+
opacity: V ? "0.5" : "1"
|
|
84
|
+
}, Xi = () => !T || !I || !u ? !1 : li?.checkOverEachItem ? li.checkOverEachItem(T, I) && !!I : T.data.current?.type !== I.data.current?.type && !!I, Ai = (n) => {
|
|
85
|
+
m(n.target.value);
|
|
86
86
|
}, Zi = () => {
|
|
87
|
-
|
|
88
|
-
},
|
|
87
|
+
si || ci(null);
|
|
88
|
+
}, Si = bi(null), zi = Ii(
|
|
89
89
|
(n) => {
|
|
90
|
-
|
|
90
|
+
Si.current = n;
|
|
91
91
|
},
|
|
92
92
|
[]
|
|
93
93
|
), Vi = bi(O);
|
|
94
94
|
Vi.current = O;
|
|
95
|
-
const
|
|
95
|
+
const Ti = Ii(() => {
|
|
96
96
|
L && L(String(i.original.id));
|
|
97
|
-
}, [L, i.original.id]),
|
|
98
|
-
if (
|
|
99
|
-
const n =
|
|
97
|
+
}, [L, i.original.id]), Fi = Ii(() => {
|
|
98
|
+
if (Si.current) {
|
|
99
|
+
const n = Si.current();
|
|
100
100
|
if (!n.isValid) return;
|
|
101
|
-
|
|
101
|
+
l && n.value !== void 0 && D && D(String(i.original.id), l, {
|
|
102
102
|
value: n.value,
|
|
103
|
-
originalValue: i.original[
|
|
103
|
+
originalValue: i.original[l],
|
|
104
104
|
meta: n.meta || void 0
|
|
105
105
|
});
|
|
106
|
-
} else if (
|
|
107
|
-
const n = i.cells?.find((
|
|
106
|
+
} else if (l) {
|
|
107
|
+
const n = i.cells?.find((r) => r.column?.key === l);
|
|
108
108
|
if (n) {
|
|
109
|
-
const
|
|
109
|
+
const r = A?.[i.original.id]?.[l]?.value, h = r !== void 0 ? r : n.value, d = qi(h, n.column);
|
|
110
110
|
if (!d.isValid) {
|
|
111
111
|
Vi.current?.showNotification?.("error", d.error || "Validation failed");
|
|
112
112
|
return;
|
|
@@ -114,14 +114,14 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
K && K(String(i.original.id));
|
|
117
|
-
}, [K, i.original, i.cells,
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
if (!
|
|
117
|
+
}, [K, i.original, i.cells, l, D, A]), Mi = (n, r) => {
|
|
118
|
+
const h = { ...i.original }, d = n !== void 0 ? n : mi;
|
|
119
|
+
l && d !== void 0 && (h[l] = d, $ && $(h, M, l, d, r), P && P(String(i.original.id), l)), Zi();
|
|
120
|
+
}, Hi = bi(null), Wi = (n, r, h, d) => {
|
|
121
|
+
if (!Ri && (n?.stopPropagation(), l !== d)) {
|
|
122
122
|
if ($) {
|
|
123
|
-
if (
|
|
124
|
-
ci(d),
|
|
123
|
+
if (yi?.includes(d))
|
|
124
|
+
ci(d), m(String(i.original[d]));
|
|
125
125
|
else {
|
|
126
126
|
const _ = O?.getSystemMessage?.("notAllowedInlineEdit") || "Inline Edit is not allowed for this column";
|
|
127
127
|
O?.showNotification?.("error", _);
|
|
@@ -129,50 +129,50 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
if (E)
|
|
132
|
-
E(
|
|
132
|
+
E(r, h, i.original, ei?.map((_) => _.original) || []);
|
|
133
133
|
else if (!E && a) {
|
|
134
134
|
const _ = i.original.id, ne = { target: { checked: !a.checkedIds.includes(_) } };
|
|
135
135
|
a.onItemCheck(ne, _);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, $i = async () => {
|
|
139
139
|
R(!0), ai && await ai(i?.original?.id, i?.original, !(g?.[i?.original?.id]?.isOpen ?? !1), i?.original?.__level || 0), R(!1);
|
|
140
|
-
}, wi = Ci(() => i.cells.filter((n) => n.column?.visible).map((n) => n.column?.width ?? 0).reduce((n,
|
|
140
|
+
}, wi = Ci(() => i.cells.filter((n) => n.column?.visible).map((n) => n.column?.width ?? 0).reduce((n, r) => n + r, 0), [i.cells]), J = Ci(() => p?.draggingOver && p?.draggingOver === i?.original?.id, [p, i?.original?.id]), Ei = Ci(() => J ? p?.dropPosition || "inside" : null, [J, p?.dropPosition]), Q = !!(J && Ei === "inside"), S = i?.original?.__rowMetadata || i?.original?._meta, X = b !== i?.original?.id, xi = !i?.original?.__isLoading, ji = !!(S?.__is_new || S?.__is_added || i?.original?.is_added || y?.is_added || S?.is_added || S?.is_new), ie = !!(i?.original?.is_deleted || S?.__is_deleted || y?.is_deleted || S?.is_deleted), ee = !!(i?.original?.is_modified || i?.original?.is_row_modified || S?.__is_modified || S?.__is_edited || y?.is_row_modified || S?.is_modified) && !ji, Ni = s != null && String(s) === String(i?.original?.id), Ui = Oi({
|
|
141
141
|
"bg-neutral-100 dark:bg-black-600": b === i?.original?.id && !c,
|
|
142
142
|
"bg-primary-100 dark:bg-primary-950": Ni && X && !c,
|
|
143
143
|
"bg-primary-50 dark:bg-black-700": !i?.original?.is_read && j && !i?.original?.__isLoading && X && !c,
|
|
144
144
|
// 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,
|
|
145
|
-
"bg-warning-50 dark:bg-warning-975": ee &&
|
|
146
|
-
"bg-error-50 dark:bg-error-975": ie &&
|
|
147
|
-
"bg-success-50 dark:bg-success-975":
|
|
145
|
+
"bg-warning-50 dark:bg-warning-975": ee && xi && X && !c,
|
|
146
|
+
"bg-error-50 dark:bg-error-975": ie && xi && X && !c,
|
|
147
|
+
"bg-success-50 dark:bg-success-975": ji && xi && X && !c,
|
|
148
148
|
"bg-primary-50 dark:bg-primary-900": c,
|
|
149
|
-
[
|
|
149
|
+
[vi[i?.original?.__rowBgStatus]]: i?.original?.__rowBgStatus && !c
|
|
150
150
|
});
|
|
151
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ te(
|
|
152
152
|
"tr",
|
|
153
153
|
{
|
|
154
154
|
...i.getRowProps(),
|
|
155
|
-
ref: x ||
|
|
155
|
+
ref: x || u ? pi : null,
|
|
156
156
|
key: i.original.id,
|
|
157
157
|
"data-row-id": i.original.id,
|
|
158
|
-
className:
|
|
158
|
+
className: Oi(
|
|
159
159
|
`text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${a?.selectionDisabledRowIds?.includes(i?.original?.id) ? "opacity-50" : ""} border-t`,
|
|
160
|
-
|
|
160
|
+
V ? "z-40" : "",
|
|
161
161
|
Xi() ? "shadow-dnd-drop" : "",
|
|
162
162
|
x && I && I?.data?.current?.type === "table-file-dropzone" && I?.data?.current?.folderId === i?.original?.id && i?.original?.type === "folder" ? "bg-primary-50" : "",
|
|
163
163
|
i?.original?.isDefinedActionRow ? "bg-primary-50" : "",
|
|
164
164
|
Q ? "z-50" : "",
|
|
165
|
-
|
|
165
|
+
Ui || "bg-white dark:bg-black-800"
|
|
166
166
|
),
|
|
167
|
-
style: { ...
|
|
168
|
-
...x ||
|
|
169
|
-
...x ||
|
|
167
|
+
style: { ...hi, ...u ? Qi : {}, width: "max-content" },
|
|
168
|
+
...x || u ? ki : {},
|
|
169
|
+
...x || u ? _i : {}
|
|
170
170
|
},
|
|
171
|
-
Q && p?.dragOperation ? /* @__PURE__ */
|
|
172
|
-
Q && !p?.dragOperation ? /* @__PURE__ */
|
|
173
|
-
J &&
|
|
174
|
-
J &&
|
|
175
|
-
i?.original?.isDefinedActionRow ? /* @__PURE__ */
|
|
171
|
+
Q && p?.dragOperation ? /* @__PURE__ */ t("div", { className: "absolute right-2 h-row flex items-center z-20 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "bg-primary-200 px-2 py-1 rounded", children: p?.dragOperation === "COPY" ? /* @__PURE__ */ t(re, { sx: { fontSize: 12 }, className: "text-primary-700" }) : /* @__PURE__ */ t(Yi, { sx: { fontSize: 12 }, className: "text-primary-700" }) }) }) : null,
|
|
172
|
+
Q && !p?.dragOperation ? /* @__PURE__ */ t("div", { className: "absolute right-2 h-row flex items-center z-20 pointer-events-none", children: /* @__PURE__ */ t(Yi, { sx: { fontSize: 16 }, className: "text-primary-500" }) }) : null,
|
|
173
|
+
J && Ei === "before" && !i?.original?.isDefinedActionRow ? /* @__PURE__ */ t("div", { className: "absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500" }) }) : null,
|
|
174
|
+
J && Ei === "after" && !i?.original?.isDefinedActionRow ? /* @__PURE__ */ t("div", { className: "absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500" }) }) : null,
|
|
175
|
+
i?.original?.isDefinedActionRow ? /* @__PURE__ */ t(
|
|
176
176
|
ce,
|
|
177
177
|
{
|
|
178
178
|
cells: i.cells,
|
|
@@ -189,83 +189,83 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
189
189
|
disabled: i?.original?.disabled,
|
|
190
190
|
disabledTooltip: i?.original?.disabledTooltip
|
|
191
191
|
}
|
|
192
|
-
) : U ? /* @__PURE__ */
|
|
192
|
+
) : U ? /* @__PURE__ */ t(U, { data: i.original, setIsDraggingFile: G, children: /* @__PURE__ */ t(
|
|
193
193
|
Gi,
|
|
194
194
|
{
|
|
195
195
|
isDraggingOver: Q,
|
|
196
196
|
level: e,
|
|
197
197
|
withDraggable: x,
|
|
198
|
-
setDroppableNodeRef:
|
|
198
|
+
setDroppableNodeRef: Li,
|
|
199
199
|
isLastRow: Z,
|
|
200
200
|
lastRow: w,
|
|
201
|
-
isCheckbox:
|
|
201
|
+
isCheckbox: ri,
|
|
202
202
|
checkboxConfig: a,
|
|
203
203
|
row: i,
|
|
204
204
|
rowHovering: b,
|
|
205
|
-
tableActions:
|
|
205
|
+
tableActions: ti,
|
|
206
206
|
disableOptionsForRowIndex: W,
|
|
207
207
|
index: M,
|
|
208
208
|
showNewItem: j,
|
|
209
209
|
currentData: y,
|
|
210
210
|
lastNonStickyColumnIndex: H,
|
|
211
211
|
getSumOfNextVisibleColumnWidth: ni,
|
|
212
|
-
toggleRowExpand:
|
|
212
|
+
toggleRowExpand: $i,
|
|
213
213
|
loadingExpand: C,
|
|
214
|
-
cellRef:
|
|
215
|
-
handleCellClick:
|
|
214
|
+
cellRef: Hi,
|
|
215
|
+
handleCellClick: Wi,
|
|
216
216
|
getFullRowDataOnClick: oi,
|
|
217
|
-
handleCellValueChange:
|
|
218
|
-
handleUpdateCellData:
|
|
219
|
-
handleRowCancelEdit:
|
|
220
|
-
handleRowConfirmEdit:
|
|
221
|
-
registerValidation:
|
|
222
|
-
inlineEditing:
|
|
217
|
+
handleCellValueChange: Ai,
|
|
218
|
+
handleUpdateCellData: Mi,
|
|
219
|
+
handleRowCancelEdit: Ti,
|
|
220
|
+
handleRowConfirmEdit: Fi,
|
|
221
|
+
registerValidation: zi,
|
|
222
|
+
inlineEditing: l,
|
|
223
223
|
isInlineEditing: c,
|
|
224
224
|
setRowHovering: Y,
|
|
225
225
|
highlightSubstring: ii,
|
|
226
226
|
rowOptions: f,
|
|
227
227
|
isDraggingFile: k,
|
|
228
|
-
rowAdditionalActions:
|
|
228
|
+
rowAdditionalActions: N,
|
|
229
229
|
hoverConfig: di,
|
|
230
230
|
isSelected: Ni
|
|
231
231
|
}
|
|
232
|
-
) }) : /* @__PURE__ */
|
|
232
|
+
) }) : /* @__PURE__ */ t(
|
|
233
233
|
Gi,
|
|
234
234
|
{
|
|
235
235
|
level: e,
|
|
236
236
|
withDraggable: x,
|
|
237
|
-
setDroppableNodeRef:
|
|
237
|
+
setDroppableNodeRef: Li,
|
|
238
238
|
isLastRow: Z,
|
|
239
239
|
lastRow: w,
|
|
240
|
-
isCheckbox:
|
|
240
|
+
isCheckbox: ri,
|
|
241
241
|
checkboxConfig: a,
|
|
242
242
|
row: i,
|
|
243
243
|
rowHovering: b,
|
|
244
|
-
tableActions:
|
|
244
|
+
tableActions: ti,
|
|
245
245
|
disableOptionsForRowIndex: W,
|
|
246
246
|
index: M,
|
|
247
247
|
showNewItem: j,
|
|
248
248
|
currentData: y,
|
|
249
249
|
lastNonStickyColumnIndex: H,
|
|
250
250
|
getSumOfNextVisibleColumnWidth: ni,
|
|
251
|
-
toggleRowExpand:
|
|
251
|
+
toggleRowExpand: $i,
|
|
252
252
|
loadingExpand: C,
|
|
253
|
-
cellRef:
|
|
254
|
-
handleCellClick:
|
|
253
|
+
cellRef: Hi,
|
|
254
|
+
handleCellClick: Wi,
|
|
255
255
|
getFullRowDataOnClick: oi,
|
|
256
|
-
handleCellValueChange:
|
|
257
|
-
handleUpdateCellData:
|
|
258
|
-
handleRowCancelEdit:
|
|
259
|
-
handleRowConfirmEdit:
|
|
260
|
-
registerValidation:
|
|
261
|
-
inlineEditing:
|
|
256
|
+
handleCellValueChange: Ai,
|
|
257
|
+
handleUpdateCellData: Mi,
|
|
258
|
+
handleRowCancelEdit: Ti,
|
|
259
|
+
handleRowConfirmEdit: Fi,
|
|
260
|
+
registerValidation: zi,
|
|
261
|
+
inlineEditing: l,
|
|
262
262
|
isInlineEditing: c,
|
|
263
263
|
setRowHovering: Y,
|
|
264
264
|
highlightSubstring: ii,
|
|
265
265
|
rowOptions: f,
|
|
266
266
|
isDraggingFile: k,
|
|
267
267
|
isDraggingOver: Q,
|
|
268
|
-
rowAdditionalActions:
|
|
268
|
+
rowAdditionalActions: N,
|
|
269
269
|
hoverConfig: di,
|
|
270
270
|
isSelected: Ni
|
|
271
271
|
}
|
|
@@ -277,7 +277,7 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
277
277
|
isLastRow: w,
|
|
278
278
|
lastRow: ii,
|
|
279
279
|
isCheckbox: M,
|
|
280
|
-
checkboxConfig:
|
|
280
|
+
checkboxConfig: hi,
|
|
281
281
|
row: e,
|
|
282
282
|
rowHovering: g,
|
|
283
283
|
tableActions: ei,
|
|
@@ -288,205 +288,208 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
|
|
|
288
288
|
lastNonStickyColumnIndex: W,
|
|
289
289
|
getSumOfNextVisibleColumnWidth: ni,
|
|
290
290
|
toggleRowExpand: $,
|
|
291
|
-
loadingExpand:
|
|
292
|
-
cellRef:
|
|
293
|
-
handleCellClick:
|
|
294
|
-
getFullRowDataOnClick:
|
|
291
|
+
loadingExpand: yi,
|
|
292
|
+
cellRef: ti,
|
|
293
|
+
handleCellClick: li,
|
|
294
|
+
getFullRowDataOnClick: u,
|
|
295
295
|
handleCellValueChange: x,
|
|
296
296
|
handleUpdateCellData: ai,
|
|
297
297
|
handleRowCancelEdit: j,
|
|
298
298
|
handleRowConfirmEdit: B,
|
|
299
299
|
registerValidation: p,
|
|
300
300
|
inlineEditing: oi,
|
|
301
|
-
isInlineEditing:
|
|
301
|
+
isInlineEditing: s,
|
|
302
302
|
setRowHovering: U,
|
|
303
|
-
highlightSubstring:
|
|
304
|
-
rowOptions:
|
|
303
|
+
highlightSubstring: Ri,
|
|
304
|
+
rowOptions: N,
|
|
305
305
|
level: di,
|
|
306
|
-
isDraggingFile:
|
|
306
|
+
isDraggingFile: D,
|
|
307
307
|
isDraggingOver: P,
|
|
308
|
-
rowAdditionalActions:
|
|
308
|
+
rowAdditionalActions: si,
|
|
309
309
|
hoverConfig: L,
|
|
310
310
|
isSelected: K
|
|
311
311
|
}) => {
|
|
312
312
|
const [A, O] = F(!1), {
|
|
313
|
-
getPendingEdit:
|
|
313
|
+
getPendingEdit: ri,
|
|
314
314
|
hasPendingEdit: gi,
|
|
315
|
-
pendingEdits:
|
|
316
|
-
tableHeaders:
|
|
315
|
+
pendingEdits: z,
|
|
316
|
+
tableHeaders: l,
|
|
317
317
|
pendingEditsCount: c,
|
|
318
318
|
scrollToCell: ci
|
|
319
|
-
} = Pi(
|
|
320
|
-
if (Array.isArray(
|
|
321
|
-
if (typeof
|
|
322
|
-
const o =
|
|
319
|
+
} = Pi(Bi), b = z?.[e.original.id] && Object.keys(z[e.original.id]).length > 0, Y = (c ?? 0) > 0, mi = Ci(() => {
|
|
320
|
+
if (Array.isArray(N)) return N;
|
|
321
|
+
if (typeof N == "function") {
|
|
322
|
+
const o = N({ ...e.original, rowIndex: a });
|
|
323
323
|
return Array.isArray(o) ? o : [];
|
|
324
324
|
}
|
|
325
325
|
return [];
|
|
326
|
-
}, [
|
|
327
|
-
"
|
|
328
|
-
"
|
|
329
|
-
"
|
|
326
|
+
}, [N, e.original, a]), m = e?.original?.__rowMetadata || e?.original?._meta, y = g !== e?.original?.id, q = !e?.original?.__isLoading, C = !!(m?.__is_new || m?.__is_added || e?.original?.is_added || f?.is_added || m?.is_added || m?.is_new), R = !!(e?.original?.is_deleted || m?.__is_deleted || f?.is_deleted || m?.is_deleted), k = !!(e?.original?.is_modified || e?.original?.is_row_modified || m?.__is_modified || m?.__is_edited || f?.is_row_modified || m?.is_deleted) && !C, G = K && !s && g !== e?.original?.id ? "bg-primary-100 dark:bg-primary-950" : void 0, ui = Oi("pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-10", {
|
|
327
|
+
"bg-success-400 dark:bg-success-500": C && q && y && !s,
|
|
328
|
+
"bg-error-400 dark:bg-error-500": R && q && y && !s,
|
|
329
|
+
"bg-warning-400 dark:bg-warning-500": k && q && y && !s
|
|
330
330
|
});
|
|
331
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ Di(
|
|
332
332
|
"div",
|
|
333
333
|
{
|
|
334
334
|
ref: i ? Z : null,
|
|
335
335
|
className: P ? "border-2 border-primary-400 dark:border-primary-500 rounded-sm" : "",
|
|
336
|
-
children:
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
336
|
+
children: [
|
|
337
|
+
/* @__PURE__ */ t("div", { className: ui }),
|
|
338
|
+
/* @__PURE__ */ Di("div", { className: "flex", ref: w ? ii : null, children: [
|
|
339
|
+
Y && /* @__PURE__ */ t(
|
|
340
|
+
fe,
|
|
341
|
+
{
|
|
342
|
+
rowId: String(e.original.id),
|
|
343
|
+
rowIndex: a,
|
|
344
|
+
pendingEdits: z,
|
|
345
|
+
tableHeaders: l,
|
|
346
|
+
rowHasPendingEdits: !!b,
|
|
347
|
+
rowHovering: g != null ? String(g) : void 0,
|
|
348
|
+
isInlineEditing: s,
|
|
349
|
+
is_read: !!e.original.is_read,
|
|
350
|
+
is_modified: k,
|
|
351
|
+
is_row_modified: !!e.original.is_row_modified,
|
|
352
|
+
is_deleted: R,
|
|
353
|
+
is_added: C,
|
|
354
|
+
is_incomplete: e?.original?.status === "Incomplete",
|
|
355
|
+
showNewItem: E,
|
|
356
|
+
onScrollToCell: ci
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
M && /* @__PURE__ */ t(
|
|
360
|
+
me,
|
|
361
|
+
{
|
|
362
|
+
checkboxConfig: hi,
|
|
363
|
+
id: String(e.original.id),
|
|
364
|
+
rowHovering: g != null ? String(g) : void 0,
|
|
365
|
+
isDisabled: !!e?.original?.__isLoading,
|
|
366
|
+
isDraggingOver: P,
|
|
367
|
+
is_added: C,
|
|
368
|
+
is_deleted: R,
|
|
369
|
+
is_incomplete: e?.original?.status === "Incomplete",
|
|
370
|
+
is_modified: k,
|
|
371
|
+
is_read: !!e.original.is_read,
|
|
372
|
+
is_row_modified: !!e.original.is_row_modified,
|
|
373
|
+
showNewItem: E,
|
|
374
|
+
currentData: f ?? {},
|
|
375
|
+
bgColor: e?.original?.__rowBgStatus ? vi[e?.original?.__rowBgStatus] : G,
|
|
376
|
+
isInlineEditing: s,
|
|
377
|
+
hasPendingEditsColumn: Y,
|
|
378
|
+
rowHasPendingEdits: b
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
ei ? /* @__PURE__ */ t(
|
|
382
|
+
pe,
|
|
383
|
+
{
|
|
384
|
+
tableActions: ei,
|
|
385
|
+
disableOptionsForRowIndex: H ?? null,
|
|
386
|
+
id: String(e.original.id),
|
|
387
|
+
index: a,
|
|
388
|
+
is_read: !!e?.original?.is_read,
|
|
389
|
+
is_incomplete: e?.original?.status === "Incomplete",
|
|
390
|
+
showNewItem: !!E,
|
|
391
|
+
is_modified: k,
|
|
392
|
+
is_row_modified: !!e?.original?.is_row_modified,
|
|
393
|
+
is_deleted: R,
|
|
394
|
+
currentData: f ?? {},
|
|
395
|
+
is_added: C,
|
|
396
|
+
rowData: e.original,
|
|
397
|
+
rowHovering: g,
|
|
398
|
+
isDisabled: !!e?.original?.__isLoading,
|
|
399
|
+
bgColor: D ? "bg-primary-50" : e?.original?.__rowBgStatus ? vi[e?.original?.__rowBgStatus] : G,
|
|
400
|
+
isInlineEditing: s,
|
|
401
|
+
rowHasPendingEdits: b
|
|
402
|
+
}
|
|
403
|
+
) : null,
|
|
404
|
+
/* @__PURE__ */ Di(
|
|
405
|
+
"div",
|
|
406
|
+
{
|
|
407
|
+
className: "relative flex-1",
|
|
408
|
+
id: `row-${e.original.id}`,
|
|
409
|
+
onMouseEnter: () => O(!0),
|
|
410
|
+
onMouseLeave: () => O(!1),
|
|
411
|
+
children: [
|
|
412
|
+
e.cells.filter((o) => o?.column?.visible !== !1).map((o, v) => {
|
|
413
|
+
const _i = v === W?.(), fi = v === (W?.() ?? -1) + 1, pi = o?.column?.sticky ? ni?.(v) ?? 0 : 0;
|
|
414
|
+
if (e.original?.__isLoading)
|
|
415
|
+
return /* @__PURE__ */ t(_e, { cell: o, id: v, nextWidthSum: pi, isLastCell: _i, rowHovering: g, index: v, isFirstStickyCell: fi }, v);
|
|
416
|
+
const V = ri?.(String(e.original.id), o?.column?.key || ""), ki = gi?.(String(e.original.id), o?.column?.key || "");
|
|
417
|
+
return /* @__PURE__ */ t(
|
|
418
|
+
ue,
|
|
419
|
+
{
|
|
420
|
+
cell: o,
|
|
421
|
+
rowHovering: g,
|
|
422
|
+
isFirstStickyCell: fi,
|
|
423
|
+
level: di ?? 0,
|
|
424
|
+
toggleRowExpand: $,
|
|
425
|
+
loadingExpand: yi,
|
|
426
|
+
index: v,
|
|
427
|
+
cellRef: ti,
|
|
428
|
+
currentData: f,
|
|
429
|
+
handleCellClick: (T) => {
|
|
430
|
+
T && li(T, u ? e.original : String(e.original.id), v, o?.column?.key || "");
|
|
431
|
+
},
|
|
432
|
+
handleCellValueChange: x,
|
|
433
|
+
handleUpdateCellData: ai,
|
|
434
|
+
registerValidation: p,
|
|
435
|
+
id: e.original.id,
|
|
436
|
+
inlineEditing: oi,
|
|
437
|
+
isInlineEditing: s,
|
|
438
|
+
isLastCell: _i,
|
|
439
|
+
is_incomplete: e?.original?.status === "Incomplete",
|
|
440
|
+
is_added: C,
|
|
441
|
+
is_deleted: R,
|
|
442
|
+
is_modified: k,
|
|
443
|
+
is_read: !!e.original.is_read,
|
|
444
|
+
is_row_modified: !!e.original.is_row_modified,
|
|
445
|
+
nextWidthSum: pi,
|
|
446
|
+
setRowHovering: U,
|
|
447
|
+
highlightSubstring: Ri,
|
|
448
|
+
isDraggingOver: P,
|
|
449
|
+
isLoading: !!e?.original?.__isLoading,
|
|
450
|
+
pendingEdit: V,
|
|
451
|
+
hasPendingEdit: ki,
|
|
452
|
+
pendingValidationError: V?.validationError
|
|
429
453
|
},
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
setRowHovering: U,
|
|
470
|
-
is_read: !!e.original.is_read,
|
|
471
|
-
showNewItem: !!E,
|
|
472
|
-
is_modified: k,
|
|
473
|
-
is_row_modified: !!e.original.is_row_modified,
|
|
474
|
-
is_incomplete: e?.original?.status === "Incomplete",
|
|
475
|
-
currentData: f ?? {},
|
|
476
|
-
is_deleted: R,
|
|
477
|
-
is_added: C,
|
|
478
|
-
isDraggingOver: !!P,
|
|
479
|
-
rowAdditionalActions: ri,
|
|
480
|
-
rowData: e.original,
|
|
481
|
-
index: a,
|
|
482
|
-
bgColor: e?.original?.__rowBgStatus ? hi[e?.original?.__rowBgStatus] : G,
|
|
483
|
-
isInlineEditing: r,
|
|
484
|
-
onConfirmEdit: B,
|
|
485
|
-
onCancelEdit: j,
|
|
486
|
-
rowHasPendingEdits: b
|
|
487
|
-
}
|
|
488
|
-
)
|
|
489
|
-
] })
|
|
454
|
+
o?.column?.key
|
|
455
|
+
);
|
|
456
|
+
}),
|
|
457
|
+
L?.onHover && A && ge(
|
|
458
|
+
/* @__PURE__ */ t("div", { className: "absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl", children: L.onHover(e.original) }),
|
|
459
|
+
document.getElementById(`row-${e.original.id}`)
|
|
460
|
+
)
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
(mi.length > 0 || !!si) && /* @__PURE__ */ t(
|
|
465
|
+
be,
|
|
466
|
+
{
|
|
467
|
+
rowId: e.original.id,
|
|
468
|
+
rowOptions: mi,
|
|
469
|
+
disableOption: H !== null || !!e?.original?.__isLoading,
|
|
470
|
+
rowHovering: g,
|
|
471
|
+
setRowHovering: U,
|
|
472
|
+
is_read: !!e.original.is_read,
|
|
473
|
+
showNewItem: !!E,
|
|
474
|
+
is_modified: k,
|
|
475
|
+
is_row_modified: !!e.original.is_row_modified,
|
|
476
|
+
is_incomplete: e?.original?.status === "Incomplete",
|
|
477
|
+
currentData: f ?? {},
|
|
478
|
+
is_deleted: R,
|
|
479
|
+
is_added: C,
|
|
480
|
+
isDraggingOver: !!P,
|
|
481
|
+
rowAdditionalActions: si,
|
|
482
|
+
rowData: e.original,
|
|
483
|
+
index: a,
|
|
484
|
+
bgColor: e?.original?.__rowBgStatus ? vi[e?.original?.__rowBgStatus] : G,
|
|
485
|
+
isInlineEditing: s,
|
|
486
|
+
onConfirmEdit: B,
|
|
487
|
+
onCancelEdit: j,
|
|
488
|
+
rowHasPendingEdits: b
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
] })
|
|
492
|
+
]
|
|
490
493
|
}
|
|
491
494
|
);
|
|
492
495
|
};
|