@angular/aria 21.0.2 → 21.0.4

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 (81) hide show
  1. package/fesm2022/_accordion-chunk.mjs +108 -0
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-chunk.mjs +425 -0
  4. package/fesm2022/_combobox-chunk.mjs.map +1 -0
  5. package/fesm2022/_combobox-listbox-chunk.mjs +240 -0
  6. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
  7. package/fesm2022/_combobox-tree-chunk.mjs +331 -0
  8. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -0
  9. package/fesm2022/_deferred-content-chunk.mjs +124 -0
  10. package/fesm2022/_deferred-content-chunk.mjs.map +1 -0
  11. package/fesm2022/_expansion-chunk.mjs +41 -0
  12. package/fesm2022/_expansion-chunk.mjs.map +1 -0
  13. package/fesm2022/_list-chunk.mjs +287 -0
  14. package/fesm2022/_list-chunk.mjs.map +1 -0
  15. package/fesm2022/_list-navigation-chunk.mjs +116 -0
  16. package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
  17. package/fesm2022/_menu-chunk.mjs +515 -0
  18. package/fesm2022/_menu-chunk.mjs.map +1 -0
  19. package/fesm2022/_pointer-event-manager-chunk.mjs +54 -0
  20. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
  21. package/fesm2022/_signal-like-chunk.mjs +118 -0
  22. package/fesm2022/_signal-like-chunk.mjs.map +1 -0
  23. package/fesm2022/_tabs-chunk.mjs +159 -0
  24. package/fesm2022/_tabs-chunk.mjs.map +1 -0
  25. package/fesm2022/_toolbar-widget-group-chunk.mjs +148 -0
  26. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -0
  27. package/fesm2022/_widget-chunk.mjs +5 -246
  28. package/fesm2022/_widget-chunk.mjs.map +1 -1
  29. package/fesm2022/accordion.mjs +73 -55
  30. package/fesm2022/accordion.mjs.map +1 -1
  31. package/fesm2022/aria.mjs +1 -1
  32. package/fesm2022/aria.mjs.map +1 -1
  33. package/fesm2022/combobox.mjs +166 -153
  34. package/fesm2022/combobox.mjs.map +1 -1
  35. package/fesm2022/grid.mjs +287 -261
  36. package/fesm2022/grid.mjs.map +1 -1
  37. package/fesm2022/listbox.mjs +211 -197
  38. package/fesm2022/listbox.mjs.map +1 -1
  39. package/fesm2022/menu.mjs +308 -286
  40. package/fesm2022/menu.mjs.map +1 -1
  41. package/fesm2022/private.mjs +15 -2329
  42. package/fesm2022/private.mjs.map +1 -1
  43. package/fesm2022/tabs.mjs +221 -199
  44. package/fesm2022/tabs.mjs.map +1 -1
  45. package/fesm2022/toolbar.mjs +64 -48
  46. package/fesm2022/toolbar.mjs.map +1 -1
  47. package/fesm2022/tree.mjs +54 -44
  48. package/fesm2022/tree.mjs.map +1 -1
  49. package/package.json +2 -2
  50. package/types/_accordion-chunk.d.ts +100 -0
  51. package/types/_combobox-chunk.d.ts +194 -0
  52. package/types/_deferred-content-chunk.d.ts +42 -0
  53. package/types/_expansion-chunk.d.ts +40 -0
  54. package/types/_grid-chunk.d.ts +43 -250
  55. package/types/_keyboard-event-manager-chunk.d.ts +68 -0
  56. package/types/_list-chunk.d.ts +211 -0
  57. package/types/_list-navigation-chunk.d.ts +119 -0
  58. package/types/_listbox-chunk.d.ts +107 -0
  59. package/types/_menu-chunk.d.ts +267 -0
  60. package/types/_pointer-event-manager-chunk.d.ts +34 -0
  61. package/types/_tabs-chunk.d.ts +153 -0
  62. package/types/_toolbar-chunk.d.ts +124 -0
  63. package/types/_tree-chunk.d.ts +185 -0
  64. package/types/accordion.d.ts +65 -54
  65. package/types/aria.d.ts +1 -1
  66. package/types/combobox.d.ts +86 -56
  67. package/types/grid.d.ts +47 -32
  68. package/types/listbox.d.ts +22 -7
  69. package/types/menu.d.ts +135 -117
  70. package/types/private.d.ts +28 -1376
  71. package/types/tabs.d.ts +109 -88
  72. package/types/toolbar.d.ts +77 -66
  73. package/types/tree.d.ts +118 -104
  74. package/_adev_assets/aria-accordion.json +0 -743
  75. package/_adev_assets/aria-combobox.json +0 -603
  76. package/_adev_assets/aria-grid.json +0 -893
  77. package/_adev_assets/aria-listbox.json +0 -540
  78. package/_adev_assets/aria-menu.json +0 -1049
  79. package/_adev_assets/aria-tabs.json +0 -880
  80. package/_adev_assets/aria-toolbar.json +0 -545
  81. package/_adev_assets/aria-tree.json +0 -853
