@progress/kendo-react-grid 7.5.0-develop.9 → 8.0.0-develop.2

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.
package/Grid.mjs CHANGED
@@ -7,41 +7,42 @@
7
7
  */
8
8
  "use client";
9
9
  import * as r from "react";
10
- import s from "prop-types";
11
- import { dispatchEvent as Ke, canUseDOM as V, getActiveElement as Oe, memoizeOne as S, validatePackage as Pe, shouldShowValidationUI as Ve, setScrollbarWidth as ae, getter as Ue, classNames as F, kendoThemeMaps as G, WatermarkOverlay as We } from "@progress/kendo-react-common";
12
- import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns as Be, ClipboardService as $e, TableKeyboardNavigationContext as U, isRtl as je, tableKeyboardNavigationTools as N, tableColumnsVirtualization as qe, Pager as Je, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Qe, updateRight as Xe } from "@progress/kendo-react-data-tools";
13
- import { GridSelectionCell as Ye } from "./cells/GridSelectionCell.mjs";
14
- import { GridHierarchyCell as Ze } from "./cells/GridHierarchyCell.mjs";
15
- import { GridEditCell as et } from "./cells/GridEditCell.mjs";
16
- import { Header as tt } from "./header/Header.mjs";
17
- import { HeaderRow as st } from "./header/HeaderRow.mjs";
18
- import { FilterRow as it } from "./header/FilterRow.mjs";
19
- import { GroupPanel as ot } from "./header/GroupPanel.mjs";
20
- import { Footer as rt } from "./footer/Footer.mjs";
21
- import { provideLocalizationService as at, registerForLocalization as lt } from "@progress/kendo-react-intl";
22
- import { pagerMessagesMap as nt, gridAriaLabel as ue, messages as ht } from "./messages/index.mjs";
23
- import { VirtualScroll as pt } from "./VirtualScroll.mjs";
24
- import { VirtualScrollFixed as ge, RowHeightService as me } from "./VirtualScrollFixed.mjs";
25
- import { ColumnResize as dt } from "./drag/ColumnResize.mjs";
26
- import { CommonDragLogic as ct } from "./drag/CommonDragLogic.mjs";
27
- import { firefox as fe, firefoxMaxHeight as be, flatData as ut, readColumns as gt, sanitizeColumns as mt, getColumnWidth as W, autoGenerateColumns as ft, getNestedValue as ve, resolveCells as bt } from "./utils/index.mjs";
28
- import { GridCell as vt } from "./cells/GridCell.mjs";
29
- import { GridGroupCell as Ce } from "./cells/GridGroupCell.mjs";
30
- import { GridRow as Ct } from "./rows/GridRow.mjs";
31
- import { GridHeaderSelectionCell as Rt } from "./header/GridHeaderSelectionCell.mjs";
32
- import { GridNoRecords as yt } from "./GridNoRecords.mjs";
33
- import { operators as Re } from "./filterCommon.mjs";
34
- import { FooterRow as wt } from "./footer/FooterRow.mjs";
35
- import { normalize as St } from "./paging/GridPagerSettings.mjs";
36
- import { packageMetadata as ye } from "./package-metadata.mjs";
10
+ import o from "prop-types";
11
+ import { RowHeightService as re, dispatchEvent as Pe, canUseDOM as U, getActiveElement as Ke, memoizeOne as S, validatePackage as Oe, shouldShowValidationUI as Ve, setScrollbarWidth as ae, getter as Ue, classNames as N, kendoThemeMaps as P, WatermarkOverlay as We } from "@progress/kendo-react-common";
12
+ import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns as Be, ClipboardService as $e, TableKeyboardNavigationContext as W, isRtl as je, tableKeyboardNavigationTools as _, tableColumnsVirtualization as qe, Pager as Xe, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Ye, updateRight as Je, KEYBOARD_NAV_DATA_ID as Qe } from "@progress/kendo-react-data-tools";
13
+ import { GridSelectionCell as Ze } from "./cells/GridSelectionCell.mjs";
14
+ import { GridHierarchyCell as et } from "./cells/GridHierarchyCell.mjs";
15
+ import { GridEditCell as tt } from "./cells/GridEditCell.mjs";
16
+ import { Header as st } from "./header/Header.mjs";
17
+ import { HeaderRow as it } from "./header/HeaderRow.mjs";
18
+ import { FilterRow as ot } from "./header/FilterRow.mjs";
19
+ import { GroupPanel as rt } from "./header/GroupPanel.mjs";
20
+ import { Footer as at } from "./footer/Footer.mjs";
21
+ import { provideLocalizationService as lt, registerForLocalization as nt } from "@progress/kendo-react-intl";
22
+ import { pagerMessagesMap as ht, gridAriaLabel as ue, messages as pt } from "./messages/index.mjs";
23
+ import { VirtualScroll as dt } from "./VirtualScroll.mjs";
24
+ import { VirtualScrollFixed as ge } from "./VirtualScrollFixed.mjs";
25
+ import { ColumnResize as ct } from "./drag/ColumnResize.mjs";
26
+ import { CommonDragLogic as ut } from "./drag/CommonDragLogic.mjs";
27
+ import { firefox as fe, firefoxMaxHeight as me, flatData as gt, readColumns as ft, sanitizeColumns as mt, getColumnWidth as B, autoGenerateColumns as vt, getNestedValue as ve, resolveCells as bt } from "./utils/index.mjs";
28
+ import { GridCell as Ct } from "./cells/GridCell.mjs";
29
+ import { GridGroupCell as be } from "./cells/GridGroupCell.mjs";
30
+ import { GridRow as Rt } from "./rows/GridRow.mjs";
31
+ import { GridHeaderSelectionCell as yt } from "./header/GridHeaderSelectionCell.mjs";
32
+ import { GridNoRecords as wt } from "./GridNoRecords.mjs";
33
+ import { operators as Ce } from "./filterCommon.mjs";
34
+ import { FooterRow as St } from "./footer/FooterRow.mjs";
35
+ import { normalize as It } from "./paging/GridPagerSettings.mjs";
36
+ import { packageMetadata as Re } from "./package-metadata.mjs";
37
37
  import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
