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