@angular/aria 0.0.1 → 21.0.0-next.10

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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/fesm2022/_widget-chunk.mjs +990 -0
  4. package/fesm2022/_widget-chunk.mjs.map +1 -0
  5. package/fesm2022/accordion.mjs +192 -0
  6. package/fesm2022/accordion.mjs.map +1 -0
  7. package/fesm2022/aria.mjs +7 -0
  8. package/fesm2022/aria.mjs.map +1 -0
  9. package/fesm2022/combobox.mjs +145 -0
  10. package/fesm2022/combobox.mjs.map +1 -0
  11. package/fesm2022/deferred-content.mjs +60 -0
  12. package/fesm2022/deferred-content.mjs.map +1 -0
  13. package/fesm2022/grid.mjs +213 -0
  14. package/fesm2022/grid.mjs.map +1 -0
  15. package/fesm2022/listbox.mjs +200 -0
  16. package/fesm2022/listbox.mjs.map +1 -0
  17. package/fesm2022/menu.mjs +302 -0
  18. package/fesm2022/menu.mjs.map +1 -0
  19. package/fesm2022/radio-group.mjs +197 -0
  20. package/fesm2022/radio-group.mjs.map +1 -0
  21. package/fesm2022/tabs.mjs +299 -0
  22. package/fesm2022/tabs.mjs.map +1 -0
  23. package/fesm2022/toolbar.mjs +218 -0
  24. package/fesm2022/toolbar.mjs.map +1 -0
  25. package/fesm2022/tree.mjs +288 -0
  26. package/fesm2022/tree.mjs.map +1 -0
  27. package/fesm2022/ui-patterns.mjs +2951 -0
  28. package/fesm2022/ui-patterns.mjs.map +1 -0
  29. package/package.json +86 -3
  30. package/types/_grid-chunk.d.ts +546 -0
  31. package/types/accordion.d.ts +92 -0
  32. package/types/aria.d.ts +6 -0
  33. package/types/combobox.d.ts +60 -0
  34. package/types/deferred-content.d.ts +38 -0
  35. package/types/grid.d.ts +111 -0
  36. package/types/listbox.d.ts +95 -0
  37. package/types/menu.d.ts +158 -0
  38. package/types/radio-group.d.ts +82 -0
  39. package/types/tabs.d.ts +156 -0
  40. package/types/toolbar.d.ts +113 -0
  41. package/types/tree.d.ts +135 -0
  42. package/types/ui-patterns.d.ts +1604 -0
