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