@angular/aria 0.0.0 → 21.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.
@@ -0,0 +1,113 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal, OnInit, OnDestroy } from '@angular/core';
3
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
4
+ import { ToolbarWidgetPattern, ToolbarWidgetGroupPattern, ToolbarPattern, ToolbarWidgetGroupControls } from '@angular/aria/ui-patterns';
5
+
6
+ /**
7
+ * A toolbar widget container.
8
+ *
9
+ * Widgets such as radio groups or buttons are nested within a toolbar to allow for a single
10
+ * place of reference for focus and navigation. The Toolbar is meant to be used in conjunction
11
+ * with ToolbarWidget and RadioGroup as follows:
12
+ *
13
+ * ```html
14
+ * <div ngToolbar>
15
+ * <button ngToolbarWidget>Button</button>
16
+ * <div ngRadioGroup>
17
+ * <label ngRadioButton value="1">Option 1</label>
18
+ * <label ngRadioButton value="2">Option 2</label>
19
+ * <label ngRadioButton value="3">Option 3</label>
20
+ * </div>
21
+ * </div>
22
+ * ```
23
+ */
24
+ declare class Toolbar<V> {
25
+ /** A reference to the toolbar element. */
26
+ private readonly _elementRef;
27
+ /** The TabList nested inside of the container. */
28
+ private readonly _widgets;
29
+ /** A signal wrapper for directionality. */
30
+ readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
31
+ /** Sorted UIPatterns of the child widgets */
32
+ readonly items: Signal<(ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>)[]>;
33
+ /** Whether the toolbar is vertically or horizontally oriented. */
34
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
35
+ /** Whether disabled items in the group should be skipped when navigating. */
36
+ readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
37
+ /** Whether the toolbar is disabled. */
38
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
39
+ /** Whether focus should wrap when navigating. */
40
+ readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
41
+ /** The toolbar UIPattern. */
42
+ readonly pattern: ToolbarPattern<V>;
43
+ /** Whether the toolbar has received focus yet. */
44
+ private _hasFocused;
45
+ constructor();
46
+ onFocus(): void;
47
+ register(widget: ToolbarWidget<V> | ToolbarWidgetGroup<V>): void;
48
+ unregister(widget: ToolbarWidget<V> | ToolbarWidgetGroup<V>): void;
49
+ /** Finds the toolbar item associated with a given element. */
50
+ private _getItem;
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Toolbar<any>, never>;
52
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Toolbar<any>, "[ngToolbar]", ["ngToolbar"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
53
+ }
54
+ /**
55
+ * A widget within a toolbar.
56
+ *
57
+ * A widget is anything that is within a toolbar. It should be applied to any native HTML element
58
+ * that has the purpose of acting as a widget navigatable within a toolbar.
59
+ */
60
+ declare class ToolbarWidget<V> implements OnInit, OnDestroy {
61
+ /** A reference to the widget element. */
62
+ private readonly _elementRef;
63
+ /** The parent Toolbar. */
64
+ private readonly _toolbar;
65
+ /** A unique identifier for the widget. */
66
+ private readonly _generatedId;
67
+ /** A unique identifier for the widget. */
68
+ readonly id: Signal<string>;
69
+ /** The parent Toolbar UIPattern. */
70
+ readonly toolbar: Signal<ToolbarPattern<any>>;
71
+ /** A reference to the widget element to be focused on navigation. */
72
+ readonly element: Signal<any>;
73
+ /** Whether the widget is disabled. */
74
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
75
+ /** Whether the widget is 'hard' disabled, which is different from `aria-disabled`. A hard disabled widget cannot receive focus. */
76
+ readonly hardDisabled: Signal<boolean>;
77
+ /** The ToolbarWidget UIPattern. */
78
+ readonly pattern: ToolbarWidgetPattern<V>;
79
+ ngOnInit(): void;
80
+ ngOnDestroy(): void;
81
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarWidget<any>, never>;
82
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToolbarWidget<any>, "[ngToolbarWidget]", ["ngToolbarWidget"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
83
+ }
84
+ /**
85
+ * A directive that groups toolbar widgets, used for more complex widgets like radio groups that
86
+ * have their own internal navigation.
87
+ */
88
+ declare class ToolbarWidgetGroup<V> implements OnInit, OnDestroy {
89
+ /** A reference to the widget element. */
90
+ private readonly _elementRef;
91
+ /** The parent Toolbar. */
92
+ private readonly _toolbar;
93
+ /** A unique identifier for the widget. */
94
+ private readonly _generatedId;
95
+ /** A unique identifier for the widget. */
96
+ readonly id: Signal<string>;
97
+ /** The parent Toolbar UIPattern. */
98
+ readonly toolbar: Signal<ToolbarPattern<any> | undefined>;
99
+ /** A reference to the widget element to be focused on navigation. */
100
+ readonly element: Signal<any>;
101
+ /** Whether the widget group is disabled. */
102
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
103
+ /** The controls that can be performed on the widget group. */
104
+ readonly controls: _angular_core.WritableSignal<ToolbarWidgetGroupControls | undefined>;
105
+ /** The ToolbarWidgetGroup UIPattern. */
106
+ readonly pattern: ToolbarWidgetGroupPattern<V>;
107
+ ngOnInit(): void;
108
+ ngOnDestroy(): void;
109
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarWidgetGroup<any>, never>;
110
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToolbarWidgetGroup<any>, never, never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
111
+ }
112
+
113
+ export { Toolbar, ToolbarWidget, ToolbarWidgetGroup };
@@ -0,0 +1,151 @@
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 { TreePattern, TreeItemPattern } from '@angular/aria/ui-patterns';
5
+ import { ComboboxPopup } from './combobox.js';
6
+ import * as i1 from '@angular/aria/deferred-content';
7
+
8
+ interface HasElement {
9
+ element: Signal<HTMLElement>;
10
+ }
11
+ /**
12
+ * A Tree container.
13
+ *
14
+ * Transforms nested lists into an accessible, ARIA-compliant tree structure.
15
+ *
16
+ * ```html
17
+ * <ul ngTree [(value)]="selectedItems" [multi]="true">
18
+ * <li ngTreeItem [value]="'leaf1'">Leaf Item 1</li>
19
+ * <li ngTreeItem [value]="'parent1'">
20
+ * Parent Item 1
21
+ * <ul ngTreeItemGroup [value]="'parent1'">
22
+ * <ng-template ngTreeItemGroupContent>
23
+ * <li ngTreeItem [value]="'child1.1'">Child Item 1.1</li>
24
+ * <li ngTreeItem [value]="'child1.2'">Child Item 1.2</li>
25
+ * </ng-template>
26
+ * </ul>
27
+ * </li>
28
+ * <li ngTreeItem [value]="'leaf2'" [disabled]="true">Disabled Leaf Item 2</li>
29
+ * </ul>
30
+ * ```
31
+ */
32
+ declare class Tree<V> {
33
+ /** A unique identifier for the tree. */
34
+ private readonly _generatedId;
35
+ /** A unique identifier for the tree. */
36
+ protected id: Signal<string>;
37
+ /** A reference to the parent combobox popup, if one exists. */
38
+ private readonly _popup;
39
+ /** A reference to the tree element. */
40
+ private readonly _elementRef;
41
+ /** All TreeItem instances within this tree. */
42
+ private readonly _unorderedItems;
43
+ /** Orientation of the tree. */
44
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
45
+ /** Whether multi-selection is allowed. */
46
+ readonly multi: _angular_core.InputSignalWithTransform<boolean, unknown>;
47
+ /** Whether the tree is disabled. */
48
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
49
+ /** The selection strategy used by the tree. */
50
+ readonly selectionMode: _angular_core.InputSignal<"explicit" | "follow">;
51
+ /** The focus strategy used by the tree. */
52
+ readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
53
+ /** Whether navigation wraps. */
54
+ readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
55
+ /** Whether to skip disabled items during navigation. */
56
+ readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
57
+ /** Typeahead delay. */
58
+ readonly typeaheadDelay: _angular_core.InputSignal<number>;
59
+ /** Selected item values. */
60
+ readonly value: _angular_core.ModelSignal<V[]>;
61
+ /** Text direction. */
62
+ readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
63
+ /** Whether the tree is in navigation mode. */
64
+ readonly nav: _angular_core.InputSignal<boolean>;
65
+ /** The aria-current type. */
66
+ readonly currentType: _angular_core.InputSignal<"page" | "step" | "location" | "date" | "time" | "true" | "false">;
67
+ /** The UI pattern for the tree. */
68
+ readonly pattern: TreePattern<V>;
69
+ /** Whether the tree has received focus yet. */
70
+ private _hasFocused;
71
+ constructor();
72
+ onFocus(): void;
73
+ register(child: TreeItem<V>): void;
74
+ unregister(child: TreeItem<V>): void;
75
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tree<any>, never>;
76
+ 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: {}; }]>;
77
+ }
78
+ /**
79
+ * A selectable and expandable Tree Item in a Tree.
80
+ */
81
+ declare class TreeItem<V> implements OnInit, OnDestroy, HasElement {
82
+ /** A reference to the tree item element. */
83
+ private readonly _elementRef;
84
+ /** A unique identifier for the tree item. */
85
+ private readonly _id;
86
+ /** The owned tree item group. */
87
+ private readonly _group;
88
+ /** The id of the owned group. */
89
+ readonly ownsId: Signal<string | undefined>;
90
+ /** The host native element. */
91
+ readonly element: Signal<any>;
92
+ /** The value of the tree item. */
93
+ readonly value: _angular_core.InputSignal<V>;
94
+ /** The parent tree root or tree item group. */
95
+ readonly parent: _angular_core.InputSignal<TreeItemGroup<V> | Tree<V>>;
96
+ /** Whether the tree item is disabled. */
97
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
98
+ /** Optional label for typeahead. Defaults to the element's textContent. */
99
+ readonly label: _angular_core.InputSignal<string | undefined>;
100
+ /** Search term for typeahead. */
101
+ readonly searchTerm: Signal<any>;
102
+ /** The tree root. */
103
+ readonly tree: Signal<Tree<V>>;
104
+ /** The UI pattern for this item. */
105
+ pattern: TreeItemPattern<V>;
106
+ constructor();
107
+ ngOnInit(): void;
108
+ ngOnDestroy(): void;
109
+ register(group: TreeItemGroup<V>): void;
110
+ unregister(): void;
111
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItem<any>, never>;
112
+ 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>;
113
+ }
114
+ /**
115
+ * Container that designates content as a group.
116
+ */
117
+ declare class TreeItemGroup<V> implements OnInit, OnDestroy, HasElement {
118
+ /** A reference to the group element. */
119
+ private readonly _elementRef;
120
+ /** The DeferredContentAware host directive. */
121
+ private readonly _deferredContentAware;
122
+ /** All groupable items that are descendants of the group. */
123
+ private readonly _unorderedItems;
124
+ /** The host native element. */
125
+ readonly element: Signal<any>;
126
+ /** Unique ID for the group. */
127
+ readonly id: string;
128
+ /** Whether the group is visible. */
129
+ readonly visible: _angular_core.WritableSignal<boolean>;
130
+ /** Child items within this group. */
131
+ readonly children: Signal<TreeItem<V>[]>;
132
+ /** Tree item that owns the group. */
133
+ readonly ownedBy: _angular_core.InputSignal<TreeItem<V>>;
134
+ constructor();
135
+ ngOnInit(): void;
136
+ ngOnDestroy(): void;
137
+ register(child: TreeItem<V>): void;
138
+ unregister(child: TreeItem<V>): void;
139
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItemGroup<any>, never>;
140
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeItemGroup<any>, "[ngTreeItemGroup]", ["ngTreeItemGroup"], { "ownedBy": { "alias": "ownedBy"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
141
+ }
142
+ /**
143
+ * A structural directive that marks the `ng-template` to be used as the content
144
+ * for a `TreeItemGroup`. This content can be lazily loaded.
145
+ */
146
+ declare class TreeItemGroupContent {
147
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItemGroupContent, never>;
148
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeItemGroupContent, "ng-template[ngTreeItemGroupContent]", never, {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
149
+ }
150
+
151
+ export { Tree, TreeItem, TreeItemGroup, TreeItemGroupContent };