@progress/kendo-angular-dropdowns 7.0.2 → 7.0.4-dev.202208041601
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/README.md +93 -7
- package/bundles/kendo-angular-dropdowns.umd.js +1 -1
- package/common/util.d.ts +1 -1
- package/dropdowntrees/checked-state/base-check.directive.d.ts +9 -2
- package/dropdowntrees/checked-state/checked-item.d.ts +4 -0
- package/dropdowntrees/lookup/lookup.d.ts +51 -0
- package/dropdowntrees/lookup/lookup.service.d.ts +32 -0
- package/dropdowntrees/multiselecttree.component.d.ts +16 -3
- package/esm2015/comboboxes/combobox.component.js +1 -1
- package/esm2015/dropdownlist/dropdownlist.component.js +1 -1
- package/esm2015/dropdowntrees/checked-state/base-check.directive.js +16 -14
- package/esm2015/dropdowntrees/dropdowntree.component.js +2 -2
- package/esm2015/dropdowntrees/lookup/lookup.js +6 -0
- package/esm2015/dropdowntrees/lookup/lookup.service.js +84 -0
- package/esm2015/dropdowntrees/multiselecttree.component.js +88 -24
- package/esm2015/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-dropdowns.js +175 -33
- package/package.json +2 -2
package/common/util.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export declare const getHierarchicalItemLevel: (index: string) => number;
|
|
|
134
134
|
*
|
|
135
135
|
* Retrieves all descendant nodes' lookups which are currently registered in the provided lookup item as a flat array.
|
|
136
136
|
*/
|
|
137
|
-
export declare const fetchDescendentNodes: (lookup:
|
|
137
|
+
export declare const fetchDescendentNodes: (lookup: any, filterExpression?: (lookup: TreeItem) => boolean) => TreeItemLookup[];
|
|
138
138
|
/**
|
|
139
139
|
* @hidden
|
|
140
140
|
*
|
|
@@ -19,6 +19,13 @@ export declare abstract class BaseCheckDirective {
|
|
|
19
19
|
* Defines the collection that will store the full checked items.
|
|
20
20
|
*/
|
|
21
21
|
abstract checkedItems: CheckedItem[];
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
* The flag is needed in order to determine how to construct the items map keys.
|
|
25
|
+
* If `true`, then the key consists of the item's value and 0 (no leveling required),
|
|
26
|
+
* else the key consists of the item's value and level (depth)
|
|
27
|
+
*/
|
|
28
|
+
isHeterogeneous: boolean;
|
|
22
29
|
/**
|
|
23
30
|
* Holds a Set with just the checked item keys.
|
|
24
31
|
*
|
|
@@ -34,9 +41,9 @@ export declare abstract class BaseCheckDirective {
|
|
|
34
41
|
* Adds the item's depth to the item's value to allow duplicate values on different levels.
|
|
35
42
|
*
|
|
36
43
|
* @param item - The checked key.
|
|
37
|
-
* @returns { string } - A string key consisting of the item's `valueField` value and its depth.
|
|
44
|
+
* @returns { string } - A string key consisting of the item's `valueField` value and its depth (depth is 0 if data is homogeneous).
|
|
38
45
|
*/
|
|
39
46
|
private getKey;
|
|
40
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseCheckDirective, never>;
|
|
41
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseCheckDirective, never, never, { "valueField": "valueField"; "checkedItems": "checkedItems"; }, {}, never>;
|
|
48
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseCheckDirective, never, never, { "valueField": "valueField"; "checkedItems": "checkedItems"; "isHeterogeneous": "isHeterogeneous"; }, {}, never>;
|
|
42
49
|
}
|
|
@@ -21,4 +21,8 @@ export interface CheckedItem {
|
|
|
21
21
|
* Used to retrieve the correct valueField, when using heterogenous data.
|
|
22
22
|
*/
|
|
23
23
|
level?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Represents a unique key identifier constructed from the item's value and level (if heterogeneous data)
|
|
26
|
+
*/
|
|
27
|
+
key?: string;
|
|
24
28
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export interface NormalizedTreeItem {
|
|
9
|
+
/**
|
|
10
|
+
* The original dataItem
|
|
11
|
+
*/
|
|
12
|
+
dataItem?: any;
|
|
13
|
+
/**
|
|
14
|
+
* The unique item's key identifier.
|
|
15
|
+
*/
|
|
16
|
+
key?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export interface NormalizedItemLookup {
|
|
22
|
+
/**
|
|
23
|
+
* The current TreeItem instance
|
|
24
|
+
*/
|
|
25
|
+
item: NormalizedTreeItem;
|
|
26
|
+
/**
|
|
27
|
+
* The children of the current node
|
|
28
|
+
*/
|
|
29
|
+
children?: NormalizedTreeItem[];
|
|
30
|
+
/**
|
|
31
|
+
* The parent of the current node
|
|
32
|
+
*/
|
|
33
|
+
parent?: NormalizedItemLookup;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
export interface NormalizedTreeItemLookup {
|
|
39
|
+
/**
|
|
40
|
+
* The current TreeItem instance.
|
|
41
|
+
*/
|
|
42
|
+
item: NormalizedTreeItem;
|
|
43
|
+
/**
|
|
44
|
+
* The lookup details for the parent of the current TreeView node.
|
|
45
|
+
*/
|
|
46
|
+
parent?: NormalizedItemLookup;
|
|
47
|
+
/**
|
|
48
|
+
* The lookup details for the children of the current TreeView node.
|
|
49
|
+
*/
|
|
50
|
+
children?: NormalizedTreeItemLookup[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NormalizedItemLookup, NormalizedTreeItem, NormalizedTreeItemLookup } from './lookup';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare const nodeIndex: (item: NormalizedTreeItem) => string;
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export declare const buildTreeIndex: (parentIndex: string, itemIndex: string | number) => string;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildTreeItem: (dataItem: any, valueField: any, currentLevelIndex: number) => NormalizedTreeItem;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export declare class MultiSelectTreeLookupService {
|
|
23
|
+
private map;
|
|
24
|
+
reset(): void;
|
|
25
|
+
registerChildren(index: string, children: NormalizedTreeItem[]): void;
|
|
26
|
+
item(index: string): NormalizedItemLookup;
|
|
27
|
+
registerItem(item: any, parent?: NormalizedTreeItem): void;
|
|
28
|
+
itemLookup(index: string): NormalizedTreeItemLookup;
|
|
29
|
+
private mapChildren;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectTreeLookupService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MultiSelectTreeLookupService>;
|
|
32
|
+
}
|
|
@@ -24,6 +24,7 @@ import { Observable } from 'rxjs';
|
|
|
24
24
|
import { DropDownSize } from '../common/models/size';
|
|
25
25
|
import { DropDownRounded } from '../common/models/rounded';
|
|
26
26
|
import { DropDownFillMode } from '../common/models/fillmode';
|
|
27
|
+
import { MultiSelectTreeLookupService } from './lookup/lookup.service';
|
|
27
28
|
import * as i0 from "@angular/core";
|
|
28
29
|
/**
|
|
29
30
|
* Represents the [Kendo UI MultiSelectTree component for Angular]({% slug overview_multiselecttree %}).
|
|
@@ -36,6 +37,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
|
|
|
36
37
|
private _zone;
|
|
37
38
|
private localization;
|
|
38
39
|
private cdr;
|
|
40
|
+
private lookup;
|
|
39
41
|
touchEnabled: boolean;
|
|
40
42
|
hostClasses: boolean;
|
|
41
43
|
get isDisabled(): boolean;
|
|
@@ -395,8 +397,11 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
|
|
|
395
397
|
checkedItems: CheckedItem[];
|
|
396
398
|
/**
|
|
397
399
|
* @hidden
|
|
400
|
+
* The flag is needed in order to determine how to construct the items map keys.
|
|
401
|
+
* If `true`, then the key consists of the item's value and 0 (no leveling required),
|
|
402
|
+
* else the key consists of the item's value and level (depth)
|
|
398
403
|
*/
|
|
399
|
-
|
|
404
|
+
isHeterogeneous: boolean;
|
|
400
405
|
/**
|
|
401
406
|
* @hidden
|
|
402
407
|
*/
|
|
@@ -424,7 +429,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
|
|
|
424
429
|
private _fillMode;
|
|
425
430
|
private subscriptions;
|
|
426
431
|
private lastNodeOnFocus;
|
|
427
|
-
constructor(wrapper: ElementRef, popupService: PopupService, renderer: Renderer2, navigationService: NavigationService, _zone: NgZone, localization: LocalizationService, cdr: ChangeDetectorRef, touchEnabled: boolean);
|
|
432
|
+
constructor(wrapper: ElementRef, popupService: PopupService, renderer: Renderer2, navigationService: NavigationService, _zone: NgZone, localization: LocalizationService, cdr: ChangeDetectorRef, lookup: MultiSelectTreeLookupService, touchEnabled: boolean);
|
|
428
433
|
ngOnInit(): void;
|
|
429
434
|
/**
|
|
430
435
|
* @hidden
|
|
@@ -438,6 +443,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
|
|
|
438
443
|
* @hidden
|
|
439
444
|
*/
|
|
440
445
|
ngAfterContentChecked(): void;
|
|
446
|
+
ngAfterContentInit(): void;
|
|
441
447
|
/**
|
|
442
448
|
* @hidden
|
|
443
449
|
*
|
|
@@ -581,6 +587,13 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
|
|
|
581
587
|
*/
|
|
582
588
|
private disabledItemsMapper;
|
|
583
589
|
private setComponentClasses;
|
|
584
|
-
|
|
590
|
+
private removeParents;
|
|
591
|
+
/**
|
|
592
|
+
* Creates an internal map of the available tree items to be used as a reference
|
|
593
|
+
* to retrieve the item's children/parent and determine the checked sate
|
|
594
|
+
*/
|
|
595
|
+
private registerLookupItems;
|
|
596
|
+
private registerChildLookupItems;
|
|
597
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectTreeComponent, [null, null, null, null, null, null, null, null, { optional: true; }]>;
|
|
585
598
|
static ɵcmp: i0.ɵɵComponentDeclaration<MultiSelectTreeComponent, "kendo-multiselecttree", ["kendoMultiSelectTree"], { "tabindex": "tabindex"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "popupSettings": "popupSettings"; "checkableSettings": "checkableSettings"; "data": "data"; "value": "value"; "dataItems": "dataItems"; "textField": "textField"; "valueField": "valueField"; "valueDepth": "valueDepth"; "loading": "loading"; "placeholder": "placeholder"; "listHeight": "listHeight"; "disabled": "disabled"; "readonly": "readonly"; "valuePrimitive": "valuePrimitive"; "loadOnDemand": "loadOnDemand"; "focusableId": "focusableId"; "clearButton": "clearButton"; "filterable": "filterable"; "checkAll": "checkAll"; "hasChildren": "hasChildren"; "fetchChildren": "fetchChildren"; "isNodeExpanded": "isNodeExpanded"; "isNodeVisible": "isNodeVisible"; "itemDisabled": "itemDisabled"; "tagMapper": "tagMapper"; }, { "onFocus": "focus"; "onBlur": "blur"; "open": "open"; "opened": "opened"; "close": "close"; "closed": "closed"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "valueChange": "valueChange"; "removeTag": "removeTag"; "filterChange": "filterChange"; }, ["headerTemplate", "footerTemplate", "nodeTemplate", "noDataTemplate", "tagTemplate", "groupTagTemplate"], never>;
|
|
586
599
|
}
|
|
@@ -787,7 +787,7 @@ export class ComboBoxComponent {
|
|
|
787
787
|
* @hidden
|
|
788
788
|
*/
|
|
789
789
|
get buttonClasses() {
|
|
790
|
-
return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-
|
|
790
|
+
return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-caret-alt-down';
|
|
791
791
|
}
|
|
792
792
|
/**
|
|
793
793
|
* @hidden
|
|
@@ -727,7 +727,7 @@ export class DropDownListComponent {
|
|
|
727
727
|
* @hidden
|
|
728
728
|
*/
|
|
729
729
|
get buttonClasses() {
|
|
730
|
-
return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-
|
|
730
|
+
return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-caret-alt-down';
|
|
731
731
|
}
|
|
732
732
|
/**
|
|
733
733
|
* @hidden
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Directive, Input } from '@angular/core';
|
|
6
|
-
import { getHierarchicalItemLevel,
|
|
6
|
+
import { getHierarchicalItemLevel, valueFrom } from '../../common/util';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
@@ -16,48 +16,50 @@ export class BaseCheckDirective {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const level = getHierarchicalItemLevel(item.index);
|
|
19
|
-
const
|
|
19
|
+
const key = this.getKey(item, level);
|
|
20
|
+
const candidate = Object.assign(Object.assign({}, item), { level, key });
|
|
20
21
|
this.checkedItems.push(candidate);
|
|
21
|
-
this.checkedKeys.add(
|
|
22
|
+
this.checkedKeys.add(key);
|
|
22
23
|
}
|
|
23
24
|
removeItem(item) {
|
|
24
25
|
if (!this.isItemChecked(item)) {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
const level = getHierarchicalItemLevel(item.index);
|
|
28
|
-
const
|
|
29
|
+
const key = this.getKey(item, level);
|
|
30
|
+
const candidate = Object.assign(Object.assign({}, item), { level, key });
|
|
29
31
|
this.checkedItems = this.checkedItems
|
|
30
32
|
.filter(item => valueFrom(item, this.valueField) !== valueFrom(candidate, this.valueField));
|
|
31
|
-
this.checkedKeys.delete(
|
|
33
|
+
this.checkedKeys.delete(key);
|
|
32
34
|
}
|
|
33
35
|
isItemChecked(item) {
|
|
34
36
|
const level = item.index.split('_').length - 1;
|
|
35
37
|
item.level = level;
|
|
36
|
-
|
|
38
|
+
const key = this.getKey(item, level);
|
|
39
|
+
return this.checkedKeys.has(key);
|
|
37
40
|
}
|
|
38
41
|
updateItems() {
|
|
39
42
|
this.checkedItems = this.checkedItems || [];
|
|
40
|
-
this.checkedKeys = new Set(this.checkedItems.map(item =>
|
|
43
|
+
this.checkedKeys = new Set(this.checkedItems.map(item => item.key));
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* Adds the item's depth to the item's value to allow duplicate values on different levels.
|
|
44
47
|
*
|
|
45
48
|
* @param item - The checked key.
|
|
46
|
-
* @returns { string } - A string key consisting of the item's `valueField` value and its depth.
|
|
49
|
+
* @returns { string } - A string key consisting of the item's `valueField` value and its depth (depth is 0 if data is homogeneous).
|
|
47
50
|
*/
|
|
48
|
-
getKey(item) {
|
|
49
|
-
|
|
50
|
-
return valueFrom(item, this.valueField) + '_' + item.level;
|
|
51
|
-
}
|
|
52
|
-
return valueFrom(item, this.valueField);
|
|
51
|
+
getKey(item, level) {
|
|
52
|
+
return valueFrom(item, this.valueField) + '_' + (this.isHeterogeneous ? level : 0);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
BaseCheckDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseCheckDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
-
BaseCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BaseCheckDirective, inputs: { valueField: "valueField", checkedItems: "checkedItems" }, ngImport: i0 });
|
|
56
|
+
BaseCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BaseCheckDirective, inputs: { valueField: "valueField", checkedItems: "checkedItems", isHeterogeneous: "isHeterogeneous" }, ngImport: i0 });
|
|
57
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseCheckDirective, decorators: [{
|
|
58
58
|
type: Directive
|
|
59
59
|
}], propDecorators: { valueField: [{
|
|
60
60
|
type: Input
|
|
61
61
|
}], checkedItems: [{
|
|
62
62
|
type: Input
|
|
63
|
+
}], isHeterogeneous: [{
|
|
64
|
+
type: Input
|
|
63
65
|
}] } });
|
|
@@ -732,7 +732,7 @@ export class DropDownTreeComponent {
|
|
|
732
732
|
* @hidden
|
|
733
733
|
*/
|
|
734
734
|
get buttonClasses() {
|
|
735
|
-
return this.loading ? 'k-i-loading k-input-loading-icon' : 'k-i-
|
|
735
|
+
return this.loading ? 'k-i-loading k-input-loading-icon' : 'k-i-caret-alt-down';
|
|
736
736
|
}
|
|
737
737
|
/**
|
|
738
738
|
* @hidden
|
|
@@ -1129,7 +1129,7 @@ DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
1129
1129
|
</div>
|
|
1130
1130
|
</ng-template>
|
|
1131
1131
|
<ng-container #container></ng-container>
|
|
1132
|
-
`, isInline: true, components: [{ type: i4.TreeViewComponent, selector: "kendo-treeview", inputs: ["filterInputPlaceholder", "animate", "nodeTemplate", "loadMoreButtonTemplate", "trackBy", "nodes", "textField", "hasChildren", "isChecked", "isDisabled", "isExpanded", "isSelected", "isVisible", "navigable", "children", "loadOnDemand", "filterable", "filter", "size"], outputs: ["childrenLoaded", "blur", "focus", "expand", "collapse", "nodeDragStart", "nodeDrag", "filterStateChange", "nodeDrop", "nodeDragEnd", "addItem", "removeItem", "checkedChange", "selectionChange", "filterChange", "nodeClick", "nodeDblClick"], exportAs: ["kendoTreeView"] }], directives: [{ type: i5.LocalizedMessagesDirective, selector: "\n [kendoDropDownListLocalizedMessages],\n [kendoDropDownTreeLocalizedMessages],\n [kendoComboBoxLocalizedMessages],\n [kendoMultiColumnComboBoxLocalizedMessages],\n [kendoAutoCompleteLocalizedMessages],\n [kendoMultiSelectLocalizedMessages],\n [kendoMultiSelectTreeLocalizedMessages]\n " }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.FilterInputDirective, selector: "[filterInput]", inputs: ["filterInput"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i4.SelectDirective, selector: "[kendoTreeViewSelectable]", inputs: ["isSelected", "selectBy", "kendoTreeViewSelectable", "selectedKeys"], outputs: ["selectedKeysChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1132
|
+
`, isInline: true, components: [{ type: i4.TreeViewComponent, selector: "kendo-treeview", inputs: ["filterInputPlaceholder", "expandDisabledNodes", "animate", "nodeTemplate", "loadMoreButtonTemplate", "trackBy", "nodes", "textField", "hasChildren", "isChecked", "isDisabled", "isExpanded", "isSelected", "isVisible", "navigable", "children", "loadOnDemand", "filterable", "filter", "size", "disableParentNodesOnly"], outputs: ["childrenLoaded", "blur", "focus", "expand", "collapse", "nodeDragStart", "nodeDrag", "filterStateChange", "nodeDrop", "nodeDragEnd", "addItem", "removeItem", "checkedChange", "selectionChange", "filterChange", "nodeClick", "nodeDblClick"], exportAs: ["kendoTreeView"] }], directives: [{ type: i5.LocalizedMessagesDirective, selector: "\n [kendoDropDownListLocalizedMessages],\n [kendoDropDownTreeLocalizedMessages],\n [kendoComboBoxLocalizedMessages],\n [kendoMultiColumnComboBoxLocalizedMessages],\n [kendoAutoCompleteLocalizedMessages],\n [kendoMultiSelectLocalizedMessages],\n [kendoMultiSelectTreeLocalizedMessages]\n " }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.FilterInputDirective, selector: "[filterInput]", inputs: ["filterInput"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i4.SelectDirective, selector: "[kendoTreeViewSelectable]", inputs: ["isSelected", "selectBy", "kendoTreeViewSelectable", "selectedKeys"], outputs: ["selectedKeysChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1133
1133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownTreeComponent, decorators: [{
|
|
1134
1134
|
type: Component,
|
|
1135
1135
|
args: [{
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
import { isPresent, valueFrom } from '../../common/util';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export const nodeIndex = (item) => (item || {}).key;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export const buildTreeIndex = (parentIndex, itemIndex) => {
|
|
16
|
+
return [parentIndex, itemIndex].filter(part => isPresent(part)).join('_');
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export const buildTreeItem = (dataItem, valueField, currentLevelIndex) => {
|
|
22
|
+
if (!isPresent(dataItem)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
dataItem,
|
|
27
|
+
key: valueFrom({ dataItem, level: currentLevelIndex }, valueField) + '_' + currentLevelIndex
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
export class MultiSelectTreeLookupService {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.map = new Map();
|
|
36
|
+
}
|
|
37
|
+
reset() {
|
|
38
|
+
this.map.clear();
|
|
39
|
+
}
|
|
40
|
+
registerChildren(index, children) {
|
|
41
|
+
const item = this.item(index);
|
|
42
|
+
if (!item) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
item.children = children;
|
|
46
|
+
}
|
|
47
|
+
item(index) {
|
|
48
|
+
return this.map.get(index) || null;
|
|
49
|
+
}
|
|
50
|
+
registerItem(item, parent) {
|
|
51
|
+
const currentLookup = {
|
|
52
|
+
children: [],
|
|
53
|
+
item,
|
|
54
|
+
parent: this.item(nodeIndex(parent))
|
|
55
|
+
};
|
|
56
|
+
this.map.set(item.key, currentLookup);
|
|
57
|
+
}
|
|
58
|
+
itemLookup(index) {
|
|
59
|
+
const item = this.item(index);
|
|
60
|
+
if (!item) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
children: this.mapChildren(item.children),
|
|
65
|
+
item: item.item,
|
|
66
|
+
parent: item.parent
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
mapChildren(children = []) {
|
|
70
|
+
return children.map(c => {
|
|
71
|
+
const { item, parent, children } = this.item(c.key);
|
|
72
|
+
return {
|
|
73
|
+
children: this.mapChildren(children),
|
|
74
|
+
item,
|
|
75
|
+
parent
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
MultiSelectTreeLookupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiSelectTreeLookupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
81
|
+
MultiSelectTreeLookupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiSelectTreeLookupService });
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiSelectTreeLookupService, decorators: [{
|
|
83
|
+
type: Injectable
|
|
84
|
+
}] });
|