@progress/kendo-react-grid 8.2.1-develop.5 → 8.3.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.js +1 -1
- package/Grid.mjs +336 -341
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +20 -21
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +14 -13
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +7 -3
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +26 -28
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +67 -52
- package/columnMenu/GridColumnMenuColumnsList.js +1 -1
- package/columnMenu/GridColumnMenuColumnsList.mjs +36 -34
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +52 -49
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.js +1 -1
- package/drag/ColumnDraggable.mjs +17 -15
- package/header/GridHeaderCell.js +1 -1
- package/header/GridHeaderCell.mjs +22 -28
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +3 -3
- package/header/Header.js +1 -1
- package/header/Header.mjs +24 -38
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +83 -77
- package/index.d.mts +10 -16
- package/index.d.ts +10 -16
- package/index.js +1 -1
- package/index.mjs +80 -80
- package/messages/index.js +1 -1
- package/messages/index.mjs +49 -43
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +32 -40
- package/utils/index.js +1 -1
- package/utils/index.mjs +39 -38
package/Grid.mjs
CHANGED
|
@@ -8,36 +8,36 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { RowHeightService as
|
|
12
|
-
import { tableKeyboardNavigation 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
|
|
39
|
-
import { SAFARI_REGEX as
|
|
40
|
-
const
|
|
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
41
|
constructor(a) {
|
|
42
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
43
|
const t = { rowIndex: this.rowIndex };
|
|
@@ -82,8 +82,8 @@ const z = class z extends r.Component {
|
|
|
82
82
|
this.props.onContextMenu.call(void 0, l);
|
|
83
83
|
}
|
|
84
84
|
}, this.getVirtualScroll = (e) => {
|
|
85
|
-
const { rowHeight: t, detailRowHeight: s, detail: l, expandField:
|
|
86
|
-
return !
|
|
85
|
+
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;
|
|
86
|
+
return !g || z && !h || !!(l && d) && (!v || !h) ? ft : ve;
|
|
87
87
|
}, this.isAllData = () => {
|
|
88
88
|
const { data: e, total: t } = this.props;
|
|
89
89
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
@@ -97,33 +97,33 @@ const z = class z extends r.Component {
|
|
|
97
97
|
t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
|
|
98
98
|
), 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) {
|
|
99
99
|
const s = this.props.rowHeight * e;
|
|
100
|
-
this.vs.containerHeight =
|
|
100
|
+
this.vs.containerHeight = Ce ? Math.min(Re, s) : s;
|
|
101
101
|
} else
|
|
102
102
|
this.vs.containerHeight = 1533915;
|
|
103
|
-
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof
|
|
104
|
-
const { rowHeight: s = 0, detail: l, expandField:
|
|
105
|
-
let { detailRowHeight:
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
this.vs.containerHeight =
|
|
103
|
+
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ve) {
|
|
104
|
+
const { rowHeight: s = 0, detail: l, expandField: d } = this.props;
|
|
105
|
+
let { detailRowHeight: p = 0 } = this.props;
|
|
106
|
+
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(this.vs, this._data.length, s, p, this._data)) : this.vs.rowHeightService = new ne(e, s, p);
|
|
107
|
+
const h = this.vs.rowHeightService.totalHeight();
|
|
108
|
+
this.vs.containerHeight = Ce ? Math.min(Re, h) : h;
|
|
109
109
|
}
|
|
110
|
-
}, this.getCachedScrollbarWidth = () => (this._scrollbarWidth || (this._scrollbarWidth =
|
|
110
|
+
}, this.getCachedScrollbarWidth = () => (this._scrollbarWidth || (this._scrollbarWidth = Ke() || void 0), this._scrollbarWidth), this.scrollHandler = (e) => {
|
|
111
111
|
if (e.target !== e.currentTarget)
|
|
112
112
|
return;
|
|
113
113
|
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
114
114
|
const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
|
|
115
115
|
this.props.columnVirtualization && (!this.vs.scrollableVirtual || s === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
116
116
|
this.forceUpdate();
|
|
117
|
-
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e),
|
|
117
|
+
}, 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;
|
|
118
118
|
}, this.onKeyDown = (e) => {
|
|
119
|
-
if (
|
|
119
|
+
if (T.onKeyDown(e, {
|
|
120
120
|
navigatable: this.props.navigatable || !1,
|
|
121
121
|
contextStateRef: this.contextStateRef,
|
|
122
122
|
navigationStateRef: this.navigationStateRef,
|
|
123
123
|
onNavigationAction: this.onNavigationAction,
|
|
124
124
|
columns: this.columns
|
|
125
125
|
}), this.props.onKeyDown) {
|
|
126
|
-
const { mode: t, cell: s } =
|
|
126
|
+
const { mode: t, cell: s } = pe(this.props.selectable), l = {
|
|
127
127
|
dataItems: this.getLeafDataItems(),
|
|
128
128
|
mode: t,
|
|
129
129
|
cell: s,
|
|
@@ -134,7 +134,7 @@ const z = class z extends r.Component {
|
|
|
134
134
|
this.props.onKeyDown.call(void 0, l);
|
|
135
135
|
}
|
|
136
136
|
}, this.onFocus = (e) => {
|
|
137
|
-
|
|
137
|
+
T.onFocus(e, {
|
|
138
138
|
navigatable: !!this.props.navigatable,
|
|
139
139
|
contextStateRef: this.contextStateRef
|
|
140
140
|
});
|
|
@@ -278,51 +278,51 @@ const z = class z extends r.Component {
|
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
280
|
}, this.inActiveElement = () => {
|
|
281
|
-
var
|
|
282
|
-
if (!
|
|
281
|
+
var d, p, h;
|
|
282
|
+
if (!M)
|
|
283
283
|
return !1;
|
|
284
|
-
const e =
|
|
284
|
+
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));
|
|
285
285
|
return !!(t && l && s);
|
|
286
|
-
}, this.onResize = (e, t, s, l,
|
|
286
|
+
}, this.onResize = (e, t, s, l, d, p) => {
|
|
287
287
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
288
288
|
void 0,
|
|
289
289
|
{
|
|
290
290
|
columns: this.columns,
|
|
291
291
|
nativeEvent: l,
|
|
292
|
-
targetColumnId:
|
|
292
|
+
targetColumnId: p,
|
|
293
293
|
index: e,
|
|
294
294
|
newWidth: t,
|
|
295
295
|
oldWidth: s,
|
|
296
|
-
end:
|
|
296
|
+
end: d,
|
|
297
297
|
target: this
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
|
-
}, this.reInitVirtualization =
|
|
300
|
+
}, this.reInitVirtualization = y((e, t, s, l, d, p) => {
|
|
301
301
|
this.vs.reset();
|
|
302
|
-
const
|
|
303
|
-
this.vs = new
|
|
304
|
-
}), this.flatData =
|
|
305
|
-
const
|
|
306
|
-
|
|
302
|
+
const h = this.getVirtualScroll(this.props);
|
|
303
|
+
this.vs = new h(p);
|
|
304
|
+
}), this.flatData = y((e, t, s, l, d, p, h) => {
|
|
305
|
+
const g = [], v = vt(
|
|
306
|
+
g,
|
|
307
307
|
e,
|
|
308
308
|
t,
|
|
309
309
|
{ index: s },
|
|
310
310
|
l !== void 0,
|
|
311
|
-
|
|
311
|
+
d
|
|
312
312
|
);
|
|
313
|
-
return { flattedData:
|
|
314
|
-
}), this.rowHeightService =
|
|
313
|
+
return { flattedData: g, resolvedGroupsCount: v };
|
|
314
|
+
}), this.rowHeightService = y((e, t, s, l, d) => new ne(t, s, l, d)), this.childrenToArray = y((e) => r.Children.toArray(e)), this.readColumns = y(
|
|
315
315
|
(e, t, s) => {
|
|
316
|
-
const l = e.filter((
|
|
317
|
-
return
|
|
316
|
+
const l = e.filter((d) => d && d.type && d.type.displayName === "KendoReactGridColumn");
|
|
317
|
+
return Ct(l, this.columns, { prevId: 0, idPrefix: t });
|
|
318
318
|
}
|
|
319
|
-
), this.mapColumns =
|
|
320
|
-
(e, t) =>
|
|
321
|
-
), this.filterColumnsByMediaProp = (e) => e.filter((t) =>
|
|
322
|
-
this.props.selectedField && e.filter((
|
|
323
|
-
|
|
319
|
+
), this.mapColumns = y(
|
|
320
|
+
(e, t) => Je(e, !0)
|
|
321
|
+
), this.filterColumnsByMediaProp = (e) => e.filter((t) => M && t && t.media ? window.matchMedia(t.media).matches : t), this.configureColumns = y((e, t, s) => {
|
|
322
|
+
this.props.selectedField && e.filter((g) => g.field === this.props.selectedField).forEach((g) => {
|
|
323
|
+
g.width = g.width || "50px", g.cell = g.cell || it, g.headerCell = g.headerCell || It;
|
|
324
324
|
});
|
|
325
|
-
const l = {
|
|
325
|
+
const { unstyled: l } = this.props, d = l && l.uGrid ? l.uGrid : he, p = {
|
|
326
326
|
id: "",
|
|
327
327
|
resizable: !0,
|
|
328
328
|
width: "32px",
|
|
@@ -343,22 +343,22 @@ const z = class z extends r.Component {
|
|
|
343
343
|
};
|
|
344
344
|
let h = 0;
|
|
345
345
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
346
|
-
...
|
|
347
|
-
cell:
|
|
346
|
+
...p,
|
|
347
|
+
cell: ot,
|
|
348
348
|
field: this.props.expandField,
|
|
349
|
-
headerClassName:
|
|
349
|
+
headerClassName: m(d.hierarchyCell({}))
|
|
350
350
|
}), h++);
|
|
351
|
-
for (let
|
|
351
|
+
for (let g = 0; g < t; g++)
|
|
352
352
|
e.unshift({
|
|
353
|
-
...
|
|
353
|
+
...p,
|
|
354
354
|
isAccessible: !1,
|
|
355
|
-
cell:
|
|
355
|
+
cell: Ee,
|
|
356
356
|
field: "value",
|
|
357
357
|
locked: this.props.lockGroups
|
|
358
358
|
}), h++;
|
|
359
|
-
e.slice(h).forEach((
|
|
360
|
-
}), this.getHeaderRow =
|
|
361
|
-
|
|
359
|
+
e.slice(h).forEach((g) => g.parentIndex >= 0 && (g.parentIndex += h));
|
|
360
|
+
}), this.getHeaderRow = y((e, t, s, l, d, p, h, g, v, z, E, G, O) => /* @__PURE__ */ r.createElement(
|
|
361
|
+
lt,
|
|
362
362
|
{
|
|
363
363
|
cells: this.props.cells,
|
|
364
364
|
sort: e,
|
|
@@ -367,21 +367,21 @@ const z = class z extends r.Component {
|
|
|
367
367
|
group: s || [],
|
|
368
368
|
groupable: l,
|
|
369
369
|
groupChange: this.groupChange,
|
|
370
|
-
filter:
|
|
371
|
-
filterable:
|
|
372
|
-
filterOperators:
|
|
370
|
+
filter: d,
|
|
371
|
+
filterable: p,
|
|
372
|
+
filterOperators: h,
|
|
373
373
|
filterChange: this.filterChange,
|
|
374
|
-
columnMenu:
|
|
375
|
-
columnMenuIcon:
|
|
374
|
+
columnMenu: v,
|
|
375
|
+
columnMenuIcon: z,
|
|
376
376
|
selectionChange: this.onHeaderSelectionChange,
|
|
377
|
-
columns:
|
|
377
|
+
columns: E,
|
|
378
378
|
columnResize: this.columnResize,
|
|
379
379
|
pressHandler: this.dragLogic.pressHandler,
|
|
380
380
|
dragHandler: this.dragLogic.dragHandler,
|
|
381
381
|
releaseHandler: this.dragLogic.releaseHandler,
|
|
382
|
-
columnsMap:
|
|
383
|
-
cellRender:
|
|
384
|
-
isRtl:
|
|
382
|
+
columnsMap: G,
|
|
383
|
+
cellRender: g,
|
|
384
|
+
isRtl: O,
|
|
385
385
|
dragClue: this.dragLogic.dragClueRef,
|
|
386
386
|
headerRef: this.headerElementRef,
|
|
387
387
|
containerRef: this.containerRef,
|
|
@@ -396,15 +396,15 @@ const z = class z extends r.Component {
|
|
|
396
396
|
if (this.tableBodyRef.current && ((e = this.tableBodyRef.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
397
397
|
this._singleEditRow = !1, (t = document.activeElement) != null && t.closest(".k-grid-edit-row") ? this._lastActiveElement = document.activeElement : this._lastActiveElement = void 0;
|
|
398
398
|
const l = Array.from((s = this.tableBodyRef.current) == null ? void 0 : s.getElementsByClassName("k-grid-edit-row"));
|
|
399
|
-
l.length > this.rowsInEdit.length ? this._newEditableRow = l.filter((
|
|
399
|
+
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;
|
|
400
400
|
}
|
|
401
|
-
},
|
|
402
|
-
const
|
|
403
|
-
this.vs = new c(
|
|
401
|
+
}, Ue(Ie), this.showLicenseWatermark = $e(Ie);
|
|
402
|
+
const n = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
403
|
+
this.vs = new c(n || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new bt(
|
|
404
404
|
this.columnReorder.bind(this),
|
|
405
405
|
this.groupReorder.bind(this),
|
|
406
406
|
this.columnToGroup.bind(this)
|
|
407
|
-
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new
|
|
407
|
+
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new mt(this.onResize), this.props.clipboard && (this.clipboardService = new Xe(this.onClipboard)), T.onConstructor({
|
|
408
408
|
navigatable: !!a.navigatable,
|
|
409
409
|
contextStateRef: this.contextStateRef,
|
|
410
410
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -452,8 +452,8 @@ const z = class z extends r.Component {
|
|
|
452
452
|
*/
|
|
453
453
|
// tslint:enable:max-line-length
|
|
454
454
|
get columns() {
|
|
455
|
-
const a = this._columns.filter((
|
|
456
|
-
return
|
|
455
|
+
const a = this._columns.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
456
|
+
return Rt(a);
|
|
457
457
|
}
|
|
458
458
|
/**
|
|
459
459
|
* Returns the HTML element of the Grid component.
|
|
@@ -462,7 +462,7 @@ const z = class z extends r.Component {
|
|
|
462
462
|
return this._element;
|
|
463
463
|
}
|
|
464
464
|
get document() {
|
|
465
|
-
if (
|
|
465
|
+
if (M)
|
|
466
466
|
return this.element && this.element.ownerDocument || document;
|
|
467
467
|
}
|
|
468
468
|
get _header() {
|
|
@@ -476,24 +476,24 @@ const z = class z extends r.Component {
|
|
|
476
476
|
*/
|
|
477
477
|
componentDidMount() {
|
|
478
478
|
var c;
|
|
479
|
-
this.props.columnVirtualization && !navigator.userAgent.match(
|
|
480
|
-
const a =
|
|
481
|
-
this.isRtl = a,
|
|
479
|
+
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());
|
|
480
|
+
const a = Ye(this.element);
|
|
481
|
+
this.isRtl = a, T.onComponentDidMount({
|
|
482
482
|
scope: this.element || void 0,
|
|
483
483
|
contextStateRef: this.contextStateRef,
|
|
484
484
|
navigationStateRef: this.navigationStateRef
|
|
485
485
|
}), this.isRtl && this.forceUpdate();
|
|
486
|
-
const
|
|
486
|
+
const n = {
|
|
487
487
|
rootMargin: "0px",
|
|
488
488
|
threshold: 0.9
|
|
489
489
|
};
|
|
490
|
-
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer =
|
|
490
|
+
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);
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
493
|
* @hidden
|
|
494
494
|
*/
|
|
495
495
|
getSnapshotBeforeUpdate() {
|
|
496
|
-
return
|
|
496
|
+
return T.onGetSnapshotBeforeUpdate({
|
|
497
497
|
document: this.document,
|
|
498
498
|
contextStateRef: this.contextStateRef,
|
|
499
499
|
navigationStateRef: this.navigationStateRef
|
|
@@ -503,7 +503,7 @@ const z = class z extends r.Component {
|
|
|
503
503
|
* @hidden
|
|
504
504
|
*/
|
|
505
505
|
componentDidUpdate() {
|
|
506
|
-
this.resetTableWidth(),
|
|
506
|
+
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({
|
|
507
507
|
scope: this.element || void 0,
|
|
508
508
|
contextStateRef: this.contextStateRef,
|
|
509
509
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -525,29 +525,29 @@ const z = class z extends r.Component {
|
|
|
525
525
|
* @hidden
|
|
526
526
|
*/
|
|
527
527
|
render() {
|
|
528
|
-
var
|
|
528
|
+
var ae;
|
|
529
529
|
let a = this.props.total || 0;
|
|
530
|
-
const
|
|
531
|
-
let
|
|
532
|
-
Array.isArray(this.props.data) ? (
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
const n = D.getIdPrefix(this.navigationStateRef), c = pt(this), { unstyled: e, size: t = "medium" } = this.props, s = e && e.uGrid ? e.uGrid : he;
|
|
531
|
+
let l = [];
|
|
532
|
+
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);
|
|
533
|
+
const d = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", p = this.props.scrollable === "virtual", { resolvedGroupsCount: h, flattedData: g } = this.flatData(
|
|
534
|
+
l,
|
|
535
|
+
d,
|
|
536
536
|
this.props.skip || 0,
|
|
537
537
|
this.props.group,
|
|
538
538
|
this.props.expandField,
|
|
539
539
|
this.props.filter,
|
|
540
540
|
this.props.sort
|
|
541
541
|
);
|
|
542
|
-
this._data =
|
|
543
|
-
const
|
|
544
|
-
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable =
|
|
545
|
-
const
|
|
546
|
-
this.initializeVirtualization(a,
|
|
547
|
-
const
|
|
548
|
-
this.initColumns(
|
|
549
|
-
const
|
|
550
|
-
|
|
542
|
+
this._data = g;
|
|
543
|
+
const v = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
|
|
544
|
+
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = v;
|
|
545
|
+
const z = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
|
|
546
|
+
this.initializeVirtualization(a, v);
|
|
547
|
+
const E = this.childrenToArray(this.props.children);
|
|
548
|
+
this.initColumns(E, h);
|
|
549
|
+
const G = E.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), O = E.filter((i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"), j = E.filter((i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"), R = this._columns.filter((i) => i.children.length === 0), q = v && /* @__PURE__ */ r.createElement(
|
|
550
|
+
ht,
|
|
551
551
|
{
|
|
552
552
|
group: this.props.group || [],
|
|
553
553
|
groupChange: this.groupChange,
|
|
@@ -559,41 +559,40 @@ const z = class z extends r.Component {
|
|
|
559
559
|
ariaControls: this._gridId,
|
|
560
560
|
onContextMenu: this.onContextMenu
|
|
561
561
|
}
|
|
562
|
-
), { sort:
|
|
563
|
-
|
|
562
|
+
), { sort: _e, sortable: xe, group: ke, filter: Te, filterable: De, filterOperators: He = Se, headerCellRender: ze, columnMenu: Ae, columnMenuIcon: Fe } = this.props, J = /* @__PURE__ */ r.createElement(
|
|
563
|
+
at,
|
|
564
564
|
{
|
|
565
|
-
size:
|
|
565
|
+
size: t,
|
|
566
566
|
columnResize: this.columnResize,
|
|
567
567
|
staticHeaders: this.props.scrollable !== "none",
|
|
568
568
|
scrollableDataElement: () => this.vs.container,
|
|
569
569
|
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
570
|
-
draggable: this.props.reorderable ||
|
|
570
|
+
draggable: this.props.reorderable || v,
|
|
571
571
|
ref: this.headerRef,
|
|
572
572
|
elemRef: this.headerElementRef,
|
|
573
|
-
className: this.props.headerClassName,
|
|
574
573
|
headerRow: this.getHeaderRow(
|
|
575
|
-
we,
|
|
576
|
-
ye,
|
|
577
|
-
Ee,
|
|
578
|
-
n,
|
|
579
|
-
Se,
|
|
580
|
-
Ie,
|
|
581
|
-
ke,
|
|
582
574
|
_e,
|
|
583
575
|
xe,
|
|
576
|
+
ke,
|
|
577
|
+
v,
|
|
578
|
+
Te,
|
|
579
|
+
De,
|
|
580
|
+
He,
|
|
584
581
|
ze,
|
|
582
|
+
Ae,
|
|
583
|
+
Fe,
|
|
585
584
|
this._columns,
|
|
586
585
|
this._columnsMap,
|
|
587
586
|
this.isRtl
|
|
588
587
|
),
|
|
589
588
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
590
|
-
|
|
589
|
+
nt,
|
|
591
590
|
{
|
|
592
591
|
cells: this.props.cells,
|
|
593
|
-
size:
|
|
592
|
+
size: t,
|
|
594
593
|
columns: this._columns,
|
|
595
594
|
filter: this.props.filter,
|
|
596
|
-
filterOperators: this.props.filterOperators ||
|
|
595
|
+
filterOperators: this.props.filterOperators || Se,
|
|
597
596
|
filterChange: this.filterChange,
|
|
598
597
|
sort: this.props.sort,
|
|
599
598
|
cellRender: this.props.filterCellRender,
|
|
@@ -602,65 +601,67 @@ const z = class z extends r.Component {
|
|
|
602
601
|
ariaRowIndex: this._columnsMap.length + 1
|
|
603
602
|
}
|
|
604
603
|
) || void 0,
|
|
605
|
-
cols:
|
|
604
|
+
cols: R.map((i, f) => /* @__PURE__ */ r.createElement(
|
|
606
605
|
"col",
|
|
607
606
|
{
|
|
608
|
-
key:
|
|
609
|
-
width:
|
|
607
|
+
key: f.toString(),
|
|
608
|
+
width: U(i)
|
|
610
609
|
}
|
|
611
610
|
))
|
|
612
611
|
}
|
|
613
|
-
),
|
|
612
|
+
), Ne = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, Le = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: Me, hiddenColumns: Ge } = Qe({
|
|
614
613
|
enabled: this.props.columnVirtualization,
|
|
615
|
-
columns:
|
|
616
|
-
tableViewPortWidth:
|
|
617
|
-
scrollLeft:
|
|
618
|
-
}),
|
|
614
|
+
columns: R,
|
|
615
|
+
tableViewPortWidth: Le,
|
|
616
|
+
scrollLeft: Ne
|
|
617
|
+
}), Oe = (i, f, b, F) => {
|
|
619
618
|
let k = !1;
|
|
620
|
-
const S = this.props.selectedField ?
|
|
619
|
+
const S = this.props.selectedField ? ye(this.props.selectedField, i.dataItem) : void 0;
|
|
621
620
|
return {
|
|
622
|
-
row:
|
|
623
|
-
if (
|
|
621
|
+
row: R.map((u, C) => {
|
|
622
|
+
if (Ge[C])
|
|
624
623
|
return null;
|
|
625
|
-
const
|
|
626
|
-
let
|
|
624
|
+
const N = u.id ? u.id : C, w = m(s.contentSticky({ locked: u.locked }), u.className), I = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
|
|
625
|
+
let K = !1;
|
|
627
626
|
if (u.editable && this.props.editField) {
|
|
628
|
-
const
|
|
629
|
-
|
|
627
|
+
const x = ye(this.props.editField, i.dataItem);
|
|
628
|
+
x && (x === !0 || x === u.field) && (k = !0, K = !0);
|
|
630
629
|
}
|
|
631
|
-
const
|
|
630
|
+
const L = u.cell || K && rt || Et, _ = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
632
631
|
return /* @__PURE__ */ r.createElement(
|
|
633
|
-
|
|
632
|
+
L,
|
|
634
633
|
{
|
|
635
634
|
onContextMenu: this.onContextMenu,
|
|
636
|
-
key:
|
|
635
|
+
key: N,
|
|
637
636
|
locked: this.props.lockGroups,
|
|
638
|
-
id:
|
|
639
|
-
`${
|
|
640
|
-
|
|
641
|
-
|
|
637
|
+
id: D.generateNavigatableId(
|
|
638
|
+
`${f}-${String(C)}`,
|
|
639
|
+
n,
|
|
640
|
+
_ || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
642
641
|
),
|
|
643
|
-
colSpan:
|
|
642
|
+
colSpan: Me[C],
|
|
644
643
|
dataItem: i.dataItem,
|
|
645
644
|
field: u.field,
|
|
646
645
|
editor: u.editor,
|
|
647
646
|
format: u.format,
|
|
648
|
-
className:
|
|
647
|
+
className: w,
|
|
649
648
|
render: this.props.cellRender,
|
|
650
|
-
cells:
|
|
649
|
+
cells: yt(this.props.cells, u.cells),
|
|
651
650
|
onChange: this.itemChange,
|
|
652
|
-
selectionChange: this.props.onSelectionChange ? (
|
|
653
|
-
this.selectionChange({ event:
|
|
651
|
+
selectionChange: this.props.onSelectionChange ? (x) => {
|
|
652
|
+
this.selectionChange({ event: x, dataItem: i.dataItem, dataIndex: b, columnIndex: C });
|
|
654
653
|
} : void 0,
|
|
655
|
-
columnIndex:
|
|
656
|
-
columnsCount:
|
|
654
|
+
columnIndex: C,
|
|
655
|
+
columnsCount: R.length,
|
|
657
656
|
rowType: i.rowType,
|
|
658
657
|
level: i.level,
|
|
659
658
|
expanded: i.expanded,
|
|
660
659
|
dataIndex: i.dataIndex,
|
|
661
|
-
style:
|
|
660
|
+
style: I,
|
|
662
661
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
663
|
-
isSelected: Array.isArray(S) && S.indexOf(
|
|
662
|
+
isSelected: Array.isArray(S) && S.indexOf(C) > -1,
|
|
663
|
+
isSorted: !!we(u.field, this.props.sort),
|
|
664
|
+
isAlt: F
|
|
664
665
|
}
|
|
665
666
|
);
|
|
666
667
|
}),
|
|
@@ -668,73 +669,72 @@ const z = class z extends r.Component {
|
|
|
668
669
|
isSelected: typeof S == "boolean" && S
|
|
669
670
|
};
|
|
670
671
|
};
|
|
671
|
-
let
|
|
672
|
-
if (
|
|
672
|
+
let X = 0;
|
|
673
|
+
if (p)
|
|
673
674
|
for (let i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
676
|
-
this._data.push(
|
|
675
|
+
const f = this._data.shift();
|
|
676
|
+
if (f)
|
|
677
|
+
this._data.push(f), X++, f.rowType === "groupHeader" && i--;
|
|
677
678
|
else
|
|
678
679
|
break;
|
|
679
680
|
}
|
|
680
|
-
const
|
|
681
|
-
let
|
|
682
|
-
const
|
|
683
|
-
let
|
|
684
|
-
const
|
|
685
|
-
let
|
|
681
|
+
const Y = (i) => i >= this._data.length - X;
|
|
682
|
+
let Q = this.vs.realSkip || 0;
|
|
683
|
+
const P = [];
|
|
684
|
+
let B = !1;
|
|
685
|
+
const Z = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
686
|
+
let A = 0;
|
|
686
687
|
if (this._data.length) {
|
|
687
|
-
let i = -1,
|
|
688
|
-
(this._slicedData || this._data).forEach((
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
|
|
688
|
+
let i = -1, f = 0;
|
|
689
|
+
(this._slicedData || this._data).forEach((b, F) => {
|
|
690
|
+
b.rowType === "data" && (Q++, i++);
|
|
691
|
+
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);
|
|
692
|
+
if (A = u + Z + f, P.push(/* @__PURE__ */ r.createElement(
|
|
693
|
+
St,
|
|
693
694
|
{
|
|
694
|
-
key:
|
|
695
|
-
dataItem:
|
|
696
|
-
isAltRow:
|
|
695
|
+
key: C,
|
|
696
|
+
dataItem: b.dataItem,
|
|
697
|
+
isAltRow: k,
|
|
697
698
|
isInEdit: w.isInEdit,
|
|
698
|
-
rowType:
|
|
699
|
-
isHidden:
|
|
700
|
-
onClick: (
|
|
701
|
-
onDoubleClick: (
|
|
699
|
+
rowType: b.rowType,
|
|
700
|
+
isHidden: Y(F),
|
|
701
|
+
onClick: (I) => this.rowClick(I, b),
|
|
702
|
+
onDoubleClick: (I) => this.rowDblClick(I, b),
|
|
702
703
|
selectedField: this.props.selectedField,
|
|
703
704
|
rowHeight: this.props.rowHeight,
|
|
704
705
|
render: this.props.rowRender,
|
|
705
|
-
ariaRowIndex:
|
|
706
|
-
absoluteRowIndex:
|
|
707
|
-
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ?
|
|
706
|
+
ariaRowIndex: A,
|
|
707
|
+
absoluteRowIndex: u,
|
|
708
|
+
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? u : i,
|
|
708
709
|
isSelected: w.isSelected
|
|
709
710
|
},
|
|
710
711
|
w.row
|
|
711
|
-
)), this.props.detail &&
|
|
712
|
-
const
|
|
713
|
-
|
|
712
|
+
)), this.props.detail && b.rowType === "data" && b.expanded) {
|
|
713
|
+
const I = R.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
714
|
+
f++, A = u + Z + f, P.push(/* @__PURE__ */ r.createElement(
|
|
714
715
|
"tr",
|
|
715
716
|
{
|
|
716
717
|
key: N,
|
|
717
|
-
className:
|
|
718
|
-
|
|
719
|
-
S ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
718
|
+
className: m(
|
|
719
|
+
s.detailTr({ isAlt: k })
|
|
720
720
|
),
|
|
721
|
-
style: { visibility:
|
|
721
|
+
style: { visibility: Y(F) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
722
722
|
role: "row",
|
|
723
|
-
"aria-rowindex":
|
|
723
|
+
"aria-rowindex": A
|
|
724
724
|
},
|
|
725
|
-
this.props.group && this.props.group.map((
|
|
726
|
-
var
|
|
727
|
-
const
|
|
725
|
+
this.props.group && this.props.group.map((K, L) => {
|
|
726
|
+
var le;
|
|
727
|
+
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 } : {};
|
|
728
728
|
return /* @__PURE__ */ r.createElement(
|
|
729
|
-
|
|
729
|
+
Ee,
|
|
730
730
|
{
|
|
731
731
|
id: "",
|
|
732
|
-
dataIndex:
|
|
733
|
-
field:
|
|
734
|
-
dataItem:
|
|
735
|
-
key:
|
|
736
|
-
style:
|
|
737
|
-
ariaColumnIndex: 1 +
|
|
732
|
+
dataIndex: b.dataIndex,
|
|
733
|
+
field: K.field,
|
|
734
|
+
dataItem: b.dataItem,
|
|
735
|
+
key: L,
|
|
736
|
+
style: x,
|
|
737
|
+
ariaColumnIndex: 1 + L,
|
|
738
738
|
isSelected: !1,
|
|
739
739
|
locked: this.props.lockGroups,
|
|
740
740
|
isRtl: this.isRtl,
|
|
@@ -743,109 +743,112 @@ const z = class z extends r.Component {
|
|
|
743
743
|
);
|
|
744
744
|
}),
|
|
745
745
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
746
|
-
|
|
746
|
+
Dt,
|
|
747
747
|
{
|
|
748
|
-
id:
|
|
748
|
+
id: D.generateNavigatableId(`${N}-dhcell`, n)
|
|
749
749
|
}
|
|
750
750
|
),
|
|
751
751
|
/* @__PURE__ */ r.createElement(
|
|
752
|
-
|
|
752
|
+
Tt,
|
|
753
753
|
{
|
|
754
754
|
onContextMenu: this.onContextMenu,
|
|
755
|
-
dataItem:
|
|
756
|
-
dataIndex:
|
|
757
|
-
colSpan:
|
|
755
|
+
dataItem: b.dataItem,
|
|
756
|
+
dataIndex: b.dataIndex,
|
|
757
|
+
colSpan: I,
|
|
758
758
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
759
759
|
detail: this.props.detail,
|
|
760
|
-
id:
|
|
760
|
+
id: D.generateNavigatableId(`${N}-dcell`, n)
|
|
761
761
|
}
|
|
762
762
|
)
|
|
763
763
|
));
|
|
764
764
|
}
|
|
765
765
|
});
|
|
766
766
|
} else
|
|
767
|
-
|
|
768
|
-
const
|
|
767
|
+
B = !0;
|
|
768
|
+
const Pe = () => {
|
|
769
769
|
const i = this._header;
|
|
770
770
|
return i && i.table && i.table.clientWidth;
|
|
771
|
-
},
|
|
771
|
+
}, ee = () => /* @__PURE__ */ r.createElement(
|
|
772
772
|
"div",
|
|
773
773
|
{
|
|
774
774
|
key: "no-records",
|
|
775
|
-
className:
|
|
776
|
-
style: { width:
|
|
775
|
+
className: m(s.noRecords({})),
|
|
776
|
+
style: { width: Pe() }
|
|
777
777
|
},
|
|
778
|
-
/* @__PURE__ */ r.createElement(
|
|
779
|
-
|
|
780
|
-
|
|
778
|
+
/* @__PURE__ */ r.createElement(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
className: m(s.noRecordsTemplate({})),
|
|
782
|
+
[st]: D.generateNavigatableId("no-records", n)
|
|
783
|
+
},
|
|
784
|
+
O.length ? O : /* @__PURE__ */ r.createElement(_t, null)
|
|
785
|
+
)
|
|
786
|
+
), te = {
|
|
787
|
+
size: t,
|
|
781
788
|
onPageChange: this.pagerPageChange,
|
|
782
789
|
total: a,
|
|
783
790
|
dir: this.isRtl ? "rtl" : void 0,
|
|
784
791
|
skip: this.vs.propsSkip || 0,
|
|
785
792
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
786
|
-
messagesMap:
|
|
787
|
-
...
|
|
788
|
-
},
|
|
793
|
+
messagesMap: ut,
|
|
794
|
+
...kt(this.props.pageable || {})
|
|
795
|
+
}, 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(
|
|
789
796
|
"col",
|
|
790
797
|
{
|
|
791
|
-
key:
|
|
792
|
-
width:
|
|
798
|
+
key: f.toString(),
|
|
799
|
+
width: U(i)
|
|
793
800
|
}
|
|
794
|
-
),
|
|
801
|
+
), ie = (ae = this.props.cells) != null && ae.footerCell || this._columns.some(
|
|
795
802
|
(i) => {
|
|
796
|
-
var
|
|
797
|
-
return !!(i.footerCell || (
|
|
803
|
+
var f;
|
|
804
|
+
return !!(i.footerCell || (f = i.cells) != null && f.footerCell);
|
|
798
805
|
}
|
|
799
806
|
) ? /* @__PURE__ */ r.createElement(
|
|
800
|
-
|
|
807
|
+
dt,
|
|
801
808
|
{
|
|
802
|
-
size:
|
|
809
|
+
size: t,
|
|
803
810
|
columnResize: this.columnResize,
|
|
804
811
|
staticHeaders: this.props.scrollable !== "none",
|
|
805
812
|
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
806
813
|
ref: (i) => this._footer = i,
|
|
807
814
|
row: /* @__PURE__ */ r.createElement(
|
|
808
|
-
|
|
815
|
+
xt,
|
|
809
816
|
{
|
|
810
817
|
cells: this.props.cells,
|
|
811
|
-
idPrefix:
|
|
818
|
+
idPrefix: n,
|
|
812
819
|
columns: this._columns,
|
|
813
820
|
isRtl: this.isRtl,
|
|
814
|
-
ariaRowIndex:
|
|
821
|
+
ariaRowIndex: A + 1
|
|
815
822
|
}
|
|
816
823
|
),
|
|
817
|
-
cols:
|
|
824
|
+
cols: R.map(We)
|
|
818
825
|
}
|
|
819
|
-
) : null,
|
|
826
|
+
) : null, oe = /* @__PURE__ */ r.createElement(
|
|
820
827
|
"colgroup",
|
|
821
828
|
{
|
|
822
829
|
ref: (i) => {
|
|
823
830
|
this.columnResize.colGroupMain = i;
|
|
824
831
|
}
|
|
825
832
|
},
|
|
826
|
-
|
|
827
|
-
(i,
|
|
833
|
+
R.map(
|
|
834
|
+
(i, f) => /* @__PURE__ */ r.createElement(
|
|
828
835
|
"col",
|
|
829
836
|
{
|
|
830
|
-
key:
|
|
831
|
-
className:
|
|
832
|
-
width:
|
|
837
|
+
key: f.toString(),
|
|
838
|
+
className: we(i.field, this.props.sort) ? m(s.sorted({})) : void 0,
|
|
839
|
+
width: U(i)
|
|
833
840
|
}
|
|
834
841
|
)
|
|
835
842
|
)
|
|
836
|
-
),
|
|
843
|
+
), re = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
837
844
|
if (this.props.scrollable === "none")
|
|
838
|
-
return /* @__PURE__ */ r.createElement(
|
|
845
|
+
return /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
839
846
|
"div",
|
|
840
847
|
{
|
|
841
848
|
id: this.props.id,
|
|
842
849
|
style: this.props.style,
|
|
843
|
-
className:
|
|
844
|
-
|
|
845
|
-
{
|
|
846
|
-
"k-grid-md": !this.props.size,
|
|
847
|
-
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
848
|
-
},
|
|
850
|
+
className: m(
|
|
851
|
+
s.wrapper({ size: t }),
|
|
849
852
|
this.props.className
|
|
850
853
|
),
|
|
851
854
|
ref: (i) => {
|
|
@@ -854,12 +857,12 @@ const z = class z extends r.Component {
|
|
|
854
857
|
"aria-label": this.props.ariaLabel,
|
|
855
858
|
onKeyDown: this.onKeyDown,
|
|
856
859
|
onFocus: this.onFocus,
|
|
857
|
-
...
|
|
860
|
+
...ce
|
|
858
861
|
},
|
|
859
|
-
|
|
860
|
-
|
|
862
|
+
G,
|
|
863
|
+
q,
|
|
861
864
|
/* @__PURE__ */ r.createElement(
|
|
862
|
-
|
|
865
|
+
ue,
|
|
863
866
|
{
|
|
864
867
|
selectable: this.props.selectable,
|
|
865
868
|
onRelease: this.selectionRelease,
|
|
@@ -871,34 +874,28 @@ const z = class z extends r.Component {
|
|
|
871
874
|
"table",
|
|
872
875
|
{
|
|
873
876
|
ref: (i) => this.headTable = i,
|
|
874
|
-
className:
|
|
875
|
-
"k-table k-grid-table",
|
|
876
|
-
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
877
|
-
),
|
|
878
|
-
style: { userSelect: d }
|
|
877
|
+
className: m(s.table({ size: t }))
|
|
879
878
|
},
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className:
|
|
883
|
-
|
|
879
|
+
oe,
|
|
880
|
+
J,
|
|
881
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: m(s.tbody({})), ...ge }, P),
|
|
882
|
+
ie
|
|
884
883
|
)
|
|
885
884
|
),
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
),
|
|
889
|
-
let
|
|
890
|
-
return
|
|
885
|
+
B && ee(),
|
|
886
|
+
re && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(fe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(me, { ref: this.dragLogic.refDragElementClue }))
|
|
887
|
+
), j, this.props.pageable && se);
|
|
888
|
+
let W = this.props.style || {};
|
|
889
|
+
return p && (W.height || (W = Object.assign({}, W, { height: "450px" }))), /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
891
890
|
"div",
|
|
892
891
|
{
|
|
893
892
|
id: this.props.id,
|
|
894
|
-
style:
|
|
895
|
-
className:
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
"k-grid-virtual": s
|
|
901
|
-
},
|
|
893
|
+
style: W,
|
|
894
|
+
className: m(
|
|
895
|
+
s.wrapper({
|
|
896
|
+
size: t,
|
|
897
|
+
virtual: p
|
|
898
|
+
}),
|
|
902
899
|
this.props.className
|
|
903
900
|
),
|
|
904
901
|
ref: (i) => {
|
|
@@ -907,31 +904,31 @@ const z = class z extends r.Component {
|
|
|
907
904
|
"aria-label": this.props.ariaLabel,
|
|
908
905
|
onKeyDown: this.onKeyDown,
|
|
909
906
|
onFocus: this.onFocus,
|
|
910
|
-
...
|
|
907
|
+
...ce
|
|
911
908
|
},
|
|
912
|
-
|
|
913
|
-
|
|
909
|
+
G,
|
|
910
|
+
q,
|
|
914
911
|
/* @__PURE__ */ r.createElement(
|
|
915
912
|
"div",
|
|
916
913
|
{
|
|
917
|
-
className:
|
|
914
|
+
className: m(s.ariaRoot({})),
|
|
918
915
|
role: "grid",
|
|
919
|
-
"aria-colcount":
|
|
916
|
+
"aria-colcount": R.length,
|
|
920
917
|
"aria-rowcount": a,
|
|
921
918
|
id: this._gridId,
|
|
922
|
-
"aria-label": c.toLanguageString(
|
|
919
|
+
"aria-label": c.toLanguageString(be, gt[be])
|
|
923
920
|
},
|
|
924
|
-
|
|
925
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
921
|
+
J,
|
|
922
|
+
/* @__PURE__ */ r.createElement("div", { className: m(s.container({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
926
923
|
"div",
|
|
927
924
|
{
|
|
928
925
|
ref: this.containerRef,
|
|
929
|
-
className:
|
|
926
|
+
className: m(s.content({})),
|
|
930
927
|
onScroll: this.scrollHandler,
|
|
931
928
|
role: "presentation"
|
|
932
929
|
},
|
|
933
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
934
|
-
|
|
930
|
+
/* @__PURE__ */ r.createElement("div", { className: m(s.tableWrap({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
931
|
+
ue,
|
|
935
932
|
{
|
|
936
933
|
selectable: this.props.selectable,
|
|
937
934
|
onRelease: this.selectionRelease,
|
|
@@ -943,42 +940,40 @@ const z = class z extends r.Component {
|
|
|
943
940
|
"table",
|
|
944
941
|
{
|
|
945
942
|
ref: (i) => this.tableElement = i,
|
|
946
|
-
className:
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
951
|
-
}
|
|
943
|
+
className: m(
|
|
944
|
+
s.table({
|
|
945
|
+
size: t
|
|
946
|
+
})
|
|
952
947
|
),
|
|
953
948
|
role: "presentation",
|
|
954
|
-
style: { userSelect:
|
|
949
|
+
style: { userSelect: z }
|
|
955
950
|
},
|
|
956
|
-
|
|
951
|
+
oe,
|
|
957
952
|
/* @__PURE__ */ r.createElement(
|
|
958
953
|
"tbody",
|
|
959
954
|
{
|
|
960
|
-
className:
|
|
955
|
+
className: m(s.tbody({})),
|
|
961
956
|
ref: this.tableBodyRef,
|
|
962
957
|
role: "rowgroup",
|
|
963
|
-
...
|
|
958
|
+
...ge
|
|
964
959
|
},
|
|
965
|
-
|
|
960
|
+
P
|
|
966
961
|
)
|
|
967
962
|
)
|
|
968
|
-
),
|
|
969
|
-
|
|
963
|
+
), B && ee()),
|
|
964
|
+
p && /* @__PURE__ */ r.createElement("div", { className: m(s.heightContainer({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
970
965
|
"div",
|
|
971
966
|
{
|
|
972
|
-
style:
|
|
967
|
+
style: p ? { height: this.vs.containerHeight + "px" } : {}
|
|
973
968
|
}
|
|
974
969
|
))
|
|
975
970
|
)),
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
971
|
+
ie,
|
|
972
|
+
re && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(fe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(me, { ref: this.dragLogic.refDragElementClue })),
|
|
973
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(qe, null)
|
|
979
974
|
),
|
|
980
|
-
|
|
981
|
-
this.props.pageable &&
|
|
975
|
+
j,
|
|
976
|
+
this.props.pageable && se
|
|
982
977
|
));
|
|
983
978
|
}
|
|
984
979
|
calculateMedia() {
|
|
@@ -986,8 +981,8 @@ const z = class z extends r.Component {
|
|
|
986
981
|
}
|
|
987
982
|
selectionChange(a) {
|
|
988
983
|
if (this.props.onSelectionChange) {
|
|
989
|
-
const { event:
|
|
990
|
-
...this.getArguments(
|
|
984
|
+
const { event: n, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: s, cell: l } = pe(this.props.selectable), d = {
|
|
985
|
+
...this.getArguments(n.syntheticEvent),
|
|
991
986
|
dataItem: c,
|
|
992
987
|
startColIndex: t,
|
|
993
988
|
endColIndex: t,
|
|
@@ -1004,13 +999,13 @@ const z = class z extends r.Component {
|
|
|
1004
999
|
componentId: this._gridId,
|
|
1005
1000
|
selectedField: this.props.selectedField || ""
|
|
1006
1001
|
};
|
|
1007
|
-
this.props.onSelectionChange.call(void 0,
|
|
1002
|
+
this.props.onSelectionChange.call(void 0, d);
|
|
1008
1003
|
}
|
|
1009
1004
|
}
|
|
1010
|
-
raiseDataEvent(a,
|
|
1005
|
+
raiseDataEvent(a, n, c, e, t) {
|
|
1011
1006
|
const s = this.props.onDataStateChange;
|
|
1012
1007
|
if (a) {
|
|
1013
|
-
const l = { ...this.getArguments(e), ...
|
|
1008
|
+
const l = { ...this.getArguments(e), ...n, targetEvent: t };
|
|
1014
1009
|
a.call(void 0, l);
|
|
1015
1010
|
} else
|
|
1016
1011
|
s && s.call(
|
|
@@ -1025,60 +1020,60 @@ const z = class z extends r.Component {
|
|
|
1025
1020
|
}
|
|
1026
1021
|
);
|
|
1027
1022
|
}
|
|
1028
|
-
columnReorder(a,
|
|
1029
|
-
const e = this._columns[a], t = e.depth, s = (
|
|
1023
|
+
columnReorder(a, n, c) {
|
|
1024
|
+
const e = this._columns[a], t = e.depth, s = (h) => {
|
|
1030
1025
|
do
|
|
1031
|
-
|
|
1032
|
-
while (
|
|
1033
|
-
return
|
|
1026
|
+
h++;
|
|
1027
|
+
while (h < this._columns.length && this._columns[h].depth > t);
|
|
1028
|
+
return h;
|
|
1034
1029
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1035
|
-
this._columns.splice(a <
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1030
|
+
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++;
|
|
1031
|
+
const d = this._columns[a].locked && this._columns[n].locked;
|
|
1032
|
+
et(this._columnsMap, this._columns, d || this._shouldUpdateLeftRight), tt(this._columnsMap, this._columns, d || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
1033
|
+
const p = this.columns;
|
|
1039
1034
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1040
|
-
const
|
|
1035
|
+
const h = {
|
|
1041
1036
|
target: this,
|
|
1042
|
-
columns:
|
|
1037
|
+
columns: p,
|
|
1043
1038
|
columnId: e.id,
|
|
1044
1039
|
nativeEvent: c
|
|
1045
1040
|
};
|
|
1046
|
-
this.props.onColumnReorder.call(void 0,
|
|
1041
|
+
this.props.onColumnReorder.call(void 0, h);
|
|
1047
1042
|
}
|
|
1048
1043
|
}
|
|
1049
|
-
groupReorder(a,
|
|
1044
|
+
groupReorder(a, n, c) {
|
|
1050
1045
|
if (this.props.group === void 0)
|
|
1051
1046
|
return;
|
|
1052
1047
|
const e = this.props.group.slice();
|
|
1053
|
-
e.splice(
|
|
1048
|
+
e.splice(n, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
1054
1049
|
}
|
|
1055
|
-
columnToGroup(a,
|
|
1050
|
+
columnToGroup(a, n, c) {
|
|
1056
1051
|
const e = this._columns[a].field;
|
|
1057
1052
|
if (!e)
|
|
1058
1053
|
return;
|
|
1059
1054
|
const t = (this.props.group || []).slice();
|
|
1060
|
-
t.splice(
|
|
1055
|
+
t.splice(n, 0, { field: e }), this.groupChange(t, c);
|
|
1061
1056
|
}
|
|
1062
|
-
columnGroupChange(a,
|
|
1057
|
+
columnGroupChange(a, n) {
|
|
1063
1058
|
const c = this.dragLogic.getCurrentGroupsLength;
|
|
1064
|
-
this.columnToGroup(a, c,
|
|
1059
|
+
this.columnToGroup(a, c, n);
|
|
1065
1060
|
}
|
|
1066
1061
|
resetTableWidth() {
|
|
1067
1062
|
let a = 0;
|
|
1068
1063
|
if (!this.columnResize.colGroupMain)
|
|
1069
1064
|
return;
|
|
1070
|
-
const
|
|
1071
|
-
for (let c = 0; c <
|
|
1072
|
-
const e =
|
|
1065
|
+
const n = this.columnResize.colGroupMain.children;
|
|
1066
|
+
for (let c = 0; c < n.length; c++) {
|
|
1067
|
+
const e = n[c].width;
|
|
1073
1068
|
if (!e)
|
|
1074
1069
|
return;
|
|
1075
1070
|
a += parseFloat(e.toString());
|
|
1076
1071
|
}
|
|
1077
1072
|
a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
|
|
1078
1073
|
}
|
|
1079
|
-
initColumns(a,
|
|
1080
|
-
const c =
|
|
1081
|
-
this._columns = t, this._columns.length === 0 && (this._columns =
|
|
1074
|
+
initColumns(a, n) {
|
|
1075
|
+
const c = D.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = this.filterColumnsByMediaProp(e);
|
|
1076
|
+
this._columns = t, this._columns.length === 0 && (this._columns = wt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, n, c), this._columnsMap = this.mapColumns(this._columns, this._columnsMutations), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1082
1077
|
}
|
|
1083
1078
|
getDataState() {
|
|
1084
1079
|
return {
|
|
@@ -1097,9 +1092,9 @@ const z = class z extends r.Component {
|
|
|
1097
1092
|
};
|
|
1098
1093
|
}
|
|
1099
1094
|
};
|
|
1100
|
-
|
|
1095
|
+
H.displayName = "KendoReactGrid", H.defaultProps = {
|
|
1101
1096
|
// never use this
|
|
1102
|
-
},
|
|
1097
|
+
}, H.propTypes = {
|
|
1103
1098
|
data: o.oneOfType([
|
|
1104
1099
|
o.array,
|
|
1105
1100
|
o.shape({
|
|
@@ -1180,9 +1175,9 @@ z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
|
1180
1175
|
})
|
|
1181
1176
|
]),
|
|
1182
1177
|
size: o.oneOf(["small", "medium"])
|
|
1183
|
-
},
|
|
1184
|
-
let
|
|
1185
|
-
|
|
1178
|
+
}, H.contextType = V;
|
|
1179
|
+
let $ = H;
|
|
1180
|
+
ct($);
|
|
1186
1181
|
export {
|
|
1187
|
-
|
|
1182
|
+
$ as Grid
|
|
1188
1183
|
};
|