@angular/cdk-experimental 21.0.0-next.6 → 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.
Files changed (74) hide show
  1. package/fesm2022/_polyfill-chunk.mjs.map +1 -1
  2. package/fesm2022/cdk-experimental.mjs +1 -1
  3. package/fesm2022/cdk-experimental.mjs.map +1 -1
  4. package/fesm2022/column-resize.mjs.map +1 -1
  5. package/fesm2022/popover-edit.mjs.map +1 -1
  6. package/fesm2022/scrolling.mjs.map +1 -1
  7. package/fesm2022/selection.mjs.map +1 -1
  8. package/fesm2022/table-scroll-container.mjs.map +1 -1
  9. package/package.json +3 -38
  10. package/types/column-resize.d.ts +37 -37
  11. package/types/popover-edit.d.ts +30 -30
  12. package/types/scrolling.d.ts +6 -6
  13. package/types/selection.d.ts +14 -14
  14. package/types/table-scroll-container.d.ts +6 -6
  15. package/fesm2022/_accordion-chunk.mjs +0 -153
  16. package/fesm2022/_accordion-chunk.mjs.map +0 -1
  17. package/fesm2022/_combobox-chunk.mjs +0 -278
  18. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  19. package/fesm2022/_combobox-listbox-chunk.mjs +0 -278
  20. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  21. package/fesm2022/_combobox-tree-chunk.mjs +0 -398
  22. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  23. package/fesm2022/_expansion-chunk.mjs +0 -87
  24. package/fesm2022/_expansion-chunk.mjs.map +0 -1
  25. package/fesm2022/_list-chunk.mjs +0 -374
  26. package/fesm2022/_list-chunk.mjs.map +0 -1
  27. package/fesm2022/_list-navigation-chunk.mjs +0 -131
  28. package/fesm2022/_list-navigation-chunk.mjs.map +0 -1
  29. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -145
  30. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  31. package/fesm2022/_tabs-chunk.mjs +0 -211
  32. package/fesm2022/_tabs-chunk.mjs.map +0 -1
  33. package/fesm2022/_toolbar-chunk.mjs +0 -273
  34. package/fesm2022/_toolbar-chunk.mjs.map +0 -1
  35. package/fesm2022/_toolbar-radio-group-chunk.mjs +0 -222
  36. package/fesm2022/_toolbar-radio-group-chunk.mjs.map +0 -1
  37. package/fesm2022/accordion.mjs +0 -195
  38. package/fesm2022/accordion.mjs.map +0 -1
  39. package/fesm2022/combobox.mjs +0 -131
  40. package/fesm2022/combobox.mjs.map +0 -1
  41. package/fesm2022/deferred-content.mjs +0 -59
  42. package/fesm2022/deferred-content.mjs.map +0 -1
  43. package/fesm2022/listbox.mjs +0 -204
  44. package/fesm2022/listbox.mjs.map +0 -1
  45. package/fesm2022/radio-group.mjs +0 -200
  46. package/fesm2022/radio-group.mjs.map +0 -1
  47. package/fesm2022/tabs.mjs +0 -303
  48. package/fesm2022/tabs.mjs.map +0 -1
  49. package/fesm2022/toolbar.mjs +0 -221
  50. package/fesm2022/toolbar.mjs.map +0 -1
  51. package/fesm2022/tree.mjs +0 -333
  52. package/fesm2022/tree.mjs.map +0 -1
  53. package/fesm2022/ui-patterns.mjs +0 -24
  54. package/fesm2022/ui-patterns.mjs.map +0 -1
  55. package/types/_accordion-chunk.d.ts +0 -90
  56. package/types/_combobox-chunk.d.ts +0 -138
  57. package/types/_expansion-chunk.d.ts +0 -71
  58. package/types/_list-chunk.d.ts +0 -209
  59. package/types/_list-navigation-chunk.d.ts +0 -101
  60. package/types/_listbox-chunk.d.ts +0 -105
  61. package/types/_pointer-event-manager-chunk.d.ts +0 -98
  62. package/types/_radio-group-chunk.d.ts +0 -92
  63. package/types/_tabs-chunk.d.ts +0 -138
  64. package/types/_toolbar-chunk.d.ts +0 -150
  65. package/types/_tree-chunk.d.ts +0 -139
  66. package/types/accordion.d.ts +0 -95
  67. package/types/combobox.d.ts +0 -54
  68. package/types/deferred-content.d.ts +0 -37
  69. package/types/listbox.d.ts +0 -99
  70. package/types/radio-group.d.ts +0 -85
  71. package/types/tabs.d.ts +0 -160
  72. package/types/toolbar.d.ts +0 -115
  73. package/types/tree.d.ts +0 -155
  74. package/types/ui-patterns.d.ts +0 -157