38
- import { GridDetailHierarchyCell as It } from "./cells/GridDetailHierarchyCell.mjs";
39
- const _ = class _ extends r.Component {
38
+ import { GridDetailHierarchyCell as Et } from "./cells/GridDetailHierarchyCell.mjs";
39
+ import { SAFARI_REGEX as xt } from "./constants/index.mjs";
40
+ const T = class T extends r.Component {
40
41
  constructor(a) {
41
- super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = r.createRef(), this.headerElementRef = r.createRef(), this._element = null, this.tableElement = null, this.containerRef = r.createRef(), this.tableBodyRef = r.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.observer = null, this.handleIntersection = (e) => {
42
+ super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._focusFirst = !1, this._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = r.createRef(), this.headerElementRef = r.createRef(), this._element = null, this.tableElement = null, this.containerRef = r.createRef(), this.tableBodyRef = r.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.headTable = null, this.observer = null, this.handleIntersection = (e) => {
42
43
  const t = { rowIndex: this.rowIndex };
43
- e.forEach((i) => {
44
- i.isIntersecting || this.setCurrentOnTop(t);
44
+ e.forEach((s) => {
45
+ s.isIntersecting || this.setCurrentOnTop(t);
45
46
  });
46
47
  }, this.setCurrentOnTop = (e) => {
47
48
  if (!this.vs.container || this.props.scrollable === "none")
@@ -51,35 +52,35 @@ const _ = class _ extends r.Component {
51
52
  if (this.props.scrollable === "virtual")
52
53
  this.vs.askedSkip = t, this.vs.container.scroll(0, Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight));
53
54
  else if (this.element) {
54
- const i = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
55
- i && this.containerRef.current && (this.containerRef.current.scrollTop = i.offsetTop);
55
+ const s = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
56
+ s && this.containerRef.current && (this.containerRef.current.scrollTop = s.offsetTop);
56
57
  }
57
58
  }, this.scrollIntoView = (e) => {
58
59
  if (!this.vs.container || this.props.scrollable === "none")
59
60
  return;
60
61
  this.rowIndex = e.rowIndex;
61
- const { rowIndex: t } = e, i = this.element;
62
- if (this.observer && i) {
62
+ const { rowIndex: t } = e, s = this.element;
63
+ if (this.observer && s) {
63
64
  this.observer.disconnect();
64
- const n = i.querySelector(`[absolute-row-index="${t}"]`);
65
- n ? this.observer.observe(n) : this.setCurrentOnTop(e);
65
+ const l = s.querySelector(`[absolute-row-index="${t}"]`);
66
+ l ? this.observer.observe(l) : this.setCurrentOnTop(e);
66
67
  }
67
68
  }, this.fitColumns = (e) => {
68
69
  this.columnResize.dblClickHandler(null, e);
69
- }, this.onContextMenu = (e, t, i) => {
70
+ }, this.onContextMenu = (e, t, s) => {
70
71
  if (this.props.onContextMenu) {
71
- const n = {
72
+ const l = {
72
73
  target: this,
73
74
  syntheticEvent: e,
74
75
  nativeEvent: e.nativeEvent,
75
76
  dataItem: t,
76
- field: i
77
+ field: s
77
78
  };
78
- this.props.onContextMenu.call(void 0, n);
79
+ this.props.onContextMenu.call(void 0, l);
79
80
  }
80
81
  }, this.getVirtualScroll = (e) => {
81
- const { rowHeight: t, detailRowHeight: i, detail: n, expandField: h, groupable: l } = e, d = this.isAllData(), f = t !== void 0 && t > 0, R = i !== void 0 && i > 0, I = l === !0 || typeof l == "object" && l.enabled !== !1;
82
- return !f || I && !d || !!(n && h) && (!R || !d) ? pt : ge;
82
+ const { rowHeight: t, detailRowHeight: s, detail: l, expandField: p, groupable: n } = e, d = this.isAllData(), m = t !== void 0 && t > 0, R = s !== void 0 && s > 0, k = n === !0 || typeof n == "object" && n.enabled !== !1;
83
+ return !m || k && !d || !!(l && p) && (!R || !d) ? dt : ge;
83
84
  }, this.isAllData = () => {
84
85
  const { data: e, total: t } = this.props;
85
86
  return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
@@ -92,46 +93,54 @@ const _ = class _ extends r.Component {
92
93
  this.props.sort,
93
94
  t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
94
95
  ), this.vs.fixedScroll = this.props.fixedScroll || !1, this.vs.PageChange = this.pageChange, this.vs.realSkip = this.props.skip || 0, this.vs.pageSize = (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 0, this.vs.scrollableVirtual = this.props.scrollable === "virtual", this.vs.total = e, this.vs.propsSkip = (this.props.skip || 0) + (this.props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.props.skip || 0)) : 0), this.props.rowHeight !== void 0 && this.props.rowHeight > 0 && !t) {
95
- const i = this.props.rowHeight * e;
96
- this.vs.containerHeight = fe ? Math.min(be, i) : i;
96
+ const s = this.props.rowHeight * e;
97
+ this.vs.containerHeight = fe ? Math.min(me, s) : s;
97
98
  } else
98
99
  this.vs.containerHeight = 1533915;
99
100
  if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ge) {
100
- const { rowHeight: i = 0, detail: n, expandField: h } = this.props;
101
- let { detailRowHeight: l = 0 } = this.props;
102
- l = n && h ? l : i, this.isAllData() ? (this.vs.total = this._data.length, this._slicedData = this._data.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this._data.length, i, l, this._data)) : this.vs.rowHeightService = new me(e, i, l);
101
+ const { rowHeight: s = 0, detail: l, expandField: p } = this.props;
102
+ let { detailRowHeight: n = 0 } = this.props;
103
+ n = l && p ? n : s, this.isAllData() ? (this.vs.total = this._data.length, this._slicedData = this._data.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this._data.length, s, n, this._data)) : this.vs.rowHeightService = new re(e, s, n);
103
104
  const d = this.vs.rowHeightService.totalHeight();
104
- this.vs.containerHeight = fe ? Math.min(be, d) : d;
105
+ this.vs.containerHeight = fe ? Math.min(me, d) : d;
105
106
  }
106
107
  }, this.scrollHandler = (e) => {
107
108
  if (e.target !== e.currentTarget)
108
109
  return;
109
110
  clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
110
- const t = e.currentTarget.scrollLeft, i = e.currentTarget.scrollTop;
111
- this.props.columnVirtualization && (!this.vs.scrollableVirtual || i === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
111
+ const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
112
+ this.props.columnVirtualization && (!this.vs.scrollableVirtual || s === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
112
113
  this.forceUpdate();
113
- }, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && i !== this.wrapperScrollTop && this.vs.scrollHandler(e), Ke(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = i;
114
+ }, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e), Pe(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = s;
114
115
  }, this.onKeyDown = (e) => {
115
116
  if (x.onKeyDown(e, {
116
117
  contextStateRef: this.contextStateRef,
117
118
  navigationStateRef: this.navigationStateRef,
118
119
  onNavigationAction: this.onNavigationAction
119
120
  }), this.props.onKeyDown) {
120
- const { mode: t, cell: i } = le(this.props.selectable), n = {
121
+ const { mode: t, cell: s } = le(this.props.selectable), l = {
121
122
  dataItems: this.getLeafDataItems(),
122
123
  mode: t,
123
- cell: i,
124
+ cell: s,
124
125
  componentId: this._gridId,
125
126
  selectedField: this.props.selectedField,
126
127
  ...this.getArguments(e)
127
128
  };
128
- this.props.onKeyDown.call(void 0, n);
129
+ this.props.onKeyDown.call(void 0, l);
129
130
  }
130
131
  }, this.onFocus = (e) => {
131
132
  x.onFocus(e, {
132
133
  contextStateRef: this.contextStateRef
133
134
  });
134
135
  }, this.onNavigationAction = (e) => {
136
+ if (e.action === "moveToNextPage" && this.moveToNextPage(e.event), e.action === "moveToPrevPage" && this.moveToPrevPage(e.event), e.focusElement && e.action === "reorderToRight") {
137
+ const t = parseInt(e.focusElement.ariaColIndex, 10) - 1;
138
+ t < this._columns.length - 1 && this.columnReorder(t, t + 1, e.event);
139
+ }
140
+ if (e.focusElement && e.action === "reorderToLeft") {
141
+ const t = parseInt(e.focusElement.ariaColIndex, 10) - 1;
142
+ t > 0 && this.columnReorder(t, t - 1, e.event);
143
+ }
135
144
  if (this.props.onNavigationAction) {
136
145
  const t = {
137
146
  focusElement: e.focusElement,
@@ -158,8 +167,8 @@ const _ = class _ extends r.Component {
158
167
  }, this.itemChange = (e) => {
159
168
  const t = this.props.onItemChange;
160
169
  if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
161
- const i = this.props.onExpandChange;
162
- i && i.call(
170
+ const s = this.props.onExpandChange;
171
+ s && s.call(
163
172
  void 0,
164
173
  {
165
174
  ...this.getArguments(e.syntheticEvent),
@@ -193,25 +202,36 @@ const _ = class _ extends r.Component {
193
202
  );
194
203
  }, this.selectionRelease = (e) => {
195
204
  if (this.props.onSelectionChange) {
196
- const t = {
205
+ const t = this.getSlicedLeafDataItems()[e.startRowIndex], s = this.getSlicedLeafDataItems()[e.endRowIndex], l = {
197
206
  syntheticEvent: void 0,
198
207
  target: this,
199
208
  selectedField: this.props.selectedField || "",
200
209
  componentId: this._gridId,
201
210
  dataItems: this.getLeafDataItems(),
202
211
  dataItem: null,
212
+ startDataItem: t,
213
+ endDataItem: s,
203
214
  ...e
204
215
  };
205
- this.props.onSelectionChange.call(void 0, t);
216
+ this.props.onSelectionChange.call(void 0, l);
206
217
  }
207
- }, this.pageChange = (e, t, i) => {
218
+ }, this.pageChange = (e, t, s) => {
208
219
  this.raiseDataEvent(
209
220
  this.props.onPageChange,
210
221
  { page: e },
211
222
  { skip: e.skip, take: e.take },
212
223
  t,
213
- i
224
+ s
214
225
  );
226
+ }, this.getTotal = () => {
227
+ let e = this.props.total || 0;
228
+ return Array.isArray(this.props.data) ? e = e || this.props.data.length : this.props.data && (e = e || this.props.data.total), e;
229
+ }, this.moveToNextPage = (e) => {
230
+ const t = this.props.take || 0, s = (this.props.skip || 0) + t, l = this.getTotal();
231
+ s < l && this.pageChange({ skip: s, take: t }, e);
232
+ }, this.moveToPrevPage = (e) => {
233
+ const t = this.props.take || 0, s = (this.props.skip || 0) - t;
234
+ s >= 0 && this.pageChange({ skip: s, take: t }, e);
215
235
  }, this.pagerPageChange = (e) => {
216
236
  this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
217
237
  }, this.sortChange = (e, t) => {
@@ -229,12 +249,12 @@ const _ = class _ extends r.Component {
229
249
  t
230
250
  );
231
251
  }, this.groupChange = (e, t) => {
232
- const i = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
233
- this.raiseDataEvent(
252
+ const s = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
253
+ e.length === 0 && this.props.navigatable && (this._focusFirst = !0), this._columnsMutations++, this.raiseDataEvent(
234
254
  this.props.onGroupChange,
235
255
  { group: e },
236
256
  { group: e, skip: 0 },
237
- i
257
+ s
238
258
  );
239
259
  }, this.onClipboard = (e, t) => {
240
260
  if (this.props.onClipboard) {
@@ -252,51 +272,51 @@ const _ = class _ extends r.Component {
252
272
  );
253
273
  }
254
274
  }, this.inActiveElement = () => {
255
- var h, l, d;
256
- if (!V)
275
+ var p, n, d;
276
+ if (!U)
257
277
  return !1;
258
- const e = Oe(this.document), t = e ? e.matches(".k-table-td") ? e : (h = this.document) == null ? void 0 : h.body : (l = this.document) == null ? void 0 : l.body, i = t.closest(".k-grid-container"), n = t && ((d = this._element) == null ? void 0 : d.contains(t));
259
- return !!(t && n && i);
260
- }, this.onResize = (e, t, i, n, h, l) => {
278
+ const e = Ke(this.document), t = e ? e.matches(".k-table-td") ? e : (p = this.document) == null ? void 0 : p.body : (n = this.document) == null ? void 0 : n.body, s = t.closest(".k-grid-container"), l = t && ((d = this._element) == null ? void 0 : d.contains(t));
279
+ return !!(t && l && s);
280
+ }, this.onResize = (e, t, s, l, p, n) => {
261
281
  this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
262
282
  void 0,
263
283
  {
264
284
  columns: this.columns,
265
- nativeEvent: n,
266
- targetColumnId: l,
285
+ nativeEvent: l,
286
+ targetColumnId: n,
267
287
  index: e,
268
288
  newWidth: t,
269
- oldWidth: i,
270
- end: h,
289
+ oldWidth: s,
290
+ end: p,
271
291
  target: this
272
292
  }
273
293
  );
274
- }, this.reInitVirtualization = S((e, t, i, n, h, l) => {
294
+ }, this.reInitVirtualization = S((e, t, s, l, p, n) => {
275
295
  this.vs.reset();
276
296
  const d = this.getVirtualScroll(this.props);
277
- this.vs = new d(l);
278
- }), this.flatData = S((e, t, i, n, h, l, d) => {
279
- const f = [], R = ut(
280
- f,
297
+ this.vs = new d(n);
298
+ }), this.flatData = S((e, t, s, l, p, n, d) => {
299
+ const m = [], R = gt(
300
+ m,
281
301
  e,
282
302
  t,
283
- { index: i },
284
- n !== void 0,
285
- h
303
+ { index: s },
304
+ l !== void 0,
305
+ p
286
306
  );
287
- return { flattedData: f, resolvedGroupsCount: R };
288
- }), this.rowHeightService = S((e, t, i, n, h) => new me(t, i, n, h)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
289
- (e, t, i) => {
290
- const n = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
291
- return gt(n, this.columns, { prevId: 0, idPrefix: t });
307
+ return { flattedData: m, resolvedGroupsCount: R };
308
+ }), this.rowHeightService = S((e, t, s, l, p) => new re(t, s, l, p)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
309
+ (e, t, s) => {
310
+ const l = e.filter((p) => p && p.type && p.type.displayName === "KendoReactGridColumn");
311
+ return ft(l, this.columns, { prevId: 0, idPrefix: t });
292
312
  }
293
313
  ), this.mapColumns = S(
294
- (e, t) => Be(e, t)
295
- ), this.configureColumns = S((e, t, i) => {
296
- this.props.selectedField && e.filter((l) => l.field === this.props.selectedField).forEach((l) => {
297
- l.width = l.width || "50px", l.cell = l.cell || Ye, l.headerCell = l.headerCell || Rt;
314
+ (e, t) => Be(e, !0)
315
+ ), this.configureColumns = S((e, t, s) => {
316
+ this.props.selectedField && e.filter((n) => n.field === this.props.selectedField).forEach((n) => {
317
+ n.width = n.width || "50px", n.cell = n.cell || Ze, n.headerCell = n.headerCell || yt;
298
318
  });
299
- const n = {
319
+ const l = {
300
320
  id: "",
301
321
  resizable: !0,
302
322
  width: "32px",
@@ -315,46 +335,47 @@ const _ = class _ extends r.Component {
315
335
  ariaColumnIndex: 0,
316
336
  isAccessible: !0
317
337
  };
318
- let h = 0;
338
+ let p = 0;
319
339
  this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
320
- ...n,
321
- cell: Ze,
340
+ ...l,
341
+ cell: et,
322
342
  field: this.props.expandField,
323
343
  headerClassName: "k-hierarchy-cell k-header"
324
- }), h++);
325
- for (let l = 0; l < t; l++)
344
+ }), p++);
345
+ for (let n = 0; n < t; n++)
326
346
  e.unshift({
327
- ...n,
347
+ ...l,
328
348
  isAccessible: !1,
329
- cell: Ce,
349
+ cell: be,
330
350
  field: "value",
331
351
  locked: this.props.lockGroups
332
- }), h++;
333
- e.slice(h).forEach((l) => l.parentIndex >= 0 && (l.parentIndex += h));
334
- }), this.getHeaderRow = S((e, t, i, n, h, l, d, f, R, I, z, C) => /* @__PURE__ */ r.createElement(
335
- st,
352
+ }), p++;
353
+ e.slice(p).forEach((n) => n.parentIndex >= 0 && (n.parentIndex += p));
354
+ }), this.getHeaderRow = S((e, t, s, l, p, n, d, m, R, k, z, C, A) => /* @__PURE__ */ r.createElement(
355
+ it,
336
356
  {
337
357
  cells: this.props.cells,
338
358
  sort: e,
339
359
  sortable: t,
340
360
  sortChange: this.sortChange,
341
- group: i || [],
342
- groupable: n,
361
+ group: s || [],
362
+ groupable: l,
343
363
  groupChange: this.groupChange,
344
- filter: h,
345
- filterable: l,
364
+ filter: p,
365
+ filterable: n,
346
366
  filterOperators: d,
347
367
  filterChange: this.filterChange,
348
368
  columnMenu: R,
369
+ columnMenuIcon: k,
349
370
  selectionChange: this.onHeaderSelectionChange,
350
- columns: I,
371
+ columns: z,
351
372
  columnResize: this.columnResize,
352
373
  pressHandler: this.dragLogic.pressHandler,
353
374
  dragHandler: this.dragLogic.dragHandler,
354
375
  releaseHandler: this.dragLogic.releaseHandler,
355
- columnsMap: z,
356
- cellRender: f,
357
- isRtl: C,
376
+ columnsMap: C,
377
+ cellRender: m,
378
+ isRtl: A,
358
379
  dragClue: this.dragLogic.dragClueRef,
359
380
  headerRef: this.headerElementRef,
360
381
  containerRef: this.containerRef,
@@ -362,15 +383,15 @@ const _ = class _ extends r.Component {
362
383
  columnGroupChange: this.columnGroupChange
363
384
  }
364
385
  )), this.resolveTitle = (e) => {
365
- const t = this._columns.find((n) => n.field === e), i = t && (t.title || t.field);
366
- return i === void 0 ? e : i;
367
- }, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), Pe(ye), this.showLicenseWatermark = Ve(ye);
368
- const p = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
369
- this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new ct(
386
+ const t = this._columns.find((l) => l.field === e), s = t && (t.title || t.field);
387
+ return s === void 0 ? e : s;
388
+ }, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), this.getSlicedLeafDataItems = () => (this._slicedData || this._data).filter((e) => e.rowType === "data").map((e) => e.dataItem), Oe(Re), this.showLicenseWatermark = Ve(Re);
389
+ const h = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
390
+ this.vs = new c(h || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new ut(
370
391
  this.columnReorder.bind(this),
371
392
  this.groupReorder.bind(this),
372
393
  this.columnToGroup.bind(this)
373
- ), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new dt(this.onResize), this.props.clipboard && (this.clipboardService = new $e(this.onClipboard)), x.onConstructor({
394
+ ), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new ct(this.onResize), this.props.clipboard && (this.clipboardService = new $e(this.onClipboard)), x.onConstructor({
374
395
  navigatable: !!a.navigatable,
375
396
  contextStateRef: this.contextStateRef,
376
397
  navigationStateRef: this.navigationStateRef,
@@ -418,7 +439,7 @@ const _ = class _ extends r.Component {
418
439
  */
419
440
  // tslint:enable:max-line-length
420
441
  get columns() {
421
- const a = this._columns.filter((p) => p.declarationIndex >= 0 && p.parentIndex === -1);
442
+ const a = this._columns.filter((h) => h.declarationIndex >= 0 && h.parentIndex === -1);
422
443
  return mt(a);
423
444
  }
424
445
  /**
@@ -428,7 +449,7 @@ const _ = class _ extends r.Component {
428
449
  return this._element;
429
450
  }
430
451
  get document() {
431
- if (V)
452
+ if (U)
432
453
  return this.element && this.element.ownerDocument || document;
433
454
  }
434
455
  get _header() {
@@ -441,18 +462,18 @@ const _ = class _ extends r.Component {
441
462
  * @hidden
442
463
  */
443
464
  componentDidMount() {
444
- this.resetTableWidth(), ae();
465
+ this.props.columnVirtualization && !navigator.userAgent.match(xt) && (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), ae();
445
466
  const a = je(this.element);
446
467
  this.isRtl = a, x.onComponentDidMount({
447
468
  scope: this.element || void 0,
448
469
  contextStateRef: this.contextStateRef,
449
470
  navigationStateRef: this.navigationStateRef
450
471
  }), this.isRtl && this.forceUpdate();
451
- const p = {
472
+ const h = {
452
473
  rootMargin: "0px",
453
474
  threshold: 0.9
454
475
  };
455
- this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = V && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, p) || null;
476
+ this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = U && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, h) || null;
456
477
  }
457
478
  /**
458
479
  * @hidden
@@ -471,8 +492,9 @@ const _ = class _ extends r.Component {
471
492
  this.resetTableWidth(), ae(), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), x.onComponentDidUpdate({
472
493
  scope: this.element || void 0,
473
494
  contextStateRef: this.contextStateRef,
474
- navigationStateRef: this.navigationStateRef
475
- });
495
+ navigationStateRef: this.navigationStateRef,
496
+ focusFirst: this._focusFirst
497
+ }), this._focusFirst = !1;
476
498
  }
477
499
  /**
478
500
  * @hidden
@@ -484,12 +506,12 @@ const _ = class _ extends r.Component {
484
506
  * @hidden
485
507
  */
486
508
  render() {
487
- var oe;
509
+ var ie;
488
510
  let a = this.props.total || 0;
489
- const p = N.getIdPrefix(this.navigationStateRef), c = at(this);
511
+ const h = _.getIdPrefix(this.navigationStateRef), c = lt(this);
490
512
  let e = [];
491
513
  Array.isArray(this.props.data) ? (e = this.props.data, a = a || this.props.data.length) : this.props.data && (e = this.props.data.data, a = a || this.props.data.total);
492
- const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", i = this.props.scrollable === "virtual", { resolvedGroupsCount: n, flattedData: h } = this.flatData(
514
+ const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", s = this.props.scrollable === "virtual", { resolvedGroupsCount: l, flattedData: p } = this.flatData(
493
515
  e,
494
516
  t,
495
517
  this.props.skip || 0,
@@ -498,15 +520,15 @@ const _ = class _ extends r.Component {
498
520
  this.props.filter,
499
521
  this.props.sort
500
522
  );
501
- this._data = h;
502
- const l = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
503
- this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = l;
523
+ this._data = p;
524
+ const n = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
525
+ this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = n;
504
526
  const d = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
505
- this.initializeVirtualization(a, l);
506
- const f = this.childrenToArray(this.props.children);
507
- this.initColumns(f, n);
508
- const R = f.map((o) => o && o.type && o.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(o, { ...o.props, ariaControls: this._gridId }) : null), I = f.filter((o) => o && o.type && o.type.displayName === "KendoReactGridNoRecords"), z = f.filter((o) => o && o.type && o.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((o) => o.children.length === 0), $ = l && /* @__PURE__ */ r.createElement(
509
- ot,
527
+ this.initializeVirtualization(a, n);
528
+ const m = this.childrenToArray(this.props.children);
529
+ this.initColumns(m, l);
530
+ const R = m.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), k = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"), z = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((i) => i.children.length === 0), A = n && /* @__PURE__ */ r.createElement(
531
+ rt,
510
532
  {
511
533
  group: this.props.group || [],
512
534
  groupChange: this.groupChange,
@@ -518,38 +540,39 @@ const _ = class _ extends r.Component {
518
540
  ariaControls: this._gridId,
519
541
  onContextMenu: this.onContextMenu
520
542
  }
521
- ), { sort: we, sortable: Se, group: ke, filter: Ie, filterable: Ee, filterOperators: xe = Re, headerCellRender: _e, columnMenu: ze } = this.props, j = /* @__PURE__ */ r.createElement(
522
- tt,
543
+ ), { sort: ye, sortable: we, group: Se, filter: Ie, filterable: ke, filterOperators: Ee = Ce, headerCellRender: xe, columnMenu: _e, columnMenuIcon: Te } = this.props, j = /* @__PURE__ */ r.createElement(
544
+ st,
523
545
  {
524
546
  size: this.props.size,
525
547
  columnResize: this.columnResize,
526
548
  staticHeaders: this.props.scrollable !== "none",
527
549
  scrollableDataElement: () => this.vs.container,
528
- draggable: this.props.reorderable || l,
550
+ draggable: this.props.reorderable || n,
529
551
  ref: this.headerRef,
530
552
  elemRef: this.headerElementRef,
531
553
  headerRow: this.getHeaderRow(
554
+ ye,
532
555
  we,
533
556
  Se,
534
- ke,
535
- l,
557
+ n,
536
558
  Ie,
559
+ ke,
537
560
  Ee,
538
561
  xe,
539
562
  _e,
540
- ze,
563
+ Te,
541
564
  this._columns,
542
565
  this._columnsMap,
543
566
  this.isRtl
544
567
  ),
545
568
  filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
546
- it,
569
+ ot,
547
570
  {
548
571
  cells: this.props.cells,
549
572
  size: this.props.size,
550
573
  columns: this._columns,
551
574
  filter: this.props.filter,
552
- filterOperators: this.props.filterOperators || Re,
575
+ filterOperators: this.props.filterOperators || Ce,
553
576
  filterChange: this.filterChange,
554
577
  sort: this.props.sort,
555
578
  cellRender: this.props.filterCellRender,
@@ -557,136 +580,136 @@ const _ = class _ extends r.Component {
557
580
  ariaRowIndex: this._columnsMap.length + 1
558
581
  }
559
582
  ) || void 0,
560
- cols: C.map((o, g) => /* @__PURE__ */ r.createElement(
583
+ cols: C.map((i, g) => /* @__PURE__ */ r.createElement(
561
584
  "col",
562
585
  {
563
586
  key: g.toString(),
564
- width: W(o)
587
+ width: B(i)
565
588
  }
566
589
  ))
567
590
  }
568
- ), De = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, He = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: Te, hiddenColumns: Le } = qe({
591
+ ), ze = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Fe } = qe({
569
592
  enabled: this.props.columnVirtualization,
570
593
  columns: C,
571
- tableViewPortWidth: He,
572
- scrollLeft: De
573
- }), Fe = (o, g, m) => {
594
+ tableViewPortWidth: De,
595
+ scrollLeft: ze
596
+ }), Le = (i, g, f) => {
574
597
  let E = !1;
575
- const k = this.props.selectedField ? ve(this.props.selectedField, o.dataItem) : void 0;
598
+ const I = this.props.selectedField ? ve(this.props.selectedField, i.dataItem) : void 0;
576
599
  return {
577
- row: C.map((u, b) => {
578
- if (Le[b])
600
+ row: C.map((u, v) => {
601
+ if (Fe[v])
579
602
  return null;
580
- const H = u.id ? u.id : b, T = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, y = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
603
+ const H = u.id ? u.id : v, F = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, y = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
581
604
  let w = !1;
582
605
  if (u.editable && this.props.editField) {
583
- const v = ve(this.props.editField, o.dataItem);
584
- v && (v === !0 || v === u.field) && (E = !0, w = !0);
606
+ const b = ve(this.props.editField, i.dataItem);
607
+ b && (b === !0 || b === u.field) && (E = !0, w = !0);
585
608
  }
586
- const P = u.cell || w && et || vt, L = this.props.expandField && this.props.detail && u.field === this.props.expandField;
609
+ const V = u.cell || w && tt || Ct, L = this.props.expandField && this.props.detail && u.field === this.props.expandField;
587
610
  return /* @__PURE__ */ r.createElement(
588
- P,
611
+ V,
589
612
  {
590
613
  onContextMenu: this.onContextMenu,
591
614
  key: H,
592
615
  locked: this.props.lockGroups,
593
- id: N.generateNavigatableId(
594
- `${g}-${String(b)}`,
595
- p,
596
- L ? "nodata" : "cell"
616
+ id: _.generateNavigatableId(
617
+ `${g}-${String(v)}`,
618
+ h,
619
+ L || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
597
620
  ),
598
- colSpan: Te[b],
599
- dataItem: o.dataItem,
621
+ colSpan: He[v],
622
+ dataItem: i.dataItem,
600
623
  field: u.field,
601
624
  editor: u.editor,
602
625
  format: u.format,
603
- className: T,
626
+ className: F,
604
627
  render: this.props.cellRender,
605
628
  cells: bt(this.props.cells, u.cells),
606
629
  onChange: this.itemChange,
607
- selectionChange: this.props.onSelectionChange ? (v) => {
608
- this.selectionChange({ event: v, dataItem: o.dataItem, dataIndex: m, columnIndex: b });
630
+ selectionChange: this.props.onSelectionChange ? (b) => {
631
+ this.selectionChange({ event: b, dataItem: i.dataItem, dataIndex: f, columnIndex: v });
609
632
  } : void 0,
610
- columnIndex: b,
633
+ columnIndex: v,
611
634
  columnsCount: C.length,
612
- rowType: o.rowType,
613
- level: o.level,
614
- expanded: o.expanded,
615
- dataIndex: o.dataIndex,
635
+ rowType: i.rowType,
636
+ level: i.level,
637
+ expanded: i.expanded,
638
+ dataIndex: i.dataIndex,
616
639
  style: y,
617
640
  ariaColumnIndex: u.ariaColumnIndex,
618
- isSelected: Array.isArray(k) && k.indexOf(b) > -1
641
+ isSelected: Array.isArray(I) && I.indexOf(v) > -1
619
642
  }
620
643
  );
621
644
  }),
622
645
  isInEdit: E,
623
- isSelected: typeof k == "boolean" && k
646
+ isSelected: typeof I == "boolean" && I
624
647
  };
625
648
  };
626
649
  let q = 0;
627
- if (i)
628
- for (let o = 0; o < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); o++) {
650
+ if (s)
651
+ for (let i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {
629
652
  const g = this._data.shift();
630
653
  if (g)
631
- this._data.push(g), q++, g.rowType === "groupHeader" && o--;
654
+ this._data.push(g), q++, g.rowType === "groupHeader" && i--;
632
655
  else
633
656
  break;
634
657
  }
635
- const J = (o) => o >= this._data.length - q;
636
- let Q = this.vs.realSkip || 0;
637
- const A = [];
658
+ const X = (i) => i >= this._data.length - q;
659
+ let Y = this.vs.realSkip || 0;
660
+ const M = [];
638
661
  let K = !1;
639
662
  const O = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
640
663
  let D = 0;
641
664
  if (this._data.length) {
642
- let o = -1, g = 0;
643
- (this._slicedData || this._data).forEach((m, E) => {
644
- m.rowType === "data" && (Q++, o++);
645
- const k = Q % 2 === 0, u = this.props.dataItemKey && Ue(this.props.dataItemKey)(m.dataItem), b = E + (this.vs.realSkip || 0), H = u || "ai" + b, T = H + "_1", y = Fe(m, H, o);
646
- if (D = b + O + g, A.push(/* @__PURE__ */ r.createElement(
647
- Ct,
665
+ let i = -1, g = 0;
666
+ (this._slicedData || this._data).forEach((f, E) => {
667
+ f.rowType === "data" && (Y++, i++);
668
+ const I = Y % 2 === 0, u = this.props.dataItemKey && Ue(this.props.dataItemKey)(f.dataItem), v = E + (this.vs.realSkip || 0), H = u || "ai" + v, F = H + "_1", y = Le(f, H, i);
669
+ if (D = v + O + g, M.push(/* @__PURE__ */ r.createElement(
670
+ Rt,
648
671
  {
649
672
  key: H,
650
- dataItem: m.dataItem,
651
- isAltRow: k,
673
+ dataItem: f.dataItem,
674
+ isAltRow: I,
652
675
  isInEdit: y.isInEdit,
653
- rowType: m.rowType,
654
- isHidden: J(E),
655
- onClick: (w) => this.rowClick(w, m),
656
- onDoubleClick: (w) => this.rowDblClick(w, m),
676
+ rowType: f.rowType,
677
+ isHidden: X(E),
678
+ onClick: (w) => this.rowClick(w, f),
679
+ onDoubleClick: (w) => this.rowDblClick(w, f),
657
680
  selectedField: this.props.selectedField,
658
681
  rowHeight: this.props.rowHeight,
659
682
  render: this.props.rowRender,
660
683
  ariaRowIndex: D,
661
- absoluteRowIndex: b,
662
- dataIndex: this.vs.scrollableVirtual ? b : o,
684
+ absoluteRowIndex: v,
685
+ dataIndex: this.vs.scrollableVirtual ? v : i,
663
686
  isSelected: y.isSelected
664
687
  },
665
688
  y.row
666
- )), this.props.detail && m.rowType === "data" && m.expanded) {
689
+ )), this.props.detail && f.rowType === "data" && f.expanded) {
667
690
  const w = C.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
668
- g++, D = b + O + g, A.push(/* @__PURE__ */ r.createElement(
691
+ g++, D = v + O + g, M.push(/* @__PURE__ */ r.createElement(
669
692
  "tr",
670
693
  {
671
- key: T,
672
- className: F(
694
+ key: F,
695
+ className: N(
673
696
  "k-table-row",
674
- k ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
697
+ I ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
675
698
  ),
676
- style: { visibility: J(E) ? "hidden" : "", height: this.props.detailRowHeight },
699
+ style: { visibility: X(E) ? "hidden" : "", height: this.props.detailRowHeight },
677
700
  role: "row",
678
701
  "aria-rowindex": D
679
702
  },
680
- this.props.group && this.props.group.map((P, L) => {
681
- var re;
682
- const v = (re = y == null ? void 0 : y.row[L]) == null ? void 0 : re.props.style, Ge = v ? this.isRtl ? { left: v.right, right: v.left } : { left: v.left, right: v.right } : {};
703
+ this.props.group && this.props.group.map((V, L) => {
704
+ var oe;
705
+ const b = (oe = y == null ? void 0 : y.row[L]) == null ? void 0 : oe.props.style, Ge = b ? this.isRtl ? { left: b.right, right: b.left } : { left: b.left, right: b.right } : {};
683
706
  return /* @__PURE__ */ r.createElement(
684
- Ce,
707
+ be,
685
708
  {
686
709
  id: "",
687
- dataIndex: m.dataIndex,
688
- field: P.field,
689
- dataItem: m.dataItem,
710
+ dataIndex: f.dataIndex,
711
+ field: V.field,
712
+ dataItem: f.dataItem,
690
713
  key: L,
691
714
  style: Ge,
692
715
  ariaColumnIndex: 1 + L,
@@ -698,21 +721,21 @@ const _ = class _ extends r.Component {
698
721
  );
699
722
  }),
700
723
  this.props.expandField && /* @__PURE__ */ r.createElement(
701
- It,
724
+ Et,
702
725
  {
703
- id: N.generateNavigatableId(`${T}-dhcell`, p)
726
+ id: _.generateNavigatableId(`${F}-dhcell`, h)
704
727
  }
705
728
  ),
706
729
  /* @__PURE__ */ r.createElement(
707
730
  kt,
708
731
  {
709
732
  onContextMenu: this.onContextMenu,
710
- dataItem: m.dataItem,
711
- dataIndex: m.dataIndex,
733
+ dataItem: f.dataItem,
734
+ dataIndex: f.dataIndex,
712
735
  colSpan: w,
713
736
  ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
714
737
  detail: this.props.detail,
715
- id: N.generateNavigatableId(`${T}-dcell`, p)
738
+ id: _.generateNavigatableId(`${F}-dcell`, h)
716
739
  }
717
740
  )
718
741
  ));
@@ -721,39 +744,50 @@ const _ = class _ extends r.Component {
721
744
  } else
722
745
  K = !0;
723
746
  const Ne = () => {
724
- const o = this._header;
725
- return o && o.table.clientWidth;
726
- }, X = () => /* @__PURE__ */ r.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": O, style: { width: Ne() } }, /* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template" }, I.length ? I : /* @__PURE__ */ r.createElement(yt, null))), Y = {
747
+ const i = this._header;
748
+ return i && i.table.clientWidth;
749
+ }, J = () => /* @__PURE__ */ r.createElement(
750
+ "div",
751
+ {
752
+ key: "no-records",
753
+ className: "k-grid-norecords",
754
+ "aria-rowindex": O,
755
+ style: { width: Ne() }
756
+ },
757
+ /* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Qe]: _.generateNavigatableId("no-records", h) }, k.length ? k : /* @__PURE__ */ r.createElement(wt, null))
758
+ ), Q = {
727
759
  size: this.props.size,
728
760
  onPageChange: this.pagerPageChange,
729
761
  total: a,
730
762
  dir: this.isRtl ? "rtl" : void 0,
731
763
  skip: this.vs.propsSkip || 0,
732
764
  take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
733
- messagesMap: nt,
734
- ...St(this.props.pageable || {})
735
- }, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Y }) : /* @__PURE__ */ r.createElement(Je, { className: "k-grid-pager", ...Y }), Ae = (o) => this.props.sort && this.props.sort.filter((g) => g.field === o).length > 0, Me = (o, g) => /* @__PURE__ */ r.createElement(
765
+ messagesMap: ht,
766
+ navigatable: this.props.navigatable,
767
+ ...It(this.props.pageable || {})
768
+ }, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(Xe, { className: "k-grid-pager", ...Q }), Ae = (i) => this.props.sort && this.props.sort.filter((g) => g.field === i).length > 0, Me = (i, g) => /* @__PURE__ */ r.createElement(
736
769
  "col",
737
770
  {
738
771
  key: g.toString(),
739
- width: W(o)
772
+ width: B(i)
740
773
  }
741
- ), ee = (oe = this.props.cells) != null && oe.footerCell || this._columns.some(
742
- (o) => {
774
+ ), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
775
+ (i) => {
743
776
  var g;
744
- return !!(o.footerCell || (g = o.cells) != null && g.footerCell);
777
+ return !!(i.footerCell || (g = i.cells) != null && g.footerCell);
745
778
  }
746
779
  ) ? /* @__PURE__ */ r.createElement(
747
- rt,
780
+ at,
748
781
  {
749
782
  size: this.props.size,
750
783
  columnResize: this.columnResize,
751
784
  staticHeaders: this.props.scrollable !== "none",
752
- ref: (o) => this._footer = o,
785
+ ref: (i) => this._footer = i,
753
786
  row: /* @__PURE__ */ r.createElement(
754
- wt,
787
+ St,
755
788
  {
756
789
  cells: this.props.cells,
790
+ idPrefix: h,
757
791
  columns: this._columns,
758
792
  isRtl: this.isRtl,
759
793
  ariaRowIndex: D + 1
@@ -764,37 +798,37 @@ const _ = class _ extends r.Component {
764
798
  ) : null, te = /* @__PURE__ */ r.createElement(
765
799
  "colgroup",
766
800
  {
767
- ref: (o) => {
768
- this.columnResize.colGroupMain = o;
801
+ ref: (i) => {
802
+ this.columnResize.colGroupMain = i;
769
803
  }
770
804
  },
771
805
  C.map(
772
- (o, g) => /* @__PURE__ */ r.createElement(
806
+ (i, g) => /* @__PURE__ */ r.createElement(
773
807
  "col",
774
808
  {
775
809
  key: g.toString(),
776
- className: Ae(o.field) ? "k-sorted" : void 0,
777
- width: W(o)
810
+ className: Ae(i.field) ? "k-sorted" : void 0,
811
+ width: B(i)
778
812
  }
779
813
  )
780
814
  )
781
- ), se = this.dragLogic.reorderable || this.dragLogic.groupable, ie = this.props.columnVirtualization ? "block" : "table";
815
+ ), se = this.dragLogic.reorderable || this.dragLogic.groupable;
782
816
  if (this.props.scrollable === "none")
783
- return /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
817
+ return /* @__PURE__ */ r.createElement(W.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
784
818
  "div",
785
819
  {
786
820
  id: this.props.id,
787
821
  style: this.props.style,
788
- className: F(
822
+ className: N(
789
823
  "k-grid",
790
824
  {
791
825
  "k-grid-md": !this.props.size,
792
- [`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
826
+ [`k-grid-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
793
827
  },
794
828
  this.props.className
795
829
  ),
796
- ref: (o) => {
797
- this._element = o;
830
+ ref: (i) => {
831
+ this._element = i;
798
832
  },
799
833
  "aria-label": this.props.ariaLabel,
800
834
  onKeyDown: this.onKeyDown,
@@ -802,51 +836,52 @@ const _ = class _ extends r.Component {
802
836
  ...ne
803
837
  },
804
838
  R,
805
- $,
839
+ A,
806
840
  /* @__PURE__ */ r.createElement(
807
841
  he,
808
842
  {
809
843
  selectable: this.props.selectable,
810
844
  onRelease: this.selectionRelease,
811
- childRef: (o) => {
812
- this.tableElement = o;
845
+ childRef: (i) => {
846
+ this.tableElement = i, this.headTable = i;
813
847
  }
814
848
  },
815
849
  /* @__PURE__ */ r.createElement(
816
850
  "table",
817
851
  {
818
- className: F(
852
+ ref: (i) => this.headTable = i,
853
+ className: N(
819
854
  "k-table k-grid-table",
820
- { [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
855
+ { [`k-table-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
821
856
  ),
822
- style: { userSelect: d, display: ie }
857
+ style: { userSelect: d }
823
858
  },
824
859
  te,
825
860
  j,
826
- /* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, A),
861
+ /* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, M),
827
862
  ee
828
863
  )
829
864
  ),
830
- K && X(),
865
+ K && J(),
831
866
  se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
832
867
  ), z, this.props.pageable && Z);
833
- let M = this.props.style || {};
834
- return i && (M.height || (M = Object.assign({}, M, { height: "450px" }))), /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
868
+ let G = this.props.style || {};
869
+ return s && (G.height || (G = Object.assign({}, G, { height: "450px" }))), /* @__PURE__ */ r.createElement(W.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
835
870
  "div",
836
871
  {
837
872
  id: this.props.id,
838
- style: M,
839
- className: F(
873
+ style: G,
874
+ className: N(
840
875
  "k-grid",
841
876
  {
842
877
  "k-grid-md": !this.props.size,
843
- [`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
844
- "k-grid-virtual": i
878
+ [`k-grid-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
879
+ "k-grid-virtual": s
845
880
  },
846
881
  this.props.className
847
882
  ),
848
- ref: (o) => {
849
- this._element = o;
883
+ ref: (i) => {
884
+ this._element = i;
850
885
  },
851
886
  "aria-label": this.props.ariaLabel,
852
887
  onKeyDown: this.onKeyDown,
@@ -854,7 +889,7 @@ const _ = class _ extends r.Component {
854
889
  ...ne
855
890
  },
856
891
  R,
857
- $,
892
+ A,
858
893
  /* @__PURE__ */ r.createElement(
859
894
  "div",
860
895
  {
@@ -863,7 +898,7 @@ const _ = class _ extends r.Component {
863
898
  "aria-colcount": C.length,
864
899
  "aria-rowcount": a,
865
900
  id: this._gridId,
866
- "aria-label": c.toLanguageString(ue, ht[ue])
901
+ "aria-label": c.toLanguageString(ue, pt[ue])
867
902
  },
868
903
  j,
869
904
  /* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
@@ -879,22 +914,23 @@ const _ = class _ extends r.Component {
879
914
  {
880
915
  selectable: this.props.selectable,
881
916
  onRelease: this.selectionRelease,
882
- childRef: (o) => {
883
- this.tableElement = o;
917
+ childRef: (i) => {
918
+ this.tableElement = i;
884
919
  }
885
920
  },
886
921
  /* @__PURE__ */ r.createElement(
887
922
  "table",
888
923
  {
889
- className: F(
924
+ ref: (i) => this.tableElement = i,
925
+ className: N(
890
926
  "k-table k-grid-table",
891
927
  {
892
928
  "k-table-md": !this.props.size,
893
- [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
929
+ [`k-table-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
894
930
  }
895
931
  ),
896
932
  role: "presentation",
897
- style: { userSelect: d, display: ie }
933
+ style: { userSelect: d }
898
934
  },
899
935
  te,
900
936
  /* @__PURE__ */ r.createElement(
@@ -905,14 +941,14 @@ const _ = class _ extends r.Component {
905
941
  role: "rowgroup",
906
942
  ...pe
907
943
  },
908
- A
944
+ M
909
945
  )
910
946
  )
911
- ), K && X()),
912
- i && /* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
947
+ ), K && J()),
948
+ s && /* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
913
949
  "div",
914
950
  {
915
- style: i ? { height: this.vs.containerHeight + "px" } : {}
951
+ style: s ? { height: this.vs.containerHeight + "px" } : {}
916
952
  }
917
953
  ))
918
954
  )),
@@ -926,8 +962,8 @@ const _ = class _ extends r.Component {
926
962
  }
927
963
  selectionChange(a) {
928
964
  if (this.props.onSelectionChange) {
929
- const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: i, cell: n } = le(this.props.selectable), h = {
930
- ...this.getArguments(p.syntheticEvent),
965
+ const { event: h, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: s, cell: l } = le(this.props.selectable), p = {
966
+ ...this.getArguments(h.syntheticEvent),
931
967
  dataItem: c,
932
968
  startColIndex: t,
933
969
  endColIndex: t,
@@ -938,22 +974,22 @@ const _ = class _ extends r.Component {
938
974
  ctrlKey: !1,
939
975
  shiftKey: !1,
940
976
  metaKey: !1,
941
- mode: i,
942
- cell: n,
977
+ mode: s,
978
+ cell: l,
943
979
  isDrag: !1,
944
980
  componentId: this._gridId,
945
981
  selectedField: this.props.selectedField || ""
946
982
  };
947
- this.props.onSelectionChange.call(void 0, h);
983
+ this.props.onSelectionChange.call(void 0, p);
948
984
  }
949
985
  }
950
- raiseDataEvent(a, p, c, e, t) {
951
- const i = this.props.onDataStateChange;
986
+ raiseDataEvent(a, h, c, e, t) {
987
+ const s = this.props.onDataStateChange;
952
988
  if (a) {
953
- const n = { ...this.getArguments(e), ...p, targetEvent: t };
954
- a.call(void 0, n);
989
+ const l = { ...this.getArguments(e), ...h, targetEvent: t };
990
+ a.call(void 0, l);
955
991
  } else
956
- i && i.call(
992
+ s && s.call(
957
993
  void 0,
958
994
  {
959
995
  ...this.getArguments(e),
@@ -965,60 +1001,60 @@ const _ = class _ extends r.Component {
965
1001
  }
966
1002
  );
967
1003
  }
968
- columnReorder(a, p, c) {
969
- const e = this._columns[a], t = e.depth, i = (d) => {
1004
+ columnReorder(a, h, c) {
1005
+ const e = this._columns[a], t = e.depth, s = (d) => {
970
1006
  do
971
1007
  d++;
972
1008
  while (d < this._columns.length && this._columns[d].depth > t);
973
1009
  return d;
974
- }, n = this._columns.splice(a, i(a) - a);
975
- this._columns.splice(a < p ? i(p - n.length) : p, 0, ...n), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, f) => d.orderIndex = f), this._columnsMutations++;
976
- const h = this._columns[a].locked && this._columns[p].locked;
977
- Qe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), Xe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
978
- const l = this.columns;
1010
+ }, l = this._columns.splice(a, s(a) - a);
1011
+ this._columns.splice(a < h ? s(h - l.length) : h, 0, ...l), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, m) => d.orderIndex = m), this._columnsMutations++;
1012
+ const p = this._columns[a].locked && this._columns[h].locked;
1013
+ Ye(this._columnsMap, this._columns, p || this._shouldUpdateLeftRight), Je(this._columnsMap, this._columns, p || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
1014
+ const n = this.columns;
979
1015
  if (this.forceUpdate(), this.props.onColumnReorder) {
980
1016
  const d = {
981
1017
  target: this,
982
- columns: l,
1018
+ columns: n,
983
1019
  columnId: e.id,
984
1020
  nativeEvent: c
985
1021
  };
986
1022
  this.props.onColumnReorder.call(void 0, d);
987
1023
  }
988
1024
  }
989
- groupReorder(a, p, c) {
1025
+ groupReorder(a, h, c) {
990
1026
  if (this.props.group === void 0)
991
1027
  return;
992
1028
  const e = this.props.group.slice();
993
- e.splice(p, 0, ...e.splice(a, 1)), this.groupChange(e, c);
1029
+ e.splice(h, 0, ...e.splice(a, 1)), this.groupChange(e, c);
994
1030
  }
995
- columnToGroup(a, p, c) {
1031
+ columnToGroup(a, h, c) {
996
1032
  const e = this._columns[a].field;
997
1033
  if (!e)
998
1034
  return;
999
1035
  const t = (this.props.group || []).slice();
1000
- t.splice(p, 0, { field: e }), this.groupChange(t, c);
1036
+ t.splice(h, 0, { field: e }), this.groupChange(t, c);
1001
1037
  }
1002
- columnGroupChange(a, p) {
1038
+ columnGroupChange(a, h) {
1003
1039
  const c = this.dragLogic.getCurrentGroupsLength;
1004
- this.columnToGroup(a, c, p);
1040
+ this.columnToGroup(a, c, h);
1005
1041
  }
1006
1042
  resetTableWidth() {
1007
1043
  let a = 0;
1008
1044
  if (!this.columnResize.colGroupMain)
1009
1045
  return;
1010
- const p = this.columnResize.colGroupMain.children;
1011
- for (let c = 0; c < p.length; c++) {
1012
- const e = p[c].width;
1046
+ const h = this.columnResize.colGroupMain.children;
1047
+ for (let c = 0; c < h.length; c++) {
1048
+ const e = h[c].width;
1013
1049
  if (!e)
1014
1050
  return;
1015
1051
  a += parseFloat(e.toString());
1016
1052
  }
1017
1053
  a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
1018
1054
  }
1019
- initColumns(a, p) {
1020
- const c = N.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = e.length !== this._columns.length;
1021
- this._columns = e, this._columns.length === 0 && (this._columns = ft(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, p, c), this._columnsMap = this.mapColumns(this._columns, t), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
1055
+ initColumns(a, h) {
1056
+ const c = _.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations);
1057
+ this._columns = e, this._columns.length === 0 && (this._columns = vt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, h, c), this._columnsMap = this.mapColumns(this._columns, this._columnsMutations), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
1022
1058
  }
1023
1059
  getDataState() {
1024
1060
  return {
@@ -1037,87 +1073,87 @@ const _ = class _ extends r.Component {
1037
1073
  };
1038
1074
  }
1039
1075
  };
1040
- _.displayName = "KendoReactGrid", _.defaultProps = {
1076
+ T.displayName = "KendoReactGrid", T.defaultProps = {
1041
1077
  // never use this
1042
- }, _.propTypes = {
1043
- data: s.oneOfType([
1044
- s.array,
1045
- s.shape({
1046
- data: s.array,
1047
- total: s.number
1078
+ }, T.propTypes = {
1079
+ data: o.oneOfType([
1080
+ o.array,
1081
+ o.shape({
1082
+ data: o.array,
1083
+ total: o.number
1048
1084
  })
1049
1085
  ]),
1050
- sortable: s.oneOfType([
1051
- s.bool,
1052
- s.shape({
1053
- mode: s.oneOf(["single", "multiple"]),
1054
- allowUnsort: s.bool
1086
+ sortable: o.oneOfType([
1087
+ o.bool,
1088
+ o.shape({
1089
+ mode: o.oneOf(["single", "multiple"]),
1090
+ allowUnsort: o.bool
1055
1091
  })
1056
1092
  ]),
1057
- onSortChange: s.func,
1058
- sort: s.array,
1059
- filterable: s.bool,
1060
- filter: s.any,
1061
- onFilterChange: s.func,
1062
- pageable: s.oneOfType([
1063
- s.bool,
1064
- s.shape({
1065
- buttonCount: s.number,
1066
- responsive: s.bool,
1067
- info: s.bool,
1068
- type: s.oneOf(["numeric", "input"]),
1069
- pageSizes: s.oneOfType(
1093
+ onSortChange: o.func,
1094
+ sort: o.array,
1095
+ filterable: o.bool,
1096
+ filter: o.any,
1097
+ onFilterChange: o.func,
1098
+ pageable: o.oneOfType([
1099
+ o.bool,
1100
+ o.shape({
1101
+ buttonCount: o.number,
1102
+ responsive: o.bool,
1103
+ info: o.bool,
1104
+ type: o.oneOf(["numeric", "input"]),
1105
+ pageSizes: o.oneOfType(
1070
1106
  [
1071
- s.bool,
1072
- s.arrayOf(s.oneOfType([
1073
- s.string,
1074
- s.number
1107
+ o.bool,
1108
+ o.arrayOf(o.oneOfType([
1109
+ o.string,
1110
+ o.number
1075
1111
  ]))
1076
1112
  ]
1077
1113
  ),
1078
- previousNext: s.bool
1114
+ previousNext: o.bool
1079
1115
  })
1080
1116
  ]),
1081
- pageSize: s.number,
1082
- onPageChange: s.func,
1083
- total: s.number,
1084
- skip: s.number,
1085
- take: s.number,
1086
- fixedScroll: s.bool,
1087
- onExpandChange: s.func,
1088
- expandField: s.string,
1089
- selectedField: s.string,
1090
- onSelectionChange: s.func,
1091
- onHeaderSelectionChange: s.func,
1092
- resizable: s.bool,
1093
- reorderable: s.bool,
1094
- group: s.any,
1095
- groupable: s.oneOfType([
1096
- s.bool,
1097
- s.shape({
1098
- enabled: s.bool,
1099
- footer: s.oneOf(["always", "visible", "none"])
1117
+ pageSize: o.number,
1118
+ onPageChange: o.func,
1119
+ total: o.number,
1120
+ skip: o.number,
1121
+ take: o.number,
1122
+ fixedScroll: o.bool,
1123
+ onExpandChange: o.func,
1124
+ expandField: o.string,
1125
+ selectedField: o.string,
1126
+ onSelectionChange: o.func,
1127
+ onHeaderSelectionChange: o.func,
1128
+ resizable: o.bool,
1129
+ reorderable: o.bool,
1130
+ group: o.any,
1131
+ groupable: o.oneOfType([
1132
+ o.bool,
1133
+ o.shape({
1134
+ enabled: o.bool,
1135
+ footer: o.oneOf(["always", "visible", "none"])
1100
1136
  })
1101
1137
  ]),
1102
- onGroupChange: s.func,
1103
- onRowClick: s.func,
1104
- onRowDoubleClick: s.func,
1105
- onItemChange: s.func,
1106
- editField: s.string,
1107
- scrollable: s.oneOf(["none", "scrollable", "virtual"]),
1108
- rowHeight: s.number,
1109
- detailRowHeight: s.number,
1110
- detail: s.any,
1111
- style: s.object,
1112
- onDataStateChange: s.func,
1113
- onColumnResize: s.func,
1114
- onColumnReorder: s.func,
1115
- dataItemKey: s.string,
1116
- navigatable: s.bool,
1117
- size: s.oneOf(["small", "medium"])
1118
- }, _.contextType = U;
1119
- let B = _;
1120
- lt(B);
1138
+ onGroupChange: o.func,
1139
+ onRowClick: o.func,
1140
+ onRowDoubleClick: o.func,
1141
+ onItemChange: o.func,
1142
+ editField: o.string,
1143
+ scrollable: o.oneOf(["none", "scrollable", "virtual"]),
1144
+ rowHeight: o.number,
1145
+ detailRowHeight: o.number,
1146
+ detail: o.any,
1147
+ style: o.object,
1148
+ onDataStateChange: o.func,
1149
+ onColumnResize: o.func,
1150
+ onColumnReorder: o.func,
1151
+ dataItemKey: o.string,
1152
+ navigatable: o.bool,
1153
+ size: o.oneOf(["small", "medium"])
1154
+ }, T.contextType = W;
1155
+ let $ = T;
1156
+ nt($);
1121
1157
  export {
1122
- B as Grid
1158
+ $ as Grid
1123
1159
  };