@angular/aria 21.0.0-next.8 → 21.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/aria-accordion.json +373 -0
- package/_adev_assets/aria-combobox.json +383 -0
- package/_adev_assets/aria-grid.json +578 -0
- package/_adev_assets/aria-listbox.json +511 -0
- package/_adev_assets/aria-menu.json +752 -0
- package/_adev_assets/aria-radio-group.json +389 -0
- package/_adev_assets/aria-tabs.json +987 -0
- package/_adev_assets/aria-toolbar.json +717 -0
- package/_adev_assets/aria-tree.json +1067 -0
- package/fesm2022/_widget-chunk.mjs +827 -0
- package/fesm2022/_widget-chunk.mjs.map +1 -0
- package/fesm2022/accordion.mjs +371 -172
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -2
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +304 -114
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +89 -49
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/grid.mjs +517 -0
- package/fesm2022/grid.mjs.map +1 -0
- package/fesm2022/listbox.mjs +384 -183
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +535 -0
- package/fesm2022/menu.mjs.map +1 -0
- package/fesm2022/private.mjs +2347 -0
- package/fesm2022/private.mjs.map +1 -0
- package/fesm2022/radio-group.mjs +320 -179
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/tabs.mjs +483 -274
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +330 -199
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +511 -309
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +14 -6
- package/types/_grid-chunk.d.ts +546 -0
- package/types/accordion.d.ts +4 -4
- package/types/combobox.d.ts +18 -5
- package/types/deferred-content.d.ts +1 -0
- package/types/grid.d.ts +111 -0
- package/types/listbox.d.ts +6 -3
- package/types/menu.d.ts +158 -0
- package/types/{ui-patterns.d.ts → private.d.ts} +333 -133
- package/types/radio-group.d.ts +5 -3
- package/types/tabs.d.ts +4 -4
- package/types/toolbar.d.ts +4 -4
- package/types/tree.d.ts +17 -32
- package/fesm2022/ui-patterns.mjs +0 -2504
- package/fesm2022/ui-patterns.mjs.map +0 -1
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options that are applicable to all event handlers.
|
|
5
|
+
*
|
|
6
|
+
* This library has not yet had a need for stopPropagationImmediate.
|
|
7
|
+
*/
|
|
8
|
+
interface EventHandlerOptions {
|
|
9
|
+
stopPropagation: boolean;
|
|
10
|
+
preventDefault: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A basic event handler. */
|
|
13
|
+
type EventHandler<T extends Event> = (event: T) => void;
|
|
14
|
+
/** A function that determines whether an event is to be handled. */
|
|
15
|
+
type EventMatcher<T extends Event> = (event: T) => boolean;
|
|
16
|
+
/** A config that specifies how to handle a particular event. */
|
|
17
|
+
interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {
|
|
18
|
+
matcher: EventMatcher<T>;
|
|
19
|
+
handler: EventHandler<T>;
|
|
20
|
+
}
|
|
21
|
+
/** Bit flag representation of the possible modifier keys that can be present on an event. */
|
|
22
|
+
declare enum Modifier {
|
|
23
|
+
None = 0,
|
|
24
|
+
Ctrl = 1,
|
|
25
|
+
Shift = 2,
|
|
26
|
+
Alt = 4,
|
|
27
|
+
Meta = 8,
|
|
28
|
+
Any = "Any"
|
|
29
|
+
}
|
|
30
|
+
type ModifierInputs = Modifier | Modifier[];
|
|
31
|
+
/**
|
|
32
|
+
* Abstract base class for all event managers.
|
|
33
|
+
*
|
|
34
|
+
* Event managers are designed to normalize how event handlers are authored and create a safety net
|
|
35
|
+
* for common event handling gotchas like remembering to call preventDefault or stopPropagation.
|
|
36
|
+
*/
|
|
37
|
+
declare abstract class EventManager<T extends Event> {
|
|
38
|
+
protected configs: EventHandlerConfig<T>[];
|
|
39
|
+
abstract options: EventHandlerOptions;
|
|
40
|
+
/** Runs the handlers that match with the given event. */
|
|
41
|
+
handle(event: T): void;
|
|
42
|
+
/** Configures the event manager to handle specific events. (See subclasses for more). */
|
|
43
|
+
abstract on(...args: [...unknown[]]): this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type SignalLike<T> = () => T;
|
|
47
|
+
interface WritableSignalLike<T> extends SignalLike<T> {
|
|
48
|
+
set(value: T): void;
|
|
49
|
+
update(updateFn: (value: T) => T): void;
|
|
50
|
+
}
|
|
51
|
+
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
52
|
+
declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Used to represent a keycode.
|
|
56
|
+
*
|
|
57
|
+
* This is used to match whether an events keycode should be handled. The ability to match using a
|
|
58
|
+
* string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.
|
|
59
|
+
*/
|
|
60
|
+
type KeyCode = string | SignalLike<string> | RegExp;
|
|
61
|
+
/**
|
|
62
|
+
* An event manager that is specialized for handling keyboard events. By default this manager stops
|
|
63
|
+
* propagation and prevents default on all events it handles.
|
|
64
|
+
*/
|
|
65
|
+
declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
|
|
66
|
+
options: EventHandlerOptions;
|
|
67
|
+
/** Configures this event manager to handle events with a specific key and no modifiers. */
|
|
68
|
+
on(key: KeyCode, handler: EventHandler<T>): this;
|
|
69
|
+
/** Configures this event manager to handle events with a specific modifer and key combination. */
|
|
70
|
+
on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;
|
|
71
|
+
private _normalizeInputs;
|
|
72
|
+
private _isMatch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The different mouse buttons that may appear on a pointer event.
|
|
77
|
+
*/
|
|
78
|
+
declare enum MouseButton {
|
|
79
|
+
Main = 0,
|
|
80
|
+
Auxiliary = 1,
|
|
81
|
+
Secondary = 2
|
|
82
|
+
}
|
|
83
|
+
/** An event manager that is specialized for handling pointer events. */
|
|
84
|
+
declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
|
|
85
|
+
options: EventHandlerOptions;
|
|
86
|
+
/**
|
|
87
|
+
* Configures this event manager to handle events with a specific modifer and mouse button
|
|
88
|
+
* combination.
|
|
89
|
+
*/
|
|
90
|
+
on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
|
|
91
|
+
/**
|
|
92
|
+
* Configures this event manager to handle events with a specific mouse button and no modifiers.
|
|
93
|
+
*/
|
|
94
|
+
on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
|
|
95
|
+
/**
|
|
96
|
+
* Configures this event manager to handle events with the main mouse button and no modifiers.
|
|
97
|
+
*
|
|
98
|
+
* @param handler The handler function
|
|
99
|
+
* @param options Options for whether to stop propagation or prevent default.
|
|
100
|
+
*/
|
|
101
|
+
on(handler: EventHandler<T>): this;
|
|
102
|
+
private _normalizeInputs;
|
|
103
|
+
_isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Represents coordinates in a grid. */
|
|
107
|
+
interface RowCol {
|
|
108
|
+
/** The row index. */
|
|
109
|
+
row: number;
|
|
110
|
+
/** The column index. */
|
|
111
|
+
col: number;
|
|
112
|
+
}
|
|
113
|
+
/** The base interface for a cell in a grid. */
|
|
114
|
+
interface BaseGridCell {
|
|
115
|
+
/** The number of rows the cell should span. */
|
|
116
|
+
rowSpan: SignalLike<number>;
|
|
117
|
+
/** The number of columns the cell should span. */
|
|
118
|
+
colSpan: SignalLike<number>;
|
|
119
|
+
}
|
|
120
|
+
/** Represents the required inputs for GridData. */
|
|
121
|
+
interface GridDataInputs<T extends BaseGridCell> {
|
|
122
|
+
/** The two-dimensional array of cells that represents the grid. */
|
|
123
|
+
cells: SignalLike<T[][]>;
|
|
124
|
+
}
|
|
125
|
+
/** Controls internal coordinates for a grid of items. */
|
|
126
|
+
declare class GridData<T extends BaseGridCell> {
|
|
127
|
+
readonly inputs: GridDataInputs<T>;
|
|
128
|
+
/** The two-dimensional array of cells that represents the grid. */
|
|
129
|
+
readonly cells: SignalLike<T[][]>;
|
|
130
|
+
/** The number of rows in the grid. */
|
|
131
|
+
readonly rowCount: _angular_core.Signal<number>;
|
|
132
|
+
/** The maximum number of rows in the grid, accounting for row spans. */
|
|
133
|
+
readonly maxRowCount: _angular_core.Signal<number>;
|
|
134
|
+
/** The maximum number of columns in the grid, accounting for column spans. */
|
|
135
|
+
readonly maxColCount: _angular_core.Signal<number>;
|
|
136
|
+
/** A map from a cell to its primary and spanned coordinates. */
|
|
137
|
+
private readonly _coordsMap;
|
|
138
|
+
/** A map from a coordinate string to the cell at that coordinate. */
|
|
139
|
+
private readonly _cellMap;
|
|
140
|
+
/** A map from a row index to the number of columns in that row. */
|
|
141
|
+
private readonly _colCountsByRow;
|
|
142
|
+
/** A map from a column index to the number of rows in that column. */
|
|
143
|
+
private readonly _rowCountByCol;
|
|
144
|
+
constructor(inputs: GridDataInputs<T>);
|
|
145
|
+
/** Gets the cell at the given coordinates. */
|
|
146
|
+
getCell(rowCol: RowCol): T | undefined;
|
|
147
|
+
/** Gets the primary coordinates of the given cell. */
|
|
148
|
+
getCoords(cell: T): RowCol | undefined;
|
|
149
|
+
/** Gets all coordinates that the given cell spans. */
|
|
150
|
+
getAllCoords(cell: T): RowCol[] | undefined;
|
|
151
|
+
/** Gets the number of rows in the given column. */
|
|
152
|
+
getRowCount(col: number): number | undefined;
|
|
153
|
+
/** Gets the number of columns in the given row. */
|
|
154
|
+
getColCount(row: number): number | undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Represents an cell in a grid, such as a grid cell, that may receive focus. */
|
|
158
|
+
interface GridFocusCell extends BaseGridCell {
|
|
159
|
+
/** A unique identifier for the cell. */
|
|
160
|
+
id: SignalLike<string>;
|
|
161
|
+
/** The html element that should receive focus. */
|
|
162
|
+
element: SignalLike<HTMLElement>;
|
|
163
|
+
/** Whether a cell is disabled. */
|
|
164
|
+
disabled: SignalLike<boolean>;
|
|
165
|
+
}
|
|
166
|
+
/** Represents the required inputs for a grid that contains focusable cells. */
|
|
167
|
+
interface GridFocusInputs {
|
|
168
|
+
/** The focus strategy used by the grid. */
|
|
169
|
+
focusMode: SignalLike<'roving' | 'activedescendant'>;
|
|
170
|
+
/** Whether the grid is disabled. */
|
|
171
|
+
disabled: SignalLike<boolean>;
|
|
172
|
+
/** Whether disabled cells in the grid should be skipped when navigating. */
|
|
173
|
+
skipDisabled: SignalLike<boolean>;
|
|
174
|
+
}
|
|
175
|
+
/** Dependencies for the `GridFocus` class. */
|
|
176
|
+
interface GridFocusDeps<T extends GridFocusCell> {
|
|
177
|
+
/** The `GridData` instance that this focus manager operates on. */
|
|
178
|
+
grid: GridData<T>;
|
|
179
|
+
}
|
|
180
|
+
/** Controls focus for a 2D grid of cells. */
|
|
181
|
+
declare class GridFocus<T extends GridFocusCell> {
|
|
182
|
+
readonly inputs: GridFocusInputs & GridFocusDeps<T>;
|
|
183
|
+
/** The current active cell. */
|
|
184
|
+
readonly activeCell: _angular_core.WritableSignal<T | undefined>;
|
|
185
|
+
/** The current active cell coordinates. */
|
|
186
|
+
readonly activeCoords: _angular_core.WritableSignal<RowCol>;
|
|
187
|
+
/** Whether the grid active state is empty (no active cell or coordinates). */
|
|
188
|
+
readonly stateEmpty: _angular_core.Signal<boolean>;
|
|
189
|
+
/**
|
|
190
|
+
* Whether the grid focus state is stale.
|
|
191
|
+
*
|
|
192
|
+
* A stale state means the active cell or coordinates are no longer valid based on the
|
|
193
|
+
* current grid data, for example if the underlying cells have changed.
|
|
194
|
+
* A stale state should be re-initialized.
|
|
195
|
+
*/
|
|
196
|
+
readonly stateStale: _angular_core.Signal<boolean>;
|
|
197
|
+
/** The id of the current active cell, for ARIA activedescendant. */
|
|
198
|
+
readonly activeDescendant: _angular_core.Signal<string | undefined>;
|
|
199
|
+
/** Whether the grid is in a disabled state. */
|
|
200
|
+
readonly gridDisabled: _angular_core.Signal<boolean>;
|
|
201
|
+
/** The tabindex for the grid container. */
|
|
202
|
+
readonly gridTabIndex: _angular_core.Signal<0 | -1>;
|
|
203
|
+
constructor(inputs: GridFocusInputs & GridFocusDeps<T>);
|
|
204
|
+
/** Returns the tabindex for the given grid cell cell. */
|
|
205
|
+
getCellTabindex(cell: T): -1 | 0;
|
|
206
|
+
/** Returns true if the given cell can be navigated to. */
|
|
207
|
+
isFocusable(cell: T): boolean;
|
|
208
|
+
/** Focuses the given cell. */
|
|
209
|
+
focusCell(cell: T): boolean;
|
|
210
|
+
/** Moves focus to the cell at the given coordinates if it's part of a focusable cell. */
|
|
211
|
+
focusCoordinates(coords: RowCol): boolean;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** A utility type that ensures an object has exactly one key from a given set. */
|
|
215
|
+
type ExactlyOneKey<T, K extends keyof T = keyof T> = {
|
|
216
|
+
[P in K]: Record<P, T[P]> & Partial<Record<Exclude<K, P>, never>>;
|
|
217
|
+
}[K];
|
|
218
|
+
/** Represents a directional change in the grid, either by row or by column. */
|
|
219
|
+
type Delta = ExactlyOneKey<{
|
|
220
|
+
row: -1 | 1;
|
|
221
|
+
col: -1 | 1;
|
|
222
|
+
}>;
|
|
223
|
+
/** The wrapping behavior for keyboard navigation. */
|
|
224
|
+
type WrapStrategy = 'continuous' | 'loop' | 'nowrap';
|
|
225
|
+
/** Represents an item in a collection, such as a listbox option, than can be navigated to. */
|
|
226
|
+
interface GridNavigationCell extends GridFocusCell {
|
|
227
|
+
}
|
|
228
|
+
/** Represents the required inputs for a collection that has navigable items. */
|
|
229
|
+
interface GridNavigationInputs extends GridFocusInputs {
|
|
230
|
+
/** The wrapping behavior for keyboard navigation along the row axis. */
|
|
231
|
+
rowWrap: SignalLike<WrapStrategy>;
|
|
232
|
+
/** The wrapping behavior for keyboard navigation along the column axis. */
|
|
233
|
+
colWrap: SignalLike<WrapStrategy>;
|
|
234
|
+
}
|
|
235
|
+
/** Dependencies for the `GridNavigation` class. */
|
|
236
|
+
interface GridNavigationDeps<T extends GridNavigationCell> {
|
|
237
|
+
/** The `GridData` instance that this navigation manager operates on. */
|
|
238
|
+
grid: GridData<T>;
|
|
239
|
+
/** The `GridFocus` instance that this navigation manager uses to manage focus. */
|
|
240
|
+
gridFocus: GridFocus<T>;
|
|
241
|
+
}
|
|
242
|
+
/** Controls navigation for a grid of items. */
|
|
243
|
+
declare class GridNavigation<T extends GridNavigationCell> {
|
|
244
|
+
readonly inputs: GridNavigationInputs & GridNavigationDeps<T>;
|
|
245
|
+
/** The maximum number of steps to take when searching for the next cell. */
|
|
246
|
+
private _maxSteps;
|
|
247
|
+
constructor(inputs: GridNavigationInputs & GridNavigationDeps<T>);
|
|
248
|
+
/** Navigates to the given item. */
|
|
249
|
+
gotoCell(cell: T): boolean;
|
|
250
|
+
/** Navigates to the given coordinates. */
|
|
251
|
+
gotoCoords(coords: RowCol): boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Gets the coordinates of the next focusable cell in a given direction, without changing focus.
|
|
254
|
+
*/
|
|
255
|
+
peek(direction: Delta, fromCoords: RowCol, wrap?: WrapStrategy): RowCol | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* Navigates to the next focusable cell in a given direction.
|
|
258
|
+
*/
|
|
259
|
+
advance(direction: Delta): boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Gets the coordinates of the first focusable cell.
|
|
262
|
+
* If a row is not provided, searches the entire grid.
|
|
263
|
+
*/
|
|
264
|
+
peekFirst(row?: number): RowCol | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Navigates to the first focusable cell.
|
|
267
|
+
* If a row is not provided, searches the entire grid.
|
|
268
|
+
*/
|
|
269
|
+
first(row?: number): boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Gets the coordinates of the last focusable cell.
|
|
272
|
+
* If a row is not provided, searches the entire grid.
|
|
273
|
+
*/
|
|
274
|
+
peekLast(row?: number): RowCol | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Navigates to the last focusable cell.
|
|
277
|
+
* If a row is not provided, searches the entire grid.
|
|
278
|
+
*/
|
|
279
|
+
last(row?: number): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Finds the next focusable cell in a given direction based on the wrapping behavior.
|
|
282
|
+
*/
|
|
283
|
+
private _peekDirectional;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Represents a cell in a grid that can be selected. */
|
|
287
|
+
interface GridSelectionCell extends GridFocusCell {
|
|
288
|
+
/** Whether the cell is selected. */
|
|
289
|
+
selected: WritableSignalLike<boolean>;
|
|
290
|
+
/** Whether the cell is selectable. */
|
|
291
|
+
selectable: SignalLike<boolean>;
|
|
292
|
+
}
|
|
293
|
+
/** Represents the required inputs for a grid that has selectable cells. */
|
|
294
|
+
interface GridSelectionInputs extends GridFocusInputs {
|
|
295
|
+
}
|
|
296
|
+
/** Dependencies for the `GridSelection` class. */
|
|
297
|
+
interface GridSelectionDeps<T extends GridSelectionCell> {
|
|
298
|
+
/** The `GridData` instance that this selection manager operates on. */
|
|
299
|
+
grid: GridData<T>;
|
|
300
|
+
/** The `GridFocus` instance that this selection manager uses to manage focus. */
|
|
301
|
+
gridFocus: GridFocus<T>;
|
|
302
|
+
}
|
|
303
|
+
/** Controls selection for a grid of items. */
|
|
304
|
+
declare class GridSelection<T extends GridSelectionCell> {
|
|
305
|
+
readonly inputs: GridSelectionInputs & GridSelectionDeps<T>;
|
|
306
|
+
constructor(inputs: GridSelectionInputs & GridSelectionDeps<T>);
|
|
307
|
+
/** Selects one or more cells in a given range. */
|
|
308
|
+
select(fromCoords: RowCol, toCoords?: RowCol): void;
|
|
309
|
+
/** Deselects one or more cells in a given range. */
|
|
310
|
+
deselect(fromCoords: RowCol, toCoords?: RowCol): void;
|
|
311
|
+
/** Toggles the selection state of one or more cells in a given range. */
|
|
312
|
+
toggle(fromCoords: RowCol, toCoords?: RowCol): void;
|
|
313
|
+
/** Selects all valid cells in the grid. */
|
|
314
|
+
selectAll(): void;
|
|
315
|
+
/** Deselects all valid cells in the grid. */
|
|
316
|
+
deselectAll(): void;
|
|
317
|
+
/** A generator that yields all valid (selectable and not disabled) cells within a given range. */
|
|
318
|
+
_validCells(fromCoords: RowCol, toCoords: RowCol): Generator<T>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** A type that represents a cell in a grid, combining all cell-related interfaces. */
|
|
322
|
+
type GridCell = BaseGridCell & GridFocusCell & GridNavigationCell & GridSelectionCell;
|
|
323
|
+
/** Represents the required inputs for a grid. */
|
|
324
|
+
interface GridInputs$1<T extends GridCell> extends GridDataInputs<T>, GridFocusInputs, GridNavigationInputs, GridSelectionInputs {
|
|
325
|
+
/** Whether selection is enabled for the grid. */
|
|
326
|
+
enableSelection: SignalLike<boolean>;
|
|
327
|
+
}
|
|
328
|
+
/** The main class that orchestrates the grid behaviors. */
|
|
329
|
+
declare class Grid<T extends GridCell> {
|
|
330
|
+
readonly inputs: GridInputs$1<T>;
|
|
331
|
+
/** The underlying data structure for the grid. */
|
|
332
|
+
readonly data: GridData<T>;
|
|
333
|
+
/** Controls focus for the grid. */
|
|
334
|
+
readonly focusBehavior: GridFocus<T>;
|
|
335
|
+
/** Controls navigation for the grid. */
|
|
336
|
+
readonly navigationBehavior: GridNavigation<T>;
|
|
337
|
+
/** Controls selection for the grid. */
|
|
338
|
+
readonly selectionBehavior: GridSelection<T>;
|
|
339
|
+
/** The anchor point for range selection, linked to the active coordinates. */
|
|
340
|
+
readonly selectionAnchor: _angular_core.WritableSignal<RowCol>;
|
|
341
|
+
/** The `tabindex` for the grid container. */
|
|
342
|
+
readonly gridTabIndex: _angular_core.Signal<0 | -1>;
|
|
343
|
+
/** Whether the grid is in a disabled state. */
|
|
344
|
+
readonly gridDisabled: _angular_core.Signal<boolean>;
|
|
345
|
+
/** The ID of the active descendant for ARIA `activedescendant` focus management. */
|
|
346
|
+
readonly activeDescendant: _angular_core.Signal<string | undefined>;
|
|
347
|
+
constructor(inputs: GridInputs$1<T>);
|
|
348
|
+
/** Gets the 1-based row index of a cell. */
|
|
349
|
+
rowIndex(cell: T): number | undefined;
|
|
350
|
+
/** Gets the 1-based column index of a cell. */
|
|
351
|
+
colIndex(cell: T): number | undefined;
|
|
352
|
+
/** Gets the `tabindex` for a given cell. */
|
|
353
|
+
cellTabIndex(cell: T): -1 | 0;
|
|
354
|
+
/** Navigates to the cell above the currently active cell. */
|
|
355
|
+
up(): boolean;
|
|
356
|
+
/** Extends the selection to the cell above the selection anchor. */
|
|
357
|
+
rangeSelectUp(): void;
|
|
358
|
+
/** Navigates to the cell below the currently active cell. */
|
|
359
|
+
down(): boolean;
|
|
360
|
+
/** Extends the selection to the cell below the selection anchor. */
|
|
361
|
+
rangeSelectDown(): void;
|
|
362
|
+
/** Navigates to the cell to the left of the currently active cell. */
|
|
363
|
+
left(): boolean;
|
|
364
|
+
/** Extends the selection to the cell to the left of the selection anchor. */
|
|
365
|
+
rangeSelectLeft(): void;
|
|
366
|
+
/** Navigates to the cell to the right of the currently active cell. */
|
|
367
|
+
right(): boolean;
|
|
368
|
+
/** Extends the selection to the cell to the right of the selection anchor. */
|
|
369
|
+
rangeSelectRight(): void;
|
|
370
|
+
/** Navigates to the first focusable cell in the grid. */
|
|
371
|
+
first(): boolean;
|
|
372
|
+
/** Navigates to the first focusable cell in the current row. */
|
|
373
|
+
firstInRow(): boolean;
|
|
374
|
+
/** Navigates to the last focusable cell in the grid. */
|
|
375
|
+
last(): boolean;
|
|
376
|
+
/** Navigates to the last focusable cell in the current row. */
|
|
377
|
+
lastInRow(): boolean;
|
|
378
|
+
/** Selects all cells in the current row. */
|
|
379
|
+
selectRow(): void;
|
|
380
|
+
/** Selects all cells in the current column. */
|
|
381
|
+
selectCol(): void;
|
|
382
|
+
/** Selects all selectable cells in the grid. */
|
|
383
|
+
selectAll(): void;
|
|
384
|
+
/** Navigates to and focuses the given cell. */
|
|
385
|
+
gotoCell(cell: T): boolean;
|
|
386
|
+
/** Toggles the selection state of the given cell. */
|
|
387
|
+
toggleSelect(cell: T): void;
|
|
388
|
+
/** Extends the selection from the anchor to the given cell. */
|
|
389
|
+
rangeSelect(cell: T): void;
|
|
390
|
+
/** Extends the selection to the given coordinates. */
|
|
391
|
+
private _rangeSelectCoords;
|
|
392
|
+
/** Resets the active state of the grid if it is empty or stale. */
|
|
393
|
+
resetState(): boolean;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/** The inputs for the `GridCellWidgetPattern`. */
|
|
397
|
+
interface GridCellWidgetInputs {
|
|
398
|
+
/** The `GridCellPattern` that this widget belongs to. */
|
|
399
|
+
cell: SignalLike<GridCellPattern>;
|
|
400
|
+
/** The html element that should receive focus. */
|
|
401
|
+
element: SignalLike<HTMLElement>;
|
|
402
|
+
/**
|
|
403
|
+
* Whether the widget is activated, which pauses grid navigation to allow interaction
|
|
404
|
+
* with the widget.
|
|
405
|
+
*/
|
|
406
|
+
activate: WritableSignalLike<boolean>;
|
|
407
|
+
}
|
|
408
|
+
/** The UI pattern for a widget inside a grid cell. */
|
|
409
|
+
declare class GridCellWidgetPattern {
|
|
410
|
+
readonly inputs: GridCellWidgetInputs;
|
|
411
|
+
/** The html element that should receive focus. */
|
|
412
|
+
readonly element: SignalLike<HTMLElement>;
|
|
413
|
+
/** The `tabindex` for the widget. */
|
|
414
|
+
readonly tabIndex: SignalLike<-1 | 0>;
|
|
415
|
+
/** Whether the widget is in an active state (i.e. its containing cell is active). */
|
|
416
|
+
readonly active: SignalLike<boolean>;
|
|
417
|
+
constructor(inputs: GridCellWidgetInputs);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** The inputs for the `GridCellPattern`. */
|
|
421
|
+
interface GridCellInputs extends GridCell {
|
|
422
|
+
/** The `GridPattern` that this cell belongs to. */
|
|
423
|
+
grid: SignalLike<GridPattern>;
|
|
424
|
+
/** The `GridRowPattern` that this cell belongs to. */
|
|
425
|
+
row: SignalLike<GridRowPattern>;
|
|
426
|
+
/** The widget pattern contained within this cell, if any. */
|
|
427
|
+
widget: SignalLike<GridCellWidgetPattern | undefined>;
|
|
428
|
+
/** The index of this cell's row within the grid. */
|
|
429
|
+
rowIndex: SignalLike<number | undefined>;
|
|
430
|
+
/** The index of this cell's column within the grid. */
|
|
431
|
+
colIndex: SignalLike<number | undefined>;
|
|
432
|
+
}
|
|
433
|
+
/** The UI pattern for a grid cell. */
|
|
434
|
+
declare class GridCellPattern implements GridCell {
|
|
435
|
+
readonly inputs: GridCellInputs;
|
|
436
|
+
/** A unique identifier for the cell. */
|
|
437
|
+
readonly id: SignalLike<string>;
|
|
438
|
+
/** Whether a cell is disabled. */
|
|
439
|
+
readonly disabled: SignalLike<boolean>;
|
|
440
|
+
/** Whether the cell is selected. */
|
|
441
|
+
readonly selected: WritableSignalLike<boolean>;
|
|
442
|
+
/** Whether the cell is selectable. */
|
|
443
|
+
readonly selectable: SignalLike<boolean>;
|
|
444
|
+
/** The number of rows the cell should span. */
|
|
445
|
+
readonly rowSpan: SignalLike<number>;
|
|
446
|
+
/** The number of columns the cell should span. */
|
|
447
|
+
readonly colSpan: SignalLike<number>;
|
|
448
|
+
/** The `aria-selected` attribute for the cell. */
|
|
449
|
+
readonly ariaSelected: _angular_core.Signal<boolean | undefined>;
|
|
450
|
+
/** The `aria-rowindex` attribute for the cell. */
|
|
451
|
+
readonly ariaRowIndex: _angular_core.Signal<number | undefined>;
|
|
452
|
+
/** The `aria-colindex` attribute for the cell. */
|
|
453
|
+
readonly ariaColIndex: _angular_core.Signal<number | undefined>;
|
|
454
|
+
/** The html element that should receive focus. */
|
|
455
|
+
readonly element: SignalLike<HTMLElement>;
|
|
456
|
+
/** Whether the cell is active. */
|
|
457
|
+
readonly active: _angular_core.Signal<boolean>;
|
|
458
|
+
/** The internal tab index calculation for the cell. */
|
|
459
|
+
private readonly _tabIndex;
|
|
460
|
+
/** The `tabindex` for the cell. If the cell contains a widget, the cell's tabindex is -1. */
|
|
461
|
+
readonly tabIndex: SignalLike<-1 | 0>;
|
|
462
|
+
/** Whether the widget within the cell is activated. */
|
|
463
|
+
readonly widgetActivated: SignalLike<boolean>;
|
|
464
|
+
constructor(inputs: GridCellInputs);
|
|
465
|
+
/** Gets the `tabindex` for the widget within the cell. */
|
|
466
|
+
widgetTabIndex(): -1 | 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/** The inputs for the `GridRowPattern`. */
|
|
470
|
+
interface GridRowInputs {
|
|
471
|
+
/** The `GridPattern` that this row belongs to. */
|
|
472
|
+
grid: SignalLike<GridPattern>;
|
|
473
|
+
/** The cells that make up this row. */
|
|
474
|
+
cells: SignalLike<GridCellPattern[]>;
|
|
475
|
+
/** The index of this row within the grid. */
|
|
476
|
+
rowIndex: SignalLike<number | undefined>;
|
|
477
|
+
}
|
|
478
|
+
/** The UI pattern for a grid row. */
|
|
479
|
+
declare class GridRowPattern {
|
|
480
|
+
readonly inputs: GridRowInputs;
|
|
481
|
+
/** The index of this row within the grid. */
|
|
482
|
+
rowIndex: SignalLike<number | undefined>;
|
|
483
|
+
constructor(inputs: GridRowInputs);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/** Represents the required inputs for the grid pattern. */
|
|
487
|
+
interface GridInputs extends Omit<GridInputs$1<GridCellPattern>, 'cells'> {
|
|
488
|
+
/** The html element of the grid. */
|
|
489
|
+
element: SignalLike<HTMLElement>;
|
|
490
|
+
/** The rows that make up the grid. */
|
|
491
|
+
rows: SignalLike<GridRowPattern[]>;
|
|
492
|
+
/** A function that returns the grid cell associated with a given element. */
|
|
493
|
+
getCell: (e: Element) => GridCellPattern | undefined;
|
|
494
|
+
}
|
|
495
|
+
/** The UI pattern for a grid, handling keyboard navigation, focus, and selection. */
|
|
496
|
+
declare class GridPattern {
|
|
497
|
+
readonly inputs: GridInputs;
|
|
498
|
+
/** The underlying grid behavior that this pattern is built on. */
|
|
499
|
+
readonly gridBehavior: Grid<GridCellPattern>;
|
|
500
|
+
/** The cells in the grid. */
|
|
501
|
+
readonly cells: _angular_core.Signal<GridCellPattern[][]>;
|
|
502
|
+
/** The tab index for the grid. */
|
|
503
|
+
readonly tabIndex: _angular_core.Signal<0 | -1>;
|
|
504
|
+
/** Whether the grid is disabled. */
|
|
505
|
+
readonly disabled: _angular_core.Signal<boolean>;
|
|
506
|
+
/** The ID of the currently active descendant cell. */
|
|
507
|
+
readonly activeDescendant: _angular_core.Signal<string | undefined>;
|
|
508
|
+
/** The currently active cell. */
|
|
509
|
+
readonly activeCell: _angular_core.Signal<GridCellPattern | undefined>;
|
|
510
|
+
/** Whether to pause grid navigation. */
|
|
511
|
+
readonly pauseNavigation: _angular_core.Signal<boolean>;
|
|
512
|
+
/** Whether the focus is in the grid. */
|
|
513
|
+
readonly isFocused: _angular_core.WritableSignal<boolean>;
|
|
514
|
+
/** Whether the user is currently dragging to select a range of cells. */
|
|
515
|
+
readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
516
|
+
/** The keydown event manager for the grid. */
|
|
517
|
+
readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
518
|
+
/** The pointerdown event manager for the grid. */
|
|
519
|
+
readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
520
|
+
/** The pointerup event manager for the grid. */
|
|
521
|
+
readonly pointerup: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
522
|
+
constructor(inputs: GridInputs);
|
|
523
|
+
/** Handles keydown events on the grid. */
|
|
524
|
+
onKeydown(event: KeyboardEvent): void;
|
|
525
|
+
/** Handles pointerdown events on the grid. */
|
|
526
|
+
onPointerdown(event: PointerEvent): void;
|
|
527
|
+
/** Handles pointermove events on the grid. */
|
|
528
|
+
onPointermove(event: PointerEvent): void;
|
|
529
|
+
/** Handles pointerup events on the grid. */
|
|
530
|
+
onPointerup(event: PointerEvent): void;
|
|
531
|
+
/** Handles focusin events on the grid. */
|
|
532
|
+
onFocusIn(event: FocusEvent): void;
|
|
533
|
+
/** Indicates maybe the losing focus is caused by row/cell deletion. */
|
|
534
|
+
private readonly _maybeDeletion;
|
|
535
|
+
/** Handles focusout events on the grid. */
|
|
536
|
+
onFocusOut(event: FocusEvent): void;
|
|
537
|
+
/** Indicates the losing focus is certainly caused by row/cell deletion. */
|
|
538
|
+
private readonly _deletion;
|
|
539
|
+
/** Resets the active state of the grid if it is empty or stale. */
|
|
540
|
+
resetStateEffect(): void;
|
|
541
|
+
/** Focuses on the active cell element. */
|
|
542
|
+
focusEffect(): void;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern, KeyboardEventManager, PointerEventManager, convertGetterSetterToWritableSignalLike };
|
|
546
|
+
export type { GridCellInputs, GridCellWidgetInputs, GridInputs, GridRowInputs, SignalLike, WritableSignalLike };
|
package/types/accordion.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { WritableSignal } from '@angular/core';
|
|
4
|
-
import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from '@angular/aria/
|
|
4
|
+
import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from '@angular/aria/private';
|
|
5
5
|
import * as i1 from '@angular/aria/deferred-content';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -18,7 +18,7 @@ declare class AccordionPanel {
|
|
|
18
18
|
/** The parent accordion trigger pattern that controls this panel. This is set by AccordionGroup. */
|
|
19
19
|
readonly accordionTrigger: WritableSignal<AccordionTriggerPattern | undefined>;
|
|
20
20
|
/** The UI pattern instance for this panel. */
|
|
21
|
-
readonly
|
|
21
|
+
readonly _pattern: AccordionPanelPattern;
|
|
22
22
|
constructor();
|
|
23
23
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionPanel, never>;
|
|
24
24
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
@@ -47,7 +47,7 @@ declare class AccordionTrigger {
|
|
|
47
47
|
/** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
|
|
48
48
|
readonly accordionPanel: WritableSignal<AccordionPanelPattern | undefined>;
|
|
49
49
|
/** The UI pattern instance for this trigger. */
|
|
50
|
-
readonly
|
|
50
|
+
readonly _pattern: AccordionTriggerPattern;
|
|
51
51
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
|
|
52
52
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
53
53
|
}
|
|
@@ -75,7 +75,7 @@ declare class AccordionGroup {
|
|
|
75
75
|
/** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */
|
|
76
76
|
wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
77
77
|
/** The UI pattern instance for this accordion group. */
|
|
78
|
-
readonly
|
|
78
|
+
readonly _pattern: AccordionGroupPattern;
|
|
79
79
|
constructor();
|
|
80
80
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
|
|
81
81
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_triggers", "_panels"], never, true, never>;
|
package/types/combobox.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { WritableSignal } from '@angular/core';
|
|
3
|
-
import
|
|
3
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
+
import { ComboboxPattern, ComboboxListboxControls, ComboboxTreeControls } from '@angular/aria/private';
|
|
4
5
|
import * as i1 from '@angular/aria/deferred-content';
|
|
5
6
|
|
|
6
7
|
declare class Combobox<V> {
|
|
8
|
+
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
9
|
+
private readonly _directionality;
|
|
10
|
+
/** A signal wrapper for directionality. */
|
|
11
|
+
protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
|
|
7
12
|
/** The element that the combobox is attached to. */
|
|
8
13
|
private readonly _elementRef;
|
|
9
14
|
/** The DeferredContentAware host directive. */
|
|
@@ -14,15 +19,23 @@ declare class Combobox<V> {
|
|
|
14
19
|
filterMode: _angular_core.InputSignal<"manual" | "auto-select" | "highlight">;
|
|
15
20
|
/** Whether the combobox is focused. */
|
|
16
21
|
readonly isFocused: WritableSignal<boolean>;
|
|
17
|
-
/** The value of the first matching item in the popup. */
|
|
18
|
-
firstMatch: _angular_core.InputSignal<V | undefined>;
|
|
19
22
|
/** Whether the listbox has received focus yet. */
|
|
20
23
|
private _hasBeenFocused;
|
|
24
|
+
/** Whether the combobox is disabled. */
|
|
25
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
26
|
+
/** Whether the combobox is read-only. */
|
|
27
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
28
|
+
/** The value of the first matching item in the popup. */
|
|
29
|
+
readonly firstMatch: _angular_core.InputSignal<V | undefined>;
|
|
30
|
+
/** Whether the combobox is expanded. */
|
|
31
|
+
readonly expanded: _angular_core.Signal<boolean>;
|
|
32
|
+
/** Input element connected to the combobox, if any. */
|
|
33
|
+
readonly inputElement: _angular_core.Signal<HTMLInputElement | undefined>;
|
|
21
34
|
/** The combobox ui pattern. */
|
|
22
|
-
readonly
|
|
35
|
+
readonly _pattern: ComboboxPattern<any, V>;
|
|
23
36
|
constructor();
|
|
24
37
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox<any>, never>;
|
|
25
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
38
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
26
39
|
}
|
|
27
40
|
declare class ComboboxInput {
|
|
28
41
|
/** The element that the combobox is attached to. */
|
|
@@ -29,6 +29,7 @@ declare class DeferredContent {
|
|
|
29
29
|
private readonly _templateRef;
|
|
30
30
|
private readonly _viewContainerRef;
|
|
31
31
|
private _isRendered;
|
|
32
|
+
readonly deferredContentAware: _angular_core.WritableSignal<DeferredContentAware | null>;
|
|
32
33
|
constructor();
|
|
33
34
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContent, never>;
|
|
34
35
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContent, never, never, {}, {}, never, never, true, never>;
|