@progress/kendo-react-grid 8.3.0-develop.1 → 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 +337 -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 +21 -33
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +83 -77
- package/index.d.mts +10 -12
- package/index.d.ts +10 -12
- 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,40 +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
573
|
headerRow: this.getHeaderRow(
|
|
574
|
-
we,
|
|
575
|
-
ye,
|
|
576
|
-
Ee,
|
|
577
|
-
n,
|
|
578
|
-
Se,
|
|
579
|
-
Ie,
|
|
580
|
-
ke,
|
|
581
574
|
_e,
|
|
582
575
|
xe,
|
|
576
|
+
ke,
|
|
577
|
+
v,
|
|
578
|
+
Te,
|
|
579
|
+
De,
|
|
580
|
+
He,
|
|
583
581
|
ze,
|
|
582
|
+
Ae,
|
|
583
|
+
Fe,
|
|
584
584
|
this._columns,
|
|
585
585
|
this._columnsMap,
|
|
586
586
|
this.isRtl
|
|
587
587
|
),
|
|
588
588
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
589
|
-
|
|
589
|
+
nt,
|
|
590
590
|
{
|
|
591
591
|
cells: this.props.cells,
|
|
592
|
-
size:
|
|
592
|
+
size: t,
|
|
593
593
|
columns: this._columns,
|
|
594
594
|
filter: this.props.filter,
|
|
595
|
-
filterOperators: this.props.filterOperators ||
|
|
595
|
+
filterOperators: this.props.filterOperators || Se,
|
|
596
596
|
filterChange: this.filterChange,
|
|
597
597
|
sort: this.props.sort,
|
|
598
598
|
cellRender: this.props.filterCellRender,
|
|
@@ -601,65 +601,67 @@ const z = class z extends r.Component {
|
|
|
601
601
|
ariaRowIndex: this._columnsMap.length + 1
|
|
602
602
|
}
|
|
603
603
|
) || void 0,
|
|
604
|
-
cols:
|
|
604
|
+
cols: R.map((i, f) => /* @__PURE__ */ r.createElement(
|
|
605
605
|
"col",
|
|
606
606
|
{
|
|
607
|
-
key:
|
|
608
|
-
width:
|
|
607
|
+
key: f.toString(),
|
|
608
|
+
width: U(i)
|
|
609
609
|
}
|
|
610
610
|
))
|
|
611
611
|
}
|
|
612
|
-
),
|
|
612
|
+
), Ne = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, Le = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: Me, hiddenColumns: Ge } = Qe({
|
|
613
613
|
enabled: this.props.columnVirtualization,
|
|
614
|
-
columns:
|
|
615
|
-
tableViewPortWidth:
|
|
616
|
-
scrollLeft:
|
|
617
|
-
}),
|
|
614
|
+
columns: R,
|
|
615
|
+
tableViewPortWidth: Le,
|
|
616
|
+
scrollLeft: Ne
|
|
617
|
+
}), Oe = (i, f, b, F) => {
|
|
618
618
|
let k = !1;
|
|
619
|
-
const S = this.props.selectedField ?
|
|
619
|
+
const S = this.props.selectedField ? ye(this.props.selectedField, i.dataItem) : void 0;
|
|
620
620
|
return {
|
|
621
|
-
row:
|
|
622
|
-
if (
|
|
621
|
+
row: R.map((u, C) => {
|
|
622
|
+
if (Ge[C])
|
|
623
623
|
return null;
|
|
624
|
-
const
|
|
625
|
-
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;
|
|
626
626
|
if (u.editable && this.props.editField) {
|
|
627
|
-
const
|
|
628
|
-
|
|
627
|
+
const x = ye(this.props.editField, i.dataItem);
|
|
628
|
+
x && (x === !0 || x === u.field) && (k = !0, K = !0);
|
|
629
629
|
}
|
|
630
|
-
const
|
|
630
|
+
const L = u.cell || K && rt || Et, _ = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
631
631
|
return /* @__PURE__ */ r.createElement(
|
|
632
|
-
|
|
632
|
+
L,
|
|
633
633
|
{
|
|
634
634
|
onContextMenu: this.onContextMenu,
|
|
635
|
-
key:
|
|
635
|
+
key: N,
|
|
636
636
|
locked: this.props.lockGroups,
|
|
637
|
-
id:
|
|
638
|
-
`${
|
|
639
|
-
|
|
640
|
-
|
|
637
|
+
id: D.generateNavigatableId(
|
|
638
|
+
`${f}-${String(C)}`,
|
|
639
|
+
n,
|
|
640
|
+
_ || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
641
641
|
),
|
|
642
|
-
colSpan:
|
|
642
|
+
colSpan: Me[C],
|
|
643
643
|
dataItem: i.dataItem,
|
|
644
644
|
field: u.field,
|
|
645
645
|
editor: u.editor,
|
|
646
646
|
format: u.format,
|
|
647
|
-
className:
|
|
647
|
+
className: w,
|
|
648
648
|
render: this.props.cellRender,
|
|
649
|
-
cells:
|
|
649
|
+
cells: yt(this.props.cells, u.cells),
|
|
650
650
|
onChange: this.itemChange,
|
|
651
|
-
selectionChange: this.props.onSelectionChange ? (
|
|
652
|
-
this.selectionChange({ event:
|
|
651
|
+
selectionChange: this.props.onSelectionChange ? (x) => {
|
|
652
|
+
this.selectionChange({ event: x, dataItem: i.dataItem, dataIndex: b, columnIndex: C });
|
|
653
653
|
} : void 0,
|
|
654
|
-
columnIndex:
|
|
655
|
-
columnsCount:
|
|
654
|
+
columnIndex: C,
|
|
655
|
+
columnsCount: R.length,
|
|
656
656
|
rowType: i.rowType,
|
|
657
657
|
level: i.level,
|
|
658
658
|
expanded: i.expanded,
|
|
659
659
|
dataIndex: i.dataIndex,
|
|
660
|
-
style:
|
|
660
|
+
style: I,
|
|
661
661
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
662
|
-
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
|
|
663
665
|
}
|
|
664
666
|
);
|
|
665
667
|
}),
|
|
@@ -667,73 +669,72 @@ const z = class z extends r.Component {
|
|
|
667
669
|
isSelected: typeof S == "boolean" && S
|
|
668
670
|
};
|
|
669
671
|
};
|
|
670
|
-
let
|
|
671
|
-
if (
|
|
672
|
+
let X = 0;
|
|
673
|
+
if (p)
|
|
672
674
|
for (let i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
675
|
-
this._data.push(
|
|
675
|
+
const f = this._data.shift();
|
|
676
|
+
if (f)
|
|
677
|
+
this._data.push(f), X++, f.rowType === "groupHeader" && i--;
|
|
676
678
|
else
|
|
677
679
|
break;
|
|
678
680
|
}
|
|
679
|
-
const
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
let
|
|
683
|
-
const
|
|
684
|
-
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;
|
|
685
687
|
if (this._data.length) {
|
|
686
|
-
let i = -1,
|
|
687
|
-
(this._slicedData || this._data).forEach((
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
if (
|
|
691
|
-
|
|
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,
|
|
692
694
|
{
|
|
693
|
-
key:
|
|
694
|
-
dataItem:
|
|
695
|
-
isAltRow:
|
|
695
|
+
key: C,
|
|
696
|
+
dataItem: b.dataItem,
|
|
697
|
+
isAltRow: k,
|
|
696
698
|
isInEdit: w.isInEdit,
|
|
697
|
-
rowType:
|
|
698
|
-
isHidden:
|
|
699
|
-
onClick: (
|
|
700
|
-
onDoubleClick: (
|
|
699
|
+
rowType: b.rowType,
|
|
700
|
+
isHidden: Y(F),
|
|
701
|
+
onClick: (I) => this.rowClick(I, b),
|
|
702
|
+
onDoubleClick: (I) => this.rowDblClick(I, b),
|
|
701
703
|
selectedField: this.props.selectedField,
|
|
702
704
|
rowHeight: this.props.rowHeight,
|
|
703
705
|
render: this.props.rowRender,
|
|
704
|
-
ariaRowIndex:
|
|
705
|
-
absoluteRowIndex:
|
|
706
|
-
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ?
|
|
706
|
+
ariaRowIndex: A,
|
|
707
|
+
absoluteRowIndex: u,
|
|
708
|
+
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? u : i,
|
|
707
709
|
isSelected: w.isSelected
|
|
708
710
|
},
|
|
709
711
|
w.row
|
|
710
|
-
)), this.props.detail &&
|
|
711
|
-
const
|
|
712
|
-
|
|
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(
|
|
713
715
|
"tr",
|
|
714
716
|
{
|
|
715
|
-
key:
|
|
716
|
-
className:
|
|
717
|
-
|
|
718
|
-
S ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
717
|
+
key: N,
|
|
718
|
+
className: m(
|
|
719
|
+
s.detailTr({ isAlt: k })
|
|
719
720
|
),
|
|
720
|
-
style: { visibility:
|
|
721
|
+
style: { visibility: Y(F) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
721
722
|
role: "row",
|
|
722
|
-
"aria-rowindex":
|
|
723
|
+
"aria-rowindex": A
|
|
723
724
|
},
|
|
724
|
-
this.props.group && this.props.group.map((
|
|
725
|
-
var
|
|
726
|
-
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 } : {};
|
|
727
728
|
return /* @__PURE__ */ r.createElement(
|
|
728
|
-
|
|
729
|
+
Ee,
|
|
729
730
|
{
|
|
730
731
|
id: "",
|
|
731
|
-
dataIndex:
|
|
732
|
-
field:
|
|
733
|
-
dataItem:
|
|
734
|
-
key:
|
|
735
|
-
style:
|
|
736
|
-
ariaColumnIndex: 1 +
|
|
732
|
+
dataIndex: b.dataIndex,
|
|
733
|
+
field: K.field,
|
|
734
|
+
dataItem: b.dataItem,
|
|
735
|
+
key: L,
|
|
736
|
+
style: x,
|
|
737
|
+
ariaColumnIndex: 1 + L,
|
|
737
738
|
isSelected: !1,
|
|
738
739
|
locked: this.props.lockGroups,
|
|
739
740
|
isRtl: this.isRtl,
|
|
@@ -742,109 +743,112 @@ const z = class z extends r.Component {
|
|
|
742
743
|
);
|
|
743
744
|
}),
|
|
744
745
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
745
|
-
|
|
746
|
+
Dt,
|
|
746
747
|
{
|
|
747
|
-
id:
|
|
748
|
+
id: D.generateNavigatableId(`${N}-dhcell`, n)
|
|
748
749
|
}
|
|
749
750
|
),
|
|
750
751
|
/* @__PURE__ */ r.createElement(
|
|
751
|
-
|
|
752
|
+
Tt,
|
|
752
753
|
{
|
|
753
754
|
onContextMenu: this.onContextMenu,
|
|
754
|
-
dataItem:
|
|
755
|
-
dataIndex:
|
|
756
|
-
colSpan:
|
|
755
|
+
dataItem: b.dataItem,
|
|
756
|
+
dataIndex: b.dataIndex,
|
|
757
|
+
colSpan: I,
|
|
757
758
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
758
759
|
detail: this.props.detail,
|
|
759
|
-
id:
|
|
760
|
+
id: D.generateNavigatableId(`${N}-dcell`, n)
|
|
760
761
|
}
|
|
761
762
|
)
|
|
762
763
|
));
|
|
763
764
|
}
|
|
764
765
|
});
|
|
765
766
|
} else
|
|
766
|
-
|
|
767
|
-
const
|
|
767
|
+
B = !0;
|
|
768
|
+
const Pe = () => {
|
|
768
769
|
const i = this._header;
|
|
769
770
|
return i && i.table && i.table.clientWidth;
|
|
770
|
-
},
|
|
771
|
+
}, ee = () => /* @__PURE__ */ r.createElement(
|
|
771
772
|
"div",
|
|
772
773
|
{
|
|
773
774
|
key: "no-records",
|
|
774
|
-
className:
|
|
775
|
-
style: { width:
|
|
775
|
+
className: m(s.noRecords({})),
|
|
776
|
+
style: { width: Pe() }
|
|
776
777
|
},
|
|
777
|
-
/* @__PURE__ */ r.createElement(
|
|
778
|
-
|
|
779
|
-
|
|
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,
|
|
780
788
|
onPageChange: this.pagerPageChange,
|
|
781
789
|
total: a,
|
|
782
790
|
dir: this.isRtl ? "rtl" : void 0,
|
|
783
791
|
skip: this.vs.propsSkip || 0,
|
|
784
792
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
785
|
-
messagesMap:
|
|
786
|
-
...
|
|
787
|
-
},
|
|
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(
|
|
788
796
|
"col",
|
|
789
797
|
{
|
|
790
|
-
key:
|
|
791
|
-
width:
|
|
798
|
+
key: f.toString(),
|
|
799
|
+
width: U(i)
|
|
792
800
|
}
|
|
793
|
-
),
|
|
801
|
+
), ie = (ae = this.props.cells) != null && ae.footerCell || this._columns.some(
|
|
794
802
|
(i) => {
|
|
795
|
-
var
|
|
796
|
-
return !!(i.footerCell || (
|
|
803
|
+
var f;
|
|
804
|
+
return !!(i.footerCell || (f = i.cells) != null && f.footerCell);
|
|
797
805
|
}
|
|
798
806
|
) ? /* @__PURE__ */ r.createElement(
|
|
799
|
-
|
|
807
|
+
dt,
|
|
800
808
|
{
|
|
801
|
-
size:
|
|
809
|
+
size: t,
|
|
802
810
|
columnResize: this.columnResize,
|
|
803
811
|
staticHeaders: this.props.scrollable !== "none",
|
|
804
812
|
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
805
813
|
ref: (i) => this._footer = i,
|
|
806
814
|
row: /* @__PURE__ */ r.createElement(
|
|
807
|
-
|
|
815
|
+
xt,
|
|
808
816
|
{
|
|
809
817
|
cells: this.props.cells,
|
|
810
|
-
idPrefix:
|
|
818
|
+
idPrefix: n,
|
|
811
819
|
columns: this._columns,
|
|
812
820
|
isRtl: this.isRtl,
|
|
813
|
-
ariaRowIndex:
|
|
821
|
+
ariaRowIndex: A + 1
|
|
814
822
|
}
|
|
815
823
|
),
|
|
816
|
-
cols:
|
|
824
|
+
cols: R.map(We)
|
|
817
825
|
}
|
|
818
|
-
) : null,
|
|
826
|
+
) : null, oe = /* @__PURE__ */ r.createElement(
|
|
819
827
|
"colgroup",
|
|
820
828
|
{
|
|
821
829
|
ref: (i) => {
|
|
822
830
|
this.columnResize.colGroupMain = i;
|
|
823
831
|
}
|
|
824
832
|
},
|
|
825
|
-
|
|
826
|
-
(i,
|
|
833
|
+
R.map(
|
|
834
|
+
(i, f) => /* @__PURE__ */ r.createElement(
|
|
827
835
|
"col",
|
|
828
836
|
{
|
|
829
|
-
key:
|
|
830
|
-
className:
|
|
831
|
-
width:
|
|
837
|
+
key: f.toString(),
|
|
838
|
+
className: we(i.field, this.props.sort) ? m(s.sorted({})) : void 0,
|
|
839
|
+
width: U(i)
|
|
832
840
|
}
|
|
833
841
|
)
|
|
834
842
|
)
|
|
835
|
-
),
|
|
843
|
+
), re = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
836
844
|
if (this.props.scrollable === "none")
|
|
837
|
-
return /* @__PURE__ */ r.createElement(
|
|
845
|
+
return /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
838
846
|
"div",
|
|
839
847
|
{
|
|
840
848
|
id: this.props.id,
|
|
841
849
|
style: this.props.style,
|
|
842
|
-
className:
|
|
843
|
-
|
|
844
|
-
{
|
|
845
|
-
"k-grid-md": !this.props.size,
|
|
846
|
-
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
847
|
-
},
|
|
850
|
+
className: m(
|
|
851
|
+
s.wrapper({ size: t }),
|
|
848
852
|
this.props.className
|
|
849
853
|
),
|
|
850
854
|
ref: (i) => {
|
|
@@ -853,12 +857,12 @@ const z = class z extends r.Component {
|
|
|
853
857
|
"aria-label": this.props.ariaLabel,
|
|
854
858
|
onKeyDown: this.onKeyDown,
|
|
855
859
|
onFocus: this.onFocus,
|
|
856
|
-
...
|
|
860
|
+
...ce
|
|
857
861
|
},
|
|
858
|
-
|
|
859
|
-
|
|
862
|
+
G,
|
|
863
|
+
q,
|
|
860
864
|
/* @__PURE__ */ r.createElement(
|
|
861
|
-
|
|
865
|
+
ue,
|
|
862
866
|
{
|
|
863
867
|
selectable: this.props.selectable,
|
|
864
868
|
onRelease: this.selectionRelease,
|
|
@@ -870,34 +874,28 @@ const z = class z extends r.Component {
|
|
|
870
874
|
"table",
|
|
871
875
|
{
|
|
872
876
|
ref: (i) => this.headTable = i,
|
|
873
|
-
className:
|
|
874
|
-
"k-table k-grid-table",
|
|
875
|
-
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
876
|
-
),
|
|
877
|
-
style: { userSelect: d }
|
|
877
|
+
className: m(s.table({ size: t }))
|
|
878
878
|
},
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className:
|
|
882
|
-
|
|
879
|
+
oe,
|
|
880
|
+
J,
|
|
881
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: m(s.tbody({})), ...ge }, P),
|
|
882
|
+
ie
|
|
883
883
|
)
|
|
884
884
|
),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
),
|
|
888
|
-
let
|
|
889
|
-
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(
|
|
890
890
|
"div",
|
|
891
891
|
{
|
|
892
892
|
id: this.props.id,
|
|
893
|
-
style:
|
|
894
|
-
className:
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
"k-grid-virtual": s
|
|
900
|
-
},
|
|
893
|
+
style: W,
|
|
894
|
+
className: m(
|
|
895
|
+
s.wrapper({
|
|
896
|
+
size: t,
|
|
897
|
+
virtual: p
|
|
898
|
+
}),
|
|
901
899
|
this.props.className
|
|
902
900
|
),
|
|
903
901
|
ref: (i) => {
|
|
@@ -906,31 +904,31 @@ const z = class z extends r.Component {
|
|
|
906
904
|
"aria-label": this.props.ariaLabel,
|
|
907
905
|
onKeyDown: this.onKeyDown,
|
|
908
906
|
onFocus: this.onFocus,
|
|
909
|
-
...
|
|
907
|
+
...ce
|
|
910
908
|
},
|
|
911
|
-
|
|
912
|
-
|
|
909
|
+
G,
|
|
910
|
+
q,
|
|
913
911
|
/* @__PURE__ */ r.createElement(
|
|
914
912
|
"div",
|
|
915
913
|
{
|
|
916
|
-
className:
|
|
914
|
+
className: m(s.ariaRoot({})),
|
|
917
915
|
role: "grid",
|
|
918
|
-
"aria-colcount":
|
|
916
|
+
"aria-colcount": R.length,
|
|
919
917
|
"aria-rowcount": a,
|
|
920
918
|
id: this._gridId,
|
|
921
|
-
"aria-label": c.toLanguageString(
|
|
919
|
+
"aria-label": c.toLanguageString(be, gt[be])
|
|
922
920
|
},
|
|
923
|
-
|
|
924
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
921
|
+
J,
|
|
922
|
+
/* @__PURE__ */ r.createElement("div", { className: m(s.container({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
925
923
|
"div",
|
|
926
924
|
{
|
|
927
925
|
ref: this.containerRef,
|
|
928
|
-
className:
|
|
926
|
+
className: m(s.content({})),
|
|
929
927
|
onScroll: this.scrollHandler,
|
|
930
928
|
role: "presentation"
|
|
931
929
|
},
|
|
932
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
933
|
-
|
|
930
|
+
/* @__PURE__ */ r.createElement("div", { className: m(s.tableWrap({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
931
|
+
ue,
|
|
934
932
|
{
|
|
935
933
|
selectable: this.props.selectable,
|
|
936
934
|
onRelease: this.selectionRelease,
|
|
@@ -942,42 +940,40 @@ const z = class z extends r.Component {
|
|
|
942
940
|
"table",
|
|
943
941
|
{
|
|
944
942
|
ref: (i) => this.tableElement = i,
|
|
945
|
-
className:
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
950
|
-
}
|
|
943
|
+
className: m(
|
|
944
|
+
s.table({
|
|
945
|
+
size: t
|
|
946
|
+
})
|
|
951
947
|
),
|
|
952
948
|
role: "presentation",
|
|
953
|
-
style: { userSelect:
|
|
949
|
+
style: { userSelect: z }
|
|
954
950
|
},
|
|
955
|
-
|
|
951
|
+
oe,
|
|
956
952
|
/* @__PURE__ */ r.createElement(
|
|
957
953
|
"tbody",
|
|
958
954
|
{
|
|
959
|
-
className:
|
|
955
|
+
className: m(s.tbody({})),
|
|
960
956
|
ref: this.tableBodyRef,
|
|
961
957
|
role: "rowgroup",
|
|
962
|
-
...
|
|
958
|
+
...ge
|
|
963
959
|
},
|
|
964
|
-
|
|
960
|
+
P
|
|
965
961
|
)
|
|
966
962
|
)
|
|
967
|
-
),
|
|
968
|
-
|
|
963
|
+
), B && ee()),
|
|
964
|
+
p && /* @__PURE__ */ r.createElement("div", { className: m(s.heightContainer({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
969
965
|
"div",
|
|
970
966
|
{
|
|
971
|
-
style:
|
|
967
|
+
style: p ? { height: this.vs.containerHeight + "px" } : {}
|
|
972
968
|
}
|
|
973
969
|
))
|
|
974
970
|
)),
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
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)
|
|
978
974
|
),
|
|
979
|
-
|
|
980
|
-
this.props.pageable &&
|
|
975
|
+
j,
|
|
976
|
+
this.props.pageable && se
|
|
981
977
|
));
|
|
982
978
|
}
|
|
983
979
|
calculateMedia() {
|
|
@@ -985,8 +981,8 @@ const z = class z extends r.Component {
|
|
|
985
981
|
}
|
|
986
982
|
selectionChange(a) {
|
|
987
983
|
if (this.props.onSelectionChange) {
|
|
988
|
-
const { event:
|
|
989
|
-
...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),
|
|
990
986
|
dataItem: c,
|
|
991
987
|
startColIndex: t,
|
|
992
988
|
endColIndex: t,
|
|
@@ -1003,13 +999,13 @@ const z = class z extends r.Component {
|
|
|
1003
999
|
componentId: this._gridId,
|
|
1004
1000
|
selectedField: this.props.selectedField || ""
|
|
1005
1001
|
};
|
|
1006
|
-
this.props.onSelectionChange.call(void 0,
|
|
1002
|
+
this.props.onSelectionChange.call(void 0, d);
|
|
1007
1003
|
}
|
|
1008
1004
|
}
|
|
1009
|
-
raiseDataEvent(a,
|
|
1005
|
+
raiseDataEvent(a, n, c, e, t) {
|
|
1010
1006
|
const s = this.props.onDataStateChange;
|
|
1011
1007
|
if (a) {
|
|
1012
|
-
const l = { ...this.getArguments(e), ...
|
|
1008
|
+
const l = { ...this.getArguments(e), ...n, targetEvent: t };
|
|
1013
1009
|
a.call(void 0, l);
|
|
1014
1010
|
} else
|
|
1015
1011
|
s && s.call(
|
|
@@ -1024,60 +1020,60 @@ const z = class z extends r.Component {
|
|
|
1024
1020
|
}
|
|
1025
1021
|
);
|
|
1026
1022
|
}
|
|
1027
|
-
columnReorder(a,
|
|
1028
|
-
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) => {
|
|
1029
1025
|
do
|
|
1030
|
-
|
|
1031
|
-
while (
|
|
1032
|
-
return
|
|
1026
|
+
h++;
|
|
1027
|
+
while (h < this._columns.length && this._columns[h].depth > t);
|
|
1028
|
+
return h;
|
|
1033
1029
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1034
|
-
this._columns.splice(a <
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
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;
|
|
1038
1034
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1039
|
-
const
|
|
1035
|
+
const h = {
|
|
1040
1036
|
target: this,
|
|
1041
|
-
columns:
|
|
1037
|
+
columns: p,
|
|
1042
1038
|
columnId: e.id,
|
|
1043
1039
|
nativeEvent: c
|
|
1044
1040
|
};
|
|
1045
|
-
this.props.onColumnReorder.call(void 0,
|
|
1041
|
+
this.props.onColumnReorder.call(void 0, h);
|
|
1046
1042
|
}
|
|
1047
1043
|
}
|
|
1048
|
-
groupReorder(a,
|
|
1044
|
+
groupReorder(a, n, c) {
|
|
1049
1045
|
if (this.props.group === void 0)
|
|
1050
1046
|
return;
|
|
1051
1047
|
const e = this.props.group.slice();
|
|
1052
|
-
e.splice(
|
|
1048
|
+
e.splice(n, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
1053
1049
|
}
|
|
1054
|
-
columnToGroup(a,
|
|
1050
|
+
columnToGroup(a, n, c) {
|
|
1055
1051
|
const e = this._columns[a].field;
|
|
1056
1052
|
if (!e)
|
|
1057
1053
|
return;
|
|
1058
1054
|
const t = (this.props.group || []).slice();
|
|
1059
|
-
t.splice(
|
|
1055
|
+
t.splice(n, 0, { field: e }), this.groupChange(t, c);
|
|
1060
1056
|
}
|
|
1061
|
-
columnGroupChange(a,
|
|
1057
|
+
columnGroupChange(a, n) {
|
|
1062
1058
|
const c = this.dragLogic.getCurrentGroupsLength;
|
|
1063
|
-
this.columnToGroup(a, c,
|
|
1059
|
+
this.columnToGroup(a, c, n);
|
|
1064
1060
|
}
|
|
1065
1061
|
resetTableWidth() {
|
|
1066
1062
|
let a = 0;
|
|
1067
1063
|
if (!this.columnResize.colGroupMain)
|
|
1068
1064
|
return;
|
|
1069
|
-
const
|
|
1070
|
-
for (let c = 0; c <
|
|
1071
|
-
const e =
|
|
1065
|
+
const n = this.columnResize.colGroupMain.children;
|
|
1066
|
+
for (let c = 0; c < n.length; c++) {
|
|
1067
|
+
const e = n[c].width;
|
|
1072
1068
|
if (!e)
|
|
1073
1069
|
return;
|
|
1074
1070
|
a += parseFloat(e.toString());
|
|
1075
1071
|
}
|
|
1076
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");
|
|
1077
1073
|
}
|
|
1078
|
-
initColumns(a,
|
|
1079
|
-
const c =
|
|
1080
|
-
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;
|
|
1081
1077
|
}
|
|
1082
1078
|
getDataState() {
|
|
1083
1079
|
return {
|
|
@@ -1096,9 +1092,9 @@ const z = class z extends r.Component {
|
|
|
1096
1092
|
};
|
|
1097
1093
|
}
|
|
1098
1094
|
};
|
|
1099
|
-
|
|
1095
|
+
H.displayName = "KendoReactGrid", H.defaultProps = {
|
|
1100
1096
|
// never use this
|
|
1101
|
-
},
|
|
1097
|
+
}, H.propTypes = {
|
|
1102
1098
|
data: o.oneOfType([
|
|
1103
1099
|
o.array,
|
|
1104
1100
|
o.shape({
|
|
@@ -1179,9 +1175,9 @@ z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
|
1179
1175
|
})
|
|
1180
1176
|
]),
|
|
1181
1177
|
size: o.oneOf(["small", "medium"])
|
|
1182
|
-
},
|
|
1183
|
-
let
|
|
1184
|
-
|
|
1178
|
+
}, H.contextType = V;
|
|
1179
|
+
let $ = H;
|
|
1180
|
+
ct($);
|
|
1185
1181
|
export {
|
|
1186
|
-
|
|
1182
|
+
$ as Grid
|
|
1187
1183
|
};
|