@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,273 +0,0 @@
1
- import { computed, signal } from '@angular/core';
2
- import { List } from './_list-chunk.mjs';
3
- import { PointerEventManager, KeyboardEventManager } from './_pointer-event-manager-chunk.mjs';
4
-
5
- class ToolbarWidgetPattern {
6
- inputs;
7
- /** A unique identifier for the widget. */
8
- id;
9
- /** The html element that should receive focus. */
10
- element;
11
- /** Whether the widget is disabled. */
12
- disabled;
13
- /** A reference to the parent toolbar. */
14
- toolbar;
15
- /** The tabindex of the widgdet. */
16
- tabindex = computed(() => this.toolbar().listBehavior.getItemTabindex(this));
17
- /** The text used by the typeahead search. */
18
- searchTerm = () => ''; // Unused because toolbar does not support typeahead.
19
- /** The value associated with the widget. */
20
- value = () => ''; // Unused because toolbar does not support selection.
21
- /** The position of the widget within the toolbar. */
22
- index = computed(() => this.toolbar().inputs.items().indexOf(this) ?? -1);
23
- /** Whether the widget is currently the active one (focused). */
24
- active = computed(() => this.toolbar().inputs.activeItem() === this);
25
- constructor(inputs) {
26
- this.inputs = inputs;
27
- this.id = inputs.id;
28
- this.element = inputs.element;
29
- this.disabled = inputs.disabled;
30
- this.toolbar = inputs.toolbar;
31
- }
32
- }
33
-
34
- /** A group of widgets within a toolbar that provides nested navigation. */
35
- class ToolbarWidgetGroupPattern {
36
- inputs;
37
- /** A unique identifier for the widget. */
38
- id;
39
- /** The html element that should receive focus. */
40
- element;
41
- /** Whether the widget is disabled. */
42
- disabled;
43
- /** A reference to the parent toolbar. */
44
- toolbar;
45
- /** The text used by the typeahead search. */
46
- searchTerm = () => ''; // Unused because toolbar does not support typeahead.
47
- /** The value associated with the widget. */
48
- value = () => ''; // Unused because toolbar does not support selection.
49
- /** The position of the widget within the toolbar. */
50
- index = computed(() => this.toolbar()?.inputs.items().indexOf(this) ?? -1);
51
- /** The actions that can be performed on the widget group. */
52
- controls = computed(() => this.inputs.controls() ?? this._defaultControls);
53
- /** Default toolbar widget group controls when no controls provided. */
54
- _defaultControls = {
55
- isOnFirstItem: () => true,
56
- isOnLastItem: () => true,
57
- next: () => { },
58
- prev: () => { },
59
- first: () => { },
60
- last: () => { },
61
- unfocus: () => { },
62
- trigger: () => { },
63
- goto: () => { },
64
- setDefaultState: () => { },
65
- };
66
- constructor(inputs) {
67
- this.inputs = inputs;
68
- this.id = inputs.id;
69
- this.element = inputs.element;
70
- this.disabled = inputs.disabled;
71
- this.toolbar = inputs.toolbar;
72
- }
73
- }
74
-
75
- /** Controls the state of a toolbar. */
76
- class ToolbarPattern {
77
- inputs;
78
- /** The list behavior for the toolbar. */
79
- listBehavior;
80
- /** Whether the tablist is vertically or horizontally oriented. */
81
- orientation;
82
- /** Whether disabled items in the group should be skipped when navigating. */
83
- skipDisabled;
84
- /** Whether the toolbar is disabled. */
85
- disabled = computed(() => this.listBehavior.disabled());
86
- /** The tabindex of the toolbar (if using activedescendant). */
87
- tabindex = computed(() => this.listBehavior.tabindex());
88
- /** The id of the current active widget (if using activedescendant). */
89
- activedescendant = computed(() => this.listBehavior.activedescendant());
90
- /** The key used to navigate to the previous widget. */
91
- _prevKey = computed(() => {
92
- if (this.inputs.orientation() === 'vertical') {
93
- return 'ArrowUp';
94
- }
95
- return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
96
- });
97
- /** The key used to navigate to the next widget. */
98
- _nextKey = computed(() => {
99
- if (this.inputs.orientation() === 'vertical') {
100
- return 'ArrowDown';
101
- }
102
- return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
103
- });
104
- /** The alternate key used to navigate to the previous widget. */
105
- _altPrevKey = computed(() => {
106
- if (this.inputs.orientation() === 'vertical') {
107
- return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
108
- }
109
- return 'ArrowUp';
110
- });
111
- /** The alternate key used to navigate to the next widget. */
112
- _altNextKey = computed(() => {
113
- if (this.inputs.orientation() === 'vertical') {
114
- return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
115
- }
116
- return 'ArrowDown';
117
- });
118
- /** The keydown event manager for the toolbar. */
119
- _keydown = computed(() => {
120
- const manager = new KeyboardEventManager();
121
- return manager
122
- .on(this._nextKey, () => this._next())
123
- .on(this._prevKey, () => this._prev())
124
- .on(this._altNextKey, () => this._groupNext())
125
- .on(this._altPrevKey, () => this._groupPrev())
126
- .on(' ', () => this._trigger())
127
- .on('Enter', () => this._trigger())
128
- .on('Home', () => this._first())
129
- .on('End', () => this._last());
130
- });
131
- /** The pointerdown event manager for the toolbar. */
132
- _pointerdown = computed(() => new PointerEventManager().on(e => this._goto(e)));
133
- /** Navigates to the next widget in the toolbar. */
134
- _next() {
135
- const item = this.inputs.activeItem();
136
- if (item instanceof ToolbarWidgetGroupPattern) {
137
- if (!item.disabled() && !item.controls().isOnLastItem()) {
138
- item.controls().next(false);
139
- return;
140
- }
141
- item.controls().unfocus();
142
- }
143
- this.listBehavior.next();
144
- const newItem = this.inputs.activeItem();
145
- if (newItem instanceof ToolbarWidgetGroupPattern) {
146
- newItem.controls().first();
147
- }
148
- }
149
- /** Navigates to the previous widget in the toolbar. */
150
- _prev() {
151
- const item = this.inputs.activeItem();
152
- if (item instanceof ToolbarWidgetGroupPattern) {
153
- if (!item.disabled() && !item.controls().isOnFirstItem()) {
154
- item.controls().prev(false);
155
- return;
156
- }
157
- item.controls().unfocus();
158
- }
159
- this.listBehavior.prev();
160
- const newItem = this.inputs.activeItem();
161
- if (newItem instanceof ToolbarWidgetGroupPattern) {
162
- newItem.controls().last();
163
- }
164
- }
165
- _groupNext() {
166
- const item = this.inputs.activeItem();
167
- if (item instanceof ToolbarWidgetPattern)
168
- return;
169
- item?.controls().next(true);
170
- }
171
- _groupPrev() {
172
- const item = this.inputs.activeItem();
173
- if (item instanceof ToolbarWidgetPattern)
174
- return;
175
- item?.controls().prev(true);
176
- }
177
- /** Triggers the action of the currently active widget. */
178
- _trigger() {
179
- const item = this.inputs.activeItem();
180
- if (item instanceof ToolbarWidgetGroupPattern) {
181
- item.controls().trigger();
182
- }
183
- }
184
- /** Navigates to the first widget in the toolbar. */
185
- _first() {
186
- const item = this.inputs.activeItem();
187
- if (item instanceof ToolbarWidgetGroupPattern) {
188
- item.controls().unfocus();
189
- }
190
- this.listBehavior.first();
191
- const newItem = this.inputs.activeItem();
192
- if (newItem instanceof ToolbarWidgetGroupPattern) {
193
- newItem.controls().first();
194
- }
195
- }
196
- /** Navigates to the last widget in the toolbar. */
197
- _last() {
198
- const item = this.inputs.activeItem();
199
- if (item instanceof ToolbarWidgetGroupPattern) {
200
- item.controls().unfocus();
201
- }
202
- this.listBehavior.last();
203
- const newItem = this.inputs.activeItem();
204
- if (newItem instanceof ToolbarWidgetGroupPattern) {
205
- newItem.controls().last();
206
- }
207
- }
208
- /** Navigates to the widget targeted by a pointer event. */
209
- _goto(e) {
210
- const item = this.inputs.getItem(e.target);
211
- if (!item)
212
- return;
213
- this.listBehavior.goto(item);
214
- if (item instanceof ToolbarWidgetGroupPattern) {
215
- item.controls().goto(e);
216
- }
217
- }
218
- constructor(inputs) {
219
- this.inputs = inputs;
220
- this.orientation = inputs.orientation;
221
- this.skipDisabled = inputs.skipDisabled;
222
- this.listBehavior = new List({
223
- ...inputs,
224
- multi: () => false,
225
- focusMode: () => 'roving',
226
- selectionMode: () => 'explicit',
227
- value: signal([]),
228
- typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.
229
- });
230
- }
231
- /** Handles keydown events for the toolbar. */
232
- onKeydown(event) {
233
- if (this.disabled())
234
- return;
235
- this._keydown().handle(event);
236
- }
237
- /** Handles pointerdown events for the toolbar. */
238
- onPointerdown(event) {
239
- if (this.disabled())
240
- return;
241
- this._pointerdown().handle(event);
242
- }
243
- /**
244
- * Sets the toolbar to its default initial state.
245
- *
246
- * Sets the active index to the selected widget if one exists and is focusable.
247
- * Otherwise, sets the active index to the first focusable widget.
248
- */
249
- setDefaultState() {
250
- let firstItem = null;
251
- for (const item of this.inputs.items()) {
252
- if (this.listBehavior.isFocusable(item)) {
253
- if (!firstItem) {
254
- firstItem = item;
255
- }
256
- }
257
- }
258
- if (firstItem) {
259
- this.inputs.activeItem.set(firstItem);
260
- }
261
- if (firstItem instanceof ToolbarWidgetGroupPattern) {
262
- firstItem.controls().setDefaultState();
263
- }
264
- }
265
- /** Validates the state of the toolbar and returns a list of accessibility violations. */
266
- validate() {
267
- const violations = [];
268
- return violations;
269
- }
270
- }
271
-
272
- export { ToolbarPattern, ToolbarWidgetGroupPattern, ToolbarWidgetPattern };
273
- //# sourceMappingURL=_toolbar-chunk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_toolbar-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/toolbar/toolbar-widget.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/toolbar/toolbar-widget-group.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/toolbar/toolbar.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\nimport type {ToolbarPattern} from './toolbar';\n\n/** Represents the required inputs for a toolbar widget in a toolbar. */\nexport interface ToolbarWidgetInputs<V>\n extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index'> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V>>;\n}\n\nexport class ToolbarWidgetPattern<V> implements ListItem<V> {\n /** A unique identifier for the widget. */\n readonly id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** Whether the widget is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** A reference to the parent toolbar. */\n readonly toolbar: SignalLike<ToolbarPattern<V>>;\n\n /** The tabindex of the widgdet. */\n readonly tabindex = computed(() => this.toolbar().listBehavior.getItemTabindex(this));\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => '' as V; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n readonly index = computed(() => this.toolbar().inputs.items().indexOf(this) ?? -1);\n\n /** Whether the widget is currently the active one (focused). */\n readonly active = computed(() => this.toolbar().inputs.activeItem() === this);\n\n constructor(readonly inputs: ToolbarWidgetInputs<V>) {\n this.id = inputs.id;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n this.toolbar = inputs.toolbar;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\nimport type {ToolbarPattern} from './toolbar';\n\n/** An interface that allows sub patterns to expose the necessary controls for the toolbar. */\nexport interface ToolbarWidgetGroupControls {\n /** Whether the widget group is currently on the first item. */\n isOnFirstItem(): boolean;\n\n /** Whether the widget group is currently on the last item. */\n isOnLastItem(): boolean;\n\n /** Navigates to the next widget in the group. */\n next(wrap: boolean): void;\n\n /** Navigates to the previous widget in the group. */\n prev(wrap: boolean): void;\n\n /** Navigates to the first widget in the group. */\n first(): void;\n\n /** Navigates to the last widget in the group. */\n last(): void;\n\n /** Removes focus from the widget group. */\n unfocus(): void;\n\n /** Triggers the action of the currently active widget in the group. */\n trigger(): void;\n\n /** Navigates to the widget targeted by a pointer event. */\n goto(event: PointerEvent): void;\n\n /** Sets the widget group to its default initial state. */\n setDefaultState(): void;\n}\n\n/** Represents the required inputs for a toolbar widget group. */\nexport interface ToolbarWidgetGroupInputs<V>\n extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index'> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V> | undefined>;\n\n /** The controls for the sub patterns associated with the toolbar. */\n controls: SignalLike<ToolbarWidgetGroupControls | undefined>;\n}\n\n/** A group of widgets within a toolbar that provides nested navigation. */\nexport class ToolbarWidgetGroupPattern<V> implements ListItem<V> {\n /** A unique identifier for the widget. */\n readonly id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** Whether the widget is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** A reference to the parent toolbar. */\n readonly toolbar: SignalLike<ToolbarPattern<V> | undefined>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => '' as V; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n readonly index = computed(() => this.toolbar()?.inputs.items().indexOf(this) ?? -1);\n\n /** The actions that can be performed on the widget group. */\n readonly controls: SignalLike<ToolbarWidgetGroupControls> = computed(\n () => this.inputs.controls() ?? this._defaultControls,\n );\n\n /** Default toolbar widget group controls when no controls provided. */\n private readonly _defaultControls: ToolbarWidgetGroupControls = {\n isOnFirstItem: () => true,\n isOnLastItem: () => true,\n next: () => {},\n prev: () => {},\n first: () => {},\n last: () => {},\n unfocus: () => {},\n trigger: () => {},\n goto: () => {},\n setDefaultState: () => {},\n };\n\n constructor(readonly inputs: ToolbarWidgetGroupInputs<V>) {\n this.id = inputs.id;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n this.toolbar = inputs.toolbar;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {ToolbarWidgetPattern} from './toolbar-widget';\nimport {ToolbarWidgetGroupPattern} from './toolbar-widget-group';\n\n/** Represents the required inputs for a toolbar. */\nexport type ToolbarInputs<V> = Omit<\n ListInputs<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>,\n 'multi' | 'typeaheadDelay' | 'value' | 'selectionMode' | 'focusMode'\n> & {\n /** A function that returns the toolbar item associated with a given element. */\n getItem: (e: Element) => ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V> | undefined;\n};\n\n/** Controls the state of a toolbar. */\nexport class ToolbarPattern<V> {\n /** The list behavior for the toolbar. */\n readonly listBehavior: List<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether disabled items in the group should be skipped when navigating. */\n readonly skipDisabled: SignalLike<boolean>;\n\n /** Whether the toolbar is disabled. */\n readonly disabled = computed(() => this.listBehavior.disabled());\n\n /** The tabindex of the toolbar (if using activedescendant). */\n readonly tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active widget (if using activedescendant). */\n readonly activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous widget. */\n private readonly _prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next widget. */\n private readonly _nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The alternate key used to navigate to the previous widget. */\n private readonly _altPrevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n }\n return 'ArrowUp';\n });\n\n /** The alternate key used to navigate to the next widget. */\n private readonly _altNextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n }\n return 'ArrowDown';\n });\n\n /** The keydown event manager for the toolbar. */\n private readonly _keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n return manager\n .on(this._nextKey, () => this._next())\n .on(this._prevKey, () => this._prev())\n .on(this._altNextKey, () => this._groupNext())\n .on(this._altPrevKey, () => this._groupPrev())\n .on(' ', () => this._trigger())\n .on('Enter', () => this._trigger())\n .on('Home', () => this._first())\n .on('End', () => this._last());\n });\n\n /** The pointerdown event manager for the toolbar. */\n private readonly _pointerdown = computed(() => new PointerEventManager().on(e => this._goto(e)));\n\n /** Navigates to the next widget in the toolbar. */\n private _next() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetGroupPattern) {\n if (!item.disabled() && !item.controls().isOnLastItem()) {\n item.controls().next(false);\n return;\n }\n item.controls().unfocus();\n }\n\n this.listBehavior.next();\n const newItem = this.inputs.activeItem();\n if (newItem instanceof ToolbarWidgetGroupPattern) {\n newItem.controls().first();\n }\n }\n\n /** Navigates to the previous widget in the toolbar. */\n private _prev() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetGroupPattern) {\n if (!item.disabled() && !item.controls().isOnFirstItem()) {\n item.controls().prev(false);\n return;\n }\n item.controls().unfocus();\n }\n\n this.listBehavior.prev();\n const newItem = this.inputs.activeItem();\n if (newItem instanceof ToolbarWidgetGroupPattern) {\n newItem.controls().last();\n }\n }\n\n private _groupNext() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetPattern) return;\n item?.controls().next(true);\n }\n\n private _groupPrev() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetPattern) return;\n item?.controls().prev(true);\n }\n\n /** Triggers the action of the currently active widget. */\n private _trigger() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetGroupPattern) {\n item.controls().trigger();\n }\n }\n\n /** Navigates to the first widget in the toolbar. */\n private _first() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetGroupPattern) {\n item.controls().unfocus();\n }\n\n this.listBehavior.first();\n const newItem = this.inputs.activeItem();\n if (newItem instanceof ToolbarWidgetGroupPattern) {\n newItem.controls().first();\n }\n }\n\n /** Navigates to the last widget in the toolbar. */\n private _last() {\n const item = this.inputs.activeItem();\n if (item instanceof ToolbarWidgetGroupPattern) {\n item.controls().unfocus();\n }\n\n this.listBehavior.last();\n const newItem = this.inputs.activeItem();\n if (newItem instanceof ToolbarWidgetGroupPattern) {\n newItem.controls().last();\n }\n }\n\n /** Navigates to the widget targeted by a pointer event. */\n private _goto(e: PointerEvent) {\n const item = this.inputs.getItem(e.target as Element);\n if (!item) return;\n\n this.listBehavior.goto(item);\n if (item instanceof ToolbarWidgetGroupPattern) {\n item.controls().goto(e);\n }\n }\n\n constructor(readonly inputs: ToolbarInputs<V>) {\n this.orientation = inputs.orientation;\n this.skipDisabled = inputs.skipDisabled;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n focusMode: () => 'roving',\n selectionMode: () => 'explicit',\n value: signal([] as V[]),\n typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.\n });\n }\n\n /** Handles keydown events for the toolbar. */\n onKeydown(event: KeyboardEvent) {\n if (this.disabled()) return;\n this._keydown().handle(event);\n }\n\n /** Handles pointerdown events for the toolbar. */\n onPointerdown(event: PointerEvent) {\n if (this.disabled()) return;\n this._pointerdown().handle(event);\n }\n\n /**\n * Sets the toolbar to its default initial state.\n *\n * Sets the active index to the selected widget if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable widget.\n */\n setDefaultState() {\n let firstItem: ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n if (firstItem instanceof ToolbarWidgetGroupPattern) {\n firstItem.controls().setDefaultState();\n }\n }\n\n /** Validates the state of the toolbar and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n return violations;\n }\n}\n"],"names":[],"mappings":";;;;MAoBa,oBAAoB,CAAA;AA4BV,IAAA,MAAA;;AA1BZ,IAAA,EAAE;;AAGF,IAAA,OAAO;;AAGP,IAAA,QAAQ;;AAGR,IAAA,OAAO;;AAGP,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;AAG5E,IAAA,UAAU,GAAG,MAAM,EAAE,CAAC;;AAGtB,IAAA,KAAK,GAAG,MAAM,EAAO,CAAC;;IAGtB,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;AAGzE,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC;AAE7E,IAAA,WAAA,CAAqB,MAA8B,EAAA;QAA9B,IAAM,CAAA,MAAA,GAAN,MAAM;AACzB,QAAA,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;AACnB,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAC7B,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;;AAEhC;;ACED;MACa,yBAAyB,CAAA;AAyCf,IAAA,MAAA;;AAvCZ,IAAA,EAAE;;AAGF,IAAA,OAAO;;AAGP,IAAA,QAAQ;;AAGR,IAAA,OAAO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AAU;;AAEpB;;;;"}
@@ -1,222 +0,0 @@
1
- import { signal, computed } from '@angular/core';
2
- import { List } from './_list-chunk.mjs';
3
- import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.mjs';
4
-
5
- /** Controls the state of a radio group. */
6
- class RadioGroupPattern {
7
- inputs;
8
- /** The list behavior for the radio group. */
9
- listBehavior;
10
- /** Whether the radio group is vertically or horizontally oriented. */
11
- orientation;
12
- /** Whether focus should wrap when navigating. */
13
- wrap = signal(false);
14
- /** The selection strategy used by the radio group. */
15
- selectionMode = signal('follow');
16
- /** Whether the radio group is disabled. */
17
- disabled = computed(() => this.inputs.disabled() || this.listBehavior.disabled());
18
- /** The currently selected radio button. */
19
- selectedItem = computed(() => this.listBehavior.selectionBehavior.selectedItems()[0]);
20
- /** Whether the radio group is readonly. */
21
- readonly = computed(() => this.selectedItem()?.disabled() || this.inputs.readonly());
22
- /** The tabindex of the radio group. */
23
- tabindex = computed(() => this.listBehavior.tabindex());
24
- /** The id of the current active radio button (if using activedescendant). */
25
- activedescendant = computed(() => this.listBehavior.activedescendant());
26
- /** The key used to navigate to the previous radio button. */
27
- _prevKey = computed(() => {
28
- if (this.inputs.orientation() === 'vertical') {
29
- return 'ArrowUp';
30
- }
31
- return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
32
- });
33
- /** The key used to navigate to the next radio button. */
34
- _nextKey = computed(() => {
35
- if (this.inputs.orientation() === 'vertical') {
36
- return 'ArrowDown';
37
- }
38
- return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
39
- });
40
- /** The keydown event manager for the radio group. */
41
- keydown = computed(() => {
42
- const manager = new KeyboardEventManager();
43
- // Readonly mode allows navigation but not selection changes.
44
- if (this.readonly()) {
45
- return manager
46
- .on(this._prevKey, () => this.listBehavior.prev())
47
- .on(this._nextKey, () => this.listBehavior.next())
48
- .on('Home', () => this.listBehavior.first())
49
- .on('End', () => this.listBehavior.last());
50
- }
51
- // Default behavior: navigate and select on arrow keys, home, end.
52
- // Space/Enter also select the focused item.
53
- return manager
54
- .on(this._prevKey, () => this.listBehavior.prev({ selectOne: true }))
55
- .on(this._nextKey, () => this.listBehavior.next({ selectOne: true }))
56
- .on('Home', () => this.listBehavior.first({ selectOne: true }))
57
- .on('End', () => this.listBehavior.last({ selectOne: true }))
58
- .on(' ', () => this.listBehavior.selectOne())
59
- .on('Enter', () => this.listBehavior.selectOne());
60
- });
61
- /** The pointerdown event manager for the radio group. */
62
- pointerdown = computed(() => {
63
- const manager = new PointerEventManager();
64
- if (this.readonly()) {
65
- // Navigate focus only in readonly mode.
66
- return manager.on(e => this.listBehavior.goto(this.inputs.getItem(e)));
67
- }
68
- // Default behavior: navigate and select on click.
69
- return manager.on(e => this.listBehavior.goto(this.inputs.getItem(e), { selectOne: true }));
70
- });
71
- constructor(inputs) {
72
- this.inputs = inputs;
73
- this.orientation = inputs.orientation;
74
- this.listBehavior = new List({
75
- ...inputs,
76
- wrap: this.wrap,
77
- selectionMode: this.selectionMode,
78
- multi: () => false,
79
- typeaheadDelay: () => 0, // Radio groups do not support typeahead.
80
- });
81
- }
82
- /** Handles keydown events for the radio group. */
83
- onKeydown(event) {
84
- if (!this.disabled()) {
85
- this.keydown().handle(event);
86
- }
87
- }
88
- /** Handles pointerdown events for the radio group. */
89
- onPointerdown(event) {
90
- if (!this.disabled()) {
91
- this.pointerdown().handle(event);
92
- }
93
- }
94
- /**
95
- * Sets the radio group to its default initial state.
96
- *
97
- * Sets the active index to the selected radio button if one exists and is focusable.
98
- * Otherwise, sets the active index to the first focusable radio button.
99
- */
100
- setDefaultState() {
101
- let firstItem = null;
102
- for (const item of this.inputs.items()) {
103
- if (this.listBehavior.isFocusable(item)) {
104
- if (!firstItem) {
105
- firstItem = item;
106
- }
107
- if (item.selected()) {
108
- this.inputs.activeItem.set(item);
109
- return;
110
- }
111
- }
112
- }
113
- if (firstItem) {
114
- this.inputs.activeItem.set(firstItem);
115
- }
116
- }
117
- /** Validates the state of the radio group and returns a list of accessibility violations. */
118
- validate() {
119
- const violations = [];
120
- if (this.selectedItem()?.disabled() && this.inputs.skipDisabled()) {
121
- violations.push("Accessibility Violation: The selected radio button is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.");
122
- }
123
- return violations;
124
- }
125
- }
126
-
127
- /** Represents a radio button within a radio group. */
128
- class RadioButtonPattern {
129
- inputs;
130
- /** A unique identifier for the radio button. */
131
- id;
132
- /** The value associated with the radio button. */
133
- value;
134
- /** The position of the radio button within the group. */
135
- index = computed(() => this.group()?.listBehavior.inputs.items().indexOf(this) ?? -1);
136
- /** Whether the radio button is currently the active one (focused). */
137
- active = computed(() => this.group()?.listBehavior.inputs.activeItem() === this);
138
- /** Whether the radio button is selected. */
139
- selected = computed(() => !!this.group()?.listBehavior.inputs.value().includes(this.value()));
140
- /** Whether the radio button is disabled. */
141
- disabled;
142
- /** A reference to the parent radio group. */
143
- group;
144
- /** The tabindex of the radio button. */
145
- tabindex = computed(() => this.group()?.listBehavior.getItemTabindex(this));
146
- /** The HTML element associated with the radio button. */
147
- element;
148
- /** The search term for typeahead. */
149
- searchTerm = () => ''; // Radio groups do not support typeahead.
150
- constructor(inputs) {
151
- this.inputs = inputs;
152
- this.id = inputs.id;
153
- this.value = inputs.value;
154
- this.group = inputs.group;
155
- this.element = inputs.element;
156
- this.disabled = inputs.disabled;
157
- }
158
- }
159
-
160
- /** Controls the state of a radio group in a toolbar. */
161
- class ToolbarRadioGroupPattern extends RadioGroupPattern {
162
- inputs;
163
- constructor(inputs) {
164
- if (!!inputs.toolbar()) {
165
- inputs.orientation = inputs.toolbar().orientation;
166
- inputs.skipDisabled = inputs.toolbar().skipDisabled;
167
- }
168
- super(inputs);
169
- this.inputs = inputs;
170
- }
171
- /** Noop. The toolbar handles keydown events. */
172
- onKeydown(_) { }
173
- /** Noop. The toolbar handles pointerdown events. */
174
- onPointerdown(_) { }
175
- /** Whether the radio group is currently on the first item. */
176
- isOnFirstItem() {
177
- return this.listBehavior.navigationBehavior.peekPrev() === undefined;
178
- }
179
- /** Whether the radio group is currently on the last item. */
180
- isOnLastItem() {
181
- return this.listBehavior.navigationBehavior.peekNext() === undefined;
182
- }
183
- /** Navigates to the next radio button in the group. */
184
- next(wrap) {
185
- this.wrap.set(wrap);
186
- this.listBehavior.next();
187
- this.wrap.set(false);
188
- }
189
- /** Navigates to the previous radio button in the group. */
190
- prev(wrap) {
191
- this.wrap.set(wrap);
192
- this.listBehavior.prev();
193
- this.wrap.set(false);
194
- }
195
- /** Navigates to the first radio button in the group. */
196
- first() {
197
- this.listBehavior.first();
198
- }
199
- /** Navigates to the last radio button in the group. */
200
- last() {
201
- this.listBehavior.last();
202
- }
203
- /** Removes focus from the radio group. */
204
- unfocus() {
205
- this.inputs.activeItem.set(undefined);
206
- }
207
- /** Triggers the action of the currently active radio button in the group. */
208
- trigger() {
209
- if (this.readonly())
210
- return;
211
- this.listBehavior.selectOne();
212
- }
213
- /** Navigates to the radio button targeted by a pointer event. */
214
- goto(e) {
215
- this.listBehavior.goto(this.inputs.getItem(e), {
216
- selectOne: !this.readonly(),
217
- });
218
- }
219
- }
220
-
221
- export { RadioButtonPattern, RadioGroupPattern, ToolbarRadioGroupPattern };
222
- //# sourceMappingURL=_toolbar-radio-group-chunk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_toolbar-radio-group-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-group.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-button.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/toolbar-radio-group.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioButtonPattern} from './radio-button';\n\n/** Represents the required inputs for a radio group. */\nexport type RadioGroupInputs<V> = Omit<\n ListInputs<RadioButtonPattern<V>, V>,\n 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'\n> & {\n /** Whether the radio group is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the radio group is readonly. */\n readonly: SignalLike<boolean>;\n\n /** A function that returns the radio button associated with a given element. */\n getItem: (e: PointerEvent) => RadioButtonPattern<V> | undefined;\n};\n\n/** Controls the state of a radio group. */\nexport class RadioGroupPattern<V> {\n /** The list behavior for the radio group. */\n readonly listBehavior: List<RadioButtonPattern<V>, V>;\n\n /** Whether the radio group is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = signal(false);\n\n /** The selection strategy used by the radio group. */\n readonly selectionMode = signal<'follow' | 'explicit'>('follow');\n\n /** Whether the radio group is disabled. */\n readonly disabled = computed(() => this.inputs.disabled() || this.listBehavior.disabled());\n\n /** The currently selected radio button. */\n readonly selectedItem = computed(() => this.listBehavior.selectionBehavior.selectedItems()[0]);\n\n /** Whether the radio group is readonly. */\n readonly readonly = computed(() => this.selectedItem()?.disabled() || this.inputs.readonly());\n\n /** The tabindex of the radio group. */\n readonly tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active radio button (if using activedescendant). */\n readonly activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous radio button. */\n private readonly _prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next radio button. */\n private readonly _nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the radio group. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n // Readonly mode allows navigation but not selection changes.\n if (this.readonly()) {\n return manager\n .on(this._prevKey, () => this.listBehavior.prev())\n .on(this._nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n }\n\n // Default behavior: navigate and select on arrow keys, home, end.\n // Space/Enter also select the focused item.\n return manager\n .on(this._prevKey, () => this.listBehavior.prev({selectOne: true}))\n .on(this._nextKey, () => this.listBehavior.next({selectOne: true}))\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(' ', () => this.listBehavior.selectOne())\n .on('Enter', () => this.listBehavior.selectOne());\n });\n\n /** The pointerdown event manager for the radio group. */\n readonly pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.readonly()) {\n // Navigate focus only in readonly mode.\n return manager.on(e => this.listBehavior.goto(this.inputs.getItem(e)!));\n }\n\n // Default behavior: navigate and select on click.\n return manager.on(e => this.listBehavior.goto(this.inputs.getItem(e)!, {selectOne: true}));\n });\n\n constructor(readonly inputs: RadioGroupInputs<V>) {\n this.orientation = inputs.orientation;\n this.listBehavior = new List({\n ...inputs,\n wrap: this.wrap,\n selectionMode: this.selectionMode,\n multi: () => false,\n typeaheadDelay: () => 0, // Radio groups do not support typeahead.\n });\n }\n\n /** Handles keydown events for the radio group. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events for the radio group. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /**\n * Sets the radio group to its default initial state.\n *\n * Sets the active index to the selected radio button if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable radio button.\n */\n setDefaultState() {\n let firstItem: RadioButtonPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Validates the state of the radio group and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n if (this.selectedItem()?.disabled() && this.inputs.skipDisabled()) {\n violations.push(\n \"Accessibility Violation: The selected radio button is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.\",\n );\n }\n\n return violations;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\nimport type {RadioGroupPattern} from './radio-group';\n\n/** Represents the required inputs for a radio button in a radio group. */\nexport interface RadioButtonInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'index'> {\n /** A reference to the parent radio group. */\n group: SignalLike<RadioGroupPattern<V> | undefined>;\n}\n\n/** Represents a radio button within a radio group. */\nexport class RadioButtonPattern<V> {\n /** A unique identifier for the radio button. */\n readonly id: SignalLike<string>;\n\n /** The value associated with the radio button. */\n readonly value: SignalLike<V>;\n\n /** The position of the radio button within the group. */\n readonly index: SignalLike<number> = computed(\n () => this.group()?.listBehavior.inputs.items().indexOf(this) ?? -1,\n );\n\n /** Whether the radio button is currently the active one (focused). */\n readonly active = computed(() => this.group()?.listBehavior.inputs.activeItem() === this);\n\n /** Whether the radio button is selected. */\n readonly selected: SignalLike<boolean> = computed(\n () => !!this.group()?.listBehavior.inputs.value().includes(this.value()),\n );\n\n /** Whether the radio button is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** A reference to the parent radio group. */\n readonly group: SignalLike<RadioGroupPattern<V> | undefined>;\n\n /** The tabindex of the radio button. */\n readonly tabindex = computed(() => this.group()?.listBehavior.getItemTabindex(this));\n\n /** The HTML element associated with the radio button. */\n readonly element: SignalLike<HTMLElement>;\n\n /** The search term for typeahead. */\n readonly searchTerm = () => ''; // Radio groups do not support typeahead.\n\n constructor(readonly inputs: RadioButtonInputs<V>) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.group = inputs.group;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioGroupInputs, RadioGroupPattern} from './radio-group';\nimport type {ToolbarPattern} from '../toolbar/toolbar';\nimport type {ToolbarWidgetGroupControls} from '../toolbar/toolbar-widget-group';\n\n/** Represents the required inputs for a toolbar controlled radio group. */\nexport type ToolbarRadioGroupInputs<V> = RadioGroupInputs<V> & {\n /** The toolbar controlling the radio group. */\n toolbar: SignalLike<ToolbarPattern<V> | undefined>;\n};\n\n/** Controls the state of a radio group in a toolbar. */\nexport class ToolbarRadioGroupPattern<V>\n extends RadioGroupPattern<V>\n implements ToolbarWidgetGroupControls\n{\n constructor(override readonly inputs: ToolbarRadioGroupInputs<V>) {\n if (!!inputs.toolbar()) {\n inputs.orientation = inputs.toolbar()!.orientation;\n inputs.skipDisabled = inputs.toolbar()!.skipDisabled;\n }\n\n super(inputs);\n }\n\n /** Noop. The toolbar handles keydown events. */\n override onKeydown(_: KeyboardEvent): void {}\n\n /** Noop. The toolbar handles pointerdown events. */\n override onPointerdown(_: PointerEvent): void {}\n\n /** Whether the radio group is currently on the first item. */\n isOnFirstItem() {\n return this.listBehavior.navigationBehavior.peekPrev() === undefined;\n }\n\n /** Whether the radio group is currently on the last item. */\n isOnLastItem() {\n return this.listBehavior.navigationBehavior.peekNext() === undefined;\n }\n\n /** Navigates to the next radio button in the group. */\n next(wrap: boolean) {\n this.wrap.set(wrap);\n this.listBehavior.next();\n this.wrap.set(false);\n }\n\n /** Navigates to the previous radio button in the group. */\n prev(wrap: boolean) {\n this.wrap.set(wrap);\n this.listBehavior.prev();\n this.wrap.set(false);\n }\n\n /** Navigates to the first radio button in the group. */\n first() {\n this.listBehavior.first();\n }\n\n /** Navigates to the last radio button in the group. */\n last() {\n this.listBehavior.last();\n }\n\n /** Removes focus from the radio group. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Triggers the action of the currently active radio button in the group. */\n trigger() {\n if (this.readonly()) return;\n this.listBehavior.selectOne();\n }\n\n /** Navigates to the radio button targeted by a pointer event. */\n goto(e: PointerEvent) {\n this.listBehavior.goto(this.inputs.getItem(e)!, {\n selectOne: !this.readonly(),\n });\n }\n}\n"],"names":[],"mappings":";;;;AA6BA;MACa,iBAAiB,CAAA;AAiFP,IAAA,MAAA;;AA/EZ,IAAA,YAAY;;AAGZ,IAAA,WAAW;;AAGX,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;;AAGpB,IAAA,aAAa,GAAG,MAAM,CAAwB,QAAQ,CAAC;;IAGvD,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;AAGjF,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;;IAGrF,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;;AAGpF,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;AAGvD,IAAA,gBAAgB,GAAG,QAAQ,CAAC,M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