@angular/cdk-experimental 20.2.0-next.1 → 20.2.0-next.3
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 +3 -3
- package/{accordion.d-CC6dGMlv.d.ts → accordion.d.d.ts} +7 -5
- package/{expansion.d-Zkcf-XJU.d.ts → expansion.d.d.ts} +3 -3
- package/fesm2022/accordion.mjs +17 -17
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/{accordion-D9JoxtzT.mjs → accordion2.mjs} +8 -6
- package/fesm2022/accordion2.mjs.map +1 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +54 -54
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +10 -10
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +6 -6
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/{expansion-C9iQLHOG.mjs → expansion.mjs} +2 -2
- package/fesm2022/expansion.mjs.map +1 -0
- package/fesm2022/{list-focus-Czul8jzR.mjs → list-navigation.mjs} +63 -62
- package/fesm2022/list-navigation.mjs.map +1 -0
- package/fesm2022/list.mjs +355 -0
- package/fesm2022/list.mjs.map +1 -0
- package/fesm2022/listbox.mjs +12 -13
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option.mjs +231 -0
- package/fesm2022/option.mjs.map +1 -0
- package/fesm2022/{polyfill-CXksG4af.mjs → polyfill.mjs} +2 -2
- package/fesm2022/polyfill.mjs.map +1 -0
- package/fesm2022/popover-edit.mjs +44 -44
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/{radio-button-92xc4w-A.mjs → radio-button.mjs} +33 -70
- package/fesm2022/radio-button.mjs.map +1 -0
- package/fesm2022/radio-group.mjs +10 -10
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +7 -7
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +19 -19
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +7 -7
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs.mjs +20 -20
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/{tabs-hMdwtXv2.mjs → tabs2.mjs} +34 -70
- package/fesm2022/tabs2.mjs.map +1 -0
- package/fesm2022/tree.mjs +87 -159
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +7 -8
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/list.d.d.ts +207 -0
- package/listbox/index.d.ts +5 -6
- package/{listbox.d-Ckp1is82.d.ts → listbox.d.d.ts} +9 -62
- package/package.json +2 -2
- package/{pointer-event-manager.d-BqSm9Jh5.d.ts → pointer-event-manager.d.d.ts} +12 -8
- package/radio-group/index.d.ts +4 -4
- package/{radio-group.d-CFC0aKQM.d.ts → radio-group.d.d.ts} +12 -31
- package/tabs/index.d.ts +4 -4
- package/{tabs.d-Db8oTrMB.d.ts → tabs.d.d.ts} +15 -30
- package/tree/index.d.ts +10 -39
- package/ui-patterns/index.d.ts +7 -8
- package/fesm2022/accordion-D9JoxtzT.mjs.map +0 -1
- package/fesm2022/expansion-C9iQLHOG.mjs.map +0 -1
- package/fesm2022/list-focus-Czul8jzR.mjs.map +0 -1
- package/fesm2022/list-selection-C41ApAbt.mjs +0 -136
- package/fesm2022/list-selection-C41ApAbt.mjs.map +0 -1
- package/fesm2022/list-typeahead-DIIbNJrP.mjs +0 -64
- package/fesm2022/list-typeahead-DIIbNJrP.mjs.map +0 -1
- package/fesm2022/option-CgeKz9_Q.mjs +0 -321
- package/fesm2022/option-CgeKz9_Q.mjs.map +0 -1
- package/fesm2022/polyfill-CXksG4af.mjs.map +0 -1
- package/fesm2022/radio-button-92xc4w-A.mjs.map +0 -1
- package/fesm2022/tabs-hMdwtXv2.mjs.map +0 -1
- package/list-selection.d-fbAPr_N_.d.ts +0 -69
- package/list-typeahead.d-ljh3nJ9y.d.ts +0 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ExpansionControl, ListExpansion } from './expansion.mjs';
|
|
3
|
+
import { List } from './list.mjs';
|
|
4
|
+
import { KeyboardEventManager, PointerEventManager } from './list-navigation.mjs';
|
|
5
5
|
|
|
6
6
|
/** Controls label and description of an element. */
|
|
7
7
|
class LabelControl {
|
|
@@ -35,12 +35,16 @@ class TabPattern {
|
|
|
35
35
|
expansion;
|
|
36
36
|
/** A global unique identifier for the tab. */
|
|
37
37
|
id;
|
|
38
|
+
/** The index of the tab. */
|
|
39
|
+
index = computed(() => this.inputs.tablist().inputs.items().indexOf(this));
|
|
38
40
|
/** A local unique identifier for the tab. */
|
|
39
41
|
value;
|
|
40
42
|
/** Whether the tab is disabled. */
|
|
41
43
|
disabled;
|
|
42
44
|
/** The html element that should receive focus. */
|
|
43
45
|
element;
|
|
46
|
+
/** The text used by the typeahead search. */
|
|
47
|
+
searchTerm = () => ''; // Unused because tabs do not support typeahead.
|
|
44
48
|
/** Whether this tab has expandable content. */
|
|
45
49
|
expandable = computed(() => this.expansion.expandable());
|
|
46
50
|
/** The unique identifier used by the expansion behavior. */
|
|
@@ -48,11 +52,11 @@ class TabPattern {
|
|
|
48
52
|
/** Whether the tab is expanded. */
|
|
49
53
|
expanded = computed(() => this.expansion.isExpanded());
|
|
50
54
|
/** Whether the tab is active. */
|
|
51
|
-
active = computed(() => this.inputs.tablist().
|
|
55
|
+
active = computed(() => this.inputs.tablist().inputs.activeItem() === this);
|
|
52
56
|
/** Whether the tab is selected. */
|
|
53
|
-
selected = computed(() => !!this.inputs.tablist().
|
|
57
|
+
selected = computed(() => !!this.inputs.tablist().inputs.value().includes(this.value()));
|
|
54
58
|
/** The tabindex of the tab. */
|
|
55
|
-
tabindex = computed(() => this.inputs.tablist().
|
|
59
|
+
tabindex = computed(() => this.inputs.tablist().listBehavior.getItemTabindex(this));
|
|
56
60
|
/** The id of the tabpanel associated with the tab. */
|
|
57
61
|
controls = computed(() => this.inputs.tabpanel()?.id());
|
|
58
62
|
constructor(inputs) {
|
|
@@ -99,12 +103,8 @@ class TabPanelPattern {
|
|
|
99
103
|
/** Controls the state of a tablist. */
|
|
100
104
|
class TabListPattern {
|
|
101
105
|
inputs;
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
/** Controls selection for the tablist. */
|
|
105
|
-
selection;
|
|
106
|
-
/** Controls focus for the tablist. */
|
|
107
|
-
focusManager;
|
|
106
|
+
/** The list behavior for the tablist. */
|
|
107
|
+
listBehavior;
|
|
108
108
|
/** Controls expansion for the tablist. */
|
|
109
109
|
expansionManager;
|
|
110
110
|
/** Whether the tablist is vertically or horizontally oriented. */
|
|
@@ -112,9 +112,9 @@ class TabListPattern {
|
|
|
112
112
|
/** Whether the tablist is disabled. */
|
|
113
113
|
disabled;
|
|
114
114
|
/** The tabindex of the tablist. */
|
|
115
|
-
tabindex = computed(() => this.
|
|
115
|
+
tabindex = computed(() => this.listBehavior.tabindex());
|
|
116
116
|
/** The id of the current active tab. */
|
|
117
|
-
activedescendant = computed(() => this.
|
|
117
|
+
activedescendant = computed(() => this.listBehavior.activedescendant());
|
|
118
118
|
/** Whether selection should follow focus. */
|
|
119
119
|
followFocus = computed(() => this.inputs.selectionMode() === 'follow');
|
|
120
120
|
/** The key used to navigate to the previous tab in the tablist. */
|
|
@@ -134,27 +134,25 @@ class TabListPattern {
|
|
|
134
134
|
/** The keydown event manager for the tablist. */
|
|
135
135
|
keydown = computed(() => {
|
|
136
136
|
return new KeyboardEventManager()
|
|
137
|
-
.on(this.prevKey, () => this.prev({ select: this.followFocus() }))
|
|
138
|
-
.on(this.nextKey, () => this.next({ select: this.followFocus() }))
|
|
139
|
-
.on('Home', () => this.first({ select: this.followFocus() }))
|
|
140
|
-
.on('End', () => this.last({ select: this.followFocus() }))
|
|
141
|
-
.on(' ', () => this.
|
|
142
|
-
.on('Enter', () => this.
|
|
137
|
+
.on(this.prevKey, () => this.listBehavior.prev({ select: this.followFocus() }))
|
|
138
|
+
.on(this.nextKey, () => this.listBehavior.next({ select: this.followFocus() }))
|
|
139
|
+
.on('Home', () => this.listBehavior.first({ select: this.followFocus() }))
|
|
140
|
+
.on('End', () => this.listBehavior.last({ select: this.followFocus() }))
|
|
141
|
+
.on(' ', () => this.listBehavior.select())
|
|
142
|
+
.on('Enter', () => this.listBehavior.select());
|
|
143
143
|
});
|
|
144
144
|
/** The pointerdown event manager for the tablist. */
|
|
145
145
|
pointerdown = computed(() => {
|
|
146
|
-
return new PointerEventManager().on(e => this.goto(e, { select: true }));
|
|
146
|
+
return new PointerEventManager().on(e => this.listBehavior.goto(this._getItem(e), { select: true }));
|
|
147
147
|
});
|
|
148
148
|
constructor(inputs) {
|
|
149
149
|
this.inputs = inputs;
|
|
150
150
|
this.disabled = inputs.disabled;
|
|
151
151
|
this.orientation = inputs.orientation;
|
|
152
|
-
this.
|
|
153
|
-
this.navigation = new ListNavigation({ ...inputs, focusManager: this.focusManager });
|
|
154
|
-
this.selection = new ListSelection({
|
|
152
|
+
this.listBehavior = new List({
|
|
155
153
|
...inputs,
|
|
156
154
|
multi: () => false,
|
|
157
|
-
|
|
155
|
+
typeaheadDelay: () => 0, // Tabs do not support typeahead.
|
|
158
156
|
});
|
|
159
157
|
this.expansionManager = new ListExpansion({
|
|
160
158
|
...inputs,
|
|
@@ -171,20 +169,20 @@ class TabListPattern {
|
|
|
171
169
|
* This method should be called once the tablist and its tabs are properly initialized.
|
|
172
170
|
*/
|
|
173
171
|
setDefaultState() {
|
|
174
|
-
let
|
|
175
|
-
for (const
|
|
176
|
-
if (!this.
|
|
172
|
+
let firstItem;
|
|
173
|
+
for (const item of this.inputs.items()) {
|
|
174
|
+
if (!this.listBehavior.isFocusable(item))
|
|
177
175
|
continue;
|
|
178
|
-
if (
|
|
179
|
-
|
|
176
|
+
if (firstItem === undefined) {
|
|
177
|
+
firstItem = item;
|
|
180
178
|
}
|
|
181
179
|
if (item.selected()) {
|
|
182
|
-
this.inputs.
|
|
180
|
+
this.inputs.activeItem.set(item);
|
|
183
181
|
return;
|
|
184
182
|
}
|
|
185
183
|
}
|
|
186
|
-
if (
|
|
187
|
-
this.inputs.
|
|
184
|
+
if (firstItem !== undefined) {
|
|
185
|
+
this.inputs.activeItem.set(firstItem);
|
|
188
186
|
}
|
|
189
187
|
}
|
|
190
188
|
/** Handles keydown events for the tablist. */
|
|
@@ -199,41 +197,7 @@ class TabListPattern {
|
|
|
199
197
|
this.pointerdown().handle(event);
|
|
200
198
|
}
|
|
201
199
|
}
|
|
202
|
-
/**
|
|
203
|
-
first(opts) {
|
|
204
|
-
this.navigation.first();
|
|
205
|
-
this._select(opts);
|
|
206
|
-
}
|
|
207
|
-
/** Navigates to the last option in the tablist. */
|
|
208
|
-
last(opts) {
|
|
209
|
-
this.navigation.last();
|
|
210
|
-
this._select(opts);
|
|
211
|
-
}
|
|
212
|
-
/** Navigates to the next option in the tablist. */
|
|
213
|
-
next(opts) {
|
|
214
|
-
this.navigation.next();
|
|
215
|
-
this._select(opts);
|
|
216
|
-
}
|
|
217
|
-
/** Navigates to the previous option in the tablist. */
|
|
218
|
-
prev(opts) {
|
|
219
|
-
this.navigation.prev();
|
|
220
|
-
this._select(opts);
|
|
221
|
-
}
|
|
222
|
-
/** Navigates to the given item in the tablist. */
|
|
223
|
-
goto(event, opts) {
|
|
224
|
-
const item = this._getItem(event);
|
|
225
|
-
if (item) {
|
|
226
|
-
this.navigation.goto(item);
|
|
227
|
-
this._select(opts);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
/** Handles updating selection for the tablist. */
|
|
231
|
-
_select(opts) {
|
|
232
|
-
if (opts?.select) {
|
|
233
|
-
this.selection.selectOne();
|
|
234
|
-
this.expansionManager.open(this.focusManager.activeItem());
|
|
235
|
-
}
|
|
236
|
-
}
|
|
200
|
+
/** Returns the tab item associated with the given pointer event. */
|
|
237
201
|
_getItem(e) {
|
|
238
202
|
if (!(e.target instanceof HTMLElement)) {
|
|
239
203
|
return;
|
|
@@ -243,5 +207,5 @@ class TabListPattern {
|
|
|
243
207
|
}
|
|
244
208
|
}
|
|
245
209
|
|
|
246
|
-
export { TabListPattern
|
|
247
|
-
//# sourceMappingURL=
|
|
210
|
+
export { TabListPattern, TabPanelPattern, TabPattern };
|
|
211
|
+
//# sourceMappingURL=tabs2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs2.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/label/label.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/tabs/tabs.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\n\n/** Represents the required inputs for the label control. */\nexport interface LabelControlInputs {\n /** The default `aria-labelledby` ids. */\n defaultLabelledBy: SignalLike<string[]>;\n}\n\n/** Represents the optional inputs for the label control. */\nexport interface LabelControlOptionalInputs {\n /** The `aria-label`. */\n label?: SignalLike<string | undefined>;\n\n /** The user-provided `aria-labelledby` ids. */\n labelledBy?: SignalLike<string[]>;\n}\n\n/** Controls label and description of an element. */\nexport class LabelControl {\n /** The `aria-label`. */\n readonly label = computed(() => this.inputs.label?.());\n\n /** The `aria-labelledby` ids. */\n readonly labelledBy = computed(() => {\n const label = this.label();\n const labelledBy = this.inputs.labelledBy?.();\n const defaultLabelledBy = this.inputs.defaultLabelledBy();\n\n if (labelledBy && labelledBy.length > 0) {\n return labelledBy;\n }\n\n // If an aria-label is provided by developers, do not set aria-labelledby with the\n // defaultLabelledBy value because if both attributes are set, aria-labelledby will be used.\n if (label) {\n return [];\n }\n\n return defaultLabelledBy;\n });\n\n constructor(readonly inputs: LabelControlInputs & LabelControlOptionalInputs) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {\n ExpansionItem,\n ExpansionControl,\n ListExpansionInputs,\n ListExpansion,\n} from '../behaviors/expansion/expansion';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {LabelControl, LabelControlOptionalInputs} from '../behaviors/label/label';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** The required inputs to tabs. */\nexport interface TabInputs\n extends Omit<ListItem<string>, 'searchTerm' | 'index'>,\n Omit<ExpansionItem, 'expansionId' | 'expandable'> {\n /** The parent tablist that controls the tab. */\n tablist: SignalLike<TabListPattern>;\n\n /** The remote tabpanel controlled by the tab. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** Controls expansion for this tab. */\n readonly expansion: ExpansionControl;\n\n /** A global unique identifier for the tab. */\n readonly id: SignalLike<string>;\n\n /** The index of the tab. */\n readonly index = computed(() => this.inputs.tablist().inputs.items().indexOf(this));\n\n /** A local unique identifier for the tab. */\n readonly value: SignalLike<string>;\n\n /** Whether the tab is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because tabs do not support typeahead.\n\n /** Whether this tab has expandable content. */\n readonly expandable = computed(() => this.expansion.expandable());\n\n /** The unique identifier used by the expansion behavior. */\n readonly expansionId = computed(() => this.expansion.expansionId());\n\n /** Whether the tab is expanded. */\n readonly expanded = computed(() => this.expansion.isExpanded());\n\n /** Whether the tab is active. */\n readonly active = computed(() => this.inputs.tablist().inputs.activeItem() === this);\n\n /** Whether the tab is selected. */\n readonly selected = computed(() => !!this.inputs.tablist().inputs.value().includes(this.value()));\n\n /** The tabindex of the tab. */\n readonly tabindex = computed(() => this.inputs.tablist().listBehavior.getItemTabindex(this));\n\n /** The id of the tabpanel associated with the tab. */\n readonly controls = computed(() => this.inputs.tabpanel()?.id());\n\n constructor(readonly inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.disabled = inputs.disabled;\n this.element = inputs.element;\n this.expansion = new ExpansionControl({\n ...inputs,\n expansionId: inputs.value,\n expandable: () => true,\n expansionManager: inputs.tablist().expansionManager,\n });\n }\n}\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs extends LabelControlOptionalInputs {\n id: SignalLike<string>;\n tab: SignalLike<TabPattern | undefined>;\n value: SignalLike<string>;\n}\n\n/** A tabpanel associated with a tab. */\nexport class TabPanelPattern {\n /** A global unique identifier for the tabpanel. */\n readonly id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n readonly value: SignalLike<string>;\n\n /** Controls label for this tabpanel. */\n readonly labelManager: LabelControl;\n\n /** Whether the tabpanel is hidden. */\n readonly hidden = computed(() => this.inputs.tab()?.expanded() === false);\n\n /** The tabindex of this tabpanel. */\n readonly tabindex = computed(() => (this.hidden() ? -1 : 0));\n\n /** The aria-labelledby value for this tabpanel. */\n readonly labelledBy = computed(() =>\n this.labelManager.labelledBy().length > 0\n ? this.labelManager.labelledBy().join(' ')\n : undefined,\n );\n\n constructor(readonly inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.labelManager = new LabelControl({\n ...inputs,\n defaultLabelledBy: computed(() => (this.inputs.tab() ? [this.inputs.tab()!.id()] : [])),\n });\n }\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> &\n Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** The list behavior for the tablist. */\n readonly listBehavior: List<TabPattern, string>;\n\n /** Controls expansion for the tablist. */\n readonly expansionManager: ListExpansion;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n readonly tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active tab. */\n readonly activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** Whether selection should follow focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the tablist. */\n readonly keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.listBehavior.prev({select: this.followFocus()}))\n .on(this.nextKey, () => this.listBehavior.next({select: this.followFocus()}))\n .on('Home', () => this.listBehavior.first({select: this.followFocus()}))\n .on('End', () => this.listBehavior.last({select: this.followFocus()}))\n .on(' ', () => this.listBehavior.select())\n .on('Enter', () => this.listBehavior.select());\n });\n\n /** The pointerdown event manager for the tablist. */\n readonly pointerdown = computed(() => {\n return new PointerEventManager().on(e =>\n this.listBehavior.goto(this._getItem(e)!, {select: true}),\n );\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n typeaheadDelay: () => 0, // Tabs do not support typeahead.\n });\n\n this.expansionManager = new ListExpansion({\n ...inputs,\n multiExpandable: () => false,\n expandedIds: this.inputs.value,\n });\n }\n\n /**\n * Sets the tablist to its default initial state.\n *\n * Sets the active index of the tablist to the first focusable selected\n * tab if one exists. Otherwise, sets focus to the first focusable tab.\n *\n * This method should be called once the tablist and its tabs are properly initialized.\n */\n setDefaultState() {\n let firstItem: TabPattern | undefined;\n\n for (const item of this.inputs.items()) {\n if (!this.listBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n if (firstItem !== undefined) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Handles keydown events for the tablist. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** The pointerdown event manager for the tablist. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Returns the tab item associated with the given pointer event. */\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"tab\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":[],"mappings":";;;;;AAyBA;MACa,YAAY,CAAA;AAuBF,IAAA,MAAA;;AArBZ,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;;AAG7C,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAClC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI;QAC7C,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;QAEzD,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;AACvC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