@rxap/tree 19.1.0 → 21.0.1-dev.0
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/CHANGELOG.md +22 -0
- package/compodoc/changelog.html +21 -0
- package/compodoc/components/TreeComponent.html +158 -161
- package/compodoc/dependencies.html +14 -14
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +308 -308
- package/docs/html/classes/DefaultTreeApplyFilterMethod.html +2 -2
- package/docs/html/classes/SearchForm.html +2 -2
- package/docs/html/classes/TreeComponent.html +4 -4
- package/docs/html/classes/TreeContentDirective.html +2 -2
- package/docs/html/classes/TreeDataSource.html +16 -16
- package/docs/html/functions/FormFactory.html +1 -1
- package/docs/html/functions/flatTree.html +1 -1
- package/docs/html/functions/isSelectionChange.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/ISearchForm.html +2 -2
- package/docs/html/interfaces/TreeApplyFilterParameter.html +2 -2
- package/docs/html/interfaces/TreeDataSourceMetadata.html +3 -3
- package/docs/html/modules.html +1 -1
- package/docs/html/variables/RXAP_TREE_CONTENT_EDITABLE_METHOD.html +1 -1
- package/docs/html/variables/RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD.html +1 -1
- package/docs/html/variables/RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD.html +1 -1
- package/docs/html/variables/RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD.html +1 -1
- package/docs/html/variables/SearchFormProviders.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/DefaultTreeApplyFilterMethod.md +5 -5
- package/docs/markdown/classes/SearchForm.md +5 -5
- package/docs/markdown/classes/TreeComponent.md +34 -34
- package/docs/markdown/classes/TreeContentDirective.md +4 -4
- package/docs/markdown/classes/TreeDataSource.md +87 -87
- package/docs/markdown/functions/FormFactory.md +2 -2
- package/docs/markdown/functions/flatTree.md +2 -2
- package/docs/markdown/functions/isSelectionChange.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/ISearchForm.md +4 -4
- package/docs/markdown/interfaces/TreeApplyFilterParameter.md +5 -5
- package/docs/markdown/interfaces/TreeDataSourceMetadata.md +8 -8
- package/docs/markdown/variables/RXAP_TREE_CONTENT_EDITABLE_METHOD.md +2 -2
- package/docs/markdown/variables/RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD.md +2 -2
- package/docs/markdown/variables/RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD.md +2 -2
- package/docs/markdown/variables/RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD.md +2 -2
- package/docs/markdown/variables/SearchFormProviders.md +2 -2
- package/docs/wiki/Class.DefaultTreeApplyFilterMethod.md +4 -4
- package/docs/wiki/Class.SearchForm.md +4 -4
- package/docs/wiki/Class.TreeComponent.md +33 -33
- package/docs/wiki/Class.TreeContentDirective.md +3 -3
- package/docs/wiki/Class.TreeDataSource.md +86 -86
- package/docs/wiki/Function.FormFactory.md +1 -1
- package/docs/wiki/Function.flatTree.md +1 -1
- package/docs/wiki/Function.isSelectionChange.md +1 -1
- package/docs/wiki/Interface.ISearchForm.md +3 -3
- package/docs/wiki/Interface.TreeApplyFilterParameter.md +4 -4
- package/docs/wiki/Interface.TreeDataSourceMetadata.md +7 -7
- package/docs/wiki/Variable.RXAP_TREE_CONTENT_EDITABLE_METHOD.md +1 -1
- package/docs/wiki/Variable.RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD.md +1 -1
- package/docs/wiki/Variable.RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD.md +1 -1
- package/docs/wiki/Variable.RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD.md +1 -1
- package/docs/wiki/Variable.SearchFormProviders.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-tree.mjs +21 -23
- package/fesm2022/rxap-tree.mjs.map +1 -1
- package/package.json +42 -41
- package/types/rxap-tree.d.ts +190 -0
- package/index.d.ts +0 -5
- package/lib/search.form.d.ts +0 -16
- package/lib/tokens.d.ts +0 -2
- package/lib/tree-content.directive.d.ts +0 -8
- package/lib/tree.component.d.ts +0 -63
- package/lib/tree.data-source.d.ts +0 -108
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injector, Provider, InjectionToken, TemplateRef, OnInit, AfterContentInit, EventEmitter, ElementRef, ViewContainerRef, ChangeDetectorRef, Renderer2 } from '@angular/core';
|
|
3
|
+
import { FormType, RxapFormGroup, RxapFormControl } from '@rxap/forms';
|
|
4
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
+
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
6
|
+
import { Node, NodeToDisplayFunction, NodeGetIconFunction, NodeGetTypeFunction, NodeGetStyleFunction, NodeHasDetailsFunction, EventOptions, ExpandNodeFunction } from '@rxap/data-structure-tree';
|
|
7
|
+
import { Method } from '@rxap/pattern';
|
|
8
|
+
import { WithIdentifier, WithChildren } from '@rxap/utilities';
|
|
9
|
+
import { SelectionModel, SelectionChange } from '@angular/cdk/collections';
|
|
10
|
+
import { BaseDataSource, BaseDataSourceMetadata, BaseDataSourceViewer } from '@rxap/data-source';
|
|
11
|
+
import { ToggleSubject } from '@rxap/rxjs';
|
|
12
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
13
|
+
|
|
14
|
+
interface ISearchForm<Scope = unknown> {
|
|
15
|
+
search: string;
|
|
16
|
+
scope: Record<string, Scope[]>;
|
|
17
|
+
}
|
|
18
|
+
declare class SearchForm<Scope = unknown> implements FormType<ISearchForm<Scope>> {
|
|
19
|
+
rxapFormGroup: RxapFormGroup<ISearchForm<Scope>>;
|
|
20
|
+
search: RxapFormControl<string>;
|
|
21
|
+
scope: RxapFormControl<ISearchForm<Scope>['scope']>;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SearchForm<any>, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SearchForm<any>>;
|
|
24
|
+
}
|
|
25
|
+
declare function FormFactory(injector: Injector, state: ISearchForm | null, existingFormDefinition: SearchForm | null): SearchForm;
|
|
26
|
+
declare const SearchFormProviders: Provider[];
|
|
27
|
+
|
|
28
|
+
declare const RXAP_TREE_CONTENT_EDITABLE_METHOD: InjectionToken<unknown>;
|
|
29
|
+
|
|
30
|
+
declare class TreeContentDirective {
|
|
31
|
+
readonly template: TemplateRef<any>;
|
|
32
|
+
constructor(template: TemplateRef<any>);
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeContentDirective, never>;
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TreeContentDirective, "ng-template[rxapTreeContent]", never, {}, {}, never, never, true, never>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare function isSelectionChange<T>(obj: any): obj is SelectionChange<T>;
|
|
38
|
+
interface TreeDataSourceMetadata extends BaseDataSourceMetadata {
|
|
39
|
+
selectMultiple?: boolean;
|
|
40
|
+
expandMultiple?: boolean;
|
|
41
|
+
scopeTypes?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* If true the tree will be refreshed with caching disbabled after the first load
|
|
44
|
+
*/
|
|
45
|
+
autoRefreshWithoutCache?: boolean;
|
|
46
|
+
}
|
|
47
|
+
declare const RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD: InjectionToken<unknown>;
|
|
48
|
+
declare const RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD: InjectionToken<unknown>;
|
|
49
|
+
declare const RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD: InjectionToken<unknown>;
|
|
50
|
+
declare function flatTree<Data extends WithIdentifier & WithChildren = any>(tree: Node<Data> | Array<Node<Data>>, all?: boolean): Array<Node<Data>>;
|
|
51
|
+
interface TreeApplyFilterParameter<Form extends ISearchForm = ISearchForm, Data extends WithIdentifier & WithChildren = any> {
|
|
52
|
+
tree: Array<Node<Data>>;
|
|
53
|
+
filter: Form;
|
|
54
|
+
scopeTypes?: string[];
|
|
55
|
+
}
|
|
56
|
+
declare class DefaultTreeApplyFilterMethod<Data extends WithIdentifier & WithChildren = any> implements Method<Array<Node<Data>>, TreeApplyFilterParameter> {
|
|
57
|
+
protected lastFilter: ISearchForm | null;
|
|
58
|
+
call({ tree, filter, scopeTypes }: TreeApplyFilterParameter): Array<Node<Data>> | Promise<Array<Node<Data>>>;
|
|
59
|
+
protected isEqualToLastFilter(filter: ISearchForm): boolean;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTreeApplyFilterMethod<any>, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTreeApplyFilterMethod<any>>;
|
|
62
|
+
}
|
|
63
|
+
declare class TreeDataSource<Data extends WithIdentifier & WithChildren = any, RootParameters = any, NodeParameters = any> extends BaseDataSource<Array<Node<Data>>, TreeDataSourceMetadata> implements OnInit {
|
|
64
|
+
readonly rootRemoteMethod: Method<Data | Data[], RootParameters>;
|
|
65
|
+
readonly childrenRemoteMethod: Method<Data[], Node<Data>> | null;
|
|
66
|
+
tree$: BehaviorSubject<Node<Data, any>[]>;
|
|
67
|
+
treeControl: FlatTreeControl<Node<Data>>;
|
|
68
|
+
selected: SelectionModel<Node<Data>>;
|
|
69
|
+
expanded: SelectionModel<string>;
|
|
70
|
+
loading$: ToggleSubject;
|
|
71
|
+
searchForm: SearchForm | null;
|
|
72
|
+
protected _data$: BehaviorSubject<Node<Data, any>[]>;
|
|
73
|
+
private _expandedLocalStorageSubscription;
|
|
74
|
+
private _selectedLocalStorageSubscription;
|
|
75
|
+
private _preSelected;
|
|
76
|
+
private _refreshMatchFilter;
|
|
77
|
+
private readonly applyFilterMethod;
|
|
78
|
+
constructor(rootRemoteMethod: Method<Data | Data[], RootParameters>, childrenRemoteMethod?: Method<Data[], Node<Data>> | null, applyFilterMethod?: Method<Array<Node<Data>>, TreeApplyFilterParameter> | null, metadata?: TreeDataSourceMetadata | null);
|
|
79
|
+
private _nodeParameters;
|
|
80
|
+
get nodeParameters(): NodeParameters | null;
|
|
81
|
+
set nodeParameters(nodeParameters: NodeParameters | null);
|
|
82
|
+
ngOnInit(): void;
|
|
83
|
+
toDisplay: NodeToDisplayFunction<Data>;
|
|
84
|
+
getIcon: NodeGetIconFunction<Data>;
|
|
85
|
+
getType: NodeGetTypeFunction<Data>;
|
|
86
|
+
getStyle: NodeGetStyleFunction<Data>;
|
|
87
|
+
hasDetails: NodeHasDetailsFunction<Data>;
|
|
88
|
+
matchFilter: (node: Node<Data>) => boolean;
|
|
89
|
+
getTreeRoot(options?: {
|
|
90
|
+
cache?: boolean;
|
|
91
|
+
}): Promise<Array<Node<Data>>>;
|
|
92
|
+
selectNode(node: Node<Data>): Promise<void>;
|
|
93
|
+
setTreeControl(treeControl: FlatTreeControl<Node<Data>>): void;
|
|
94
|
+
setMatchFilter(matchFilter: (node: Node<Data>) => boolean): void;
|
|
95
|
+
setToDisplay(toDisplay?: NodeToDisplayFunction<Data>): void;
|
|
96
|
+
setGetIcon(getIcon?: NodeGetIconFunction<Data>): void;
|
|
97
|
+
setHasDetails(hasDetails?: NodeHasDetailsFunction<Data>): void;
|
|
98
|
+
deselectNode(node: Node<Data>): Promise<void>;
|
|
99
|
+
expandNode(node: Node<Data>, options?: EventOptions): Promise<void>;
|
|
100
|
+
getChildren(node: Node<Data>): Promise<Data[]>;
|
|
101
|
+
getRoot(options?: {
|
|
102
|
+
cache?: boolean;
|
|
103
|
+
}): Promise<Data | Data[]>;
|
|
104
|
+
getRootParameters(options?: {
|
|
105
|
+
cache?: boolean;
|
|
106
|
+
}): Promise<RootParameters>;
|
|
107
|
+
getNodeById(id: string): Node<Data> | null;
|
|
108
|
+
toNode(parent: Node<Data> | null, item: Data, depth?: number, onExpand?: ExpandNodeFunction<Data>, onCollapse?: ExpandNodeFunction<Data>, onSelect?: ExpandNodeFunction<Data>, onDeselect?: ExpandNodeFunction<Data>): Promise<Node<Data>>;
|
|
109
|
+
collapseNode(node: Node<Data>, options?: EventOptions): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Converts the tree structure into a list.
|
|
112
|
+
*
|
|
113
|
+
* @param tree
|
|
114
|
+
* @param all true - include nodes children that are not expanded
|
|
115
|
+
*/
|
|
116
|
+
flatTree(tree: Node<Data>, all?: boolean): Array<Node<Data>>;
|
|
117
|
+
destroy(): void;
|
|
118
|
+
refreshMatchFilter(): void;
|
|
119
|
+
refresh(): Promise<any>;
|
|
120
|
+
reset(): any;
|
|
121
|
+
setGetStyle(getStyle?: NodeGetStyleFunction<any>): void;
|
|
122
|
+
setGetType(getType?: NodeGetTypeFunction<any>): void;
|
|
123
|
+
/**
|
|
124
|
+
* recall the getStyle, getIcon and toDisplay methods
|
|
125
|
+
* and update the node objects
|
|
126
|
+
*/
|
|
127
|
+
updateNodes(): void;
|
|
128
|
+
protected _connect(collectionViewer: Required<BaseDataSourceViewer>): Observable<Array<Node<Data>>>;
|
|
129
|
+
private initSelected;
|
|
130
|
+
private initExpanded;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeDataSource<any, any, any>, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
132
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TreeDataSource<any, any, any>>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare class TreeComponent<Data extends WithIdentifier & WithChildren = any> implements OnInit, AfterContentInit {
|
|
136
|
+
private readonly viewContainerRef;
|
|
137
|
+
private readonly cdr;
|
|
138
|
+
private readonly renderer;
|
|
139
|
+
private readonly elementRef;
|
|
140
|
+
readonly searchForm: SearchForm | null;
|
|
141
|
+
treeControl: FlatTreeControl<Node<Data>>;
|
|
142
|
+
dataSource: TreeDataSource<Data>;
|
|
143
|
+
contentEditableMethod?: Method<any, string | null> | null;
|
|
144
|
+
toDisplay?: NodeToDisplayFunction<any>;
|
|
145
|
+
getIcon?: NodeGetIconFunction<any>;
|
|
146
|
+
getType?: NodeGetTypeFunction<any>;
|
|
147
|
+
getStyle?: NodeGetStyleFunction<any>;
|
|
148
|
+
multiple: boolean;
|
|
149
|
+
hasDetails?: NodeHasDetailsFunction<any>;
|
|
150
|
+
content?: TreeContentDirective;
|
|
151
|
+
hideLeafIcon: boolean;
|
|
152
|
+
id?: string;
|
|
153
|
+
details: EventEmitter<any>;
|
|
154
|
+
dividerOffset: string;
|
|
155
|
+
portal: TemplatePortal | null;
|
|
156
|
+
treeContainer: ElementRef;
|
|
157
|
+
readonly showTreeNavigation: i0.WritableSignal<boolean>;
|
|
158
|
+
/**
|
|
159
|
+
* Indicates that the divider is moved with mouse down
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
private _moveDivider;
|
|
163
|
+
/**
|
|
164
|
+
* Holds the current tree container width.
|
|
165
|
+
* If null the move divider feature was not yet used and the initial
|
|
166
|
+
* container width is not calculated
|
|
167
|
+
* @private
|
|
168
|
+
*/
|
|
169
|
+
private _treeContainerWidth;
|
|
170
|
+
constructor(viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, contentEditableMethod: Method<any, string | null> | null, renderer: Renderer2, elementRef: ElementRef<HTMLElement>, searchForm: SearchForm | null);
|
|
171
|
+
get nodeDisplayEditable(): boolean;
|
|
172
|
+
get cacheId(): string;
|
|
173
|
+
getLevel: (node: Node<Data>) => number;
|
|
174
|
+
isExpandable: (node: Node<Data>) => boolean;
|
|
175
|
+
hasChild: (_: number, nodeData: Node<Data>) => boolean;
|
|
176
|
+
ngOnInit(): void;
|
|
177
|
+
ngAfterContentInit(): void;
|
|
178
|
+
openDetails(node: Node<Data>): void;
|
|
179
|
+
onContentEditableChange(value: string | null, node: Node<Data>): any;
|
|
180
|
+
onMousedown(): void;
|
|
181
|
+
onMouseup(): void;
|
|
182
|
+
onMousemove($event: MouseEvent): void;
|
|
183
|
+
toggleTreeNavigation(): void;
|
|
184
|
+
private setDividerOffset;
|
|
185
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent<any>, [null, null, { optional: true; }, null, null, { optional: true; }]>;
|
|
186
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent<any>, "rxap-tree", never, { "dataSource": { "alias": "dataSource"; "required": true; }; "contentEditableMethod": { "alias": "contentEditableMethod"; "required": false; }; "toDisplay": { "alias": "toDisplay"; "required": false; }; "getIcon": { "alias": "getIcon"; "required": false; }; "getType": { "alias": "getType"; "required": false; }; "getStyle": { "alias": "getStyle"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "hasDetails": { "alias": "hasDetails"; "required": false; }; "hideLeafIcon": { "alias": "hideLeafIcon"; "required": false; }; "id": { "alias": "id"; "required": false; }; "dividerOffset": { "alias": "dividerOffset"; "required": false; }; }, { "details": "details"; }, ["content"], ["[searchHeader]", "*"], true, never>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export { DefaultTreeApplyFilterMethod, FormFactory, RXAP_TREE_CONTENT_EDITABLE_METHOD, RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD, RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD, RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD, SearchForm, SearchFormProviders, TreeComponent, TreeContentDirective, TreeDataSource, flatTree, isSelectionChange };
|
|
190
|
+
export type { ISearchForm, TreeApplyFilterParameter, TreeDataSourceMetadata };
|
package/index.d.ts
DELETED
package/lib/search.form.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Injector, Provider } from '@angular/core';
|
|
2
|
-
import { FormType, RxapFormControl, RxapFormGroup } from '@rxap/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export interface ISearchForm<Scope = unknown> {
|
|
5
|
-
search: string;
|
|
6
|
-
scope: Record<string, Scope[]>;
|
|
7
|
-
}
|
|
8
|
-
export declare class SearchForm<Scope = unknown> implements FormType<ISearchForm<Scope>> {
|
|
9
|
-
rxapFormGroup: RxapFormGroup<ISearchForm<Scope>>;
|
|
10
|
-
search: RxapFormControl<string>;
|
|
11
|
-
scope: RxapFormControl<ISearchForm<Scope>['scope']>;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SearchForm<any>, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SearchForm<any>>;
|
|
14
|
-
}
|
|
15
|
-
export declare function FormFactory(injector: Injector, state: ISearchForm | null, existingFormDefinition: SearchForm | null): SearchForm;
|
|
16
|
-
export declare const SearchFormProviders: Provider[];
|
package/lib/tokens.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TreeContentDirective {
|
|
4
|
-
readonly template: TemplateRef<any>;
|
|
5
|
-
constructor(template: TemplateRef<any>);
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TreeContentDirective, never>;
|
|
7
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TreeContentDirective, "ng-template[rxapTreeContent]", never, {}, {}, never, never, true, never>;
|
|
8
|
-
}
|
package/lib/tree.component.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { TemplatePortal } from '@angular/cdk/portal';
|
|
2
|
-
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
3
|
-
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnInit, Renderer2, ViewContainerRef } from '@angular/core';
|
|
4
|
-
import { Node, NodeGetIconFunction, NodeGetStyleFunction, NodeGetTypeFunction, NodeHasDetailsFunction, NodeToDisplayFunction } from '@rxap/data-structure-tree';
|
|
5
|
-
import { Method } from '@rxap/pattern';
|
|
6
|
-
import { WithChildren, WithIdentifier } from '@rxap/utilities';
|
|
7
|
-
import { SearchForm } from './search.form';
|
|
8
|
-
import { TreeContentDirective } from './tree-content.directive';
|
|
9
|
-
import { TreeDataSource } from './tree.data-source';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
export declare class TreeComponent<Data extends WithIdentifier & WithChildren = any> implements OnInit, AfterContentInit {
|
|
12
|
-
private readonly viewContainerRef;
|
|
13
|
-
private readonly cdr;
|
|
14
|
-
private readonly renderer;
|
|
15
|
-
private readonly elementRef;
|
|
16
|
-
readonly searchForm: SearchForm | null;
|
|
17
|
-
treeControl: FlatTreeControl<Node<Data>>;
|
|
18
|
-
dataSource: TreeDataSource<Data>;
|
|
19
|
-
contentEditableMethod?: Method<any, string | null> | null;
|
|
20
|
-
toDisplay?: NodeToDisplayFunction<any>;
|
|
21
|
-
getIcon?: NodeGetIconFunction<any>;
|
|
22
|
-
getType?: NodeGetTypeFunction<any>;
|
|
23
|
-
getStyle?: NodeGetStyleFunction<any>;
|
|
24
|
-
multiple: boolean;
|
|
25
|
-
hasDetails?: NodeHasDetailsFunction<any>;
|
|
26
|
-
content?: TreeContentDirective;
|
|
27
|
-
hideLeafIcon: boolean;
|
|
28
|
-
id?: string;
|
|
29
|
-
details: EventEmitter<any>;
|
|
30
|
-
dividerOffset: string;
|
|
31
|
-
portal: TemplatePortal | null;
|
|
32
|
-
treeContainer: ElementRef;
|
|
33
|
-
readonly showTreeNavigation: import("@angular/core").WritableSignal<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Indicates that the divider is moved with mouse down
|
|
36
|
-
* @private
|
|
37
|
-
*/
|
|
38
|
-
private _moveDivider;
|
|
39
|
-
/**
|
|
40
|
-
* Holds the current tree container width.
|
|
41
|
-
* If null the move divider feature was not yet used and the initial
|
|
42
|
-
* container width is not calculated
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
private _treeContainerWidth;
|
|
46
|
-
constructor(viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, contentEditableMethod: Method<any, string | null> | null, renderer: Renderer2, elementRef: ElementRef<HTMLElement>, searchForm: SearchForm | null);
|
|
47
|
-
get nodeDisplayEditable(): boolean;
|
|
48
|
-
get cacheId(): string;
|
|
49
|
-
getLevel: (node: Node<Data>) => number;
|
|
50
|
-
isExpandable: (node: Node<Data>) => boolean;
|
|
51
|
-
hasChild: (_: number, nodeData: Node<Data>) => boolean;
|
|
52
|
-
ngOnInit(): void;
|
|
53
|
-
ngAfterContentInit(): void;
|
|
54
|
-
openDetails(node: Node<Data>): void;
|
|
55
|
-
onContentEditableChange(value: string | null, node: Node<Data>): any;
|
|
56
|
-
onMousedown(): void;
|
|
57
|
-
onMouseup(): void;
|
|
58
|
-
onMousemove($event: MouseEvent): void;
|
|
59
|
-
toggleTreeNavigation(): void;
|
|
60
|
-
private setDividerOffset;
|
|
61
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent<any>, [null, null, { optional: true; }, null, null, { optional: true; }]>;
|
|
62
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent<any>, "rxap-tree", never, { "dataSource": { "alias": "dataSource"; "required": true; }; "contentEditableMethod": { "alias": "contentEditableMethod"; "required": false; }; "toDisplay": { "alias": "toDisplay"; "required": false; }; "getIcon": { "alias": "getIcon"; "required": false; }; "getType": { "alias": "getType"; "required": false; }; "getStyle": { "alias": "getStyle"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "hasDetails": { "alias": "hasDetails"; "required": false; }; "hideLeafIcon": { "alias": "hideLeafIcon"; "required": false; }; "id": { "alias": "id"; "required": false; }; "dividerOffset": { "alias": "dividerOffset"; "required": false; }; }, { "details": "details"; }, ["content"], ["[searchHeader]", "*"], true, never>;
|
|
63
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { SelectionChange, SelectionModel } from '@angular/cdk/collections';
|
|
2
|
-
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
3
|
-
import { InjectionToken, OnInit } from '@angular/core';
|
|
4
|
-
import { BaseDataSource, BaseDataSourceMetadata, BaseDataSourceViewer } from '@rxap/data-source';
|
|
5
|
-
import { EventOptions, ExpandNodeFunction, Node, NodeGetIconFunction, NodeGetStyleFunction, NodeGetTypeFunction, NodeHasDetailsFunction, NodeToDisplayFunction } from '@rxap/data-structure-tree';
|
|
6
|
-
import { Method } from '@rxap/pattern';
|
|
7
|
-
import { ToggleSubject } from '@rxap/rxjs';
|
|
8
|
-
import { WithChildren, WithIdentifier } from '@rxap/utilities';
|
|
9
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
|
10
|
-
import { ISearchForm, SearchForm } from './search.form';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
export declare function isSelectionChange<T>(obj: any): obj is SelectionChange<T>;
|
|
13
|
-
export interface TreeDataSourceMetadata extends BaseDataSourceMetadata {
|
|
14
|
-
selectMultiple?: boolean;
|
|
15
|
-
expandMultiple?: boolean;
|
|
16
|
-
scopeTypes?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* If true the tree will be refreshed with caching disbabled after the first load
|
|
19
|
-
*/
|
|
20
|
-
autoRefreshWithoutCache?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD: InjectionToken<unknown>;
|
|
23
|
-
export declare const RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD: InjectionToken<unknown>;
|
|
24
|
-
export declare const RXAP_TREE_DATA_SOURCE_APPLY_FILTER_METHOD: InjectionToken<unknown>;
|
|
25
|
-
export declare function flatTree<Data extends WithIdentifier & WithChildren = any>(tree: Node<Data> | Array<Node<Data>>, all?: boolean): Array<Node<Data>>;
|
|
26
|
-
export interface TreeApplyFilterParameter<Form extends ISearchForm = ISearchForm, Data extends WithIdentifier & WithChildren = any> {
|
|
27
|
-
tree: Array<Node<Data>>;
|
|
28
|
-
filter: Form;
|
|
29
|
-
scopeTypes?: string[];
|
|
30
|
-
}
|
|
31
|
-
export declare class DefaultTreeApplyFilterMethod<Data extends WithIdentifier & WithChildren = any> implements Method<Array<Node<Data>>, TreeApplyFilterParameter> {
|
|
32
|
-
protected lastFilter: ISearchForm | null;
|
|
33
|
-
call({ tree, filter, scopeTypes }: TreeApplyFilterParameter): Array<Node<Data>> | Promise<Array<Node<Data>>>;
|
|
34
|
-
protected isEqualToLastFilter(filter: ISearchForm): boolean;
|
|
35
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTreeApplyFilterMethod<any>, never>;
|
|
36
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTreeApplyFilterMethod<any>>;
|
|
37
|
-
}
|
|
38
|
-
export declare class TreeDataSource<Data extends WithIdentifier & WithChildren = any, RootParameters = any, NodeParameters = any> extends BaseDataSource<Array<Node<Data>>, TreeDataSourceMetadata> implements OnInit {
|
|
39
|
-
readonly rootRemoteMethod: Method<Data | Data[], RootParameters>;
|
|
40
|
-
readonly childrenRemoteMethod: Method<Data[], Node<Data>> | null;
|
|
41
|
-
tree$: BehaviorSubject<Node<Data, any>[]>;
|
|
42
|
-
treeControl: FlatTreeControl<Node<Data>>;
|
|
43
|
-
selected: SelectionModel<Node<Data>>;
|
|
44
|
-
expanded: SelectionModel<string>;
|
|
45
|
-
loading$: ToggleSubject;
|
|
46
|
-
searchForm: SearchForm | null;
|
|
47
|
-
protected _data$: BehaviorSubject<Node<Data, any>[]>;
|
|
48
|
-
private _expandedLocalStorageSubscription;
|
|
49
|
-
private _selectedLocalStorageSubscription;
|
|
50
|
-
private _preSelected;
|
|
51
|
-
private _refreshMatchFilter;
|
|
52
|
-
private readonly applyFilterMethod;
|
|
53
|
-
constructor(rootRemoteMethod: Method<Data | Data[], RootParameters>, childrenRemoteMethod?: Method<Data[], Node<Data>> | null, applyFilterMethod?: Method<Array<Node<Data>>, TreeApplyFilterParameter> | null, metadata?: TreeDataSourceMetadata | null);
|
|
54
|
-
private _nodeParameters;
|
|
55
|
-
get nodeParameters(): NodeParameters | null;
|
|
56
|
-
set nodeParameters(nodeParameters: NodeParameters | null);
|
|
57
|
-
ngOnInit(): void;
|
|
58
|
-
toDisplay: NodeToDisplayFunction<Data>;
|
|
59
|
-
getIcon: NodeGetIconFunction<Data>;
|
|
60
|
-
getType: NodeGetTypeFunction<Data>;
|
|
61
|
-
getStyle: NodeGetStyleFunction<Data>;
|
|
62
|
-
hasDetails: NodeHasDetailsFunction<Data>;
|
|
63
|
-
matchFilter: (node: Node<Data>) => boolean;
|
|
64
|
-
getTreeRoot(options?: {
|
|
65
|
-
cache?: boolean;
|
|
66
|
-
}): Promise<Array<Node<Data>>>;
|
|
67
|
-
selectNode(node: Node<Data>): Promise<void>;
|
|
68
|
-
setTreeControl(treeControl: FlatTreeControl<Node<Data>>): void;
|
|
69
|
-
setMatchFilter(matchFilter: (node: Node<Data>) => boolean): void;
|
|
70
|
-
setToDisplay(toDisplay?: NodeToDisplayFunction<Data>): void;
|
|
71
|
-
setGetIcon(getIcon?: NodeGetIconFunction<Data>): void;
|
|
72
|
-
setHasDetails(hasDetails?: NodeHasDetailsFunction<Data>): void;
|
|
73
|
-
deselectNode(node: Node<Data>): Promise<void>;
|
|
74
|
-
expandNode(node: Node<Data>, options?: EventOptions): Promise<void>;
|
|
75
|
-
getChildren(node: Node<Data>): Promise<Data[]>;
|
|
76
|
-
getRoot(options?: {
|
|
77
|
-
cache?: boolean;
|
|
78
|
-
}): Promise<Data | Data[]>;
|
|
79
|
-
getRootParameters(options?: {
|
|
80
|
-
cache?: boolean;
|
|
81
|
-
}): Promise<RootParameters>;
|
|
82
|
-
getNodeById(id: string): Node<Data> | null;
|
|
83
|
-
toNode(parent: Node<Data> | null, item: Data, depth?: number, onExpand?: ExpandNodeFunction<Data>, onCollapse?: ExpandNodeFunction<Data>, onSelect?: ExpandNodeFunction<Data>, onDeselect?: ExpandNodeFunction<Data>): Promise<Node<Data>>;
|
|
84
|
-
collapseNode(node: Node<Data>, options?: EventOptions): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Converts the tree structure into a list.
|
|
87
|
-
*
|
|
88
|
-
* @param tree
|
|
89
|
-
* @param all true - include nodes children that are not expanded
|
|
90
|
-
*/
|
|
91
|
-
flatTree(tree: Node<Data>, all?: boolean): Array<Node<Data>>;
|
|
92
|
-
destroy(): void;
|
|
93
|
-
refreshMatchFilter(): void;
|
|
94
|
-
refresh(): Promise<any>;
|
|
95
|
-
reset(): any;
|
|
96
|
-
setGetStyle(getStyle?: NodeGetStyleFunction<any>): void;
|
|
97
|
-
setGetType(getType?: NodeGetTypeFunction<any>): void;
|
|
98
|
-
/**
|
|
99
|
-
* recall the getStyle, getIcon and toDisplay methods
|
|
100
|
-
* and update the node objects
|
|
101
|
-
*/
|
|
102
|
-
updateNodes(): void;
|
|
103
|
-
protected _connect(collectionViewer: Required<BaseDataSourceViewer>): Observable<Array<Node<Data>>>;
|
|
104
|
-
private initSelected;
|
|
105
|
-
private initExpanded;
|
|
106
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TreeDataSource<any, any, any>, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
107
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TreeDataSource<any, any, any>>;
|
|
108
|
-
}
|