@progress/kendo-react-treeview 5.4.0-dev.202205200719 → 5.4.0-dev.202206061009
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-treeview.js +1 -1
- package/dist/es/ItemRenderProps.js +1 -0
- package/dist/es/TreeView.d.ts +10 -10
- package/dist/es/TreeView.js +18 -12
- package/dist/es/TreeViewDragAnalyzer.d.ts +4 -4
- package/dist/es/TreeViewDragAnalyzer.js +7 -5
- package/dist/es/TreeViewDragClue.d.ts +2 -2
- package/dist/es/TreeViewDragClue.js +5 -3
- package/dist/es/TreeViewItem.d.ts +7 -7
- package/dist/es/TreeViewItem.js +13 -11
- package/dist/es/TreeViewOperationDescriptors.js +1 -0
- package/dist/es/TreeViewProps.js +1 -0
- package/dist/es/events.d.ts +1 -1
- package/dist/es/events.js +1 -0
- package/dist/es/main.d.ts +5 -5
- package/dist/es/main.js +5 -5
- package/dist/es/moveTreeViewItem.d.ts +3 -3
- package/dist/es/moveTreeViewItem.js +2 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/processTreeViewItems.d.ts +1 -1
- package/dist/es/processTreeViewItems.js +1 -1
- package/dist/es/utils/itemUtils.d.ts +2 -2
- package/dist/npm/TreeView.d.ts +10 -10
- package/dist/npm/TreeView.js +29 -22
- package/dist/npm/TreeViewDragAnalyzer.d.ts +4 -4
- package/dist/npm/TreeViewDragAnalyzer.js +8 -5
- package/dist/npm/TreeViewDragClue.d.ts +2 -2
- package/dist/npm/TreeViewDragClue.js +7 -4
- package/dist/npm/TreeViewItem.d.ts +7 -7
- package/dist/npm/TreeViewItem.js +24 -21
- package/dist/npm/events.d.ts +1 -1
- package/dist/npm/handleTreeViewCheckChange.js +11 -10
- package/dist/npm/main.d.ts +5 -5
- package/dist/npm/main.js +8 -7
- package/dist/npm/moveTreeViewItem.d.ts +3 -3
- package/dist/npm/moveTreeViewItem.js +9 -8
- package/dist/npm/package-metadata.js +2 -1
- package/dist/npm/processTreeViewItems.d.ts +1 -1
- package/dist/npm/processTreeViewItems.js +8 -7
- package/dist/npm/utils/FieldsService.js +9 -9
- package/dist/npm/utils/consts.js +1 -0
- package/dist/npm/utils/getItemIdUponKeyboardNavigation.js +5 -5
- package/dist/npm/utils/itemIdUtils.js +1 -0
- package/dist/npm/utils/itemUtils.d.ts +2 -2
- package/dist/npm/utils/itemUtils.js +19 -18
- package/dist/npm/utils/misc.js +1 -0
- package/dist/systemjs/kendo-react-treeview.js +1 -1
- package/package.json +6 -6
package/dist/es/TreeView.js
CHANGED
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -51,6 +53,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
51
53
|
* @hidden
|
|
52
54
|
*/
|
|
53
55
|
_this.state = { focusedItemId: undefined, focusedItemPublicId: undefined, tabbableItemId: ZERO_LEVEL_ZERO_NODE_ID };
|
|
56
|
+
_this.fieldsSvc = null;
|
|
54
57
|
// When there is a change in state.focusedItemId, calling focus() on the dom element of the focused item
|
|
55
58
|
// is most often not needed, because the browser focuses the element on its own.
|
|
56
59
|
// https://github.com/telerik/kendo-react/issues/190
|
|
@@ -119,7 +122,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
119
122
|
};
|
|
120
123
|
_this.onKeyDown = function (event) {
|
|
121
124
|
var focusedItem = _this.getFocusedItem();
|
|
122
|
-
if (focusedItem) {
|
|
125
|
+
if (focusedItem && _this.fieldsSvc) {
|
|
123
126
|
var newItemId = nav(focusedItem, _this.state.focusedItemId, _this.data, event.keyCode, _this.fieldsSvc);
|
|
124
127
|
if (newItemId !== _this.state.focusedItemId) {
|
|
125
128
|
// This disables the auto-scroll. The scroll is achieved via item focusing.
|
|
@@ -140,19 +143,19 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
140
143
|
get: function () {
|
|
141
144
|
return this._element;
|
|
142
145
|
},
|
|
143
|
-
enumerable:
|
|
146
|
+
enumerable: false,
|
|
144
147
|
configurable: true
|
|
145
148
|
});
|
|
146
149
|
/**
|
|
147
150
|
* @hidden
|
|
148
151
|
*/
|
|
149
152
|
TreeView.prototype.render = function () {
|
|
150
|
-
var _this = this;
|
|
151
153
|
var _a;
|
|
154
|
+
var _this = this;
|
|
152
155
|
this.fieldsSvc = new FieldsService(this.props);
|
|
153
156
|
var _b = this.props, size = _b.size, className = _b.className;
|
|
154
157
|
return (React.createElement("div", { className: classNames('k-treeview', (_a = {},
|
|
155
|
-
_a["k-treeview-"
|
|
158
|
+
_a["k-treeview-".concat(sizeMap[size] || size)] = size,
|
|
156
159
|
_a), className), onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, role: "tree", "aria-multiselectable": this.ariaMultiSelectable ? true : undefined, "aria-label": this.props['aria-label'], "aria-labelledby": this.props['aria-labelledby'], ref: function (element) { return _this._element = element; }, tabIndex: this.props.tabIndex },
|
|
157
160
|
React.createElement("ul", { className: "k-treeview-lines k-treeview-group", role: "group" }, this.data.map(function (item, index) {
|
|
158
161
|
return (React.createElement(TreeViewItem, { item: item, position: index === 0 ? 'top' : index === _this.data.length - 1 ? 'bot' : 'mid', itemId: index.toString(), treeGuid: _this.treeGuid, animate: _this.props.animate, focusedItemId: _this.state.focusedItemId, tabbableItemId: _this.state.tabbableItemId, fieldsService: _this.fieldsSvc, itemUI: _this.props.item, checkboxes: _this.props.checkboxes, ariaMultiSelectable: _this.ariaMultiSelectable, onItemClick: _this.onItemClick, onFocusDomElNeeded: _this.onFocusDomElNeeded, draggable: _this.props.draggable, onPress: _this.onPress, onDrag: _this.onDrag, onRelease: _this.onRelease, expandIcons: _this.props.expandIcons, onExpandChange: _this.onExpandChange, onCheckChange: _this.onCheckChange, key: index, size: size }));
|
|
@@ -167,9 +170,12 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
167
170
|
};
|
|
168
171
|
TreeView.prototype.dispatchEventsOnKeyDown = function (event, focusedItem) {
|
|
169
172
|
var _this = this;
|
|
173
|
+
if (this.fieldsSvc === null) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
170
176
|
// isEnabled is the most expensive op and that is why is left last.
|
|
171
177
|
var isEnabled = function () {
|
|
172
|
-
return isEnabledAndAllParentsEnabled(_this.state.focusedItemId, _this.data, _this.fieldsSvc);
|
|
178
|
+
return _this.fieldsSvc && isEnabledAndAllParentsEnabled(_this.state.focusedItemId, _this.data, _this.fieldsSvc);
|
|
173
179
|
};
|
|
174
180
|
if (event.keyCode === Keys.left && this.fieldsSvc.expanded(focusedItem) && isEnabled()) {
|
|
175
181
|
this.dispatchExpandChange(event, focusedItem, this.state.focusedItemId);
|
|
@@ -188,7 +194,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
188
194
|
}
|
|
189
195
|
};
|
|
190
196
|
TreeView.prototype.setFocus = function (focusedItemId) {
|
|
191
|
-
if (focusedItemId) {
|
|
197
|
+
if (focusedItemId && this.fieldsSvc) {
|
|
192
198
|
if (this.fieldsSvc.focusIdField) {
|
|
193
199
|
var item = this.getItemById(focusedItemId);
|
|
194
200
|
this.setState({ focusedItemId: focusedItemId, focusedItemPublicId: this.fieldsSvc.focusId(item) });
|
|
@@ -223,7 +229,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
223
229
|
dispatchEvent(this.props.onItemClick, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
224
230
|
};
|
|
225
231
|
TreeView.prototype.refocusDueToFocusIdField = function () {
|
|
226
|
-
if (this.fieldsSvc.focusIdField) {
|
|
232
|
+
if (this.fieldsSvc && this.fieldsSvc.focusIdField) {
|
|
227
233
|
var focusedItemPublicId = this.state.focusedItemPublicId;
|
|
228
234
|
if (focusedItemPublicId) {
|
|
229
235
|
var focusedItemId = this.props.getFocusHierarchicalIndex ?
|
|
@@ -240,14 +246,14 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
240
246
|
get: function () {
|
|
241
247
|
return this.props['aria-multiselectable'] === true || this.props['aria-multiselectable'] === 'true';
|
|
242
248
|
},
|
|
243
|
-
enumerable:
|
|
249
|
+
enumerable: false,
|
|
244
250
|
configurable: true
|
|
245
251
|
});
|
|
246
252
|
Object.defineProperty(TreeView.prototype, "data", {
|
|
247
253
|
get: function () {
|
|
248
254
|
return this.props.data || [];
|
|
249
255
|
},
|
|
250
|
-
enumerable:
|
|
256
|
+
enumerable: false,
|
|
251
257
|
configurable: true
|
|
252
258
|
});
|
|
253
259
|
TreeView.prototype.focusDomItem = function (domItem) {
|
|
@@ -260,7 +266,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
260
266
|
get: function () {
|
|
261
267
|
return this.treeGuid;
|
|
262
268
|
},
|
|
263
|
-
enumerable:
|
|
269
|
+
enumerable: false,
|
|
264
270
|
configurable: true
|
|
265
271
|
});
|
|
266
272
|
/**
|
|
@@ -313,4 +319,4 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
313
319
|
};
|
|
314
320
|
return TreeView;
|
|
315
321
|
}(React.Component));
|
|
316
|
-
export
|
|
322
|
+
export { TreeView };
|
|
@@ -89,7 +89,7 @@ import { TreeViewItemDragOverEvent, TreeViewItemDragEndEvent } from './events';
|
|
|
89
89
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
92
|
+
export declare class TreeViewDragAnalyzer {
|
|
93
93
|
private event;
|
|
94
94
|
private itemId;
|
|
95
95
|
private treeViewGuid;
|
|
@@ -111,13 +111,13 @@ export default class TreeViewDragAnalyzer {
|
|
|
111
111
|
/**
|
|
112
112
|
* Returns `true` if dropping is allowed. Otherwise, returns `false`.
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
get isDropAllowed(): boolean;
|
|
115
115
|
/**
|
|
116
116
|
* Returns an object which contains:
|
|
117
117
|
* * The `itemHierarchicalIndex` of the destination item (the item below the dragged item) and
|
|
118
118
|
* * The `guid` of the destination TreeView (the TreeView which renders the destination item).
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
get destinationMeta(): {
|
|
121
121
|
itemHierarchicalIndex: string;
|
|
122
122
|
treeViewGuid: string;
|
|
123
123
|
};
|
|
@@ -130,6 +130,6 @@ export default class TreeViewDragAnalyzer {
|
|
|
130
130
|
* * `child`—Indicates that the dragged item is positioned in the middle of the destination item.
|
|
131
131
|
* * `undefined`—Indicates that dropping is not allowed.
|
|
132
132
|
*/
|
|
133
|
-
getDropOperation(): "after" | "child" | "before";
|
|
133
|
+
getDropOperation(): "after" | "child" | "before" | undefined;
|
|
134
134
|
private setDestimationMeta;
|
|
135
135
|
}
|
|
@@ -97,6 +97,8 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
97
97
|
function TreeViewDragAnalyzer(event) {
|
|
98
98
|
this.event = event;
|
|
99
99
|
this.initialized = false;
|
|
100
|
+
this.destItemId = '';
|
|
101
|
+
this.destTreeViewGuid = '';
|
|
100
102
|
this.itemId = event.itemHierarchicalIndex;
|
|
101
103
|
this.treeViewGuid = event.target.guid;
|
|
102
104
|
}
|
|
@@ -120,14 +122,14 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
120
122
|
get: function () {
|
|
121
123
|
if (this.initialized && this.destItemId && this.destTreeViewGuid) {
|
|
122
124
|
// Disallow circular references.
|
|
123
|
-
return !((this.destTreeViewGuid
|
|
124
|
-
startsWith(this.treeViewGuid
|
|
125
|
+
return !(("".concat(this.destTreeViewGuid, "_").concat(this.destItemId, "_")).
|
|
126
|
+
startsWith("".concat(this.treeViewGuid, "_").concat(this.itemId, "_")));
|
|
125
127
|
}
|
|
126
128
|
else {
|
|
127
129
|
return false;
|
|
128
130
|
}
|
|
129
131
|
},
|
|
130
|
-
enumerable:
|
|
132
|
+
enumerable: false,
|
|
131
133
|
configurable: true
|
|
132
134
|
});
|
|
133
135
|
Object.defineProperty(TreeViewDragAnalyzer.prototype, "destinationMeta", {
|
|
@@ -139,7 +141,7 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
139
141
|
get: function () {
|
|
140
142
|
return { itemHierarchicalIndex: this.destItemId, treeViewGuid: this.destTreeViewGuid };
|
|
141
143
|
},
|
|
142
|
-
enumerable:
|
|
144
|
+
enumerable: false,
|
|
143
145
|
configurable: true
|
|
144
146
|
});
|
|
145
147
|
/**
|
|
@@ -181,4 +183,4 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
181
183
|
};
|
|
182
184
|
return TreeViewDragAnalyzer;
|
|
183
185
|
}());
|
|
184
|
-
export
|
|
186
|
+
export { TreeViewDragAnalyzer };
|
|
@@ -108,7 +108,7 @@ export interface TreeViewDragClueState {
|
|
|
108
108
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
109
109
|
* ```
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export declare class TreeViewDragClue extends React.PureComponent<TreeViewDragClueProps, TreeViewDragClueState> {
|
|
112
112
|
/**
|
|
113
113
|
* @hidden
|
|
114
114
|
*/
|
|
@@ -127,7 +127,7 @@ export default class TreeViewDragClue extends React.PureComponent<TreeViewDragCl
|
|
|
127
127
|
/**
|
|
128
128
|
* @hidden
|
|
129
129
|
*/
|
|
130
|
-
render(): JSX.Element;
|
|
130
|
+
render(): false | JSX.Element | undefined;
|
|
131
131
|
/**
|
|
132
132
|
* Displays the TreeViewDragClue component.
|
|
133
133
|
*
|
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -134,7 +136,7 @@ var TreeViewDragClue = /** @class */ (function (_super) {
|
|
|
134
136
|
*/
|
|
135
137
|
TreeViewDragClue.prototype.render = function () {
|
|
136
138
|
var dynamicStyle = { top: this.state.top + 'px', left: this.state.left + 'px' };
|
|
137
|
-
return this.state.visible && (React.createElement("div", { className: "k-header k-drag-clue", style: __assign({}, this.props.style, dynamicStyle) },
|
|
139
|
+
return this.state.visible && (React.createElement("div", { className: "k-header k-drag-clue", style: __assign(__assign({}, this.props.style), dynamicStyle) },
|
|
138
140
|
React.createElement("span", { className: classNames('k-icon k-drag-status k-icon-with-modifier', this.state.operationClassName) },
|
|
139
141
|
React.createElement("span", { className: "k-icon k-icon-modifier" })),
|
|
140
142
|
this.state.text));
|
|
@@ -162,4 +164,4 @@ var TreeViewDragClue = /** @class */ (function (_super) {
|
|
|
162
164
|
TreeViewDragClue.defaultProps = { style: { display: 'block', position: 'absolute', zIndex: 20000, padding: '4px 6px' } };
|
|
163
165
|
return TreeViewDragClue;
|
|
164
166
|
}(React.PureComponent));
|
|
165
|
-
export
|
|
167
|
+
export { TreeViewDragClue };
|
|
@@ -61,13 +61,13 @@ declare class TreeViewItemWithoutContext extends React.Component<TreeViewItemPro
|
|
|
61
61
|
private onPress;
|
|
62
62
|
private onDrag;
|
|
63
63
|
private onRelease;
|
|
64
|
-
private
|
|
65
|
-
private
|
|
66
|
-
private
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
private
|
|
70
|
-
private
|
|
64
|
+
private get fieldsSvc();
|
|
65
|
+
private get itemId();
|
|
66
|
+
private get item();
|
|
67
|
+
private get tabIndex();
|
|
68
|
+
private get ariaExpanded();
|
|
69
|
+
private get ariaChecked();
|
|
70
|
+
private get ariaSelected();
|
|
71
71
|
private getIconClassName;
|
|
72
72
|
private getRootClassName;
|
|
73
73
|
private getContentClassName;
|
package/dist/es/TreeViewItem.js
CHANGED
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -72,7 +74,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
72
74
|
var subitems = this.renderSubitemsIfApplicable();
|
|
73
75
|
var itemInPart = this.renderItemInPart();
|
|
74
76
|
return (React.createElement("li", { className: this.getRootClassName(), tabIndex: this.tabIndex, role: "treeitem", "aria-expanded": this.ariaExpanded, "aria-selected": this.ariaSelected, "aria-checked": this.ariaChecked, "aria-disabled": this.fieldsSvc.disabled(this.item) ? true : undefined, ref: function (el) { return _this.itemElement = el; } },
|
|
75
|
-
React.createElement("div", { className: "k-treeview-"
|
|
77
|
+
React.createElement("div", { className: "k-treeview-".concat(this.props.position), ref: this.assignDraggableMeta },
|
|
76
78
|
this.renderExpandIcon(),
|
|
77
79
|
this.renderCheckbox(),
|
|
78
80
|
this.props.draggable ?
|
|
@@ -105,13 +107,13 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
TreeViewItemWithoutContext.prototype.renderCheckbox = function () {
|
|
108
|
-
var _this = this;
|
|
109
110
|
var _a;
|
|
111
|
+
var _this = this;
|
|
110
112
|
if (this.props.checkboxes) {
|
|
111
113
|
var size = this.props.size;
|
|
112
114
|
return (React.createElement("div", { className: "k-checkbox-wrap" },
|
|
113
115
|
React.createElement("input", { type: "checkbox", className: classNames('k-checkbox k-rounded-md', (_a = {},
|
|
114
|
-
_a["k-checkbox-"
|
|
116
|
+
_a["k-checkbox-".concat(sizeMap[size] || size)] = size,
|
|
115
117
|
_a)), checked: Boolean(this.fieldsSvc.checked(this.item)), id: this.itemGuid, tabIndex: -1, onChange: this.onCheckChange, ref: function (el) { return _this.checkboxElement = el; } }),
|
|
116
118
|
React.createElement("label", { className: "k-checkbox-label", htmlFor: this.itemGuid })));
|
|
117
119
|
}
|
|
@@ -145,28 +147,28 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
145
147
|
get: function () {
|
|
146
148
|
return this.props.fieldsService;
|
|
147
149
|
},
|
|
148
|
-
enumerable:
|
|
150
|
+
enumerable: false,
|
|
149
151
|
configurable: true
|
|
150
152
|
});
|
|
151
153
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "itemId", {
|
|
152
154
|
get: function () {
|
|
153
155
|
return this.props.itemId;
|
|
154
156
|
},
|
|
155
|
-
enumerable:
|
|
157
|
+
enumerable: false,
|
|
156
158
|
configurable: true
|
|
157
159
|
});
|
|
158
160
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "item", {
|
|
159
161
|
get: function () {
|
|
160
162
|
return this.props.item;
|
|
161
163
|
},
|
|
162
|
-
enumerable:
|
|
164
|
+
enumerable: false,
|
|
163
165
|
configurable: true
|
|
164
166
|
});
|
|
165
167
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "tabIndex", {
|
|
166
168
|
get: function () {
|
|
167
169
|
return (this.props.focusedItemId || this.props.tabbableItemId) === this.itemId ? 0 : -1;
|
|
168
170
|
},
|
|
169
|
-
enumerable:
|
|
171
|
+
enumerable: false,
|
|
170
172
|
configurable: true
|
|
171
173
|
});
|
|
172
174
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaExpanded", {
|
|
@@ -174,7 +176,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
174
176
|
return this.fieldsSvc.hasChildren(this.item) || hasChildren(this.item, this.fieldsSvc.getChildrenField()) ?
|
|
175
177
|
Boolean(this.fieldsSvc.expanded(this.item)) : undefined;
|
|
176
178
|
},
|
|
177
|
-
enumerable:
|
|
179
|
+
enumerable: false,
|
|
178
180
|
configurable: true
|
|
179
181
|
});
|
|
180
182
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaChecked", {
|
|
@@ -191,7 +193,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
191
193
|
return undefined;
|
|
192
194
|
}
|
|
193
195
|
},
|
|
194
|
-
enumerable:
|
|
196
|
+
enumerable: false,
|
|
195
197
|
configurable: true
|
|
196
198
|
});
|
|
197
199
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaSelected", {
|
|
@@ -206,7 +208,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
206
208
|
return undefined;
|
|
207
209
|
}
|
|
208
210
|
},
|
|
209
|
-
enumerable:
|
|
211
|
+
enumerable: false,
|
|
210
212
|
configurable: true
|
|
211
213
|
});
|
|
212
214
|
TreeViewItemWithoutContext.prototype.getIconClassName = function () {
|
package/dist/es/TreeViewProps.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es/events.d.ts
CHANGED
package/dist/es/events.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es/main.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import TreeView from './TreeView';
|
|
1
|
+
import { TreeView } from './TreeView';
|
|
2
2
|
import { TreeViewItemClickEvent, TreeViewExpandChangeEvent, TreeViewCheckChangeEvent, TreeViewItemDragOverEvent, TreeViewItemDragStartEvent, TreeViewItemDragEndEvent } from './events';
|
|
3
|
-
import processTreeViewItems from './processTreeViewItems';
|
|
4
|
-
import moveTreeViewItem from './moveTreeViewItem';
|
|
3
|
+
import { processTreeViewItems } from './processTreeViewItems';
|
|
4
|
+
import { moveTreeViewItem } from './moveTreeViewItem';
|
|
5
5
|
import { handleTreeViewCheckChange, TreeViewCheckChangeSettings } from './handleTreeViewCheckChange';
|
|
6
6
|
import { TreeViewOperationDescriptor, TreeViewOperationDescriptors, TreeViewCheckDescriptor } from './TreeViewOperationDescriptors';
|
|
7
7
|
import { ItemRenderProps } from './ItemRenderProps';
|
|
8
8
|
import { TreeViewProps } from './TreeViewProps';
|
|
9
|
-
import TreeViewDragClue from './TreeViewDragClue';
|
|
10
|
-
import TreeViewDragAnalyzer from './TreeViewDragAnalyzer';
|
|
9
|
+
import { TreeViewDragClue } from './TreeViewDragClue';
|
|
10
|
+
import { TreeViewDragAnalyzer } from './TreeViewDragAnalyzer';
|
|
11
11
|
import { TreeViewItemPropsContext } from './TreeViewItem';
|
|
12
12
|
export { TreeViewItemPropsContext, TreeView, processTreeViewItems, handleTreeViewCheckChange, TreeViewCheckChangeSettings, TreeViewItemClickEvent, TreeViewExpandChangeEvent, TreeViewCheckChangeEvent, TreeViewItemDragOverEvent, TreeViewItemDragStartEvent, TreeViewItemDragEndEvent, TreeViewOperationDescriptor, TreeViewOperationDescriptors, TreeViewCheckDescriptor, TreeViewProps, ItemRenderProps, TreeViewDragClue, moveTreeViewItem, TreeViewDragAnalyzer };
|
package/dist/es/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import TreeView from './TreeView';
|
|
2
|
-
import processTreeViewItems from './processTreeViewItems';
|
|
3
|
-
import moveTreeViewItem from './moveTreeViewItem';
|
|
1
|
+
import { TreeView } from './TreeView';
|
|
2
|
+
import { processTreeViewItems } from './processTreeViewItems';
|
|
3
|
+
import { moveTreeViewItem } from './moveTreeViewItem';
|
|
4
4
|
import { handleTreeViewCheckChange } from './handleTreeViewCheckChange';
|
|
5
|
-
import TreeViewDragClue from './TreeViewDragClue';
|
|
6
|
-
import TreeViewDragAnalyzer from './TreeViewDragAnalyzer';
|
|
5
|
+
import { TreeViewDragClue } from './TreeViewDragClue';
|
|
6
|
+
import { TreeViewDragAnalyzer } from './TreeViewDragAnalyzer';
|
|
7
7
|
import { TreeViewItemPropsContext } from './TreeViewItem';
|
|
8
8
|
export { TreeViewItemPropsContext, TreeView, processTreeViewItems, handleTreeViewCheckChange, TreeViewDragClue, moveTreeViewItem, TreeViewDragAnalyzer };
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
104
104
|
* ```
|
|
105
105
|
*/
|
|
106
|
-
export
|
|
107
|
-
sourceData: any[];
|
|
106
|
+
export declare function moveTreeViewItem(sourceItemHierarchicalIndex: string, sourceData: any[] | null | undefined, operation: 'before' | 'after' | 'child', targetItemHierarchicalIndex: string, targetData?: any[] | null, childrenField?: string): any[] | {
|
|
107
|
+
sourceData: any[] | null | undefined;
|
|
108
108
|
targetData: any[];
|
|
109
|
-
};
|
|
109
|
+
} | null | undefined;
|
|
@@ -106,7 +106,7 @@ import { CHILDREN_FIELD } from './utils/consts';
|
|
|
106
106
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export function moveTreeViewItem(sourceItemHierarchicalIndex, sourceData, operation, targetItemHierarchicalIndex, targetData, childrenField) {
|
|
110
110
|
var subItemsField = childrenField || CHILDREN_FIELD;
|
|
111
111
|
if (!validateInput()) {
|
|
112
112
|
return prepareInputDataForReturn();
|
|
@@ -135,7 +135,7 @@ export default function moveTreeViewItem(sourceItemHierarchicalIndex, sourceData
|
|
|
135
135
|
return targetData ? { sourceData: sourceData, targetData: targetData } : sourceData;
|
|
136
136
|
}
|
|
137
137
|
function validateNoCircularReference() {
|
|
138
|
-
return !(targetItemHierarchicalIndex
|
|
138
|
+
return !"".concat(targetItemHierarchicalIndex, "_").startsWith("".concat(sourceItemHierarchicalIndex, "_"));
|
|
139
139
|
}
|
|
140
140
|
function validateInput() {
|
|
141
141
|
if (!sourceData || !sourceData.length ||
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-treeview',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654509058,
|
|
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
|
};
|
|
@@ -48,4 +48,4 @@ import { TreeViewOperationDescriptors } from './TreeViewOperationDescriptors';
|
|
|
48
48
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export declare function processTreeViewItems(data: any[] | null | undefined, operations: TreeViewOperationDescriptors): any[];
|
|
@@ -62,7 +62,7 @@ import { getNestedValue, isArray } from './utils/misc';
|
|
|
62
62
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
export
|
|
65
|
+
export function processTreeViewItems(data, operations) {
|
|
66
66
|
if (!data || !data.length) {
|
|
67
67
|
return [];
|
|
68
68
|
}
|
|
@@ -6,11 +6,11 @@ export declare function hasChildren(item: any, childrenField: string): boolean;
|
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
9
|
-
export declare function isItemExpandedAndWithChildren(item: any, fieldsSvc: FieldsService): boolean;
|
|
9
|
+
export declare function isItemExpandedAndWithChildren(item: any, fieldsSvc: FieldsService): boolean | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
|
-
export declare function resolveItemId(publicId: any, idField: string, items: any[], childrenField: string): string;
|
|
13
|
+
export declare function resolveItemId(publicId: any, idField: string, items: any[], childrenField: string): string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* @hidden
|
|
16
16
|
*/
|
package/dist/npm/TreeView.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface TreeViewState {
|
|
|
29
29
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export declare class TreeView extends React.Component<TreeViewProps, TreeViewState> {
|
|
33
33
|
/**
|
|
34
34
|
* @hidden
|
|
35
35
|
*/
|
|
@@ -48,10 +48,10 @@ export default class TreeView extends React.Component<TreeViewProps, TreeViewSta
|
|
|
48
48
|
textField: PropTypes.Requireable<string>;
|
|
49
49
|
disableField: PropTypes.Requireable<string>;
|
|
50
50
|
item: PropTypes.Requireable<any>;
|
|
51
|
-
'aria-multiselectable': (props: any, propName: any, componentName: any) => Error;
|
|
51
|
+
'aria-multiselectable': (props: any, propName: any, componentName: any) => Error | null;
|
|
52
52
|
'aria-label': PropTypes.Requireable<string>;
|
|
53
53
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
54
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
54
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* @hidden
|
|
@@ -66,14 +66,14 @@ export default class TreeView extends React.Component<TreeViewProps, TreeViewSta
|
|
|
66
66
|
disableField: string;
|
|
67
67
|
checkField: string;
|
|
68
68
|
checkIndeterminateField: string;
|
|
69
|
-
size: "small" | "medium" | "large";
|
|
69
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* @hidden
|
|
73
73
|
*/
|
|
74
74
|
state: {
|
|
75
|
-
focusedItemId:
|
|
76
|
-
focusedItemPublicId:
|
|
75
|
+
focusedItemId: undefined;
|
|
76
|
+
focusedItemPublicId: undefined;
|
|
77
77
|
tabbableItemId: string;
|
|
78
78
|
};
|
|
79
79
|
private blurRequest;
|
|
@@ -84,7 +84,7 @@ export default class TreeView extends React.Component<TreeViewProps, TreeViewSta
|
|
|
84
84
|
/**
|
|
85
85
|
* @hidden
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
get element(): HTMLDivElement | null;
|
|
88
88
|
constructor(props: TreeViewProps);
|
|
89
89
|
/**
|
|
90
90
|
* @hidden
|
|
@@ -112,11 +112,11 @@ export default class TreeView extends React.Component<TreeViewProps, TreeViewSta
|
|
|
112
112
|
private dispatchExpandChange;
|
|
113
113
|
private dispatchItemClick;
|
|
114
114
|
private refocusDueToFocusIdField;
|
|
115
|
-
private
|
|
116
|
-
private
|
|
115
|
+
private get ariaMultiSelectable();
|
|
116
|
+
private get data();
|
|
117
117
|
private focusDomItem;
|
|
118
118
|
/**
|
|
119
119
|
* Returns the `guid` which is associated with the TreeView.
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
get guid(): string;
|
|
122
122
|
}
|