@angular/aria 0.0.1 → 21.0.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -0
- package/fesm2022/accordion.mjs +192 -0
- package/fesm2022/accordion.mjs.map +1 -0
- package/fesm2022/aria.mjs +7 -0
- package/fesm2022/aria.mjs.map +1 -0
- package/fesm2022/combobox.mjs +130 -0
- package/fesm2022/combobox.mjs.map +1 -0
- package/fesm2022/deferred-content.mjs +60 -0
- package/fesm2022/deferred-content.mjs.map +1 -0
- package/fesm2022/listbox.mjs +200 -0
- package/fesm2022/listbox.mjs.map +1 -0
- package/fesm2022/radio-group.mjs +197 -0
- package/fesm2022/radio-group.mjs.map +1 -0
- package/fesm2022/tabs.mjs +299 -0
- package/fesm2022/tabs.mjs.map +1 -0
- package/fesm2022/toolbar.mjs +218 -0
- package/fesm2022/toolbar.mjs.map +1 -0
- package/fesm2022/tree.mjs +285 -0
- package/fesm2022/tree.mjs.map +1 -0
- package/fesm2022/ui-patterns.mjs +2504 -0
- package/fesm2022/ui-patterns.mjs.map +1 -0
- package/package.json +78 -3
- package/types/accordion.d.ts +92 -0
- package/types/aria.d.ts +6 -0
- package/types/combobox.d.ts +51 -0
- package/types/deferred-content.d.ts +38 -0
- package/types/listbox.d.ts +95 -0
- package/types/radio-group.d.ts +82 -0
- package/types/tabs.d.ts +156 -0
- package/types/toolbar.d.ts +113 -0
- package/types/tree.d.ts +133 -0
- package/types/ui-patterns.d.ts +1404 -0
package/types/tree.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { Signal, OnInit, OnDestroy } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/aria/deferred-content';
|
|
5
|
+
import { DeferredContentAware } from '@angular/aria/deferred-content';
|
|
6
|
+
import { TreePattern, TreeItemPattern } from '@angular/aria/ui-patterns';
|
|
7
|
+
import { ComboboxPopup } from './combobox.js';
|
|
8
|
+
|
|
9
|
+
interface HasElement {
|
|
10
|
+
element: Signal<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A Tree container.
|
|
14
|
+
*
|
|
15
|
+
* Transforms nested lists into an accessible, ARIA-compliant tree structure.
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <ul ngTree [(value)]="selectedItems" [multi]="true">
|
|
19
|
+
* <li ngTreeItem [value]="'leaf1'">Leaf Item 1</li>
|
|
20
|
+
* <li ngTreeItem [value]="'parent1'">
|
|
21
|
+
* Parent Item 1
|
|
22
|
+
* <ul ngTreeItemGroup [value]="'parent1'">
|
|
23
|
+
* <ng-template ngTreeItemGroupContent>
|
|
24
|
+
* <li ngTreeItem [value]="'child1.1'">Child Item 1.1</li>
|
|
25
|
+
* <li ngTreeItem [value]="'child1.2'">Child Item 1.2</li>
|
|
26
|
+
* </ng-template>
|
|
27
|
+
* </ul>
|
|
28
|
+
* </li>
|
|
29
|
+
* <li ngTreeItem [value]="'leaf2'" [disabled]="true">Disabled Leaf Item 2</li>
|
|
30
|
+
* </ul>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare class Tree<V> {
|
|
34
|
+
/** A unique identifier for the tree. */
|
|
35
|
+
private readonly _generatedId;
|
|
36
|
+
/** A unique identifier for the tree. */
|
|
37
|
+
protected id: Signal<string>;
|
|
38
|
+
/** A reference to the parent combobox popup, if one exists. */
|
|
39
|
+
private readonly _popup;
|
|
40
|
+
/** A reference to the tree element. */
|
|
41
|
+
private readonly _elementRef;
|
|
42
|
+
/** All TreeItem instances within this tree. */
|
|
43
|
+
private readonly _unorderedItems;
|
|
44
|
+
/** Orientation of the tree. */
|
|
45
|
+
readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
|
|
46
|
+
/** Whether multi-selection is allowed. */
|
|
47
|
+
readonly multi: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
48
|
+
/** Whether the tree is disabled. */
|
|
49
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
50
|
+
/** The selection strategy used by the tree. */
|
|
51
|
+
readonly selectionMode: _angular_core.InputSignal<"explicit" | "follow">;
|
|
52
|
+
/** The focus strategy used by the tree. */
|
|
53
|
+
readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
|
|
54
|
+
/** Whether navigation wraps. */
|
|
55
|
+
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
56
|
+
/** Whether to skip disabled items during navigation. */
|
|
57
|
+
readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
58
|
+
/** Typeahead delay. */
|
|
59
|
+
readonly typeaheadDelay: _angular_core.InputSignal<number>;
|
|
60
|
+
/** Selected item values. */
|
|
61
|
+
readonly value: _angular_core.ModelSignal<V[]>;
|
|
62
|
+
/** Text direction. */
|
|
63
|
+
readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
64
|
+
/** Whether the tree is in navigation mode. */
|
|
65
|
+
readonly nav: _angular_core.InputSignal<boolean>;
|
|
66
|
+
/** The aria-current type. */
|
|
67
|
+
readonly currentType: _angular_core.InputSignal<"page" | "step" | "location" | "date" | "time" | "true" | "false">;
|
|
68
|
+
/** The UI pattern for the tree. */
|
|
69
|
+
readonly pattern: TreePattern<V>;
|
|
70
|
+
/** Whether the tree has received focus yet. */
|
|
71
|
+
private _hasFocused;
|
|
72
|
+
constructor();
|
|
73
|
+
onFocus(): void;
|
|
74
|
+
register(child: TreeItem<V>): void;
|
|
75
|
+
unregister(child: TreeItem<V>): void;
|
|
76
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tree<any>, never>;
|
|
77
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Tree<any>, "[ngTree]", ["ngTree"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "nav": { "alias": "nav"; "required": false; "isSignal": true; }; "currentType": { "alias": "currentType"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A selectable and expandable Tree Item in a Tree.
|
|
81
|
+
*/
|
|
82
|
+
declare class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestroy, HasElement {
|
|
83
|
+
/** A reference to the tree item element. */
|
|
84
|
+
private readonly _elementRef;
|
|
85
|
+
/** A unique identifier for the tree item. */
|
|
86
|
+
private readonly _id;
|
|
87
|
+
/** The owned tree item group. */
|
|
88
|
+
private readonly _group;
|
|
89
|
+
/** The host native element. */
|
|
90
|
+
readonly element: Signal<any>;
|
|
91
|
+
/** The value of the tree item. */
|
|
92
|
+
readonly value: _angular_core.InputSignal<V>;
|
|
93
|
+
/** The parent tree root or tree item group. */
|
|
94
|
+
readonly parent: _angular_core.InputSignal<TreeItemGroup<V> | Tree<V>>;
|
|
95
|
+
/** Whether the tree item is disabled. */
|
|
96
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
97
|
+
/** Optional label for typeahead. Defaults to the element's textContent. */
|
|
98
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
99
|
+
/** Search term for typeahead. */
|
|
100
|
+
readonly searchTerm: Signal<any>;
|
|
101
|
+
/** The tree root. */
|
|
102
|
+
readonly tree: Signal<Tree<V>>;
|
|
103
|
+
/** The UI pattern for this item. */
|
|
104
|
+
pattern: TreeItemPattern<V>;
|
|
105
|
+
constructor();
|
|
106
|
+
ngOnInit(): void;
|
|
107
|
+
ngOnDestroy(): void;
|
|
108
|
+
register(group: TreeItemGroup<V>): void;
|
|
109
|
+
unregister(): void;
|
|
110
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItem<any>, never>;
|
|
111
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeItem<any>, "[ngTreeItem]", ["ngTreeItem"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "parent": { "alias": "parent"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Contains children tree itmes.
|
|
115
|
+
*/
|
|
116
|
+
declare class TreeItemGroup<V> implements OnInit, OnDestroy {
|
|
117
|
+
/** The DeferredContent host directive. */
|
|
118
|
+
private readonly _deferredContent;
|
|
119
|
+
/** All groupable items that are descendants of the group. */
|
|
120
|
+
private readonly _unorderedItems;
|
|
121
|
+
/** Child items within this group. */
|
|
122
|
+
readonly children: Signal<TreeItemPattern<V>[]>;
|
|
123
|
+
/** Tree item that owns the group. */
|
|
124
|
+
readonly ownedBy: _angular_core.InputSignal<TreeItem<V>>;
|
|
125
|
+
ngOnInit(): void;
|
|
126
|
+
ngOnDestroy(): void;
|
|
127
|
+
register(child: TreeItem<V>): void;
|
|
128
|
+
unregister(child: TreeItem<V>): void;
|
|
129
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItemGroup<any>, never>;
|
|
130
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeItemGroup<any>, "ng-template[ngTreeItemGroup]", ["ngTreeItemGroup"], { "ownedBy": { "alias": "ownedBy"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { Tree, TreeItem, TreeItemGroup };
|