@angular/cdk-experimental 20.0.0-next.7 → 20.0.0-next.8

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.
Files changed (37) hide show
  1. package/combobox/index.d.ts +1 -0
  2. package/fesm2022/cdk-experimental.mjs +1 -1
  3. package/fesm2022/cdk-experimental.mjs.map +1 -1
  4. package/fesm2022/column-resize.mjs +1 -2
  5. package/fesm2022/column-resize.mjs.map +1 -1
  6. package/fesm2022/combobox.mjs +4 -4
  7. package/fesm2022/combobox.mjs.map +1 -1
  8. package/fesm2022/deferred-content.mjs.map +1 -1
  9. package/fesm2022/{list-focus-DtTH4bDx.mjs → list-focus-CSTLIgwc.mjs} +111 -87
  10. package/fesm2022/list-focus-CSTLIgwc.mjs.map +1 -0
  11. package/fesm2022/listbox.mjs +2 -2
  12. package/fesm2022/listbox.mjs.map +1 -1
  13. package/fesm2022/{option-Bgpacz3g.mjs → option-D1-Zcobx.mjs} +98 -79
  14. package/fesm2022/option-D1-Zcobx.mjs.map +1 -0
  15. package/fesm2022/polyfill-DRXnWbMt.mjs.map +1 -1
  16. package/fesm2022/popover-edit.mjs +1 -2
  17. package/fesm2022/popover-edit.mjs.map +1 -1
  18. package/fesm2022/scrolling.mjs.map +1 -1
  19. package/fesm2022/selection.mjs.map +1 -1
  20. package/fesm2022/table-scroll-container.mjs +1 -2
  21. package/fesm2022/table-scroll-container.mjs.map +1 -1
  22. package/fesm2022/{tabs-cBelBNjZ.mjs → tabs-C0pLghH2.mjs} +5 -10
  23. package/fesm2022/tabs-C0pLghH2.mjs.map +1 -0
  24. package/fesm2022/tabs.mjs +2 -2
  25. package/fesm2022/tabs.mjs.map +1 -1
  26. package/fesm2022/ui-patterns.mjs +3 -3
  27. package/fesm2022/ui-patterns.mjs.map +1 -1
  28. package/{list-focus.d-1SGksIi8.d.ts → list-navigation.d-cy63EByU.d.ts} +88 -79
  29. package/listbox/index.d.ts +2 -2
  30. package/{listbox.d-C-LFh0S9.d.ts → listbox.d-DJqDR_H3.d.ts} +39 -19
  31. package/package.json +2 -2
  32. package/tabs/index.d.ts +2 -2
  33. package/{tabs.d-BIIDt2Rf.d.ts → tabs.d-CWu2orP4.d.ts} +1 -1
  34. package/ui-patterns/index.d.ts +3 -3
  35. package/fesm2022/list-focus-DtTH4bDx.mjs.map +0 -1
  36. package/fesm2022/option-Bgpacz3g.mjs.map +0 -1
  37. package/fesm2022/tabs-cBelBNjZ.mjs.map +0 -1
@@ -32,7 +32,8 @@ declare enum ModifierKey {
32
32
  Ctrl = 1,
33
33
  Shift = 2,
34
34
  Alt = 4,
35
- Meta = 8
35
+ Meta = 8,
36
+ Any = "Any"
36
37
  }
37
38
  type ModifierInputs = ModifierKey | ModifierKey[];
38
39
  /**
@@ -102,59 +103,57 @@ declare class PointerEventManager<T extends PointerEvent> extends EventManager<T
102
103
  _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
103
104
  }
104
105
 
105
- /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
106
- interface ListNavigationItem {
106
+ /** Represents an item in a collection, such as a listbox option, than may receive focus. */
107
+ interface ListFocusItem {
108
+ /** A unique identifier for the item. */
109
+ id: SignalLike<string>;
110
+ /** The html element that should receive focus. */
111
+ element: SignalLike<HTMLElement>;
107
112
  /** Whether an item is disabled. */
108
113
  disabled: SignalLike<boolean>;
109
114
  }