@@ -0,0 +1,194 @@
1
+ import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
2
+ import { 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> | ComboboxDialogPattern | 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
+ /** Whether the combobox is disabled. */
21
+ disabled: SignalLike<boolean>;
22
+ /** Whether the combobox is read-only. */
23
+ readonly: SignalLike<boolean>;
24
+ /** Whether the combobox is in a right-to-left context. */
25
+ textDirection: SignalLike<'rtl' | 'ltr'>;
26
+ /** Whether the combobox is always expanded. */
27
+ alwaysExpanded: SignalLike<boolean>;
28
+ }
29
+ /** An interface that allows combobox popups to expose the necessary controls for the combobox. */
30
+ interface ComboboxListboxControls<T extends ListItem<V>, V> {
31
+ /** A unique identifier for the popup. */
32
+ id: () => string;
33
+ /** The ARIA role for the popup. */
34
+ role: SignalLike<'listbox' | 'tree' | 'grid'>;
35
+ /** Whether multiple items in the popup can be selected at once. */
36
+ multi: SignalLike<boolean>;
37
+ /** The ID of the active item in the popup. */
38
+ activeId: SignalLike<string | undefined>;
39
+ /** The list of items in the popup. */
40
+ items: SignalLike<T[]>;
41
+ /** Navigates to the given item in the popup. */
42
+ focus: (item: T, opts?: {
43
+ focusElement?: boolean;
44
+ }) => void;
45
+ /** Navigates to the next item in the popup. */
46
+ next: () => void;
47
+ /** Navigates to the previous item in the popup. */
48
+ prev: () => void;
49
+ /** Navigates to the first item in the popup. */
50
+ first: () => void;
51
+ /** Navigates to the last item in the popup. */
52
+ last: () => void;
53
+ /** Selects the current item in the popup. */
54
+ select: (item?: T) => void;
55
+ /** Toggles the selection state of the given item in the popup. */
56
+ toggle: (item?: T) => void;
57
+ /** Clears the selection state of the popup. */
58
+ clearSelection: () => void;
59
+ /** Removes focus from any item in the popup. */
60
+ unfocus: () => void;
61
+ /** Returns the item corresponding to the given event. */
62
+ getItem: (e: PointerEvent) => T | undefined;
63
+ /** Returns the currently active (focused) item in the popup. */
64
+ getActiveItem: () => T | undefined;
65
+ /** Returns the currently selected items in the popup. */
66
+ getSelectedItems: () => T[];
67
+ /** Sets the value of the combobox based on the selected item. */
68
+ setValue: (value: V | undefined) => void;
69
+ }
70
+ interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<T, V> {
71
+ /** Whether the currently active item in the popup is collapsible. */
72
+ isItemCollapsible: () => boolean;
73
+ /** Expands the currently active item in the popup. */
74
+ expandItem: () => void;
75
+ /** Collapses the currently active item in the popup. */
76
+ collapseItem: () => void;
77
+ /** Checks if the currently active item in the popup is expandable. */
78
+ isItemExpandable: (item?: T) => boolean;
79
+ /** Expands all nodes in the tree. */
80
+ expandAll: () => void;
81
+ /** Collapses all nodes in the tree. */
82
+ collapseAll: () => void;
83
+ /** Toggles the expansion state of the currently active item in the popup. */
84
+ toggleExpansion: (item?: T) => void;
85
+ /** Whether the current active item is selectable. */
86
+ isItemSelectable: (item?: T) => boolean;
87
+ }
88
+ /** Controls the state of a combobox. */
89
+ declare class ComboboxPattern<T extends ListItem<V>, V> {
90
+ readonly inputs: ComboboxInputs<T, V>;
91
+ /** Whether the combobox is expanded. */
92
+ expanded: WritableSignalLike<boolean>;
93
+ /** Whether the combobox is disabled. */
94
+ disabled: () => boolean;
95
+ /** The ID of the active item in the combobox. */
96
+ activeDescendant: SignalLike<string | null>;
97
+ /** The currently highlighted item in the combobox. */
98
+ highlightedItem: WritableSignalLike<T | undefined>;
99
+ /** Whether the most recent input event was a deletion. */
100
+ isDeleting: boolean;
101
+ /** Whether the combobox is focused. */
102
+ isFocused: WritableSignalLike<boolean>;
103
+ /** Whether the combobox has ever been focused. */
104
+ hasBeenFocused: WritableSignalLike<boolean>;
105
+ /** The key used to navigate to the previous item in the list. */
106
+ expandKey: SignalLike<"ArrowLeft" | "ArrowRight">;
107
+ /** The key used to navigate to the next item in the list. */
108
+ collapseKey: SignalLike<"ArrowLeft" | "ArrowRight">;
109
+ /** The ID of the popup associated with the combobox. */
110
+ popupId: SignalLike<string | null>;
111
+ /** The autocomplete behavior of the combobox. */
112
+ autocomplete: SignalLike<"both" | "list">;
113
+ /** The ARIA role of the popup associated with the combobox. */
114
+ hasPopup: SignalLike<"listbox" | "tree" | "grid" | "dialog" | null>;
115
+ /** Whether the combobox is read-only. */
116
+ readonly: SignalLike<true | null>;
117
+ /** Returns the listbox controls for the combobox. */
118
+ listControls: () => ComboboxListboxControls<T, V> | null | undefined;
119
+ /** Returns the tree controls for the combobox. */
120
+ treeControls: () => ComboboxTreeControls<T, V> | null;
121
+ /** The keydown event manager for the combobox. */
122
+ keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
123
+ /** The click event manager for the combobox. */
124
+ click: SignalLike<PointerEventManager<PointerEvent>>;
125
+ constructor(inputs: ComboboxInputs<T, V>);
126
+ /** Handles keydown events for the combobox. */
127
+ onKeydown(event: KeyboardEvent): void;
128
+ /** Handles click events for the combobox. */
129
+ onClick(event: MouseEvent): void;
130
+ /** Handles input events for the combobox. */
131
+ onInput(event: Event): void;
132
+ /** Handles focus in events for the combobox. */
133
+ onFocusIn(): void;
134
+ /** Handles focus out events for the combobox. */
135
+ onFocusOut(event: FocusEvent): void;
136
+ /** The first matching item in the combobox. */
137
+ firstMatch: SignalLike<T | undefined>;
138
+ /** Handles filtering logic for the combobox. */
139
+ onFilter(): void;
140
+ /** Highlights the currently selected item in the combobox. */
141
+ highlight(): void;
142
+ /** Closes the combobox. */
143
+ close(opts?: {
144
+ reset: boolean;
145
+ }): void;
146
+ /** Opens the combobox. */
147
+ open(nav?: {
148
+ first?: boolean;
149
+ last?: boolean;
150
+ selected?: boolean;
151
+ }): void;
152
+ /** Navigates to the next focusable item in the combobox popup. */
153
+ next(): void;
154
+ /** Navigates to the previous focusable item in the combobox popup. */
155
+ prev(): void;
156
+ /** Navigates to the first focusable item in the combobox popup. */
157
+ first(): void;
158
+ /** Navigates to the last focusable item in the combobox popup. */
159
+ last(): void;
160
+ /** Collapses the currently focused item in the combobox. */
161
+ collapseItem(): void;
162
+ /** Expands the currently focused item in the combobox. */
163
+ expandItem(): void;
164
+ /** Selects an item in the combobox popup. */
165
+ select(opts?: {
166
+ item?: T;
167
+ commit?: boolean;
168
+ close?: boolean;
169
+ }): void;
170
+ /** Updates the value of the input based on the currently selected item. */
171
+ commit(): void;
172
+ /** Navigates and handles additional actions based on filter mode. */
173
+ private _navigate;
174
+ }
175
+ declare class ComboboxDialogPattern {
176
+ readonly inputs: {
177
+ combobox: ComboboxPattern<any, any>;
178
+ element: SignalLike<HTMLDialogElement>;
179
+ id: SignalLike<string>;
180
+ };
181
+ id: () => string;
182
+ role: () => "dialog";
183
+ keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
184
+ constructor(inputs: {
185
+ combobox: ComboboxPattern<any, any>;
186
+ element: SignalLike<HTMLDialogElement>;
187
+ id: SignalLike<string>;
188
+ });
189
+ onKeydown(event: KeyboardEvent): void;
190
+ onClick(event: MouseEvent): void;
191
+ }
192
+
193
+ export { ComboboxDialogPattern, ComboboxPattern };
194
+ export type { ComboboxInputs, ComboboxListboxControls, ComboboxTreeControls };
@@ -0,0 +1,42 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnDestroy } from '@angular/core';
3
+
4
+ /**
5
+ * A container directive controls the visibility of its content.
6
+ */
7
+ declare class DeferredContentAware {
8
+ readonly contentVisible: _angular_core.WritableSignal<boolean>;
9
+ readonly preserveContent: _angular_core.ModelSignal<boolean>;
10
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContentAware, never>;
11
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContentAware, never, never, { "preserveContent": { "alias": "preserveContent"; "required": false; "isSignal": true; }; }, { "preserveContent": "preserveContentChange"; }, never, never, true, never>;
12
+ }
13
+ /**
14
+ * DeferredContent loads/unloads the content based on the visibility.
15
+ * The visibilty signal is sent from a parent directive implements
16
+ * DeferredContentAware.
17
+ *
18
+ * Use this directive as a host directive. For example:
19
+ *
20
+ * ```ts
21
+ * @Directive({
22
+ * selector: 'ng-template[AccordionContent]',
23
+ * hostDirectives: [DeferredContent],
24
+ * })
25
+ * class AccordionContent {}
26
+ * ```
27
+ */
28
+ declare class DeferredContent implements OnDestroy {
29
+ private readonly _deferredContentAware;
30
+ private readonly _templateRef;
31
+ private readonly _viewContainerRef;
32
+ private _currentViewRef;
33
+ private _isRendered;
34
+ readonly deferredContentAware: _angular_core.WritableSignal<DeferredContentAware | null>;
35
+ constructor();
36
+ ngOnDestroy(): void;
37
+ private _destroyContent;
38
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContent, never>;
39
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContent, never, never, {}, {}, never, never, true, never>;
40
+ }
41
+
42
+ export { DeferredContent, DeferredContentAware };
@@ -0,0 +1,40 @@
1
+ import { SignalLike, WritableSignalLike } from './_list-navigation-chunk.js';
2
+
3
+ /** Represents an item that can be expanded or collapsed. */
4
+ interface ExpansionItem {
5
+ /** Whether the item is expandable. */
6
+ expandable: SignalLike<boolean>;
7
+ /** Whether the item is expanded. */
8
+ expanded: WritableSignalLike<boolean>;
9
+ /** Whether the expansion is disabled. */
10
+ disabled: SignalLike<boolean>;
11
+ }
12
+ /** Represents the required inputs for an expansion behavior. */
13
+ interface ListExpansionInputs {
14
+ /** Whether multiple items can be expanded at once. */
15
+ multiExpandable: SignalLike<boolean>;
16
+ /** An array of expansion items. */
17
+ items: SignalLike<ExpansionItem[]>;
18
+ /** Whether all expansions are disabled. */
19
+ disabled: SignalLike<boolean>;
20
+ }
21
+ /** Manages the expansion state of a list of items. */
22
+ declare class ListExpansion {
23
+ readonly inputs: ListExpansionInputs;
24
+ constructor(inputs: ListExpansionInputs);
25
+ /** Opens the specified item. */
26
+ open(item: ExpansionItem): boolean;
27
+ /** Closes the specified item. */
28
+ close(item: ExpansionItem): boolean;
29
+ /** Toggles the expansion state of the specified item. */
30
+ toggle(item: ExpansionItem): boolean;
31
+ /** Opens all focusable items in the list. */
32
+ openAll(): void;
33
+ /** Closes all focusable items in the list. */
34
+ closeAll(): void;
35
+ /** Checks whether the specified item is expandable / collapsible. */
36
+ isExpandable(item: ExpansionItem): boolean;
37
+ }
38
+
39
+ export { ListExpansion };
40
+ export type { ExpansionItem, ListExpansionInputs };
@@ -1,213 +1,6 @@
1
- import * as _angular_core from '@angular/core';
2
- import { WritableSignal, Signal } from '@angular/core';
3
-
4
- /**
5
- * Options that are applicable to all event handlers.
6
- *
7
- * This library has not yet had a need for stopPropagationImmediate.
8
- */
9
- interface EventHandlerOptions {
10
- stopPropagation: boolean;
11
- preventDefault: boolean;
12
- }
13
- /** A basic event handler. */
14
- type EventHandler<T extends Event> = (event: T) => void;
15
- /** A function that determines whether an event is to be handled. */
16
- type EventMatcher<T extends Event> = (event: T) => boolean;
17
- /** A config that specifies how to handle a particular event. */
18
- interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {
19
- matcher: EventMatcher<T>;
20
- handler: EventHandler<T>;
21
- }
22
- /** Bit flag representation of the possible modifier keys that can be present on an event. */
23
- declare enum Modifier {
24
- None = 0,
25
- Ctrl = 1,
26
- Shift = 2,
27
- Alt = 4,
28
- Meta = 8,
29
- Any = "Any"
30
- }
31
- type ModifierInputs = Modifier | Modifier[];
32
- /**
33
- * Abstract base class for all event managers.
34
- *
35
- * Event managers are designed to normalize how event handlers are authored and create a safety net
36
- * for common event handling gotchas like remembering to call preventDefault or stopPropagation.
37
- */
38
- declare abstract class EventManager<T extends Event> {
39
- protected configs: EventHandlerConfig<T>[];
40
- abstract options: EventHandlerOptions;
41
- /** Runs the handlers that match with the given event. */
42
- handle(event: T): void;
43
- /** Configures the event manager to handle specific events. (See subclasses for more). */
44
- abstract on(...args: [...unknown[]]): this;
45
- }
46
-
47
- type SignalLike<T> = () => T;
48
- interface WritableSignalLike<T> extends SignalLike<T> {
49
- set(value: T): void;
50
- update(updateFn: (value: T) => T): void;
51
- }
52
- /** Converts a getter setter style signal to a WritableSignalLike. */
53
- declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
54
-
55
- /**
56
- * Used to represent a keycode.
57
- *
58
- * This is used to match whether an events keycode should be handled. The ability to match using a
59
- * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.
60
- */
61
- type KeyCode = string | SignalLike<string> | RegExp;
62
- /**
63
- * An event manager that is specialized for handling keyboard events. By default this manager stops
64
- * propagation and prevents default on all events it handles.
65
- */
66
- declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
67
- options: EventHandlerOptions;
68
- /** Configures this event manager to handle events with a specific key and no modifiers. */
69
- on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
70
- /** Configures this event manager to handle events with a specific modifer and key combination. */
71
- on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
72
- private _normalizeInputs;
73
- private _isMatch;
74
- }
75
-
76
- /**
77
- * The different mouse buttons that may appear on a pointer event.
78
- */
79
- declare enum MouseButton {
80
- Main = 0,
81
- Auxiliary = 1,
82
- Secondary = 2
83
- }
84
- /** An event manager that is specialized for handling pointer events. */
85
- declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
86
- options: EventHandlerOptions;
87
- /**
88
- * Configures this event manager to handle events with a specific modifer and mouse button
89
- * combination.
90
- */
91
- on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
92
- /**
93
- * Configures this event manager to handle events with a specific mouse button and no modifiers.
94
- */
95
- on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
96
- /**
97
- * Configures this event manager to handle events with the main mouse button and no modifiers.
98
- *
99
- * @param handler The handler function
100
- * @param options Options for whether to stop propagation or prevent default.
101
- */
102
- on(handler: EventHandler<T>): this;
103
- private _normalizeInputs;
104
- _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
105
- }
106
-
107
- /** Represents an item in a collection, such as a listbox option, than may receive focus. */
108
- interface ListFocusItem {
109
- /** A unique identifier for the item. */
110
- id: SignalLike<string>;
111
- /** The html element that should receive focus. */
112
- element: SignalLike<HTMLElement | undefined>;
113
- /** Whether an item is disabled. */
114
- disabled: SignalLike<boolean>;
115
- /** The index of the item in the list. */
116
- index: SignalLike<number>;
117
- }
118
- /** Represents the required inputs for a collection that contains focusable items. */
119
- interface ListFocusInputs<T extends ListFocusItem> {
120
- /** The focus strategy used by the list. */
121
- focusMode: SignalLike<'roving' | 'activedescendant'>;
122
- /** Whether the list is disabled. */
123
- disabled: SignalLike<boolean>;
124
- /** The items in the list. */
125
- items: SignalLike<T[]>;
126
- /** The active item. */
127
- activeItem: WritableSignalLike<T | undefined>;
128
- /** Whether disabled items in the list should be focusable. */
129
- softDisabled: SignalLike<boolean>;
130
- element: SignalLike<HTMLElement | undefined>;
131
- }
132
- /** Controls focus for a list of items. */
133
- declare class ListFocus<T extends ListFocusItem> {
134
- readonly inputs: ListFocusInputs<T>;
135
- /** The last item that was active. */
136
- prevActiveItem: _angular_core.WritableSignal<T | undefined>;
137
- /** The index of the last item that was active. */
138
- prevActiveIndex: _angular_core.Signal<number>;
139
- /** The current active index in the list. */
140
- activeIndex: _angular_core.Signal<number>;
141
- constructor(inputs: ListFocusInputs<T>);
142
- /** Whether the list is in a disabled state. */
143
- isListDisabled(): boolean;
144
- /** The id of the current active item. */
145
- getActiveDescendant(): string | undefined;
146
- /** The tab index for the list. */
147
- getListTabIndex(): -1 | 0;
148
- /** Returns the tab index for the given item. */
149
- getItemTabIndex(item: T): -1 | 0;
150
- /** Moves focus to the given item if it is focusable. */
151
- focus(item: T, opts?: {
152
- focusElement?: boolean;
153
- }): boolean;
154
- /** Returns true if the given item can be navigated to. */
155
- isFocusable(item: T): boolean;
156
- }
157
-
158
- /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
159
- interface ListNavigationItem extends ListFocusItem {
160
- }
161
- /** Represents the required inputs for a collection that has navigable items. */
162
- interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
163
- /** Whether focus should wrap when navigating. */
164
- wrap: SignalLike<boolean>;
165
- /** Whether the list is vertically or horizontally oriented. */
166
- orientation: SignalLike<'vertical' | 'horizontal'>;
167
- /** The direction that text is read based on the users locale. */
168
- textDirection: SignalLike<'rtl' | 'ltr'>;
169
- }
170
- /** Controls navigation for a list of items. */
171
- declare class ListNavigation<T extends ListNavigationItem> {
172
- readonly inputs: ListNavigationInputs<T> & {
173
- focusManager: ListFocus<T>;
174
- };
175
- constructor(inputs: ListNavigationInputs<T> & {
176
- focusManager: ListFocus<T>;
177
- });
178
- /** Navigates to the given item. */
179
- goto(item?: T, opts?: {
180
- focusElement?: boolean;
181
- }): boolean;
182
- /** Navigates to the next item in the list. */
183
- next(opts?: {
184
- focusElement?: boolean;
185
- }): boolean;
186
- /** Peeks the next item in the list. */
187
- peekNext(): T | undefined;
188
- /** Navigates to the previous item in the list. */
189
- prev(opts?: {
190
- focusElement?: boolean;
191
- }): boolean;
192
- /** Peeks the previous item in the list. */
193
- peekPrev(): T | undefined;
194
- /** Navigates to the first item in the list. */
195
- first(opts?: {
196
- focusElement?: boolean;
197
- }): boolean;
198
- /** Navigates to the last item in the list. */
199
- last(opts?: {
200
- focusElement?: boolean;
201
- }): boolean;
202
- /** Gets the first focusable item from the given list of items. */
203
- peekFirst(items?: T[]): T | undefined;
204
- /** Gets the last focusable item from the given list of items. */
205
- peekLast(items?: T[]): T | undefined;
206
- /** Advances to the next or previous focusable item in the list based on the given delta. */
207
- private _advance;
208
- /** Peeks the next or previous focusable item in the list based on the given delta. */
209
- private _peek;
210
- }
1
+ import { SignalLike, WritableSignalLike, ListNavigationItem, ListNavigationInputs, ListFocus, ListNavigation } from './_list-navigation-chunk.js';
2
+ import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
3
+ import { PointerEventManager } from './_pointer-event-manager-chunk.js';
211
4
 
