packageDocumentation module import { PropertyRecord } from "@itwin/appui-abstract" ; import { FlatGridItemType , IMutableCategorizedPropertyItem , IMutableFlatGridItem , MutableCategorizedProperty } from "./MutableFlatGridItem" ; import { IMutableGridItemFactory } from "./MutableGridItemFactory" ; beta export class MutableCategorizedStructProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem { private _renderLabel : boolean ; private _children : IMutableCategorizedPropertyItem [ ] ; public constructor ( record , parentSelectionKey , parentCategorySelectionKey , depth , gridItemFactory , overrideName ? , overrideDisplayLabel ? ) { super ( FlatGridItemType . Struct , record , parentSelectionKey , parentCategorySelectionKey , depth , overrideName , overrideDisplayLabel ) ; this . _renderLabel = ! record . property . hideCompositePropertyLabel ; const childrenDepth = depth + ( this . _renderLabel ? 1 : 0 ) ; this . _children = record . getChildrenRecords ( ) . map ( ( value ) => { return gridItemFactory . createCategorizedProperty ( value , this . selectionKey , this . parentCategorySelectionKey , childrenDepth ) ; } ) ; } public get type ( ) : FlatGridItemType . Struct { return FlatGridItemType . Struct ; } public getChildren ( ) { return this . _children ; } public override getDescendantsAndSelf ( ) { return this . _renderLabel ? super . getDescendantsAndSelf ( ) : this . getDescendants ( ) ; } public override getVisibleDescendants ( ) { const descendants = [ ] ; if ( this . isExpanded || ! this . _renderLabel ) { this . getChildren ( ) . forEach ( ( child ) => descendants . push ( ... child . getVisibleDescendantsAndSelf ( ) ) ) ; } return descendants ; } public override getVisibleDescendantsAndSelf ( ) { return this . _renderLabel ? super . getVisibleDescendantsAndSelf ( ) : this . getVisibleDescendants ( ) ; } }