@progress/kendo-angular-treeview 21.4.1-develop.1 → 22.0.0-develop.1
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/fesm2022/progress-kendo-angular-treeview.mjs +115 -115
- package/filtering-base.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/package.json +11 -19
- package/schematics/ngAdd/index.js +4 -4
- package/esm2022/check-mode.mjs +0 -5
- package/esm2022/check.directive.mjs +0 -334
- package/esm2022/checkable-settings.mjs +0 -5
- package/esm2022/checkbox/checked-state.mjs +0 -5
- package/esm2022/data-bound-component.mjs +0 -19
- package/esm2022/data-change-notification.service.mjs +0 -14
- package/esm2022/default-callbacks.mjs +0 -36
- package/esm2022/directives.mjs +0 -53
- package/esm2022/disable.directive.mjs +0 -83
- package/esm2022/drag-and-drop/drag-and-drop-editing.directive.mjs +0 -76
- package/esm2022/drag-and-drop/drag-and-drop-utils.mjs +0 -270
- package/esm2022/drag-and-drop/drag-and-drop.directive.mjs +0 -348
- package/esm2022/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +0 -44
- package/esm2022/drag-and-drop/drag-clue/drag-clue.component.mjs +0 -132
- package/esm2022/drag-and-drop/drag-clue/drag-clue.service.mjs +0 -123
- package/esm2022/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +0 -43
- package/esm2022/drag-and-drop/drop-hint/drop-hint.component.mjs +0 -102
- package/esm2022/drag-and-drop/drop-hint/drop-hint.service.mjs +0 -41
- package/esm2022/drag-and-drop/editing-services/drag-and-drop-asset.service.mjs +0 -48
- package/esm2022/drag-and-drop/editing-services/flat-editing.service.mjs +0 -141
- package/esm2022/drag-and-drop/editing-services/hierarchy-editing.service.mjs +0 -88
- package/esm2022/drag-and-drop/models/drop-action.mjs +0 -32
- package/esm2022/drag-and-drop/models/drop-position.mjs +0 -22
- package/esm2022/drag-and-drop/models/editing-service.mjs +0 -5
- package/esm2022/drag-and-drop/models/preventable-event.mjs +0 -25
- package/esm2022/drag-and-drop/models/scroll-direction.mjs +0 -12
- package/esm2022/drag-and-drop/models/scroll-settings.mjs +0 -5
- package/esm2022/drag-and-drop/models/tree-item-filter-state.mjs +0 -5
- package/esm2022/drag-and-drop/models/treeitem-add-remove-args.mjs +0 -5
- package/esm2022/drag-and-drop/models/treeitem-drag-event.mjs +0 -24
- package/esm2022/drag-and-drop/models/treeitem-drag-start-event.mjs +0 -25
- package/esm2022/drag-and-drop/models/treeitem-drop-event.mjs +0 -54
- package/esm2022/drag-and-drop/models.mjs +0 -14
- package/esm2022/expand-state.service.mjs +0 -24
- package/esm2022/expand.directive.mjs +0 -226
- package/esm2022/expandable-component.mjs +0 -19
- package/esm2022/filter-expand-settings.interface.mjs +0 -5
- package/esm2022/filter-state.interface.mjs +0 -5
- package/esm2022/filtering-base.mjs +0 -92
- package/esm2022/flat-binding.directive.mjs +0 -165
- package/esm2022/funcs.mjs +0 -9
- package/esm2022/hierarchy-binding.directive.mjs +0 -164
- package/esm2022/index-builder.service.mjs +0 -33
- package/esm2022/index.mjs +0 -31
- package/esm2022/load-more/load-more-button-template.directive.mjs +0 -41
- package/esm2022/load-more/load-more-request-args.mjs +0 -5
- package/esm2022/load-more/load-more-utils.mjs +0 -35
- package/esm2022/load-more/load-more.directive.mjs +0 -137
- package/esm2022/load-more/load-more.service.mjs +0 -5
- package/esm2022/loading-indicator.directive.mjs +0 -69
- package/esm2022/loading-notification.service.mjs +0 -21
- package/esm2022/localization/custom-messages.component.mjs +0 -54
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -27
- package/esm2022/navigation/navigation-item.interface.mjs +0 -5
- package/esm2022/navigation/navigation-model.mjs +0 -152
- package/esm2022/navigation/navigation-state.interface.mjs +0 -5
- package/esm2022/navigation/navigation.service.mjs +0 -248
- package/esm2022/node-children.service.mjs +0 -21
- package/esm2022/node-click-event.interface.mjs +0 -5
- package/esm2022/node-template.directive.mjs +0 -45
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-treeview.mjs +0 -8
- package/esm2022/selection/select.directive.mjs +0 -174
- package/esm2022/selection/selectable-settings.mjs +0 -5
- package/esm2022/selection/selection-mode.mjs +0 -5
- package/esm2022/selection/selection.service.mjs +0 -33
- package/esm2022/size.mjs +0 -5
- package/esm2022/treeitem-lookup.interface.mjs +0 -5
- package/esm2022/treeitem.interface.mjs +0 -5
- package/esm2022/treeview-filter-settings.mjs +0 -12
- package/esm2022/treeview-group.component.mjs +0 -759
- package/esm2022/treeview-item-content.directive.mjs +0 -82
- package/esm2022/treeview-item.directive.mjs +0 -245
- package/esm2022/treeview-lookup.service.mjs +0 -89
- package/esm2022/treeview.component.mjs +0 -874
- package/esm2022/treeview.module.mjs +0 -74
- package/esm2022/utils.mjs +0 -301
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Input, Optional, Host } from '@angular/core';
|
|
6
|
-
import { getter } from '@progress/kendo-common';
|
|
7
|
-
import { anyChanged, isChanged } from '@progress/kendo-angular-common';
|
|
8
|
-
import { DataBoundComponent } from './data-bound-component';
|
|
9
|
-
import { isArrayWithAtLeastOneItem, isPresent } from './utils';
|
|
10
|
-
import { of } from 'rxjs';
|
|
11
|
-
import { HierarchyEditingService } from './drag-and-drop/editing-services/hierarchy-editing.service';
|
|
12
|
-
import { DragAndDropDirective } from './drag-and-drop/drag-and-drop.directive';
|
|
13
|
-
import { isVisible } from './default-callbacks';
|
|
14
|
-
import { IndexBuilderService } from './index-builder.service';
|
|
15
|
-
import { FilteringBase } from './filtering-base';
|
|
16
|
-
import * as i0 from "@angular/core";
|
|
17
|
-
import * as i1 from "./data-bound-component";
|
|
18
|
-
import * as i2 from "./drag-and-drop/drag-and-drop.directive";
|
|
19
|
-
const indexBuilder = new IndexBuilderService();
|
|
20
|
-
const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIndex = '') => {
|
|
21
|
-
if (!isArrayWithAtLeastOneItem(currentLevelNodes)) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
return currentLevelNodes.map((node, idx) => {
|
|
25
|
-
const index = indexBuilder.nodeIndex(idx.toString(), parentIndex);
|
|
26
|
-
const wrapper = {
|
|
27
|
-
dataItem: node,
|
|
28
|
-
index,
|
|
29
|
-
parent,
|
|
30
|
-
visible: true
|
|
31
|
-
};
|
|
32
|
-
wrapper.children = mapToWrappers(getter(childrenField)(node), childrenField, wrapper, index);
|
|
33
|
-
return wrapper;
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Represents a directive that handles hierarchical data binding and provides built-in filtering functionality for the TreeView.
|
|
38
|
-
*
|
|
39
|
-
* Use this directive to bind hierarchical data where child nodes are nested within parent nodes.
|
|
40
|
-
* The directive also enables the built-in filter input and automatic filter handling when used with the `filterable` property.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```html
|
|
44
|
-
* <kendo-treeview
|
|
45
|
-
* kendoTreeViewHierarchyBinding
|
|
46
|
-
* childrenField="items"
|
|
47
|
-
* textField="text"
|
|
48
|
-
* [nodes]="data"
|
|
49
|
-
* [filterable]="true">
|
|
50
|
-
* </kendo-treeview>
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @remarks
|
|
54
|
-
* Applied to: {@link TreeViewComponent}
|
|
55
|
-
*/
|
|
56
|
-
export class HierarchyBindingDirective extends FilteringBase {
|
|
57
|
-
component;
|
|
58
|
-
dragAndDropDirective;
|
|
59
|
-
/**
|
|
60
|
-
* Specifies the field name of the parent node that holds the child data items.
|
|
61
|
-
*/
|
|
62
|
-
set childrenField(value) {
|
|
63
|
-
if (!value) {
|
|
64
|
-
throw new Error("'childrenField' cannot be empty");
|
|
65
|
-
}
|
|
66
|
-
this._childrenField = value;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Specifies the field name of the parent node that holds the child data items.
|
|
70
|
-
*/
|
|
71
|
-
get childrenField() {
|
|
72
|
-
return this._childrenField;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Specifies the hierarchical data displayed by the TreeView.
|
|
76
|
-
*/
|
|
77
|
-
set nodes(nodes) {
|
|
78
|
-
// Needs to be a setter so that it can be accessed via `super` call (typescript v5)
|
|
79
|
-
this._nodes = nodes;
|
|
80
|
-
}
|
|
81
|
-
get nodes() {
|
|
82
|
-
return this._nodes;
|
|
83
|
-
}
|
|
84
|
-
_nodes;
|
|
85
|
-
/**
|
|
86
|
-
* @hidden
|
|
87
|
-
* A callback which determines whether a TreeView node should be rendered as hidden.
|
|
88
|
-
*/
|
|
89
|
-
set isVisible(fn) {
|
|
90
|
-
this.component.isVisible = fn;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @hidden
|
|
94
|
-
*/
|
|
95
|
-
loadOnDemand = true;
|
|
96
|
-
_childrenField;
|
|
97
|
-
originalData = [];
|
|
98
|
-
constructor(component, dragAndDropDirective) {
|
|
99
|
-
super(component);
|
|
100
|
-
this.component = component;
|
|
101
|
-
this.dragAndDropDirective = dragAndDropDirective;
|
|
102
|
-
const shouldFilter = !isPresent(this.dragAndDropDirective);
|
|
103
|
-
this.component.isVisible = shouldFilter ? (node) => this.visibleNodes.has(node) : isVisible;
|
|
104
|
-
}
|
|
105
|
-
ngOnInit() {
|
|
106
|
-
if (isPresent(this.childrenField)) {
|
|
107
|
-
this.component.children = item => of(getter(this.childrenField)(item));
|
|
108
|
-
this.component.hasChildren = item => {
|
|
109
|
-
const children = getter(this.childrenField)(item);
|
|
110
|
-
return Boolean(children && children.length);
|
|
111
|
-
};
|
|
112
|
-
this.component.editService = new HierarchyEditingService(this);
|
|
113
|
-
this.component.filterChange.subscribe(this.handleFilterChange.bind(this));
|
|
114
|
-
if (this.component.filter) {
|
|
115
|
-
this.handleFilterChange(this.component.filter);
|
|
116
|
-
}
|
|
117
|
-
if (!this.loadOnDemand && isPresent(this.component.preloadChildNodes)) {
|
|
118
|
-
this.component.preloadChildNodes();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
ngOnChanges(changes) {
|
|
123
|
-
if (isChanged('childrenField', changes, false)) {
|
|
124
|
-
this.nodes = this.originalData;
|
|
125
|
-
this.updateNodes(this.originalData);
|
|
126
|
-
}
|
|
127
|
-
if (isChanged('nodes', changes, false)) {
|
|
128
|
-
this.updateNodes(changes['nodes'].currentValue);
|
|
129
|
-
}
|
|
130
|
-
// should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
131
|
-
if (anyChanged(['nodes', 'loadOnDemand'], changes) && !this.loadOnDemand && isPresent(this.component.preloadChildNodes)) {
|
|
132
|
-
this.component.preloadChildNodes();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* @hidden
|
|
137
|
-
*/
|
|
138
|
-
updateNodes(values) {
|
|
139
|
-
this.originalData = values || [];
|
|
140
|
-
this.filterData = mapToWrappers(values, this.childrenField) || [];
|
|
141
|
-
this.updateVisibleNodes(this.filterData);
|
|
142
|
-
}
|
|
143
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: i1.DataBoundComponent }, { token: i2.DragAndDropDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: HierarchyBindingDirective, isStandalone: true, selector: "[kendoTreeViewHierarchyBinding]", inputs: { childrenField: "childrenField", nodes: "nodes", isVisible: "isVisible", loadOnDemand: "loadOnDemand" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
145
|
-
}
|
|
146
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
|
|
147
|
-
type: Directive,
|
|
148
|
-
args: [{
|
|
149
|
-
selector: '[kendoTreeViewHierarchyBinding]',
|
|
150
|
-
standalone: true
|
|
151
|
-
}]
|
|
152
|
-
}], ctorParameters: () => [{ type: i1.DataBoundComponent }, { type: i2.DragAndDropDirective, decorators: [{
|
|
153
|
-
type: Optional
|
|
154
|
-
}, {
|
|
155
|
-
type: Host
|
|
156
|
-
}] }], propDecorators: { childrenField: [{
|
|
157
|
-
type: Input
|
|
158
|
-
}], nodes: [{
|
|
159
|
-
type: Input
|
|
160
|
-
}], isVisible: [{
|
|
161
|
-
type: Input
|
|
162
|
-
}], loadOnDemand: [{
|
|
163
|
-
type: Input
|
|
164
|
-
}] } });
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 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 * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export class IndexBuilderService {
|
|
11
|
-
INDEX_SEPARATOR = '_';
|
|
12
|
-
nodeIndex(index = '', parentIndex = '') {
|
|
13
|
-
return `${parentIndex}${parentIndex ? this.INDEX_SEPARATOR : ''}${index}`;
|
|
14
|
-
}
|
|
15
|
-
indexForLevel(index, level) {
|
|
16
|
-
return index.split(this.INDEX_SEPARATOR).slice(0, level).join(this.INDEX_SEPARATOR);
|
|
17
|
-
}
|
|
18
|
-
lastLevelIndex(index = '') {
|
|
19
|
-
const parts = index.split(this.INDEX_SEPARATOR);
|
|
20
|
-
if (!parts.length) {
|
|
21
|
-
return NaN;
|
|
22
|
-
}
|
|
23
|
-
return parseInt(parts[parts.length - 1], 10);
|
|
24
|
-
}
|
|
25
|
-
level(index) {
|
|
26
|
-
return index.split(this.INDEX_SEPARATOR).length;
|
|
27
|
-
}
|
|
28
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IndexBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IndexBuilderService });
|
|
30
|
-
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IndexBuilderService, decorators: [{
|
|
32
|
-
type: Injectable
|
|
33
|
-
}] });
|
package/esm2022/index.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export { TreeViewComponent } from './treeview.component';
|
|
6
|
-
export { TreeViewModule } from './treeview.module';
|
|
7
|
-
export { NodeTemplateDirective } from './node-template.directive';
|
|
8
|
-
export { CheckDirective } from './check.directive';
|
|
9
|
-
export { DisableDirective } from './disable.directive';
|
|
10
|
-
export { ExpandDirective } from './expand.directive';
|
|
11
|
-
export { SelectDirective } from './selection/select.directive';
|
|
12
|
-
export { DataBoundComponent } from './data-bound-component';
|
|
13
|
-
export { ExpandableComponent } from './expandable-component';
|
|
14
|
-
export { HierarchyBindingDirective } from './hierarchy-binding.directive';
|
|
15
|
-
export { FlatDataBindingDirective } from './flat-binding.directive';
|
|
16
|
-
export { DragAndDropDirective } from './drag-and-drop/drag-and-drop.directive';
|
|
17
|
-
export { DragAndDropEditingDirective } from './drag-and-drop/drag-and-drop-editing.directive';
|
|
18
|
-
export { DropHintTemplateDirective } from './drag-and-drop/drop-hint/drop-hint-template.directive';
|
|
19
|
-
export { DragClueTemplateDirective } from './drag-and-drop/drag-clue/drag-clue-template.directive';
|
|
20
|
-
export { DropAction } from './drag-and-drop/models/drop-action';
|
|
21
|
-
export { DropPosition } from './drag-and-drop/models/drop-position';
|
|
22
|
-
export { TreeItemDropEvent } from './drag-and-drop/models/treeitem-drop-event';
|
|
23
|
-
export { TreeItemDragStartEvent } from './drag-and-drop/models/treeitem-drag-start-event';
|
|
24
|
-
export { TreeItemDragEvent } from './drag-and-drop/models/treeitem-drag-event';
|
|
25
|
-
export { DragClueService } from './drag-and-drop/drag-clue/drag-clue.service';
|
|
26
|
-
export { DropHintService } from './drag-and-drop/drop-hint/drop-hint.service';
|
|
27
|
-
export { LoadMoreDirective } from './load-more/load-more.directive';
|
|
28
|
-
export { LoadMoreButtonTemplateDirective } from './load-more/load-more-button-template.directive';
|
|
29
|
-
export { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
30
|
-
export { LocalizedMessagesDirective } from "./localization/localized-messages.directive";
|
|
31
|
-
export * from './directives';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Optional, Directive, TemplateRef } from "@angular/core";
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Represents a directive for customizing the load more button in the TreeView.
|
|
9
|
-
*
|
|
10
|
-
* To define the template, nest an `<ng-template>` tag with the `kendoTreeViewLoadMoreButtonTemplate` directive inside a `<kendo-treeview>` tag
|
|
11
|
-
* ([see example](slug:loadmorebutton_treeview#button-template)).
|
|
12
|
-
*
|
|
13
|
-
* The template context provides the following variable:
|
|
14
|
-
* - `let-index="index"`—The hierarchical index of the load more button node.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```html
|
|
18
|
-
* <kendo-treeview>
|
|
19
|
-
* <ng-template kendoTreeViewLoadMoreButtonTemplate let-index="index">
|
|
20
|
-
* Load more at {{ index }}
|
|
21
|
-
* </ng-template>
|
|
22
|
-
* </kendo-treeview>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export class LoadMoreButtonTemplateDirective {
|
|
26
|
-
templateRef;
|
|
27
|
-
constructor(templateRef) {
|
|
28
|
-
this.templateRef = templateRef;
|
|
29
|
-
}
|
|
30
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadMoreButtonTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
31
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: LoadMoreButtonTemplateDirective, isStandalone: true, selector: "[kendoTreeViewLoadMoreButtonTemplate]", ngImport: i0 });
|
|
32
|
-
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadMoreButtonTemplateDirective, decorators: [{
|
|
34
|
-
type: Directive,
|
|
35
|
-
args: [{
|
|
36
|
-
selector: '[kendoTreeViewLoadMoreButtonTemplate]',
|
|
37
|
-
standalone: true
|
|
38
|
-
}]
|
|
39
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
40
|
-
type: Optional
|
|
41
|
-
}] }] });
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { isPresent } from '../utils';
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
export const copyPageSize = (treeview, source, target) => {
|
|
10
|
-
if (!isPresent(treeview.loadMoreService)) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const sourceGroupSize = treeview.getNodePageSize(source);
|
|
14
|
-
treeview.setNodePageSize(target, sourceGroupSize);
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export const incrementPageSize = (treeview, dataItem) => {
|
|
20
|
-
if (!isPresent(treeview.loadMoreService)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const currentPageSize = treeview.getNodePageSize(dataItem);
|
|
24
|
-
treeview.setNodePageSize(dataItem, currentPageSize + 1);
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
export const decrementPageSize = (treeview, dataItem) => {
|
|
30
|
-
if (!isPresent(treeview.loadMoreService)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const currentPageSize = treeview.getNodePageSize(dataItem);
|
|
34
|
-
treeview.setNodePageSize(dataItem, currentPageSize - 1);
|
|
35
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Input, isDevMode } from '@angular/core';
|
|
6
|
-
import { guid } from '@progress/kendo-angular-common';
|
|
7
|
-
import { TreeViewComponent } from '../treeview.component';
|
|
8
|
-
import { isPresent } from '../utils';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "../treeview.component";
|
|
11
|
-
const LOAD_MORE_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/treeview/load-more-button/';
|
|
12
|
-
/**
|
|
13
|
-
* Represents the directive that enables you to display only a limited number of nodes per level
|
|
14
|
-
* ([see example](slug:loadmorebutton_treeview)).
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```html
|
|
18
|
-
* <kendo-treeview
|
|
19
|
-
* ...
|
|
20
|
-
* kendoTreeViewLoadMore
|
|
21
|
-
* [pageSize]="10"
|
|
22
|
-
* [totalRootNodes]="100"
|
|
23
|
-
* totalField="totalChildren">
|
|
24
|
-
* </kendo-treeview>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Applied to: {@link TreeViewComponent}
|
|
29
|
-
*/
|
|
30
|
-
export class LoadMoreDirective {
|
|
31
|
-
treeview;
|
|
32
|
-
/**
|
|
33
|
-
* Sets the callback function that runs when the load more button is clicked.
|
|
34
|
-
* Provide a function when you fetch additional nodes on demand
|
|
35
|
-
* ([see example](slug:loadmorebutton_treeview#remote-data)).
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
set loadMoreNodes(loadMoreNodes) {
|
|
39
|
-
if (typeof loadMoreNodes === 'string') {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
this.treeview.loadMoreService.loadMoreNodes = loadMoreNodes;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Sets the initial number of nodes to render on each level.
|
|
46
|
-
* Each time the load more button is clicked, the page size increases by this number.
|
|
47
|
-
*/
|
|
48
|
-
pageSize;
|
|
49
|
-
/**
|
|
50
|
-
* Sets the total number of root nodes.
|
|
51
|
-
* Use this property when you fetch additional nodes on demand
|
|
52
|
-
* ([see example](slug:loadmorebutton_treeview#remote-data)).
|
|
53
|
-
*/
|
|
54
|
-
totalRootNodes;
|
|
55
|
-
/**
|
|
56
|
-
* Sets the field that contains the total number of child nodes for the data item.
|
|
57
|
-
* Use this property when you fetch additional nodes on demand
|
|
58
|
-
* ([see example](slug:loadmorebutton_treeview#remote-data)).
|
|
59
|
-
*/
|
|
60
|
-
totalField;
|
|
61
|
-
/**
|
|
62
|
-
* Keeps track of the current page size of each node over expand/collapse cycles.
|
|
63
|
-
*/
|
|
64
|
-
pageSizes = new Map();
|
|
65
|
-
/**
|
|
66
|
-
* Used as an identifier for the root page size as the root collection of nodes is not associated with a data item.
|
|
67
|
-
*/
|
|
68
|
-
rootLevelId = guid();
|
|
69
|
-
constructor(treeview) {
|
|
70
|
-
this.treeview = treeview;
|
|
71
|
-
this.treeview.loadMoreService = {
|
|
72
|
-
getInitialPageSize: this.getInitalPageSize.bind(this),
|
|
73
|
-
getGroupSize: this.getGroupSize.bind(this),
|
|
74
|
-
setGroupSize: this.setGroupSize.bind(this),
|
|
75
|
-
getTotalNodesCount: this.getTotalNodesCount.bind(this)
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
ngOnChanges() {
|
|
79
|
-
this.verifySettings();
|
|
80
|
-
}
|
|
81
|
-
verifySettings() {
|
|
82
|
-
if (!isDevMode()) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (!isPresent(this.pageSize)) {
|
|
86
|
-
throw new Error(`To use the TreeView \`kendoTreeViewLoadMore\` directive, you need to assign a \`pageSize\` value. See ${LOAD_MORE_DOC_LINK}.`);
|
|
87
|
-
}
|
|
88
|
-
const loadMoreNodes = this.treeview.loadMoreService.loadMoreNodes;
|
|
89
|
-
if (isPresent(loadMoreNodes) && typeof loadMoreNodes !== 'function') {
|
|
90
|
-
throw new Error(`The passed value to the \`kendoTreeViewLoadMore\` directive must be a function that retrieves additional nodes. See ${LOAD_MORE_DOC_LINK}.`);
|
|
91
|
-
}
|
|
92
|
-
if (isPresent(loadMoreNodes) && !isPresent(this.totalField)) {
|
|
93
|
-
throw new Error(`When a function to fetch additional nodes is provided to the \`kendoTreeViewLoadMore\` directive, the \`totalField\` and \`totalRootNodes\` values must also be provided. See ${LOAD_MORE_DOC_LINK}.`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
getGroupSize(dataItem) {
|
|
97
|
-
const itemKey = dataItem || this.rootLevelId;
|
|
98
|
-
return this.pageSizes.has(itemKey) ? this.pageSizes.get(itemKey) : this.pageSize;
|
|
99
|
-
}
|
|
100
|
-
setGroupSize(dataItem, pageSize) {
|
|
101
|
-
const itemKey = dataItem || this.rootLevelId;
|
|
102
|
-
const normalizedSizeValue = pageSize > 0 ? pageSize : 0;
|
|
103
|
-
this.pageSizes.set(itemKey, normalizedSizeValue);
|
|
104
|
-
}
|
|
105
|
-
getTotalNodesCount(dataItem, loadedNodesCount) {
|
|
106
|
-
if (isPresent(dataItem) && isPresent(this.totalField)) {
|
|
107
|
-
return dataItem[this.totalField];
|
|
108
|
-
}
|
|
109
|
-
else if (!isPresent(dataItem) && isPresent(this.totalRootNodes)) {
|
|
110
|
-
return this.totalRootNodes;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
return loadedNodesCount;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
getInitalPageSize() {
|
|
117
|
-
return this.pageSize;
|
|
118
|
-
}
|
|
119
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadMoreDirective, deps: [{ token: i1.TreeViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
120
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: LoadMoreDirective, isStandalone: true, selector: "[kendoTreeViewLoadMore]", inputs: { loadMoreNodes: ["kendoTreeViewLoadMore", "loadMoreNodes"], pageSize: "pageSize", totalRootNodes: "totalRootNodes", totalField: "totalField" }, usesOnChanges: true, ngImport: i0 });
|
|
121
|
-
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadMoreDirective, decorators: [{
|
|
123
|
-
type: Directive,
|
|
124
|
-
args: [{
|
|
125
|
-
selector: '[kendoTreeViewLoadMore]',
|
|
126
|
-
standalone: true
|
|
127
|
-
}]
|
|
128
|
-
}], ctorParameters: () => [{ type: i1.TreeViewComponent }], propDecorators: { loadMoreNodes: [{
|
|
129
|
-
type: Input,
|
|
130
|
-
args: ['kendoTreeViewLoadMore']
|
|
131
|
-
}], pageSize: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], totalRootNodes: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}], totalField: [{
|
|
136
|
-
type: Input
|
|
137
|
-
}] } });
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, ChangeDetectorRef, HostBinding, Input } from '@angular/core';
|
|
6
|
-
import { ExpandStateService } from './expand-state.service';
|
|
7
|
-
import { LoadingNotificationService } from './loading-notification.service';
|
|
8
|
-
import { of } from 'rxjs';
|
|
9
|
-
import { delay, filter, switchMap, takeUntil, tap } from 'rxjs/operators';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "./expand-state.service";
|
|
12
|
-
import * as i2 from "./loading-notification.service";
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export class LoadingIndicatorDirective {
|
|
17
|
-
expandService;
|
|
18
|
-
loadingService;
|
|
19
|
-
cd;
|
|
20
|
-
get loading() {
|
|
21
|
-
return this._loading;
|
|
22
|
-
}
|
|
23
|
-
set loading(value) {
|
|
24
|
-
this._loading = value;
|
|
25
|
-
this.cd.markForCheck();
|
|
26
|
-
}
|
|
27
|
-
index;
|
|
28
|
-
_loading = false;
|
|
29
|
-
subscription;
|
|
30
|
-
constructor(expandService, loadingService, cd) {
|
|
31
|
-
this.expandService = expandService;
|
|
32
|
-
this.loadingService = loadingService;
|
|
33
|
-
this.cd = cd;
|
|
34
|
-
}
|
|
35
|
-
ngOnInit() {
|
|
36
|
-
const loadingNotifications = this.loadingService
|
|
37
|
-
.changes
|
|
38
|
-
.pipe(filter(index => index === this.index));
|
|
39
|
-
this.subscription = this.expandService
|
|
40
|
-
.changes
|
|
41
|
-
.pipe(filter(({ index }) => index === this.index), tap(({ expand }) => {
|
|
42
|
-
if (!expand && this.loading) {
|
|
43
|
-
this.loading = false;
|
|
44
|
-
}
|
|
45
|
-
}), filter(({ expand }) => expand), switchMap(x => of(x).pipe(delay(100), takeUntil(loadingNotifications))))
|
|
46
|
-
.subscribe(() => this.loading = true);
|
|
47
|
-
this.subscription.add(loadingNotifications.subscribe(() => this.loading = false));
|
|
48
|
-
}
|
|
49
|
-
ngOnDestroy() {
|
|
50
|
-
if (this.subscription) {
|
|
51
|
-
this.subscription.unsubscribe();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadingIndicatorDirective, deps: [{ token: i1.ExpandStateService }, { token: i2.LoadingNotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: LoadingIndicatorDirective, isStandalone: true, selector: "[kendoTreeViewLoading]", inputs: { index: ["kendoTreeViewLoading", "index"] }, host: { properties: { "class.k-i-loading": "this.loading" } }, ngImport: i0 });
|
|
56
|
-
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadingIndicatorDirective, decorators: [{
|
|
58
|
-
type: Directive,
|
|
59
|
-
args: [{
|
|
60
|
-
selector: '[kendoTreeViewLoading]',
|
|
61
|
-
standalone: true
|
|
62
|
-
}]
|
|
63
|
-
}], ctorParameters: () => [{ type: i1.ExpandStateService }, { type: i2.LoadingNotificationService }, { type: i0.ChangeDetectorRef }], propDecorators: { loading: [{
|
|
64
|
-
type: HostBinding,
|
|
65
|
-
args: ["class.k-i-loading"]
|
|
66
|
-
}], index: [{
|
|
67
|
-
type: Input,
|
|
68
|
-
args: ["kendoTreeViewLoading"]
|
|
69
|
-
}] } });
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 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 { Subject } from "rxjs";
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export class LoadingNotificationService {
|
|
12
|
-
changes = new Subject();
|
|
13
|
-
notifyLoaded(index) {
|
|
14
|
-
this.changes.next(index);
|
|
15
|
-
}
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadingNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadingNotificationService });
|
|
18
|
-
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LoadingNotificationService, decorators: [{
|
|
20
|
-
type: Injectable
|
|
21
|
-
}] });
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, forwardRef } from "@angular/core";
|
|
6
|
-
import { TreeViewMessages } from "./messages";
|
|
7
|
-
import { LocalizationService } from "@progress/kendo-angular-l10n";
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
10
|
-
/**
|
|
11
|
-
* Represents the custom messages component of the TreeView.
|
|
12
|
-
*
|
|
13
|
-
* Use this component to override default messages for the TreeView.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```html
|
|
17
|
-
* <kendo-treeview>
|
|
18
|
-
* <kendo-treeview-messages
|
|
19
|
-
* loadMore="Load more items">
|
|
20
|
-
* </kendo-treeview-messages>
|
|
21
|
-
* </kendo-treeview>
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export class CustomMessagesComponent extends TreeViewMessages {
|
|
25
|
-
service;
|
|
26
|
-
constructor(service) {
|
|
27
|
-
super();
|
|
28
|
-
this.service = service;
|
|
29
|
-
}
|
|
30
|
-
get override() {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-treeview-messages", providers: [
|
|
35
|
-
{
|
|
36
|
-
provide: TreeViewMessages,
|
|
37
|
-
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
38
|
-
}
|
|
39
|
-
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
42
|
-
type: Component,
|
|
43
|
-
args: [{
|
|
44
|
-
providers: [
|
|
45
|
-
{
|
|
46
|
-
provide: TreeViewMessages,
|
|
47
|
-
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
selector: 'kendo-treeview-messages',
|
|
51
|
-
template: ``,
|
|
52
|
-
standalone: true
|
|
53
|
-
}]
|
|
54
|
-
}], ctorParameters: () => [{ type: i1.LocalizationService }] });
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, forwardRef } from "@angular/core";
|
|
6
|
-
import { TreeViewMessages } from "./messages";
|
|
7
|
-
import { LocalizationService } from "@progress/kendo-angular-l10n";
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
export class LocalizedMessagesDirective extends TreeViewMessages {
|
|
14
|
-
service;
|
|
15
|
-
constructor(service) {
|
|
16
|
-
super();
|
|
17
|
-
this.service = service;
|
|
18
|
-
}
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoTreeViewLocalizedMessages]", providers: [
|
|
21
|
-
{
|
|
22
|
-
provide: TreeViewMessages,
|
|
23
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
24
|
-
}
|
|
25
|
-
], usesInheritance: true, ngImport: i0 });
|
|
26
|
-
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
28
|
-
type: Directive,
|
|
29
|
-
args: [{
|
|
30
|
-
providers: [
|
|
31
|
-
{
|
|
32
|
-
provide: TreeViewMessages,
|
|
33
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
selector: '[kendoTreeViewLocalizedMessages]',
|
|
37
|
-
standalone: true
|
|
38
|
-
}]
|
|
39
|
-
}], ctorParameters: () => [{ type: i1.LocalizationService }] });
|