@progress/kendo-react-grid 9.0.0-develop.9 → 9.0.1-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/Grid.js +1 -1
  2. package/Grid.mjs +927 -1042
  3. package/GridNoRecords.js +1 -1
  4. package/GridNoRecords.mjs +7 -14
  5. package/GridToolbar.js +1 -1
  6. package/GridToolbar.mjs +23 -28
  7. package/VirtualScroll.js +1 -1
  8. package/VirtualScroll.mjs +53 -51
  9. package/VirtualScrollFixed.js +1 -1
  10. package/VirtualScrollFixed.mjs +16 -14
  11. package/cells/GridFilterCell.js +1 -1
  12. package/cells/GridFilterCell.mjs +99 -113
  13. package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
  14. package/columnMenu/GridColumnMenuCheckboxFilter.mjs +132 -178
  15. package/columnMenu/GridColumnMenuFilter.js +1 -1
  16. package/columnMenu/GridColumnMenuFilter.mjs +123 -156
  17. package/columnMenu/GridColumnMenuFilterCell.js +1 -1
  18. package/columnMenu/GridColumnMenuFilterCell.mjs +42 -53
  19. package/columnMenu/GridColumnMenuFilterUI.js +1 -1
  20. package/columnMenu/GridColumnMenuFilterUI.mjs +15 -17
  21. package/columnMenu/GridColumnMenuGroup.js +1 -1
  22. package/columnMenu/GridColumnMenuGroup.mjs +29 -40
  23. package/columnMenu/GridColumnMenuItemContent.js +1 -1
  24. package/columnMenu/GridColumnMenuItemContent.mjs +7 -20
  25. package/columnMenu/GridColumnMenuItemGroup.js +1 -1
  26. package/columnMenu/GridColumnMenuItemGroup.mjs +7 -20
  27. package/columnMenu/GridColumnMenuSort.js +1 -1
  28. package/columnMenu/GridColumnMenuSort.mjs +42 -53
  29. package/dist/cdn/js/kendo-react-grid.js +1 -1
  30. package/drag/ColumnDraggable.js +1 -1
  31. package/drag/ColumnDraggable.mjs +34 -45
  32. package/drag/GroupingIndicator.js +1 -1
  33. package/drag/GroupingIndicator.mjs +51 -69
  34. package/footer/Footer.js +1 -1
  35. package/footer/Footer.mjs +40 -57
  36. package/header/FilterRow.js +1 -1
  37. package/header/FilterRow.mjs +70 -78
  38. package/header/GridHeaderSelectionCell.js +1 -1
  39. package/header/GridHeaderSelectionCell.mjs +28 -37
  40. package/header/GroupPanel.js +1 -1
  41. package/header/GroupPanel.mjs +43 -49
  42. package/header/Header.js +1 -1
  43. package/header/Header.mjs +70 -89
  44. package/index.d.mts +261 -725
  45. package/index.d.ts +261 -725
  46. package/index.js +1 -1
  47. package/index.mjs +78 -80
  48. package/package-metadata.mjs +1 -1
  49. package/package.json +11 -11
  50. package/rows/GridDetailRow.js +1 -1
  51. package/rows/GridDetailRow.mjs +2 -10
package/Grid.mjs CHANGED
@@ -8,1094 +8,979 @@
8
8
  "use client";
9
9
  import * as r from "react";
10
10
  import o from "prop-types";
