@angular/aria 22.0.0-next.4 → 22.0.0-next.5
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/fesm2022/_accordion-chunk.mjs +5 -5
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-chunk.mjs +5 -5
- package/fesm2022/_combobox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-listbox-chunk.mjs +1 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-tree-chunk.mjs +6 -6
- package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -0
- package/fesm2022/_element-chunk.mjs.map +1 -0
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/_signal-like-chunk.mjs.map +1 -1
- package/fesm2022/_tabs-chunk.mjs +1 -1
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_widget-chunk.mjs +12 -166
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs +61 -0
- package/fesm2022/accordion-testing.mjs.map +1 -0
- package/fesm2022/accordion.mjs +208 -183
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +14 -85
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +55 -0
- package/fesm2022/listbox-testing.mjs.map +1 -0
- package/fesm2022/listbox.mjs +1 -1
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +75 -0
- package/fesm2022/menu-testing.mjs.map +1 -0
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +2 -1
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +57 -0
- package/fesm2022/tabs-testing.mjs.map +1 -0
- package/fesm2022/tabs.mjs +3 -5
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +56 -0
- package/fesm2022/toolbar-testing.mjs.map +1 -0
- package/fesm2022/toolbar.mjs +8 -6
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +88 -0
- package/fesm2022/tree-testing.mjs.map +1 -0
- package/fesm2022/tree.mjs +4 -6
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +26 -2
- package/resources/code-examples.db +0 -0
- package/types/_accordion-chunk.d.ts +10 -9
- package/types/_click-event-manager-chunk.d.ts +1 -1
- package/types/_combobox-chunk.d.ts +23 -23
- package/types/_element-chunk.d.ts +10 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +11 -49
- package/types/_keyboard-event-manager-chunk.d.ts +2 -2
- package/types/_list-chunk.d.ts +19 -18
- package/types/_list-navigation-chunk.d.ts +6 -16
- package/types/_listbox-chunk.d.ts +27 -27
- package/types/_menu-chunk.d.ts +51 -51
- package/types/_pointer-event-manager-chunk.d.ts +1 -1
- package/types/_signal-like-chunk.d.ts +14 -0
- package/types/_tabs-chunk.d.ts +2 -1
- package/types/_toolbar-chunk.d.ts +1 -1
- package/types/_tree-chunk.d.ts +18 -17
- package/types/accordion-testing.d.ts +63 -0
- package/types/accordion.d.ts +69 -55
- package/types/combobox.d.ts +6 -5
- package/types/grid.d.ts +8 -14
- package/types/listbox-testing.d.ts +39 -0
- package/types/listbox.d.ts +19 -18
- package/types/menu-testing.d.ts +50 -0
- package/types/menu.d.ts +4 -3
- package/types/private.d.ts +46 -44
- package/types/tabs-testing.d.ts +57 -0
- package/types/tabs.d.ts +3 -5
- package/types/toolbar-testing.d.ts +72 -0
- package/types/toolbar.d.ts +3 -2
- package/types/tree-testing.d.ts +75 -0
- package/types/tree.d.ts +5 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
2
2
|
import { PointerEventManager } from './_pointer-event-manager-chunk.js';
|
|
3
|
-
import { SignalLike, WritableSignalLike } from './
|
|
3
|
+
import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
|
|
4
4
|
import { ListItem } from './_list-chunk.js';
|
|
5
5
|
|
|
6
6
|
/** Represents the required inputs for a combobox. */
|
|
@@ -29,7 +29,7 @@ interface ComboboxInputs<T extends ListItem<V>, V> {
|
|
|
29
29
|
/** An interface that allows combobox popups to expose the necessary controls for the combobox. */
|
|
30
30
|
interface ComboboxListboxControls<T extends ListItem<V>, V> {
|
|
31
31
|
/** A unique identifier for the popup. */
|
|
32
|
-
id: () => string;
|
|
32
|
+
readonly id: () => string;
|
|
33
33
|
/** The ARIA role for the popup. */
|
|
34
34
|
role: SignalLike<'listbox' | 'tree' | 'grid'>;
|
|
35
35
|
/** Whether multiple items in the popup can be selected at once. */
|
|
@@ -89,39 +89,39 @@ interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListbox
|
|
|
89
89
|
declare class ComboboxPattern<T extends ListItem<V>, V> {
|
|
90
90
|
readonly inputs: ComboboxInputs<T, V>;
|
|
91
91
|
/** Whether the combobox is expanded. */
|
|
92
|
-
expanded: WritableSignalLike<boolean>;
|
|
92
|
+
readonly expanded: WritableSignalLike<boolean>;
|
|
93
93
|
/** Whether the combobox is disabled. */
|
|
94
|
-
disabled: () => boolean;
|
|
94
|
+
readonly disabled: () => boolean;
|
|
95
95
|
/** The ID of the active item in the combobox. */
|
|
96
|
-
activeDescendant: SignalLike<string | null>;
|
|
96
|
+
readonly activeDescendant: SignalLike<string | null>;
|
|
97
97
|
/** The currently highlighted item in the combobox. */
|
|
98
|
-
highlightedItem: WritableSignalLike<T | undefined>;
|
|
98
|
+
readonly highlightedItem: WritableSignalLike<T | undefined>;
|
|
99
99
|
/** Whether the most recent input event was a deletion. */
|
|
100
|
-
|
|
100
|
+
private _isDeleting;
|
|
101
101
|
/** Whether the combobox is focused. */
|
|
102
|
-
isFocused: WritableSignalLike<boolean>;
|
|
102
|
+
readonly isFocused: WritableSignalLike<boolean>;
|
|
103
103
|
/** Whether the combobox has ever been focused. */
|
|
104
|
-
hasBeenInteracted: WritableSignalLike<boolean>;
|
|
104
|
+
readonly hasBeenInteracted: WritableSignalLike<boolean>;
|
|
105
105
|
/** The key used to navigate to the previous item in the list. */
|
|
106
|
-
expandKey: SignalLike<"ArrowLeft" | "ArrowRight">;
|
|
106
|
+
readonly expandKey: SignalLike<"ArrowLeft" | "ArrowRight">;
|
|
107
107
|
/** The key used to navigate to the next item in the list. */
|
|
108
|
-
collapseKey: SignalLike<"ArrowLeft" | "ArrowRight">;
|
|
108
|
+
readonly collapseKey: SignalLike<"ArrowLeft" | "ArrowRight">;
|
|
109
109
|
/** The ID of the popup associated with the combobox. */
|
|
110
|
-
popupId: SignalLike<string | null>;
|
|
110
|
+
readonly popupId: SignalLike<string | null>;
|
|
111
111
|
/** The autocomplete behavior of the combobox. */
|
|
112
|
-
autocomplete: SignalLike<"both" | "list">;
|
|
112
|
+
readonly autocomplete: SignalLike<"both" | "list">;
|
|
113
113
|
/** The ARIA role of the popup associated with the combobox. */
|
|
114
|
-
hasPopup: SignalLike<"listbox" | "tree" | "grid" | "dialog" | null>;
|
|
114
|
+
readonly hasPopup: SignalLike<"listbox" | "tree" | "grid" | "dialog" | null>;
|
|
115
115
|
/** Whether the combobox is read-only. */
|
|
116
|
-
readonly: SignalLike<true | null>;
|
|
116
|
+
readonly readonly: SignalLike<true | null>;
|
|
117
117
|
/** Returns the listbox controls for the combobox. */
|
|
118
|
-
listControls: () => ComboboxListboxControls<T, V> | null | undefined;
|
|
118
|
+
readonly listControls: () => ComboboxListboxControls<T, V> | null | undefined;
|
|
119
119
|
/** Returns the tree controls for the combobox. */
|
|
120
|
-
treeControls: () => ComboboxTreeControls<T, V> | null;
|
|
120
|
+
readonly treeControls: () => ComboboxTreeControls<T, V> | null;
|
|
121
121
|
/** The keydown event manager for the combobox. */
|
|
122
|
-
keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
122
|
+
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
123
123
|
/** The click event manager for the combobox. */
|
|
124
|
-
click: SignalLike<PointerEventManager<PointerEvent>>;
|
|
124
|
+
readonly click: SignalLike<PointerEventManager<PointerEvent>>;
|
|
125
125
|
constructor(inputs: ComboboxInputs<T, V>);
|
|
126
126
|
/** Handles keydown events for the combobox. */
|
|
127
127
|
onKeydown(event: KeyboardEvent): void;
|
|
@@ -134,7 +134,7 @@ declare class ComboboxPattern<T extends ListItem<V>, V> {
|
|
|
134
134
|
/** Handles focus out events for the combobox. */
|
|
135
135
|
onFocusOut(event: FocusEvent): void;
|
|
136
136
|
/** The first matching item in the combobox. */
|
|
137
|
-
firstMatch: SignalLike<T | undefined>;
|
|
137
|
+
readonly firstMatch: SignalLike<T | undefined>;
|
|
138
138
|
/** Handles filtering logic for the combobox. */
|
|
139
139
|
onFilter(): void;
|
|
140
140
|
/** Highlights the currently selected item in the combobox. */
|
|
@@ -178,9 +178,9 @@ declare class ComboboxDialogPattern {
|
|
|
178
178
|
element: SignalLike<HTMLDialogElement>;
|
|
179
179
|
id: SignalLike<string>;
|
|
180
180
|
};
|
|
181
|
-
id: () => string;
|
|
182
|
-
role: () => "dialog";
|
|
183
|
-
keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
181
|
+
readonly id: () => string;
|
|
182
|
+
readonly role: () => "dialog";
|
|
183
|
+
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
184
184
|
constructor(inputs: {
|
|
185
185
|
combobox: ComboboxPattern<any, any>;
|
|
186
186
|
element: SignalLike<HTMLDialogElement>;
|
package/types/_grid-chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
|
|
2
2
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
3
3
|
import { PointerEventManager } from './_pointer-event-manager-chunk.js';
|
|
4
4
|
|
|
@@ -335,7 +335,9 @@ declare class Grid<T extends GridCell> {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
/** The inputs for the `GridCellWidgetPattern`. */
|
|
338
|
-
interface GridCellWidgetInputs
|
|
338
|
+
interface GridCellWidgetInputs {
|
|
339
|
+
/** Whether the widget is disabled. */
|
|
340
|
+
disabled: SignalLike<boolean>;
|
|
339
341
|
/** The `GridCellPattern` that this widget belongs to. */
|
|
340
342
|
cell: SignalLike<GridCellPattern>;
|
|
341
343
|
/** The html element that should receive focus. */
|
|
@@ -346,21 +348,17 @@ interface GridCellWidgetInputs extends Omit<ListNavigationItem, 'index'> {
|
|
|
346
348
|
focusTarget: SignalLike<HTMLElement | undefined>;
|
|
347
349
|
}
|
|
348
350
|
/** The UI pattern for a widget inside a grid cell. */
|
|
349
|
-
declare class GridCellWidgetPattern
|
|
351
|
+
declare class GridCellWidgetPattern {
|
|
350
352
|
readonly inputs: GridCellWidgetInputs;
|
|
351
|
-
/** A unique identifier for the widget. */
|
|
352
|
-
readonly id: SignalLike<string>;
|
|
353
353
|
/** The html element that should receive focus. */
|
|
354
354
|
readonly element: SignalLike<HTMLElement>;
|
|
355
355
|
/** The element that should receive focus. */
|
|
356
356
|
readonly widgetHost: SignalLike<HTMLElement>;
|
|
357
|
-
/** The index of the widget within the cell. */
|
|
358
|
-
readonly index: SignalLike<number>;
|
|
359
357
|
/** Whether the widget is disabled. */
|
|
360
358
|
readonly disabled: SignalLike<boolean>;
|
|
361
359
|
/** The tab index for the widget. */
|
|
362
360
|
readonly tabIndex: SignalLike<-1 | 0>;
|
|
363
|
-
/** Whether the widget is the active
|
|
361
|
+
/** Whether the widget is the active widget in the cell. */
|
|
364
362
|
readonly active: SignalLike<boolean>;
|
|
365
363
|
/** Whether the widget is currently activated. */
|
|
366
364
|
readonly isActivated: WritableSignalLike<boolean>;
|
|
@@ -386,13 +384,13 @@ declare class GridCellWidgetPattern implements ListNavigationItem {
|
|
|
386
384
|
}
|
|
387
385
|
|
|
388
386
|
/** The inputs for the `GridCellPattern`. */
|
|
389
|
-
interface GridCellInputs extends GridCell
|
|
387
|
+
interface GridCellInputs extends GridCell {
|
|
390
388
|
/** The `GridPattern` that this cell belongs to. */
|
|
391
389
|
grid: SignalLike<GridPattern>;
|
|
392
390
|
/** The `GridRowPattern` that this cell belongs to. */
|
|
393
391
|
row: SignalLike<GridRowPattern>;
|
|
394
|
-
/** The widget
|
|
395
|
-
|
|
392
|
+
/** The widget pattern contained within this cell, if any. */
|
|
393
|
+
widget: SignalLike<GridCellWidgetPattern | undefined>;
|
|
396
394
|
/** The index of this cell's row within the grid. */
|
|
397
395
|
rowIndex: SignalLike<number | undefined>;
|
|
398
396
|
/** The index of this cell's column within the grid. */
|
|
@@ -433,30 +431,10 @@ declare class GridCellPattern implements GridCell {
|
|
|
433
431
|
private readonly _tabIndex;
|
|
434
432
|
/** The tab index for the cell. If the cell contains a widget, the cell's tab index is -1. */
|
|
435
433
|
readonly tabIndex: SignalLike<-1 | 0>;
|
|
436
|
-
/**
|
|
437
|
-
readonly
|
|
438
|
-
/** Whether the cell contains multiple widgets. */
|
|
439
|
-
readonly multiWidgetMode: SignalLike<boolean>;
|
|
440
|
-
/** Whether navigation between widgets is disabled. */
|
|
441
|
-
readonly navigationDisabled: SignalLike<boolean>;
|
|
442
|
-
/** The focus behavior for the widgets in the cell. */
|
|
443
|
-
readonly focusBehavior: ListFocus<GridCellWidgetPattern>;
|
|
444
|
-
/** The navigation behavior for the widgets in the cell. */
|
|
445
|
-
readonly navigationBehavior: ListNavigation<GridCellWidgetPattern>;
|
|
446
|
-
/** The currently active widget in the cell. */
|
|
447
|
-
readonly activeWidget: WritableSignalLike<GridCellWidgetPattern | undefined>;
|
|
448
|
-
/** Whether navigation between widgets is activated. */
|
|
449
|
-
readonly navigationActivated: WritableSignalLike<boolean>;
|
|
450
|
-
/** Whether any widget within the cell is activated. */
|
|
451
|
-
readonly widgetActivated: SignalLike<boolean>;
|
|
434
|
+
/** The widget in the cell. */
|
|
435
|
+
readonly widget: SignalLike<GridCellWidgetPattern | undefined>;
|
|
452
436
|
/** Whether the cell or widget inside the cell is activated. */
|
|
453
437
|
readonly isActivated: SignalLike<boolean>;
|
|
454
|
-
/** The key used to navigate to the previous widget. */
|
|
455
|
-
readonly prevKey: SignalLike<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
456
|
-
/** The key used to navigate to the next widget. */
|
|
457
|
-
readonly nextKey: SignalLike<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
458
|
-
/** The keyboard event manager for the cell. */
|
|
459
|
-
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
460
438
|
constructor(inputs: GridCellInputs);
|
|
461
439
|
/** Handles keydown events for the cell. */
|
|
462
440
|
onKeydown(event: KeyboardEvent): void;
|
|
@@ -468,12 +446,6 @@ declare class GridCellPattern implements GridCell {
|
|
|
468
446
|
focus(): void;
|
|
469
447
|
/** Gets the tab index for the widget within the cell. */
|
|
470
448
|
widgetTabIndex(): -1 | 0;
|
|
471
|
-
/** Starts navigation between widgets. */
|
|
472
|
-
startNavigation(): void;
|
|
473
|
-
/** Stops navigation between widgets and restores focus to the cell. */
|
|
474
|
-
stopNavigation(): void;
|
|
475
|
-
/** Executes a navigation operation and focuses the new active widget. */
|
|
476
|
-
private _advance;
|
|
477
449
|
}
|
|
478
450
|
|
|
479
451
|
/** The inputs for the `GridRowPattern`. */
|
|
@@ -507,8 +479,6 @@ interface GridInputs extends Omit<GridInputs$1<GridCellPattern>, 'cells'> {
|
|
|
507
479
|
multi: SignalLike<boolean>;
|
|
508
480
|
/** The selection strategy used by the grid. */
|
|
509
481
|
selectionMode: SignalLike<'follow' | 'explicit'>;
|
|
510
|
-
/** Whether enable range selection. */
|
|
511
|
-
enableRangeSelection: SignalLike<boolean>;
|
|
512
482
|
/** A function that returns the grid cell associated with a given element. */
|
|
513
483
|
getCell: (e: Element | null) => GridCellPattern | undefined;
|
|
514
484
|
}
|
|
@@ -543,14 +513,10 @@ declare class GridPattern {
|
|
|
543
513
|
readonly prevColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
|
|
544
514
|
/** The key for navigating to the next column. */
|
|
545
515
|
readonly nextColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
|
|
546
|
-
/** Whether the grid pattern is currently accepting `pointermove` events. */
|
|
547
|
-
readonly acceptsPointerMove: SignalLike<boolean>;
|
|
548
516
|
/** The keydown event manager for the grid. */
|
|
549
517
|
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
550
518
|
/** The pointerdown event manager for the grid. */
|
|
551
519
|
readonly pointerdown: SignalLike<PointerEventManager<PointerEvent>>;
|
|
552
|
-
/** The pointerup event manager for the grid. */
|
|
553
|
-
readonly pointerup: SignalLike<PointerEventManager<PointerEvent>>;
|
|
554
520
|
/** Indicates maybe the losing focus is caused by row/cell deletion. */
|
|
555
521
|
private readonly _maybeDeletion;
|
|
556
522
|
/** Indicates the losing focus is certainly caused by row/cell deletion. */
|
|
@@ -562,10 +528,6 @@ declare class GridPattern {
|
|
|
562
528
|
onKeydown(event: KeyboardEvent): void;
|
|
563
529
|
/** Handles pointerdown events on the grid. */
|
|
564
530
|
onPointerdown(event: PointerEvent): void;
|
|
565
|
-
/** Handles pointermove events on the grid. */
|
|
566
|
-
onPointermove(event: PointerEvent): void;
|
|
567
|
-
/** Handles pointerup events on the grid. */
|
|
568
|
-
onPointerup(event: PointerEvent): void;
|
|
569
531
|
/** Handles focusin events on the grid. */
|
|
570
532
|
onFocusIn(event: FocusEvent): void;
|
|
571
533
|
/** Handles focusout events on the grid. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike } from './
|
|
1
|
+
import { SignalLike } from './_signal-like-chunk.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Options that are applicable to all event handlers.
|
|
@@ -56,7 +56,7 @@ type KeyCode = string | SignalLike<string> | RegExp;
|
|
|
56
56
|
* propagation and prevents default on all events it handles.
|
|
57
57
|
*/
|
|
58
58
|
declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
|
|
59
|
-
options: EventHandlerOptions;
|
|
59
|
+
readonly options: EventHandlerOptions;
|
|
60
60
|
/** Configures this event manager to handle events with a specific key and no modifiers. */
|
|
61
61
|
on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
|
|
62
62
|
/** Configures this event manager to handle events with a specific modifer and key combination. */
|
package/types/_list-chunk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
|
|
2
|
+
import { ListFocusItem, ListFocusInputs, ListFocus, ListNavigationItem, ListNavigationInputs, ListNavigation } from './_list-navigation-chunk.js';
|
|
2
3
|
|
|
3
4
|
/** Represents an item in a collection, such as a listbox option, that can be selected. */
|
|
4
5
|
interface ListSelectionItem<V> extends ListFocusItem {
|
|
@@ -22,11 +23,11 @@ declare class ListSelection<T extends ListSelectionItem<V>, V> {
|
|
|
22
23
|
focusManager: ListFocus<T>;
|
|
23
24
|
};
|
|
24
25
|
/** The start index to use for range selection. */
|
|
25
|
-
rangeStartIndex: WritableSignalLike<number>;
|
|
26
|
+
readonly rangeStartIndex: WritableSignalLike<number>;
|
|
26
27
|
/** The end index to use for range selection. */
|
|
27
|
-
rangeEndIndex: WritableSignalLike<number>;
|
|
28
|
+
readonly rangeEndIndex: WritableSignalLike<number>;
|
|
28
29
|
/** The currently selected items. */
|
|
29
|
-
selectedItems: SignalLike<T[]>;
|
|
30
|
+
readonly selectedItems: SignalLike<T[]>;
|
|
30
31
|
constructor(inputs: ListSelectionInputs<T, V> & {
|
|
31
32
|
focusManager: ListFocus<T>;
|
|
32
33
|
});
|
|
@@ -90,13 +91,13 @@ declare class ListTypeahead<T extends ListTypeaheadItem> {
|
|
|
90
91
|
/** A reference to the timeout for resetting the typeahead search. */
|
|
91
92
|
timeout?: ReturnType<typeof setTimeout> | undefined;
|
|
92
93
|
/** The focus controller of the parent list. */
|
|
93
|
-
focusManager: ListFocus<T>;
|
|
94
|
+
readonly focusManager: ListFocus<T>;
|
|
94
95
|
/** Whether the user is actively typing a typeahead search query. */
|
|
95
|
-
isTyping: SignalLike<boolean>;
|
|
96
|
+
readonly isTyping: SignalLike<boolean>;
|
|
96
97
|
/** Keeps track of the characters that typeahead search is being called with. */
|
|
97
|
-
private _query;
|
|
98
|
+
private readonly _query;
|
|
98
99
|
/** The index where that the typeahead search was initiated from. */
|
|
99
|
-
private _startIndex;
|
|
100
|
+
private readonly _startIndex;
|
|
100
101
|
constructor(inputs: ListTypeaheadInputs<T> & {
|
|
101
102
|
focusManager: ListFocus<T>;
|
|
102
103
|
});
|
|
@@ -127,21 +128,21 @@ type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> & ListNavigationI
|
|
|
127
128
|
declare class List<T extends ListItem<V>, V> {
|
|
128
129
|
readonly inputs: ListInputs<T, V>;
|
|
129
130
|
/** Controls navigation for the list. */
|
|
130
|
-
navigationBehavior: ListNavigation<T>;
|
|
131
|
+
readonly navigationBehavior: ListNavigation<T>;
|
|
131
132
|
/** Controls selection for the list. */
|
|
132
|
-
selectionBehavior: ListSelection<T, V>;
|
|
133
|
+
readonly selectionBehavior: ListSelection<T, V>;
|
|
133
134
|
/** Controls typeahead for the list. */
|
|
134
|
-
typeaheadBehavior: ListTypeahead<T>;
|
|
135
|
+
readonly typeaheadBehavior: ListTypeahead<T>;
|
|
135
136
|
/** Controls focus for the list. */
|
|
136
|
-
focusBehavior: ListFocus<T>;
|
|
137
|
+
readonly focusBehavior: ListFocus<T>;
|
|
137
138
|
/** Whether the list is disabled. */
|
|
138
|
-
disabled: SignalLike<boolean>;
|
|
139
|
+
readonly disabled: SignalLike<boolean>;
|
|
139
140
|
/** The id of the current active item. */
|
|
140
|
-
activeDescendant: SignalLike<string | undefined>;
|
|
141
|
+
readonly activeDescendant: SignalLike<string | undefined>;
|
|
141
142
|
/** The tab index of the list. */
|
|
142
|
-
tabIndex: SignalLike<0 | -1>;
|
|
143
|
+
readonly tabIndex: SignalLike<0 | -1>;
|
|
143
144
|
/** The index of the currently active item in the list. */
|
|
144
|
-
activeIndex: SignalLike<number>;
|
|
145
|
+
readonly activeIndex: SignalLike<number>;
|
|
145
146
|
/**
|
|
146
147
|
* The uncommitted index for selecting a range of options.
|
|
147
148
|
*
|
|
@@ -154,9 +155,9 @@ declare class List<T extends ListItem<V>, V> {
|
|
|
154
155
|
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
155
156
|
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
156
157
|
*/
|
|
157
|
-
private _anchorIndex;
|
|
158
|
+
private readonly _anchorIndex;
|
|
158
159
|
/** Whether the list should wrap. Used to disable wrapping while range selecting. */
|
|
159
|
-
private _wrap;
|
|
160
|
+
private readonly _wrap;
|
|
160
161
|
constructor(inputs: ListInputs<T, V>);
|
|
161
162
|
/** Returns the tab index for the given item. */
|
|
162
163
|
getItemTabindex(item: T): 0 | -1;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
interface WritableSignalLike<T> extends SignalLike<T> {
|
|
3
|
-
set(value: T): void;
|
|
4
|
-
update(updateFn: (value: T) => T): void;
|
|
5
|
-
asReadonly(): SignalLike<T>;
|
|
6
|
-
}
|
|
7
|
-
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
8
|
-
declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
|
|
9
|
-
declare function computed<T>(computation: () => T): SignalLike<T>;
|
|
10
|
-
declare function signal<T>(initialValue: T): WritableSignalLike<T>;
|
|
11
|
-
declare function linkedSignal<T>(sourceFn: () => T): WritableSignalLike<T>;
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
|
|
12
2
|
|
|
13
3
|
/** Represents an item in a collection, such as a listbox option, than may receive focus. */
|
|
14
4
|
interface ListFocusItem {
|
|
@@ -38,11 +28,11 @@ interface ListFocusInputs<T extends ListFocusItem> {
|
|
|
38
28
|
declare class ListFocus<T extends ListFocusItem> {
|
|
39
29
|
readonly inputs: ListFocusInputs<T>;
|
|
40
30
|
/** The last item that was active. */
|
|
41
|
-
prevActiveItem: WritableSignalLike<T | undefined>;
|
|
31
|
+
readonly prevActiveItem: WritableSignalLike<T | undefined>;
|
|
42
32
|
/** The index of the last item that was active. */
|
|
43
|
-
prevActiveIndex: SignalLike<number>;
|
|
33
|
+
readonly prevActiveIndex: SignalLike<number>;
|
|
44
34
|
/** The current active index in the list. */
|
|
45
|
-
activeIndex: SignalLike<number>;
|
|
35
|
+
readonly activeIndex: SignalLike<number>;
|
|
46
36
|
constructor(inputs: ListFocusInputs<T>);
|
|
47
37
|
/** Whether the list is in a disabled state. */
|
|
48
38
|
isListDisabled(): boolean;
|
|
@@ -117,5 +107,5 @@ declare class ListNavigation<T extends ListNavigationItem> {
|
|
|
117
107
|
private _peek;
|
|
118
108
|
}
|
|
119
109
|
|
|
120
|
-
export { ListFocus, ListNavigation
|
|
121
|
-
export type { ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem
|
|
110
|
+
export { ListFocus, ListNavigation };
|
|
111
|
+
export type { ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
|
|
2
2
|
import { ListInputs, List, ListItem } from './_list-chunk.js';
|
|
3
3
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
4
4
|
import { ClickEventManager } from './_click-event-manager-chunk.js';
|
|
@@ -18,27 +18,27 @@ interface OptionInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {
|
|
|
18
18
|
/** Represents an option in a listbox. */
|
|
19
19
|
declare class OptionPattern<V> {
|
|
20
20
|
/** A unique identifier for the option. */
|
|
21
|
-
id: SignalLike<string>;
|
|
21
|
+
readonly id: SignalLike<string>;
|
|
22
22
|
/** The value of the option. */
|
|
23
|
-
value: SignalLike<V>;
|
|
23
|
+
readonly value: SignalLike<V>;
|
|
24
24
|
/** The position of the option in the list. */
|
|
25
|
-
index: SignalLike<number>;
|
|
25
|
+
readonly index: SignalLike<number>;
|
|
26
26
|
/** Whether the option is active. */
|
|
27
|
-
active: SignalLike<boolean>;
|
|
27
|
+
readonly active: SignalLike<boolean>;
|
|
28
28
|
/** Whether the option is selected. */
|
|
29
|
-
selected: SignalLike<boolean | undefined>;
|
|
29
|
+
readonly selected: SignalLike<boolean | undefined>;
|
|
30
30
|
/** Whether the option is selectable. */
|
|
31
|
-
selectable: () => boolean;
|
|
31
|
+
readonly selectable: () => boolean;
|
|
32
32
|
/** Whether the option is disabled. */
|
|
33
|
-
disabled: SignalLike<boolean>;
|
|
33
|
+
readonly disabled: SignalLike<boolean>;
|
|
34
34
|
/** The text used by the typeahead search. */
|
|
35
|
-
searchTerm: SignalLike<string>;
|
|
35
|
+
readonly searchTerm: SignalLike<string>;
|
|
36
36
|
/** A reference to the parent listbox. */
|
|
37
|
-
listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
37
|
+
readonly listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
38
38
|
/** The tab index of the option. */
|
|
39
|
-
tabIndex: SignalLike<0 | -1 | undefined>;
|
|
39
|
+
readonly tabIndex: SignalLike<0 | -1 | undefined>;
|
|
40
40
|
/** The html element that should receive focus. */
|
|
41
|
-
element: SignalLike<HTMLElement | undefined>;
|
|
41
|
+
readonly element: SignalLike<HTMLElement | undefined>;
|
|
42
42
|
constructor(args: OptionInputs<V>);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -52,39 +52,39 @@ type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {
|
|
|
52
52
|
/** Controls the state of a listbox. */
|
|
53
53
|
declare class ListboxPattern<V> {
|
|
54
54
|
readonly inputs: ListboxInputs<V>;
|
|
55
|
-
listBehavior: List<OptionPattern<V>, V>;
|
|
55
|
+
readonly listBehavior: List<OptionPattern<V>, V>;
|
|
56
56
|
/** Whether the listbox has been interacted with. */
|
|
57
57
|
readonly hasBeenInteracted: WritableSignalLike<boolean>;
|
|
58
58
|
/** Whether the list is vertically or horizontally oriented. */
|
|
59
|
-
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
59
|
+
readonly orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
60
60
|
/** Whether the listbox is disabled. */
|
|
61
|
-
disabled: SignalLike<boolean>;
|
|
61
|
+
readonly disabled: SignalLike<boolean>;
|
|
62
62
|
/** Whether the listbox is readonly. */
|
|
63
|
-
readonly: SignalLike<boolean>;
|
|
63
|
+
readonly readonly: SignalLike<boolean>;
|
|
64
64
|
/** The tab index of the listbox. */
|
|
65
|
-
tabIndex: SignalLike<-1 | 0>;
|
|
65
|
+
readonly tabIndex: SignalLike<-1 | 0>;
|
|
66
66
|
/** The id of the current active item. */
|
|
67
|
-
activeDescendant: SignalLike<string | undefined>;
|
|
67
|
+
readonly activeDescendant: SignalLike<string | undefined>;
|
|
68
68
|
/** Whether multiple items in the list can be selected at once. */
|
|
69
69
|
multi: SignalLike<boolean>;
|
|
70
70
|
/** The number of items in the listbox. */
|
|
71
|
-
setsize: SignalLike<number>;
|
|
71
|
+
readonly setsize: SignalLike<number>;
|
|
72
72
|
/** Whether the listbox selection follows focus. */
|
|
73
|
-
followFocus: SignalLike<boolean>;
|
|
73
|
+
readonly followFocus: SignalLike<boolean>;
|
|
74
74
|
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
75
|
-
wrap: WritableSignalLike<boolean>;
|
|
75
|
+
readonly wrap: WritableSignalLike<boolean>;
|
|
76
76
|
/** The key used to navigate to the previous item in the list. */
|
|
77
|
-
prevKey: SignalLike<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
77
|
+
readonly prevKey: SignalLike<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
78
78
|
/** The key used to navigate to the next item in the list. */
|
|
79
|
-
nextKey: SignalLike<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
79
|
+
readonly nextKey: SignalLike<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
80
80
|
/** Represents the space key. Does nothing when the user is actively using typeahead. */
|
|
81
|
-
dynamicSpaceKey: SignalLike<"" | " ">;
|
|
81
|
+
readonly dynamicSpaceKey: SignalLike<"" | " ">;
|
|
82
82
|
/** The regexp used to decide if a key should trigger typeahead. */
|
|
83
|
-
typeaheadRegexp: RegExp;
|
|
83
|
+
readonly typeaheadRegexp: RegExp;
|
|
84
84
|
/** The keydown event manager for the listbox. */
|
|
85
|
-
keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
85
|
+
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
86
86
|
/** The click event manager for the listbox. */
|
|
87
|
-
clickManager: SignalLike<ClickEventManager<PointerEvent>>;
|
|
87
|
+
readonly clickManager: SignalLike<ClickEventManager<PointerEvent>>;
|
|
88
88
|
constructor(inputs: ListboxInputs<V>);
|
|
89
89
|
/** Returns a set of violations */
|
|
90
90
|
validate(): string[];
|