@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/npm/TreeView.js
CHANGED
|
@@ -3,16 +3,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
15
|
};
|
|
14
16
|
})();
|
|
15
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TreeView = void 0;
|
|
16
19
|
var React = require("react");
|
|
17
20
|
var PropTypes = require("prop-types");
|
|
18
21
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -53,11 +56,12 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
53
56
|
* @hidden
|
|
54
57
|
*/
|
|
55
58
|
_this.state = { focusedItemId: undefined, focusedItemPublicId: undefined, tabbableItemId: itemIdUtils_1.ZERO_LEVEL_ZERO_NODE_ID };
|
|
59
|
+
_this.fieldsSvc = null;
|
|
56
60
|
// When there is a change in state.focusedItemId, calling focus() on the dom element of the focused item
|
|
57
61
|
// is most often not needed, because the browser focuses the element on its own.
|
|
58
62
|
// https://github.com/telerik/kendo-react/issues/190
|
|
59
63
|
_this.allowExplicitFocus = false;
|
|
60
|
-
_this.treeGuid = kendo_react_common_1.guid();
|
|
64
|
+
_this.treeGuid = (0, kendo_react_common_1.guid)();
|
|
61
65
|
_this._element = null;
|
|
62
66
|
_this.onFocusDomElNeeded = function (domItem) {
|
|
63
67
|
if (_this.allowExplicitFocus) {
|
|
@@ -121,8 +125,8 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
121
125
|
};
|
|
122
126
|
_this.onKeyDown = function (event) {
|
|
123
127
|
var focusedItem = _this.getFocusedItem();
|
|
124
|
-
if (focusedItem) {
|
|
125
|
-
var newItemId = getItemIdUponKeyboardNavigation_1.default(focusedItem, _this.state.focusedItemId, _this.data, event.keyCode, _this.fieldsSvc);
|
|
128
|
+
if (focusedItem && _this.fieldsSvc) {
|
|
129
|
+
var newItemId = (0, getItemIdUponKeyboardNavigation_1.default)(focusedItem, _this.state.focusedItemId, _this.data, event.keyCode, _this.fieldsSvc);
|
|
126
130
|
if (newItemId !== _this.state.focusedItemId) {
|
|
127
131
|
// This disables the auto-scroll. The scroll is achieved via item focusing.
|
|
128
132
|
event.preventDefault();
|
|
@@ -132,7 +136,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
132
136
|
_this.dispatchEventsOnKeyDown(event, focusedItem);
|
|
133
137
|
}
|
|
134
138
|
};
|
|
135
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
139
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
136
140
|
return _this;
|
|
137
141
|
}
|
|
138
142
|
Object.defineProperty(TreeView.prototype, "element", {
|
|
@@ -142,19 +146,19 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
142
146
|
get: function () {
|
|
143
147
|
return this._element;
|
|
144
148
|
},
|
|
145
|
-
enumerable:
|
|
149
|
+
enumerable: false,
|
|
146
150
|
configurable: true
|
|
147
151
|
});
|
|
148
152
|
/**
|
|
149
153
|
* @hidden
|
|
150
154
|
*/
|
|
151
155
|
TreeView.prototype.render = function () {
|
|
152
|
-
var _this = this;
|
|
153
156
|
var _a;
|
|
157
|
+
var _this = this;
|
|
154
158
|
this.fieldsSvc = new FieldsService_1.default(this.props);
|
|
155
159
|
var _b = this.props, size = _b.size, className = _b.className;
|
|
156
|
-
return (React.createElement("div", { className: kendo_react_common_1.classNames('k-treeview', (_a = {},
|
|
157
|
-
_a["k-treeview-"
|
|
160
|
+
return (React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-treeview', (_a = {},
|
|
161
|
+
_a["k-treeview-".concat(sizeMap[size] || size)] = size,
|
|
158
162
|
_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 },
|
|
159
163
|
React.createElement("ul", { className: "k-treeview-lines k-treeview-group", role: "group" }, this.data.map(function (item, index) {
|
|
160
164
|
return (React.createElement(TreeViewItem_1.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 }));
|
|
@@ -169,15 +173,18 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
169
173
|
};
|
|
170
174
|
TreeView.prototype.dispatchEventsOnKeyDown = function (event, focusedItem) {
|
|
171
175
|
var _this = this;
|
|
176
|
+
if (this.fieldsSvc === null) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
172
179
|
// isEnabled is the most expensive op and that is why is left last.
|
|
173
180
|
var isEnabled = function () {
|
|
174
|
-
return itemUtils_1.isEnabledAndAllParentsEnabled(_this.state.focusedItemId, _this.data, _this.fieldsSvc);
|
|
181
|
+
return _this.fieldsSvc && (0, itemUtils_1.isEnabledAndAllParentsEnabled)(_this.state.focusedItemId, _this.data, _this.fieldsSvc);
|
|
175
182
|
};
|
|
176
183
|
if (event.keyCode === kendo_react_common_1.Keys.left && this.fieldsSvc.expanded(focusedItem) && isEnabled()) {
|
|
177
184
|
this.dispatchExpandChange(event, focusedItem, this.state.focusedItemId);
|
|
178
185
|
}
|
|
179
186
|
else if (event.keyCode === kendo_react_common_1.Keys.right && !this.fieldsSvc.expanded(focusedItem) &&
|
|
180
|
-
(this.fieldsSvc.hasChildren(focusedItem) || itemUtils_1.hasChildren(focusedItem, this.props.childrenField)) && isEnabled()) {
|
|
187
|
+
(this.fieldsSvc.hasChildren(focusedItem) || (0, itemUtils_1.hasChildren)(focusedItem, this.props.childrenField)) && isEnabled()) {
|
|
181
188
|
this.dispatchExpandChange(event, focusedItem, this.state.focusedItemId);
|
|
182
189
|
}
|
|
183
190
|
else if (event.keyCode === kendo_react_common_1.Keys.enter && isEnabled()) {
|
|
@@ -190,7 +197,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
190
197
|
}
|
|
191
198
|
};
|
|
192
199
|
TreeView.prototype.setFocus = function (focusedItemId) {
|
|
193
|
-
if (focusedItemId) {
|
|
200
|
+
if (focusedItemId && this.fieldsSvc) {
|
|
194
201
|
if (this.fieldsSvc.focusIdField) {
|
|
195
202
|
var item = this.getItemById(focusedItemId);
|
|
196
203
|
this.setState({ focusedItemId: focusedItemId, focusedItemPublicId: this.fieldsSvc.focusId(item) });
|
|
@@ -213,24 +220,24 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
213
220
|
return this.state.focusedItemId ? this.getItemById(this.state.focusedItemId) : undefined;
|
|
214
221
|
};
|
|
215
222
|
TreeView.prototype.getItemById = function (itemId) {
|
|
216
|
-
return itemIdUtils_1.getItemById(itemId, this.data, this.props.childrenField || consts_1.CHILDREN_FIELD);
|
|
223
|
+
return (0, itemIdUtils_1.getItemById)(itemId, this.data, this.props.childrenField || consts_1.CHILDREN_FIELD);
|
|
217
224
|
};
|
|
218
225
|
TreeView.prototype.dispatchCheckChange = function (dispatchedEvent, item, itemId) {
|
|
219
|
-
kendo_react_common_1.dispatchEvent(this.props.onCheckChange, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
226
|
+
(0, kendo_react_common_1.dispatchEvent)(this.props.onCheckChange, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
220
227
|
};
|
|
221
228
|
TreeView.prototype.dispatchExpandChange = function (dispatchedEvent, item, itemId) {
|
|
222
|
-
kendo_react_common_1.dispatchEvent(this.props.onExpandChange, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
229
|
+
(0, kendo_react_common_1.dispatchEvent)(this.props.onExpandChange, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
223
230
|
};
|
|
224
231
|
TreeView.prototype.dispatchItemClick = function (dispatchedEvent, item, itemId) {
|
|
225
|
-
kendo_react_common_1.dispatchEvent(this.props.onItemClick, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
232
|
+
(0, kendo_react_common_1.dispatchEvent)(this.props.onItemClick, dispatchedEvent, this, { item: item, itemHierarchicalIndex: itemId });
|
|
226
233
|
};
|
|
227
234
|
TreeView.prototype.refocusDueToFocusIdField = function () {
|
|
228
|
-
if (this.fieldsSvc.focusIdField) {
|
|
235
|
+
if (this.fieldsSvc && this.fieldsSvc.focusIdField) {
|
|
229
236
|
var focusedItemPublicId = this.state.focusedItemPublicId;
|
|
230
237
|
if (focusedItemPublicId) {
|
|
231
238
|
var focusedItemId = this.props.getFocusHierarchicalIndex ?
|
|
232
239
|
this.props.getFocusHierarchicalIndex(focusedItemPublicId) :
|
|
233
|
-
itemUtils_1.resolveItemId(focusedItemPublicId, this.fieldsSvc.focusIdField, this.data, this.props.childrenField);
|
|
240
|
+
(0, itemUtils_1.resolveItemId)(focusedItemPublicId, this.fieldsSvc.focusIdField, this.data, this.props.childrenField);
|
|
234
241
|
if (focusedItemId !== this.state.focusedItemId) {
|
|
235
242
|
this.allowExplicitFocus = true;
|
|
236
243
|
this.setState({ focusedItemId: focusedItemId });
|
|
@@ -242,14 +249,14 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
242
249
|
get: function () {
|
|
243
250
|
return this.props['aria-multiselectable'] === true || this.props['aria-multiselectable'] === 'true';
|
|
244
251
|
},
|
|
245
|
-
enumerable:
|
|
252
|
+
enumerable: false,
|
|
246
253
|
configurable: true
|
|
247
254
|
});
|
|
248
255
|
Object.defineProperty(TreeView.prototype, "data", {
|
|
249
256
|
get: function () {
|
|
250
257
|
return this.props.data || [];
|
|
251
258
|
},
|
|
252
|
-
enumerable:
|
|
259
|
+
enumerable: false,
|
|
253
260
|
configurable: true
|
|
254
261
|
});
|
|
255
262
|
TreeView.prototype.focusDomItem = function (domItem) {
|
|
@@ -262,7 +269,7 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
262
269
|
get: function () {
|
|
263
270
|
return this.treeGuid;
|
|
264
271
|
},
|
|
265
|
-
enumerable:
|
|
272
|
+
enumerable: false,
|
|
266
273
|
configurable: true
|
|
267
274
|
});
|
|
268
275
|
/**
|
|
@@ -315,4 +322,4 @@ var TreeView = /** @class */ (function (_super) {
|
|
|
315
322
|
};
|
|
316
323
|
return TreeView;
|
|
317
324
|
}(React.Component));
|
|
318
|
-
exports.
|
|
325
|
+
exports.TreeView = 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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TreeViewDragAnalyzer = void 0;
|
|
3
4
|
var consts_1 = require("./utils/consts");
|
|
4
5
|
var DROPZONE_BOUNDARY_DELTA = 6;
|
|
5
6
|
/**
|
|
@@ -99,6 +100,8 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
99
100
|
function TreeViewDragAnalyzer(event) {
|
|
100
101
|
this.event = event;
|
|
101
102
|
this.initialized = false;
|
|
103
|
+
this.destItemId = '';
|
|
104
|
+
this.destTreeViewGuid = '';
|
|
102
105
|
this.itemId = event.itemHierarchicalIndex;
|
|
103
106
|
this.treeViewGuid = event.target.guid;
|
|
104
107
|
}
|
|
@@ -122,14 +125,14 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
122
125
|
get: function () {
|
|
123
126
|
if (this.initialized && this.destItemId && this.destTreeViewGuid) {
|
|
124
127
|
// Disallow circular references.
|
|
125
|
-
return !((this.destTreeViewGuid
|
|
126
|
-
startsWith(this.treeViewGuid
|
|
128
|
+
return !(("".concat(this.destTreeViewGuid, "_").concat(this.destItemId, "_")).
|
|
129
|
+
startsWith("".concat(this.treeViewGuid, "_").concat(this.itemId, "_")));
|
|
127
130
|
}
|
|
128
131
|
else {
|
|
129
132
|
return false;
|
|
130
133
|
}
|
|
131
134
|
},
|
|
132
|
-
enumerable:
|
|
135
|
+
enumerable: false,
|
|
133
136
|
configurable: true
|
|
134
137
|
});
|
|
135
138
|
Object.defineProperty(TreeViewDragAnalyzer.prototype, "destinationMeta", {
|
|
@@ -141,7 +144,7 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
141
144
|
get: function () {
|
|
142
145
|
return { itemHierarchicalIndex: this.destItemId, treeViewGuid: this.destTreeViewGuid };
|
|
143
146
|
},
|
|
144
|
-
enumerable:
|
|
147
|
+
enumerable: false,
|
|
145
148
|
configurable: true
|
|
146
149
|
});
|
|
147
150
|
/**
|
|
@@ -183,4 +186,4 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
183
186
|
};
|
|
184
187
|
return TreeViewDragAnalyzer;
|
|
185
188
|
}());
|
|
186
|
-
exports.
|
|
189
|
+
exports.TreeViewDragAnalyzer = 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
|
*
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.TreeViewDragClue = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
29
32
|
/**
|
|
@@ -136,8 +139,8 @@ var TreeViewDragClue = /** @class */ (function (_super) {
|
|
|
136
139
|
*/
|
|
137
140
|
TreeViewDragClue.prototype.render = function () {
|
|
138
141
|
var dynamicStyle = { top: this.state.top + 'px', left: this.state.left + 'px' };
|
|
139
|
-
return this.state.visible && (React.createElement("div", { className: "k-header k-drag-clue", style: __assign({}, this.props.style, dynamicStyle) },
|
|
140
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-icon k-drag-status k-icon-with-modifier', this.state.operationClassName) },
|
|
142
|
+
return this.state.visible && (React.createElement("div", { className: "k-header k-drag-clue", style: __assign(__assign({}, this.props.style), dynamicStyle) },
|
|
143
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon k-drag-status k-icon-with-modifier', this.state.operationClassName) },
|
|
141
144
|
React.createElement("span", { className: "k-icon k-icon-modifier" })),
|
|
142
145
|
this.state.text));
|
|
143
146
|
};
|
|
@@ -164,4 +167,4 @@ var TreeViewDragClue = /** @class */ (function (_super) {
|
|
|
164
167
|
TreeViewDragClue.defaultProps = { style: { display: 'block', position: 'absolute', zIndex: 20000, padding: '4px 6px' } };
|
|
165
168
|
return TreeViewDragClue;
|
|
166
169
|
}(React.PureComponent));
|
|
167
|
-
exports.
|
|
170
|
+
exports.TreeViewDragClue = 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/npm/TreeViewItem.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.TreeViewItem = exports.TreeViewItemPropsContext = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
29
32
|
var itemIdUtils_1 = require("./utils/itemIdUtils");
|
|
@@ -42,7 +45,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
42
45
|
__extends(TreeViewItemWithoutContext, _super);
|
|
43
46
|
function TreeViewItemWithoutContext() {
|
|
44
47
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
45
|
-
_this.itemGuid = kendo_react_common_1.guid();
|
|
48
|
+
_this.itemGuid = (0, kendo_react_common_1.guid)();
|
|
46
49
|
_this.onCheckChange = function (e) {
|
|
47
50
|
_this.props.onCheckChange(e, _this.item, _this.itemId);
|
|
48
51
|
};
|
|
@@ -74,7 +77,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
74
77
|
var subitems = this.renderSubitemsIfApplicable();
|
|
75
78
|
var itemInPart = this.renderItemInPart();
|
|
76
79
|
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; } },
|
|
77
|
-
React.createElement("div", { className: "k-treeview-"
|
|
80
|
+
React.createElement("div", { className: "k-treeview-".concat(this.props.position), ref: this.assignDraggableMeta },
|
|
78
81
|
this.renderExpandIcon(),
|
|
79
82
|
this.renderCheckbox(),
|
|
80
83
|
this.props.draggable ?
|
|
@@ -107,13 +110,13 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
107
110
|
}
|
|
108
111
|
};
|
|
109
112
|
TreeViewItemWithoutContext.prototype.renderCheckbox = function () {
|
|
110
|
-
var _this = this;
|
|
111
113
|
var _a;
|
|
114
|
+
var _this = this;
|
|
112
115
|
if (this.props.checkboxes) {
|
|
113
116
|
var size = this.props.size;
|
|
114
117
|
return (React.createElement("div", { className: "k-checkbox-wrap" },
|
|
115
|
-
React.createElement("input", { type: "checkbox", className: kendo_react_common_1.classNames('k-checkbox k-rounded-md', (_a = {},
|
|
116
|
-
_a["k-checkbox-"
|
|
118
|
+
React.createElement("input", { type: "checkbox", className: (0, kendo_react_common_1.classNames)('k-checkbox k-rounded-md', (_a = {},
|
|
119
|
+
_a["k-checkbox-".concat(sizeMap[size] || size)] = size,
|
|
117
120
|
_a)), checked: Boolean(this.fieldsSvc.checked(this.item)), id: this.itemGuid, tabIndex: -1, onChange: this.onCheckChange, ref: function (el) { return _this.checkboxElement = el; } }),
|
|
118
121
|
React.createElement("label", { className: "k-checkbox-label", htmlFor: this.itemGuid })));
|
|
119
122
|
}
|
|
@@ -125,16 +128,16 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
125
128
|
var renderExpand = this.props.expandIcons &&
|
|
126
129
|
// If it is explicitly said that the item has children (even not loaded yet)
|
|
127
130
|
// or if the item actually has children, then render the icon.
|
|
128
|
-
(this.fieldsSvc.hasChildren(this.item) || itemUtils_1.hasChildren(this.item, this.fieldsSvc.getChildrenField()));
|
|
131
|
+
(this.fieldsSvc.hasChildren(this.item) || (0, itemUtils_1.hasChildren)(this.item, this.fieldsSvc.getChildrenField()));
|
|
129
132
|
return renderExpand && (React.createElement("span", { className: "k-treeview-toggle" },
|
|
130
133
|
React.createElement("span", { className: this.getIconClassName(), onClick: this.onExpandChange })));
|
|
131
134
|
};
|
|
132
135
|
TreeViewItemWithoutContext.prototype.renderSubitemsIfApplicable = function () {
|
|
133
136
|
var _this = this;
|
|
134
137
|
var data = this.fieldsSvc.children(this.item);
|
|
135
|
-
return itemUtils_1.isItemExpandedAndWithChildren(this.item, this.fieldsSvc) ?
|
|
138
|
+
return (0, itemUtils_1.isItemExpandedAndWithChildren)(this.item, this.fieldsSvc) ?
|
|
136
139
|
(React.createElement("ul", { className: "k-treeview-group", role: "group" }, data.map(function (item, index) {
|
|
137
|
-
return (React.createElement(exports.TreeViewItem, { item: item, position: index === 0 ? 'top' : index === data.length - 1 ? 'bot' : 'mid', itemId: itemIdUtils_1.createId(index, _this.itemId), treeGuid: _this.props.treeGuid, animate: _this.props.animate, focusedItemId: _this.props.focusedItemId, tabbableItemId: _this.props.tabbableItemId, fieldsService: _this.props.fieldsService, itemUI: _this.props.itemUI, checkboxes: _this.props.checkboxes, ariaMultiSelectable: _this.props.ariaMultiSelectable, onItemClick: _this.props.onItemClick, onFocusDomElNeeded: _this.props.onFocusDomElNeeded, draggable: _this.props.draggable, onPress: _this.props.onPress, onDrag: _this.props.onDrag, onRelease: _this.props.onRelease, expandIcons: _this.props.expandIcons, onExpandChange: _this.props.onExpandChange, onCheckChange: _this.props.onCheckChange, key: index, size: _this.props.size }));
|
|
140
|
+
return (React.createElement(exports.TreeViewItem, { item: item, position: index === 0 ? 'top' : index === data.length - 1 ? 'bot' : 'mid', itemId: (0, itemIdUtils_1.createId)(index, _this.itemId), treeGuid: _this.props.treeGuid, animate: _this.props.animate, focusedItemId: _this.props.focusedItemId, tabbableItemId: _this.props.tabbableItemId, fieldsService: _this.props.fieldsService, itemUI: _this.props.itemUI, checkboxes: _this.props.checkboxes, ariaMultiSelectable: _this.props.ariaMultiSelectable, onItemClick: _this.props.onItemClick, onFocusDomElNeeded: _this.props.onFocusDomElNeeded, draggable: _this.props.draggable, onPress: _this.props.onPress, onDrag: _this.props.onDrag, onRelease: _this.props.onRelease, expandIcons: _this.props.expandIcons, onExpandChange: _this.props.onExpandChange, onCheckChange: _this.props.onCheckChange, key: index, size: _this.props.size }));
|
|
138
141
|
}))) : undefined;
|
|
139
142
|
};
|
|
140
143
|
TreeViewItemWithoutContext.prototype.renderItemInPart = function () {
|
|
@@ -147,36 +150,36 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
147
150
|
get: function () {
|
|
148
151
|
return this.props.fieldsService;
|
|
149
152
|
},
|
|
150
|
-
enumerable:
|
|
153
|
+
enumerable: false,
|
|
151
154
|
configurable: true
|
|
152
155
|
});
|
|
153
156
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "itemId", {
|
|
154
157
|
get: function () {
|
|
155
158
|
return this.props.itemId;
|
|
156
159
|
},
|
|
157
|
-
enumerable:
|
|
160
|
+
enumerable: false,
|
|
158
161
|
configurable: true
|
|
159
162
|
});
|
|
160
163
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "item", {
|
|
161
164
|
get: function () {
|
|
162
165
|
return this.props.item;
|
|
163
166
|
},
|
|
164
|
-
enumerable:
|
|
167
|
+
enumerable: false,
|
|
165
168
|
configurable: true
|
|
166
169
|
});
|
|
167
170
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "tabIndex", {
|
|
168
171
|
get: function () {
|
|
169
172
|
return (this.props.focusedItemId || this.props.tabbableItemId) === this.itemId ? 0 : -1;
|
|
170
173
|
},
|
|
171
|
-
enumerable:
|
|
174
|
+
enumerable: false,
|
|
172
175
|
configurable: true
|
|
173
176
|
});
|
|
174
177
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaExpanded", {
|
|
175
178
|
get: function () {
|
|
176
|
-
return this.fieldsSvc.hasChildren(this.item) || itemUtils_1.hasChildren(this.item, this.fieldsSvc.getChildrenField()) ?
|
|
179
|
+
return this.fieldsSvc.hasChildren(this.item) || (0, itemUtils_1.hasChildren)(this.item, this.fieldsSvc.getChildrenField()) ?
|
|
177
180
|
Boolean(this.fieldsSvc.expanded(this.item)) : undefined;
|
|
178
181
|
},
|
|
179
|
-
enumerable:
|
|
182
|
+
enumerable: false,
|
|
180
183
|
configurable: true
|
|
181
184
|
});
|
|
182
185
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaChecked", {
|
|
@@ -193,7 +196,7 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
193
196
|
return undefined;
|
|
194
197
|
}
|
|
195
198
|
},
|
|
196
|
-
enumerable:
|
|
199
|
+
enumerable: false,
|
|
197
200
|
configurable: true
|
|
198
201
|
});
|
|
199
202
|
Object.defineProperty(TreeViewItemWithoutContext.prototype, "ariaSelected", {
|
|
@@ -208,22 +211,22 @@ var TreeViewItemWithoutContext = /** @class */ (function (_super) {
|
|
|
208
211
|
return undefined;
|
|
209
212
|
}
|
|
210
213
|
},
|
|
211
|
-
enumerable:
|
|
214
|
+
enumerable: false,
|
|
212
215
|
configurable: true
|
|
213
216
|
});
|
|
214
217
|
TreeViewItemWithoutContext.prototype.getIconClassName = function () {
|
|
215
218
|
var expanded = this.fieldsSvc.expanded(this.item);
|
|
216
|
-
return kendo_react_common_1.classNames('k-icon', {
|
|
219
|
+
return (0, kendo_react_common_1.classNames)('k-icon', {
|
|
217
220
|
'k-i-expand': !expanded,
|
|
218
221
|
'k-i-collapse': expanded,
|
|
219
|
-
'k-i-loading': expanded && !itemUtils_1.hasChildren(this.item, this.fieldsSvc.getChildrenField())
|
|
222
|
+
'k-i-loading': expanded && !(0, itemUtils_1.hasChildren)(this.item, this.fieldsSvc.getChildrenField())
|
|
220
223
|
});
|
|
221
224
|
};
|
|
222
225
|
TreeViewItemWithoutContext.prototype.getRootClassName = function () {
|
|
223
|
-
return kendo_react_common_1.classNames('k-treeview-item', { 'k-disabled': this.fieldsSvc.disabled(this.item) });
|
|
226
|
+
return (0, kendo_react_common_1.classNames)('k-treeview-item', { 'k-disabled': this.fieldsSvc.disabled(this.item) });
|
|
224
227
|
};
|
|
225
228
|
TreeViewItemWithoutContext.prototype.getContentClassName = function () {
|
|
226
|
-
return kendo_react_common_1.classNames('k-treeview-leaf', {
|
|
229
|
+
return (0, kendo_react_common_1.classNames)('k-treeview-leaf', {
|
|
227
230
|
'k-focus': this.props.focusedItemId === this.itemId,
|
|
228
231
|
'k-selected': this.fieldsSvc.selected(this.item)
|
|
229
232
|
});
|
package/dist/npm/events.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.handleTreeViewCheckChange = void 0;
|
|
30
31
|
var itemUtils_1 = require("./utils/itemUtils");
|
|
31
32
|
var itemIdUtils_1 = require("./utils/itemIdUtils");
|
|
32
33
|
var misc_1 = require("./utils/misc");
|
|
@@ -84,7 +85,7 @@ function handleTreeViewCheckChange(event, check, data, settings, childrenField)
|
|
|
84
85
|
return [];
|
|
85
86
|
}
|
|
86
87
|
var _a = parseOperation(check), ids = _a.ids, idField = _a.idField;
|
|
87
|
-
var itemId = idField ? misc_1.getNestedValue(idField, event.item) : event.itemHierarchicalIndex;
|
|
88
|
+
var itemId = idField ? (0, misc_1.getNestedValue)(idField, event.item) : event.itemHierarchicalIndex;
|
|
88
89
|
var idIndex = ids.indexOf(itemId);
|
|
89
90
|
var itemJustChecked = idIndex === -1;
|
|
90
91
|
var subItemsField = childrenField || consts_1.CHILDREN_FIELD;
|
|
@@ -102,13 +103,13 @@ function handleTreeViewCheckChange(event, check, data, settings, childrenField)
|
|
|
102
103
|
checkParents(event.itemHierarchicalIndex, itemJustChecked, idField, subItemsField, newIds, data);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
return misc_1.isArray(check) ? newIds : Object.assign({}, check, { ids: newIds });
|
|
106
|
+
return (0, misc_1.isArray)(check) ? newIds : Object.assign({}, check, { ids: newIds });
|
|
106
107
|
}
|
|
107
108
|
exports.handleTreeViewCheckChange = handleTreeViewCheckChange;
|
|
108
109
|
function parseOperation(operation) {
|
|
109
110
|
var ids;
|
|
110
111
|
var idField = undefined;
|
|
111
|
-
if (misc_1.isArray(operation)) {
|
|
112
|
+
if ((0, misc_1.isArray)(operation)) {
|
|
112
113
|
ids = operation;
|
|
113
114
|
}
|
|
114
115
|
else {
|
|
@@ -118,7 +119,7 @@ function parseOperation(operation) {
|
|
|
118
119
|
return { ids: ids, idField: idField };
|
|
119
120
|
}
|
|
120
121
|
function checkChildren(item, itemHierarchicalIndex, itemJustChecked, idField, childrenField, ids) {
|
|
121
|
-
itemUtils_1.getAllDirectIndirectChildrenIds(item, itemHierarchicalIndex, childrenField, idField).forEach(function (itemId) {
|
|
122
|
+
(0, itemUtils_1.getAllDirectIndirectChildrenIds)(item, itemHierarchicalIndex, childrenField, idField).forEach(function (itemId) {
|
|
122
123
|
if (itemJustChecked && ids.indexOf(itemId) === -1) {
|
|
123
124
|
ids.push(itemId);
|
|
124
125
|
}
|
|
@@ -137,7 +138,7 @@ function checkParents(itemHierarchicalIndex, itemJustChecked, idField, childrenF
|
|
|
137
138
|
var _a = result.value, id = _a.id, item = _a.item;
|
|
138
139
|
// The first check is needed. However, it is not sure whether to stop the entire loop.
|
|
139
140
|
if (ids.indexOf(id) === -1 &&
|
|
140
|
-
itemUtils_1.areAllDirectChildrenChecked(item, id, idField, childrenField, ids)) {
|
|
141
|
+
(0, itemUtils_1.areAllDirectChildrenChecked)(item, id, idField, childrenField, ids)) {
|
|
141
142
|
ids.push(id);
|
|
142
143
|
result = it.next();
|
|
143
144
|
}
|
|
@@ -168,12 +169,12 @@ function checkParents(itemHierarchicalIndex, itemJustChecked, idField, childrenF
|
|
|
168
169
|
switch (_a.label) {
|
|
169
170
|
case 0:
|
|
170
171
|
if (!idField) return [3 /*break*/, 5];
|
|
171
|
-
parents = itemUtils_1.getAllParents(itemHierarchicalIndex, childrenField, data);
|
|
172
|
+
parents = (0, itemUtils_1.getAllParents)(itemHierarchicalIndex, childrenField, data);
|
|
172
173
|
i = parents.length - 1;
|
|
173
174
|
_a.label = 1;
|
|
174
175
|
case 1:
|
|
175
176
|
if (!(i > -1)) return [3 /*break*/, 4];
|
|
176
|
-
return [4 /*yield*/, { id: misc_1.getNestedValue(idField, parents[i]), item: itemJustChecked ? parents[i] : undefined }];
|
|
177
|
+
return [4 /*yield*/, { id: (0, misc_1.getNestedValue)(idField, parents[i]), item: itemJustChecked ? parents[i] : undefined }];
|
|
177
178
|
case 2:
|
|
178
179
|
_a.sent();
|
|
179
180
|
_a.label = 3;
|
|
@@ -182,14 +183,14 @@ function checkParents(itemHierarchicalIndex, itemJustChecked, idField, childrenF
|
|
|
182
183
|
return [3 /*break*/, 1];
|
|
183
184
|
case 4: return [3 /*break*/, 8];
|
|
184
185
|
case 5:
|
|
185
|
-
parentId = itemIdUtils_1.getDirectParentId(itemHierarchicalIndex);
|
|
186
|
+
parentId = (0, itemIdUtils_1.getDirectParentId)(itemHierarchicalIndex);
|
|
186
187
|
_a.label = 6;
|
|
187
188
|
case 6:
|
|
188
189
|
if (!parentId) return [3 /*break*/, 8];
|
|
189
|
-
return [4 /*yield*/, { id: parentId, item: itemJustChecked ? itemIdUtils_1.getItemById(parentId, data, childrenField) : undefined }];
|
|
190
|
+
return [4 /*yield*/, { id: parentId, item: itemJustChecked ? (0, itemIdUtils_1.getItemById)(parentId, data, childrenField) : undefined }];
|
|
190
191
|
case 7:
|
|
191
192
|
_a.sent();
|
|
192
|
-
parentId = itemIdUtils_1.getDirectParentId(parentId);
|
|
193
|
+
parentId = (0, itemIdUtils_1.getDirectParentId)(parentId);
|
|
193
194
|
return [3 /*break*/, 6];
|
|
194
195
|
case 8: return [2 /*return*/];
|
|
195
196
|
}
|
package/dist/npm/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/npm/main.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TreeViewDragAnalyzer = exports.moveTreeViewItem = exports.TreeViewDragClue = exports.handleTreeViewCheckChange = exports.processTreeViewItems = exports.TreeView = exports.TreeViewItemPropsContext = void 0;
|
|
3
4
|
var TreeView_1 = require("./TreeView");
|
|
4
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "TreeView", { enumerable: true, get: function () { return TreeView_1.TreeView; } });
|
|
5
6
|
var processTreeViewItems_1 = require("./processTreeViewItems");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "processTreeViewItems", { enumerable: true, get: function () { return processTreeViewItems_1.processTreeViewItems; } });
|
|
7
8
|
var moveTreeViewItem_1 = require("./moveTreeViewItem");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "moveTreeViewItem", { enumerable: true, get: function () { return moveTreeViewItem_1.moveTreeViewItem; } });
|
|
9
10
|
var handleTreeViewCheckChange_1 = require("./handleTreeViewCheckChange");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "handleTreeViewCheckChange", { enumerable: true, get: function () { return handleTreeViewCheckChange_1.handleTreeViewCheckChange; } });
|
|
11
12
|
var TreeViewDragClue_1 = require("./TreeViewDragClue");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "TreeViewDragClue", { enumerable: true, get: function () { return TreeViewDragClue_1.TreeViewDragClue; } });
|
|
13
14
|
var TreeViewDragAnalyzer_1 = require("./TreeViewDragAnalyzer");
|
|
14
|
-
exports
|
|
15
|
+
Object.defineProperty(exports, "TreeViewDragAnalyzer", { enumerable: true, get: function () { return TreeViewDragAnalyzer_1.TreeViewDragAnalyzer; } });
|
|
15
16
|
var TreeViewItem_1 = require("./TreeViewItem");
|
|
16
|
-
exports
|
|
17
|
+
Object.defineProperty(exports, "TreeViewItemPropsContext", { enumerable: true, get: function () { return TreeViewItem_1.TreeViewItemPropsContext; } });
|
|
@@ -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;
|