File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ function getToolbarPattern(
7575 element,
7676 items,
7777 activeItem,
78+ values : signal ( [ ] ) ,
7879 wrap : signal ( inputs . wrap ?? true ) ,
7980 disabled : signal ( inputs . disabled ?? false ) ,
8081 softDisabled : signal ( inputs . softDisabled ?? true ) ,
Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import { computed , signal } from '@angular/core' ;
9+ import { computed } from '@angular/core' ;
1010import { SignalLike } from '../behaviors/signal-like/signal-like' ;
1111import { KeyboardEventManager } from '../behaviors/event-manager' ;
1212import { List , ListInputs } from '../behaviors/list/list' ;
@@ -15,7 +15,7 @@ import {ToolbarWidgetPattern} from './toolbar-widget';
1515/** Represents the required inputs for a toolbar. */
1616export type ToolbarInputs < V > = Omit <
1717 ListInputs < ToolbarWidgetPattern < V > , V > ,
18- 'multi' | 'typeaheadDelay' | 'values' | ' selectionMode' | 'focusMode'
18+ 'multi' | 'typeaheadDelay' | 'selectionMode' | 'focusMode'
1919> & {
2020 /** A function that returns the toolbar item associated with a given element. */
2121 getItem : ( e : Element ) => ToolbarWidgetPattern < V > | undefined ;
@@ -160,7 +160,6 @@ export class ToolbarPattern<V> {
160160 multi : ( ) => true ,
161161 focusMode : ( ) => 'roving' ,
162162 selectionMode : ( ) => 'explicit' ,
163- values : signal ( [ ] as V [ ] ) ,
164163 typeaheadDelay : ( ) => 0 , // Toolbar widgets do not support typeahead.
165164 } ) ;
166165 }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
1818 OnInit ,
1919 OnDestroy ,
2020 contentChildren ,
21+ model ,
2122} from '@angular/core' ;
2223import {
2324 ToolbarPattern ,
@@ -108,6 +109,9 @@ export class Toolbar<V> {
108109 /** Whether focus should wrap when navigating. */
109110 readonly wrap = input ( true , { transform : booleanAttribute } ) ;
110111
112+ /** The values of the selected widgets within the toolbar. */
113+ readonly values = model < V [ ] > ( [ ] ) ;
114+
111115 /** The toolbar UIPattern. */
112116 readonly _pattern : ToolbarPattern < V > = new ToolbarPattern < V > ( {
113117 ...this ,
@@ -116,6 +120,7 @@ export class Toolbar<V> {
116120 textDirection : this . textDirection ,
117121 element : ( ) => this . _elementRef . nativeElement ,
118122 getItem : e => this . _getItem ( e ) ,
123+ values : this . values ,
119124 } ) ;
120125
121126 /** Whether the toolbar has received focus yet. */
You can’t perform that action at this time.
0 commit comments