@itwin/presentation-hierarchies 2.0.0-alpha.12 → 2.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +268 -16
  2. package/README.md +2 -2
  3. package/lib/cjs/hierarchies/HierarchyNode.d.ts +13 -11
  4. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  5. package/lib/cjs/hierarchies/HierarchyNode.js +18 -0
  6. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  7. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +2 -0
  8. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +23 -6
  10. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  11. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +5 -4
  12. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  13. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
  14. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +3 -3
  15. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  16. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  17. package/lib/cjs/hierarchies/HierarchySearch.d.ts +184 -78
  18. package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +1 -1
  19. package/lib/cjs/hierarchies/HierarchySearch.js +305 -113
  20. package/lib/cjs/hierarchies/HierarchySearch.js.map +1 -1
  21. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +2 -2
  22. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  23. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  24. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +3 -3
  25. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  26. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  27. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +9 -4
  28. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  29. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +25 -16
  30. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  31. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +4 -4
  32. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  33. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +12 -9
  34. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  35. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +3 -3
  36. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  37. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  38. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts +2 -2
  39. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  40. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +31 -55
  41. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  42. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +2 -2
  43. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  44. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +1 -1
  45. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  46. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  47. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  48. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +4 -1
  49. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  50. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +1 -1
  51. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  52. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  53. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +2 -2
  54. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  55. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  56. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  57. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
  58. package/lib/cjs/presentation-hierarchies.d.ts +1 -1
  59. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
  60. package/lib/cjs/presentation-hierarchies.js +2 -1
  61. package/lib/cjs/presentation-hierarchies.js.map +1 -1
  62. package/lib/esm/hierarchies/HierarchyNode.d.ts +13 -11
  63. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  64. package/lib/esm/hierarchies/HierarchyNode.js +18 -0
  65. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  66. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +2 -0
  67. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
  68. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +23 -6
  69. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
  70. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +5 -4
  71. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  72. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
  73. package/lib/esm/hierarchies/HierarchyProvider.d.ts +3 -3
  74. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  75. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  76. package/lib/esm/hierarchies/HierarchySearch.d.ts +184 -78
  77. package/lib/esm/hierarchies/HierarchySearch.d.ts.map +1 -1
  78. package/lib/esm/hierarchies/HierarchySearch.js +304 -111
  79. package/lib/esm/hierarchies/HierarchySearch.js.map +1 -1
  80. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +2 -2
  81. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  82. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  83. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +3 -3
  84. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  85. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  86. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +9 -4
  87. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  88. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +26 -17
  89. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  90. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts +4 -4
  91. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  92. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js +13 -10
  93. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  94. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +3 -3
  95. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  96. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  97. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +2 -2
  98. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  99. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js +32 -56
  100. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  101. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts +2 -2
  102. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  103. package/lib/esm/hierarchies/imodel/TreeNodesReader.js +2 -2
  104. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  105. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  106. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  107. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js +4 -1
  108. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  109. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +1 -1
  110. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  111. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  112. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +2 -2
  113. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  114. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  115. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
  116. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -1
  117. package/lib/esm/presentation-hierarchies.d.ts +1 -1
  118. package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
  119. package/lib/esm/presentation-hierarchies.js +1 -1
  120. package/lib/esm/presentation-hierarchies.js.map +1 -1
  121. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchySearch.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"AAAA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Z,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,kBAAkB,IAAI,MAAM,EAAE,CAAC;QACjC,OAAO,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC3D,CAAC;IACD,OAAO,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC;AACjD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { HierarchyNodeIdentifier } from \"./HierarchyNodeIdentifier.js\";\nimport { HierarchyNodeKey } from \"./HierarchyNodeKey.js\";\n\nimport type { NonGroupingHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport interface SearchPathRevealDepthInPath {\n /**\n * Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.\n *\n * Use when you want to expand up to specific instance node and don't care about grouping nodes.\n *\n * **Use case example:**\n *\n * All nodes up to `Element1` should be expanded in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n *\n * Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`\n *\n * **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.\n */\n depthInPath: number;\n}\n\n/** @public */\nexport interface SearchPathRevealDepthInHierarchy {\n /**\n * Considering the list of nodes from root to the target node, this is an index in that list, identifying the node that should be revealed in hierarchy by auto-expanding its ancestors.\n *\n * This should take into account the number of grouping nodes in hierarchy.\n *\n * **Use case example:**\n *\n * Only `Node1` and `GroupingNode1` should have `autoExpand` flag in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n *\n * Provide `{ path: [Node1, Element1], reveal: { depthInHierarchy: 2 } }`\n *\n * To get the correct depth use `HierarchyNode.parentKeys.length`.\n *\n * **NOTE**: All nodes that are up to `depthInHierarchy` will be expanded **except** search targets.\n */\n depthInHierarchy: number;\n}\n\n/** @public */\nexport interface HierarchySearchPathOptions {\n /**\n * This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.\n * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.\n * - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.\n * - If it's an instance of `SearchPathRevealDepthInPath`, then all nodes up to `depthInPath` will have `autoExpand` flag.\n * - If it's an instance of `SearchPathRevealDepthInHierarchy`, then all nodes up to `depthInHierarchy` will have `autoExpand` flag.\n */\n reveal?: boolean | SearchPathRevealDepthInHierarchy | SearchPathRevealDepthInPath;\n /**\n * This option specifies whether or not search target should be expanded.\n * - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.\n * - If it's `true`, search target will have `autoExpand` flag.\n *\n * **NOTE**: this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.\n */\n autoExpand?: boolean;\n}\n\nnamespace HierarchySearchPathOptions {\n export function mergeRevealOptions(\n lhs: HierarchySearchPathOptions[\"reveal\"],\n rhs: HierarchySearchPathOptions[\"reveal\"],\n ): HierarchySearchPathOptions[\"reveal\"] {\n if (rhs === true || lhs === true) {\n return true;\n }\n if (!rhs || !lhs) {\n return !!rhs ? rhs : lhs;\n }\n\n const lhsDepth = \"depthInPath\" in lhs ? lhs.depthInPath : lhs.depthInHierarchy;\n const rhsDepth = \"depthInPath\" in rhs ? rhs.depthInPath : rhs.depthInHierarchy;\n const isLhsDepthBasedOnPath = \"depthInPath\" in lhs;\n const isRhsDepthBasedOnPath = \"depthInPath\" in rhs;\n\n if (isLhsDepthBasedOnPath) {\n if (isRhsDepthBasedOnPath) {\n return lhsDepth > rhsDepth ? lhs : rhs;\n }\n return lhs;\n }\n if (isRhsDepthBasedOnPath) {\n return rhs;\n }\n return lhsDepth > rhsDepth ? lhs : rhs;\n }\n\n export function mergeAutoExpandOption(\n lhs: HierarchySearchPathOptions[\"autoExpand\"],\n rhs: HierarchySearchPathOptions[\"autoExpand\"],\n ): HierarchySearchPathOptions[\"autoExpand\"] {\n return lhs || rhs ? true : undefined;\n }\n}\n\n/**\n * A path of hierarchy node identifiers for search the hierarchy with additional options.\n * @public\n */\nexport type HierarchySearchPath = HierarchyNodeIdentifiersPath | { path: HierarchyNodeIdentifiersPath; options?: HierarchySearchPathOptions };\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchySearchPath {\n /**\n * Normalizes the hierarchy search path to the object form.\n * @public\n */\n export function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath> {\n if (Array.isArray(source)) {\n return { path: source };\n }\n return source;\n }\n\n /**\n * Merges two given `HierarchySearchPathOptions` objects.\n *\n * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:\n * - if any one of the inputs is `true`, return `true`,\n * - else if only one of the inputs is an object, return it,\n * - else if both inputs are falsy, return `false` or `undefined`,\n * - else:\n * - if only one of the inputs has `depthInHierarchy` set, return the other one,\n * - else return the one with greater `depthInPath` or `depthInHierarchy`.\n *\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchPathOptions | undefined,\n rhs: HierarchySearchPathOptions | undefined,\n ): HierarchySearchPathOptions | undefined {\n const reveal = HierarchySearchPathOptions.mergeRevealOptions(lhs?.reveal, rhs?.reveal);\n const autoExpand = HierarchySearchPathOptions.mergeAutoExpandOption(lhs?.autoExpand, rhs?.autoExpand);\n return reveal || autoExpand\n ? {\n ...(reveal !== undefined ? { reveal } : undefined),\n ...(autoExpand !== undefined ? { autoExpand } : undefined),\n }\n : undefined;\n }\n}\n\nfunction extractSearchPropsInternal(\n rootLevelSearchProps: HierarchySearchPath[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n):\n | {\n childrenTargetPaths?: HierarchySearchPath[];\n hasSearchTargetAncestor: boolean;\n }\n | undefined {\n if (!parentNode) {\n return rootLevelSearchProps ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false } : undefined;\n }\n const searchProps: {\n childrenTargetPaths?: HierarchySearchPath[];\n hasSearchTargetAncestor: boolean;\n } = {\n ...(parentNode.search?.childrenTargetPaths ? { childrenTargetPaths: parentNode.search.childrenTargetPaths } : undefined),\n hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,\n };\n return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;\n}\n\n/**\n * Creates a set of utilities for making it easier to search the given hierarchy\n * level.\n *\n * @public\n */\nexport function createHierarchySearchHelper(\n rootLevelSearchProps: HierarchySearchPath[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n) {\n const searchProps = extractSearchPropsInternal(rootLevelSearchProps, parentNode);\n const hasSearch = !!searchProps;\n\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n } & (\n | {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n ),\n ): void;\n function saveSearchPropsFromPathsIntoReducer(extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): void | Promise<void>;\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n } & (\n | {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | { asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean> }\n ),\n ): void | Promise<void> {\n // Passes down matching normalized paths to the reducer.\n // It uses `nodeKey`, `pathMatcher` or `asyncPathMatcher` to check if `HierarchyNodeIdentifier` at the first position in search path matches the node\n // and if it does, the path is passed down to the reducer.\n // This function returns a promise only if asyncPathMatcher returns a promise.\n if (!searchProps?.childrenTargetPaths) {\n return;\n }\n const matchedPathPromises = new Array<Promise<NormalizedSearchPath | undefined>>();\n for (const childrenTargetPaths of searchProps.childrenTargetPaths) {\n const normalizedPath = HierarchySearchPath.normalize(childrenTargetPaths);\n /* c8 ignore next 3 */\n if (normalizedPath.path.length === 0) {\n continue;\n }\n if (\"nodeKey\" in extractionProps) {\n if (\n (HierarchyNodeKey.isGeneric(extractionProps.nodeKey) && HierarchyNodeIdentifier.equal(normalizedPath.path[0], extractionProps.nodeKey)) ||\n (HierarchyNodeKey.isInstances(extractionProps.nodeKey) &&\n extractionProps.nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(normalizedPath.path[0], ik)))\n ) {\n extractionProps.pathsReducer.accept(normalizedPath);\n }\n continue;\n }\n\n const matchesPossiblyPromise =\n \"pathMatcher\" in extractionProps ? extractionProps.pathMatcher(normalizedPath.path[0]) : extractionProps.asyncPathMatcher(normalizedPath.path[0]);\n if (matchesPossiblyPromise instanceof Promise) {\n matchedPathPromises.push(matchesPossiblyPromise.then((matches) => (matches ? normalizedPath : undefined)));\n continue;\n }\n if (matchesPossiblyPromise) {\n extractionProps.pathsReducer.accept(normalizedPath);\n }\n }\n if (matchedPathPromises.length === 0) {\n return;\n }\n return Promise.all(matchedPathPromises).then((matchedPath) =>\n matchedPath.forEach((normalizedPath) => normalizedPath && extractionProps.pathsReducer.accept(normalizedPath)),\n );\n }\n\n function createChildNodeProps(props: {\n parentKeys?: undefined;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }): Pick<NonGroupingHierarchyNode, \"search\"> | undefined;\n function createChildNodeProps(props: {\n parentKeys?: undefined;\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }): Pick<NonGroupingHierarchyNode, \"search\"> | undefined;\n function createChildNodeProps(props: {\n parentKeys?: undefined;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): Promise<Pick<NonGroupingHierarchyNode, \"search\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\"> | undefined;\n function createChildNodeProps(props: {\n parentKeys: HierarchyNodeKey[];\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n parentKeys: HierarchyNodeKey[];\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n parentKeys: HierarchyNodeKey[];\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(\n props: { parentKeys?: HierarchyNodeKey[] } & (\n | {\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }\n | {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }\n ),\n ):\n | Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | Pick<NonGroupingHierarchyNode, \"search\"> | undefined>\n | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\">\n | Pick<NonGroupingHierarchyNode, \"search\">\n | undefined {\n if (!hasSearch) {\n return undefined;\n }\n const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);\n if (\"asyncPathMatcher\" in props) {\n const extractResult = saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, asyncPathMatcher: props.asyncPathMatcher });\n if (extractResult instanceof Promise) {\n return extractResult.then(() => reducer.getNodeProps(props.parentKeys));\n }\n } else {\n saveSearchPropsFromPathsIntoReducer({ ...props, pathsReducer: reducer });\n }\n return reducer.getNodeProps(props.parentKeys);\n }\n return {\n /** Returns a flag indicating if the hierarchy level is filtered. */\n hasSearch,\n /**\n * Returns a flag indicating whether this hierarchy level has an ancestor node\n * that is a search target. That generally means that this and all downstream hierarchy\n * levels should be displayed without search being applied to them, even if search paths\n * say otherwise.\n */\n hasSearchTargetAncestor: searchProps?.hasSearchTargetAncestor ?? false,\n /**\n * Returns a list of hierarchy node identifiers that apply specifically for this\n * hierarchy level. Returns `undefined` if search is not applied to this level.\n */\n getChildNodeSearchIdentifiers: () => {\n if (!searchProps?.childrenTargetPaths) {\n return undefined;\n }\n return searchProps.childrenTargetPaths\n .map(HierarchySearchPath.normalize)\n .filter(({ path }) => path.length > 0)\n .map(({ path }) => path[0]);\n },\n /**\n * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`\n * and `autoExpand`) to be set based on the search paths and search options. This function calculates\n * these props for a child node based on its key or path matcher.\n *\n * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies\n * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the\n * `nodeKey` prop can be used to check the whole identifier.\n *\n * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:\n * - `parentKeys` is defined and `pathMatcher` or `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;\n * - `parentKeys` is undefined - does not return `HierarchyNode.autoExpand` option;\n * - props have `asyncPathMatcher` - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a promise.\n */\n createChildNodeProps,\n };\n}\n\ntype NormalizedSearchPath = ReturnType<(typeof HierarchySearchPath)[\"normalize\"]>;\n\n/**\n * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.\n *\n * Saved values can be applied to a single `HierarchyNode` - this means that a new reducer should be created every time these props are requested for a `HierarchyNode`.\n *\n * Extracts information using `accept` function:\n * - Determines if node is search target, and if it is saves the options as `searchTargetOptions`\n * - Saves `HierarchySearchPathOptions` and `childrenTargetPaths`\n */\nclass MatchingSearchPathsReducer {\n private _childrenTargetPaths = new Array<NormalizedSearchPath>();\n private _isSearchTarget = false;\n private _searchTargetOptions: HierarchySearchPathOptions | undefined = undefined;\n private _revealOption: HierarchySearchPathOptions[\"reveal\"] = false;\n\n public constructor(private _hasSearchTargetAncestor: boolean) {}\n\n public accept(normalizedPath: NormalizedSearchPath): void {\n const { path, options } = normalizedPath;\n if (path.length === 1) {\n this._isSearchTarget = true;\n this._searchTargetOptions = HierarchySearchPath.mergeOptions(this._searchTargetOptions, options);\n } else if (path.length > 1) {\n this._childrenTargetPaths.push({ path: path.slice(1), options });\n this._revealOption = HierarchySearchPathOptions.mergeRevealOptions(options?.reveal, this._revealOption);\n }\n }\n\n public getNodeProps<T extends HierarchyNodeKey[] | undefined = undefined>(\n parentKeys?: T,\n ): T extends undefined ? Pick<NonGroupingHierarchyNode, \"search\"> : Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> {\n return {\n ...(this._hasSearchTargetAncestor || this._isSearchTarget || this._childrenTargetPaths.length > 0\n ? {\n search: {\n ...(this._hasSearchTargetAncestor ? { hasSearchTargetAncestor: true } : undefined),\n ...(this._isSearchTarget ? { isSearchTarget: true, searchTargetOptions: this._searchTargetOptions } : undefined),\n ...(this._childrenTargetPaths.length > 0 ? { childrenTargetPaths: this._childrenTargetPaths } : undefined),\n },\n }\n : undefined),\n ...(parentKeys &&\n (shouldAutoExpandBasedOnReveal({\n reveal: this._revealOption,\n nodePositionInHierarchy: parentKeys.length,\n nodePositionInPath: parentKeys.filter((key) => !HierarchyNodeKey.isGrouping(key)).length,\n }) ||\n !!this._searchTargetOptions?.autoExpand)\n ? { autoExpand: true }\n : undefined),\n };\n }\n}\n\n/** @internal */\nexport function shouldAutoExpandBasedOnReveal({\n reveal,\n nodePositionInPath,\n nodePositionInHierarchy,\n}: {\n reveal: HierarchySearchPathOptions[\"reveal\"];\n nodePositionInPath: number;\n nodePositionInHierarchy: number;\n}): boolean {\n if (!reveal) {\n return false;\n }\n if (reveal === true) {\n return true;\n }\n if (\"depthInHierarchy\" in reveal) {\n return nodePositionInHierarchy < reveal.depthInHierarchy;\n }\n return nodePositionInPath < reveal.depthInPath;\n}\n"]}
