UNPKG

@itwin/presentation-hierarchies

Version:

A package for creating hierarchies based on data in iTwin.js iModels.

23 lines 1.06 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { iterateChildNodeGroupingParams } from "./Shared.js"; /** @internal */ export function assignAutoExpand(props) { for (const node of props.grouped) { let autoExpandProp; iterateChildNodeGroupingParams(node, props.groupingType, (groupingProps) => { if (autoExpandProp === "always") { return true; } autoExpandProp = groupingProps?.autoExpand ? groupingProps.autoExpand : autoExpandProp; return; }); if (autoExpandProp === "always" || (autoExpandProp === "single-child" && node.children.length === 1)) { node.autoExpand = true; } } return props; } //# sourceMappingURL=AutoExpand.js.map