@@ -271,6 +271,9 @@ export class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestr
271271 /** Search term for typeahead. */
272272 readonly searchTerm = computed ( ( ) => this . label ( ) ?? this . element ( ) . textContent ) ;
273273
274+ /** Whether the item is active. */
275+ active : Signal < boolean > ;
276+
274277 /** The tree root. */
275278 readonly tree : Signal < Tree < V > > = computed ( ( ) => {
276279 if ( this . parent ( ) instanceof Tree ) {
@@ -279,25 +282,22 @@ export class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestr
279282 return ( this . parent ( ) as TreeItemGroup < V > ) . ownedBy ( ) . tree ( ) ;
280283 } ) ;
281284
282- /** Whether the item is active. */
283- readonly active = computed ( ( ) => this . _pattern . active ( ) ) ;
284-
285285 /** Whether this item is currently expanded, returning null if not expandable. */
286286 readonly expanded = computed ( ( ) =>
287287 this . _pattern . expandable ( ) ? this . _pattern . expanded ( ) : null ,
288288 ) ;
289289
290290 /** The level of the current item in a tree. */
291- readonly level = computed ( ( ) => this . _pattern . level ( ) ) ;
291+ level : Signal < number > ;
292292
293293 /** The position of this item among its siblings (1-based). */
294- readonly posinset = computed ( ( ) => this . _pattern . posinset ( ) ) ;
294+ posinset : Signal < number > ;
295295
296296 /** Whether the item is selected. */
297- readonly selected = computed ( ( ) => this . _pattern . selected ( ) ) ;
297+ selected : Signal < boolean | undefined > ;
298298
299299 /** Whether this item is visible. */
300- readonly visible = computed ( ( ) => this . _pattern . visible ( ) ) ;
300+ visible : Signal < boolean > ;
301301
302302 /** The UI pattern for this item. */
303303 _pattern : TreeItemPattern < V > ;
@@ -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