@progress/kendo-react-treelist 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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/dist/cdn/js/kendo-react-treelist.js +1 -1
- package/dist/es/TreeList.d.ts +8 -5
- package/dist/es/TreeList.js +15 -10
- package/dist/es/cells/EditCells/TreeListBooleanEditor.d.ts +2 -1
- package/dist/es/cells/EditCells/TreeListDateEditor.d.ts +2 -1
- package/dist/es/cells/EditCells/TreeListNumericEditor.d.ts +2 -1
- package/dist/es/cells/EditCells/TreeListTextEditor.d.ts +2 -1
- package/dist/es/cells/TreeListCell.d.ts +2 -1
- package/dist/es/cells/TreeListCell.js +1 -1
- package/dist/es/cells/TreeListSelectionCell.d.ts +2 -1
- package/dist/es/interfaces/TreeListCellProps.d.ts +1 -1
- package/dist/es/interfaces/TreeListColumnProps.d.ts +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rows/TreeListDraggableRow.js +10 -6
- package/dist/es/rows/TreeListRow.js +2 -2
- package/dist/es/utils/data-operations.d.ts +2 -2
- package/dist/es/utils/data-operations.js +14 -10
- package/dist/npm/TreeList.d.ts +8 -5
- package/dist/npm/TreeList.js +32 -27
- package/dist/npm/TreeListNoRecords.js +2 -2
- package/dist/npm/cells/EditCells/TreeListBooleanEditor.d.ts +2 -1
- package/dist/npm/cells/EditCells/TreeListBooleanEditor.js +4 -4
- package/dist/npm/cells/EditCells/TreeListDateEditor.d.ts +2 -1
- package/dist/npm/cells/EditCells/TreeListDateEditor.js +3 -3
- package/dist/npm/cells/EditCells/TreeListNumericEditor.d.ts +2 -1
- package/dist/npm/cells/EditCells/TreeListNumericEditor.js +3 -3
- package/dist/npm/cells/EditCells/TreeListTextEditor.d.ts +2 -1
- package/dist/npm/cells/EditCells/TreeListTextEditor.js +3 -3
- package/dist/npm/cells/FilterCells/TreeListBooleanFilter.js +1 -1
- package/dist/npm/cells/FilterCells/TreeListDateFilter.js +1 -1
- package/dist/npm/cells/FilterCells/TreeListNumericFilter.js +1 -1
- package/dist/npm/cells/FilterCells/TreeListTextFilter.js +1 -1
- package/dist/npm/cells/TreeListCell.d.ts +2 -1
- package/dist/npm/cells/TreeListCell.js +5 -5
- package/dist/npm/cells/TreeListSelectionCell.d.ts +2 -1
- package/dist/npm/cells/TreeListSelectionCell.js +3 -3
- package/dist/npm/header/TreeListHeaderSelectionCell.js +1 -1
- package/dist/npm/interfaces/TreeListCellProps.d.ts +1 -1
- package/dist/npm/interfaces/TreeListColumnProps.d.ts +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rows/TreeListDraggableRow.js +10 -6
- package/dist/npm/rows/TreeListRow.js +3 -3
- package/dist/npm/utils/data-operations.d.ts +2 -2
- package/dist/npm/utils/data-operations.js +26 -22
- package/dist/systemjs/kendo-react-treelist.js +1 -1
- package/package.json +11 -11
package/dist/es/TreeList.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { CommonDragLogic, TableKeyboardNavigationContextType } from '@progress/kendo-react-data-tools';
|
|
4
|
+
import { TreeListCellProps } from './interfaces/TreeListCellProps';
|
|
4
5
|
import { TreeListProps } from './interfaces/TreeListProps';
|
|
6
|
+
import { TreeListHeaderCellProps } from './interfaces/TreeListHeaderCellProps';
|
|
7
|
+
import { TreeListFilterCellProps } from './interfaces/TreeListFilterCellProps';
|
|
5
8
|
/**
|
|
6
9
|
* Represents the [KendoReact TreeList component]({% slug getstarted_treelist %}).
|
|
7
10
|
*/
|
|
@@ -19,7 +22,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
19
22
|
}>>;
|
|
20
23
|
onSortChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
24
|
sort: PropTypes.Requireable<any[]>;
|
|
22
|
-
columns: PropTypes.Requireable<object[]>;
|
|
25
|
+
columns: PropTypes.Requireable<(object | null | undefined)[]>;
|
|
23
26
|
columnVirtualization: PropTypes.Requireable<boolean>;
|
|
24
27
|
filter: PropTypes.Requireable<any[]>;
|
|
25
28
|
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -50,7 +53,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
50
53
|
navigatable: PropTypes.Requireable<boolean>;
|
|
51
54
|
};
|
|
52
55
|
/** @hidden */
|
|
53
|
-
static contextType: React.Context<TableKeyboardNavigationContextType>;
|
|
56
|
+
static contextType: React.Context<TableKeyboardNavigationContextType | undefined>;
|
|
54
57
|
private wrapperScrollLeft;
|
|
55
58
|
private wrapperScrollTop;
|
|
56
59
|
private updateOnScroll;
|
|
@@ -62,7 +65,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
62
65
|
private columnsMap;
|
|
63
66
|
private columnResize;
|
|
64
67
|
private element;
|
|
65
|
-
protected dragLogic: CommonDragLogic
|
|
68
|
+
protected dragLogic: CommonDragLogic<TreeListCellProps, TreeListHeaderCellProps, TreeListFilterCellProps>;
|
|
66
69
|
private _treeListId;
|
|
67
70
|
private get document();
|
|
68
71
|
private contextStateRef;
|
|
@@ -74,7 +77,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
74
77
|
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
75
78
|
*/
|
|
76
79
|
scrollIntoView: (options: {
|
|
77
|
-
rowIndex?: number;
|
|
80
|
+
rowIndex?: number | undefined;
|
|
78
81
|
}) => void;
|
|
79
82
|
/**
|
|
80
83
|
* @hidden
|
|
@@ -83,7 +86,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
83
86
|
/**
|
|
84
87
|
* @hidden
|
|
85
88
|
*/
|
|
86
|
-
getSnapshotBeforeUpdate():
|
|
89
|
+
getSnapshotBeforeUpdate(): null;
|
|
87
90
|
/**
|
|
88
91
|
* @hidden
|
|
89
92
|
*/
|
package/dist/es/TreeList.js
CHANGED
|
@@ -35,10 +35,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
};
|
|
38
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
39
|
-
for (var i = 0,
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
42
46
|
};
|
|
43
47
|
import * as React from 'react';
|
|
44
48
|
import * as PropTypes from 'prop-types';
|
|
@@ -86,7 +90,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
86
90
|
_this.element.scroll(0, (rowIndex - 1) * rowHeight);
|
|
87
91
|
}
|
|
88
92
|
else {
|
|
89
|
-
var selectedRow = _this.element.querySelector("tbody > tr:nth-child("
|
|
93
|
+
var selectedRow = _this.element.querySelector("tbody > tr:nth-child(".concat(rowIndex, ")"));
|
|
90
94
|
if (selectedRow) {
|
|
91
95
|
var offsetTop = selectedRow.offsetTop - _this.tbodyOffsetTop;
|
|
92
96
|
_this.element.scroll(0, offsetTop);
|
|
@@ -100,7 +104,8 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
100
104
|
});
|
|
101
105
|
if (_this.props.onKeyDown) {
|
|
102
106
|
var _a = getSelectionOptions(_this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
103
|
-
|
|
107
|
+
var ev = __assign({ dataItems: _this.getLeafDataItems(), mode: mode, cell: cell, componentId: _this._treeListId, selectedField: _this.props.selectedField }, _this.getArguments(event));
|
|
108
|
+
_this.props.onKeyDown.call(undefined, ev);
|
|
104
109
|
}
|
|
105
110
|
};
|
|
106
111
|
_this.onFocus = function (event) {
|
|
@@ -128,7 +133,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
128
133
|
return index;
|
|
129
134
|
};
|
|
130
135
|
var spliced = _this.extendedColumn.splice(prev, end(prev) - prev);
|
|
131
|
-
(_a = _this.extendedColumn).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced));
|
|
136
|
+
(_a = _this.extendedColumn).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced, false));
|
|
132
137
|
_this.extendedColumn.filter(function (q) { return q.declarationIndex >= 0; }).forEach(function (c, i) { return c.orderIndex = i; });
|
|
133
138
|
if (_this.props.onColumnReorder) {
|
|
134
139
|
var event_1 = {
|
|
@@ -401,10 +406,10 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
401
406
|
return null;
|
|
402
407
|
}
|
|
403
408
|
var columnKey = column.id ? column.id : columnIndex;
|
|
404
|
-
var className = ""
|
|
405
|
-
+
|
|
409
|
+
var className = "".concat(column.className ? column.className + ' ' : '')
|
|
410
|
+
+ "".concat(column.locked ? 'k-grid-content-sticky' : '');
|
|
406
411
|
var cellProps = {
|
|
407
|
-
id: navigationTools.generateNavigatableId(rowId
|
|
412
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(columnIndex)), idPrefix),
|
|
408
413
|
colSpan: colSpans[columnIndex],
|
|
409
414
|
dataItem: item.dataItem,
|
|
410
415
|
field: column.field,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListBooleanEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListBooleanEditor: {
|
|
5
|
-
(props: TreeListBooleanEditorProps):
|
|
6
|
+
(props: TreeListBooleanEditorProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListDateEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListDateEditor: {
|
|
5
|
-
(props: TreeListDateEditorProps):
|
|
6
|
+
(props: TreeListDateEditorProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListNumericEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListNumericEditor: {
|
|
5
|
-
(props: TreeListNumericEditorProps): any;
|
|
6
|
+
(props: TreeListNumericEditorProps): React.ReactElement<HTMLTableCellElement, string | React.JSXElementConstructor<any>> | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListTextEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListTextEditor: {
|
|
5
|
-
(props: TreeListTextEditorProps):
|
|
6
|
+
(props: TreeListTextEditorProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -40,7 +40,7 @@ export var TreeListCell = function (props) {
|
|
|
40
40
|
if (props.expandable) {
|
|
41
41
|
icons.push.apply(icons, level.slice(1).map(function (_x, i) { return (React.createElement("span", { className: "k-icon k-i-none", key: i })); }));
|
|
42
42
|
if (hasChildren) {
|
|
43
|
-
icons.push(React.createElement("span", __assign({ className: "k-icon k-i-"
|
|
43
|
+
icons.push(React.createElement("span", __assign({ className: "k-icon k-i-".concat(expanded ? 'collapse' : 'expand'), key: "expand-collapse", onClick: function (event) { return props.onExpandChange(event, dataItem, level); } }, (_a = {}, _a[TREELIST_PREVENT_SELECTION_ELEMENT] = true, _a))));
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
icons.push(React.createElement("span", { className: "k-icon k-i-none", key: icons.length }));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListSelectionCellProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListSelectionCell: {
|
|
5
|
-
(props: TreeListSelectionCellProps):
|
|
6
|
+
(props: TreeListSelectionCellProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -3,7 +3,7 @@ import { CellProps } from '@progress/kendo-react-data-tools';
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents the props of the TreeListCell component.
|
|
5
5
|
*/
|
|
6
|
-
export interface TreeListCellProps extends CellProps {
|
|
6
|
+
export interface TreeListCellProps extends Omit<CellProps, 'onExpandChange' | 'render' | 'onChange'> {
|
|
7
7
|
/**
|
|
8
8
|
* An array of indexes of each parent and current item in the data tree.
|
|
9
9
|
*/
|
|
@@ -6,7 +6,7 @@ import { TreeListFilterCellProps } from './TreeListFilterCellProps';
|
|
|
6
6
|
/**
|
|
7
7
|
* The props of the columns of the TreeList component.
|
|
8
8
|
*/
|
|
9
|
-
export interface TreeListColumnProps extends TreeColumnBaseProps {
|
|
9
|
+
export interface TreeListColumnProps extends Omit<TreeColumnBaseProps, 'children' | 'cell' | 'editCell'> {
|
|
10
10
|
/**
|
|
11
11
|
* Defines the component that will be rendered as a cell. If not set, a `TreeListCell` will be rendered by default.
|
|
12
12
|
*/
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-treelist',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654762280,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -24,10 +24,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
28
|
-
for (var i = 0,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
28
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
29
|
+
if (ar || !(i in from)) {
|
|
30
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
31
|
+
ar[i] = from[i];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
35
|
};
|
|
32
36
|
import * as React from 'react';
|
|
33
37
|
import * as ReactDOM from 'react-dom';
|
|
@@ -133,8 +137,8 @@ var TreeListDraggableRow = /** @class */ (function (_super) {
|
|
|
133
137
|
_this.onRelease = function (args) {
|
|
134
138
|
var event = args.event;
|
|
135
139
|
if (_this.dragged) {
|
|
136
|
-
var dragged = __spreadArray([], _this.dragged);
|
|
137
|
-
var draggedOver = _this.draggedOver && __spreadArray([], _this.draggedOver);
|
|
140
|
+
var dragged = __spreadArray([], _this.dragged, true);
|
|
141
|
+
var draggedOver = _this.draggedOver && __spreadArray([], _this.draggedOver, true);
|
|
138
142
|
var allowDrop = _this.state.clueProps.allowDrop;
|
|
139
143
|
_this.dragged = null;
|
|
140
144
|
_this.draggedOver = null;
|
|
@@ -24,7 +24,7 @@ export var TreeListRow = React.forwardRef(function (props, ref) {
|
|
|
24
24
|
});
|
|
25
25
|
var style = React.useMemo(function () { return rowHeight !== undefined ? { height: rowHeight + 'px' } : undefined; }, [rowHeight]);
|
|
26
26
|
var defaultRendering = (React.createElement("tr", __assign({ onClick: props.onClick, onDoubleClick: props.onDoubleClick, onContextMenu: props.onContextMenu, className: className, style: style, ref: ref, "aria-expanded": expanded, role: 'row', "aria-rowindex": ariaRowIndex, "aria-level": level.length, "aria-posinset": ariaPosInSet, "aria-setsize": ariaSetSize }, (_a = {}, _a[TREELIST_ROW_INDEX_ATTRIBUTE] = props.rowIndex, _a)), props.children));
|
|
27
|
-
return props.render ?
|
|
27
|
+
return (React.createElement(React.Fragment, null, props.render ?
|
|
28
28
|
props.render.call(undefined, defaultRendering, props) :
|
|
29
|
-
defaultRendering;
|
|
29
|
+
defaultRendering));
|
|
30
30
|
});
|
|
@@ -80,7 +80,7 @@ export declare const extendDataItem: (item: any, subItemsField: string, propsToE
|
|
|
80
80
|
* in the tree data and the items for which returns true will be removed.
|
|
81
81
|
* @returns {any[]} - The new data tree.
|
|
82
82
|
*/
|
|
83
|
-
export declare const removeItems: (data: any, subItemsField:
|
|
83
|
+
export declare const removeItems: (data: any[], subItemsField: string, condition: (item: any) => boolean) => any[];
|
|
84
84
|
/**
|
|
85
85
|
* Changes the `subItems` collection of each data item which matches the passed `condition`.
|
|
86
86
|
*
|
|
@@ -92,7 +92,7 @@ export declare const removeItems: (data: any, subItemsField: any, condition: any
|
|
|
92
92
|
* has as a parameter the subitems collection of the matched items and which will return the new subitems collection.
|
|
93
93
|
* @returns {any[]} - The new data tree.
|
|
94
94
|
*/
|
|
95
|
-
export declare const modifySubItems: (data: any, subItemsField:
|
|
95
|
+
export declare const modifySubItems: (data: any[], subItemsField: string, condition: (item: any) => boolean, change: (subItems: any[]) => any[]) => any[];
|
|
96
96
|
/**
|
|
97
97
|
* Returns the data item path in the tree based on the level parameter.
|
|
98
98
|
*
|
|
@@ -9,10 +9,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
|
-
for (var i = 0,
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
16
20
|
};
|
|
17
21
|
import { getNestedValue } from './index';
|
|
18
22
|
import { filterBy as filterByCommon, orderBy as orderByCommon } from '@progress/kendo-react-data-tools';
|
|
@@ -82,14 +86,14 @@ export function flatData(data, getChildren, itemMap) {
|
|
|
82
86
|
}
|
|
83
87
|
while (stack.length > 0) {
|
|
84
88
|
var stackItem = stack.pop();
|
|
85
|
-
flatted.push(__assign(__assign({ dataItem: stackItem.root, level: __spreadArray([], stackItem.level) }, itemMap(stackItem.root)), { levelCount: stackItem.levelCount }));
|
|
89
|
+
flatted.push(__assign(__assign({ dataItem: stackItem.root, level: __spreadArray([], stackItem.level, true) }, itemMap(stackItem.root)), { levelCount: stackItem.levelCount }));
|
|
86
90
|
if (stackItem.data.length) {
|
|
87
91
|
for (var i = stackItem.data.length - 1; i >= 0; i--) {
|
|
88
92
|
var root = stackItem.data[i];
|
|
89
93
|
stack.push({
|
|
90
94
|
root: root,
|
|
91
95
|
data: getChildren(root),
|
|
92
|
-
level: __spreadArray(__spreadArray([], stackItem.level), [i]),
|
|
96
|
+
level: __spreadArray(__spreadArray([], stackItem.level, true), [i], false),
|
|
93
97
|
levelCount: stackItem.data.length
|
|
94
98
|
});
|
|
95
99
|
}
|
|
@@ -169,8 +173,8 @@ export var extendDataItem = function (item, subItemsField, propsToExtend) {
|
|
|
169
173
|
*/
|
|
170
174
|
export var removeItems = function (data, subItemsField, condition) {
|
|
171
175
|
var _a;
|
|
172
|
-
var newData = mapTree([(_a = {}, _a[subItemsField] = __spreadArray([], data), _a)], subItemsField, function (item) { return removeChild(item, condition, subItemsField); });
|
|
173
|
-
return __spreadArray([], newData[0][subItemsField]);
|
|
176
|
+
var newData = mapTree([(_a = {}, _a[subItemsField] = __spreadArray([], data, true), _a)], subItemsField, function (item) { return removeChild(item, condition, subItemsField); });
|
|
177
|
+
return __spreadArray([], newData[0][subItemsField], true);
|
|
174
178
|
};
|
|
175
179
|
/**
|
|
176
180
|
* @hidden
|
|
@@ -180,7 +184,7 @@ var removeChild = function (item, condition, subItemsField) {
|
|
|
180
184
|
var subItems = item[subItemsField] || [];
|
|
181
185
|
var childIndex = subItems.findIndex(condition);
|
|
182
186
|
if (childIndex !== -1) {
|
|
183
|
-
var newChildren = __spreadArray([], subItems);
|
|
187
|
+
var newChildren = __spreadArray([], subItems, true);
|
|
184
188
|
newChildren.splice(childIndex, 1);
|
|
185
189
|
return __assign(__assign({}, item), (_a = {}, _a[subItemsField] = newChildren, _a));
|
|
186
190
|
}
|
|
@@ -226,7 +230,7 @@ export var getItemPath = function (tree, level, subItemsField) {
|
|
|
226
230
|
* @returns {any[]} - The new data tree.
|
|
227
231
|
*/
|
|
228
232
|
export var moveTreeItem = function (data, target, destination, subItemsField) {
|
|
229
|
-
var tree = __spreadArray([], data);
|
|
233
|
+
var tree = __spreadArray([], data, true);
|
|
230
234
|
var targetItemPath = getItemPath(tree, target, subItemsField);
|
|
231
235
|
var targetItem = targetItemPath.pop();
|
|
232
236
|
var targetParent = targetItemPath.pop();
|
package/dist/npm/TreeList.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { CommonDragLogic, TableKeyboardNavigationContextType } from '@progress/kendo-react-data-tools';
|
|
4
|
+
import { TreeListCellProps } from './interfaces/TreeListCellProps';
|
|
4
5
|
import { TreeListProps } from './interfaces/TreeListProps';
|
|
6
|
+
import { TreeListHeaderCellProps } from './interfaces/TreeListHeaderCellProps';
|
|
7
|
+
import { TreeListFilterCellProps } from './interfaces/TreeListFilterCellProps';
|
|
5
8
|
/**
|
|
6
9
|
* Represents the [KendoReact TreeList component]({% slug getstarted_treelist %}).
|
|
7
10
|
*/
|
|
@@ -19,7 +22,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
19
22
|
}>>;
|
|
20
23
|
onSortChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
24
|
sort: PropTypes.Requireable<any[]>;
|
|
22
|
-
columns: PropTypes.Requireable<object[]>;
|
|
25
|
+
columns: PropTypes.Requireable<(object | null | undefined)[]>;
|
|
23
26
|
columnVirtualization: PropTypes.Requireable<boolean>;
|
|
24
27
|
filter: PropTypes.Requireable<any[]>;
|
|
25
28
|
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -50,7 +53,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
50
53
|
navigatable: PropTypes.Requireable<boolean>;
|
|
51
54
|
};
|
|
52
55
|
/** @hidden */
|
|
53
|
-
static contextType: React.Context<TableKeyboardNavigationContextType>;
|
|
56
|
+
static contextType: React.Context<TableKeyboardNavigationContextType | undefined>;
|
|
54
57
|
private wrapperScrollLeft;
|
|
55
58
|
private wrapperScrollTop;
|
|
56
59
|
private updateOnScroll;
|
|
@@ -62,7 +65,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
62
65
|
private columnsMap;
|
|
63
66
|
private columnResize;
|
|
64
67
|
private element;
|
|
65
|
-
protected dragLogic: CommonDragLogic
|
|
68
|
+
protected dragLogic: CommonDragLogic<TreeListCellProps, TreeListHeaderCellProps, TreeListFilterCellProps>;
|
|
66
69
|
private _treeListId;
|
|
67
70
|
private get document();
|
|
68
71
|
private contextStateRef;
|
|
@@ -74,7 +77,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
74
77
|
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
75
78
|
*/
|
|
76
79
|
scrollIntoView: (options: {
|
|
77
|
-
rowIndex?: number;
|
|
80
|
+
rowIndex?: number | undefined;
|
|
78
81
|
}) => void;
|
|
79
82
|
/**
|
|
80
83
|
* @hidden
|
|
@@ -83,7 +86,7 @@ export declare class TreeList extends React.Component<TreeListProps, {}> {
|
|
|
83
86
|
/**
|
|
84
87
|
* @hidden
|
|
85
88
|
*/
|
|
86
|
-
getSnapshotBeforeUpdate():
|
|
89
|
+
getSnapshotBeforeUpdate(): null;
|
|
87
90
|
/**
|
|
88
91
|
* @hidden
|
|
89
92
|
*/
|
package/dist/npm/TreeList.js
CHANGED
|
@@ -36,10 +36,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
36
36
|
}
|
|
37
37
|
return t;
|
|
38
38
|
};
|
|
39
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
40
|
-
for (var i = 0,
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
40
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
41
|
+
if (ar || !(i in from)) {
|
|
42
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
43
|
+
ar[i] = from[i];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
43
47
|
};
|
|
44
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
49
|
exports.TreeList = void 0;
|
|
@@ -71,7 +75,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
71
75
|
_this.extendedColumn = [];
|
|
72
76
|
_this.columnsMap = [];
|
|
73
77
|
_this.element = null;
|
|
74
|
-
_this._treeListId = kendo_react_common_1.guid();
|
|
78
|
+
_this._treeListId = (0, kendo_react_common_1.guid)();
|
|
75
79
|
_this.contextStateRef = { current: undefined };
|
|
76
80
|
_this.navigationStateRef = { current: undefined };
|
|
77
81
|
/**
|
|
@@ -89,7 +93,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
89
93
|
_this.element.scroll(0, (rowIndex - 1) * rowHeight);
|
|
90
94
|
}
|
|
91
95
|
else {
|
|
92
|
-
var selectedRow = _this.element.querySelector("tbody > tr:nth-child("
|
|
96
|
+
var selectedRow = _this.element.querySelector("tbody > tr:nth-child(".concat(rowIndex, ")"));
|
|
93
97
|
if (selectedRow) {
|
|
94
98
|
var offsetTop = selectedRow.offsetTop - _this.tbodyOffsetTop;
|
|
95
99
|
_this.element.scroll(0, offsetTop);
|
|
@@ -102,8 +106,9 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
102
106
|
navigationStateRef: _this.navigationStateRef
|
|
103
107
|
});
|
|
104
108
|
if (_this.props.onKeyDown) {
|
|
105
|
-
var _a = kendo_react_data_tools_1.getSelectionOptions(_this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
106
|
-
|
|
109
|
+
var _a = (0, kendo_react_data_tools_1.getSelectionOptions)(_this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
110
|
+
var ev = __assign({ dataItems: _this.getLeafDataItems(), mode: mode, cell: cell, componentId: _this._treeListId, selectedField: _this.props.selectedField }, _this.getArguments(event));
|
|
111
|
+
_this.props.onKeyDown.call(undefined, ev);
|
|
107
112
|
}
|
|
108
113
|
};
|
|
109
114
|
_this.onFocus = function (event) {
|
|
@@ -131,7 +136,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
131
136
|
return index;
|
|
132
137
|
};
|
|
133
138
|
var spliced = _this.extendedColumn.splice(prev, end(prev) - prev);
|
|
134
|
-
(_a = _this.extendedColumn).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced));
|
|
139
|
+
(_a = _this.extendedColumn).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced, false));
|
|
135
140
|
_this.extendedColumn.filter(function (q) { return q.declarationIndex >= 0; }).forEach(function (c, i) { return c.orderIndex = i; });
|
|
136
141
|
if (_this.props.onColumnReorder) {
|
|
137
142
|
var event_1 = {
|
|
@@ -204,7 +209,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
204
209
|
}
|
|
205
210
|
}
|
|
206
211
|
_this.tbodyOffsetTop = table.tBodies[0].offsetTop;
|
|
207
|
-
index_1.setHeaderRowsTop(table, toolbarHeight);
|
|
212
|
+
(0, index_1.setHeaderRowsTop)(table, toolbarHeight);
|
|
208
213
|
};
|
|
209
214
|
_this.itemChange = function (event) {
|
|
210
215
|
var itemChange = _this.props.onItemChange;
|
|
@@ -294,16 +299,16 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
294
299
|
_this.expandedSubItems = function (dataItem) {
|
|
295
300
|
var items = [];
|
|
296
301
|
if (_this.expanded(dataItem) && _this.hasChildren(dataItem)) {
|
|
297
|
-
items.push.apply(items, index_1.getNestedValue(_this.props.subItemsField, dataItem));
|
|
302
|
+
items.push.apply(items, (0, index_1.getNestedValue)(_this.props.subItemsField, dataItem));
|
|
298
303
|
}
|
|
299
304
|
return items;
|
|
300
305
|
};
|
|
301
306
|
_this.getLeafDataItems = function () {
|
|
302
307
|
return _this.flatData.map(function (item) { return item.dataItem; });
|
|
303
308
|
};
|
|
304
|
-
_this.expanded = function (dataItem) { return Boolean(index_1.getNestedValue(_this.props.expandField, dataItem)); };
|
|
305
|
-
_this.hasChildren = function (dataItem) { return Boolean(index_1.getNestedValue(_this.props.subItemsField, dataItem)); };
|
|
306
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
309
|
+
_this.expanded = function (dataItem) { return Boolean((0, index_1.getNestedValue)(_this.props.expandField, dataItem)); };
|
|
310
|
+
_this.hasChildren = function (dataItem) { return Boolean((0, index_1.getNestedValue)(_this.props.subItemsField, dataItem)); };
|
|
311
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
307
312
|
_this.dragLogic = new kendo_react_data_tools_1.CommonDragLogic(_this.columnReorder, kendo_react_common_1.noop, kendo_react_common_1.noop);
|
|
308
313
|
_this.columnResize = new kendo_react_data_tools_1.ColumnResize(_this.onResize.bind(_this));
|
|
309
314
|
kendo_react_data_tools_1.tableKeyboardNavigation.onConstructor({
|
|
@@ -381,8 +386,8 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
381
386
|
var FilterRow = filterRow || kendo_react_data_tools_1.FilterRow;
|
|
382
387
|
var idPrefix = kendo_react_data_tools_1.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);
|
|
383
388
|
if (this.prevColumns !== columns) {
|
|
384
|
-
this.extendedColumn = kendo_react_data_tools_1.readColumns(columns, { prevId: 0, idPrefix: idPrefix });
|
|
385
|
-
this.columnsMap = kendo_react_data_tools_1.mapColumns(this.extendedColumn);
|
|
389
|
+
this.extendedColumn = (0, kendo_react_data_tools_1.readColumns)(columns, { prevId: 0, idPrefix: idPrefix });
|
|
390
|
+
this.columnsMap = (0, kendo_react_data_tools_1.mapColumns)(this.extendedColumn);
|
|
386
391
|
}
|
|
387
392
|
this.prevColumns = this.props.columns;
|
|
388
393
|
var leafColumns = this.extendedColumn.filter(function (c) { return c.children.length === 0; });
|
|
@@ -393,7 +398,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
393
398
|
this.dragLogic.groupable = false;
|
|
394
399
|
var header = (React.createElement(kendo_react_data_tools_1.Header, { headerRow: React.createElement(kendo_react_data_tools_1.HeaderRow, { sort: this.props.sort, sortable: this.props.sortable, sortChange: this.sortChange, selectionChange: this.onHeaderSelectionChange, columns: this.extendedColumn, columnsMap: this.columnsMap, cellRender: this.props.headerCellRender, columnResize: this.columnResize, columnMenu: this.props.columnMenu, columnMenuFilter: this.props.columnMenuFilter, columnMenuFilterChange: this.columnMenuFilterChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler }), filterRow: filterable && React.createElement(FilterRow, { columns: leafColumns, filter: this.props.filter, filterChange: this.filterChange, sort: this.props.sort, ariaRowIndex: this.columnsMap.length + 1 }) || undefined, columnResize: this.columnResize }));
|
|
395
400
|
var wrapperStyles = this.props.style || {};
|
|
396
|
-
var _f = kendo_react_data_tools_1.tableColumnsVirtualization({
|
|
401
|
+
var _f = (0, kendo_react_data_tools_1.tableColumnsVirtualization)({
|
|
397
402
|
enabled: this.props.columnVirtualization,
|
|
398
403
|
columns: leafColumns,
|
|
399
404
|
scrollLeft: this.wrapperScrollLeft,
|
|
@@ -404,10 +409,10 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
404
409
|
return null;
|
|
405
410
|
}
|
|
406
411
|
var columnKey = column.id ? column.id : columnIndex;
|
|
407
|
-
var className = ""
|
|
408
|
-
+
|
|
412
|
+
var className = "".concat(column.className ? column.className + ' ' : '')
|
|
413
|
+
+ "".concat(column.locked ? 'k-grid-content-sticky' : '');
|
|
409
414
|
var cellProps = {
|
|
410
|
-
id: kendo_react_data_tools_1.tableKeyboardNavigationTools.generateNavigatableId(rowId
|
|
415
|
+
id: kendo_react_data_tools_1.tableKeyboardNavigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(columnIndex)), idPrefix),
|
|
411
416
|
colSpan: colSpans[columnIndex],
|
|
412
417
|
dataItem: item.dataItem,
|
|
413
418
|
field: column.field,
|
|
@@ -446,7 +451,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
446
451
|
flattedData = flattedData.slice(skip, skip + take);
|
|
447
452
|
}
|
|
448
453
|
if (scrollable === 'virtual') {
|
|
449
|
-
flattedData = index_1.tableRowsVirtualization({
|
|
454
|
+
flattedData = (0, index_1.tableRowsVirtualization)({
|
|
450
455
|
rows: flattedData,
|
|
451
456
|
tableViewPortHeight: parseFloat((wrapperStyles.height || wrapperStyles.maxHeight || '').toString()),
|
|
452
457
|
scrollTop: this.wrapperScrollTop
|
|
@@ -456,11 +461,11 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
456
461
|
var levels = flattedData.map(function (i) { return i.level; });
|
|
457
462
|
var rowIndexStart = this.columnsMap.length + (filterable ? 1 : 0) + 1;
|
|
458
463
|
var body = flattedData.length > 0 && flattedData.map(function (item, rowIndex) {
|
|
459
|
-
var inEdit = index_1.getNestedValue(_this.props.editField, item.dataItem);
|
|
460
|
-
var dataItemKeyValue = _this.props.dataItemKey && kendo_react_common_1.getter(_this.props.dataItemKey)(item.dataItem);
|
|
464
|
+
var inEdit = (0, index_1.getNestedValue)(_this.props.editField, item.dataItem);
|
|
465
|
+
var dataItemKeyValue = _this.props.dataItemKey && (0, kendo_react_common_1.getter)(_this.props.dataItemKey)(item.dataItem);
|
|
461
466
|
var rowId = String(dataItemKeyValue ? dataItemKeyValue : item.level.join('.'));
|
|
462
467
|
var isRowExpanded = _this.expanded(item.dataItem);
|
|
463
|
-
var selectedValue = _this.props.selectedField ? index_1.getNestedValue(_this.props.selectedField, item.dataItem) : undefined;
|
|
468
|
+
var selectedValue = _this.props.selectedField ? (0, index_1.getNestedValue)(_this.props.selectedField, item.dataItem) : undefined;
|
|
464
469
|
var rowProps = {
|
|
465
470
|
key: rowId,
|
|
466
471
|
level: item.level,
|
|
@@ -498,7 +503,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
498
503
|
var tableUserSelect = this.props.selectable && this.props.selectable.drag ? 'none' : undefined;
|
|
499
504
|
var tableProps = (this.props.tableProps || {});
|
|
500
505
|
return (React.createElement(kendo_react_data_tools_1.TableKeyboardNavigationContext.Provider, { value: this.contextStateRef.current },
|
|
501
|
-
React.createElement("div", __assign({ style: this.props.style, className: kendo_react_common_1.classNames('k-widget k-grid', this.props.className, { 'k-treelist-scrollable': scrollable !== 'none' }), ref: function (e) { return _this.element = e; }, onScroll: virtualScroll ? this.handleOnScroll : undefined, onKeyDown: this.onKeyDown, onFocus: this.onFocus, "aria-rowcount": total, "aria-colcount": leafColumns.length, role: 'treegrid' }, kendo_react_data_tools_1.tableKeyboardNavigationScopeAttributes),
|
|
506
|
+
React.createElement("div", __assign({ style: this.props.style, className: (0, kendo_react_common_1.classNames)('k-widget k-grid', this.props.className, { 'k-treelist-scrollable': scrollable !== 'none' }), ref: function (e) { return _this.element = e; }, onScroll: virtualScroll ? this.handleOnScroll : undefined, onKeyDown: this.onKeyDown, onFocus: this.onFocus, "aria-rowcount": total, "aria-colcount": leafColumns.length, role: 'treegrid' }, kendo_react_data_tools_1.tableKeyboardNavigationScopeAttributes),
|
|
502
507
|
this.props.toolbar,
|
|
503
508
|
React.createElement(kendo_react_data_tools_1.TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease },
|
|
504
509
|
React.createElement("table", __assign({}, tableProps, { style: __assign(__assign({}, (tableProps.style || {})), { userSelect: tableUserSelect }), role: 'presentation' }),
|
|
@@ -539,7 +544,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
539
544
|
this.tbodyOffsetTop > 0 &&
|
|
540
545
|
this.flattedData.length) ?
|
|
541
546
|
this.flattedData :
|
|
542
|
-
data_operations_1.flatData(data, this.expandedSubItems, itemDataMap);
|
|
547
|
+
(0, data_operations_1.flatData)(data, this.expandedSubItems, itemDataMap);
|
|
543
548
|
this.prevData = data;
|
|
544
549
|
this.flattedData = flattedData;
|
|
545
550
|
return flattedData;
|
|
@@ -550,7 +555,7 @@ var TreeList = /** @class */ (function (_super) {
|
|
|
550
555
|
TreeList.prototype.selectionChange = function (options) {
|
|
551
556
|
if (this.props.onSelectionChange) {
|
|
552
557
|
var event_4 = options.event, item = options.item, dataIndex = options.dataIndex, columnIndex = options.columnIndex;
|
|
553
|
-
var _a = kendo_react_data_tools_1.getSelectionOptions(this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
558
|
+
var _a = (0, kendo_react_data_tools_1.getSelectionOptions)(this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
554
559
|
var selectionEvent = __assign(__assign({}, this.getArguments(event_4.syntheticEvent)), { dataItem: item.dataItem, level: item.level, startColIndex: columnIndex, endColIndex: columnIndex, startRowIndex: dataIndex, endRowIndex: dataIndex, dataItems: this.getLeafDataItems(), altKey: false, ctrlKey: false, shiftKey: false, metaKey: false, mode: mode, cell: cell, isDrag: false, componentId: this._treeListId, selectedField: this.props.selectedField || '' });
|
|
555
560
|
this.props.onSelectionChange.call(undefined, selectionEvent);
|
|
556
561
|
}
|
|
@@ -32,9 +32,9 @@ var TreeListNoRecords = /** @class */ (function (_super) {
|
|
|
32
32
|
* @hidden
|
|
33
33
|
*/
|
|
34
34
|
TreeListNoRecords.prototype.render = function () {
|
|
35
|
-
return this.props.children || kendo_react_intl_1.provideLocalizationService(this).toLanguageString(messages_1.noRecords, messages_1.messages[messages_1.noRecords]);
|
|
35
|
+
return this.props.children || (0, kendo_react_intl_1.provideLocalizationService)(this).toLanguageString(messages_1.noRecords, messages_1.messages[messages_1.noRecords]);
|
|
36
36
|
};
|
|
37
37
|
return TreeListNoRecords;
|
|
38
38
|
}(React.Component));
|
|
39
39
|
exports.TreeListNoRecords = TreeListNoRecords;
|
|
40
|
-
kendo_react_intl_1.registerForLocalization(TreeListNoRecords);
|
|
40
|
+
(0, kendo_react_intl_1.registerForLocalization)(TreeListNoRecords);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListBooleanEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListBooleanEditor: {
|
|
5
|
-
(props: TreeListBooleanEditorProps):
|
|
6
|
+
(props: TreeListBooleanEditorProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -30,13 +30,13 @@ var TreeListBooleanEditor = function (props) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}, [props.onChange, props.dataItem, props.level, props.field]);
|
|
33
|
-
var inputId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
34
|
-
var navigationAttributes = kendo_react_data_tools_1.useTableKeyboardNavigation(props.id);
|
|
35
|
-
var editCellClasses = kendo_react_common_1.classNames((_a = {},
|
|
33
|
+
var inputId = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
34
|
+
var navigationAttributes = (0, kendo_react_data_tools_1.useTableKeyboardNavigation)(props.id);
|
|
35
|
+
var editCellClasses = (0, kendo_react_common_1.classNames)((_a = {},
|
|
36
36
|
_a['k-selected'] = props.isSelected,
|
|
37
37
|
_a), props.className);
|
|
38
38
|
var defaultRendering = (React.createElement("td", __assign({ style: props.style, className: editCellClasses, "aria-colindex": props.ariaColumnIndex, "aria-selected": props.isSelected, role: 'gridcell' }, navigationAttributes, (_b = {}, _b[constants_1.TREELIST_COL_INDEX_ATTRIBUTE] = props.colIndex, _b)),
|
|
39
|
-
React.createElement("input", { checked: utils_1.getNestedValue(props.field, props.dataItem) || false, id: inputId, type: "checkbox", className: "k-checkbox k-checkbox-md k-rounded-md", onChange: onChange }),
|
|
39
|
+
React.createElement("input", { checked: (0, utils_1.getNestedValue)(props.field, props.dataItem) || false, id: inputId, type: "checkbox", className: "k-checkbox k-checkbox-md k-rounded-md", onChange: onChange }),
|
|
40
40
|
React.createElement("label", { className: "k-checkbox-label", htmlFor: inputId })));
|
|
41
41
|
return props.render ?
|
|
42
42
|
props.render.call(undefined, defaultRendering, props) :
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TreeListCellProps } from '../../interfaces/TreeListCellProps';
|
|
2
3
|
export interface TreeListDateEditorProps extends TreeListCellProps {
|
|
3
4
|
}
|
|
4
5
|
export declare const TreeListDateEditor: {
|
|
5
|
-
(props: TreeListDateEditorProps):
|
|
6
|
+
(props: TreeListDateEditorProps): JSX.Element | null;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|