@@ -0,0 +1,82 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { WritableSignal } from '@angular/core';
3
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
4
+ import { RadioButtonPattern, RadioGroupPattern } from '@angular/aria/ui-patterns';
5
+ import * as i1 from '@angular/aria/toolbar';
6
+
7
+ /**
8
+ * A radio button group container.
9
+ *
10
+ * Radio groups are used to group multiple radio buttons or radio group labels so they function as
11
+ * a single form control. The RadioGroup is meant to be used in conjunction with RadioButton
12
+ * as follows:
13
+ *
14
+ * ```html
15
+ * <div ngRadioGroup>
16
+ * <div ngRadioButton value="1">Option 1</div>
17
+ * <div ngRadioButton value="2">Option 2</div>
18
+ * <div ngRadioButton value="3">Option 3</div>
19
+ * </div>
20
+ * ```
21
+ */
22
+ declare class RadioGroup<V> {
23
+ /** A reference to the radio group element. */
24
+ private readonly _elementRef;
25
+ /** A reference to the ToolbarWidgetGroup, if the radio group is in a toolbar. */
26
+ private readonly _toolbarWidgetGroup;
27
+ /** Whether the radio group is inside of a Toolbar. */
28
+ private readonly _hasToolbar;
29
+ /** The RadioButtons nested inside of the RadioGroup. */
30
+ private readonly _radioButtons;
31
+ /** A signal wrapper for directionality. */
32
+ protected textDirection: WritableSignal<_angular_cdk_bidi.Direction>;
33
+ /** The RadioButton UIPatterns of the child RadioButtons. */
34
+ protected items: _angular_core.Signal<RadioButtonPattern<any>[]>;
35
+ /** Whether the radio group is vertically or horizontally oriented. */
36
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
37
+ /** Whether disabled items in the group should be skipped when navigating. */
38
+ readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
39
+ /** The focus strategy used by the radio group. */
40
+ readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
41
+ /** Whether the radio group is disabled. */
42
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
43
+ /** Whether the radio group is readonly. */
44
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
45
+ /** The value of the currently selected radio button. */
46
+ readonly value: _angular_core.ModelSignal<V | null>;
47
+ /** The internal selection state for the radio group. */
48
+ private readonly _value;
49
+ /** The RadioGroup UIPattern. */
50
+ readonly pattern: RadioGroupPattern<V>;
51
+ /** Whether the radio group has received focus yet. */
52
+ private _hasFocused;
53
+ constructor();
54
+ onFocus(): void;
55
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioGroup<any>, never>;
56
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioGroup<any>, "[ngRadioGroup]", ["ngRadioGroup"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_radioButtons"], never, true, [{ directive: typeof i1.ToolbarWidgetGroup; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
57
+ }
58
+ /** A selectable radio button in a RadioGroup. */
59
+ declare class RadioButton<V> {
60
+ /** A reference to the radio button element. */
61
+ private readonly _elementRef;
62
+ /** The parent RadioGroup. */
63
+ private readonly _radioGroup;
64
+ /** A unique identifier for the radio button. */
65
+ private readonly _generatedId;
66
+ /** A unique identifier for the radio button. */
67
+ readonly id: _angular_core.Signal<string>;
68
+ /** The value associated with the radio button. */
69
+ readonly value: _angular_core.InputSignal<V>;
70
+ /** The parent RadioGroup UIPattern. */
71
+ readonly group: _angular_core.Signal<RadioGroupPattern<any>>;
72
+ /** A reference to the radio button element to be focused on navigation. */
73
+ element: _angular_core.Signal<any>;
74
+ /** Whether the radio button is disabled. */
75
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
76
+ /** The RadioButton UIPattern. */
77
+ pattern: RadioButtonPattern<V>;
78
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioButton<any>, never>;
79
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioButton<any>, "[ngRadioButton]", ["ngRadioButton"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
80
+ }
81
+
82
+ export { RadioButton, RadioGroup };
@@ -0,0 +1,156 @@
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 { TabPattern, TabPanelPattern, TabListPattern } from '@angular/aria/ui-patterns';
5
+ import * as i1 from '@angular/aria/deferred-content';
6
+
7
+ interface HasElement {
8
+ element: Signal<HTMLElement>;
9
+ }
10
+ /**
11
+ * A Tabs container.
12
+ *
13
+ * Represents a set of layered sections of content. The Tabs is a container meant to be used with
14
+ * TabList, Tab, and TabPanel as follows:
15
+ *
16
+ * ```html
17
+ * <div ngTabs>
18
+ * <ul ngTabList>
19
+ * <li ngTab value="tab1">Tab 1</li>
20
+ * <li ngTab value="tab2">Tab 2</li>
21
+ * <li ngTab value="tab3">Tab 3</li>
22
+ * </ul>
23
+ *
24
+ * <div ngTabPanel value="tab1">
25
+ * <ng-template ngTabContent>Tab content 1</ng-template>
26
+ * </div>
27
+ * <div ngTabPanel value="tab2">
28
+ * <ng-template ngTabContent>Tab content 2</ng-template>
29
+ * </div>
30
+ * <div ngTabPanel value="tab3">
31
+ * <ng-template ngTabContent>Tab content 3</ng-template>
32
+ * </div>
33
+ * ```
34
+ */
35
+ declare class Tabs {
36
+ /** The TabList nested inside of the container. */
37
+ private readonly _tablist;
38
+ /** The TabPanels nested inside of the container. */
39
+ private readonly _unorderedPanels;
40
+ /** The Tab UIPattern of the child Tabs. */
41
+ tabs: Signal<TabPattern[] | undefined>;
42
+ /** The TabPanel UIPattern of the child TabPanels. */
43
+ unorderedTabpanels: Signal<TabPanelPattern[]>;
44
+ register(child: TabList | TabPanel): void;
45
+ deregister(child: TabList | TabPanel): void;
46
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tabs, never>;
47
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Tabs, "[ngTabs]", ["ngTabs"], {}, {}, never, never, true, never>;
48
+ }
49
+ /**
50
+ * A TabList container.
51
+ *
52
+ * Controls a list of Tab(s).
53
+ */
54
+ declare class TabList implements OnInit, OnDestroy {
55
+ /** A reference to the tab list element. */
56
+ private readonly _elementRef;
57
+ /** The parent Tabs. */
58
+ private readonly _tabs;
59
+ /** The Tabs nested inside of the TabList. */
60
+ private readonly _unorderedTabs;
61
+ /** The internal tab selection state. */
62
+ private readonly _selection;
63
+ /** Text direction. */
64
+ readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
65
+ /** The Tab UIPatterns of the child Tabs. */
66
+ readonly tabs: Signal<TabPattern[]>;
67
+ /** Whether the tablist is vertically or horizontally oriented. */
68
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
69
+ /** Whether focus should wrap when navigating. */
70
+ readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
71
+ /** Whether disabled items in the list should be skipped when navigating. */
72
+ readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
73
+ /** The focus strategy used by the tablist. */
74
+ readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
75
+ /** The selection strategy used by the tablist. */
76
+ readonly selectionMode: _angular_core.InputSignal<"follow" | "explicit">;
77
+ /** Whether the tablist is disabled. */
78
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
79
+ /** The current selected tab. */
80
+ readonly selectedTab: _angular_core.ModelSignal<string | undefined>;
81
+ /** The TabList UIPattern. */
82
+ readonly pattern: TabListPattern;
83
+ /** Whether the tree has received focus yet. */
84
+ private _hasFocused;
85
+ constructor();
86
+ onFocus(): void;
87
+ ngOnInit(): void;
88
+ ngOnDestroy(): void;
89
+ register(child: Tab): void;
90
+ deregister(child: Tab): void;
91
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabList, never>;
92
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TabList, "[ngTabList]", ["ngTabList"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selectedTab": { "alias": "selectedTab"; "required": false; "isSignal": true; }; }, { "selectedTab": "selectedTabChange"; }, never, never, true, never>;
93
+ }
94
+ /** A selectable tab in a TabList. */
95
+ declare class Tab implements HasElement, OnInit, OnDestroy {
96
+ /** A reference to the tab element. */
97
+ private readonly _elementRef;
98
+ /** The parent Tabs. */
99
+ private readonly _tabs;
100
+ /** The parent TabList. */
101
+ private readonly _tabList;
102
+ /** A global unique identifier for the tab. */
103
+ private readonly _id;
104
+ /** The host native element. */
105
+ readonly element: Signal<any>;
106
+ /** The parent TabList UIPattern. */
107
+ readonly tablist: Signal<TabListPattern>;
108
+ /** The TabPanel UIPattern associated with the tab */
109
+ readonly tabpanel: Signal<TabPanelPattern | undefined>;
110
+ /** Whether a tab is disabled. */
111
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
112
+ /** A local unique identifier for the tab. */
113
+ readonly value: _angular_core.InputSignal<string>;
114
+ /** The Tab UIPattern. */
115
+ readonly pattern: TabPattern;
116
+ ngOnInit(): void;
117
+ ngOnDestroy(): void;
118
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tab, never>;
119
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Tab, "[ngTab]", ["ngTab"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
120
+ }
121
+ /**
122
+ * A TabPanel container for the resources of layered content associated with a tab.
123
+ *
124
+ * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute
125
+ * will be applied to the tabpanel element to remove it from the accessibility tree and stop
126
+ * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl
127
+ * and a proper styling is required.
128
+ */
129
+ declare class TabPanel implements OnInit, OnDestroy {
130
+ /** The DeferredContentAware host directive. */
131
+ private readonly _deferredContentAware;
132
+ /** The parent Tabs. */
133
+ private readonly _Tabs;
134
+ /** A global unique identifier for the tab. */
135
+ private readonly _id;
136
+ /** The Tab UIPattern associated with the tabpanel */
137
+ readonly tab: Signal<TabPattern | undefined>;
138
+ /** A local unique identifier for the tabpanel. */
139
+ readonly value: _angular_core.InputSignal<string>;
140
+ /** The TabPanel UIPattern. */
141
+ readonly pattern: TabPanelPattern;
142
+ constructor();
143
+ ngOnInit(): void;
144
+ ngOnDestroy(): void;
145
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabPanel, never>;
146
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TabPanel, "[ngTabPanel]", ["ngTabPanel"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
147
+ }
148
+ /**
149
+ * A TabContent container for the lazy-loaded content.
150
+ */
151
+ declare class TabContent {
152
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabContent, never>;
153
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TabContent, "ng-template[ngTabContent]", ["ngTabContent"], {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
154
+ }
155
+
156
+ export { Tab, TabContent, TabList, TabPanel, Tabs };
@@ -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,135 @@
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
+ /** Whether the tree item is selectable. */
98
+ readonly selectable: _angular_core.InputSignal<boolean>;
99
+ /** Optional label for typeahead. Defaults to the element's textContent. */
100
+ readonly label: _angular_core.InputSignal<string | undefined>;
101
+ /** Search term for typeahead. */
102
+ readonly searchTerm: Signal<any>;
103
+ /** The tree root. */
104
+ readonly tree: Signal<Tree<V>>;
105
+ /** The UI pattern for this item. */
106
+ pattern: TreeItemPattern<V>;
107
+ constructor();
108
+ ngOnInit(): void;
109
+ ngOnDestroy(): void;
110
+ register(group: TreeItemGroup<V>): void;
111
+ unregister(): void;
112
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItem<any>, never>;
113
+ 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; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
114
+ }
115
+ /**
116
+ * Contains children tree itmes.
117
+ */
118
+ declare class TreeItemGroup<V> implements OnInit, OnDestroy {
119
+ /** The DeferredContent host directive. */
120
+ private readonly _deferredContent;
121
+ /** All groupable items that are descendants of the group. */
122
+ private readonly _unorderedItems;
123
+ /** Child items within this group. */
124
+ readonly children: Signal<TreeItemPattern<V>[]>;
125
+ /** Tree item that owns the group. */
126
+ readonly ownedBy: _angular_core.InputSignal<TreeItem<V>>;
127
+ ngOnInit(): void;
128
+ ngOnDestroy(): void;
129
+ register(child: TreeItem<V>): void;
130
+ unregister(child: TreeItem<V>): void;
131
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeItemGroup<any>, never>;
132
+ 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: {}; }]>;
133
+ }
134
+
135
+ export { Tree, TreeItem, TreeItemGroup };