@@ -220,14 +220,14 @@ export class Tree<V> {
220220 exportAs : 'ngTreeItem' ,
221221 host : {
222222 'class' : 'ng-treeitem' ,
223- '[attr.data-active]' : '_pattern. active()' ,
223+ '[attr.data-active]' : 'active()' ,
224224 'role' : 'treeitem' ,
225225 '[id]' : '_pattern.id()' ,
226- '[attr.aria-expanded]' : '_pattern.expandable() ? _pattern. expanded() : null ' ,
227- '[attr.aria-selected]' : '_pattern. selected()' ,
226+ '[attr.aria-expanded]' : 'expanded()' ,
227+ '[attr.aria-selected]' : 'selected()' ,
228228 '[attr.aria-current]' : '_pattern.current()' ,
229229 '[attr.aria-disabled]' : '_pattern.disabled()' ,
230- '[attr.aria-level]' : '_pattern. level()' ,
230+ '[attr.aria-level]' : 'level()' ,
231231 '[attr.aria-setsize]' : '_pattern.setsize()' ,
232232 '[attr.aria-posinset]' : '_pattern.posinset()' ,
233233 '[attr.tabindex]' : '_pattern.tabIndex()' ,
@@ -272,6 +272,23 @@ export class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestr
272272 return ( this . parent ( ) as TreeItemGroup < V > ) . ownedBy ( ) . tree ( ) ;
273273 } ) ;
274274
275+ /** Whether the item is active. */
276+ readonly active = computed ( ( ) => this . _pattern . active ( ) ) ;
277+
278+ /** Whether this item is currently expanded, returning null if not expandable. */
279+ readonly expanded = computed ( ( ) =>
280+ this . _pattern . expandable ( ) ? this . _pattern . expanded ( ) : null ,
281+ ) ;
282+
283+ /** The level of the current item in a tree. */
284+ readonly level = computed ( ( ) => this . _pattern . level ( ) ) ;
285+
286+ /** Whether the item is selected. */
287+ readonly selected = computed ( ( ) => this . _pattern . selected ( ) ) ;
288+
289+ /** Whether this item is visible due to all of its parents being expanded. */
290+ readonly visible = computed ( ( ) => this . _pattern . visible ( ) ) ;
291+
275292 /** The UI pattern for this item. */
276293 _pattern : TreeItemPattern < V > ;
277294
0 commit comments