@progress/kendo-react-grid 7.5.0-develop.7 → 7.5.0-develop.8
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.js +1 -1
- package/Grid.mjs +252 -252
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +7 -7
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
package/Grid.mjs
CHANGED
|
@@ -8,40 +8,40 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
10
|
import s from "prop-types";
|
|
11
|
-
import { dispatchEvent as
|
|
12
|
-
import { tableKeyboardNavigation as x, getSelectionOptions as
|
|
13
|
-
import { GridSelectionCell as
|
|
14
|
-
import { GridHierarchyCell as
|
|
15
|
-
import { GridEditCell as
|
|
16
|
-
import { Header as
|
|
17
|
-
import { HeaderRow as
|
|
18
|
-
import { FilterRow as
|
|
19
|
-
import { GroupPanel as
|
|
20
|
-
import { Footer as
|
|
21
|
-
import { provideLocalizationService as
|
|
22
|
-
import { pagerMessagesMap as
|
|
23
|
-
import { VirtualScroll as
|
|
24
|
-
import { VirtualScrollFixed as
|
|
25
|
-
import { ColumnResize as
|
|
26
|
-
import { CommonDragLogic as
|
|
27
|
-
import { firefox as
|
|
28
|
-
import { GridCell as
|
|
29
|
-
import { GridGroupCell as
|
|
30
|
-
import { GridRow as
|
|
31
|
-
import { GridHeaderSelectionCell as
|
|
32
|
-
import { GridNoRecords as
|
|
33
|
-
import { operators as
|
|
34
|
-
import { FooterRow as
|
|
35
|
-
import { normalize as
|
|
36
|
-
import { packageMetadata as
|
|
37
|
-
import { GridDetailCell as
|
|
38
|
-
import { GridDetailHierarchyCell as
|
|
11
|
+
import { dispatchEvent as Ke, canUseDOM as V, getActiveElement as Oe, memoizeOne as S, validatePackage as Pe, shouldShowValidationUI as Ve, setScrollbarWidth as ae, getter as Ue, classNames as F, kendoThemeMaps as G, WatermarkOverlay as We } from "@progress/kendo-react-common";
|
|
12
|
+
import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns as Be, ClipboardService as $e, TableKeyboardNavigationContext as U, isRtl as je, tableKeyboardNavigationTools as N, tableColumnsVirtualization as qe, Pager as Je, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Qe, updateRight as Xe } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GridSelectionCell as Ye } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as Ze } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridEditCell as et } from "./cells/GridEditCell.mjs";
|
|
16
|
+
import { Header as tt } from "./header/Header.mjs";
|
|
17
|
+
import { HeaderRow as st } from "./header/HeaderRow.mjs";
|
|
18
|
+
import { FilterRow as it } from "./header/FilterRow.mjs";
|
|
19
|
+
import { GroupPanel as ot } from "./header/GroupPanel.mjs";
|
|
20
|
+
import { Footer as rt } from "./footer/Footer.mjs";
|
|
21
|
+
import { provideLocalizationService as at, registerForLocalization as lt } from "@progress/kendo-react-intl";
|
|
22
|
+
import { pagerMessagesMap as nt, gridAriaLabel as ue, messages as ht } from "./messages/index.mjs";
|
|
23
|
+
import { VirtualScroll as pt } from "./VirtualScroll.mjs";
|
|
24
|
+
import { VirtualScrollFixed as ge, RowHeightService as me } from "./VirtualScrollFixed.mjs";
|
|
25
|
+
import { ColumnResize as dt } from "./drag/ColumnResize.mjs";
|
|
26
|
+
import { CommonDragLogic as ct } from "./drag/CommonDragLogic.mjs";
|
|
27
|
+
import { firefox as fe, firefoxMaxHeight as be, flatData as ut, readColumns as gt, sanitizeColumns as mt, getColumnWidth as W, autoGenerateColumns as ft, getNestedValue as ve, resolveCells as bt } from "./utils/index.mjs";
|
|
28
|
+
import { GridCell as vt } from "./cells/GridCell.mjs";
|
|
29
|
+
import { GridGroupCell as Ce } from "./cells/GridGroupCell.mjs";
|
|
30
|
+
import { GridRow as Ct } from "./rows/GridRow.mjs";
|
|
31
|
+
import { GridHeaderSelectionCell as Rt } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
+
import { GridNoRecords as yt } from "./GridNoRecords.mjs";
|
|
33
|
+
import { operators as Re } from "./filterCommon.mjs";
|
|
34
|
+
import { FooterRow as wt } from "./footer/FooterRow.mjs";
|
|
35
|
+
import { normalize as St } from "./paging/GridPagerSettings.mjs";
|
|
36
|
+
import { packageMetadata as ye } from "./package-metadata.mjs";
|
|
37
|
+
import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
|
|
38
|
+
import { GridDetailHierarchyCell as It } from "./cells/GridDetailHierarchyCell.mjs";
|
|
39
39
|
const _ = class _ extends r.Component {
|
|
40
40
|
constructor(a) {
|
|
41
41
|
super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = r.createRef(), this.headerElementRef = r.createRef(), this._element = null, this.tableElement = null, this.containerRef = r.createRef(), this.tableBodyRef = r.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.observer = null, this.handleIntersection = (e) => {
|
|
42
42
|
const t = { rowIndex: this.rowIndex };
|
|
43
|
-
e.forEach((
|
|
44
|
-
|
|
43
|
+
e.forEach((i) => {
|
|
44
|
+
i.isIntersecting || this.setCurrentOnTop(t);
|
|
45
45
|
});
|
|
46
46
|
}, this.setCurrentOnTop = (e) => {
|
|
47
47
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
@@ -51,35 +51,35 @@ const _ = class _ extends r.Component {
|
|
|
51
51
|
if (this.props.scrollable === "virtual")
|
|
52
52
|
this.vs.askedSkip = t, this.vs.container.scroll(0, Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight));
|
|
53
53
|
else if (this.element) {
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const i = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
|
|
55
|
+
i && this.containerRef.current && (this.containerRef.current.scrollTop = i.offsetTop);
|
|
56
56
|
}
|
|
57
57
|
}, this.scrollIntoView = (e) => {
|
|
58
58
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
59
59
|
return;
|
|
60
60
|
this.rowIndex = e.rowIndex;
|
|
61
|
-
const { rowIndex: t } = e,
|
|
62
|
-
if (this.observer &&
|
|
61
|
+
const { rowIndex: t } = e, i = this.element;
|
|
62
|
+
if (this.observer && i) {
|
|
63
63
|
this.observer.disconnect();
|
|
64
|
-
const n =
|
|
64
|
+
const n = i.querySelector(`[absolute-row-index="${t}"]`);
|
|
65
65
|
n ? this.observer.observe(n) : this.setCurrentOnTop(e);
|
|
66
66
|
}
|
|
67
67
|
}, this.fitColumns = (e) => {
|
|
68
68
|
this.columnResize.dblClickHandler(null, e);
|
|
69
|
-
}, this.onContextMenu = (e, t,
|
|
69
|
+
}, this.onContextMenu = (e, t, i) => {
|
|
70
70
|
if (this.props.onContextMenu) {
|
|
71
71
|
const n = {
|
|
72
72
|
target: this,
|
|
73
73
|
syntheticEvent: e,
|
|
74
74
|
nativeEvent: e.nativeEvent,
|
|
75
75
|
dataItem: t,
|
|
76
|
-
field:
|
|
76
|
+
field: i
|
|
77
77
|
};
|
|
78
78
|
this.props.onContextMenu.call(void 0, n);
|
|
79
79
|
}
|
|
80
80
|
}, this.getVirtualScroll = (e) => {
|
|
81
|
-
const { rowHeight: t, detailRowHeight:
|
|
82
|
-
return !
|
|
81
|
+
const { rowHeight: t, detailRowHeight: i, detail: n, expandField: h, groupable: l } = e, d = this.isAllData(), f = t !== void 0 && t > 0, R = i !== void 0 && i > 0, I = l === !0 || typeof l == "object" && l.enabled !== !1;
|
|
82
|
+
return !f || I && !d || !!(n && h) && (!R || !d) ? pt : ge;
|
|
83
83
|
}, this.isAllData = () => {
|
|
84
84
|
const { data: e, total: t } = this.props;
|
|
85
85
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
@@ -92,35 +92,35 @@ const _ = class _ extends r.Component {
|
|
|
92
92
|
this.props.sort,
|
|
93
93
|
t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
|
|
94
94
|
), this.vs.fixedScroll = this.props.fixedScroll || !1, this.vs.PageChange = this.pageChange, this.vs.realSkip = this.props.skip || 0, this.vs.pageSize = (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 0, this.vs.scrollableVirtual = this.props.scrollable === "virtual", this.vs.total = e, this.vs.propsSkip = (this.props.skip || 0) + (this.props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.props.skip || 0)) : 0), this.props.rowHeight !== void 0 && this.props.rowHeight > 0 && !t) {
|
|
95
|
-
const
|
|
96
|
-
this.vs.containerHeight =
|
|
95
|
+
const i = this.props.rowHeight * e;
|
|
96
|
+
this.vs.containerHeight = fe ? Math.min(be, i) : i;
|
|
97
97
|
} else
|
|
98
98
|
this.vs.containerHeight = 1533915;
|
|
99
|
-
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof
|
|
100
|
-
const { rowHeight:
|
|
99
|
+
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ge) {
|
|
100
|
+
const { rowHeight: i = 0, detail: n, expandField: h } = this.props;
|
|
101
101
|
let { detailRowHeight: l = 0 } = this.props;
|
|
102
|
-
l = n && h ? l :
|
|
102
|
+
l = n && h ? l : i, this.isAllData() ? (this.vs.total = this._data.length, this._slicedData = this._data.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this._data.length, i, l, this._data)) : this.vs.rowHeightService = new me(e, i, l);
|
|
103
103
|
const d = this.vs.rowHeightService.totalHeight();
|
|
104
|
-
this.vs.containerHeight =
|
|
104
|
+
this.vs.containerHeight = fe ? Math.min(be, d) : d;
|
|
105
105
|
}
|
|
106
106
|
}, this.scrollHandler = (e) => {
|
|
107
107
|
if (e.target !== e.currentTarget)
|
|
108
108
|
return;
|
|
109
109
|
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
110
|
-
const t = e.currentTarget.scrollLeft,
|
|
111
|
-
this.props.columnVirtualization && (!this.vs.scrollableVirtual ||
|
|
110
|
+
const t = e.currentTarget.scrollLeft, i = e.currentTarget.scrollTop;
|
|
111
|
+
this.props.columnVirtualization && (!this.vs.scrollableVirtual || i === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
112
112
|
this.forceUpdate();
|
|
113
|
-
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs &&
|
|
113
|
+
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && i !== this.wrapperScrollTop && this.vs.scrollHandler(e), Ke(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = i;
|
|
114
114
|
}, this.onKeyDown = (e) => {
|
|
115
115
|
if (x.onKeyDown(e, {
|
|
116
116
|
contextStateRef: this.contextStateRef,
|
|
117
117
|
navigationStateRef: this.navigationStateRef,
|
|
118
118
|
onNavigationAction: this.onNavigationAction
|
|
119
119
|
}), this.props.onKeyDown) {
|
|
120
|
-
const { mode: t, cell:
|
|
120
|
+
const { mode: t, cell: i } = le(this.props.selectable), n = {
|
|
121
121
|
dataItems: this.getLeafDataItems(),
|
|
122
122
|
mode: t,
|
|
123
|
-
cell:
|
|
123
|
+
cell: i,
|
|
124
124
|
componentId: this._gridId,
|
|
125
125
|
selectedField: this.props.selectedField,
|
|
126
126
|
...this.getArguments(e)
|
|
@@ -158,8 +158,8 @@ const _ = class _ extends r.Component {
|
|
|
158
158
|
}, this.itemChange = (e) => {
|
|
159
159
|
const t = this.props.onItemChange;
|
|
160
160
|
if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const i = this.props.onExpandChange;
|
|
162
|
+
i && i.call(
|
|
163
163
|
void 0,
|
|
164
164
|
{
|
|
165
165
|
...this.getArguments(e.syntheticEvent),
|
|
@@ -204,13 +204,13 @@ const _ = class _ extends r.Component {
|
|
|
204
204
|
};
|
|
205
205
|
this.props.onSelectionChange.call(void 0, t);
|
|
206
206
|
}
|
|
207
|
-
}, this.pageChange = (e, t,
|
|
207
|
+
}, this.pageChange = (e, t, i) => {
|
|
208
208
|
this.raiseDataEvent(
|
|
209
209
|
this.props.onPageChange,
|
|
210
210
|
{ page: e },
|
|
211
211
|
{ skip: e.skip, take: e.take },
|
|
212
212
|
t,
|
|
213
|
-
|
|
213
|
+
i
|
|
214
214
|
);
|
|
215
215
|
}, this.pagerPageChange = (e) => {
|
|
216
216
|
this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
@@ -229,12 +229,12 @@ const _ = class _ extends r.Component {
|
|
|
229
229
|
t
|
|
230
230
|
);
|
|
231
231
|
}, this.groupChange = (e, t) => {
|
|
232
|
-
const
|
|
232
|
+
const i = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
|
|
233
233
|
this.raiseDataEvent(
|
|
234
234
|
this.props.onGroupChange,
|
|
235
235
|
{ group: e },
|
|
236
236
|
{ group: e, skip: 0 },
|
|
237
|
-
|
|
237
|
+
i
|
|
238
238
|
);
|
|
239
239
|
}, this.onClipboard = (e, t) => {
|
|
240
240
|
if (this.props.onClipboard) {
|
|
@@ -255,9 +255,9 @@ const _ = class _ extends r.Component {
|
|
|
255
255
|
var h, l, d;
|
|
256
256
|
if (!V)
|
|
257
257
|
return !1;
|
|
258
|
-
const e =
|
|
259
|
-
return !!(t && n &&
|
|
260
|
-
}, this.onResize = (e, t,
|
|
258
|
+
const e = Oe(this.document), t = e ? e.matches(".k-table-td") ? e : (h = this.document) == null ? void 0 : h.body : (l = this.document) == null ? void 0 : l.body, i = t.closest(".k-grid-container"), n = t && ((d = this._element) == null ? void 0 : d.contains(t));
|
|
259
|
+
return !!(t && n && i);
|
|
260
|
+
}, this.onResize = (e, t, i, n, h, l) => {
|
|
261
261
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
262
262
|
void 0,
|
|
263
263
|
{
|
|
@@ -266,35 +266,35 @@ const _ = class _ extends r.Component {
|
|
|
266
266
|
targetColumnId: l,
|
|
267
267
|
index: e,
|
|
268
268
|
newWidth: t,
|
|
269
|
-
oldWidth:
|
|
269
|
+
oldWidth: i,
|
|
270
270
|
end: h,
|
|
271
271
|
target: this
|
|
272
272
|
}
|
|
273
273
|
);
|
|
274
|
-
}, this.reInitVirtualization = S((e, t,
|
|
274
|
+
}, this.reInitVirtualization = S((e, t, i, n, h, l) => {
|
|
275
275
|
this.vs.reset();
|
|
276
276
|
const d = this.getVirtualScroll(this.props);
|
|
277
277
|
this.vs = new d(l);
|
|
278
|
-
}), this.flatData = S((e, t,
|
|
279
|
-
const
|
|
280
|
-
|
|
278
|
+
}), this.flatData = S((e, t, i, n, h, l, d) => {
|
|
279
|
+
const f = [], R = ut(
|
|
280
|
+
f,
|
|
281
281
|
e,
|
|
282
282
|
t,
|
|
283
|
-
{ index:
|
|
283
|
+
{ index: i },
|
|
284
284
|
n !== void 0,
|
|
285
285
|
h
|
|
286
286
|
);
|
|
287
|
-
return { flattedData:
|
|
288
|
-
}), this.rowHeightService = S((e, t,
|
|
289
|
-
(e, t,
|
|
287
|
+
return { flattedData: f, resolvedGroupsCount: R };
|
|
288
|
+
}), this.rowHeightService = S((e, t, i, n, h) => new me(t, i, n, h)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
|
|
289
|
+
(e, t, i) => {
|
|
290
290
|
const n = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
|
|
291
|
-
return
|
|
291
|
+
return gt(n, this.columns, { prevId: 0, idPrefix: t });
|
|
292
292
|
}
|
|
293
293
|
), this.mapColumns = S(
|
|
294
|
-
(e, t) =>
|
|
295
|
-
), this.configureColumns = S((e, t,
|
|
294
|
+
(e, t) => Be(e, t)
|
|
295
|
+
), this.configureColumns = S((e, t, i) => {
|
|
296
296
|
this.props.selectedField && e.filter((l) => l.field === this.props.selectedField).forEach((l) => {
|
|
297
|
-
l.width = l.width || "50px", l.cell = l.cell ||
|
|
297
|
+
l.width = l.width || "50px", l.cell = l.cell || Ye, l.headerCell = l.headerCell || Rt;
|
|
298
298
|
});
|
|
299
299
|
const n = {
|
|
300
300
|
id: "",
|
|
@@ -318,7 +318,7 @@ const _ = class _ extends r.Component {
|
|
|
318
318
|
let h = 0;
|
|
319
319
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
320
320
|
...n,
|
|
321
|
-
cell:
|
|
321
|
+
cell: Ze,
|
|
322
322
|
field: this.props.expandField,
|
|
323
323
|
headerClassName: "k-hierarchy-cell k-header"
|
|
324
324
|
}), h++);
|
|
@@ -326,19 +326,19 @@ const _ = class _ extends r.Component {
|
|
|
326
326
|
e.unshift({
|
|
327
327
|
...n,
|
|
328
328
|
isAccessible: !1,
|
|
329
|
-
cell:
|
|
329
|
+
cell: Ce,
|
|
330
330
|
field: "value",
|
|
331
331
|
locked: this.props.lockGroups
|
|
332
332
|
}), h++;
|
|
333
333
|
e.slice(h).forEach((l) => l.parentIndex >= 0 && (l.parentIndex += h));
|
|
334
|
-
}), this.getHeaderRow = S((e, t,
|
|
335
|
-
|
|
334
|
+
}), this.getHeaderRow = S((e, t, i, n, h, l, d, f, R, I, z, C) => /* @__PURE__ */ r.createElement(
|
|
335
|
+
st,
|
|
336
336
|
{
|
|
337
337
|
cells: this.props.cells,
|
|
338
338
|
sort: e,
|
|
339
339
|
sortable: t,
|
|
340
340
|
sortChange: this.sortChange,
|
|
341
|
-
group:
|
|
341
|
+
group: i || [],
|
|
342
342
|
groupable: n,
|
|
343
343
|
groupChange: this.groupChange,
|
|
344
344
|
filter: h,
|
|
@@ -352,9 +352,9 @@ const _ = class _ extends r.Component {
|
|
|
352
352
|
pressHandler: this.dragLogic.pressHandler,
|
|
353
353
|
dragHandler: this.dragLogic.dragHandler,
|
|
354
354
|
releaseHandler: this.dragLogic.releaseHandler,
|
|
355
|
-
columnsMap:
|
|
356
|
-
cellRender:
|
|
357
|
-
isRtl:
|
|
355
|
+
columnsMap: z,
|
|
356
|
+
cellRender: f,
|
|
357
|
+
isRtl: C,
|
|
358
358
|
dragClue: this.dragLogic.dragClueRef,
|
|
359
359
|
headerRef: this.headerElementRef,
|
|
360
360
|
containerRef: this.containerRef,
|
|
@@ -362,15 +362,15 @@ const _ = class _ extends r.Component {
|
|
|
362
362
|
columnGroupChange: this.columnGroupChange
|
|
363
363
|
}
|
|
364
364
|
)), this.resolveTitle = (e) => {
|
|
365
|
-
const t = this._columns.find((n) => n.field === e),
|
|
366
|
-
return
|
|
367
|
-
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem),
|
|
365
|
+
const t = this._columns.find((n) => n.field === e), i = t && (t.title || t.field);
|
|
366
|
+
return i === void 0 ? e : i;
|
|
367
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), Pe(ye), this.showLicenseWatermark = Ve(ye);
|
|
368
368
|
const p = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
369
|
-
this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new
|
|
369
|
+
this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new ct(
|
|
370
370
|
this.columnReorder.bind(this),
|
|
371
371
|
this.groupReorder.bind(this),
|
|
372
372
|
this.columnToGroup.bind(this)
|
|
373
|
-
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new
|
|
373
|
+
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new dt(this.onResize), this.props.clipboard && (this.clipboardService = new $e(this.onClipboard)), x.onConstructor({
|
|
374
374
|
navigatable: !!a.navigatable,
|
|
375
375
|
contextStateRef: this.contextStateRef,
|
|
376
376
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -419,7 +419,7 @@ const _ = class _ extends r.Component {
|
|
|
419
419
|
// tslint:enable:max-line-length
|
|
420
420
|
get columns() {
|
|
421
421
|
const a = this._columns.filter((p) => p.declarationIndex >= 0 && p.parentIndex === -1);
|
|
422
|
-
return
|
|
422
|
+
return mt(a);
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* Returns the HTML element of the Grid component.
|
|
@@ -441,8 +441,8 @@ const _ = class _ extends r.Component {
|
|
|
441
441
|
* @hidden
|
|
442
442
|
*/
|
|
443
443
|
componentDidMount() {
|
|
444
|
-
this.resetTableWidth(),
|
|
445
|
-
const a =
|
|
444
|
+
this.resetTableWidth(), ae();
|
|
445
|
+
const a = je(this.element);
|
|
446
446
|
this.isRtl = a, x.onComponentDidMount({
|
|
447
447
|
scope: this.element || void 0,
|
|
448
448
|
contextStateRef: this.contextStateRef,
|
|
@@ -468,7 +468,7 @@ const _ = class _ extends r.Component {
|
|
|
468
468
|
* @hidden
|
|
469
469
|
*/
|
|
470
470
|
componentDidUpdate() {
|
|
471
|
-
this.resetTableWidth(),
|
|
471
|
+
this.resetTableWidth(), ae(), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), x.onComponentDidUpdate({
|
|
472
472
|
scope: this.element || void 0,
|
|
473
473
|
contextStateRef: this.contextStateRef,
|
|
474
474
|
navigationStateRef: this.navigationStateRef
|
|
@@ -484,12 +484,12 @@ const _ = class _ extends r.Component {
|
|
|
484
484
|
* @hidden
|
|
485
485
|
*/
|
|
486
486
|
render() {
|
|
487
|
-
var
|
|
487
|
+
var oe;
|
|
488
488
|
let a = this.props.total || 0;
|
|
489
|
-
const p =
|
|
489
|
+
const p = N.getIdPrefix(this.navigationStateRef), c = at(this);
|
|
490
490
|
let e = [];
|
|
491
491
|
Array.isArray(this.props.data) ? (e = this.props.data, a = a || this.props.data.length) : this.props.data && (e = this.props.data.data, a = a || this.props.data.total);
|
|
492
|
-
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", { resolvedGroupsCount:
|
|
492
|
+
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", i = this.props.scrollable === "virtual", { resolvedGroupsCount: n, flattedData: h } = this.flatData(
|
|
493
493
|
e,
|
|
494
494
|
t,
|
|
495
495
|
this.props.skip || 0,
|
|
@@ -498,15 +498,15 @@ const _ = class _ extends r.Component {
|
|
|
498
498
|
this.props.filter,
|
|
499
499
|
this.props.sort
|
|
500
500
|
);
|
|
501
|
-
this._data =
|
|
502
|
-
const
|
|
503
|
-
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable =
|
|
504
|
-
const
|
|
505
|
-
this.initializeVirtualization(a,
|
|
506
|
-
const
|
|
507
|
-
this.initColumns(
|
|
508
|
-
const
|
|
509
|
-
|
|
501
|
+
this._data = h;
|
|
502
|
+
const l = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
|
|
503
|
+
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = l;
|
|
504
|
+
const d = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
|
|
505
|
+
this.initializeVirtualization(a, l);
|
|
506
|
+
const f = this.childrenToArray(this.props.children);
|
|
507
|
+
this.initColumns(f, n);
|
|
508
|
+
const R = f.map((o) => o && o.type && o.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(o, { ...o.props, ariaControls: this._gridId }) : null), I = f.filter((o) => o && o.type && o.type.displayName === "KendoReactGridNoRecords"), z = f.filter((o) => o && o.type && o.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((o) => o.children.length === 0), $ = l && /* @__PURE__ */ r.createElement(
|
|
509
|
+
ot,
|
|
510
510
|
{
|
|
511
511
|
group: this.props.group || [],
|
|
512
512
|
groupChange: this.groupChange,
|
|
@@ -518,38 +518,38 @@ const _ = class _ extends r.Component {
|
|
|
518
518
|
ariaControls: this._gridId,
|
|
519
519
|
onContextMenu: this.onContextMenu
|
|
520
520
|
}
|
|
521
|
-
), { sort:
|
|
522
|
-
|
|
521
|
+
), { sort: we, sortable: Se, group: ke, filter: Ie, filterable: Ee, filterOperators: xe = Re, headerCellRender: _e, columnMenu: ze } = this.props, j = /* @__PURE__ */ r.createElement(
|
|
522
|
+
tt,
|
|
523
523
|
{
|
|
524
524
|
size: this.props.size,
|
|
525
525
|
columnResize: this.columnResize,
|
|
526
526
|
staticHeaders: this.props.scrollable !== "none",
|
|
527
527
|
scrollableDataElement: () => this.vs.container,
|
|
528
|
-
draggable: this.props.reorderable ||
|
|
528
|
+
draggable: this.props.reorderable || l,
|
|
529
529
|
ref: this.headerRef,
|
|
530
530
|
elemRef: this.headerElementRef,
|
|
531
531
|
headerRow: this.getHeaderRow(
|
|
532
|
-
ye,
|
|
533
532
|
we,
|
|
534
533
|
Se,
|
|
535
|
-
h,
|
|
536
534
|
ke,
|
|
535
|
+
l,
|
|
537
536
|
Ie,
|
|
538
537
|
Ee,
|
|
539
538
|
xe,
|
|
540
539
|
_e,
|
|
540
|
+
ze,
|
|
541
541
|
this._columns,
|
|
542
542
|
this._columnsMap,
|
|
543
543
|
this.isRtl
|
|
544
544
|
),
|
|
545
545
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
546
|
-
|
|
546
|
+
it,
|
|
547
547
|
{
|
|
548
548
|
cells: this.props.cells,
|
|
549
549
|
size: this.props.size,
|
|
550
550
|
columns: this._columns,
|
|
551
551
|
filter: this.props.filter,
|
|
552
|
-
filterOperators: this.props.filterOperators ||
|
|
552
|
+
filterOperators: this.props.filterOperators || Re,
|
|
553
553
|
filterChange: this.filterChange,
|
|
554
554
|
sort: this.props.sort,
|
|
555
555
|
cellRender: this.props.filterCellRender,
|
|
@@ -557,65 +557,65 @@ const _ = class _ extends r.Component {
|
|
|
557
557
|
ariaRowIndex: this._columnsMap.length + 1
|
|
558
558
|
}
|
|
559
559
|
) || void 0,
|
|
560
|
-
cols:
|
|
560
|
+
cols: C.map((o, g) => /* @__PURE__ */ r.createElement(
|
|
561
561
|
"col",
|
|
562
562
|
{
|
|
563
563
|
key: g.toString(),
|
|
564
|
-
width: W(
|
|
564
|
+
width: W(o)
|
|
565
565
|
}
|
|
566
566
|
))
|
|
567
567
|
}
|
|
568
|
-
),
|
|
568
|
+
), De = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, He = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: Te, hiddenColumns: Le } = qe({
|
|
569
569
|
enabled: this.props.columnVirtualization,
|
|
570
|
-
columns:
|
|
571
|
-
tableViewPortWidth:
|
|
572
|
-
scrollLeft:
|
|
573
|
-
}),
|
|
570
|
+
columns: C,
|
|
571
|
+
tableViewPortWidth: He,
|
|
572
|
+
scrollLeft: De
|
|
573
|
+
}), Fe = (o, g, m) => {
|
|
574
574
|
let E = !1;
|
|
575
|
-
const k = this.props.selectedField ?
|
|
575
|
+
const k = this.props.selectedField ? ve(this.props.selectedField, o.dataItem) : void 0;
|
|
576
576
|
return {
|
|
577
|
-
row:
|
|
578
|
-
if (
|
|
577
|
+
row: C.map((u, b) => {
|
|
578
|
+
if (Le[b])
|
|
579
579
|
return null;
|
|
580
|
-
const
|
|
580
|
+
const H = u.id ? u.id : b, T = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, y = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
|
|
581
581
|
let w = !1;
|
|
582
582
|
if (u.editable && this.props.editField) {
|
|
583
|
-
const
|
|
584
|
-
|
|
583
|
+
const v = ve(this.props.editField, o.dataItem);
|
|
584
|
+
v && (v === !0 || v === u.field) && (E = !0, w = !0);
|
|
585
585
|
}
|
|
586
|
-
const P = u.cell || w &&
|
|
586
|
+
const P = u.cell || w && et || vt, L = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
587
587
|
return /* @__PURE__ */ r.createElement(
|
|
588
588
|
P,
|
|
589
589
|
{
|
|
590
590
|
onContextMenu: this.onContextMenu,
|
|
591
|
-
key:
|
|
591
|
+
key: H,
|
|
592
592
|
locked: this.props.lockGroups,
|
|
593
|
-
id:
|
|
594
|
-
`${g}-${String(
|
|
593
|
+
id: N.generateNavigatableId(
|
|
594
|
+
`${g}-${String(b)}`,
|
|
595
595
|
p,
|
|
596
|
-
|
|
596
|
+
L ? "nodata" : "cell"
|
|
597
597
|
),
|
|
598
|
-
colSpan:
|
|
599
|
-
dataItem:
|
|
598
|
+
colSpan: Te[b],
|
|
599
|
+
dataItem: o.dataItem,
|
|
600
600
|
field: u.field,
|
|
601
601
|
editor: u.editor,
|
|
602
602
|
format: u.format,
|
|
603
|
-
className:
|
|
603
|
+
className: T,
|
|
604
604
|
render: this.props.cellRender,
|
|
605
|
-
cells:
|
|
605
|
+
cells: bt(this.props.cells, u.cells),
|
|
606
606
|
onChange: this.itemChange,
|
|
607
|
-
selectionChange: this.props.onSelectionChange ? (
|
|
608
|
-
this.selectionChange({ event:
|
|
607
|
+
selectionChange: this.props.onSelectionChange ? (v) => {
|
|
608
|
+
this.selectionChange({ event: v, dataItem: o.dataItem, dataIndex: m, columnIndex: b });
|
|
609
609
|
} : void 0,
|
|
610
|
-
columnIndex:
|
|
611
|
-
columnsCount:
|
|
612
|
-
rowType:
|
|
613
|
-
level:
|
|
614
|
-
expanded:
|
|
615
|
-
dataIndex:
|
|
610
|
+
columnIndex: b,
|
|
611
|
+
columnsCount: C.length,
|
|
612
|
+
rowType: o.rowType,
|
|
613
|
+
level: o.level,
|
|
614
|
+
expanded: o.expanded,
|
|
615
|
+
dataIndex: o.dataIndex,
|
|
616
616
|
style: y,
|
|
617
617
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
618
|
-
isSelected: Array.isArray(k) && k.indexOf(
|
|
618
|
+
isSelected: Array.isArray(k) && k.indexOf(b) > -1
|
|
619
619
|
}
|
|
620
620
|
);
|
|
621
621
|
}),
|
|
@@ -623,73 +623,73 @@ const _ = class _ extends r.Component {
|
|
|
623
623
|
isSelected: typeof k == "boolean" && k
|
|
624
624
|
};
|
|
625
625
|
};
|
|
626
|
-
let
|
|
627
|
-
if (
|
|
628
|
-
for (let
|
|
626
|
+
let q = 0;
|
|
627
|
+
if (i)
|
|
628
|
+
for (let o = 0; o < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); o++) {
|
|
629
629
|
const g = this._data.shift();
|
|
630
630
|
if (g)
|
|
631
|
-
this._data.push(g),
|
|
631
|
+
this._data.push(g), q++, g.rowType === "groupHeader" && o--;
|
|
632
632
|
else
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
|
-
const
|
|
636
|
-
let
|
|
635
|
+
const J = (o) => o >= this._data.length - q;
|
|
636
|
+
let Q = this.vs.realSkip || 0;
|
|
637
637
|
const A = [];
|
|
638
638
|
let K = !1;
|
|
639
639
|
const O = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
640
|
-
let
|
|
640
|
+
let D = 0;
|
|
641
641
|
if (this._data.length) {
|
|
642
|
-
let
|
|
642
|
+
let o = -1, g = 0;
|
|
643
643
|
(this._slicedData || this._data).forEach((m, E) => {
|
|
644
|
-
m.rowType === "data" && (
|
|
645
|
-
const k =
|
|
646
|
-
if (
|
|
647
|
-
|
|
644
|
+
m.rowType === "data" && (Q++, o++);
|
|
645
|
+
const k = Q % 2 === 0, u = this.props.dataItemKey && Ue(this.props.dataItemKey)(m.dataItem), b = E + (this.vs.realSkip || 0), H = u || "ai" + b, T = H + "_1", y = Fe(m, H, o);
|
|
646
|
+
if (D = b + O + g, A.push(/* @__PURE__ */ r.createElement(
|
|
647
|
+
Ct,
|
|
648
648
|
{
|
|
649
|
-
key:
|
|
649
|
+
key: H,
|
|
650
650
|
dataItem: m.dataItem,
|
|
651
651
|
isAltRow: k,
|
|
652
652
|
isInEdit: y.isInEdit,
|
|
653
653
|
rowType: m.rowType,
|
|
654
|
-
isHidden:
|
|
654
|
+
isHidden: J(E),
|
|
655
655
|
onClick: (w) => this.rowClick(w, m),
|
|
656
656
|
onDoubleClick: (w) => this.rowDblClick(w, m),
|
|
657
657
|
selectedField: this.props.selectedField,
|
|
658
658
|
rowHeight: this.props.rowHeight,
|
|
659
659
|
render: this.props.rowRender,
|
|
660
|
-
ariaRowIndex:
|
|
661
|
-
absoluteRowIndex:
|
|
662
|
-
dataIndex: this.vs.scrollableVirtual ?
|
|
660
|
+
ariaRowIndex: D,
|
|
661
|
+
absoluteRowIndex: b,
|
|
662
|
+
dataIndex: this.vs.scrollableVirtual ? b : o,
|
|
663
663
|
isSelected: y.isSelected
|
|
664
664
|
},
|
|
665
665
|
y.row
|
|
666
666
|
)), this.props.detail && m.rowType === "data" && m.expanded) {
|
|
667
|
-
const w =
|
|
668
|
-
g++,
|
|
667
|
+
const w = C.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
668
|
+
g++, D = b + O + g, A.push(/* @__PURE__ */ r.createElement(
|
|
669
669
|
"tr",
|
|
670
670
|
{
|
|
671
|
-
key:
|
|
672
|
-
className:
|
|
671
|
+
key: T,
|
|
672
|
+
className: F(
|
|
673
673
|
"k-table-row",
|
|
674
674
|
k ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
675
675
|
),
|
|
676
|
-
style: { visibility:
|
|
676
|
+
style: { visibility: J(E) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
677
677
|
role: "row",
|
|
678
|
-
"aria-rowindex":
|
|
678
|
+
"aria-rowindex": D
|
|
679
679
|
},
|
|
680
|
-
this.props.group && this.props.group.map((P,
|
|
681
|
-
var
|
|
682
|
-
const
|
|
680
|
+
this.props.group && this.props.group.map((P, L) => {
|
|
681
|
+
var re;
|
|
682
|
+
const v = (re = y == null ? void 0 : y.row[L]) == null ? void 0 : re.props.style, Ge = v ? this.isRtl ? { left: v.right, right: v.left } : { left: v.left, right: v.right } : {};
|
|
683
683
|
return /* @__PURE__ */ r.createElement(
|
|
684
|
-
|
|
684
|
+
Ce,
|
|
685
685
|
{
|
|
686
686
|
id: "",
|
|
687
687
|
dataIndex: m.dataIndex,
|
|
688
688
|
field: P.field,
|
|
689
689
|
dataItem: m.dataItem,
|
|
690
|
-
key:
|
|
691
|
-
style:
|
|
692
|
-
ariaColumnIndex: 1 +
|
|
690
|
+
key: L,
|
|
691
|
+
style: Ge,
|
|
692
|
+
ariaColumnIndex: 1 + L,
|
|
693
693
|
isSelected: !1,
|
|
694
694
|
locked: this.props.lockGroups,
|
|
695
695
|
isRtl: this.isRtl,
|
|
@@ -698,13 +698,13 @@ const _ = class _ extends r.Component {
|
|
|
698
698
|
);
|
|
699
699
|
}),
|
|
700
700
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
701
|
-
|
|
701
|
+
It,
|
|
702
702
|
{
|
|
703
|
-
id:
|
|
703
|
+
id: N.generateNavigatableId(`${T}-dhcell`, p)
|
|
704
704
|
}
|
|
705
705
|
),
|
|
706
706
|
/* @__PURE__ */ r.createElement(
|
|
707
|
-
|
|
707
|
+
kt,
|
|
708
708
|
{
|
|
709
709
|
onContextMenu: this.onContextMenu,
|
|
710
710
|
dataItem: m.dataItem,
|
|
@@ -712,7 +712,7 @@ const _ = class _ extends r.Component {
|
|
|
712
712
|
colSpan: w,
|
|
713
713
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
714
714
|
detail: this.props.detail,
|
|
715
|
-
id:
|
|
715
|
+
id: N.generateNavigatableId(`${T}-dcell`, p)
|
|
716
716
|
}
|
|
717
717
|
)
|
|
718
718
|
));
|
|
@@ -720,72 +720,72 @@ const _ = class _ extends r.Component {
|
|
|
720
720
|
});
|
|
721
721
|
} else
|
|
722
722
|
K = !0;
|
|
723
|
-
const
|
|
724
|
-
const
|
|
725
|
-
return
|
|
726
|
-
},
|
|
723
|
+
const Ne = () => {
|
|
724
|
+
const o = this._header;
|
|
725
|
+
return o && o.table.clientWidth;
|
|
726
|
+
}, X = () => /* @__PURE__ */ r.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": O, style: { width: Ne() } }, /* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template" }, I.length ? I : /* @__PURE__ */ r.createElement(yt, null))), Y = {
|
|
727
727
|
size: this.props.size,
|
|
728
728
|
onPageChange: this.pagerPageChange,
|
|
729
729
|
total: a,
|
|
730
730
|
dir: this.isRtl ? "rtl" : void 0,
|
|
731
731
|
skip: this.vs.propsSkip || 0,
|
|
732
732
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
733
|
-
messagesMap:
|
|
734
|
-
...
|
|
735
|
-
},
|
|
733
|
+
messagesMap: nt,
|
|
734
|
+
...St(this.props.pageable || {})
|
|
735
|
+
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Y }) : /* @__PURE__ */ r.createElement(Je, { className: "k-grid-pager", ...Y }), Ae = (o) => this.props.sort && this.props.sort.filter((g) => g.field === o).length > 0, Me = (o, g) => /* @__PURE__ */ r.createElement(
|
|
736
736
|
"col",
|
|
737
737
|
{
|
|
738
738
|
key: g.toString(),
|
|
739
|
-
width: W(
|
|
739
|
+
width: W(o)
|
|
740
740
|
}
|
|
741
|
-
),
|
|
742
|
-
(
|
|
741
|
+
), ee = (oe = this.props.cells) != null && oe.footerCell || this._columns.some(
|
|
742
|
+
(o) => {
|
|
743
743
|
var g;
|
|
744
|
-
return !!(
|
|
744
|
+
return !!(o.footerCell || (g = o.cells) != null && g.footerCell);
|
|
745
745
|
}
|
|
746
746
|
) ? /* @__PURE__ */ r.createElement(
|
|
747
|
-
|
|
747
|
+
rt,
|
|
748
748
|
{
|
|
749
749
|
size: this.props.size,
|
|
750
750
|
columnResize: this.columnResize,
|
|
751
751
|
staticHeaders: this.props.scrollable !== "none",
|
|
752
|
-
ref: (
|
|
752
|
+
ref: (o) => this._footer = o,
|
|
753
753
|
row: /* @__PURE__ */ r.createElement(
|
|
754
|
-
|
|
754
|
+
wt,
|
|
755
755
|
{
|
|
756
756
|
cells: this.props.cells,
|
|
757
757
|
columns: this._columns,
|
|
758
758
|
isRtl: this.isRtl,
|
|
759
|
-
ariaRowIndex:
|
|
759
|
+
ariaRowIndex: D + 1
|
|
760
760
|
}
|
|
761
761
|
),
|
|
762
|
-
cols:
|
|
762
|
+
cols: C.map(Me)
|
|
763
763
|
}
|
|
764
|
-
) : null,
|
|
764
|
+
) : null, te = /* @__PURE__ */ r.createElement(
|
|
765
765
|
"colgroup",
|
|
766
766
|
{
|
|
767
|
-
ref: (
|
|
768
|
-
this.columnResize.colGroupMain =
|
|
767
|
+
ref: (o) => {
|
|
768
|
+
this.columnResize.colGroupMain = o;
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
|
-
|
|
772
|
-
(
|
|
771
|
+
C.map(
|
|
772
|
+
(o, g) => /* @__PURE__ */ r.createElement(
|
|
773
773
|
"col",
|
|
774
774
|
{
|
|
775
775
|
key: g.toString(),
|
|
776
|
-
className:
|
|
777
|
-
width: W(
|
|
776
|
+
className: Ae(o.field) ? "k-sorted" : void 0,
|
|
777
|
+
width: W(o)
|
|
778
778
|
}
|
|
779
779
|
)
|
|
780
780
|
)
|
|
781
|
-
),
|
|
781
|
+
), se = this.dragLogic.reorderable || this.dragLogic.groupable, ie = this.props.columnVirtualization ? "block" : "table";
|
|
782
782
|
if (this.props.scrollable === "none")
|
|
783
783
|
return /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
784
784
|
"div",
|
|
785
785
|
{
|
|
786
786
|
id: this.props.id,
|
|
787
787
|
style: this.props.style,
|
|
788
|
-
className:
|
|
788
|
+
className: F(
|
|
789
789
|
"k-grid",
|
|
790
790
|
{
|
|
791
791
|
"k-grid-md": !this.props.size,
|
|
@@ -793,79 +793,79 @@ const _ = class _ extends r.Component {
|
|
|
793
793
|
},
|
|
794
794
|
this.props.className
|
|
795
795
|
),
|
|
796
|
-
ref: (
|
|
797
|
-
this._element =
|
|
796
|
+
ref: (o) => {
|
|
797
|
+
this._element = o;
|
|
798
798
|
},
|
|
799
799
|
"aria-label": this.props.ariaLabel,
|
|
800
800
|
onKeyDown: this.onKeyDown,
|
|
801
801
|
onFocus: this.onFocus,
|
|
802
|
-
...
|
|
802
|
+
...ne
|
|
803
803
|
},
|
|
804
|
-
|
|
805
|
-
|
|
804
|
+
R,
|
|
805
|
+
$,
|
|
806
806
|
/* @__PURE__ */ r.createElement(
|
|
807
|
-
|
|
807
|
+
he,
|
|
808
808
|
{
|
|
809
809
|
selectable: this.props.selectable,
|
|
810
810
|
onRelease: this.selectionRelease,
|
|
811
|
-
childRef: (
|
|
812
|
-
this.tableElement =
|
|
811
|
+
childRef: (o) => {
|
|
812
|
+
this.tableElement = o;
|
|
813
813
|
}
|
|
814
814
|
},
|
|
815
815
|
/* @__PURE__ */ r.createElement(
|
|
816
816
|
"table",
|
|
817
817
|
{
|
|
818
|
-
className:
|
|
818
|
+
className: F(
|
|
819
819
|
"k-table k-grid-table",
|
|
820
820
|
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
821
821
|
),
|
|
822
|
-
style: { userSelect:
|
|
822
|
+
style: { userSelect: d, display: ie }
|
|
823
823
|
},
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...
|
|
827
|
-
|
|
824
|
+
te,
|
|
825
|
+
j,
|
|
826
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, A),
|
|
827
|
+
ee
|
|
828
828
|
)
|
|
829
829
|
),
|
|
830
|
-
K &&
|
|
831
|
-
|
|
832
|
-
),
|
|
830
|
+
K && X(),
|
|
831
|
+
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
|
|
832
|
+
), z, this.props.pageable && Z);
|
|
833
833
|
let M = this.props.style || {};
|
|
834
|
-
return
|
|
834
|
+
return i && (M.height || (M = Object.assign({}, M, { height: "450px" }))), /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
835
835
|
"div",
|
|
836
836
|
{
|
|
837
837
|
id: this.props.id,
|
|
838
838
|
style: M,
|
|
839
|
-
className:
|
|
839
|
+
className: F(
|
|
840
840
|
"k-grid",
|
|
841
841
|
{
|
|
842
842
|
"k-grid-md": !this.props.size,
|
|
843
843
|
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
844
|
-
"k-grid-virtual":
|
|
844
|
+
"k-grid-virtual": i
|
|
845
845
|
},
|
|
846
846
|
this.props.className
|
|
847
847
|
),
|
|
848
|
-
ref: (
|
|
849
|
-
this._element =
|
|
848
|
+
ref: (o) => {
|
|
849
|
+
this._element = o;
|
|
850
850
|
},
|
|
851
851
|
"aria-label": this.props.ariaLabel,
|
|
852
852
|
onKeyDown: this.onKeyDown,
|
|
853
853
|
onFocus: this.onFocus,
|
|
854
|
-
...
|
|
854
|
+
...ne
|
|
855
855
|
},
|
|
856
|
-
|
|
857
|
-
|
|
856
|
+
R,
|
|
857
|
+
$,
|
|
858
858
|
/* @__PURE__ */ r.createElement(
|
|
859
859
|
"div",
|
|
860
860
|
{
|
|
861
861
|
className: "k-grid-aria-root",
|
|
862
862
|
role: "grid",
|
|
863
|
-
"aria-colcount":
|
|
863
|
+
"aria-colcount": C.length,
|
|
864
864
|
"aria-rowcount": a,
|
|
865
865
|
id: this._gridId,
|
|
866
|
-
"aria-label": c.toLanguageString(
|
|
866
|
+
"aria-label": c.toLanguageString(ue, ht[ue])
|
|
867
867
|
},
|
|
868
|
-
|
|
868
|
+
j,
|
|
869
869
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
870
870
|
"div",
|
|
871
871
|
{
|
|
@@ -875,18 +875,18 @@ const _ = class _ extends r.Component {
|
|
|
875
875
|
role: "presentation"
|
|
876
876
|
},
|
|
877
877
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-table-wrap", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
878
|
-
|
|
878
|
+
he,
|
|
879
879
|
{
|
|
880
880
|
selectable: this.props.selectable,
|
|
881
881
|
onRelease: this.selectionRelease,
|
|
882
|
-
childRef: (
|
|
883
|
-
this.tableElement =
|
|
882
|
+
childRef: (o) => {
|
|
883
|
+
this.tableElement = o;
|
|
884
884
|
}
|
|
885
885
|
},
|
|
886
886
|
/* @__PURE__ */ r.createElement(
|
|
887
887
|
"table",
|
|
888
888
|
{
|
|
889
|
-
className:
|
|
889
|
+
className: F(
|
|
890
890
|
"k-table k-grid-table",
|
|
891
891
|
{
|
|
892
892
|
"k-table-md": !this.props.size,
|
|
@@ -894,39 +894,39 @@ const _ = class _ extends r.Component {
|
|
|
894
894
|
}
|
|
895
895
|
),
|
|
896
896
|
role: "presentation",
|
|
897
|
-
style: { userSelect:
|
|
897
|
+
style: { userSelect: d, display: ie }
|
|
898
898
|
},
|
|
899
|
-
|
|
899
|
+
te,
|
|
900
900
|
/* @__PURE__ */ r.createElement(
|
|
901
901
|
"tbody",
|
|
902
902
|
{
|
|
903
903
|
className: "k-table-tbody",
|
|
904
904
|
ref: this.tableBodyRef,
|
|
905
905
|
role: "rowgroup",
|
|
906
|
-
...
|
|
906
|
+
...pe
|
|
907
907
|
},
|
|
908
908
|
A
|
|
909
909
|
)
|
|
910
910
|
)
|
|
911
|
-
), K &&
|
|
912
|
-
/* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
911
|
+
), K && X()),
|
|
912
|
+
i && /* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
913
913
|
"div",
|
|
914
914
|
{
|
|
915
|
-
style:
|
|
915
|
+
style: i ? { height: this.vs.containerHeight + "px" } : {}
|
|
916
916
|
}
|
|
917
917
|
))
|
|
918
918
|
)),
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
919
|
+
ee,
|
|
920
|
+
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue })),
|
|
921
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(We, null)
|
|
922
922
|
),
|
|
923
|
-
|
|
924
|
-
this.props.pageable &&
|
|
923
|
+
z,
|
|
924
|
+
this.props.pageable && Z
|
|
925
925
|
));
|
|
926
926
|
}
|
|
927
927
|
selectionChange(a) {
|
|
928
928
|
if (this.props.onSelectionChange) {
|
|
929
|
-
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode:
|
|
929
|
+
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: i, cell: n } = le(this.props.selectable), h = {
|
|
930
930
|
...this.getArguments(p.syntheticEvent),
|
|
931
931
|
dataItem: c,
|
|
932
932
|
startColIndex: t,
|
|
@@ -938,7 +938,7 @@ const _ = class _ extends r.Component {
|
|
|
938
938
|
ctrlKey: !1,
|
|
939
939
|
shiftKey: !1,
|
|
940
940
|
metaKey: !1,
|
|
941
|
-
mode:
|
|
941
|
+
mode: i,
|
|
942
942
|
cell: n,
|
|
943
943
|
isDrag: !1,
|
|
944
944
|
componentId: this._gridId,
|
|
@@ -948,12 +948,12 @@ const _ = class _ extends r.Component {
|
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
raiseDataEvent(a, p, c, e, t) {
|
|
951
|
-
const
|
|
951
|
+
const i = this.props.onDataStateChange;
|
|
952
952
|
if (a) {
|
|
953
953
|
const n = { ...this.getArguments(e), ...p, targetEvent: t };
|
|
954
954
|
a.call(void 0, n);
|
|
955
955
|
} else
|
|
956
|
-
|
|
956
|
+
i && i.call(
|
|
957
957
|
void 0,
|
|
958
958
|
{
|
|
959
959
|
...this.getArguments(e),
|
|
@@ -966,15 +966,15 @@ const _ = class _ extends r.Component {
|
|
|
966
966
|
);
|
|
967
967
|
}
|
|
968
968
|
columnReorder(a, p, c) {
|
|
969
|
-
const e = this._columns[a], t = e.depth,
|
|
969
|
+
const e = this._columns[a], t = e.depth, i = (d) => {
|
|
970
970
|
do
|
|
971
971
|
d++;
|
|
972
972
|
while (d < this._columns.length && this._columns[d].depth > t);
|
|
973
973
|
return d;
|
|
974
|
-
}, n = this._columns.splice(a,
|
|
975
|
-
this._columns.splice(a < p ?
|
|
974
|
+
}, n = this._columns.splice(a, i(a) - a);
|
|
975
|
+
this._columns.splice(a < p ? i(p - n.length) : p, 0, ...n), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, f) => d.orderIndex = f), this._columnsMutations++;
|
|
976
976
|
const h = this._columns[a].locked && this._columns[p].locked;
|
|
977
|
-
|
|
977
|
+
Qe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), Xe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
978
978
|
const l = this.columns;
|
|
979
979
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
980
980
|
const d = {
|
|
@@ -1017,8 +1017,8 @@ const _ = class _ extends r.Component {
|
|
|
1017
1017
|
a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
|
|
1018
1018
|
}
|
|
1019
1019
|
initColumns(a, p) {
|
|
1020
|
-
const c =
|
|
1021
|
-
this._columns = e, this._columns.length === 0 && (this._columns =
|
|
1020
|
+
const c = N.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = e.length !== this._columns.length;
|
|
1021
|
+
this._columns = e, this._columns.length === 0 && (this._columns = ft(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, p, c), this._columnsMap = this.mapColumns(this._columns, t), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1022
1022
|
}
|
|
1023
1023
|
getDataState() {
|
|
1024
1024
|
return {
|
|
@@ -1117,7 +1117,7 @@ _.displayName = "KendoReactGrid", _.defaultProps = {
|
|
|
1117
1117
|
size: s.oneOf(["small", "medium"])
|
|
1118
1118
|
}, _.contextType = U;
|
|
1119
1119
|
let B = _;
|
|
1120
|
-
|
|
1120
|
+
lt(B);
|
|
1121
1121
|
export {
|
|
1122
1122
|
B as Grid
|
|
1123
1123
|
};
|