@@ -25,7 +25,7 @@ import {
2525import { _IdGenerator } from '@angular/cdk/a11y' ;
2626import { Directionality } from '@angular/cdk/bidi' ;
2727import { DeferredContent , DeferredContentAware } from '@angular/aria/deferred-content' ;
28- import { ComboboxTreePattern , TreeItemPattern , TreePattern } from '@angular/aria/private' ;
28+ import { ComboboxTreePattern , SignalLike , TreeItemPattern , TreePattern } from '@angular/aria/private' ;
2929import { ComboboxPopup } from '../combobox' ;
3030
3131interface HasElement {
@@ -279,28 +279,28 @@ export class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestr
279279 return ( this . parent ( ) as TreeItemGroup < V > ) . ownedBy ( ) . tree ( ) ;
280280 } ) ;
281281
282+ /** The UI pattern for this item. */
283+ _pattern : TreeItemPattern < V > ;
284+
282285 /** Whether the item is active. */
283- readonly active = computed ( ( ) => this . _pattern . active ( ) ) ;
286+ active : Signal < boolean > ;
284287
285288 /** Whether this item is currently expanded, returning null if not expandable. */
286289 readonly expanded = computed ( ( ) =>
287290 this . _pattern . expandable ( ) ? this . _pattern . expanded ( ) : null ,
288291 ) ;
289292
290293 /** The level of the current item in a tree. */
291- readonly level = computed ( ( ) => this . _pattern . level ( ) ) ;
294+ level : SignalLike < number > ;
292295
293296 /** The position of this item among its siblings (1-based). */
294- readonly posinset = computed ( ( ) => this . _pattern . posinset ( ) ) ;
297+ posinset : SignalLike < number > ;
295298
296299 /** Whether the item is selected. */
297- readonly selected = computed ( ( ) => this . _pattern . selected ( ) ) ;
300+ selected : SignalLike < boolean | undefined > ;
298301
299302 /** Whether this item is visible. */
300- readonly visible = computed ( ( ) => this . _pattern . visible ( ) ) ;
301-
302- /** The UI pattern for this item. */
303- _pattern : TreeItemPattern < V > ;
303+ visible : SignalLike < boolean > ;
304304
305305 constructor ( ) {
306306 super ( ) ;
@@ -336,6 +336,12 @@ export class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestr
336336 children : computed ( ( ) => this . _group ( ) ?. children ( ) ?? [ ] ) ,
337337 hasChildren : computed ( ( ) => ! ! this . _group ( ) ) ,
338338 } ) ;
339+
340+ this . active = this . _pattern . active ;
341+ this . level = this . _pattern . level ;
342+ this . posinset = this . _pattern . posinset ;
343+ this . selected = this . _pattern . selected ;
344+ this . visible = this . _pattern . visible ;
339345 }
340346
341347 ngOnDestroy ( ) {
0 commit comments