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