@progress/kendo-react-grid 8.1.1 → 8.2.0-develop.10

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