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