@itwin/presentation-hierarchies 1.2.1 → 1.4.0

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 (71) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +4 -3
  3. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +48 -3
  4. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +1 -1
  5. package/lib/cjs/hierarchies/HierarchyFiltering.js +137 -2
  6. package/lib/cjs/hierarchies/HierarchyFiltering.js.map +1 -1
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts +1 -0
  8. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNode.js +3 -0
  10. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  11. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +45 -8
  12. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  13. package/lib/cjs/hierarchies/HierarchyProvider.js +7 -6
  14. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  15. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +3 -6
  16. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -1
  17. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js +134 -181
  18. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -1
  19. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +2 -0
  20. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  21. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +16 -8
  22. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  23. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  24. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  25. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +1 -1
  26. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  27. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +12 -0
  28. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  29. package/lib/cjs/hierarchies/internal/Common.d.ts +14 -0
  30. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  31. package/lib/cjs/hierarchies/internal/Common.js +18 -0
  32. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  33. package/lib/cjs/presentation-hierarchies.d.ts +1 -1
  34. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
  35. package/lib/cjs/presentation-hierarchies.js +3 -2
  36. package/lib/cjs/presentation-hierarchies.js.map +1 -1
  37. package/lib/esm/hierarchies/HierarchyFiltering.d.ts +48 -3
  38. package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +1 -1
  39. package/lib/esm/hierarchies/HierarchyFiltering.js +136 -2
  40. package/lib/esm/hierarchies/HierarchyFiltering.js.map +1 -1
  41. package/lib/esm/hierarchies/HierarchyNode.d.ts +1 -0
  42. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  43. package/lib/esm/hierarchies/HierarchyNode.js +3 -0
  44. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  45. package/lib/esm/hierarchies/HierarchyProvider.d.ts +45 -8
  46. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  47. package/lib/esm/hierarchies/HierarchyProvider.js +8 -7
  48. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  49. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +3 -6
  50. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -1
  51. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js +132 -180
  52. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -1
  53. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +2 -0
  54. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  55. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +16 -8
  56. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  57. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  58. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  59. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +1 -1
  60. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  61. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +12 -0
  62. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  63. package/lib/esm/hierarchies/internal/Common.d.ts +14 -0
  64. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  65. package/lib/esm/hierarchies/internal/Common.js +17 -0
  66. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  67. package/lib/esm/presentation-hierarchies.d.ts +1 -1
  68. package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
  69. package/lib/esm/presentation-hierarchies.js +1 -1
  70. package/lib/esm/presentation-hierarchies.js.map +1 -1
  71. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"PredicateBasedHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/PredicateBasedHierarchyDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA4IpD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AE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EACvE,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,KAAK,CAAC,CAAC,EACxD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,EACtD,QAAQ,EAAE,CACX,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,YAA2B;IAC1D,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC3D,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3B,IAAI,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,EAAE,CAAC;YACjB,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC;QACD,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,SAAS,0CAA0C,CAAC,GAA2C;IAC7F,OAAO,CAAC,CAAE,GAAgD,CAAC,0BAA0B,CAAC;AACxF,CAAC;AAED,SAAS,4CAA4C,CAAC,GAA2C;IAC/F,OAAO,CAAC,CAAE,GAAkD,CAAC,4BAA4B,CAAC;AAC5F,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 { concatMap, filter, firstValueFrom, from, mergeAll, mergeMap, toArray } from \"rxjs\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, InstanceKey } from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../HierarchyNode.js\";\nimport { GenericNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey.js\";\nimport { DefineHierarchyLevelProps, HierarchyDefinition, HierarchyDefinitionParentNode, HierarchyLevelDefinition } from \"./IModelHierarchyDefinition.js\";\n\n/**\n * Props for defining child hierarchy level for specific parent instance node.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineInstanceNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent instance node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: InstancesNodeKey };\n\n /**\n * Full name of the parent instance node class.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeClassName: string;\n\n /**\n * ECInstanceIds of the parent instance node.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeInstanceIds: Id64String[];\n};\n\n/**\n * A definition of a hierarchy level that should be used for specific parent instance nodes.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ninterface InstancesNodeChildHierarchyLevelDefinition {\n /**\n * A predicate for matching the parent instances node. This can be either a string or a predicate function:\n *\n * - The string version should specify full name of the parent instance node's class to match against when\n * checking if this hierarchy level should be used for specific parent instance node. The check is polymorphic,\n * so `BisCore.Element` class would match `BisCore.GeometricElement`, `BisCore.Category` and all other element classes.\n *\n * - The function version should return a boolean indicating whether this hierarchy level definition should be used\n * for the given parent node.\n */\n parentInstancesNodePredicate: string | ((parentNodeKey: InstancesNodeKey) => Promise<boolean>);\n\n /**\n * Called to create a hierarchy level definition when the `parentInstancesNodePredicate` predicate passes.\n */\n definitions: (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * If set to true, and node matches at least one of the previous definitions, this definition will not be applied.\n *\n * For example:\n * ```ts\n * {\n * parentInstancesNodePredicate: \"BisCore.GeometricElement3d\",\n * definitions: () => ...,\n * },\n * // This will apply to all elements, that are not `BisCore.GeometricElement3d`\n * {\n * parentInstancesNodePredicate: \"BisCore.Element\",\n * onlyIfNotHandled: true,\n * definitions: () => ...,\n * }\n * ```\n */\n onlyIfNotHandled?: boolean;\n}\n\n/**\n * Props for defining child hierarchy level for specific generic parent node.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineGenericNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent generic node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: GenericNodeKey };\n};\n\n/**\n * A definition of a hierarchy level for that should be used for specific generic parent nodes.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ninterface GenericNodeChildHierarchyLevelDefinition {\n /**\n * A function that indicates whether this hierarchy level definition should be used for\n * specific parent generic node.\n */\n parentGenericNodePredicate: (parentNodeKey: GenericNodeKey) => Promise<boolean>;\n\n /**\n * Called to create a hierarchy level definition when the `parentInstancesNodePredicate` predicate passes.\n */\n definitions: (requestProps: DefineGenericNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * A hierarchy level definition associated with specific parent instance or generic node. *\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ntype PredicateBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefinition | GenericNodeChildHierarchyLevelDefinition;\n\n/**\n * Props for defining root hierarchy level.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineRootHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\">;\n\n/**\n * Props for `createPredicateBasedHierarchyDefinition`.\n * @public\n */\ninterface PredicateBasedHierarchyDefinitionProps {\n /** Access to ECClass hierarchy in the iModel */\n classHierarchyInspector: ECClassHierarchyInspector;\n\n /** Hierarchy level definitions */\n hierarchy: {\n /** Called to create the root hierarchy level definition. */\n rootNodes: (props: DefineRootHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * A list of child hierarchy level definitions. The list is first filtered based on\n * the parent node and then is used to create child hierarchy level definitions.\n */\n childNodes: PredicateBasedHierarchyLevelDefinition[];\n };\n}\n\n/**\n * Creates an instance of `HierarchyDefinition` that uses a somewhat declarative approach to define the\n * hierarchy - each hierarchy level is defined by specifying a parent node predicate and child hierarchy\n * level definitions, that are used when the predicate passes.\n *\n * @public\n */\nexport function createPredicateBasedHierarchyDefinition(props: PredicateBasedHierarchyDefinitionProps): HierarchyDefinition {\n return new PredicateBasedHierarchyDefinition(props);\n}\n\nclass PredicateBasedHierarchyDefinition implements HierarchyDefinition {\n public constructor(private _props: PredicateBasedHierarchyDefinitionProps) {}\n\n /**\n * Create hierarchy level definitions for specific hierarchy level.\n * @param parentNode Parent node to create children definitions for.\n */\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNode } = props;\n\n if (parentNode && HierarchyNode.isGeneric(parentNode)) {\n return firstValueFrom(\n from(this._props.hierarchy.childNodes).pipe(\n filter(isGenericNodeChildHierarchyLevelDefinition),\n mergeMap(async (def) => {\n if (await def.parentGenericNodePredicate(parentNode.key)) {\n return def.definitions({ ...props, parentNode });\n }\n return [];\n }),\n mergeAll(),\n toArray(),\n ),\n );\n }\n\n if (parentNode && HierarchyNode.isInstancesNode(parentNode)) {\n const instancesParentNodeDefs = this._props.hierarchy.childNodes.filter(isInstancesNodeChildHierarchyLevelDefinition);\n return firstValueFrom(\n from(groupInstanceIdsByClass(parentNode.key.instanceKeys).entries()).pipe(\n mergeMap(async ([parentNodeClassName, parentNodeInstanceIds]) =>\n createHierarchyLevelDefinitions(this._props.classHierarchyInspector, instancesParentNodeDefs, {\n ...props,\n parentNodeClassName,\n parentNodeInstanceIds,\n parentNode,\n }),\n ),\n mergeAll(),\n toArray(),\n ),\n );\n }\n\n return this._props.hierarchy.rootNodes(props);\n }\n}\n\nasync function createHierarchyLevelDefinitions(\n classHierarchy: ECClassHierarchyInspector,\n defs: InstancesNodeChildHierarchyLevelDefinition[],\n requestProps: DefineInstanceNodeChildHierarchyLevelProps,\n) {\n return from(defs).pipe(\n mergeMap(async (def, idx) => {\n if (\n typeof def.parentInstancesNodePredicate === \"string\" &&\n (await classHierarchy.classDerivesFrom(requestProps.parentNodeClassName, def.parentInstancesNodePredicate))\n ) {\n return { def, idx };\n }\n if (typeof def.parentInstancesNodePredicate === \"function\" && (await def.parentInstancesNodePredicate(requestProps.parentNode.key))) {\n return { def, idx };\n }\n return undefined;\n }),\n filter((x): x is Exclude<typeof x, undefined> => !!x),\n toArray(),\n concatMap((x) => x.sort((a, b) => a.idx - b.idx).map(({ def }) => def)),\n filter((def, idx) => !def.onlyIfNotHandled || idx === 0),\n mergeMap(async (def) => def.definitions(requestProps)),\n mergeAll(),\n );\n}\n\nfunction groupInstanceIdsByClass(instanceKeys: InstanceKey[]) {\n const instanceIdsByClass = new Map<string, Id64String[]>();\n instanceKeys.forEach((key) => {\n let instanceIds = instanceIdsByClass.get(key.className);\n if (!instanceIds) {\n instanceIds = [];\n instanceIdsByClass.set(key.className, instanceIds);\n }\n instanceIds.push(key.id);\n });\n return instanceIdsByClass;\n}\n\nfunction isGenericNodeChildHierarchyLevelDefinition(def: PredicateBasedHierarchyLevelDefinition): def is GenericNodeChildHierarchyLevelDefinition {\n return !!(def as GenericNodeChildHierarchyLevelDefinition).parentGenericNodePredicate;\n}\n\nfunction isInstancesNodeChildHierarchyLevelDefinition(def: PredicateBasedHierarchyLevelDefinition): def is InstancesNodeChildHierarchyLevelDefinition {\n return !!(def as InstancesNodeChildHierarchyLevelDefinition).parentInstancesNodePredicate;\n}\n"]}