11
- import { RowHeightService as ne, getScrollbarWidth as Ke, dispatchEvent as Be, canUseDOM as M, getActiveElement as Ve, memoizeOne as y, uGrid as he, classNames as m, validatePackage as Ue, shouldShowValidationUI as $e, setScrollbarWidth as de, getter as je, WatermarkOverlay as qe } from "@progress/kendo-react-common";
12
- import { tableKeyboardNavigation as T, getSelectionOptions as pe, mapColumns as Je, ClipboardService as Xe, TableKeyboardNavigationContext as V, isRtl as Ye, tableKeyboardNavigationTools as D, tableColumnsVirtualization as Qe, Pager as Ze, tableKeyboardNavigationScopeAttributes as ce, TableSelection as ue, tableKeyboardNavigationBodyAttributes as ge, DropClue as fe, DragClue as me, updateLeft as et, updateRight as tt, KEYBOARD_NAV_DATA_ID as st } from "@progress/kendo-react-data-tools";
13
- import { GridSelectionCell as it } from "./cells/GridSelectionCell.mjs";
14
- import { GridHierarchyCell as ot } from "./cells/GridHierarchyCell.mjs";
15
- import { GridEditCell as rt } from "./cells/GridEditCell.mjs";
16
- import { Header as at } from "./header/Header.mjs";
17
- import { HeaderRow as lt } from "./header/HeaderRow.mjs";
18
- import { FilterRow as nt } from "./header/FilterRow.mjs";
19
- import { GroupPanel as ht } from "./header/GroupPanel.mjs";
20
- import { Footer as dt } from "./footer/Footer.mjs";
21
- import { provideLocalizationService as pt, registerForLocalization as ct } from "@progress/kendo-react-intl";
22
- import { pagerMessagesMap as ut, gridAriaLabel as be, messages as gt } from "./messages/index.mjs";
23
- import { VirtualScroll as ft } from "./VirtualScroll.mjs";
24
- import { VirtualScrollFixed as ve } from "./VirtualScrollFixed.mjs";
25
- import { ColumnResize as mt } from "./drag/ColumnResize.mjs";
26
- import { CommonDragLogic as bt } from "./drag/CommonDragLogic.mjs";
27
- import { firefox as Ce, firefoxMaxHeight as Re, flatData as vt, readColumns as Ct, sanitizeColumns as Rt, getColumnWidth as U, isSorted as we, autoGenerateColumns as wt, getNestedValue as ye, resolveCells as yt } from "./utils/index.mjs";
28
- import { GridCell as Et } from "./cells/GridCell.mjs";
29
- import { GridGroupCell as Ee } from "./cells/GridGroupCell.mjs";
30
- import { GridRow as St } from "./rows/GridRow.mjs";
31
- import { GridHeaderSelectionCell as It } from "./header/GridHeaderSelectionCell.mjs";
32
- import { GridNoRecords as _t } from "./GridNoRecords.mjs";
33
- import { operators as Se } from "./filterCommon.mjs";
34
- import { FooterRow as xt } from "./footer/FooterRow.mjs";
35
- import { normalize as kt } from "./paging/GridPagerSettings.mjs";
36
- import { packageMetadata as Ie } from "./package-metadata.mjs";
37
- import { GridDetailCell as Tt } from "./cells/GridDetailCell.mjs";
38
- import { GridDetailHierarchyCell as Dt } from "./cells/GridDetailHierarchyCell.mjs";
39
- import { SAFARI_REGEX as Ht } from "./constants/index.mjs";
40
- const H = class H extends r.Component {
41
- constructor(a) {
42
- super(a), 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
- const t = { rowIndex: this.rowIndex };
44
- e.forEach((s) => {
45
- s.isIntersecting || this.setCurrentOnTop(t);
46
- });
47
- }, this.setCurrentOnTop = (e) => {
48
- if (!this.vs.container || this.props.scrollable === "none")
11
+ import { useId as Rn, validatePackage as Cn, useUnstyled as vn, uGrid as yn, shouldShowValidationUI as wn, useDir as En, setScrollbarWidth as ct, canUseDOM as Q, getter as In, classNames as b, WatermarkOverlay as Sn, RowHeightService as it, getScrollbarWidth as kn, dispatchEvent as xn, getActiveElement as Hn } from "@progress/kendo-react-common";
12
+ import { tableKeyboardNavigation as K, ClipboardService as Tn, tableKeyboardNavigationTools as L, tableColumnsVirtualization as Dn, Pager as Nn, TableKeyboardNavigationContext as dt, tableKeyboardNavigationScopeAttributes as ut, TableSelection as st, tableKeyboardNavigationBodyAttributes as ft, DropClue as gt, DragClue as mt, getSelectionOptions as ht, updateLeft as Fn, updateRight as Gn, mapColumns as An, KEYBOARD_NAV_DATA_ID as zn } from "@progress/kendo-react-data-tools";
13
+ import { GridSelectionCell as Mn } from "./cells/GridSelectionCell.mjs";
14
+ import { GridHierarchyCell as On } from "./cells/GridHierarchyCell.mjs";
15
+ import { GridEditCell as Pn } from "./cells/GridEditCell.mjs";
16
+ import { Header as Kn } from "./header/Header.mjs";
17
+ import { HeaderRow as Ln } from "./header/HeaderRow.mjs";
18
+ import { FilterRow as Vn } from "./header/FilterRow.mjs";
19
+ import { GroupPanel as Bn } from "./header/GroupPanel.mjs";
20
+ import { Footer as Wn } from "./footer/Footer.mjs";
21
+ import { useLocalization as _n } from "@progress/kendo-react-intl";
22
+ import { pagerMessagesMap as Un, gridAriaLabel as bt, messages as $n } from "./messages/index.mjs";
23
+ import { VirtualScroll as jn } from "./VirtualScroll.mjs";
24
+ import { VirtualScrollFixed as Rt } from "./VirtualScrollFixed.mjs";
25
+ import { ColumnResize as qn } from "./drag/ColumnResize.mjs";
26
+ import { CommonDragLogic as Jn } from "./drag/CommonDragLogic.mjs";
27
+ import { getColumnWidth as Ne, isSorted as Ct, sanitizeColumns as Xn, firefox as vt, firefoxMaxHeight as yt, flatData as Yn, autoGenerateColumns as Qn, getNestedValue as wt, resolveCells as Zn, readColumns as pn } from "./utils/index.mjs";
28
+ import { GridCell as er } from "./cells/GridCell.mjs";
29
+ import { GridGroupCell as Et } from "./cells/GridGroupCell.mjs";
30
+ import { GridRow as tr } from "./rows/GridRow.mjs";
31
+ import { GridHeaderSelectionCell as nr } from "./header/GridHeaderSelectionCell.mjs";
32
+ import { GridNoRecords as rr } from "./GridNoRecords.mjs";
33
+ import { operators as It } from "./filterCommon.mjs";
34
+ import { FooterRow as ar } from "./footer/FooterRow.mjs";
35
+ import { normalize as lr } from "./paging/GridPagerSettings.mjs";
36
+ import { packageMetadata as St } from "./package-metadata.mjs";
37
+ import { GridDetailCell as or } from "./cells/GridDetailCell.mjs";
38
+ import { GridDetailHierarchyCell as cr } from "./cells/GridDetailHierarchyCell.mjs";
39
+ import { SAFARI_REGEX as ir } from "./constants/index.mjs";
40
+ const kt = r.forwardRef((t, xt) => {
41
+ var nt, rt, at, lt;
42
+ const se = Rn();
43
+ Cn(St);
44
+ const A = () => {
45
+ var e;
46
+ if (Q)
47
+ return ((e = Z()) == null ? void 0 : e.ownerDocument) || document;
48
+ }, T = () => (t.id || se) + "-role-element-id", V = () => {
49
+ const e = s.current.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
50
+ return Xn(e);
51
+ }, Z = () => k.current, fe = r.useCallback(
52
+ (e) => {
53
+ var l;
54
+ if (!c.current || !((l = c.current) != null && l.container) || t.scrollable === "none")
49
55
  return;
50
- this.observer && this.observer.disconnect();
51
- const { rowIndex: t } = e;
52
- if (this.props.scrollable === "virtual")
53
- this.vs.askedSkip = t, this.vs.container.scroll(
56
+ z.current && z.current.disconnect();
57
+ const { rowIndex: n } = e, a = Z();
58
+ if (t.scrollable === "virtual")
59
+ c.current.askedSkip = n, c.current.container.scroll(
54
60
  0,
55
- Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight)
61
+ Math.round(c.current.askedSkip / c.current.total * c.current.container.scrollHeight)
56
62
  );
57
- else if (this.element) {
58
- const s = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
59
- s && this.containerRef.current && (this.containerRef.current.scrollTop = s.offsetTop);
60
- }
61
- }, this.scrollIntoView = (e) => {
62
- if (!this.vs.container || this.props.scrollable === "none")
63
- return;
64
- this.rowIndex = e.rowIndex;
65
- const { rowIndex: t } = e, s = this.element;
66
- if (this.observer && s) {
67
- this.observer.disconnect();
68
- const l = s.querySelector(`[absolute-row-index="${t}"]`);
69
- l ? this.observer.observe(l) : this.setCurrentOnTop(e);
70
- }
71
- }, this.fitColumns = (e) => {
72
- this.columnResize.dblClickHandler(null, e);
73
- }, this.getColumnsEssentialProps = (e) => JSON.stringify(e.map((t) => ({ id: t.id, field: t.field, title: t.title, children: t.children }))), this.checkMatchMediaColumnsDifferece = () => {
74
- const e = this.childrenToArray(this.props.children);
75
- return this.getColumnsEssentialProps(e) === this.getColumnsEssentialProps(this._columns);
76
- }, this.onContextMenu = (e, t, s) => {
77
- if (this.props.onContextMenu) {
78
- const l = {
79
- target: this,
80
- syntheticEvent: e,
81
- nativeEvent: e.nativeEvent,
82
- dataItem: t,
83
- field: s
84
- };
85
- this.props.onContextMenu.call(void 0, l);
63
+ else if (a) {
64
+ const i = n < 1 ? a.querySelector("tbody > tr:nth-child(1)") : a.querySelector(`tbody > tr:nth-child(${n + 1})`);
65
+ i && _.current && (_.current.scrollTop = i.offsetTop);
86
66
  }
87
- }, this.getVirtualScroll = (e) => {
88
- const { rowHeight: t, detailRowHeight: s, detail: l, expandField: d, groupable: p } = e, h = this.isAllData(), g = t !== void 0 && t > 0, v = s !== void 0 && s > 0, z = p === !0 || typeof p == "object" && p.enabled !== !1;
89
- return !g || z && !h || !!(l && d) && (!v || !h) ? ft : ve;
90
- }, this.isAllData = () => {
91
- const { data: e, total: t } = this.props;
92
- return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
93
- }, this.initializeVirtualization = (e, t) => {
94
- if (this.reInitVirtualization(
95
- this.props.scrollable === "virtual",
96
- this.props.total,
97
- this.props.filter,
98
- this.props.group,
99
- this.props.sort,
100
- t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
101
- ), 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) {
102
- const s = this.props.rowHeight * e;
103
- this.vs.containerHeight = Ce ? Math.min(Re, s) : s;
104
- } else
105
- this.vs.containerHeight = 1533915;
106
- if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ve) {
107
- const { rowHeight: s = 0, detail: l, expandField: d } = this.props;
108
- let { detailRowHeight: p = 0 } = this.props;
109
- p = l && d ? p : 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(
110
- this.vs,
111
- this._data.length,
112
- s,
113
- p,
114
- this._data
115
- )) : this.vs.rowHeightService = new ne(e, s, p);
116
- const h = this.vs.rowHeightService.totalHeight();
117
- this.vs.containerHeight = Ce ? Math.min(Re, h) : h;
118
- }
119
- }, this.getCachedScrollbarWidth = () => (this._scrollbarWidth || (this._scrollbarWidth = Ke() || void 0), this._scrollbarWidth), this.scrollHandler = (e) => {
120
- if (e.target !== e.currentTarget)
121
- return;
122
- clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
123
- const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
124
- this.props.columnVirtualization && (!this.vs.scrollableVirtual || s === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
125
- this.forceUpdate();
126
- }, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e), Be(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = s;
127
- }, this.onKeyDown = (e) => {
128
- if (T.onKeyDown(e, {
129
- navigatable: this.props.navigatable || !1,
130
- contextStateRef: this.contextStateRef,
131
- navigationStateRef: this.navigationStateRef,
132
- onNavigationAction: this.onNavigationAction,
133
- columns: this.columns
134
- }), this.props.onKeyDown) {
135
- const { mode: t, cell: s } = pe(this.props.selectable), l = {
136
- dataItems: this.getLeafDataItems(),
137
- mode: t,
138
- cell: s,
139
- componentId: this._gridId,
140
- selectedField: this.props.selectedField,
141
- ...this.getArguments(e)
142
- };
143
- this.props.onKeyDown.call(void 0, l);
144
- }
145
- }, this.onFocus = (e) => {
146
- T.onFocus(e, {
147
- navigatable: !!this.props.navigatable,
148
- contextStateRef: this.contextStateRef
149
- });
150
- }, this.onNavigationAction = (e) => {
151
- if (e.action === "moveToNextPage" && this.moveToNextPage(e.event), e.action === "moveToPrevPage" && this.moveToPrevPage(e.event), e.focusElement && e.action === "reorderToRight") {
152
- const t = parseInt(e.focusElement.ariaColIndex, 10) - 1;
153
- t < this._columns.length - 1 && this.columnReorder(t, t + 1, e.event);
154
- }
155
- if (e.focusElement && e.action === "reorderToLeft") {
156
- const t = parseInt(e.focusElement.ariaColIndex, 10) - 1;
157
- t > 0 && this.columnReorder(t, t - 1, e.event);
158
- }
159
- if (this.props.onNavigationAction) {
160
- const t = {
161
- focusElement: e.focusElement,
162
- ...this.getArguments(e.event)
163
- };
164
- this.props.onNavigationAction.call(void 0, t);
165
- }
166
- }, this.rowClick = (e, t) => {
167
- this.props.onRowClick && e.target.nodeName === "TD" && this.props.onRowClick.call(void 0, {
168
- dataItem: t.dataItem,
169
- ...this.getArguments(e)
170
- });
171
- }, this.rowDblClick = (e, t) => {
172
- this.props.onRowDoubleClick && e.target.nodeName === "TD" && this.props.onRowDoubleClick.call(void 0, {
173
- dataItem: t.dataItem,
174
- ...this.getArguments(e)
67
+ },
68
+ [t.scrollable]
69
+ ), Fe = r.useCallback(
70
+ (e) => {
71
+ const n = { rowIndex: Se.current };
72
+ e.forEach((a) => {
73
+ a.isIntersecting || fe(n);
175
74
  });
176
- }, this.itemChange = (e) => {
177
- const t = this.props.onItemChange;
178
- if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
179
- const s = this.props.onExpandChange;
180
- s && s.call(void 0, {
181
- ...this.getArguments(e.syntheticEvent),
182
- dataItem: e.dataItem,
183
- dataIndex: e.dataIndex,
184
- value: e.value
185
- });
186
- return;
75
+ },
76
+ [fe]
77
+ ), [, ge] = r.useReducer((e) => !e, !0), Ge = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), B = r.useMemo(() => r.Children.toArray(t.children), [t.children]), Ht = () => Ge(B) === Ge(s.current), Tt = () => {
78
+ Ht() || ge();
79
+ }, me = (e, n, a) => {
80
+ if (t.onContextMenu) {
81
+ const l = {
82
+ target: w.current,
83
+ syntheticEvent: e,
84
+ nativeEvent: e.nativeEvent,
85
+ dataItem: n,
86
+ field: a
87
+ };
88
+ t.onContextMenu.call(void 0, l);
89
+ }
90
+ }, Ae = () => {
91
+ const { data: e, total: n } = t;
92
+ return Array.isArray(e) ? e.length === n : e ? n === e.total : !1;
93
+ }, Dt = () => {
94
+ const { rowHeight: e, detailRowHeight: n, detail: a, expandField: l, groupable: i } = t, u = Ae(), d = e !== void 0 && e > 0, h = n !== void 0 && n > 0, E = i === !0 || typeof i == "object" && i.enabled !== !1;
95
+ return !d || E && !u || !!(a && l) && (!h || !u) ? jn : Rt;
96
+ }, Nt = (e, n) => {
97
+ if (c.current) {
98
+ if (c.current.fixedScroll = t.fixedScroll || !1, c.current.PageChange = ee, c.current.realSkip = t.skip || 0, c.current.pageSize = (t.take !== void 0 ? t.take : t.pageSize) || 0, c.current.scrollableVirtual = t.scrollable === "virtual", c.current.total = e, c.current.propsSkip = (t.skip || 0) + (t.scrollable === "virtual" ? c.current.topCacheCount + (c.current.attendedSkip - (t.skip || 0)) : 0), t.rowHeight !== void 0 && t.rowHeight > 0 && !n) {
99
+ const a = t.rowHeight * e;
100
+ c.current.containerHeight = vt ? Math.min(yt, a) : a;
101
+ } else
102
+ c.current.containerHeight = 1533915;
103
+ if (c.current.containerRef = _, c.current.tableBodyRef = U, c.current.table = y.current, le.current = void 0, c.current instanceof Rt) {
104
+ const { rowHeight: a = 0, detail: l, expandField: i } = t;
105
+ let { detailRowHeight: u = 0 } = t;
106
+ u = l && i ? u : a, Ae() ? (c.current.total = R.current.length, le.current = R.current.slice(
107
+ c.current.realSkip,
108
+ c.current.realSkip + c.current.pageSize
109
+ ), c.current.rowHeightService = new it(
110
+ R.current.length,
111
+ a,
112
+ u,
113
+ R.current
114
+ )) : c.current.rowHeightService = new it(e, a, u);
115
+ const d = c.current.rowHeightService.totalHeight();
116
+ c.current.containerHeight = vt ? Math.min(yt, d) : d;
187
117
  }
188
- t && t.call(void 0, {
189
- ...this.getArguments(e.syntheticEvent),
118
+ }
119
+ }, p = () => (we.current || (we.current = kn() || void 0), we.current), Ft = (e) => {
120
+ var l;
121
+ if (e.target !== e.currentTarget)
122
+ return;
123
+ clearTimeout(Ie.current), c.current && (c.current.table = y.current);
124
+ const n = e.currentTarget.scrollLeft, a = e.currentTarget.scrollTop;
125
+ t.columnVirtualization && (!((l = c.current) != null && l.scrollableVirtual) || a === Ee.current) && (Ie.current = window.setTimeout(() => {
126
+ ge();
127
+ }, 0)), O.current && O.current.setScrollLeft(n), W.current && W.current.setScrollLeft(n), c.current && a !== Ee.current && c.current.scrollHandler(e), xn(t.onScroll, e, w.current, void 0), Ee.current = a;
128
+ }, ze = (e) => {
129
+ if (K.onKeyDown(e, {
130
+ navigatable: t.navigatable || !1,
131
+ contextStateRef: S,
132
+ navigationStateRef: D,
133
+ onNavigationAction: Gt,
134
+ columns: V()
135
+ }), K.onGetSnapshotBeforeUpdate({
136
+ document: A(),
137
+ contextStateRef: S,
138
+ navigationStateRef: D
139
+ }), t.onKeyDown) {
140
+ const { mode: n, cell: a } = ht(t.selectable), l = {
141
+ dataItems: re(),
142
+ mode: n,
143
+ cell: a,
144
+ componentId: T(),
145
+ selectedField: t.selectedField,
146
+ ...v(e)
147
+ };
148
+ t.onKeyDown.call(void 0, l);
149
+ }
150
+ }, Me = (e) => {
151
+ K.onFocus(e, {
152
+ navigatable: !!t.navigatable,
153
+ contextStateRef: S
154
+ });
155
+ }, Gt = (e) => {
156
+ if (e.action === "moveToNextPage" && Lt(e.event), e.action === "moveToPrevPage" && Vt(e.event), e.focusElement && e.action === "reorderToRight") {
157
+ const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
158
+ n < s.current.length - 1 && he(n, n + 1, e.event);
159
+ }
160
+ if (e.focusElement && e.action === "reorderToLeft") {
161
+ const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
162
+ n > 0 && he(n, n - 1, e.event);
163
+ }
164
+ if (t.onNavigationAction) {
165
+ const n = {
166
+ focusElement: e.focusElement,
167
+ ...v(e.event)
168
+ };
169
+ t.onNavigationAction.call(void 0, n);
170
+ }
171
+ }, At = (e, n) => {
172
+ t.onRowClick && e.target.nodeName === "TD" && t.onRowClick.call(void 0, {
173
+ dataItem: n.dataItem,
174
+ ...v(e)
175
+ });
176
+ }, zt = (e, n) => {
177
+ t.onRowDoubleClick && e.target.nodeName === "TD" && t.onRowDoubleClick.call(void 0, {
178
+ dataItem: n.dataItem,
179
+ ...v(e)
180
+ });
181
+ }, Mt = (e) => {
182
+ if (e.field === t.expandField || t.group && e.field === void 0) {
183
+ t.onExpandChange && t.onExpandChange.call(void 0, {
184
+ ...v(e.syntheticEvent),
190
185
  dataItem: e.dataItem,
191
186
  dataIndex: e.dataIndex,
192
- field: e.field,
193
187
  value: e.value
194
188
  });
195
- }, this.onHeaderSelectionChange = (e) => {
196
- this.props.onHeaderSelectionChange && this.props.onHeaderSelectionChange.call(void 0, {
197
- field: e.field,
198
- nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
199
- syntheticEvent: e.syntheticEvent,
200
- target: this,
201
- dataItems: this.getLeafDataItems(),
202
- selectedField: this.props.selectedField
203
- });
204
- }, this.selectionRelease = (e) => {
205
- if (this.props.onSelectionChange) {
206
- const t = this.getSlicedLeafDataItems()[e.startRowIndex], s = this.getSlicedLeafDataItems()[e.endRowIndex], l = {
207
- syntheticEvent: void 0,
208
- target: this,
209
- selectedField: this.props.selectedField || "",
210
- componentId: this._gridId,
211
- dataItems: this.getLeafDataItems(),
212
- dataItem: null,
213
- startDataItem: t,
214
- endDataItem: s,
215
- ...e
216
- };
217
- this.props.onSelectionChange.call(void 0, l);
218
- }
219
- }, this.pageChange = (e, t, s) => {
220
- this.raiseDataEvent(
221
- this.props.onPageChange,
222
- { page: e },
223
- { skip: e.skip, take: e.take },
224
- t,
225
- s
226
- );
227
- }, this.getTotal = () => {
228
- let e = this.props.total || 0;
229
- return Array.isArray(this.props.data) ? e = e || this.props.data.length : this.props.data && (e = e || this.props.data.total), e;
230
- }, this.moveToNextPage = (e) => {
231
- const t = this.props.take || 0, s = (this.props.skip || 0) + t, l = this.getTotal();
232
- s < l && this.pageChange({ skip: s, take: t }, e);
233
- }, this.moveToPrevPage = (e) => {
234
- const t = this.props.take || 0, s = (this.props.skip || 0) - t;
235
- s >= 0 && this.pageChange({ skip: s, take: t }, e);
236
- }, this.pagerPageChange = (e) => {
237
- this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
238
- }, this.sortChange = (e, t) => {
239
- this.raiseDataEvent(
240
- this.props.onSortChange,
241
- { sort: e },
242
- { sort: e, ...this.props.scrollable === "virtual" ? { skip: 0 } : {} },
243
- t
244
- );
245
- }, this.filterChange = (e, t) => {
246
- this.raiseDataEvent(
247
- this.props.onFilterChange,
248
- { filter: e },
249
- { filter: e || void 0, skip: 0 },
250
- t
251
- );
252
- }, this.groupChange = (e, t) => {
253
- const s = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
254
- e.length === 0 && this.props.navigatable && (this._focusFirst = !0), this._columnsMutations++, this.raiseDataEvent(
255
- this.props.onGroupChange,
256
- { group: e },
257
- { group: e, skip: 0 },
258
- s
259
- );
260
- }, this.onClipboard = (e, t) => {
261
- if (this.props.onClipboard) {
262
- if (!this.inActiveElement() || !e)
263
- return;
264
- this.props.onClipboard.call(void 0, {
265
- type: e,
266
- nativeEvent: t,
267
- columns: this._columns,
268
- dataItemKey: this.props.dataItemKey || "",
269
- ...typeof this.props.clipboard != "boolean" ? this.props.clipboard : {}
270
- });
271
- }
272
- }, this.inActiveElement = () => {
273
- var d, p, h;
274
- if (!M)
275
- return !1;
276
- const e = Ve(this.document), t = e ? e.matches(".k-table-td") ? e : (d = this.document) == null ? void 0 : d.body : (p = this.document) == null ? void 0 : p.body, s = t.closest(".k-grid-container"), l = t && ((h = this._element) == null ? void 0 : h.contains(t));
277
- return !!(t && l && s);
278
- }, this.onResize = (e, t, s, l, d, p) => {
279
- this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(void 0, {
280
- columns: this.columns,
281
- nativeEvent: l,
282
- targetColumnId: p,
283
- index: e,
284
- newWidth: t,
285
- oldWidth: s,
286
- end: d,
287
- target: this
288
- });
289
- }, this.reInitVirtualization = y(
290
- (e, t, s, l, d, p) => {
291
- this.vs.reset();
292
- const h = this.getVirtualScroll(this.props);
293
- this.vs = new h(p);
294
- }
295
- ), this.flatData = y((e, t, s, l, d, p, h) => {
296
- const g = [], v = vt(
297
- g,
298
- e,
299
- t,
300
- { index: s },
301
- l !== void 0,
302
- d
303
- );
304
- return { flattedData: g, resolvedGroupsCount: v };
305
- }), this.rowHeightService = y(
306
- (e, t, s, l, d) => new ne(t, s, l, d)
307
- ), this.childrenToArray = y((e) => r.Children.toArray(e)), this.readColumns = y((e, t, s) => {
308
- const l = e.filter(
309
- (d) => d && d.type && d.type.displayName === "KendoReactGridColumn"
310
- );
311
- return Ct(l, this.columns, { prevId: 0, idPrefix: t });
312
- }), this.mapColumns = y((e, t) => Je(e, !0)), this.filterColumnsByMediaProp = (e) => e.filter((t) => M && t && t.media ? window.matchMedia(t.media).matches : t), this.configureColumns = y((e, t, s) => {
313
- this.props.selectedField && e.filter((g) => g.field === this.props.selectedField).forEach((g) => {
314
- g.width = g.width || "50px", g.cell = g.cell || it, g.headerCell = g.headerCell || It;
315
- });
316
- const { unstyled: l } = this.props, d = l && l.uGrid ? l.uGrid : he, p = {
317
- id: "",
318
- resizable: !0,
319
- width: "32px",
320
- title: " ",
321
- declarationIndex: -1,
322
- orderIndex: -1,
323
- children: [],
324
- parentIndex: -1,
325
- depth: 0,
326
- colSpan: 0,
327
- rowSpan: 0,
328
- left: 0,
329
- right: 0,
330
- index: 0,
331
- rightBorder: !1,
332
- ariaColumnIndex: 0,
333
- isAccessible: !0
189
+ return;
190
+ }
191
+ t.onItemChange && t.onItemChange.call(void 0, {
192
+ ...v(e.syntheticEvent),
193
+ dataItem: e.dataItem,
194
+ dataIndex: e.dataIndex,
195
+ field: e.field,
196
+ value: e.value
197
+ });
198
+ }, Ot = (e) => {
199
+ if (t.onSelectionChange) {
200
+ const { event: n, dataItem: a, dataIndex: l, columnIndex: i } = e, { mode: u, cell: d } = ht(t.selectable), h = {
201
+ ...v(n.syntheticEvent),
202
+ dataItem: a,
203
+ startColIndex: i,
204
+ endColIndex: i,
205
+ startRowIndex: l,
206
+ endRowIndex: l,
207
+ dataItems: re(),
208
+ altKey: !1,
209
+ ctrlKey: !1,
210
+ shiftKey: !1,
211
+ metaKey: !1,
212
+ mode: u,
213
+ cell: d,
214
+ isDrag: !1,
215
+ componentId: T(),
216
+ selectedField: t.selectedField || ""
334
217
  };
335
- let h = 0;
336
- this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
337
- ...p,
338
- cell: ot,
339
- field: this.props.expandField,
340
- headerClassName: m(d.hierarchyCell({}))
341
- }), h++);
342
- for (let g = 0; g < t; g++)
343
- e.unshift({
344
- ...p,
345
- isAccessible: !1,
346
- cell: Ee,
347
- field: "value",
348
- locked: this.props.lockGroups
349
- }), h++;
350
- e.slice(h).forEach((g) => g.parentIndex >= 0 && (g.parentIndex += h));
351
- }), this.getHeaderRow = y(
352
- (e, t, s, l, d, p, h, g, v, z, E, G, O) => /* @__PURE__ */ r.createElement(
353
- lt,
354
- {
355
- cells: this.props.cells,
356
- sort: e,
357
- sortable: t,
358
- sortChange: this.sortChange,
359
- group: s || [],
360
- groupable: l,
361
- groupChange: this.groupChange,
362
- filter: d,
363
- filterable: p,
364
- filterOperators: h,
365
- filterChange: this.filterChange,
366
- columnMenu: v,
367
- columnMenuIcon: z,
368
- selectionChange: this.onHeaderSelectionChange,
369
- columns: E,
370
- columnResize: this.columnResize,
371
- pressHandler: this.dragLogic.pressHandler,
372
- dragHandler: this.dragLogic.dragHandler,
373
- releaseHandler: this.dragLogic.releaseHandler,
374
- columnsMap: G,
375
- cellRender: g,
376
- isRtl: O,
377
- dragClue: this.dragLogic.dragClueRef,
378
- headerRef: this.headerElementRef,
379
- containerRef: this.containerRef,
380
- navigatable: !!this.props.navigatable,
381
- columnGroupChange: this.columnGroupChange
218
+ t.onSelectionChange.call(void 0, h);
219
+ }
220
+ }, Pt = (e) => {
221
+ t.onHeaderSelectionChange && t.onHeaderSelectionChange.call(void 0, {
222
+ field: e.field,
223
+ nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
224
+ syntheticEvent: e.syntheticEvent,
225
+ target: w.current,
226
+ dataItems: re(),
227
+ selectedField: t.selectedField
228
+ });
229
+ }, Oe = (e) => {
230
+ if (t.onSelectionChange) {
231
+ const n = Le()[e.startRowIndex], a = Le()[e.endRowIndex], l = {
232
+ syntheticEvent: void 0,
233
+ target: w.current,
234
+ selectedField: t.selectedField || "",
235
+ componentId: T(),
236
+ dataItems: re(),
237
+ dataItem: null,
238
+ startDataItem: n,
239
+ endDataItem: a,
240
+ ...e
241
+ };
242
+ t.onSelectionChange.call(void 0, l);
243
+ }
244
+ }, ee = (e, n, a) => {
245
+ ne(
246
+ t.onPageChange,
247
+ { page: e },
248
+ { skip: e.skip, take: e.take },
249
+ n,
250
+ a
251
+ );
252
+ }, Kt = () => {
253
+ let e = t.total || 0;
254
+ return Array.isArray(t.data) ? e = e || t.data.length : t.data && (e = e || t.data.total), e;
255
+ }, Lt = (e) => {
256
+ const n = t.take || 0, a = (t.skip || 0) + n, l = Kt();
257
+ a < l && ee({ skip: a, take: n }, e);
258
+ }, Vt = (e) => {
259
+ const n = t.take || 0, a = (t.skip || 0) - n;
260
+ a >= 0 && ee({ skip: a, take: n }, e);
261
+ }, Bt = (e) => {
262
+ ee({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
263
+ }, Wt = (e, n) => {
264
+ ne(
265
+ t.onSortChange,
266
+ { sort: e },
267
+ { sort: e, ...t.scrollable === "virtual" ? { skip: 0 } : {} },
268
+ n
269
+ );
270
+ }, Pe = (e, n) => {
271
+ ne(
272
+ t.onFilterChange,
273
+ { filter: e },
274
+ { filter: e || void 0, skip: 0 },
275
+ n
276
+ );
277
+ }, te = (e, n) => {
278
+ const a = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
279
+ e.length === 0 && t.navigatable && (Ce.current = !0), ne(
280
+ t.onGroupChange,
281
+ { group: e },
282
+ { group: e, skip: 0 },
283
+ a
284
+ );
285
+ }, ne = (e, n, a, l, i) => {
286
+ const u = t.onDataStateChange;
287
+ if (e) {
288
+ const d = { ...v(l), ...n, targetEvent: i };
289
+ e.call(void 0, d);
290
+ } else
291
+ u && u.call(void 0, {
292
+ ...v(l),
293
+ targetEvent: i || {},
294
+ dataState: {
295
+ ...en(),
296
+ ...a
382
297
  }
383
- )
384
- ), this.resolveTitle = (e) => {
385
- const t = this._columns.find((l) => l.field === e), s = t && (t.title || t.field);
386
- return s === void 0 ? e : s;
387
- }, 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 = () => {
388
- var e, t, s;
389
- if (this.tableBodyRef.current && ((e = this.tableBodyRef.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
390
- this._singleEditRow = !1, (t = document.activeElement) != null && t.closest(".k-grid-edit-row") ? this._lastActiveElement = document.activeElement : this._lastActiveElement = void 0;
391
- const l = Array.from((s = this.tableBodyRef.current) == null ? void 0 : s.getElementsByClassName("k-grid-edit-row"));
392
- l.length > this.rowsInEdit.length ? this._newEditableRow = l.filter((d) => !this.rowsInEdit.includes(d))[0] : l.length === 1 && (this._newEditableRow = l[0], this._singleEditRow = !0), this.rowsInEdit = l;
393
- }
394
- }, Ue(Ie), this.showLicenseWatermark = $e(Ie);
395
- const n = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
396
- this.vs = new c(n || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new bt(
397
- this.columnReorder.bind(this),
398
- this.groupReorder.bind(this),
399
- this.columnToGroup.bind(this)
400
- ), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new mt(this.onResize), this.props.clipboard && (this.clipboardService = new Xe(this.onClipboard)), T.onConstructor({
401
- navigatable: !!a.navigatable,
402
- contextStateRef: this.contextStateRef,
403
- navigationStateRef: this.navigationStateRef,
404
- idPrefix: this._gridId
298
+ });
299
+ }, he = (e, n, a) => {
300
+ const l = s.current[e], i = l.depth, u = (f) => {
301
+ do
302
+ f++;
303
+ while (f < s.current.length && s.current[f].depth > i);
304
+ return f;
305
+ }, d = s.current.splice(e, u(e) - e);
306
+ s.current.splice(e < n ? u(n - d.length) : n, 0, ...d), s.current.filter((f) => f.declarationIndex >= 0).forEach((f, P) => f.orderIndex = P);
307
+ const h = s.current[e].locked && s.current[n].locked;
308
+ Fn(M.current, s.current, h || ce.current), Gn(M.current, s.current, h || ce.current), Re.current && (ce.current = !1, Re.current = !1);
309
+ const E = V();
310
+ if (ge(), t.onColumnReorder) {
311
+ const f = {
312
+ target: w.current,
313
+ columns: E,
314
+ columnId: l.id,
315
+ nativeEvent: a
316
+ };
317
+ t.onColumnReorder.call(void 0, f);
318
+ }
319
+ }, _t = (e, n, a) => {
320
+ if (t.group === void 0)
321
+ return;
322
+ const l = t.group.slice();
323
+ l.splice(n, 0, ...l.splice(e, 1)), te(l, a);
324
+ }, Ke = (e, n, a) => {
325
+ const l = s.current[e].field;
326
+ if (!l)
327
+ return;
328
+ const i = (t.group || []).slice();
329
+ i.splice(n, 0, { field: l }), te(i, a);
330
+ }, Ut = (e, n) => {
331
+ const a = g.current.getCurrentGroupsLength;
332
+ Ke(e, a, n);
333
+ }, be = () => {
334
+ let e = 0;
335
+ if (!C.current.colGroupMain)
336
+ return;
337
+ const n = C.current.colGroupMain.children;
338
+ for (let a = 0; a < n.length; a++) {
339
+ const l = n[a].width;
340
+ if (!l)
341
+ return;
342
+ e += parseFloat(l.toString());
343
+ }
344
+ e = Math.round(e), O.current && O.current.setWidth(e), W.current && W.current.setWidth(e), y.current && (y.current.style.width = e + "px");
345
+ }, $t = (e, n) => {
346
+ if (t.onClipboard) {
347
+ if (!jt() || !e)
348
+ return;
349
+ t.onClipboard.call(void 0, {
350
+ type: e,
351
+ nativeEvent: n,
352
+ columns: s.current,
353
+ dataItemKey: t.dataItemKey || "",
354
+ ...typeof t.clipboard != "boolean" ? t.clipboard : {}
355
+ });
356
+ }
357
+ }, jt = () => {
358
+ var i, u, d;
359
+ if (!Q)
360
+ return !1;
361
+ const e = Hn(A()), n = e ? e.matches(".k-table-td") ? e : (i = A()) == null ? void 0 : i.body : (u = A()) == null ? void 0 : u.body, a = n.closest(".k-grid-container"), l = n && ((d = k.current) == null ? void 0 : d.contains(n));
362
+ return !!(n && l && a);
363
+ }, qt = (e, n, a, l, i, u) => {
364
+ be(), ce.current = !0, Re.current = !0, t.onColumnResize && t.onColumnResize.call(void 0, {
365
+ columns: V(),
366
+ nativeEvent: l,
367
+ targetColumnId: u,
368
+ index: e,
369
+ newWidth: n,
370
+ oldWidth: a,
371
+ end: i,
372
+ target: w.current
373
+ });
374
+ }, Jt = (e, n, a, l, i) => {
375
+ const u = [], d = Yn(
376
+ u,
377
+ e,
378
+ n,
379
+ { index: a },
380
+ l !== void 0,
381
+ i
382
+ );
383
+ return { flattedData: u, resolvedGroupsCount: d };
384
+ }, Xt = (e, n) => {
385
+ const a = e.filter(
386
+ (l) => l && l.type && l.type.displayName === "KendoReactGridColumn"
387
+ );
388
+ return pn(a, V(), { prevId: 0, idPrefix: n });
389
+ }, Yt = (e) => e.filter((n) => Q && n && n.media ? window.matchMedia(n.media).matches : n), Qt = (e, n) => {
390
+ const a = L.getIdPrefix(D), l = Xt(e, a), i = Yt(l);
391
+ s.current = i, s.current.length === 0 && (s.current = Qn(t.data, t.group, t.expandField, {
392
+ prevId: 0,
393
+ idPrefix: a
394
+ })), Zt(s.current, n), M.current = An(s.current, !0), C.current.columns = s.current, g.current.columns = s.current;
395
+ }, Zt = (e, n) => {
396
+ t.selectedField && e.filter((i) => i.field === t.selectedField).forEach((i) => {
397
+ i.width = i.width || "50px", i.cell = i.cell || Mn, i.headerCell = i.headerCell || nr;
405
398
  });
406
- }
407
- /* eslint-disable max-len */
408
- /**
409
- * A getter of the current columns. Gets the current column width or current columns, or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column. Can be used on each Grid instance. To obtain the instance of the rendered Grid, use the `ref` callback. The following example demonstrates how to reorder the columns by dragging their handlers and check the properties afterwards. You can check the result in the browser console.
410
- *
411
- * @example
412
- * ```jsx
413
- * class App extends React.Component {
414
- * constructor(props) {
415
- * super(props);
416
- * this.state = {
417
- * data: [
418
- * { 'foo': 'A1', 'bar': 'B1' },
419
- * { 'foo': 'A2', 'bar': 'B2' },
420
- * { 'foo': 'A3', 'bar': 'B2' }
421
- * ]
422
- * };
423
- * this.grid = null;
424
- * }
425
- * render() {
426
- * return (
427
- * <div>
428
- * <Grid
429
- * data={this.state.data}
430
- * reorderable={true}
431
- * ref={(g) => { this.grid = g; }}
432
- * >
433
- * <GridColumn field="foo" />
434
- * <GridColumn field="bar" />
435
- * </Grid>
436
- * <button onClick={() => console.log(JSON.stringify(this.grid.columns))}>
437
- * log current properties into browser console.
438
- * </button>
439
- * </div>
440
- * );
441
- * }
442
- * }
443
- * ReactDOM.render(<App />, document.querySelector('my-app'));
444
- * ```
445
- */
446
- // tslint:enable:max-line-length
447
- get columns() {
448
- const a = this._columns.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
449
- return Rt(a);
450
- }
451
- /**
452
- * Returns the HTML element of the Grid component.
453
- */
454
- get element() {
455
- return this._element;
456
- }
457
- get document() {
458
- if (M)
459
- return this.element && this.element.ownerDocument || document;
460
- }
461
- get _header() {
462
- return this.headerRef.current;
463
- }
464
- get _gridId() {
465
- return this.props.id + "-role-element-id";
466
- }
467
- /**
468
- * @hidden
469
- */
470
- componentDidMount() {
471
- var c;
472
- this.props.columnVirtualization && !navigator.userAgent.match(Ht) && (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), de(this.getCachedScrollbarWidth());
473
- const a = Ye(this.element);
474
- this.isRtl = a, T.onComponentDidMount({
475
- scope: this.element || void 0,
476
- contextStateRef: this.contextStateRef,
477
- navigationStateRef: this.navigationStateRef
478
- }), this.isRtl && this.forceUpdate();
479
- const n = {
480
- rootMargin: "0px",
481
- threshold: 0.9
399
+ const a = {
400
+ id: "",
401
+ resizable: !0,
402
+ width: "32px",
403
+ title: " ",
404
+ declarationIndex: -1,
405
+ orderIndex: -1,
406
+ children: [],
407
+ parentIndex: -1,
408
+ depth: 0,
409
+ colSpan: 0,
410
+ rowSpan: 0,
411
+ left: 0,
412
+ right: 0,
413
+ index: 0,
414
+ rightBorder: !1,
415
+ ariaColumnIndex: 0,
416
+ isAccessible: !0
482
417
  };
483
- this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = M && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, n) || null, this.resizeObserver = M && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), (c = this.document) != null && c.body && this.resizeObserver && this.resizeObserver.observe(this.document.body);
484
- }
485
- /**
486
- * @hidden
487
- */
488
- getSnapshotBeforeUpdate() {
489
- return T.onGetSnapshotBeforeUpdate({
490
- document: this.document,
491
- contextStateRef: this.contextStateRef,
492
- navigationStateRef: this.navigationStateRef
493
- }), null;
494
- }
495
- /**
496
- * @hidden
497
- */
498
- componentDidUpdate() {
499
- this.resetTableWidth(), de(this.getCachedScrollbarWidth()), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), this.handleFocusInEditableRows(), T.onComponentDidUpdate({
500
- scope: this.element || void 0,
501
- contextStateRef: this.contextStateRef,
502
- navigationStateRef: this.navigationStateRef,
503
- focusFirst: this._focusFirst,
504
- newEditableRow: this._newEditableRow,
505
- singleEditRow: this._singleEditRow,
506
- lastActiveElement: this._lastActiveElement,
507
- navigatable: this.props.navigatable
508
- }), this._focusFirst = !1, this._newEditableRow = void 0;
509
- }
510
- /**
511
- * @hidden
512
- */
513
- componentWillUnmount() {
418
+ let l = 0;
419
+ t.expandField && t.onExpandChange && t.detail && (e.unshift({
420
+ ...a,
421
+ cell: On,
422
+ field: t.expandField,
423
+ headerClassName: b(m.hierarchyCell({}))
424
+ }), l++);
425
+ for (let i = 0; i < n; i++)
426
+ e.unshift({
427
+ ...a,
428
+ isAccessible: !1,
429
+ cell: Et,
430
+ field: "value",
431
+ locked: t.lockGroups
432
+ }), l++;
433
+ e.slice(l).forEach((i) => i.parentIndex >= 0 && (i.parentIndex += l));
434
+ }, pt = (e) => {
435
+ const n = s.current.find((l) => l.field === e), a = n && (n.title || n.field);
436
+ return a === void 0 ? e : a;
437
+ }, en = () => ({
438
+ filter: t.filter,
439
+ sort: t.sort,
440
+ skip: t.skip,
441
+ take: t.take !== void 0 ? t.take : t.pageSize,
442
+ group: t.group
443
+ }), v = (e) => ({
444
+ nativeEvent: e && e.nativeEvent,
445
+ syntheticEvent: e,
446
+ target: w.current
447
+ }), re = () => R.current.filter((e) => e.rowType === "data").map((e) => e.dataItem), Le = () => (le.current || R.current).filter((e) => e.rowType === "data").map((e) => e.dataItem), tn = () => {
448
+ var e, n, a;
449
+ if (U.current && ((e = U.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
450
+ ye.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? ve.current = document.activeElement : ve.current = void 0;
451
+ const l = Array.from((a = U.current) == null ? void 0 : a.getElementsByClassName("k-grid-edit-row"));
452
+ l.length > ke.current.length ? oe.current = l.filter(
453
+ (i) => !ke.current.includes(i)
454
+ )[0] : l.length === 1 && (oe.current = l[0], ye.current = !0), ke.current = l;
455
+ }
456
+ }, g = r.useRef(), S = r.useRef(), D = r.useRef(), ae = r.useRef(), c = r.useRef(), C = r.useRef(), z = r.useRef(null), R = r.useRef([]), le = r.useRef(), s = r.useRef([]), M = r.useRef([[]]), Re = r.useRef(!1), Ce = r.useRef(!1), oe = r.useRef(), ve = r.useRef(), ye = r.useRef(!1), ce = r.useRef(!0), we = r.useRef(), Ee = r.useRef(0), Ie = r.useRef(), Se = r.useRef(), ke = r.useRef([]), W = r.useRef(null), O = r.useRef(null), Ve = r.useRef(null), k = r.useRef(null), y = r.useRef(null), _ = r.useRef(null), U = r.useRef(null), ie = r.useRef(null), nn = _n(), xe = vn(), m = xe && xe.uGrid ? xe.uGrid : yn, rn = wn(St), N = En(k);
457
+ r.useMemo(() => {
458
+ K.onConstructor({
459
+ navigatable: !!t.navigatable,
460
+ contextStateRef: S,
461
+ navigationStateRef: D,
462
+ idPrefix: T()
463
+ });
464
+ }, []), r.useMemo(() => {
514
465
  var a;
515
- clearTimeout(this.forceUpdateTimeout), this.clipboardService && this.clipboardService.removeEventListeners(this.document), (a = this.document) != null && a.body && this.resizeObserver && this.resizeObserver.disconnect();
516
- }
517
- /**
518
- * @hidden
519
- */
520
- render() {
521
- var ae;
522
- let a = this.props.total || 0;
523
- const n = D.getIdPrefix(this.navigationStateRef), c = pt(this), { unstyled: e, size: t = "medium" } = this.props, s = e && e.uGrid ? e.uGrid : he;
524
- let l = [];
525
- Array.isArray(this.props.data) ? (l = this.props.data, a = a || this.props.data.length) : this.props.data && (l = this.props.data.data, a = a || this.props.data.total);
526
- const d = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", p = this.props.scrollable === "virtual", { resolvedGroupsCount: h, flattedData: g } = this.flatData(
527
- l,
528
- d,
529
- this.props.skip || 0,
530
- this.props.group,
531
- this.props.expandField,
532
- this.props.filter,
533
- this.props.sort
534
- );
535
- this._data = g;
536
- const v = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
537
- this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = v;
538
- const z = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
539
- this.initializeVirtualization(a, v);
540
- const E = this.childrenToArray(this.props.children);
541
- this.initColumns(E, h);
542
- const G = E.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), O = E.filter(
543
- (i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"
544
- ), j = E.filter(
545
- (i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"
546
- ), R = this._columns.filter((i) => i.children.length === 0), q = v && /* @__PURE__ */ r.createElement(
547
- ht,
548
- {
549
- group: this.props.group || [],
550
- groupChange: this.groupChange,
551
- pressHandler: this.dragLogic.pressHandler,
552
- dragHandler: this.dragLogic.dragHandler,
553
- releaseHandler: this.dragLogic.releaseHandler,
554
- refCallback: this.dragLogic.refGroupPanelDiv,
555
- resolveTitle: this.resolveTitle,
556
- ariaControls: this._gridId,
557
- onContextMenu: this.onContextMenu
466
+ (a = c.current) == null || a.reset();
467
+ const e = t.groupable === !0 || typeof t.groupable == "object" && t.groupable.enabled !== !1, n = Dt();
468
+ c.current = new n(e || t.rowHeight === void 0 || t.rowHeight === 0);
469
+ }, [t.scrollable, t.total, t.filter, t.group, t.groupable, t.sort, t.rowHeight]), r.useEffect(() => (t.clipboard && (ae.current = new Tn($t), ae.current.addEventListeners(A())), () => {
470
+ ae.current && ae.current.removeEventListeners(A());
471
+ }), [t.onClipboard, t.clipboard]), r.useMemo(() => {
472
+ C.current = new qn(qt);
473
+ }, [t.onColumnResize]), r.useMemo(() => {
474
+ g.current = new Jn(he, _t, Ke);
475
+ }, [t.onColumnReorder, t.onGroupChange, t.group, t.groupable]), r.useEffect(() => (t.columnVirtualization && !window.navigator.userAgent.match(ir) && (ie.current && (ie.current.style.display = "block"), y.current && (y.current.style.display = "block")), be(), ct(p()), K.onComponentDidMount({
476
+ scope: k.current || void 0,
477
+ contextStateRef: S,
478
+ navigationStateRef: D
479
+ }), () => {
480
+ clearTimeout(Ie.current);
481
+ }), []), r.useEffect(() => {
482
+ var e;
483
+ be(), ct(p()), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""), tn(), K.onComponentDidUpdate({
484
+ scope: k.current || void 0,
485
+ contextStateRef: S,
486
+ navigationStateRef: D,
487
+ focusFirst: Ce.current,
488
+ newEditableRow: oe.current,
489
+ singleEditRow: ye.current,
490
+ lastActiveElement: ve.current,
491
+ navigatable: t.navigatable
492
+ }), Ce.current = !1, oe.current = void 0;
493
+ }), r.useEffect(() => {
494
+ if (Q) {
495
+ const e = {
496
+ rootMargin: "0px",
497
+ threshold: 0.9
498
+ };
499
+ z.current = window.IntersectionObserver && new window.IntersectionObserver(Fe, e) || null;
500
+ }
501
+ }, [Fe]), r.useEffect(() => {
502
+ let e;
503
+ return Q && window.ResizeObserver && (e = new window.ResizeObserver(Tt), e.observe(k.current)), () => {
504
+ e == null || e.disconnect();
505
+ };
506
+ }, []);
507
+ const w = r.useRef(null);
508
+ r.useImperativeHandle(
509
+ w,
510
+ () => ({
511
+ get element() {
512
+ return Z();
513
+ },
514
+ props: t,
515
+ get columns() {
516
+ return V();
517
+ },
518
+ scrollIntoView: (e) => {
519
+ var l;
520
+ if (!((l = c.current) != null && l.container) || t.scrollable === "none")
521
+ return;
522
+ const { rowIndex: n } = e;
523
+ Se.current = n;
524
+ const a = Z();
525
+ if (z.current && a) {
526
+ z.current.disconnect();
527
+ const i = a.querySelector(`[absolute-row-index="${Se.current}"]`);
528
+ i ? z.current.observe(i) : fe(e);
529
+ }
530
+ },
531
+ fitColumns: (e) => {
532
+ C.current.dblClickHandler(null, e);
558
533
  }
559
- ), {
560
- sort: _e,
561
- sortable: xe,
562
- group: ke,
563
- filter: Te,
564
- filterable: De,
565
- filterOperators: He = Se,
566
- headerCellRender: ze,
567
- columnMenu: Ae,
568
- columnMenuIcon: Fe
569
- } = this.props, J = /* @__PURE__ */ r.createElement(
570
- at,
571
- {
572
- size: t,
573
- columnResize: this.columnResize,
574
- staticHeaders: this.props.scrollable !== "none",
575
- scrollableDataElement: () => this.vs.container,
576
- hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
577
- draggable: this.props.reorderable || v,
578
- ref: this.headerRef,
579
- elemRef: this.headerElementRef,
580
- headerRow: this.getHeaderRow(
581
- _e,
582
- xe,
583
- ke,
584
- v,
585
- Te,
586
- De,
587
- He,
588
- ze,
589
- Ae,
590
- Fe,
591
- this._columns,
592
- this._columnsMap,
593
- this.isRtl
594
- ),
595
- filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
596
- nt,
534
+ })
535
+ ), r.useImperativeHandle(xt, () => w.current);
536
+ let F = t.total || 0;
537
+ const $ = L.getIdPrefix(D), { size: x = "medium" } = t;
538
+ let He = [];
539
+ Array.isArray(t.data) ? (He = t.data, F = F || t.data.length) : t.data && (He = t.data.data, F = F || t.data.total);
540
+ const an = typeof t.groupable == "object" && t.groupable.footer || "none", j = t.scrollable === "virtual", { resolvedGroupsCount: ln, flattedData: on } = Jt(
541
+ He,
542
+ an,
543
+ t.skip || 0,
544
+ t.group,
545
+ t.expandField
546
+ );
547
+ R.current = on;
548
+ const q = t.groupable === !0 || typeof t.groupable == "object" && t.groupable.enabled !== !1;
549
+ C.current.resizable = t.resizable || !1, g.current.reorderable = t.reorderable || !1, g.current.groupable = q;
550
+ const cn = t.selectable && t.selectable.drag ? "none" : void 0;
551
+ Nt(F, q), Qt(B, ln);
552
+ const Be = B.map((e) => e && e.type && e.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(e, { ...e.props, ariaControls: T() }) : null), We = B.filter(
553
+ (e) => e && e.type && e.type.displayName === "KendoReactGridNoRecords"
554
+ ), _e = B.filter(
555
+ (e) => e && e.type && e.type.displayName === "KendoReactGridStatusBar"
556
+ ), H = s.current.filter((e) => e.children.length === 0), Ue = q && /* @__PURE__ */ r.createElement(
557
+ Bn,
558
+ {
559
+ group: t.group || [],
560
+ groupChange: te,
561
+ pressHandler: g.current.pressHandler,
562
+ dragHandler: g.current.dragHandler,
563
+ releaseHandler: g.current.releaseHandler,
564
+ refCallback: g.current.refGroupPanelDiv,
565
+ resolveTitle: pt,
566
+ ariaControls: T(),
567
+ onContextMenu: me
568
+ }
569
+ ), $e = /* @__PURE__ */ r.createElement(
570
+ Kn,
571
+ {
572
+ size: x,
573
+ columnResize: C.current,
574
+ staticHeaders: t.scrollable !== "none",
575
+ scrollableDataElement: () => {
576
+ var e;
577
+ return ((e = c.current) == null ? void 0 : e.container) || null;
578
+ },
579
+ hasScrollbarWidth: !!p(),
580
+ draggable: t.reorderable || q,
581
+ ref: O,
582
+ elemRef: Ve,
583
+ headerRow: /* @__PURE__ */ r.createElement(
584
+ Ln,
585
+ {
586
+ cells: t.cells,
587
+ sort: t.sort,
588
+ sortable: t.sortable,
589
+ sortChange: Wt,
590
+ group: t.group || [],
591
+ groupable: q,
592
+ groupChange: te,
593
+ filter: t.filter,
594
+ filterable: t.filterable,
595
+ filterOperators: t.filterOperators || It,
596
+ filterChange: Pe,
597
+ columnMenu: t.columnMenu,
598
+ columnMenuIcon: t.columnMenuIcon,
599
+ selectionChange: Pt,
600
+ columns: s.current,
601
+ columnResize: C.current,
602
+ pressHandler: g.current.pressHandler,
603
+ dragHandler: g.current.dragHandler,
604
+ releaseHandler: g.current.releaseHandler,
605
+ columnsMap: M.current,
606
+ cellRender: t.headerCellRender,
607
+ isRtl: N === "rtl",
608
+ dragClue: g.current.dragClueRef,
609
+ headerRef: Ve,
610
+ containerRef: _,
611
+ navigatable: !!t.navigatable,
612
+ columnGroupChange: Ut
613
+ }
614
+ ),
615
+ filterRow: t.filterable && /* @__PURE__ */ r.createElement(
616
+ Vn,
617
+ {
618
+ cells: t.cells,
619
+ size: x,
620
+ columns: s.current,
621
+ filter: t.filter,
622
+ filterOperators: t.filterOperators || It,
623
+ filterChange: Pe,
624
+ sort: t.sort,
625
+ cellRender: t.filterCellRender,
626
+ isRtl: N === "rtl",
627
+ navigatable: !!t.navigatable,
628
+ ariaRowIndex: M.current.length + 1
629
+ }
630
+ ) || void 0,
631
+ cols: H.map((e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width: Ne(e) }))
632
+ }
633
+ ), dn = c.current && c.current.container && c.current.container.scrollLeft || 0, un = parseFloat(((t.style || {}).width || "").toString()), { colSpans: sn, hiddenColumns: fn } = Dn({
634
+ enabled: t.columnVirtualization,
635
+ columns: H,
636
+ tableViewPortWidth: un,
637
+ scrollLeft: dn
638
+ }), gn = (e, n, a, l) => {
639
+ let i = !1;
640
+ const u = t.selectedField ? wt(t.selectedField, e.dataItem) : void 0;
641
+ return {
642
+ row: H.map((d, h) => {
643
+ if (fn[h])
644
+ return null;
645
+ const E = d.id ? d.id : h, f = b(m.contentSticky({ locked: d.locked }), d.className), P = d.left !== void 0 ? N !== "rtl" ? { left: d.left, right: d.right } : { left: d.right, right: d.left } : {};
646
+ let X = !1;
647
+ if (d.editable && t.editField) {
648
+ const I = wt(t.editField, e.dataItem);
649
+ I && (I === !0 || I === d.field) && (i = !0, X = !0);
650
+ }
651
+ const G = d.cell || X && Pn || er, De = t.expandField && t.detail && d.field === t.expandField;
652
+ return /* @__PURE__ */ r.createElement(
653
+ G,
597
654
  {
598
- cells: this.props.cells,
599
- size: t,
600
- columns: this._columns,
601
- filter: this.props.filter,
602
- filterOperators: this.props.filterOperators || Se,
603
- filterChange: this.filterChange,
604
- sort: this.props.sort,
605
- cellRender: this.props.filterCellRender,
606
- isRtl: this.isRtl,
607
- navigatable: !!this.props.navigatable,
608
- ariaRowIndex: this._columnsMap.length + 1
609
- }
610
- ) || void 0,
611
- cols: R.map((i, f) => /* @__PURE__ */ r.createElement("col", { key: f.toString(), width: U(i) }))
612
- }
613
- ), Ne = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, Le = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: Me, hiddenColumns: Ge } = Qe({
614
- enabled: this.props.columnVirtualization,
615
- columns: R,
616
- tableViewPortWidth: Le,
617
- scrollLeft: Ne
618
- }), Oe = (i, f, b, F) => {
619
- let k = !1;
620
- const S = this.props.selectedField ? ye(this.props.selectedField, i.dataItem) : void 0;
621
- return {
622
- row: R.map((u, C) => {
623
- if (Ge[C])
624
- return null;
625
- const N = u.id ? u.id : C, w = m(
626
- s.contentSticky({ locked: u.locked }),
627
- u.className
628
- ), I = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
629
- let K = !1;
630
- if (u.editable && this.props.editField) {
631
- const x = ye(this.props.editField, i.dataItem);
632
- x && (x === !0 || x === u.field) && (k = !0, K = !0);
655
+ onContextMenu: me,
656
+ key: E,
657
+ locked: t.lockGroups,
658
+ id: L.generateNavigatableId(
659
+ `${n}-${String(h)}`,
660
+ $,
661
+ De || e.rowType === "groupHeader" || e.rowType === "groupFooter" || d.field === "value" ? "nodata" : "cell"
662
+ ),
663
+ colSpan: sn[h],
664
+ dataItem: e.dataItem,
665
+ field: d.field,
666
+ editor: d.editor,
667
+ format: d.format,
668
+ className: f,
669
+ render: t.cellRender,
670
+ cells: Zn(t.cells, d.cells),
671
+ onChange: Mt,
672
+ selectionChange: t.onSelectionChange ? (I) => {
673
+ Ot({
674
+ event: I,
675
+ dataItem: e.dataItem,
676
+ dataIndex: a,
677
+ columnIndex: h
678
+ });
679
+ } : void 0,
680
+ columnIndex: h,
681
+ columnsCount: H.length,
682
+ rowType: e.rowType,
683
+ level: e.level,
684
+ expanded: e.expanded,
685
+ dataIndex: e.dataIndex,
686
+ style: P,
687
+ ariaColumnIndex: d.ariaColumnIndex,
688
+ isSelected: Array.isArray(u) && u.indexOf(h) > -1,
689
+ isSorted: !!Ct(d.field, t.sort),
690
+ isAlt: l
633
691
  }
634
- const L = u.cell || K && rt || Et, _ = this.props.expandField && this.props.detail && u.field === this.props.expandField;
635
- return /* @__PURE__ */ r.createElement(
636
- L,
637
- {
638
- onContextMenu: this.onContextMenu,
639
- key: N,
640
- locked: this.props.lockGroups,
641
- id: D.generateNavigatableId(
642
- `${f}-${String(C)}`,
643
- n,
644
- _ || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
645
- ),
646
- colSpan: Me[C],
647
- dataItem: i.dataItem,
648
- field: u.field,
649
- editor: u.editor,
650
- format: u.format,
651
- className: w,
652
- render: this.props.cellRender,
653
- cells: yt(this.props.cells, u.cells),
654
- onChange: this.itemChange,
655
- selectionChange: this.props.onSelectionChange ? (x) => {
656
- this.selectionChange({
657
- event: x,
658
- dataItem: i.dataItem,
659
- dataIndex: b,
660
- columnIndex: C
661
- });
662
- } : void 0,
663
- columnIndex: C,
664
- columnsCount: R.length,
665
- rowType: i.rowType,
666
- level: i.level,
667
- expanded: i.expanded,
668
- dataIndex: i.dataIndex,
669
- style: I,
670
- ariaColumnIndex: u.ariaColumnIndex,
671
- isSelected: Array.isArray(S) && S.indexOf(C) > -1,
672
- isSorted: !!we(u.field, this.props.sort),
673
- isAlt: F
674
- }
675
- );
676
- }),
677
- isInEdit: k,
678
- isSelected: typeof S == "boolean" && S
679
- };
692
+ );
693
+ }),
694
+ isInEdit: i,
695
+ isSelected: typeof u == "boolean" && u
680
696
  };
681
- let X = 0;
682
- if (p)
683
- for (let i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {
684
- const f = this._data.shift();
685
- if (f)
686
- this._data.push(f), X++, f.rowType === "groupHeader" && i--;
687
- else
688
- break;
689
- }
690
- const Y = (i) => i >= this._data.length - X;
691
- let Q = this.vs.realSkip || 0;
692
- const P = [];
693
- let B = !1;
694
- const Z = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
695
- let A = 0;
696
- if (this._data.length) {
697
- let i = -1, f = 0;
698
- (this._slicedData || this._data).forEach((b, F) => {
699
- b.rowType === "data" && (Q++, i++);
700
- const k = Q % 2 === 0, S = this.props.dataItemKey && je(this.props.dataItemKey)(b.dataItem), u = F + (this.vs.realSkip || 0), C = S || "ai" + u, N = C + "_1", w = Oe(b, C, i, k);
701
- if (A = u + Z + f, P.push(
697
+ };
698
+ let je = 0;
699
+ if (j && c.current)
700
+ for (let e = 0; e < c.current.topCacheCount + c.current.attendedSkip - (t.skip || 0); e++) {
701
+ const n = R.current.shift();
702
+ if (n)
703
+ R.current.push(n), je++, n.rowType === "groupHeader" && e--;
704
+ else
705
+ break;
706
+ }
707
+ const qe = (e) => e >= R.current.length - je;
708
+ let Je = ((nt = c.current) == null ? void 0 : nt.realSkip) || 0;
709
+ const de = [];
710
+ let Te = !1;
711
+ const Xe = M.current.length + (t.filterable ? 1 : 0) + 1;
712
+ let J = 0;
713
+ if (R.current.length) {
714
+ let e = -1, n = 0;
715
+ (le.current || R.current).forEach((a, l) => {
716
+ var P, X;
717
+ a.rowType === "data" && (Je++, e++);
718
+ const i = Je % 2 === 0, u = t.dataItemKey && In(t.dataItemKey)(a.dataItem), d = l + (((P = c.current) == null ? void 0 : P.realSkip) || 0), h = u || "ai" + d, E = h + "_1", f = gn(a, h, e, i);
719
+ if (J = d + Xe + n, de.push(
720
+ /* @__PURE__ */ r.createElement(
721
+ tr,
722
+ {
723
+ key: h,
724
+ dataItem: a.dataItem,
725
+ isAltRow: i,
726
+ isInEdit: f.isInEdit,
727
+ rowType: a.rowType,
728
+ isHidden: qe(l),
729
+ onClick: (G) => At(G, a),
730
+ onDoubleClick: (G) => zt(G, a),
731
+ selectedField: t.selectedField,
732
+ rowHeight: t.rowHeight,
733
+ render: t.rowRender,
734
+ ariaRowIndex: J,
735
+ absoluteRowIndex: d,
736
+ dataIndex: (X = c.current) != null && X.scrollableVirtual && !t.groupable ? d : e,
737
+ isSelected: f.isSelected
738
+ },
739
+ f.row
740
+ )
741
+ ), t.detail && a.rowType === "data" && a.expanded) {
742
+ const G = H.length - (t.expandField ? 1 : 0) - (t.group ? t.group.length : 0) || 1;
743
+ n++, J = d + Xe + n, de.push(
702
744
  /* @__PURE__ */ r.createElement(
703
- St,
745
+ "tr",
704
746
  {
705
- key: C,
706
- dataItem: b.dataItem,
707
- isAltRow: k,
708
- isInEdit: w.isInEdit,
709
- rowType: b.rowType,
710
- isHidden: Y(F),
711
- onClick: (I) => this.rowClick(I, b),
712
- onDoubleClick: (I) => this.rowDblClick(I, b),
713
- selectedField: this.props.selectedField,
714
- rowHeight: this.props.rowHeight,
715
- render: this.props.rowRender,
716
- ariaRowIndex: A,
717
- absoluteRowIndex: u,
718
- dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? u : i,
719
- isSelected: w.isSelected
720
- },
721
- w.row
722
- )
723
- ), this.props.detail && b.rowType === "data" && b.expanded) {
724
- const I = R.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
725
- f++, A = u + Z + f, P.push(
726
- /* @__PURE__ */ r.createElement(
727
- "tr",
728
- {
729
- key: N,
730
- className: m(s.detailTr({ isAlt: k })),
731
- style: {
732
- visibility: Y(F) ? "hidden" : "",
733
- height: this.props.detailRowHeight
734
- },
735
- role: "row",
736
- "aria-rowindex": A
747
+ key: E,
748
+ className: b(m.detailTr({ isAlt: i })),
749
+ style: {
750
+ visibility: qe(l) ? "hidden" : "",
751
+ height: t.detailRowHeight
737
752
  },
738
- this.props.group && this.props.group.map((K, L) => {
739
- var le;
740
- const _ = (le = w == null ? void 0 : w.row[L]) == null ? void 0 : le.props.style, x = _ ? this.isRtl ? { left: _.right, right: _.left } : { left: _.left, right: _.right } : {};
741
- return /* @__PURE__ */ r.createElement(
742
- Ee,
743
- {
744
- id: "",
745
- dataIndex: b.dataIndex,
746
- field: K.field,
747
- dataItem: b.dataItem,
748
- key: L,
749
- style: x,
750
- ariaColumnIndex: 1 + L,
751
- isSelected: !1,
752
- locked: this.props.lockGroups,
753
- isRtl: this.isRtl,
754
- cells: this.props.cells
755
- }
756
- );
757
- }),
758
- this.props.expandField && /* @__PURE__ */ r.createElement(
759
- Dt,
760
- {
761
- id: D.generateNavigatableId(`${N}-dhcell`, n)
762
- }
763
- ),
764
- /* @__PURE__ */ r.createElement(
765
- Tt,
753
+ role: "row",
754
+ "aria-rowindex": J
755
+ },
756
+ t.group && t.group.map((De, I) => {
757
+ var ot;
758
+ const Y = (ot = f == null ? void 0 : f.row[I]) == null ? void 0 : ot.props.style, bn = Y ? N !== "rtl" ? { left: Y.left, right: Y.right } : { left: Y.right, right: Y.left } : {};
759
+ return /* @__PURE__ */ r.createElement(
760
+ Et,
766
761
  {
767
- onContextMenu: this.onContextMenu,
768
- dataItem: b.dataItem,
769
- dataIndex: b.dataIndex,
770
- colSpan: I,
771
- ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
772
- detail: this.props.detail,
773
- id: D.generateNavigatableId(`${N}-dcell`, n)
762
+ id: "",
763
+ dataIndex: a.dataIndex,
764
+ field: De.field,
765
+ dataItem: a.dataItem,
766
+ key: I,
767
+ style: bn,
768
+ ariaColumnIndex: 1 + I,
769
+ isSelected: !1,
770
+ locked: t.lockGroups,
771
+ isRtl: N === "rtl",
772
+ cells: t.cells
774
773
  }
775
- )
774
+ );
775
+ }),
776
+ t.expandField && /* @__PURE__ */ r.createElement(
777
+ cr,
778
+ {
779
+ id: L.generateNavigatableId(`${E}-dhcell`, $)
780
+ }
781
+ ),
782
+ /* @__PURE__ */ r.createElement(
783
+ or,
784
+ {
785
+ onContextMenu: me,
786
+ dataItem: a.dataItem,
787
+ dataIndex: a.dataIndex,
788
+ colSpan: G,
789
+ ariaColIndex: 2 + (t.group ? t.group.length : 0),
790
+ detail: t.detail,
791
+ id: L.generateNavigatableId(`${E}-dcell`, $)
792
+ }
776
793
  )
777
- );
794
+ )
795
+ );
796
+ }
797
+ });
798
+ } else
799
+ Te = !0;
800
+ const mn = () => {
801
+ const e = O.current;
802
+ return e && e.table() && e.table().clientWidth;
803
+ }, Ye = () => /* @__PURE__ */ r.createElement("div", { key: "no-records", className: b(m.noRecords({})), style: { width: mn() } }, /* @__PURE__ */ r.createElement(
804
+ "div",
805
+ {
806
+ className: b(m.noRecordsTemplate({})),
807
+ [zn]: L.generateNavigatableId("no-records", $)
808
+ },
809
+ We.length ? We : /* @__PURE__ */ r.createElement(rr, null)
810
+ )), Qe = {
811
+ size: x,
812
+ onPageChange: Bt,
813
+ total: F,
814
+ dir: N,
815
+ skip: ((rt = c.current) == null ? void 0 : rt.propsSkip) || 0,
816
+ take: (t.take !== void 0 ? t.take : t.pageSize) || 10,
817
+ messagesMap: Un,
818
+ ...lr(t.pageable || {})
819
+ }, Ze = t.pager ? /* @__PURE__ */ r.createElement(t.pager, { ...Qe }) : /* @__PURE__ */ r.createElement(Nn, { className: b(m.pager({})), ...Qe }), hn = (e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width: Ne(e) }), pe = (at = t.cells) != null && at.footerCell || s.current.some((e) => {
820
+ var n;
821
+ return !!(e.footerCell || (n = e.cells) != null && n.footerCell);
822
+ }) ? /* @__PURE__ */ r.createElement(
823
+ Wn,
824
+ {
825
+ size: x,
826
+ columnResize: C.current,
827
+ staticHeaders: t.scrollable !== "none",
828
+ hasScrollbarWidth: !!p(),
829
+ ref: W,
830
+ row: /* @__PURE__ */ r.createElement(
831
+ ar,
832
+ {
833
+ cells: t.cells,
834
+ idPrefix: $,
835
+ columns: s.current,
836
+ isRtl: N === "rtl",
837
+ ariaRowIndex: J + 1
778
838
  }
779
- });
780
- } else
781
- B = !0;
782
- const Pe = () => {
783
- const i = this._header;
784
- return i && i.table && i.table.clientWidth;
785
- }, ee = () => /* @__PURE__ */ r.createElement("div", { key: "no-records", className: m(s.noRecords({})), style: { width: Pe() } }, /* @__PURE__ */ r.createElement(
839
+ ),
840
+ cols: H.map(hn)
841
+ }
842
+ ) : null, et = /* @__PURE__ */ r.createElement(
843
+ "colgroup",
844
+ {
845
+ ref: (e) => {
846
+ C.current.colGroupMain = e;
847
+ }
848
+ },
849
+ H.map((e, n) => /* @__PURE__ */ r.createElement(
850
+ "col",
851
+ {
852
+ key: n.toString(),
853
+ className: Ct(e.field, t.sort) ? b(m.sorted({})) : void 0,
854
+ width: Ne(e)
855
+ }
856
+ ))
857
+ ), tt = g.current.reorderable || g.current.groupable;
858
+ if (t.scrollable === "none")
859
+ return /* @__PURE__ */ r.createElement(dt.Provider, { value: S.current }, /* @__PURE__ */ r.createElement(
786
860
  "div",
787
861
  {
788
- className: m(s.noRecordsTemplate({})),
789
- [st]: D.generateNavigatableId("no-records", n)
862
+ id: t.id || se,
863
+ style: t.style,
864
+ className: b(m.wrapper({ size: x }), t.className),
865
+ ref: k,
866
+ "aria-label": t.ariaLabel,
867
+ onKeyDown: ze,
868
+ onFocus: Me,
869
+ ...ut
790
870
  },
791
- O.length ? O : /* @__PURE__ */ r.createElement(_t, null)
792
- )), te = {
793
- size: t,
794
- onPageChange: this.pagerPageChange,
795
- total: a,
796
- dir: this.isRtl ? "rtl" : void 0,
797
- skip: this.vs.propsSkip || 0,
798
- take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
799
- messagesMap: ut,
800
- ...kt(this.props.pageable || {})
801
- }, se = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...te }) : /* @__PURE__ */ r.createElement(Ze, { className: m(s.pager({})), ...te }), We = (i, f) => /* @__PURE__ */ r.createElement("col", { key: f.toString(), width: U(i) }), ie = (ae = this.props.cells) != null && ae.footerCell || this._columns.some((i) => {
802
- var f;
803
- return !!(i.footerCell || (f = i.cells) != null && f.footerCell);
804
- }) ? /* @__PURE__ */ r.createElement(
805
- dt,
806
- {
807
- size: t,
808
- columnResize: this.columnResize,
809
- staticHeaders: this.props.scrollable !== "none",
810
- hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
811
- ref: (i) => this._footer = i,
812
- row: /* @__PURE__ */ r.createElement(
813
- xt,
814
- {
815
- cells: this.props.cells,
816
- idPrefix: n,
817
- columns: this._columns,
818
- isRtl: this.isRtl,
819
- ariaRowIndex: A + 1
871
+ Be,
872
+ Ue,
873
+ /* @__PURE__ */ r.createElement(
874
+ st,
875
+ {
876
+ selectable: t.selectable,
877
+ onRelease: Oe,
878
+ childRef: (e) => {
879
+ y.current = e, ie.current = e;
820
880
  }
821
- ),
822
- cols: R.map(We)
823
- }
824
- ) : null, oe = /* @__PURE__ */ r.createElement(
825
- "colgroup",
881
+ },
882
+ /* @__PURE__ */ r.createElement("table", { ref: ie, className: b(m.table({ size: x })) }, et, $e, /* @__PURE__ */ r.createElement(
883
+ "tbody",
884
+ {
885
+ role: "rowgroup",
886
+ className: b(m.tbody({})),
887
+ ...ft
888
+ },
889
+ de
890
+ ), pe)
891
+ ),
892
+ Te && Ye(),
893
+ tt && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gt, { ref: g.current.refDropElementClue }), /* @__PURE__ */ r.createElement(mt, { ref: g.current.refDragElementClue }))
894
+ ), _e, t.pageable && Ze);
895
+ let ue = t.style || {};
896
+ return j && (ue.height || (ue = Object.assign({}, ue, { height: "450px" }))), /* @__PURE__ */ r.createElement(dt.Provider, { value: S.current }, /* @__PURE__ */ r.createElement(
897
+ "div",
898
+ {
899
+ id: t.id || se,
900
+ style: ue,
901
+ className: b(
902
+ m.wrapper({
903
+ size: x,
904
+ virtual: j
905
+ }),
906
+ t.className
907
+ ),
908
+ ref: k,
909
+ "aria-label": t.ariaLabel,
910
+ onKeyDown: ze,
911
+ onFocus: Me,
912
+ ...ut
913
+ },
914
+ Be,
915
+ Ue,
916
+ /* @__PURE__ */ r.createElement(
917
+ "div",
826
918
  {
827
- ref: (i) => {
828
- this.columnResize.colGroupMain = i;
829
- }
919
+ className: b(m.ariaRoot({})),
920
+ role: "grid",
921
+ "aria-colcount": H.length,
922
+ "aria-rowcount": F,
923
+ id: T(),
924
+ "aria-label": nn.toLanguageString(bt, $n[bt])
830
925
  },
831
- R.map((i, f) => /* @__PURE__ */ r.createElement(
832
- "col",
833
- {
834
- key: f.toString(),
835
- className: we(i.field, this.props.sort) ? m(s.sorted({})) : void 0,
836
- width: U(i)
837
- }
838
- ))
839
- ), re = this.dragLogic.reorderable || this.dragLogic.groupable;
840
- if (this.props.scrollable === "none")
841
- return /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
926
+ $e,
927
+ /* @__PURE__ */ r.createElement("div", { className: b(m.container({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
842
928
  "div",
843
929
  {
844
- id: this.props.id,
845
- style: this.props.style,
846
- className: m(s.wrapper({ size: t }), this.props.className),
847
- ref: (i) => {
848
- this._element = i;
849
- },
850
- "aria-label": this.props.ariaLabel,
851
- onKeyDown: this.onKeyDown,
852
- onFocus: this.onFocus,
853
- ...ce
930
+ ref: _,
931
+ className: b(m.content({})),
932
+ onScroll: Ft,
933
+ role: "presentation"
854
934
  },
855
- G,
856
- q,
857
- /* @__PURE__ */ r.createElement(
858
- ue,
935
+ /* @__PURE__ */ r.createElement("div", { className: b(m.tableWrap({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
936
+ st,
859
937
  {
860
- selectable: this.props.selectable,
861
- onRelease: this.selectionRelease,
862
- childRef: (i) => {
863
- this.tableElement = i, this.headTable = i;
938
+ selectable: t.selectable,
939
+ onRelease: Oe,
940
+ childRef: (e) => {
941
+ y.current = e;
864
942
  }
865
943
  },
866
944
  /* @__PURE__ */ r.createElement(
867
945
  "table",
868
946
  {
869
- ref: (i) => this.headTable = i,
870
- className: m(s.table({ size: t }))
947
+ ref: y,
948
+ className: b(
949
+ m.table({
950
+ size: x
951
+ })
952
+ ),
953
+ role: "presentation",
954
+ style: { userSelect: cn }
871
955
  },
872
- oe,
873
- J,
956
+ et,
874
957
  /* @__PURE__ */ r.createElement(
875
958
  "tbody",
876
959
  {
960
+ className: b(m.tbody({})),
961
+ ref: U,
877
962
  role: "rowgroup",
878
- className: m(s.tbody({})),
879
- ...ge
963
+ ...ft
880
964
  },
881
- P
882
- ),
883
- ie
965
+ de
966
+ )
884
967
  )
885
- ),
886
- B && ee(),
887
- re && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(fe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(me, { ref: this.dragLogic.refDragElementClue }))
888
- ), j, this.props.pageable && se);
889
- let W = this.props.style || {};
890
- return p && (W.height || (W = Object.assign({}, W, { height: "450px" }))), /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
891
- "div",
892
- {
893
- id: this.props.id,
894
- style: W,
895
- className: m(
896
- s.wrapper({
897
- size: t,
898
- virtual: p
899
- }),
900
- this.props.className
901
- ),
902
- ref: (i) => {
903
- this._element = i;
904
- },
905
- "aria-label": this.props.ariaLabel,
906
- onKeyDown: this.onKeyDown,
907
- onFocus: this.onFocus,
908
- ...ce
909
- },
910
- G,
911
- q,
912
- /* @__PURE__ */ r.createElement(
913
- "div",
914
- {
915
- className: m(s.ariaRoot({})),
916
- role: "grid",
917
- "aria-colcount": R.length,
918
- "aria-rowcount": a,
919
- id: this._gridId,
920
- "aria-label": c.toLanguageString(be, gt[be])
921
- },
922
- J,
923
- /* @__PURE__ */ r.createElement("div", { className: m(s.container({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
968
+ ), Te && Ye()),
969
+ j && /* @__PURE__ */ r.createElement("div", { className: b(m.heightContainer({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
924
970
  "div",
925
971
  {
926
- ref: this.containerRef,
927
- className: m(s.content({})),
928
- onScroll: this.scrollHandler,
929
- role: "presentation"
930
- },
931
- /* @__PURE__ */ r.createElement("div", { className: m(s.tableWrap({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
932
- ue,
933
- {
934
- selectable: this.props.selectable,
935
- onRelease: this.selectionRelease,
936
- childRef: (i) => {
937
- this.tableElement = i;
938
- }
939
- },
940
- /* @__PURE__ */ r.createElement(
941
- "table",
942
- {
943
- ref: (i) => this.tableElement = i,
944
- className: m(
945
- s.table({
946
- size: t
947
- })
948
- ),
949
- role: "presentation",
950
- style: { userSelect: z }
951
- },
952
- oe,
953
- /* @__PURE__ */ r.createElement(
954
- "tbody",
955
- {
956
- className: m(s.tbody({})),
957
- ref: this.tableBodyRef,
958
- role: "rowgroup",
959
- ...ge
960
- },
961
- P
962
- )
963
- )
964
- ), B && ee()),
965
- p && /* @__PURE__ */ r.createElement("div", { className: m(s.heightContainer({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
966
- "div",
967
- {
968
- style: p ? { height: this.vs.containerHeight + "px" } : {}
969
- }
970
- ))
971
- )),
972
- ie,
973
- re && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(fe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(me, { ref: this.dragLogic.refDragElementClue })),
974
- this.showLicenseWatermark && /* @__PURE__ */ r.createElement(qe, null)
975
- ),
976
- j,
977
- this.props.pageable && se
978
- ));
979
- }
980
- calculateMedia() {
981
- this.checkMatchMediaColumnsDifferece() || this.forceUpdate();
982
- }
983
- selectionChange(a) {
984
- if (this.props.onSelectionChange) {
985
- const { event: n, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: s, cell: l } = pe(this.props.selectable), d = {
986
- ...this.getArguments(n.syntheticEvent),
987
- dataItem: c,
988
- startColIndex: t,
989
- endColIndex: t,
990
- startRowIndex: e,
991
- endRowIndex: e,
992
- dataItems: this.getLeafDataItems(),
993
- altKey: !1,
994
- ctrlKey: !1,
995
- shiftKey: !1,
996
- metaKey: !1,
997
- mode: s,
998
- cell: l,
999
- isDrag: !1,
1000
- componentId: this._gridId,
1001
- selectedField: this.props.selectedField || ""
1002
- };
1003
- this.props.onSelectionChange.call(void 0, d);
1004
- }
1005
- }
1006
- raiseDataEvent(a, n, c, e, t) {
1007
- const s = this.props.onDataStateChange;
1008
- if (a) {
1009
- const l = { ...this.getArguments(e), ...n, targetEvent: t };
1010
- a.call(void 0, l);
1011
- } else
1012
- s && s.call(void 0, {
1013
- ...this.getArguments(e),
1014
- targetEvent: t || {},
1015
- dataState: {
1016
- ...this.getDataState(),
1017
- ...c
1018
- }
1019
- });
1020
- }
1021
- columnReorder(a, n, c) {
1022
- const e = this._columns[a], t = e.depth, s = (h) => {
1023
- do
1024
- h++;
1025
- while (h < this._columns.length && this._columns[h].depth > t);
1026
- return h;
1027
- }, l = this._columns.splice(a, s(a) - a);
1028
- this._columns.splice(a < n ? s(n - l.length) : n, 0, ...l), this._columns.filter((h) => h.declarationIndex >= 0).forEach((h, g) => h.orderIndex = g), this._columnsMutations++;
1029
- const d = this._columns[a].locked && this._columns[n].locked;
1030
- et(this._columnsMap, this._columns, d || this._shouldUpdateLeftRight), tt(this._columnsMap, this._columns, d || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
1031
- const p = this.columns;
1032
- if (this.forceUpdate(), this.props.onColumnReorder) {
1033
- const h = {
1034
- target: this,
1035
- columns: p,
1036
- columnId: e.id,
1037
- nativeEvent: c
1038
- };
1039
- this.props.onColumnReorder.call(void 0, h);
1040
- }
1041
- }
1042
- groupReorder(a, n, c) {
1043
- if (this.props.group === void 0)
1044
- return;
1045
- const e = this.props.group.slice();
1046
- e.splice(n, 0, ...e.splice(a, 1)), this.groupChange(e, c);
1047
- }
1048
- columnToGroup(a, n, c) {
1049
- const e = this._columns[a].field;
1050
- if (!e)
1051
- return;
1052
- const t = (this.props.group || []).slice();
1053
- t.splice(n, 0, { field: e }), this.groupChange(t, c);
1054
- }
1055
- columnGroupChange(a, n) {
1056
- const c = this.dragLogic.getCurrentGroupsLength;
1057
- this.columnToGroup(a, c, n);
1058
- }
1059
- resetTableWidth() {
1060
- let a = 0;
1061
- if (!this.columnResize.colGroupMain)
1062
- return;
1063
- const n = this.columnResize.colGroupMain.children;
1064
- for (let c = 0; c < n.length; c++) {
1065
- const e = n[c].width;
1066
- if (!e)
1067
- return;
1068
- a += parseFloat(e.toString());
1069
- }
1070
- a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
1071
- }
1072
- initColumns(a, n) {
1073
- const c = D.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = this.filterColumnsByMediaProp(e);
1074
- this._columns = t, this._columns.length === 0 && (this._columns = wt(this.props.data, this.props.group, this.props.expandField, {
1075
- prevId: 0,
1076
- idPrefix: c
1077
- })), this.configureColumns(this._columns, n, c), this._columnsMap = this.mapColumns(this._columns, this._columnsMutations), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
1078
- }
1079
- getDataState() {
1080
- return {
1081
- filter: this.props.filter,
1082
- sort: this.props.sort,
1083
- skip: this.props.skip,
1084
- take: this.props.take !== void 0 ? this.props.take : this.props.pageSize,
1085
- group: this.props.group
1086
- };
1087
- }
1088
- getArguments(a) {
1089
- return {
1090
- nativeEvent: a && a.nativeEvent,
1091
- syntheticEvent: a,
1092
- target: this
1093
- };
1094
- }
1095
- };
1096
- H.displayName = "KendoReactGrid", H.defaultProps = {
1097
- // never use this
1098
- }, H.propTypes = {
972
+ style: j ? { height: ((lt = c.current) == null ? void 0 : lt.containerHeight) + "px" } : {}
973
+ }
974
+ ))
975
+ )),
976
+ pe,
977
+ tt && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gt, { ref: g.current.refDropElementClue }), /* @__PURE__ */ r.createElement(mt, { ref: g.current.refDragElementClue })),
978
+ rn && /* @__PURE__ */ r.createElement(Sn, null)
979
+ ),
980
+ _e,
981
+ t.pageable && Ze
982
+ ));
983
+ }), dr = {
1099
984
  data: o.oneOfType([
1100
985
  o.array,
1101
986
  o.shape({
@@ -1171,9 +1056,9 @@ H.displayName = "KendoReactGrid", H.defaultProps = {
1171
1056
  })
1172
1057
  ]),
1173
1058
  size: o.oneOf(["small", "medium"])
1174
- }, H.contextType = V;
1175
- let $ = H;
1176
- ct($);
1059
+ };
1060
+ kt.displayName = "KendoReactGrid";
1061
+ kt.propTypes = dr;
1177
1062
  export {
1178
- $ as Grid
1063
+ kt as Grid
1179
1064
  };