@lax-wp/design-system 0.14.35 → 0.14.37
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/CellContextMenuPortal.cjs.js +2 -0
- package/dist/components/data-display/infinite-table/CellContextMenuPortal.cjs.js.map +1 -0
- package/dist/components/data-display/infinite-table/CellContextMenuPortal.d.ts +28 -0
- package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js +226 -0
- package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js.map +1 -0
- 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 +169 -151
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/constants.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/constants.d.ts +8 -0
- package/dist/components/data-display/infinite-table/constants.es.js +24 -20
- package/dist/components/data-display/infinite-table/constants.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/context.cjs.js +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 +5 -1
- package/dist/components/data-display/infinite-table/context.es.js +5 -2
- package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/copy-text.cjs.js +3 -0
- package/dist/components/data-display/infinite-table/copy-text.cjs.js.map +1 -0
- package/dist/components/data-display/infinite-table/copy-text.d.ts +13 -0
- package/dist/components/data-display/infinite-table/copy-text.es.js +19 -0
- package/dist/components/data-display/infinite-table/copy-text.es.js.map +1 -0
- 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 +518 -497
- package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/types.d.ts +69 -0
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.es.js +24 -24
- package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/providers/design-system-provider/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsx as s, jsxs as b, Fragment as
|
|
2
|
-
import { useCheckbox as
|
|
3
|
-
import { useTableConfig as
|
|
4
|
-
import { canEditTableView as
|
|
5
|
-
import
|
|
6
|
-
import { FloatingBar as
|
|
1
|
+
import { jsx as s, jsxs as b, Fragment as Er } from "react/jsx-runtime";
|
|
2
|
+
import { useCheckbox as Rr } from "../../../hooks/useCheckbox.es.js";
|
|
3
|
+
import { useTableConfig as kr } from "../../../providers/design-system-provider/hooks.es.js";
|
|
4
|
+
import { canEditTableView as _r, mergeViewColumnsWithTableColumns as Lt } from "../../../utils/table.es.js";
|
|
5
|
+
import gt from "../../button/Button.es.js";
|
|
6
|
+
import { FloatingBar as Mr } from "../../floating-bar/FloatingBar.es.js";
|
|
7
7
|
import { Typography as be } from "../typography/Typography.es.js";
|
|
8
|
-
import { useSensors as
|
|
9
|
-
import
|
|
10
|
-
import { AutoSizer as
|
|
11
|
-
import { createPortal as
|
|
12
|
-
import { useTable as
|
|
13
|
-
import { Body as
|
|
14
|
-
import { validateCellValue as
|
|
15
|
-
import { Row as
|
|
16
|
-
import { TableContext as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
8
|
+
import { useSensors as Ir, useSensor as Vt, MouseSensor as Lr, TouchSensor as gr, DndContext as Vr, closestCorners as jr, DragOverlay as Br } from "@dnd-kit/core";
|
|
9
|
+
import Pr, { useState as m, useRef as O, useCallback as i, useEffect as T, useMemo as C, forwardRef as jt } from "react";
|
|
10
|
+
import { AutoSizer as Wr } from "react-virtualized-auto-sizer";
|
|
11
|
+
import { createPortal as Hr } from "react-dom";
|
|
12
|
+
import { useTable as $r, useResizeColumns as zr } from "react-table";
|
|
13
|
+
import { Body as Cr } from "./body/index.es.js";
|
|
14
|
+
import { validateCellValue as Bt } from "./validateCell.es.js";
|
|
15
|
+
import { Row as Ur } from "./body/rows/row.es.js";
|
|
16
|
+
import { TableContext as qr } from "./context.es.js";
|
|
17
|
+
import { CellContextMenuPortal as Jr } from "./CellContextMenuPortal.es.js";
|
|
18
|
+
import { CurrencyDropdownPortal as Gr } from "./CurrencyDropdownPortal.es.js";
|
|
19
|
+
import { Head as Xr } from "./head/index.es.js";
|
|
20
|
+
import { PendingEditsFloatingBar as Yr } from "./PendingEditsFloatingBar.es.js";
|
|
21
|
+
import { DATA_ROW_ID_ATTR as Zr, DATA_COLUMN_KEY_ATTR as Qr, OS_VIEWPORT_SELECTOR as Kr, SCROLL_TO_CELL_COLUMN_WIDTH_FALLBACK as en, SCROLL_TO_CELL_LEFT_OFFSET as tn, DEFAULT_PAGE_SIZE as ln, DEFAULT_COLUMN_MAX_WIDTH as rn, DEFAULT_COLUMN_WIDTH as nn, DEFAULT_COLUMN_MIN_WIDTH as sn, DND_ACTIVATION_DISTANCE as Pt, ROW_ADDITIONAL_ACTIONS_DEFAULT_WIDTH as on, ROW_OPTIONS_COLUMN_WIDTH as an, TOOLBAR_FIRST_BREAKPOINT as Z, TOOLBAR_SECOND_BREAKPOINT as Ce, DROP_ANIMATION_DURATION as cn, DROP_ANIMATION_EASING as dn } from "./constants.es.js";
|
|
22
|
+
import { getRowSlotHeight as un, useRowHeight as hn } from "./useRowHeight.es.js";
|
|
23
|
+
import { NoDataFoundWidgets as mn } from "../empty-state/NoDataFoundWidgets.es.js";
|
|
24
|
+
import { NoDataFound as pn } from "../empty-state/NoDataFound.es.js";
|
|
25
|
+
import { Add2Icon as fn } from "../../icon/icons.generated.es.js";
|
|
26
|
+
const vn = Wr, Wt = "Create Column", wn = (g, D) => `button-admin-${g.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "") || D}`, zn = Pr.memo(
|
|
26
27
|
({
|
|
27
28
|
tableKey: g,
|
|
28
29
|
searchConfig: D = {
|
|
@@ -38,12 +39,12 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
38
39
|
onResetFilter: () => Promise.resolve({}),
|
|
39
40
|
asyncRowOptionsFilter: () => Promise.resolve({})
|
|
40
41
|
},
|
|
41
|
-
sortConfig:
|
|
42
|
+
sortConfig: p = {
|
|
42
43
|
onSort: () => null,
|
|
43
44
|
columnSort: { field: "", order: "" },
|
|
44
45
|
onRemoveSort: () => null
|
|
45
46
|
},
|
|
46
|
-
headerConfig:
|
|
47
|
+
headerConfig: c = {
|
|
47
48
|
showExportButton: null,
|
|
48
49
|
showFilters: !0,
|
|
49
50
|
showSorts: !0,
|
|
@@ -56,122 +57,123 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
56
57
|
isLoading: !1,
|
|
57
58
|
showDivider: !1
|
|
58
59
|
},
|
|
59
|
-
hoverConfig:
|
|
60
|
+
hoverConfig: Ht = null,
|
|
60
61
|
columns: A,
|
|
61
62
|
modelName: Q,
|
|
62
63
|
enableMasterDataEnumSuggestions: K = !1,
|
|
63
64
|
agreementId: ee,
|
|
64
65
|
enumSuggestionsExtraParams: te,
|
|
65
66
|
enumSuggestionsData: le,
|
|
66
|
-
data:
|
|
67
|
-
onRowClick:
|
|
67
|
+
data: u = [],
|
|
68
|
+
onRowClick: $t,
|
|
68
69
|
showHeader: xe,
|
|
69
|
-
showSubHeader:
|
|
70
|
+
showSubHeader: zt = !0,
|
|
70
71
|
tableActions: Ue,
|
|
71
|
-
rowOptions:
|
|
72
|
+
rowOptions: V,
|
|
72
73
|
hideRowOptionWidth: qe,
|
|
73
|
-
checkboxUtilities:
|
|
74
|
+
checkboxUtilities: j,
|
|
74
75
|
isLoading: re = !1,
|
|
75
|
-
onScroll:
|
|
76
|
-
onScrolling:
|
|
76
|
+
onScroll: Ct,
|
|
77
|
+
onScrolling: Ut,
|
|
77
78
|
isColumnConfigurable: ne,
|
|
78
79
|
onAddColumnClick: se,
|
|
79
80
|
emptyMessage: Je,
|
|
80
|
-
noDataWidget:
|
|
81
|
-
buttons:
|
|
82
|
-
onEditColumnClick:
|
|
83
|
-
onDeleteColumnClick:
|
|
84
|
-
onRowTooltipClick:
|
|
85
|
-
tooltiptext:
|
|
86
|
-
cascadingTableConfig:
|
|
87
|
-
originalsOnly:
|
|
88
|
-
disableOptionsForRowIndex:
|
|
81
|
+
noDataWidget: Ge,
|
|
82
|
+
buttons: Xe,
|
|
83
|
+
onEditColumnClick: Ye,
|
|
84
|
+
onDeleteColumnClick: Ze,
|
|
85
|
+
onRowTooltipClick: qt,
|
|
86
|
+
tooltiptext: Jt,
|
|
87
|
+
cascadingTableConfig: Gt,
|
|
88
|
+
originalsOnly: Xt,
|
|
89
|
+
disableOptionsForRowIndex: Yt,
|
|
89
90
|
tableHeightClass: oe = "h-[calc(100vh-220px)]",
|
|
90
|
-
getFullRowDataOnClick:
|
|
91
|
-
selectedRowId:
|
|
92
|
-
onRowEdit:
|
|
93
|
-
onBulkRowEdit:
|
|
94
|
-
inlineEditColumns:
|
|
95
|
-
isResizable:
|
|
91
|
+
getFullRowDataOnClick: Zt,
|
|
92
|
+
selectedRowId: Qt = null,
|
|
93
|
+
onRowEdit: _,
|
|
94
|
+
onBulkRowEdit: B,
|
|
95
|
+
inlineEditColumns: Kt,
|
|
96
|
+
isResizable: el = !0,
|
|
96
97
|
paginationConfig: ae,
|
|
97
98
|
dndSortableUtils: ie,
|
|
98
|
-
multipleContexts:
|
|
99
|
+
multipleContexts: Qe,
|
|
99
100
|
withSortable: ye,
|
|
100
|
-
withDraggable:
|
|
101
|
-
enableRootDrag:
|
|
102
|
-
pageSize:
|
|
103
|
-
onCascadingRowExpand:
|
|
104
|
-
totalItems:
|
|
101
|
+
withDraggable: tl,
|
|
102
|
+
enableRootDrag: ll,
|
|
103
|
+
pageSize: rl = ln,
|
|
104
|
+
onCascadingRowExpand: nl,
|
|
105
|
+
totalItems: Ke,
|
|
105
106
|
showRecordCount: Te = !1,
|
|
106
|
-
getInnerRowData:
|
|
107
|
-
maxLevel:
|
|
108
|
-
expandedRows:
|
|
109
|
-
setExpandedRows:
|
|
110
|
-
showNewItem:
|
|
111
|
-
rawData:
|
|
112
|
-
dragConfig:
|
|
113
|
-
isOverlayLoading:
|
|
114
|
-
style:
|
|
107
|
+
getInnerRowData: sl,
|
|
108
|
+
maxLevel: ol,
|
|
109
|
+
expandedRows: al = {},
|
|
110
|
+
setExpandedRows: il,
|
|
111
|
+
showNewItem: cl,
|
|
112
|
+
rawData: et,
|
|
113
|
+
dragConfig: dl,
|
|
114
|
+
isOverlayLoading: ul,
|
|
115
|
+
style: hl = {},
|
|
115
116
|
floatingBarConfig: De,
|
|
116
|
-
rowWrapper:
|
|
117
|
-
rowLinkConfig:
|
|
118
|
-
isCellClickDisabled:
|
|
117
|
+
rowWrapper: ml,
|
|
118
|
+
rowLinkConfig: pl,
|
|
119
|
+
isCellClickDisabled: fl,
|
|
119
120
|
setHeaderOnParent: Ne,
|
|
120
|
-
optimizeTable:
|
|
121
|
-
multiSelectConfig:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
optimizeTable: vl = !1,
|
|
122
|
+
multiSelectConfig: wl,
|
|
123
|
+
cellContextMenuConfig: tt,
|
|
124
|
+
headerContextOptions: Fl,
|
|
125
|
+
showHeaderContextOptions: Sl,
|
|
126
|
+
setShowHeaderContextOptions: bl,
|
|
127
|
+
showDataTypeIcon: xl = !1,
|
|
126
128
|
rowAdditionalActions: ce,
|
|
127
129
|
rowAdditionalActionsWidth: Oe,
|
|
128
130
|
setVisibleHeaders: Ae,
|
|
129
|
-
cellEditing:
|
|
130
|
-
cellEditingValue:
|
|
131
|
-
allowInlineEdit:
|
|
132
|
-
onFieldOperationFlow:
|
|
133
|
-
fieldOperationLoading:
|
|
131
|
+
cellEditing: yl = null,
|
|
132
|
+
cellEditingValue: Tl = null,
|
|
133
|
+
allowInlineEdit: Dl = !1,
|
|
134
|
+
onFieldOperationFlow: Nl,
|
|
135
|
+
fieldOperationLoading: P = null,
|
|
134
136
|
onTableActionsReady: Ee,
|
|
135
|
-
onPendingEditsChange:
|
|
136
|
-
onCancelPendingEdits:
|
|
137
|
+
onPendingEditsChange: lt,
|
|
138
|
+
onCancelPendingEdits: W
|
|
137
139
|
}) => {
|
|
138
|
-
const a =
|
|
140
|
+
const a = kr(), Ol = un(hn()), Al = !!D?.search, rt = n?.columnFilters?.length > 0, U = Al || rt, El = !!j, N = a?.getTableView?.(g) ?? null, [x, q] = m(N || null), M = !_r(
|
|
139
141
|
x,
|
|
140
142
|
a?.getUserId?.()
|
|
141
|
-
), [Re,
|
|
143
|
+
), [Re, ke] = m(!1), [_e, nt] = m(!1), [Rl, st] = m(null), [v, Me] = m(A), ot = (u.length === 0 || !v.length) && !re, [at, de] = m(
|
|
142
144
|
null
|
|
143
|
-
), [
|
|
145
|
+
), [kl, _l] = m(!1), [Ml, Il] = m(null), [Ll, gl] = m(!1), [Vl, ue] = m(
|
|
144
146
|
null
|
|
145
|
-
), [
|
|
147
|
+
), [jl, he] = m(null), [Bl, it] = m({}), [J, Ie] = m(
|
|
146
148
|
null
|
|
147
|
-
), [
|
|
149
|
+
), [Pl, ct] = m(!1), [E, Wl] = m(0), Le = O(null), ge = O(null), [dt, Hl] = m({
|
|
148
150
|
width: 0,
|
|
149
151
|
height: 0
|
|
150
|
-
}), [
|
|
152
|
+
}), [$l, H] = m(null), [R, ut] = m(null), [zl, ht] = m(null), [mt, pt] = m(null), [Cl, ft] = m(null), [Ve, G] = m({}), je = O(!1), me = O(!1), Be = O(x);
|
|
151
153
|
Be.current = x;
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
154
|
+
const vt = O(a);
|
|
155
|
+
vt.current = a;
|
|
156
|
+
const wt = O(A);
|
|
157
|
+
wt.current = A;
|
|
156
158
|
const pe = O(n);
|
|
157
159
|
pe.current = n;
|
|
158
|
-
const
|
|
160
|
+
const Ft = O(null), St = O(
|
|
159
161
|
() => ({})
|
|
160
|
-
),
|
|
162
|
+
), bt = O(() => ({})), [h, k] = m({}), Pe = i(
|
|
161
163
|
(e, t, l) => {
|
|
162
|
-
|
|
164
|
+
k((r) => {
|
|
163
165
|
const o = r[e]?.[t];
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
const F =
|
|
166
|
+
let d = l.validationError;
|
|
167
|
+
if (d === void 0) {
|
|
168
|
+
const F = v.find((f) => f.key === t);
|
|
167
169
|
if (F) {
|
|
168
|
-
const f =
|
|
170
|
+
const f = Bt(
|
|
169
171
|
l.value,
|
|
170
172
|
F
|
|
171
173
|
);
|
|
172
|
-
|
|
174
|
+
d = f.isValid ? null : f.error || "Invalid";
|
|
173
175
|
} else
|
|
174
|
-
|
|
176
|
+
d = o?.validationError ?? null;
|
|
175
177
|
}
|
|
176
178
|
return {
|
|
177
179
|
...r,
|
|
@@ -179,52 +181,52 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
179
181
|
...r[e] || {},
|
|
180
182
|
[t]: {
|
|
181
183
|
...l,
|
|
182
|
-
validationError:
|
|
184
|
+
validationError: d ?? null
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
};
|
|
186
188
|
});
|
|
187
189
|
},
|
|
188
|
-
[
|
|
189
|
-
),
|
|
190
|
+
[v]
|
|
191
|
+
), xt = i(() => Object.values(h).some(
|
|
190
192
|
(e) => Object.keys(e).length > 0
|
|
191
|
-
), [
|
|
193
|
+
), [h]);
|
|
192
194
|
T(() => {
|
|
193
195
|
Ee && Ee({
|
|
194
196
|
addPendingEdit: Pe,
|
|
195
|
-
hasPendingEdits:
|
|
197
|
+
hasPendingEdits: xt
|
|
196
198
|
});
|
|
197
|
-
}, [Ee, Pe,
|
|
198
|
-
const
|
|
199
|
+
}, [Ee, Pe, xt]);
|
|
200
|
+
const Ul = i(
|
|
199
201
|
(e, t) => {
|
|
200
|
-
|
|
202
|
+
k((l) => {
|
|
201
203
|
const r = { ...l };
|
|
202
204
|
if (r[e]) {
|
|
203
|
-
const { [t]: o, ...
|
|
204
|
-
Object.keys(
|
|
205
|
+
const { [t]: o, ...d } = r[e];
|
|
206
|
+
Object.keys(d).length === 0 ? delete r[e] : r[e] = d;
|
|
205
207
|
}
|
|
206
208
|
return r;
|
|
207
209
|
});
|
|
208
210
|
},
|
|
209
211
|
[]
|
|
210
|
-
),
|
|
211
|
-
(e, t) =>
|
|
212
|
-
[
|
|
213
|
-
),
|
|
214
|
-
(e, t) => !!
|
|
215
|
-
[
|
|
216
|
-
),
|
|
217
|
-
|
|
218
|
-
}, [
|
|
212
|
+
), ql = i(
|
|
213
|
+
(e, t) => h[e]?.[t],
|
|
214
|
+
[h]
|
|
215
|
+
), Jl = i(
|
|
216
|
+
(e, t) => !!h[e]?.[t],
|
|
217
|
+
[h]
|
|
218
|
+
), yt = i(() => {
|
|
219
|
+
P || (W && Object.keys(h).length > 0 && W(h), k({}), G({}), H(null));
|
|
220
|
+
}, [P, W, h]), $ = i(
|
|
219
221
|
(e, t, l) => {
|
|
220
222
|
setTimeout(() => {
|
|
221
223
|
a?.dispatchEvent?.("SCROLL_TO_TABLE_ROW", { rowIndex: l });
|
|
222
|
-
const r =
|
|
224
|
+
const r = v.findIndex(
|
|
223
225
|
(o) => o.key === t
|
|
224
226
|
);
|
|
225
227
|
setTimeout(() => {
|
|
226
228
|
const o = document.querySelector(
|
|
227
|
-
`[${
|
|
229
|
+
`[${Zr}="${e}"] [${Qr}="${t}"]`
|
|
228
230
|
);
|
|
229
231
|
if (o)
|
|
230
232
|
o.scrollIntoView({
|
|
@@ -233,94 +235,94 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
233
235
|
inline: "center"
|
|
234
236
|
});
|
|
235
237
|
else if (r > 0) {
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
+
const d = document.querySelector(Kr);
|
|
239
|
+
if (d) {
|
|
238
240
|
let F = 0;
|
|
239
241
|
for (let f = 0; f < r; f++) {
|
|
240
|
-
const y =
|
|
241
|
-
y?.sticky || (F += y?.width ||
|
|
242
|
+
const y = v[f];
|
|
243
|
+
y?.sticky || (F += y?.width || en);
|
|
242
244
|
}
|
|
243
245
|
F = Math.max(
|
|
244
246
|
0,
|
|
245
|
-
F -
|
|
246
|
-
),
|
|
247
|
+
F - tn
|
|
248
|
+
), d.scrollTo({
|
|
247
249
|
left: F,
|
|
248
250
|
behavior: "smooth"
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
|
-
|
|
254
|
+
H({ rowId: e, columnKey: t });
|
|
253
255
|
}, 350);
|
|
254
256
|
}, 100);
|
|
255
257
|
},
|
|
256
|
-
[
|
|
257
|
-
), X =
|
|
258
|
+
[v, a]
|
|
259
|
+
), X = i(
|
|
258
260
|
(e) => {
|
|
259
261
|
let t = !1, l = null;
|
|
260
262
|
const r = {}, o = /* @__PURE__ */ new Set();
|
|
261
|
-
return Object.entries(e).forEach(([
|
|
262
|
-
r[
|
|
263
|
-
const L =
|
|
263
|
+
return Object.entries(e).forEach(([d, F]) => {
|
|
264
|
+
r[d] = {}, Object.entries(F).forEach(([f, y]) => {
|
|
265
|
+
const L = v.find((S) => S.key === f), w = Bt(
|
|
264
266
|
y.value,
|
|
265
267
|
L
|
|
266
268
|
);
|
|
267
|
-
|
|
269
|
+
w.isValid ? r[d][f] = {
|
|
268
270
|
...y,
|
|
269
271
|
validationError: null
|
|
270
|
-
} : (t = !0,
|
|
272
|
+
} : (t = !0, w.error && o.add(w.error), l || (l = { rowId: d, columnKey: f }), r[d][f] = {
|
|
271
273
|
...y,
|
|
272
|
-
validationError:
|
|
274
|
+
validationError: w.error
|
|
273
275
|
});
|
|
274
276
|
});
|
|
275
277
|
}), { hasErrors: t, updatedEdits: r, firstError: l, errorTypes: o };
|
|
276
278
|
},
|
|
277
|
-
[
|
|
278
|
-
), fe =
|
|
279
|
+
[v]
|
|
280
|
+
), fe = i((e) => {
|
|
279
281
|
const t = e.has("Field required"), l = e.size > (t ? 1 : 0);
|
|
280
282
|
return t && l ? "Missing required field(s) and invalid format detected. Please review highlighted field(s)." : t ? "Missing required field(s). Please review highlighted field(s)." : "Invalid field value(s). Please review highlighted field(s).";
|
|
281
|
-
}, []),
|
|
282
|
-
const { hasErrors: e, updatedEdits: t, firstError: l, errorTypes: r } = X(
|
|
283
|
+
}, []), Tt = i(() => {
|
|
284
|
+
const { hasErrors: e, updatedEdits: t, firstError: l, errorTypes: r } = X(h);
|
|
283
285
|
if (e) {
|
|
284
|
-
if (
|
|
286
|
+
if (k(t), a?.showNotification?.(
|
|
285
287
|
"error",
|
|
286
288
|
fe(r)
|
|
287
289
|
), l) {
|
|
288
|
-
const
|
|
290
|
+
const d = u.findIndex(
|
|
289
291
|
(F) => F.id === l.rowId
|
|
290
292
|
);
|
|
291
|
-
|
|
293
|
+
$(l.rowId, l.columnKey, d);
|
|
292
294
|
}
|
|
293
295
|
return;
|
|
294
296
|
}
|
|
295
297
|
const o = [];
|
|
296
|
-
Object.entries(
|
|
297
|
-
const f =
|
|
298
|
-
(y) => y.id ===
|
|
298
|
+
Object.entries(h).forEach(([d, F]) => {
|
|
299
|
+
const f = u.find(
|
|
300
|
+
(y) => y.id === d
|
|
299
301
|
);
|
|
300
302
|
if (f) {
|
|
301
303
|
const y = { ...f }, L = {};
|
|
302
|
-
Object.entries(F).forEach(([
|
|
303
|
-
y[
|
|
304
|
+
Object.entries(F).forEach(([w, S]) => {
|
|
305
|
+
y[w] = S.value, L[w] = { value: S.value, meta: S.meta };
|
|
304
306
|
}), o.push({ ...y, __editedFields: L });
|
|
305
307
|
}
|
|
306
|
-
}), o.length > 0 && (
|
|
308
|
+
}), o.length > 0 && (B ? B(o) : _ && _(null, null, null, null, null, {
|
|
307
309
|
isBulk: !0,
|
|
308
310
|
rows: o
|
|
309
|
-
})),
|
|
311
|
+
})), k({}), G({}), H(null);
|
|
310
312
|
}, [
|
|
313
|
+
h,
|
|
311
314
|
u,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
j,
|
|
315
|
+
_,
|
|
316
|
+
B,
|
|
315
317
|
X,
|
|
316
318
|
fe,
|
|
317
|
-
|
|
319
|
+
$,
|
|
318
320
|
a
|
|
319
|
-
]),
|
|
321
|
+
]), Gl = i(
|
|
320
322
|
(e) => {
|
|
321
|
-
if (
|
|
322
|
-
const t =
|
|
323
|
-
t &&
|
|
323
|
+
if (P) return;
|
|
324
|
+
const t = h[e];
|
|
325
|
+
t && W && W({ [e]: t }), k((l) => {
|
|
324
326
|
const r = { ...l };
|
|
325
327
|
return delete r[e], r;
|
|
326
328
|
}), G((l) => {
|
|
@@ -328,92 +330,92 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
328
330
|
return Object.keys(r).forEach((o) => {
|
|
329
331
|
o.startsWith(`${e}-`) && delete r[o];
|
|
330
332
|
}), r;
|
|
331
|
-
}),
|
|
333
|
+
}), H(null);
|
|
332
334
|
},
|
|
333
|
-
[
|
|
334
|
-
),
|
|
335
|
+
[P, W, h]
|
|
336
|
+
), Xl = i(
|
|
335
337
|
(e) => {
|
|
336
|
-
const t =
|
|
338
|
+
const t = h[e];
|
|
337
339
|
if (!t || Object.keys(t).length === 0) return;
|
|
338
|
-
const { hasErrors: l, updatedEdits: r, firstError: o, errorTypes:
|
|
340
|
+
const { hasErrors: l, updatedEdits: r, firstError: o, errorTypes: d } = X({ [e]: t });
|
|
339
341
|
if (l) {
|
|
340
|
-
if (
|
|
341
|
-
...
|
|
342
|
+
if (k((w) => ({
|
|
343
|
+
...w,
|
|
342
344
|
[e]: r[e]
|
|
343
345
|
})), a?.showNotification?.(
|
|
344
346
|
"error",
|
|
345
|
-
fe(
|
|
347
|
+
fe(d)
|
|
346
348
|
), o) {
|
|
347
|
-
const
|
|
349
|
+
const w = u.findIndex(
|
|
348
350
|
(S) => S.id === o.rowId
|
|
349
351
|
);
|
|
350
|
-
|
|
352
|
+
$(o.rowId, o.columnKey, w);
|
|
351
353
|
}
|
|
352
354
|
return;
|
|
353
355
|
}
|
|
354
|
-
const F =
|
|
355
|
-
(
|
|
356
|
+
const F = u.find(
|
|
357
|
+
(w) => w.id === e
|
|
356
358
|
);
|
|
357
359
|
if (!F) return;
|
|
358
360
|
const f = { ...F }, y = {};
|
|
359
|
-
Object.entries(t).forEach(([
|
|
360
|
-
f[
|
|
361
|
+
Object.entries(t).forEach(([w, S]) => {
|
|
362
|
+
f[w] = S.value, y[w] = { value: S.value, meta: S.meta };
|
|
361
363
|
});
|
|
362
364
|
const L = { ...f, __editedFields: y };
|
|
363
|
-
|
|
365
|
+
B ? B([L]) : _ && _(null, null, null, null, null, {
|
|
364
366
|
isBulk: !0,
|
|
365
367
|
rows: [L]
|
|
366
|
-
}),
|
|
367
|
-
const S = { ...
|
|
368
|
+
}), k((w) => {
|
|
369
|
+
const S = { ...w };
|
|
368
370
|
return delete S[e], S;
|
|
369
|
-
}), G((
|
|
370
|
-
const S = { ...
|
|
371
|
-
return Object.keys(S).forEach((
|
|
372
|
-
|
|
371
|
+
}), G((w) => {
|
|
372
|
+
const S = { ...w };
|
|
373
|
+
return Object.keys(S).forEach((It) => {
|
|
374
|
+
It.startsWith(`${e}-`) && delete S[It];
|
|
373
375
|
}), S;
|
|
374
|
-
}),
|
|
376
|
+
}), H(null);
|
|
375
377
|
},
|
|
376
378
|
[
|
|
379
|
+
h,
|
|
377
380
|
u,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
j,
|
|
381
|
+
_,
|
|
382
|
+
B,
|
|
381
383
|
X,
|
|
382
384
|
fe,
|
|
383
|
-
|
|
385
|
+
$,
|
|
384
386
|
a
|
|
385
387
|
]
|
|
386
|
-
),
|
|
388
|
+
), z = C(() => Object.values(h).reduce(
|
|
387
389
|
(e, t) => e + Object.keys(t).length,
|
|
388
390
|
0
|
|
389
|
-
), [
|
|
391
|
+
), [h]);
|
|
390
392
|
T(() => {
|
|
391
|
-
|
|
392
|
-
}, [
|
|
393
|
-
const
|
|
393
|
+
lt?.(z > 0, z);
|
|
394
|
+
}, [z, lt]);
|
|
395
|
+
const Yl = C(() => {
|
|
394
396
|
const e = [];
|
|
395
|
-
return Object.entries(
|
|
396
|
-
const r =
|
|
397
|
+
return Object.entries(h).forEach(([t, l]) => {
|
|
398
|
+
const r = u.findIndex(
|
|
397
399
|
(o) => o.id === t
|
|
398
400
|
);
|
|
399
|
-
Object.entries(l).forEach(([o,
|
|
400
|
-
const F =
|
|
401
|
+
Object.entries(l).forEach(([o, d]) => {
|
|
402
|
+
const F = v.find((f) => f.key === o);
|
|
401
403
|
e.push({
|
|
402
404
|
rowId: t,
|
|
403
405
|
columnKey: o,
|
|
404
406
|
fieldName: F?.Header || F?.display_name || o,
|
|
405
|
-
value:
|
|
406
|
-
originalValue:
|
|
407
|
-
meta:
|
|
408
|
-
originalMeta:
|
|
407
|
+
value: d.value,
|
|
408
|
+
originalValue: d.originalValue,
|
|
409
|
+
meta: d.meta,
|
|
410
|
+
originalMeta: d.originalMeta,
|
|
409
411
|
rowIndex: r
|
|
410
412
|
});
|
|
411
413
|
});
|
|
412
414
|
}), e;
|
|
413
|
-
}, [
|
|
415
|
+
}, [h, v, u]), Zl = C(() => {
|
|
414
416
|
const e = /* @__PURE__ */ new Map();
|
|
415
|
-
return Object.entries(
|
|
416
|
-
const r =
|
|
417
|
+
return Object.entries(h).forEach(([t, l]) => {
|
|
418
|
+
const r = u.findIndex(
|
|
417
419
|
(o) => o.id === t
|
|
418
420
|
);
|
|
419
421
|
e.set(t, {
|
|
@@ -424,164 +426,167 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
424
426
|
}), Array.from(e.values()).sort(
|
|
425
427
|
(t, l) => t.rowIndex - l.rowIndex
|
|
426
428
|
);
|
|
427
|
-
}, [
|
|
428
|
-
(e) =>
|
|
429
|
+
}, [h, u]), Ql = i(
|
|
430
|
+
(e) => ut(e),
|
|
429
431
|
[]
|
|
430
|
-
), ve =
|
|
431
|
-
() =>
|
|
432
|
+
), ve = i(
|
|
433
|
+
() => ut(null),
|
|
432
434
|
[]
|
|
433
|
-
),
|
|
435
|
+
), Kl = i(
|
|
434
436
|
(e, t) => {
|
|
435
|
-
|
|
437
|
+
ht({ value: e, reference: t }), R?.onSelected && R.onSelected(e, t), ve();
|
|
436
438
|
},
|
|
437
439
|
[R, ve]
|
|
438
|
-
),
|
|
439
|
-
() =>
|
|
440
|
+
), er = i(
|
|
441
|
+
() => ht(null),
|
|
440
442
|
[]
|
|
441
|
-
),
|
|
442
|
-
(e) =>
|
|
443
|
+
), tr = i(
|
|
444
|
+
(e) => pt(e),
|
|
443
445
|
[]
|
|
444
|
-
),
|
|
445
|
-
() =>
|
|
446
|
+
), Dt = i(
|
|
447
|
+
() => pt(null),
|
|
448
|
+
[]
|
|
449
|
+
), lr = i(
|
|
450
|
+
(e) => ft(e),
|
|
446
451
|
[]
|
|
447
|
-
),
|
|
452
|
+
), Nt = i(() => ft(null), []), rr = i(
|
|
448
453
|
(e, t) => {
|
|
449
454
|
G((l) => ({ ...l, [e]: t }));
|
|
450
455
|
},
|
|
451
456
|
[]
|
|
452
|
-
),
|
|
457
|
+
), nr = i(
|
|
453
458
|
(e) => Ve[e],
|
|
454
459
|
[Ve]
|
|
455
|
-
),
|
|
460
|
+
), sr = C(() => {
|
|
456
461
|
const e = oe.match(/h-\[(\d+px)\]/);
|
|
457
462
|
if (e) return e[1];
|
|
458
463
|
const t = oe.match(/h-\[(calc\(.+\))\]/);
|
|
459
464
|
if (t)
|
|
460
465
|
return t[1].replace(/([+-])/g, " $1 ").replace(/\s+/g, " ");
|
|
461
|
-
}, [oe]),
|
|
462
|
-
isEmpty:
|
|
463
|
-
isFilters:
|
|
466
|
+
}, [oe]), or = {
|
|
467
|
+
isEmpty: ot,
|
|
468
|
+
isFilters: U,
|
|
464
469
|
isColumnConfigurable: ne,
|
|
465
470
|
handleOnClick: se,
|
|
466
471
|
emptyMessage: Je,
|
|
467
|
-
buttons:
|
|
468
|
-
noDataWidget:
|
|
469
|
-
},
|
|
470
|
-
() =>
|
|
471
|
-
[
|
|
472
|
-
),
|
|
472
|
+
buttons: Xe,
|
|
473
|
+
noDataWidget: Ge
|
|
474
|
+
}, ar = a?.t?.(Wt) ?? Wt, we = U ? "No Results Found" : Je || "No Data Found", ir = typeof we == "string" ? a?.t?.(we) ?? we : we, Ot = { __isLoading: !0 }, cr = new Array(1).fill(Ot), dr = new Array(rl).fill(Ot), Y = C(
|
|
475
|
+
() => v.filter((e) => !!e?.visible),
|
|
476
|
+
[v]
|
|
477
|
+
), ur = $r(
|
|
473
478
|
{
|
|
474
|
-
columns:
|
|
479
|
+
columns: vl ? Y : v,
|
|
475
480
|
data: [
|
|
476
|
-
...
|
|
477
|
-
...re ?
|
|
481
|
+
...u,
|
|
482
|
+
...re ? u?.length ? cr : dr : []
|
|
478
483
|
],
|
|
479
484
|
defaultColumn: {
|
|
480
|
-
minWidth:
|
|
481
|
-
width:
|
|
482
|
-
maxWidth:
|
|
485
|
+
minWidth: sn,
|
|
486
|
+
width: nn,
|
|
487
|
+
maxWidth: rn
|
|
483
488
|
}
|
|
484
489
|
},
|
|
485
|
-
|
|
486
|
-
), { getTableProps:
|
|
487
|
-
|
|
488
|
-
const
|
|
490
|
+
zr
|
|
491
|
+
), { getTableProps: At, getTableBodyProps: Et, headerGroups: Fe, prepareRow: Rt, rows: I } = ur;
|
|
492
|
+
Ft.current = Fe;
|
|
493
|
+
const hr = JSON.stringify(
|
|
489
494
|
Fe[0]?.headers?.map(
|
|
490
495
|
(e) => e?.Header
|
|
491
496
|
)
|
|
492
497
|
);
|
|
493
498
|
T(() => {
|
|
494
499
|
if (Ae) {
|
|
495
|
-
const e =
|
|
500
|
+
const e = Ft.current;
|
|
496
501
|
Ae?.(
|
|
497
502
|
e?.[0]?.headers?.map((t) => t?.Header) ?? []
|
|
498
503
|
);
|
|
499
504
|
}
|
|
500
|
-
}, [
|
|
501
|
-
const { checkboxConfig:
|
|
505
|
+
}, [hr, Ae]);
|
|
506
|
+
const { checkboxConfig: We } = Rr({
|
|
502
507
|
rows: I,
|
|
503
|
-
checkedIds:
|
|
504
|
-
isCheckAllDisabled:
|
|
505
|
-
selectionDisabledRowIds:
|
|
506
|
-
rawData:
|
|
507
|
-
onAllChecked:
|
|
508
|
-
setCheckedIds:
|
|
509
|
-
checkboxMetadata:
|
|
510
|
-
}),
|
|
511
|
-
|
|
512
|
-
activationConstraint: { distance:
|
|
508
|
+
checkedIds: j?.checkedIds,
|
|
509
|
+
isCheckAllDisabled: j?.isCheckAllDisabled,
|
|
510
|
+
selectionDisabledRowIds: j?.selectionDisabledRowIds,
|
|
511
|
+
rawData: et,
|
|
512
|
+
onAllChecked: gl,
|
|
513
|
+
setCheckedIds: j?.setCheckedIds,
|
|
514
|
+
checkboxMetadata: j?.checkboxMetadata
|
|
515
|
+
}), mr = Ir(
|
|
516
|
+
Vt(Lr, {
|
|
517
|
+
activationConstraint: { distance: Pt }
|
|
513
518
|
}),
|
|
514
|
-
|
|
515
|
-
activationConstraint: { distance:
|
|
519
|
+
Vt(gr, {
|
|
520
|
+
activationConstraint: { distance: Pt }
|
|
516
521
|
})
|
|
517
|
-
),
|
|
518
|
-
easing:
|
|
519
|
-
duration:
|
|
522
|
+
), pr = {
|
|
523
|
+
easing: dn,
|
|
524
|
+
duration: cn
|
|
520
525
|
};
|
|
521
|
-
function
|
|
522
|
-
return !
|
|
526
|
+
function fr() {
|
|
527
|
+
return !Qe?.length || !ye ? I : Qe.reduce(
|
|
523
528
|
(e, t) => (e[t] = I.filter(
|
|
524
529
|
(l) => l.original?.type === t
|
|
525
530
|
), e),
|
|
526
531
|
{}
|
|
527
532
|
);
|
|
528
533
|
}
|
|
529
|
-
|
|
530
|
-
const
|
|
534
|
+
bt.current = fr;
|
|
535
|
+
const vr = (e) => {
|
|
531
536
|
const { active: t } = e;
|
|
532
537
|
Ie(
|
|
533
538
|
I.find(
|
|
534
539
|
(l) => l.original?.id === t?.id
|
|
535
540
|
) ?? null
|
|
536
541
|
);
|
|
537
|
-
},
|
|
542
|
+
}, wr = (e) => {
|
|
538
543
|
const { active: t, over: l } = e;
|
|
539
544
|
l && (ie?.checkDndDragEnd && ie.checkDndDragEnd(
|
|
540
545
|
t,
|
|
541
546
|
l,
|
|
542
|
-
|
|
547
|
+
Bl,
|
|
543
548
|
(r) => {
|
|
544
|
-
|
|
549
|
+
it(r), ct(!0), ie.onDragSuccess?.({
|
|
545
550
|
draggedId: t.id,
|
|
546
551
|
droppedId: l.id,
|
|
547
552
|
draggedType: t.data.current?.type,
|
|
548
553
|
droppedType: l.data.current?.type,
|
|
549
554
|
updatedList: r,
|
|
550
|
-
cb: () =>
|
|
555
|
+
cb: () => ct(!1)
|
|
551
556
|
});
|
|
552
557
|
}
|
|
553
558
|
), Ie(null));
|
|
554
|
-
},
|
|
555
|
-
!
|
|
556
|
-
},
|
|
557
|
-
|
|
558
|
-
},
|
|
559
|
-
|
|
560
|
-
}, [
|
|
561
|
-
|
|
562
|
-
}, []),
|
|
563
|
-
() =>
|
|
559
|
+
}, Fr = () => Ie(null), Sr = (e) => {
|
|
560
|
+
!p?.onSort && !n?.onFilter || de(at === e ? null : e);
|
|
561
|
+
}, br = (e) => {
|
|
562
|
+
Il(e), _l(!kl), de(null);
|
|
563
|
+
}, He = i(() => {
|
|
564
|
+
p?.onRemoveSort ? p.onRemoveSort() : p?.onSort && p.onSort("", "");
|
|
565
|
+
}, [p]), Se = i((e = null) => {
|
|
566
|
+
st(e), ke((t) => e ? !0 : !t);
|
|
567
|
+
}, []), $e = i(
|
|
568
|
+
() => nt((e) => !e),
|
|
564
569
|
[]
|
|
565
|
-
),
|
|
570
|
+
), xr = () => {
|
|
566
571
|
const e = Fe[0]?.headers?.filter((t) => t?.visible !== !1);
|
|
567
572
|
for (let t = 0; t < e.length; t++)
|
|
568
573
|
if (e[t].sticky) return t - 1;
|
|
569
574
|
return e.length - 1;
|
|
570
|
-
},
|
|
575
|
+
}, yr = i(
|
|
571
576
|
(e) => {
|
|
572
577
|
let t = 0;
|
|
573
578
|
for (let l = e + 1; l < Y.length; l++)
|
|
574
579
|
Y[l].visible !== !1 && (t += Y[l].width ?? 0);
|
|
575
|
-
return ce && (t += Oe ||
|
|
580
|
+
return ce && (t += Oe || on), V && (t += qe ? 0 : an), t;
|
|
576
581
|
},
|
|
577
582
|
[
|
|
578
583
|
Y,
|
|
579
584
|
Oe,
|
|
580
585
|
qe,
|
|
581
586
|
ce,
|
|
582
|
-
|
|
587
|
+
V
|
|
583
588
|
]
|
|
584
|
-
),
|
|
589
|
+
), kt = () => {
|
|
585
590
|
const e = a?.getUserId?.();
|
|
586
591
|
return {
|
|
587
592
|
...x || {},
|
|
@@ -602,10 +607,10 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
602
607
|
}))
|
|
603
608
|
};
|
|
604
609
|
};
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
const l =
|
|
608
|
-
|
|
610
|
+
St.current = kt;
|
|
611
|
+
const Tr = (e, t) => {
|
|
612
|
+
const l = kt();
|
|
613
|
+
q({
|
|
609
614
|
...l,
|
|
610
615
|
columns: l?.columns?.map(
|
|
611
616
|
(r) => r.name === e ? { ...r, width: t } : r
|
|
@@ -614,13 +619,13 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
614
619
|
});
|
|
615
620
|
};
|
|
616
621
|
T(() => {
|
|
617
|
-
if (n?.columnFilters?.length > 0 &&
|
|
622
|
+
if (n?.columnFilters?.length > 0 && ke(!0), M) return;
|
|
618
623
|
const e = Be.current;
|
|
619
624
|
if (JSON.stringify(e?.filters || []) !== JSON.stringify(n?.columnFilters || [])) {
|
|
620
625
|
const t = (e?.filters?.length ?? 0) > 0, l = n?.columnFilters?.length > 0;
|
|
621
626
|
if (!(t && !l && !me.current)) {
|
|
622
|
-
const o =
|
|
623
|
-
|
|
627
|
+
const o = St.current();
|
|
628
|
+
q({
|
|
624
629
|
...o,
|
|
625
630
|
filters: JSON.parse(
|
|
626
631
|
JSON.stringify(n?.columnFilters || [])
|
|
@@ -631,34 +636,34 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
631
636
|
me.current = !1;
|
|
632
637
|
}
|
|
633
638
|
}, [n?.columnFilters, M]);
|
|
634
|
-
const
|
|
639
|
+
const Dr = i(
|
|
635
640
|
(e) => {
|
|
636
641
|
me.current = !0, n?.onRemoveFilter?.(e);
|
|
637
642
|
},
|
|
638
643
|
[n?.onRemoveFilter]
|
|
639
|
-
),
|
|
644
|
+
), Nr = i(() => {
|
|
640
645
|
me.current = !0, n?.onClearFilter?.();
|
|
641
646
|
}, [n?.onClearFilter]);
|
|
642
647
|
T(() => {
|
|
643
|
-
|
|
644
|
-
}, [
|
|
648
|
+
p?.columnSort?.field ? (nt(!0), p.columnSort.order === "asc" ? (ue(p.columnSort.field), he(null)) : p.columnSort.order === "desc" && (he(p.columnSort.field), ue(null))) : (ue(null), he(null));
|
|
649
|
+
}, [p?.columnSort?.field, p?.columnSort?.order]), T(() => {
|
|
645
650
|
Me(
|
|
646
|
-
|
|
651
|
+
Lt(
|
|
647
652
|
Be.current?.columns || [],
|
|
648
653
|
A
|
|
649
654
|
)
|
|
650
655
|
);
|
|
651
656
|
}, [A]), T(() => {
|
|
652
|
-
x?.unsaved &&
|
|
657
|
+
x?.unsaved && vt.current?.persistTableView?.(x);
|
|
653
658
|
}, [x]), T(() => {
|
|
654
|
-
|
|
655
|
-
|
|
659
|
+
it(
|
|
660
|
+
bt.current()
|
|
656
661
|
);
|
|
657
662
|
}, [I.length]), T(() => {
|
|
658
|
-
|
|
659
|
-
|
|
663
|
+
q(N || null), N?.columns && Me(
|
|
664
|
+
Lt(
|
|
660
665
|
N?.columns || [],
|
|
661
|
-
|
|
666
|
+
wt.current
|
|
662
667
|
)
|
|
663
668
|
), N?.filters && N.filters.length > 0 && !je.current ? (requestAnimationFrame(() => {
|
|
664
669
|
pe.current?.onFilter?.(N.filters);
|
|
@@ -666,7 +671,7 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
666
671
|
}, [N]), T(() => {
|
|
667
672
|
if (Le.current) {
|
|
668
673
|
const e = new ResizeObserver(
|
|
669
|
-
(t) =>
|
|
674
|
+
(t) => Wl(t[0].contentRect.width)
|
|
670
675
|
);
|
|
671
676
|
return e.observe(Le.current), () => e.disconnect();
|
|
672
677
|
}
|
|
@@ -674,68 +679,68 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
674
679
|
if (!ge.current) return;
|
|
675
680
|
const e = new ResizeObserver((t) => {
|
|
676
681
|
const { width: l, height: r } = t[0].contentRect;
|
|
677
|
-
|
|
682
|
+
Hl({ width: l, height: r });
|
|
678
683
|
});
|
|
679
684
|
return e.observe(ge.current), () => e.disconnect();
|
|
680
685
|
}, []);
|
|
681
|
-
const
|
|
682
|
-
|
|
686
|
+
const _t = /* @__PURE__ */ s(
|
|
687
|
+
Xr,
|
|
683
688
|
{
|
|
684
|
-
isResizable:
|
|
689
|
+
isResizable: el,
|
|
685
690
|
headerGroups: Fe,
|
|
686
|
-
isCheckbox:
|
|
687
|
-
checkboxConfig:
|
|
688
|
-
isAllChecked:
|
|
689
|
-
showHeaderOptions:
|
|
691
|
+
isCheckbox: El,
|
|
692
|
+
checkboxConfig: We,
|
|
693
|
+
isAllChecked: Ll,
|
|
694
|
+
showHeaderOptions: at ?? "",
|
|
690
695
|
setShowHeaderOptions: de,
|
|
691
|
-
isShowSortArrowAsc:
|
|
692
|
-
isShowSortArrowDesc:
|
|
693
|
-
onSort:
|
|
696
|
+
isShowSortArrowAsc: Vl,
|
|
697
|
+
isShowSortArrowDesc: jl,
|
|
698
|
+
onSort: p?.onSort,
|
|
694
699
|
onFilter: n?.onFilter,
|
|
695
|
-
toggleHeaderOption:
|
|
700
|
+
toggleHeaderOption: Sr,
|
|
696
701
|
setIsShowSortArrowAsc: ue,
|
|
697
702
|
setIsShowSortArrowDesc: he,
|
|
698
703
|
toggleDataFilterModal: Se,
|
|
699
|
-
rowOptions: Array.isArray(
|
|
704
|
+
rowOptions: Array.isArray(V) ? V : [],
|
|
700
705
|
isColumnConfigurable: ne ?? !1,
|
|
701
706
|
onAddColumnClick: se,
|
|
702
|
-
onEditColumnClick:
|
|
703
|
-
onDeleteColumnClick:
|
|
707
|
+
onEditColumnClick: Ye,
|
|
708
|
+
onDeleteColumnClick: Ze,
|
|
704
709
|
tableActions: Ue || null,
|
|
705
710
|
isLoading: re,
|
|
706
711
|
rowAdditionalActions: ce ?? null,
|
|
707
|
-
showPendingEditsColumn:
|
|
712
|
+
showPendingEditsColumn: z > 0
|
|
708
713
|
}
|
|
709
|
-
),
|
|
710
|
-
|
|
714
|
+
), Mt = /* @__PURE__ */ b(Er, { children: [
|
|
715
|
+
Pl || ul ? /* @__PURE__ */ s("div", { className: "absolute left-0 top-0 w-full h-full z-40 flex items-center justify-center bg-neutral-100 dark:bg-black-700" }) : null,
|
|
711
716
|
/* @__PURE__ */ s(
|
|
712
717
|
"div",
|
|
713
718
|
{
|
|
714
|
-
...
|
|
719
|
+
...At(),
|
|
715
720
|
className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",
|
|
716
|
-
children:
|
|
717
|
-
|
|
718
|
-
/* @__PURE__ */ s("div", { className: "absolute w-full", children: a?.renderEmpty ? a.renderEmpty(
|
|
719
|
-
|
|
720
|
-
ne && !
|
|
721
|
-
|
|
721
|
+
children: ot ? /* @__PURE__ */ b("div", { className: "z-10", children: [
|
|
722
|
+
_t,
|
|
723
|
+
/* @__PURE__ */ s("div", { className: "absolute w-full", children: a?.renderEmpty ? a.renderEmpty(or) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center w-full h-[12rem] text-neutral-900 dark:text-neutral-200 mt-8", children: [
|
|
724
|
+
Ge && !U ? /* @__PURE__ */ s(mn, { widgetType: "TABLE" }) : /* @__PURE__ */ s(pn, { text: ir }),
|
|
725
|
+
ne && !U ? /* @__PURE__ */ s("div", { className: "my-4", children: /* @__PURE__ */ b(
|
|
726
|
+
gt,
|
|
722
727
|
{
|
|
723
728
|
id: "btn-table-shell-create-column",
|
|
724
729
|
status: "primary",
|
|
725
730
|
appearance: "ghost",
|
|
726
731
|
onClick: se,
|
|
727
732
|
children: [
|
|
728
|
-
/* @__PURE__ */ s(
|
|
733
|
+
/* @__PURE__ */ s(fn, { className: "text-white dark:text-white" }),
|
|
729
734
|
" ",
|
|
730
|
-
|
|
735
|
+
ar
|
|
731
736
|
]
|
|
732
737
|
}
|
|
733
738
|
) }) : null,
|
|
734
|
-
!
|
|
735
|
-
|
|
739
|
+
!U && Xe?.map((e, t) => /* @__PURE__ */ s(
|
|
740
|
+
gt,
|
|
736
741
|
{
|
|
737
742
|
status: "secondary",
|
|
738
|
-
id:
|
|
743
|
+
id: wn(e.label, t),
|
|
739
744
|
onClick: e.onClick,
|
|
740
745
|
children: a?.t?.(e.label) ?? e.label
|
|
741
746
|
},
|
|
@@ -743,20 +748,20 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
743
748
|
))
|
|
744
749
|
] }) })
|
|
745
750
|
] }) : /* @__PURE__ */ s(
|
|
746
|
-
|
|
751
|
+
vn,
|
|
747
752
|
{
|
|
748
753
|
style: { width: "100%", height: "100%" },
|
|
749
754
|
renderProp: ({ width: e, height: t }) => {
|
|
750
|
-
const l = e > 0 ? e :
|
|
755
|
+
const l = e > 0 ? e : dt.width, r = t > 0 ? t : dt.height;
|
|
751
756
|
return l > 0 && r > 0 ? /* @__PURE__ */ s(
|
|
752
|
-
|
|
757
|
+
Cr,
|
|
753
758
|
{
|
|
754
|
-
getTableBodyProps:
|
|
759
|
+
getTableBodyProps: Et,
|
|
755
760
|
rows: I,
|
|
756
|
-
prepareRow:
|
|
761
|
+
prepareRow: Rt,
|
|
757
762
|
isLoading: re,
|
|
758
|
-
onScroll:
|
|
759
|
-
onScrolling:
|
|
763
|
+
onScroll: Ct,
|
|
764
|
+
onScrolling: Ut,
|
|
760
765
|
columns: A,
|
|
761
766
|
width: l,
|
|
762
767
|
height: r,
|
|
@@ -769,44 +774,44 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
769
774
|
)
|
|
770
775
|
}
|
|
771
776
|
)
|
|
772
|
-
] }),
|
|
773
|
-
|
|
777
|
+
] }), Or = jt((e, t) => /* @__PURE__ */ b("div", { className: "h-full w-full", ...e, ref: t, children: [
|
|
778
|
+
_t,
|
|
774
779
|
/* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children })
|
|
775
|
-
] })),
|
|
780
|
+
] })), Ar = jt((e, t) => /* @__PURE__ */ s("div", { className: "h-full w-full", ...e, ref: t, children: /* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children }) })), ze = C(() => a?.renderTableHeader ? a.renderTableHeader({
|
|
776
781
|
tableKey: g,
|
|
777
782
|
search: D?.search,
|
|
778
783
|
handleSearch: D?.handleSearch,
|
|
779
784
|
toggleShowFilters: Se,
|
|
780
|
-
toggleShowSorts:
|
|
785
|
+
toggleShowSorts: $e,
|
|
781
786
|
filterCounts: n?.columnFilters?.length,
|
|
782
787
|
columns: A,
|
|
783
788
|
columnFilters: n?.columnFilters,
|
|
784
|
-
setSelectedTableView:
|
|
789
|
+
setSelectedTableView: q,
|
|
785
790
|
selectedTableView: x,
|
|
786
|
-
enableTableView:
|
|
791
|
+
enableTableView: c?.showTableView,
|
|
787
792
|
modelName: Q,
|
|
788
793
|
enableMasterDataEnumSuggestions: K,
|
|
789
794
|
onRemoveFilter: n?.onRemoveFilter,
|
|
790
795
|
onClearFilter: n?.onClearFilter,
|
|
791
796
|
onFilter: n?.onFilter,
|
|
792
|
-
data: le ??
|
|
793
|
-
tableHeaders:
|
|
794
|
-
showTableViewAsModal:
|
|
795
|
-
additionalOptions:
|
|
796
|
-
inlineActions:
|
|
797
|
-
showFilters:
|
|
798
|
-
showSorts:
|
|
799
|
-
showSearch:
|
|
800
|
-
isLoading: !!
|
|
797
|
+
data: le ?? u,
|
|
798
|
+
tableHeaders: v,
|
|
799
|
+
showTableViewAsModal: c?.showTableViewAsModal,
|
|
800
|
+
additionalOptions: c?.additionalOptions,
|
|
801
|
+
inlineActions: c?.inlineActions,
|
|
802
|
+
showFilters: c?.showFilters,
|
|
803
|
+
showSorts: c?.showSorts,
|
|
804
|
+
showSearch: c?.showSearch,
|
|
805
|
+
isLoading: !!c?.isLoading,
|
|
801
806
|
setTableHeaders: Me,
|
|
802
807
|
allowAStarSearch: !!D?.allowAStarSearch,
|
|
803
|
-
withContent: !!
|
|
804
|
-
setShowFilters:
|
|
805
|
-
sort:
|
|
806
|
-
onSort:
|
|
807
|
-
onRemoveSort:
|
|
808
|
-
showExportButton:
|
|
809
|
-
onExportClick:
|
|
808
|
+
withContent: !!c?.content,
|
|
809
|
+
setShowFilters: ke,
|
|
810
|
+
sort: p?.columnSort,
|
|
811
|
+
onSort: p?.onSort,
|
|
812
|
+
onRemoveSort: He,
|
|
813
|
+
showExportButton: c?.showExportButton,
|
|
814
|
+
onExportClick: c?.onExportClick,
|
|
810
815
|
agreementId: ee,
|
|
811
816
|
enumSuggestionsExtraParams: te
|
|
812
817
|
}) : null, [
|
|
@@ -814,22 +819,22 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
814
819
|
D?.search,
|
|
815
820
|
D?.handleSearch,
|
|
816
821
|
Se,
|
|
817
|
-
|
|
822
|
+
$e,
|
|
818
823
|
n?.columnFilters,
|
|
819
824
|
A,
|
|
820
|
-
|
|
825
|
+
q,
|
|
821
826
|
x,
|
|
822
|
-
|
|
827
|
+
c,
|
|
823
828
|
Q,
|
|
824
829
|
n?.onRemoveFilter,
|
|
825
830
|
n?.onClearFilter,
|
|
826
831
|
n?.onFilter,
|
|
827
|
-
|
|
832
|
+
u,
|
|
828
833
|
le,
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
834
|
+
v,
|
|
835
|
+
p?.columnSort,
|
|
836
|
+
p?.onSort,
|
|
837
|
+
He,
|
|
833
838
|
a,
|
|
834
839
|
D?.allowAStarSearch,
|
|
835
840
|
K,
|
|
@@ -837,96 +842,99 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
837
842
|
te
|
|
838
843
|
]);
|
|
839
844
|
return T(() => {
|
|
840
|
-
Ne && Ne(
|
|
841
|
-
}, [
|
|
842
|
-
|
|
845
|
+
Ne && Ne(ze);
|
|
846
|
+
}, [ze, Ne]), /* @__PURE__ */ b(
|
|
847
|
+
qr.Provider,
|
|
843
848
|
{
|
|
844
849
|
value: {
|
|
845
|
-
tableWrapper:
|
|
846
|
-
tableBodyWrapper:
|
|
847
|
-
lastNonStickyColumnIndex:
|
|
850
|
+
tableWrapper: Or,
|
|
851
|
+
tableBodyWrapper: Ar,
|
|
852
|
+
lastNonStickyColumnIndex: xr,
|
|
848
853
|
search: D?.search,
|
|
849
854
|
columnFilters: n?.columnFilters,
|
|
850
|
-
onRowClick:
|
|
851
|
-
onSort:
|
|
855
|
+
onRowClick: $t,
|
|
856
|
+
onSort: p?.onSort,
|
|
852
857
|
onFilter: n?.onFilter,
|
|
853
858
|
toggleShowFilters: Se,
|
|
854
|
-
toggleShowSorts:
|
|
859
|
+
toggleShowSorts: $e,
|
|
855
860
|
onRemoveFilter: n?.onRemoveFilter,
|
|
856
861
|
onClearFilter: n?.onClearFilter,
|
|
857
|
-
rowOptions:
|
|
858
|
-
checkboxConfig:
|
|
862
|
+
rowOptions: V,
|
|
863
|
+
checkboxConfig: We,
|
|
859
864
|
onResetFilter: n?.onResetFilter,
|
|
860
865
|
isColumnConfigurable: ne,
|
|
861
866
|
onAddColumnClick: se,
|
|
862
|
-
onEditColumnClick:
|
|
863
|
-
onDeleteColumnClick:
|
|
864
|
-
onRowTooltipClick:
|
|
865
|
-
tooltiptext:
|
|
866
|
-
cascadingTableConfig:
|
|
867
|
-
activeInlineEdit:
|
|
868
|
-
setActiveInlineEdit:
|
|
869
|
-
originalsOnly:
|
|
870
|
-
disableOptionsForRowIndex:
|
|
871
|
-
getFullRowDataOnClick:
|
|
872
|
-
selectedRowId:
|
|
873
|
-
getSumOfNextVisibleColumnWidth:
|
|
874
|
-
onRowEdit:
|
|
875
|
-
inlineEditColumns:
|
|
867
|
+
onEditColumnClick: Ye,
|
|
868
|
+
onDeleteColumnClick: Ze,
|
|
869
|
+
onRowTooltipClick: qt,
|
|
870
|
+
tooltiptext: Jt,
|
|
871
|
+
cascadingTableConfig: Gt,
|
|
872
|
+
activeInlineEdit: $l,
|
|
873
|
+
setActiveInlineEdit: H,
|
|
874
|
+
originalsOnly: Xt,
|
|
875
|
+
disableOptionsForRowIndex: Yt,
|
|
876
|
+
getFullRowDataOnClick: Zt,
|
|
877
|
+
selectedRowId: Qt,
|
|
878
|
+
getSumOfNextVisibleColumnWidth: yr,
|
|
879
|
+
onRowEdit: _,
|
|
880
|
+
inlineEditColumns: Kt,
|
|
876
881
|
tableActions: Ue,
|
|
877
882
|
dndSortableUtils: ie,
|
|
878
883
|
withSortable: ye,
|
|
879
|
-
withDraggable:
|
|
880
|
-
onCascadingRowExpand:
|
|
881
|
-
getInnerRowData:
|
|
882
|
-
tableHeaders:
|
|
883
|
-
maxLevel:
|
|
884
|
-
expandedRows:
|
|
885
|
-
setExpandedRows:
|
|
886
|
-
showNewItem:
|
|
887
|
-
rawData:
|
|
888
|
-
dragConfig:
|
|
889
|
-
rowWrapper:
|
|
890
|
-
rowLinkConfig:
|
|
891
|
-
isCellClickDisabled:
|
|
884
|
+
withDraggable: tl,
|
|
885
|
+
onCascadingRowExpand: nl,
|
|
886
|
+
getInnerRowData: sl,
|
|
887
|
+
tableHeaders: v,
|
|
888
|
+
maxLevel: ol,
|
|
889
|
+
expandedRows: al,
|
|
890
|
+
setExpandedRows: il,
|
|
891
|
+
showNewItem: cl,
|
|
892
|
+
rawData: et,
|
|
893
|
+
dragConfig: dl,
|
|
894
|
+
rowWrapper: ml,
|
|
895
|
+
rowLinkConfig: pl,
|
|
896
|
+
isCellClickDisabled: fl,
|
|
892
897
|
asyncRowOptionsFilter: n?.asyncRowOptionsFilter,
|
|
893
|
-
handleUpdateColumnWidth:
|
|
898
|
+
handleUpdateColumnWidth: Tr,
|
|
894
899
|
isTableViewReadOnly: M,
|
|
895
|
-
multiSelectConfig:
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
900
|
+
multiSelectConfig: wl,
|
|
901
|
+
cellContextMenuConfig: tt,
|
|
902
|
+
openCellContextMenu: lr,
|
|
903
|
+
closeCellContextMenu: Nt,
|
|
904
|
+
headerContextOptions: Fl,
|
|
905
|
+
showHeaderContextOptions: Sl,
|
|
906
|
+
setShowHeaderContextOptions: bl,
|
|
899
907
|
headerDivWidth: E,
|
|
900
|
-
showDataTypeIcon:
|
|
908
|
+
showDataTypeIcon: xl,
|
|
901
909
|
rowAdditionalActions: ce,
|
|
902
|
-
hoverConfig:
|
|
910
|
+
hoverConfig: Ht,
|
|
903
911
|
rowAdditionalActionsWidth: Oe,
|
|
904
|
-
cellEditing:
|
|
905
|
-
cellEditingValue:
|
|
906
|
-
openMasterDataModal:
|
|
912
|
+
cellEditing: yl,
|
|
913
|
+
cellEditingValue: Tl,
|
|
914
|
+
openMasterDataModal: Ql,
|
|
907
915
|
closeMasterDataModal: ve,
|
|
908
|
-
selectedMasterData:
|
|
909
|
-
clearSelectedMasterData:
|
|
910
|
-
allowInlineEdit:
|
|
911
|
-
openCurrencyDropdown:
|
|
912
|
-
closeCurrencyDropdown:
|
|
913
|
-
currencyDropdownConfig:
|
|
916
|
+
selectedMasterData: zl,
|
|
917
|
+
clearSelectedMasterData: er,
|
|
918
|
+
allowInlineEdit: Dl,
|
|
919
|
+
openCurrencyDropdown: tr,
|
|
920
|
+
closeCurrencyDropdown: Dt,
|
|
921
|
+
currencyDropdownConfig: mt,
|
|
914
922
|
selectedCurrenciesMap: Ve,
|
|
915
|
-
setCurrencyForCell:
|
|
916
|
-
getCurrencyForCell:
|
|
917
|
-
pendingEdits:
|
|
923
|
+
setCurrencyForCell: rr,
|
|
924
|
+
getCurrencyForCell: nr,
|
|
925
|
+
pendingEdits: h,
|
|
918
926
|
addPendingEdit: Pe,
|
|
919
|
-
removePendingEdit:
|
|
920
|
-
getPendingEdit:
|
|
921
|
-
hasPendingEdit:
|
|
922
|
-
clearAllPendingEdits:
|
|
923
|
-
saveAllPendingEdits:
|
|
924
|
-
clearRowPendingEdits:
|
|
925
|
-
saveRowPendingEdits:
|
|
926
|
-
pendingEditsCount:
|
|
927
|
-
scrollToCell:
|
|
928
|
-
onFieldOperationFlow:
|
|
929
|
-
fieldOperationLoading:
|
|
927
|
+
removePendingEdit: Ul,
|
|
928
|
+
getPendingEdit: ql,
|
|
929
|
+
hasPendingEdit: Jl,
|
|
930
|
+
clearAllPendingEdits: yt,
|
|
931
|
+
saveAllPendingEdits: Tt,
|
|
932
|
+
clearRowPendingEdits: Gl,
|
|
933
|
+
saveRowPendingEdits: Xl,
|
|
934
|
+
pendingEditsCount: z,
|
|
935
|
+
scrollToCell: $,
|
|
936
|
+
onFieldOperationFlow: Nl,
|
|
937
|
+
fieldOperationLoading: P,
|
|
930
938
|
validateAllPendingEdits: X
|
|
931
939
|
},
|
|
932
940
|
children: [
|
|
@@ -939,13 +947,13 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
939
947
|
/* @__PURE__ */ b(
|
|
940
948
|
"div",
|
|
941
949
|
{
|
|
942
|
-
className: `flex items-center gap-x-2 gap-y-1 ${E < Z ? "w-full flex-wrap" : ""} ${
|
|
950
|
+
className: `flex items-center gap-x-2 gap-y-1 ${E < Z ? "w-full flex-wrap" : ""} ${c?.content ? "min-w-0 flex-1" : "shrink-0"}`,
|
|
943
951
|
children: [
|
|
944
|
-
|
|
952
|
+
c?.content ? /* @__PURE__ */ s(
|
|
945
953
|
"div",
|
|
946
954
|
{
|
|
947
955
|
className: `min-w-0 ${E < Z ? "w-full" : "flex-1"}`,
|
|
948
|
-
children:
|
|
956
|
+
children: c.content
|
|
949
957
|
}
|
|
950
958
|
) : null,
|
|
951
959
|
Te ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
@@ -977,7 +985,7 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
977
985
|
size: "small",
|
|
978
986
|
variant: "semibold",
|
|
979
987
|
appearance: "title",
|
|
980
|
-
children: (
|
|
988
|
+
children: (Ke ?? u.length).toLocaleString()
|
|
981
989
|
}
|
|
982
990
|
),
|
|
983
991
|
/* @__PURE__ */ s(
|
|
@@ -989,28 +997,28 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
989
997
|
children: "total records"
|
|
990
998
|
}
|
|
991
999
|
)
|
|
992
|
-
] }) :
|
|
1000
|
+
] }) : c?.preContent ? /* @__PURE__ */ s("div", { className: "flex min-w-0 shrink-0 justify-start items-center", children: c.preContent }) : null
|
|
993
1001
|
]
|
|
994
1002
|
}
|
|
995
1003
|
),
|
|
996
1004
|
/* @__PURE__ */ b(
|
|
997
1005
|
"div",
|
|
998
1006
|
{
|
|
999
|
-
className: `flex min-w-0 items-center justify-end ${E < Z ? "w-full" :
|
|
1007
|
+
className: `flex min-w-0 items-center justify-end ${E < Z ? "w-full" : c?.content ? "shrink-0" : "flex-1"} ${E < Ce ? "flex-col" : "flex-row flex-wrap"} ${c?.postContent ? "gap-2" : ""}`,
|
|
1000
1008
|
children: [
|
|
1001
|
-
Te &&
|
|
1009
|
+
Te && c?.preContent ? /* @__PURE__ */ s("div", { className: "flex w-full justify-start items-center", children: c.preContent }) : null,
|
|
1002
1010
|
/* @__PURE__ */ s(
|
|
1003
1011
|
"div",
|
|
1004
1012
|
{
|
|
1005
|
-
className: `flex justify-end items-center min-w-0 ${E <
|
|
1006
|
-
children:
|
|
1013
|
+
className: `flex justify-end items-center min-w-0 ${E < Ce || E < Z ? "w-full" : ""}`,
|
|
1014
|
+
children: ze
|
|
1007
1015
|
}
|
|
1008
1016
|
),
|
|
1009
|
-
|
|
1017
|
+
c?.postContent ? /* @__PURE__ */ s(
|
|
1010
1018
|
"div",
|
|
1011
1019
|
{
|
|
1012
|
-
className: `flex justify-end items-center ${E <
|
|
1013
|
-
children:
|
|
1020
|
+
className: `flex justify-end items-center ${E < Ce ? "w-full" : ""}`,
|
|
1021
|
+
children: c.postContent
|
|
1014
1022
|
}
|
|
1015
1023
|
) : null
|
|
1016
1024
|
]
|
|
@@ -1019,48 +1027,48 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1019
1027
|
]
|
|
1020
1028
|
}
|
|
1021
1029
|
) : null,
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
sort:
|
|
1026
|
-
onRemoveSort:
|
|
1027
|
-
onSort:
|
|
1028
|
-
tableHeaders:
|
|
1029
|
-
data:
|
|
1030
|
+
c?.showDivider ? /* @__PURE__ */ s("div", { className: "border-b pb-2 w-full dark:bg-black-800" }) : null,
|
|
1031
|
+
zt && (Re || _e) ? /* @__PURE__ */ s("div", { className: "flex justify-between items-center pb-4 dark:bg-black-800", children: /* @__PURE__ */ b("div", { className: "flex gap-2 items-center", children: [
|
|
1032
|
+
_e && a?.renderSortItem ? a.renderSortItem({
|
|
1033
|
+
sort: p?.columnSort,
|
|
1034
|
+
onRemoveSort: He,
|
|
1035
|
+
onSort: p?.onSort,
|
|
1036
|
+
tableHeaders: v,
|
|
1037
|
+
data: u,
|
|
1030
1038
|
disabled: M
|
|
1031
1039
|
}) : null,
|
|
1032
|
-
Re &&
|
|
1040
|
+
Re && _e && p?.columnSort?.field !== "" ? /* @__PURE__ */ s("div", { className: "h-8 w-[1px] flex-shrink-0 bg-neutral-200" }) : null,
|
|
1033
1041
|
Re ? /* @__PURE__ */ b("div", { className: "flex gap-2 items-center", children: [
|
|
1034
|
-
(
|
|
1042
|
+
(rt || n?.onResetFilter) && a?.renderActiveFilters && a.renderActiveFilters({
|
|
1035
1043
|
filters: n?.columnFilters,
|
|
1036
|
-
onRemoveFilter:
|
|
1037
|
-
onClearFilter:
|
|
1044
|
+
onRemoveFilter: Dr,
|
|
1045
|
+
onClearFilter: Nr,
|
|
1038
1046
|
onResetFilter: n?.onResetFilter,
|
|
1039
1047
|
onFilter: n?.onFilter,
|
|
1040
|
-
tableHeaders:
|
|
1048
|
+
tableHeaders: v,
|
|
1041
1049
|
columnFilters: n?.columnFilters,
|
|
1042
1050
|
modelName: Q,
|
|
1043
1051
|
enableMasterDataEnumSuggestions: K,
|
|
1044
1052
|
noSpacing: !0,
|
|
1045
1053
|
notionStyle: n?.notionStyle,
|
|
1046
1054
|
context: n?.context,
|
|
1047
|
-
data: le ??
|
|
1055
|
+
data: le ?? u,
|
|
1048
1056
|
agreementId: ee,
|
|
1049
1057
|
enumSuggestionsExtraParams: te,
|
|
1050
1058
|
disabled: M
|
|
1051
1059
|
}),
|
|
1052
1060
|
a?.renderFilterButtons && a.renderFilterButtons({
|
|
1053
1061
|
onClearFilter: n?.onClearFilter,
|
|
1054
|
-
onClose:
|
|
1062
|
+
onClose: br,
|
|
1055
1063
|
modelName: Q,
|
|
1056
1064
|
enableMasterDataEnumSuggestions: K,
|
|
1057
|
-
defaultFilterColumn:
|
|
1058
|
-
resetDefaultFilterColumn: () =>
|
|
1059
|
-
column:
|
|
1065
|
+
defaultFilterColumn: Rl,
|
|
1066
|
+
resetDefaultFilterColumn: () => st(null),
|
|
1067
|
+
column: Ml,
|
|
1060
1068
|
onFilter: n?.onFilter,
|
|
1061
|
-
tableHeaders:
|
|
1069
|
+
tableHeaders: v,
|
|
1062
1070
|
columnFilters: n?.columnFilters,
|
|
1063
|
-
data: le ??
|
|
1071
|
+
data: le ?? u,
|
|
1064
1072
|
notionStyle: n?.notionStyle,
|
|
1065
1073
|
context: n?.context,
|
|
1066
1074
|
agreementId: ee,
|
|
@@ -1069,7 +1077,7 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1069
1077
|
})
|
|
1070
1078
|
] }) : null
|
|
1071
1079
|
] }) }) : null,
|
|
1072
|
-
De && Object.keys(De).length ? /* @__PURE__ */ s(
|
|
1080
|
+
De && Object.keys(De).length ? /* @__PURE__ */ s(Mr, { ...De }) : null,
|
|
1073
1081
|
!xe && Te ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 mb-2", children: [
|
|
1074
1082
|
/* @__PURE__ */ b(
|
|
1075
1083
|
"svg",
|
|
@@ -1093,9 +1101,9 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1093
1101
|
]
|
|
1094
1102
|
}
|
|
1095
1103
|
),
|
|
1096
|
-
/* @__PURE__ */ s(be, { size: "small", variant: "semibold", appearance: "title", children: (
|
|
1104
|
+
/* @__PURE__ */ s(be, { size: "small", variant: "semibold", appearance: "title", children: (Ke ?? u.length).toLocaleString() }),
|
|
1097
1105
|
/* @__PURE__ */ s(be, { size: "small", variant: "regular", appearance: "subtitle", children: "total records" })
|
|
1098
|
-
] }) : !xe &&
|
|
1106
|
+
] }) : !xe && c?.preContent ? /* @__PURE__ */ s("div", { className: "flex items-center mb-2", children: c.preContent }) : null,
|
|
1099
1107
|
/* @__PURE__ */ s(
|
|
1100
1108
|
"div",
|
|
1101
1109
|
{
|
|
@@ -1103,47 +1111,47 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1103
1111
|
className: `w-full ${ae ? "h-auto" : oe} rounded-lg relative border overflow-x-hidden`,
|
|
1104
1112
|
style: {
|
|
1105
1113
|
...ae ? {
|
|
1106
|
-
height:
|
|
1107
|
-
} : { height:
|
|
1108
|
-
...
|
|
1114
|
+
height: u?.length > 0 ? `${(u?.length + 1) * Ol + 4}px` : "350px"
|
|
1115
|
+
} : { height: sr },
|
|
1116
|
+
...hl
|
|
1109
1117
|
},
|
|
1110
|
-
children:
|
|
1111
|
-
|
|
1118
|
+
children: ll ? Mt : /* @__PURE__ */ b(
|
|
1119
|
+
Vr,
|
|
1112
1120
|
{
|
|
1113
|
-
sensors:
|
|
1114
|
-
onDragEnd:
|
|
1115
|
-
onDragStart:
|
|
1116
|
-
onDragCancel:
|
|
1117
|
-
collisionDetection:
|
|
1121
|
+
sensors: mr,
|
|
1122
|
+
onDragEnd: wr,
|
|
1123
|
+
onDragStart: vr,
|
|
1124
|
+
onDragCancel: Fr,
|
|
1125
|
+
collisionDetection: jr,
|
|
1118
1126
|
children: [
|
|
1119
|
-
|
|
1120
|
-
|
|
1127
|
+
Mt,
|
|
1128
|
+
J ? Hr(
|
|
1121
1129
|
/* @__PURE__ */ s(
|
|
1122
|
-
|
|
1130
|
+
Br,
|
|
1123
1131
|
{
|
|
1124
1132
|
adjustScale: !0,
|
|
1125
|
-
dropAnimation:
|
|
1133
|
+
dropAnimation: pr,
|
|
1126
1134
|
children: /* @__PURE__ */ s(
|
|
1127
1135
|
"table",
|
|
1128
1136
|
{
|
|
1129
|
-
...
|
|
1137
|
+
...At(),
|
|
1130
1138
|
className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse",
|
|
1131
1139
|
children: /* @__PURE__ */ b(
|
|
1132
1140
|
"tbody",
|
|
1133
1141
|
{
|
|
1134
|
-
...
|
|
1142
|
+
...Et(),
|
|
1135
1143
|
className: "bg-transparent divide-y divide-neutral-200",
|
|
1136
1144
|
children: [
|
|
1137
|
-
void
|
|
1145
|
+
void Rt(J),
|
|
1138
1146
|
/* @__PURE__ */ s(
|
|
1139
|
-
|
|
1147
|
+
Ur,
|
|
1140
1148
|
{
|
|
1141
|
-
row:
|
|
1149
|
+
row: J,
|
|
1142
1150
|
index: I?.findIndex(
|
|
1143
|
-
(e) => e.id ===
|
|
1151
|
+
(e) => e.id === J.original.id
|
|
1144
1152
|
)
|
|
1145
1153
|
},
|
|
1146
|
-
|
|
1154
|
+
J.original.id
|
|
1147
1155
|
)
|
|
1148
1156
|
]
|
|
1149
1157
|
}
|
|
@@ -1162,7 +1170,7 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1162
1170
|
ae && a?.renderPagination ? a.renderPagination(ae) : null,
|
|
1163
1171
|
a?.renderMasterDataModal && a.renderMasterDataModal({
|
|
1164
1172
|
isVisible: !!R,
|
|
1165
|
-
onSelected:
|
|
1173
|
+
onSelected: Kl,
|
|
1166
1174
|
onClose: ve,
|
|
1167
1175
|
masterDataColumnName: R?.masterDataColumnName,
|
|
1168
1176
|
masterDataFormula: R?.masterDataFormula,
|
|
@@ -1172,22 +1180,35 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1172
1180
|
showFilters: !0
|
|
1173
1181
|
}),
|
|
1174
1182
|
/* @__PURE__ */ s(
|
|
1175
|
-
|
|
1183
|
+
Gr,
|
|
1184
|
+
{
|
|
1185
|
+
config: mt,
|
|
1186
|
+
onClose: Dt
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ s(
|
|
1190
|
+
Jr,
|
|
1176
1191
|
{
|
|
1177
|
-
|
|
1178
|
-
|
|
1192
|
+
state: Cl,
|
|
1193
|
+
config: tt,
|
|
1194
|
+
rowOptions: V,
|
|
1195
|
+
asyncRowOptionsFilter: n?.asyncRowOptionsFilter,
|
|
1196
|
+
checkedIds: We?.checkedIds,
|
|
1197
|
+
rows: u,
|
|
1198
|
+
columns: v,
|
|
1199
|
+
onClose: Nt
|
|
1179
1200
|
}
|
|
1180
1201
|
),
|
|
1181
1202
|
/* @__PURE__ */ s(
|
|
1182
|
-
|
|
1203
|
+
Yr,
|
|
1183
1204
|
{
|
|
1184
|
-
pendingEditsCount:
|
|
1185
|
-
pendingEditsList:
|
|
1186
|
-
rowsWithPendingEdits:
|
|
1187
|
-
fieldOperationLoading:
|
|
1188
|
-
onClearAll:
|
|
1189
|
-
onSaveAll:
|
|
1190
|
-
onScrollToCell:
|
|
1205
|
+
pendingEditsCount: z,
|
|
1206
|
+
pendingEditsList: Yl,
|
|
1207
|
+
rowsWithPendingEdits: Zl,
|
|
1208
|
+
fieldOperationLoading: P,
|
|
1209
|
+
onClearAll: yt,
|
|
1210
|
+
onSaveAll: Tt,
|
|
1211
|
+
onScrollToCell: $
|
|
1191
1212
|
}
|
|
1192
1213
|
)
|
|
1193
1214
|
]
|
|
@@ -1196,6 +1217,6 @@ const dn = gr, jt = "Create Column", un = (g, D) => `button-admin-${g.toLowerCas
|
|
|
1196
1217
|
}
|
|
1197
1218
|
);
|
|
1198
1219
|
export {
|
|
1199
|
-
|
|
1220
|
+
zn as InfiniteTable
|
|
1200
1221
|
};
|
|
1201
1222
|
//# sourceMappingURL=index.es.js.map
|