@progress/kendo-react-grid 7.5.0-develop.19 → 7.5.0-develop.20
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 +114 -112
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +2 -1
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +58 -58
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +57 -56
- package/index.d.mts +13 -0
- package/index.d.ts +13 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
package/Grid.mjs
CHANGED
|
@@ -8,35 +8,35 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { RowHeightService as re, dispatchEvent as
|
|
12
|
-
import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns 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
|
|
11
|
+
import { RowHeightService as re, dispatchEvent as Pe, canUseDOM as U, getActiveElement as Ke, memoizeOne as S, validatePackage as Oe, shouldShowValidationUI as Ve, setScrollbarWidth as ae, getter as Ue, classNames as N, kendoThemeMaps as P, WatermarkOverlay as We } from "@progress/kendo-react-common";
|
|
12
|
+
import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns as Be, ClipboardService as $e, TableKeyboardNavigationContext as W, isRtl as je, tableKeyboardNavigationTools as _, tableColumnsVirtualization as qe, Pager as Xe, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Ye, updateRight as Je, KEYBOARD_NAV_DATA_ID as Qe } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GridSelectionCell as Ze } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as et } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridEditCell as tt } from "./cells/GridEditCell.mjs";
|
|
16
|
+
import { Header as st } from "./header/Header.mjs";
|
|
17
|
+
import { HeaderRow as it } from "./header/HeaderRow.mjs";
|
|
18
|
+
import { FilterRow as ot } from "./header/FilterRow.mjs";
|
|
19
|
+
import { GroupPanel as rt } from "./header/GroupPanel.mjs";
|
|
20
|
+
import { Footer as at } from "./footer/Footer.mjs";
|
|
21
|
+
import { provideLocalizationService as lt, registerForLocalization as nt } from "@progress/kendo-react-intl";
|
|
22
|
+
import { pagerMessagesMap as ht, gridAriaLabel as ue, messages as pt } from "./messages/index.mjs";
|
|
23
|
+
import { VirtualScroll as dt } from "./VirtualScroll.mjs";
|
|
24
24
|
import { VirtualScrollFixed as ge } from "./VirtualScrollFixed.mjs";
|
|
25
|
-
import { ColumnResize as
|
|
26
|
-
import { CommonDragLogic as
|
|
27
|
-
import { firefox as fe, firefoxMaxHeight as me, flatData as
|
|
28
|
-
import { GridCell as
|
|
25
|
+
import { ColumnResize as ct } from "./drag/ColumnResize.mjs";
|
|
26
|
+
import { CommonDragLogic as ut } from "./drag/CommonDragLogic.mjs";
|
|
27
|
+
import { firefox as fe, firefoxMaxHeight as me, flatData as gt, readColumns as ft, sanitizeColumns as mt, getColumnWidth as B, autoGenerateColumns as vt, getNestedValue as ve, resolveCells as bt } from "./utils/index.mjs";
|
|
28
|
+
import { GridCell as Ct } from "./cells/GridCell.mjs";
|
|
29
29
|
import { GridGroupCell as be } from "./cells/GridGroupCell.mjs";
|
|
30
|
-
import { GridRow as
|
|
31
|
-
import { GridHeaderSelectionCell as
|
|
32
|
-
import { GridNoRecords as
|
|
30
|
+
import { GridRow as Rt } from "./rows/GridRow.mjs";
|
|
31
|
+
import { GridHeaderSelectionCell as yt } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
+
import { GridNoRecords as wt } from "./GridNoRecords.mjs";
|
|
33
33
|
import { operators as Ce } from "./filterCommon.mjs";
|
|
34
|
-
import { FooterRow as
|
|
35
|
-
import { normalize as
|
|
34
|
+
import { FooterRow as St } from "./footer/FooterRow.mjs";
|
|
35
|
+
import { normalize as It } from "./paging/GridPagerSettings.mjs";
|
|
36
36
|
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
37
|
-
import { GridDetailCell as
|
|
38
|
-
import { GridDetailHierarchyCell as
|
|
39
|
-
import { SAFARI_REGEX as
|
|
37
|
+
import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
|
|
38
|
+
import { GridDetailHierarchyCell as Et } from "./cells/GridDetailHierarchyCell.mjs";
|
|
39
|
+
import { SAFARI_REGEX as xt } from "./constants/index.mjs";
|
|
40
40
|
const T = class T 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._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = r.createRef(), this.headerElementRef = r.createRef(), this._element = null, this.tableElement = null, this.containerRef = r.createRef(), this.tableBodyRef = r.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.headTable = null, this.observer = null, this.handleIntersection = (e) => {
|
|
@@ -80,7 +80,7 @@ const T = class T extends r.Component {
|
|
|
80
80
|
}
|
|
81
81
|
}, this.getVirtualScroll = (e) => {
|
|
82
82
|
const { rowHeight: t, detailRowHeight: s, detail: l, expandField: p, groupable: n } = e, d = this.isAllData(), m = t !== void 0 && t > 0, R = s !== void 0 && s > 0, k = n === !0 || typeof n == "object" && n.enabled !== !1;
|
|
83
|
-
return !m || k && !d || !!(l && p) && (!R || !d) ?
|
|
83
|
+
return !m || k && !d || !!(l && p) && (!R || !d) ? dt : ge;
|
|
84
84
|
}, this.isAllData = () => {
|
|
85
85
|
const { data: e, total: t } = this.props;
|
|
86
86
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
@@ -111,7 +111,7 @@ const T = class T extends r.Component {
|
|
|
111
111
|
const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
|
|
112
112
|
this.props.columnVirtualization && (!this.vs.scrollableVirtual || s === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
113
113
|
this.forceUpdate();
|
|
114
|
-
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e),
|
|
114
|
+
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e), Pe(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = s;
|
|
115
115
|
}, this.onKeyDown = (e) => {
|
|
116
116
|
if (x.onKeyDown(e, {
|
|
117
117
|
contextStateRef: this.contextStateRef,
|
|
@@ -273,9 +273,9 @@ const T = class T extends r.Component {
|
|
|
273
273
|
}
|
|
274
274
|
}, this.inActiveElement = () => {
|
|
275
275
|
var p, n, d;
|
|
276
|
-
if (!
|
|
276
|
+
if (!U)
|
|
277
277
|
return !1;
|
|
278
|
-
const e =
|
|
278
|
+
const e = Ke(this.document), t = e ? e.matches(".k-table-td") ? e : (p = this.document) == null ? void 0 : p.body : (n = this.document) == null ? void 0 : n.body, s = t.closest(".k-grid-container"), l = t && ((d = this._element) == null ? void 0 : d.contains(t));
|
|
279
279
|
return !!(t && l && s);
|
|
280
280
|
}, this.onResize = (e, t, s, l, p, n) => {
|
|
281
281
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
@@ -296,7 +296,7 @@ const T = class T extends r.Component {
|
|
|
296
296
|
const d = this.getVirtualScroll(this.props);
|
|
297
297
|
this.vs = new d(n);
|
|
298
298
|
}), this.flatData = S((e, t, s, l, p, n, d) => {
|
|
299
|
-
const m = [], R =
|
|
299
|
+
const m = [], R = gt(
|
|
300
300
|
m,
|
|
301
301
|
e,
|
|
302
302
|
t,
|
|
@@ -308,13 +308,13 @@ const T = class T extends r.Component {
|
|
|
308
308
|
}), this.rowHeightService = S((e, t, s, l, p) => new re(t, s, l, p)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
|
|
309
309
|
(e, t, s) => {
|
|
310
310
|
const l = e.filter((p) => p && p.type && p.type.displayName === "KendoReactGridColumn");
|
|
311
|
-
return
|
|
311
|
+
return ft(l, this.columns, { prevId: 0, idPrefix: t });
|
|
312
312
|
}
|
|
313
313
|
), this.mapColumns = S(
|
|
314
|
-
(e, t) =>
|
|
314
|
+
(e, t) => Be(e, t)
|
|
315
315
|
), this.configureColumns = S((e, t, s) => {
|
|
316
316
|
this.props.selectedField && e.filter((n) => n.field === this.props.selectedField).forEach((n) => {
|
|
317
|
-
n.width = n.width || "50px", n.cell = n.cell ||
|
|
317
|
+
n.width = n.width || "50px", n.cell = n.cell || Ze, n.headerCell = n.headerCell || yt;
|
|
318
318
|
});
|
|
319
319
|
const l = {
|
|
320
320
|
id: "",
|
|
@@ -338,7 +338,7 @@ const T = class T extends r.Component {
|
|
|
338
338
|
let p = 0;
|
|
339
339
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
340
340
|
...l,
|
|
341
|
-
cell:
|
|
341
|
+
cell: et,
|
|
342
342
|
field: this.props.expandField,
|
|
343
343
|
headerClassName: "k-hierarchy-cell k-header"
|
|
344
344
|
}), p++);
|
|
@@ -351,8 +351,8 @@ const T = class T extends r.Component {
|
|
|
351
351
|
locked: this.props.lockGroups
|
|
352
352
|
}), p++;
|
|
353
353
|
e.slice(p).forEach((n) => n.parentIndex >= 0 && (n.parentIndex += p));
|
|
354
|
-
}), this.getHeaderRow = S((e, t, s, l, p, n, d, m, R, k, z, C) => /* @__PURE__ */ r.createElement(
|
|
355
|
-
|
|
354
|
+
}), this.getHeaderRow = S((e, t, s, l, p, n, d, m, R, k, z, C, A) => /* @__PURE__ */ r.createElement(
|
|
355
|
+
it,
|
|
356
356
|
{
|
|
357
357
|
cells: this.props.cells,
|
|
358
358
|
sort: e,
|
|
@@ -366,15 +366,16 @@ const T = class T extends r.Component {
|
|
|
366
366
|
filterOperators: d,
|
|
367
367
|
filterChange: this.filterChange,
|
|
368
368
|
columnMenu: R,
|
|
369
|
+
columnMenuIcon: k,
|
|
369
370
|
selectionChange: this.onHeaderSelectionChange,
|
|
370
|
-
columns:
|
|
371
|
+
columns: z,
|
|
371
372
|
columnResize: this.columnResize,
|
|
372
373
|
pressHandler: this.dragLogic.pressHandler,
|
|
373
374
|
dragHandler: this.dragLogic.dragHandler,
|
|
374
375
|
releaseHandler: this.dragLogic.releaseHandler,
|
|
375
|
-
columnsMap:
|
|
376
|
+
columnsMap: C,
|
|
376
377
|
cellRender: m,
|
|
377
|
-
isRtl:
|
|
378
|
+
isRtl: A,
|
|
378
379
|
dragClue: this.dragLogic.dragClueRef,
|
|
379
380
|
headerRef: this.headerElementRef,
|
|
380
381
|
containerRef: this.containerRef,
|
|
@@ -384,13 +385,13 @@ const T = class T extends r.Component {
|
|
|
384
385
|
)), this.resolveTitle = (e) => {
|
|
385
386
|
const t = this._columns.find((l) => l.field === e), s = t && (t.title || t.field);
|
|
386
387
|
return s === void 0 ? e : s;
|
|
387
|
-
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), this.getSlicedLeafDataItems = () => (this._slicedData || this._data).filter((e) => e.rowType === "data").map((e) => e.dataItem),
|
|
388
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), this.getSlicedLeafDataItems = () => (this._slicedData || this._data).filter((e) => e.rowType === "data").map((e) => e.dataItem), Oe(Re), this.showLicenseWatermark = Ve(Re);
|
|
388
389
|
const h = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
389
|
-
this.vs = new c(h || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new
|
|
390
|
+
this.vs = new c(h || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new ut(
|
|
390
391
|
this.columnReorder.bind(this),
|
|
391
392
|
this.groupReorder.bind(this),
|
|
392
393
|
this.columnToGroup.bind(this)
|
|
393
|
-
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new
|
|
394
|
+
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new ct(this.onResize), this.props.clipboard && (this.clipboardService = new $e(this.onClipboard)), x.onConstructor({
|
|
394
395
|
navigatable: !!a.navigatable,
|
|
395
396
|
contextStateRef: this.contextStateRef,
|
|
396
397
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -439,7 +440,7 @@ const T = class T extends r.Component {
|
|
|
439
440
|
// tslint:enable:max-line-length
|
|
440
441
|
get columns() {
|
|
441
442
|
const a = this._columns.filter((h) => h.declarationIndex >= 0 && h.parentIndex === -1);
|
|
442
|
-
return
|
|
443
|
+
return mt(a);
|
|
443
444
|
}
|
|
444
445
|
/**
|
|
445
446
|
* Returns the HTML element of the Grid component.
|
|
@@ -448,7 +449,7 @@ const T = class T extends r.Component {
|
|
|
448
449
|
return this._element;
|
|
449
450
|
}
|
|
450
451
|
get document() {
|
|
451
|
-
if (
|
|
452
|
+
if (U)
|
|
452
453
|
return this.element && this.element.ownerDocument || document;
|
|
453
454
|
}
|
|
454
455
|
get _header() {
|
|
@@ -461,8 +462,8 @@ const T = class T extends r.Component {
|
|
|
461
462
|
* @hidden
|
|
462
463
|
*/
|
|
463
464
|
componentDidMount() {
|
|
464
|
-
this.props.columnVirtualization && !navigator.userAgent.match(
|
|
465
|
-
const a =
|
|
465
|
+
this.props.columnVirtualization && !navigator.userAgent.match(xt) && (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), ae();
|
|
466
|
+
const a = je(this.element);
|
|
466
467
|
this.isRtl = a, x.onComponentDidMount({
|
|
467
468
|
scope: this.element || void 0,
|
|
468
469
|
contextStateRef: this.contextStateRef,
|
|
@@ -472,7 +473,7 @@ const T = class T extends r.Component {
|
|
|
472
473
|
rootMargin: "0px",
|
|
473
474
|
threshold: 0.9
|
|
474
475
|
};
|
|
475
|
-
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer =
|
|
476
|
+
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = U && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, h) || null;
|
|
476
477
|
}
|
|
477
478
|
/**
|
|
478
479
|
* @hidden
|
|
@@ -507,7 +508,7 @@ const T = class T extends r.Component {
|
|
|
507
508
|
render() {
|
|
508
509
|
var ie;
|
|
509
510
|
let a = this.props.total || 0;
|
|
510
|
-
const h = _.getIdPrefix(this.navigationStateRef), c =
|
|
511
|
+
const h = _.getIdPrefix(this.navigationStateRef), c = lt(this);
|
|
511
512
|
let e = [];
|
|
512
513
|
Array.isArray(this.props.data) ? (e = this.props.data, a = a || this.props.data.length) : this.props.data && (e = this.props.data.data, a = a || this.props.data.total);
|
|
513
514
|
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", s = this.props.scrollable === "virtual", { resolvedGroupsCount: l, flattedData: p } = this.flatData(
|
|
@@ -526,8 +527,8 @@ const T = class T extends r.Component {
|
|
|
526
527
|
this.initializeVirtualization(a, n);
|
|
527
528
|
const m = this.childrenToArray(this.props.children);
|
|
528
529
|
this.initColumns(m, l);
|
|
529
|
-
const R = m.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), k = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"), z = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((i) => i.children.length === 0),
|
|
530
|
-
|
|
530
|
+
const R = m.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), k = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"), z = m.filter((i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((i) => i.children.length === 0), A = n && /* @__PURE__ */ r.createElement(
|
|
531
|
+
rt,
|
|
531
532
|
{
|
|
532
533
|
group: this.props.group || [],
|
|
533
534
|
groupChange: this.groupChange,
|
|
@@ -539,8 +540,8 @@ const T = class T extends r.Component {
|
|
|
539
540
|
ariaControls: this._gridId,
|
|
540
541
|
onContextMenu: this.onContextMenu
|
|
541
542
|
}
|
|
542
|
-
), { sort: ye, sortable: we, group: Se, filter: Ie, filterable: ke, filterOperators: Ee = Ce, headerCellRender: xe, columnMenu: _e } = this.props, j = /* @__PURE__ */ r.createElement(
|
|
543
|
-
|
|
543
|
+
), { sort: ye, sortable: we, group: Se, filter: Ie, filterable: ke, filterOperators: Ee = Ce, headerCellRender: xe, columnMenu: _e, columnMenuIcon: Te } = this.props, j = /* @__PURE__ */ r.createElement(
|
|
544
|
+
st,
|
|
544
545
|
{
|
|
545
546
|
size: this.props.size,
|
|
546
547
|
columnResize: this.columnResize,
|
|
@@ -559,12 +560,13 @@ const T = class T extends r.Component {
|
|
|
559
560
|
Ee,
|
|
560
561
|
xe,
|
|
561
562
|
_e,
|
|
563
|
+
Te,
|
|
562
564
|
this._columns,
|
|
563
565
|
this._columnsMap,
|
|
564
566
|
this.isRtl
|
|
565
567
|
),
|
|
566
568
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
567
|
-
|
|
569
|
+
ot,
|
|
568
570
|
{
|
|
569
571
|
cells: this.props.cells,
|
|
570
572
|
size: this.props.size,
|
|
@@ -582,21 +584,21 @@ const T = class T extends r.Component {
|
|
|
582
584
|
"col",
|
|
583
585
|
{
|
|
584
586
|
key: g.toString(),
|
|
585
|
-
width:
|
|
587
|
+
width: B(i)
|
|
586
588
|
}
|
|
587
589
|
))
|
|
588
590
|
}
|
|
589
|
-
),
|
|
591
|
+
), ze = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Fe } = qe({
|
|
590
592
|
enabled: this.props.columnVirtualization,
|
|
591
593
|
columns: C,
|
|
592
|
-
tableViewPortWidth:
|
|
593
|
-
scrollLeft:
|
|
594
|
-
}),
|
|
594
|
+
tableViewPortWidth: De,
|
|
595
|
+
scrollLeft: ze
|
|
596
|
+
}), Le = (i, g, f) => {
|
|
595
597
|
let E = !1;
|
|
596
598
|
const I = this.props.selectedField ? ve(this.props.selectedField, i.dataItem) : void 0;
|
|
597
599
|
return {
|
|
598
600
|
row: C.map((u, v) => {
|
|
599
|
-
if (
|
|
601
|
+
if (Fe[v])
|
|
600
602
|
return null;
|
|
601
603
|
const H = u.id ? u.id : v, F = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, y = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
|
|
602
604
|
let w = !1;
|
|
@@ -604,9 +606,9 @@ const T = class T extends r.Component {
|
|
|
604
606
|
const b = ve(this.props.editField, i.dataItem);
|
|
605
607
|
b && (b === !0 || b === u.field) && (E = !0, w = !0);
|
|
606
608
|
}
|
|
607
|
-
const
|
|
609
|
+
const V = u.cell || w && tt || Ct, L = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
608
610
|
return /* @__PURE__ */ r.createElement(
|
|
609
|
-
|
|
611
|
+
V,
|
|
610
612
|
{
|
|
611
613
|
onContextMenu: this.onContextMenu,
|
|
612
614
|
key: H,
|
|
@@ -616,14 +618,14 @@ const T = class T extends r.Component {
|
|
|
616
618
|
h,
|
|
617
619
|
L || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
618
620
|
),
|
|
619
|
-
colSpan:
|
|
621
|
+
colSpan: He[v],
|
|
620
622
|
dataItem: i.dataItem,
|
|
621
623
|
field: u.field,
|
|
622
624
|
editor: u.editor,
|
|
623
625
|
format: u.format,
|
|
624
626
|
className: F,
|
|
625
627
|
render: this.props.cellRender,
|
|
626
|
-
cells:
|
|
628
|
+
cells: bt(this.props.cells, u.cells),
|
|
627
629
|
onChange: this.itemChange,
|
|
628
630
|
selectionChange: this.props.onSelectionChange ? (b) => {
|
|
629
631
|
this.selectionChange({ event: b, dataItem: i.dataItem, dataIndex: f, columnIndex: v });
|
|
@@ -655,17 +657,17 @@ const T = class T extends r.Component {
|
|
|
655
657
|
}
|
|
656
658
|
const X = (i) => i >= this._data.length - q;
|
|
657
659
|
let Y = this.vs.realSkip || 0;
|
|
658
|
-
const
|
|
659
|
-
let
|
|
660
|
-
const
|
|
660
|
+
const M = [];
|
|
661
|
+
let K = !1;
|
|
662
|
+
const O = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
661
663
|
let D = 0;
|
|
662
664
|
if (this._data.length) {
|
|
663
665
|
let i = -1, g = 0;
|
|
664
666
|
(this._slicedData || this._data).forEach((f, E) => {
|
|
665
667
|
f.rowType === "data" && (Y++, i++);
|
|
666
|
-
const I = Y % 2 === 0, u = this.props.dataItemKey &&
|
|
667
|
-
if (D = v +
|
|
668
|
-
|
|
668
|
+
const I = Y % 2 === 0, u = this.props.dataItemKey && Ue(this.props.dataItemKey)(f.dataItem), v = E + (this.vs.realSkip || 0), H = u || "ai" + v, F = H + "_1", y = Le(f, H, i);
|
|
669
|
+
if (D = v + O + g, M.push(/* @__PURE__ */ r.createElement(
|
|
670
|
+
Rt,
|
|
669
671
|
{
|
|
670
672
|
key: H,
|
|
671
673
|
dataItem: f.dataItem,
|
|
@@ -686,7 +688,7 @@ const T = class T extends r.Component {
|
|
|
686
688
|
y.row
|
|
687
689
|
)), this.props.detail && f.rowType === "data" && f.expanded) {
|
|
688
690
|
const w = C.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
689
|
-
g++, D = v +
|
|
691
|
+
g++, D = v + O + g, M.push(/* @__PURE__ */ r.createElement(
|
|
690
692
|
"tr",
|
|
691
693
|
{
|
|
692
694
|
key: F,
|
|
@@ -698,18 +700,18 @@ const T = class T extends r.Component {
|
|
|
698
700
|
role: "row",
|
|
699
701
|
"aria-rowindex": D
|
|
700
702
|
},
|
|
701
|
-
this.props.group && this.props.group.map((
|
|
703
|
+
this.props.group && this.props.group.map((V, L) => {
|
|
702
704
|
var oe;
|
|
703
|
-
const b = (oe = y == null ? void 0 : y.row[L]) == null ? void 0 : oe.props.style,
|
|
705
|
+
const b = (oe = y == null ? void 0 : y.row[L]) == null ? void 0 : oe.props.style, Ge = b ? this.isRtl ? { left: b.right, right: b.left } : { left: b.left, right: b.right } : {};
|
|
704
706
|
return /* @__PURE__ */ r.createElement(
|
|
705
707
|
be,
|
|
706
708
|
{
|
|
707
709
|
id: "",
|
|
708
710
|
dataIndex: f.dataIndex,
|
|
709
|
-
field:
|
|
711
|
+
field: V.field,
|
|
710
712
|
dataItem: f.dataItem,
|
|
711
713
|
key: L,
|
|
712
|
-
style:
|
|
714
|
+
style: Ge,
|
|
713
715
|
ariaColumnIndex: 1 + L,
|
|
714
716
|
isSelected: !1,
|
|
715
717
|
locked: this.props.lockGroups,
|
|
@@ -719,13 +721,13 @@ const T = class T extends r.Component {
|
|
|
719
721
|
);
|
|
720
722
|
}),
|
|
721
723
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
722
|
-
|
|
724
|
+
Et,
|
|
723
725
|
{
|
|
724
726
|
id: _.generateNavigatableId(`${F}-dhcell`, h)
|
|
725
727
|
}
|
|
726
728
|
),
|
|
727
729
|
/* @__PURE__ */ r.createElement(
|
|
728
|
-
|
|
730
|
+
kt,
|
|
729
731
|
{
|
|
730
732
|
onContextMenu: this.onContextMenu,
|
|
731
733
|
dataItem: f.dataItem,
|
|
@@ -740,8 +742,8 @@ const T = class T extends r.Component {
|
|
|
740
742
|
}
|
|
741
743
|
});
|
|
742
744
|
} else
|
|
743
|
-
|
|
744
|
-
const
|
|
745
|
+
K = !0;
|
|
746
|
+
const Ne = () => {
|
|
745
747
|
const i = this._header;
|
|
746
748
|
return i && i.table.clientWidth;
|
|
747
749
|
}, J = () => /* @__PURE__ */ r.createElement(
|
|
@@ -749,10 +751,10 @@ const T = class T extends r.Component {
|
|
|
749
751
|
{
|
|
750
752
|
key: "no-records",
|
|
751
753
|
className: "k-grid-norecords",
|
|
752
|
-
"aria-rowindex":
|
|
753
|
-
style: { width:
|
|
754
|
+
"aria-rowindex": O,
|
|
755
|
+
style: { width: Ne() }
|
|
754
756
|
},
|
|
755
|
-
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [
|
|
757
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Qe]: _.generateNavigatableId("no-records", h) }, k.length ? k : /* @__PURE__ */ r.createElement(wt, null))
|
|
756
758
|
), Q = {
|
|
757
759
|
size: this.props.size,
|
|
758
760
|
onPageChange: this.pagerPageChange,
|
|
@@ -760,13 +762,13 @@ const T = class T extends r.Component {
|
|
|
760
762
|
dir: this.isRtl ? "rtl" : void 0,
|
|
761
763
|
skip: this.vs.propsSkip || 0,
|
|
762
764
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
763
|
-
messagesMap:
|
|
764
|
-
...
|
|
765
|
-
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(
|
|
765
|
+
messagesMap: ht,
|
|
766
|
+
...It(this.props.pageable || {})
|
|
767
|
+
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(Xe, { className: "k-grid-pager", ...Q }), Ae = (i) => this.props.sort && this.props.sort.filter((g) => g.field === i).length > 0, Me = (i, g) => /* @__PURE__ */ r.createElement(
|
|
766
768
|
"col",
|
|
767
769
|
{
|
|
768
770
|
key: g.toString(),
|
|
769
|
-
width:
|
|
771
|
+
width: B(i)
|
|
770
772
|
}
|
|
771
773
|
), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
772
774
|
(i) => {
|
|
@@ -774,14 +776,14 @@ const T = class T extends r.Component {
|
|
|
774
776
|
return !!(i.footerCell || (g = i.cells) != null && g.footerCell);
|
|
775
777
|
}
|
|
776
778
|
) ? /* @__PURE__ */ r.createElement(
|
|
777
|
-
|
|
779
|
+
at,
|
|
778
780
|
{
|
|
779
781
|
size: this.props.size,
|
|
780
782
|
columnResize: this.columnResize,
|
|
781
783
|
staticHeaders: this.props.scrollable !== "none",
|
|
782
784
|
ref: (i) => this._footer = i,
|
|
783
785
|
row: /* @__PURE__ */ r.createElement(
|
|
784
|
-
|
|
786
|
+
St,
|
|
785
787
|
{
|
|
786
788
|
cells: this.props.cells,
|
|
787
789
|
idPrefix: h,
|
|
@@ -790,7 +792,7 @@ const T = class T extends r.Component {
|
|
|
790
792
|
ariaRowIndex: D + 1
|
|
791
793
|
}
|
|
792
794
|
),
|
|
793
|
-
cols: C.map(
|
|
795
|
+
cols: C.map(Me)
|
|
794
796
|
}
|
|
795
797
|
) : null, te = /* @__PURE__ */ r.createElement(
|
|
796
798
|
"colgroup",
|
|
@@ -804,14 +806,14 @@ const T = class T extends r.Component {
|
|
|
804
806
|
"col",
|
|
805
807
|
{
|
|
806
808
|
key: g.toString(),
|
|
807
|
-
className:
|
|
808
|
-
width:
|
|
809
|
+
className: Ae(i.field) ? "k-sorted" : void 0,
|
|
810
|
+
width: B(i)
|
|
809
811
|
}
|
|
810
812
|
)
|
|
811
813
|
)
|
|
812
814
|
), se = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
813
815
|
if (this.props.scrollable === "none")
|
|
814
|
-
return /* @__PURE__ */ r.createElement(
|
|
816
|
+
return /* @__PURE__ */ r.createElement(W.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
815
817
|
"div",
|
|
816
818
|
{
|
|
817
819
|
id: this.props.id,
|
|
@@ -820,7 +822,7 @@ const T = class T extends r.Component {
|
|
|
820
822
|
"k-grid",
|
|
821
823
|
{
|
|
822
824
|
"k-grid-md": !this.props.size,
|
|
823
|
-
[`k-grid-${
|
|
825
|
+
[`k-grid-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
824
826
|
},
|
|
825
827
|
this.props.className
|
|
826
828
|
),
|
|
@@ -833,7 +835,7 @@ const T = class T extends r.Component {
|
|
|
833
835
|
...ne
|
|
834
836
|
},
|
|
835
837
|
R,
|
|
836
|
-
|
|
838
|
+
A,
|
|
837
839
|
/* @__PURE__ */ r.createElement(
|
|
838
840
|
he,
|
|
839
841
|
{
|
|
@@ -849,30 +851,30 @@ const T = class T extends r.Component {
|
|
|
849
851
|
ref: (i) => this.headTable = i,
|
|
850
852
|
className: N(
|
|
851
853
|
"k-table k-grid-table",
|
|
852
|
-
{ [`k-table-${
|
|
854
|
+
{ [`k-table-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
853
855
|
),
|
|
854
856
|
style: { userSelect: d }
|
|
855
857
|
},
|
|
856
858
|
te,
|
|
857
859
|
j,
|
|
858
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe },
|
|
860
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, M),
|
|
859
861
|
ee
|
|
860
862
|
)
|
|
861
863
|
),
|
|
862
|
-
|
|
864
|
+
K && J(),
|
|
863
865
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
|
|
864
866
|
), z, this.props.pageable && Z);
|
|
865
|
-
let
|
|
866
|
-
return s && (
|
|
867
|
+
let G = this.props.style || {};
|
|
868
|
+
return s && (G.height || (G = Object.assign({}, G, { height: "450px" }))), /* @__PURE__ */ r.createElement(W.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
867
869
|
"div",
|
|
868
870
|
{
|
|
869
871
|
id: this.props.id,
|
|
870
|
-
style:
|
|
872
|
+
style: G,
|
|
871
873
|
className: N(
|
|
872
874
|
"k-grid",
|
|
873
875
|
{
|
|
874
876
|
"k-grid-md": !this.props.size,
|
|
875
|
-
[`k-grid-${
|
|
877
|
+
[`k-grid-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
876
878
|
"k-grid-virtual": s
|
|
877
879
|
},
|
|
878
880
|
this.props.className
|
|
@@ -886,7 +888,7 @@ const T = class T extends r.Component {
|
|
|
886
888
|
...ne
|
|
887
889
|
},
|
|
888
890
|
R,
|
|
889
|
-
|
|
891
|
+
A,
|
|
890
892
|
/* @__PURE__ */ r.createElement(
|
|
891
893
|
"div",
|
|
892
894
|
{
|
|
@@ -895,7 +897,7 @@ const T = class T extends r.Component {
|
|
|
895
897
|
"aria-colcount": C.length,
|
|
896
898
|
"aria-rowcount": a,
|
|
897
899
|
id: this._gridId,
|
|
898
|
-
"aria-label": c.toLanguageString(ue,
|
|
900
|
+
"aria-label": c.toLanguageString(ue, pt[ue])
|
|
899
901
|
},
|
|
900
902
|
j,
|
|
901
903
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
@@ -923,7 +925,7 @@ const T = class T extends r.Component {
|
|
|
923
925
|
"k-table k-grid-table",
|
|
924
926
|
{
|
|
925
927
|
"k-table-md": !this.props.size,
|
|
926
|
-
[`k-table-${
|
|
928
|
+
[`k-table-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
927
929
|
}
|
|
928
930
|
),
|
|
929
931
|
role: "presentation",
|
|
@@ -938,10 +940,10 @@ const T = class T extends r.Component {
|
|
|
938
940
|
role: "rowgroup",
|
|
939
941
|
...pe
|
|
940
942
|
},
|
|
941
|
-
|
|
943
|
+
M
|
|
942
944
|
)
|
|
943
945
|
)
|
|
944
|
-
),
|
|
946
|
+
), K && J()),
|
|
945
947
|
s && /* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
946
948
|
"div",
|
|
947
949
|
{
|
|
@@ -951,7 +953,7 @@ const T = class T extends r.Component {
|
|
|
951
953
|
)),
|
|
952
954
|
ee,
|
|
953
955
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue })),
|
|
954
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
956
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(We, null)
|
|
955
957
|
),
|
|
956
958
|
z,
|
|
957
959
|
this.props.pageable && Z
|
|
@@ -1007,7 +1009,7 @@ const T = class T extends r.Component {
|
|
|
1007
1009
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1008
1010
|
this._columns.splice(a < h ? s(h - l.length) : h, 0, ...l), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, m) => d.orderIndex = m), this._columnsMutations++;
|
|
1009
1011
|
const p = this._columns[a].locked && this._columns[h].locked;
|
|
1010
|
-
|
|
1012
|
+
Ye(this._columnsMap, this._columns, p || this._shouldUpdateLeftRight), Je(this._columnsMap, this._columns, p || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
1011
1013
|
const n = this.columns;
|
|
1012
1014
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1013
1015
|
const d = {
|
|
@@ -1051,7 +1053,7 @@ const T = class T extends r.Component {
|
|
|
1051
1053
|
}
|
|
1052
1054
|
initColumns(a, h) {
|
|
1053
1055
|
const c = _.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = e.length !== this._columns.length;
|
|
1054
|
-
this._columns = e, this._columns.length === 0 && (this._columns =
|
|
1056
|
+
this._columns = e, this._columns.length === 0 && (this._columns = vt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, h, c), this._columnsMap = this.mapColumns(this._columns, t), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1055
1057
|
}
|
|
1056
1058
|
getDataState() {
|
|
1057
1059
|
return {
|
|
@@ -1148,9 +1150,9 @@ T.displayName = "KendoReactGrid", T.defaultProps = {
|
|
|
1148
1150
|
dataItemKey: o.string,
|
|
1149
1151
|
navigatable: o.bool,
|
|
1150
1152
|
size: o.oneOf(["small", "medium"])
|
|
1151
|
-
}, T.contextType =
|
|
1152
|
-
let
|
|
1153
|
-
|
|
1153
|
+
}, T.contextType = W;
|
|
1154
|
+
let $ = T;
|
|
1155
|
+
nt($);
|
|
1154
1156
|
export {
|
|
1155
|
-
|
|
1157
|
+
$ as Grid
|
|
1156
1158
|
};
|
package/GridColumn.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),l=r=>null;l.displayName="KendoReactGridColumn";l.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};l.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,locked:e.bool};exports.GridColumn=l;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),l=r=>null;l.displayName="KendoReactGridColumn";l.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};l.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,menuIcon:e.any,locked:e.bool};exports.GridColumn=l;
|
package/GridColumn.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
const l = (
|
|
10
|
+
const l = (o) => null;
|
|
11
11
|
l.displayName = "KendoReactGridColumn";
|
|
12
12
|
l.defaultProps = {
|
|
13
13
|
filterable: !0,
|
|
@@ -46,6 +46,7 @@ l.propTypes = {
|
|
|
46
46
|
orderIndex: e.number,
|
|
47
47
|
groupable: e.bool,
|
|
48
48
|
columnMenu: e.any,
|
|
49
|
+
menuIcon: e.any,
|
|
49
50
|
locked: e.bool
|
|
50
51
|
};
|
|
51
52
|
export {
|