@progress/kendo-react-grid 14.2.2-develop.1 → 14.3.0-develop.1
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +625 -555
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +419 -433
- package/components/StickyGroupTable.d.ts +42 -0
- package/components/StickyGroupTable.js +9 -0
- package/components/StickyGroupTable.mjs +82 -0
- package/components/colGroup/GridColGroup.js +1 -1
- package/components/colGroup/GridColGroup.mjs +9 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.d.ts +8 -0
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +125 -108
- package/getRowContents.d.ts +58 -0
- package/getRowContents.js +8 -0
- package/getRowContents.mjs +100 -0
- package/header/GridHeaderGroupSpacerCell.d.ts +13 -0
- package/header/GridHeaderGroupSpacerCell.js +9 -0
- package/header/GridHeaderGroupSpacerCell.mjs +23 -0
- package/hooks/useStickyGroups.d.ts +71 -0
- package/hooks/useStickyGroups.js +9 -0
- package/hooks/useStickyGroups.mjs +350 -0
- package/interfaces/GridGroupableSettings.d.ts +23 -0
- package/messages/index.d.ts +5 -0
- package/messages/index.js +2 -2
- package/messages/index.mjs +28 -26
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +17 -17
- package/stacked/StackedModeComponents.d.ts +1 -0
- package/stacked/StackedModeComponents.js +1 -1
- package/stacked/StackedModeComponents.mjs +14 -14
package/GridClientWrapper.mjs
CHANGED
|
@@ -6,31 +6,33 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { useAdaptiveModeContext as
|
|
11
|
-
import { filterBy as
|
|
12
|
-
import { getSelectionOptions as
|
|
13
|
-
import { ColumnResize as
|
|
14
|
-
import { CommonDragLogic as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
import * as c from "react";
|
|
10
|
+
import { useAdaptiveModeContext as lr, canUseDOM as te, getActiveElement as sr, useDir as ur, setScrollbarWidth as pe, cloneArray as gr, RowHeightService as fr, getter as re } from "@progress/kendo-react-common";
|
|
11
|
+
import { filterBy as mr } from "@progress/kendo-data-query";
|
|
12
|
+
import { getSelectionOptions as Pe, populateClipboardData as hr, ClipboardActionType as Te, getEditableOptions as Pr, tableKeyboardNavigation as Y, ClipboardService as Rr, TableKeyboardNavigationContext as br, updateLeft as vr, updateRight as Cr, getGroupExpandableOptions as Ir, groupExpandReducer as yr, getDetailExpandableOptions as wr, detailExpandReducer as Er, getSelectedState as et, editReducer as Sr, EDIT_ACTION as xr, closestTagName as Re, getSelectedStateFromKeyDown as kr, getColumnIndex as Dr, getRowIndex as Kr } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { ColumnResize as Hr } from "./drag/ColumnResize.mjs";
|
|
14
|
+
import { CommonDragLogic as Gr } from "./drag/CommonDragLogic.mjs";
|
|
15
|
+
import { useStickyGroups as Mr } from "./hooks/useStickyGroups.mjs";
|
|
16
|
+
import { getDefaultHeadContextMenuItems as Tr, getDefaultBodyContextMenuItems as Ar, isRowReorderEnabled as Fr, calcRowHeight as Lr, sanitizeColumns as zr, getFlatColumnsState as Or, getDataAsArray as Wr } from "./utils/index.mjs";
|
|
17
|
+
import { VirtualScroll as Nr } from "./VirtualScroll.mjs";
|
|
18
|
+
import { GridContextMenu as Br } from "./contextMenu/GridContextMenu.mjs";
|
|
19
|
+
import { GridContextMenuAnchorPart as tt } from "./contextMenu/enums.mjs";
|
|
20
|
+
import { normalizeSortable as Vr, firstLevelSortSeqMap as jr } from "./sortCommon.mjs";
|
|
21
|
+
import { BasePDFExport as Ur } from "./BasePDFExport.mjs";
|
|
22
|
+
import { BaseCSVExport as qr } from "./BaseCSVExport.mjs";
|
|
23
|
+
import { GridContext as $r } from "./utils/GridContext.mjs";
|
|
24
|
+
import { operators as _r } from "./filterCommon.mjs";
|
|
25
|
+
const Jr = (t, E, b, T) => {
|
|
26
|
+
const Q = Object.keys(E.cells).map((k) => b.findIndex((Z) => Z.field === k)), V = Object.keys(E.cells).length > 0 ? Q : !0;
|
|
27
|
+
return t.reduce((k, Z) => (k[Z[T != null ? T : "id"]] = V, k), {});
|
|
28
|
+
}, rt = (t, E, b, T) => E.reduce((V, k) => ({
|
|
29
|
+
...V,
|
|
30
|
+
...Jr(mr(t, k), k, b, T)
|
|
31
|
+
}), {}), un = (t) => {
|
|
32
|
+
var Ze;
|
|
33
|
+
const E = t.gridProps.isClient, [b, T] = c.useState({}), Q = lr(), V = c.useRef(null), k = c.useRef(null), Z = (e) => {
|
|
34
|
+
e.event.preventDefault(), T({
|
|
35
|
+
...b,
|
|
34
36
|
show: !0,
|
|
35
37
|
offset: {
|
|
36
38
|
left: e.event.pageX,
|
|
@@ -39,41 +41,41 @@ const Tn = (t, E, h, D) => {
|
|
|
39
41
|
dataItem: e.dataItem,
|
|
40
42
|
field: e.field
|
|
41
43
|
});
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
const e = t.gridProps.sortable && (
|
|
46
|
-
return
|
|
44
|
+
}, Ae = () => {
|
|
45
|
+
T({});
|
|
46
|
+
}, y = c.useMemo(() => t.columnsRef.find((e) => e.field === b.field), [t.columnsRef, b]), Fe = c.useMemo(() => {
|
|
47
|
+
const e = t.gridProps.sortable && (y == null ? void 0 : y.sortable);
|
|
48
|
+
return Tr({
|
|
47
49
|
pdf: !!t.gridProps.pdf,
|
|
48
50
|
sortable: !!e,
|
|
49
|
-
selectable:
|
|
51
|
+
selectable: Pe(t.gridProps.selectable).enabled,
|
|
50
52
|
clipboard: !!t.gridProps.clipboard
|
|
51
53
|
});
|
|
52
|
-
}, [
|
|
54
|
+
}, [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Le = c.useMemo(() => (t.gridProps.sortable && (y == null || y.sortable), Ar({
|
|
53
55
|
pdf: !!t.gridProps.pdf,
|
|
54
|
-
selectable:
|
|
56
|
+
selectable: Pe(t.gridProps.selectable).enabled,
|
|
55
57
|
clipboard: !!t.gridProps.clipboard,
|
|
56
|
-
rowReorderable:
|
|
57
|
-
})), [
|
|
58
|
-
const e = (
|
|
59
|
-
if (
|
|
60
|
-
const o =
|
|
61
|
-
return
|
|
58
|
+
rowReorderable: Fr(t.gridProps.rowReorderable)
|
|
59
|
+
})), [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), ne = c.useMemo(() => {
|
|
60
|
+
const e = (y == null ? void 0 : y.contextMenu) || t.gridProps.contextMenu, r = typeof e == "function" ? e(b) : e;
|
|
61
|
+
if (r && b.offset) {
|
|
62
|
+
const o = b.dataItem ? tt.body : tt.head, n = r[o], i = b.dataItem ? Le : Fe;
|
|
63
|
+
return n === !1 ? void 0 : n === !0 || n === void 0 ? i : n;
|
|
62
64
|
}
|
|
63
|
-
}, [t.gridProps.contextMenu,
|
|
64
|
-
var
|
|
65
|
-
const
|
|
65
|
+
}, [t.gridProps.contextMenu, b, Le, Fe, y]), nt = (e) => {
|
|
66
|
+
var d, u, g, m, f, I, l, w, R;
|
|
67
|
+
const r = e.event.item, o = {
|
|
66
68
|
target: x.current,
|
|
67
69
|
syntheticEvent: e.event.syntheticEvent,
|
|
68
70
|
nativeEvent: e.event.nativeEvent,
|
|
69
|
-
menuItem:
|
|
71
|
+
menuItem: r,
|
|
70
72
|
...e
|
|
71
73
|
};
|
|
72
|
-
t.gridProps.onContextMenuItemClick &&
|
|
73
|
-
const
|
|
74
|
+
t.gridProps.onContextMenuItemClick && s(t.gridProps.onContextMenuItemClick, o);
|
|
75
|
+
const n = S(), i = {
|
|
74
76
|
selectedField: "",
|
|
75
77
|
componentId: t.id,
|
|
76
|
-
dataItems:
|
|
78
|
+
dataItems: n,
|
|
77
79
|
dataItem: e.dataItem,
|
|
78
80
|
startRowIndex: -1,
|
|
79
81
|
endRowIndex: -1,
|
|
@@ -84,213 +86,251 @@ const Tn = (t, E, h, D) => {
|
|
|
84
86
|
metaKey: !1,
|
|
85
87
|
shiftKey: !1,
|
|
86
88
|
isDrag: !1,
|
|
87
|
-
...
|
|
89
|
+
...Pe(t.gridProps.selectable),
|
|
88
90
|
...o
|
|
89
|
-
}, a =
|
|
90
|
-
switch ((
|
|
91
|
+
}, a = n.findIndex((L) => L === e.dataItem);
|
|
92
|
+
switch ((d = r.data) == null ? void 0 : d.action) {
|
|
91
93
|
case "SortCommand":
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
94
|
+
if (y) {
|
|
95
|
+
const L = (u = r.name) == null ? void 0 : u.toLowerCase().includes("asc"), X = ((g = r.name) == null ? void 0 : g.toLowerCase().includes("desc")) ? "desc" : void 0, Me = L ? "asc" : X, dr = r.name ? Me : void 0;
|
|
96
|
+
ze(e.event.syntheticEvent, y, dr);
|
|
95
97
|
}
|
|
96
98
|
break;
|
|
97
99
|
case "SelectRowCommand":
|
|
98
|
-
|
|
100
|
+
Et(i);
|
|
99
101
|
break;
|
|
100
102
|
case "SelectAllRowsCommand":
|
|
101
|
-
|
|
103
|
+
wt(i);
|
|
102
104
|
break;
|
|
103
105
|
case "ExportPDFCommand":
|
|
104
|
-
|
|
106
|
+
ve();
|
|
105
107
|
break;
|
|
106
108
|
case "ClearSelectionCommand":
|
|
107
|
-
|
|
109
|
+
xt(i);
|
|
108
110
|
break;
|
|
109
111
|
case "ReorderRowCommand":
|
|
110
|
-
|
|
112
|
+
ee.current = e.dataItem, (m = r.name) != null && m.toLowerCase().includes("rowup") && a > 0 && p(e.event.syntheticEvent, a - 1, "before"), (f = r.name) != null && f.toLowerCase().includes("rowdown") && a < n.length - 1 && p(e.event.syntheticEvent, a + 1, "after"), (I = r.name) != null && I.toLowerCase().includes("rowtop") && p(e.event.syntheticEvent, 0, "before"), (l = r.name) != null && l.toLowerCase().includes("rowbottom") && p(e.event.syntheticEvent, n.length - 1, "after");
|
|
111
113
|
break;
|
|
112
114
|
case "CopySelectionCommand":
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
de(
|
|
116
|
+
Te.copy,
|
|
115
117
|
e.event.nativeEvent,
|
|
116
118
|
{
|
|
117
|
-
copyHeaders: !((
|
|
119
|
+
copyHeaders: !((w = r.name) != null && w.toLowerCase().includes("noheaders"))
|
|
118
120
|
},
|
|
119
121
|
e.dataItem,
|
|
120
122
|
e.field
|
|
121
123
|
);
|
|
122
124
|
break;
|
|
123
125
|
case "PasteCommand":
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
de(
|
|
127
|
+
Te.paste,
|
|
126
128
|
e.event.nativeEvent,
|
|
127
129
|
{
|
|
128
|
-
copyHeaders: !((
|
|
130
|
+
copyHeaders: !((R = r.name) != null && R.toLowerCase().includes("noheaders"))
|
|
129
131
|
},
|
|
130
132
|
e.dataItem,
|
|
131
133
|
e.field
|
|
132
134
|
);
|
|
133
135
|
break;
|
|
134
136
|
}
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
const e = t.columnsRef.filter((
|
|
138
|
-
return
|
|
139
|
-
},
|
|
137
|
+
Ae();
|
|
138
|
+
}, oe = () => {
|
|
139
|
+
const e = t.columnsRef.filter((r) => r.declarationIndex >= 0 && r.parentIndex === -1);
|
|
140
|
+
return zr(e);
|
|
141
|
+
}, ot = (e, r, o) => {
|
|
140
142
|
if (t.gridProps.onContextMenu && E) {
|
|
141
|
-
const
|
|
143
|
+
const n = {
|
|
142
144
|
target: x.current,
|
|
143
145
|
syntheticEvent: e,
|
|
144
146
|
nativeEvent: e.nativeEvent,
|
|
145
|
-
dataItem:
|
|
147
|
+
dataItem: r,
|
|
146
148
|
field: o
|
|
147
149
|
};
|
|
148
|
-
|
|
150
|
+
s(t.gridProps.onContextMenu, n);
|
|
149
151
|
}
|
|
150
|
-
t.gridProps.contextMenu &&
|
|
152
|
+
t.gridProps.contextMenu && Z({
|
|
151
153
|
event: e,
|
|
152
|
-
dataItem:
|
|
154
|
+
dataItem: r,
|
|
153
155
|
field: o
|
|
154
156
|
});
|
|
155
|
-
},
|
|
157
|
+
}, it = (e) => {
|
|
158
|
+
var a, d;
|
|
156
159
|
if (e.target !== e.currentTarget)
|
|
157
160
|
return;
|
|
158
|
-
clearTimeout(
|
|
159
|
-
const
|
|
160
|
-
t.gridProps.columnVirtualization && (!
|
|
161
|
-
|
|
162
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current =
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
clearTimeout(De.current), v.current && (v.current.table = W.current);
|
|
162
|
+
const r = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop;
|
|
163
|
+
t.gridProps.columnVirtualization && (!D || o === ke.current) && (De.current = window.setTimeout(() => {
|
|
164
|
+
q();
|
|
165
|
+
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = r), B.current && B.current.setScrollLeft(r), N.current && N.current.setScrollLeft(r), G != null && G.current && G.current.setScrollLeft(r), M != null && M.current && M.current.setScrollLeft(r);
|
|
166
|
+
const n = (a = t.gridProps.virtualSkipRef) == null ? void 0 : a.current;
|
|
167
|
+
v.current && o !== ke.current && v.current.scrollHandler(e);
|
|
168
|
+
const i = D && ((d = t.gridProps.virtualSkipRef) == null ? void 0 : d.current) !== n;
|
|
169
|
+
t.gridProps.onScroll && E && s(t.gridProps.onScroll, {
|
|
170
|
+
...C(e)
|
|
171
|
+
}), ke.current = o, i || Xe();
|
|
172
|
+
}, at = (e) => {
|
|
173
|
+
var o, n;
|
|
174
|
+
const r = e.target;
|
|
175
|
+
if ((e.keyCode === 38 || e.keyCode === 40) && r.closest(".k-grid-sticky-container")) {
|
|
176
|
+
const i = parseInt(((o = r.closest("tr")) == null ? void 0 : o.getAttribute("absolute-row-index")) || "", 10), a = r.getAttribute("data-keyboardnavid");
|
|
177
|
+
if (!isNaN(i) && a && !((n = K.current) == null ? void 0 : n.querySelector(`tr[absolute-row-index="${i}"]`)))
|
|
178
|
+
return he.current = {
|
|
179
|
+
navId: a,
|
|
180
|
+
key: e.key,
|
|
181
|
+
code: e.code,
|
|
182
|
+
keyCode: e.keyCode
|
|
183
|
+
}, e.preventDefault(), e.stopPropagation(), se({ rowIndex: i }), !0;
|
|
184
|
+
}
|
|
185
|
+
return !1;
|
|
186
|
+
}, ct = () => {
|
|
187
|
+
var a;
|
|
188
|
+
if (!he.current || !H.current)
|
|
189
|
+
return;
|
|
190
|
+
const { navId: e, key: r, code: o, keyCode: n } = he.current, i = (a = K.current) == null ? void 0 : a.querySelector(
|
|
191
|
+
`[data-keyboardnavid="${e}"]`
|
|
192
|
+
);
|
|
193
|
+
i && i.dispatchEvent(
|
|
194
|
+
new KeyboardEvent("keydown", {
|
|
195
|
+
key: r,
|
|
196
|
+
code: o,
|
|
197
|
+
keyCode: n,
|
|
198
|
+
bubbles: !0,
|
|
199
|
+
cancelable: !0
|
|
200
|
+
})
|
|
201
|
+
);
|
|
202
|
+
}, dt = (e) => {
|
|
203
|
+
if (at(e))
|
|
204
|
+
return;
|
|
205
|
+
Y.onKeyDown(e, {
|
|
167
206
|
navigatable: t.gridProps.navigatable || !1,
|
|
168
|
-
contextStateRef:
|
|
169
|
-
navigationStateRef:
|
|
170
|
-
onNavigationAction:
|
|
171
|
-
columns:
|
|
172
|
-
}),
|
|
173
|
-
document:
|
|
174
|
-
contextStateRef:
|
|
175
|
-
navigationStateRef:
|
|
207
|
+
contextStateRef: O,
|
|
208
|
+
navigationStateRef: $,
|
|
209
|
+
onNavigationAction: st,
|
|
210
|
+
columns: oe()
|
|
211
|
+
}), Y.onGetSnapshotBeforeUpdate({
|
|
212
|
+
document: A(),
|
|
213
|
+
contextStateRef: O,
|
|
214
|
+
navigationStateRef: $
|
|
176
215
|
});
|
|
177
|
-
const
|
|
178
|
-
dataItems:
|
|
216
|
+
const r = {
|
|
217
|
+
dataItems: S(),
|
|
179
218
|
mode: P.mode,
|
|
180
219
|
cell: P.cell,
|
|
181
220
|
componentId: t.id,
|
|
182
221
|
selectedField: "",
|
|
183
|
-
...
|
|
222
|
+
...C(e)
|
|
184
223
|
};
|
|
185
|
-
t.gridProps.onKeyDown && E &&
|
|
186
|
-
},
|
|
187
|
-
|
|
224
|
+
t.gridProps.onKeyDown && E && s(t.gridProps.onKeyDown, r);
|
|
225
|
+
}, lt = (e) => {
|
|
226
|
+
Y.onFocus(e, {
|
|
188
227
|
navigatable: !!t.gridProps.navigatable,
|
|
189
|
-
contextStateRef:
|
|
228
|
+
contextStateRef: O
|
|
190
229
|
});
|
|
191
|
-
},
|
|
192
|
-
const { columnsRef:
|
|
193
|
-
if (e.action === "moveToNextPage" &&
|
|
230
|
+
}, st = (e) => {
|
|
231
|
+
const { columnsRef: r } = t;
|
|
232
|
+
if (e.action === "moveToNextPage" && Kt(e.event), e.action === "moveToPrevPage" && Ht(e.event), e.focusElement && (e.action === "reorderToRight" || e.action === "reorderToLeft")) {
|
|
194
233
|
const o = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
195
|
-
if (!
|
|
234
|
+
if (!r[o].reorderable)
|
|
196
235
|
return;
|
|
197
236
|
if (e.action === "reorderToRight" && o < t.columnsRef.length - 1) {
|
|
198
|
-
if (
|
|
237
|
+
if (r[o + 1].disableReorder)
|
|
199
238
|
return;
|
|
200
|
-
|
|
239
|
+
ae(o, o + 1, e.event);
|
|
201
240
|
}
|
|
202
241
|
if (e.action === "reorderToLeft" && o > 0) {
|
|
203
|
-
if (
|
|
242
|
+
if (r[o - 1].disableReorder)
|
|
204
243
|
return;
|
|
205
|
-
|
|
244
|
+
ae(o, o - 1, e.event);
|
|
206
245
|
}
|
|
207
246
|
}
|
|
208
|
-
if (e.action === "select" &&
|
|
247
|
+
if (e.action === "select" && Ct(e.event), t.gridProps.onNavigationAction && E) {
|
|
209
248
|
const o = {
|
|
210
249
|
focusElement: e.focusElement,
|
|
211
|
-
...
|
|
250
|
+
...C(e.event)
|
|
212
251
|
};
|
|
213
|
-
|
|
252
|
+
s(t.gridProps.onNavigationAction, o);
|
|
214
253
|
}
|
|
215
|
-
},
|
|
216
|
-
t.gridProps.onRowClick &&
|
|
217
|
-
dataItem:
|
|
218
|
-
...
|
|
254
|
+
}, ut = (e, r) => {
|
|
255
|
+
t.gridProps.onRowClick && Re(e.target, "TD") && s(t.gridProps.onRowClick, {
|
|
256
|
+
dataItem: r,
|
|
257
|
+
...C(e)
|
|
219
258
|
});
|
|
220
|
-
},
|
|
221
|
-
t.gridProps.onRowDoubleClick &&
|
|
222
|
-
dataItem:
|
|
223
|
-
...
|
|
259
|
+
}, gt = (e, r) => {
|
|
260
|
+
t.gridProps.onRowDoubleClick && Re(e.target, "TD") && s(t.gridProps.onRowDoubleClick, {
|
|
261
|
+
dataItem: r,
|
|
262
|
+
...C(e)
|
|
224
263
|
});
|
|
225
|
-
},
|
|
226
|
-
t.gridProps.onItemChange &&
|
|
227
|
-
...
|
|
264
|
+
}, ft = (e) => {
|
|
265
|
+
t.gridProps.onItemChange && s(t.gridProps.onItemChange, {
|
|
266
|
+
...C(e.syntheticEvent),
|
|
228
267
|
dataItem: e.dataItem,
|
|
229
268
|
field: void 0,
|
|
230
269
|
value: void 0
|
|
231
270
|
});
|
|
232
|
-
},
|
|
233
|
-
t.gridProps.onItemChange && t.gridProps.onEditChange &&
|
|
271
|
+
}, mt = (e) => {
|
|
272
|
+
t.gridProps.onItemChange && t.gridProps.onEditChange && s(t.gridProps.onEditChange, {
|
|
234
273
|
edit: {},
|
|
235
|
-
...
|
|
274
|
+
...C(e.syntheticEvent)
|
|
236
275
|
});
|
|
237
|
-
},
|
|
238
|
-
if (
|
|
239
|
-
const
|
|
240
|
-
type:
|
|
241
|
-
payload: { id:
|
|
276
|
+
}, ht = (e, r, o) => {
|
|
277
|
+
if (Qe.enabled && Qe.mode === "incell" && t.gridProps.dataItemKey) {
|
|
278
|
+
const n = Sr(t.gridProps.edit, {
|
|
279
|
+
type: xr.ENTER_FIELD_EDIT,
|
|
280
|
+
payload: { id: r[t.gridProps.dataItemKey], field: o }
|
|
242
281
|
});
|
|
243
|
-
t.gridProps.onEditChange &&
|
|
244
|
-
edit:
|
|
245
|
-
...
|
|
282
|
+
t.gridProps.onEditChange && s(t.gridProps.onEditChange, {
|
|
283
|
+
edit: n,
|
|
284
|
+
...C(e)
|
|
246
285
|
});
|
|
247
286
|
}
|
|
248
|
-
},
|
|
249
|
-
var
|
|
250
|
-
if (
|
|
251
|
-
const i =
|
|
252
|
-
t.gridProps.onDetailExpandChange &&
|
|
253
|
-
...
|
|
287
|
+
}, Pt = (e, r) => {
|
|
288
|
+
var n;
|
|
289
|
+
if (wr(t.detailExpandable).enabled) {
|
|
290
|
+
const i = Er((n = t.gridProps.detailExpand) != null ? n : {}, e);
|
|
291
|
+
t.gridProps.onDetailExpandChange && s(t.gridProps.onDetailExpandChange, {
|
|
292
|
+
...C(r),
|
|
254
293
|
detailExpand: i
|
|
255
294
|
});
|
|
256
295
|
}
|
|
257
|
-
},
|
|
258
|
-
var
|
|
259
|
-
const o =
|
|
296
|
+
}, Rt = (e, r) => {
|
|
297
|
+
var n;
|
|
298
|
+
const o = Ir(
|
|
260
299
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
261
300
|
);
|
|
262
301
|
if (o.enabled) {
|
|
263
|
-
const i =
|
|
264
|
-
t.gridProps.onGroupExpandChange &&
|
|
265
|
-
...
|
|
302
|
+
const i = yr((n = t.gridProps.groupExpand) != null ? n : [], e, o);
|
|
303
|
+
t.gridProps.onGroupExpandChange && s(t.gridProps.onGroupExpandChange, {
|
|
304
|
+
...C(r),
|
|
266
305
|
groupExpand: i
|
|
267
306
|
});
|
|
268
307
|
}
|
|
269
|
-
|
|
270
|
-
|
|
308
|
+
nr(e.group);
|
|
309
|
+
}, ze = (e, r, o) => {
|
|
310
|
+
const { allowUnsort: n, mode: i } = Vr(
|
|
271
311
|
t.gridProps.sortable || !1,
|
|
272
|
-
|
|
273
|
-
), a = (t.gridProps.sort || []).filter((
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
t.gridProps.onItemChange &&
|
|
277
|
-
...
|
|
312
|
+
r.sortable || !1
|
|
313
|
+
), a = (t.gridProps.sort || []).filter((g) => g.field === r.field)[0], d = o || jr[n][a && a.dir || ""], u = i === "single" ? [] : (t.gridProps.sort || []).filter((g) => g.field !== r.field);
|
|
314
|
+
d !== "" && r.field && u.push({ field: r.field, dir: d }), Oe(u, e);
|
|
315
|
+
}, bt = (e) => {
|
|
316
|
+
t.gridProps.onItemChange && s(t.gridProps.onItemChange, {
|
|
317
|
+
...C(e.syntheticEvent),
|
|
278
318
|
dataItem: e.dataItem,
|
|
279
319
|
dataIndex: e.dataIndex,
|
|
280
320
|
field: e.field,
|
|
281
321
|
value: e.value
|
|
282
322
|
});
|
|
283
|
-
},
|
|
284
|
-
var
|
|
323
|
+
}, vt = (e) => {
|
|
324
|
+
var r;
|
|
285
325
|
if (t.gridProps.onSelectionChange && P.enabled) {
|
|
286
|
-
const { event: o, dataItem:
|
|
287
|
-
...
|
|
288
|
-
dataItem:
|
|
326
|
+
const { event: o, dataItem: n, dataIndex: i, columnIndex: a } = e, d = {
|
|
327
|
+
...C(o),
|
|
328
|
+
dataItem: n,
|
|
289
329
|
startColIndex: a,
|
|
290
330
|
endColIndex: a,
|
|
291
331
|
startRowIndex: i,
|
|
292
332
|
endRowIndex: i,
|
|
293
|
-
dataItems:
|
|
333
|
+
dataItems: S(),
|
|
294
334
|
altKey: !1,
|
|
295
335
|
ctrlKey: !1,
|
|
296
336
|
shiftKey: !1,
|
|
@@ -301,46 +341,46 @@ const Tn = (t, E, h, D) => {
|
|
|
301
341
|
componentId: t.id,
|
|
302
342
|
selectedField: ""
|
|
303
343
|
};
|
|
304
|
-
|
|
305
|
-
...
|
|
306
|
-
select: t.gridProps.dataItemKey ?
|
|
307
|
-
event:
|
|
308
|
-
selectedState: (
|
|
344
|
+
s(t.gridProps.onSelectionChange, {
|
|
345
|
+
...d,
|
|
346
|
+
select: t.gridProps.dataItemKey ? et({
|
|
347
|
+
event: d,
|
|
348
|
+
selectedState: (r = t.gridProps.select) != null ? r : {},
|
|
309
349
|
dataItemKey: t.gridProps.dataItemKey
|
|
310
350
|
}) : {}
|
|
311
351
|
});
|
|
312
352
|
}
|
|
313
|
-
},
|
|
314
|
-
var
|
|
353
|
+
}, Ct = (e) => {
|
|
354
|
+
var g, m;
|
|
315
355
|
if (!P.enabled || !t.gridProps.dataItemKey)
|
|
316
356
|
return;
|
|
317
|
-
const
|
|
318
|
-
dataItems:
|
|
357
|
+
const r = {
|
|
358
|
+
dataItems: S(),
|
|
319
359
|
mode: P.mode,
|
|
320
360
|
cell: P.cell,
|
|
321
361
|
componentId: t.id,
|
|
322
362
|
selectedField: "",
|
|
323
|
-
...
|
|
324
|
-
}, o =
|
|
325
|
-
event:
|
|
326
|
-
selectedState: (
|
|
363
|
+
...C(e)
|
|
364
|
+
}, o = kr({
|
|
365
|
+
event: r,
|
|
366
|
+
selectedState: (g = t.gridProps.select) != null ? g : {},
|
|
327
367
|
dataItemKey: t.gridProps.dataItemKey
|
|
328
368
|
});
|
|
329
369
|
if (o === t.gridProps.select)
|
|
330
370
|
return;
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
t.gridProps.onSelectionChange &&
|
|
335
|
-
...
|
|
371
|
+
const n = e.target, i = Re(n, "TD"), a = Re(n, "TR"), d = Dr(i), u = Kr(a);
|
|
372
|
+
if (d !== void 0 && u !== void 0) {
|
|
373
|
+
const f = (m = Wr(t.gridProps.data)) == null ? void 0 : m[u];
|
|
374
|
+
t.gridProps.onSelectionChange && s(t.gridProps.onSelectionChange, {
|
|
375
|
+
...r,
|
|
336
376
|
select: o,
|
|
337
|
-
dataItem:
|
|
338
|
-
startRowIndex:
|
|
339
|
-
startColIndex:
|
|
340
|
-
startDataItem:
|
|
341
|
-
endDataItem:
|
|
342
|
-
endRowIndex:
|
|
343
|
-
endColIndex:
|
|
377
|
+
dataItem: f,
|
|
378
|
+
startRowIndex: u,
|
|
379
|
+
startColIndex: d,
|
|
380
|
+
startDataItem: f,
|
|
381
|
+
endDataItem: f,
|
|
382
|
+
endRowIndex: u,
|
|
383
|
+
endColIndex: d,
|
|
344
384
|
ctrlKey: e.ctrlKey,
|
|
345
385
|
altKey: e.altKey,
|
|
346
386
|
metaKey: e.metaKey,
|
|
@@ -348,50 +388,50 @@ const Tn = (t, E, h, D) => {
|
|
|
348
388
|
isDrag: !1
|
|
349
389
|
});
|
|
350
390
|
}
|
|
351
|
-
},
|
|
391
|
+
}, It = (e) => {
|
|
352
392
|
if (t.gridProps.onHeaderSelectionChange && P.enabled) {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
select: e.syntheticEvent.target.checked ?
|
|
393
|
+
const r = S();
|
|
394
|
+
s(t.gridProps.onHeaderSelectionChange, {
|
|
395
|
+
select: e.syntheticEvent.target.checked ? r.reduce((o, n) => (t.gridProps.dataItemKey && re(t.gridProps.dataItemKey)(n) !== void 0 && (o[re(t.gridProps.dataItemKey)(n)] = !0), o), {}) : {},
|
|
356
396
|
field: e.field,
|
|
357
397
|
nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
|
|
358
398
|
syntheticEvent: e.syntheticEvent,
|
|
359
399
|
target: x.current,
|
|
360
|
-
dataItems:
|
|
400
|
+
dataItems: r
|
|
361
401
|
});
|
|
362
402
|
}
|
|
363
|
-
},
|
|
364
|
-
t.gridProps.onSelectionChange && P.enabled &&
|
|
403
|
+
}, j = (e, r) => {
|
|
404
|
+
t.gridProps.onSelectionChange && P.enabled && s(t.gridProps.onSelectionChange, {
|
|
365
405
|
...e,
|
|
366
|
-
select:
|
|
406
|
+
select: r
|
|
367
407
|
});
|
|
368
|
-
},
|
|
369
|
-
var
|
|
408
|
+
}, yt = (e) => {
|
|
409
|
+
var r;
|
|
370
410
|
if (t.gridProps.onSelectionChange && P.enabled) {
|
|
371
|
-
const o =
|
|
411
|
+
const o = S()[e.startRowIndex], n = S()[e.endRowIndex], i = {
|
|
372
412
|
syntheticEvent: void 0,
|
|
373
413
|
target: x.current,
|
|
374
414
|
selectedField: "",
|
|
375
415
|
componentId: t.id,
|
|
376
|
-
dataItems:
|
|
416
|
+
dataItems: S(),
|
|
377
417
|
dataItem: null,
|
|
378
418
|
startDataItem: o,
|
|
379
|
-
endDataItem:
|
|
419
|
+
endDataItem: n,
|
|
380
420
|
...e
|
|
381
|
-
}, a =
|
|
421
|
+
}, a = et({
|
|
382
422
|
event: i,
|
|
383
|
-
selectedState: (
|
|
423
|
+
selectedState: (r = t.gridProps.select) != null ? r : {},
|
|
384
424
|
// Thats kinda strange, even through the `dataItemKey` is required by the `getSelectedState`
|
|
385
425
|
// it does work correctly even without it
|
|
386
426
|
dataItemKey: t.gridProps.dataItemKey
|
|
387
427
|
});
|
|
388
|
-
|
|
428
|
+
j(i, a);
|
|
389
429
|
}
|
|
390
|
-
},
|
|
430
|
+
}, wt = (e) => {
|
|
391
431
|
if (t.gridProps.onSelectionChange && P.enabled) {
|
|
392
|
-
const
|
|
432
|
+
const r = e.dataItems[0], o = e.dataItems[e.dataItems.length - 1], n = {}, i = {
|
|
393
433
|
...e,
|
|
394
|
-
startDataItem:
|
|
434
|
+
startDataItem: r,
|
|
395
435
|
endDataItem: o,
|
|
396
436
|
startRowIndex: 0,
|
|
397
437
|
endRowIndex: e.dataItems.length - 1,
|
|
@@ -399,35 +439,35 @@ const Tn = (t, E, h, D) => {
|
|
|
399
439
|
endColIndex: t.columnsRef.length - 1
|
|
400
440
|
};
|
|
401
441
|
e.dataItems.forEach((a) => {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
}),
|
|
442
|
+
const u = re(t.gridProps.dataItemKey)(a);
|
|
443
|
+
n[u] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
|
|
444
|
+
}), j(i, n);
|
|
405
445
|
}
|
|
406
|
-
},
|
|
446
|
+
}, Et = (e) => {
|
|
407
447
|
if (t.gridProps.onSelectionChange && P.enabled) {
|
|
408
|
-
const o =
|
|
409
|
-
(
|
|
410
|
-
),
|
|
448
|
+
const o = re(t.gridProps.dataItemKey)(e.dataItem), n = 0, i = t.columnsRef.length - 1, a = e.dataItems.findIndex(
|
|
449
|
+
(f) => f[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
|
|
450
|
+
), g = {
|
|
411
451
|
...e,
|
|
412
452
|
startDataItem: a,
|
|
413
453
|
endDataItem: a,
|
|
414
454
|
startRowIndex: a,
|
|
415
455
|
endRowIndex: a,
|
|
416
|
-
startColIndex:
|
|
456
|
+
startColIndex: n,
|
|
417
457
|
endColIndex: i
|
|
418
|
-
},
|
|
419
|
-
|
|
458
|
+
}, m = e.mode === "multiple" ? t.gridProps.select || {} : {};
|
|
459
|
+
m[o] === !0 || Array.isArray(m[o]) && m[o].length === t.columnsRef.length ? delete m[o] : m[o] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, j(g, m);
|
|
420
460
|
}
|
|
421
|
-
},
|
|
461
|
+
}, St = (e) => {
|
|
422
462
|
if (!P.enabled)
|
|
423
463
|
return;
|
|
424
|
-
const
|
|
464
|
+
const r = S(), o = {
|
|
425
465
|
syntheticEvent: void 0,
|
|
426
466
|
nativeEvent: void 0,
|
|
427
467
|
target: x.current,
|
|
428
468
|
selectedField: "",
|
|
429
469
|
componentId: t.id,
|
|
430
|
-
dataItems:
|
|
470
|
+
dataItems: r,
|
|
431
471
|
dataItem: null,
|
|
432
472
|
startDataItem: null,
|
|
433
473
|
endDataItem: null,
|
|
@@ -440,123 +480,123 @@ const Tn = (t, E, h, D) => {
|
|
|
440
480
|
cell: P.cell
|
|
441
481
|
};
|
|
442
482
|
if (!e || e.length === 0) {
|
|
443
|
-
const
|
|
483
|
+
const f = {
|
|
444
484
|
...o,
|
|
445
485
|
startRowIndex: -1,
|
|
446
486
|
endRowIndex: -1,
|
|
447
487
|
startColIndex: -1,
|
|
448
488
|
endColIndex: -1
|
|
449
489
|
};
|
|
450
|
-
|
|
490
|
+
j(f, {});
|
|
451
491
|
return;
|
|
452
492
|
}
|
|
453
|
-
const
|
|
493
|
+
const n = rt(
|
|
454
494
|
t.gridProps.data,
|
|
455
495
|
e,
|
|
456
496
|
t.columnsRef,
|
|
457
497
|
t.gridProps.dataItemKey
|
|
458
498
|
), i = {};
|
|
459
|
-
Object.keys(
|
|
460
|
-
|
|
499
|
+
Object.keys(n).forEach((f) => {
|
|
500
|
+
n[f] && (i[f] = P.cell ? [...Array(t.columnsRef.length).keys()] : !0);
|
|
461
501
|
});
|
|
462
|
-
let a = -1,
|
|
502
|
+
let a = -1, d = -1, u = r[0] || null, g = r[r.length - 1] || null;
|
|
463
503
|
if (t.gridProps.dataItemKey) {
|
|
464
|
-
const
|
|
465
|
-
for (let
|
|
466
|
-
const
|
|
467
|
-
|
|
504
|
+
const f = re(t.gridProps.dataItemKey);
|
|
505
|
+
for (let I = 0; I < r.length; I++) {
|
|
506
|
+
const l = f(r[I]);
|
|
507
|
+
l !== void 0 && n[l] && (a === -1 && (a = I, u = r[I]), d = I, g = r[I]);
|
|
468
508
|
}
|
|
469
509
|
}
|
|
470
|
-
const
|
|
510
|
+
const m = {
|
|
471
511
|
...o,
|
|
472
512
|
startRowIndex: a,
|
|
473
|
-
endRowIndex:
|
|
513
|
+
endRowIndex: d,
|
|
474
514
|
startColIndex: 0,
|
|
475
515
|
endColIndex: t.columnsRef.length - 1,
|
|
476
|
-
startDataItem:
|
|
477
|
-
endDataItem:
|
|
516
|
+
startDataItem: u,
|
|
517
|
+
endDataItem: g
|
|
478
518
|
};
|
|
479
|
-
|
|
480
|
-
},
|
|
481
|
-
t.gridProps.onSelectionChange && P.enabled &&
|
|
482
|
-
},
|
|
483
|
-
|
|
519
|
+
j(m, i);
|
|
520
|
+
}, xt = (e) => {
|
|
521
|
+
t.gridProps.onSelectionChange && P.enabled && j(e, {});
|
|
522
|
+
}, U = (e, r, o, n, i) => {
|
|
523
|
+
Dt();
|
|
484
524
|
const a = t.gridProps.onDataStateChange;
|
|
485
525
|
if (e) {
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
} else a &&
|
|
489
|
-
...
|
|
526
|
+
const d = { ...C(n), ...r, targetEvent: i };
|
|
527
|
+
s(e, d);
|
|
528
|
+
} else a && s(a, {
|
|
529
|
+
...C(n),
|
|
490
530
|
targetEvent: i || {},
|
|
491
531
|
dataState: {
|
|
492
|
-
...
|
|
532
|
+
...Bt(),
|
|
493
533
|
...o
|
|
494
534
|
}
|
|
495
535
|
});
|
|
496
|
-
},
|
|
497
|
-
var
|
|
498
|
-
|
|
536
|
+
}, ie = (e, r, o) => {
|
|
537
|
+
var n;
|
|
538
|
+
D && t.gridProps.pageable && ((n = v.current) == null || n.reset()), U(
|
|
499
539
|
t.gridProps.onPageChange,
|
|
500
540
|
{ page: e },
|
|
501
541
|
{ skip: e.skip, take: e.take },
|
|
502
|
-
|
|
542
|
+
r,
|
|
503
543
|
o
|
|
504
544
|
);
|
|
505
|
-
},
|
|
506
|
-
var
|
|
507
|
-
t.gridProps.pageable || (
|
|
508
|
-
},
|
|
545
|
+
}, kt = (e, r, o) => {
|
|
546
|
+
var n;
|
|
547
|
+
t.gridProps.pageable || (n = t.gridProps.group) != null && n.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, q()) : ie(e, r, o);
|
|
548
|
+
}, be = () => {
|
|
509
549
|
let e = t.gridProps.total || 0;
|
|
510
550
|
return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
},
|
|
551
|
+
}, Dt = () => {
|
|
552
|
+
D && t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = 0);
|
|
553
|
+
}, Kt = (e) => {
|
|
514
554
|
var i, a;
|
|
515
|
-
const
|
|
516
|
-
o <
|
|
517
|
-
},
|
|
518
|
-
var
|
|
519
|
-
const
|
|
520
|
-
o >= 0 &&
|
|
521
|
-
},
|
|
522
|
-
|
|
523
|
-
},
|
|
524
|
-
|
|
555
|
+
const r = (a = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? a : 0, o = (t.gridProps.skip || 0) + r, n = be();
|
|
556
|
+
o < n && ie({ skip: o, take: r }, e);
|
|
557
|
+
}, Ht = (e) => {
|
|
558
|
+
var n, i;
|
|
559
|
+
const r = (i = (n = t.gridProps.take) != null ? n : t.gridProps.pageSize) != null ? i : 0, o = (t.gridProps.skip || 0) - r;
|
|
560
|
+
o >= 0 && ie({ skip: o, take: r }, e);
|
|
561
|
+
}, Gt = (e) => {
|
|
562
|
+
ie({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
563
|
+
}, Oe = (e, r) => {
|
|
564
|
+
U(
|
|
525
565
|
t.gridProps.onSortChange,
|
|
526
566
|
{ sort: e },
|
|
527
|
-
{ sort: e, ...
|
|
528
|
-
|
|
567
|
+
{ sort: e, ...D && !t.gridProps.pageable ? { skip: 0 } : {} },
|
|
568
|
+
r
|
|
529
569
|
);
|
|
530
|
-
},
|
|
531
|
-
|
|
570
|
+
}, Mt = (e, r) => {
|
|
571
|
+
U(
|
|
532
572
|
t.gridProps.onFilterChange,
|
|
533
573
|
{ filter: e },
|
|
534
574
|
{ filter: e, skip: 0 },
|
|
535
|
-
|
|
575
|
+
r
|
|
536
576
|
);
|
|
537
|
-
},
|
|
577
|
+
}, Tt = (e) => {
|
|
538
578
|
if (!e || e.length === 0) {
|
|
539
|
-
|
|
579
|
+
We({});
|
|
540
580
|
return;
|
|
541
581
|
}
|
|
542
|
-
const
|
|
582
|
+
const r = rt(
|
|
543
583
|
t.gridProps.data,
|
|
544
584
|
e,
|
|
545
585
|
t.columnsRef,
|
|
546
586
|
t.gridProps.dataItemKey
|
|
547
587
|
);
|
|
548
|
-
|
|
549
|
-
},
|
|
550
|
-
|
|
588
|
+
We({ ...r });
|
|
589
|
+
}, We = (e) => {
|
|
590
|
+
U(
|
|
551
591
|
t.gridProps.onHighlightChange,
|
|
552
592
|
{ highlight: e },
|
|
553
593
|
{},
|
|
554
594
|
{}
|
|
555
595
|
);
|
|
556
|
-
},
|
|
557
|
-
const
|
|
596
|
+
}, At = (e) => {
|
|
597
|
+
const r = t.gridProps.searchFields || t.columnsRef.map((i) => i.field) || [], o = e.nativeEvent.target.value, n = {
|
|
558
598
|
logic: "or",
|
|
559
|
-
filters:
|
|
599
|
+
filters: r.filter((i) => i !== void 0).map((i) => {
|
|
560
600
|
var a;
|
|
561
601
|
return typeof i == "string" ? { field: i, value: o, operator: "contains" } : {
|
|
562
602
|
value: o,
|
|
@@ -566,165 +606,165 @@ const Tn = (t, E, h, D) => {
|
|
|
566
606
|
};
|
|
567
607
|
})
|
|
568
608
|
};
|
|
569
|
-
|
|
609
|
+
U(
|
|
570
610
|
t.gridProps.onSearchChange,
|
|
571
611
|
{
|
|
572
|
-
search:
|
|
612
|
+
search: n
|
|
573
613
|
},
|
|
574
614
|
{ skip: 0 },
|
|
575
615
|
e.syntheticEvent
|
|
576
616
|
);
|
|
577
|
-
},
|
|
617
|
+
}, ve = () => {
|
|
578
618
|
var e;
|
|
579
|
-
(e =
|
|
580
|
-
},
|
|
619
|
+
(e = V.current) == null || e.save();
|
|
620
|
+
}, Ne = async () => {
|
|
581
621
|
var e;
|
|
582
|
-
await ((e =
|
|
583
|
-
},
|
|
622
|
+
await ((e = k.current) == null ? void 0 : e.save());
|
|
623
|
+
}, Be = () => {
|
|
584
624
|
var e;
|
|
585
|
-
return ((e =
|
|
586
|
-
},
|
|
587
|
-
var
|
|
588
|
-
(
|
|
589
|
-
},
|
|
590
|
-
var
|
|
591
|
-
return (
|
|
592
|
-
},
|
|
593
|
-
const o =
|
|
594
|
-
let
|
|
595
|
-
t.isVirtualScroll && e.length && !t.gridProps.pageable && (
|
|
625
|
+
return ((e = k.current) == null ? void 0 : e.getBlob()) || null;
|
|
626
|
+
}, Ft = async (e) => {
|
|
627
|
+
var r, o;
|
|
628
|
+
(r = t.gridProps) != null && r.onPdfExport && await ((o = t.gridProps) == null ? void 0 : o.onPdfExport(e));
|
|
629
|
+
}, Lt = (e) => {
|
|
630
|
+
var r, o;
|
|
631
|
+
return (r = t.gridProps) != null && r.onCsvExport ? (o = t.gridProps) == null ? void 0 : o.onCsvExport(e) : e;
|
|
632
|
+
}, Ce = (e, r) => {
|
|
633
|
+
const o = r.nativeEvent ? r : { nativeEvent: r.nativeEvent || r.originalEvent };
|
|
634
|
+
let n = {};
|
|
635
|
+
t.isVirtualScroll && e.length && !t.gridProps.pageable && (n = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (Ee.current = !0), U(
|
|
596
636
|
t.gridProps.onGroupChange,
|
|
597
637
|
{ group: e },
|
|
598
|
-
{ group: e, skip: 0, ...
|
|
638
|
+
{ group: e, skip: 0, ...n },
|
|
599
639
|
o
|
|
600
640
|
);
|
|
601
|
-
},
|
|
641
|
+
}, Ie = (e) => {
|
|
602
642
|
if (t.gridProps.onColumnsStateChange) {
|
|
603
|
-
const
|
|
643
|
+
const r = {
|
|
604
644
|
target: x.current,
|
|
605
645
|
columnsState: e
|
|
606
646
|
};
|
|
607
|
-
|
|
647
|
+
s(t.gridProps.onColumnsStateChange, r);
|
|
608
648
|
}
|
|
609
|
-
},
|
|
610
|
-
const { columnsRef:
|
|
649
|
+
}, ae = (e, r, o) => {
|
|
650
|
+
const { columnsRef: n, columnsState: i } = t, a = n[e], d = Or(i), u = a.depth, g = (l) => {
|
|
611
651
|
do
|
|
612
|
-
|
|
613
|
-
while (
|
|
614
|
-
return
|
|
615
|
-
},
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
const
|
|
619
|
-
|
|
652
|
+
l++;
|
|
653
|
+
while (l < n.length && n[l].depth > u);
|
|
654
|
+
return l;
|
|
655
|
+
}, m = n.splice(e, g(e) - e);
|
|
656
|
+
n.splice(e < r ? g(r - m.length) : r, 0, ...m), n.filter((l) => l.declarationIndex >= 0).forEach((l, w) => {
|
|
657
|
+
l.orderIndex = w;
|
|
658
|
+
const R = d.find((L) => L.id === l.id);
|
|
659
|
+
R && (R.orderIndex = w);
|
|
620
660
|
});
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
if (
|
|
625
|
-
const
|
|
661
|
+
const f = n[e].locked && n[r].locked;
|
|
662
|
+
vr(t.columnsMapRef, n, f || fe.current), Cr(t.columnsMapRef, n, f || fe.current), we.current && (fe.current = !1, we.current = !1);
|
|
663
|
+
const I = oe();
|
|
664
|
+
if (q(), t.gridProps.onColumnReorder) {
|
|
665
|
+
const l = {
|
|
626
666
|
target: x.current,
|
|
627
|
-
columns:
|
|
667
|
+
columns: I,
|
|
628
668
|
columnId: a.id,
|
|
629
669
|
nativeEvent: o
|
|
630
670
|
};
|
|
631
|
-
|
|
671
|
+
s(t.gridProps.onColumnReorder, l);
|
|
632
672
|
}
|
|
633
|
-
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
if (o === "forbidden" || !
|
|
673
|
+
Ie(i);
|
|
674
|
+
}, p = (e, r, o) => {
|
|
675
|
+
const n = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
|
|
676
|
+
if (o === "forbidden" || !n || !ee.current)
|
|
637
677
|
return;
|
|
638
|
-
const i = t.dataRef[
|
|
639
|
-
t.gridProps.onRowReorder &&
|
|
640
|
-
draggedDataItems: [
|
|
678
|
+
const i = t.dataRef[r];
|
|
679
|
+
t.gridProps.onRowReorder && s(t.gridProps.onRowReorder, {
|
|
680
|
+
draggedDataItems: [ee.current],
|
|
641
681
|
droppedDataItem: i == null ? void 0 : i.dataItem,
|
|
642
682
|
dropPosition: o,
|
|
643
683
|
nativeEvent: e.originalEvent,
|
|
644
684
|
dragEvent: e,
|
|
645
685
|
target: x.current
|
|
646
|
-
}),
|
|
647
|
-
},
|
|
686
|
+
}), ee.current = null;
|
|
687
|
+
}, zt = (e, r, o) => {
|
|
648
688
|
if (t.gridProps.group === void 0)
|
|
649
689
|
return;
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
690
|
+
const n = t.gridProps.group.slice();
|
|
691
|
+
n.splice(r, 0, ...n.splice(e, 1)), Ce(n, o);
|
|
692
|
+
}, Ve = (e, r, o) => {
|
|
693
|
+
const n = t.columnsRef[e].field;
|
|
694
|
+
if (!n)
|
|
655
695
|
return;
|
|
656
696
|
const i = (t.gridProps.group || []).slice();
|
|
657
|
-
i.splice(
|
|
658
|
-
},
|
|
659
|
-
const o =
|
|
660
|
-
|
|
661
|
-
},
|
|
662
|
-
var o,
|
|
697
|
+
i.splice(r, 0, { field: n }), Ce(i, o);
|
|
698
|
+
}, Ot = (e, r) => {
|
|
699
|
+
const o = z.current.getCurrentGroupsLength;
|
|
700
|
+
Ve(e, o, r);
|
|
701
|
+
}, ye = () => {
|
|
702
|
+
var o, n, i, a, d, u, g, m, f, I;
|
|
663
703
|
if (t.gridProps.dataLayoutMode === "stacked") {
|
|
664
|
-
const l = ((o =
|
|
665
|
-
if ((
|
|
666
|
-
const
|
|
667
|
-
if (
|
|
668
|
-
let
|
|
669
|
-
for (let
|
|
670
|
-
const
|
|
671
|
-
|
|
704
|
+
const l = ((o = H.current) == null ? void 0 : o.offsetWidth) || 0;
|
|
705
|
+
if ((n = h.current) != null && n.colGroupMain && l) {
|
|
706
|
+
const w = h.current.colGroupMain.children, R = w.length - 1;
|
|
707
|
+
if (R >= 0) {
|
|
708
|
+
let L = 0;
|
|
709
|
+
for (let X = 0; X < R; X++) {
|
|
710
|
+
const Me = parseFloat((w[X].width || 0).toString()) || w[X].clientWidth;
|
|
711
|
+
L += Me;
|
|
672
712
|
}
|
|
673
|
-
const
|
|
674
|
-
|
|
713
|
+
const J = Math.max(0, l - L);
|
|
714
|
+
w[R].width = J + "px", (a = (i = h.current.colGroupHeader) == null ? void 0 : i.children) != null && a[R] && (h.current.colGroupHeader.children[R].width = J + "px"), (u = (d = h.current.colGroupFooter) == null ? void 0 : d.children) != null && u[R] && (h.current.colGroupFooter.children[R].width = J + "px"), (m = (g = h.current.colGroupStickyHeader) == null ? void 0 : g.children) != null && m[R] && (h.current.colGroupStickyHeader.children[R].width = J + "px"), (I = (f = h.current.colGroupStickyFooter) == null ? void 0 : f.children) != null && I[R] && (h.current.colGroupStickyFooter.children[R].width = J + "px");
|
|
675
715
|
}
|
|
676
716
|
}
|
|
677
|
-
|
|
717
|
+
B.current && B.current.setWidth(l), N.current && N.current.setWidth(l), G.current && G.current.setWidth(l), M.current && M.current.setWidth(l), W.current && (W.current.style.width = l ? l + "px" : "");
|
|
678
718
|
return;
|
|
679
719
|
}
|
|
680
720
|
let e = 0;
|
|
681
|
-
if (!
|
|
721
|
+
if (!h.current.colGroupMain)
|
|
682
722
|
return;
|
|
683
|
-
const
|
|
684
|
-
for (let l = 0; l <
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
723
|
+
const r = h.current.colGroupMain.children;
|
|
724
|
+
for (let l = 0; l < r.length; l++) {
|
|
725
|
+
const w = r[l].width;
|
|
726
|
+
if (!w) {
|
|
687
727
|
e = 0;
|
|
688
728
|
break;
|
|
689
729
|
}
|
|
690
|
-
e += parseFloat(
|
|
730
|
+
e += parseFloat(w.toString());
|
|
691
731
|
}
|
|
692
|
-
e = Math.round(e),
|
|
693
|
-
},
|
|
732
|
+
e = Math.round(e), B.current && B.current.setWidth(e), N.current && N.current.setWidth(e), G.current && G.current.setWidth(e), M.current && M.current.setWidth(e), W.current && (W.current.style.width = e ? e + "px" : "");
|
|
733
|
+
}, je = () => {
|
|
694
734
|
var e;
|
|
695
|
-
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e =
|
|
696
|
-
},
|
|
735
|
+
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e = H.current) == null ? void 0 : e.offsetWidth) || 0);
|
|
736
|
+
}, ce = () => {
|
|
697
737
|
var e;
|
|
698
|
-
t.gridProps.containerHeightRef && (t.gridProps.containerHeightRef.current = ((e =
|
|
699
|
-
},
|
|
738
|
+
t.gridProps.containerHeightRef && (t.gridProps.containerHeightRef.current = ((e = F.current) == null ? void 0 : e.offsetHeight) || 0);
|
|
739
|
+
}, Wt = () => {
|
|
700
740
|
const e = t.gridProps.minRowHeightRef;
|
|
701
741
|
if (e && !e.current && !t.gridProps.rowHeight) {
|
|
702
|
-
const
|
|
703
|
-
|
|
742
|
+
const r = Lr(K.current);
|
|
743
|
+
r && (e.current = r, q());
|
|
704
744
|
}
|
|
705
|
-
},
|
|
706
|
-
(e,
|
|
707
|
-
var
|
|
708
|
-
if (!
|
|
745
|
+
}, de = c.useCallback(
|
|
746
|
+
(e, r, o, n, i) => {
|
|
747
|
+
var g;
|
|
748
|
+
if (!Nt() && !o || !e)
|
|
709
749
|
return;
|
|
710
750
|
const a = {
|
|
711
751
|
type: e,
|
|
712
|
-
nativeEvent:
|
|
752
|
+
nativeEvent: r,
|
|
713
753
|
columns: t.columnsRef,
|
|
714
754
|
dataItemKey: t.gridProps.dataItemKey || "",
|
|
715
|
-
dataItem:
|
|
755
|
+
dataItem: n,
|
|
716
756
|
field: i,
|
|
717
757
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
718
758
|
...o
|
|
719
|
-
},
|
|
759
|
+
}, d = S(), u = hr({
|
|
720
760
|
event: a,
|
|
721
|
-
data:
|
|
722
|
-
selectedState: (
|
|
723
|
-
previousCopiedItems:
|
|
761
|
+
data: d,
|
|
762
|
+
selectedState: (g = t.gridProps.select) != null ? g : {},
|
|
763
|
+
previousCopiedItems: Je.current
|
|
724
764
|
});
|
|
725
|
-
e !==
|
|
765
|
+
e !== Te.paste && (Je.current = u.copiedItems), t.gridProps.onClipboard && E && s(t.gridProps.onClipboard, {
|
|
726
766
|
...a,
|
|
727
|
-
...
|
|
767
|
+
...u
|
|
728
768
|
});
|
|
729
769
|
},
|
|
730
770
|
[
|
|
@@ -734,24 +774,24 @@ const Tn = (t, E, h, D) => {
|
|
|
734
774
|
t.gridProps.clipboard,
|
|
735
775
|
t.gridProps.onClipboard
|
|
736
776
|
]
|
|
737
|
-
),
|
|
738
|
-
var i, a,
|
|
739
|
-
if (!
|
|
777
|
+
), Nt = () => {
|
|
778
|
+
var i, a, d;
|
|
779
|
+
if (!te)
|
|
740
780
|
return !1;
|
|
741
|
-
const e =
|
|
742
|
-
return !!(
|
|
743
|
-
},
|
|
744
|
-
|
|
745
|
-
columns:
|
|
746
|
-
nativeEvent:
|
|
747
|
-
targetColumnId:
|
|
781
|
+
const e = sr(A()), r = e ? e.matches(".k-table-td") ? e : (i = A()) == null ? void 0 : i.body : (a = A()) == null ? void 0 : a.body, o = r.closest(".k-grid-container"), n = r && ((d = H.current) == null ? void 0 : d.contains(r));
|
|
782
|
+
return !!(r && n && o);
|
|
783
|
+
}, Ue = (e, r, o, n, i, a, d) => {
|
|
784
|
+
ye(), fe.current = !0, we.current = !0, t.gridProps.onColumnResize && E && s(t.gridProps.onColumnResize, {
|
|
785
|
+
columns: oe(),
|
|
786
|
+
nativeEvent: n,
|
|
787
|
+
targetColumnId: d,
|
|
748
788
|
index: e,
|
|
749
|
-
newWidth:
|
|
789
|
+
newWidth: r,
|
|
750
790
|
oldWidth: o,
|
|
751
791
|
end: i,
|
|
752
792
|
target: x.current
|
|
753
|
-
}), i &&
|
|
754
|
-
},
|
|
793
|
+
}), i && Ie(a);
|
|
794
|
+
}, Bt = () => {
|
|
755
795
|
var e;
|
|
756
796
|
return {
|
|
757
797
|
filter: t.gridProps.filter,
|
|
@@ -760,77 +800,101 @@ const Tn = (t, E, h, D) => {
|
|
|
760
800
|
take: (e = t.gridProps.take) != null ? e : t.gridProps.pageSize,
|
|
761
801
|
group: t.gridProps.group
|
|
762
802
|
};
|
|
763
|
-
},
|
|
803
|
+
}, C = (e) => ({
|
|
764
804
|
nativeEvent: e && e.nativeEvent,
|
|
765
805
|
syntheticEvent: e,
|
|
766
806
|
target: x.current
|
|
767
|
-
}),
|
|
807
|
+
}), Vt = (e) => ({
|
|
768
808
|
...e,
|
|
769
809
|
nativeEvent: void 0,
|
|
770
810
|
syntheticEvent: void 0,
|
|
771
811
|
target: void 0,
|
|
772
812
|
targetEvent: void 0,
|
|
773
813
|
focusElement: void 0
|
|
774
|
-
}),
|
|
814
|
+
}), s = (e, r) => {
|
|
775
815
|
if (t.gridProps.isClient) {
|
|
776
|
-
e(
|
|
816
|
+
e(r);
|
|
777
817
|
return;
|
|
778
818
|
}
|
|
779
|
-
e(
|
|
780
|
-
},
|
|
781
|
-
var e,
|
|
782
|
-
if (
|
|
783
|
-
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
(i) => !
|
|
787
|
-
)[0] :
|
|
819
|
+
e(Vt(r));
|
|
820
|
+
}, jt = () => {
|
|
821
|
+
var e, r, o;
|
|
822
|
+
if (K.current && ((e = K.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
823
|
+
xe.current = !1, (r = document.activeElement) != null && r.closest(".k-grid-edit-row") ? Se.current = document.activeElement : Se.current = void 0;
|
|
824
|
+
const n = Array.from((o = K.current) == null ? void 0 : o.getElementsByClassName("k-grid-edit-row"));
|
|
825
|
+
n.length > He.current.length ? ge.current = n.filter(
|
|
826
|
+
(i) => !He.current.includes(i)
|
|
827
|
+
)[0] : n.length === 1 && (ge.current = n[0], xe.current = !0), He.current = n;
|
|
788
828
|
}
|
|
789
|
-
},
|
|
829
|
+
}, S = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), A = () => {
|
|
790
830
|
var e;
|
|
791
|
-
if (
|
|
792
|
-
return ((e =
|
|
793
|
-
},
|
|
831
|
+
if (te)
|
|
832
|
+
return ((e = le()) == null ? void 0 : e.ownerDocument) || document;
|
|
833
|
+
}, le = () => H.current, se = c.useCallback(
|
|
794
834
|
(e) => {
|
|
795
|
-
var
|
|
796
|
-
if (!v.current || !((
|
|
835
|
+
var n, i;
|
|
836
|
+
if (!v.current || !((n = v.current) != null && n.container) || t.gridProps.scrollable === "none")
|
|
797
837
|
return;
|
|
798
|
-
|
|
799
|
-
const { rowIndex:
|
|
800
|
-
if (
|
|
801
|
-
const a = ((i = v.current.rowHeightService) == null ? void 0 : i.offset(
|
|
838
|
+
_.current && _.current.disconnect();
|
|
839
|
+
const { rowIndex: r } = e, o = le();
|
|
840
|
+
if (D) {
|
|
841
|
+
const a = ((i = v.current.rowHeightService) == null ? void 0 : i.offset(r)) || 0;
|
|
802
842
|
v.current.container.scroll(0, a);
|
|
803
843
|
} else if (o) {
|
|
804
|
-
const a =
|
|
805
|
-
a &&
|
|
844
|
+
const a = r < 1 ? o.querySelector("tbody > tr:nth-child(1)") : o.querySelector(`tbody > tr:nth-child(${r + 1})`);
|
|
845
|
+
a && F.current && (F.current.scrollTop = a.offsetTop);
|
|
806
846
|
}
|
|
807
847
|
},
|
|
808
848
|
[t.gridProps.scrollable]
|
|
809
|
-
),
|
|
810
|
-
|
|
811
|
-
},
|
|
849
|
+
), qe = (e) => JSON.stringify(e.map((r) => ({ id: r.id, field: r.field, title: r.title, children: r.children }))), Ut = () => qe(ar) === qe(t.columnsRef), qt = () => {
|
|
850
|
+
me.current = window.innerWidth, Ut() || q();
|
|
851
|
+
}, $t = () => {
|
|
812
852
|
var a;
|
|
813
|
-
const { virtualTotal: e, virtualPageSize:
|
|
814
|
-
|
|
815
|
-
},
|
|
853
|
+
const { virtualTotal: e, virtualPageSize: r, gridProps: o } = t, n = v.current, i = t.gridProps.rowHeight || ((a = o.minRowHeightRef) == null ? void 0 : a.current) || 0;
|
|
854
|
+
n && (n.fixedScroll = o.fixedScroll || !1, n.PageChange = kt, n.pageSize = r, n.scrollableVirtual = D, n.container = F.current, n.tableBody = K.current, n.scrollHeightContainer = _e.current, n.table = W.current, (!n.rowHeightService || n.total !== e) && i && (n.total = e, n.rowHeightService = new fr(e, i)));
|
|
855
|
+
}, $e = c.useCallback(
|
|
816
856
|
(e) => {
|
|
817
|
-
const
|
|
857
|
+
const r = { rowIndex: Ke.current };
|
|
818
858
|
e.forEach((o) => {
|
|
819
|
-
o.boundingClientRect.height !== o.intersectionRect.height &&
|
|
859
|
+
o.boundingClientRect.height !== o.intersectionRect.height && se(r);
|
|
820
860
|
});
|
|
821
861
|
},
|
|
822
|
-
[
|
|
823
|
-
),
|
|
862
|
+
[se]
|
|
863
|
+
), q = () => {
|
|
824
864
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
|
|
865
|
+
}, _t = (e) => e.left !== void 0 ? Ge !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, x = c.useRef(null), v = c.useRef(void 0), h = c.useRef(void 0), z = c.useRef(void 0), O = c.useRef(void 0), $ = c.useRef(void 0), ue = c.useRef(void 0), _ = c.useRef(null), K = c.useRef(null), Jt = c.useRef(null), F = c.useRef(null), W = c.useRef(null), Xt = c.useRef(null), H = c.useRef(null), _e = c.useRef(null), N = c.useRef(null), B = c.useRef(null), G = c.useRef(null), M = c.useRef(null), we = c.useRef(!1), Ee = c.useRef(!1), ge = c.useRef(void 0), Se = c.useRef(void 0), xe = c.useRef(!1), fe = c.useRef(!0), ke = c.useRef(0), De = c.useRef(void 0), Ke = c.useRef(void 0), He = c.useRef([]), Je = c.useRef([]), me = c.useRef(0), he = c.useRef(
|
|
866
|
+
null
|
|
867
|
+
), Yt = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyHeaders, Qt = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyFooters, Zt = !!((Ze = t.gridProps.group) != null && Ze.length), {
|
|
868
|
+
stickyHeaderItems: pt,
|
|
869
|
+
stickyHeaderRef: er,
|
|
870
|
+
stickyFooterItems: tr,
|
|
871
|
+
stickyFooterRef: rr,
|
|
872
|
+
scrollToStickyGroup: nr,
|
|
873
|
+
update: Xe
|
|
874
|
+
} = Mr({
|
|
875
|
+
enabled: Yt,
|
|
876
|
+
enabledFooters: Qt,
|
|
877
|
+
flatData: t.dataRef,
|
|
878
|
+
containerRef: F,
|
|
879
|
+
tableBodyRef: K,
|
|
880
|
+
rowHeight: t.gridProps.rowHeight,
|
|
881
|
+
isGrouped: Zt,
|
|
882
|
+
virtualSkipRef: t.gridProps.virtualSkipRef,
|
|
883
|
+
rowHeightServiceRef: {
|
|
884
|
+
get current() {
|
|
885
|
+
var e;
|
|
886
|
+
return (e = v.current) == null ? void 0 : e.rowHeightService;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}), ee = c.useRef(null), or = c.useRef(null), ir = c.useRef(null), Ge = ur(H), D = t.isVirtualScroll, ar = c.useMemo(() => c.Children.toArray(t.gridProps.children), [t.gridProps.children]), Ye = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, P = Pe(t.gridProps.selectable), Qe = Pr(t.gridProps.editable), cr = me.current && Q && me.current <= Q.medium && t.gridProps.adaptive;
|
|
890
|
+
return c.useMemo(() => {
|
|
891
|
+
Y.onConstructor({
|
|
828
892
|
navigatable: !!t.gridProps.navigatable,
|
|
829
|
-
contextStateRef:
|
|
830
|
-
navigationStateRef:
|
|
893
|
+
contextStateRef: O,
|
|
894
|
+
navigationStateRef: $,
|
|
831
895
|
idPrefix: t.id
|
|
832
|
-
}), v.current = new
|
|
833
|
-
}, []),
|
|
896
|
+
}), v.current = new Nr();
|
|
897
|
+
}, []), c.useMemo(() => {
|
|
834
898
|
var e;
|
|
835
899
|
(e = v.current) == null || e.reset();
|
|
836
900
|
}, [
|
|
@@ -838,134 +902,134 @@ const Tn = (t, E, h, D) => {
|
|
|
838
902
|
t.gridProps.total,
|
|
839
903
|
t.gridProps.filter,
|
|
840
904
|
t.gridProps.group,
|
|
841
|
-
|
|
905
|
+
Ye,
|
|
842
906
|
t.gridProps.sort,
|
|
843
907
|
t.gridProps.rowHeight
|
|
844
|
-
]),
|
|
845
|
-
|
|
846
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard,
|
|
847
|
-
scope:
|
|
848
|
-
contextStateRef:
|
|
849
|
-
navigationStateRef:
|
|
908
|
+
]), c.useEffect(() => (t.gridProps.clipboard && (ue.current = new Rr(de), ue.current.addEventListeners(A())), () => {
|
|
909
|
+
ue.current && ue.current.removeEventListeners(A());
|
|
910
|
+
}), [t.gridProps.onClipboard, t.gridProps.clipboard, de, A]), c.useEffect(() => (je(), ye(), pe(), Y.onComponentDidMount({
|
|
911
|
+
scope: H.current || void 0,
|
|
912
|
+
contextStateRef: O,
|
|
913
|
+
navigationStateRef: $
|
|
850
914
|
}), () => {
|
|
851
|
-
clearTimeout(
|
|
852
|
-
}), []),
|
|
915
|
+
clearTimeout(De.current);
|
|
916
|
+
}), []), c.useEffect(() => {
|
|
853
917
|
var e;
|
|
854
|
-
|
|
855
|
-
scope:
|
|
856
|
-
contextStateRef:
|
|
857
|
-
navigationStateRef:
|
|
858
|
-
focusFirst:
|
|
859
|
-
newEditableRow:
|
|
860
|
-
singleEditRow:
|
|
861
|
-
lastActiveElement:
|
|
918
|
+
je(), ye(), pe(), D && (ce(), Wt(), (e = v.current) == null || e.update()), Xe(), jt(), Y.onComponentDidUpdate({
|
|
919
|
+
scope: H.current || void 0,
|
|
920
|
+
contextStateRef: O,
|
|
921
|
+
navigationStateRef: $,
|
|
922
|
+
focusFirst: Ee.current,
|
|
923
|
+
newEditableRow: ge.current,
|
|
924
|
+
singleEditRow: xe.current,
|
|
925
|
+
lastActiveElement: Se.current,
|
|
862
926
|
navigatable: t.gridProps.navigatable
|
|
863
|
-
}),
|
|
864
|
-
}),
|
|
865
|
-
if (
|
|
927
|
+
}), ct(), Ee.current = !1, ge.current = void 0, he.current = void 0;
|
|
928
|
+
}), c.useEffect(() => {
|
|
929
|
+
if (te) {
|
|
866
930
|
const e = {
|
|
867
931
|
rootMargin: "0px",
|
|
868
932
|
threshold: 0.9
|
|
869
933
|
};
|
|
870
|
-
|
|
934
|
+
_.current = window.IntersectionObserver && new window.IntersectionObserver($e, e) || null;
|
|
871
935
|
}
|
|
872
|
-
}, [
|
|
873
|
-
var
|
|
936
|
+
}, [$e]), c.useEffect(() => {
|
|
937
|
+
var r;
|
|
874
938
|
let e;
|
|
875
|
-
return
|
|
876
|
-
|
|
877
|
-
}), e.observe((
|
|
939
|
+
return te && window.ResizeObserver && (e = new window.ResizeObserver(() => {
|
|
940
|
+
qt(), D && ce();
|
|
941
|
+
}), e.observe((r = A()) == null ? void 0 : r.body)), () => {
|
|
878
942
|
e == null || e.disconnect();
|
|
879
943
|
};
|
|
880
|
-
}, []),
|
|
881
|
-
if (!
|
|
944
|
+
}, []), c.useEffect(() => {
|
|
945
|
+
if (!te || !window.ResizeObserver || !D || !F.current)
|
|
882
946
|
return;
|
|
883
947
|
const e = () => {
|
|
884
948
|
var i, a;
|
|
885
949
|
const o = ((i = t.gridProps.containerHeightRef) == null ? void 0 : i.current) || 0;
|
|
886
|
-
|
|
887
|
-
const
|
|
888
|
-
(o === 0 &&
|
|
889
|
-
},
|
|
890
|
-
return
|
|
891
|
-
|
|
950
|
+
ce();
|
|
951
|
+
const n = ((a = t.gridProps.containerHeightRef) == null ? void 0 : a.current) || 0;
|
|
952
|
+
(o === 0 && n > 0 || Math.abs(n - o) > 10) && q();
|
|
953
|
+
}, r = new window.ResizeObserver(e);
|
|
954
|
+
return r.observe(F.current), () => {
|
|
955
|
+
r.disconnect();
|
|
892
956
|
};
|
|
893
|
-
}, [
|
|
957
|
+
}, [D, ce]), c.useImperativeHandle(
|
|
894
958
|
x,
|
|
895
959
|
() => ({
|
|
896
960
|
get element() {
|
|
897
|
-
return
|
|
961
|
+
return le();
|
|
898
962
|
},
|
|
899
963
|
props: t.gridProps,
|
|
900
964
|
get columns() {
|
|
901
|
-
return
|
|
965
|
+
return oe();
|
|
902
966
|
},
|
|
903
967
|
scrollIntoView: (e) => {
|
|
904
|
-
var
|
|
905
|
-
if (!((
|
|
968
|
+
var n;
|
|
969
|
+
if (!((n = v.current) != null && n.container) || t.gridProps.scrollable === "none")
|
|
906
970
|
return;
|
|
907
|
-
const { rowIndex:
|
|
908
|
-
|
|
909
|
-
const o =
|
|
910
|
-
if (
|
|
911
|
-
|
|
912
|
-
const i = o.querySelector(`[absolute-row-index="${
|
|
913
|
-
i ?
|
|
971
|
+
const { rowIndex: r } = e;
|
|
972
|
+
Ke.current = r;
|
|
973
|
+
const o = le();
|
|
974
|
+
if (_.current && o) {
|
|
975
|
+
_.current.disconnect();
|
|
976
|
+
const i = o.querySelector(`[absolute-row-index="${Ke.current}"]`);
|
|
977
|
+
i ? _.current.observe(i) : se(e);
|
|
914
978
|
}
|
|
915
979
|
},
|
|
916
980
|
fitColumns: (e) => {
|
|
917
|
-
|
|
981
|
+
h.current.dblClickHandler(null, e);
|
|
918
982
|
},
|
|
919
|
-
exportAsPdf:
|
|
920
|
-
saveAsCsv:
|
|
921
|
-
getCsvBlob:
|
|
922
|
-
getTotal:
|
|
923
|
-
getLeafDataItems:
|
|
983
|
+
exportAsPdf: ve,
|
|
984
|
+
saveAsCsv: Ne,
|
|
985
|
+
getCsvBlob: Be,
|
|
986
|
+
getTotal: be,
|
|
987
|
+
getLeafDataItems: S
|
|
924
988
|
})
|
|
925
|
-
),
|
|
926
|
-
|
|
927
|
-
}, [t.gridProps.onColumnResize, t.columnsRef]),
|
|
928
|
-
|
|
989
|
+
), c.useImperativeHandle(t.gridRef, () => x.current), c.useMemo(() => {
|
|
990
|
+
h.current = new Hr(Ue);
|
|
991
|
+
}, [t.gridProps.onColumnResize, t.columnsRef]), c.useMemo(() => {
|
|
992
|
+
z.current = new Gr(ae, zt, Ve);
|
|
929
993
|
}, [
|
|
930
994
|
t.gridProps.onColumnReorder,
|
|
931
995
|
t.gridProps.onGroupChange,
|
|
932
996
|
t.gridProps.group,
|
|
933
997
|
t.columnsRef,
|
|
934
998
|
t.gridProps.groupable
|
|
935
|
-
]),
|
|
936
|
-
|
|
999
|
+
]), h.current.resizable = t.gridProps.resizable || !1, h.current.columns = t.columnsRef, h.current.columnsState = gr(t.columnsState), z.current.reorderable = t.gridProps.reorderable || !1, z.current.groupable = Ye, z.current.columns = t.columnsRef, z.current.dir = Ge, $t(), /* @__PURE__ */ c.createElement(
|
|
1000
|
+
$r.Provider,
|
|
937
1001
|
{
|
|
938
1002
|
value: {
|
|
939
1003
|
isClient: E,
|
|
940
|
-
rowReorder:
|
|
941
|
-
activeDragRowDataItemRef:
|
|
942
|
-
reorderRowDragTargetRef:
|
|
943
|
-
reorderRowDropTargetRef:
|
|
944
|
-
dir:
|
|
945
|
-
getCellPositionStyle:
|
|
1004
|
+
rowReorder: p,
|
|
1005
|
+
activeDragRowDataItemRef: ee,
|
|
1006
|
+
reorderRowDragTargetRef: or,
|
|
1007
|
+
reorderRowDropTargetRef: ir,
|
|
1008
|
+
dir: Ge,
|
|
1009
|
+
getCellPositionStyle: _t,
|
|
946
1010
|
dataItemKey: t.gridProps.dataItemKey,
|
|
947
1011
|
columnsState: t.columnsState,
|
|
948
1012
|
columnsRef: t.columnsRef,
|
|
949
1013
|
hiddenColumnsRef: t.hiddenColumnsRef,
|
|
950
|
-
onColumnsStateChange:
|
|
1014
|
+
onColumnsStateChange: Ie,
|
|
951
1015
|
groupable: t.gridProps.groupable,
|
|
952
1016
|
group: t.gridProps.group,
|
|
953
1017
|
reorderable: t.gridProps.reorderable,
|
|
954
1018
|
defaultGroup: t.gridProps.defaultGroup,
|
|
955
|
-
groupChange:
|
|
956
|
-
selectionRelease:
|
|
957
|
-
pagerPageChange:
|
|
958
|
-
onContextMenu:
|
|
959
|
-
rowClick:
|
|
960
|
-
rowDblClick:
|
|
961
|
-
cellClick:
|
|
962
|
-
headerCellClick:
|
|
963
|
-
itemChange:
|
|
964
|
-
onDialogEditCancel:
|
|
965
|
-
onDialogEditSubmit:
|
|
966
|
-
columnReorder:
|
|
967
|
-
onResize:
|
|
968
|
-
getTotal:
|
|
1019
|
+
groupChange: Ce,
|
|
1020
|
+
selectionRelease: yt,
|
|
1021
|
+
pagerPageChange: Gt,
|
|
1022
|
+
onContextMenu: ot,
|
|
1023
|
+
rowClick: ut,
|
|
1024
|
+
rowDblClick: gt,
|
|
1025
|
+
cellClick: ht,
|
|
1026
|
+
headerCellClick: ze,
|
|
1027
|
+
itemChange: bt,
|
|
1028
|
+
onDialogEditCancel: mt,
|
|
1029
|
+
onDialogEditSubmit: ft,
|
|
1030
|
+
columnReorder: ae,
|
|
1031
|
+
onResize: Ue,
|
|
1032
|
+
getTotal: be,
|
|
969
1033
|
sortable: t.gridProps.sortable,
|
|
970
1034
|
pageable: t.gridProps.pageable,
|
|
971
1035
|
pageSize: t.gridProps.pageSize,
|
|
@@ -973,83 +1037,89 @@ const Tn = (t, E, h, D) => {
|
|
|
973
1037
|
skip: t.gridProps.skip,
|
|
974
1038
|
take: t.gridProps.take,
|
|
975
1039
|
defaultSort: t.gridProps.defaultSort,
|
|
976
|
-
sortChange:
|
|
1040
|
+
sortChange: Oe,
|
|
977
1041
|
filterable: t.gridProps.filterable,
|
|
978
1042
|
filter: t.gridProps.filter,
|
|
979
1043
|
defaultFilter: t.gridProps.defaultFilter,
|
|
980
|
-
filterOperators: t.gridProps.filterOperators ||
|
|
981
|
-
getLeafDataItems:
|
|
982
|
-
filterChange:
|
|
983
|
-
applyHighlightDescriptor:
|
|
984
|
-
applySelectionDescriptor:
|
|
1044
|
+
filterOperators: t.gridProps.filterOperators || _r,
|
|
1045
|
+
getLeafDataItems: S,
|
|
1046
|
+
filterChange: Mt,
|
|
1047
|
+
applyHighlightDescriptor: Tt,
|
|
1048
|
+
applySelectionDescriptor: St,
|
|
985
1049
|
highlight: t.gridProps.highlight,
|
|
986
1050
|
select: t.gridProps.select,
|
|
987
|
-
searchChange:
|
|
988
|
-
exportAsPdf:
|
|
989
|
-
exportAsCsv:
|
|
990
|
-
getCsvBlob:
|
|
991
|
-
onHeaderSelectionChange:
|
|
992
|
-
columnGroupChange:
|
|
993
|
-
onKeyDown:
|
|
994
|
-
onFocus:
|
|
995
|
-
scrollHandler:
|
|
996
|
-
selectionChange:
|
|
997
|
-
mobileMode:
|
|
998
|
-
adaptiveColumnMenuRef:
|
|
1051
|
+
searchChange: At,
|
|
1052
|
+
exportAsPdf: ve,
|
|
1053
|
+
exportAsCsv: Ne,
|
|
1054
|
+
getCsvBlob: Be,
|
|
1055
|
+
onHeaderSelectionChange: It,
|
|
1056
|
+
columnGroupChange: Ot,
|
|
1057
|
+
onKeyDown: dt,
|
|
1058
|
+
onFocus: lt,
|
|
1059
|
+
scrollHandler: it,
|
|
1060
|
+
selectionChange: vt,
|
|
1061
|
+
mobileMode: cr,
|
|
1062
|
+
adaptiveColumnMenuRef: me.current,
|
|
999
1063
|
adpativeTitle: t.gridProps.adaptiveTitle,
|
|
1000
1064
|
adaptive: t.gridProps.adaptive,
|
|
1001
|
-
dispatchDetailExpand:
|
|
1002
|
-
dispatchGroupExpand:
|
|
1003
|
-
columnResizeRef:
|
|
1004
|
-
dragLogicRef:
|
|
1005
|
-
navigationStateRef:
|
|
1006
|
-
tableElementRef:
|
|
1007
|
-
tableBodyElementRef:
|
|
1008
|
-
headerElementRef:
|
|
1009
|
-
containerElementRef:
|
|
1010
|
-
headTableElementRef:
|
|
1011
|
-
elementRef:
|
|
1012
|
-
virtualScrollHeightContainerRef:
|
|
1013
|
-
footerRef:
|
|
1014
|
-
headerRef:
|
|
1015
|
-
vsRef: v
|
|
1065
|
+
dispatchDetailExpand: Pt,
|
|
1066
|
+
dispatchGroupExpand: Rt,
|
|
1067
|
+
columnResizeRef: h,
|
|
1068
|
+
dragLogicRef: z,
|
|
1069
|
+
navigationStateRef: $,
|
|
1070
|
+
tableElementRef: W,
|
|
1071
|
+
tableBodyElementRef: K,
|
|
1072
|
+
headerElementRef: Jt,
|
|
1073
|
+
containerElementRef: F,
|
|
1074
|
+
headTableElementRef: Xt,
|
|
1075
|
+
elementRef: H,
|
|
1076
|
+
virtualScrollHeightContainerRef: _e,
|
|
1077
|
+
footerRef: N,
|
|
1078
|
+
headerRef: B,
|
|
1079
|
+
vsRef: v,
|
|
1080
|
+
stickyHeaderItems: pt,
|
|
1081
|
+
stickyHeaderRef: er,
|
|
1082
|
+
stickyFooterItems: tr,
|
|
1083
|
+
stickyFooterRef: rr,
|
|
1084
|
+
stickyHeaderTableRef: G,
|
|
1085
|
+
stickyFooterTableRef: M
|
|
1016
1086
|
}
|
|
1017
1087
|
},
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
|
|
1088
|
+
/* @__PURE__ */ c.createElement(br.Provider, { value: O.current }, t.children),
|
|
1089
|
+
/* @__PURE__ */ c.createElement(
|
|
1090
|
+
Br,
|
|
1021
1091
|
{
|
|
1022
|
-
show:
|
|
1023
|
-
dataItem:
|
|
1024
|
-
field:
|
|
1025
|
-
items:
|
|
1026
|
-
offset:
|
|
1027
|
-
onClose:
|
|
1028
|
-
onSelect:
|
|
1092
|
+
show: b.show && (ne == null ? void 0 : ne.length),
|
|
1093
|
+
dataItem: b.dataItem,
|
|
1094
|
+
field: b.field,
|
|
1095
|
+
items: ne,
|
|
1096
|
+
offset: b.offset,
|
|
1097
|
+
onClose: Ae,
|
|
1098
|
+
onSelect: nt
|
|
1029
1099
|
}
|
|
1030
1100
|
),
|
|
1031
|
-
t.gridProps.pdf && /* @__PURE__ */
|
|
1032
|
-
|
|
1101
|
+
t.gridProps.pdf && /* @__PURE__ */ c.createElement(
|
|
1102
|
+
Ur,
|
|
1033
1103
|
{
|
|
1034
1104
|
gridProps: t.gridProps,
|
|
1035
1105
|
innerGrid: t.innerGrid,
|
|
1036
1106
|
pdf: typeof t.gridProps.pdf == "object" ? t.gridProps.pdf : {},
|
|
1037
|
-
onPdfExport:
|
|
1038
|
-
ref: (e) =>
|
|
1107
|
+
onPdfExport: Ft,
|
|
1108
|
+
ref: (e) => V.current = e
|
|
1039
1109
|
}
|
|
1040
1110
|
),
|
|
1041
|
-
t.gridProps.csv && /* @__PURE__ */
|
|
1042
|
-
|
|
1111
|
+
t.gridProps.csv && /* @__PURE__ */ c.createElement(
|
|
1112
|
+
qr,
|
|
1043
1113
|
{
|
|
1044
1114
|
gridProps: t.gridProps,
|
|
1045
1115
|
csv: typeof t.gridProps.csv == "object" ? t.gridProps.csv : {},
|
|
1046
|
-
onCsvExport:
|
|
1116
|
+
onCsvExport: Lt,
|
|
1047
1117
|
columnsState: t.columnsState,
|
|
1048
|
-
ref: (e) =>
|
|
1118
|
+
ref: (e) => k.current = e
|
|
1049
1119
|
}
|
|
1050
1120
|
)
|
|
1051
1121
|
);
|
|
1052
1122
|
};
|
|
1053
1123
|
export {
|
|
1054
|
-
|
|
1124
|
+
un as GridClientWrapper
|
|
1055
1125
|
};
|