@angular/cdk-experimental 21.0.0-next.6 → 21.0.0-next.9

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 (74) hide show
  1. package/fesm2022/_polyfill-chunk.mjs.map +1 -1
  2. package/fesm2022/cdk-experimental.mjs +1 -1
  3. package/fesm2022/cdk-experimental.mjs.map +1 -1
  4. package/fesm2022/column-resize.mjs.map +1 -1
  5. package/fesm2022/popover-edit.mjs.map +1 -1
  6. package/fesm2022/scrolling.mjs.map +1 -1
  7. package/fesm2022/selection.mjs.map +1 -1
  8. package/fesm2022/table-scroll-container.mjs.map +1 -1
  9. package/package.json +3 -38
  10. package/types/column-resize.d.ts +37 -37
  11. package/types/popover-edit.d.ts +30 -30
  12. package/types/scrolling.d.ts +6 -6
  13. package/types/selection.d.ts +14 -14
  14. package/types/table-scroll-container.d.ts +6 -6
  15. package/fesm2022/_accordion-chunk.mjs +0 -153
  16. package/fesm2022/_accordion-chunk.mjs.map +0 -1
  17. package/fesm2022/_combobox-chunk.mjs +0 -278
  18. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  19. package/fesm2022/_combobox-listbox-chunk.mjs +0 -278
  20. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  21. package/fesm2022/_combobox-tree-chunk.mjs +0 -398
  22. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  23. package/fesm2022/_expansion-chunk.mjs +0 -87
  24. package/fesm2022/_expansion-chunk.mjs.map +0 -1
  25. package/fesm2022/_list-chunk.mjs +0 -374
  26. package/fesm2022/_list-chunk.mjs.map +0 -1
  27. package/fesm2022/_list-navigation-chunk.mjs +0 -131
  28. package/fesm2022/_list-navigation-chunk.mjs.map +0 -1
  29. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -145
  30. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  31. package/fesm2022/_tabs-chunk.mjs +0 -211
  32. package/fesm2022/_tabs-chunk.mjs.map +0 -1
  33. package/fesm2022/_toolbar-chunk.mjs +0 -273
  34. package/fesm2022/_toolbar-chunk.mjs.map +0 -1
  35. package/fesm2022/_toolbar-radio-group-chunk.mjs +0 -222
  36. package/fesm2022/_toolbar-radio-group-chunk.mjs.map +0 -1
  37. package/fesm2022/accordion.mjs +0 -195
  38. package/fesm2022/accordion.mjs.map +0 -1
  39. package/fesm2022/combobox.mjs +0 -131
  40. package/fesm2022/combobox.mjs.map +0 -1
  41. package/fesm2022/deferred-content.mjs +0 -59
  42. package/fesm2022/deferred-content.mjs.map +0 -1
  43. package/fesm2022/listbox.mjs +0 -204
  44. package/fesm2022/listbox.mjs.map +0 -1
  45. package/fesm2022/radio-group.mjs +0 -200
  46. package/fesm2022/radio-group.mjs.map +0 -1
  47. package/fesm2022/tabs.mjs +0 -303
  48. package/fesm2022/tabs.mjs.map +0 -1
  49. package/fesm2022/toolbar.mjs +0 -221
  50. package/fesm2022/toolbar.mjs.map +0 -1
  51. package/fesm2022/tree.mjs +0 -333
  52. package/fesm2022/tree.mjs.map +0 -1
  53. package/fesm2022/ui-patterns.mjs +0 -24
  54. package/fesm2022/ui-patterns.mjs.map +0 -1
  55. package/types/_accordion-chunk.d.ts +0 -90
  56. package/types/_combobox-chunk.d.ts +0 -138
  57. package/types/_expansion-chunk.d.ts +0 -71
  58. package/types/_list-chunk.d.ts +0 -209
  59. package/types/_list-navigation-chunk.d.ts +0 -101
  60. package/types/_listbox-chunk.d.ts +0 -105
  61. package/types/_pointer-event-manager-chunk.d.ts +0 -98
  62. package/types/_radio-group-chunk.d.ts +0 -92
  63. package/types/_tabs-chunk.d.ts +0 -138
  64. package/types/_toolbar-chunk.d.ts +0 -150
  65. package/types/_tree-chunk.d.ts +0 -139
  66. package/types/accordion.d.ts +0 -95
  67. package/types/combobox.d.ts +0 -54
  68. package/types/deferred-content.d.ts +0 -37
  69. package/types/listbox.d.ts +0 -99
  70. package/types/radio-group.d.ts +0 -85
  71. package/types/tabs.d.ts +0 -160
  72. package/types/toolbar.d.ts +0 -115
  73. package/types/tree.d.ts +0 -155
  74. package/types/ui-patterns.d.ts +0 -157
