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