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