@@ -1,98 +0,0 @@
1
- import { SignalLike } from './_list-navigation-chunk.js';
2
-
3
- /**
4
- * Options that are applicable to all event handlers.
5
- *
6
- * This library has not yet had a need for stopPropagationImmediate.
7
- */
8
- interface EventHandlerOptions {
9
- stopPropagation: boolean;
10
- preventDefault: boolean;
11
- }
12
- /** A basic event handler. */
13
- type EventHandler<T extends Event> = (event: T) => void;
14
- /** A function that determines whether an event is to be handled. */
15
- type EventMatcher<T extends Event> = (event: T) => boolean;
16
- /** A config that specifies how to handle a particular event. */
17
- interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {
18
- matcher: EventMatcher<T>;
19
- handler: EventHandler<T>;
20
- }
21
- /** Bit flag representation of the possible modifier keys that can be present on an event. */
22
- declare enum Modifier {
23
- None = 0,
24
- Ctrl = 1,
25
- Shift = 2,
26
- Alt = 4,
27
- Meta = 8,
28
- Any = "Any"
29
- }
30
- type ModifierInputs = Modifier | Modifier[];
31
- /**
32
- * Abstract base class for all event managers.
33
- *
34
- * Event managers are designed to normalize how event handlers are authored and create a safety net
35
- * for common event handling gotchas like remembering to call preventDefault or stopPropagation.
36
- */
37
- declare abstract class EventManager<T extends Event> {
38
- protected configs: EventHandlerConfig<T>[];
39
- abstract options: EventHandlerOptions;
40
- /** Runs the handlers that match with the given event. */
41
- handle(event: T): void;
42
- /** Configures the event manager to handle specific events. (See subclasses for more). */
43
- abstract on(...args: [...unknown[]]): this;
44
- }
45
-
46
- /**
47
- * Used to represent a keycode.
48
- *
49
- * This is used to match whether an events keycode should be handled. The ability to match using a
50
- * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.
51
- */
52
- type KeyCode = string | SignalLike<string> | RegExp;
53
- /**
54
- * An event manager that is specialized for handling keyboard events. By default this manager stops
55
- * propagation and prevents default on all events it handles.
56
- */
57
- declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
58
- options: EventHandlerOptions;
59
- /** Configures this event manager to handle events with a specific key and no modifiers. */
60
- on(key: KeyCode, handler: EventHandler<T>): this;
61
- /** Configures this event manager to handle events with a specific modifer and key combination. */
62
- on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;
63
- private _normalizeInputs;
64
- private _isMatch;
65
- }
66
-
67
- /**
68
- * The different mouse buttons that may appear on a pointer event.
69
- */
70
- declare enum MouseButton {
71
- Main = 0,
72
- Auxiliary = 1,
73
- Secondary = 2
74
- }
75
- /** An event manager that is specialized for handling pointer events. */
76
- declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
77
- options: EventHandlerOptions;
78
- /**
79
- * Configures this event manager to handle events with a specific modifer and mouse button
80
- * combination.
81
- */
82
- on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
83
- /**
84
- * Configures this event manager to handle events with a specific mouse button and no modifiers.
85
- */
86
- on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
87
- /**
88
- * Configures this event manager to handle events with the main mouse button and no modifiers.
89
- *
90
- * @param handler The handler function
91
- * @param options Options for whether to stop propagation or prevent default.
92
- */
93
- on(handler: EventHandler<T>): this;
94
- private _normalizeInputs;
95
- _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
96
- }
97
-
98
- export { KeyboardEventManager, PointerEventManager };
@@ -1,92 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.js';
3
- import { ListItem, ListInputs, List } from './_list-chunk.js';
4
- import { SignalLike } from './_list-navigation-chunk.js';
5
-
6
- /** Represents the required inputs for a radio button in a radio group. */
7
- interface RadioButtonInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'index'> {
8
- /** A reference to the parent radio group. */
9
- group: SignalLike<RadioGroupPattern<V> | undefined>;
10
- }
11
- /** Represents a radio button within a radio group. */
12
- declare class RadioButtonPattern<V> {
13
- readonly inputs: RadioButtonInputs<V>;
14
- /** A unique identifier for the radio button. */
15
- readonly id: SignalLike<string>;
16
- /** The value associated with the radio button. */
17
- readonly value: SignalLike<V>;
18
- /** The position of the radio button within the group. */
19
- readonly index: SignalLike<number>;
20
- /** Whether the radio button is currently the active one (focused). */
21
- readonly active: _angular_core.Signal<boolean>;
22
- /** Whether the radio button is selected. */
23
- readonly selected: SignalLike<boolean>;
24
- /** Whether the radio button is disabled. */
25
- readonly disabled: SignalLike<boolean>;
26
- /** A reference to the parent radio group. */
27
- readonly group: SignalLike<RadioGroupPattern<V> | undefined>;
28
- /** The tabindex of the radio button. */
29
- readonly tabindex: _angular_core.Signal<0 | -1 | undefined>;
30
- /** The HTML element associated with the radio button. */
31
- readonly element: SignalLike<HTMLElement>;
32
- /** The search term for typeahead. */
33
- readonly searchTerm: () => string;
34
- constructor(inputs: RadioButtonInputs<V>);
35
- }
36
-
37
- /** Represents the required inputs for a radio group. */
38
- type RadioGroupInputs<V> = Omit<ListInputs<RadioButtonPattern<V>, V>, 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'> & {
39
- /** Whether the radio group is disabled. */
40
- disabled: SignalLike<boolean>;
41
- /** Whether the radio group is readonly. */
42
- readonly: SignalLike<boolean>;
43
- /** A function that returns the radio button associated with a given element. */
44
- getItem: (e: PointerEvent) => RadioButtonPattern<V> | undefined;
45
- };
46
- /** Controls the state of a radio group. */
47
- declare class RadioGroupPattern<V> {
48
- readonly inputs: RadioGroupInputs<V>;
49
- /** The list behavior for the radio group. */
50
- readonly listBehavior: List<RadioButtonPattern<V>, V>;
51
- /** Whether the radio group is vertically or horizontally oriented. */
52
- readonly orientation: SignalLike<'vertical' | 'horizontal'>;
53
- /** Whether focus should wrap when navigating. */
54
- readonly wrap: _angular_core.WritableSignal<boolean>;
55
- /** The selection strategy used by the radio group. */
56
- readonly selectionMode: _angular_core.WritableSignal<"follow" | "explicit">;
57
- /** Whether the radio group is disabled. */
58
- readonly disabled: _angular_core.Signal<boolean>;
59
- /** The currently selected radio button. */
60
- readonly selectedItem: _angular_core.Signal<RadioButtonPattern<V>>;
61
- /** Whether the radio group is readonly. */
62
- readonly readonly: _angular_core.Signal<boolean>;
63
- /** The tabindex of the radio group. */
64
- readonly tabindex: _angular_core.Signal<0 | -1>;
65
- /** The id of the current active radio button (if using activedescendant). */
66
- readonly activedescendant: _angular_core.Signal<string | undefined>;
67
- /** The key used to navigate to the previous radio button. */
68
- private readonly _prevKey;
69
- /** The key used to navigate to the next radio button. */
70
- private readonly _nextKey;
71
- /** The keydown event manager for the radio group. */
72
- readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
73
- /** The pointerdown event manager for the radio group. */
74
- readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
75
- constructor(inputs: RadioGroupInputs<V>);
76
- /** Handles keydown events for the radio group. */
77
- onKeydown(event: KeyboardEvent): void;
78
- /** Handles pointerdown events for the radio group. */
79
- onPointerdown(event: PointerEvent): void;
80
- /**
81
- * Sets the radio group to its default initial state.
82
- *
83
- * Sets the active index to the selected radio button if one exists and is focusable.
84
- * Otherwise, sets the active index to the first focusable radio button.
85
- */
86
- setDefaultState(): void;
87
- /** Validates the state of the radio group and returns a list of accessibility violations. */
88
- validate(): string[];
89
- }
90
-
91
- export { RadioButtonPattern, RadioGroupPattern };
92
- export type { RadioButtonInputs, RadioGroupInputs };
@@ -1,138 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.js';
3
- import { ExpansionItem, ExpansionControl, ListExpansionInputs, ListExpansion } from './_expansion-chunk.js';
4
- import { SignalLike } from './_list-navigation-chunk.js';
5
- import { ListItem, ListInputs, List } from './_list-chunk.js';
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: _angular_core.Signal<string | undefined>;
24
- /** The `aria-labelledby` ids. */
25
- readonly labelledBy: _angular_core.Signal<string[]>;
26
- constructor(inputs: LabelControlInputs & LabelControlOptionalInputs);
27
- }
28
-
29
- /** The required inputs to tabs. */
30
- interface TabInputs extends Omit<ListItem<string>, 'searchTerm' | 'index'>, Omit<ExpansionItem, 'expansionId' | 'expandable'> {
31
- /** The parent tablist that controls the tab. */
32
- tablist: SignalLike<TabListPattern>;
33
- /** The remote tabpanel controlled by the tab. */
34
- tabpanel: SignalLike<TabPanelPattern | undefined>;
35
- }
36
- /** A tab in a tablist. */
37
- declare class TabPattern {
38
- readonly inputs: TabInputs;
39
- /** Controls expansion for this tab. */
40
- readonly expansion: ExpansionControl;
41
- /** A global unique identifier for the tab. */
42
- readonly id: SignalLike<string>;
43
- /** The index of the tab. */
44
- readonly index: _angular_core.Signal<number>;
45
- /** A local unique identifier for the tab. */
46
- readonly value: SignalLike<string>;
47
- /** Whether the tab is disabled. */
48
- readonly disabled: SignalLike<boolean>;
49
- /** The html element that should receive focus. */
50
- readonly element: SignalLike<HTMLElement>;
51
- /** The text used by the typeahead search. */
52
- readonly searchTerm: () => string;
53
- /** Whether this tab has expandable content. */
54
- readonly expandable: _angular_core.Signal<boolean>;
55
- /** The unique identifier used by the expansion behavior. */
56
- readonly expansionId: _angular_core.Signal<string>;
57
- /** Whether the tab is expanded. */
58
- readonly expanded: _angular_core.Signal<boolean>;
59
- /** Whether the tab is active. */
60
- readonly active: _angular_core.Signal<boolean>;
61
- /** Whether the tab is selected. */
62
- readonly selected: _angular_core.Signal<boolean>;
63
- /** The tabindex of the tab. */
64
- readonly tabindex: _angular_core.Signal<0 | -1>;
65
- /** The id of the tabpanel associated with the tab. */
66
- readonly controls: _angular_core.Signal<string | undefined>;
67
- constructor(inputs: TabInputs);
68
- }
69
- /** The required inputs for the tabpanel. */
70
- interface TabPanelInputs extends LabelControlOptionalInputs {
71
- id: SignalLike<string>;
72
- tab: SignalLike<TabPattern | undefined>;
73
- value: SignalLike<string>;
74
- }
75
- /** A tabpanel associated with a tab. */
76
- declare class TabPanelPattern {
77
- readonly inputs: TabPanelInputs;
78
- /** A global unique identifier for the tabpanel. */
79
- readonly id: SignalLike<string>;
80
- /** A local unique identifier for the tabpanel. */
81
- readonly value: SignalLike<string>;
82
- /** Controls label for this tabpanel. */
83
- readonly labelManager: LabelControl;
84
- /** Whether the tabpanel is hidden. */
85
- readonly hidden: _angular_core.Signal<boolean>;
86
- /** The tabindex of this tabpanel. */
87
- readonly tabindex: _angular_core.Signal<0 | -1>;
88
- /** The aria-labelledby value for this tabpanel. */
89
- readonly labelledBy: _angular_core.Signal<string | undefined>;
90
- constructor(inputs: TabPanelInputs);
91
- }
92
- /** The required inputs for the tablist. */
93
- type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> & Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;
94
- /** Controls the state of a tablist. */
95
- declare class TabListPattern {
96
- readonly inputs: TabListInputs;
97
- /** The list behavior for the tablist. */
98
- readonly listBehavior: List<TabPattern, string>;
99
- /** Controls expansion for the tablist. */
100
- readonly expansionManager: ListExpansion;
101
- /** Whether the tablist is vertically or horizontally oriented. */
102
- readonly orientation: SignalLike<'vertical' | 'horizontal'>;
103
- /** Whether the tablist is disabled. */
104
- readonly disabled: SignalLike<boolean>;
105
- /** The tabindex of the tablist. */
106
- readonly tabindex: _angular_core.Signal<0 | -1>;
107
- /** The id of the current active tab. */
108
- readonly activedescendant: _angular_core.Signal<string | undefined>;
109
- /** Whether selection should follow focus. */
110
- readonly followFocus: _angular_core.Signal<boolean>;
111
- /** The key used to navigate to the previous tab in the tablist. */
112
- readonly prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
113
- /** The key used to navigate to the next item in the list. */
114
- readonly nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
115
- /** The keydown event manager for the tablist. */
116
- readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
117
- /** The pointerdown event manager for the tablist. */
118
- readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
119
- constructor(inputs: TabListInputs);
120
- /**
121
- * Sets the tablist to its default initial state.
122
- *
123
- * Sets the active index of the tablist to the first focusable selected
124
- * tab if one exists. Otherwise, sets focus to the first focusable tab.
125
- *
126
- * This method should be called once the tablist and its tabs are properly initialized.
127
- */
128
- setDefaultState(): void;
129
- /** Handles keydown events for the tablist. */
130
- onKeydown(event: KeyboardEvent): void;
131
- /** The pointerdown event manager for the tablist. */
132
- onPointerdown(event: PointerEvent): void;
133
- /** Returns the tab item associated with the given pointer event. */
134
- private _getItem;
135
- }
136
-
137
- export { TabListPattern, TabPanelPattern, TabPattern };
138
- export type { TabInputs, TabListInputs, TabPanelInputs };
@@ -1,150 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { SignalLike } from './_list-navigation-chunk.js';
3
- import { ListItem, ListInputs, List } from './_list-chunk.js';
4
-
5
- /** Represents the required inputs for a toolbar widget in a toolbar. */
6
- interface ToolbarWidgetInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index'> {
7
- /** A reference to the parent toolbar. */
8
- toolbar: SignalLike<ToolbarPattern<V>>;
9
- }
10
- declare class ToolbarWidgetPattern<V> implements ListItem<V> {
11
- readonly inputs: ToolbarWidgetInputs<V>;
12
- /** A unique identifier for the widget. */
13
- readonly id: SignalLike<string>;
14
- /** The html element that should receive focus. */
15
- readonly element: SignalLike<HTMLElement>;
16
- /** Whether the widget is disabled. */
17
- readonly disabled: SignalLike<boolean>;
18
- /** A reference to the parent toolbar. */
19
- readonly toolbar: SignalLike<ToolbarPattern<V>>;
20
- /** The tabindex of the widgdet. */
21
- readonly tabindex: _angular_core.Signal<0 | -1>;
22
- /** The text used by the typeahead search. */
23
- readonly searchTerm: () => string;
24
- /** The value associated with the widget. */
25
- readonly value: () => V;
26
- /** The position of the widget within the toolbar. */
27
- readonly index: _angular_core.Signal<number>;
28
- /** Whether the widget is currently the active one (focused). */
29
- readonly active: _angular_core.Signal<boolean>;
30
- constructor(inputs: ToolbarWidgetInputs<V>);
31
- }
32
-
33
- /** An interface that allows sub patterns to expose the necessary controls for the toolbar. */
34
- interface ToolbarWidgetGroupControls {
35
- /** Whether the widget group is currently on the first item. */
36
- isOnFirstItem(): boolean;
37
- /** Whether the widget group is currently on the last item. */
38
- isOnLastItem(): boolean;
39
- /** Navigates to the next widget in the group. */
40
- next(wrap: boolean): void;
41
- /** Navigates to the previous widget in the group. */
42
- prev(wrap: boolean): void;
43
- /** Navigates to the first widget in the group. */
44
- first(): void;
45
- /** Navigates to the last widget in the group. */
46
- last(): void;
47
- /** Removes focus from the widget group. */
48
- unfocus(): void;
49
- /** Triggers the action of the currently active widget in the group. */
50
- trigger(): void;
51
- /** Navigates to the widget targeted by a pointer event. */
52
- goto(event: PointerEvent): void;
53
- /** Sets the widget group to its default initial state. */
54
- setDefaultState(): void;
55
- }
56
- /** Represents the required inputs for a toolbar widget group. */
57
- interface ToolbarWidgetGroupInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index'> {
58
- /** A reference to the parent toolbar. */
59
- toolbar: SignalLike<ToolbarPattern<V> | undefined>;
60
- /** The controls for the sub patterns associated with the toolbar. */
61
- controls: SignalLike<ToolbarWidgetGroupControls | undefined>;
62
- }
63
- /** A group of widgets within a toolbar that provides nested navigation. */
64
- declare class ToolbarWidgetGroupPattern<V> implements ListItem<V> {
65
- readonly inputs: ToolbarWidgetGroupInputs<V>;
66
- /** A unique identifier for the widget. */
67
- readonly id: SignalLike<string>;
68
- /** The html element that should receive focus. */
69
- readonly element: SignalLike<HTMLElement>;
70
- /** Whether the widget is disabled. */
71
- readonly disabled: SignalLike<boolean>;
72
- /** A reference to the parent toolbar. */
73
- readonly toolbar: SignalLike<ToolbarPattern<V> | undefined>;
74
- /** The text used by the typeahead search. */
75
- readonly searchTerm: () => string;
76
- /** The value associated with the widget. */
77
- readonly value: () => V;
78
- /** The position of the widget within the toolbar. */
79
- readonly index: _angular_core.Signal<number>;
80
- /** The actions that can be performed on the widget group. */
81
- readonly controls: SignalLike<ToolbarWidgetGroupControls>;
82
- /** Default toolbar widget group controls when no controls provided. */
83
- private readonly _defaultControls;
84
- constructor(inputs: ToolbarWidgetGroupInputs<V>);
85
- }
86
-
87
- /** Represents the required inputs for a toolbar. */
88
- type ToolbarInputs<V> = Omit<ListInputs<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>, 'multi' | 'typeaheadDelay' | 'value' | 'selectionMode' | 'focusMode'> & {
89
- /** A function that returns the toolbar item associated with a given element. */
90
- getItem: (e: Element) => ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V> | undefined;
91
- };
92
- /** Controls the state of a toolbar. */
93
- declare class ToolbarPattern<V> {
94
- readonly inputs: ToolbarInputs<V>;
95
- /** The list behavior for the toolbar. */
96
- readonly listBehavior: List<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>;
97
- /** Whether the tablist is vertically or horizontally oriented. */
98
- readonly orientation: SignalLike<'vertical' | 'horizontal'>;
99
- /** Whether disabled items in the group should be skipped when navigating. */
100
- readonly skipDisabled: SignalLike<boolean>;
101
- /** Whether the toolbar is disabled. */
102
- readonly disabled: _angular_core.Signal<boolean>;
103
- /** The tabindex of the toolbar (if using activedescendant). */
104
- readonly tabindex: _angular_core.Signal<0 | -1>;
105
- /** The id of the current active widget (if using activedescendant). */
106
- readonly activedescendant: _angular_core.Signal<string | undefined>;
107
- /** The key used to navigate to the previous widget. */
108
- private readonly _prevKey;
109
- /** The key used to navigate to the next widget. */
110
- private readonly _nextKey;
111
- /** The alternate key used to navigate to the previous widget. */
112
- private readonly _altPrevKey;
113
- /** The alternate key used to navigate to the next widget. */
114
- private readonly _altNextKey;
115
- /** The keydown event manager for the toolbar. */
116
- private readonly _keydown;
117
- /** The pointerdown event manager for the toolbar. */
118
- private readonly _pointerdown;
119
- /** Navigates to the next widget in the toolbar. */
120
- private _next;
121
- /** Navigates to the previous widget in the toolbar. */
122
- private _prev;
123
- private _groupNext;
124
- private _groupPrev;
125
- /** Triggers the action of the currently active widget. */
126
- private _trigger;
127
- /** Navigates to the first widget in the toolbar. */
128
- private _first;
129
- /** Navigates to the last widget in the toolbar. */
130
- private _last;
131
- /** Navigates to the widget targeted by a pointer event. */
132
- private _goto;
133
- constructor(inputs: ToolbarInputs<V>);
134
- /** Handles keydown events for the toolbar. */
135
- onKeydown(event: KeyboardEvent): void;
136
- /** Handles pointerdown events for the toolbar. */
137
- onPointerdown(event: PointerEvent): void;
138
- /**
139
- * Sets the toolbar to its default initial state.
140
- *
141
- * Sets the active index to the selected widget if one exists and is focusable.
142
- * Otherwise, sets the active index to the first focusable widget.
143
- */
144
- setDefaultState(): void;
145
- /** Validates the state of the toolbar and returns a list of accessibility violations. */
146
- validate(): string[];
147
- }
148
-
149
- export { ToolbarPattern, ToolbarWidgetGroupPattern, ToolbarWidgetPattern };
150
- export type { ToolbarInputs, ToolbarWidgetGroupControls, ToolbarWidgetGroupInputs, ToolbarWidgetInputs };
@@ -1,139 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { SignalLike } from './_list-navigation-chunk.js';
3
- import { ListItem, ListInputs, List } from './_list-chunk.js';
4
- import { ExpansionItem, ListExpansion, ExpansionControl } from './_expansion-chunk.js';
5
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.js';
6
-
7
- /** Represents the required inputs for a tree item. */
8
- interface TreeItemInputs<V> extends Omit<ListItem<V>, 'index'> {
9
- /** The parent item. */
10
- parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;
11
- /** Whether this item has children. Children can be lazily loaded. */
12
- hasChildren: SignalLike<boolean>;
13
- /** The children items. */
14
- children: SignalLike<TreeItemPattern<V>[]>;
15
- /** The tree pattern this item belongs to. */
16
- tree: SignalLike<TreePattern<V>>;
17
- }
18
- interface TreeItemPattern<V> extends TreeItemInputs<V> {
19
- }
20
- /**
21
- * Represents an item in a Tree.
22
- */
23
- declare class TreeItemPattern<V> implements ExpansionItem {
24
- readonly inputs: TreeItemInputs<V>;
25
- /** The position of this item among its siblings. */
26
- readonly index: _angular_core.Signal<number>;
27
- /** The unique identifier used by the expansion behavior. */
28
- readonly expansionId: SignalLike<string>;
29
- /** Controls expansion for child items. */
30
- readonly expansionManager: ListExpansion;
31
- /** Controls expansion for this item. */
32
- readonly expansion: ExpansionControl;
33
- /** Whether the item is expandable. It's expandable if children item exist. */
34
- readonly expandable: SignalLike<boolean>;
35
- /** The level of the current item in a tree. */
36
- readonly level: SignalLike<number>;
37
- /** Whether this item is currently expanded. */
38
- readonly expanded: _angular_core.Signal<boolean>;
39
- /** Whether this item is visible. */
40
- readonly visible: _angular_core.Signal<boolean>;
41
- /** The number of items under the same parent at the same level. */
42
- readonly setsize: _angular_core.Signal<number>;
43
- /** The position of this item among its siblings (1-based). */
44
- readonly posinset: _angular_core.Signal<number>;
45
- /** Whether the item is active. */
46
- readonly active: _angular_core.Signal<boolean>;
47
- /** The tabindex of the item. */
48
- readonly tabindex: _angular_core.Signal<0 | -1>;
49
- /** Whether the item is selected. */
50
- readonly selected: _angular_core.Signal<boolean | undefined>;
51
- /** The current type of this item. */
52
- readonly current: _angular_core.Signal<"page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined>;
53
- constructor(inputs: TreeItemInputs<V>);
54
- }
55
- /** The selection operations that the tree can perform. */
56
- interface SelectOptions {
57
- toggle?: boolean;
58
- selectOne?: boolean;
59
- selectRange?: boolean;
60
- anchor?: boolean;
61
- }
62
- /** Represents the required inputs for a tree. */
63
- interface TreeInputs<V> extends Omit<ListInputs<TreeItemPattern<V>, V>, 'items'> {
64
- /** A unique identifier for the tree. */
65
- id: SignalLike<string>;
66
- /** All items in the tree, in document order (DFS-like, a flattened list). */
67
- allItems: SignalLike<TreeItemPattern<V>[]>;
68
- /** Whether the tree is in navigation mode. */
69
- nav: SignalLike<boolean>;
70
- /** The aria-current type. */
71
- currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;
72
- }
73
- interface TreePattern<V> extends TreeInputs<V> {
74
- }
75
- /** Controls the state and interactions of a tree view. */
76
- declare class TreePattern<V> {
77
- readonly inputs: TreeInputs<V>;
78
- /** The list behavior for the tree. */
79
- readonly listBehavior: List<TreeItemPattern<V>, V>;
80
- /** Controls expansion for direct children of the tree root (top-level items). */
81
- readonly expansionManager: ListExpansion;
82
- /** The root level is 0. */
83
- readonly level: () => number;
84
- /** The root is always expanded. */
85
- readonly expanded: () => boolean;
86
- /** The tabindex of the tree. */
87
- tabindex: SignalLike<-1 | 0>;
88
- /** The id of the current active item. */
89
- readonly activedescendant: _angular_core.Signal<string | undefined>;
90
- /** The direct children of the root (top-level tree items). */
91
- readonly children: _angular_core.Signal<TreeItemPattern<V>[]>;
92
- /** All currently visible tree items. An item is visible if their parent is expanded. */
93
- readonly visibleItems: _angular_core.Signal<TreeItemPattern<V>[]>;
94
- /** Whether the tree selection follows focus. */
95
- readonly followFocus: _angular_core.Signal<boolean>;
96
- /** The key for navigating to the previous item. */
97
- readonly prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
98
- /** The key for navigating to the next item. */
99
- readonly nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
100
- /** The key for collapsing an item or moving to its parent. */
101
- readonly collapseKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
102
- /** The key for expanding an item or moving to its first child. */
103
- readonly expandKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
104
- /** Represents the space key. Does nothing when the user is actively using typeahead. */
105
- readonly dynamicSpaceKey: _angular_core.Signal<"" | " ">;
106
- /** Regular expression to match characters for typeahead. */
107
- readonly typeaheadRegexp: RegExp;
108
- /** The keydown event manager for the tree. */
109
- readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
110
- /** The pointerdown event manager for the tree. */
111
- pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
112
- constructor(inputs: TreeInputs<V>);
113
- /**
114
- * Sets the tree to it's default initial state.
115
- *
116
- * Sets the active index of the tree to the first focusable selected tree item if one exists.
117
- * Otherwise, sets focus to the first focusable tree item.
118
- */
119
- setDefaultState(): void;
120
- /** Handles keydown events on the tree. */
121
- onKeydown(event: KeyboardEvent): void;
122
- /** Handles pointerdown events on the tree. */
123
- onPointerdown(event: PointerEvent): void;
124
- /** Navigates to the given tree item in the tree. */
125
- goto(e: PointerEvent, opts?: SelectOptions): void;
126
- /** Toggles to expand or collapse a tree item. */
127
- toggleExpansion(item?: TreeItemPattern<V>): void;
128
- /** Expands a tree item. */
129
- expand(opts?: SelectOptions): void;
130
- /** Expands all sibling tree items including itself. */
131
- expandSiblings(item?: TreeItemPattern<V>): void;
132
- /** Collapses a tree item. */
133
- collapse(opts?: SelectOptions): void;
134
- /** Retrieves the TreeItemPattern associated with a DOM event, if any. */
135
- protected _getItem(event: Event): TreeItemPattern<V> | undefined;
136
- }
137
-
138
- export { TreeItemPattern, TreePattern };
139
- export type { TreeInputs, TreeItemInputs };