UNPKG

@itwin/presentation-hierarchies

Version:

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

26 lines 1.18 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.assignAutoExpand = assignAutoExpand; const Shared_js_1 = require("./Shared.js"); /** @internal */ function assignAutoExpand(props) { for (const node of props.grouped) { let autoExpandProp; (0, Shared_js_1.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