@angular/aria 22.0.0-next.6 → 22.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_accordion-chunk.mjs +1 -1
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -3
- package/fesm2022/_collection-chunk.mjs.map +1 -0
- package/fesm2022/_deferred-content-chunk.mjs +16 -14
- package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
- package/fesm2022/_expansion-chunk.mjs.map +1 -1
- package/fesm2022/_list-chunk.mjs +4 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs +4 -2
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +6 -50
- package/fesm2022/_option-chunk.mjs.map +1 -0
- package/fesm2022/_tabs-chunk.mjs +22 -47
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_transforms-chunk.mjs +8 -0
- package/fesm2022/_transforms-chunk.mjs.map +1 -0
- package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
- package/fesm2022/_tree-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +84 -21
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs.map +1 -1
- package/fesm2022/accordion.mjs +32 -57
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox-testing.mjs +79 -0
- package/fesm2022/combobox-testing.mjs.map +1 -0
- package/fesm2022/combobox.mjs +287 -296
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid-testing.mjs +80 -0
- package/fesm2022/grid-testing.mjs.map +1 -0
- package/fesm2022/grid.mjs +113 -86
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +4 -0
- package/fesm2022/listbox-testing.mjs.map +1 -1
- package/fesm2022/listbox.mjs +231 -225
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +11 -0
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +66 -84
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +166 -9
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +241 -222
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +5 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +23 -33
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +12 -0
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +160 -156
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +10 -2
- package/types/_accordion-chunk.d.ts +2 -2
- package/types/_collection-chunk.d.ts +42 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +23 -9
- package/types/_keyboard-event-manager-chunk.d.ts +1 -1
- package/types/_list-chunk.d.ts +1 -1
- package/types/_list-navigation-chunk.d.ts +1 -1
- package/types/_listbox-chunk.d.ts +1 -1
- package/types/_menu-chunk.d.ts +1 -1
- package/types/_tabs-chunk.d.ts +8 -43
- package/types/_toolbar-chunk.d.ts +1 -1
- package/types/_tree-chunk.d.ts +1 -1
- package/types/accordion.d.ts +7 -13
- package/types/combobox-testing.d.ts +63 -0
- package/types/combobox.d.ts +96 -192
- package/types/grid-testing.d.ts +83 -0
- package/types/grid.d.ts +102 -90
- package/types/listbox-testing.d.ts +25 -0
- package/types/listbox.d.ts +60 -63
- package/types/menu-testing.d.ts +6 -0
- package/types/menu.d.ts +24 -17
- package/types/private.d.ts +115 -133
- package/types/tabs.d.ts +26 -24
- package/types/toolbar-testing.d.ts +4 -0
- package/types/toolbar.d.ts +5 -6
- package/types/tree-testing.d.ts +8 -0
- package/types/tree.d.ts +11 -15
- package/fesm2022/_combobox-chunk.mjs +0 -429
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
- package/fesm2022/_element-chunk.mjs +0 -6
- package/fesm2022/_element-chunk.mjs.map +0 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/fesm2022/_signal-like-chunk.mjs.map +0 -1
- package/resources/code-examples.db +0 -0
- package/types/_combobox-chunk.d.ts +0 -194
- package/types/_element-chunk.d.ts +0 -10
- package/types/_pointer-event-manager-chunk.d.ts +0 -34
- package/types/_signal-like-chunk.d.ts +0 -14
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
type SignalLike<T> = () => T;
|
|
4
|
+
interface WritableSignalLike<T> extends SignalLike<T> {
|
|
5
|
+
set(value: T): void;
|
|
6
|
+
update(updateFn: (value: T) => T): void;
|
|
7
|
+
asReadonly(): SignalLike<T>;
|
|
8
|
+
}
|
|
9
|
+
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
10
|
+
declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
|
|
11
|
+
declare function computed<T>(computation: () => T): SignalLike<T>;
|
|
12
|
+
declare function signal<T>(initialValue: T): WritableSignalLike<T>;
|
|
13
|
+
declare function linkedSignal<T>(sourceFn: () => T): WritableSignalLike<T>;
|
|
14
|
+
|
|
15
|
+
interface HasElement {
|
|
16
|
+
element: HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Sort directives by their document order.
|
|
20
|
+
*/
|
|
21
|
+
declare function sortDirectives(a: HasElement, b: HasElement): 1 | -1;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A collection that lazily sorts its items based on their DOM position.
|
|
25
|
+
* It uses manual registration and updates its order when items are added/removed
|
|
26
|
+
* or when structural DOM changes are detected via MutationObserver.
|
|
27
|
+
*
|
|
28
|
+
* TODO(ok7sai): replace Mutation Observer with internal API.
|
|
29
|
+
*/
|
|
30
|
+
declare class SortedCollection<T extends HasElement> {
|
|
31
|
+
private readonly _items;
|
|
32
|
+
private readonly _version;
|
|
33
|
+
private _observer?;
|
|
34
|
+
readonly orderedItems: Signal<T[]>;
|
|
35
|
+
register(item: T): void;
|
|
36
|
+
unregister(item: T): void;
|
|
37
|
+
startObserving(element: HTMLElement): void;
|
|
38
|
+
stopObserving(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { SortedCollection, computed, convertGetterSetterToWritableSignalLike, linkedSignal, signal, sortDirectives };
|
|
42
|
+
export type { HasElement, SignalLike, WritableSignalLike };
|
package/types/_grid-chunk.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ClickEventManager } from './_click-event-manager-chunk.js';
|
|
4
|
+
import { ElementRef } from '@angular/core';
|
|
4
5
|
|
|
5
6
|
/** Represents coordinates in a grid. */
|
|
6
7
|
interface RowCol {
|
|
@@ -334,6 +335,11 @@ declare class Grid<T extends GridCell> {
|
|
|
334
335
|
private _navigateWithSelection;
|
|
335
336
|
}
|
|
336
337
|
|
|
338
|
+
/** A type that allows lazy resolution of a DOM Element. */
|
|
339
|
+
type ElementResolver<T = HTMLElement> = ElementRef<T> | T | undefined | null | ((context: HTMLElement) => T | null | undefined);
|
|
340
|
+
/** Evaluates an ElementResolver to return the underlying DOM element, or undefined. */
|
|
341
|
+
declare function resolveElement<T = HTMLElement>(resolver: ElementResolver<T>, context: HTMLElement): T | undefined;
|
|
342
|
+
|
|
337
343
|
/** The inputs for the `GridCellWidgetPattern`. */
|
|
338
344
|
interface GridCellWidgetInputs {
|
|
339
345
|
/** Whether the widget is disabled. */
|
|
@@ -345,7 +351,11 @@ interface GridCellWidgetInputs {
|
|
|
345
351
|
/** The type of widget, which determines how it is activated. */
|
|
346
352
|
widgetType: SignalLike<'simple' | 'complex' | 'editable'>;
|
|
347
353
|
/** The element that will receive focus when the widget is activated. */
|
|
348
|
-
focusTarget: SignalLike<HTMLElement
|
|
354
|
+
focusTarget: SignalLike<ElementResolver<HTMLElement>>;
|
|
355
|
+
/** Callback hook used to notify parents or directives upon interaction. */
|
|
356
|
+
onActivate?: (event: KeyboardEvent | FocusEvent | undefined) => void;
|
|
357
|
+
/** Callback hook used to notify parents or directives upon exit. */
|
|
358
|
+
onDeactivate?: (event: KeyboardEvent | FocusEvent | undefined) => void;
|
|
349
359
|
}
|
|
350
360
|
/** The UI pattern for a widget inside a grid cell. */
|
|
351
361
|
declare class GridCellWidgetPattern {
|
|
@@ -377,6 +387,10 @@ declare class GridCellWidgetPattern {
|
|
|
377
387
|
onFocusOut(event: FocusEvent): void;
|
|
378
388
|
/** Focuses the widget's host element. */
|
|
379
389
|
focus(): void;
|
|
390
|
+
/** Side-effect executed whenever the widget activates. Runs in the write phase. */
|
|
391
|
+
activationEffect(): void;
|
|
392
|
+
/** Side-effect executed whenever the widget deactivates. Runs in the write phase. */
|
|
393
|
+
deactivationEffect(): void;
|
|
380
394
|
/** Activates the widget. */
|
|
381
395
|
activate(event?: KeyboardEvent | FocusEvent): void;
|
|
382
396
|
/** Deactivates the widget and restores focus to the widget's host element. */
|
|
@@ -515,8 +529,8 @@ declare class GridPattern {
|
|
|
515
529
|
readonly nextColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
|
|
516
530
|
/** The keydown event manager for the grid. */
|
|
517
531
|
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
|
|
518
|
-
/** The
|
|
519
|
-
readonly
|
|
532
|
+
/** The click event manager for the grid. */
|
|
533
|
+
readonly clickManager: SignalLike<ClickEventManager<PointerEvent>>;
|
|
520
534
|
/** Indicates maybe the losing focus is caused by row/cell deletion. */
|
|
521
535
|
private readonly _maybeDeletion;
|
|
522
536
|
/** Indicates the losing focus is certainly caused by row/cell deletion. */
|
|
@@ -526,8 +540,8 @@ declare class GridPattern {
|
|
|
526
540
|
constructor(inputs: GridInputs);
|
|
527
541
|
/** Handles keydown events on the grid. */
|
|
528
542
|
onKeydown(event: KeyboardEvent): void;
|
|
529
|
-
/** Handles
|
|
530
|
-
|
|
543
|
+
/** Handles click events on the grid. */
|
|
544
|
+
onClick(event: PointerEvent): void;
|
|
531
545
|
/** Handles focusin events on the grid. */
|
|
532
546
|
onFocusIn(event: FocusEvent): void;
|
|
533
547
|
/** Handles focusout events on the grid. */
|
|
@@ -544,5 +558,5 @@ declare class GridPattern {
|
|
|
544
558
|
focusEffect(): void;
|
|
545
559
|
}
|
|
546
560
|
|
|
547
|
-
export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern };
|
|
548
|
-
export type { GridCellInputs, GridCellWidgetInputs, GridInputs, GridRowInputs };
|
|
561
|
+
export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern, resolveElement };
|
|
562
|
+
export type { ElementResolver, GridCellInputs, GridCellWidgetInputs, GridInputs, GridRowInputs };
|
package/types/_list-chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
import { ListFocusItem, ListFocusInputs, ListFocus, ListNavigationItem, ListNavigationInputs, ListNavigation } from './_list-navigation-chunk.js';
|
|
3
3
|
|
|
4
4
|
/** Represents an item in a collection, such as a listbox option, that can be selected. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
|
|
3
3
|
/** Represents an item in a collection, such as a listbox option, than may receive focus. */
|
|
4
4
|
interface ListFocusItem {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-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';
|
package/types/_menu-chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
3
3
|
import { ListInputs, ListItem, List } from './_list-chunk.js';
|
|
4
4
|
|
package/types/_tabs-chunk.d.ts
CHANGED
|
@@ -1,56 +1,27 @@
|
|
|
1
1
|
import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
|
|
2
2
|
import { ClickEventManager } from './_click-event-manager-chunk.js';
|
|
3
3
|
import { ExpansionItem, ListExpansionInputs, ListExpansion } from './_expansion-chunk.js';
|
|
4
|
-
import { SignalLike, WritableSignalLike } from './
|
|
4
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
5
5
|
import { ListNavigationItem, ListNavigationInputs, ListFocus, ListNavigation } from './_list-navigation-chunk.js';
|
|
6
6
|
|
|
7
|
-
/** Represents the required inputs for the label control. */
|
|
8
|
-
interface LabelControlInputs {
|
|
9
|
-
/** The default `aria-labelledby` ids. */
|
|
10
|
-
defaultLabelledBy: SignalLike<string[]>;
|
|
11
|
-
}
|
|
12
|
-
/** Represents the optional inputs for the label control. */
|
|
13
|
-
interface LabelControlOptionalInputs {
|
|
14
|
-
/** The `aria-label`. */
|
|
15
|
-
label?: SignalLike<string | undefined>;
|
|
16
|
-
/** The user-provided `aria-labelledby` ids. */
|
|
17
|
-
labelledBy?: SignalLike<string[]>;
|
|
18
|
-
}
|
|
19
|
-
/** Controls label and description of an element. */
|
|
20
|
-
declare class LabelControl {
|
|
21
|
-
readonly inputs: LabelControlInputs & LabelControlOptionalInputs;
|
|
22
|
-
/** The `aria-label`. */
|
|
23
|
-
readonly label: SignalLike<string | undefined>;
|
|
24
|
-
/** The `aria-labelledby` ids. */
|
|
25
|
-
readonly labelledBy: SignalLike<string[]>;
|
|
26
|
-
constructor(inputs: LabelControlInputs & LabelControlOptionalInputs);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
7
|
/** The required inputs to tabs. */
|
|
30
|
-
interface TabInputs extends Omit<ListNavigationItem, 'index'>, Omit<ExpansionItem, 'expandable'> {
|
|
8
|
+
interface TabInputs extends Omit<ListNavigationItem, 'index'>, Omit<ExpansionItem, 'expandable' | 'expanded'> {
|
|
31
9
|
/** The parent tablist that controls the tab. */
|
|
32
|
-
|
|
10
|
+
tabList: SignalLike<TabListPattern>;
|
|
33
11
|
/** The remote tabpanel controlled by the tab. */
|
|
34
|
-
|
|
35
|
-
/** The remote tabpanel unique identifier. */
|
|
36
|
-
value: SignalLike<string>;
|
|
12
|
+
tabPanel: SignalLike<TabPanelPattern | undefined>;
|
|
37
13
|
}
|
|
38
14
|
/** A tab in a tablist. */
|
|
39
15
|
declare class TabPattern {
|
|
40
16
|
readonly inputs: TabInputs;
|
|
41
17
|
/** A global unique identifier for the tab. */
|
|
42
18
|
readonly id: SignalLike<string>;
|
|
43
|
-
/** The index of the tab. */
|
|
44
|
-
readonly index: SignalLike<number>;
|
|
45
|
-
/** The remote tabpanel unique identifier. */
|
|
46
|
-
readonly value: SignalLike<string>;
|
|
47
19
|
/** Whether the tab is disabled. */
|
|
48
20
|
readonly disabled: SignalLike<boolean>;
|
|
49
21
|
/** The html element that should receive focus. */
|
|
50
22
|
readonly element: SignalLike<HTMLElement>;
|
|
51
23
|
/** Whether this tab has expandable panel. */
|
|
52
24
|
readonly expandable: SignalLike<boolean>;
|
|
53
|
-
/** Whether the tab panel is expanded. */
|
|
54
25
|
readonly expanded: WritableSignalLike<boolean>;
|
|
55
26
|
/** Whether the tab is active. */
|
|
56
27
|
readonly active: SignalLike<boolean>;
|
|
@@ -65,23 +36,17 @@ declare class TabPattern {
|
|
|
65
36
|
open(): boolean;
|
|
66
37
|
}
|
|
67
38
|
/** The required inputs for the tabpanel. */
|
|
68
|
-
interface TabPanelInputs
|
|
39
|
+
interface TabPanelInputs {
|
|
69
40
|
/** A global unique identifier for the tabpanel. */
|
|
70
41
|
id: SignalLike<string>;
|
|
71
42
|
/** The tab that controls this tabpanel. */
|
|
72
|
-
tab: SignalLike<TabPattern | undefined>;
|
|
73
|
-
/** A local unique identifier for the tabpanel. */
|
|
74
|
-
value: SignalLike<string>;
|
|
43
|
+
readonly tab: SignalLike<TabPattern | undefined>;
|
|
75
44
|
}
|
|
76
45
|
/** A tabpanel associated with a tab. */
|
|
77
46
|
declare class TabPanelPattern {
|
|
78
47
|
readonly inputs: TabPanelInputs;
|
|
79
48
|
/** A global unique identifier for the tabpanel. */
|
|
80
49
|
readonly id: SignalLike<string>;
|
|
81
|
-
/** A local unique identifier for the tabpanel. */
|
|
82
|
-
readonly value: SignalLike<string>;
|
|
83
|
-
/** Controls label for this tabpanel. */
|
|
84
|
-
readonly labelManager: LabelControl;
|
|
85
50
|
/** Whether the tabpanel is hidden. */
|
|
86
51
|
readonly hidden: SignalLike<boolean>;
|
|
87
52
|
/** The tab index of this tabpanel. */
|
|
@@ -94,6 +59,8 @@ declare class TabPanelPattern {
|
|
|
94
59
|
interface TabListInputs extends Omit<ListNavigationInputs<TabPattern>, 'multi'>, Omit<ListExpansionInputs, 'multiExpandable' | 'items'> {
|
|
95
60
|
/** The selection strategy used by the tablist. */
|
|
96
61
|
selectionMode: SignalLike<'follow' | 'explicit'>;
|
|
62
|
+
/** The currently selected tab. */
|
|
63
|
+
selectedTab: WritableSignalLike<TabPattern | undefined>;
|
|
97
64
|
}
|
|
98
65
|
/** Controls the state of a tablist. */
|
|
99
66
|
declare class TabListPattern {
|
|
@@ -146,8 +113,6 @@ declare class TabListPattern {
|
|
|
146
113
|
onClick(event: PointerEvent): void;
|
|
147
114
|
/** Handles focusin events for the tablist. */
|
|
148
115
|
onFocusIn(): void;
|
|
149
|
-
/** Opens the tab by given value. */
|
|
150
|
-
open(value: string): boolean;
|
|
151
116
|
/** Opens the given tab or the current active tab. */
|
|
152
117
|
open(tab?: TabPattern): boolean;
|
|
153
118
|
/** Executes a navigation operation and expand the active tab if needed. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
import { ListItem, ListInputs, List } from './_list-chunk.js';
|
|
3
3
|
|
|
4
4
|
/** Represents the required inputs for a toolbar widget group. */
|
package/types/_tree-chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignalLike, WritableSignalLike } from './
|
|
1
|
+
import { SignalLike, WritableSignalLike } from './_collection-chunk.js';
|
|
2
2
|
import { ExpansionItem, ListExpansionInputs, ListExpansion } from './_expansion-chunk.js';
|
|
3
3
|
import { ListNavigationItem, ListFocusItem, ListFocusInputs, ListNavigationInputs, ListNavigation, ListFocus } from './_list-navigation-chunk.js';
|
|
4
4
|
import { ListTypeaheadItem, ListSelectionItem, ListSelectionInputs, ListTypeaheadInputs, ListSelection, ListTypeahead, NavOptions } from './_list-chunk.js';
|
package/types/accordion.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { OnInit, OnDestroy } from '@angular/core';
|
|
|
3
3
|
import { AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.js';
|
|
4
4
|
import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.js';
|
|
5
5
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
6
|
+
import { SortedCollection } from './_collection-chunk.js';
|
|
6
7
|
import './_keyboard-event-manager-chunk.js';
|
|
7
|
-
import './_signal-like-chunk.js';
|
|
8
8
|
import './_click-event-manager-chunk.js';
|
|
9
9
|
import './_expansion-chunk.js';
|
|
10
10
|
import './_list-navigation-chunk.js';
|
|
@@ -91,8 +91,6 @@ declare class AccordionTrigger implements OnInit, OnDestroy {
|
|
|
91
91
|
readonly panelId: _angular_core.Signal<string>;
|
|
92
92
|
/** Whether the trigger is disabled. */
|
|
93
93
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
94
|
-
/** The index of the trigger within the accordion group. */
|
|
95
|
-
readonly index: _angular_core.InputSignal<number | undefined>;
|
|
96
94
|
/** Whether the corresponding panel is expanded. */
|
|
97
95
|
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
98
96
|
/** Whether the trigger is active. */
|
|
@@ -108,7 +106,7 @@ declare class AccordionTrigger implements OnInit, OnDestroy {
|
|
|
108
106
|
/** Toggles the expansion state of this item. */
|
|
109
107
|
toggle(): void;
|
|
110
108
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
|
|
111
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "panel": { "alias": "panel"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "
|
|
109
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "panel": { "alias": "panel"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
/**
|
|
@@ -147,15 +145,13 @@ declare class AccordionTrigger implements OnInit, OnDestroy {
|
|
|
147
145
|
* @developerPreview 21.0
|
|
148
146
|
* @see [Accordion](guide/aria/accordion)
|
|
149
147
|
*/
|
|
150
|
-
declare class AccordionGroup {
|
|
148
|
+
declare class AccordionGroup implements OnDestroy {
|
|
151
149
|
/** A reference to the group element. */
|
|
152
150
|
private readonly _elementRef;
|
|
153
151
|
/** A reference to the group element. */
|
|
154
152
|
readonly element: HTMLElement;
|
|
155
|
-
/** The
|
|
156
|
-
|
|
157
|
-
/** The AccordionTriggers nested inside this group. */
|
|
158
|
-
private readonly _sortedTriggers;
|
|
153
|
+
/** The collection of AccordionTriggers. */
|
|
154
|
+
readonly _collection: SortedCollection<AccordionTrigger>;
|
|
159
155
|
/** The corresponding patterns for the accordion triggers. */
|
|
160
156
|
private readonly _triggerPatterns;
|
|
161
157
|
/** The text direction (ltr or rtl). */
|
|
@@ -173,14 +169,12 @@ declare class AccordionGroup {
|
|
|
173
169
|
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
174
170
|
/** The UI pattern instance for this accordion group. */
|
|
175
171
|
readonly _pattern: AccordionGroupPattern;
|
|
172
|
+
constructor();
|
|
173
|
+
ngOnDestroy(): void;
|
|
176
174
|
/** Expands all accordion panels if multi-expandable. */
|
|
177
175
|
expandAll(): void;
|
|
178
176
|
/** Collapses all accordion panels. */
|
|
179
177
|
collapseAll(): void;
|
|
180
|
-
/** Internal method to register each trigger as we can not use contentChildren. */
|
|
181
|
-
_registerTrigger(trigger: AccordionTrigger): void;
|
|
182
|
-
/** Internal method to unregister each trigger as we can not use contentChildren. */
|
|
183
|
-
_unregisterTrigger(trigger: AccordionTrigger): void;
|
|
184
178
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
|
|
185
179
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
186
180
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BaseHarnessFilters, ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, ComponentHarnessConstructor, HarnessLoader } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** A set of criteria that can be used to filter a list of `ComboboxHarness` instances. */
|
|
4
|
+
interface ComboboxHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Only find instances whose placeholder matches the given value. */
|
|
6
|
+
placeholder?: string | RegExp;
|
|
7
|
+
/** Only find instances whose value matches the given value. */
|
|
8
|
+
value?: string | RegExp;
|
|
9
|
+
/** Only find instances with the given disabled state. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Harness for interacting with a standard `ngCombobox` input element in tests. */
|
|
14
|
+
declare class ComboboxHarness extends ContentContainerComponentHarness {
|
|
15
|
+
static hostSelector: string;
|
|
16
|
+
/**
|
|
17
|
+
* Gets a `HarnessPredicate` that can be used to search for a combobox with specific attributes.
|
|
18
|
+
* @param options Options for filtering which combobox instances are considered a match.
|
|
19
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
20
|
+
*/
|
|
21
|
+
static with(options?: ComboboxHarnessFilters): HarnessPredicate<ComboboxHarness>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the component harness for the active widget contained inside the popup.
|
|
24
|
+
* Use this when you need to access the harness of the widget itself (e.g., `ListboxHarness`),
|
|
25
|
+
* rather than querying items within it.
|
|
26
|
+
* @param type The harness type to locate. Must implement standard static `.with()` method.
|
|
27
|
+
*/
|
|
28
|
+
getPopupWidget<T extends ComponentHarness>(type: ComponentHarnessConstructor<T> & {
|
|
29
|
+
with: (options?: {
|
|
30
|
+
selector?: string;
|
|
31
|
+
}) => HarnessPredicate<T>;
|
|
32
|
+
}): Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Gets a harness loader scoped to the content inside the popup container.
|
|
35
|
+
* Note that lookups performed by this loader will only find descendants of the popup container.
|
|
36
|
+
*/
|
|
37
|
+
getPopupLoader(): Promise<HarnessLoader>;
|
|
38
|
+
/** Overrides root loader to automatically resolve queries nested inside the associated popup. */
|
|
39
|
+
protected getRootHarnessLoader(): Promise<HarnessLoader>;
|
|
40
|
+
/** Whether the combobox is expanded (popup is open). */
|
|
41
|
+
isOpen(): Promise<boolean>;
|
|
42
|
+
/** Whether the combobox is disabled. */
|
|
43
|
+
isDisabled(): Promise<boolean>;
|
|
44
|
+
/** Gets the current value string of the combobox input. */
|
|
45
|
+
getValue(): Promise<string>;
|
|
46
|
+
/** Sets the value of the combobox input. */
|
|
47
|
+
setValue(value: string): Promise<void>;
|
|
48
|
+
/** Gets the placeholder text of the combobox. */
|
|
49
|
+
getPlaceholder(): Promise<string | null>;
|
|
50
|
+
/** Opens the combobox popup if it is currently closed. */
|
|
51
|
+
open(): Promise<void>;
|
|
52
|
+
/** Closes the combobox popup if it is currently open. */
|
|
53
|
+
close(): Promise<void>;
|
|
54
|
+
/** Focuses the combobox. */
|
|
55
|
+
focus(): Promise<void>;
|
|
56
|
+
/** Blurs the combobox. */
|
|
57
|
+
blur(): Promise<void>;
|
|
58
|
+
/** Whether the combobox has focus. */
|
|
59
|
+
isFocused(): Promise<boolean>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { ComboboxHarness };
|
|
63
|
+
export type { ComboboxHarnessFilters };
|