@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,92 @@
1
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
+ import * as _angular_core from '@angular/core';
3
+ import { WritableSignal } from '@angular/core';
4
+ import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from '@angular/aria/ui-patterns';
5
+ import * as i1 from '@angular/aria/deferred-content';
6
+
7
+ /**
8
+ * Represents the content panel of an accordion item. It is controlled by an
9
+ * associated `AccordionTrigger`.
10
+ */
11
+ declare class AccordionPanel {
12
+ /** The DeferredContentAware host directive. */
13
+ private readonly _deferredContentAware;
14
+ /** A global unique identifier for the panel. */
15
+ private readonly _id;
16
+ /** A local unique identifier for the panel, used to match with its trigger's value. */
17
+ value: _angular_core.InputSignal<string>;
18
+ /** The parent accordion trigger pattern that controls this panel. This is set by AccordionGroup. */
19
+ readonly accordionTrigger: WritableSignal<AccordionTriggerPattern | undefined>;
20
+ /** The UI pattern instance for this panel. */
21
+ readonly pattern: AccordionPanelPattern;
22
+ constructor();
23
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionPanel, never>;
24
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
25
+ }
26
+ /**
27
+ * Represents the trigger button for an accordion item. It controls the expansion
28
+ * state of an associated `AccordionPanel`.
29
+ */
30
+ declare class AccordionTrigger {
31
+ /** A global unique identifier for the trigger. */
32
+ private readonly _id;
33
+ /** A reference to the trigger element. */
34
+ private readonly _elementRef;
35
+ /** The parent AccordionGroup. */
36
+ private readonly _accordionGroup;
37
+ /** A local unique identifier for the trigger, used to match with its panel's value. */
38
+ value: _angular_core.InputSignal<string>;
39
+ /** Whether the trigger is disabled. */
40
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
41
+ /**
42
+ * Whether this trigger is completely inaccessible.
43
+ *
44
+ * TODO(ok7sai): Consider move this to UI patterns.
45
+ */
46
+ readonly hardDisabled: _angular_core.Signal<boolean>;
47
+ /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
48
+ readonly accordionPanel: WritableSignal<AccordionPanelPattern | undefined>;
49
+ /** The UI pattern instance for this trigger. */
50
+ readonly pattern: AccordionTriggerPattern;
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
52
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
53
+ }
54
+ /**
55
+ * Container for a group of accordion items. It manages the overall state and
56
+ * interactions of the accordion, such as keyboard navigation and expansion mode.
57
+ */
58
+ declare class AccordionGroup {
59
+ /** A reference to the group element. */
60
+ private readonly _elementRef;
61
+ /** The AccordionTriggers nested inside this group. */
62
+ protected readonly _triggers: _angular_core.Signal<readonly AccordionTrigger[]>;
63
+ /** The AccordionPanels nested inside this group. */
64
+ protected readonly _panels: _angular_core.Signal<readonly AccordionPanel[]>;
65
+ /** The text direction (ltr or rtl). */
66
+ readonly textDirection: WritableSignal<_angular_cdk_bidi.Direction>;
67
+ /** Whether the entire accordion group is disabled. */
68
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
69
+ /** Whether multiple accordion items can be expanded simultaneously. */
70
+ multiExpandable: _angular_core.InputSignalWithTransform<boolean, unknown>;
71
+ /** The values of the current selected/expanded accordions. */
72
+ value: _angular_core.ModelSignal<string[]>;
73
+ /** Whether disabled items should be skipped during keyboard navigation. */
74
+ skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
75
+ /** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */
76
+ wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
77
+ /** The UI pattern instance for this accordion group. */
78
+ readonly pattern: AccordionGroupPattern;
79
+ constructor();
80
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
81
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_triggers", "_panels"], never, true, never>;
82
+ }
83
+ /**
84
+ * A structural directive that marks the `ng-template` to be used as the content
85
+ * for a `AccordionPanel`. This content can be lazily loaded.
86
+ */
87
+ declare class AccordionContent {
88
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionContent, never>;
89
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionContent, "ng-template[ngAccordionContent]", never, {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
90
+ }
91
+
92
+ export { AccordionContent, AccordionGroup, AccordionPanel, AccordionTrigger };
@@ -0,0 +1,6 @@
1
+ import { Version } from '@angular/core';
2
+
3
+ /** Current version of the CDK Experimental package. */
4
+ declare const VERSION: Version;
5
+
6
+ export { VERSION };
@@ -0,0 +1,60 @@
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 { ComboboxPattern, ComboboxListboxControls, ComboboxTreeControls } from '@angular/aria/ui-patterns';
5
+ import * as i1 from '@angular/aria/deferred-content';
6
+
7
+ declare class Combobox<V> {
8
+ /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
9
+ private readonly _directionality;
10
+ /** A signal wrapper for directionality. */
11
+ protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
12
+ /** The element that the combobox is attached to. */
13
+ private readonly _elementRef;
14
+ /** The DeferredContentAware host directive. */
15
+ private readonly _deferredContentAware;
16
+ /** The combobox popup. */
17
+ readonly popup: _angular_core.Signal<ComboboxPopup<V> | undefined>;
18
+ /** The filter mode for the combobox. */
19
+ filterMode: _angular_core.InputSignal<"manual" | "auto-select" | "highlight">;
20
+ /** Whether the combobox is focused. */
21
+ readonly isFocused: WritableSignal<boolean>;
22
+ /** Whether the listbox has received focus yet. */
23
+ private _hasBeenFocused;
24
+ /** Whether the combobox is disabled. */
25
+ readonly disabled: _angular_core.InputSignal<boolean>;
26
+ /** Whether the combobox is read-only. */
27
+ readonly readonly: _angular_core.InputSignal<boolean>;
28
+ /** The value of the first matching item in the popup. */
29
+ readonly firstMatch: _angular_core.InputSignal<V | undefined>;
30
+ /** The combobox ui pattern. */
31
+ readonly pattern: ComboboxPattern<any, V>;
32
+ constructor();
33
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox<any>, never>;
34
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
35
+ }
36
+ declare class ComboboxInput {
37
+ /** The element that the combobox is attached to. */
38
+ private readonly _elementRef;
39
+ /** The combobox that the input belongs to. */
40
+ readonly combobox: Combobox<any>;
41
+ /** The value of the input. */
42
+ value: _angular_core.ModelSignal<string>;
43
+ constructor();
44
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxInput, never>;
45
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxInput, "input[ngComboboxInput]", ["ngComboboxInput"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
46
+ }
47
+ declare class ComboboxPopupContainer {
48
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopupContainer, never>;
49
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopupContainer, "ng-template[ngComboboxPopupContainer]", ["ngComboboxPopupContainer"], {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
50
+ }
51
+ declare class ComboboxPopup<V> {
52
+ /** The combobox that the popup belongs to. */
53
+ readonly combobox: Combobox<V> | null;
54
+ /** The controls the popup exposes to the combobox. */
55
+ readonly controls: WritableSignal<ComboboxListboxControls<any, V> | ComboboxTreeControls<any, V> | undefined>;
56
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopup<any>, never>;
57
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopup<any>, "[ngComboboxPopup]", ["ngComboboxPopup"], {}, {}, never, never, true, never>;
58
+ }
59
+
60
+ export { Combobox, ComboboxInput, ComboboxPopup, ComboboxPopupContainer };
@@ -0,0 +1,38 @@
1
+ import * as _angular_core from '@angular/core';
2
+
3
+ /**
4
+ * A container directive controls the visibility of its content.
5
+ */
6
+ declare class DeferredContentAware {
7
+ readonly contentVisible: _angular_core.WritableSignal<boolean>;
8
+ readonly preserveContent: _angular_core.ModelSignal<boolean>;
9
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContentAware, never>;
10
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContentAware, never, never, { "preserveContent": { "alias": "preserveContent"; "required": false; "isSignal": true; }; }, { "preserveContent": "preserveContentChange"; }, never, never, true, never>;
11
+ }
12
+ /**
13
+ * DeferredContent loads/unloads the content based on the visibility.
14
+ * The visibilty signal is sent from a parent directive implements
15
+ * DeferredContentAware.
16
+ *
17
+ * Use this directive as a host directive. For example:
18
+ *
19
+ * ```ts
20
+ * @Directive({
21
+ * selector: 'ng-template[AccordionContent]',
22
+ * hostDirectives: [DeferredContent],
23
+ * })
24
+ * class AccordionContent {}
25
+ * ```
26
+ */
27
+ declare class DeferredContent {
28
+ private readonly _deferredContentAware;
29
+ private readonly _templateRef;
30
+ private readonly _viewContainerRef;
31
+ private _isRendered;
32
+ readonly deferredContentAware: _angular_core.WritableSignal<DeferredContentAware | null>;
33
+ constructor();
34
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContent, never>;
35
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContent, never, never, {}, {}, never, never, true, never>;
36
+ }
37
+
38
+ export { DeferredContent, DeferredContentAware };
@@ -0,0 +1,111 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { GridPattern, GridRowPattern, GridCellPattern, GridCellWidgetPattern } from './_grid-chunk.js';
4
+
5
+ /** A directive that provides grid-based navigation and selection behavior. */
6
+ declare class Grid {
7
+ /** A reference to the host element. */
8
+ private readonly _elementRef;
9
+ /** The rows that make up the grid. */
10
+ private readonly _rows;
11
+ /** The UI patterns for the rows in the grid. */
12
+ private readonly _rowPatterns;
13
+ /** The host native element. */
14
+ readonly element: Signal<any>;
15
+ /** Whether selection is enabled for the grid. */
16
+ readonly enableSelection: _angular_core.InputSignalWithTransform<boolean, unknown>;
17
+ /** Whether the grid is disabled. */
18
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
19
+ /** Whether to skip disabled items during navigation. */
20
+ readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
21
+ /** The focus strategy used by the grid. */
22
+ readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
23
+ /** The wrapping behavior for keyboard navigation along the row axis. */
24
+ readonly rowWrap: _angular_core.InputSignal<"continuous" | "loop" | "nowrap">;
25
+ /** The wrapping behavior for keyboard navigation along the column axis. */
26
+ readonly colWrap: _angular_core.InputSignal<"continuous" | "loop" | "nowrap">;
27
+ /** The UI pattern for the grid. */
28
+ readonly pattern: GridPattern;
29
+ constructor();
30
+ /** Gets the cell pattern for a given element. */
31
+ private _getCell;
32
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Grid, never>;
33
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Grid, "[ngGrid]", ["ngGrid"], { "enableSelection": { "alias": "enableSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "rowWrap": { "alias": "rowWrap"; "required": false; "isSignal": true; }; "colWrap": { "alias": "colWrap"; "required": false; "isSignal": true; }; }, {}, ["_rows"], never, true, never>;
34
+ }
35
+ /** A directive that represents a row in a grid. */
36
+ declare class GridRow {
37
+ /** A reference to the host element. */
38
+ private readonly _elementRef;
39
+ /** The cells that make up this row. */
40
+ private readonly _cells;
41
+ /** The UI patterns for the cells in this row. */
42
+ private readonly _cellPatterns;
43
+ /** The parent grid. */
44
+ private readonly _grid;
45
+ /** The parent grid UI pattern. */
46
+ readonly grid: Signal<GridPattern>;
47
+ /** The host native element. */
48
+ readonly element: Signal<any>;
49
+ /** The ARIA role for the row. */
50
+ readonly role: _angular_core.InputSignal<"row" | "rowheader">;
51
+ /** The index of this row within the grid. */
52
+ readonly rowIndex: _angular_core.InputSignal<number | undefined>;
53
+ /** The UI pattern for the grid row. */
54
+ readonly pattern: GridRowPattern;
55
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridRow, never>;
56
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<GridRow, "[ngGridRow]", ["ngGridRow"], { "role": { "alias": "role"; "required": false; "isSignal": true; }; "rowIndex": { "alias": "rowIndex"; "required": false; "isSignal": true; }; }, {}, ["_cells"], never, true, never>;
57
+ }
58
+ /** A directive that represents a cell in a grid. */
59
+ declare class GridCell {
60
+ /** A reference to the host element. */
61
+ private readonly _elementRef;
62
+ /** The widget contained within this cell, if any. */
63
+ private readonly _widgets;
64
+ /** The UI pattern for the widget in this cell. */
65
+ private readonly _widgetPattern;
66
+ /** The parent row. */
67
+ private readonly _row;
68
+ /** A unique identifier for the cell. */
69
+ private readonly _id;
70
+ /** The host native element. */
71
+ readonly element: Signal<any>;
72
+ /** The ARIA role for the cell. */
73
+ readonly role: _angular_core.InputSignal<"gridcell" | "columnheader">;
74
+ /** The number of rows the cell should span. */
75
+ readonly rowSpan: _angular_core.InputSignal<number>;
76
+ /** The number of columns the cell should span. */
77
+ readonly colSpan: _angular_core.InputSignal<number>;
78
+ /** The index of this cell's row within the grid. */
79
+ readonly rowIndex: _angular_core.InputSignal<number | undefined>;
80
+ /** The index of this cell's column within the grid. */
81
+ readonly colIndex: _angular_core.InputSignal<number | undefined>;
82
+ /** Whether the cell is disabled. */
83
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
84
+ /** Whether the cell is selected. */
85
+ readonly selected: _angular_core.ModelSignal<boolean>;
86
+ /** Whether the cell is selectable. */
87
+ readonly selectable: _angular_core.InputSignal<boolean>;
88
+ /** The UI pattern for the grid cell. */
89
+ readonly pattern: GridCellPattern;
90
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridCell, never>;
91
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<GridCell, "[ngGridCell]", ["ngGridCell"], { "role": { "alias": "role"; "required": false; "isSignal": true; }; "rowSpan": { "alias": "rowSpan"; "required": false; "isSignal": true; }; "colSpan": { "alias": "colSpan"; "required": false; "isSignal": true; }; "rowIndex": { "alias": "rowIndex"; "required": false; "isSignal": true; }; "colIndex": { "alias": "colIndex"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; }, ["_widgets"], never, true, never>;
92
+ }
93
+ /** A directive that represents a widget inside a grid cell. */
94
+ declare class GridCellWidget {
95
+ /** A reference to the host element. */
96
+ private readonly _elementRef;
97
+ /** The parent cell. */
98
+ private readonly _cell;
99
+ /** The host native element. */
100
+ readonly element: Signal<any>;
101
+ /** Whether the widget is activated and the grid navigation should be paused. */
102
+ readonly activate: _angular_core.ModelSignal<boolean>;
103
+ /** The UI pattern for the grid cell widget. */
104
+ readonly pattern: GridCellWidgetPattern;
105
+ /** Focuses the widget. */
106
+ focus(): void;
107
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridCellWidget, never>;
108
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<GridCellWidget, "[ngGridCellWidget]", ["ngGridCellWidget"], { "activate": { "alias": "activate"; "required": false; "isSignal": true; }; }, { "activate": "activateChange"; }, never, never, true, never>;
109
+ }
110
+
111
+ export { Grid, GridCell, GridCellWidget, GridRow };
@@ -0,0 +1,95 @@
1
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
+ import * as _angular_core from '@angular/core';
3
+ import { OptionPattern, ListboxPattern } from '@angular/aria/ui-patterns';
4
+ import { ComboboxPopup } from './combobox.js';
5
+ import '@angular/aria/deferred-content';
6
+
7
+ /**
8
+ * A listbox container.
9
+ *
10
+ * Listboxes are used to display a list of items for a user to select from. The Listbox is meant
11
+ * to be used in conjunction with Option as follows:
12
+ *
13
+ * ```html
14
+ * <ul ngListbox>
15
+ * <li [value]="1" ngOption>Item 1</li>
16
+ * <li [value]="2" ngOption>Item 2</li>
17
+ * <li [value]="3" ngOption>Item 3</li>
18
+ * </ul>
19
+ * ```
20
+ */
21
+ declare class Listbox<V> {
22
+ /** A unique identifier for the listbox. */
23
+ private readonly _generatedId;
24
+ /** A unique identifier for the listbox. */
25
+ protected id: _angular_core.Signal<string>;
26
+ /** A reference to the parent combobox popup, if one exists. */
27
+ private readonly _popup;
28
+ /** A reference to the listbox element. */
29
+ private readonly _elementRef;
30
+ /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
31
+ private readonly _directionality;
32
+ /** The Options nested inside of the Listbox. */
33
+ private readonly _options;
34
+ /** A signal wrapper for directionality. */
35
+ protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
36
+ /** The Option UIPatterns of the child Options. */
37
+ protected items: _angular_core.Signal<OptionPattern<any>[]>;
38
+ /** Whether the list is vertically or horizontally oriented. */
39
+ orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
40
+ /** Whether multiple items in the list can be selected at once. */
41
+ multi: _angular_core.InputSignalWithTransform<boolean, unknown>;
42
+ /** Whether focus should wrap when navigating. */
43
+ wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
44
+ /** Whether disabled items in the list should be skipped when navigating. */
45
+ skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
46
+ /** The focus strategy used by the list. */
47
+ focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
48
+ /** The selection strategy used by the list. */
49
+ selectionMode: _angular_core.InputSignal<"follow" | "explicit">;
50
+ /** The amount of time before the typeahead search is reset. */
51
+ typeaheadDelay: _angular_core.InputSignal<number>;
52
+ /** Whether the listbox is disabled. */
53
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
+ /** Whether the listbox is readonly. */
55
+ readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
56
+ /** The values of the current selected items. */
57
+ value: _angular_core.ModelSignal<V[]>;
58
+ /** The Listbox UIPattern. */
59
+ pattern: ListboxPattern<V>;
60
+ /** Whether the listbox has received focus yet. */
61
+ private _hasFocused;
62
+ constructor();
63
+ onFocus(): void;
64
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Listbox<any>, never>;
65
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Listbox<any>, "[ngListbox]", ["ngListbox"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "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; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "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"; }, ["_options"], never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
66
+ }
67
+ /** A selectable option in a Listbox. */
68
+ declare class Option<V> {
69
+ /** A reference to the option element. */
70
+ private readonly _elementRef;
71
+ /** The parent Listbox. */
72
+ private readonly _listbox;
73
+ /** A unique identifier for the option. */
74
+ private readonly _generatedId;
75
+ /** A unique identifier for the option. */
76
+ protected id: _angular_core.Signal<string>;
77
+ /** The text used by the typeahead search. */
78
+ protected searchTerm: _angular_core.Signal<any>;
79
+ /** The parent Listbox UIPattern. */
80
+ protected listbox: _angular_core.Signal<ListboxPattern<any>>;
81
+ /** A reference to the option element to be focused on navigation. */
82
+ protected element: _angular_core.Signal<any>;
83
+ /** The value of the option. */
84
+ value: _angular_core.InputSignal<V>;
85
+ /** Whether an item is disabled. */
86
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
87
+ /** The text used by the typeahead search. */
88
+ label: _angular_core.InputSignal<string | undefined>;
89
+ /** The Option UIPattern. */
90
+ pattern: OptionPattern<V>;
91
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Option<any>, never>;
92
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Option<any>, "[ngOption]", ["ngOption"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
93
+ }
94
+
95
+ export { Listbox, Option };
@@ -0,0 +1,158 @@
1
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
+ import * as _angular_core from '@angular/core';
3
+ import { Signal } from '@angular/core';
4
+ import { MenuTriggerPattern, MenuPattern, MenuItemPattern, SignalLike, MenuBarPattern } from '@angular/aria/ui-patterns';
5
+
6
+ /**
7
+ * A trigger for a menu.
8
+ *
9
+ * The menu trigger is used to open and close menus, and can be placed on menu items to connect
10
+ * sub-menus.
11
+ */
12
+ declare class MenuTrigger<V> {
13
+ /** A reference to the menu trigger element. */
14
+ private readonly _elementRef;
15
+ /** A reference to the menu element. */
16
+ readonly element: HTMLButtonElement;
17
+ /** The submenu associated with the menu trigger. */
18
+ submenu: _angular_core.InputSignal<Menu<V> | undefined>;
19
+ /** A callback function triggered when a menu item is selected. */
20
+ onSubmit: _angular_core.OutputEmitterRef<V>;
21
+ /** The menu trigger ui pattern instance. */
22
+ uiPattern: MenuTriggerPattern<V>;
23
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuTrigger<any>, never>;
24
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuTrigger<any>, "button[ngMenuTrigger]", ["ngMenuTrigger"], { "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; }, { "onSubmit": "onSubmit"; }, never, never, true, never>;
25
+ }
26
+ /**
27
+ * A list of menu items.
28
+ *
29
+ * A menu is used to offer a list of menu item choices to users. Menus can be nested within other
30
+ * menus to create sub-menus.
31
+ *
32
+ * ```html
33
+ * <button ngMenuTrigger menu="menu">Options</button>
34
+ *
35
+ * <div ngMenu #menu="ngMenu">
36
+ * <div ngMenuItem>Star</div>
37
+ * <div ngMenuItem>Edit</div>
38
+ * <div ngMenuItem>Delete</div>
39
+ * </div>
40
+ * ```
41
+ */
42
+ declare class Menu<V> {
43
+ /** The menu items contained in the menu. */
44
+ readonly _allItems: Signal<readonly MenuItem<V>[]>;
45
+ /** The menu items that are direct children of this menu. */
46
+ readonly _items: Signal<MenuItem<V>[]>;
47
+ /** A reference to the menu element. */
48
+ private readonly _elementRef;
49
+ /** A reference to the menu element. */
50
+ readonly element: HTMLElement;
51
+ /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
52
+ private readonly _directionality;
53
+ /** A signal wrapper for directionality. */
54
+ readonly textDirection: Signal<_angular_cdk_bidi.Direction>;
55
+ /** The submenu associated with the menu. */
56
+ readonly submenu: _angular_core.InputSignal<Menu<V> | undefined>;
57
+ /** The unique ID of the menu. */
58
+ readonly id: _angular_core.InputSignal<string>;
59
+ /** Whether the menu should wrap its items. */
60
+ readonly wrap: _angular_core.InputSignal<boolean>;
61
+ /** The delay in seconds before the typeahead buffer is cleared. */
62
+ readonly typeaheadDelay: _angular_core.InputSignal<number>;
63
+ /** A reference to the parent menu item or menu trigger. */
64
+ readonly parent: _angular_core.InputSignal<MenuItem<V> | MenuTrigger<V> | undefined>;
65
+ /** The menu ui pattern instance. */
66
+ readonly uiPattern: MenuPattern<V>;
67
+ /**
68
+ * The menu items as a writable signal.
69
+ *
70
+ * TODO(wagnermaciel): This would normally be a computed, but using a computed causes a bug where
71
+ * sometimes the items array is empty. The bug can be reproduced by switching this to use a
72
+ * computed and then quickly opening and closing menus in the dev app.
73
+ */
74
+ readonly items: () => MenuItemPattern<V>[];
75
+ /** Whether the menu is visible. */
76
+ isVisible: Signal<boolean>;
77
+ /** A callback function triggered when a menu item is selected. */
78
+ onSubmit: _angular_core.OutputEmitterRef<V>;
79
+ constructor();
80
+ /** Closes the menu. */
81
+ close(opts?: {
82
+ refocus?: boolean;
83
+ }): void;
84
+ /** Closes all parent menus. */
85
+ closeAll(opts?: {
86
+ refocus?: boolean;
87
+ }): void;
88
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Menu<any>, never>;
89
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Menu<any>, "[ngMenu]", ["ngMenu"], { "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "parent": { "alias": "parent"; "required": false; "isSignal": true; }; }, { "onSubmit": "onSubmit"; }, ["_allItems"], never, true, never>;
90
+ }
91
+ /**
92
+ * A menu bar of menu items.
93
+ *
94
+ * Like the menu, a menubar is used to offer a list of menu item choices to users. However, a
95
+ * menubar is used to display a persistent, top-level,
96
+ * always-visible set of menu item choices.
97
+ */
98
+ declare class MenuBar<V> {
99
+ /** The menu items contained in the menubar. */
100
+ readonly _allItems: Signal<readonly MenuItem<V>[]>;
101
+ readonly _items: SignalLike<MenuItem<V>[]>;
102
+ /** A reference to the menu element. */
103
+ private readonly _elementRef;
104
+ /** A reference to the menubar element. */
105
+ readonly element: HTMLElement;
106
+ /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
107
+ private readonly _directionality;
108
+ /** A signal wrapper for directionality. */
109
+ readonly textDirection: Signal<_angular_cdk_bidi.Direction>;
110
+ /** The value of the menu. */
111
+ readonly value: _angular_core.ModelSignal<V[]>;
112
+ /** Whether the menu should wrap its items. */
113
+ readonly wrap: _angular_core.InputSignal<boolean>;
114
+ /** The delay in seconds before the typeahead buffer is cleared. */
115
+ readonly typeaheadDelay: _angular_core.InputSignal<number>;
116
+ /** The menu ui pattern instance. */
117
+ readonly uiPattern: MenuBarPattern<V>;
118
+ /** The menu items as a writable signal. */
119
+ readonly items: _angular_core.WritableSignal<MenuItemPattern<V>[]>;
120
+ /** A callback function triggered when a menu item is selected. */
121
+ onSubmit: _angular_core.OutputEmitterRef<V>;
122
+ constructor();
123
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuBar<any>, never>;
124
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuBar<any>, "[ngMenuBar]", ["ngMenuBar"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onSubmit": "onSubmit"; }, ["_allItems"], never, true, never>;
125
+ }
126
+ /**
127
+ * An item in a Menu.
128
+ *
129
+ * Menu items can be used in menus and menubars to represent a choice or action a user can take.
130
+ */
131
+ declare class MenuItem<V> {
132
+ /** A reference to the menu item element. */
133
+ private readonly _elementRef;
134
+ /** A reference to the menu element. */
135
+ readonly element: HTMLElement;
136
+ /** The unique ID of the menu item. */
137
+ readonly id: _angular_core.InputSignal<string>;
138
+ /** The value of the menu item. */
139
+ readonly value: _angular_core.InputSignal<V>;
140
+ /** Whether the menu item is disabled. */
141
+ readonly disabled: _angular_core.InputSignal<boolean>;
142
+ /** The search term associated with the menu item. */
143
+ readonly searchTerm: _angular_core.ModelSignal<string>;
144
+ /** A reference to the parent menu. */
145
+ private readonly _menu;
146
+ /** A reference to the parent menu bar. */
147
+ private readonly _menuBar;
148
+ /** A reference to the parent menu or menubar. */
149
+ readonly parent: Menu<V> | MenuBar<V> | null;
150
+ /** The submenu associated with the menu item. */
151
+ readonly submenu: _angular_core.InputSignal<Menu<V> | undefined>;
152
+ /** The menu item ui pattern instance. */
153
+ readonly uiPattern: MenuItemPattern<V>;
154
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItem<any>, never>;
155
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuItem<any>, "[ngMenuItem]", ["ngMenuItem"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "searchTerm": { "alias": "searchTerm"; "required": false; "isSignal": true; }; "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; }, { "searchTerm": "searchTermChange"; }, never, never, true, never>;
156
+ }
157
+
158
+ export { Menu, MenuBar, MenuItem, MenuTrigger };