@progress/kendo-react-grid 13.2.0-develop.8 → 13.2.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +221 -222
- package/constants/index.js +1 -1
- package/constants/index.mjs +3 -4
- 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,28 +7,27 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
|
-
import { useAdaptiveModeContext as Wt, canUseDOM as Q, getActiveElement as jt, useDir as
|
|
11
|
-
import { filterBy as
|
|
12
|
-
import { getSelectionOptions as se, populateClipboardData as
|
|
10
|
+
import { useAdaptiveModeContext as Wt, canUseDOM as Q, getActiveElement as jt, useDir as qt, setScrollbarWidth as Ve, cloneArray as _t, getter as Z, RowHeightService as $t } from "@progress/kendo-react-common";
|
|
11
|
+
import { filterBy as Jt } from "@progress/kendo-data-query";
|
|
12
|
+
import { getSelectionOptions as se, populateClipboardData as Xt, ClipboardActionType as ke, getEditableOptions as Yt, tableKeyboardNavigation as U, ClipboardService as Qt, TableKeyboardNavigationContext as Zt, closestTagName as ue, editReducer as pt, EDIT_ACTION as en, getDetailExpandableOptions as tn, detailExpandReducer as nn, getGroupExpandableOptions as rn, groupExpandReducer as on, getSelectedState as We, getSelectedStateFromKeyDown as an, getColumnIndex as dn, getRowIndex as ln, updateLeft as cn, updateRight as sn } from "@progress/kendo-react-data-tools";
|
|
13
13
|
import { ColumnResize as un } from "./drag/ColumnResize.mjs";
|
|
14
14
|
import { CommonDragLogic as gn } from "./drag/CommonDragLogic.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const I = t.gridProps.isClient, [h, S] = a.useState({}), W = Wt(), G = a.useRef(null), x = (e) => {
|
|
15
|
+
import { getDefaultHeadContextMenuItems as fn, getDefaultBodyContextMenuItems as mn, isRowReorderEnabled as Pn, sanitizeColumns as hn, getDataAsArray as Rn, getFlatColumnsState as bn, calcRowHeight as vn } from "./utils/index.mjs";
|
|
16
|
+
import { VirtualScroll as In } from "./VirtualScroll.mjs";
|
|
17
|
+
import { GridContextMenu as Cn } from "./contextMenu/GridContextMenu.mjs";
|
|
18
|
+
import { GridContextMenuAnchorPart as je } from "./contextMenu/enums.mjs";
|
|
19
|
+
import { normalizeSortable as En, firstLevelSortSeqMap as wn } from "./sortCommon.mjs";
|
|
20
|
+
import { BasePDFExport as yn } from "./BasePDFExport.mjs";
|
|
21
|
+
import { GridContext as xn } from "./utils/GridContext.mjs";
|
|
22
|
+
import { operators as Sn } from "./filterCommon.mjs";
|
|
23
|
+
const kn = (t, I, h, S) => {
|
|
24
|
+
const V = Object.keys(I.cells).map((x) => h.findIndex((G) => G.field === x)), A = Object.keys(I.cells).length > 0 ? V : !0;
|
|
25
|
+
return t.reduce((x, G) => (x[G[S != null ? S : "id"]] = A, x), {});
|
|
26
|
+
}, qe = (t, I, h, S) => I.reduce((A, x) => ({
|
|
27
|
+
...A,
|
|
28
|
+
...kn(Jt(t, x), x, h, S)
|
|
29
|
+
}), {}), Vn = (t) => {
|
|
30
|
+
const I = t.gridProps.isClient, [h, S] = a.useState({}), V = Wt(), A = a.useRef(null), x = (e) => {
|
|
32
31
|
e.event.preventDefault(), S({
|
|
33
32
|
...h,
|
|
34
33
|
show: !0,
|
|
@@ -39,33 +38,33 @@ const Dn = (t, I, h, S) => {
|
|
|
39
38
|
dataItem: e.dataItem,
|
|
40
39
|
field: e.field
|
|
41
40
|
});
|
|
42
|
-
},
|
|
41
|
+
}, G = () => {
|
|
43
42
|
S({});
|
|
44
|
-
}, v = a.useMemo(() => t.columnsRef.find((e) => e.field === h.field), [t.columnsRef, h]),
|
|
43
|
+
}, v = a.useMemo(() => t.columnsRef.find((e) => e.field === h.field), [t.columnsRef, h]), De = a.useMemo(() => {
|
|
45
44
|
const e = t.gridProps.sortable && (v == null ? void 0 : v.sortable);
|
|
46
|
-
return
|
|
45
|
+
return fn({
|
|
47
46
|
pdf: !!t.gridProps.pdf,
|
|
48
47
|
sortable: !!e,
|
|
49
48
|
selectable: se(t.gridProps.selectable).enabled,
|
|
50
49
|
clipboard: !!t.gridProps.clipboard
|
|
51
50
|
});
|
|
52
|
-
}, [v, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]),
|
|
51
|
+
}, [v, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ke = a.useMemo(() => {
|
|
53
52
|
const e = t.gridProps.sortable && (v == null ? void 0 : v.sortable);
|
|
54
|
-
return
|
|
53
|
+
return mn({
|
|
55
54
|
pdf: !!t.gridProps.pdf,
|
|
56
55
|
sortable: !!e,
|
|
57
56
|
selectable: se(t.gridProps.selectable).enabled,
|
|
58
57
|
clipboard: !!t.gridProps.clipboard,
|
|
59
|
-
rowReorderable:
|
|
58
|
+
rowReorderable: Pn(t.gridProps.rowReorderable)
|
|
60
59
|
});
|
|
61
60
|
}, [v, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), p = a.useMemo(() => {
|
|
62
61
|
const e = (v == null ? void 0 : v.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(h) : e;
|
|
63
62
|
if (n && h.offset) {
|
|
64
|
-
const o = h.dataItem ?
|
|
63
|
+
const o = h.dataItem ? je.body : je.head, r = n[o], i = h.dataItem ? Ke : De;
|
|
65
64
|
return r === !1 ? void 0 : r === !0 || r === void 0 ? i : r;
|
|
66
65
|
}
|
|
67
|
-
}, [t.gridProps.contextMenu, h,
|
|
68
|
-
var l, s, u, m, f, w, P,
|
|
66
|
+
}, [t.gridProps.contextMenu, h, Ke, De, v]), _e = (e) => {
|
|
67
|
+
var l, s, u, m, f, w, P, J, X;
|
|
69
68
|
const n = e.event.item, o = {
|
|
70
69
|
target: E.current,
|
|
71
70
|
syntheticEvent: e.event.syntheticEvent,
|
|
@@ -95,30 +94,30 @@ const Dn = (t, I, h, S) => {
|
|
|
95
94
|
case "SortCommand":
|
|
96
95
|
if (v) {
|
|
97
96
|
const Y = (s = n.name) == null ? void 0 : s.toLowerCase().includes("asc"), Bt = ((u = n.name) == null ? void 0 : u.toLowerCase().includes("desc")) ? "desc" : void 0, Ut = Y ? "asc" : Bt, Vt = n.name ? Ut : void 0;
|
|
98
|
-
|
|
97
|
+
Me(e.event.syntheticEvent, v, Vt);
|
|
99
98
|
}
|
|
100
99
|
break;
|
|
101
100
|
case "SelectRowCommand":
|
|
102
|
-
|
|
101
|
+
ut(i);
|
|
103
102
|
break;
|
|
104
103
|
case "SelectAllRowsCommand":
|
|
105
|
-
|
|
104
|
+
st(i);
|
|
106
105
|
break;
|
|
107
106
|
case "ExportPDFCommand":
|
|
108
107
|
fe();
|
|
109
108
|
break;
|
|
110
109
|
case "ClearSelectionCommand":
|
|
111
|
-
|
|
110
|
+
ft(i);
|
|
112
111
|
break;
|
|
113
112
|
case "ReorderRowCommand":
|
|
114
|
-
$.current = e.dataItem, (m = n.name) != null && m.toLowerCase().includes("rowup") && d > 0 &&
|
|
113
|
+
$.current = e.dataItem, (m = n.name) != null && m.toLowerCase().includes("rowup") && d > 0 && W(e.event.syntheticEvent, d - 1, "before"), (f = n.name) != null && f.toLowerCase().includes("rowdown") && d < r.length - 1 && W(e.event.syntheticEvent, d + 1, "after"), (w = n.name) != null && w.toLowerCase().includes("rowtop") && W(e.event.syntheticEvent, 0, "before"), (P = n.name) != null && P.toLowerCase().includes("rowbottom") && W(e.event.syntheticEvent, r.length - 1, "after");
|
|
115
114
|
break;
|
|
116
115
|
case "CopySelectionCommand":
|
|
117
116
|
oe(
|
|
118
|
-
|
|
117
|
+
ke.copy,
|
|
119
118
|
e.event.nativeEvent,
|
|
120
119
|
{
|
|
121
|
-
copyHeaders: !((
|
|
120
|
+
copyHeaders: !((J = n.name) != null && J.toLowerCase().includes("noheaders"))
|
|
122
121
|
},
|
|
123
122
|
e.dataItem,
|
|
124
123
|
e.field
|
|
@@ -126,21 +125,21 @@ const Dn = (t, I, h, S) => {
|
|
|
126
125
|
break;
|
|
127
126
|
case "PasteCommand":
|
|
128
127
|
oe(
|
|
129
|
-
|
|
128
|
+
ke.paste,
|
|
130
129
|
e.event.nativeEvent,
|
|
131
130
|
{
|
|
132
|
-
copyHeaders: !((
|
|
131
|
+
copyHeaders: !((X = n.name) != null && X.toLowerCase().includes("noheaders"))
|
|
133
132
|
},
|
|
134
133
|
e.dataItem,
|
|
135
134
|
e.field
|
|
136
135
|
);
|
|
137
136
|
break;
|
|
138
137
|
}
|
|
139
|
-
|
|
138
|
+
G();
|
|
140
139
|
}, ee = () => {
|
|
141
140
|
const e = t.columnsRef.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
142
|
-
return
|
|
143
|
-
},
|
|
141
|
+
return hn(e);
|
|
142
|
+
}, $e = (e, n, o) => {
|
|
144
143
|
if (t.gridProps.onContextMenu && I) {
|
|
145
144
|
const r = {
|
|
146
145
|
target: E.current,
|
|
@@ -159,24 +158,24 @@ const Dn = (t, I, h, S) => {
|
|
|
159
158
|
}, Je = (e) => {
|
|
160
159
|
if (e.target !== e.currentTarget)
|
|
161
160
|
return;
|
|
162
|
-
clearTimeout(
|
|
161
|
+
clearTimeout(we.current), b.current && (b.current.table = j.current);
|
|
163
162
|
const n = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop;
|
|
164
|
-
t.gridProps.columnVirtualization && (!y || o ===
|
|
163
|
+
t.gridProps.columnVirtualization && (!y || o === Ee.current) && (we.current = window.setTimeout(() => {
|
|
165
164
|
O();
|
|
166
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n),
|
|
165
|
+
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n), _.current && _.current.setScrollLeft(n), q.current && q.current.setScrollLeft(n), b.current && o !== Ee.current && b.current.scrollHandler(e), t.gridProps.onScroll && I && c(t.gridProps.onScroll, {
|
|
167
166
|
...R(e)
|
|
168
|
-
}),
|
|
169
|
-
},
|
|
170
|
-
|
|
167
|
+
}), Ee.current = o;
|
|
168
|
+
}, Xe = (e) => {
|
|
169
|
+
U.onKeyDown(e, {
|
|
171
170
|
navigatable: t.gridProps.navigatable || !1,
|
|
172
171
|
contextStateRef: M,
|
|
173
|
-
navigationStateRef:
|
|
174
|
-
onNavigationAction:
|
|
172
|
+
navigationStateRef: F,
|
|
173
|
+
onNavigationAction: Qe,
|
|
175
174
|
columns: ee()
|
|
176
|
-
}),
|
|
175
|
+
}), U.onGetSnapshotBeforeUpdate({
|
|
177
176
|
document: k(),
|
|
178
177
|
contextStateRef: M,
|
|
179
|
-
navigationStateRef:
|
|
178
|
+
navigationStateRef: F
|
|
180
179
|
});
|
|
181
180
|
const n = {
|
|
182
181
|
dataItems: C(),
|
|
@@ -187,14 +186,14 @@ const Dn = (t, I, h, S) => {
|
|
|
187
186
|
...R(e)
|
|
188
187
|
};
|
|
189
188
|
t.gridProps.onKeyDown && I && c(t.gridProps.onKeyDown, n);
|
|
190
|
-
},
|
|
191
|
-
|
|
189
|
+
}, Ye = (e) => {
|
|
190
|
+
U.onFocus(e, {
|
|
192
191
|
navigatable: !!t.gridProps.navigatable,
|
|
193
192
|
contextStateRef: M
|
|
194
193
|
});
|
|
195
|
-
},
|
|
194
|
+
}, Qe = (e) => {
|
|
196
195
|
const { columnsRef: n } = t;
|
|
197
|
-
if (e.action === "moveToNextPage" &&
|
|
196
|
+
if (e.action === "moveToNextPage" && ht(e.event), e.action === "moveToPrevPage" && Rt(e.event), e.focusElement && (e.action === "reorderToRight" || e.action === "reorderToLeft")) {
|
|
198
197
|
const o = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
199
198
|
if (!n[o].reorderable)
|
|
200
199
|
return;
|
|
@@ -209,37 +208,37 @@ const Dn = (t, I, h, S) => {
|
|
|
209
208
|
ne(o, o - 1, e.event);
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
|
-
if (e.action === "select" &&
|
|
211
|
+
if (e.action === "select" && dt(e.event), t.gridProps.onNavigationAction && I) {
|
|
213
212
|
const o = {
|
|
214
213
|
focusElement: e.focusElement,
|
|
215
214
|
...R(e.event)
|
|
216
215
|
};
|
|
217
216
|
c(t.gridProps.onNavigationAction, o);
|
|
218
217
|
}
|
|
219
|
-
},
|
|
218
|
+
}, Ze = (e, n) => {
|
|
220
219
|
t.gridProps.onRowClick && ue(e.target, "TD") && c(t.gridProps.onRowClick, {
|
|
221
220
|
dataItem: n,
|
|
222
221
|
...R(e)
|
|
223
222
|
});
|
|
224
|
-
},
|
|
223
|
+
}, pe = (e, n) => {
|
|
225
224
|
t.gridProps.onRowDoubleClick && ue(e.target, "TD") && c(t.gridProps.onRowDoubleClick, {
|
|
226
225
|
dataItem: n,
|
|
227
226
|
...R(e)
|
|
228
227
|
});
|
|
229
|
-
},
|
|
228
|
+
}, et = (e) => {
|
|
230
229
|
t.gridProps.onItemChange && c(t.gridProps.onItemChange, {
|
|
231
230
|
...R(e.syntheticEvent),
|
|
232
231
|
dataItem: e.dataItem,
|
|
233
232
|
field: void 0,
|
|
234
233
|
value: void 0
|
|
235
234
|
});
|
|
236
|
-
},
|
|
235
|
+
}, tt = (e) => {
|
|
237
236
|
t.gridProps.onItemChange && t.gridProps.onEditChange && c(t.gridProps.onEditChange, {
|
|
238
237
|
edit: {},
|
|
239
238
|
...R(e.syntheticEvent)
|
|
240
239
|
});
|
|
241
|
-
},
|
|
242
|
-
if (
|
|
240
|
+
}, nt = (e, n, o) => {
|
|
241
|
+
if (Ue.enabled && Ue.mode === "incell" && t.gridProps.dataItemKey) {
|
|
243
242
|
const r = pt(t.gridProps.edit, {
|
|
244
243
|
type: en.ENTER_FIELD_EDIT,
|
|
245
244
|
payload: { id: n[t.gridProps.dataItemKey], field: o }
|
|
@@ -249,7 +248,7 @@ const Dn = (t, I, h, S) => {
|
|
|
249
248
|
...R(e)
|
|
250
249
|
});
|
|
251
250
|
}
|
|
252
|
-
},
|
|
251
|
+
}, rt = (e, n) => {
|
|
253
252
|
var r;
|
|
254
253
|
if (tn(t.detailExpandable).enabled) {
|
|
255
254
|
const i = nn((r = t.gridProps.detailExpand) != null ? r : {}, e);
|
|
@@ -258,7 +257,7 @@ const Dn = (t, I, h, S) => {
|
|
|
258
257
|
detailExpand: i
|
|
259
258
|
});
|
|
260
259
|
}
|
|
261
|
-
},
|
|
260
|
+
}, ot = (e, n) => {
|
|
262
261
|
var r;
|
|
263
262
|
const o = rn(
|
|
264
263
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
@@ -270,13 +269,13 @@ const Dn = (t, I, h, S) => {
|
|
|
270
269
|
groupExpand: i
|
|
271
270
|
});
|
|
272
271
|
}
|
|
273
|
-
},
|
|
274
|
-
const { allowUnsort: r, mode: i } =
|
|
272
|
+
}, Me = (e, n, o) => {
|
|
273
|
+
const { allowUnsort: r, mode: i } = En(
|
|
275
274
|
t.gridProps.sortable || !1,
|
|
276
275
|
n.sortable || !1
|
|
277
|
-
), d = (t.gridProps.sort || []).filter((u) => u.field === n.field)[0], l = o ||
|
|
278
|
-
l !== "" && n.field && s.push({ field: n.field, dir: l }),
|
|
279
|
-
},
|
|
276
|
+
), d = (t.gridProps.sort || []).filter((u) => u.field === n.field)[0], l = o || wn[r][d && d.dir || ""], s = i === "single" ? [] : (t.gridProps.sort || []).filter((u) => u.field !== n.field);
|
|
277
|
+
l !== "" && n.field && s.push({ field: n.field, dir: l }), Te(s, e);
|
|
278
|
+
}, it = (e) => {
|
|
280
279
|
t.gridProps.onItemChange && c(t.gridProps.onItemChange, {
|
|
281
280
|
...R(e.syntheticEvent),
|
|
282
281
|
dataItem: e.dataItem,
|
|
@@ -284,7 +283,7 @@ const Dn = (t, I, h, S) => {
|
|
|
284
283
|
field: e.field,
|
|
285
284
|
value: e.value
|
|
286
285
|
});
|
|
287
|
-
},
|
|
286
|
+
}, at = (e) => {
|
|
288
287
|
var n;
|
|
289
288
|
if (t.gridProps.onSelectionChange && g.enabled) {
|
|
290
289
|
const { event: o, dataItem: r, dataIndex: i, columnIndex: d } = e, l = {
|
|
@@ -307,14 +306,14 @@ const Dn = (t, I, h, S) => {
|
|
|
307
306
|
};
|
|
308
307
|
c(t.gridProps.onSelectionChange, {
|
|
309
308
|
...l,
|
|
310
|
-
select: t.gridProps.dataItemKey ?
|
|
309
|
+
select: t.gridProps.dataItemKey ? We({
|
|
311
310
|
event: l,
|
|
312
311
|
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
313
312
|
dataItemKey: t.gridProps.dataItemKey
|
|
314
313
|
}) : {}
|
|
315
314
|
});
|
|
316
315
|
}
|
|
317
|
-
},
|
|
316
|
+
}, dt = (e) => {
|
|
318
317
|
var u, m;
|
|
319
318
|
if (!g.enabled || !t.gridProps.dataItemKey)
|
|
320
319
|
return;
|
|
@@ -334,7 +333,7 @@ const Dn = (t, I, h, S) => {
|
|
|
334
333
|
return;
|
|
335
334
|
const r = e.target, i = ue(r, "TD"), d = ue(r, "TR"), l = dn(i), s = ln(d);
|
|
336
335
|
if (l !== void 0 && s !== void 0) {
|
|
337
|
-
const f = (m =
|
|
336
|
+
const f = (m = Rn(t.gridProps.data)) == null ? void 0 : m[s];
|
|
338
337
|
t.gridProps.onSelectionChange && c(t.gridProps.onSelectionChange, {
|
|
339
338
|
...n,
|
|
340
339
|
select: o,
|
|
@@ -352,7 +351,7 @@ const Dn = (t, I, h, S) => {
|
|
|
352
351
|
isDrag: !1
|
|
353
352
|
});
|
|
354
353
|
}
|
|
355
|
-
},
|
|
354
|
+
}, lt = (e) => {
|
|
356
355
|
if (t.gridProps.onHeaderSelectionChange && g.enabled) {
|
|
357
356
|
const n = C();
|
|
358
357
|
c(t.gridProps.onHeaderSelectionChange, {
|
|
@@ -364,12 +363,12 @@ const Dn = (t, I, h, S) => {
|
|
|
364
363
|
dataItems: n
|
|
365
364
|
});
|
|
366
365
|
}
|
|
367
|
-
},
|
|
366
|
+
}, L = (e, n) => {
|
|
368
367
|
t.gridProps.onSelectionChange && g.enabled && c(t.gridProps.onSelectionChange, {
|
|
369
368
|
...e,
|
|
370
369
|
select: n
|
|
371
370
|
});
|
|
372
|
-
},
|
|
371
|
+
}, ct = (e) => {
|
|
373
372
|
var n;
|
|
374
373
|
if (t.gridProps.onSelectionChange && g.enabled) {
|
|
375
374
|
const o = C()[e.startRowIndex], r = C()[e.endRowIndex], i = {
|
|
@@ -382,16 +381,16 @@ const Dn = (t, I, h, S) => {
|
|
|
382
381
|
startDataItem: o,
|
|
383
382
|
endDataItem: r,
|
|
384
383
|
...e
|
|
385
|
-
}, d =
|
|
384
|
+
}, d = We({
|
|
386
385
|
event: i,
|
|
387
386
|
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
388
387
|
// Thats kinda strange, even through the `dataItemKey` is required by the `getSelectedState`
|
|
389
388
|
// it does work correctly even without it
|
|
390
389
|
dataItemKey: t.gridProps.dataItemKey
|
|
391
390
|
});
|
|
392
|
-
|
|
391
|
+
L(i, d);
|
|
393
392
|
}
|
|
394
|
-
},
|
|
393
|
+
}, st = (e) => {
|
|
395
394
|
if (t.gridProps.onSelectionChange && g.enabled) {
|
|
396
395
|
const n = e.dataItems[0], o = e.dataItems[e.dataItems.length - 1], r = {}, i = {
|
|
397
396
|
...e,
|
|
@@ -405,9 +404,9 @@ const Dn = (t, I, h, S) => {
|
|
|
405
404
|
e.dataItems.forEach((d) => {
|
|
406
405
|
const s = Z(t.gridProps.dataItemKey)(d);
|
|
407
406
|
r[s] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
|
|
408
|
-
}),
|
|
407
|
+
}), L(i, r);
|
|
409
408
|
}
|
|
410
|
-
},
|
|
409
|
+
}, ut = (e) => {
|
|
411
410
|
if (t.gridProps.onSelectionChange && g.enabled) {
|
|
412
411
|
const o = Z(t.gridProps.dataItemKey)(e.dataItem), r = 0, i = t.columnsRef.length - 1, d = e.dataItems.findIndex(
|
|
413
412
|
(f) => f[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
|
|
@@ -420,9 +419,9 @@ const Dn = (t, I, h, S) => {
|
|
|
420
419
|
startColIndex: r,
|
|
421
420
|
endColIndex: i
|
|
422
421
|
}, m = e.mode === "multiple" ? t.gridProps.select || {} : {};
|
|
423
|
-
m[o] === !0 || Array.isArray(m[o]) && m[o].length === t.columnsRef.length ? delete m[o] : m[o] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0,
|
|
422
|
+
m[o] === !0 || Array.isArray(m[o]) && m[o].length === t.columnsRef.length ? delete m[o] : m[o] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, L(u, m);
|
|
424
423
|
}
|
|
425
|
-
},
|
|
424
|
+
}, gt = (e) => {
|
|
426
425
|
if (!g.enabled)
|
|
427
426
|
return;
|
|
428
427
|
const n = C(), o = {
|
|
@@ -451,7 +450,7 @@ const Dn = (t, I, h, S) => {
|
|
|
451
450
|
startColIndex: -1,
|
|
452
451
|
endColIndex: -1
|
|
453
452
|
};
|
|
454
|
-
|
|
453
|
+
L(f, {});
|
|
455
454
|
return;
|
|
456
455
|
}
|
|
457
456
|
const r = qe(
|
|
@@ -480,11 +479,11 @@ const Dn = (t, I, h, S) => {
|
|
|
480
479
|
startDataItem: s,
|
|
481
480
|
endDataItem: u
|
|
482
481
|
};
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
t.gridProps.onSelectionChange && g.enabled &&
|
|
486
|
-
},
|
|
487
|
-
|
|
482
|
+
L(m, i);
|
|
483
|
+
}, ft = (e) => {
|
|
484
|
+
t.gridProps.onSelectionChange && g.enabled && L(e, {});
|
|
485
|
+
}, z = (e, n, o, r, i) => {
|
|
486
|
+
Pt();
|
|
488
487
|
const d = t.gridProps.onDataStateChange;
|
|
489
488
|
if (e) {
|
|
490
489
|
const l = { ...R(r), ...n, targetEvent: i };
|
|
@@ -493,54 +492,54 @@ const Dn = (t, I, h, S) => {
|
|
|
493
492
|
...R(r),
|
|
494
493
|
targetEvent: i || {},
|
|
495
494
|
dataState: {
|
|
496
|
-
...
|
|
495
|
+
...kt(),
|
|
497
496
|
...o
|
|
498
497
|
}
|
|
499
498
|
});
|
|
500
499
|
}, te = (e, n, o) => {
|
|
501
500
|
var r;
|
|
502
|
-
y && t.gridProps.pageable && ((r = b.current) == null || r.reset()),
|
|
501
|
+
y && t.gridProps.pageable && ((r = b.current) == null || r.reset()), z(
|
|
503
502
|
t.gridProps.onPageChange,
|
|
504
503
|
{ page: e },
|
|
505
504
|
{ skip: e.skip, take: e.take },
|
|
506
505
|
n,
|
|
507
506
|
o
|
|
508
507
|
);
|
|
509
|
-
},
|
|
508
|
+
}, mt = (e, n, o) => {
|
|
510
509
|
var r;
|
|
511
510
|
t.gridProps.pageable || (r = t.gridProps.group) != null && r.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, O()) : te(e, n, o);
|
|
512
511
|
}, ge = () => {
|
|
513
512
|
let e = t.gridProps.total || 0;
|
|
514
513
|
return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
|
|
515
|
-
},
|
|
514
|
+
}, Pt = () => {
|
|
516
515
|
y && t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = 0);
|
|
517
|
-
},
|
|
516
|
+
}, ht = (e) => {
|
|
518
517
|
var i, d;
|
|
519
518
|
const n = (d = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? d : 0, o = (t.gridProps.skip || 0) + n, r = ge();
|
|
520
519
|
o < r && te({ skip: o, take: n }, e);
|
|
521
|
-
},
|
|
520
|
+
}, Rt = (e) => {
|
|
522
521
|
var r, i;
|
|
523
522
|
const n = (i = (r = t.gridProps.take) != null ? r : t.gridProps.pageSize) != null ? i : 0, o = (t.gridProps.skip || 0) - n;
|
|
524
523
|
o >= 0 && te({ skip: o, take: n }, e);
|
|
525
|
-
},
|
|
524
|
+
}, bt = (e) => {
|
|
526
525
|
te({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
527
|
-
},
|
|
528
|
-
|
|
526
|
+
}, Te = (e, n) => {
|
|
527
|
+
z(
|
|
529
528
|
t.gridProps.onSortChange,
|
|
530
529
|
{ sort: e },
|
|
531
530
|
{ sort: e, ...y && !t.gridProps.pageable ? { skip: 0 } : {} },
|
|
532
531
|
n
|
|
533
532
|
);
|
|
534
|
-
},
|
|
535
|
-
|
|
533
|
+
}, vt = (e, n) => {
|
|
534
|
+
z(
|
|
536
535
|
t.gridProps.onFilterChange,
|
|
537
536
|
{ filter: e },
|
|
538
537
|
{ filter: e, skip: 0 },
|
|
539
538
|
n
|
|
540
539
|
);
|
|
541
|
-
},
|
|
540
|
+
}, It = (e) => {
|
|
542
541
|
if (!e || e.length === 0) {
|
|
543
|
-
|
|
542
|
+
He({});
|
|
544
543
|
return;
|
|
545
544
|
}
|
|
546
545
|
const n = qe(
|
|
@@ -549,15 +548,15 @@ const Dn = (t, I, h, S) => {
|
|
|
549
548
|
t.columnsRef,
|
|
550
549
|
t.gridProps.dataItemKey
|
|
551
550
|
);
|
|
552
|
-
|
|
553
|
-
},
|
|
554
|
-
|
|
551
|
+
He({ ...n });
|
|
552
|
+
}, He = (e) => {
|
|
553
|
+
z(
|
|
555
554
|
t.gridProps.onHighlightChange,
|
|
556
555
|
{ highlight: e },
|
|
557
556
|
{},
|
|
558
557
|
{}
|
|
559
558
|
);
|
|
560
|
-
},
|
|
559
|
+
}, Ct = (e) => {
|
|
561
560
|
const n = t.gridProps.searchFields || t.columnsRef.map((i) => i.field) || [], o = e.nativeEvent.target.value, r = {
|
|
562
561
|
logic: "or",
|
|
563
562
|
filters: n.filter((i) => i !== void 0).map((i) => {
|
|
@@ -570,7 +569,7 @@ const Dn = (t, I, h, S) => {
|
|
|
570
569
|
};
|
|
571
570
|
})
|
|
572
571
|
};
|
|
573
|
-
|
|
572
|
+
z(
|
|
574
573
|
t.gridProps.onSearchChange,
|
|
575
574
|
{
|
|
576
575
|
search: r
|
|
@@ -580,14 +579,14 @@ const Dn = (t, I, h, S) => {
|
|
|
580
579
|
);
|
|
581
580
|
}, fe = () => {
|
|
582
581
|
var e;
|
|
583
|
-
(e =
|
|
584
|
-
},
|
|
582
|
+
(e = A.current) == null || e.save();
|
|
583
|
+
}, Et = async (e) => {
|
|
585
584
|
var n, o;
|
|
586
585
|
(n = t.gridProps) != null && n.onPdfExport && await ((o = t.gridProps) == null ? void 0 : o.onPdfExport(e));
|
|
587
586
|
}, me = (e, n) => {
|
|
588
587
|
const o = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
|
|
589
588
|
let r = {};
|
|
590
|
-
t.isVirtualScroll && e.length && !t.gridProps.pageable && (r = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (
|
|
589
|
+
t.isVirtualScroll && e.length && !t.gridProps.pageable && (r = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (ve.current = !0), z(
|
|
591
590
|
t.gridProps.onGroupChange,
|
|
592
591
|
{ group: e },
|
|
593
592
|
{ group: e, skip: 0, ...r },
|
|
@@ -602,19 +601,19 @@ const Dn = (t, I, h, S) => {
|
|
|
602
601
|
c(t.gridProps.onColumnsStateChange, n);
|
|
603
602
|
}
|
|
604
603
|
}, ne = (e, n, o) => {
|
|
605
|
-
const { columnsRef: r, columnsState: i } = t, d = r[e], l =
|
|
604
|
+
const { columnsRef: r, columnsState: i } = t, d = r[e], l = bn(i), s = d.depth, u = (P) => {
|
|
606
605
|
do
|
|
607
606
|
P++;
|
|
608
607
|
while (P < r.length && r[P].depth > s);
|
|
609
608
|
return P;
|
|
610
609
|
}, m = r.splice(e, u(e) - e);
|
|
611
|
-
r.splice(e < n ? u(n - m.length) : n, 0, ...m), r.filter((P) => P.declarationIndex >= 0).forEach((P,
|
|
612
|
-
P.orderIndex =
|
|
613
|
-
const
|
|
614
|
-
|
|
610
|
+
r.splice(e < n ? u(n - m.length) : n, 0, ...m), r.filter((P) => P.declarationIndex >= 0).forEach((P, J) => {
|
|
611
|
+
P.orderIndex = J;
|
|
612
|
+
const X = l.find((Y) => Y.id === P.id);
|
|
613
|
+
X && (X.orderIndex = J);
|
|
615
614
|
});
|
|
616
615
|
const f = r[e].locked && r[n].locked;
|
|
617
|
-
cn(t.columnsMapRef, r, f || le.current), sn(t.columnsMapRef, r, f || le.current),
|
|
616
|
+
cn(t.columnsMapRef, r, f || le.current), sn(t.columnsMapRef, r, f || le.current), be.current && (le.current = !1, be.current = !1);
|
|
618
617
|
const w = ee();
|
|
619
618
|
if (O(), t.gridProps.onColumnReorder) {
|
|
620
619
|
const P = {
|
|
@@ -626,7 +625,7 @@ const Dn = (t, I, h, S) => {
|
|
|
626
625
|
c(t.gridProps.onColumnReorder, P);
|
|
627
626
|
}
|
|
628
627
|
Pe(i);
|
|
629
|
-
},
|
|
628
|
+
}, W = (e, n, o) => {
|
|
630
629
|
const r = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
|
|
631
630
|
if (o === "forbidden" || !r || !$.current)
|
|
632
631
|
return;
|
|
@@ -639,20 +638,20 @@ const Dn = (t, I, h, S) => {
|
|
|
639
638
|
dragEvent: e,
|
|
640
639
|
target: E.current
|
|
641
640
|
}), $.current = null;
|
|
642
|
-
},
|
|
641
|
+
}, wt = (e, n, o) => {
|
|
643
642
|
if (t.gridProps.group === void 0)
|
|
644
643
|
return;
|
|
645
644
|
const r = t.gridProps.group.slice();
|
|
646
645
|
r.splice(n, 0, ...r.splice(e, 1)), me(r, o);
|
|
647
|
-
},
|
|
646
|
+
}, Ae = (e, n, o) => {
|
|
648
647
|
const r = t.columnsRef[e].field;
|
|
649
648
|
if (!r)
|
|
650
649
|
return;
|
|
651
650
|
const i = (t.gridProps.group || []).slice();
|
|
652
651
|
i.splice(n, 0, { field: r }), me(i, o);
|
|
653
|
-
},
|
|
652
|
+
}, yt = (e, n) => {
|
|
654
653
|
const o = K.current.getCurrentGroupsLength;
|
|
655
|
-
|
|
654
|
+
Ae(e, o, n);
|
|
656
655
|
}, he = () => {
|
|
657
656
|
let e = 0;
|
|
658
657
|
if (!D.current.colGroupMain)
|
|
@@ -666,23 +665,23 @@ const Dn = (t, I, h, S) => {
|
|
|
666
665
|
}
|
|
667
666
|
e += parseFloat(r.toString());
|
|
668
667
|
}
|
|
669
|
-
e = Math.round(e),
|
|
670
|
-
},
|
|
668
|
+
e = Math.round(e), _.current && _.current.setWidth(e), q.current && q.current.setWidth(e), j.current && (j.current.style.width = e ? e + "px" : "");
|
|
669
|
+
}, Ge = () => {
|
|
671
670
|
var e;
|
|
672
|
-
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e =
|
|
671
|
+
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e = H.current) == null ? void 0 : e.offsetWidth) || 0);
|
|
673
672
|
}, re = () => {
|
|
674
673
|
var e;
|
|
675
674
|
t.gridProps.containerHeightRef && (t.gridProps.containerHeightRef.current = ((e = T.current) == null ? void 0 : e.offsetHeight) || 0);
|
|
676
|
-
},
|
|
675
|
+
}, xt = () => {
|
|
677
676
|
const e = t.gridProps.minRowHeightRef;
|
|
678
677
|
if (e && !e.current && !t.gridProps.rowHeight) {
|
|
679
|
-
const n =
|
|
678
|
+
const n = vn(B.current);
|
|
680
679
|
n && (e.current = n, O());
|
|
681
680
|
}
|
|
682
681
|
}, oe = a.useCallback(
|
|
683
682
|
(e, n, o, r, i) => {
|
|
684
683
|
var u;
|
|
685
|
-
if (!
|
|
684
|
+
if (!St() && !o || !e)
|
|
686
685
|
return;
|
|
687
686
|
const d = {
|
|
688
687
|
type: e,
|
|
@@ -693,13 +692,13 @@ const Dn = (t, I, h, S) => {
|
|
|
693
692
|
field: i,
|
|
694
693
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
695
694
|
...o
|
|
696
|
-
}, l = C(), s =
|
|
695
|
+
}, l = C(), s = Xt({
|
|
697
696
|
event: d,
|
|
698
697
|
data: l,
|
|
699
698
|
selectedState: (u = t.gridProps.select) != null ? u : {},
|
|
700
|
-
previousCopiedItems:
|
|
699
|
+
previousCopiedItems: Ne.current
|
|
701
700
|
});
|
|
702
|
-
e !==
|
|
701
|
+
e !== ke.paste && (Ne.current = s.copiedItems), t.gridProps.onClipboard && I && c(t.gridProps.onClipboard, {
|
|
703
702
|
...d,
|
|
704
703
|
...s
|
|
705
704
|
});
|
|
@@ -711,14 +710,14 @@ const Dn = (t, I, h, S) => {
|
|
|
711
710
|
t.gridProps.clipboard,
|
|
712
711
|
t.gridProps.onClipboard
|
|
713
712
|
]
|
|
714
|
-
),
|
|
713
|
+
), St = () => {
|
|
715
714
|
var i, d, l;
|
|
716
715
|
if (!Q)
|
|
717
716
|
return !1;
|
|
718
|
-
const e = jt(k()), n = e ? e.matches(".k-table-td") ? e : (i = k()) == null ? void 0 : i.body : (d = k()) == null ? void 0 : d.body, o = n.closest(".k-grid-container"), r = n && ((l =
|
|
717
|
+
const e = jt(k()), n = e ? e.matches(".k-table-td") ? e : (i = k()) == null ? void 0 : i.body : (d = k()) == null ? void 0 : d.body, o = n.closest(".k-grid-container"), r = n && ((l = H.current) == null ? void 0 : l.contains(n));
|
|
719
718
|
return !!(n && r && o);
|
|
720
|
-
},
|
|
721
|
-
he(), le.current = !0,
|
|
719
|
+
}, Le = (e, n, o, r, i, d, l) => {
|
|
720
|
+
he(), le.current = !0, be.current = !0, t.gridProps.onColumnResize && I && c(t.gridProps.onColumnResize, {
|
|
722
721
|
columns: ee(),
|
|
723
722
|
nativeEvent: r,
|
|
724
723
|
targetColumnId: l,
|
|
@@ -728,7 +727,7 @@ const Dn = (t, I, h, S) => {
|
|
|
728
727
|
end: i,
|
|
729
728
|
target: E.current
|
|
730
729
|
}), i && Pe(d);
|
|
731
|
-
},
|
|
730
|
+
}, kt = () => {
|
|
732
731
|
var e;
|
|
733
732
|
return {
|
|
734
733
|
filter: t.gridProps.filter,
|
|
@@ -741,7 +740,7 @@ const Dn = (t, I, h, S) => {
|
|
|
741
740
|
nativeEvent: e && e.nativeEvent,
|
|
742
741
|
syntheticEvent: e,
|
|
743
742
|
target: E.current
|
|
744
|
-
}),
|
|
743
|
+
}), Dt = (e) => ({
|
|
745
744
|
...e,
|
|
746
745
|
nativeEvent: void 0,
|
|
747
746
|
syntheticEvent: void 0,
|
|
@@ -753,26 +752,26 @@ const Dn = (t, I, h, S) => {
|
|
|
753
752
|
e(n);
|
|
754
753
|
return;
|
|
755
754
|
}
|
|
756
|
-
e(
|
|
757
|
-
},
|
|
755
|
+
e(Dt(n));
|
|
756
|
+
}, Kt = () => {
|
|
758
757
|
var e, n, o;
|
|
759
|
-
if (
|
|
760
|
-
|
|
761
|
-
const r = Array.from((o =
|
|
762
|
-
r.length >
|
|
763
|
-
(i) => !
|
|
764
|
-
)[0] : r.length === 1 && (de.current = r[0],
|
|
758
|
+
if (B.current && ((e = B.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
759
|
+
Ce.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? Ie.current = document.activeElement : Ie.current = void 0;
|
|
760
|
+
const r = Array.from((o = B.current) == null ? void 0 : o.getElementsByClassName("k-grid-edit-row"));
|
|
761
|
+
r.length > xe.current.length ? de.current = r.filter(
|
|
762
|
+
(i) => !xe.current.includes(i)
|
|
763
|
+
)[0] : r.length === 1 && (de.current = r[0], Ce.current = !0), xe.current = r;
|
|
765
764
|
}
|
|
766
765
|
}, C = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), k = () => {
|
|
767
766
|
var e;
|
|
768
767
|
if (Q)
|
|
769
768
|
return ((e = ie()) == null ? void 0 : e.ownerDocument) || document;
|
|
770
|
-
}, ie = () =>
|
|
769
|
+
}, ie = () => H.current, Re = a.useCallback(
|
|
771
770
|
(e) => {
|
|
772
771
|
var r, i;
|
|
773
772
|
if (!b.current || !((r = b.current) != null && r.container) || t.gridProps.scrollable === "none")
|
|
774
773
|
return;
|
|
775
|
-
|
|
774
|
+
N.current && N.current.disconnect();
|
|
776
775
|
const { rowIndex: n } = e, o = ie();
|
|
777
776
|
if (y) {
|
|
778
777
|
const d = ((i = b.current.rowHeightService) == null ? void 0 : i.offset(n)) || 0;
|
|
@@ -783,15 +782,15 @@ const Dn = (t, I, h, S) => {
|
|
|
783
782
|
}
|
|
784
783
|
},
|
|
785
784
|
[t.gridProps.scrollable]
|
|
786
|
-
),
|
|
787
|
-
ce.current = window.innerWidth,
|
|
788
|
-
},
|
|
785
|
+
), ze = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), Mt = () => ze(Ft) === ze(t.columnsRef), Tt = () => {
|
|
786
|
+
ce.current = window.innerWidth, Mt() || O();
|
|
787
|
+
}, Ht = () => {
|
|
789
788
|
var d;
|
|
790
789
|
const { virtualTotal: e, virtualPageSize: n, gridProps: o } = t, r = b.current, i = t.gridProps.rowHeight || ((d = o.minRowHeightRef) == null ? void 0 : d.current) || 0;
|
|
791
|
-
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange =
|
|
790
|
+
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange = mt, r.pageSize = n, r.scrollableVirtual = y, r.container = T.current, r.tableBody = B.current, r.scrollHeightContainer = Fe.current, r.table = j.current, (!r.rowHeightService || r.total !== e) && i && (r.total = e, r.rowHeightService = new $t(e, i)));
|
|
792
791
|
}, Oe = a.useCallback(
|
|
793
792
|
(e) => {
|
|
794
|
-
const n = { rowIndex:
|
|
793
|
+
const n = { rowIndex: ye.current };
|
|
795
794
|
e.forEach((o) => {
|
|
796
795
|
o.boundingClientRect.height !== o.intersectionRect.height && Re(n);
|
|
797
796
|
});
|
|
@@ -799,14 +798,14 @@ const Dn = (t, I, h, S) => {
|
|
|
799
798
|
[Re]
|
|
800
799
|
), O = () => {
|
|
801
800
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
802
|
-
},
|
|
801
|
+
}, At = (e) => e.left !== void 0 ? Se !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, E = a.useRef(null), b = a.useRef(void 0), D = a.useRef(void 0), K = a.useRef(void 0), M = a.useRef(void 0), F = a.useRef(void 0), ae = a.useRef(void 0), N = a.useRef(null), B = a.useRef(null), Gt = a.useRef(null), T = a.useRef(null), j = a.useRef(null), Lt = a.useRef(null), H = a.useRef(null), Fe = a.useRef(null), q = a.useRef(null), _ = a.useRef(null), be = a.useRef(!1), ve = a.useRef(!1), de = a.useRef(void 0), Ie = a.useRef(void 0), Ce = a.useRef(!1), le = a.useRef(!0), Ee = a.useRef(0), we = a.useRef(void 0), ye = a.useRef(void 0), xe = a.useRef([]), Ne = a.useRef([]), ce = a.useRef(0), $ = a.useRef(null), zt = a.useRef(null), Ot = a.useRef(null), Se = qt(H), y = t.isVirtualScroll, Ft = a.useMemo(() => a.Children.toArray(t.gridProps.children), [t.gridProps.children]), Be = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, g = se(t.gridProps.selectable), Ue = Yt(t.gridProps.editable), Nt = ce.current && V && ce.current <= V.medium && t.gridProps.adaptive;
|
|
803
802
|
return a.useMemo(() => {
|
|
804
|
-
|
|
803
|
+
U.onConstructor({
|
|
805
804
|
navigatable: !!t.gridProps.navigatable,
|
|
806
805
|
contextStateRef: M,
|
|
807
|
-
navigationStateRef:
|
|
806
|
+
navigationStateRef: F,
|
|
808
807
|
idPrefix: t.id
|
|
809
|
-
}), b.current = new
|
|
808
|
+
}), b.current = new In();
|
|
810
809
|
}, []), a.useMemo(() => {
|
|
811
810
|
var e;
|
|
812
811
|
(e = b.current) == null || e.reset();
|
|
@@ -815,42 +814,42 @@ const Dn = (t, I, h, S) => {
|
|
|
815
814
|
t.gridProps.total,
|
|
816
815
|
t.gridProps.filter,
|
|
817
816
|
t.gridProps.group,
|
|
818
|
-
|
|
817
|
+
Be,
|
|
819
818
|
t.gridProps.sort,
|
|
820
819
|
t.gridProps.rowHeight
|
|
821
820
|
]), a.useEffect(() => (t.gridProps.clipboard && (ae.current = new Qt(oe), ae.current.addEventListeners(k())), () => {
|
|
822
821
|
ae.current && ae.current.removeEventListeners(k());
|
|
823
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard, oe, k]), a.useEffect(() => (
|
|
824
|
-
scope:
|
|
822
|
+
}), [t.gridProps.onClipboard, t.gridProps.clipboard, oe, k]), a.useEffect(() => (Ge(), he(), Ve(), U.onComponentDidMount({
|
|
823
|
+
scope: H.current || void 0,
|
|
825
824
|
contextStateRef: M,
|
|
826
|
-
navigationStateRef:
|
|
825
|
+
navigationStateRef: F
|
|
827
826
|
}), () => {
|
|
828
|
-
clearTimeout(
|
|
827
|
+
clearTimeout(we.current);
|
|
829
828
|
}), []), a.useEffect(() => {
|
|
830
829
|
var e;
|
|
831
|
-
|
|
832
|
-
scope:
|
|
830
|
+
Ge(), he(), Ve(), y && (re(), xt(), (e = b.current) == null || e.update()), Kt(), U.onComponentDidUpdate({
|
|
831
|
+
scope: H.current || void 0,
|
|
833
832
|
contextStateRef: M,
|
|
834
|
-
navigationStateRef:
|
|
835
|
-
focusFirst:
|
|
833
|
+
navigationStateRef: F,
|
|
834
|
+
focusFirst: ve.current,
|
|
836
835
|
newEditableRow: de.current,
|
|
837
|
-
singleEditRow:
|
|
838
|
-
lastActiveElement:
|
|
836
|
+
singleEditRow: Ce.current,
|
|
837
|
+
lastActiveElement: Ie.current,
|
|
839
838
|
navigatable: t.gridProps.navigatable
|
|
840
|
-
}),
|
|
839
|
+
}), ve.current = !1, de.current = void 0;
|
|
841
840
|
}), a.useEffect(() => {
|
|
842
841
|
if (Q) {
|
|
843
842
|
const e = {
|
|
844
843
|
rootMargin: "0px",
|
|
845
844
|
threshold: 0.9
|
|
846
845
|
};
|
|
847
|
-
|
|
846
|
+
N.current = window.IntersectionObserver && new window.IntersectionObserver(Oe, e) || null;
|
|
848
847
|
}
|
|
849
848
|
}, [Oe]), a.useEffect(() => {
|
|
850
849
|
var n;
|
|
851
850
|
let e;
|
|
852
851
|
return Q && window.ResizeObserver && (e = new window.ResizeObserver(() => {
|
|
853
|
-
|
|
852
|
+
Tt(), y && re();
|
|
854
853
|
}), e.observe((n = k()) == null ? void 0 : n.body)), () => {
|
|
855
854
|
e == null || e.disconnect();
|
|
856
855
|
};
|
|
@@ -882,12 +881,12 @@ const Dn = (t, I, h, S) => {
|
|
|
882
881
|
if (!((r = b.current) != null && r.container) || t.gridProps.scrollable === "none")
|
|
883
882
|
return;
|
|
884
883
|
const { rowIndex: n } = e;
|
|
885
|
-
|
|
884
|
+
ye.current = n;
|
|
886
885
|
const o = ie();
|
|
887
|
-
if (
|
|
888
|
-
|
|
889
|
-
const i = o.querySelector(`[absolute-row-index="${
|
|
890
|
-
i ?
|
|
886
|
+
if (N.current && o) {
|
|
887
|
+
N.current.disconnect();
|
|
888
|
+
const i = o.querySelector(`[absolute-row-index="${ye.current}"]`);
|
|
889
|
+
i ? N.current.observe(i) : Re(e);
|
|
891
890
|
}
|
|
892
891
|
},
|
|
893
892
|
fitColumns: (e) => {
|
|
@@ -898,26 +897,26 @@ const Dn = (t, I, h, S) => {
|
|
|
898
897
|
getLeafDataItems: C
|
|
899
898
|
})
|
|
900
899
|
), a.useImperativeHandle(t.gridRef, () => E.current), a.useMemo(() => {
|
|
901
|
-
D.current = new un(
|
|
900
|
+
D.current = new un(Le);
|
|
902
901
|
}, [t.gridProps.onColumnResize, t.columnsRef]), a.useMemo(() => {
|
|
903
|
-
K.current = new gn(ne,
|
|
902
|
+
K.current = new gn(ne, wt, Ae);
|
|
904
903
|
}, [
|
|
905
904
|
t.gridProps.onColumnReorder,
|
|
906
905
|
t.gridProps.onGroupChange,
|
|
907
906
|
t.gridProps.group,
|
|
908
907
|
t.columnsRef,
|
|
909
908
|
t.gridProps.groupable
|
|
910
|
-
]), D.current.resizable = t.gridProps.resizable || !1, D.current.columns = t.columnsRef, D.current.columnsState =
|
|
911
|
-
|
|
909
|
+
]), D.current.resizable = t.gridProps.resizable || !1, D.current.columns = t.columnsRef, D.current.columnsState = _t(t.columnsState), K.current.reorderable = t.gridProps.reorderable || !1, K.current.groupable = Be, K.current.columns = t.columnsRef, K.current.dir = Se, Ht(), /* @__PURE__ */ a.createElement(
|
|
910
|
+
xn.Provider,
|
|
912
911
|
{
|
|
913
912
|
value: {
|
|
914
913
|
isClient: I,
|
|
915
|
-
rowReorder:
|
|
914
|
+
rowReorder: W,
|
|
916
915
|
activeDragRowDataItemRef: $,
|
|
917
916
|
reorderRowDragTargetRef: zt,
|
|
918
|
-
reorderRowDropTargetRef:
|
|
919
|
-
dir:
|
|
920
|
-
getCellPositionStyle:
|
|
917
|
+
reorderRowDropTargetRef: Ot,
|
|
918
|
+
dir: Se,
|
|
919
|
+
getCellPositionStyle: At,
|
|
921
920
|
dataItemKey: t.gridProps.dataItemKey,
|
|
922
921
|
columnsState: t.columnsState,
|
|
923
922
|
columnsRef: t.columnsRef,
|
|
@@ -928,18 +927,18 @@ const Dn = (t, I, h, S) => {
|
|
|
928
927
|
reorderable: t.gridProps.reorderable,
|
|
929
928
|
defaultGroup: t.gridProps.defaultGroup,
|
|
930
929
|
groupChange: me,
|
|
931
|
-
selectionRelease:
|
|
932
|
-
pagerPageChange:
|
|
933
|
-
onContextMenu:
|
|
934
|
-
rowClick:
|
|
935
|
-
rowDblClick:
|
|
936
|
-
cellClick:
|
|
937
|
-
headerCellClick:
|
|
938
|
-
itemChange:
|
|
939
|
-
onDialogEditCancel:
|
|
940
|
-
onDialogEditSubmit:
|
|
930
|
+
selectionRelease: ct,
|
|
931
|
+
pagerPageChange: bt,
|
|
932
|
+
onContextMenu: $e,
|
|
933
|
+
rowClick: Ze,
|
|
934
|
+
rowDblClick: pe,
|
|
935
|
+
cellClick: nt,
|
|
936
|
+
headerCellClick: Me,
|
|
937
|
+
itemChange: it,
|
|
938
|
+
onDialogEditCancel: tt,
|
|
939
|
+
onDialogEditSubmit: et,
|
|
941
940
|
columnReorder: ne,
|
|
942
|
-
onResize:
|
|
941
|
+
onResize: Le,
|
|
943
942
|
getTotal: ge,
|
|
944
943
|
sortable: t.gridProps.sortable,
|
|
945
944
|
pageable: t.gridProps.pageable,
|
|
@@ -948,71 +947,71 @@ const Dn = (t, I, h, S) => {
|
|
|
948
947
|
skip: t.gridProps.skip,
|
|
949
948
|
take: t.gridProps.take,
|
|
950
949
|
defaultSort: t.gridProps.defaultSort,
|
|
951
|
-
sortChange:
|
|
950
|
+
sortChange: Te,
|
|
952
951
|
filterable: t.gridProps.filterable,
|
|
953
952
|
filter: t.gridProps.filter,
|
|
954
953
|
defaultFilter: t.gridProps.defaultFilter,
|
|
955
|
-
filterOperators: t.gridProps.filterOperators ||
|
|
954
|
+
filterOperators: t.gridProps.filterOperators || Sn,
|
|
956
955
|
getLeafDataItems: C,
|
|
957
|
-
filterChange:
|
|
958
|
-
applyHighlightDescriptor:
|
|
959
|
-
applySelectionDescriptor:
|
|
956
|
+
filterChange: vt,
|
|
957
|
+
applyHighlightDescriptor: It,
|
|
958
|
+
applySelectionDescriptor: gt,
|
|
960
959
|
highlight: t.gridProps.highlight,
|
|
961
960
|
select: t.gridProps.select,
|
|
962
|
-
searchChange:
|
|
961
|
+
searchChange: Ct,
|
|
963
962
|
exportAsPdf: fe,
|
|
964
|
-
onHeaderSelectionChange:
|
|
965
|
-
columnGroupChange:
|
|
966
|
-
onKeyDown:
|
|
967
|
-
onFocus:
|
|
963
|
+
onHeaderSelectionChange: lt,
|
|
964
|
+
columnGroupChange: yt,
|
|
965
|
+
onKeyDown: Xe,
|
|
966
|
+
onFocus: Ye,
|
|
968
967
|
scrollHandler: Je,
|
|
969
|
-
selectionChange:
|
|
968
|
+
selectionChange: at,
|
|
970
969
|
mobileMode: Nt,
|
|
971
970
|
adaptiveColumnMenuRef: ce.current,
|
|
972
971
|
adpativeTitle: t.gridProps.adaptiveTitle,
|
|
973
972
|
adaptive: t.gridProps.adaptive,
|
|
974
|
-
dispatchDetailExpand:
|
|
975
|
-
dispatchGroupExpand:
|
|
973
|
+
dispatchDetailExpand: rt,
|
|
974
|
+
dispatchGroupExpand: ot,
|
|
976
975
|
columnResizeRef: D,
|
|
977
976
|
dragLogicRef: K,
|
|
978
|
-
navigationStateRef:
|
|
979
|
-
tableElementRef:
|
|
980
|
-
tableBodyElementRef:
|
|
981
|
-
headerElementRef:
|
|
977
|
+
navigationStateRef: F,
|
|
978
|
+
tableElementRef: j,
|
|
979
|
+
tableBodyElementRef: B,
|
|
980
|
+
headerElementRef: Gt,
|
|
982
981
|
containerElementRef: T,
|
|
983
|
-
headTableElementRef:
|
|
984
|
-
elementRef:
|
|
985
|
-
virtualScrollHeightContainerRef:
|
|
986
|
-
footerRef:
|
|
987
|
-
headerRef:
|
|
982
|
+
headTableElementRef: Lt,
|
|
983
|
+
elementRef: H,
|
|
984
|
+
virtualScrollHeightContainerRef: Fe,
|
|
985
|
+
footerRef: q,
|
|
986
|
+
headerRef: _,
|
|
988
987
|
vsRef: b
|
|
989
988
|
}
|
|
990
989
|
},
|
|
991
990
|
/* @__PURE__ */ a.createElement(Zt.Provider, { value: M.current }, t.children),
|
|
992
991
|
/* @__PURE__ */ a.createElement(
|
|
993
|
-
|
|
992
|
+
Cn,
|
|
994
993
|
{
|
|
995
994
|
show: h.show && (p == null ? void 0 : p.length),
|
|
996
995
|
dataItem: h.dataItem,
|
|
997
996
|
field: h.field,
|
|
998
997
|
items: p,
|
|
999
998
|
offset: h.offset,
|
|
1000
|
-
onClose:
|
|
1001
|
-
onSelect:
|
|
999
|
+
onClose: G,
|
|
1000
|
+
onSelect: _e
|
|
1002
1001
|
}
|
|
1003
1002
|
),
|
|
1004
1003
|
t.gridProps.pdf && /* @__PURE__ */ a.createElement(
|
|
1005
|
-
|
|
1004
|
+
yn,
|
|
1006
1005
|
{
|
|
1007
1006
|
gridProps: t.gridProps,
|
|
1008
1007
|
innerGrid: t.innerGrid,
|
|
1009
1008
|
pdf: typeof t.gridProps.pdf == "object" ? t.gridProps.pdf : {},
|
|
1010
|
-
onPdfExport:
|
|
1011
|
-
ref: (e) =>
|
|
1009
|
+
onPdfExport: Et,
|
|
1010
|
+
ref: (e) => A.current = e
|
|
1012
1011
|
}
|
|
1013
1012
|
)
|
|
1014
1013
|
);
|
|
1015
1014
|
};
|
|
1016
1015
|
export {
|
|
1017
|
-
|
|
1016
|
+
Vn as GridClientWrapper
|
|
1018
1017
|
};
|