1
+ {"version":3,"file":"HierarchySearch.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AA+D1F,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,mBAAmB,CAgEnC;AAhED,WAAiB,mBAAmB;IAClC;;;OAGG;IACH,SAAgB,SAAS,CAAC,MAA2B;QACnD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,6BAAS,YAKxB,CAAA;IAED;;;;;;;;;;;;OAYG;IACH,SAAgB,YAAY,CAC1B,GAA2C,EAC3C,GAA2C;QAE3C,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5D,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,MAAM,IAAI,UAAU;YACzB,CAAC,C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CAAC,CAAC,CAAC,SAAS,CAAC;aAC5D;YACH,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;QACtD,OAAO;YACL,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YACpC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SAC7C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { firstValueFrom, from, map, reduce } from \"rxjs\";\nimport { Dictionary } from \"@itwin/core-bentley\";\nimport { HierarchyNodeIdentifier } from \"./HierarchyNodeIdentifier.js\";\nimport { HierarchyNodeKey } from \"./HierarchyNodeKey.js\";\nimport { releaseMainThreadOnItemsCount } from \"./internal/operators/ReleaseMainThread.js\";\n\nimport type { NonGroupingHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport interface HierarchySearchPathOptions {\n /**\n * This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.\n * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.\n * - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.\n * - If it's a object with `groupingLevel` then `groupingLevel` determines the number of grouping levels to expand for\n * the search target.\n */\n reveal?:\n | boolean\n | {\n /**\n * Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.\n *\n * Use when you want to expand up to specific instance node and don't care about grouping nodes.\n *\n * **Use case example:**\n *\n * All nodes up to `Element1` should be expanded in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n *\n * Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`\n *\n * **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.\n */\n depthInPath: number;\n }\n | {\n /**\n * The number of grouping levels to expand for the search target. For example, if `groupingLevel` is set to `2`, then all grouping nodes up to the second level\n * will have the `autoExpand` flag.\n *\n * **Note:** if search target has less grouping levels than specified by this attribute, then all grouping nodes up to the search target will have\n * the `autoExpand` flag, but the search target itself won't have the `autoExpand` flag.\n */\n groupingLevel: number;\n };\n /**\n * This option specifies whether or not search target should be expanded.\n * - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.\n * - If it's `true`, search target will have `autoExpand` flag.\n *\n * **Note:** this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.\n */\n autoExpand?: boolean;\n}\n\n/**\n * A path of hierarchy node identifiers for search the hierarchy with additional options.\n * @public\n */\nexport type HierarchySearchPath = HierarchyNodeIdentifiersPath | { path: HierarchyNodeIdentifiersPath; options?: HierarchySearchPathOptions };\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchySearchPath {\n /**\n * Normalizes the hierarchy search path to the object form.\n * @public\n */\n export function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath> {\n if (Array.isArray(source)) {\n return { path: source };\n }\n return source;\n }\n\n /**\n * Merges two given `HierarchySearchPathOptions` objects.\n *\n * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:\n * - if any one of the inputs is `true`, return `true`,\n * - else if only one of the inputs is an object, return it,\n * - else if both inputs are falsy, return `false` or `undefined`,\n * - else:\n * - if only one of the inputs has `groupingLevel` set, return that one,\n * - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.\n *\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchPathOptions | undefined,\n rhs: HierarchySearchPathOptions | undefined,\n ): HierarchySearchPathOptions | undefined {\n const reveal = mergeRevealOptions(lhs?.reveal, rhs?.reveal);\n const autoExpand = mergeAutoExpandOption(lhs?.autoExpand, rhs?.autoExpand);\n return reveal || autoExpand\n ? {\n ...(reveal !== undefined ? { reveal } : undefined),\n ...(autoExpand !== undefined ? { autoExpand } : undefined),\n }\n : undefined;\n }\n function mergeRevealOptions(lhs: HierarchySearchPathOptions[\"reveal\"], rhs: HierarchySearchPathOptions[\"reveal\"]): HierarchySearchPathOptions[\"reveal\"] {\n if (rhs === true || lhs === true) {\n return true;\n }\n if (!rhs || !lhs) {\n return !!rhs ? rhs : lhs;\n }\n\n if (\"groupingLevel\" in lhs) {\n if (\"groupingLevel\" in rhs) {\n return lhs.groupingLevel > rhs.groupingLevel ? lhs : rhs;\n }\n return lhs;\n } else if (\"groupingLevel\" in rhs) {\n return rhs;\n }\n\n return lhs.depthInPath > rhs.depthInPath ? lhs : rhs;\n }\n\n function mergeAutoExpandOption(\n lhs: HierarchySearchPathOptions[\"autoExpand\"],\n rhs: HierarchySearchPathOptions[\"autoExpand\"],\n ): HierarchySearchPathOptions[\"autoExpand\"] {\n return lhs || rhs ? true : undefined;\n }\n}\n\n/**\n * A tree structure representing hierarchy search paths. Each node in the tree corresponds\n * to a hierarchy node identifier and may have children that represent deeper levels in the\n * hierarchy.\n *\n * The `HierarchySearchTree.createBuilder` or `HierarchySearchTree.createFromPathsList` are\n * typically used create this tree from a flat list of search paths.\n *\n * @public\n */\nexport interface HierarchySearchTree {\n /** Identifier of the hierarchy node this tree entry represents. */\n identifier: HierarchyNodeIdentifier;\n\n /**\n * When `true`, indicates that this node is a search target.\n *\n * Note: A `HierarchySearchTree` node is considered a search target if it has no children, even if `isTarget` is not explicitly set to `true`. This\n * is because a node with no children represents the end of a search path.\n */\n isTarget?: boolean;\n\n /** Provides options for handling this search tree entry, such as auto-expansion behavior. */\n options?: {\n /**\n * - `true` to expand the node and its grouping nodes,\n * - `{ groupingLevel: number }` to expand ancestor grouping nodes, e.g. for the following hierarchy:\n * ```\n * - Grouping node A\n * - Instance node A\n * - Grouping node B1\n * - Grouping node B2\n * - ...\n * - Grouping node Bn\n * - Instance node B\n * ```\n *\n * For \"Instance node B\" search tree entry:\n * - `{ groupingLevel: 1 }` expands its first grouping node \"Grouping node B1\",\n * - `{ groupingLevel: 2 }` expands two levels to \"Grouping node B2\".\n * - `{ groupingLevel: Number.MAX_SAFE_INTEGER }` expands all grouping nodes of that instance node.\n *\n * Note that there's a slight difference between `HierarchySearchTree.options.autoExpand` and\n * `HierarchySearchPath.options.reveal`. The latter option reveals the search target node by expanding its ancestors,\n * while the `HierarchySearchTree.options.autoExpand` also expands the target node itself.\n */\n autoExpand?: boolean | { groupingLevel: number };\n };\n\n /** Child search tree entries representing the next level(s) in the hierarchy search paths. */\n children?: HierarchySearchTree[];\n}\n\n/** @public */\nexport namespace HierarchySearchTree {\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras extends Record<string, unknown>> = Readonly<\n Pick<HierarchySearchTree, \"identifier\" | \"options\"> & {\n extras: TExtras;\n }\n > &\n Pick<HierarchySearchTree, \"isTarget\">;\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeInput = Readonly<Pick<HierarchySearchTree, \"identifier\" | \"isTarget\" | \"options\"> & { hasChildren: boolean }>;\n /** @public */\n interface HierarchySearchTreeBuilderAcceptHandler<TExtras extends Record<string, unknown>> {\n /**\n * Called when a new entry is added to the tree. Return `true` to accept the entry, `false` to reject it and all its children, if any.\n */\n onNewEntry?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The new entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => boolean;\n /**\n * Called when a new entry is added to the tree and accepted (either it's a new entry or it merges with an existing entry). This can be used to perform\n * side effects such as assigning extra information to the tree entry.\n */\n onEntryHandled?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The tree entry that has been handled. It's allowed to mutate this entry. */\n treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>;\n /** The input entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => void;\n }\n /** @public */\n type HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras extends Record<string, unknown>> = (\n | { path: HierarchySearchPath }\n | { tree: HierarchySearchTree }\n ) & {\n /** An optional handler for customizing the behavior of the builder when accepting new entries. */\n handler?: HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n };\n /**\n * An utility that accepts hierarchy search paths or search trees one by one and builds a `HierarchySearchTree` structure based on them.\n * @public\n */\n interface HierarchySearchTreeBuilder<TAcceptHandlerExtras extends Record<string, unknown>> {\n /**\n * Accepts a hierarchy search path or paths' tree and adds it to the builder's internal tree structure. Use `getTree()` to create\n * a `HierarchySearchTree[]` from the added paths.\n */\n accept(props: HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras>): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;\n /**\n * Create `HierarchySearchTree[]` from currently added search paths.\n */\n getTree(): HierarchySearchTree[];\n }\n\n /**\n * Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds\n * a `HierarchySearchTree` structure based on them.\n *\n * Usage example:\n *\n * ```ts\n * const builder = HierarchySearchTree.createBuilder();\n * for (const path of searchPaths) {\n * builder.accept({ path });\n * }\n * const searchTree = builder.getTree();\n * ```\n *\n * @public\n */\n export function createBuilder<\n TAcceptHandlerExtras extends Record<string, unknown> = Record<string, unknown>,\n >(): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n type HierarchySearchTreeDictionaryEntry = Omit<HierarchySearchTree, \"children\"> & {\n children?: HierarchySearchTreeDictionary;\n extras: TAcceptHandlerExtras;\n };\n type HierarchySearchTreeDictionary = Dictionary<HierarchyNodeIdentifier, HierarchySearchTreeDictionaryEntry>;\n type AcceptHandler = HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n return new (class Impl implements HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n #rootsDictionary: HierarchySearchTreeDictionary = new Dictionary(HierarchyNodeIdentifier.compare);\n\n static #mapDictionaryToTree(dictionary: HierarchySearchTreeDictionary): HierarchySearchTree[] {\n const list: HierarchySearchTree[] = [];\n for (const { children, extras: _, ...entry } of dictionary.values()) {\n list.push({ ...entry, ...(children ? { children: Impl.#mapDictionaryToTree(children) } : undefined) });\n }\n return list;\n }\n\n static #assignAutoExpandOptionsBasedOnReveal(\n treePath: Pick<HierarchySearchTree, \"options\">[],\n revealOption: HierarchySearchPathOptions[\"reveal\"] | undefined,\n ) {\n if (revealOption === true) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"groupingLevel\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // the last entry should have `autoExpand` with `groupingLevel` set to the value based on `reveal.groupingLevel`\n return { autoExpand: { groupingLevel: Math.max(revealOption.groupingLevel - 1, 0) } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"depthInPath\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: Math.min(revealOption.depthInPath, treePath.length - 1),\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n }\n }\n\n static #assignOptionsOnTreePath({\n treePath,\n targetEntryIndex,\n getEntryOptions,\n }: {\n treePath: Array<Pick<HierarchySearchTree, \"options\">>;\n targetEntryIndex: number;\n getEntryOptions: (index: number, targetEntryIndex: number) => HierarchySearchTree[\"options\"] | undefined;\n }) {\n // set all parent entries to auto-expand\n for (let i = 0; i <= targetEntryIndex; i++) {\n const options = mergeOptions(treePath[i].options, getEntryOptions(i, targetEntryIndex));\n if (options) {\n treePath[i].options = options;\n }\n }\n }\n\n #acceptNode({\n parentEntries,\n level,\n node,\n handler,\n }: {\n parentEntries: HierarchySearchTreeDictionaryEntry[];\n level: HierarchySearchTreeDictionary;\n node: Pick<HierarchySearchTree, \"identifier\" | \"isTarget\"> & { hasChildren: boolean };\n handler?: AcceptHandler;\n }): HierarchySearchTreeDictionaryEntry | undefined {\n let entry = level.get(node.identifier);\n if (!entry) {\n if (handler?.onNewEntry && !handler.onNewEntry({ parentEntries, inputEntry: node })) {\n return undefined;\n }\n entry = {\n identifier: node.identifier,\n children: node.hasChildren ? new Dictionary(HierarchyNodeIdentifier.compare) : undefined,\n extras: {} as TAcceptHandlerExtras,\n };\n level.set(node.identifier, entry);\n }\n\n const isNodeSearchTarget = node.isTarget || !node.hasChildren;\n if (isNodeSearchTarget && entry.children) {\n entry.isTarget = true;\n }\n if (!entry.children && node.hasChildren) {\n // Existing leaf nodes are implied targets. Preserve that status when adding children.\n entry.isTarget = true;\n entry.children = new Dictionary(HierarchyNodeIdentifier.compare);\n }\n handler?.onEntryHandled?.({ parentEntries, treeEntry: entry, inputEntry: node });\n return entry;\n }\n\n #acceptPath({ path, handler }: { path: HierarchySearchPath; handler?: AcceptHandler }) {\n const normalized = HierarchySearchPath.normalize(path);\n const treePath: Array<HierarchySearchTreeDictionaryEntry> = [];\n let currentLevel: HierarchySearchTreeDictionary = this.#rootsDictionary;\n for (let i = 0; i < normalized.path.length; i++) {\n const identifier = normalized.path[i];\n const acceptedNode = this.#acceptNode({\n parentEntries: treePath,\n node: { identifier, hasChildren: i < normalized.path.length - 1 },\n level: currentLevel,\n handler,\n });\n if (!acceptedNode) {\n break;\n }\n treePath.push(acceptedNode);\n if (!acceptedNode.children) {\n break;\n }\n currentLevel = acceptedNode.children;\n }\n\n if (treePath.length === 0) {\n return;\n }\n\n // handle auto-expand\n const lastNode = treePath[treePath.length - 1];\n if (normalized.options?.autoExpand) {\n (lastNode.options ??= {}).autoExpand = true;\n }\n\n // handle auto-reveal\n Impl.#assignAutoExpandOptionsBasedOnReveal(treePath, normalized.options?.reveal);\n }\n\n #acceptTree({ tree, handler }: { tree: HierarchySearchTree; handler?: AcceptHandler }) {\n const acceptTreeNode = (\n parentEntries: HierarchySearchTreeDictionaryEntry[],\n parentInputs: HierarchySearchTree[],\n level: HierarchySearchTreeDictionary,\n node: HierarchySearchTree,\n ) => {\n const acceptedNode = this.#acceptNode({\n parentEntries,\n node: { ...node, hasChildren: node.children !== undefined },\n level,\n handler,\n });\n if (!acceptedNode) {\n // It was decided to reject this node and its children, if any\n return;\n }\n const treePath = [...parentEntries, acceptedNode];\n const inputsPath = [...parentInputs, node];\n if (!node.children || node.isTarget) {\n // Found an effective search target - merge options from its path\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index) => inputsPath[index].options,\n });\n }\n const currentLevel = acceptedNode.children;\n if (currentLevel) {\n node.children?.forEach((child) => acceptTreeNode(treePath, inputsPath, currentLevel, child));\n }\n };\n acceptTreeNode([], [], this.#rootsDictionary, tree);\n }\n\n public accept(\n props: ({ path: HierarchySearchPath } | { tree: HierarchySearchTree }) & { handler?: AcceptHandler },\n ): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n if (\"path\" in props) {\n this.#acceptPath(props);\n } else {\n this.#acceptTree(props);\n }\n return this;\n }\n\n public getTree() {\n return Impl.#mapDictionaryToTree(this.#rootsDictionary);\n }\n })();\n }\n\n /**\n * Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared\n * path prefixes are merged so that each unique hierarchy node identifier appears only once\n * per level. The resulting trees carry `isTarget`, `options`, and `children` attributes\n * derived from the paths and their options (`autoExpand`, `reveal`).\n *\n * @public\n */\n export async function createFromPathsList(paths: Iterable<HierarchySearchPath>): Promise<HierarchySearchTree[]> {\n return firstValueFrom(\n from(paths).pipe(\n releaseMainThreadOnItemsCount(1000),\n reduce((builder, path) => builder.accept({ path }), createBuilder()),\n map((builder) => builder.getTree()),\n ),\n );\n }\n\n /**\n * Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,\n * `true` takes precedence over `{ groupingLevel }`, and when both sides are\n * `{ groupingLevel }` objects the larger value wins.\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchTree[\"options\"] | undefined,\n rhs: HierarchySearchTree[\"options\"] | undefined,\n ): HierarchySearchTree[\"options\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n const autoExpand = mergeSearchTreeAutoExpandOption(lhs.autoExpand, rhs.autoExpand);\n const options: NonNullable<HierarchySearchTree[\"options\"]> = {\n ...(autoExpand ? { autoExpand } : undefined),\n };\n return Object.keys(options).length > 0 ? options : undefined;\n }\n\n function mergeSearchTreeAutoExpandOption(\n lhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n rhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n ): NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n return lhs === true || rhs === true ? true : { groupingLevel: Math.max(lhs.groupingLevel, rhs.groupingLevel) };\n }\n}\n\nfunction extractSearchPropsInternal(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n):\n | {\n childrenTargetPaths?: HierarchySearchTree[];\n hasSearchTargetAncestor: boolean;\n }\n | undefined {\n if (!parentNode) {\n return rootLevelSearchProps ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false } : undefined;\n }\n const searchProps: {\n childrenTargetPaths?: HierarchySearchTree[];\n hasSearchTargetAncestor: boolean;\n } = {\n ...(parentNode.search?.childrenTargetPaths ? { childrenTargetPaths: parentNode.search.childrenTargetPaths } : undefined),\n hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,\n };\n return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;\n}\n\n/**\n * Creates a set of utilities for making it easier to search the given hierarchy\n * level.\n *\n * @public\n */\nexport function createHierarchySearchHelper(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n) {\n const searchProps = extractSearchPropsInternal(rootLevelSearchProps, parentNode);\n const hasSearch = !!searchProps;\n\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n } & (\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }\n | {}\n ),\n ): void;\n function saveSearchPropsFromPathsIntoReducer(extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): void | Promise<void>;\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n } & (\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | { asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean> }\n | {}\n ),\n ): void | Promise<void> {\n // Passes down matching hierarchy search trees to the reducer.\n // It uses `nodeKey`, `pathMatcher` or `asyncPathMatcher` to check if `HierarchyNodeIdentifier` in the search tree item's identifier matches the node\n // and if it does, the path is passed down to the reducer.\n // This function returns a promise only if `asyncPathMatcher` returns a promise.\n if (!searchProps?.childrenTargetPaths) {\n return;\n }\n const matchedTreePromises = new Array<Promise<HierarchySearchTree | undefined>>();\n for (const childrenSearchTree of searchProps.childrenTargetPaths) {\n if (\"asyncPathMatcher\" in extractionProps) {\n const matchesPossiblyPromise = extractionProps.asyncPathMatcher(childrenSearchTree.identifier);\n if (matchesPossiblyPromise instanceof Promise) {\n matchedTreePromises.push(matchesPossiblyPromise.then((matches) => (matches ? childrenSearchTree : undefined)));\n } else if (matchesPossiblyPromise) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n } else {\n const matches =\n \"pathMatcher\" in extractionProps\n ? extractionProps.pathMatcher(childrenSearchTree.identifier)\n : nodeKeyMatchesIdentifier(extractionProps.nodeKey, childrenSearchTree.identifier);\n if (matches) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n }\n }\n if (matchedTreePromises.length === 0) {\n return;\n }\n return Promise.all(matchedTreePromises).then((matchedTrees) =>\n matchedTrees.forEach((matchedTree) => matchedTree && extractionProps.pathsReducer.accept(matchedTree)),\n );\n }\n\n function createChildNodeProps(props: { nodeKey: InstancesNodeKey | GenericNodeKey }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(\n props: { nodeKey: InstancesNodeKey | GenericNodeKey } & (\n | {\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }\n | {}\n ),\n ): Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined {\n if (!hasSearch) {\n return undefined;\n }\n\n const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);\n if (\"asyncPathMatcher\" in props) {\n const extractResult = saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, nodeKey: props.nodeKey, asyncPathMatcher: props.asyncPathMatcher });\n if (extractResult instanceof Promise) {\n return extractResult.then(() => reducer.aggregatedOptions);\n }\n } else {\n saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, ...props });\n }\n return reducer.aggregatedOptions;\n }\n\n return {\n /** Returns a flag indicating if the hierarchy level is filtered. */\n hasSearch,\n /**\n * Returns a flag indicating whether this hierarchy level has an ancestor node\n * that is a search target. That generally means that this and all downstream hierarchy\n * levels should be displayed without search being applied to them, even if search paths\n * say otherwise.\n */\n hasSearchTargetAncestor: searchProps?.hasSearchTargetAncestor ?? false,\n /**\n * Returns a list of hierarchy node identifiers that apply specifically for this\n * hierarchy level. Returns `undefined` if search is not applied to this level.\n */\n getChildNodeSearchIdentifiers: () => {\n if (!searchProps?.childrenTargetPaths) {\n return undefined;\n }\n return searchProps.childrenTargetPaths.map(({ identifier }) => identifier);\n },\n /**\n * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`\n * and `autoExpand`) to be set based on the search paths and search options. This function calculates\n * these props for a child node based on its key or path matcher.\n *\n * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies\n * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the\n * `nodeKey` prop can be used to check the whole identifier.\n *\n * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:\n * - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.\n * - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;\n */\n createChildNodeProps,\n };\n}\n\nfunction nodeKeyMatchesIdentifier(nodeKey: InstancesNodeKey | GenericNodeKey, identifier: HierarchyNodeIdentifier): boolean {\n return (\n (HierarchyNodeKey.isGeneric(nodeKey) && HierarchyNodeIdentifier.equal(identifier, nodeKey)) ||\n (HierarchyNodeKey.isInstances(nodeKey) && nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(identifier, ik)))\n );\n}\n\n/**\n * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.\n *\n * Saved values can be applied to a single `HierarchyNode` - this means that a new reducer should be created every time these props are requested for a `HierarchyNode`.\n *\n * Extracts information using `accept` function:\n * - Determines if node is search target, and if it is saves the options as `searchTargetOptions`\n * - Saves `HierarchySearchPathOptions` and `childrenTargetPaths`\n */\nclass MatchingSearchPathsReducer {\n private _childrenTargetPaths = new Array<HierarchySearchTree>();\n private _isSearchTarget = false;\n private _options: HierarchySearchTree[\"options\"] | undefined = undefined;\n\n public constructor(private _hasSearchTargetAncestor: boolean) {}\n\n public accept(tree: HierarchySearchTree): void {\n if (tree.isTarget || tree.children === undefined) {\n this._isSearchTarget = true;\n }\n if (tree.children && tree.children.length > 0) {\n this._childrenTargetPaths.push(...tree.children);\n }\n this._options = HierarchySearchTree.mergeOptions(this._options, tree.options);\n }\n\n public get aggregatedOptions() {\n const search =\n this._hasSearchTargetAncestor || this._isSearchTarget || this._childrenTargetPaths.length > 0 || this._options\n ? {\n ...(this._hasSearchTargetAncestor ? { hasSearchTargetAncestor: true } : undefined),\n ...(this._isSearchTarget ? { isSearchTarget: true } : undefined),\n ...(this._childrenTargetPaths.length > 0 ? { childrenTargetPaths: this._childrenTargetPaths } : undefined),\n ...(this._options ? { options: this._options } : undefined),\n }\n : undefined;\n const autoExpand = this._options?.autoExpand === true;\n return {\n ...(search ? { search } : undefined),\n ...(autoExpand ? { autoExpand } : undefined),\n };\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { GenericInstanceFilter } from "@itwin/core-common";
2
- import type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from "@itwin/presentation-shared";
2
+ import type { EC, ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from "@itwin/presentation-shared";
3
3
  import type { NonGroupingHierarchyNode, ParentHierarchyNode } from "../HierarchyNode.js";
4
4
  import type { ProcessedGenericHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode, SourceGenericHierarchyNode, SourceInstanceHierarchyNode } from "./IModelHierarchyNode.js";
5
5
  /**
@@ -20,7 +20,7 @@ export interface InstanceNodesQueryDefinition {
20
20
  * points to a base class of multiple different classes of instances returned by the query, however
21
21
  * the more specific this class is, the more efficient hierarchy building process is.
22
22
  */
23
- fullClassName: string;
23
+ fullClassName: EC.FullClassName;
24
24
  /**
25
25
  * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected
26
26
  * to be built using `NodeSelectQueryFactory.createSelectClause`.
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC7G,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBA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;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE;IACtC,iCAAiC;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAE7B,gEAAgE;IAChE,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAEnF,2EAA2E;IAC3E,UAAU,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAEtD,uCAAuC;IACvC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC,+EAA+E;IAC/E,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3F"}
1
+ {"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACjH,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,K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AAC,KAAK,GAAG,SAAS,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE;IACtC,iCAAiC;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAE7B,gEAAgE;IAChE,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAEnF,2EAA2E;IAC3E,UAAU,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAEtD,uCAAuC;IACvC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC,+EAA+E;IAC/E,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA6ChG,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,aAAa,CAAC,GAA6B;QACzD,OAAO,CAAC,CAAE,GAAsC,CAAC,IAAI,CAAC;IACxD,CAAC;IAFe,sCAAa,gBAE5B,CAAA;IACD,SAAgB,oBAAoB,CAAC,GAA6B;QAChE,OAAO,CAAC,CAAE,GAAoC,CAAC,KAAK,CAAC;IACvD,CAAC;IAFe,6CAAoB,uBAEnC,CAAA;AACH,CAAC,EAPgB,wBAAwB,KAAxB,wBAAwB,QAOxC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from \"@itwin/presentation-shared\";\nimport type { NonGroupingHierarchyNode, ParentHierarchyNode } from \"../HierarchyNode.js\";\nimport type {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceGenericHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"./IModelHierarchyNode.js\";\n\n/**\n * A nodes definition that returns a single generic node.\n * @public\n */\nexport interface GenericHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: SourceGenericHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @public\n */\nexport interface InstanceNodesQueryDefinition {\n /**\n * Full name of the class whose instances are going to be returned. It's okay if the attribute\n * points to a base class of multiple different classes of instances returned by the query, however\n * the more specific this class is, the more efficient hierarchy building process is.\n */\n fullClassName: string;\n /**\n * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected\n * to be built using `NodeSelectQueryFactory.createSelectClause`.\n */\n query: ECSqlQueryDef;\n}\n\n/**\n * A definition of nodes included in a hierarchy level.\n * @public\n */\nexport type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition {\n return !!(def as GenericHierarchyNodeDefinition).node;\n }\n export function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition {\n return !!(def as InstanceNodesQueryDefinition).query;\n }\n}\n\n/**\n * A definition of a hierarchy level, which may consist of multiple node definitions.\n * @public\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @public\n */\nexport type NodeParser = (props: {\n /** The ECSQL row object to parse. Keys & value types depend on the executed query. */\n row: { [columnName: string]: any };\n\n /** The parent node whose child node is being parsed. */\n parentNode?: HierarchyDefinitionParentNode;\n\n /** The key of iModel which is used to run the query. */\n imodelKey: string;\n}) => SourceInstanceHierarchyNode | Promise<SourceInstanceHierarchyNode>;\n\n/**\n * A type for a function that pre-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node\n * from the hierarchy.\n *\n * @public\n */\nexport type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(props: {\n /** Node to be pre-processed. */\n node: TNode;\n\n /** The parent node whose child node is being pre-processed. */\n parentNode?: ParentHierarchyNode;\n}) => Promise<TNode | undefined>;\n\n/**\n * A type for a function that post-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one.\n *\n * @public\n */\nexport type NodePostProcessor = (props: {\n /** Node to be post-processed. */\n node: ProcessedHierarchyNode;\n\n /** The parent node whose child node is being post-processed. */\n parentNode?: ParentHierarchyNode;\n}) => Promise<ProcessedHierarchyNode>;\n\n/**\n * A type of node that can be passed to `HierarchyDefinition.defineHierarchyLevel`. This basically means\n * a `HierarchyNode` that:\n * - knows nothing about its children,\n * - is either an instances node (key is of `InstancesNodeKey` type) or a generic node (key is of `GenericNodeKey` type).\n * @public\n */\nexport type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @public\n */\nexport interface DefineHierarchyLevelProps {\n /** The iModel for which the hierarchy definition is being requested for. */\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector & { imodelKey: string };\n\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: HierarchyDefinitionParentNode | undefined;\n\n /** Optional hierarchy level filter. */\n instanceFilter?: GenericInstanceFilter;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @public\n */\nexport interface HierarchyDefinition {\n /**\n * An optional function for parsing ECInstance node from ECSQL row.\n *\n * Should be used in situations when the `HierarchyDefinition` implementation\n * introduces additional ECSQL columns into the select clause and wants to assign additional\n * data to the nodes it produces.\n *\n * Defaults to a function that parses all `HierarchyNode` attributes from a query, whose SELECT\n * clause is created using `NodeSelectQueryFactory.createSelectClause`.\n */\n parseNode?: NodeParser;\n\n /**\n * An optional function for pre-processing nodes.\n *\n * Pre-processing happens immediately after the nodes are loaded based on `HierarchyLevelDefinition`\n * returned by this `HierarchyDefinition` and before their processing (hiding, grouping, sorting, etc.) starts.\n * The step allows assigning nodes additional data or excluding them from the hierarchy based on some attributes.\n */\n preProcessNode?: NodePreProcessor;\n\n /**\n * An optional function for post-processing nodes.\n *\n * Post-processing happens after the loaded nodes go through all the merging, hiding and grouping\n * steps, but before sorting them. This step allows `HierarchyDefinition` implementations to assign additional data\n * to nodes after they're processed. This is especially true for grouping nodes as they're only created during\n * processing.\n */\n postProcessNode?: NodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;\n}\n"]}
1
+ {"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA6ChG,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,aAAa,CAAC,GAA6B;QACzD,OAAO,CAAC,CAAE,GAAsC,CAAC,IAAI,CAAC;IACxD,CAAC;IAFe,sCAAa,gBAE5B,CAAA;IACD,SAAgB,oBAAoB,CAAC,GAA6B;QAChE,OAAO,CAAC,CAAE,GAAoC,CAAC,KAAK,CAAC;IACvD,CAAC;IAFe,6CAAoB,uBAEnC,CAAA;AACH,CAAC,EAPgB,wBAAwB,KAAxB,wBAAwB,QAOxC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type { EC, ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from \"@itwin/presentation-shared\";\nimport type { NonGroupingHierarchyNode, ParentHierarchyNode } from \"../HierarchyNode.js\";\nimport type {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceGenericHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"./IModelHierarchyNode.js\";\n\n/**\n * A nodes definition that returns a single generic node.\n * @public\n */\nexport interface GenericHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: SourceGenericHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @public\n */\nexport interface InstanceNodesQueryDefinition {\n /**\n * Full name of the class whose instances are going to be returned. It's okay if the attribute\n * points to a base class of multiple different classes of instances returned by the query, however\n * the more specific this class is, the more efficient hierarchy building process is.\n */\n fullClassName: EC.FullClassName;\n /**\n * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected\n * to be built using `NodeSelectQueryFactory.createSelectClause`.\n */\n query: ECSqlQueryDef;\n}\n\n/**\n * A definition of nodes included in a hierarchy level.\n * @public\n */\nexport type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition {\n return !!(def as GenericHierarchyNodeDefinition).node;\n }\n export function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition {\n return !!(def as InstanceNodesQueryDefinition).query;\n }\n}\n\n/**\n * A definition of a hierarchy level, which may consist of multiple node definitions.\n * @public\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @public\n */\nexport type NodeParser = (props: {\n /** The ECSQL row object to parse. Keys & value types depend on the executed query. */\n row: { [columnName: string]: any };\n\n /** The parent node whose child node is being parsed. */\n parentNode?: HierarchyDefinitionParentNode;\n\n /** The key of iModel which is used to run the query. */\n imodelKey: string;\n}) => SourceInstanceHierarchyNode | Promise<SourceInstanceHierarchyNode>;\n\n/**\n * A type for a function that pre-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node\n * from the hierarchy.\n *\n * @public\n */\nexport type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(props: {\n /** Node to be pre-processed. */\n node: TNode;\n\n /** The parent node whose child node is being pre-processed. */\n parentNode?: ParentHierarchyNode;\n}) => Promise<TNode | undefined>;\n\n/**\n * A type for a function that post-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one.\n *\n * @public\n */\nexport type NodePostProcessor = (props: {\n /** Node to be post-processed. */\n node: ProcessedHierarchyNode;\n\n /** The parent node whose child node is being post-processed. */\n parentNode?: ParentHierarchyNode;\n}) => Promise<ProcessedHierarchyNode>;\n\n/**\n * A type of node that can be passed to `HierarchyDefinition.defineHierarchyLevel`. This basically means\n * a `HierarchyNode` that:\n * - knows nothing about its children,\n * - is either an instances node (key is of `InstancesNodeKey` type) or a generic node (key is of `GenericNodeKey` type).\n * @public\n */\nexport type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @public\n */\nexport interface DefineHierarchyLevelProps {\n /** The iModel for which the hierarchy definition is being requested for. */\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector & { imodelKey: string };\n\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: HierarchyDefinitionParentNode | undefined;\n\n /** Optional hierarchy level filter. */\n instanceFilter?: GenericInstanceFilter;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @public\n */\nexport interface HierarchyDefinition {\n /**\n * An optional function for parsing ECInstance node from ECSQL row.\n *\n * Should be used in situations when the `HierarchyDefinition` implementation\n * introduces additional ECSQL columns into the select clause and wants to assign additional\n * data to the nodes it produces.\n *\n * Defaults to a function that parses all `HierarchyNode` attributes from a query, whose SELECT\n * clause is created using `NodeSelectQueryFactory.createSelectClause`.\n */\n parseNode?: NodeParser;\n\n /**\n * An optional function for pre-processing nodes.\n *\n * Pre-processing happens immediately after the nodes are loaded based on `HierarchyLevelDefinition`\n * returned by this `HierarchyDefinition` and before their processing (hiding, grouping, sorting, etc.) starts.\n * The step allows assigning nodes additional data or excluding them from the hierarchy based on some attributes.\n */\n preProcessNode?: NodePreProcessor;\n\n /**\n * An optional function for post-processing nodes.\n *\n * Post-processing happens after the loaded nodes go through all the merging, hiding and grouping\n * steps, but before sorting them. This step allows `HierarchyDefinition` implementations to assign additional data\n * to nodes after they're processed. This is especially true for grouping nodes as they're only created during\n * processing.\n */\n postProcessNode?: NodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from "@itwin/presentation-shared";
1
+ import type { ConcatenatedValue, EC, InstanceKey, OmitOverUnion, PrimitiveValue } from "@itwin/presentation-shared";
2
2
  import type { GroupingHierarchyNode, NonGroupingHierarchyNode } from "../HierarchyNode.js";
3
3
  import type { GenericNodeKey, InstancesNodeKey } from "../HierarchyNodeKey.js";
4
4
  /**
@@ -80,7 +80,7 @@ interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingPara
80
80
  *
81
81
  * Full class name format: `SchemaName.ClassName`.
82
82
  */
83
- fullClassNames: string[];
83
+ fullClassNames: EC.FullClassName[];
84
84
  }
85
85
  /**
86
86
  * A data structure that represents properties grouping.
@@ -93,7 +93,7 @@ export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGrou
93
93
  *
94
94
  * Full class name format: `SchemaName.ClassName`.
95
95
  */
96
- propertiesClassName: string;
96
+ propertiesClassName: EC.FullClassName;
97
97
  /**
98
98
  * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.
99
99
  *
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyNode.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAChH,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/E;;;GAGG;AACH,UAAU,iCAAiC;IACzC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uGAAuG;IACvG,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,gCAAgC,CA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{"version":3,"file":"IModelHierarchyNode.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA2N1D,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,sBAAsB,CAatC;AAbD,WAAiB,sBAAsB;IACrC,sDAAsD;IACtD,SAAgB,SAAS,CAAC,IAA4B;QACpD,OAAO,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,gCAAS,YAExB,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAAC,IAA4B;QAC1D,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,sCAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAAC,IAA4B;QACzD,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,qCAAc,iBAE7B,CAAA;AACH,CAAC,EAbgB,sBAAsB,KAAtB,sBAAsB,QAatC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\nimport type { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport type { GroupingHierarchyNode, NonGroupingHierarchyNode } from \"../HierarchyNode.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * Base processing parameters that apply to every node.\n * @public\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n * @public\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n * @public\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n * @public\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n * @public\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @public\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @public\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n * @public\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n * @public\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: string[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @public\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: string;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @public\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue | ConcatenatedValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @public\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @public\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A generic (not based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: GenericNodeKey;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @public\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @public\n */\nexport type ProcessedHierarchyNode = ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace ProcessedHierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric(node: ProcessedHierarchyNode): node is ProcessedGenericHierarchyNode {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode(node: ProcessedHierarchyNode): node is ProcessedInstanceHierarchyNode {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode(node: ProcessedHierarchyNode): node is ProcessedGroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n}\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned by hierarchy definitions as a generic node or when the node is just parsed from query results.\n * @public\n */\nexport type SourceHierarchyNode<TBase = SourceGenericHierarchyNode | SourceInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n\n/**\n * A kind of `ProcessedGenericHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceGenericHierarchyNode = SourceHierarchyNode<Omit<ProcessedGenericHierarchyNode, \"key\"> & { key: string }>;\n\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceInstanceHierarchyNode = SourceHierarchyNode<\n Omit<ProcessedInstanceHierarchyNode, \"key\"> & {\n key: Omit<InstancesNodeKey, \"instanceKeys\"> & { instanceKeys: InstanceKey[] };\n }\n>;\n"]}
1
+ {"version":3,"file":"IModelHierarchyNode.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA2N1D,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,sBAAsB,CAatC;AAbD,WAAiB,sBAAsB;IACrC,sDAAsD;IACtD,SAAgB,SAAS,CAAC,IAA4B;QACpD,OAAO,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,gCAAS,YAExB,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAAC,IAA4B;QAC1D,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,sCAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAAC,IAA4B;QACzD,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,qCAAc,iBAE7B,CAAA;AACH,CAAC,EAbgB,sBAAsB,KAAtB,sBAAsB,QAatC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\nimport type { ConcatenatedValue, EC, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport type { GroupingHierarchyNode, NonGroupingHierarchyNode } from \"../HierarchyNode.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * Base processing parameters that apply to every node.\n * @public\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n * @public\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n * @public\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n * @public\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n * @public\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @public\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @public\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n * @public\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n * @public\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: EC.FullClassName[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @public\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: EC.FullClassName;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @public\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue | ConcatenatedValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @public\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @public\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A generic (not based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: GenericNodeKey;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @public\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @public\n */\nexport type ProcessedHierarchyNode = ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace ProcessedHierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric(node: ProcessedHierarchyNode): node is ProcessedGenericHierarchyNode {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode(node: ProcessedHierarchyNode): node is ProcessedInstanceHierarchyNode {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode(node: ProcessedHierarchyNode): node is ProcessedGroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n}\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned by hierarchy definitions as a generic node or when the node is just parsed from query results.\n * @public\n */\nexport type SourceHierarchyNode<TBase = SourceGenericHierarchyNode | SourceInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n\n/**\n * A kind of `ProcessedGenericHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceGenericHierarchyNode = SourceHierarchyNode<Omit<ProcessedGenericHierarchyNode, \"key\"> & { key: string }>;\n\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceInstanceHierarchyNode = SourceHierarchyNode<\n Omit<ProcessedInstanceHierarchyNode, \"key\"> & {\n key: Omit<InstancesNodeKey, \"instanceKeys\"> & { instanceKeys: InstanceKey[] };\n }\n>;\n"]}
@@ -1,5 +1,5 @@
1
1
  import "../internal/DisposePolyfill.js";
2
- import { HierarchySearchPath } from "../HierarchySearch.js";
2
+ import { HierarchySearchTree } from "../HierarchySearch.js";
3
3
  import type { ECClassHierarchyInspector, ECSchemaProvider, Event, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
4
4
  import type { HierarchyProvider } from "../HierarchyProvider.js";
5
5
  import type { HierarchyDefinition } from "./IModelHierarchyDefinition.js";
@@ -62,10 +62,15 @@ interface IModelHierarchyProviderProps {
62
62
  * by calling `setFormatter` on the provider instance.
63
63
  */
64
64
  formatter?: IPrimitiveValueFormatter;
65
- /** Props for search the hierarchy. */
65
+ /**
66
+ * Props for searching the hierarchy.
67
+ *
68
+ * Note: this just provides a quick way to set the search when creating a new hierarchy provider, but the
69
+ * search can be changed at any time by calling `setHierarchySearch` on the provider instance.
70
+ */
66
71
  search?: {
67
- /** A list of node identifiers from root to target node. */
68
- paths: HierarchySearchPath[];
72
+ /** A list of search trees that define paths from root to search target nodes. */
73
+ paths: HierarchySearchTree[];
69
74
  };
70
75
  }
71
76
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyProvider.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyProvider.ts"],"names":[],"mappings":"AAKA,OAAO,gCAAgC,CAAC;AA6BxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA4B5D,OAAO,KAAK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G,eAAe,CAAC;IACvH;;;;;OAKG;IACH,OAAO,EAAE,KAAK,CAAC;QACb;;;;;;WAMG;QACH,YAAY,EAAE,YAAY,CAAC;QAE3B;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,kCAAkC,GAAG,iBAAiB,GAAG,UAAU,CAE7H"}
1
+ {"version":3,"file":"IModelHierarchyProvider.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyProvider.ts"],"names":[],"mappings":"AAKA,OAAO,gCAAgC,CAAC;AA6BxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA4B5D,OAAO,KAAK,EAEV,yBAAyB,EACzB,gBAAgB,EAGhB,KAAK,EAEL,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEzF,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AASlF;;;GAGG;AACH,UAAU,uCAAuC;IAC/C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,cAAc;AACd,KAAK,YAAY,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,yBAAyB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtH;;;GAGG;AACH,UAAU,4BAA4B;IACpC;;;;;;OAMG;IACH,YAAY,EAAE,YAAY,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IAEzC,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,OAAO,CAAC,uCAAuC,CAAC,CAAC;IAEpE;;;;OAIG;IACH,SAAS,CAAC,EAAE,wBAAwB,CAAC;IAErC;;;;;OAKG;IACH,MAAM,CAAC,EAAE;QACP,iFAAiF;QACjF,KAAK,EAAE,mBAAmB,EAAE,CAAC;KAC9B,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,4BAA4B,GAAG,iBAAiB,GAAG,UAAU,CAGjH;AAED;;;GAGG;AACH,UAAU,kCAAmC,SAAQ,IAAI,CAAC,4BAA4B,EAAE,cAAc,GAAG,eAAe,CAAC;IACvH;;;;;OAKG;IACH,OAAO,EAAE,KAAK,CAAC;QACb;;;;;;WAMG;QACH,YAAY,EAAE,YAAY,CAAC;QAE3B;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,kCAAkC,GAAG,iBAAiB,GAAG,UAAU,CAE7H"}
@@ -9,7 +9,7 @@ import { createDefaultValueFormatter, formatConcatenatedValue, InstanceKey, norm
9
9
  import { RowsLimitExceededError } from "../HierarchyErrors.js";
10
10
  import { HierarchyNode } from "../HierarchyNode.js";
11
11
  import { HierarchyNodeKey } from "../HierarchyNodeKey.js";
12
- import { HierarchySearchPath } from "../HierarchySearch.js";
12
+ import { HierarchySearchTree } from "../HierarchySearch.js";
13
13
  import { LOGGING_NAMESPACE as BASE_LOGGING_NAMESPACE, LOGGING_NAMESPACE_INTERNAL as BASE_LOGGING_NAMESPACE_INTERNAL, LOGGING_NAMESPACE_PERFORMANCE as BASE_LOGGING_NAMESPACE_PERFORMANCE, createNodeIdentifierForLogging, hasChildren, } from "../internal/Common.js";
14
14
  import { eachValueFrom } from "../internal/EachValueFrom.js";
15
15
  import { doLog, log } from "../internal/LoggingUtils.js";
@@ -521,47 +521,56 @@ function mergeNodes(source) {
521
521
  return acc;
522
522
  }, new Array()), mergeAll());
523
523
  }
