@progress/kendo-react-grid 11.0.0-develop.12 → 11.0.0-develop.13

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