212
5
  /** Represents coordinates in a grid. */
213
6
  interface RowCol {
@@ -234,9 +27,9 @@ declare class GridData<T extends BaseGridCell> {
234
27
  /** The two-dimensional array of cells that represents the grid. */
235
28
  readonly cells: SignalLike<T[][]>;
236
29
  /** The maximum number of rows in the grid, accounting for row spans. */
237
- readonly maxRowCount: _angular_core.Signal<number>;
30
+ readonly maxRowCount: SignalLike<number>;
238
31
  /** The maximum number of columns in the grid, accounting for column spans. */
239
- readonly maxColCount: _angular_core.Signal<number>;
32
+ readonly maxColCount: SignalLike<number>;
240
33
  /** A map from a cell to its primary and spanned coordinates. */
241
34
  private readonly _coordsMap;
242
35
  /** A map from a coordinate string to the cell at that coordinate. */
@@ -287,11 +80,11 @@ interface GridFocusDeps<T extends GridFocusCell> {
287
80
  declare class GridFocus<T extends GridFocusCell> {
288
81
  readonly inputs: GridFocusInputs & GridFocusDeps<T>;
289
82
  /** The current active cell. */
290
- readonly activeCell: WritableSignal<T | undefined>;
83
+ readonly activeCell: WritableSignalLike<T | undefined>;
291
84
  /** The current active cell coordinates. */
292
- readonly activeCoords: WritableSignal<RowCol>;
85
+ readonly activeCoords: WritableSignalLike<RowCol>;
293
86
  /** Whether the grid active state is empty (no active cell or coordinates). */
294
- readonly stateEmpty: _angular_core.Signal<boolean>;
87
+ readonly stateEmpty: SignalLike<boolean>;
295
88
  /**
296
89
  * Whether the grid focus state is stale.
297
90
  *
@@ -299,13 +92,13 @@ declare class GridFocus<T extends GridFocusCell> {
299
92
  * current grid data, for example if the underlying cells have changed.
300
93
  * A stale state should be re-initialized.
301
94
  */
302
- readonly stateStale: _angular_core.Signal<boolean>;
95
+ readonly stateStale: SignalLike<boolean>;
303
96
  /** The id of the current active cell, for ARIA activedescendant. */
304
- readonly activeDescendant: _angular_core.Signal<string | undefined>;
97
+ readonly activeDescendant: SignalLike<string | undefined>;
305
98
  /** Whether the grid is in a disabled state. */
306
- readonly gridDisabled: _angular_core.Signal<boolean>;
99
+ readonly gridDisabled: SignalLike<boolean>;
307
100
  /** The tab index for the grid container. */
308
- readonly gridTabIndex: _angular_core.Signal<0 | -1>;
101
+ readonly gridTabIndex: SignalLike<0 | -1>;
309
102
  constructor(inputs: GridFocusInputs & GridFocusDeps<T>);
310
103
  /** Returns the tab index for the given grid cell cell. */
311
104
  getCellTabIndex(cell: T): -1 | 0;
@@ -470,11 +263,11 @@ declare class Grid<T extends GridCell> {
470
263
  /** Controls selection for the grid. */
471
264
  readonly selectionBehavior: GridSelection<T>;
472
265
  /** The anchor point for range selection, linked to the active coordinates. */
473
- readonly selectionAnchor: _angular_core.WritableSignal<RowCol>;
266
+ readonly selectionAnchor: WritableSignalLike<RowCol>;
474
267
  /** The cell at the selection anchor. */
475
- readonly selectionAnchorCell: _angular_core.Signal<T | undefined>;
268
+ readonly selectionAnchorCell: SignalLike<T | undefined>;
476
269
  /** Whether a range selection has settled. */
477
- readonly selectionStabled: _angular_core.WritableSignal<boolean>;
270
+ readonly selectionStabled: WritableSignalLike<boolean>;
478
271
  /** Whether all selectable cells are selected. */
479
272
  readonly allSelected: SignalLike<boolean>;
480
273
  /** The tab index for the grid container. */
@@ -560,23 +353,23 @@ declare class GridCellWidgetPattern implements ListNavigationItem {
560
353
  /** The html element that should receive focus. */
561
354
  readonly element: SignalLike<HTMLElement>;
562
355
  /** The element that should receive focus. */
563
- readonly widgetHost: Signal<HTMLElement>;
356
+ readonly widgetHost: SignalLike<HTMLElement>;
564
357
  /** The index of the widget within the cell. */
565
- readonly index: Signal<number>;
358
+ readonly index: SignalLike<number>;
566
359
  /** Whether the widget is disabled. */
567
- readonly disabled: Signal<boolean>;
360
+ readonly disabled: SignalLike<boolean>;
568
361
  /** The tab index for the widget. */
569
- readonly tabIndex: Signal<-1 | 0>;
362
+ readonly tabIndex: SignalLike<-1 | 0>;
570
363
  /** Whether the widget is the active item in the widget list. */
571
- readonly active: Signal<boolean>;
364
+ readonly active: SignalLike<boolean>;
572
365
  /** Whether the widget is currently activated. */
573
- readonly isActivated: WritableSignal<boolean>;
366
+ readonly isActivated: WritableSignalLike<boolean>;
574
367
  /** The last event that caused the widget to be activated. */
575
- readonly lastActivateEvent: WritableSignal<KeyboardEvent | FocusEvent | undefined>;
368
+ readonly lastActivateEvent: WritableSignalLike<KeyboardEvent | FocusEvent | undefined>;
576
369
  /** The last event that caused the widget to be deactivated. */
577
- readonly lastDeactivateEvent: WritableSignal<KeyboardEvent | FocusEvent | undefined>;
370
+ readonly lastDeactivateEvent: WritableSignalLike<KeyboardEvent | FocusEvent | undefined>;
578
371
  /** The keyboard event manager for the widget. */
579
- readonly keydown: Signal<KeyboardEventManager<KeyboardEvent>>;
372
+ readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
580
373
  constructor(inputs: GridCellWidgetInputs);
581
374
  /** Handles keydown events for the widget. */
582
375
  onKeydown(event: KeyboardEvent): void;
@@ -615,7 +408,7 @@ declare class GridCellPattern implements GridCell {
615
408
  /** The html element that should receive focus. */
616
409
  readonly element: SignalLike<HTMLElement>;
617
410
  /** Whether the cell has focus. */
618
- readonly isFocused: WritableSignal<boolean>;
411
+ readonly isFocused: WritableSignalLike<boolean>;
619
412
  /** Whether the cell is selected. */
620
413
  readonly selected: WritableSignalLike<boolean>;
621
414
  /** Whether the cell is selectable. */
@@ -659,11 +452,11 @@ declare class GridCellPattern implements GridCell {
659
452
  /** Whether the cell or widget inside the cell is activated. */
660
453
  readonly isActivated: SignalLike<boolean>;
661
454
  /** The key used to navigate to the previous widget. */
662
- readonly prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
455
+ readonly prevKey: SignalLike<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
663
456
  /** The key used to navigate to the next widget. */
664
- readonly nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
457
+ readonly nextKey: SignalLike<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
665
458
  /** The keyboard event manager for the cell. */
666
- readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
459
+ readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
667
460
  constructor(inputs: GridCellInputs);
668
461
  /** Handles keydown events for the cell. */
669
462
  onKeydown(event: KeyboardEvent): void;
@@ -725,35 +518,35 @@ declare class GridPattern {
725
518
  /** The underlying grid behavior that this pattern is built on. */
726
519
  readonly gridBehavior: Grid<GridCellPattern>;
727
520
  /** The cells in the grid. */
728
- readonly cells: _angular_core.Signal<GridCellPattern[][]>;
521
+ readonly cells: SignalLike<GridCellPattern[][]>;
729
522
  /** The tab index for the grid. */
730
- readonly tabIndex: _angular_core.Signal<0 | -1>;
523
+ readonly tabIndex: SignalLike<0 | -1>;
731
524
  /** Whether the grid is disabled. */
732
- readonly disabled: _angular_core.Signal<boolean>;
525
+ readonly disabled: SignalLike<boolean>;
733
526
  /** The ID of the currently active descendant cell. */
734
- readonly activeDescendant: _angular_core.Signal<string | undefined>;
527
+ readonly activeDescendant: SignalLike<string | undefined>;
735
528
  /** The currently active cell. */
736
- readonly activeCell: _angular_core.Signal<GridCellPattern | undefined>;
529
+ readonly activeCell: SignalLike<GridCellPattern | undefined>;
737
530
  /** The current selection anchor cell. */
738
531
  readonly anchorCell: SignalLike<GridCellPattern | undefined>;
739
532
  /** Whether to pause grid navigation and give the keyboard control to cell or widget. */
740
533
  readonly pauseNavigation: SignalLike<boolean>;
741
534
  /** Whether the focus is in the grid. */
742
- readonly isFocused: _angular_core.WritableSignal<boolean>;
535
+ readonly isFocused: WritableSignalLike<boolean>;
743
536
  /** Whether the grid has been focused once. */
744
- readonly hasBeenFocused: _angular_core.WritableSignal<boolean>;
537
+ readonly hasBeenFocused: WritableSignalLike<boolean>;
745
538
  /** Whether the user is currently dragging to select a range of cells. */
746
- readonly dragging: _angular_core.WritableSignal<boolean>;
539
+ readonly dragging: WritableSignalLike<boolean>;
747
540
  /** The key for navigating to the previous column. */
748
- readonly prevColKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft">;
541
+ readonly prevColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
749
542
  /** The key for navigating to the next column. */
750
- readonly nextColKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft">;
543
+ readonly nextColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
751
544
  /** The keydown event manager for the grid. */
752
- readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
545
+ readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
753
546
  /** The pointerdown event manager for the grid. */
754
- readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
547
+ readonly pointerdown: SignalLike<PointerEventManager<PointerEvent>>;
755
548
  /** The pointerup event manager for the grid. */
756
- readonly pointerup: _angular_core.Signal<PointerEventManager<PointerEvent>>;
549
+ readonly pointerup: SignalLike<PointerEventManager<PointerEvent>>;
757
550
  /** Indicates maybe the losing focus is caused by row/cell deletion. */
758
551
  private readonly _maybeDeletion;
759
552
  /** Indicates the losing focus is certainly caused by row/cell deletion. */
@@ -785,5 +578,5 @@ declare class GridPattern {
785
578
  focusEffect(): void;
786
579
  }
787
580
 
788
- export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern, KeyboardEventManager, ListFocus, ListNavigation, PointerEventManager, convertGetterSetterToWritableSignalLike };
789
- export type { GridCellInputs, GridCellWidgetInputs, GridInputs, GridRowInputs, ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem, SignalLike, WritableSignalLike };
581
+ export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern };
582
+ export type { GridCellInputs, GridCellWidgetInputs, GridInputs, GridRowInputs };