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

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