524
- function mergeSearchProps(primary, secondary) {
525
- if (!primary || !secondary) {
526
- return primary ?? secondary;
524
+ function mergeSearchAttribute(primary, secondary) {
525
+ if (!primary) {
526
+ return secondary;
527
+ }
528
+ if (!secondary) {
529
+ return primary;
527
530
  }
528
531
  const hasSearchTargetAncestor = primary.hasSearchTargetAncestor || secondary.hasSearchTargetAncestor;
529
- const childrenTargetPaths = [...(primary.childrenTargetPaths ?? []), ...(secondary.childrenTargetPaths ?? [])];
532
+ const isSearchTarget = primary.isSearchTarget || secondary.isSearchTarget;
533
+ const searchOptions = HierarchySearchTree.mergeOptions(primary.options, secondary.options);
534
+ const childrenTargetPathsBuilder = HierarchySearchTree.createBuilder();
535
+ primary.childrenTargetPaths?.forEach((tree) => childrenTargetPathsBuilder.accept({ tree }));
536
+ secondary.childrenTargetPaths?.forEach((tree) => childrenTargetPathsBuilder.accept({ tree }));
537
+ const childrenTargetPaths = childrenTargetPathsBuilder.getTree();
530
538
  return {
531
539
  ...(hasSearchTargetAncestor ? { hasSearchTargetAncestor } : undefined),
532
540
  ...(childrenTargetPaths.length ? { childrenTargetPaths } : undefined),
533
- ...(primary.isSearchTarget || secondary.isSearchTarget
534
- ? {
535
- isSearchTarget: true,
536
- searchTargetOptions: HierarchySearchPath.mergeOptions(primary.isSearchTarget ? primary.searchTargetOptions : undefined, secondary.isSearchTarget ? secondary.searchTargetOptions : undefined),
537
- }
538
- : {
539
- isSearchTarget: false,
540
- }),
541
+ ...(isSearchTarget ? { isSearchTarget } : undefined),
542
+ ...(searchOptions ? { options: searchOptions } : undefined),
543
+ };
544
+ }
545
+ function mergeBaseNodeAttributes(primary, secondary) {
546
+ const search = mergeSearchAttribute(primary.search, secondary.search);
547
+ return {
548
+ ...(primary.autoExpand || secondary.autoExpand ? { autoExpand: true } : undefined),
549
+ ...(primary.children && secondary.children ? { children: true } : undefined),
550
+ ...(primary.supportsFiltering || secondary.supportsFiltering ? { supportsFiltering: true } : undefined),
551
+ ...(search ? { search } : undefined),
541
552
  };
542
553
  }
543
554
  function tryMergeInstanceNodes(primary, secondary) {
544
555
  if (HierarchyNode.isInstancesNode(primary) &&
545
556
  HierarchyNode.isInstancesNode(secondary) &&
546
557
  primary.key.instanceKeys.some((lhsKey) => secondary.key.instanceKeys.some((rhsKey) => InstanceKey.equals(lhsKey, rhsKey)))) {
547
- const searchProps = mergeSearchProps(primary.search, secondary.search);
548
558
  return {
549
559
  ...primary,
550
560
  key: {
551
561
  type: "instances",
552
562
  instanceKeys: primary.key.instanceKeys.concat(secondary.key.instanceKeys),
553
563
  },
554
- ...(searchProps ? { search: searchProps } : undefined),
564
+ ...mergeBaseNodeAttributes(primary, secondary),
555
565
  };
556
566
  }
557
567
  return undefined;
558
568
  }
559
569
  function tryMergeGenericNodes(primary, secondary) {
560
570
  if (HierarchyNode.isGeneric(primary) && HierarchyNode.isGeneric(secondary) && primary.key.id === secondary.key.id) {
561
- const searchProps = mergeSearchProps(primary.search, secondary.search);
562
571
  return {
563
572
  ...primary,
564
- ...(searchProps ? { search: searchProps } : undefined),
573
+ ...mergeBaseNodeAttributes(primary, secondary),
565
574
  };
566
575
  }
567
576
  return undefined;