1
+ {"version":3,"file":"PredicateBasedHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/PredicateBasedHierarchyDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoJpD;;;;;;GAMG;AACH,MAAM,UAAU,uCAAuC,CAAC,KAA6C;IACnG,OAAO,IAAI,iCAAiC,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,iCAAiC;IAKV;IAJpB,SAAS,CAAyB;IAClC,cAAc,CAA+B;IAC7C,eAAe,CAAgC;IAEtD,YAA2B,MAA8C;QAA9C,WAAM,GAAN,MAAM,CAAwC;QACvE,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;QACzC,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QACnD,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YAChC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QACrD,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,oBAAoB,CAAC,KAAgC;QAChE,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QAE7B,IAAI,UAAU,IAAI,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;YACtD,OAAO,cAAc,CACnB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU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AAI,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,EAAE,CAAC;YACjB,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC;QACD,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,SAAS,0CAA0C,CAAC,GAA2C;IAC7F,OAAO,CAAC,CAAE,GAAgD,CAAC,0BAA0B,CAAC;AACxF,CAAC;AAED,SAAS,4CAA4C,CAAC,GAA2C;IAC/F,OAAO,CAAC,CAAE,GAAkD,CAAC,4BAA4B,CAAC;AAC5F,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 { concatMap, filter, firstValueFrom, from, mergeAll, mergeMap, toArray } from \"rxjs\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, InstanceKey } from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../HierarchyNode.js\";\nimport { GenericNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey.js\";\nimport {\n DefineHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyDefinitionParentNode,\n HierarchyLevelDefinition,\n NodeParser,\n NodePostProcessor,\n NodePreProcessor,\n} from \"./IModelHierarchyDefinition.js\";\n\n/**\n * Props for defining child hierarchy level for specific parent instance node.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineInstanceNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent instance node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: InstancesNodeKey };\n\n /**\n * Full name of the parent instance node class.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeClassName: string;\n\n /**\n * ECInstanceIds of the parent instance node.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeInstanceIds: Id64String[];\n};\n\n/**\n * A definition of a hierarchy level that should be used for specific parent instance nodes.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ninterface InstancesNodeChildHierarchyLevelDefinition {\n /**\n * A predicate for matching the parent instances node. This can be either a string or a predicate function:\n *\n * - The string version should specify full name of the parent instance node's class to match against when\n * checking if this hierarchy level should be used for specific parent instance node. The check is polymorphic,\n * so `BisCore.Element` class would match `BisCore.GeometricElement`, `BisCore.Category` and all other element classes.\n *\n * - The function version should return a boolean indicating whether this hierarchy level definition should be used\n * for the given parent node.\n */\n parentInstancesNodePredicate: string | ((parentNodeKey: InstancesNodeKey) => Promise<boolean>);\n\n /**\n * Called to create a hierarchy level definition when the `parentInstancesNodePredicate` predicate passes.\n */\n definitions: (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * If set to true, and node matches at least one of the previous definitions, this definition will not be applied.\n *\n * For example:\n * ```ts\n * {\n * parentInstancesNodePredicate: \"BisCore.GeometricElement3d\",\n * definitions: () => ...,\n * },\n * // This will apply to all elements, that are not `BisCore.GeometricElement3d`\n * {\n * parentInstancesNodePredicate: \"BisCore.Element\",\n * onlyIfNotHandled: true,\n * definitions: () => ...,\n * }\n * ```\n */\n onlyIfNotHandled?: boolean;\n}\n\n/**\n * Props for defining child hierarchy level for specific generic parent node.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineGenericNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent generic node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: GenericNodeKey };\n};\n\n/**\n * A definition of a hierarchy level for that should be used for specific generic parent nodes.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ninterface GenericNodeChildHierarchyLevelDefinition {\n /**\n * A function that indicates whether this hierarchy level definition should be used for\n * specific parent generic node.\n */\n parentGenericNodePredicate: (parentNodeKey: GenericNodeKey) => Promise<boolean>;\n\n /**\n * Called to create a hierarchy level definition when the `parentInstancesNodePredicate` predicate passes.\n */\n definitions: (requestProps: DefineGenericNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * A hierarchy level definition associated with specific parent instance or generic node. *\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\ntype PredicateBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefinition | GenericNodeChildHierarchyLevelDefinition;\n\n/**\n * Props for defining root hierarchy level.\n * @see `createPredicateBasedHierarchyDefinition`\n * @public\n */\nexport type DefineRootHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\">;\n\n/**\n * Props for `createPredicateBasedHierarchyDefinition`.\n * @public\n */\ninterface PredicateBasedHierarchyDefinitionProps extends Pick<HierarchyDefinition, \"parseNode\" | \"preProcessNode\" | \"postProcessNode\"> {\n /** Access to ECClass hierarchy in the iModel */\n classHierarchyInspector: ECClassHierarchyInspector;\n\n /** Hierarchy level definitions */\n hierarchy: {\n /** Called to create the root hierarchy level definition. */\n rootNodes: (props: DefineRootHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * A list of child hierarchy level definitions. The list is first filtered based on\n * the parent node and then is used to create child hierarchy level definitions.\n */\n childNodes: PredicateBasedHierarchyLevelDefinition[];\n };\n}\n\n/**\n * Creates an instance of `HierarchyDefinition` that uses a somewhat declarative approach to define the\n * hierarchy - each hierarchy level is defined by specifying a parent node predicate and child hierarchy\n * level definitions, that are used when the predicate passes.\n *\n * @public\n */\nexport function createPredicateBasedHierarchyDefinition(props: PredicateBasedHierarchyDefinitionProps): HierarchyDefinition {\n return new PredicateBasedHierarchyDefinition(props);\n}\n\nclass PredicateBasedHierarchyDefinition implements HierarchyDefinition {\n public parseNode: NodeParser | undefined;\n public preProcessNode: NodePreProcessor | undefined;\n public postProcessNode: NodePostProcessor | undefined;\n\n public constructor(private _props: PredicateBasedHierarchyDefinitionProps) {\n if (this._props.parseNode) {\n this.parseNode = this._props.parseNode;\n }\n if (this._props.preProcessNode) {\n this.preProcessNode = this._props.preProcessNode;\n }\n if (this._props.postProcessNode) {\n this.postProcessNode = this._props.postProcessNode;\n }\n }\n\n /**\n * Create hierarchy level definitions for specific hierarchy level.\n * @param parentNode Parent node to create children definitions for.\n */\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNode } = props;\n\n if (parentNode && HierarchyNode.isGeneric(parentNode)) {\n return firstValueFrom(\n from(this._props.hierarchy.childNodes).pipe(\n filter(isGenericNodeChildHierarchyLevelDefinition),\n mergeMap(async (def) => {\n if (await def.parentGenericNodePredicate(parentNode.key)) {\n return def.definitions({ ...props, parentNode });\n }\n return [];\n }),\n mergeAll(),\n toArray(),\n ),\n );\n }\n\n if (parentNode && HierarchyNode.isInstancesNode(parentNode)) {\n const instancesParentNodeDefs = this._props.hierarchy.childNodes.filter(isInstancesNodeChildHierarchyLevelDefinition);\n return firstValueFrom(\n from(groupInstanceIdsByClass(parentNode.key.instanceKeys).entries()).pipe(\n mergeMap(async ([parentNodeClassName, parentNodeInstanceIds]) =>\n createHierarchyLevelDefinitions(this._props.classHierarchyInspector, instancesParentNodeDefs, {\n ...props,\n parentNodeClassName,\n parentNodeInstanceIds,\n parentNode,\n }),\n ),\n mergeAll(),\n toArray(),\n ),\n );\n }\n\n return this._props.hierarchy.rootNodes(props);\n }\n}\n\nasync function createHierarchyLevelDefinitions(\n classHierarchy: ECClassHierarchyInspector,\n defs: InstancesNodeChildHierarchyLevelDefinition[],\n requestProps: DefineInstanceNodeChildHierarchyLevelProps,\n) {\n return from(defs).pipe(\n mergeMap(async (def, idx) => {\n if (\n typeof def.parentInstancesNodePredicate === \"string\" &&\n (await classHierarchy.classDerivesFrom(requestProps.parentNodeClassName, def.parentInstancesNodePredicate))\n ) {\n return { def, idx };\n }\n if (typeof def.parentInstancesNodePredicate === \"function\" && (await def.parentInstancesNodePredicate(requestProps.parentNode.key))) {\n return { def, idx };\n }\n return undefined;\n }),\n filter((x): x is Exclude<typeof x, undefined> => !!x),\n toArray(),\n concatMap((x) => x.sort((a, b) => a.idx - b.idx).map(({ def }) => def)),\n filter((def, idx) => !def.onlyIfNotHandled || idx === 0),\n mergeMap(async (def) => def.definitions(requestProps)),\n mergeAll(),\n );\n}\n\nfunction groupInstanceIdsByClass(instanceKeys: InstanceKey[]) {\n const instanceIdsByClass = new Map<string, Id64String[]>();\n instanceKeys.forEach((key) => {\n let instanceIds = instanceIdsByClass.get(key.className);\n if (!instanceIds) {\n instanceIds = [];\n instanceIdsByClass.set(key.className, instanceIds);\n }\n instanceIds.push(key.id);\n });\n return instanceIdsByClass;\n}\n\nfunction isGenericNodeChildHierarchyLevelDefinition(def: PredicateBasedHierarchyLevelDefinition): def is GenericNodeChildHierarchyLevelDefinition {\n return !!(def as GenericNodeChildHierarchyLevelDefinition).parentGenericNodePredicate;\n}\n\nfunction isInstancesNodeChildHierarchyLevelDefinition(def: PredicateBasedHierarchyLevelDefinition): def is InstancesNodeChildHierarchyLevelDefinition {\n return !!(def as InstancesNodeChildHierarchyLevelDefinition).parentInstancesNodePredicate;\n}\n"]}
@@ -40,4 +40,18 @@ export declare function compareNodesByLabel<TLhsNode extends {
40
40
  }, TRhsNode extends {
41
41
  label: string;
42
42
  }>(lhs: TLhsNode, rhs: TRhsNode): number;