@@ -1,138 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.js';
3
- import { SignalLike, WritableSignalLike } from './_list-navigation-chunk.js';
4
- import { ListItem } from './_list-chunk.js';
5
-
6
- /** Represents the required inputs for a combobox. */
7
- interface ComboboxInputs<T extends ListItem<V>, V> {
8
- /** The controls for the popup associated with the combobox. */
9
- popupControls: SignalLike<ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | undefined>;
10
- /** The HTML input element that serves as the combobox input. */
11
- inputEl: SignalLike<HTMLInputElement | undefined>;
12
- /** The HTML element that serves as the combobox container. */
13
- containerEl: SignalLike<HTMLElement | undefined>;
14
- /** The filtering mode for the combobox. */
15
- filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;
16
- /** The current value of the combobox. */
17
- inputValue?: WritableSignalLike<string>;
18
- /** The value of the first matching item in the popup. */
19
- firstMatch: SignalLike<V | undefined>;
20
- }
21
- /** An interface that allows combobox popups to expose the necessary controls for the combobox. */
22
- interface ComboboxListboxControls<T extends ListItem<V>, V> {
23
- /** A unique identifier for the popup. */
24
- id: () => string;
25
- /** The ARIA role for the popup. */
26
- role: SignalLike<'listbox' | 'tree' | 'grid'>;
27
- /** The ID of the active item in the popup. */
28
- activeId: SignalLike<string | undefined>;
29
- /** The list of items in the popup. */
30
- items: SignalLike<T[]>;
31
- /** Navigates to the given item in the popup. */
32
- focus: (item: T) => void;
33
- /** Navigates to the next item in the popup. */
34
- next: () => void;
35
- /** Navigates to the previous item in the popup. */
36
- prev: () => void;
37
- /** Navigates to the first item in the popup. */
38
- first: () => void;
39
- /** Navigates to the last item in the popup. */
40
- last: () => void;
41
- /** Selects the current item in the popup. */
42
- select: (item?: T) => void;
43
- /** Clears the selection state of the popup. */
44
- clearSelection: () => void;
45
- /** Removes focus from any item in the popup. */
46
- unfocus: () => void;
47
- /** Returns the item corresponding to the given event. */
48
- getItem: (e: PointerEvent) => T | undefined;
49
- /** Returns the currently selected item in the popup. */
50
- getSelectedItem: () => T | undefined;
51
- /** Sets the value of the combobox based on the selected item. */
52
- setValue: (value: V | undefined) => void;
53
- }
54
- interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<T, V> {
55
- /** Whether the currently active item in the popup is collapsible. */
56
- isItemCollapsible: () => boolean;
57
- /** Expands the currently active item in the popup. */
58
- expandItem: () => void;
59
- /** Collapses the currently active item in the popup. */
60
- collapseItem: () => void;
61
- /** Checks if the currently active item in the popup is expandable. */
62
- isItemExpandable: () => boolean;
63
- /** Expands all nodes in the tree. */
64
- expandAll: () => void;
65
- /** Collapses all nodes in the tree. */
66
- collapseAll: () => void;
67
- }
68
- /** Controls the state of a combobox. */
69
- declare class ComboboxPattern<T extends ListItem<V>, V> {
70
- readonly inputs: ComboboxInputs<T, V>;
71
- /** Whether the combobox is expanded. */
72
- expanded: _angular_core.WritableSignal<boolean>;
73
- /** The ID of the active item in the combobox. */
74
- activedescendant: _angular_core.Signal<string | null>;
75
- /** The currently highlighted item in the combobox. */
76
- highlightedItem: _angular_core.WritableSignal<T | undefined>;
77
- /** Whether the most recent input event was a deletion. */
78
- isDeleting: boolean;
79
- /** Whether the combobox is focused. */
80
- isFocused: _angular_core.WritableSignal<boolean>;
81
- /** The key used to navigate to the previous item in the list. */
82
- expandKey: _angular_core.Signal<string>;
83
- /** The key used to navigate to the next item in the list. */
84
- collapseKey: _angular_core.Signal<string>;
85
- /** The ID of the popup associated with the combobox. */
86
- popupId: _angular_core.Signal<string | null>;
87
- /** The autocomplete behavior of the combobox. */
88
- autocomplete: _angular_core.Signal<"both" | "list">;
89
- /** The ARIA role of the popup associated with the combobox. */
90
- hasPopup: _angular_core.Signal<"listbox" | "tree" | "grid" | null>;
91
- /** The keydown event manager for the combobox. */
92
- keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
93
- /** The pointerup event manager for the combobox. */
94
- pointerup: _angular_core.Signal<PointerEventManager<PointerEvent>>;
95
- constructor(inputs: ComboboxInputs<T, V>);
96
- /** Handles keydown events for the combobox. */
97
- onKeydown(event: KeyboardEvent): void;
98
- /** Handles pointerup events for the combobox. */
99
- onPointerup(event: PointerEvent): void;
100
- /** Handles input events for the combobox. */
101
- onInput(event: Event): void;
102
- onFocusIn(): void;
103
- /** Handles focus out events for the combobox. */
104
- onFocusOut(event: FocusEvent): void;
105
- firstMatch: _angular_core.Signal<T | undefined>;
106
- onFilter(): void;
107
- highlight(): void;
108
- /** Closes the combobox. */
109
- close(): void;
110
- /** Opens the combobox. */
111
- open(nav?: {
112
- first?: boolean;
113
- last?: boolean;
114
- }): void;
115
- /** Navigates to the next focusable item in the combobox popup. */
116
- next(): void;
117
- /** Navigates to the previous focusable item in the combobox popup. */
118
- prev(): void;
119
- /** Navigates to the first focusable item in the combobox popup. */
120
- first(): void;
121
- /** Navigates to the last focusable item in the combobox popup. */
122
- last(): void;
123
- collapseItem(): void;
124
- expandItem(): void;
125
- /** Selects an item in the combobox popup. */
126
- select(opts?: {
127
- item?: T;
128
- commit?: boolean;
129
- close?: boolean;
130
- }): void;
131
- /** Updates the value of the input based on the currently selected item. */
132
- commit(): void;
133
- /** Navigates and handles additional actions based on filter mode. */
134
- private _navigate;
135
- }
136
-
137
- export { ComboboxPattern };
138
- export type { ComboboxInputs, ComboboxListboxControls, ComboboxTreeControls };
@@ -1,71 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { SignalLike, WritableSignalLike } from './_list-navigation-chunk.js';
3
-
4
- /** Represents an item that can be expanded or collapsed. */
5
- interface ExpansionItem {
6
- /** Whether the item is expandable. */
7
- expandable: SignalLike<boolean>;
8
- /** Used to uniquely identify an expansion item. */
9
- expansionId: SignalLike<string>;
10
- /** Whether the expansion is disabled. */
11
- disabled: SignalLike<boolean>;
12
- }
13
- interface ExpansionControl extends ExpansionItem {
14
- }
15
- /**
16
- * Controls a single item's expansion state and interactions,
17
- * delegating actual state changes to an Expansion manager.
18
- */
19
- declare class ExpansionControl {
20
- readonly inputs: ExpansionItem & {
21
- expansionManager: ListExpansion;
22
- };
23
- /** Whether this specific item is currently expanded. Derived from the Expansion manager. */
24
- readonly isExpanded: _angular_core.Signal<boolean>;
25
- /** Whether this item can be expanded. */
26
- readonly isExpandable: _angular_core.Signal<boolean>;
27
- constructor(inputs: ExpansionItem & {
28
- expansionManager: ListExpansion;
29
- });
30
- /** Requests the Expansion manager to open this item. */
31
- open(): void;
32
- /** Requests the Expansion manager to close this item. */
33
- close(): void;
34
- /** Requests the Expansion manager to toggle this item. */
35
- toggle(): void;
36
- }
37
- /** Represents the required inputs for an expansion behavior. */
38
- interface ListExpansionInputs {
39
- /** Whether multiple items can be expanded at once. */
40
- multiExpandable: SignalLike<boolean>;
41
- /** An array of ids of the currently expanded items. */
42
- expandedIds: WritableSignalLike<string[]>;
43
- /** An array of expansion items. */
44
- items: SignalLike<ExpansionItem[]>;
45
- /** Whether all expansions are disabled. */
46
- disabled: SignalLike<boolean>;
47
- }
48
- /** Manages the expansion state of a list of items. */
49
- declare class ListExpansion {
50
- readonly inputs: ListExpansionInputs;
51
- /** A signal holding an array of ids of the currently expanded items. */
52
- expandedIds: WritableSignalLike<string[]>;
53
- constructor(inputs: ListExpansionInputs);
54
- /** Opens the specified item. */
55
- open(item: ExpansionItem): void;
56
- /** Closes the specified item. */
57
- close(item: ExpansionItem): void;
58
- /** Toggles the expansion state of the specified item. */
59
- toggle(item: ExpansionItem): void;
60
- /** Opens all focusable items in the list. */
61
- openAll(): void;
62
- /** Closes all focusable items in the list. */
63
- closeAll(): void;
64
- /** Checks whether the specified item is expandable / collapsible. */
65
- isExpandable(item: ExpansionItem): boolean;
66
- /** Checks whether the specified item is currently expanded. */
67
- isExpanded(item: ExpansionItem): boolean;
68
- }
69
-
70
- export { ExpansionControl, ListExpansion };
71
- export type { ExpansionItem, ListExpansionInputs };
@@ -1,209 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { ListFocusItem, SignalLike, ListFocusInputs, WritableSignalLike, ListFocus, ListNavigationItem, ListNavigationInputs, ListNavigation } from './_list-navigation-chunk.js';
3
-
4
- /** Represents an item in a collection, such as a listbox option, than can be selected. */
5
- interface ListSelectionItem<V> extends ListFocusItem {
6
- /** The value of the item. */
7
- value: SignalLike<V>;
8
- }
9
- /** Represents the required inputs for a collection that contains selectable items. */
10
- interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
11
- /** Whether multiple items in the list can be selected at once. */
12
- multi: SignalLike<boolean>;
13
- /** The current value of the list selection. */
14
- value: WritableSignalLike<V[]>;
15
- /** The selection strategy used by the list. */
16
- selectionMode: SignalLike<'follow' | 'explicit'>;
17
- }
18
- /** Controls selection for a list of items. */
19
- declare class ListSelection<T extends ListSelectionItem<V>, V> {
20
- readonly inputs: ListSelectionInputs<T, V> & {
21
- focusManager: ListFocus<T>;
22
- };
23
- /** The start index to use for range selection. */
24
- rangeStartIndex: _angular_core.WritableSignal<number>;
25
- /** The end index to use for range selection. */
26
- rangeEndIndex: _angular_core.WritableSignal<number>;
27
- /** The currently selected items. */
28
- selectedItems: _angular_core.Signal<T[]>;
29
- constructor(inputs: ListSelectionInputs<T, V> & {
30
- focusManager: ListFocus<T>;
31
- });
32
- /** Selects the item at the current active index. */
33
- select(item?: ListSelectionItem<V>, opts?: {
34
- anchor: boolean;
35
- }): void;
36
- /** Deselects the item at the current active index. */
37
- deselect(item?: T | null): void;
38
- /** Toggles the item at the current active index. */
39
- toggle(): void;
40
- /** Toggles only the item at the current active index. */
41
- toggleOne(): void;
42
- /** Selects all items in the list. */
43
- selectAll(): void;
44
- /** Deselects all items in the list. */
45
- deselectAll(): void;
46
- /**
47
- * Selects all items in the list or deselects all
48
- * items in the list if all items are already selected.
49
- */
50
- toggleAll(): void;
51
- /** Sets the selection to only the current active item. */
52
- selectOne(): void;
53
- /**
54
- * Selects all items in the list up to the anchor item.
55
- *
56
- * Deselects all items that were previously within the
57
- * selected range that are now outside of the selected range
58
- */
59
- selectRange(opts?: {
60
- anchor: boolean;
61
- }): void;
62
- /** Marks the given index as the start of a range selection. */
63
- beginRangeSelection(index?: number): void;
64
- /** Returns the items in the list starting from the given index. */
65
- private _getItemsFromIndex;
66
- }
67
-
68
- /**
69
- * Represents an item in a collection, such as a listbox option, than can be navigated to by
70
- * typeahead.
71
- */
72
- interface ListTypeaheadItem extends ListFocusItem {
73
- /** The text used by the typeahead search. */
74
- searchTerm: SignalLike<string>;
75
- }
76
- /**
77
- * Represents the required inputs for a collection that contains items that can be navigated to by
78
- * typeahead.
79
- */
80
- interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {
81
- /** The amount of time before the typeahead search is reset. */
82
- typeaheadDelay: SignalLike<number>;
83
- }
84
- /** Controls typeahead for a list of items. */
85
- declare class ListTypeahead<T extends ListTypeaheadItem> {
86
- readonly inputs: ListTypeaheadInputs<T> & {
87
- focusManager: ListFocus<T>;
88
- };
89
- /** A reference to the timeout for resetting the typeahead search. */
90
- timeout?: ReturnType<typeof setTimeout> | undefined;
91
- /** The focus controller of the parent list. */
92
- focusManager: ListFocus<T>;
93
- /** Whether the user is actively typing a typeahead search query. */
94
- isTyping: _angular_core.Signal<boolean>;
95
- /** Keeps track of the characters that typeahead search is being called with. */
96
- private _query;
97
- /** The index where that the typeahead search was initiated from. */
98
- private _startIndex;
99
- constructor(inputs: ListTypeaheadInputs<T> & {
100
- focusManager: ListFocus<T>;
101
- });
102
- /** Performs a typeahead search, appending the given character to the search string. */
103
- search(char: string): boolean;
104
- /**
105
- * Returns the first item whose search term matches the
106
- * current query starting from the the current anchor index.
107
- */
108
- private _getItem;
109
- }
110
-
111
- /** The selection operations that the list can perform. */
112
- interface SelectOptions {
113
- toggle?: boolean;
114
- select?: boolean;
115
- selectOne?: boolean;
116
- selectRange?: boolean;
117
- anchor?: boolean;
118
- }
119
- /** Represents an item in the list. */
120
- type ListItem<V> = ListTypeaheadItem & ListNavigationItem & ListSelectionItem<V> & ListFocusItem;
121
- /** The necessary inputs for the list behavior. */
122
- type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> & ListNavigationInputs<T> & ListSelectionInputs<T, V> & ListTypeaheadInputs<T>;
123
- /** Controls the state of a list. */
124
- declare class List<T extends ListItem<V>, V> {
125
- readonly inputs: ListInputs<T, V>;
126
- /** Controls navigation for the list. */
127
- navigationBehavior: ListNavigation<T>;
128
- /** Controls selection for the list. */
129
- selectionBehavior: ListSelection<T, V>;
130
- /** Controls typeahead for the list. */
131
- typeaheadBehavior: ListTypeahead<T>;
132
- /** Controls focus for the list. */
133
- focusBehavior: ListFocus<T>;
134
- /** Whether the list is disabled. */
135
- disabled: _angular_core.Signal<boolean>;
136
- /** The id of the current active item. */
137
- activedescendant: _angular_core.Signal<string | undefined>;
138
- /** The tabindex of the list. */
139
- tabindex: _angular_core.Signal<0 | -1>;
140
- /** The index of the currently active item in the list. */
141
- activeIndex: _angular_core.Signal<number>;
142
- /**
143
- * The uncommitted index for selecting a range of options.
144
- *
145
- * NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
146
- * The anchorIndex does not necessarily represent the start of a range, but represents the most
147
- * recent index where the user showed intent to begin a range selection. Usually, this is wherever
148
- * the user most recently pressed the "Shift" key, but if the user presses shift + space to select
149
- * from the anchor, the user is not intending to start a new range from this index.
150
- *
151
- * In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
152
- * while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
153
- */
154
- private _anchorIndex;
155
- /** Whether the list should wrap. Used to disable wrapping while range selecting. */
156
- private _wrap;
157
- constructor(inputs: ListInputs<T, V>);
158
- /** Returns the tabindex for the given item. */
159
- getItemTabindex(item: T): 0 | -1;
160
- /** Navigates to the first option in the list. */
161
- first(opts?: SelectOptions): void;
162
- /** Navigates to the last option in the list. */
163
- last(opts?: SelectOptions): void;
164
- /** Navigates to the next option in the list. */
165
- next(opts?: SelectOptions): void;
166
- /** Navigates to the previous option in the list. */
167
- prev(opts?: SelectOptions): void;
168
- /** Navigates to the given item in the list. */
169
- goto(item: T, opts?: SelectOptions): void;
170
- /** Removes focus from the list. */
171
- unfocus(): void;
172
- /** Marks the given index as the potential start of a range selection. */
173
- anchor(index: number): void;
174
- /** Handles typeahead search navigation for the list. */
175
- search(char: string, opts?: SelectOptions): void;
176
- /** Checks if the list is currently typing for typeahead search. */
177
- isTyping(): boolean;
178
- /** Selects the currently active item in the list. */
179
- select(item?: T): void;
180
- /** Sets the selection to only the current active item. */
181
- selectOne(): void;
182
- /** Deselects the currently active item in the list. */
183
- deselect(): void;
184
- /** Deselects all items in the list. */
185
- deselectAll(): void;
186
- /** Toggles the currently active item in the list. */
187
- toggle(): void;
188
- /** Toggles the currently active item in the list, deselecting all other items. */
189
- toggleOne(): void;
190
- /** Toggles the selection of all items in the list. */
191
- toggleAll(): void;
192
- /** Checks if the given item is able to receive focus. */
193
- isFocusable(item: T): boolean;
194
- /** Handles updating selection for the list. */
195
- updateSelection(opts?: SelectOptions): void;
196
- /**
197
- * Safely performs a navigation operation.
198
- *
199
- * Handles conditionally disabling wrapping for when a navigation
200
- * operation is occurring while the user is selecting a range of options.
201
- *
202
- * Handles boilerplate calling of focus & selection operations. Also ensures these
203
- * additional operations are only called if the navigation operation moved focus to a new option.
204
- */
205
- private _navigate;
206
- }
207
-
208
- export { List };
209
- export type { ListInputs, ListItem };
@@ -1,101 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
-
3
- type SignalLike<T> = () => T;
4
- interface WritableSignalLike<T> extends SignalLike<T> {
5
- set(value: T): void;
6
- update(updateFn: (value: T) => T): void;
7
- }
8
- /** Converts a getter setter style signal to a WritableSignalLike. */
9
- declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
10
-
11
- /** Represents an item in a collection, such as a listbox option, than may receive focus. */
12
- interface ListFocusItem {
13
- /** A unique identifier for the item. */
14
- id: SignalLike<string>;
15
- /** The html element that should receive focus. */
16
- element: SignalLike<HTMLElement>;
17
- /** Whether an item is disabled. */
18
- disabled: SignalLike<boolean>;
19
- /** The index of the item in the list. */
20
- index: SignalLike<number>;
21
- }
22
- /** Represents the required inputs for a collection that contains focusable items. */
23
- interface ListFocusInputs<T extends ListFocusItem> {
24
- /** The focus strategy used by the list. */
25
- focusMode: SignalLike<'roving' | 'activedescendant'>;
26
- /** Whether the list is disabled. */
27
- disabled: SignalLike<boolean>;
28
- /** The items in the list. */
29
- items: SignalLike<T[]>;
30
- /** The active item. */
31
- activeItem: WritableSignalLike<T | undefined>;
32
- /** Whether disabled items in the list should be skipped when navigating. */
33
- skipDisabled: SignalLike<boolean>;
34
- element: SignalLike<HTMLElement | undefined>;
35
- }
36
- /** Controls focus for a list of items. */
37
- declare class ListFocus<T extends ListFocusItem> {
38
- readonly inputs: ListFocusInputs<T>;
39
- /** The last item that was active. */
40
- prevActiveItem: _angular_core.WritableSignal<T | undefined>;
41
- /** The index of the last item that was active. */
42
- prevActiveIndex: _angular_core.Signal<number>;
43
- /** The current active index in the list. */
44
- activeIndex: _angular_core.Signal<number>;
45
- constructor(inputs: ListFocusInputs<T>);
46
- /** Whether the list is in a disabled state. */
47
- isListDisabled(): boolean;
48
- /** The id of the current active item. */
49
- getActiveDescendant(): string | undefined;
50
- /** The tabindex for the list. */
51
- getListTabindex(): -1 | 0;
52
- /** Returns the tabindex for the given item. */
53
- getItemTabindex(item: T): -1 | 0;
54
- /** Moves focus to the given item if it is focusable. */
55
- focus(item: T): boolean;
56
- /** Returns true if the given item can be navigated to. */
57
- isFocusable(item: T): boolean;
58
- }
59
-
60
- /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
61
- interface ListNavigationItem extends ListFocusItem {
62
- }
63
- /** Represents the required inputs for a collection that has navigable items. */
64
- interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
65
- /** Whether focus should wrap when navigating. */
66
- wrap: SignalLike<boolean>;
67
- /** Whether the list is vertically or horizontally oriented. */
68
- orientation: SignalLike<'vertical' | 'horizontal'>;
69
- /** The direction that text is read based on the users locale. */
70
- textDirection: SignalLike<'rtl' | 'ltr'>;
71
- }
72
- /** Controls navigation for a list of items. */
73
- declare class ListNavigation<T extends ListNavigationItem> {
74
- readonly inputs: ListNavigationInputs<T> & {
75
- focusManager: ListFocus<T>;
76
- };
77
- constructor(inputs: ListNavigationInputs<T> & {
78
- focusManager: ListFocus<T>;
79
- });
80
- /** Navigates to the given item. */
81
- goto(item?: T): boolean;
82
- /** Navigates to the next item in the list. */
83
- next(): boolean;
84
- /** Peeks the next item in the list. */
85
- peekNext(): T | undefined;
86
- /** Navigates to the previous item in the list. */
87
- prev(): boolean;
88
- /** Peeks the previous item in the list. */
89
- peekPrev(): T | undefined;
90
- /** Navigates to the first item in the list. */
91
- first(): boolean;
92
- /** Navigates to the last item in the list. */
93
- last(): boolean;
94
- /** Advances to the next or previous focusable item in the list based on the given delta. */
95
- private _advance;
96
- /** Peeks the next or previous focusable item in the list based on the given delta. */
97
- private _peek;
98
- }
99
-
100
- export { ListFocus, ListNavigation, convertGetterSetterToWritableSignalLike };
101
- export type { ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem, SignalLike, WritableSignalLike };
@@ -1,105 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { SignalLike } from './_list-navigation-chunk.js';
3
- import { ListItem, ListInputs, List } from './_list-chunk.js';
4
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.js';
5
-
6
- /**
7
- * Represents the properties exposed by a listbox that need to be accessed by an option.
8
- * This exists to avoid circular dependency errors between the listbox and option.
9
- */
10
- interface ListboxPattern$1<V> {
11
- inputs: ListInputs<OptionPattern<V>, V>;
12
- listBehavior: List<OptionPattern<V>, V>;
13
- }
14
- /** Represents the required inputs for an option in a listbox. */
15
- interface OptionInputs<V> extends Omit<ListItem<V>, 'index'> {
16
- listbox: SignalLike<ListboxPattern$1<V> | undefined>;
17
- }
18
- /** Represents an option in a listbox. */
19
- declare class OptionPattern<V> {
20
- /** A unique identifier for the option. */
21
- id: SignalLike<string>;
22
- /** The value of the option. */
23
- value: SignalLike<V>;
24
- /** The position of the option in the list. */
25
- index: _angular_core.Signal<number>;
26
- /** Whether the option is active. */
27
- active: _angular_core.Signal<boolean>;
28
- /** Whether the option is selected. */
29
- selected: _angular_core.Signal<boolean | undefined>;
30
- /** Whether the option is disabled. */
31
- disabled: SignalLike<boolean>;
32
- /** The text used by the typeahead search. */
33
- searchTerm: SignalLike<string>;
34
- /** A reference to the parent listbox. */
35
- listbox: SignalLike<ListboxPattern$1<V> | undefined>;
36
- /** The tabindex of the option. */
37
- tabindex: _angular_core.Signal<0 | -1 | undefined>;
38
- /** The html element that should receive focus. */
39
- element: SignalLike<HTMLElement>;
40
- constructor(args: OptionInputs<V>);
41
- }
42
-
43
- /** Represents the required inputs for a listbox. */
44
- type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {
45
- /** A unique identifier for the listbox. */
46
- id: SignalLike<string>;
47
- /** Whether the listbox is readonly. */
48
- readonly: SignalLike<boolean>;
49
- };
50
- /** Controls the state of a listbox. */
51
- declare class ListboxPattern<V> {
52
- readonly inputs: ListboxInputs<V>;
53
- listBehavior: List<OptionPattern<V>, V>;
54
- /** Whether the list is vertically or horizontally oriented. */
55
- orientation: SignalLike<'vertical' | 'horizontal'>;
56
- /** Whether the listbox is disabled. */
57
- disabled: _angular_core.Signal<boolean>;
58
- /** Whether the listbox is readonly. */
59
- readonly: SignalLike<boolean>;
60
- /** The tabindex of the listbox. */
61
- tabindex: SignalLike<-1 | 0>;
62
- /** The id of the current active item. */
63
- activedescendant: _angular_core.Signal<string | undefined>;
64
- /** Whether multiple items in the list can be selected at once. */
65
- multi: SignalLike<boolean>;
66
- /** The number of items in the listbox. */
67
- setsize: _angular_core.Signal<number>;
68
- /** Whether the listbox selection follows focus. */
69
- followFocus: _angular_core.Signal<boolean>;
70
- /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
71
- wrap: _angular_core.WritableSignal<boolean>;
72
- /** The key used to navigate to the previous item in the list. */
73
- prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
74
- /** The key used to navigate to the next item in the list. */
75
- nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
76
- /** Represents the space key. Does nothing when the user is actively using typeahead. */
77
- dynamicSpaceKey: _angular_core.Signal<"" | " ">;
78
- /** The regexp used to decide if a key should trigger typeahead. */
79
- typeaheadRegexp: RegExp;
80
- /** The keydown event manager for the listbox. */
81
- keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
82
- /** The pointerdown event manager for the listbox. */
83
- pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
84
- constructor(inputs: ListboxInputs<V>);
85
- /** Returns a set of violations */
86
- validate(): string[];
87
- /** Handles keydown events for the listbox. */
88
- onKeydown(event: KeyboardEvent): void;
89
- onPointerdown(event: PointerEvent): void;
90
- /**
91
- * Sets the listbox to it's default initial state.
92
- *
93
- * Sets the active index of the listbox to the first focusable selected
94
- * item if one exists. Otherwise, sets focus to the first focusable item.
95
- *
96
- * This method should be called once the listbox and it's options are properly initialized,
97
- * meaning the ListboxPattern and OptionPatterns should have references to each other before this
98
- * is called.
99
- */
100
- setDefaultState(): void;
101
- protected _getItem(e: PointerEvent): OptionPattern<V> | undefined;
102
- }
103
-
104
- export { ListboxPattern, OptionPattern };
105
- export type { ListboxInputs, OptionInputs };