@progress/kendo-react-grid 11.4.0-develop.1 → 11.4.0-develop.3

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