@itwin/tree-widget-react 2.2.0 → 2.3.1

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 (29) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/README.md +26 -0
  3. package/lib/cjs/components/SelectableTree.d.ts +2 -0
  4. package/lib/cjs/components/SelectableTree.js +1 -0
  5. package/lib/cjs/components/SelectableTree.js.map +1 -1
  6. package/lib/cjs/components/TreeSelector.d.ts +1 -0
  7. package/lib/cjs/components/TreeSelector.js +1 -1
  8. package/lib/cjs/components/TreeSelector.js.map +1 -1
  9. package/lib/cjs/components/trees/models-tree/ModelsTree.js +2 -3
  10. package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -1
  11. package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.d.ts +1 -0
  12. package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +48 -15
  13. package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
  14. package/lib/cjs/components/trees/models-tree/Utils.js +0 -22
  15. package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
  16. package/lib/esm/components/SelectableTree.d.ts +2 -0
  17. package/lib/esm/components/SelectableTree.js +1 -0
  18. package/lib/esm/components/SelectableTree.js.map +1 -1
  19. package/lib/esm/components/TreeSelector.d.ts +1 -0
  20. package/lib/esm/components/TreeSelector.js +1 -1
  21. package/lib/esm/components/TreeSelector.js.map +1 -1
  22. package/lib/esm/components/trees/models-tree/ModelsTree.js +2 -3
  23. package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -1
  24. package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.d.ts +1 -0
  25. package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +48 -15
  26. package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
  27. package/lib/esm/components/trees/models-tree/Utils.js +0 -22
  28. package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../src/components/trees/models-tree/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAQrD,gBAAgB;AAChB,MAAM,OAAO,0BAA0B;IAErC,YAAoB,UAAsC;QAAtC,eAAU,GAAV,UAAU,CAA4B;QADlD,SAAI,GAAG,IAAI,KAAK,EAAc,CAAC;IACsB,CAAC;IAEtD,KAAK,CAAC,IAAI;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;IAC9C,CAAC;IAEM,KAAK,CAAC,CAAC,aAAa;QACzB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;YAC1B,MAAM,EAAE,CAAC;SACV;QAED,IAAI,MAAM,CAAC;QACX,OAAO,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE;YACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,MAAM,MAAM,CAAC;SACd;IACH,CAAC;CACF;AAOD,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,OAAO,GAA0B;QACrC,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE;QACxH,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B;QAClD,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe;KACzC,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,8BAA8B;QAClC,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,SAAS;aAChB;SACF;QACD,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,IAAI;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AAC,CAAC,QAAQ,WAAW,EAAE,EAAE,CAAC;IAE3F,OAAO;QACL,QAAQ,EAAE,sBAAsB;QAChC,iBAAiB,EAAE;YACjB;gBACE,YAAY,EAAE;oBACZ,UAAU,EAAE,SAAS;oBACrB,SAAS,EAAE,mBAAmB;iBAC/B;gBACD,SAAS,EAAE,SAAS;gBACpB,WAAW,EAAE;oBACX,UAAU,EAAE,SAAS;oBACrB,SAAS,EAAE,kBAAkB;iBAC9B;aACF;SACF;QACD,cAAc;QACd,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,KAAK;KACpB,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,0BAA0B,CAAC,IAAsC,EAAE,IAAmB;IACpG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;AAC5H,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAAwB;IACxE,MAAM,WAAW,GAAqB;QACpC,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE;;;;;;;OAOJ;QACH,WAAW,EAAE,KAAK;KACnB,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAyB,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAgB,CAAC;AAC/I,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 type { GeometricModel3dProps, ModelQueryParams } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { NodeKey } from \"@itwin/presentation-common\";\n\nimport type { ModelInfo } from \"./ModelsTreeComponent\";\n\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type { ChildNodeSpecification, Node, Ruleset, SingleSchemaClassSpecification } from \"@itwin/presentation-common\";\nimport type { DelayLoadedTreeNodeItem } from \"@itwin/components-react\";\nimport type { ModelsTreeHierarchyConfiguration } from \"./ModelsTree\";\n/** @internal */\nexport class CachingElementIdsContainer {\n private _ids = new Array<Id64String>();\n constructor(private _generator: AsyncGenerator<Id64String>) {}\n\n private async next() {\n return (await this._generator.next()).value;\n }\n\n public async *getElementIds() {\n for (const id of this._ids) {\n yield id;\n }\n\n let nextId;\n while ((nextId = await this.next())) {\n this._ids.push(nextId);\n yield nextId;\n }\n }\n}\n\n/** @internal */\nexport type CreateRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\"> & {\n enableElementsClassGrouping?: boolean;\n};\n\n/** @internal */\nexport function createRuleset(props: CreateRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: !!props.enableElementsClassGrouping,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTree\",\n requiredSchemas: [\n {\n name: \"BisCore\",\n },\n ],\n rules: [\n {\n ruleType: \"RootNodes\",\n autoExpand: true,\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createRelatedHierarchySubjectSpecification(), createRelatedNonHierarchySubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createNonContentModelsSpecification(context), createContentModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"ISubModeledElement\", \"BisCore\")`,\n specifications: [createElementModelSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelCategoriesSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isCategory: \"true\",\n modelId: \"ParentNode.InstanceId\",\n icon: '\"icon-layers\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"SpatialCategory\", \"BisCore\")`,\n specifications: [createCategoryElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricElement3d\", \"BisCore\")`,\n specifications: [createEementElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"SpatialCategory\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Content\",\n condition: `ContentDisplayType = \"AssemblyElementsRequest\"`,\n specifications: [\n {\n specType: \"SelectedNodeInstances\",\n },\n {\n specType: \"ContentRelatedInstances\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n count: \"*\",\n },\n ],\n },\n ],\n },\n ],\n };\n}\n\n/** @internal */\nexport type CreateSearchRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\">;\n\n/** @internal */\nexport function createSearchRuleset(props: CreateSearchRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: false,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTreeSearch\",\n rules: [\n {\n ruleType: \"RootNodes\",\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createRelatedHierarchySubjectSpecification(),\n {\n ...createRelatedNonHierarchySubjectSpecification(),\n hideExpression: `NOT ThisNode.HasChildren ANDALSO NOT ThisNode.ChildrenArtifacts.AnyMatches(x => x.isContentModel)`,\n hideIfNoChildren: undefined,\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createNonContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"NodeArtifacts\",\n items: {\n isContentModel: \"true\",\n },\n },\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelSubModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n ],\n };\n}\n\ninterface SpecificationsContext {\n elementClassSpecification: SingleSchemaClassSpecification;\n groupElements: boolean;\n showEmptyModels: boolean;\n}\n\nfunction createRootSubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: [\n {\n schemaName: \"BisCore\",\n classNames: [\"Subject\"],\n },\n ],\n instanceFilter: `this.Parent = NULL`,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") <> NULL OR ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") = \"Hierarchy\"`,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedNonHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") = NULL AND ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") <> \"Hierarchy\"`,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createNonContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasNoContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND ${hasNoContent}${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND (${hasContent})${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createElementModelSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Backward\",\n },\n ],\n instanceFilter,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createModelCategoriesSpecification({ elementClassSpecification }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelContainsElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Forward\",\n },\n ],\n ],\n instanceFilter: `NOT this.IsPrivate`,\n suppressSimilarAncestorsCheck: true,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createCategoryElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Backward\",\n targetClass: elementClassSpecification,\n },\n ],\n instanceFilter: `this.Model.Id = parent.parent.ECInstanceId ANDALSO this.Parent = NULL`,\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createEementElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n ],\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createModelSubModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelOwnsSubModel\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"GeometricModel3d\",\n },\n },\n ],\n instanceFilter,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\n/** @internal */\nexport function addModelsTreeNodeItemIcons(item: Partial<DelayLoadedTreeNodeItem>, node: Partial<Node>) {\n item.icon = node.key && NodeKey.isClassGroupingNodeKey(node.key) ? node.extendedData?.groupIcon : node.extendedData?.icon;\n}\n\n/** @internal */\nexport async function queryModelsForHeaderActions(iModel: IModelConnection) {\n const queryParams: ModelQueryParams = {\n from: \"BisCore.GeometricModel3d\",\n where: `\n EXISTS (\n SELECT 1\n FROM BisCore.Element e\n WHERE e.ECClassId IS (BisCore.GeometricElement3d, BisCore.InformationPartitionElement)\n AND e.ECInstanceId = GeometricModel3d.ModeledElement.Id\n )\n `,\n wantPrivate: false,\n };\n\n const modelProps = await iModel.models.queryProps(queryParams);\n return modelProps.map(({ id, isPlanProjection }: GeometricModel3dProps) => ({ id, isPlanProjection })).filter(({ id }) => id) as ModelInfo[];\n}\n"]}
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../src/components/trees/models-tree/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAQrD,gBAAgB;AAChB,MAAM,OAAO,0BAA0B;IAErC,YAAoB,U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YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;AAC5H,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAAwB;IACxE,MAAM,WAAW,GAAqB;QACpC,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE;;;;;;;OAOJ;QACH,WAAW,EAAE,KAAK;KACnB,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAyB,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAgB,CAAC;AAC/I,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 type { GeometricModel3dProps, ModelQueryParams } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { NodeKey } from \"@itwin/presentation-common\";\n\nimport type { ModelInfo } from \"./ModelsTreeComponent\";\n\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type { ChildNodeSpecification, Node, Ruleset, SingleSchemaClassSpecification } from \"@itwin/presentation-common\";\nimport type { DelayLoadedTreeNodeItem } from \"@itwin/components-react\";\nimport type { ModelsTreeHierarchyConfiguration } from \"./ModelsTree\";\n/** @internal */\nexport class CachingElementIdsContainer {\n private _ids = new Array<Id64String>();\n constructor(private _generator: AsyncGenerator<Id64String>) {}\n\n private async next() {\n return (await this._generator.next()).value;\n }\n\n public async *getElementIds() {\n for (const id of this._ids) {\n yield id;\n }\n\n let nextId;\n while ((nextId = await this.next())) {\n this._ids.push(nextId);\n yield nextId;\n }\n }\n}\n\n/** @internal */\nexport type CreateRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\"> & {\n enableElementsClassGrouping?: boolean;\n};\n\n/** @internal */\nexport function createRuleset(props: CreateRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: !!props.enableElementsClassGrouping,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTree\",\n requiredSchemas: [\n {\n name: \"BisCore\",\n },\n ],\n rules: [\n {\n ruleType: \"RootNodes\",\n autoExpand: true,\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createRelatedHierarchySubjectSpecification(), createRelatedNonHierarchySubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createNonContentModelsSpecification(context), createContentModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"ISubModeledElement\", \"BisCore\")`,\n specifications: [createElementModelSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelCategoriesSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isCategory: \"true\",\n modelId: \"ParentNode.InstanceId\",\n icon: '\"icon-layers\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"SpatialCategory\", \"BisCore\")`,\n specifications: [createCategoryElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricElement3d\", \"BisCore\")`,\n specifications: [createEementElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"SpatialCategory\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n ],\n };\n}\n\n/** @internal */\nexport type CreateSearchRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\">;\n\n/** @internal */\nexport function createSearchRuleset(props: CreateSearchRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: false,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTreeSearch\",\n rules: [\n {\n ruleType: \"RootNodes\",\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createRelatedHierarchySubjectSpecification(),\n {\n ...createRelatedNonHierarchySubjectSpecification(),\n hideExpression: `NOT ThisNode.HasChildren ANDALSO NOT ThisNode.ChildrenArtifacts.AnyMatches(x => x.isContentModel)`,\n hideIfNoChildren: undefined,\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createNonContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"NodeArtifacts\",\n items: {\n isContentModel: \"true\",\n },\n },\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelSubModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n ],\n };\n}\n\ninterface SpecificationsContext {\n elementClassSpecification: SingleSchemaClassSpecification;\n groupElements: boolean;\n showEmptyModels: boolean;\n}\n\nfunction createRootSubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: [\n {\n schemaName: \"BisCore\",\n classNames: [\"Subject\"],\n },\n ],\n instanceFilter: `this.Parent = NULL`,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") <> NULL OR ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") = \"Hierarchy\"`,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedNonHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") = NULL AND ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") <> \"Hierarchy\"`,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createNonContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasNoContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND ${hasNoContent}${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND (${hasContent})${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createElementModelSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Backward\",\n },\n ],\n instanceFilter,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createModelCategoriesSpecification({ elementClassSpecification }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelContainsElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Forward\",\n },\n ],\n ],\n instanceFilter: `NOT this.IsPrivate`,\n suppressSimilarAncestorsCheck: true,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createCategoryElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Backward\",\n targetClass: elementClassSpecification,\n },\n ],\n instanceFilter: `this.Model.Id = parent.parent.ECInstanceId ANDALSO this.Parent = NULL`,\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createEementElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n ],\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createModelSubModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelOwnsSubModel\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"GeometricModel3d\",\n },\n },\n ],\n instanceFilter,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\n/** @internal */\nexport function addModelsTreeNodeItemIcons(item: Partial<DelayLoadedTreeNodeItem>, node: Partial<Node>) {\n item.icon = node.key && NodeKey.isClassGroupingNodeKey(node.key) ? node.extendedData?.groupIcon : node.extendedData?.icon;\n}\n\n/** @internal */\nexport async function queryModelsForHeaderActions(iModel: IModelConnection) {\n const queryParams: ModelQueryParams = {\n from: \"BisCore.GeometricModel3d\",\n where: `\n EXISTS (\n SELECT 1\n FROM BisCore.Element e\n WHERE e.ECClassId IS (BisCore.GeometricElement3d, BisCore.InformationPartitionElement)\n AND e.ECInstanceId = GeometricModel3d.ModeledElement.Id\n )\n `,\n wantPrivate: false,\n };\n\n const modelProps = await iModel.models.queryProps(queryParams);\n return modelProps.map(({ id, isPlanProjection }: GeometricModel3dProps) => ({ id, isPlanProjection })).filter(({ id }) => id) as ModelInfo[];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/tree-widget-react",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Tree Widget React",
5
5
  "keywords": [
6
6
  "Bentley",