@progress/kendo-angular-treeview 6.0.0-dev.202112021059 → 6.0.1-dev.202202151121
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-treeview.js +18 -18
- package/dist/cdn/main.js +1 -1
- package/dist/es/checkbox/checkbox.component.js +17 -1
- package/dist/es/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/es/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/es/navigation/navigation.service.js +9 -6
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/size.js +4 -0
- package/dist/es/treeview-group.component.js +7 -2
- package/dist/es/treeview-item-content.directive.js +2 -2
- package/dist/es/treeview-item.directive.js +6 -5
- package/dist/es/treeview.component.js +36 -4
- package/dist/es/utils.js +17 -5
- package/dist/es2015/checkbox/checkbox.component.d.ts +6 -0
- package/dist/es2015/checkbox/checkbox.component.js +13 -1
- package/dist/es2015/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/es2015/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/navigation/navigation-state.interface.d.ts +1 -0
- package/dist/es2015/navigation/navigation.service.d.ts +2 -1
- package/dist/es2015/navigation/navigation.service.js +8 -6
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/size.d.ts +14 -0
- package/dist/es2015/size.js +4 -0
- package/dist/es2015/treeview-group.component.d.ts +2 -0
- package/dist/es2015/treeview-group.component.js +49 -35
- package/dist/es2015/treeview-item-content.directive.js +2 -2
- package/dist/es2015/treeview-item.directive.js +5 -5
- package/dist/es2015/treeview.component.d.ts +13 -0
- package/dist/es2015/treeview.component.js +46 -13
- package/dist/es2015/utils.d.ts +7 -1
- package/dist/es2015/utils.js +17 -5
- package/dist/fesm2015/index.js +144 -72
- package/dist/fesm5/index.js +98 -30
- package/dist/npm/checkbox/checkbox.component.js +17 -1
- package/dist/npm/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/npm/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/npm/navigation/navigation.service.js +9 -6
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/size.js +6 -0
- package/dist/npm/treeview-group.component.js +7 -2
- package/dist/npm/treeview-item-content.directive.js +2 -2
- package/dist/npm/treeview-item.directive.js +6 -5
- package/dist/npm/treeview.component.js +35 -3
- package/dist/npm/utils.js +17 -5
- package/dist/systemjs/kendo-angular-treeview.js +1 -1
- package/package.json +9 -8
|
@@ -50,10 +50,10 @@ var TreeViewItemContentDirective = /** @class */ (function () {
|
|
|
50
50
|
this.subscriptions.unsubscribe();
|
|
51
51
|
};
|
|
52
52
|
TreeViewItemContentDirective.prototype.updateFocusClass = function () {
|
|
53
|
-
this.render(this.navigationService.isActive(this.index), 'k-
|
|
53
|
+
this.render(this.navigationService.isActive(this.index), 'k-focus');
|
|
54
54
|
};
|
|
55
55
|
TreeViewItemContentDirective.prototype.updateSelectionClass = function (selected) {
|
|
56
|
-
this.render(selected, 'k-
|
|
56
|
+
this.render(selected, 'k-selected');
|
|
57
57
|
};
|
|
58
58
|
TreeViewItemContentDirective.prototype.render = function (addClass, className) {
|
|
59
59
|
var action = addClass ? 'addClass' : 'removeClass';
|
|
@@ -138,9 +138,9 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
138
138
|
var _this = this;
|
|
139
139
|
this.subscriptions = [
|
|
140
140
|
this.navigationService.moves
|
|
141
|
-
.subscribe(function () {
|
|
141
|
+
.subscribe(function (navState) {
|
|
142
142
|
_this.updateTabIndex();
|
|
143
|
-
_this.focusItem();
|
|
143
|
+
_this.focusItem(navState.shouldScroll);
|
|
144
144
|
}),
|
|
145
145
|
this.navigationService.expands
|
|
146
146
|
.pipe(operators_1.filter(function (_a) {
|
|
@@ -175,9 +175,10 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
175
175
|
TreeViewItemDirective.prototype.isFocusable = function () {
|
|
176
176
|
return !this.isDisabled && this.navigationService.isFocusable(this.index);
|
|
177
177
|
};
|
|
178
|
-
TreeViewItemDirective.prototype.focusItem = function () {
|
|
178
|
+
TreeViewItemDirective.prototype.focusItem = function (scrollIntoView) {
|
|
179
|
+
if (scrollIntoView === void 0) { scrollIntoView = false; }
|
|
179
180
|
if (this.isInitialized && this.navigationService.isActive(this.index)) {
|
|
180
|
-
this.element.nativeElement.focus();
|
|
181
|
+
this.element.nativeElement.focus({ preventScroll: !scrollIntoView });
|
|
181
182
|
}
|
|
182
183
|
};
|
|
183
184
|
TreeViewItemDirective.prototype.moveLookupItem = function (changes) {
|
|
@@ -217,7 +218,7 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
217
218
|
this.setAttribute('aria-checked', this.checkable ? this.ariaChecked : null);
|
|
218
219
|
};
|
|
219
220
|
TreeViewItemDirective.prototype.setDisabledClass = function () {
|
|
220
|
-
this.setClass('k-
|
|
221
|
+
this.setClass('k-disabled', this.isDisabled);
|
|
221
222
|
};
|
|
222
223
|
TreeViewItemDirective.prototype.setClass = function (className, toggle) {
|
|
223
224
|
var action = toggle ? 'addClass' : 'removeClass';
|
|
@@ -232,6 +232,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
232
232
|
this.isActive = false;
|
|
233
233
|
this.data = new rxjs_1.BehaviorSubject([]);
|
|
234
234
|
this._animate = true;
|
|
235
|
+
this._size = 'medium';
|
|
235
236
|
this.subscriptions = new rxjs_1.Subscription();
|
|
236
237
|
this.domSubscriptions = [];
|
|
237
238
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
@@ -363,6 +364,30 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
363
364
|
enumerable: true,
|
|
364
365
|
configurable: true
|
|
365
366
|
});
|
|
367
|
+
Object.defineProperty(TreeViewComponent.prototype, "size", {
|
|
368
|
+
get: function () {
|
|
369
|
+
return this._size;
|
|
370
|
+
},
|
|
371
|
+
/**
|
|
372
|
+
* Sets the size of the component.
|
|
373
|
+
*
|
|
374
|
+
* The possible values are:
|
|
375
|
+
* * `'small'`
|
|
376
|
+
* * `'medium'` (default)
|
|
377
|
+
* * `'large'`
|
|
378
|
+
* * `null`
|
|
379
|
+
*
|
|
380
|
+
*/
|
|
381
|
+
set: function (size) {
|
|
382
|
+
this.renderer.removeClass(this.element.nativeElement, utils_1.getSizeClass('treeview', this.size));
|
|
383
|
+
if (size) {
|
|
384
|
+
this.renderer.addClass(this.element.nativeElement, utils_1.getSizeClass('treeview', size));
|
|
385
|
+
}
|
|
386
|
+
this._size = size;
|
|
387
|
+
},
|
|
388
|
+
enumerable: true,
|
|
389
|
+
configurable: true
|
|
390
|
+
});
|
|
366
391
|
TreeViewComponent.prototype.ngOnChanges = function (changes) {
|
|
367
392
|
this.navigationService.navigable = Boolean(this.navigable);
|
|
368
393
|
// TODO: should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
@@ -403,6 +428,9 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
403
428
|
_this.attachDomHandlers();
|
|
404
429
|
});
|
|
405
430
|
}
|
|
431
|
+
if (this.size) {
|
|
432
|
+
this.renderer.addClass(this.element.nativeElement, utils_1.getSizeClass('treeview', this.size));
|
|
433
|
+
}
|
|
406
434
|
};
|
|
407
435
|
/**
|
|
408
436
|
* Blurs the focused TreeView item.
|
|
@@ -562,7 +590,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
562
590
|
return;
|
|
563
591
|
}
|
|
564
592
|
var index = utils_1.nodeId(utils_1.closestNode(target));
|
|
565
|
-
// the disabled check is probably not needed due to the k-
|
|
593
|
+
// the disabled check is probably not needed due to the k-disabled styles
|
|
566
594
|
if (!index || this.navigationService.isDisabled(index)) {
|
|
567
595
|
return;
|
|
568
596
|
}
|
|
@@ -624,7 +652,6 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
624
652
|
});
|
|
625
653
|
};
|
|
626
654
|
tslib_1.__decorate([
|
|
627
|
-
core_1.HostBinding("class.k-widget"),
|
|
628
655
|
core_1.HostBinding("class.k-treeview"),
|
|
629
656
|
tslib_1.__metadata("design:type", Boolean)
|
|
630
657
|
], TreeViewComponent.prototype, "classNames", void 0);
|
|
@@ -798,13 +825,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
798
825
|
core_1.Input(),
|
|
799
826
|
tslib_1.__metadata("design:type", String)
|
|
800
827
|
], TreeViewComponent.prototype, "filter", void 0);
|
|
828
|
+
tslib_1.__decorate([
|
|
829
|
+
core_1.Input(),
|
|
830
|
+
tslib_1.__metadata("design:type", String),
|
|
831
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
832
|
+
], TreeViewComponent.prototype, "size", null);
|
|
801
833
|
TreeViewComponent = tslib_1.__decorate([
|
|
802
834
|
core_1.Component({
|
|
803
835
|
changeDetection: core_1.ChangeDetectionStrategy.Default,
|
|
804
836
|
exportAs: 'kendoTreeView',
|
|
805
837
|
providers: providers,
|
|
806
838
|
selector: 'kendo-treeview',
|
|
807
|
-
template: "\n <
|
|
839
|
+
template: "\n <span\n class=\"k-treeview-filter\"\n *ngIf=\"filterable\"\n >\n <kendo-textbox\n [size]=\"size\"\n [value]=\"filter\"\n [clearButton]=\"true\"\n (valueChange)=\"filterChange.emit($event)\"\n [placeholder]=\"filterInputPlaceholder\"\n >\n <ng-template kendoTextBoxPrefixTemplate>\n <span class=\"k-input-icon k-icon k-i-search\"></span>\n </ng-template>\n </kendo-textbox>\n </span>\n <ul class=\"k-treeview-lines\"\n kendoTreeViewGroup\n role=\"group\"\n [size]=\"size\"\n [loadOnDemand]=\"loadOnDemand\"\n [checkboxes]=\"checkboxes\"\n [expandIcons]=\"expandIcons\"\n [selectable]=\"selectable\"\n [touchActions]=\"touchActions\"\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [isChecked]=\"isChecked\"\n [isDisabled]=\"isDisabled\"\n [isExpanded]=\"isExpanded\"\n [isSelected]=\"isSelected\"\n [isVisible]=\"isVisible\"\n [nodeTemplateRef]=\"nodeTemplateRef?.templateRef\"\n [loadMoreButtonTemplateRef]=\"loadMoreButtonTemplateRef?.templateRef\"\n [textField]=\"textField\"\n [nodes]=\"fetchNodes\"\n [loadMoreService]=\"loadMoreService\"\n [trackBy]=\"trackBy\"\n >\n </ul>\n <ng-container #assetsContainer></ng-container>\n "
|
|
808
840
|
}),
|
|
809
841
|
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
810
842
|
core_1.ChangeDetectorRef,
|
package/dist/npm/utils.js
CHANGED
|
@@ -92,7 +92,7 @@ exports.isFocusable = function (element) {
|
|
|
92
92
|
* @hidden
|
|
93
93
|
*/
|
|
94
94
|
exports.isContent = function (element) {
|
|
95
|
-
var scopeSelector = '.k-
|
|
95
|
+
var scopeSelector = '.k-treeview-leaf:not(.k-treeview-load-more-button),.k-treeview-item,.k-treeview';
|
|
96
96
|
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
@@ -101,20 +101,20 @@ exports.isContent = function (element) {
|
|
|
101
101
|
node = node.parentNode;
|
|
102
102
|
}
|
|
103
103
|
if (node) {
|
|
104
|
-
return exports.match(node, '.k-
|
|
104
|
+
return exports.match(node, '.k-treeview-leaf:not(.k-treeview-load-more-button)');
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
/**
|
|
108
108
|
* @hidden
|
|
109
109
|
*
|
|
110
|
-
* Returns the nested .k-
|
|
110
|
+
* Returns the nested .k-treeview-leaf:not(.k-treeview-load-more-button) element.
|
|
111
111
|
* If the passed parent item is itself a content node, it is returned.
|
|
112
112
|
*/
|
|
113
113
|
exports.getContentElement = function (parent) {
|
|
114
114
|
if (!exports.isPresent(parent)) {
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var selector = '.k-
|
|
117
|
+
var selector = '.k-treeview-leaf:not(.k-treeview-load-more-button)';
|
|
118
118
|
if (exports.match(parent, selector)) {
|
|
119
119
|
return parent;
|
|
120
120
|
}
|
|
@@ -124,7 +124,7 @@ exports.getContentElement = function (parent) {
|
|
|
124
124
|
* @hidden
|
|
125
125
|
*/
|
|
126
126
|
exports.isLoadMoreButton = function (element) {
|
|
127
|
-
return exports.isPresent(exports.closestWithMatch(element, '.k-
|
|
127
|
+
return exports.isPresent(exports.closestWithMatch(element, '.k-treeview-leaf.k-treeview-load-more-button'));
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
130
|
* @hidden
|
|
@@ -308,3 +308,15 @@ exports.sameValues = function (as, bs) {
|
|
|
308
308
|
}
|
|
309
309
|
return Array.from(as).every(function (v) { return bs.has(v); });
|
|
310
310
|
};
|
|
311
|
+
/**
|
|
312
|
+
* @hidden
|
|
313
|
+
* Returns the size class based on the component and size input.
|
|
314
|
+
*/
|
|
315
|
+
exports.getSizeClass = function (component, size) {
|
|
316
|
+
var SIZE_CLASSES = {
|
|
317
|
+
'small': "k-" + component + "-sm",
|
|
318
|
+
'medium': "k-" + component + "-md",
|
|
319
|
+
'large': "k-" + component + "-lg"
|
|
320
|
+
};
|
|
321
|
+
return SIZE_CLASSES[size];
|
|
322
|
+
};
|