@angular/cdk-experimental 20.1.0-next.0 → 20.1.0-next.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/accordion/index.d.ts +22 -22
- package/{accordion.d-B3UVyhWI.d.ts → accordion.d-MvKtoWUK.d.ts} +13 -13
- package/column-resize/index.d.ts +37 -37
- package/combobox/index.d.ts +8 -8
- package/deferred-content/index.d.ts +7 -7
- package/{expansion.d-DSLPa1yp.d.ts → expansion.d-BvIuKvYU.d.ts} +25 -28
- package/fesm2022/{accordion-CyyDY39y.mjs → accordion-CN4PcmAh.mjs} +2 -4
- package/fesm2022/accordion-CN4PcmAh.mjs.map +1 -0
- package/fesm2022/accordion.mjs +2 -2
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/{expansion-DykBzWrb.mjs → expansion-C9iQLHOG.mjs} +9 -15
- package/fesm2022/expansion-C9iQLHOG.mjs.map +1 -0
- package/fesm2022/list-focus-BXQdAA3i.mjs.map +1 -1
- package/fesm2022/{list-selection-BLV4Yy7T.mjs → list-selection-C41ApAbt.mjs} +7 -1
- package/fesm2022/list-selection-C41ApAbt.mjs.map +1 -0
- package/fesm2022/list-typeahead-DIIbNJrP.mjs +64 -0
- package/fesm2022/list-typeahead-DIIbNJrP.mjs.map +1 -0
- package/fesm2022/listbox.mjs +3 -2
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/{option-r2ojgVMH.mjs → option-D44ECQK6.mjs} +3 -62
- package/fesm2022/option-D44ECQK6.mjs.map +1 -0
- package/fesm2022/polyfill-CXksG4af.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/{radio-s5uO_tmJ.mjs → radio-button-BiqPDreS.mjs} +2 -2
- package/fesm2022/radio-button-BiqPDreS.mjs.map +1 -0
- package/fesm2022/{radio.mjs → radio-group.mjs} +4 -4
- package/fesm2022/radio-group.mjs.map +1 -0
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/{tabs-BN3wsMdD.mjs → tabs-DLPSZvPZ.mjs} +35 -12
- package/fesm2022/tabs-DLPSZvPZ.mjs.map +1 -0
- package/fesm2022/tabs.mjs +85 -27
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/tree.mjs +691 -0
- package/fesm2022/tree.mjs.map +1 -0
- package/fesm2022/ui-patterns.mjs +7 -6
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/{list-navigation.d-Br99p_2O.d.ts → list-navigation.d-tcweHm4g.d.ts} +3 -3
- package/{list-selection.d-BQWRFJI-.d.ts → list-selection.d-BBLdeUeF.d.ts} +5 -5
- package/list-typeahead.d-DvIIfjfu.d.ts +48 -0
- package/listbox/index.d.ts +28 -27
- package/{listbox.d-C8oz9si7.d.ts → listbox.d-hkdivyCf.d.ts} +20 -62
- package/package.json +9 -5
- package/popover-edit/index.d.ts +30 -30
- package/{radio → radio-group}/index.d.ts +20 -20
- package/{radio-group.d-C3xIREax.d.ts → radio-group.d-CcY7mCC2.d.ts} +15 -15
- package/scrolling/index.d.ts +6 -6
- package/selection/index.d.ts +14 -14
- package/table-scroll-container/index.d.ts +6 -6
- package/tabs/index.d.ts +63 -46
- package/{tabs.d-D0UIRVMM.d.ts → tabs.d-DHT_RQQu.d.ts} +43 -34
- package/tree/index.d.ts +298 -0
- package/ui-patterns/index.d.ts +8 -7
- package/fesm2022/accordion-CyyDY39y.mjs.map +0 -1
- package/fesm2022/expansion-DykBzWrb.mjs.map +0 -1
- package/fesm2022/list-selection-BLV4Yy7T.mjs.map +0 -1
- package/fesm2022/option-r2ojgVMH.mjs.map +0 -1
- package/fesm2022/radio-s5uO_tmJ.mjs.map +0 -1
- package/fesm2022/radio.mjs.map +0 -1
- package/fesm2022/tabs-BN3wsMdD.mjs.map +0 -1
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { computed, signal, input, booleanAttribute, model, inject, afterRenderEffect, Directive, ElementRef } from '@angular/core';
|
|
3
|
+
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
5
|
+
import * as i1 from '@angular/cdk-experimental/deferred-content';
|
|
6
|
+
import { DeferredContentAware, DeferredContent } from '@angular/cdk-experimental/deferred-content';
|
|
7
|
+
import { M as ModifierKey, L as ListFocus, a as ListNavigation, K as KeyboardEventManager, P as PointerEventManager } from './list-focus-BXQdAA3i.mjs';
|
|
8
|
+
import { L as ListSelection } from './list-selection-C41ApAbt.mjs';
|
|
9
|
+
import { L as ListTypeahead } from './list-typeahead-DIIbNJrP.mjs';
|
|
10
|
+
import { E as ExpansionControl, L as ListExpansion } from './expansion-C9iQLHOG.mjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Represents an item in a Tree.
|
|
14
|
+
*/
|
|
15
|
+
class TreeItemPattern {
|
|
16
|
+
inputs;
|
|
17
|
+
/** The unique identifier used by the expansion behavior. */
|
|
18
|
+
expansionId;
|
|
19
|
+
/** Controls expansion for child items. */
|
|
20
|
+
expansionManager;
|
|
21
|
+
/** Controls expansion for this item. */
|
|
22
|
+
expansion;
|
|
23
|
+
/** Whether the item is expandable. It's expandable if children item exist. */
|
|
24
|
+
expandable;
|
|
25
|
+
/** The level of the current item in a tree. */
|
|
26
|
+
level = computed(() => this.parent().level() + 1);
|
|
27
|
+
/** Whether this item is currently expanded. */
|
|
28
|
+
expanded = computed(() => this.expansion.isExpanded());
|
|
29
|
+
/** Whether this item is visible. */
|
|
30
|
+
visible = computed(() => this.parent().expanded());
|
|
31
|
+
/** The number of items under the same parent at the same level. */
|
|
32
|
+
setsize = computed(() => this.parent().children().length);
|
|
33
|
+
/** The position of this item among its siblings (1-based). */
|
|
34
|
+
posinset = computed(() => this.parent().children().indexOf(this) + 1);
|
|
35
|
+
/** Whether the item is active. */
|
|
36
|
+
active = computed(() => this.tree().focusManager.activeItem() === this);
|
|
37
|
+
/** The tabindex of the item. */
|
|
38
|
+
tabindex = computed(() => this.tree().focusManager.getItemTabindex(this));
|
|
39
|
+
/** Whether the item is selected. */
|
|
40
|
+
selected = computed(() => this.tree().value().includes(this.value()));
|
|
41
|
+
constructor(inputs) {
|
|
42
|
+
this.inputs = inputs;
|
|
43
|
+
this.id = inputs.id;
|
|
44
|
+
this.value = inputs.value;
|
|
45
|
+
this.element = inputs.element;
|
|
46
|
+
this.disabled = inputs.disabled;
|
|
47
|
+
this.searchTerm = inputs.searchTerm;
|
|
48
|
+
this.expansionId = inputs.id;
|
|
49
|
+
this.tree = inputs.tree;
|
|
50
|
+
this.parent = inputs.parent;
|
|
51
|
+
this.children = inputs.children;
|
|
52
|
+
this.expandable = inputs.hasChildren;
|
|
53
|
+
this.expansion = new ExpansionControl({
|
|
54
|
+
...inputs,
|
|
55
|
+
expandable: this.expandable,
|
|
56
|
+
expansionId: this.expansionId,
|
|
57
|
+
expansionManager: this.parent().expansionManager,
|
|
58
|
+
});
|
|
59
|
+
this.expansionManager = new ListExpansion({
|
|
60
|
+
...inputs,
|
|
61
|
+
multiExpandable: () => true,
|
|
62
|
+
// TODO(ok7sai): allow pre-expanded tree items.
|
|
63
|
+
expandedIds: signal([]),
|
|
64
|
+
items: this.children,
|
|
65
|
+
disabled: computed(() => this.tree()?.disabled() ?? false),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** Controls the state and interactions of a tree view. */
|
|
70
|
+
class TreePattern {
|
|
71
|
+
inputs;
|
|
72
|
+
/** Controls focus for the all visible tree items. */
|
|
73
|
+
focusManager;
|
|
74
|
+
/** Controls navigation for all visible tree items. */
|
|
75
|
+
navigationManager;
|
|
76
|
+
/** Controls selection for all visible tree items. */
|
|
77
|
+
selectionManager;
|
|
78
|
+
/** Controls typeahead for all visible tree items. */
|
|
79
|
+
typeaheadManager;
|
|
80
|
+
/** Controls expansion for direct children of the tree root (top-level items). */
|
|
81
|
+
expansionManager;
|
|
82
|
+
/** The root level is 0. */
|
|
83
|
+
level = () => 0;
|
|
84
|
+
/** The root is always expanded. */
|
|
85
|
+
expanded = () => true;
|
|
86
|
+
/** The tabindex of the tree. */
|
|
87
|
+
tabindex = computed(() => this.focusManager.getListTabindex());
|
|
88
|
+
/** The id of the current active item. */
|
|
89
|
+
activedescendant = computed(() => this.focusManager.getActiveDescendant());
|
|
90
|
+
/** Whether the tree is performing a range selection. */
|
|
91
|
+
inSelection = signal(false);
|
|
92
|
+
/** The direct children of the root (top-level tree items). */
|
|
93
|
+
children = computed(() => this.inputs.allItems().filter(item => item.level() === this.level() + 1));
|
|
94
|
+
/** All currently visible tree items. An item is visible if their parent is expanded. */
|
|
95
|
+
visibleItems = computed(() => this.inputs.allItems().filter(item => item.visible()));
|
|
96
|
+
/** Whether the tree selection follows focus. */
|
|
97
|
+
followFocus = computed(() => this.inputs.selectionMode() === 'follow');
|
|
98
|
+
/** The key for navigating to the previous item. */
|
|
99
|
+
prevKey = computed(() => {
|
|
100
|
+
if (this.inputs.orientation() === 'vertical') {
|
|
101
|
+
return 'ArrowUp';
|
|
102
|
+
}
|
|
103
|
+
return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
104
|
+
});
|
|
105
|
+
/** The key for navigating to the next item. */
|
|
106
|
+
nextKey = computed(() => {
|
|
107
|
+
if (this.inputs.orientation() === 'vertical') {
|
|
108
|
+
return 'ArrowDown';
|
|
109
|
+
}
|
|
110
|
+
return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
111
|
+
});
|
|
112
|
+
/** The key for collapsing an item or moving to its parent. */
|
|
113
|
+
collapseKey = computed(() => {
|
|
114
|
+
if (this.inputs.orientation() === 'horizontal') {
|
|
115
|
+
return 'ArrowUp';
|
|
116
|
+
}
|
|
117
|
+
return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
118
|
+
});
|
|
119
|
+
/** The key for expanding an item or moving to its first child. */
|
|
120
|
+
expandKey = computed(() => {
|
|
121
|
+
if (this.inputs.orientation() === 'horizontal') {
|
|
122
|
+
return 'ArrowDown';
|
|
123
|
+
}
|
|
124
|
+
return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
125
|
+
});
|
|
126
|
+
/** Represents the space key. Does nothing when the user is actively using typeahead. */
|
|
127
|
+
dynamicSpaceKey = computed(() => (this.typeaheadManager.isTyping() ? '' : ' '));
|
|
128
|
+
/** Regular expression to match characters for typeahead. */
|
|
129
|
+
typeaheadRegexp = /^.$/;
|
|
130
|
+
/** Uncommitted tree item for selecting a range of tree items. */
|
|
131
|
+
anchorItem = signal(undefined);
|
|
132
|
+
/**
|
|
133
|
+
* Uncommitted tree item index for selecting a range of tree items.
|
|
134
|
+
*
|
|
135
|
+
* The index is computed in case the tree item position is changed caused by tree expansions.
|
|
136
|
+
*/
|
|
137
|
+
anchorIndex = computed(() => this.anchorItem() ? this.visibleItems().indexOf(this.anchorItem()) : -1);
|
|
138
|
+
/** The keydown event manager for the tree. */
|
|
139
|
+
keydown = computed(() => {
|
|
140
|
+
const manager = new KeyboardEventManager();
|
|
141
|
+
if (!this.followFocus()) {
|
|
142
|
+
manager
|
|
143
|
+
.on(this.prevKey, () => this.prev())
|
|
144
|
+
.on(this.nextKey, () => this.next())
|
|
145
|
+
.on('Home', () => this.first())
|
|
146
|
+
.on('End', () => this.last())
|
|
147
|
+
.on(this.typeaheadRegexp, e => this.search(e.key));
|
|
148
|
+
}
|
|
149
|
+
if (this.followFocus()) {
|
|
150
|
+
manager
|
|
151
|
+
.on(this.prevKey, () => this.prev({ selectOne: true }))
|
|
152
|
+
.on(this.nextKey, () => this.next({ selectOne: true }))
|
|
153
|
+
.on('Home', () => this.first({ selectOne: true }))
|
|
154
|
+
.on('End', () => this.last({ selectOne: true }))
|
|
155
|
+
.on(this.typeaheadRegexp, e => this.search(e.key, { selectOne: true }));
|
|
156
|
+
}
|
|
157
|
+
if (this.inputs.multi()) {
|
|
158
|
+
manager
|
|
159
|
+
.on(ModifierKey.Any, 'Shift', () => this.anchorItem.set(this.focusManager.activeItem()))
|
|
160
|
+
.on(ModifierKey.Shift, this.prevKey, () => this.prev({ selectRange: true }))
|
|
161
|
+
.on(ModifierKey.Shift, this.nextKey, () => this.next({ selectRange: true }))
|
|
162
|
+
.on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'Home', () => this.first({ selectRange: true, anchor: false }))
|
|
163
|
+
.on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'End', () => this.last({ selectRange: true, anchor: false }))
|
|
164
|
+
.on(ModifierKey.Shift, 'Enter', () => this._updateSelection({ selectRange: true, anchor: false }))
|
|
165
|
+
.on(ModifierKey.Shift, this.dynamicSpaceKey, () => this._updateSelection({ selectRange: true, anchor: false }));
|
|
166
|
+
}
|
|
167
|
+
if (!this.followFocus() && this.inputs.multi()) {
|
|
168
|
+
manager
|
|
169
|
+
.on(this.dynamicSpaceKey, () => this.selectionManager.toggle())
|
|
170
|
+
.on('Enter', () => this.selectionManager.toggle())
|
|
171
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'A', () => this.selectionManager.toggleAll());
|
|
172
|
+
}
|
|
173
|
+
if (!this.followFocus() && !this.inputs.multi()) {
|
|
174
|
+
manager.on(this.dynamicSpaceKey, () => this.selectionManager.toggleOne());
|
|
175
|
+
manager.on('Enter', () => this.selectionManager.toggleOne());
|
|
176
|
+
}
|
|
177
|
+
if (this.inputs.multi() && this.followFocus()) {
|
|
178
|
+
manager
|
|
179
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], this.prevKey, () => this.prev())
|
|
180
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], this.nextKey, () => this.next())
|
|
181
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], ' ', () => this.selectionManager.toggle())
|
|
182
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Enter', () => this.selectionManager.toggle())
|
|
183
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Home', () => this.first())
|
|
184
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'End', () => this.last())
|
|
185
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'A', () => {
|
|
186
|
+
this.selectionManager.toggleAll();
|
|
187
|
+
this.selectionManager.select(); // Ensure the currect item remains selected.
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
manager
|
|
191
|
+
.on(this.expandKey, () => this.expand())
|
|
192
|
+
.on(this.collapseKey, () => this.collapse())
|
|
193
|
+
.on(ModifierKey.Shift, '*', () => this.expandSiblings());
|
|
194
|
+
return manager;
|
|
195
|
+
});
|
|
196
|
+
/** The pointerdown event manager for the tree. */
|
|
197
|
+
pointerdown = computed(() => {
|
|
198
|
+
const manager = new PointerEventManager();
|
|
199
|
+
if (this.multi()) {
|
|
200
|
+
manager.on(ModifierKey.Shift, e => this.goto(e, { selectRange: true }));
|
|
201
|
+
}
|
|
202
|
+
if (!this.multi() && this.followFocus()) {
|
|
203
|
+
return manager.on(e => this.goto(e, { selectOne: true }));
|
|
204
|
+
}
|
|
205
|
+
if (!this.multi() && !this.followFocus()) {
|
|
206
|
+
return manager.on(e => this.goto(e, { toggle: true }));
|
|
207
|
+
}
|
|
208
|
+
if (this.multi() && this.followFocus()) {
|
|
209
|
+
return manager
|
|
210
|
+
.on(e => this.goto(e, { selectOne: true }))
|
|
211
|
+
.on(ModifierKey.Ctrl, e => this.goto(e, { toggle: true }));
|
|
212
|
+
}
|
|
213
|
+
if (this.multi() && !this.followFocus()) {
|
|
214
|
+
return manager.on(e => this.goto(e, { toggle: true }));
|
|
215
|
+
}
|
|
216
|
+
return manager;
|
|
217
|
+
});
|
|
218
|
+
constructor(inputs) {
|
|
219
|
+
this.inputs = inputs;
|
|
220
|
+
this.allItems = inputs.allItems;
|
|
221
|
+
this.focusMode = inputs.focusMode;
|
|
222
|
+
this.disabled = inputs.disabled;
|
|
223
|
+
this.activeIndex = inputs.activeIndex;
|
|
224
|
+
this.skipDisabled = inputs.skipDisabled;
|
|
225
|
+
this.wrap = inputs.wrap;
|
|
226
|
+
this.orientation = inputs.orientation;
|
|
227
|
+
this.textDirection = inputs.textDirection;
|
|
228
|
+
this.multi = inputs.multi;
|
|
229
|
+
this.value = inputs.value;
|
|
230
|
+
this.selectionMode = inputs.selectionMode;
|
|
231
|
+
this.typeaheadDelay = inputs.typeaheadDelay;
|
|
232
|
+
this.focusManager = new ListFocus({
|
|
233
|
+
...inputs,
|
|
234
|
+
items: this.visibleItems,
|
|
235
|
+
});
|
|
236
|
+
this.navigationManager = new ListNavigation({
|
|
237
|
+
...inputs,
|
|
238
|
+
wrap: computed(() => this.inputs.wrap() && !this.inSelection()),
|
|
239
|
+
items: this.visibleItems,
|
|
240
|
+
focusManager: this.focusManager,
|
|
241
|
+
});
|
|
242
|
+
this.selectionManager = new ListSelection({
|
|
243
|
+
...inputs,
|
|
244
|
+
items: this.visibleItems,
|
|
245
|
+
focusManager: this.focusManager,
|
|
246
|
+
});
|
|
247
|
+
this.typeaheadManager = new ListTypeahead({
|
|
248
|
+
...inputs,
|
|
249
|
+
items: this.visibleItems,
|
|
250
|
+
focusManager: this.focusManager,
|
|
251
|
+
});
|
|
252
|
+
this.expansionManager = new ListExpansion({
|
|
253
|
+
multiExpandable: () => true,
|
|
254
|
+
// TODO(ok7sai): allow pre-expanded tree items.
|
|
255
|
+
expandedIds: signal([]),
|
|
256
|
+
items: this.children,
|
|
257
|
+
disabled: this.disabled,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Sets the tree to it's default initial state.
|
|
262
|
+
*
|
|
263
|
+
* Sets the active index of the tree to the first focusable selected tree item if one exists.
|
|
264
|
+
* Otherwise, sets focus to the first focusable tree item.
|
|
265
|
+
*/
|
|
266
|
+
setDefaultState() {
|
|
267
|
+
let firstItemIndex;
|
|
268
|
+
for (const [index, item] of this.allItems().entries()) {
|
|
269
|
+
if (!item.visible())
|
|
270
|
+
continue;
|
|
271
|
+
if (!this.focusManager.isFocusable(item))
|
|
272
|
+
continue;
|
|
273
|
+
if (firstItemIndex === undefined) {
|
|
274
|
+
firstItemIndex = index;
|
|
275
|
+
}
|
|
276
|
+
if (item.selected()) {
|
|
277
|
+
this.activeIndex.set(index);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (firstItemIndex !== undefined) {
|
|
282
|
+
this.activeIndex.set(firstItemIndex);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/** Handles keydown events on the tree. */
|
|
286
|
+
onKeydown(event) {
|
|
287
|
+
if (!this.disabled()) {
|
|
288
|
+
this.keydown().handle(event);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/** Handles pointerdown events on the tree. */
|
|
292
|
+
onPointerdown(event) {
|
|
293
|
+
if (!this.disabled()) {
|
|
294
|
+
this.pointerdown().handle(event);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/** Navigates to the first visible tree item in the tree. */
|
|
298
|
+
first(opts) {
|
|
299
|
+
this._navigate(opts, () => this.navigationManager.first());
|
|
300
|
+
}
|
|
301
|
+
/** Navigates to the last visible tree item in the tree. */
|
|
302
|
+
last(opts) {
|
|
303
|
+
this._navigate(opts, () => this.navigationManager.last());
|
|
304
|
+
}
|
|
305
|
+
/** Navigates to the next visible tree item in the tree. */
|
|
306
|
+
next(opts) {
|
|
307
|
+
this._navigate(opts, () => this.navigationManager.next());
|
|
308
|
+
}
|
|
309
|
+
/** Navigates to the previous visible tree item in the tree. */
|
|
310
|
+
prev(opts) {
|
|
311
|
+
this._navigate(opts, () => this.navigationManager.prev());
|
|
312
|
+
}
|
|
313
|
+
/** Navigates to the given tree item in the tree. */
|
|
314
|
+
goto(event, opts) {
|
|
315
|
+
const item = this._getItem(event);
|
|
316
|
+
this._navigate(opts, () => this.navigationManager.goto(item));
|
|
317
|
+
this.toggleExpansion(item);
|
|
318
|
+
}
|
|
319
|
+
/** Handles typeahead search navigation for the tree. */
|
|
320
|
+
search(char, opts) {
|
|
321
|
+
this._navigate(opts, () => this.typeaheadManager.search(char));
|
|
322
|
+
}
|
|
323
|
+
/** Toggles to expand or collapse a tree item. */
|
|
324
|
+
toggleExpansion(item) {
|
|
325
|
+
item ??= this.focusManager.activeItem();
|
|
326
|
+
if (!item || !this.focusManager.isFocusable(item))
|
|
327
|
+
return;
|
|
328
|
+
if (!item.expandable())
|
|
329
|
+
return;
|
|
330
|
+
if (item.expanded()) {
|
|
331
|
+
this.collapse();
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
item.expansion.open();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/** Expands a tree item. */
|
|
338
|
+
expand(item) {
|
|
339
|
+
item ??= this.focusManager.activeItem();
|
|
340
|
+
if (!item || !this.focusManager.isFocusable(item))
|
|
341
|
+
return;
|
|
342
|
+
if (item.expandable() && !item.expanded()) {
|
|
343
|
+
item.expansion.open();
|
|
344
|
+
}
|
|
345
|
+
else if (item.expanded() && item.children().length > 0) {
|
|
346
|
+
const firstChild = item.children()[0];
|
|
347
|
+
if (this.focusManager.isFocusable(firstChild)) {
|
|
348
|
+
this.navigationManager.goto(firstChild);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/** Expands all sibling tree items including itself. */
|
|
353
|
+
expandSiblings(item) {
|
|
354
|
+
item ??= this.focusManager.activeItem();
|
|
355
|
+
const siblings = item.parent()?.children();
|
|
356
|
+
siblings?.forEach(item => this.expand(item));
|
|
357
|
+
}
|
|
358
|
+
/** Collapses a tree item. */
|
|
359
|
+
collapse(item) {
|
|
360
|
+
item ??= this.focusManager.activeItem();
|
|
361
|
+
if (!item || !this.focusManager.isFocusable(item))
|
|
362
|
+
return;
|
|
363
|
+
if (item.expandable() && item.expanded()) {
|
|
364
|
+
item.expansion.close();
|
|
365
|
+
}
|
|
366
|
+
else if (item.parent() && item.parent() !== this) {
|
|
367
|
+
const parentItem = item.parent();
|
|
368
|
+
if (parentItem instanceof TreeItemPattern && this.focusManager.isFocusable(parentItem)) {
|
|
369
|
+
this.navigationManager.goto(parentItem);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/** Safely performs a navigation operation. */
|
|
374
|
+
_navigate(opts = {}, operation) {
|
|
375
|
+
if (opts?.selectRange) {
|
|
376
|
+
this.inSelection.set(true);
|
|
377
|
+
this.selectionManager.rangeStartIndex.set(this.anchorIndex());
|
|
378
|
+
}
|
|
379
|
+
const moved = operation();
|
|
380
|
+
if (moved) {
|
|
381
|
+
this._updateSelection(opts);
|
|
382
|
+
}
|
|
383
|
+
this.inSelection.set(false);
|
|
384
|
+
}
|
|
385
|
+
/** Handles updating selection for the tree. */
|
|
386
|
+
_updateSelection(opts = { anchor: true }) {
|
|
387
|
+
if (opts.toggle) {
|
|
388
|
+
this.selectionManager.toggle();
|
|
389
|
+
}
|
|
390
|
+
if (opts.selectOne) {
|
|
391
|
+
this.selectionManager.selectOne();
|
|
392
|
+
}
|
|
393
|
+
if (opts.selectRange) {
|
|
394
|
+
this.selectionManager.selectRange();
|
|
395
|
+
}
|
|
396
|
+
if (!opts.anchor) {
|
|
397
|
+
this.anchorItem.set(this.visibleItems()[this.selectionManager.rangeStartIndex()]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/** Retrieves the TreeItemPattern associated with a DOM event, if any. */
|
|
401
|
+
_getItem(event) {
|
|
402
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const element = event.target.closest('[role="treeitem"]');
|
|
406
|
+
return this.inputs.allItems().find(i => i.element() === element);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Sort directives by their document order.
|
|
412
|
+
*/
|
|
413
|
+
function sortDirectives(a, b) {
|
|
414
|
+
return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0
|
|
415
|
+
? 1
|
|
416
|
+
: -1;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* A Tree container.
|
|
420
|
+
*
|
|
421
|
+
* Transforms nested lists into an accessible, ARIA-compliant tree structure.
|
|
422
|
+
*
|
|
423
|
+
* ```html
|
|
424
|
+
* <ul cdkTree [(value)]="selectedItems" [multi]="true">
|
|
425
|
+
* <li cdkTreeItem [value]="'leaf1'">Leaf Item 1</li>
|
|
426
|
+
* <li cdkTreeItem [value]="'parent1'">
|
|
427
|
+
* Parent Item 1
|
|
428
|
+
* <ul cdkTreeItemGroup [value]="'parent1'">
|
|
429
|
+
* <ng-template cdkTreeItemGroupContent>
|
|
430
|
+
* <li cdkTreeItem [value]="'child1.1'">Child Item 1.1</li>
|
|
431
|
+
* <li cdkTreeItem [value]="'child1.2'">Child Item 1.2</li>
|
|
432
|
+
* </ng-template>
|
|
433
|
+
* </ul>
|
|
434
|
+
* </li>
|
|
435
|
+
* <li cdkTreeItem [value]="'leaf2'" [disabled]="true">Disabled Leaf Item 2</li>
|
|
436
|
+
* </ul>
|
|
437
|
+
* ```
|
|
438
|
+
*/
|
|
439
|
+
class CdkTree {
|
|
440
|
+
/** All CdkTreeItem instances within this tree. */
|
|
441
|
+
_unorderedItems = signal(new Set());
|
|
442
|
+
/** All CdkGroup instances within this tree. */
|
|
443
|
+
unorderedGroups = signal(new Set());
|
|
444
|
+
/** Orientation of the tree. */
|
|
445
|
+
orientation = input('vertical');
|
|
446
|
+
/** Whether multi-selection is allowed. */
|
|
447
|
+
multi = input(false, { transform: booleanAttribute });
|
|
448
|
+
/** Whether the tree is disabled. */
|
|
449
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
450
|
+
/** The selection strategy used by the tree. */
|
|
451
|
+
selectionMode = input('explicit');
|
|
452
|
+
/** The focus strategy used by the tree. */
|
|
453
|
+
focusMode = input('roving');
|
|
454
|
+
/** Whether navigation wraps. */
|
|
455
|
+
wrap = input(true, { transform: booleanAttribute });
|
|
456
|
+
/** Whether to skip disabled items during navigation. */
|
|
457
|
+
skipDisabled = input(true, { transform: booleanAttribute });
|
|
458
|
+
/** Typeahead delay. */
|
|
459
|
+
typeaheadDelay = input(0.5);
|
|
460
|
+
/** Selected item values. */
|
|
461
|
+
value = model([]);
|
|
462
|
+
/** Text direction. */
|
|
463
|
+
textDirection = inject(Directionality).valueSignal;
|
|
464
|
+
/** The UI pattern for the tree. */
|
|
465
|
+
pattern = new TreePattern({
|
|
466
|
+
...this,
|
|
467
|
+
allItems: computed(() => [...this._unorderedItems()].sort(sortDirectives).map(item => item.pattern)),
|
|
468
|
+
activeIndex: signal(0),
|
|
469
|
+
});
|
|
470
|
+
/** Whether the tree has received focus yet. */
|
|
471
|
+
_hasFocused = signal(false);
|
|
472
|
+
constructor() {
|
|
473
|
+
afterRenderEffect(() => {
|
|
474
|
+
if (!this._hasFocused()) {
|
|
475
|
+
this.pattern.setDefaultState();
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
onFocus() {
|
|
480
|
+
this._hasFocused.set(true);
|
|
481
|
+
}
|
|
482
|
+
register(child) {
|
|
483
|
+
if (child instanceof CdkTreeItemGroup) {
|
|
484
|
+
this.unorderedGroups().add(child);
|
|
485
|
+
this.unorderedGroups.set(new Set(this.unorderedGroups()));
|
|
486
|
+
}
|
|
487
|
+
if (child instanceof CdkTreeItem) {
|
|
488
|
+
this._unorderedItems().add(child);
|
|
489
|
+
this._unorderedItems.set(new Set(this._unorderedItems()));
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
deregister(child) {
|
|
493
|
+
if (child instanceof CdkTreeItemGroup) {
|
|
494
|
+
this.unorderedGroups().delete(child);
|
|
495
|
+
this.unorderedGroups.set(new Set(this.unorderedGroups()));
|
|
496
|
+
}
|
|
497
|
+
if (child instanceof CdkTreeItem) {
|
|
498
|
+
this._unorderedItems().delete(child);
|
|
499
|
+
this._unorderedItems.set(new Set(this._unorderedItems()));
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTree, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
503
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: CdkTree, isStandalone: true, selector: "[cdkTree]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, focusMode: { classPropertyName: "focusMode", publicName: "focusMode", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, skipDisabled: { classPropertyName: "skipDisabled", publicName: "skipDisabled", isSignal: true, isRequired: false, transformFunction: null }, typeaheadDelay: { classPropertyName: "typeaheadDelay", publicName: "typeaheadDelay", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "tree" }, listeners: { "keydown": "pattern.onKeydown($event)", "pointerdown": "pattern.onPointerdown($event)", "focusin": "onFocus()" }, properties: { "attr.aria-orientation": "pattern.orientation()", "attr.aria-multiselectable": "pattern.multi()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-activedescendant": "pattern.activedescendant()", "tabindex": "pattern.tabindex()" }, classAttribute: "cdk-tree" }, exportAs: ["cdkTree"], ngImport: i0 });
|
|
504
|
+
}
|
|
505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTree, decorators: [{
|
|
506
|
+
type: Directive,
|
|
507
|
+
args: [{
|
|
508
|
+
selector: '[cdkTree]',
|
|
509
|
+
exportAs: 'cdkTree',
|
|
510
|
+
host: {
|
|
511
|
+
'class': 'cdk-tree',
|
|
512
|
+
'role': 'tree',
|
|
513
|
+
'[attr.aria-orientation]': 'pattern.orientation()',
|
|
514
|
+
'[attr.aria-multiselectable]': 'pattern.multi()',
|
|
515
|
+
'[attr.aria-disabled]': 'pattern.disabled()',
|
|
516
|
+
'[attr.aria-activedescendant]': 'pattern.activedescendant()',
|
|
517
|
+
'[tabindex]': 'pattern.tabindex()',
|
|
518
|
+
'(keydown)': 'pattern.onKeydown($event)',
|
|
519
|
+
'(pointerdown)': 'pattern.onPointerdown($event)',
|
|
520
|
+
'(focusin)': 'onFocus()',
|
|
521
|
+
},
|
|
522
|
+
}]
|
|
523
|
+
}], ctorParameters: () => [] });
|
|
524
|
+
/**
|
|
525
|
+
* A selectable and expandable Tree Item in a Tree.
|
|
526
|
+
*/
|
|
527
|
+
class CdkTreeItem {
|
|
528
|
+
/** A reference to the tree item element. */
|
|
529
|
+
_elementRef = inject(ElementRef);
|
|
530
|
+
/** A unique identifier for the tree item. */
|
|
531
|
+
_id = inject(_IdGenerator).getId('cdk-tree-item-');
|
|
532
|
+
/** The top level CdkTree. */
|
|
533
|
+
_tree = inject((CdkTree));
|
|
534
|
+
/** The parent CdkTreeItem. */
|
|
535
|
+
_treeItem = inject((CdkTreeItem), { optional: true, skipSelf: true });
|
|
536
|
+
/** The parent CdkGroup, if any. */
|
|
537
|
+
_parentGroup = inject((CdkTreeItemGroup), { optional: true });
|
|
538
|
+
/** The top level TreePattern. */
|
|
539
|
+
_treePattern = computed(() => this._tree.pattern);
|
|
540
|
+
/** The parent TreeItemPattern. */
|
|
541
|
+
_parentPattern = computed(() => this._treeItem?.pattern ?? this._treePattern());
|
|
542
|
+
/** The host native element. */
|
|
543
|
+
element = computed(() => this._elementRef.nativeElement);
|
|
544
|
+
/** The value of the tree item. */
|
|
545
|
+
value = input.required();
|
|
546
|
+
/** Whether the tree item is disabled. */
|
|
547
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
548
|
+
/** Optional label for typeahead. Defaults to the element's textContent. */
|
|
549
|
+
label = input();
|
|
550
|
+
/** Search term for typeahead. */
|
|
551
|
+
searchTerm = computed(() => this.label() ?? this.element().textContent);
|
|
552
|
+
/** Manual group assignment. */
|
|
553
|
+
group = signal(undefined);
|
|
554
|
+
/** The UI pattern for this item. */
|
|
555
|
+
pattern = new TreeItemPattern({
|
|
556
|
+
...this,
|
|
557
|
+
id: () => this._id,
|
|
558
|
+
tree: this._treePattern,
|
|
559
|
+
parent: this._parentPattern,
|
|
560
|
+
children: computed(() => this.group()
|
|
561
|
+
?.children()
|
|
562
|
+
.map(item => item.pattern) ?? []),
|
|
563
|
+
hasChildren: computed(() => !!this.group()),
|
|
564
|
+
});
|
|
565
|
+
constructor() {
|
|
566
|
+
afterRenderEffect(() => {
|
|
567
|
+
const group = [...this._tree.unorderedGroups()].find(group => group.value() === this.value());
|
|
568
|
+
if (group) {
|
|
569
|
+
this.group.set(group);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
// Updates the visibility of the owned group.
|
|
573
|
+
afterRenderEffect(() => {
|
|
574
|
+
this.group()?.visible.set(this.pattern.expanded());
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
ngOnInit() {
|
|
578
|
+
this._tree.register(this);
|
|
579
|
+
this._parentGroup?.register(this);
|
|
580
|
+
}
|
|
581
|
+
ngOnDestroy() {
|
|
582
|
+
this._tree.deregister(this);
|
|
583
|
+
this._parentGroup?.deregister(this);
|
|
584
|
+
}
|
|
585
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
586
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: CdkTreeItem, isStandalone: true, selector: "[cdkTreeItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "treeitem" }, properties: { "class.cdk-active": "pattern.active()", "id": "pattern.id()", "attr.aria-expanded": "pattern.expandable() ? pattern.expanded() : null", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-level": "pattern.level()", "attr.aria-owns": "group()?.id", "attr.aria-setsize": "pattern.setsize()", "attr.aria-posinset": "pattern.posinset()", "attr.tabindex": "pattern.tabindex()", "attr.inert": "pattern.visible() ? null : true" }, classAttribute: "cdk-treeitem" }, exportAs: ["cdkTreeItem"], ngImport: i0 });
|
|
587
|
+
}
|
|
588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItem, decorators: [{
|
|
589
|
+
type: Directive,
|
|
590
|
+
args: [{
|
|
591
|
+
selector: '[cdkTreeItem]',
|
|
592
|
+
exportAs: 'cdkTreeItem',
|
|
593
|
+
host: {
|
|
594
|
+
'class': 'cdk-treeitem',
|
|
595
|
+
'[class.cdk-active]': 'pattern.active()',
|
|
596
|
+
'role': 'treeitem',
|
|
597
|
+
'[id]': 'pattern.id()',
|
|
598
|
+
'[attr.aria-expanded]': 'pattern.expandable() ? pattern.expanded() : null',
|
|
599
|
+
'[attr.aria-selected]': 'pattern.selected()',
|
|
600
|
+
'[attr.aria-disabled]': 'pattern.disabled()',
|
|
601
|
+
'[attr.aria-level]': 'pattern.level()',
|
|
602
|
+
'[attr.aria-owns]': 'group()?.id',
|
|
603
|
+
'[attr.aria-setsize]': 'pattern.setsize()',
|
|
604
|
+
'[attr.aria-posinset]': 'pattern.posinset()',
|
|
605
|
+
'[attr.tabindex]': 'pattern.tabindex()',
|
|
606
|
+
'[attr.inert]': 'pattern.visible() ? null : true',
|
|
607
|
+
},
|
|
608
|
+
}]
|
|
609
|
+
}], ctorParameters: () => [] });
|
|
610
|
+
/**
|
|
611
|
+
* Container that designates content as a group.
|
|
612
|
+
*/
|
|
613
|
+
class CdkTreeItemGroup {
|
|
614
|
+
/** A reference to the group element. */
|
|
615
|
+
_elementRef = inject(ElementRef);
|
|
616
|
+
/** The DeferredContentAware host directive. */
|
|
617
|
+
_deferredContentAware = inject(DeferredContentAware);
|
|
618
|
+
/** The top level CdkTree. */
|
|
619
|
+
_tree = inject((CdkTree));
|
|
620
|
+
/** All groupable items that are descendants of the group. */
|
|
621
|
+
_unorderedItems = signal(new Set());
|
|
622
|
+
/** The host native element. */
|
|
623
|
+
element = computed(() => this._elementRef.nativeElement);
|
|
624
|
+
/** Unique ID for the group. */
|
|
625
|
+
id = inject(_IdGenerator).getId('cdk-tree-group-');
|
|
626
|
+
/** Whether the group is visible. */
|
|
627
|
+
visible = signal(true);
|
|
628
|
+
/** Child items within this group. */
|
|
629
|
+
children = computed(() => [...this._unorderedItems()].sort(sortDirectives));
|
|
630
|
+
/** Identifier for matching the group owner. */
|
|
631
|
+
value = input.required();
|
|
632
|
+
constructor() {
|
|
633
|
+
// Connect the group's hidden state to the DeferredContentAware's visibility.
|
|
634
|
+
afterRenderEffect(() => {
|
|
635
|
+
this._deferredContentAware.contentVisible.set(this.visible());
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
ngOnInit() {
|
|
639
|
+
this._tree.register(this);
|
|
640
|
+
}
|
|
641
|
+
ngOnDestroy() {
|
|
642
|
+
this._tree.deregister(this);
|
|
643
|
+
}
|
|
644
|
+
register(child) {
|
|
645
|
+
this._unorderedItems().add(child);
|
|
646
|
+
this._unorderedItems.set(new Set(this._unorderedItems()));
|
|
647
|
+
}
|
|
648
|
+
deregister(child) {
|
|
649
|
+
this._unorderedItems().delete(child);
|
|
650
|
+
this._unorderedItems.set(new Set(this._unorderedItems()));
|
|
651
|
+
}
|
|
652
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItemGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
653
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: CdkTreeItemGroup, isStandalone: true, selector: "[cdkTreeItemGroup]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "id": "id", "attr.inert": "visible() ? null : true" }, classAttribute: "cdk-treeitem-group" }, exportAs: ["cdkTreeItemGroup"], hostDirectives: [{ directive: i1.DeferredContentAware, inputs: ["preserveContent", "preserveContent"] }], ngImport: i0 });
|
|
654
|
+
}
|
|
655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItemGroup, decorators: [{
|
|
656
|
+
type: Directive,
|
|
657
|
+
args: [{
|
|
658
|
+
selector: '[cdkTreeItemGroup]',
|
|
659
|
+
exportAs: 'cdkTreeItemGroup',
|
|
660
|
+
hostDirectives: [
|
|
661
|
+
{
|
|
662
|
+
directive: DeferredContentAware,
|
|
663
|
+
inputs: ['preserveContent'],
|
|
664
|
+
},
|
|
665
|
+
],
|
|
666
|
+
host: {
|
|
667
|
+
'class': 'cdk-treeitem-group',
|
|
668
|
+
'role': 'group',
|
|
669
|
+
'[id]': 'id',
|
|
670
|
+
'[attr.inert]': 'visible() ? null : true',
|
|
671
|
+
},
|
|
672
|
+
}]
|
|
673
|
+
}], ctorParameters: () => [] });
|
|
674
|
+
/**
|
|
675
|
+
* A structural directive that marks the `ng-template` to be used as the content
|
|
676
|
+
* for a `CdkTreeItemGroup`. This content can be lazily loaded.
|
|
677
|
+
*/
|
|
678
|
+
class CdkTreeItemGroupContent {
|
|
679
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItemGroupContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
680
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: CdkTreeItemGroupContent, isStandalone: true, selector: "ng-template[cdkTreeItemGroupContent]", hostDirectives: [{ directive: i1.DeferredContent }], ngImport: i0 });
|
|
681
|
+
}
|
|
682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkTreeItemGroupContent, decorators: [{
|
|
683
|
+
type: Directive,
|
|
684
|
+
args: [{
|
|
685
|
+
selector: 'ng-template[cdkTreeItemGroupContent]',
|
|
686
|
+
hostDirectives: [DeferredContent],
|
|
687
|
+
}]
|
|
688
|
+
}] });
|
|
689
|
+
|
|
690
|
+
export { CdkTree, CdkTreeItem, CdkTreeItemGroup, CdkTreeItemGroupContent };
|
|
691
|
+
//# sourceMappingURL=tree.mjs.map
|