@progress/kendo-react-grid 14.3.0-develop.8 → 14.3.0-develop.9

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