UNPKG

@itwin/presentation-hierarchies

Version:

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

29 lines 1.39 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.iterateChildNodeGroupingParams = iterateChildNodeGroupingParams; /** @internal */ function iterateChildNodeGroupingParams(parentNode, groupingType, cb) { function getGroupingParams(params) { switch (groupingType) { case "base-class": return params?.grouping?.byBaseClasses; case "class": return typeof params?.grouping?.byClass === "object" ? params.grouping.byClass : undefined; case "label": return typeof params?.grouping?.byLabel === "object" && params.grouping.byLabel.action !== "merge" ? params.grouping.byLabel : undefined; case "property": return params?.grouping?.byProperties; } } for (const childNode of parentNode.children) { const groupingParams = getGroupingParams(childNode.processingParams); if (cb(groupingParams)) { return; } } } //# sourceMappingURL=Shared.js.map