@tectra-ng/ui 0.1.1 → 0.1.2
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/country/README.md +14 -4
- package/data-view/README.md +71 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chip.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country.mjs +47 -6
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-data-view.mjs +1370 -0
- package/fesm2022/tectra-ng-ui-data-view.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +2 -2
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-number.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menu.mjs +2 -2
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-message.mjs +2 -2
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-paginator.mjs +2 -2
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-select.mjs +4 -4
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-slider.mjs +2 -2
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +1373 -1333
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tag.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +2 -2
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-select.mjs +7 -46
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +901 -0
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree.mjs +1940 -0
- package/fesm2022/tectra-ng-ui-tree.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +928 -0
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs.map +1 -0
- package/package.json +17 -1
- package/tree/README.md +93 -0
- package/tree-table/README.md +84 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +11 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -1
- package/types/tectra-ng-ui-chip.d.ts +3 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -1
- package/types/tectra-ng-ui-country-select.d.ts +11 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +9 -3
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-data-view.d.ts +363 -0
- package/types/tectra-ng-ui-data-view.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +8 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -1
- package/types/tectra-ng-ui-input-number.d.ts +1 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -1
- package/types/tectra-ng-ui-input.d.ts +4 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-menu.d.ts +2 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +5 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-multiselect.d.ts +11 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -1
- package/types/tectra-ng-ui-paginator.d.ts +1 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +11 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-slider.d.ts +1 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -1
- package/types/tectra-ng-ui-table.d.ts +181 -15
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tag.d.ts +8 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -1
- package/types/tectra-ng-ui-toggle-switch.d.ts +5 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +19 -22
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-table.d.ts +94 -0
- package/types/tectra-ng-ui-tree-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree.d.ts +571 -0
- package/types/tectra-ng-ui-tree.d.ts.map +1 -0
- package/types/tectra-ng-ui-virtual-scroller.d.ts +297 -0
- package/types/tectra-ng-ui-virtual-scroller.d.ts.map +1 -0
- package/virtual-scroller/README.md +60 -0
|
@@ -0,0 +1,1940 @@
|
|
|
1
|
+
import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, Injector, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, linkedSignal, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
|
|
4
|
+
import { TxTypeahead, uniqueId } from "@tectra-ng/core/a11y";
|
|
5
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
7
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
8
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
9
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
import { TxIconField, TxInputIcon } from "@tectra-ng/ui/icon-field";
|
|
11
|
+
import { TxInput } from "@tectra-ng/ui/input";
|
|
12
|
+
import { TxMenu } from "@tectra-ng/ui/menu";
|
|
13
|
+
import { foldText, readOptionField } from "@tectra-ng/ui/select";
|
|
14
|
+
var TxTreeDragService = class TxTreeDragService {
|
|
15
|
+
state = signal(null, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
16
|
+
start(state) {
|
|
17
|
+
this.state.set(state);
|
|
18
|
+
}
|
|
19
|
+
stop() {
|
|
20
|
+
this.state.set(null);
|
|
21
|
+
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
23
|
+
minVersion: "12.0.0",
|
|
24
|
+
version: "22.2.3",
|
|
25
|
+
ngImport: i0,
|
|
26
|
+
type: TxTreeDragService,
|
|
27
|
+
deps: [],
|
|
28
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
29
|
+
});
|
|
30
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: TxTreeDragService,
|
|
35
|
+
providedIn: "root"
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: TxTreeDragService,
|
|
43
|
+
decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{ providedIn: "root" }]
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
var TxTreeNodeTemplate = class TxTreeNodeTemplate {
|
|
49
|
+
templateRef = inject(TemplateRef);
|
|
50
|
+
txTreeNode = input("", ...ngDevMode ? [{ debugName: "txTreeNode" }] : /* istanbul ignore next */ []);
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
52
|
+
minVersion: "12.0.0",
|
|
53
|
+
version: "22.2.3",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: TxTreeNodeTemplate,
|
|
56
|
+
deps: [],
|
|
57
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
58
|
+
});
|
|
59
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
60
|
+
minVersion: "17.1.0",
|
|
61
|
+
version: "22.2.3",
|
|
62
|
+
type: TxTreeNodeTemplate,
|
|
63
|
+
isStandalone: true,
|
|
64
|
+
selector: "ng-template[txTreeNode]",
|
|
65
|
+
inputs: { txTreeNode: {
|
|
66
|
+
classPropertyName: "txTreeNode",
|
|
67
|
+
publicName: "txTreeNode",
|
|
68
|
+
isSignal: true,
|
|
69
|
+
isRequired: false,
|
|
70
|
+
transformFunction: null
|
|
71
|
+
} },
|
|
72
|
+
ngImport: i0
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
76
|
+
minVersion: "12.0.0",
|
|
77
|
+
version: "22.2.3",
|
|
78
|
+
ngImport: i0,
|
|
79
|
+
type: TxTreeNodeTemplate,
|
|
80
|
+
decorators: [{
|
|
81
|
+
type: Directive,
|
|
82
|
+
args: [{ selector: "ng-template[txTreeNode]" }]
|
|
83
|
+
}],
|
|
84
|
+
propDecorators: { txTreeNode: [{
|
|
85
|
+
type: i0.Input,
|
|
86
|
+
args: [{
|
|
87
|
+
isSignal: true,
|
|
88
|
+
alias: "txTreeNode",
|
|
89
|
+
required: false
|
|
90
|
+
}]
|
|
91
|
+
}] }
|
|
92
|
+
});
|
|
93
|
+
var TxTreeHeader = class TxTreeHeader {
|
|
94
|
+
templateRef = inject(TemplateRef);
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
96
|
+
minVersion: "12.0.0",
|
|
97
|
+
version: "22.2.3",
|
|
98
|
+
ngImport: i0,
|
|
99
|
+
type: TxTreeHeader,
|
|
100
|
+
deps: [],
|
|
101
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
102
|
+
});
|
|
103
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
104
|
+
minVersion: "14.0.0",
|
|
105
|
+
version: "22.2.3",
|
|
106
|
+
type: TxTreeHeader,
|
|
107
|
+
isStandalone: true,
|
|
108
|
+
selector: "ng-template[txTreeHeader]",
|
|
109
|
+
ngImport: i0
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
113
|
+
minVersion: "12.0.0",
|
|
114
|
+
version: "22.2.3",
|
|
115
|
+
ngImport: i0,
|
|
116
|
+
type: TxTreeHeader,
|
|
117
|
+
decorators: [{
|
|
118
|
+
type: Directive,
|
|
119
|
+
args: [{ selector: "ng-template[txTreeHeader]" }]
|
|
120
|
+
}]
|
|
121
|
+
});
|
|
122
|
+
var TxTreeFooter = class TxTreeFooter {
|
|
123
|
+
templateRef = inject(TemplateRef);
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
125
|
+
minVersion: "12.0.0",
|
|
126
|
+
version: "22.2.3",
|
|
127
|
+
ngImport: i0,
|
|
128
|
+
type: TxTreeFooter,
|
|
129
|
+
deps: [],
|
|
130
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
131
|
+
});
|
|
132
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
133
|
+
minVersion: "14.0.0",
|
|
134
|
+
version: "22.2.3",
|
|
135
|
+
type: TxTreeFooter,
|
|
136
|
+
isStandalone: true,
|
|
137
|
+
selector: "ng-template[txTreeFooter]",
|
|
138
|
+
ngImport: i0
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
142
|
+
minVersion: "12.0.0",
|
|
143
|
+
version: "22.2.3",
|
|
144
|
+
ngImport: i0,
|
|
145
|
+
type: TxTreeFooter,
|
|
146
|
+
decorators: [{
|
|
147
|
+
type: Directive,
|
|
148
|
+
args: [{ selector: "ng-template[txTreeFooter]" }]
|
|
149
|
+
}]
|
|
150
|
+
});
|
|
151
|
+
var TxTreeEmpty = class TxTreeEmpty {
|
|
152
|
+
templateRef = inject(TemplateRef);
|
|
153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
154
|
+
minVersion: "12.0.0",
|
|
155
|
+
version: "22.2.3",
|
|
156
|
+
ngImport: i0,
|
|
157
|
+
type: TxTreeEmpty,
|
|
158
|
+
deps: [],
|
|
159
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
160
|
+
});
|
|
161
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
162
|
+
minVersion: "14.0.0",
|
|
163
|
+
version: "22.2.3",
|
|
164
|
+
type: TxTreeEmpty,
|
|
165
|
+
isStandalone: true,
|
|
166
|
+
selector: "ng-template[txTreeEmpty]",
|
|
167
|
+
ngImport: i0
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
171
|
+
minVersion: "12.0.0",
|
|
172
|
+
version: "22.2.3",
|
|
173
|
+
ngImport: i0,
|
|
174
|
+
type: TxTreeEmpty,
|
|
175
|
+
decorators: [{
|
|
176
|
+
type: Directive,
|
|
177
|
+
args: [{ selector: "ng-template[txTreeEmpty]" }]
|
|
178
|
+
}]
|
|
179
|
+
});
|
|
180
|
+
var TxTreeLoading = class TxTreeLoading {
|
|
181
|
+
templateRef = inject(TemplateRef);
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
183
|
+
minVersion: "12.0.0",
|
|
184
|
+
version: "22.2.3",
|
|
185
|
+
ngImport: i0,
|
|
186
|
+
type: TxTreeLoading,
|
|
187
|
+
deps: [],
|
|
188
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
189
|
+
});
|
|
190
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
191
|
+
minVersion: "14.0.0",
|
|
192
|
+
version: "22.2.3",
|
|
193
|
+
type: TxTreeLoading,
|
|
194
|
+
isStandalone: true,
|
|
195
|
+
selector: "ng-template[txTreeLoading]",
|
|
196
|
+
ngImport: i0
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
200
|
+
minVersion: "12.0.0",
|
|
201
|
+
version: "22.2.3",
|
|
202
|
+
ngImport: i0,
|
|
203
|
+
type: TxTreeLoading,
|
|
204
|
+
decorators: [{
|
|
205
|
+
type: Directive,
|
|
206
|
+
args: [{ selector: "ng-template[txTreeLoading]" }]
|
|
207
|
+
}]
|
|
208
|
+
});
|
|
209
|
+
var TxTreeFilter = class TxTreeFilter {
|
|
210
|
+
templateRef = inject(TemplateRef);
|
|
211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
212
|
+
minVersion: "12.0.0",
|
|
213
|
+
version: "22.2.3",
|
|
214
|
+
ngImport: i0,
|
|
215
|
+
type: TxTreeFilter,
|
|
216
|
+
deps: [],
|
|
217
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
218
|
+
});
|
|
219
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
220
|
+
minVersion: "14.0.0",
|
|
221
|
+
version: "22.2.3",
|
|
222
|
+
type: TxTreeFilter,
|
|
223
|
+
isStandalone: true,
|
|
224
|
+
selector: "ng-template[txTreeFilter]",
|
|
225
|
+
ngImport: i0
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
229
|
+
minVersion: "12.0.0",
|
|
230
|
+
version: "22.2.3",
|
|
231
|
+
ngImport: i0,
|
|
232
|
+
type: TxTreeFilter,
|
|
233
|
+
decorators: [{
|
|
234
|
+
type: Directive,
|
|
235
|
+
args: [{ selector: "ng-template[txTreeFilter]" }]
|
|
236
|
+
}]
|
|
237
|
+
});
|
|
238
|
+
var TxTreeToggleIcon = class TxTreeToggleIcon {
|
|
239
|
+
templateRef = inject(TemplateRef);
|
|
240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
241
|
+
minVersion: "12.0.0",
|
|
242
|
+
version: "22.2.3",
|
|
243
|
+
ngImport: i0,
|
|
244
|
+
type: TxTreeToggleIcon,
|
|
245
|
+
deps: [],
|
|
246
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
247
|
+
});
|
|
248
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
249
|
+
minVersion: "14.0.0",
|
|
250
|
+
version: "22.2.3",
|
|
251
|
+
type: TxTreeToggleIcon,
|
|
252
|
+
isStandalone: true,
|
|
253
|
+
selector: "ng-template[txTreeToggleIcon]",
|
|
254
|
+
ngImport: i0
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
258
|
+
minVersion: "12.0.0",
|
|
259
|
+
version: "22.2.3",
|
|
260
|
+
ngImport: i0,
|
|
261
|
+
type: TxTreeToggleIcon,
|
|
262
|
+
decorators: [{
|
|
263
|
+
type: Directive,
|
|
264
|
+
args: [{ selector: "ng-template[txTreeToggleIcon]" }]
|
|
265
|
+
}]
|
|
266
|
+
});
|
|
267
|
+
var TxTreeCheckboxIcon = class TxTreeCheckboxIcon {
|
|
268
|
+
templateRef = inject(TemplateRef);
|
|
269
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
270
|
+
minVersion: "12.0.0",
|
|
271
|
+
version: "22.2.3",
|
|
272
|
+
ngImport: i0,
|
|
273
|
+
type: TxTreeCheckboxIcon,
|
|
274
|
+
deps: [],
|
|
275
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
276
|
+
});
|
|
277
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
278
|
+
minVersion: "14.0.0",
|
|
279
|
+
version: "22.2.3",
|
|
280
|
+
type: TxTreeCheckboxIcon,
|
|
281
|
+
isStandalone: true,
|
|
282
|
+
selector: "ng-template[txTreeCheckboxIcon]",
|
|
283
|
+
ngImport: i0
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
287
|
+
minVersion: "12.0.0",
|
|
288
|
+
version: "22.2.3",
|
|
289
|
+
ngImport: i0,
|
|
290
|
+
type: TxTreeCheckboxIcon,
|
|
291
|
+
decorators: [{
|
|
292
|
+
type: Directive,
|
|
293
|
+
args: [{ selector: "ng-template[txTreeCheckboxIcon]" }]
|
|
294
|
+
}]
|
|
295
|
+
});
|
|
296
|
+
function walkTree(nodes, visit, parent = null) {
|
|
297
|
+
for (const node of nodes) {
|
|
298
|
+
visit(node, parent);
|
|
299
|
+
walkTree(node.children ?? [], visit, node);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function findNode(nodes, key) {
|
|
303
|
+
let found = null;
|
|
304
|
+
walkTree(nodes, (node) => {
|
|
305
|
+
if (!found && node.key === key) found = node;
|
|
306
|
+
});
|
|
307
|
+
return found;
|
|
308
|
+
}
|
|
309
|
+
function descendantKeys(node) {
|
|
310
|
+
const keys = [];
|
|
311
|
+
walkTree(node.children ?? [], (child) => {
|
|
312
|
+
if (!child.disabled && child.selectable !== false) keys.push(child.key);
|
|
313
|
+
});
|
|
314
|
+
return keys;
|
|
315
|
+
}
|
|
316
|
+
function parentMap(nodes) {
|
|
317
|
+
const parents = /* @__PURE__ */ new Map();
|
|
318
|
+
walkTree(nodes, (node, parent) => parents.set(node.key, parent));
|
|
319
|
+
return parents;
|
|
320
|
+
}
|
|
321
|
+
function normalizeChecked(nodes, keys) {
|
|
322
|
+
const checked = new Set(keys);
|
|
323
|
+
const settle = (node) => {
|
|
324
|
+
const children = (node.children ?? []).filter((child) => !child.disabled && child.selectable !== false);
|
|
325
|
+
if (!children.length) return checked.has(node.key);
|
|
326
|
+
const all = children.map(settle).every(Boolean);
|
|
327
|
+
if (all) checked.add(node.key);
|
|
328
|
+
else checked.delete(node.key);
|
|
329
|
+
return all;
|
|
330
|
+
};
|
|
331
|
+
nodes.forEach(settle);
|
|
332
|
+
const order = [];
|
|
333
|
+
walkTree(nodes, (node) => checked.has(node.key) && order.push(node.key));
|
|
334
|
+
return order;
|
|
335
|
+
}
|
|
336
|
+
function isLeafNode(node) {
|
|
337
|
+
return node.leaf === false ? false : !node.children?.length;
|
|
338
|
+
}
|
|
339
|
+
function nodeMatches(node, query, fields) {
|
|
340
|
+
return fields.some((field) => foldText(String(readOptionField(node, field) ?? "")).includes(query));
|
|
341
|
+
}
|
|
342
|
+
function filterTree(nodes, query, fields, mode = "lenient") {
|
|
343
|
+
const folded = foldText(query.trim());
|
|
344
|
+
if (!folded) return [...nodes];
|
|
345
|
+
const visit = (node) => {
|
|
346
|
+
const own = nodeMatches(node, folded, fields);
|
|
347
|
+
const children = node.children ?? [];
|
|
348
|
+
if (own && (mode === "lenient" || !children.length)) return node;
|
|
349
|
+
const kept = children.map(visit).filter((child) => child !== null);
|
|
350
|
+
if (kept.length) return {
|
|
351
|
+
...node,
|
|
352
|
+
children: kept
|
|
353
|
+
};
|
|
354
|
+
return own ? {
|
|
355
|
+
...node,
|
|
356
|
+
children: []
|
|
357
|
+
} : null;
|
|
358
|
+
};
|
|
359
|
+
return nodes.map(visit).filter((node) => node !== null);
|
|
360
|
+
}
|
|
361
|
+
function branchKeys(nodes) {
|
|
362
|
+
const keys = [];
|
|
363
|
+
walkTree(nodes, (node) => {
|
|
364
|
+
if (node.children?.length) keys.push(node.key);
|
|
365
|
+
});
|
|
366
|
+
return keys;
|
|
367
|
+
}
|
|
368
|
+
function isDescendantOf(nodes, ancestorKey, key) {
|
|
369
|
+
const ancestor = findNode(nodes, ancestorKey);
|
|
370
|
+
if (!ancestor) return false;
|
|
371
|
+
let found = false;
|
|
372
|
+
walkTree(ancestor.children ?? [], (node) => {
|
|
373
|
+
if (node.key === key) found = true;
|
|
374
|
+
});
|
|
375
|
+
return found;
|
|
376
|
+
}
|
|
377
|
+
function removeNode(nodes, key) {
|
|
378
|
+
return nodes.filter((node) => node.key !== key).map((node) => {
|
|
379
|
+
if (!node.children?.length) return node;
|
|
380
|
+
const children = removeNode(node.children, key);
|
|
381
|
+
return children.length === node.children.length && children.every((child, index) => child === node.children?.[index]) ? node : {
|
|
382
|
+
...node,
|
|
383
|
+
children
|
|
384
|
+
};
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function insertNode(nodes, node, targetKey, position) {
|
|
388
|
+
if (targetKey === null) return [...nodes, node];
|
|
389
|
+
const index = nodes.findIndex((item) => item.key === targetKey);
|
|
390
|
+
if (index >= 0) {
|
|
391
|
+
if (position === "inside") {
|
|
392
|
+
const target = nodes[index];
|
|
393
|
+
const result = [...nodes];
|
|
394
|
+
result[index] = {
|
|
395
|
+
...target,
|
|
396
|
+
children: [...target.children ?? [], node]
|
|
397
|
+
};
|
|
398
|
+
return result;
|
|
399
|
+
}
|
|
400
|
+
const result = [...nodes];
|
|
401
|
+
result.splice(position === "before" ? index : index + 1, 0, node);
|
|
402
|
+
return result;
|
|
403
|
+
}
|
|
404
|
+
return nodes.map((item) => item.children?.length ? {
|
|
405
|
+
...item,
|
|
406
|
+
children: insertNode(item.children, node, targetKey, position)
|
|
407
|
+
} : item);
|
|
408
|
+
}
|
|
409
|
+
function moveNode(nodes, key, targetKey, position) {
|
|
410
|
+
const node = findNode(nodes, key);
|
|
411
|
+
if (!node || key === targetKey || targetKey !== null && isDescendantOf(nodes, key, targetKey)) return [...nodes];
|
|
412
|
+
return insertNode(removeNode(nodes, key), node, targetKey, position);
|
|
413
|
+
}
|
|
414
|
+
function siblingsOf(nodes, key) {
|
|
415
|
+
const parent = parentMap(nodes).get(key);
|
|
416
|
+
return parent ? parent.children ?? [] : nodes;
|
|
417
|
+
}
|
|
418
|
+
function scopesMatch(dragScope, dropScope) {
|
|
419
|
+
if (dropScope === null || dropScope === void 0) return true;
|
|
420
|
+
if (dragScope === null || dragScope === void 0) return false;
|
|
421
|
+
const drag = typeof dragScope === "string" ? [dragScope] : dragScope;
|
|
422
|
+
const drop = typeof dropScope === "string" ? [dropScope] : dropScope;
|
|
423
|
+
return drag.some((scope) => drop.includes(scope));
|
|
424
|
+
}
|
|
425
|
+
var TxTree = class TxTree {
|
|
426
|
+
value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
427
|
+
selectionMode = input(void 0, ...ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []);
|
|
428
|
+
selection = model(null, ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
|
|
429
|
+
expandedKeys = model([], ...ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []);
|
|
430
|
+
metaKeySelection = input(false, {
|
|
431
|
+
...ngDevMode ? { debugName: "metaKeySelection" } : /* istanbul ignore next */ {},
|
|
432
|
+
transform: booleanAttribute
|
|
433
|
+
});
|
|
434
|
+
propagateSelectionUp = input(true, {
|
|
435
|
+
...ngDevMode ? { debugName: "propagateSelectionUp" } : /* istanbul ignore next */ {},
|
|
436
|
+
transform: booleanAttribute
|
|
437
|
+
});
|
|
438
|
+
propagateSelectionDown = input(true, {
|
|
439
|
+
...ngDevMode ? { debugName: "propagateSelectionDown" } : /* istanbul ignore next */ {},
|
|
440
|
+
transform: booleanAttribute
|
|
441
|
+
});
|
|
442
|
+
highlightOnSelect = input(false, {
|
|
443
|
+
...ngDevMode ? { debugName: "highlightOnSelect" } : /* istanbul ignore next */ {},
|
|
444
|
+
transform: booleanAttribute
|
|
445
|
+
});
|
|
446
|
+
contextMenu = input(void 0, ...ngDevMode ? [{ debugName: "contextMenu" }] : /* istanbul ignore next */ []);
|
|
447
|
+
contextMenuSelection = model(null, ...ngDevMode ? [{ debugName: "contextMenuSelection" }] : /* istanbul ignore next */ []);
|
|
448
|
+
draggableNodes = input(false, {
|
|
449
|
+
...ngDevMode ? { debugName: "draggableNodes" } : /* istanbul ignore next */ {},
|
|
450
|
+
transform: booleanAttribute
|
|
451
|
+
});
|
|
452
|
+
droppableNodes = input(false, {
|
|
453
|
+
...ngDevMode ? { debugName: "droppableNodes" } : /* istanbul ignore next */ {},
|
|
454
|
+
transform: booleanAttribute
|
|
455
|
+
});
|
|
456
|
+
draggableScope = input(void 0, ...ngDevMode ? [{ debugName: "draggableScope" }] : /* istanbul ignore next */ []);
|
|
457
|
+
droppableScope = input(void 0, ...ngDevMode ? [{ debugName: "droppableScope" }] : /* istanbul ignore next */ []);
|
|
458
|
+
validateDrop = input(false, {
|
|
459
|
+
...ngDevMode ? { debugName: "validateDrop" } : /* istanbul ignore next */ {},
|
|
460
|
+
transform: booleanAttribute
|
|
461
|
+
});
|
|
462
|
+
loading = input(false, {
|
|
463
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
464
|
+
transform: booleanAttribute
|
|
465
|
+
});
|
|
466
|
+
loadingMode = input("mask", ...ngDevMode ? [{ debugName: "loadingMode" }] : /* istanbul ignore next */ []);
|
|
467
|
+
loadingIcon = input("spinner", ...ngDevMode ? [{ debugName: "loadingIcon" }] : /* istanbul ignore next */ []);
|
|
468
|
+
emptyMessage = input(void 0, ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
|
|
469
|
+
filter = input(false, {
|
|
470
|
+
...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
|
|
471
|
+
transform: booleanAttribute
|
|
472
|
+
});
|
|
473
|
+
filterBy = input("label", ...ngDevMode ? [{ debugName: "filterBy" }] : /* istanbul ignore next */ []);
|
|
474
|
+
filterMode = input("lenient", ...ngDevMode ? [{ debugName: "filterMode" }] : /* istanbul ignore next */ []);
|
|
475
|
+
filterPlaceholder = input(void 0, ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
|
|
476
|
+
filterInputAutoFocus = input(false, {
|
|
477
|
+
...ngDevMode ? { debugName: "filterInputAutoFocus" } : /* istanbul ignore next */ {},
|
|
478
|
+
transform: booleanAttribute
|
|
479
|
+
});
|
|
480
|
+
scrollHeight = input(void 0, ...ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
|
|
481
|
+
virtualScroll = input(false, {
|
|
482
|
+
...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
|
|
483
|
+
transform: booleanAttribute
|
|
484
|
+
});
|
|
485
|
+
virtualScrollItemSize = input(30, {
|
|
486
|
+
...ngDevMode ? { debugName: "virtualScrollItemSize" } : /* istanbul ignore next */ {},
|
|
487
|
+
transform: numberAttribute
|
|
488
|
+
});
|
|
489
|
+
virtualScrollTolerance = input(10, {
|
|
490
|
+
...ngDevMode ? { debugName: "virtualScrollTolerance" } : /* istanbul ignore next */ {},
|
|
491
|
+
transform: numberAttribute
|
|
492
|
+
});
|
|
493
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
494
|
+
ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
495
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
496
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
497
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
498
|
+
unstyled = input(void 0, {
|
|
499
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
500
|
+
transform: optionalBoolean
|
|
501
|
+
});
|
|
502
|
+
nodeSelect = output();
|
|
503
|
+
nodeUnselect = output();
|
|
504
|
+
nodeExpand = output();
|
|
505
|
+
nodeCollapse = output();
|
|
506
|
+
nodeContextMenuSelect = output();
|
|
507
|
+
nodeDoubleClick = output();
|
|
508
|
+
nodeDrop = output();
|
|
509
|
+
filtered = output();
|
|
510
|
+
nodeTemplates = contentChildren(TxTreeNodeTemplate, ...ngDevMode ? [{ debugName: "nodeTemplates" }] : /* istanbul ignore next */ []);
|
|
511
|
+
headerTemplate = contentChild(TxTreeHeader, ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
|
|
512
|
+
footerTemplate = contentChild(TxTreeFooter, ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
|
|
513
|
+
emptyTemplate = contentChild(TxTreeEmpty, ...ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []);
|
|
514
|
+
loadingTemplate = contentChild(TxTreeLoading, ...ngDevMode ? [{ debugName: "loadingTemplate" }] : /* istanbul ignore next */ []);
|
|
515
|
+
filterTemplate = contentChild(TxTreeFilter, ...ngDevMode ? [{ debugName: "filterTemplate" }] : /* istanbul ignore next */ []);
|
|
516
|
+
toggleIconTemplate = contentChild(TxTreeToggleIcon, ...ngDevMode ? [{ debugName: "toggleIconTemplate" }] : /* istanbul ignore next */ []);
|
|
517
|
+
checkboxIconTemplate = contentChild(TxTreeCheckboxIcon, ...ngDevMode ? [{ debugName: "checkboxIconTemplate" }] : /* istanbul ignore next */ []);
|
|
518
|
+
document = inject(DOCUMENT);
|
|
519
|
+
host = inject(ElementRef);
|
|
520
|
+
injector = inject(Injector);
|
|
521
|
+
dragService = inject(TxTreeDragService);
|
|
522
|
+
typeahead = new TxTypeahead();
|
|
523
|
+
menu = viewChild("nodeMenu", ...ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []);
|
|
524
|
+
wrapper = viewChild("wrapper", ...ngDevMode ? [{ debugName: "wrapper" }] : /* istanbul ignore next */ []);
|
|
525
|
+
filterInput = viewChild("filterInput", ...ngDevMode ? [{ debugName: "filterInput" }] : /* istanbul ignore next */ []);
|
|
526
|
+
seenKeys = /* @__PURE__ */ new Set();
|
|
527
|
+
anchor = null;
|
|
528
|
+
translations = injectTranslations();
|
|
529
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
530
|
+
passThrough = injectPassThrough("tree", this, this.pt, this.ptOptions);
|
|
531
|
+
hostStyle = computed(() => ({
|
|
532
|
+
...toStyleObject(this.dt(), "--tx-tree"),
|
|
533
|
+
...this.passThrough().root?.style
|
|
534
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
535
|
+
treeId = uniqueId("tx-tree");
|
|
536
|
+
query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
537
|
+
focusedKey = signal(null, ...ngDevMode ? [{ debugName: "focusedKey" }] : /* istanbul ignore next */ []);
|
|
538
|
+
pendingKeys = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "pendingKeys" }] : /* istanbul ignore next */ []);
|
|
539
|
+
mountedKeys = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "mountedKeys" }] : /* istanbul ignore next */ []);
|
|
540
|
+
draggingKey = signal(null, ...ngDevMode ? [{ debugName: "draggingKey" }] : /* istanbul ignore next */ []);
|
|
541
|
+
dropTarget = signal(null, ...ngDevMode ? [{ debugName: "dropTarget" }] : /* istanbul ignore next */ []);
|
|
542
|
+
menuOpen = signal(false, ...ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []);
|
|
543
|
+
menuItems = signal([], ...ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []);
|
|
544
|
+
scrollTop = signal(0, ...ngDevMode ? [{ debugName: "scrollTop" }] : /* istanbul ignore next */ []);
|
|
545
|
+
viewportHeight = signal(0, ...ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []);
|
|
546
|
+
filtering = computed(() => this.filter() && this.query().trim().length > 0, ...ngDevMode ? [{ debugName: "filtering" }] : /* istanbul ignore next */ []);
|
|
547
|
+
filterFields = computed(() => this.filterBy().split(",").map((field) => field.trim()).filter(Boolean), ...ngDevMode ? [{ debugName: "filterFields" }] : /* istanbul ignore next */ []);
|
|
548
|
+
filteredValue = computed(() => this.filtering() ? filterTree(this.value(), this.query(), this.filterFields(), this.filterMode()) : this.value(), ...ngDevMode ? [{ debugName: "filteredValue" }] : /* istanbul ignore next */ []);
|
|
549
|
+
filterExpanded = linkedSignal(() => new Set(this.filtering() ? branchKeys(this.filteredValue()) : []), ...ngDevMode ? [{ debugName: "filterExpanded" }] : /* istanbul ignore next */ []);
|
|
550
|
+
expandedSet = computed(() => this.filtering() ? this.filterExpanded() : new Set(this.expandedKeys()), ...ngDevMode ? [{ debugName: "expandedSet" }] : /* istanbul ignore next */ []);
|
|
551
|
+
selectedKeys = computed(() => {
|
|
552
|
+
const selection = this.selection();
|
|
553
|
+
if (!selection) return /* @__PURE__ */ new Set();
|
|
554
|
+
return new Set((Array.isArray(selection) ? selection : [selection]).map((node) => node.key));
|
|
555
|
+
}, ...ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []);
|
|
556
|
+
templatesByType = computed(() => new Map(this.nodeTemplates().map((template) => [template.txTreeNode(), template.templateRef])), ...ngDevMode ? [{ debugName: "templatesByType" }] : /* istanbul ignore next */ []);
|
|
557
|
+
multiselectable = computed(() => this.selectionMode() === "multiple" || this.selectionMode() === "checkbox", ...ngDevMode ? [{ debugName: "multiselectable" }] : /* istanbul ignore next */ []);
|
|
558
|
+
checkboxMode = computed(() => this.selectionMode() === "checkbox", ...ngDevMode ? [{ debugName: "checkboxMode" }] : /* istanbul ignore next */ []);
|
|
559
|
+
tree = computed(() => {
|
|
560
|
+
const expanded = this.expandedSet();
|
|
561
|
+
const mounted = this.virtualScroll() ? /* @__PURE__ */ new Set() : this.mountedKeys();
|
|
562
|
+
const selected = this.selectedKeys();
|
|
563
|
+
const pending = this.pendingKeys();
|
|
564
|
+
const checkbox = this.checkboxMode();
|
|
565
|
+
const up = this.propagateSelectionUp();
|
|
566
|
+
const draggable = this.draggableNodes();
|
|
567
|
+
const build = (nodes, level, parentKey) => nodes.map((node, index) => {
|
|
568
|
+
const leaf = isLeafNode(node);
|
|
569
|
+
const open = !leaf && expanded.has(node.key);
|
|
570
|
+
const children = (open || mounted.has(node.key)) && node.children?.length ? build(node.children, level + 1, node.key) : [];
|
|
571
|
+
const checked = selected.has(node.key);
|
|
572
|
+
const icon = (open ? node.expandedIcon : node.collapsedIcon) ?? node.icon ?? null;
|
|
573
|
+
return {
|
|
574
|
+
id: `${this.treeId}-${node.key}`,
|
|
575
|
+
node,
|
|
576
|
+
level,
|
|
577
|
+
setSize: nodes.length,
|
|
578
|
+
posInSet: index + 1,
|
|
579
|
+
parentKey,
|
|
580
|
+
leaf,
|
|
581
|
+
expanded: open,
|
|
582
|
+
loading: !!node.loading || pending.has(node.key) && node.children === void 0,
|
|
583
|
+
selected: checked,
|
|
584
|
+
checked,
|
|
585
|
+
partial: checkbox && up && !checked && this.hasCheckedDescendant(node, selected),
|
|
586
|
+
selectable: !!this.selectionMode() && !node.disabled && node.selectable !== false,
|
|
587
|
+
draggable: draggable && !node.disabled && node.draggable !== false,
|
|
588
|
+
icon,
|
|
589
|
+
children
|
|
590
|
+
};
|
|
591
|
+
});
|
|
592
|
+
return build(this.filteredValue(), 1, null);
|
|
593
|
+
}, ...ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []);
|
|
594
|
+
rows = computed(() => {
|
|
595
|
+
const rows = [];
|
|
596
|
+
const walk = (items) => items.forEach((item) => {
|
|
597
|
+
rows.push(item);
|
|
598
|
+
if (item.expanded) walk(item.children);
|
|
599
|
+
});
|
|
600
|
+
walk(this.tree());
|
|
601
|
+
return rows;
|
|
602
|
+
}, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
603
|
+
tabKey = computed(() => {
|
|
604
|
+
const rows = this.rows();
|
|
605
|
+
const focused = this.focusedKey();
|
|
606
|
+
if (focused && rows.some((row) => row.node.key === focused)) return focused;
|
|
607
|
+
return (rows.find((row) => row.selected) ?? rows[0])?.node.key ?? null;
|
|
608
|
+
}, ...ngDevMode ? [{ debugName: "tabKey" }] : /* istanbul ignore next */ []);
|
|
609
|
+
windowRange = computed(() => {
|
|
610
|
+
const count = this.rows().length;
|
|
611
|
+
if (!this.virtualScroll()) return {
|
|
612
|
+
start: 0,
|
|
613
|
+
end: count
|
|
614
|
+
};
|
|
615
|
+
const size = this.virtualScrollItemSize();
|
|
616
|
+
const tolerance = this.virtualScrollTolerance();
|
|
617
|
+
const viewport = this.viewportHeight() || size * 10;
|
|
618
|
+
return {
|
|
619
|
+
start: Math.max(0, Math.floor(this.scrollTop() / size) - tolerance),
|
|
620
|
+
end: Math.min(count, Math.ceil((this.scrollTop() + viewport) / size) + tolerance)
|
|
621
|
+
};
|
|
622
|
+
}, ...ngDevMode ? [{ debugName: "windowRange" }] : /* istanbul ignore next */ []);
|
|
623
|
+
visibleRows = computed(() => {
|
|
624
|
+
const { start, end } = this.windowRange();
|
|
625
|
+
return this.rows().slice(start, end);
|
|
626
|
+
}, ...ngDevMode ? [{ debugName: "visibleRows" }] : /* istanbul ignore next */ []);
|
|
627
|
+
spacerBefore = computed(() => this.windowRange().start * this.virtualScrollItemSize(), ...ngDevMode ? [{ debugName: "spacerBefore" }] : /* istanbul ignore next */ []);
|
|
628
|
+
spacerAfter = computed(() => (this.rows().length - this.windowRange().end) * this.virtualScrollItemSize(), ...ngDevMode ? [{ debugName: "spacerAfter" }] : /* istanbul ignore next */ []);
|
|
629
|
+
emptyText = computed(() => this.emptyMessage() ?? this.translations().emptyMessage, ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
|
|
630
|
+
showMask = computed(() => this.loading() && this.loadingMode() === "mask", ...ngDevMode ? [{ debugName: "showMask" }] : /* istanbul ignore next */ []);
|
|
631
|
+
rootDrop = computed(() => this.dropTarget()?.key === null, ...ngDevMode ? [{ debugName: "rootDrop" }] : /* istanbul ignore next */ []);
|
|
632
|
+
filterContext = computed(() => ({
|
|
633
|
+
$implicit: this.query(),
|
|
634
|
+
query: this.query(),
|
|
635
|
+
filter: (query) => this.filterNodes(query),
|
|
636
|
+
reset: () => this.resetFilter()
|
|
637
|
+
}), ...ngDevMode ? [{ debugName: "filterContext" }] : /* istanbul ignore next */ []);
|
|
638
|
+
constructor() {
|
|
639
|
+
effect(() => {
|
|
640
|
+
const fresh = [];
|
|
641
|
+
walkTree(this.value(), (node) => {
|
|
642
|
+
if (this.seenKeys.has(node.key)) return;
|
|
643
|
+
this.seenKeys.add(node.key);
|
|
644
|
+
if (node.expanded) fresh.push(node.key);
|
|
645
|
+
});
|
|
646
|
+
if (fresh.length) untracked(() => this.expandedKeys.update((keys) => [...keys, ...fresh.filter((key) => !keys.includes(key))]));
|
|
647
|
+
});
|
|
648
|
+
effect(() => {
|
|
649
|
+
if (!this.filtering()) return;
|
|
650
|
+
const filter = this.query();
|
|
651
|
+
const filteredValue = this.filteredValue();
|
|
652
|
+
untracked(() => this.filtered.emit({
|
|
653
|
+
filter,
|
|
654
|
+
filteredValue
|
|
655
|
+
}));
|
|
656
|
+
});
|
|
657
|
+
afterNextRender(() => {
|
|
658
|
+
if (this.filterInputAutoFocus()) this.filterInput()?.nativeElement.focus();
|
|
659
|
+
this.measure();
|
|
660
|
+
});
|
|
661
|
+
inject(DestroyRef).onDestroy(() => {
|
|
662
|
+
this.anchor?.remove();
|
|
663
|
+
if (this.dragService.state()?.source === this) this.dragService.stop();
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
templateFor(node) {
|
|
667
|
+
const templates = this.templatesByType();
|
|
668
|
+
return templates.get(node.type ?? "") ?? templates.get("") ?? null;
|
|
669
|
+
}
|
|
670
|
+
nodeContext(row) {
|
|
671
|
+
return {
|
|
672
|
+
$implicit: row.node,
|
|
673
|
+
node: row.node,
|
|
674
|
+
level: row.level,
|
|
675
|
+
expanded: row.expanded,
|
|
676
|
+
selected: row.selected,
|
|
677
|
+
checked: row.checked,
|
|
678
|
+
partial: row.partial
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
nodeClass(row) {
|
|
682
|
+
return [row.node.styleClass, this.passThrough().node?.class].filter(Boolean).join(" ");
|
|
683
|
+
}
|
|
684
|
+
highlighted(row) {
|
|
685
|
+
return row.selected && (!this.checkboxMode() || this.highlightOnSelect());
|
|
686
|
+
}
|
|
687
|
+
checkState(row) {
|
|
688
|
+
return row.checked ? "true" : row.partial ? "mixed" : "false";
|
|
689
|
+
}
|
|
690
|
+
expandAll() {
|
|
691
|
+
this.expandedKeys.set(branchKeys(this.value()));
|
|
692
|
+
}
|
|
693
|
+
collapseAll() {
|
|
694
|
+
this.expandedKeys.set([]);
|
|
695
|
+
}
|
|
696
|
+
filterNodes(query) {
|
|
697
|
+
this.query.set(query);
|
|
698
|
+
}
|
|
699
|
+
resetFilter() {
|
|
700
|
+
this.query.set("");
|
|
701
|
+
const input = this.filterInput()?.nativeElement;
|
|
702
|
+
if (input) input.value = "";
|
|
703
|
+
}
|
|
704
|
+
onFilterInput(event) {
|
|
705
|
+
this.query.set(event.target.value);
|
|
706
|
+
}
|
|
707
|
+
onFilterKeydown(event) {
|
|
708
|
+
if (event.key === "Enter") event.preventDefault();
|
|
709
|
+
else if (event.key === "ArrowDown") {
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
const key = this.tabKey();
|
|
712
|
+
if (key) this.focusKey(key);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
toggle(row, event) {
|
|
716
|
+
event.stopPropagation();
|
|
717
|
+
if (row.leaf) return;
|
|
718
|
+
if (row.expanded) this.collapse(row, event);
|
|
719
|
+
else this.expand(row, event);
|
|
720
|
+
}
|
|
721
|
+
expand(row, event) {
|
|
722
|
+
if (row.leaf || row.expanded) return;
|
|
723
|
+
if (this.filtering()) this.filterExpanded.update((keys) => /* @__PURE__ */ new Set([...keys, row.node.key]));
|
|
724
|
+
else this.expandedKeys.update((keys) => [...keys, row.node.key]);
|
|
725
|
+
if (row.node.leaf === false && row.node.children === void 0) this.pendingKeys.update((keys) => /* @__PURE__ */ new Set([...keys, row.node.key]));
|
|
726
|
+
this.nodeExpand.emit({
|
|
727
|
+
node: row.node,
|
|
728
|
+
originalEvent: event
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
onCollapseEnd(row, event) {
|
|
732
|
+
if (event.target !== event.currentTarget || event.propertyName !== "grid-template-rows" || row.expanded) return;
|
|
733
|
+
this.mountedKeys.update((keys) => new Set([...keys].filter((key) => key !== row.node.key)));
|
|
734
|
+
}
|
|
735
|
+
collapse(row, event) {
|
|
736
|
+
if (!row.expanded) return;
|
|
737
|
+
this.mountedKeys.update((keys) => /* @__PURE__ */ new Set([...keys, row.node.key]));
|
|
738
|
+
if (this.filtering()) this.filterExpanded.update((keys) => new Set([...keys].filter((key) => key !== row.node.key)));
|
|
739
|
+
else this.expandedKeys.update((keys) => keys.filter((key) => key !== row.node.key));
|
|
740
|
+
this.nodeCollapse.emit({
|
|
741
|
+
node: row.node,
|
|
742
|
+
originalEvent: event
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
onNodeClick(row, event) {
|
|
746
|
+
this.focusedKey.set(row.node.key);
|
|
747
|
+
if (!row.selectable) return;
|
|
748
|
+
if (this.checkboxMode()) {
|
|
749
|
+
this.toggleCheck(row, event);
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const metaKey = event.metaKey || event.ctrlKey;
|
|
753
|
+
const useMeta = this.metaKeySelection();
|
|
754
|
+
if (this.selectionMode() === "single") {
|
|
755
|
+
if (row.selected) {
|
|
756
|
+
if (!useMeta || metaKey) {
|
|
757
|
+
this.selection.set(null);
|
|
758
|
+
this.nodeUnselect.emit({
|
|
759
|
+
node: row.node,
|
|
760
|
+
originalEvent: event
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
this.selection.set(row.node);
|
|
766
|
+
this.nodeSelect.emit({
|
|
767
|
+
node: row.node,
|
|
768
|
+
originalEvent: event
|
|
769
|
+
});
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
const current = this.currentSelection();
|
|
773
|
+
if (useMeta && !metaKey) {
|
|
774
|
+
if (current.length === 1 && current[0].key === row.node.key) return;
|
|
775
|
+
this.selection.set([row.node]);
|
|
776
|
+
this.nodeSelect.emit({
|
|
777
|
+
node: row.node,
|
|
778
|
+
originalEvent: event
|
|
779
|
+
});
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
if (row.selected) {
|
|
783
|
+
this.selection.set(current.filter((node) => node.key !== row.node.key));
|
|
784
|
+
this.nodeUnselect.emit({
|
|
785
|
+
node: row.node,
|
|
786
|
+
originalEvent: event
|
|
787
|
+
});
|
|
788
|
+
} else {
|
|
789
|
+
this.selection.set(this.inTreeOrder([...current.map((node) => node.key), row.node.key]));
|
|
790
|
+
this.nodeSelect.emit({
|
|
791
|
+
node: row.node,
|
|
792
|
+
originalEvent: event
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
onNodeDoubleClick(row, event) {
|
|
797
|
+
this.nodeDoubleClick.emit({
|
|
798
|
+
node: row.node,
|
|
799
|
+
originalEvent: event
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
onNodeContextMenu(row, event) {
|
|
803
|
+
const items = this.contextMenu();
|
|
804
|
+
if (!items?.length) return;
|
|
805
|
+
event.preventDefault();
|
|
806
|
+
event.stopPropagation();
|
|
807
|
+
this.focusedKey.set(row.node.key);
|
|
808
|
+
this.contextMenuSelection.set(row.node);
|
|
809
|
+
this.nodeContextMenuSelect.emit({
|
|
810
|
+
node: row.node,
|
|
811
|
+
originalEvent: event
|
|
812
|
+
});
|
|
813
|
+
this.menuItems.set(items);
|
|
814
|
+
this.openMenuAt(event);
|
|
815
|
+
}
|
|
816
|
+
onMenuClosed() {
|
|
817
|
+
this.menuOpen.set(false);
|
|
818
|
+
this.anchor?.remove();
|
|
819
|
+
this.anchor = null;
|
|
820
|
+
const key = this.focusedKey();
|
|
821
|
+
if (key && !this.host.nativeElement.contains(this.document.activeElement)) this.focusKey(key);
|
|
822
|
+
}
|
|
823
|
+
onTreeFocusIn(event) {
|
|
824
|
+
const key = event.target.dataset["treeKey"];
|
|
825
|
+
if (key !== void 0 && key !== this.focusedKey()) this.focusedKey.set(key);
|
|
826
|
+
}
|
|
827
|
+
onTreeKeydown(event) {
|
|
828
|
+
const target = event.target;
|
|
829
|
+
if (target.getAttribute("role") !== "treeitem" || event.target !== event.currentTarget) return;
|
|
830
|
+
const focused = target.dataset["treeKey"] ?? null;
|
|
831
|
+
if (focused !== this.focusedKey()) this.focusedKey.set(focused);
|
|
832
|
+
const rows = this.rows();
|
|
833
|
+
const index = rows.findIndex((row) => row.node.key === focused);
|
|
834
|
+
const row = rows[index];
|
|
835
|
+
if (!row) return;
|
|
836
|
+
if (event.altKey && this.draggableNodes() && this.droppableNodes() && this.moveByKey(row, event)) {
|
|
837
|
+
event.preventDefault();
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
switch (event.key) {
|
|
841
|
+
case "ArrowDown":
|
|
842
|
+
this.focusIndex(index + 1, event);
|
|
843
|
+
return;
|
|
844
|
+
case "ArrowUp":
|
|
845
|
+
this.focusIndex(index - 1, event);
|
|
846
|
+
return;
|
|
847
|
+
case "Home":
|
|
848
|
+
this.focusIndex(0, event);
|
|
849
|
+
return;
|
|
850
|
+
case "End":
|
|
851
|
+
this.focusIndex(rows.length - 1, event);
|
|
852
|
+
return;
|
|
853
|
+
case "ArrowRight":
|
|
854
|
+
event.preventDefault();
|
|
855
|
+
if (!row.leaf && !row.expanded) this.expand(row, event);
|
|
856
|
+
else if (row.children.length) this.focusKey(row.children[0].node.key);
|
|
857
|
+
return;
|
|
858
|
+
case "ArrowLeft":
|
|
859
|
+
event.preventDefault();
|
|
860
|
+
if (row.expanded) this.collapse(row, event);
|
|
861
|
+
else if (row.parentKey) this.focusKey(row.parentKey);
|
|
862
|
+
return;
|
|
863
|
+
case "Enter":
|
|
864
|
+
case " ":
|
|
865
|
+
event.preventDefault();
|
|
866
|
+
this.onNodeClick(row, event);
|
|
867
|
+
return;
|
|
868
|
+
case "*":
|
|
869
|
+
event.preventDefault();
|
|
870
|
+
rows.filter((item) => item.parentKey === row.parentKey && item.level === row.level && !item.leaf && !item.expanded).forEach((item) => this.expand(item, event));
|
|
871
|
+
return;
|
|
872
|
+
case "ContextMenu":
|
|
873
|
+
this.onNodeContextMenu(row, event);
|
|
874
|
+
return;
|
|
875
|
+
case "F10":
|
|
876
|
+
if (event.shiftKey) this.onNodeContextMenu(row, event);
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
880
|
+
const found = this.typeahead.search(event.key, rows.map((item) => item.node.label), index);
|
|
881
|
+
if (found !== null) {
|
|
882
|
+
event.preventDefault();
|
|
883
|
+
this.focusKey(rows[found].node.key);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
onScroll(event) {
|
|
888
|
+
if (!this.virtualScroll()) return;
|
|
889
|
+
const element = event.target;
|
|
890
|
+
this.scrollTop.set(element.scrollTop);
|
|
891
|
+
this.viewportHeight.set(element.clientHeight);
|
|
892
|
+
}
|
|
893
|
+
onDragStart(row, event) {
|
|
894
|
+
if (!row.draggable) {
|
|
895
|
+
event.preventDefault();
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
event.stopPropagation();
|
|
899
|
+
event.dataTransfer?.setData("text/plain", row.node.label);
|
|
900
|
+
if (event.dataTransfer) event.dataTransfer.effectAllowed = "move";
|
|
901
|
+
this.draggingKey.set(row.node.key);
|
|
902
|
+
this.dragService.start({
|
|
903
|
+
node: row.node,
|
|
904
|
+
scope: this.draggableScope(),
|
|
905
|
+
source: this
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
onDragOver(row, event) {
|
|
909
|
+
const state = this.dragService.state();
|
|
910
|
+
if (!state || !this.droppableNodes()) return;
|
|
911
|
+
event.stopPropagation();
|
|
912
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
913
|
+
const ratio = rect.height ? (event.clientY - rect.top) / rect.height : .5;
|
|
914
|
+
const inside = row.node.droppable !== false;
|
|
915
|
+
const position = ratio < .25 || !inside && ratio < .5 ? "before" : ratio > .75 || !inside ? "after" : "inside";
|
|
916
|
+
if (!this.canDrop(state.node, state.source === this, state.scope, row.node.key)) {
|
|
917
|
+
this.dropTarget.set(null);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
event.preventDefault();
|
|
921
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
922
|
+
const current = this.dropTarget();
|
|
923
|
+
if (current?.key !== row.node.key || current.position !== position) this.dropTarget.set({
|
|
924
|
+
key: row.node.key,
|
|
925
|
+
position
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
onDragLeave(row, event) {
|
|
929
|
+
const related = event.relatedTarget;
|
|
930
|
+
if (related && event.currentTarget.contains(related)) return;
|
|
931
|
+
if (this.dropTarget()?.key === row.node.key) this.dropTarget.set(null);
|
|
932
|
+
}
|
|
933
|
+
onRootDragOver(event) {
|
|
934
|
+
const state = this.dragService.state();
|
|
935
|
+
if (!state || !this.droppableNodes() || !this.canDrop(state.node, state.source === this, state.scope, null)) return;
|
|
936
|
+
event.preventDefault();
|
|
937
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
938
|
+
if (this.dropTarget()?.key !== null) this.dropTarget.set({
|
|
939
|
+
key: null,
|
|
940
|
+
position: "inside"
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
onRootDragLeave(event) {
|
|
944
|
+
const related = event.relatedTarget;
|
|
945
|
+
if (related && event.currentTarget.contains(related)) return;
|
|
946
|
+
this.dropTarget.set(null);
|
|
947
|
+
}
|
|
948
|
+
onDrop(event) {
|
|
949
|
+
const state = this.dragService.state();
|
|
950
|
+
const target = this.dropTarget();
|
|
951
|
+
this.dropTarget.set(null);
|
|
952
|
+
if (!state || !target) return;
|
|
953
|
+
event.preventDefault();
|
|
954
|
+
event.stopPropagation();
|
|
955
|
+
this.drop(state.node, state.source, target.key, target.position, event);
|
|
956
|
+
this.dragService.stop();
|
|
957
|
+
}
|
|
958
|
+
onDragEnd() {
|
|
959
|
+
this.draggingKey.set(null);
|
|
960
|
+
this.dropTarget.set(null);
|
|
961
|
+
if (this.dragService.state()?.source === this) this.dragService.stop();
|
|
962
|
+
}
|
|
963
|
+
removeDraggedNode(key) {
|
|
964
|
+
this.value.set(removeNode(this.value(), key));
|
|
965
|
+
}
|
|
966
|
+
canDrop(node, sameTree, scope, targetKey) {
|
|
967
|
+
if (!scopesMatch(sameTree ? scope ?? this.droppableScope() : scope, this.droppableScope())) return false;
|
|
968
|
+
if (targetKey === null) return true;
|
|
969
|
+
if (targetKey === node.key) return false;
|
|
970
|
+
return !(sameTree && isDescendantOf(this.value(), node.key, targetKey));
|
|
971
|
+
}
|
|
972
|
+
drop(node, source, targetKey, position, event) {
|
|
973
|
+
const dragNode = node;
|
|
974
|
+
const sameTree = source === this;
|
|
975
|
+
const base = this.value();
|
|
976
|
+
const next = sameTree ? moveNode(base, dragNode.key, targetKey, position) : insertNode(removeNode(base, dragNode.key), dragNode, targetKey, position);
|
|
977
|
+
const index = siblingsOf(next, dragNode.key).findIndex((item) => item.key === dragNode.key);
|
|
978
|
+
const dropNode = targetKey === null ? null : findNode(base, targetKey);
|
|
979
|
+
const accept = () => {
|
|
980
|
+
if (!sameTree) source.removeDraggedNode(dragNode.key);
|
|
981
|
+
this.value.set(next);
|
|
982
|
+
if (position === "inside" && targetKey !== null && !this.expandedKeys().includes(targetKey)) this.expandedKeys.update((keys) => [...keys, targetKey]);
|
|
983
|
+
};
|
|
984
|
+
this.nodeDrop.emit({
|
|
985
|
+
dragNode,
|
|
986
|
+
dropNode,
|
|
987
|
+
position,
|
|
988
|
+
index,
|
|
989
|
+
originalEvent: event,
|
|
990
|
+
accept
|
|
991
|
+
});
|
|
992
|
+
if (!this.validateDrop()) accept();
|
|
993
|
+
}
|
|
994
|
+
moveByKey(row, event) {
|
|
995
|
+
if (!row.draggable) return false;
|
|
996
|
+
const siblings = this.rows().filter((item) => item.parentKey === row.parentKey && item.level === row.level);
|
|
997
|
+
const position = siblings.findIndex((item) => item.node.key === row.node.key);
|
|
998
|
+
let target = null;
|
|
999
|
+
if (event.key === "ArrowUp" && position > 0) target = {
|
|
1000
|
+
key: siblings[position - 1].node.key,
|
|
1001
|
+
position: "before"
|
|
1002
|
+
};
|
|
1003
|
+
else if (event.key === "ArrowDown" && position < siblings.length - 1) target = {
|
|
1004
|
+
key: siblings[position + 1].node.key,
|
|
1005
|
+
position: "after"
|
|
1006
|
+
};
|
|
1007
|
+
else if (event.key === "ArrowRight" && position > 0 && siblings[position - 1].node.droppable !== false) target = {
|
|
1008
|
+
key: siblings[position - 1].node.key,
|
|
1009
|
+
position: "inside"
|
|
1010
|
+
};
|
|
1011
|
+
else if (event.key === "ArrowLeft" && row.parentKey) target = {
|
|
1012
|
+
key: row.parentKey,
|
|
1013
|
+
position: "after"
|
|
1014
|
+
};
|
|
1015
|
+
if (!target) return false;
|
|
1016
|
+
this.drop(row.node, this, target.key, target.position, event);
|
|
1017
|
+
this.focusKey(row.node.key);
|
|
1018
|
+
return true;
|
|
1019
|
+
}
|
|
1020
|
+
toggleCheck(row, event) {
|
|
1021
|
+
const keys = new Set(this.selectedKeys());
|
|
1022
|
+
const check = !row.checked;
|
|
1023
|
+
(this.propagateSelectionDown() ? [row.node.key, ...descendantKeys(row.node)] : [row.node.key]).forEach((key) => check ? keys.add(key) : keys.delete(key));
|
|
1024
|
+
const ordered = this.propagateSelectionUp() ? normalizeChecked(this.value(), [...keys]) : [...keys];
|
|
1025
|
+
this.selection.set(this.inTreeOrder(ordered));
|
|
1026
|
+
if (check) this.nodeSelect.emit({
|
|
1027
|
+
node: row.node,
|
|
1028
|
+
originalEvent: event
|
|
1029
|
+
});
|
|
1030
|
+
else this.nodeUnselect.emit({
|
|
1031
|
+
node: row.node,
|
|
1032
|
+
originalEvent: event
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
hasCheckedDescendant(node, selected) {
|
|
1036
|
+
return (node.children ?? []).some((child) => selected.has(child.key) || this.hasCheckedDescendant(child, selected));
|
|
1037
|
+
}
|
|
1038
|
+
currentSelection() {
|
|
1039
|
+
const selection = this.selection();
|
|
1040
|
+
return selection ? Array.isArray(selection) ? selection : [selection] : [];
|
|
1041
|
+
}
|
|
1042
|
+
inTreeOrder(keys) {
|
|
1043
|
+
const wanted = new Set(keys);
|
|
1044
|
+
const nodes = [];
|
|
1045
|
+
walkTree(this.value(), (node) => {
|
|
1046
|
+
if (wanted.has(node.key)) nodes.push(node);
|
|
1047
|
+
});
|
|
1048
|
+
return nodes;
|
|
1049
|
+
}
|
|
1050
|
+
focusIndex(index, event) {
|
|
1051
|
+
event.preventDefault();
|
|
1052
|
+
const rows = this.rows();
|
|
1053
|
+
const row = rows[Math.max(0, Math.min(rows.length - 1, index))];
|
|
1054
|
+
if (row) this.focusKey(row.node.key);
|
|
1055
|
+
}
|
|
1056
|
+
focusKey(key) {
|
|
1057
|
+
this.focusedKey.set(key);
|
|
1058
|
+
if (this.virtualScroll()) this.scrollToKey(key);
|
|
1059
|
+
afterNextRender(() => {
|
|
1060
|
+
const element = Array.from(this.host.nativeElement.querySelectorAll("[data-tree-key]")).find((item) => item.dataset["treeKey"] === key);
|
|
1061
|
+
element?.focus({ preventScroll: this.virtualScroll() });
|
|
1062
|
+
if (!this.virtualScroll()) element?.scrollIntoView?.({ block: "nearest" });
|
|
1063
|
+
}, { injector: this.injector });
|
|
1064
|
+
}
|
|
1065
|
+
scrollToKey(key) {
|
|
1066
|
+
const wrapper = this.wrapper()?.nativeElement;
|
|
1067
|
+
const index = this.rows().findIndex((row) => row.node.key === key);
|
|
1068
|
+
if (!wrapper || index < 0) return;
|
|
1069
|
+
const size = this.virtualScrollItemSize();
|
|
1070
|
+
const top = index * size;
|
|
1071
|
+
const height = wrapper.clientHeight;
|
|
1072
|
+
let next = wrapper.scrollTop;
|
|
1073
|
+
if (top < next) next = top;
|
|
1074
|
+
else if (top + size > next + height) next = top + size - height;
|
|
1075
|
+
wrapper.scrollTop = next;
|
|
1076
|
+
this.scrollTop.set(next);
|
|
1077
|
+
this.viewportHeight.set(height);
|
|
1078
|
+
}
|
|
1079
|
+
measure() {
|
|
1080
|
+
const wrapper = this.wrapper()?.nativeElement;
|
|
1081
|
+
if (wrapper) this.viewportHeight.set(wrapper.clientHeight);
|
|
1082
|
+
}
|
|
1083
|
+
openMenuAt(event) {
|
|
1084
|
+
const menu = this.menu();
|
|
1085
|
+
if (!menu) return;
|
|
1086
|
+
const point = event instanceof MouseEvent && (event.clientX || event.clientY) ? {
|
|
1087
|
+
x: event.clientX,
|
|
1088
|
+
y: event.clientY
|
|
1089
|
+
} : (() => {
|
|
1090
|
+
const rect = event.target.getBoundingClientRect();
|
|
1091
|
+
return {
|
|
1092
|
+
x: rect.left + 16,
|
|
1093
|
+
y: rect.bottom
|
|
1094
|
+
};
|
|
1095
|
+
})();
|
|
1096
|
+
menu.hide();
|
|
1097
|
+
this.anchor?.remove();
|
|
1098
|
+
const anchor = this.document.createElement("div");
|
|
1099
|
+
Object.assign(anchor.style, {
|
|
1100
|
+
position: "fixed",
|
|
1101
|
+
left: `${point.x}px`,
|
|
1102
|
+
top: `${point.y}px`,
|
|
1103
|
+
width: "0",
|
|
1104
|
+
height: "0",
|
|
1105
|
+
pointerEvents: "none"
|
|
1106
|
+
});
|
|
1107
|
+
this.document.body.appendChild(anchor);
|
|
1108
|
+
this.anchor = anchor;
|
|
1109
|
+
this.menuOpen.set(true);
|
|
1110
|
+
menu.show(anchor, "first", true);
|
|
1111
|
+
}
|
|
1112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1113
|
+
minVersion: "12.0.0",
|
|
1114
|
+
version: "22.2.3",
|
|
1115
|
+
ngImport: i0,
|
|
1116
|
+
type: TxTree,
|
|
1117
|
+
deps: [],
|
|
1118
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1119
|
+
});
|
|
1120
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1121
|
+
minVersion: "17.0.0",
|
|
1122
|
+
version: "22.2.3",
|
|
1123
|
+
type: TxTree,
|
|
1124
|
+
isStandalone: true,
|
|
1125
|
+
selector: "tx-tree",
|
|
1126
|
+
inputs: {
|
|
1127
|
+
value: {
|
|
1128
|
+
classPropertyName: "value",
|
|
1129
|
+
publicName: "value",
|
|
1130
|
+
isSignal: true,
|
|
1131
|
+
isRequired: false,
|
|
1132
|
+
transformFunction: null
|
|
1133
|
+
},
|
|
1134
|
+
selectionMode: {
|
|
1135
|
+
classPropertyName: "selectionMode",
|
|
1136
|
+
publicName: "selectionMode",
|
|
1137
|
+
isSignal: true,
|
|
1138
|
+
isRequired: false,
|
|
1139
|
+
transformFunction: null
|
|
1140
|
+
},
|
|
1141
|
+
selection: {
|
|
1142
|
+
classPropertyName: "selection",
|
|
1143
|
+
publicName: "selection",
|
|
1144
|
+
isSignal: true,
|
|
1145
|
+
isRequired: false,
|
|
1146
|
+
transformFunction: null
|
|
1147
|
+
},
|
|
1148
|
+
expandedKeys: {
|
|
1149
|
+
classPropertyName: "expandedKeys",
|
|
1150
|
+
publicName: "expandedKeys",
|
|
1151
|
+
isSignal: true,
|
|
1152
|
+
isRequired: false,
|
|
1153
|
+
transformFunction: null
|
|
1154
|
+
},
|
|
1155
|
+
metaKeySelection: {
|
|
1156
|
+
classPropertyName: "metaKeySelection",
|
|
1157
|
+
publicName: "metaKeySelection",
|
|
1158
|
+
isSignal: true,
|
|
1159
|
+
isRequired: false,
|
|
1160
|
+
transformFunction: null
|
|
1161
|
+
},
|
|
1162
|
+
propagateSelectionUp: {
|
|
1163
|
+
classPropertyName: "propagateSelectionUp",
|
|
1164
|
+
publicName: "propagateSelectionUp",
|
|
1165
|
+
isSignal: true,
|
|
1166
|
+
isRequired: false,
|
|
1167
|
+
transformFunction: null
|
|
1168
|
+
},
|
|
1169
|
+
propagateSelectionDown: {
|
|
1170
|
+
classPropertyName: "propagateSelectionDown",
|
|
1171
|
+
publicName: "propagateSelectionDown",
|
|
1172
|
+
isSignal: true,
|
|
1173
|
+
isRequired: false,
|
|
1174
|
+
transformFunction: null
|
|
1175
|
+
},
|
|
1176
|
+
highlightOnSelect: {
|
|
1177
|
+
classPropertyName: "highlightOnSelect",
|
|
1178
|
+
publicName: "highlightOnSelect",
|
|
1179
|
+
isSignal: true,
|
|
1180
|
+
isRequired: false,
|
|
1181
|
+
transformFunction: null
|
|
1182
|
+
},
|
|
1183
|
+
contextMenu: {
|
|
1184
|
+
classPropertyName: "contextMenu",
|
|
1185
|
+
publicName: "contextMenu",
|
|
1186
|
+
isSignal: true,
|
|
1187
|
+
isRequired: false,
|
|
1188
|
+
transformFunction: null
|
|
1189
|
+
},
|
|
1190
|
+
contextMenuSelection: {
|
|
1191
|
+
classPropertyName: "contextMenuSelection",
|
|
1192
|
+
publicName: "contextMenuSelection",
|
|
1193
|
+
isSignal: true,
|
|
1194
|
+
isRequired: false,
|
|
1195
|
+
transformFunction: null
|
|
1196
|
+
},
|
|
1197
|
+
draggableNodes: {
|
|
1198
|
+
classPropertyName: "draggableNodes",
|
|
1199
|
+
publicName: "draggableNodes",
|
|
1200
|
+
isSignal: true,
|
|
1201
|
+
isRequired: false,
|
|
1202
|
+
transformFunction: null
|
|
1203
|
+
},
|
|
1204
|
+
droppableNodes: {
|
|
1205
|
+
classPropertyName: "droppableNodes",
|
|
1206
|
+
publicName: "droppableNodes",
|
|
1207
|
+
isSignal: true,
|
|
1208
|
+
isRequired: false,
|
|
1209
|
+
transformFunction: null
|
|
1210
|
+
},
|
|
1211
|
+
draggableScope: {
|
|
1212
|
+
classPropertyName: "draggableScope",
|
|
1213
|
+
publicName: "draggableScope",
|
|
1214
|
+
isSignal: true,
|
|
1215
|
+
isRequired: false,
|
|
1216
|
+
transformFunction: null
|
|
1217
|
+
},
|
|
1218
|
+
droppableScope: {
|
|
1219
|
+
classPropertyName: "droppableScope",
|
|
1220
|
+
publicName: "droppableScope",
|
|
1221
|
+
isSignal: true,
|
|
1222
|
+
isRequired: false,
|
|
1223
|
+
transformFunction: null
|
|
1224
|
+
},
|
|
1225
|
+
validateDrop: {
|
|
1226
|
+
classPropertyName: "validateDrop",
|
|
1227
|
+
publicName: "validateDrop",
|
|
1228
|
+
isSignal: true,
|
|
1229
|
+
isRequired: false,
|
|
1230
|
+
transformFunction: null
|
|
1231
|
+
},
|
|
1232
|
+
loading: {
|
|
1233
|
+
classPropertyName: "loading",
|
|
1234
|
+
publicName: "loading",
|
|
1235
|
+
isSignal: true,
|
|
1236
|
+
isRequired: false,
|
|
1237
|
+
transformFunction: null
|
|
1238
|
+
},
|
|
1239
|
+
loadingMode: {
|
|
1240
|
+
classPropertyName: "loadingMode",
|
|
1241
|
+
publicName: "loadingMode",
|
|
1242
|
+
isSignal: true,
|
|
1243
|
+
isRequired: false,
|
|
1244
|
+
transformFunction: null
|
|
1245
|
+
},
|
|
1246
|
+
loadingIcon: {
|
|
1247
|
+
classPropertyName: "loadingIcon",
|
|
1248
|
+
publicName: "loadingIcon",
|
|
1249
|
+
isSignal: true,
|
|
1250
|
+
isRequired: false,
|
|
1251
|
+
transformFunction: null
|
|
1252
|
+
},
|
|
1253
|
+
emptyMessage: {
|
|
1254
|
+
classPropertyName: "emptyMessage",
|
|
1255
|
+
publicName: "emptyMessage",
|
|
1256
|
+
isSignal: true,
|
|
1257
|
+
isRequired: false,
|
|
1258
|
+
transformFunction: null
|
|
1259
|
+
},
|
|
1260
|
+
filter: {
|
|
1261
|
+
classPropertyName: "filter",
|
|
1262
|
+
publicName: "filter",
|
|
1263
|
+
isSignal: true,
|
|
1264
|
+
isRequired: false,
|
|
1265
|
+
transformFunction: null
|
|
1266
|
+
},
|
|
1267
|
+
filterBy: {
|
|
1268
|
+
classPropertyName: "filterBy",
|
|
1269
|
+
publicName: "filterBy",
|
|
1270
|
+
isSignal: true,
|
|
1271
|
+
isRequired: false,
|
|
1272
|
+
transformFunction: null
|
|
1273
|
+
},
|
|
1274
|
+
filterMode: {
|
|
1275
|
+
classPropertyName: "filterMode",
|
|
1276
|
+
publicName: "filterMode",
|
|
1277
|
+
isSignal: true,
|
|
1278
|
+
isRequired: false,
|
|
1279
|
+
transformFunction: null
|
|
1280
|
+
},
|
|
1281
|
+
filterPlaceholder: {
|
|
1282
|
+
classPropertyName: "filterPlaceholder",
|
|
1283
|
+
publicName: "filterPlaceholder",
|
|
1284
|
+
isSignal: true,
|
|
1285
|
+
isRequired: false,
|
|
1286
|
+
transformFunction: null
|
|
1287
|
+
},
|
|
1288
|
+
filterInputAutoFocus: {
|
|
1289
|
+
classPropertyName: "filterInputAutoFocus",
|
|
1290
|
+
publicName: "filterInputAutoFocus",
|
|
1291
|
+
isSignal: true,
|
|
1292
|
+
isRequired: false,
|
|
1293
|
+
transformFunction: null
|
|
1294
|
+
},
|
|
1295
|
+
scrollHeight: {
|
|
1296
|
+
classPropertyName: "scrollHeight",
|
|
1297
|
+
publicName: "scrollHeight",
|
|
1298
|
+
isSignal: true,
|
|
1299
|
+
isRequired: false,
|
|
1300
|
+
transformFunction: null
|
|
1301
|
+
},
|
|
1302
|
+
virtualScroll: {
|
|
1303
|
+
classPropertyName: "virtualScroll",
|
|
1304
|
+
publicName: "virtualScroll",
|
|
1305
|
+
isSignal: true,
|
|
1306
|
+
isRequired: false,
|
|
1307
|
+
transformFunction: null
|
|
1308
|
+
},
|
|
1309
|
+
virtualScrollItemSize: {
|
|
1310
|
+
classPropertyName: "virtualScrollItemSize",
|
|
1311
|
+
publicName: "virtualScrollItemSize",
|
|
1312
|
+
isSignal: true,
|
|
1313
|
+
isRequired: false,
|
|
1314
|
+
transformFunction: null
|
|
1315
|
+
},
|
|
1316
|
+
virtualScrollTolerance: {
|
|
1317
|
+
classPropertyName: "virtualScrollTolerance",
|
|
1318
|
+
publicName: "virtualScrollTolerance",
|
|
1319
|
+
isSignal: true,
|
|
1320
|
+
isRequired: false,
|
|
1321
|
+
transformFunction: null
|
|
1322
|
+
},
|
|
1323
|
+
ariaLabel: {
|
|
1324
|
+
classPropertyName: "ariaLabel",
|
|
1325
|
+
publicName: "ariaLabel",
|
|
1326
|
+
isSignal: true,
|
|
1327
|
+
isRequired: false,
|
|
1328
|
+
transformFunction: null
|
|
1329
|
+
},
|
|
1330
|
+
ariaLabelledBy: {
|
|
1331
|
+
classPropertyName: "ariaLabelledBy",
|
|
1332
|
+
publicName: "ariaLabelledBy",
|
|
1333
|
+
isSignal: true,
|
|
1334
|
+
isRequired: false,
|
|
1335
|
+
transformFunction: null
|
|
1336
|
+
},
|
|
1337
|
+
dt: {
|
|
1338
|
+
classPropertyName: "dt",
|
|
1339
|
+
publicName: "dt",
|
|
1340
|
+
isSignal: true,
|
|
1341
|
+
isRequired: false,
|
|
1342
|
+
transformFunction: null
|
|
1343
|
+
},
|
|
1344
|
+
pt: {
|
|
1345
|
+
classPropertyName: "pt",
|
|
1346
|
+
publicName: "pt",
|
|
1347
|
+
isSignal: true,
|
|
1348
|
+
isRequired: false,
|
|
1349
|
+
transformFunction: null
|
|
1350
|
+
},
|
|
1351
|
+
ptOptions: {
|
|
1352
|
+
classPropertyName: "ptOptions",
|
|
1353
|
+
publicName: "ptOptions",
|
|
1354
|
+
isSignal: true,
|
|
1355
|
+
isRequired: false,
|
|
1356
|
+
transformFunction: null
|
|
1357
|
+
},
|
|
1358
|
+
unstyled: {
|
|
1359
|
+
classPropertyName: "unstyled",
|
|
1360
|
+
publicName: "unstyled",
|
|
1361
|
+
isSignal: true,
|
|
1362
|
+
isRequired: false,
|
|
1363
|
+
transformFunction: null
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1366
|
+
outputs: {
|
|
1367
|
+
value: "valueChange",
|
|
1368
|
+
selection: "selectionChange",
|
|
1369
|
+
expandedKeys: "expandedKeysChange",
|
|
1370
|
+
contextMenuSelection: "contextMenuSelectionChange",
|
|
1371
|
+
nodeSelect: "nodeSelect",
|
|
1372
|
+
nodeUnselect: "nodeUnselect",
|
|
1373
|
+
nodeExpand: "nodeExpand",
|
|
1374
|
+
nodeCollapse: "nodeCollapse",
|
|
1375
|
+
nodeContextMenuSelect: "nodeContextMenuSelect",
|
|
1376
|
+
nodeDoubleClick: "nodeDoubleClick",
|
|
1377
|
+
nodeDrop: "nodeDrop",
|
|
1378
|
+
filtered: "filtered"
|
|
1379
|
+
},
|
|
1380
|
+
host: {
|
|
1381
|
+
properties: {
|
|
1382
|
+
"class": "passThrough().root?.class",
|
|
1383
|
+
"style": "hostStyle()",
|
|
1384
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
1385
|
+
"class.tx-tree--loading": "loading()",
|
|
1386
|
+
"class.tx-tree--scrollable": "scrollHeight() === \"flex\""
|
|
1387
|
+
},
|
|
1388
|
+
classAttribute: "tx-tree"
|
|
1389
|
+
},
|
|
1390
|
+
queries: [
|
|
1391
|
+
{
|
|
1392
|
+
propertyName: "nodeTemplates",
|
|
1393
|
+
predicate: TxTreeNodeTemplate,
|
|
1394
|
+
isSignal: true
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
propertyName: "headerTemplate",
|
|
1398
|
+
first: true,
|
|
1399
|
+
predicate: TxTreeHeader,
|
|
1400
|
+
descendants: true,
|
|
1401
|
+
isSignal: true
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
propertyName: "footerTemplate",
|
|
1405
|
+
first: true,
|
|
1406
|
+
predicate: TxTreeFooter,
|
|
1407
|
+
descendants: true,
|
|
1408
|
+
isSignal: true
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
propertyName: "emptyTemplate",
|
|
1412
|
+
first: true,
|
|
1413
|
+
predicate: TxTreeEmpty,
|
|
1414
|
+
descendants: true,
|
|
1415
|
+
isSignal: true
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
propertyName: "loadingTemplate",
|
|
1419
|
+
first: true,
|
|
1420
|
+
predicate: TxTreeLoading,
|
|
1421
|
+
descendants: true,
|
|
1422
|
+
isSignal: true
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
propertyName: "filterTemplate",
|
|
1426
|
+
first: true,
|
|
1427
|
+
predicate: TxTreeFilter,
|
|
1428
|
+
descendants: true,
|
|
1429
|
+
isSignal: true
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
propertyName: "toggleIconTemplate",
|
|
1433
|
+
first: true,
|
|
1434
|
+
predicate: TxTreeToggleIcon,
|
|
1435
|
+
descendants: true,
|
|
1436
|
+
isSignal: true
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
propertyName: "checkboxIconTemplate",
|
|
1440
|
+
first: true,
|
|
1441
|
+
predicate: TxTreeCheckboxIcon,
|
|
1442
|
+
descendants: true,
|
|
1443
|
+
isSignal: true
|
|
1444
|
+
}
|
|
1445
|
+
],
|
|
1446
|
+
viewQueries: [
|
|
1447
|
+
{
|
|
1448
|
+
propertyName: "menu",
|
|
1449
|
+
first: true,
|
|
1450
|
+
predicate: ["nodeMenu"],
|
|
1451
|
+
descendants: true,
|
|
1452
|
+
isSignal: true
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
propertyName: "wrapper",
|
|
1456
|
+
first: true,
|
|
1457
|
+
predicate: ["wrapper"],
|
|
1458
|
+
descendants: true,
|
|
1459
|
+
isSignal: true
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
propertyName: "filterInput",
|
|
1463
|
+
first: true,
|
|
1464
|
+
predicate: ["filterInput"],
|
|
1465
|
+
descendants: true,
|
|
1466
|
+
isSignal: true
|
|
1467
|
+
}
|
|
1468
|
+
],
|
|
1469
|
+
ngImport: i0,
|
|
1470
|
+
template: "@if (showMask()) {\n <div class=\"tx-tree__mask\" [class]=\"passThrough().mask?.class\" [style]=\"passThrough().mask?.style\">\n @if (loadingTemplate(); as loadingTemplate) {\n <ng-container [ngTemplateOutlet]=\"loadingTemplate.templateRef\" />\n } @else {\n <tx-icon class=\"tx-tree__loading-icon\" role=\"img\" [name]=\"loadingIcon()\" [attr.aria-label]=\"translations().loading\" />\n }\n </div>\n}\n\n@if (headerTemplate(); as headerTemplate) {\n <div class=\"tx-tree__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate.templateRef\" />\n </div>\n}\n\n@if (filterTemplate(); as filterTemplate) {\n <div class=\"tx-tree__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <ng-container [ngTemplateOutlet]=\"filterTemplate.templateRef\" [ngTemplateOutletContext]=\"filterContext()\" />\n </div>\n} @else if (filter()) {\n <tx-icon-field class=\"tx-tree__filter\" fluid [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <input\n #filterInput\n txInput\n type=\"search\"\n autocomplete=\"off\"\n class=\"tx-tree__filter-input\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"treeId\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [unstyled]=\"isUnstyled()\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n <tx-input-icon icon=\"search\" position=\"end\" />\n </tx-icon-field>\n}\n\n<div\n #wrapper\n class=\"tx-tree__wrapper\"\n [class.tx-tree__wrapper--drop]=\"rootDrop()\"\n [style.max-height]=\"scrollHeight() && scrollHeight() !== 'flex' ? scrollHeight() : null\"\n [class]=\"passThrough().wrapper?.class\"\n [style]=\"passThrough().wrapper?.style\"\n (scroll)=\"onScroll($event)\"\n (dragover)=\"onRootDragOver($event)\"\n (dragleave)=\"onRootDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n @if (rows().length) {\n <ul\n class=\"tx-tree__list\"\n role=\"tree\"\n [id]=\"treeId\"\n [class.tx-tree__list--virtual]=\"virtualScroll()\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-busy]=\"loading() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n >\n @if (virtualScroll()) {\n @if (spacerBefore()) {\n <li class=\"tx-tree__spacer\" role=\"none\" aria-hidden=\"true\" [style.height.px]=\"spacerBefore()\"></li>\n }\n @for (row of visibleRows(); track row.node.key) {\n <ng-container [ngTemplateOutlet]=\"nodeItem\" [ngTemplateOutletContext]=\"{ $implicit: row, flat: true }\" />\n }\n @if (spacerAfter()) {\n <li class=\"tx-tree__spacer\" role=\"none\" aria-hidden=\"true\" [style.height.px]=\"spacerAfter()\"></li>\n }\n } @else {\n <ng-container [ngTemplateOutlet]=\"branch\" [ngTemplateOutletContext]=\"{ $implicit: tree() }\" />\n }\n </ul>\n } @else {\n <div class=\"tx-tree__empty\" role=\"status\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate.templateRef\" />\n } @else {\n {{ emptyText() }}\n }\n </div>\n }\n</div>\n\n@if (footerTemplate(); as footerTemplate) {\n <div class=\"tx-tree__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate.templateRef\" />\n </div>\n}\n\n<tx-tiered-menu\n #nodeMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().nodeActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n/>\n\n<ng-template #branch let-rows>\n @for (row of rows; track row.node.key) {\n <ng-container [ngTemplateOutlet]=\"nodeItem\" [ngTemplateOutletContext]=\"{ $implicit: row, flat: false }\" />\n }\n</ng-template>\n\n<ng-template #nodeItem let-row let-flat=\"flat\">\n <li\n class=\"tx-tree__node\"\n role=\"none\"\n [class.tx-tree__node--leaf]=\"row.leaf\"\n [style.height.px]=\"flat ? virtualScrollItemSize() : null\"\n [style.--tx-tree-level]=\"row.level - 1\"\n [class]=\"nodeClass(row)\"\n [style]=\"passThrough().node?.style\"\n >\n <div\n class=\"tx-tree__content\"\n role=\"treeitem\"\n [id]=\"row.id\"\n [attr.data-tree-key]=\"row.node.key\"\n [attr.tabindex]=\"row.node.key === tabKey() ? 0 : -1\"\n [attr.aria-label]=\"row.node.label\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-setsize]=\"row.setSize\"\n [attr.aria-posinset]=\"row.posInSet\"\n [attr.aria-expanded]=\"row.leaf ? null : row.expanded\"\n [attr.aria-selected]=\"selectionMode() && !checkboxMode() ? row.selected : null\"\n [attr.aria-checked]=\"checkboxMode() ? checkState(row) : null\"\n [attr.aria-disabled]=\"row.node.disabled || null\"\n [attr.aria-busy]=\"row.loading || null\"\n [attr.aria-owns]=\"!flat && row.expanded && row.children.length ? row.id + '-group' : null\"\n [class.tx-tree__content--selectable]=\"row.selectable\"\n [class.tx-tree__content--selected]=\"highlighted(row)\"\n [class.tx-tree__content--disabled]=\"row.node.disabled\"\n [class.tx-tree__content--dragging]=\"draggingKey() === row.node.key\"\n [class.tx-tree__content--drop-inside]=\"dropTarget()?.key === row.node.key && dropTarget()?.position === 'inside'\"\n [class.tx-tree__content--context]=\"menuOpen() && contextMenuSelection()?.key === row.node.key\"\n [class.tx-tree__content--flat]=\"flat\"\n [attr.draggable]=\"row.draggable || null\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n (click)=\"onNodeClick(row, $event)\"\n (keydown)=\"onTreeKeydown($event)\"\n (focus)=\"onTreeFocusIn($event)\"\n (dblclick)=\"onNodeDoubleClick(row, $event)\"\n (contextmenu)=\"onNodeContextMenu(row, $event)\"\n (dragstart)=\"onDragStart(row, $event)\"\n (dragover)=\"onDragOver(row, $event)\"\n (dragleave)=\"onDragLeave(row, $event)\"\n (drop)=\"onDrop($event)\"\n (dragend)=\"onDragEnd()\"\n >\n @if (dropTarget()?.key === row.node.key && dropTarget()?.position !== 'inside') {\n <span\n class=\"tx-tree__drop-point\"\n aria-hidden=\"true\"\n [class.tx-tree__drop-point--after]=\"dropTarget()?.position === 'after'\"\n [class]=\"passThrough().dropPoint?.class\"\n [style]=\"passThrough().dropPoint?.style\"\n ></span>\n }\n <button\n type=\"button\"\n class=\"tx-tree__toggler\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tree__toggler--hidden]=\"row.leaf\"\n [class]=\"passThrough().toggler?.class\"\n [style]=\"passThrough().toggler?.style\"\n (click)=\"toggle(row, $event)\"\n >\n @if (toggleIconTemplate(); as toggleIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"toggleIconTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row.expanded, expanded: row.expanded, loading: row.loading }\"\n />\n } @else if (row.loading) {\n <tx-icon class=\"tx-tree__toggler-icon tx-tree__toggler-icon--loading\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-tree__toggler-icon\" [class.tx-tree__toggler-icon--open]=\"row.expanded\" [name]=\"'chevron-right'\" />\n }\n </button>\n @if (checkboxMode()) {\n <span\n class=\"tx-tree__checkbox\"\n aria-hidden=\"true\"\n [class.tx-tree__checkbox--checked]=\"row.checked\"\n [class.tx-tree__checkbox--partial]=\"row.partial\"\n [class.tx-tree__checkbox--disabled]=\"!row.selectable\"\n [class]=\"passThrough().checkbox?.class\"\n [style]=\"passThrough().checkbox?.style\"\n >\n @if (checkboxIconTemplate(); as checkboxIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"checkboxIconTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row.checked, checked: row.checked, partial: row.partial }\"\n />\n } @else if (row.checked) {\n <tx-icon [name]=\"'check'\" />\n } @else if (row.partial) {\n <tx-icon [name]=\"'minus'\" />\n }\n </span>\n }\n @if (row.icon) {\n <tx-icon class=\"tx-tree__icon\" aria-hidden=\"true\" [name]=\"row.icon\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n }\n <span class=\"tx-tree__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">\n @if (templateFor(row.node); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"nodeContext(row)\" />\n } @else {\n {{ row.node.label }}\n }\n </span>\n </div>\n @if (!flat && row.node.children?.length) {\n <div\n class=\"tx-tree__collapse\"\n [class.tx-tree__collapse--open]=\"row.expanded\"\n [attr.inert]=\"row.expanded ? null : ''\"\n (transitionend)=\"onCollapseEnd(row, $event)\"\n >\n <div class=\"tx-tree__collapse-inner\">\n @if (row.children.length) {\n <ul class=\"tx-tree__children\" role=\"group\" [id]=\"row.id + '-group'\" [class]=\"passThrough().children?.class\" [style]=\"passThrough().children?.style\">\n <ng-container [ngTemplateOutlet]=\"branch\" [ngTemplateOutletContext]=\"{ $implicit: row.children }\" />\n </ul>\n }\n </div>\n </div>\n }\n </li>\n</ng-template>\n",
|
|
1471
|
+
styles: [":host{position:relative;display:block}.tx-tree__list,.tx-tree__children{margin:0;padding:0;list-style:none}.tx-tree__wrapper{overflow:auto}.tx-tree__content{outline:none}.tx-tree__content{position:relative;display:flex;align-items:center}.tx-tree__toggler{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}.tx-tree__collapse{display:grid;grid-template-rows:0fr}.tx-tree__collapse--open{grid-template-rows:1fr}.tx-tree__collapse-inner{min-height:0;overflow:hidden}.tx-tree__toggler--hidden{visibility:hidden}.tx-tree__mask{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center}:host(.tx-tree--scrollable){display:flex;flex-direction:column;height:100%}:host(.tx-tree--scrollable) .tx-tree__wrapper{flex:1}:host([data-styled]){background:var(--tx-tree-background);color:var(--tx-tree-color);padding:var(--tx-tree-padding);font-family:var(--tx-font-family)}:host([data-styled]) .tx-tree__list,:host([data-styled]) .tx-tree__children{display:flex;flex-direction:column;gap:var(--tx-tree-gap);padding-block-start:var(--tx-tree-gap)}:host([data-styled]) .tx-tree__children{padding-inline-start:var(--tx-tree-indent)}:host([data-styled]) .tx-tree__list--virtual{gap:0}:host([data-styled]) .tx-tree__list--virtual>.tx-tree__node{box-sizing:border-box;padding-block-end:var(--tx-tree-gap)}:host([data-styled]) .tx-tree__content{gap:var(--tx-tree-node-gap);padding:var(--tx-tree-node-padding);border-radius:var(--tx-tree-node-border-radius);color:var(--tx-tree-node-color);outline:var(--tx-tree-node-focus-ring-width) var(--tx-tree-node-focus-ring-style) transparent;outline-offset:var(--tx-tree-node-focus-ring-offset);transition:background-color var(--tx-tree-transition-duration),color var(--tx-tree-transition-duration),outline-color var(--tx-tree-transition-duration),box-shadow var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__content--flat{margin-inline-start:calc(var(--tx-tree-level, 0) * var(--tx-tree-indent))}:host([data-styled]) .tx-tree__content--selectable{cursor:pointer;-webkit-user-select:none;user-select:none}:host([data-styled]) .tx-tree__content--selectable:not(.tx-tree__content--selected):hover,:host([data-styled]) .tx-tree__content--drop-inside{background:var(--tx-tree-node-hover-background);color:var(--tx-tree-node-hover-color)}:host([data-styled]) .tx-tree__content--selectable:not(.tx-tree__content--selected):hover .tx-tree__icon,:host([data-styled]) .tx-tree__content--drop-inside .tx-tree__icon{color:var(--tx-tree-node-icon-hover-color)}:host([data-styled]) .tx-tree__content--selected{background:var(--tx-tree-node-selected-background);color:var(--tx-tree-node-selected-color)}:host([data-styled]) .tx-tree__content--selected .tx-tree__icon{color:var(--tx-tree-node-icon-selected-color)}:host([data-styled]) .tx-tree__content--selected .tx-tree__label{font-weight:var(--tx-tree-node-label-selected-font-weight)}:host([data-styled]) .tx-tree__content--selected .tx-tree__toggler{color:inherit}:host([data-styled]) .tx-tree__content--selected .tx-tree__toggler:hover{background:var(--tx-tree-node-toggle-button-selected-hover-background);color:var(--tx-tree-node-toggle-button-selected-hover-color)}:host([data-styled]) .tx-tree__content--disabled{opacity:.6}:host([data-styled]) .tx-tree__content--dragging{outline:1px dashed var(--tx-tree-drop-point-color);outline-offset:-1px}:host([data-styled]) .tx-tree__content:focus-visible,:host([data-styled]) .tx-tree__content--context{outline-color:var(--tx-tree-node-focus-ring-color);box-shadow:var(--tx-tree-node-focus-ring-shadow)}:host([data-styled]) .tx-tree__drop-point{position:absolute;inset-inline:0;top:calc(var(--tx-tree-gap) / -2);height:0;outline:1px solid var(--tx-tree-drop-point-color);pointer-events:none}:host([data-styled]) .tx-tree__drop-point--after{top:auto;bottom:calc(var(--tx-tree-gap) / -2)}:host([data-styled]) .tx-tree__wrapper--drop{outline:1px solid var(--tx-tree-drop-point-color);outline-offset:-1px;border-radius:var(--tx-tree-node-border-radius)}:host([data-styled]) .tx-tree__toggler{width:var(--tx-tree-node-toggle-button-size);height:var(--tx-tree-node-toggle-button-size);border-radius:var(--tx-tree-node-toggle-button-border-radius);color:var(--tx-tree-node-toggle-button-color);transition:background-color var(--tx-tree-transition-duration),color var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__toggler:hover{background:var(--tx-tree-node-toggle-button-hover-background);color:var(--tx-tree-node-toggle-button-hover-color)}:host([data-styled]) .tx-tree__toggler-icon{transition:transform var(--tx-tree-expansion-duration) var(--tx-tree-expansion-easing)}:host([data-styled]) .tx-tree__toggler-icon--open{transform:rotate(90deg)}:host([data-styled]) .tx-tree__toggler-icon:dir(rtl){transform:scaleX(-1)}:host([data-styled]) .tx-tree__toggler-icon--open:dir(rtl){transform:rotate(90deg)}:host([data-styled]) .tx-tree__collapse{transition:grid-template-rows var(--tx-tree-expansion-duration) var(--tx-tree-expansion-easing)}:host([data-styled]) .tx-tree__collapse-inner{transition:visibility 0s linear}:host([data-styled]) .tx-tree__collapse:not(.tx-tree__collapse--open)>.tx-tree__collapse-inner{visibility:hidden;transition-delay:var(--tx-tree-expansion-duration)}:host([data-styled]) .tx-tree__toggler-icon--loading,:host([data-styled]) .tx-tree__loading-icon{animation:tx-tree-spin .8s linear infinite}:host([data-styled]) .tx-tree__checkbox{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;width:var(--tx-checkbox-size);height:var(--tx-checkbox-size);border:var(--tx-checkbox-border-width) solid var(--tx-checkbox-border-color);border-radius:var(--tx-checkbox-border-radius);background:var(--tx-checkbox-background);color:var(--tx-checkbox-icon-color);font-size:var(--tx-checkbox-icon-size);transition:background-color var(--tx-checkbox-transition-duration),border-color var(--tx-checkbox-transition-duration)}:host([data-styled]) .tx-tree__checkbox tx-icon{--tx-icon-stroke-width: 3}:host([data-styled]) .tx-tree__content--selectable:hover .tx-tree__checkbox:not(.tx-tree__checkbox--checked,.tx-tree__checkbox--partial){border-color:var(--tx-checkbox-hover-border-color)}:host([data-styled]) .tx-tree__checkbox--checked,:host([data-styled]) .tx-tree__checkbox--partial{border-color:var(--tx-checkbox-checked-border-color);background:var(--tx-checkbox-checked-background)}:host([data-styled]) .tx-tree__checkbox--disabled{border-color:var(--tx-checkbox-disabled-border-color);background:var(--tx-checkbox-disabled-background)}:host([data-styled]) .tx-tree__checkbox--disabled.tx-tree__checkbox--checked,:host([data-styled]) .tx-tree__checkbox--disabled.tx-tree__checkbox--partial{background:var(--tx-checkbox-disabled-checked-background);color:var(--tx-checkbox-disabled-icon-color)}:host([data-styled]) .tx-tree__icon{flex-shrink:0;color:var(--tx-tree-node-icon-color);transition:color var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__label{min-width:0;font-size:var(--tx-tree-node-label-font-size);font-weight:var(--tx-tree-node-label-font-weight)}:host([data-styled]) .tx-tree__filter{margin:var(--tx-tree-filter-margin)}:host([data-styled]) .tx-tree__mask{background:var(--tx-tree-mask-background)}:host([data-styled]) .tx-tree__loading-icon{width:var(--tx-tree-loading-icon-size);height:var(--tx-tree-loading-icon-size);font-size:var(--tx-tree-loading-icon-size);color:var(--tx-tree-node-icon-color)}:host([data-styled]) .tx-tree__empty{padding:var(--tx-tree-node-padding)}@keyframes tx-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-tree__content,:host([data-styled]) .tx-tree__toggler,:host([data-styled]) .tx-tree__toggler-icon,:host([data-styled]) .tx-tree__icon,:host([data-styled]) .tx-tree__checkbox,:host([data-styled]) .tx-tree__collapse,:host([data-styled]) .tx-tree__collapse-inner{transition:none}:host([data-styled]) .tx-tree__toggler-icon--loading,:host([data-styled]) .tx-tree__loading-icon{animation-duration:2.4s}}\n"],
|
|
1472
|
+
dependencies: [
|
|
1473
|
+
{
|
|
1474
|
+
kind: "directive",
|
|
1475
|
+
type: NgTemplateOutlet,
|
|
1476
|
+
selector: "[ngTemplateOutlet]",
|
|
1477
|
+
inputs: [
|
|
1478
|
+
"ngTemplateOutletContext",
|
|
1479
|
+
"ngTemplateOutlet",
|
|
1480
|
+
"ngTemplateOutletInjector"
|
|
1481
|
+
]
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
kind: "component",
|
|
1485
|
+
type: TxIcon,
|
|
1486
|
+
selector: "tx-icon",
|
|
1487
|
+
inputs: ["name"]
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
kind: "component",
|
|
1491
|
+
type: TxIconField,
|
|
1492
|
+
selector: "tx-icon-field",
|
|
1493
|
+
inputs: ["fluid"]
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
kind: "component",
|
|
1497
|
+
type: TxInputIcon,
|
|
1498
|
+
selector: "tx-input-icon",
|
|
1499
|
+
inputs: ["icon", "position"]
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
kind: "directive",
|
|
1503
|
+
type: TxInput,
|
|
1504
|
+
selector: "input[txInput], textarea[txInput]",
|
|
1505
|
+
inputs: [
|
|
1506
|
+
"invalid",
|
|
1507
|
+
"size",
|
|
1508
|
+
"variant",
|
|
1509
|
+
"fluid",
|
|
1510
|
+
"dt",
|
|
1511
|
+
"pt",
|
|
1512
|
+
"ptOptions",
|
|
1513
|
+
"unstyled"
|
|
1514
|
+
]
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
kind: "component",
|
|
1518
|
+
type: TxMenu,
|
|
1519
|
+
selector: "tx-menu, tx-tiered-menu",
|
|
1520
|
+
inputs: [
|
|
1521
|
+
"model",
|
|
1522
|
+
"popup",
|
|
1523
|
+
"tiered",
|
|
1524
|
+
"placement",
|
|
1525
|
+
"offset",
|
|
1526
|
+
"variant",
|
|
1527
|
+
"ariaLabel",
|
|
1528
|
+
"ariaLabelledBy",
|
|
1529
|
+
"dt",
|
|
1530
|
+
"pt",
|
|
1531
|
+
"ptOptions",
|
|
1532
|
+
"unstyled"
|
|
1533
|
+
],
|
|
1534
|
+
outputs: [
|
|
1535
|
+
"itemSelected",
|
|
1536
|
+
"opened",
|
|
1537
|
+
"closed"
|
|
1538
|
+
]
|
|
1539
|
+
}
|
|
1540
|
+
],
|
|
1541
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1545
|
+
minVersion: "12.0.0",
|
|
1546
|
+
version: "22.2.3",
|
|
1547
|
+
ngImport: i0,
|
|
1548
|
+
type: TxTree,
|
|
1549
|
+
decorators: [{
|
|
1550
|
+
type: Component,
|
|
1551
|
+
args: [{
|
|
1552
|
+
selector: "tx-tree",
|
|
1553
|
+
imports: [
|
|
1554
|
+
NgTemplateOutlet,
|
|
1555
|
+
TxIcon,
|
|
1556
|
+
TxIconField,
|
|
1557
|
+
TxInputIcon,
|
|
1558
|
+
TxInput,
|
|
1559
|
+
TxMenu
|
|
1560
|
+
],
|
|
1561
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1562
|
+
host: {
|
|
1563
|
+
class: "tx-tree",
|
|
1564
|
+
"[class]": "passThrough().root?.class",
|
|
1565
|
+
"[style]": "hostStyle()",
|
|
1566
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
1567
|
+
"[class.tx-tree--loading]": "loading()",
|
|
1568
|
+
"[class.tx-tree--scrollable]": "scrollHeight() === \"flex\""
|
|
1569
|
+
},
|
|
1570
|
+
template: "@if (showMask()) {\n <div class=\"tx-tree__mask\" [class]=\"passThrough().mask?.class\" [style]=\"passThrough().mask?.style\">\n @if (loadingTemplate(); as loadingTemplate) {\n <ng-container [ngTemplateOutlet]=\"loadingTemplate.templateRef\" />\n } @else {\n <tx-icon class=\"tx-tree__loading-icon\" role=\"img\" [name]=\"loadingIcon()\" [attr.aria-label]=\"translations().loading\" />\n }\n </div>\n}\n\n@if (headerTemplate(); as headerTemplate) {\n <div class=\"tx-tree__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate.templateRef\" />\n </div>\n}\n\n@if (filterTemplate(); as filterTemplate) {\n <div class=\"tx-tree__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <ng-container [ngTemplateOutlet]=\"filterTemplate.templateRef\" [ngTemplateOutletContext]=\"filterContext()\" />\n </div>\n} @else if (filter()) {\n <tx-icon-field class=\"tx-tree__filter\" fluid [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <input\n #filterInput\n txInput\n type=\"search\"\n autocomplete=\"off\"\n class=\"tx-tree__filter-input\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"treeId\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [unstyled]=\"isUnstyled()\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n <tx-input-icon icon=\"search\" position=\"end\" />\n </tx-icon-field>\n}\n\n<div\n #wrapper\n class=\"tx-tree__wrapper\"\n [class.tx-tree__wrapper--drop]=\"rootDrop()\"\n [style.max-height]=\"scrollHeight() && scrollHeight() !== 'flex' ? scrollHeight() : null\"\n [class]=\"passThrough().wrapper?.class\"\n [style]=\"passThrough().wrapper?.style\"\n (scroll)=\"onScroll($event)\"\n (dragover)=\"onRootDragOver($event)\"\n (dragleave)=\"onRootDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n @if (rows().length) {\n <ul\n class=\"tx-tree__list\"\n role=\"tree\"\n [id]=\"treeId\"\n [class.tx-tree__list--virtual]=\"virtualScroll()\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-busy]=\"loading() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n >\n @if (virtualScroll()) {\n @if (spacerBefore()) {\n <li class=\"tx-tree__spacer\" role=\"none\" aria-hidden=\"true\" [style.height.px]=\"spacerBefore()\"></li>\n }\n @for (row of visibleRows(); track row.node.key) {\n <ng-container [ngTemplateOutlet]=\"nodeItem\" [ngTemplateOutletContext]=\"{ $implicit: row, flat: true }\" />\n }\n @if (spacerAfter()) {\n <li class=\"tx-tree__spacer\" role=\"none\" aria-hidden=\"true\" [style.height.px]=\"spacerAfter()\"></li>\n }\n } @else {\n <ng-container [ngTemplateOutlet]=\"branch\" [ngTemplateOutletContext]=\"{ $implicit: tree() }\" />\n }\n </ul>\n } @else {\n <div class=\"tx-tree__empty\" role=\"status\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate.templateRef\" />\n } @else {\n {{ emptyText() }}\n }\n </div>\n }\n</div>\n\n@if (footerTemplate(); as footerTemplate) {\n <div class=\"tx-tree__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate.templateRef\" />\n </div>\n}\n\n<tx-tiered-menu\n #nodeMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().nodeActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n/>\n\n<ng-template #branch let-rows>\n @for (row of rows; track row.node.key) {\n <ng-container [ngTemplateOutlet]=\"nodeItem\" [ngTemplateOutletContext]=\"{ $implicit: row, flat: false }\" />\n }\n</ng-template>\n\n<ng-template #nodeItem let-row let-flat=\"flat\">\n <li\n class=\"tx-tree__node\"\n role=\"none\"\n [class.tx-tree__node--leaf]=\"row.leaf\"\n [style.height.px]=\"flat ? virtualScrollItemSize() : null\"\n [style.--tx-tree-level]=\"row.level - 1\"\n [class]=\"nodeClass(row)\"\n [style]=\"passThrough().node?.style\"\n >\n <div\n class=\"tx-tree__content\"\n role=\"treeitem\"\n [id]=\"row.id\"\n [attr.data-tree-key]=\"row.node.key\"\n [attr.tabindex]=\"row.node.key === tabKey() ? 0 : -1\"\n [attr.aria-label]=\"row.node.label\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-setsize]=\"row.setSize\"\n [attr.aria-posinset]=\"row.posInSet\"\n [attr.aria-expanded]=\"row.leaf ? null : row.expanded\"\n [attr.aria-selected]=\"selectionMode() && !checkboxMode() ? row.selected : null\"\n [attr.aria-checked]=\"checkboxMode() ? checkState(row) : null\"\n [attr.aria-disabled]=\"row.node.disabled || null\"\n [attr.aria-busy]=\"row.loading || null\"\n [attr.aria-owns]=\"!flat && row.expanded && row.children.length ? row.id + '-group' : null\"\n [class.tx-tree__content--selectable]=\"row.selectable\"\n [class.tx-tree__content--selected]=\"highlighted(row)\"\n [class.tx-tree__content--disabled]=\"row.node.disabled\"\n [class.tx-tree__content--dragging]=\"draggingKey() === row.node.key\"\n [class.tx-tree__content--drop-inside]=\"dropTarget()?.key === row.node.key && dropTarget()?.position === 'inside'\"\n [class.tx-tree__content--context]=\"menuOpen() && contextMenuSelection()?.key === row.node.key\"\n [class.tx-tree__content--flat]=\"flat\"\n [attr.draggable]=\"row.draggable || null\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n (click)=\"onNodeClick(row, $event)\"\n (keydown)=\"onTreeKeydown($event)\"\n (focus)=\"onTreeFocusIn($event)\"\n (dblclick)=\"onNodeDoubleClick(row, $event)\"\n (contextmenu)=\"onNodeContextMenu(row, $event)\"\n (dragstart)=\"onDragStart(row, $event)\"\n (dragover)=\"onDragOver(row, $event)\"\n (dragleave)=\"onDragLeave(row, $event)\"\n (drop)=\"onDrop($event)\"\n (dragend)=\"onDragEnd()\"\n >\n @if (dropTarget()?.key === row.node.key && dropTarget()?.position !== 'inside') {\n <span\n class=\"tx-tree__drop-point\"\n aria-hidden=\"true\"\n [class.tx-tree__drop-point--after]=\"dropTarget()?.position === 'after'\"\n [class]=\"passThrough().dropPoint?.class\"\n [style]=\"passThrough().dropPoint?.style\"\n ></span>\n }\n <button\n type=\"button\"\n class=\"tx-tree__toggler\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tree__toggler--hidden]=\"row.leaf\"\n [class]=\"passThrough().toggler?.class\"\n [style]=\"passThrough().toggler?.style\"\n (click)=\"toggle(row, $event)\"\n >\n @if (toggleIconTemplate(); as toggleIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"toggleIconTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row.expanded, expanded: row.expanded, loading: row.loading }\"\n />\n } @else if (row.loading) {\n <tx-icon class=\"tx-tree__toggler-icon tx-tree__toggler-icon--loading\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-tree__toggler-icon\" [class.tx-tree__toggler-icon--open]=\"row.expanded\" [name]=\"'chevron-right'\" />\n }\n </button>\n @if (checkboxMode()) {\n <span\n class=\"tx-tree__checkbox\"\n aria-hidden=\"true\"\n [class.tx-tree__checkbox--checked]=\"row.checked\"\n [class.tx-tree__checkbox--partial]=\"row.partial\"\n [class.tx-tree__checkbox--disabled]=\"!row.selectable\"\n [class]=\"passThrough().checkbox?.class\"\n [style]=\"passThrough().checkbox?.style\"\n >\n @if (checkboxIconTemplate(); as checkboxIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"checkboxIconTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row.checked, checked: row.checked, partial: row.partial }\"\n />\n } @else if (row.checked) {\n <tx-icon [name]=\"'check'\" />\n } @else if (row.partial) {\n <tx-icon [name]=\"'minus'\" />\n }\n </span>\n }\n @if (row.icon) {\n <tx-icon class=\"tx-tree__icon\" aria-hidden=\"true\" [name]=\"row.icon\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n }\n <span class=\"tx-tree__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">\n @if (templateFor(row.node); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"nodeContext(row)\" />\n } @else {\n {{ row.node.label }}\n }\n </span>\n </div>\n @if (!flat && row.node.children?.length) {\n <div\n class=\"tx-tree__collapse\"\n [class.tx-tree__collapse--open]=\"row.expanded\"\n [attr.inert]=\"row.expanded ? null : ''\"\n (transitionend)=\"onCollapseEnd(row, $event)\"\n >\n <div class=\"tx-tree__collapse-inner\">\n @if (row.children.length) {\n <ul class=\"tx-tree__children\" role=\"group\" [id]=\"row.id + '-group'\" [class]=\"passThrough().children?.class\" [style]=\"passThrough().children?.style\">\n <ng-container [ngTemplateOutlet]=\"branch\" [ngTemplateOutletContext]=\"{ $implicit: row.children }\" />\n </ul>\n }\n </div>\n </div>\n }\n </li>\n</ng-template>\n",
|
|
1571
|
+
styles: [":host{position:relative;display:block}.tx-tree__list,.tx-tree__children{margin:0;padding:0;list-style:none}.tx-tree__wrapper{overflow:auto}.tx-tree__content{outline:none}.tx-tree__content{position:relative;display:flex;align-items:center}.tx-tree__toggler{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}.tx-tree__collapse{display:grid;grid-template-rows:0fr}.tx-tree__collapse--open{grid-template-rows:1fr}.tx-tree__collapse-inner{min-height:0;overflow:hidden}.tx-tree__toggler--hidden{visibility:hidden}.tx-tree__mask{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center}:host(.tx-tree--scrollable){display:flex;flex-direction:column;height:100%}:host(.tx-tree--scrollable) .tx-tree__wrapper{flex:1}:host([data-styled]){background:var(--tx-tree-background);color:var(--tx-tree-color);padding:var(--tx-tree-padding);font-family:var(--tx-font-family)}:host([data-styled]) .tx-tree__list,:host([data-styled]) .tx-tree__children{display:flex;flex-direction:column;gap:var(--tx-tree-gap);padding-block-start:var(--tx-tree-gap)}:host([data-styled]) .tx-tree__children{padding-inline-start:var(--tx-tree-indent)}:host([data-styled]) .tx-tree__list--virtual{gap:0}:host([data-styled]) .tx-tree__list--virtual>.tx-tree__node{box-sizing:border-box;padding-block-end:var(--tx-tree-gap)}:host([data-styled]) .tx-tree__content{gap:var(--tx-tree-node-gap);padding:var(--tx-tree-node-padding);border-radius:var(--tx-tree-node-border-radius);color:var(--tx-tree-node-color);outline:var(--tx-tree-node-focus-ring-width) var(--tx-tree-node-focus-ring-style) transparent;outline-offset:var(--tx-tree-node-focus-ring-offset);transition:background-color var(--tx-tree-transition-duration),color var(--tx-tree-transition-duration),outline-color var(--tx-tree-transition-duration),box-shadow var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__content--flat{margin-inline-start:calc(var(--tx-tree-level, 0) * var(--tx-tree-indent))}:host([data-styled]) .tx-tree__content--selectable{cursor:pointer;-webkit-user-select:none;user-select:none}:host([data-styled]) .tx-tree__content--selectable:not(.tx-tree__content--selected):hover,:host([data-styled]) .tx-tree__content--drop-inside{background:var(--tx-tree-node-hover-background);color:var(--tx-tree-node-hover-color)}:host([data-styled]) .tx-tree__content--selectable:not(.tx-tree__content--selected):hover .tx-tree__icon,:host([data-styled]) .tx-tree__content--drop-inside .tx-tree__icon{color:var(--tx-tree-node-icon-hover-color)}:host([data-styled]) .tx-tree__content--selected{background:var(--tx-tree-node-selected-background);color:var(--tx-tree-node-selected-color)}:host([data-styled]) .tx-tree__content--selected .tx-tree__icon{color:var(--tx-tree-node-icon-selected-color)}:host([data-styled]) .tx-tree__content--selected .tx-tree__label{font-weight:var(--tx-tree-node-label-selected-font-weight)}:host([data-styled]) .tx-tree__content--selected .tx-tree__toggler{color:inherit}:host([data-styled]) .tx-tree__content--selected .tx-tree__toggler:hover{background:var(--tx-tree-node-toggle-button-selected-hover-background);color:var(--tx-tree-node-toggle-button-selected-hover-color)}:host([data-styled]) .tx-tree__content--disabled{opacity:.6}:host([data-styled]) .tx-tree__content--dragging{outline:1px dashed var(--tx-tree-drop-point-color);outline-offset:-1px}:host([data-styled]) .tx-tree__content:focus-visible,:host([data-styled]) .tx-tree__content--context{outline-color:var(--tx-tree-node-focus-ring-color);box-shadow:var(--tx-tree-node-focus-ring-shadow)}:host([data-styled]) .tx-tree__drop-point{position:absolute;inset-inline:0;top:calc(var(--tx-tree-gap) / -2);height:0;outline:1px solid var(--tx-tree-drop-point-color);pointer-events:none}:host([data-styled]) .tx-tree__drop-point--after{top:auto;bottom:calc(var(--tx-tree-gap) / -2)}:host([data-styled]) .tx-tree__wrapper--drop{outline:1px solid var(--tx-tree-drop-point-color);outline-offset:-1px;border-radius:var(--tx-tree-node-border-radius)}:host([data-styled]) .tx-tree__toggler{width:var(--tx-tree-node-toggle-button-size);height:var(--tx-tree-node-toggle-button-size);border-radius:var(--tx-tree-node-toggle-button-border-radius);color:var(--tx-tree-node-toggle-button-color);transition:background-color var(--tx-tree-transition-duration),color var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__toggler:hover{background:var(--tx-tree-node-toggle-button-hover-background);color:var(--tx-tree-node-toggle-button-hover-color)}:host([data-styled]) .tx-tree__toggler-icon{transition:transform var(--tx-tree-expansion-duration) var(--tx-tree-expansion-easing)}:host([data-styled]) .tx-tree__toggler-icon--open{transform:rotate(90deg)}:host([data-styled]) .tx-tree__toggler-icon:dir(rtl){transform:scaleX(-1)}:host([data-styled]) .tx-tree__toggler-icon--open:dir(rtl){transform:rotate(90deg)}:host([data-styled]) .tx-tree__collapse{transition:grid-template-rows var(--tx-tree-expansion-duration) var(--tx-tree-expansion-easing)}:host([data-styled]) .tx-tree__collapse-inner{transition:visibility 0s linear}:host([data-styled]) .tx-tree__collapse:not(.tx-tree__collapse--open)>.tx-tree__collapse-inner{visibility:hidden;transition-delay:var(--tx-tree-expansion-duration)}:host([data-styled]) .tx-tree__toggler-icon--loading,:host([data-styled]) .tx-tree__loading-icon{animation:tx-tree-spin .8s linear infinite}:host([data-styled]) .tx-tree__checkbox{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;width:var(--tx-checkbox-size);height:var(--tx-checkbox-size);border:var(--tx-checkbox-border-width) solid var(--tx-checkbox-border-color);border-radius:var(--tx-checkbox-border-radius);background:var(--tx-checkbox-background);color:var(--tx-checkbox-icon-color);font-size:var(--tx-checkbox-icon-size);transition:background-color var(--tx-checkbox-transition-duration),border-color var(--tx-checkbox-transition-duration)}:host([data-styled]) .tx-tree__checkbox tx-icon{--tx-icon-stroke-width: 3}:host([data-styled]) .tx-tree__content--selectable:hover .tx-tree__checkbox:not(.tx-tree__checkbox--checked,.tx-tree__checkbox--partial){border-color:var(--tx-checkbox-hover-border-color)}:host([data-styled]) .tx-tree__checkbox--checked,:host([data-styled]) .tx-tree__checkbox--partial{border-color:var(--tx-checkbox-checked-border-color);background:var(--tx-checkbox-checked-background)}:host([data-styled]) .tx-tree__checkbox--disabled{border-color:var(--tx-checkbox-disabled-border-color);background:var(--tx-checkbox-disabled-background)}:host([data-styled]) .tx-tree__checkbox--disabled.tx-tree__checkbox--checked,:host([data-styled]) .tx-tree__checkbox--disabled.tx-tree__checkbox--partial{background:var(--tx-checkbox-disabled-checked-background);color:var(--tx-checkbox-disabled-icon-color)}:host([data-styled]) .tx-tree__icon{flex-shrink:0;color:var(--tx-tree-node-icon-color);transition:color var(--tx-tree-transition-duration)}:host([data-styled]) .tx-tree__label{min-width:0;font-size:var(--tx-tree-node-label-font-size);font-weight:var(--tx-tree-node-label-font-weight)}:host([data-styled]) .tx-tree__filter{margin:var(--tx-tree-filter-margin)}:host([data-styled]) .tx-tree__mask{background:var(--tx-tree-mask-background)}:host([data-styled]) .tx-tree__loading-icon{width:var(--tx-tree-loading-icon-size);height:var(--tx-tree-loading-icon-size);font-size:var(--tx-tree-loading-icon-size);color:var(--tx-tree-node-icon-color)}:host([data-styled]) .tx-tree__empty{padding:var(--tx-tree-node-padding)}@keyframes tx-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-tree__content,:host([data-styled]) .tx-tree__toggler,:host([data-styled]) .tx-tree__toggler-icon,:host([data-styled]) .tx-tree__icon,:host([data-styled]) .tx-tree__checkbox,:host([data-styled]) .tx-tree__collapse,:host([data-styled]) .tx-tree__collapse-inner{transition:none}:host([data-styled]) .tx-tree__toggler-icon--loading,:host([data-styled]) .tx-tree__loading-icon{animation-duration:2.4s}}\n"]
|
|
1572
|
+
}]
|
|
1573
|
+
}],
|
|
1574
|
+
ctorParameters: () => [],
|
|
1575
|
+
propDecorators: {
|
|
1576
|
+
value: [{
|
|
1577
|
+
type: i0.Input,
|
|
1578
|
+
args: [{
|
|
1579
|
+
isSignal: true,
|
|
1580
|
+
alias: "value",
|
|
1581
|
+
required: false
|
|
1582
|
+
}]
|
|
1583
|
+
}, {
|
|
1584
|
+
type: i0.Output,
|
|
1585
|
+
args: ["valueChange"]
|
|
1586
|
+
}],
|
|
1587
|
+
selectionMode: [{
|
|
1588
|
+
type: i0.Input,
|
|
1589
|
+
args: [{
|
|
1590
|
+
isSignal: true,
|
|
1591
|
+
alias: "selectionMode",
|
|
1592
|
+
required: false
|
|
1593
|
+
}]
|
|
1594
|
+
}],
|
|
1595
|
+
selection: [{
|
|
1596
|
+
type: i0.Input,
|
|
1597
|
+
args: [{
|
|
1598
|
+
isSignal: true,
|
|
1599
|
+
alias: "selection",
|
|
1600
|
+
required: false
|
|
1601
|
+
}]
|
|
1602
|
+
}, {
|
|
1603
|
+
type: i0.Output,
|
|
1604
|
+
args: ["selectionChange"]
|
|
1605
|
+
}],
|
|
1606
|
+
expandedKeys: [{
|
|
1607
|
+
type: i0.Input,
|
|
1608
|
+
args: [{
|
|
1609
|
+
isSignal: true,
|
|
1610
|
+
alias: "expandedKeys",
|
|
1611
|
+
required: false
|
|
1612
|
+
}]
|
|
1613
|
+
}, {
|
|
1614
|
+
type: i0.Output,
|
|
1615
|
+
args: ["expandedKeysChange"]
|
|
1616
|
+
}],
|
|
1617
|
+
metaKeySelection: [{
|
|
1618
|
+
type: i0.Input,
|
|
1619
|
+
args: [{
|
|
1620
|
+
isSignal: true,
|
|
1621
|
+
alias: "metaKeySelection",
|
|
1622
|
+
required: false
|
|
1623
|
+
}]
|
|
1624
|
+
}],
|
|
1625
|
+
propagateSelectionUp: [{
|
|
1626
|
+
type: i0.Input,
|
|
1627
|
+
args: [{
|
|
1628
|
+
isSignal: true,
|
|
1629
|
+
alias: "propagateSelectionUp",
|
|
1630
|
+
required: false
|
|
1631
|
+
}]
|
|
1632
|
+
}],
|
|
1633
|
+
propagateSelectionDown: [{
|
|
1634
|
+
type: i0.Input,
|
|
1635
|
+
args: [{
|
|
1636
|
+
isSignal: true,
|
|
1637
|
+
alias: "propagateSelectionDown",
|
|
1638
|
+
required: false
|
|
1639
|
+
}]
|
|
1640
|
+
}],
|
|
1641
|
+
highlightOnSelect: [{
|
|
1642
|
+
type: i0.Input,
|
|
1643
|
+
args: [{
|
|
1644
|
+
isSignal: true,
|
|
1645
|
+
alias: "highlightOnSelect",
|
|
1646
|
+
required: false
|
|
1647
|
+
}]
|
|
1648
|
+
}],
|
|
1649
|
+
contextMenu: [{
|
|
1650
|
+
type: i0.Input,
|
|
1651
|
+
args: [{
|
|
1652
|
+
isSignal: true,
|
|
1653
|
+
alias: "contextMenu",
|
|
1654
|
+
required: false
|
|
1655
|
+
}]
|
|
1656
|
+
}],
|
|
1657
|
+
contextMenuSelection: [{
|
|
1658
|
+
type: i0.Input,
|
|
1659
|
+
args: [{
|
|
1660
|
+
isSignal: true,
|
|
1661
|
+
alias: "contextMenuSelection",
|
|
1662
|
+
required: false
|
|
1663
|
+
}]
|
|
1664
|
+
}, {
|
|
1665
|
+
type: i0.Output,
|
|
1666
|
+
args: ["contextMenuSelectionChange"]
|
|
1667
|
+
}],
|
|
1668
|
+
draggableNodes: [{
|
|
1669
|
+
type: i0.Input,
|
|
1670
|
+
args: [{
|
|
1671
|
+
isSignal: true,
|
|
1672
|
+
alias: "draggableNodes",
|
|
1673
|
+
required: false
|
|
1674
|
+
}]
|
|
1675
|
+
}],
|
|
1676
|
+
droppableNodes: [{
|
|
1677
|
+
type: i0.Input,
|
|
1678
|
+
args: [{
|
|
1679
|
+
isSignal: true,
|
|
1680
|
+
alias: "droppableNodes",
|
|
1681
|
+
required: false
|
|
1682
|
+
}]
|
|
1683
|
+
}],
|
|
1684
|
+
draggableScope: [{
|
|
1685
|
+
type: i0.Input,
|
|
1686
|
+
args: [{
|
|
1687
|
+
isSignal: true,
|
|
1688
|
+
alias: "draggableScope",
|
|
1689
|
+
required: false
|
|
1690
|
+
}]
|
|
1691
|
+
}],
|
|
1692
|
+
droppableScope: [{
|
|
1693
|
+
type: i0.Input,
|
|
1694
|
+
args: [{
|
|
1695
|
+
isSignal: true,
|
|
1696
|
+
alias: "droppableScope",
|
|
1697
|
+
required: false
|
|
1698
|
+
}]
|
|
1699
|
+
}],
|
|
1700
|
+
validateDrop: [{
|
|
1701
|
+
type: i0.Input,
|
|
1702
|
+
args: [{
|
|
1703
|
+
isSignal: true,
|
|
1704
|
+
alias: "validateDrop",
|
|
1705
|
+
required: false
|
|
1706
|
+
}]
|
|
1707
|
+
}],
|
|
1708
|
+
loading: [{
|
|
1709
|
+
type: i0.Input,
|
|
1710
|
+
args: [{
|
|
1711
|
+
isSignal: true,
|
|
1712
|
+
alias: "loading",
|
|
1713
|
+
required: false
|
|
1714
|
+
}]
|
|
1715
|
+
}],
|
|
1716
|
+
loadingMode: [{
|
|
1717
|
+
type: i0.Input,
|
|
1718
|
+
args: [{
|
|
1719
|
+
isSignal: true,
|
|
1720
|
+
alias: "loadingMode",
|
|
1721
|
+
required: false
|
|
1722
|
+
}]
|
|
1723
|
+
}],
|
|
1724
|
+
loadingIcon: [{
|
|
1725
|
+
type: i0.Input,
|
|
1726
|
+
args: [{
|
|
1727
|
+
isSignal: true,
|
|
1728
|
+
alias: "loadingIcon",
|
|
1729
|
+
required: false
|
|
1730
|
+
}]
|
|
1731
|
+
}],
|
|
1732
|
+
emptyMessage: [{
|
|
1733
|
+
type: i0.Input,
|
|
1734
|
+
args: [{
|
|
1735
|
+
isSignal: true,
|
|
1736
|
+
alias: "emptyMessage",
|
|
1737
|
+
required: false
|
|
1738
|
+
}]
|
|
1739
|
+
}],
|
|
1740
|
+
filter: [{
|
|
1741
|
+
type: i0.Input,
|
|
1742
|
+
args: [{
|
|
1743
|
+
isSignal: true,
|
|
1744
|
+
alias: "filter",
|
|
1745
|
+
required: false
|
|
1746
|
+
}]
|
|
1747
|
+
}],
|
|
1748
|
+
filterBy: [{
|
|
1749
|
+
type: i0.Input,
|
|
1750
|
+
args: [{
|
|
1751
|
+
isSignal: true,
|
|
1752
|
+
alias: "filterBy",
|
|
1753
|
+
required: false
|
|
1754
|
+
}]
|
|
1755
|
+
}],
|
|
1756
|
+
filterMode: [{
|
|
1757
|
+
type: i0.Input,
|
|
1758
|
+
args: [{
|
|
1759
|
+
isSignal: true,
|
|
1760
|
+
alias: "filterMode",
|
|
1761
|
+
required: false
|
|
1762
|
+
}]
|
|
1763
|
+
}],
|
|
1764
|
+
filterPlaceholder: [{
|
|
1765
|
+
type: i0.Input,
|
|
1766
|
+
args: [{
|
|
1767
|
+
isSignal: true,
|
|
1768
|
+
alias: "filterPlaceholder",
|
|
1769
|
+
required: false
|
|
1770
|
+
}]
|
|
1771
|
+
}],
|
|
1772
|
+
filterInputAutoFocus: [{
|
|
1773
|
+
type: i0.Input,
|
|
1774
|
+
args: [{
|
|
1775
|
+
isSignal: true,
|
|
1776
|
+
alias: "filterInputAutoFocus",
|
|
1777
|
+
required: false
|
|
1778
|
+
}]
|
|
1779
|
+
}],
|
|
1780
|
+
scrollHeight: [{
|
|
1781
|
+
type: i0.Input,
|
|
1782
|
+
args: [{
|
|
1783
|
+
isSignal: true,
|
|
1784
|
+
alias: "scrollHeight",
|
|
1785
|
+
required: false
|
|
1786
|
+
}]
|
|
1787
|
+
}],
|
|
1788
|
+
virtualScroll: [{
|
|
1789
|
+
type: i0.Input,
|
|
1790
|
+
args: [{
|
|
1791
|
+
isSignal: true,
|
|
1792
|
+
alias: "virtualScroll",
|
|
1793
|
+
required: false
|
|
1794
|
+
}]
|
|
1795
|
+
}],
|
|
1796
|
+
virtualScrollItemSize: [{
|
|
1797
|
+
type: i0.Input,
|
|
1798
|
+
args: [{
|
|
1799
|
+
isSignal: true,
|
|
1800
|
+
alias: "virtualScrollItemSize",
|
|
1801
|
+
required: false
|
|
1802
|
+
}]
|
|
1803
|
+
}],
|
|
1804
|
+
virtualScrollTolerance: [{
|
|
1805
|
+
type: i0.Input,
|
|
1806
|
+
args: [{
|
|
1807
|
+
isSignal: true,
|
|
1808
|
+
alias: "virtualScrollTolerance",
|
|
1809
|
+
required: false
|
|
1810
|
+
}]
|
|
1811
|
+
}],
|
|
1812
|
+
ariaLabel: [{
|
|
1813
|
+
type: i0.Input,
|
|
1814
|
+
args: [{
|
|
1815
|
+
isSignal: true,
|
|
1816
|
+
alias: "ariaLabel",
|
|
1817
|
+
required: false
|
|
1818
|
+
}]
|
|
1819
|
+
}],
|
|
1820
|
+
ariaLabelledBy: [{
|
|
1821
|
+
type: i0.Input,
|
|
1822
|
+
args: [{
|
|
1823
|
+
isSignal: true,
|
|
1824
|
+
alias: "ariaLabelledBy",
|
|
1825
|
+
required: false
|
|
1826
|
+
}]
|
|
1827
|
+
}],
|
|
1828
|
+
dt: [{
|
|
1829
|
+
type: i0.Input,
|
|
1830
|
+
args: [{
|
|
1831
|
+
isSignal: true,
|
|
1832
|
+
alias: "dt",
|
|
1833
|
+
required: false
|
|
1834
|
+
}]
|
|
1835
|
+
}],
|
|
1836
|
+
pt: [{
|
|
1837
|
+
type: i0.Input,
|
|
1838
|
+
args: [{
|
|
1839
|
+
isSignal: true,
|
|
1840
|
+
alias: "pt",
|
|
1841
|
+
required: false
|
|
1842
|
+
}]
|
|
1843
|
+
}],
|
|
1844
|
+
ptOptions: [{
|
|
1845
|
+
type: i0.Input,
|
|
1846
|
+
args: [{
|
|
1847
|
+
isSignal: true,
|
|
1848
|
+
alias: "ptOptions",
|
|
1849
|
+
required: false
|
|
1850
|
+
}]
|
|
1851
|
+
}],
|
|
1852
|
+
unstyled: [{
|
|
1853
|
+
type: i0.Input,
|
|
1854
|
+
args: [{
|
|
1855
|
+
isSignal: true,
|
|
1856
|
+
alias: "unstyled",
|
|
1857
|
+
required: false
|
|
1858
|
+
}]
|
|
1859
|
+
}],
|
|
1860
|
+
nodeSelect: [{
|
|
1861
|
+
type: i0.Output,
|
|
1862
|
+
args: ["nodeSelect"]
|
|
1863
|
+
}],
|
|
1864
|
+
nodeUnselect: [{
|
|
1865
|
+
type: i0.Output,
|
|
1866
|
+
args: ["nodeUnselect"]
|
|
1867
|
+
}],
|
|
1868
|
+
nodeExpand: [{
|
|
1869
|
+
type: i0.Output,
|
|
1870
|
+
args: ["nodeExpand"]
|
|
1871
|
+
}],
|
|
1872
|
+
nodeCollapse: [{
|
|
1873
|
+
type: i0.Output,
|
|
1874
|
+
args: ["nodeCollapse"]
|
|
1875
|
+
}],
|
|
1876
|
+
nodeContextMenuSelect: [{
|
|
1877
|
+
type: i0.Output,
|
|
1878
|
+
args: ["nodeContextMenuSelect"]
|
|
1879
|
+
}],
|
|
1880
|
+
nodeDoubleClick: [{
|
|
1881
|
+
type: i0.Output,
|
|
1882
|
+
args: ["nodeDoubleClick"]
|
|
1883
|
+
}],
|
|
1884
|
+
nodeDrop: [{
|
|
1885
|
+
type: i0.Output,
|
|
1886
|
+
args: ["nodeDrop"]
|
|
1887
|
+
}],
|
|
1888
|
+
filtered: [{
|
|
1889
|
+
type: i0.Output,
|
|
1890
|
+
args: ["filtered"]
|
|
1891
|
+
}],
|
|
1892
|
+
nodeTemplates: [{
|
|
1893
|
+
type: i0.ContentChildren,
|
|
1894
|
+
args: [i0.forwardRef(() => TxTreeNodeTemplate), { isSignal: true }]
|
|
1895
|
+
}],
|
|
1896
|
+
headerTemplate: [{
|
|
1897
|
+
type: i0.ContentChild,
|
|
1898
|
+
args: [i0.forwardRef(() => TxTreeHeader), { isSignal: true }]
|
|
1899
|
+
}],
|
|
1900
|
+
footerTemplate: [{
|
|
1901
|
+
type: i0.ContentChild,
|
|
1902
|
+
args: [i0.forwardRef(() => TxTreeFooter), { isSignal: true }]
|
|
1903
|
+
}],
|
|
1904
|
+
emptyTemplate: [{
|
|
1905
|
+
type: i0.ContentChild,
|
|
1906
|
+
args: [i0.forwardRef(() => TxTreeEmpty), { isSignal: true }]
|
|
1907
|
+
}],
|
|
1908
|
+
loadingTemplate: [{
|
|
1909
|
+
type: i0.ContentChild,
|
|
1910
|
+
args: [i0.forwardRef(() => TxTreeLoading), { isSignal: true }]
|
|
1911
|
+
}],
|
|
1912
|
+
filterTemplate: [{
|
|
1913
|
+
type: i0.ContentChild,
|
|
1914
|
+
args: [i0.forwardRef(() => TxTreeFilter), { isSignal: true }]
|
|
1915
|
+
}],
|
|
1916
|
+
toggleIconTemplate: [{
|
|
1917
|
+
type: i0.ContentChild,
|
|
1918
|
+
args: [i0.forwardRef(() => TxTreeToggleIcon), { isSignal: true }]
|
|
1919
|
+
}],
|
|
1920
|
+
checkboxIconTemplate: [{
|
|
1921
|
+
type: i0.ContentChild,
|
|
1922
|
+
args: [i0.forwardRef(() => TxTreeCheckboxIcon), { isSignal: true }]
|
|
1923
|
+
}],
|
|
1924
|
+
menu: [{
|
|
1925
|
+
type: i0.ViewChild,
|
|
1926
|
+
args: ["nodeMenu", { isSignal: true }]
|
|
1927
|
+
}],
|
|
1928
|
+
wrapper: [{
|
|
1929
|
+
type: i0.ViewChild,
|
|
1930
|
+
args: ["wrapper", { isSignal: true }]
|
|
1931
|
+
}],
|
|
1932
|
+
filterInput: [{
|
|
1933
|
+
type: i0.ViewChild,
|
|
1934
|
+
args: ["filterInput", { isSignal: true }]
|
|
1935
|
+
}]
|
|
1936
|
+
}
|
|
1937
|
+
});
|
|
1938
|
+
export { TxTree, TxTreeCheckboxIcon, TxTreeDragService, TxTreeEmpty, TxTreeFilter, TxTreeFooter, TxTreeHeader, TxTreeLoading, TxTreeNodeTemplate, TxTreeToggleIcon, branchKeys, descendantKeys, filterTree, findNode, insertNode, isDescendantOf, isLeafNode, moveNode, nodeMatches, normalizeChecked, parentMap, removeNode, scopesMatch, siblingsOf, walkTree };
|
|
1939
|
+
|
|
1940
|
+
//# sourceMappingURL=tectra-ng-ui-tree.mjs.map
|