110
- /** Represents the required inputs for a collection that has navigable items. */
111
- interface ListNavigationInputs<T extends ListNavigationItem> {
112
- /** Whether focus should wrap when navigating. */
113
- wrap: SignalLike<boolean>;
115
+ /** Represents the required inputs for a collection that contains focusable items. */
116
+ interface ListFocusInputs<T extends ListFocusItem> {
117
+ /** The focus strategy used by the list. */
118
+ focusMode: SignalLike<'roving' | 'activedescendant'>;
119
+ /** Whether the list is disabled. */
120
+ disabled: SignalLike<boolean>;
114
121
  /** The items in the list. */
115
122
  items: SignalLike<T[]>;
123
+ /** The index of the current active item. */
124
+ activeIndex: WritableSignalLike<number>;
116
125
  /** Whether disabled items in the list should be skipped when navigating. */
117
126
  skipDisabled: SignalLike<boolean>;
118
- /** The current index that has been navigated to. */
119
- activeIndex: WritableSignalLike<number>;
120
- /** Whether the list is vertically or horizontally oriented. */
121
- orientation: SignalLike<'vertical' | 'horizontal'>;
122
- /** The direction that text is read based on the users locale. */
123
- textDirection: SignalLike<'rtl' | 'ltr'>;
124
127
  }
125
- /** Controls navigation for a list of items. */
126
- declare class ListNavigation<T extends ListNavigationItem> {
127
- readonly inputs: ListNavigationInputs<T>;
128
+ /** Controls focus for a list of items. */
129
+ declare class ListFocus<T extends ListFocusItem> {
130
+ readonly inputs: ListFocusInputs<T>;
128
131
  /** The last index that was active. */
129
132
  prevActiveIndex: i0.WritableSignal<number>;
130
- constructor(inputs: ListNavigationInputs<T>);
131
- /** Navigates to the given item. */
132
- goto(item: T): void;
133
- /** Navigates to the next item in the list. */
134
- next(): void;
135
- /** Navigates to the previous item in the list. */
136
- prev(): void;
137
- /** Navigates to the first item in the list. */
138
- first(): void;
139
- /** Navigates to the last item in the list. */
140
- last(): void;
133
+ /** The current active item. */
134
+ activeItem: i0.Signal<T>;
135
+ constructor(inputs: ListFocusInputs<T>);
136
+ /** Whether the list is in a disabled state. */
137
+ isListDisabled(): boolean;
138
+ /** The id of the current active item. */
139
+ getActiveDescendant(): string | undefined;
140
+ /** The tabindex for the list. */
141
+ getListTabindex(): -1 | 0;
142
+ /** Returns the tabindex for the given item. */
143
+ getItemTabindex(item: T): -1 | 0;
144
+ /** Moves focus to the given item if it is focusable. */
145
+ focus(item: T): boolean;
141
146
  /** Returns true if the given item can be navigated to. */
142
147
  isFocusable(item: T): boolean;
143
- /** Advances to the next or previous focusable item in the list based on the given delta. */
144
- private _advance;
145
148
  }
146
149
 
147
150
  /** Represents an item in a collection, such as a listbox option, than can be selected. */
148
- interface ListSelectionItem<V> extends ListNavigationItem {
151
+ interface ListSelectionItem<V> extends ListFocusItem {
149
152
  /** The value of the item. */
150
153
  value: SignalLike<V>;
151
- /** Whether an item is disabled. */
152
- disabled: SignalLike<boolean>;
153
154
  }
154
155
  /** Represents the required inputs for a collection that contains selectable items. */
155
- interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {
156
- /** The items in the list. */
157
- items: SignalLike<T[]>;
156
+ interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
158
157
  /** Whether multiple items in the list can be selected at once. */
159
158
  multi: SignalLike<boolean>;
160
159
  /** The current value of the list selection. */
@@ -165,17 +164,19 @@ interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {
165
164
  /** Controls selection for a list of items. */
166
165
  declare class ListSelection<T extends ListSelectionItem<V>, V> {
167
166
  readonly inputs: ListSelectionInputs<T, V> & {
168
- navigation: ListNavigation<T>;
167
+ focusManager: ListFocus<T>;
169
168
  };
170
- /** The value of the most recently selected item. */
171
- previousValue: i0.WritableSignal<V | undefined>;
172
- /** The navigation controller of the parent list. */
173
- navigation: ListNavigation<T>;
169
+ /** The start index to use for range selection. */
170
+ rangeStartIndex: i0.WritableSignal<number>;
171
+ /** The end index to use for range selection. */
172
+ rangeEndIndex: i0.WritableSignal<number>;
174
173
  constructor(inputs: ListSelectionInputs<T, V> & {
175
- navigation: ListNavigation<T>;
174
+ focusManager: ListFocus<T>;
176
175
  });
177
176
  /** Selects the item at the current active index. */
178
- select(item?: T): void;
177
+ select(item?: ListSelectionItem<V>, opts?: {
178
+ anchor: boolean;
179
+ }): void;
179
180
  /** Deselects the item at the current active index. */
180
181
  deselect(item?: T): void;
181
182
  /** Toggles the item at the current active index. */
@@ -186,52 +187,60 @@ declare class ListSelection<T extends ListSelectionItem<V>, V> {
186
187
  selectAll(): void;
187
188
  /** Deselects all items in the list. */
188
189
  deselectAll(): void;
189
- /** Selects the items in the list starting at the last selected item. */
190
- selectFromPrevSelectedItem(): void;
191
- /** Selects the items in the list starting at the last active item. */
192
- selectFromActive(): void;
190
+ /**
191
+ * Selects all items in the list or deselects all
192
+ * items in the list if all items are already selected.
193
+ */
194
+ toggleAll(): void;
193
195
  /** Sets the selection to only the current active item. */
194
196
  selectOne(): void;
195
- /** Toggles the items in the list starting at the last selected item. */
196
- toggleFromPrevSelectedItem(): void;
197
- /** Sets the anchor to the current active index. */
198
- private _anchor;
199
- /** Selects the items in the list starting at the given index. */
200
- private _selectFromIndex;
201
- /** Returns all items from the given index to the current active index. */
197
+ /**
198
+ * Selects all items in the list up to the anchor item.
199
+ *
200
+ * Deselects all items that were previously within the
201
+ * selected range that are now outside of the selected range
202
+ */
203
+ selectRange(opts?: {
204
+ anchor: boolean;
205
+ }): void;
206
+ /** Marks the given index as the start of a range selection. */
207
+ beginRangeSelection(index?: number): void;
208
+ /** Returns the items in the list starting from the given index. */
202
209
  private _getItemsFromIndex;
203
210
  }
204
211
 
205
- /** Represents an item in a collection, such as a listbox option, than may receive focus. */
206
- interface ListFocusItem extends ListNavigationItem {
207
- /** A unique identifier for the item. */
208
- id: SignalLike<string>;
209
- /** The html element that should receive focus. */
210
- element: SignalLike<HTMLElement>;
212
+ /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
213
+ interface ListNavigationItem extends ListFocusItem {
211
214
  }
212
- /** Represents the required inputs for a collection that contains focusable items. */
213
- interface ListFocusInputs<T extends ListFocusItem> {
214
- /** The focus strategy used by the list. */
215
- focusMode: SignalLike<'roving' | 'activedescendant'>;
215
+ /** Represents the required inputs for a collection that has navigable items. */
216
+ interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
217
+ /** Whether focus should wrap when navigating. */
218
+ wrap: SignalLike<boolean>;
219
+ /** Whether the list is vertically or horizontally oriented. */
220
+ orientation: SignalLike<'vertical' | 'horizontal'>;
221
+ /** The direction that text is read based on the users locale. */
222
+ textDirection: SignalLike<'rtl' | 'ltr'>;
216
223
  }
217
- /** Controls focus for a list of items. */
218
- declare class ListFocus<T extends ListFocusItem> {
219
- readonly inputs: ListFocusInputs<T> & {
220
- navigation: ListNavigation<T>;
224
+ /** Controls navigation for a list of items. */
225
+ declare class ListNavigation<T extends ListNavigationItem> {
226
+ readonly inputs: ListNavigationInputs<T> & {
227
+ focusManager: ListFocus<T>;
221
228
  };
222
- /** The navigation controller of the parent list. */
223
- navigation: ListNavigation<ListFocusItem>;
224
- constructor(inputs: ListFocusInputs<T> & {
225
- navigation: ListNavigation<T>;
229
+ constructor(inputs: ListNavigationInputs<T> & {
230
+ focusManager: ListFocus<T>;
226
231
  });
227
- /** The id of the current active item. */
228
- getActiveDescendant(): string | undefined;
229
- /** The tabindex for the list. */
230
- getListTabindex(): -1 | 0;
231
- /** Returns the tabindex for the given item. */
232
- getItemTabindex(item: T): -1 | 0;
233
- /** Focuses the current active item. */
234
- focus(): void;
232
+ /** Navigates to the given item. */
233
+ goto(item?: T): boolean;
234
+ /** Navigates to the next item in the list. */
235
+ next(): boolean;
236
+ /** Navigates to the previous item in the list. */
237
+ prev(): boolean;
238
+ /** Navigates to the first item in the list. */
239
+ first(): boolean;
240
+ /** Navigates to the last item in the list. */
241
+ last(): boolean;
242
+ /** Advances to the next or previous focusable item in the list based on the given delta. */
243
+ private _advance;
235
244
  }
236
245
 
237
246
  export { KeyboardEventManager, ListFocus, ListNavigation, ListSelection, PointerEventManager, convertGetterSetterToWritableSignalLike };
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import * as _angular_cdk_bidi from '@angular/cdk/bidi';
3
- import { OptionPattern, ListboxPattern } from '../listbox.d-C-LFh0S9.js';
4
- import '../list-focus.d-1SGksIi8.js';
3
+ import { OptionPattern, ListboxPattern } from '../listbox.d-DJqDR_H3.js';
4
+ import '../list-navigation.d-cy63EByU.js';
5
5
 
6
6
  /**
7
7
  * A listbox container.
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ListNavigationItem, SignalLike, ListNavigation, ListFocus, ListSelection, ListSelectionItem, ListFocusItem, ListNavigationInputs, ListSelectionInputs, ListFocusInputs, KeyboardEventManager, PointerEventManager } from './list-focus.d-1SGksIi8.js';
2
+ import { ListFocusItem, SignalLike, ListFocusInputs, ListFocus, ListSelection, ListNavigation, ListNavigationItem, ListSelectionItem, ListNavigationInputs, ListSelectionInputs, KeyboardEventManager, PointerEventManager } from './list-navigation.d-cy63EByU.js';
3
3
 
4
4
  /**
5
5
  * Represents an item in a collection, such as a listbox option, than can be navigated to by
6
6
  * typeahead.
7
7
  */
8
- interface ListTypeaheadItem extends ListNavigationItem {
8
+ interface ListTypeaheadItem extends ListFocusItem {
9
9
  /** The text used by the typeahead search. */
10
10
  searchTerm: SignalLike<string>;
11
11
  }
@@ -13,30 +13,30 @@ interface ListTypeaheadItem extends ListNavigationItem {
13
13
  * Represents the required inputs for a collection that contains items that can be navigated to by
14
14
  * typeahead.
15
15
  */
16
- interface ListTypeaheadInputs {
16
+ interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {
17
17
  /** The amount of time before the typeahead search is reset. */
18
18
  typeaheadDelay: SignalLike<number>;
19
19
  }
20
20
  /** Controls typeahead for a list of items. */
21
21
  declare class ListTypeahead<T extends ListTypeaheadItem> {
22
- readonly inputs: ListTypeaheadInputs & {
23
- navigation: ListNavigation<T>;
22
+ readonly inputs: ListTypeaheadInputs<T> & {
23
+ focusManager: ListFocus<T>;
24
24
  };
25
25
  /** A reference to the timeout for resetting the typeahead search. */
26
26
  timeout?: ReturnType<typeof setTimeout> | undefined;
27
- /** The navigation controller of the parent list. */
28
- navigation: ListNavigation<T>;
27
+ /** The focus controller of the parent list. */
28
+ focusManager: ListFocus<T>;
29
29
  /** Whether the user is actively typing a typeahead search query. */
30
30
  isTyping: i0.Signal<boolean>;
31
31
  /** Keeps track of the characters that typeahead search is being called with. */
32
32
  private _query;
33
33
  /** The index where that the typeahead search was initiated from. */
34
34
  private _startIndex;
35
- constructor(inputs: ListTypeaheadInputs & {
36
- navigation: ListNavigation<T>;
35
+ constructor(inputs: ListTypeaheadInputs<T> & {
36
+ focusManager: ListFocus<T>;
37
37
  });
38
38
  /** Performs a typeahead search, appending the given character to the search string. */
39
- search(char: string): void;
39
+ search(char: string): boolean;
40
40
  /**
41
41
  * Returns the first item whose search term matches the
42
42
  * current query starting from the the current anchor index.
@@ -82,18 +82,13 @@ declare class OptionPattern<V> {
82
82
 
83
83
  /** The selection operations that the listbox can perform. */
84
84
  interface SelectOptions {
85
- select?: boolean;
86
85
  toggle?: boolean;
87
- toggleOne?: boolean;
88
86
  selectOne?: boolean;
89
- selectAll?: boolean;
90
- selectFromAnchor?: boolean;
91
- selectFromActive?: boolean;
92
- toggleFromAnchor?: boolean;
87
+ selectRange?: boolean;
88
+ anchor?: boolean;
93
89
  }
94
90
  /** Represents the required inputs for a listbox. */
95
- type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs & ListFocusInputs<OptionPattern<V>> & {
96
- disabled: SignalLike<boolean>;
91
+ type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs<OptionPattern<V>> & ListFocusInputs<OptionPattern<V>> & {
97
92
  readonly: SignalLike<boolean>;
98
93
  };
99
94
  /** Controls the state of a listbox. */
@@ -110,7 +105,7 @@ declare class ListboxPattern<V> {
110
105
  /** Whether the list is vertically or horizontally oriented. */
111
106
  orientation: SignalLike<'vertical' | 'horizontal'>;
112
107
  /** Whether the listbox is disabled. */
113
- disabled: SignalLike<boolean>;
108
+ disabled: i0.Signal<boolean>;
114
109
  /** Whether the listbox is readonly. */
115
110
  readonly: SignalLike<boolean>;
116
111
  /** The tabindex of the listbox. */
@@ -123,6 +118,8 @@ declare class ListboxPattern<V> {
123
118
  setsize: i0.Signal<number>;
124
119
  /** Whether the listbox selection follows focus. */
125
120
  followFocus: i0.Signal<boolean>;
121
+ /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
122
+ wrap: i0.WritableSignal<boolean>;
126
123
  /** The key used to navigate to the previous item in the list. */
127
124
  prevKey: i0.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
128
125
  /** The key used to navigate to the next item in the list. */
@@ -131,6 +128,19 @@ declare class ListboxPattern<V> {
131
128
  dynamicSpaceKey: i0.Signal<"" | " ">;
132
129
  /** The regexp used to decide if a key should trigger typeahead. */
133
130
  typeaheadRegexp: RegExp;
131
+ /**
132
+ * The uncommitted index for selecting a range of options.
133
+ *
134
+ * NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
135
+ * The anchorIndex does not necessarily represent the start of a range, but represents the most
136
+ * recent index where the user showed intent to begin a range selection. Usually, this is wherever
137
+ * the user most recently pressed the "Shift" key, but if the user presses shift + space to select
138
+ * from the anchor, the user is not intending to start a new range from this index.
139
+ *
140
+ * In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
141
+ * while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
142
+ */
143
+ anchorIndex: i0.WritableSignal<number>;
134
144
  /** The keydown event manager for the listbox. */
135
145
  keydown: i0.Signal<KeyboardEventManager<KeyboardEvent>>;
136
146
  /** The pointerdown event manager for the listbox. */
@@ -151,6 +161,16 @@ declare class ListboxPattern<V> {
151
161
  goto(event: PointerEvent, opts?: SelectOptions): void;
152
162
  /** Handles typeahead search navigation for the listbox. */
153
163
  search(char: string, opts?: SelectOptions): void;
164
+ /**
165
+ * Safely performs a navigation operation.
166
+ *
167
+ * Handles conditionally disabling wrapping for when a navigation
168
+ * operation is occurring while the user is selecting a range of options.
169
+ *
170
+ * Handles boilerplate calling of focus & selection operations. Also ensures these
171
+ * additional operations are only called if the navigation operation moved focus to a new option.
172
+ */
173
+ private _navigate;
154
174
  /** Handles updating selection for the listbox. */
155
175
  private _updateSelection;
156
176
  private _getItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cdk-experimental",
3
- "version": "20.0.0-next.7",
3
+ "version": "20.0.0-next.8",
4
4
  "description": "Experimental components for Angular CDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "homepage": "https://github.com/angular/components#readme",
14
14
  "peerDependencies": {
15
- "@angular/cdk": "20.0.0-next.7",
15
+ "@angular/cdk": "20.0.0-next.8",
16
16
  "@angular/core": "^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0"
17
17
  },
18
18
  "devDependencies": {
package/tabs/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
2
  import * as i0 from '@angular/core';
3
- import { TabPattern, TabPanelPattern, TabListPattern } from '../tabs.d-BIIDt2Rf.js';
3
+ import { TabPattern, TabPanelPattern, TabListPattern } from '../tabs.d-CWu2orP4.js';
4
4
  import * as i1 from '@angular/cdk-experimental/deferred-content';
5
- import '../list-focus.d-1SGksIi8.js';
5
+ import '../list-navigation.d-cy63EByU.js';
6
6
 
7
7
  /**
8
8
  * A Tabs container.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { SignalLike, ListNavigationInputs, ListSelectionInputs, ListFocusInputs, ListNavigation, ListSelection, ListFocus, KeyboardEventManager, PointerEventManager, ListNavigationItem, ListSelectionItem, ListFocusItem } from './list-focus.d-1SGksIi8.js';
2
+ import { SignalLike, ListNavigationInputs, ListSelectionInputs, ListFocusInputs, ListNavigation, ListSelection, ListFocus, KeyboardEventManager, PointerEventManager, ListNavigationItem, ListSelectionItem, ListFocusItem } from './list-navigation.d-cy63EByU.js';
3
3
 
4
4
  /** The required inputs to tabs. */
5
5
  interface TabInputs extends ListNavigationItem, ListSelectionItem<string>, ListFocusItem {
@@ -1,4 +1,4 @@
1
- export { ListboxInputs, ListboxPattern, OptionInputs, OptionPattern } from '../listbox.d-C-LFh0S9.js';
2
- export { SignalLike, WritableSignalLike, convertGetterSetterToWritableSignalLike } from '../list-focus.d-1SGksIi8.js';
3
- export { TabInputs, TabListInputs, TabListPattern, TabPanelInputs, TabPanelPattern, TabPattern } from '../tabs.d-BIIDt2Rf.js';
1
+ export { ListboxInputs, ListboxPattern, OptionInputs, OptionPattern } from '../listbox.d-DJqDR_H3.js';
2
+ export { SignalLike, WritableSignalLike, convertGetterSetterToWritableSignalLike } from '../list-navigation.d-cy63EByU.js';
3
+ export { TabInputs, TabListInputs, TabListPattern, TabPanelInputs, TabPanelPattern, TabPattern } from '../tabs.d-CWu2orP4.js';
4
4
  import '@angular/core';
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-focus-DtTH4bDx.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/keyboard-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/pointer-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-selection/list-selection.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-navigation/list-navigation.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-focus/list-focus.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 */\n\n/**\n * An event that supports modifier keys.\n *\n * Matches the native KeyboardEvent, MouseEvent, and TouchEvent.\n */\nexport interface EventWithModifiers extends Event {\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\n/**\n * Options that are applicable to all event handlers.\n *\n * This library has not yet had a need for stopPropagationImmediate.\n */\nexport interface EventHandlerOptions {\n stopPropagation: boolean;\n preventDefault: boolean;\n}\n\n/** A basic event handler. */\nexport type EventHandler<T extends Event> = (event: T) => void;\n\n/** A function that determines whether an event is to be handled. */\nexport type EventMatcher<T extends Event> = (event: T) => boolean;\n\n/** A config that specifies how to handle a particular event. */\nexport interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {\n matcher: EventMatcher<T>;\n handler: EventHandler<T>;\n}\n\n/** Bit flag representation of the possible modifier keys that can be present on an event. */\nexport enum ModifierKey {\n None = 0,\n Ctrl = 0b1,\n Shift = 0b10,\n Alt = 0b100,\n Meta = 0b1000,\n}\n\nexport type ModifierInputs = ModifierKey | ModifierKey[];\n\n/**\n * Abstract base class for all event managers.\n *\n * Event managers are designed to normalize how event handlers are authored and create a safety net\n * for common event handling gotchas like remembering to call preventDefault or stopPropagation.\n */\nexport abstract class EventManager<T extends Event> {\n protected configs: EventHandlerConfig<T>[] = [];\n abstract options: EventHandlerOptions;\n\n /** Runs the handlers that match with the given event. */\n handle(event: T): void {\n for (const config of this.configs) {\n if (config.matcher(event)) {\n config.handler(event);\n\n if (config.preventDefault) {\n event.preventDefault();\n }\n\n if (config.stopPropagation) {\n event.stopPropagation();\n }\n }\n }\n }\n\n /** Configures the event manager to handle specific events. (See subclasses for more). */\n abstract on(...args: [...unknown[]]): this;\n}\n\n/** Gets bit flag representation of the modifier keys present on the given event. */\nexport function getModifiers(event: EventWithModifiers): number {\n return (\n (+event.ctrlKey && ModifierKey.Ctrl) |\n (+event.shiftKey && ModifierKey.Shift) |\n (+event.altKey && ModifierKey.Alt) |\n (+event.metaKey && ModifierKey.Meta)\n );\n}\n\n/**\n * Checks if the given event has modifiers that are an exact match for any of the given modifier\n * flag combinations.\n */\nexport function hasModifiers(event: EventWithModifiers, modifiers: ModifierInputs): boolean {\n const eventModifiers = getModifiers(event);\n const modifiersList = Array.isArray(modifiers) ? modifiers : [modifiers];\n return modifiersList.some(modifiers => eventModifiers === modifiers);\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 {SignalLike} from '../signal-like/signal-like';\nimport {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n ModifierKey,\n} from './event-manager';\n\n/**\n * Used to represent a keycode.\n *\n * This is used to match whether an events keycode should be handled. The ability to match using a\n * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.\n */\ntype KeyCode = string | SignalLike<string> | RegExp;\n\n/**\n * An event manager that is specialized for handling keyboard events. By default this manager stops\n * propagation and prevents default on all events it handles.\n */\nexport class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: true,\n stopPropagation: true,\n };\n\n /** Configures this event manager to handle events with a specific key and no modifiers. */\n on(key: KeyCode, handler: EventHandler<T>): this;\n\n /** Configures this event manager to handle events with a specific modifer and key combination. */\n on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;\n\n on(...args: any[]) {\n const {modifiers, key, handler} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler: handler,\n matcher: event => this._isMatch(event, key, modifiers),\n ...this.options,\n });\n\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n const key = args.length === 3 ? args[1] : args[0];\n const handler = args.length === 3 ? args[2] : args[1];\n const modifiers = args.length === 3 ? args[0] : ModifierKey.None;\n\n return {\n key: key as KeyCode,\n handler: handler as EventHandler<T>,\n modifiers: modifiers as ModifierInputs,\n };\n }\n\n private _isMatch(event: T, key: KeyCode, modifiers: ModifierInputs) {\n if (!hasModifiers(event, modifiers)) {\n return false;\n }\n\n if (key instanceof RegExp) {\n return key.test(event.key);\n }\n\n const keyStr = typeof key === 'string' ? key : key();\n return keyStr.toLowerCase() === event.key.toLowerCase();\n }\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 {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n ModifierKey,\n} from './event-manager';\n\n/**\n * The different mouse buttons that may appear on a pointer event.\n */\nexport enum MouseButton {\n Main = 0,\n Auxiliary = 1,\n Secondary = 2,\n}\n\n/** An event manager that is specialized for handling pointer events. */\nexport class PointerEventManager<T extends PointerEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: false,\n stopPropagation: false,\n };\n\n /**\n * Configures this event manager to handle events with a specific modifer and mouse button\n * combination.\n */\n on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with a specific mouse button and no modifiers.\n */\n on(modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with the main mouse button and no modifiers.\n *\n * @param handler The handler function\n * @param options Options for whether to stop propagation or prevent default.\n */\n on(handler: EventHandler<T>): this;\n\n on(...args: any[]) {\n const {button, handler, modifiers} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler,\n matcher: event => this._isMatch(event, button, modifiers),\n ...this.options,\n });\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n if (args.length === 3) {\n return {\n button: args[0] as MouseButton,\n modifiers: args[1] as ModifierInputs,\n handler: args[2] as EventHandler<T>,\n };\n }\n\n if (typeof args[0] === 'number' && typeof args[1] === 'function') {\n return {\n button: MouseButton.Main,\n modifiers: args[0] as ModifierInputs,\n handler: args[1] as EventHandler<T>,\n };\n }\n\n return {\n button: MouseButton.Main,\n modifiers: ModifierKey.None,\n handler: args[0] as EventHandler<T>,\n };\n }\n\n _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs) {\n return button === (event.button ?? 0) && hasModifiers(event, modifiers);\n }\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 {signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\nimport {ListNavigation, ListNavigationItem} from '../list-navigation/list-navigation';\n\n/** Represents an item in a collection, such as a listbox option, than can be selected. */\nexport interface ListSelectionItem<V> extends ListNavigationItem {\n /** The value of the item. */\n value: SignalLike<V>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains selectable items. */\nexport interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The current value of the list selection. */\n value: WritableSignalLike<V[]>;\n\n /** The selection strategy used by the list. */\n selectionMode: SignalLike<'follow' | 'explicit'>;\n}\n\n/** Controls selection for a list of items. */\nexport class ListSelection<T extends ListSelectionItem<V>, V> {\n /** The value of the most recently selected item. */\n previousValue = signal<V | undefined>(undefined);\n\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<T>;\n\n constructor(readonly inputs: ListSelectionInputs<T, V> & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** Selects the item at the current active index. */\n select(item?: T) {\n item = item ?? this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n\n if (item.disabled() || this.inputs.value().includes(item.value())) {\n return;\n }\n\n if (!this.inputs.multi()) {\n this.deselectAll();\n }\n\n // TODO: Need to discuss when to drop this.\n this._anchor();\n this.inputs.value.update(values => values.concat(item.value()));\n }\n\n /** Deselects the item at the current active index. */\n deselect(item?: T) {\n item = item ?? this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n\n if (!item.disabled()) {\n this.inputs.value.update(values => values.filter(value => value !== item.value()));\n }\n }\n\n /** Toggles the item at the current active index. */\n toggle() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.inputs.value().includes(item.value()) ? this.deselect() : this.select();\n }\n\n /** Toggles only the item at the current active index. */\n toggleOne() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.inputs.value().includes(item.value()) ? this.deselect() : this.selectOne();\n }\n\n /** Selects all items in the list. */\n selectAll() {\n if (!this.inputs.multi()) {\n return; // Should we log a warning?\n }\n\n for (const item of this.inputs.items()) {\n this.select(item);\n }\n\n this._anchor();\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n for (const item of this.inputs.items()) {\n this.deselect(item);\n }\n }\n\n /** Selects the items in the list starting at the last selected item. */\n selectFromPrevSelectedItem() {\n const previousValue = this.inputs.items().findIndex(i => this.previousValue() === i.value());\n this._selectFromIndex(previousValue);\n }\n\n /** Selects the items in the list starting at the last active item. */\n selectFromActive() {\n this._selectFromIndex(this.inputs.navigation.prevActiveIndex());\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.deselectAll();\n this.select();\n }\n\n /** Toggles the items in the list starting at the last selected item. */\n toggleFromPrevSelectedItem() {\n const prevIndex = this.inputs.items().findIndex(i => this.previousValue() === i.value());\n const currIndex = this.inputs.navigation.inputs.activeIndex();\n const currValue = this.inputs.items()[currIndex].value();\n const items = this._getItemsFromIndex(prevIndex);\n\n const operation = this.inputs.value().includes(currValue)\n ? this.deselect.bind(this)\n : this.select.bind(this);\n\n for (const item of items) {\n operation(item);\n }\n }\n\n /** Sets the anchor to the current active index. */\n private _anchor() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.previousValue.set(item.value());\n }\n\n /** Selects the items in the list starting at the given index. */\n private _selectFromIndex(index: number) {\n const items = this._getItemsFromIndex(index);\n\n for (const item of items) {\n this.select(item);\n }\n }\n\n /** Returns all items from the given index to the current active index. */\n private _getItemsFromIndex(index: number) {\n if (index === -1) {\n return [];\n }\n\n const upper = Math.max(this.inputs.navigation.inputs.activeIndex(), index);\n const lower = Math.min(this.inputs.navigation.inputs.activeIndex(), index);\n\n const items = [];\n for (let i = lower; i <= upper; i++) {\n items.push(this.inputs.items()[i]);\n }\n return items;\n }\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 {signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem {\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled: SignalLike<boolean>;\n\n /** The current index that has been navigated to. */\n activeIndex: WritableSignalLike<number>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n /** The last index that was active. */\n prevActiveIndex = signal(0);\n\n constructor(readonly inputs: ListNavigationInputs<T>) {}\n\n /** Navigates to the given item. */\n goto(item: T) {\n if (this.isFocusable(item)) {\n this.prevActiveIndex.set(this.inputs.activeIndex());\n const index = this.inputs.items().indexOf(item);\n this.inputs.activeIndex.set(index);\n }\n }\n\n /** Navigates to the next item in the list. */\n next() {\n this._advance(1);\n }\n\n /** Navigates to the previous item in the list. */\n prev() {\n this._advance(-1);\n }\n\n /** Navigates to the first item in the list. */\n first() {\n const item = this.inputs.items().find(i => this.isFocusable(i));\n\n if (item) {\n this.goto(item);\n }\n }\n\n /** Navigates to the last item in the list. */\n last() {\n const items = this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.isFocusable(items[i])) {\n this.goto(items[i]);\n return;\n }\n }\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || !this.inputs.skipDisabled();\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1) {\n const items = this.inputs.items();\n const itemCount = items.length;\n const startIndex = this.inputs.activeIndex();\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.isFocusable(items[i])) {\n this.goto(items[i]);\n return;\n }\n }\n }\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 {SignalLike} from '../signal-like/signal-like';\nimport {ListNavigation, ListNavigationItem} from '../list-navigation/list-navigation';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem extends ListNavigationItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<ListFocusItem>;\n\n constructor(readonly inputs: ListFocusInputs<T> & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n if (this.navigation.inputs.items().length) {\n return this.navigation.inputs.items()[this.navigation.inputs.activeIndex()].id();\n }\n return undefined;\n }\n\n /** The tabindex for the list. */\n getListTabindex(): -1 | 0 {\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tabindex for the given item. */\n getItemTabindex(item: T): -1 | 0 {\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n const index = this.navigation.inputs.items().indexOf(item);\n return this.navigation.inputs.activeIndex() === index ? 0 : -1;\n }\n\n /** Focuses the current active item. */\n focus() {\n if (this.inputs.focusMode() === 'activedescendant') {\n return;\n }\n\n const item = this.navigation.inputs.items()[this.navigation.inputs.activeIndex()];\n item.element().focus();\n }\n}\n"],"names":[],"mappings":";;AA0CA;IACY;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAU;AACV,IAAA,WAAA,CAAA,WAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAY;AACZ,IAAA,WAAA,CAAA,WAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAW;AACX,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAa;AACf,CAAC,EANW,WAAW,KAAX,WAAW,GAMtB,EAAA,CAAA,CAAA;AAID;;;;;AAKG;MACmB,YAAY,CAAA;IACtB,OAAO,GAA4B,EAAE;;AAI/C,IAAA,MAAM,CAAC,KAAQ,EAAA;AACb,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;AACjC,YAAA,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,gBAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AAErB,gBAAA,IAAI,MAAM,CAAC,cAAc,EAAE;oBACzB,KAAK,CAAC,cAAc,EAAE;;AAGxB,gBAAA,IAAI,MAAM,CAAC,eAAe,EAAE;oBAC1B,KAAK,CAAC,eAAe,EAAE;;;;;AAQhC;AAED;AACM,SAAU,Y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CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;AAC1D,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,EAAE;;;IAIhE,KAAK,GAAA;QACH,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,kBAAkB,EAAE;YAClD;;QAGF,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AACjF,QAAA,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE;;AAEzB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"option-Bgpacz3g.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-typeahead/list-typeahead.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/listbox.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/option.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 */\n\nimport {computed, signal} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\nimport {ListNavigationItem, ListNavigation} from '../list-navigation/list-navigation';\n\n/**\n * Represents an item in a collection, such as a listbox option, than can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadItem extends ListNavigationItem {\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n}\n\n/**\n * Represents the required inputs for a collection that contains items that can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadInputs {\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay: SignalLike<number>;\n}\n\n/** Controls typeahead for a list of items. */\nexport class ListTypeahead<T extends ListTypeaheadItem> {\n /** A reference to the timeout for resetting the typeahead search. */\n timeout?: ReturnType<typeof setTimeout> | undefined;\n\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<T>;\n\n /** Whether the user is actively typing a typeahead search query. */\n isTyping = computed(() => this._query().length > 0);\n\n /** Keeps track of the characters that typeahead search is being called with. */\n private _query = signal('');\n\n /** The index where that the typeahead search was initiated from. */\n private _startIndex = signal<number | undefined>(undefined);\n\n constructor(readonly inputs: ListTypeaheadInputs & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string) {\n if (char.length !== 1) {\n return;\n }\n\n if (!this.isTyping() && char === ' ') {\n return;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.navigation.inputs.activeIndex());\n }\n\n clearTimeout(this.timeout);\n this._query.update(q => q + char.toLowerCase());\n const item = this._getItem();\n\n if (item) {\n this.navigation.goto(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay() * 1000);\n }\n\n /**\n * Returns the first item whose search term matches the\n * current query starting from the the current anchor index.\n */\n private _getItem() {\n let items = this.navigation.inputs.items();\n const after = items.slice(this._startIndex()! + 1);\n const before = items.slice(0, this._startIndex()!);\n items = this.navigation.inputs.wrap() ? after.concat(before) : after; // TODO: Always wrap?\n items.push(this.navigation.inputs.items()[this._startIndex()!]);\n\n const focusableItems = [];\n for (const item of items) {\n if (this.navigation.isFocusable(item)) {\n focusableItems.push(item);\n }\n }\n\n return focusableItems.find(i => i.searchTerm().toLowerCase().startsWith(this._query()));\n }\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 {ModifierKey as Modifier} from '../behaviors/event-manager/event-manager';\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {OptionPattern} from './option';\nimport {ListSelection, ListSelectionInputs} from '../behaviors/list-selection/list-selection';\nimport {ListTypeahead, ListTypeaheadInputs} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationInputs} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusInputs} from '../behaviors/list-focus/list-focus';\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The selection operations that the listbox can perform. */\ninterface SelectOptions {\n select?: boolean;\n toggle?: boolean;\n toggleOne?: boolean;\n selectOne?: boolean;\n selectAll?: boolean;\n selectFromAnchor?: boolean;\n selectFromActive?: boolean;\n toggleFromAnchor?: boolean;\n}\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> &\n ListSelectionInputs<OptionPattern<V>, V> &\n ListTypeaheadInputs &\n ListFocusInputs<OptionPattern<V>> & {\n disabled: SignalLike<boolean>;\n readonly: SignalLike<boolean>;\n };\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n /** Controls navigation for the listbox. */\n navigation: ListNavigation<OptionPattern<V>>;\n\n /** Controls selection for the listbox. */\n selection: ListSelection<OptionPattern<V>, V>;\n\n /** Controls typeahead for the listbox. */\n typeahead: ListTypeahead<OptionPattern<V>>;\n\n /** Controls focus for the listbox. */\n focusManager: ListFocus<OptionPattern<V>>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the listbox is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n\n /** The tabindex of the listbox. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active item. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The number of items in the listbox. */\n setsize = computed(() => this.navigation.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous item in the list. */\n 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 nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.typeahead.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/; // TODO: Ignore spaces?\n\n /** The keydown event manager for the listbox. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev({selectOne: true}))\n .on(this.nextKey, () => this.next({selectOne: true}))\n .on('Home', () => this.first({selectOne: true}))\n .on('End', () => this.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Shift, 'Enter', () => this._updateSelection({selectFromAnchor: true}))\n .on(Modifier.Shift, this.prevKey, () => this.prev({toggle: true}))\n .on(Modifier.Shift, this.nextKey, () => this.next({toggle: true}))\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this._updateSelection({selectAll: true}))\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.first({selectFromActive: true}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.last({selectFromActive: true}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this._updateSelection({selectFromAnchor: true}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this._updateSelection({toggle: true}));\n manager.on('Enter', () => this._updateSelection({toggle: true}));\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this._updateSelection({toggleOne: true}));\n manager.on('Enter', () => this._updateSelection({toggleOne: true}));\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.prev())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.next())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this._updateSelection({toggle: true}))\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this._updateSelection({toggle: true}))\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.first()) // TODO: Not in spec but prob should be.\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.last()); // TODO: Not in spec but prob should be.\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the listbox. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.readonly()) {\n return manager.on(e => this.goto(e));\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.goto(e, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.goto(e, {toggle: true}))\n .on(Modifier.Shift, e => this.goto(e, {toggleFromAnchor: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager\n .on(e => this.goto(e, {toggle: true}))\n .on(Modifier.Shift, e => this.goto(e, {toggleFromAnchor: true}));\n }\n\n return manager;\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.disabled = inputs.disabled;\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n\n this.navigation = new ListNavigation(inputs);\n this.selection = new ListSelection({...inputs, navigation: this.navigation});\n this.typeahead = new ListTypeahead({...inputs, navigation: this.navigation});\n this.focusManager = new ListFocus({...inputs, navigation: this.navigation});\n }\n\n /** Handles keydown events for the listbox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Navigates to the first option in the listbox. */\n first(opts?: SelectOptions) {\n this.navigation.first();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the last option in the listbox. */\n last(opts?: SelectOptions) {\n this.navigation.last();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the next option in the listbox. */\n next(opts?: SelectOptions) {\n this.navigation.next();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the previous option in the listbox. */\n prev(opts?: SelectOptions) {\n this.navigation.prev();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the given item in the listbox. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n\n if (item) {\n this.navigation.goto(item);\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n }\n\n /** Handles typeahead search navigation for the listbox. */\n search(char: string, opts?: SelectOptions) {\n this.typeahead.search(char);\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Handles updating selection for the listbox. */\n private _updateSelection(opts?: SelectOptions) {\n if (opts?.select) {\n this.selection.select();\n }\n if (opts?.toggle) {\n this.selection.toggle();\n }\n if (opts?.toggleOne) {\n this.selection.toggleOne();\n }\n if (opts?.selectOne) {\n this.selection.selectOne();\n }\n if (opts?.selectAll) {\n this.selection.selectAll();\n }\n if (opts?.selectFromAnchor) {\n this.selection.selectFromPrevSelectedItem();\n }\n if (opts?.selectFromActive) {\n this.selection.selectFromActive();\n }\n if (opts?.toggleFromAnchor) {\n this.selection.toggleFromPrevSelectedItem();\n }\n }\n\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]'); // TODO: Use a different identifier.\n return this.inputs.items().find(i => i.element() === element);\n }\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 {ListSelection, ListSelectionItem} from '../behaviors/list-selection/list-selection';\nimport {ListTypeaheadItem} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationItem} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/**\n * Represents the properties exposed by a listbox that need to be accessed by an option.\n * This exists to avoid circular dependency errors between the listbox and option.\n */\ninterface ListboxPattern<V> {\n focusManager: ListFocus<OptionPattern<V>>;\n selection: ListSelection<OptionPattern<V>, V>;\n navigation: ListNavigation<OptionPattern<V>>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V>\n extends ListNavigationItem,\n ListSelectionItem<V>,\n ListTypeaheadItem,\n ListFocusItem {\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n}\n\n/** Represents an option in a listbox. */\nexport class OptionPattern<V> {\n /** A unique identifier for the option. */\n id: SignalLike<string>;\n\n /** The value of the option. */\n value: SignalLike<V>;\n\n /** The position of the option in the list. */\n index = computed(\n () =>\n this.listbox()\n ?.navigation.inputs.items()\n .findIndex(i => i.id() === this.id()) ?? -1,\n );\n\n /** Whether the option is selected. */\n selected = computed(() => this.listbox()?.selection.inputs.value().includes(this.value()));\n\n /** Whether the option is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n\n /** A reference to the parent listbox. */\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n\n /** The tabindex of the option. */\n tabindex = computed(() => this.listbox()?.focusManager.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n constructor(args: OptionInputs<V>) {\n this.id = args.id;\n this.value = args.value;\n this.listbox = args.listbox;\n this.element = args.element;\n this.disabled = args.disabled;\n this.searchTerm = args.searchTerm;\n }\n}\n"],"names":["Modifier"],"mappings":";;;AA8BA;MACa,aAAa,CAAA;AAgBH,IAAA,MAAA;;AAdrB,IAAA,OAAO;;AAGP,IAAA,UAAU;;AAGV,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;;AAG3C,IAAA,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;;AAGnB,IAAA,WAAW,GAAG,MAAM,CAAqB,SAAS,CAAC;AAE3D,IAAA,WAAA,CAAqB,MAA6D,EAAA;QAA7D,IAAM,CAAA,MAAA,GAAN,MAAM;AACzB,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;;;AAIrC,IAAA,MAAM,CAAC,IAAY,EAAA;AACjB,QAAA,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB;;QAGF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,KAAK,GAAG,EAAE;YACpC;;AAGF,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;AACpC,YAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAA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AExB,IAAA,EAAE;;AAGF,IAAA,KAAK;;IAGL,KAAK,GAAG,QAAQ,CACd,MACE,IAAI,CAAC,OAAO;AACV,UAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AACxB,SAAA,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAChD;;IAGD,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;;AAG1F,IAAA,QAAQ;;AAGR,IAAA,UAAU;;AAGV,IAAA,OAAO;;AAGP,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;AAG7E,IAAA,OAAO;AAEP,IAAA,WAAA,CAAY,IAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE;AACjB,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;AACvB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ;AAC7B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;;AAEpC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tabs-cBelBNjZ.mjs","sources":["../../../../../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 */\n\nimport {computed, signal} from '@angular/core';\n\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../behaviors/list-selection/list-selection';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The required inputs to tabs. */\nexport interface TabInputs extends ListNavigationItem, ListSelectionItem<string>, ListFocusItem {\n tablist: SignalLike<TabListPattern>;\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** A global unique identifier for the tab. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the tab. */\n value: SignalLike<string>;\n\n /** Whether the tab is selected. */\n selected = computed(() => this.tablist().selection.inputs.value().includes(this.value()));\n\n /** A Tabpanel Id controlled by the tab. */\n controls = computed(() => this.tabpanel()?.id());\n\n /** Whether the tab is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent tablist. */\n tablist: SignalLike<TabListPattern>;\n\n /** A reference to the corresponding tabpanel. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n\n /** The tabindex of the tab. */\n tabindex = computed(() => this.tablist().focusManager.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n constructor(inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.tablist = inputs.tablist;\n this.tabpanel = inputs.tabpanel;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n }\n}\n\n/** The selection operations that the tablist can perform. */\ninterface SelectOptions {\n select?: boolean;\n toggle?: boolean;\n toggleOne?: boolean;\n selectOne?: boolean;\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = ListNavigationInputs<TabPattern> &\n Omit<ListSelectionInputs<TabPattern, string>, 'multi'> &\n ListFocusInputs<TabPattern> & {\n disabled: SignalLike<boolean>;\n };\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs {\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 id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n value: SignalLike<string>;\n\n /** A reference to the corresponding tab. */\n tab: SignalLike<TabPattern | undefined>;\n\n /** Whether the tabpanel is hidden. */\n hidden = computed(() => !this.tab()?.selected());\n\n constructor(inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.tab = inputs.tab;\n }\n}\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** Controls navigation for the tablist. */\n navigation: ListNavigation<TabPattern>;\n\n /** Controls selection for the tablist. */\n selection: ListSelection<TabPattern, string>;\n\n /** Controls focus for the tablist. */\n focusManager: ListFocus<TabPattern>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active tab. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\n 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 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 keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev({selectOne: true}))\n .on(this.nextKey, () => this.next({selectOne: true}))\n .on('Home', () => this.first({selectOne: true}))\n .on('End', () => this.last({selectOne: true}));\n } else {\n manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(' ', () => this._updateSelection({selectOne: true}))\n .on('Enter', () => this._updateSelection({selectOne: true}));\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the tablist. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n manager.on(e => this.goto(e, {selectOne: true}));\n\n return manager;\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.navigation = new ListNavigation(inputs);\n this.selection = new ListSelection({\n ...inputs,\n navigation: this.navigation,\n multi: signal(false),\n });\n this.focusManager = new ListFocus({...inputs, navigation: this.navigation});\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 /** Navigates to the first option in the tablist. */\n first(opts?: SelectOptions) {\n this.navigation.first();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the last option in the tablist. */\n last(opts?: SelectOptions) {\n this.navigation.last();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the next option in the tablist. */\n next(opts?: SelectOptions) {\n this.navigation.next();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the previous option in the tablist. */\n prev(opts?: SelectOptions) {\n this.navigation.prev();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the given item in the tablist. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n\n if (item) {\n this.navigation.goto(item);\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n }\n\n /** Handles updating selection for the tablist. */\n private _updateSelection(opts?: SelectOptions) {\n if (opts?.select) {\n this.selection.select();\n }\n if (opts?.toggle) {\n this.selection.toggle();\n }\n if (opts?.toggleOne) {\n this.selection.toggleOne();\n }\n if (opts?.selectOne) {\n this.selection.selectOne();\n }\n }\n\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":";;;AA+BA;MACa,UAAU,CAAA;;AAErB,IAAA,EAAE;;AAGF,IAAA,KAAK;;IAGL,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;;AAGzF,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;;AAGhD,IAAA,QAAQ;;AAGR,IAAA,OAAO;;AAGP,IAAA,QAAQ;;AAGR,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;AAG5E,IAAA,OAAO;AAEP,IAAA,WAAA,CAAY,MAAiB,EAAA;AAC3B,QAAA,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;AACnB,QAAA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK;AACzB,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAC7B,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,OAAO,GAAG,M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