43
+ /**
44
+ * A helper that disposes the given object, if it's disposable.
45
+ *
46
+ * The first option is to dispose using the deprecated `dispose` method if it exists on the object.
47
+ * If not, we use the new `Symbol.dispose` method. If that doesn't exist either, the object is
48
+ * considered as non-disposable and nothing is done with it.
49
+ *
50
+ * @internal
51
+ */
52
+ export declare function safeDispose(disposable: {} | {
53
+ [Symbol.dispose]: () => void;
54
+ } | {
55
+ dispose: () => void;
56
+ }): void;
43
57
  //# sourceMappingURL=Common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/Common.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,yCAAqC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,iDAA8C,CAAC;AAElG,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,YAAY,EACR,OAAO,iBAAiB,GACxB,OAAO,6BAA6B,GACpC,OAAO,0BAA0B,GACjC,OAAO,sCAAsC,UAGlD;AAED,gBAAgB;AAEhB,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC;IAAC,GAAG,EAAE,gBAAgB,CAAC;IAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAAG,SAAS,UAQhH;AAGD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,SAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA;CAAE,EAAE,IAAI,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AAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,SAAS;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,MAAM,CAEhJ;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,EAAE,GAAG;IAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,QAMtG"}
@@ -48,4 +48,21 @@ export function hasChildren(node) {
48
48
  export function compareNodesByLabel(lhs, rhs) {
49
49
  return naturalCompare(lhs.label.toLocaleLowerCase(), rhs.label.toLocaleLowerCase());
50
50
  }
51
+ /**
52
+ * A helper that disposes the given object, if it's disposable.
53
+ *
54
+ * The first option is to dispose using the deprecated `dispose` method if it exists on the object.
55
+ * If not, we use the new `Symbol.dispose` method. If that doesn't exist either, the object is
56
+ * considered as non-disposable and nothing is done with it.
57
+ *
58
+ * @internal
59
+ */
60
+ export function safeDispose(disposable) {
61
+ if ("dispose" in disposable) {
62
+ disposable.dispose();
63
+ }
64
+ else if (Symbol.dispose in disposable) {
65
+ disposable[Symbol.dispose]();
66
+ }
67
+ }
51
68
  //# sourceMappingURL=Common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/Common.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAIlD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,iBAAiB,cAAc,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,kCAAkC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,0BAA0B,cAAc,CAAC;AAElG,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAC5C,YAAoB,EACpB,YAIiD;IAEjD,OAAO,GAAG,YAAY,cAAc,YAAY,EAAE,CAAC;AACrD,CAAC;AAED,gBAAgB;AAChB,qBAAqB;AACrB,MAAM,UAAU,8BAA8B,CAC5C,IAA+G;IAE/G,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5B,MAAM,UAAU,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;IACxE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;AACpD,CAAC;AACD,mBAAmB;AAEnB,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAwD,IAAW;IAC5F,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC9F,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAAyE,GAAa,EAAE,GAAa;IACtI,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACtF,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 naturalCompare from \"natural-compare-lite\";\nimport { ConcatenatedValue } from \"@itwin/presentation-shared\";\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * This is a logging namespace for public log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE = \"Presentation.Hierarchies\";\n\n/**\n * This is a logging namespace for public performance-related log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE = `${LOGGING_NAMESPACE}.Performance`;\n\n/**\n * This is a logging namespace for internal log messages that are only interesting to package contributors,\n * but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_INTERNAL = \"Presentation.HierarchiesInternal\";\n\n/**\n * This is a logging namespace for internal performance-related log messages that are only interesting\n * to package contributors, but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE_INTERNAL = `${LOGGING_NAMESPACE_INTERNAL}.Performance`;\n\n/** @internal */\nexport function createOperatorLoggingNamespace(\n operatorName: string,\n baseCategory:\n | typeof LOGGING_NAMESPACE\n | typeof LOGGING_NAMESPACE_PERFORMANCE\n | typeof LOGGING_NAMESPACE_INTERNAL\n | typeof LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n) {\n return `${baseCategory}.Operators.${operatorName}`;\n}\n\n/** @internal */\n/* c8 ignore start */\nexport function createNodeIdentifierForLogging(\n node: { label: string | ConcatenatedValue; key: HierarchyNodeKey; parentKeys?: HierarchyNodeKey[] } | undefined,\n) {\n if (!node) {\n return \"<root>\";\n }\n const { label, key } = node;\n const parentKeys = \"parentKeys\" in node ? node.parentKeys : \"<unknown>\";\n return JSON.stringify({ label, key, parentKeys });\n}\n/* c8 ignore end */\n\n/** @internal */\nexport function hasChildren<TNode extends { children?: boolean | Array<unknown> }>(node: TNode) {\n return node.children === true || (Array.isArray(node.children) && node.children.length > 0);\n}\n\n/** @internal */\nexport function compareNodesByLabel<TLhsNode extends { label: string }, TRhsNode extends { label: string }>(lhs: TLhsNode, rhs: TRhsNode): number {\n return naturalCompare(lhs.label.toLocaleLowerCase(), rhs.label.toLocaleLowerCase());\n}\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BAAgB;AAChB,MAAM,UAAU,mBAAmB,CAAyE,GAAa,EAAE,GAAa;IACtI,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACtF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,UAA2E;IACrG,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;QAC5B,UAAU,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;SAAM,IAAI,MAAM,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC;QACxC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,CAAC;AACH,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 naturalCompare from \"natural-compare-lite\";\nimport { ConcatenatedValue } from \"@itwin/presentation-shared\";\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * This is a logging namespace for public log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE = \"Presentation.Hierarchies\";\n\n/**\n * This is a logging namespace for public performance-related log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE = `${LOGGING_NAMESPACE}.Performance`;\n\n/**\n * This is a logging namespace for internal log messages that are only interesting to package contributors,\n * but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_INTERNAL = \"Presentation.HierarchiesInternal\";\n\n/**\n * This is a logging namespace for internal performance-related log messages that are only interesting\n * to package contributors, but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE_INTERNAL = `${LOGGING_NAMESPACE_INTERNAL}.Performance`;\n\n/** @internal */\nexport function createOperatorLoggingNamespace(\n operatorName: string,\n baseCategory:\n | typeof LOGGING_NAMESPACE\n | typeof LOGGING_NAMESPACE_PERFORMANCE\n | typeof LOGGING_NAMESPACE_INTERNAL\n | typeof LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n) {\n return `${baseCategory}.Operators.${operatorName}`;\n}\n\n/** @internal */\n/* c8 ignore start */\nexport function createNodeIdentifierForLogging(\n node: { label: string | ConcatenatedValue; key: HierarchyNodeKey; parentKeys?: HierarchyNodeKey[] } | undefined,\n) {\n if (!node) {\n return \"<root>\";\n }\n const { label, key } = node;\n const parentKeys = \"parentKeys\" in node ? node.parentKeys : \"<unknown>\";\n return JSON.stringify({ label, key, parentKeys });\n}\n/* c8 ignore end */\n\n/** @internal */\nexport function hasChildren<TNode extends { children?: boolean | Array<unknown> }>(node: TNode) {\n return node.children === true || (Array.isArray(node.children) && node.children.length > 0);\n}\n\n/** @internal */\nexport function compareNodesByLabel<TLhsNode extends { label: string }, TRhsNode extends { label: string }>(lhs: TLhsNode, rhs: TRhsNode): number {\n return naturalCompare(lhs.label.toLocaleLowerCase(), rhs.label.toLocaleLowerCase());\n}\n\n/**\n * A helper that disposes the given object, if it's disposable.\n *\n * The first option is to dispose using the deprecated `dispose` method if it exists on the object.\n * If not, we use the new `Symbol.dispose` method. If that doesn't exist either, the object is\n * considered as non-disposable and nothing is done with it.\n *\n * @internal\n */\nexport function safeDispose(disposable: {} | { [Symbol.dispose]: () => void } | { dispose: () => void }) {\n if (\"dispose\" in disposable) {\n disposable.dispose();\n } else if (Symbol.dispose in disposable) {\n disposable[Symbol.dispose]();\n }\n}\n"]}
@@ -10,6 +10,6 @@ export { GroupingHierarchyNode, HierarchyNode, NonGroupingHierarchyNode } from "
10
10
  export { HierarchyNodeIdentifier, HierarchyNodeIdentifiersPath } from "./hierarchies/HierarchyNodeIdentifier.js";
11
11
  export { GenericNodeKey, GroupingNodeKey, HierarchyNodeKey, InstancesNodeKey, ClassGroupingNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey, IModelHierarchyNodeKey, } from "./hierarchies/HierarchyNodeKey.js";
12
12
  export { GetHierarchyNodesProps, HierarchyProvider, mergeProviders } from "./hierarchies/HierarchyProvider.js";
13
- export { HierarchyFilteringPath, extractFilteringProps } from "./hierarchies/HierarchyFiltering.js";
13
+ export { createHierarchyFilteringHelper, extractFilteringProps, HierarchyFilteringPath, HierarchyFilteringPathOptions, } from "./hierarchies/HierarchyFiltering.js";
14
14
  export { getLogger, setLogger } from "./hierarchies/Logging.js";
15
15
  //# sourceMappingURL=presentation-hierarchies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-hierarchies.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,yCAAyC,EACzC,0CAA0C,EAC1C,6BAA6B,EAC7B,uCAAuC,GACxC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AAClI,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AACrJ,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACjH,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"presentation-hierarchies.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,yCAAyC,EACzC,0CAA0C,EAC1C,6BAA6B,EAC7B,uCAAuC,GACxC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AAClI,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AACrJ,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACjH,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC"}
@@ -14,6 +14,6 @@ export { HierarchyNode } from "./hierarchies/HierarchyNode.js";
14
14
  export { HierarchyNodeIdentifier } from "./hierarchies/HierarchyNodeIdentifier.js";
15
15
  export { HierarchyNodeKey, } from "./hierarchies/HierarchyNodeKey.js";
16
16
  export { mergeProviders } from "./hierarchies/HierarchyProvider.js";
17
- export { HierarchyFilteringPath, extractFilteringProps } from "./hierarchies/HierarchyFiltering.js";
17
+ export { createHierarchyFilteringHelper, extractFilteringProps, HierarchyFilteringPath, } from "./hierarchies/HierarchyFiltering.js";
18
18
  export { getLogger, setLogger } from "./hierarchies/Logging.js";
19
19
  //# sourceMappingURL=presentation-hierarchies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-hierarchies.js","sourceRoot":"","sources":["../../src/presentation-hierarchies.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAIL,wBAAwB,GAIzB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,uCAAuC,GACxC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAA8B,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AAClI,OAAO,EAAE,2BAA2B,EAA2B,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AACrJ,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAuB,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAyB,aAAa,EAA4B,MAAM,gCAAgC,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAgC,MAAM,0CAA0C,CAAC;AACjH,OAAO,EAGL,gBAAgB,GASjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA6C,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,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\nexport { GenericInstanceFilter } from \"@itwin/core-common\";\n\nexport {\n DefineHierarchyLevelProps,\n HierarchyLevelDefinition,\n HierarchyDefinition,\n HierarchyNodesDefinition,\n NodeParser,\n NodePostProcessor,\n NodePreProcessor,\n} from \"./hierarchies/imodel/IModelHierarchyDefinition.js\";\nexport {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n DefineRootHierarchyLevelProps,\n createPredicateBasedHierarchyDefinition,\n} from \"./hierarchies/imodel/PredicateBasedHierarchyDefinition.js\";\nexport { LimitingECSqlQueryExecutor, createLimitingECSqlQueryExecutor } from \"./hierarchies/imodel/LimitingECSqlQueryExecutor.js\";\nexport { NodeSelectClauseColumnNames, NodesQueryClauseFactory, createNodesQueryClauseFactory } from \"./hierarchies/imodel/NodeSelectQueryFactory.js\";\nexport { createIModelHierarchyProvider } from \"./hierarchies/imodel/IModelHierarchyProvider.js\";\nexport { SourceHierarchyNode, ProcessedHierarchyNode } from \"./hierarchies/imodel/IModelHierarchyNode.js\";\n\nexport { RowsLimitExceededError } from \"./hierarchies/HierarchyErrors.js\";\nexport { GroupingHierarchyNode, HierarchyNode, NonGroupingHierarchyNode } from \"./hierarchies/HierarchyNode.js\";\nexport { HierarchyNodeIdentifier, HierarchyNodeIdentifiersPath } from \"./hierarchies/HierarchyNodeIdentifier.js\";\nexport {\n GenericNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n InstancesNodeKey,\n ClassGroupingNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n IModelHierarchyNodeKey,\n} from \"./hierarchies/HierarchyNodeKey.js\";\nexport { GetHierarchyNodesProps, HierarchyProvider, mergeProviders } from \"./hierarchies/HierarchyProvider.js\";\nexport { HierarchyFilteringPath, extractFilteringProps } from \"./hierarchies/HierarchyFiltering.js\";\nexport { getLogger, setLogger } from \"./hierarchies/Logging.js\";\n"]}
1
+ {"version":3,"file":"presentation-hierarchies.js","sourceRoot":"","sources":["../../src/presentation-hierarchies.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAIL,wBAAwB,GAIzB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,uCAAuC,GACxC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAA8B,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AAClI,OAAO,EAAE,2BAA2B,EAA2B,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AACrJ,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAuB,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAyB,aAAa,EAA4B,MAAM,gCAAgC,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAgC,MAAM,0CAA0C,CAAC;AACjH,OAAO,EAGL,gBAAgB,GASjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA6C,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,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\nexport { GenericInstanceFilter } from \"@itwin/core-common\";\n\nexport {\n DefineHierarchyLevelProps,\n HierarchyLevelDefinition,\n HierarchyDefinition,\n HierarchyNodesDefinition,\n NodeParser,\n NodePostProcessor,\n NodePreProcessor,\n} from \"./hierarchies/imodel/IModelHierarchyDefinition.js\";\nexport {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n DefineRootHierarchyLevelProps,\n createPredicateBasedHierarchyDefinition,\n} from \"./hierarchies/imodel/PredicateBasedHierarchyDefinition.js\";\nexport { LimitingECSqlQueryExecutor, createLimitingECSqlQueryExecutor } from \"./hierarchies/imodel/LimitingECSqlQueryExecutor.js\";\nexport { NodeSelectClauseColumnNames, NodesQueryClauseFactory, createNodesQueryClauseFactory } from \"./hierarchies/imodel/NodeSelectQueryFactory.js\";\nexport { createIModelHierarchyProvider } from \"./hierarchies/imodel/IModelHierarchyProvider.js\";\nexport { SourceHierarchyNode, ProcessedHierarchyNode } from \"./hierarchies/imodel/IModelHierarchyNode.js\";\n\nexport { RowsLimitExceededError } from \"./hierarchies/HierarchyErrors.js\";\nexport { GroupingHierarchyNode, HierarchyNode, NonGroupingHierarchyNode } from \"./hierarchies/HierarchyNode.js\";\nexport { HierarchyNodeIdentifier, HierarchyNodeIdentifiersPath } from \"./hierarchies/HierarchyNodeIdentifier.js\";\nexport {\n GenericNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n InstancesNodeKey,\n ClassGroupingNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n IModelHierarchyNodeKey,\n} from \"./hierarchies/HierarchyNodeKey.js\";\nexport { GetHierarchyNodesProps, HierarchyProvider, mergeProviders } from \"./hierarchies/HierarchyProvider.js\";\nexport {\n createHierarchyFilteringHelper,\n extractFilteringProps,\n HierarchyFilteringPath,\n HierarchyFilteringPathOptions,\n} from \"./hierarchies/HierarchyFiltering.js\";\nexport { getLogger, setLogger } from \"./hierarchies/Logging.js\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/presentation-hierarchies",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "A package for creating hierarchies based on data in iTwin.js iModels.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,15 +33,15 @@
33
33
  "./package.json": "./package.json"
34
34
  },
35
35
  "dependencies": {
36
- "@itwin/core-bentley": "^4.9.0",
37
- "@itwin/core-common": "^4.9.0",
38
- "@itwin/core-geometry": "^4.9.0",
36
+ "@itwin/core-bentley": "^4.10.1",
37
+ "@itwin/core-common": "^4.10.1",
38
+ "@itwin/core-geometry": "^4.10.1",
39
39
  "natural-compare-lite": "^1.4.0",
40
40
  "rxjs": "^7.8.1",
41
- "@itwin/presentation-shared": "^1.1.0"
41
+ "@itwin/presentation-shared": "^1.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@itwin/build-tools": "^4.10.0-dev.33",
44
+ "@itwin/build-tools": "^4.10.1",
45
45
  "@itwin/eslint-plugin": "5.0.0-dev.1",
46
46
  "@types/chai": "^4.3.16",
47
47
  "@types/chai-as-promised": "^7.1.8",