@progress/kendo-react-grid 14.3.0-develop.8 → 14.3.0-develop.9
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 +489 -485
- 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 +17 -17
package/GridClientWrapper.mjs
CHANGED
|
@@ -7,32 +7,32 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as d from "react";
|
|
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
|
|
26
|
-
const ne = Object.keys(
|
|
27
|
-
return t.reduce((
|
|
28
|
-
}, lt = (t,
|
|
29
|
-
|
|
30
|
-
...
|
|
31
|
-
}), {}),
|
|
32
|
-
var
|
|
33
|
-
const
|
|
34
|
-
e.event.preventDefault(),
|
|
35
|
-
...
|
|
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 dt, 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 ct, 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 dr = (t, x, b, W) => {
|
|
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[W != null ? W : "id"]] = $, k), {});
|
|
28
|
+
}, lt = (t, x, b, W) => x.reduce(($, k) => ({
|
|
29
|
+
...$,
|
|
30
|
+
...dr(Sn(t, k), k, b, W)
|
|
31
|
+
}), {}), yr = (t) => {
|
|
32
|
+
var it;
|
|
33
|
+
const x = t.gridProps.isClient, [b, W] = d.useState({}), ne = In(), $ = d.useRef(null), k = d.useRef(null), re = (e) => {
|
|
34
|
+
e.event.preventDefault(), W({
|
|
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
|
+
W({});
|
|
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, c = 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 ? !c : m.name === Ee.pinBottom ? !s : m.name === Ee.unpin ? c || s : !0)
|
|
53
|
+
} : l;
|
|
54
54
|
});
|
|
55
|
-
}, y = d.useMemo(() => t.columnsRef.find((e) => e.field ===
|
|
55
|
+
}, y = d.useMemo(() => t.columnsRef.find((e) => e.field === b.field), [t.columnsRef, b]), pe = d.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 = d.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,
|
|
@@ -75,30 +75,30 @@ const cr = (t, E, h, L) => {
|
|
|
75
75
|
t.gridProps.rowReorderable,
|
|
76
76
|
t.gridProps.pdf
|
|
77
77
|
]), de = d.useMemo(() => {
|
|
78
|
-
const e = (y == null ? void 0 : y.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(
|
|
79
|
-
if (n &&
|
|
80
|
-
const o =
|
|
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 ? ct.body : ct.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 c,
|
|
91
|
+
]), ut = (e) => {
|
|
92
|
+
var c, s, l, u, m, w, h, O, 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((
|
|
117
|
+
}, a = r.findIndex((E) => E === e.dataItem);
|
|
118
118
|
switch ((c = n.data) == null ? void 0 : c.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"), q = ((l = n.name) == null ? void 0 : l.toLowerCase().includes("desc")) ? "desc" : void 0, B = E ? "asc" : q, Q = n.name ? B : 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: !((O = n.name) != null && O.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
|
-
|
|
172
|
+
Oe();
|
|
173
173
|
}, ce = () => {
|
|
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
|
-
},
|
|
192
|
+
}, ft = (e) => {
|
|
193
193
|
var a, c;
|
|
194
194
|
if (e.target !== e.currentTarget)
|
|
195
195
|
return;
|
|
196
|
-
clearTimeout(
|
|
196
|
+
clearTimeout(Fe.current), C.current && (C.current.table = U.current);
|
|
197
197
|
const n = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop;
|
|
198
|
-
t.gridProps.columnVirtualization && (!
|
|
199
|
-
|
|
200
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n),
|
|
198
|
+
t.gridProps.columnVirtualization && (!K || o === Ae.current) && (Fe.current = window.setTimeout(() => {
|
|
199
|
+
J();
|
|
200
|
+
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n), j.current && j.current.setScrollLeft(n), V.current && V.current.setScrollLeft(n), M != null && M.current && M.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);
|
|
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 && ((c = t.gridProps.virtualSkipRef) == null ? void 0 : c.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 = G.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 || !H.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 = G.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
|
-
contextStateRef:
|
|
243
|
-
navigationStateRef:
|
|
244
|
-
onNavigationAction:
|
|
242
|
+
contextStateRef: N,
|
|
243
|
+
navigationStateRef: X,
|
|
244
|
+
onNavigationAction: bt,
|
|
245
245
|
columns: ce()
|
|
246
246
|
}), te.onGetSnapshotBeforeUpdate({
|
|
247
|
-
document:
|
|
248
|
-
contextStateRef:
|
|
249
|
-
navigationStateRef:
|
|
247
|
+
document: z(),
|
|
248
|
+
contextStateRef: N,
|
|
249
|
+
navigationStateRef: X
|
|
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
|
-
contextStateRef:
|
|
263
|
+
contextStateRef: N
|
|
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
315
|
const c = !!((i = (r = e.target).closest) != null && i.call(r, ".k-grid-pinned-container"));
|
|
316
316
|
t.gridProps.editZoneRef.current = c ? "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 = d.useCallback(
|
|
350
350
|
(e) => {
|
|
351
351
|
const { dataItemKey: n = "", pinnedTopRows: o = [], pinnedBottomRows: r = [] } = t.gridProps;
|
|
352
352
|
if (!n || !e)
|
|
@@ -355,99 +355,99 @@ 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], c = r.filter((u) => u[o] !== a),
|
|
362
|
-
let
|
|
361
|
+
const { dataItemKey: o = "", pinnedTopRows: r = [], pinnedBottomRows: i = [] } = t.gridProps, a = n[o], c = 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: [...c, n], pinnedBottomRows: s, dataItem: n };
|
|
366
366
|
break;
|
|
367
367
|
case "pinBottom":
|
|
368
|
-
|
|
368
|
+
l = { pinnedTopRows: c, pinnedBottomRows: [...s, n], dataItem: n };
|
|
369
369
|
break;
|
|
370
370
|
case "unpin":
|
|
371
|
-
|
|
371
|
+
l = { pinnedTopRows: c, 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
|
-
c !== "" && n.field &&
|
|
383
|
-
},
|
|
384
|
-
t.gridProps.onItemChange &&
|
|
385
|
-
...
|
|
381
|
+
), a = (t.gridProps.sort || []).filter((l) => l.field === n.field)[0], c = o || nr[r][a && a.dir || ""], s = i === "single" ? [] : (t.gridProps.sort || []).filter((l) => l.field !== n.field);
|
|
382
|
+
c !== "" && n.field && s.push({ field: n.field, dir: c }), 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 &&
|
|
393
|
+
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
394
394
|
const { event: o, dataItem: r, dataIndex: i, columnIndex: a } = e, c = {
|
|
395
|
-
...
|
|
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
|
-
|
|
412
|
+
f(t.gridProps.onSelectionChange, {
|
|
413
413
|
...c,
|
|
414
|
-
select: t.gridProps.dataItemKey ?
|
|
414
|
+
select: t.gridProps.dataItemKey ? dt({
|
|
415
415
|
event: c,
|
|
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 (c !== void 0 &&
|
|
441
|
-
const
|
|
442
|
-
t.gridProps.onSelectionChange &&
|
|
439
|
+
const r = e.target, i = ye(r, "TD"), a = ye(r, "TR"), c = On(i), s = pn(a);
|
|
440
|
+
if (c !== 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:
|
|
445
|
+
dataItem: m,
|
|
446
|
+
startRowIndex: s,
|
|
447
447
|
startColIndex: c,
|
|
448
|
-
startDataItem:
|
|
449
|
-
endDataItem:
|
|
450
|
-
endRowIndex:
|
|
448
|
+
startDataItem: m,
|
|
449
|
+
endDataItem: m,
|
|
450
|
+
endRowIndex: s,
|
|
451
451
|
endColIndex: c,
|
|
452
452
|
ctrlKey: e.ctrlKey,
|
|
453
453
|
altKey: e.altKey,
|
|
@@ -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
|
-
},
|
|
472
|
-
t.gridProps.onSelectionChange &&
|
|
471
|
+
}, _ = (e, n) => {
|
|
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
|
-
}, c =
|
|
499
|
+
}, c = dt({
|
|
500
500
|
event: a,
|
|
501
501
|
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
502
502
|
dataItemKey: t.gridProps.dataItemKey
|
|
503
503
|
});
|
|
504
|
-
|
|
504
|
+
_(a, c);
|
|
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[
|
|
520
|
-
}),
|
|
518
|
+
const s = ee(t.gridProps.dataItemKey)(a);
|
|
519
|
+
r[s] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
|
|
520
|
+
}), _(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,
|
|
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, _(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
|
-
|
|
566
|
+
_(m, {});
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
const r = lt(
|
|
@@ -572,15 +572,15 @@ 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, c = -1,
|
|
578
|
+
let a = -1, c = -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]), c = w, l = n[w]);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
const u = {
|
|
@@ -589,70 +589,70 @@ const cr = (t, E, h, L) => {
|
|
|
589
589
|
endRowIndex: c,
|
|
590
590
|
startColIndex: 0,
|
|
591
591
|
endColIndex: t.columnsRef.length - 1,
|
|
592
|
-
startDataItem:
|
|
593
|
-
endDataItem:
|
|
592
|
+
startDataItem: s,
|
|
593
|
+
endDataItem: l
|
|
594
594
|
};
|
|
595
|
-
|
|
596
|
-
},
|
|
597
|
-
t.gridProps.onSelectionChange &&
|
|
598
|
-
},
|
|
599
|
-
|
|
595
|
+
_(u, i);
|
|
596
|
+
}, Ft = (e) => {
|
|
597
|
+
t.gridProps.onSelectionChange && v.enabled && _(e, {});
|
|
598
|
+
}, Z = (e, n, o, r, i) => {
|
|
599
|
+
Bt();
|
|
600
600
|
const a = t.gridProps.onDataStateChange;
|
|
601
601
|
if (e) {
|
|
602
|
-
const c = { ...
|
|
603
|
-
|
|
604
|
-
} else a &&
|
|
605
|
-
...
|
|
602
|
+
const c = { ...I(r), ...n, targetEvent: i };
|
|
603
|
+
f(e, c);
|
|
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()), Z(
|
|
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,
|
|
624
|
-
},
|
|
623
|
+
t.gridProps.pageable || (r = t.gridProps.group) != null && r.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, J()) : 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
|
-
},
|
|
640
|
-
|
|
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
|
+
Z(
|
|
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) => {
|
|
647
|
-
|
|
647
|
+
Z(
|
|
648
648
|
t.gridProps.onFilterChange,
|
|
649
649
|
{ filter: e },
|
|
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
|
-
},
|
|
666
|
-
|
|
664
|
+
qe({ ...n });
|
|
665
|
+
}, qe = (e) => {
|
|
666
|
+
Z(
|
|
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) => {
|
|
@@ -682,7 +682,7 @@ const cr = (t, E, h, L) => {
|
|
|
682
682
|
};
|
|
683
683
|
})
|
|
684
684
|
};
|
|
685
|
-
|
|
685
|
+
Z(
|
|
686
686
|
t.gridProps.onSearchChange,
|
|
687
687
|
{
|
|
688
688
|
search: r
|
|
@@ -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
|
-
(e =
|
|
696
|
-
},
|
|
695
|
+
(e = $.current) == null || e.save();
|
|
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), Z(
|
|
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], c =
|
|
726
|
+
const { columnsRef: r, columnsState: i } = t, a = r[e], c = 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, O) => {
|
|
733
|
+
h.orderIndex = O;
|
|
734
|
+
const g = c.find((E) => E.id === h.id);
|
|
735
|
+
g && (g.orderIndex = O);
|
|
736
736
|
});
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
const
|
|
740
|
-
if (
|
|
741
|
-
const
|
|
742
|
-
target:
|
|
743
|
-
columns:
|
|
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 = ce();
|
|
740
|
+
if (J(), t.gridProps.onColumnReorder) {
|
|
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
|
-
},
|
|
773
|
+
i.splice(n, 0, { field: r }), ke(i, o);
|
|
774
|
+
}, $t = (e, n) => {
|
|
775
775
|
const o = p.current.getCurrentGroupsLength;
|
|
776
|
-
|
|
777
|
-
},
|
|
778
|
-
var o, r, i, a, c,
|
|
776
|
+
Ze(e, o, n);
|
|
777
|
+
}, Ke = () => {
|
|
778
|
+
var e, n, o, r, i, a, c, s, l, u, m, w, h, O;
|
|
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 = H.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 q = 0;
|
|
785
|
+
for (let Q = 0; Q < R; Q++) {
|
|
786
|
+
const Cn = parseFloat((E[Q].width || 0).toString()) || E[Q].clientWidth;
|
|
787
|
+
q += Cn;
|
|
788
788
|
}
|
|
789
|
-
const
|
|
790
|
-
|
|
789
|
+
const B = Math.max(0, g - q);
|
|
790
|
+
E[R].width = B + "px", (r = (o = P.current.colGroupHeader) == null ? void 0 : o.children) != null && r[R] && (P.current.colGroupHeader.children[R].width = B + "px"), (a = (i = P.current.colGroupFooter) == null ? void 0 : i.children) != null && a[R] && (P.current.colGroupFooter.children[R].width = B + "px"), (s = (c = P.current.colGroupStickyHeader) == null ? void 0 : c.children) != null && s[R] && (P.current.colGroupStickyHeader.children[R].width = B + "px"), (u = (l = P.current.colGroupStickyFooter) == null ? void 0 : l.children) != null && u[R] && (P.current.colGroupStickyFooter.children[R].width = B + "px"), (w = (m = P.current.colGroupPinnedTop) == null ? void 0 : m.children) != null && w[R] && (P.current.colGroupPinnedTop.children[R].width = B + "px"), (O = (h = P.current.colGroupPinnedBottom) == null ? void 0 : h.children) != null && O[R] && (P.current.colGroupPinnedBottom.children[R].width = B + "px");
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
793
|
+
j.current && j.current.setWidth(g), V.current && V.current.setWidth(g), M.current && M.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), U.current && (U.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 q = E[R].width;
|
|
801
|
+
if (!q) {
|
|
802
|
+
g = 0;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
g += parseFloat(q.toString());
|
|
805
806
|
}
|
|
806
|
-
|
|
807
|
+
g = Math.round(g), j.current && j.current.setWidth(g), V.current && V.current.setWidth(g), M.current && M.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), U.current && (U.current.style.width = g ? g + "px" : "");
|
|
807
808
|
}
|
|
808
|
-
|
|
809
|
-
},
|
|
809
|
+
Ie.current && _t();
|
|
810
|
+
}, _t = () => {
|
|
811
|
+
const e = T.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 = H.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 = T.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 =
|
|
819
|
-
n && (e.current = n,
|
|
822
|
+
const n = _n(G.current);
|
|
823
|
+
n && (e.current = n, J());
|
|
820
824
|
}
|
|
821
825
|
}, fe = d.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
|
-
}, c =
|
|
839
|
+
}, c = D(), s = kn({
|
|
836
840
|
event: a,
|
|
837
841
|
data: c,
|
|
838
|
-
selectedState: (
|
|
839
|
-
previousCopiedItems:
|
|
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
|
[
|
|
@@ -854,10 +858,10 @@ const cr = (t, E, h, L) => {
|
|
|
854
858
|
var i, a, c;
|
|
855
859
|
if (!ae)
|
|
856
860
|
return !1;
|
|
857
|
-
const e =
|
|
861
|
+
const e = wn(z()), n = e ? e.matches(".k-table-td") ? e : (i = z()) == null ? void 0 : i.body : (a = z()) == null ? void 0 : a.body, o = n.closest(".k-grid-container"), r = n && ((c = H.current) == null ? void 0 : c.contains(n));
|
|
858
862
|
return !!(n && r && o);
|
|
859
|
-
},
|
|
860
|
-
|
|
863
|
+
}, Xe = (e, n, o, r, i, a, c) => {
|
|
864
|
+
Ke(), be.current = !0, Ge.current = !0, t.gridProps.onColumnResize && x && f(t.gridProps.onColumnResize, {
|
|
861
865
|
columns: ce(),
|
|
862
866
|
nativeEvent: r,
|
|
863
867
|
targetColumnId: c,
|
|
@@ -865,8 +869,8 @@ const cr = (t, E, h, L) => {
|
|
|
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,143 +899,143 @@ 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 (G.current && ((e = G.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 = G.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), z = () => {
|
|
906
910
|
var e;
|
|
907
911
|
if (ae)
|
|
908
912
|
return ((e = me()) == null ? void 0 : e.ownerDocument) || document;
|
|
909
|
-
}, me = () =>
|
|
913
|
+
}, me = () => H.current, Pe = d.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
|
+
Y.current && Y.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 && T.current && (T.current.scrollTop = a.offsetTop);
|
|
922
926
|
}
|
|
923
927
|
},
|
|
924
928
|
[t.gridProps.scrollable]
|
|
925
|
-
),
|
|
926
|
-
ve.current = window.innerWidth, en() ||
|
|
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 = () => {
|
|
930
|
+
ve.current = window.innerWidth, en() || J();
|
|
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 = T.current, r.tableBody = G.current, r.scrollHeightContainer = et.current, r.table = U.current, (!r.rowHeightService || r.total !== e) && i && (r.total = e, r.rowHeightService = new xn(e, i)));
|
|
935
|
+
}, Qe = d.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
|
});
|
|
937
941
|
},
|
|
938
942
|
[Pe]
|
|
939
|
-
),
|
|
943
|
+
), J = () => {
|
|
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 = d.useRef(null), C = d.useRef(void 0), P = d.useRef(void 0), p = d.useRef(void 0), N = d.useRef(void 0), X = d.useRef(void 0), he = d.useRef(void 0), Y = d.useRef(null), G = d.useRef(null), on = d.useRef(null), T = d.useRef(null), U = d.useRef(null), an = d.useRef(null), H = d.useRef(null), et = d.useRef(null), V = d.useRef(null), j = d.useRef(null), M = d.useRef(null), A = d.useRef(null), F = d.useRef(null), L = d.useRef(null), dn = d.useRef(null), cn = d.useRef(null), Ge = d.useRef(!1), Te = d.useRef(!1), Re = d.useRef(void 0), He = d.useRef(void 0), Me = d.useRef(!1), be = d.useRef(!0), Ae = d.useRef(0), Fe = d.useRef(void 0), Le = d.useRef(void 0), Be = d.useRef([]), tt = d.useRef([]), ve = d.useRef(0), Ce = d.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: T,
|
|
959
|
+
tableBodyRef: G,
|
|
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 = d.useRef(null),
|
|
969
|
+
}), ie = d.useRef(null), hn = d.useRef(null), Rn = d.useRef(null), We = yn(H), K = t.isVirtualScroll, bn = d.useMemo(() => d.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;
|
|
966
970
|
return d.useMemo(() => {
|
|
967
971
|
te.onConstructor({
|
|
968
972
|
navigatable: !!t.gridProps.navigatable,
|
|
969
|
-
contextStateRef:
|
|
970
|
-
navigationStateRef:
|
|
973
|
+
contextStateRef: N,
|
|
974
|
+
navigationStateRef: X,
|
|
971
975
|
idPrefix: t.id
|
|
972
|
-
}),
|
|
976
|
+
}), C.current = new Yn();
|
|
973
977
|
}, []), d.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
|
-
]), d.useEffect(() => (t.gridProps.clipboard && (he.current = new
|
|
985
|
-
he.current && he.current.removeEventListeners(
|
|
986
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard, fe,
|
|
987
|
-
scope:
|
|
988
|
-
contextStateRef:
|
|
989
|
-
navigationStateRef:
|
|
988
|
+
]), d.useEffect(() => (t.gridProps.clipboard && (he.current = new Kn(fe), he.current.addEventListeners(z())), () => {
|
|
989
|
+
he.current && he.current.removeEventListeners(z());
|
|
990
|
+
}), [t.gridProps.onClipboard, t.gridProps.clipboard, fe, z]), d.useEffect(() => (Je(), Ke(), at(), te.onComponentDidMount({
|
|
991
|
+
scope: H.current || void 0,
|
|
992
|
+
contextStateRef: N,
|
|
993
|
+
navigationStateRef: X
|
|
990
994
|
}), () => {
|
|
991
|
-
clearTimeout(
|
|
995
|
+
clearTimeout(Fe.current);
|
|
992
996
|
}), []), d.useEffect(() => {
|
|
993
997
|
var e;
|
|
994
|
-
|
|
995
|
-
scope:
|
|
996
|
-
contextStateRef:
|
|
997
|
-
navigationStateRef:
|
|
998
|
-
focusFirst:
|
|
998
|
+
Je(), Ke(), at(), K && (ge(), Zt(), (e = C.current) == null || e.update()), nt(), Qt(), te.onComponentDidUpdate({
|
|
999
|
+
scope: H.current || void 0,
|
|
1000
|
+
contextStateRef: N,
|
|
1001
|
+
navigationStateRef: X,
|
|
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
|
-
}),
|
|
1007
|
+
}), Pt(), Te.current = !1, Re.current = void 0, Ce.current = void 0;
|
|
1004
1008
|
}), d.useEffect(() => {
|
|
1005
1009
|
if (ae) {
|
|
1006
1010
|
const e = {
|
|
1007
1011
|
rootMargin: "0px",
|
|
1008
1012
|
threshold: 0.9
|
|
1009
1013
|
};
|
|
1010
|
-
|
|
1014
|
+
Y.current = window.IntersectionObserver && new window.IntersectionObserver(Qe, e) || null;
|
|
1011
1015
|
}
|
|
1012
|
-
}, [
|
|
1016
|
+
}, [Qe]), d.useEffect(() => {
|
|
1013
1017
|
var n;
|
|
1014
1018
|
let e;
|
|
1015
1019
|
return ae && window.ResizeObserver && (e = new window.ResizeObserver(() => {
|
|
1016
|
-
tn(),
|
|
1017
|
-
}), e.observe((n =
|
|
1020
|
+
tn(), K && ge();
|
|
1021
|
+
}), e.observe((n = z()) == null ? void 0 : n.body)), () => {
|
|
1018
1022
|
e == null || e.disconnect();
|
|
1019
1023
|
};
|
|
1020
1024
|
}, []), d.useEffect(() => {
|
|
1021
|
-
if (!ae || !window.ResizeObserver || !
|
|
1025
|
+
if (!ae || !window.ResizeObserver || !K || !T.current)
|
|
1022
1026
|
return;
|
|
1023
1027
|
const e = () => {
|
|
1024
1028
|
var i, a;
|
|
1025
1029
|
const o = ((i = t.gridProps.containerHeightRef) == null ? void 0 : i.current) || 0;
|
|
1026
1030
|
ge();
|
|
1027
1031
|
const r = ((a = t.gridProps.containerHeightRef) == null ? void 0 : a.current) || 0;
|
|
1028
|
-
(o === 0 && r > 0 || Math.abs(r - o) > 10) &&
|
|
1032
|
+
(o === 0 && r > 0 || Math.abs(r - o) > 10) && J();
|
|
1029
1033
|
}, n = new window.ResizeObserver(e);
|
|
1030
|
-
return n.observe(
|
|
1034
|
+
return n.observe(T.current), () => {
|
|
1031
1035
|
n.disconnect();
|
|
1032
1036
|
};
|
|
1033
|
-
}, [
|
|
1034
|
-
|
|
1037
|
+
}, [K, ge]), d.useImperativeHandle(
|
|
1038
|
+
S,
|
|
1035
1039
|
() => ({
|
|
1036
1040
|
get element() {
|
|
1037
1041
|
return me();
|
|
@@ -1042,71 +1046,71 @@ const cr = (t, E, h, L) => {
|
|
|
1042
1046
|
},
|
|
1043
1047
|
scrollIntoView: (e) => {
|
|
1044
1048
|
var r;
|
|
1045
|
-
if (!((r =
|
|
1049
|
+
if (!((r = C.current) != null && r.container) || t.gridProps.scrollable === "none")
|
|
1046
1050
|
return;
|
|
1047
1051
|
const { rowIndex: n } = e;
|
|
1048
|
-
|
|
1052
|
+
Le.current = n;
|
|
1049
1053
|
const o = me();
|
|
1050
|
-
if (
|
|
1051
|
-
|
|
1052
|
-
const i = o.querySelector(`[absolute-row-index="${
|
|
1053
|
-
i ?
|
|
1054
|
+
if (Y.current && o) {
|
|
1055
|
+
Y.current.disconnect();
|
|
1056
|
+
const i = o.querySelector(`[absolute-row-index="${Le.current}"]`);
|
|
1057
|
+
i ? Y.current.observe(i) : Pe(e);
|
|
1054
1058
|
}
|
|
1055
1059
|
},
|
|
1056
1060
|
fitColumns: (e) => {
|
|
1057
|
-
|
|
1061
|
+
P.current.dblClickHandler(null, e);
|
|
1058
1062
|
},
|
|
1059
|
-
exportAsPdf:
|
|
1060
|
-
saveAsCsv:
|
|
1061
|
-
getCsvBlob:
|
|
1062
|
-
getTotal:
|
|
1063
|
-
getLeafDataItems:
|
|
1063
|
+
exportAsPdf: Se,
|
|
1064
|
+
saveAsCsv: $e,
|
|
1065
|
+
getCsvBlob: _e,
|
|
1066
|
+
getTotal: xe,
|
|
1067
|
+
getLeafDataItems: D
|
|
1064
1068
|
})
|
|
1065
|
-
), d.useImperativeHandle(t.gridRef, () =>
|
|
1066
|
-
|
|
1069
|
+
), d.useImperativeHandle(t.gridRef, () => S.current), d.useMemo(() => {
|
|
1070
|
+
P.current = new Nn(Xe);
|
|
1067
1071
|
}, [t.gridProps.onColumnResize, t.columnsRef]), d.useMemo(() => {
|
|
1068
|
-
p.current = new
|
|
1072
|
+
p.current = new Un(ue, qt, Ze);
|
|
1069
1073
|
}, [
|
|
1070
1074
|
t.gridProps.onColumnReorder,
|
|
1071
1075
|
t.gridProps.onGroupChange,
|
|
1072
1076
|
t.gridProps.group,
|
|
1073
1077
|
t.columnsRef,
|
|
1074
1078
|
t.gridProps.groupable
|
|
1075
|
-
]),
|
|
1076
|
-
|
|
1079
|
+
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.columnsRef, P.current.columnsState = En(t.columnsState), p.current.reorderable = t.gridProps.reorderable || !1, p.current.groupable = rt, p.current.columns = t.columnsRef, p.current.dir = We, nn(), /* @__PURE__ */ d.createElement(
|
|
1080
|
+
ir.Provider,
|
|
1077
1081
|
{
|
|
1078
1082
|
value: {
|
|
1079
|
-
isClient:
|
|
1083
|
+
isClient: x,
|
|
1080
1084
|
rowReorder: oe,
|
|
1081
1085
|
activeDragRowDataItemRef: ie,
|
|
1082
|
-
reorderRowDragTargetRef:
|
|
1083
|
-
reorderRowDropTargetRef:
|
|
1086
|
+
reorderRowDragTargetRef: hn,
|
|
1087
|
+
reorderRowDropTargetRef: Rn,
|
|
1084
1088
|
dir: We,
|
|
1085
1089
|
getCellPositionStyle: rn,
|
|
1086
1090
|
dataItemKey: t.gridProps.dataItemKey,
|
|
1087
1091
|
columnsState: t.columnsState,
|
|
1088
1092
|
columnsRef: t.columnsRef,
|
|
1089
1093
|
hiddenColumnsRef: t.hiddenColumnsRef,
|
|
1090
|
-
onColumnsStateChange:
|
|
1094
|
+
onColumnsStateChange: De,
|
|
1091
1095
|
groupable: t.gridProps.groupable,
|
|
1092
1096
|
group: t.gridProps.group,
|
|
1093
1097
|
reorderable: t.gridProps.reorderable,
|
|
1094
1098
|
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:
|
|
1099
|
+
groupChange: ke,
|
|
1100
|
+
selectionRelease: Ve,
|
|
1101
|
+
pinnedSelectionRelease: Tt,
|
|
1102
|
+
pagerPageChange: Ot,
|
|
1103
|
+
onContextMenu: gt,
|
|
1104
|
+
rowClick: vt,
|
|
1105
|
+
rowDblClick: Ct,
|
|
1106
|
+
cellClick: yt,
|
|
1107
|
+
headerCellClick: Ue,
|
|
1108
|
+
itemChange: kt,
|
|
1109
|
+
onDialogEditCancel: wt,
|
|
1110
|
+
onDialogEditSubmit: It,
|
|
1107
1111
|
columnReorder: ue,
|
|
1108
|
-
onResize:
|
|
1109
|
-
getTotal:
|
|
1112
|
+
onResize: Xe,
|
|
1113
|
+
getTotal: xe,
|
|
1110
1114
|
sortable: t.gridProps.sortable,
|
|
1111
1115
|
pageable: t.gridProps.pageable,
|
|
1112
1116
|
pageSize: t.gridProps.pageSize,
|
|
@@ -1114,95 +1118,95 @@ const cr = (t, E, h, L) => {
|
|
|
1114
1118
|
skip: t.gridProps.skip,
|
|
1115
1119
|
take: t.gridProps.take,
|
|
1116
1120
|
defaultSort: t.gridProps.defaultSort,
|
|
1117
|
-
sortChange:
|
|
1121
|
+
sortChange: je,
|
|
1118
1122
|
filterable: t.gridProps.filterable,
|
|
1119
1123
|
filter: t.gridProps.filter,
|
|
1120
1124
|
defaultFilter: t.gridProps.defaultFilter,
|
|
1121
|
-
filterOperators: t.gridProps.filterOperators ||
|
|
1122
|
-
getLeafDataItems:
|
|
1125
|
+
filterOperators: t.gridProps.filterOperators || ar,
|
|
1126
|
+
getLeafDataItems: D,
|
|
1123
1127
|
filterChange: pt,
|
|
1124
|
-
applyHighlightDescriptor:
|
|
1125
|
-
applySelectionDescriptor:
|
|
1128
|
+
applyHighlightDescriptor: Nt,
|
|
1129
|
+
applySelectionDescriptor: At,
|
|
1126
1130
|
highlight: t.gridProps.highlight,
|
|
1127
1131
|
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:
|
|
1132
|
+
searchChange: Ut,
|
|
1133
|
+
exportAsPdf: Se,
|
|
1134
|
+
exportAsCsv: $e,
|
|
1135
|
+
getCsvBlob: _e,
|
|
1136
|
+
onHeaderSelectionChange: Gt,
|
|
1137
|
+
columnGroupChange: $t,
|
|
1138
|
+
onKeyDown: ht,
|
|
1139
|
+
onFocus: Rt,
|
|
1140
|
+
scrollHandler: ft,
|
|
1141
|
+
selectionChange: Dt,
|
|
1142
|
+
mobileMode: vn,
|
|
1139
1143
|
adaptiveColumnMenuRef: ve.current,
|
|
1140
1144
|
adpativeTitle: t.gridProps.adaptiveTitle,
|
|
1141
1145
|
adaptive: t.gridProps.adaptive,
|
|
1142
|
-
dispatchDetailExpand:
|
|
1143
|
-
dispatchGroupExpand:
|
|
1144
|
-
columnResizeRef:
|
|
1146
|
+
dispatchDetailExpand: Et,
|
|
1147
|
+
dispatchGroupExpand: xt,
|
|
1148
|
+
columnResizeRef: P,
|
|
1145
1149
|
dragLogicRef: p,
|
|
1146
|
-
navigationStateRef:
|
|
1147
|
-
tableElementRef:
|
|
1148
|
-
tableBodyElementRef:
|
|
1150
|
+
navigationStateRef: X,
|
|
1151
|
+
tableElementRef: U,
|
|
1152
|
+
tableBodyElementRef: G,
|
|
1149
1153
|
headerElementRef: on,
|
|
1150
|
-
containerElementRef:
|
|
1154
|
+
containerElementRef: T,
|
|
1151
1155
|
headTableElementRef: an,
|
|
1152
|
-
elementRef:
|
|
1153
|
-
virtualScrollHeightContainerRef:
|
|
1154
|
-
footerRef:
|
|
1155
|
-
headerRef:
|
|
1156
|
-
vsRef:
|
|
1156
|
+
elementRef: H,
|
|
1157
|
+
virtualScrollHeightContainerRef: et,
|
|
1158
|
+
footerRef: V,
|
|
1159
|
+
headerRef: j,
|
|
1160
|
+
vsRef: C,
|
|
1157
1161
|
stickyHeaderItems: gn,
|
|
1158
1162
|
stickyHeaderRef: fn,
|
|
1159
1163
|
stickyFooterItems: mn,
|
|
1160
|
-
stickyFooterRef:
|
|
1161
|
-
stickyHeaderTableRef:
|
|
1162
|
-
stickyFooterTableRef:
|
|
1163
|
-
pinnedTopTableRef:
|
|
1164
|
-
pinnedBottomTableRef:
|
|
1164
|
+
stickyFooterRef: Ie,
|
|
1165
|
+
stickyHeaderTableRef: M,
|
|
1166
|
+
stickyFooterTableRef: A,
|
|
1167
|
+
pinnedTopTableRef: F,
|
|
1168
|
+
pinnedBottomTableRef: L,
|
|
1165
1169
|
pinnedTopRef: dn,
|
|
1166
1170
|
pinnedBottomRef: cn,
|
|
1167
|
-
onRowPin:
|
|
1168
|
-
getRowPinPosition:
|
|
1171
|
+
onRowPin: le,
|
|
1172
|
+
getRowPinPosition: St
|
|
1169
1173
|
}
|
|
1170
1174
|
},
|
|
1171
|
-
/* @__PURE__ */ d.createElement(
|
|
1175
|
+
/* @__PURE__ */ d.createElement(Gn.Provider, { value: N.current }, t.children),
|
|
1172
1176
|
/* @__PURE__ */ d.createElement(
|
|
1173
|
-
|
|
1177
|
+
Qn,
|
|
1174
1178
|
{
|
|
1175
|
-
show:
|
|
1176
|
-
dataItem:
|
|
1177
|
-
field:
|
|
1179
|
+
show: b.show && (de == null ? void 0 : de.length),
|
|
1180
|
+
dataItem: b.dataItem,
|
|
1181
|
+
field: b.field,
|
|
1178
1182
|
items: de,
|
|
1179
|
-
offset:
|
|
1180
|
-
onClose:
|
|
1181
|
-
onSelect:
|
|
1183
|
+
offset: b.offset,
|
|
1184
|
+
onClose: Oe,
|
|
1185
|
+
onSelect: ut
|
|
1182
1186
|
}
|
|
1183
1187
|
),
|
|
1184
1188
|
t.gridProps.pdf && /* @__PURE__ */ d.createElement(
|
|
1185
|
-
|
|
1189
|
+
rr,
|
|
1186
1190
|
{
|
|
1187
1191
|
gridProps: t.gridProps,
|
|
1188
1192
|
innerGrid: t.innerGrid,
|
|
1189
1193
|
pdf: typeof t.gridProps.pdf == "object" ? t.gridProps.pdf : {},
|
|
1190
|
-
onPdfExport:
|
|
1191
|
-
ref: (e) =>
|
|
1194
|
+
onPdfExport: Vt,
|
|
1195
|
+
ref: (e) => $.current = e
|
|
1192
1196
|
}
|
|
1193
1197
|
),
|
|
1194
1198
|
t.gridProps.csv && /* @__PURE__ */ d.createElement(
|
|
1195
|
-
|
|
1199
|
+
or,
|
|
1196
1200
|
{
|
|
1197
1201
|
gridProps: t.gridProps,
|
|
1198
1202
|
csv: typeof t.gridProps.csv == "object" ? t.gridProps.csv : {},
|
|
1199
|
-
onCsvExport:
|
|
1203
|
+
onCsvExport: jt,
|
|
1200
1204
|
columnsState: t.columnsState,
|
|
1201
|
-
ref: (e) =>
|
|
1205
|
+
ref: (e) => k.current = e
|
|
1202
1206
|
}
|
|
1203
1207
|
)
|
|
1204
1208
|
);
|
|
1205
1209
|
};
|
|
1206
1210
|
export {
|
|
1207
|
-
|
|
1211
|
+
yr as GridClientWrapper
|
|
1208
1212
|
};
|