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