@itwin/tree-widget-react 4.0.0-alpha.17 → 4.0.0-alpha.19
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.
- package/CHANGELOG.md +51 -1
- package/lib/esm/tree-widget-react/TreeWidget.d.ts +1 -3
- package/lib/esm/tree-widget-react/TreeWidget.js +19 -19
- package/lib/esm/tree-widget-react/TreeWidget.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js +2 -2
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +0 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +13 -11
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +6 -10
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +137 -92
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +12 -4
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +30 -29
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +405 -355
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.d.ts +5 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js +8 -6
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +20 -12
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.d.ts +3 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +13 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js +8 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js +6 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.d.ts +3 -5
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js +45 -38
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +8 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.d.ts +14 -20
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +271 -275
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.d.ts +4 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js +3 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +22 -15
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js +5 -5
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.d.ts +7 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js +15 -12
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/Utils.d.ts +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js +8 -3
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js +4 -4
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js +4 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.d.ts +55 -18
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js +96 -76
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.d.ts +5 -8
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js +52 -39
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +29 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +49 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.d.ts +2 -7
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +30 -39
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.d.ts +3 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +5 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +25 -13
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +3 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +7 -7
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.d.ts +8 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js +16 -11
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +44 -28
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js +11 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +5 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +4 -6
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +31 -26
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +6 -4
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +1 -5
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +44 -44
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +3 -6
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +20 -16
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/index.js +1 -0
- package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +6 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +6 -10
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +111 -69
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +7 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +17 -25
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +246 -265
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.d.ts +3 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js +9 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js +6 -6
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +17 -11
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react-internal.d.ts +2 -1
- package/lib/esm/tree-widget-react-internal.js +2 -1
- package/lib/esm/tree-widget-react-internal.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +1 -1
- package/package.json +12 -12
|
@@ -13,18 +13,18 @@ export const defaultHierarchyConfiguration = {
|
|
|
13
13
|
};
|
|
14
14
|
/** @internal */
|
|
15
15
|
export class IModelContentTreeDefinition {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
#impl;
|
|
17
|
+
#idsCache;
|
|
18
|
+
#hierarchyConfig;
|
|
19
|
+
#selectQueryFactory;
|
|
20
|
+
#nodeLabelSelectClauseFactory;
|
|
21
21
|
constructor(props) {
|
|
22
|
-
this
|
|
23
|
-
this
|
|
24
|
-
this
|
|
22
|
+
this.#idsCache = props.idsCache;
|
|
23
|
+
this.#hierarchyConfig = props.hierarchyConfig;
|
|
24
|
+
this.#impl = createPredicateBasedHierarchyDefinition({
|
|
25
25
|
classHierarchyInspector: props.imodelAccess,
|
|
26
26
|
hierarchy: {
|
|
27
|
-
rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.
|
|
27
|
+
rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.#hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),
|
|
28
28
|
childNodes: [
|
|
29
29
|
{
|
|
30
30
|
parentInstancesNodePredicate: CLASS_NAME_Subject,
|
|
@@ -75,10 +75,10 @@ export class IModelContentTreeDefinition {
|
|
|
75
75
|
],
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
|
-
this
|
|
79
|
-
this
|
|
78
|
+
this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });
|
|
79
|
+
this.#selectQueryFactory = createNodesQueryClauseFactory({
|
|
80
80
|
imodelAccess: props.imodelAccess,
|
|
81
|
-
instanceLabelSelectClauseFactory: this
|
|
81
|
+
instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
async postProcessNode(node) {
|
|
@@ -89,21 +89,21 @@ export class IModelContentTreeDefinition {
|
|
|
89
89
|
return node;
|
|
90
90
|
}
|
|
91
91
|
async defineHierarchyLevel(props) {
|
|
92
|
-
return this.
|
|
92
|
+
return this.#impl.defineHierarchyLevel(props);
|
|
93
93
|
}
|
|
94
94
|
async createSubjectChildrenQuery({ parentNodeInstanceIds: parentSubjectIds, instanceFilter, }) {
|
|
95
95
|
const [subjectFilterClauses, modelFilterClauses] = await Promise.all([
|
|
96
|
-
this.
|
|
96
|
+
this.#selectQueryFactory.createFilterClauses({
|
|
97
97
|
filter: instanceFilter,
|
|
98
98
|
contentClass: { fullName: CLASS_NAME_Subject, alias: "this" },
|
|
99
99
|
}),
|
|
100
|
-
this.
|
|
100
|
+
this.#selectQueryFactory.createFilterClauses({
|
|
101
101
|
filter: instanceFilter,
|
|
102
102
|
contentClass: { fullName: CLASS_NAME_Model, alias: "this" },
|
|
103
103
|
}),
|
|
104
104
|
]);
|
|
105
105
|
const [childSubjectIds, childModelIds] = parentSubjectIds.length
|
|
106
|
-
? await Promise.all([this.
|
|
106
|
+
? await Promise.all([this.#idsCache.getChildSubjectIds(parentSubjectIds), this.#idsCache.getChildSubjectModelIds(parentSubjectIds)])
|
|
107
107
|
: [[IModel.rootSubjectId], []];
|
|
108
108
|
const defs = new Array();
|
|
109
109
|
childSubjectIds.length &&
|
|
@@ -112,11 +112,11 @@ export class IModelContentTreeDefinition {
|
|
|
112
112
|
query: {
|
|
113
113
|
ecsql: `
|
|
114
114
|
SELECT
|
|
115
|
-
${await this.
|
|
115
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
116
116
|
ecClassId: { selector: "this.ECClassId" },
|
|
117
117
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
118
118
|
nodeLabel: {
|
|
119
|
-
selector: await this.
|
|
119
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
120
120
|
classAlias: "this",
|
|
121
121
|
className: CLASS_NAME_Subject,
|
|
122
122
|
}),
|
|
@@ -136,7 +136,7 @@ export class IModelContentTreeDefinition {
|
|
|
136
136
|
${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : ""}
|
|
137
137
|
`,
|
|
138
138
|
bindings: [
|
|
139
|
-
{ type: "idset", value: await this.
|
|
139
|
+
{ type: "idset", value: await this.#idsCache.getParentSubjectIds() },
|
|
140
140
|
...childSubjectIds.map((id) => ({ type: "id", value: id })),
|
|
141
141
|
],
|
|
142
142
|
},
|
|
@@ -149,11 +149,11 @@ export class IModelContentTreeDefinition {
|
|
|
149
149
|
SELECT model.ECInstanceId AS ECInstanceId, model.*
|
|
150
150
|
FROM (
|
|
151
151
|
SELECT
|
|
152
|
-
${await this.
|
|
152
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
153
153
|
ecClassId: { selector: "m.ECClassId" },
|
|
154
154
|
ecInstanceId: { selector: "m.ECInstanceId" },
|
|
155
155
|
nodeLabel: {
|
|
156
|
-
selector: await this.
|
|
156
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
157
157
|
classAlias: "partition",
|
|
158
158
|
className: CLASS_NAME_InformationPartitionElement,
|
|
159
159
|
}),
|
|
@@ -197,7 +197,7 @@ export class IModelContentTreeDefinition {
|
|
|
197
197
|
query: {
|
|
198
198
|
ecsql: `
|
|
199
199
|
SELECT
|
|
200
|
-
${await this.
|
|
200
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
201
201
|
ecClassId: { selector: "this.ECClassId" },
|
|
202
202
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
203
203
|
nodeLabel: "", // doesn't matter - the node is always hidden
|
|
@@ -214,13 +214,13 @@ export class IModelContentTreeDefinition {
|
|
|
214
214
|
];
|
|
215
215
|
}
|
|
216
216
|
async createGeometricModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, viewType, }) {
|
|
217
|
-
const childCategoryIds = await this.
|
|
217
|
+
const childCategoryIds = await this.#idsCache.getModelCategoryIds(modelIds);
|
|
218
218
|
const { categoryClass } = getClassesByView(viewType);
|
|
219
|
-
const categoryFilterClauses = await this.
|
|
219
|
+
const categoryFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
220
220
|
filter: instanceFilter,
|
|
221
221
|
contentClass: { fullName: categoryClass, alias: "this" },
|
|
222
222
|
});
|
|
223
|
-
const informationContentElementFilterClauses = await this.
|
|
223
|
+
const informationContentElementFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
224
224
|
filter: instanceFilter,
|
|
225
225
|
contentClass: { fullName: "BisCore.InformationContentElement", alias: "this" },
|
|
226
226
|
});
|
|
@@ -231,11 +231,11 @@ export class IModelContentTreeDefinition {
|
|
|
231
231
|
query: {
|
|
232
232
|
ecsql: `
|
|
233
233
|
SELECT
|
|
234
|
-
${await this.
|
|
234
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
235
235
|
ecClassId: { selector: "this.ECClassId" },
|
|
236
236
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
237
237
|
nodeLabel: {
|
|
238
|
-
selector: await this.
|
|
238
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
239
239
|
classAlias: "this",
|
|
240
240
|
className: categoryClass,
|
|
241
241
|
}),
|
|
@@ -262,11 +262,11 @@ export class IModelContentTreeDefinition {
|
|
|
262
262
|
query: {
|
|
263
263
|
ecsql: `
|
|
264
264
|
SELECT
|
|
265
|
-
${await this.
|
|
265
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
266
266
|
ecClassId: { selector: "this.ECClassId" },
|
|
267
267
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
268
268
|
nodeLabel: {
|
|
269
|
-
selector: await this.
|
|
269
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
270
270
|
classAlias: "this",
|
|
271
271
|
className: "BisCore.InformationContentElement",
|
|
272
272
|
}),
|
|
@@ -298,7 +298,7 @@ export class IModelContentTreeDefinition {
|
|
|
298
298
|
}
|
|
299
299
|
const { elementClass, modelClass } = getClassesByView(viewType);
|
|
300
300
|
return Promise.all(getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {
|
|
301
|
-
const instanceFilterClauses = await this.
|
|
301
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
302
302
|
filter: instanceFilter,
|
|
303
303
|
contentClass: { fullName: elementClass, alias: "this" },
|
|
304
304
|
});
|
|
@@ -307,11 +307,11 @@ export class IModelContentTreeDefinition {
|
|
|
307
307
|
query: {
|
|
308
308
|
ecsql: `
|
|
309
309
|
SELECT
|
|
310
|
-
${await this.
|
|
310
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
311
311
|
ecClassId: { selector: "this.ECClassId" },
|
|
312
312
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
313
313
|
nodeLabel: {
|
|
314
|
-
selector: await this.
|
|
314
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
315
315
|
classAlias: "this",
|
|
316
316
|
className: elementClass,
|
|
317
317
|
}),
|
|
@@ -341,7 +341,7 @@ export class IModelContentTreeDefinition {
|
|
|
341
341
|
}
|
|
342
342
|
async createModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, }) {
|
|
343
343
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
344
|
-
const instanceFilterClauses = await this.
|
|
344
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
345
345
|
filter: instanceFilter,
|
|
346
346
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
347
347
|
});
|
|
@@ -350,11 +350,11 @@ export class IModelContentTreeDefinition {
|
|
|
350
350
|
query: {
|
|
351
351
|
ecsql: `
|
|
352
352
|
SELECT
|
|
353
|
-
${await this.
|
|
353
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
354
354
|
ecClassId: { selector: "this.ECClassId" },
|
|
355
355
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
356
356
|
nodeLabel: {
|
|
357
|
-
selector: await this.
|
|
357
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
358
358
|
classAlias: "this",
|
|
359
359
|
className: classFullName,
|
|
360
360
|
}),
|
|
@@ -416,7 +416,7 @@ export class IModelContentTreeDefinition {
|
|
|
416
416
|
async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }) {
|
|
417
417
|
const groupIds = parentNode.extendedData?.groupIds;
|
|
418
418
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
419
|
-
const instanceFilterClauses = await this.
|
|
419
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
420
420
|
filter: instanceFilter,
|
|
421
421
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
422
422
|
});
|
|
@@ -425,11 +425,11 @@ export class IModelContentTreeDefinition {
|
|
|
425
425
|
query: {
|
|
426
426
|
ecsql: `
|
|
427
427
|
SELECT
|
|
428
|
-
${await this.
|
|
428
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
429
429
|
ecClassId: { selector: "this.ECClassId" },
|
|
430
430
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
431
431
|
nodeLabel: {
|
|
432
|
-
selector: await this.
|
|
432
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
433
433
|
classAlias: "this",
|
|
434
434
|
className: classFullName,
|
|
435
435
|
}),
|
|
@@ -456,7 +456,7 @@ export class IModelContentTreeDefinition {
|
|
|
456
456
|
async createGroupInformationElementMemberElementsQuery({ parentNode, instanceFilter, }) {
|
|
457
457
|
const groupIds = parentNode.extendedData?.groupIds;
|
|
458
458
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
459
|
-
const instanceFilterClauses = await this.
|
|
459
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
460
460
|
filter: instanceFilter,
|
|
461
461
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
462
462
|
});
|
|
@@ -465,11 +465,11 @@ export class IModelContentTreeDefinition {
|
|
|
465
465
|
query: {
|
|
466
466
|
ecsql: `
|
|
467
467
|
SELECT
|
|
468
|
-
${await this.
|
|
468
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
469
469
|
ecClassId: { selector: "this.ECClassId" },
|
|
470
470
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
471
471
|
nodeLabel: {
|
|
472
|
-
selector: await this.
|
|
472
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
473
473
|
classAlias: "this",
|
|
474
474
|
className: classFullName,
|
|
475
475
|
}),
|
|
@@ -496,7 +496,7 @@ export class IModelContentTreeDefinition {
|
|
|
496
496
|
}
|
|
497
497
|
async createElementChildrenQuery({ parentNodeInstanceIds: elementIds, instanceFilter, }) {
|
|
498
498
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
499
|
-
const instanceFilterClauses = await this.
|
|
499
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
500
500
|
filter: instanceFilter,
|
|
501
501
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
502
502
|
});
|
|
@@ -505,11 +505,11 @@ export class IModelContentTreeDefinition {
|
|
|
505
505
|
query: {
|
|
506
506
|
ecsql: `
|
|
507
507
|
SELECT
|
|
508
|
-
${await this.
|
|
508
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
509
509
|
ecClassId: { selector: "this.ECClassId" },
|
|
510
510
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
511
511
|
nodeLabel: {
|
|
512
|
-
selector: await this.
|
|
512
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
513
513
|
classAlias: "this",
|
|
514
514
|
className: classFullName,
|
|
515
515
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelContentTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/imodel-content-tree/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,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;iBAC9D;aACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,KAA2G;IACzI,MAAM,kBAAkB,GAAG,KAAK,EAAE,UAAU,IAAI,gBAAgB,CAAC;IACjE,MAAM,oBAAoB,GAAG,KAAK,EAAE,YAAY,IAAI,kBAAkB,CAAC;IACvE,MAAM,MAAM,GAAG;QACb;YACE,aAAa,EAAE,oBAAoB;YACnC,WAAW,EAAE,yDAAyD;YACtE,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;+CAI2B,oBAAoB;;0DAET,kBAAkB,mCAAmC,oBAAoB;;;;;SAK1H;iBACA;gBACD,iBAAiB,EAAE,IAAI;aACxB;SACF;KACF,CAAC;IAEF,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC;YACV,aAAa,EAAE,iCAAiC;YAChD,WAAW,EAAE,EAAE;YACf,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;iDAI6B,kBAAkB;;;;;;;WAOxD;iBACF;gBACD,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,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 { IModel } from \"@itwin/core-common\";\nimport {\n createNodesQueryClauseFactory,\n createPredicateBasedHierarchyDefinition,\n NodeSelectClauseColumnNames,\n ProcessedHierarchyNode,\n} from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport {\n CLASS_NAME_DrawingCategory,\n CLASS_NAME_Element,\n CLASS_NAME_GeometricModel2d,\n CLASS_NAME_GeometricModel3d,\n CLASS_NAME_InformationPartitionElement,\n CLASS_NAME_ISubModeledElement,\n CLASS_NAME_Model,\n CLASS_NAME_SpatialCategory,\n CLASS_NAME_Subject,\n} from \"../common/internal/ClassNameDefinitions.js\";\nimport { createIdsSelector, getClassesByView, parseIdsSelectorResult } from \"../common/internal/Utils.js\";\n\nimport type {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n NodesQueryClauseFactory,\n} from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlBinding, IInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport type { IModelContentTreeIdsCache } from \"./internal/IModelContentTreeIdsCache.js\";\n\n/**\n * Defines hierarchy configuration supported by `IModelContentTree`.\n * @beta\n */\nexport interface IModelContentTreeHierarchyConfiguration {\n /** Should the root Subject node be hidden. Defaults to `false`. */\n hideRootSubject: boolean;\n}\n\n/** @internal */\nexport const defaultHierarchyConfiguration: IModelContentTreeHierarchyConfiguration = {\n hideRootSubject: false,\n};\n\ninterface IModelContentTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;\n idsCache: IModelContentTreeIdsCache;\n hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n}\n\n/** @internal */\nexport class IModelContentTreeDefinition implements HierarchyDefinition {\n private _impl: HierarchyDefinition;\n private _idsCache: IModelContentTreeIdsCache;\n private _hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n private _selectQueryFactory: NodesQueryClauseFactory;\n private _nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n public constructor(props: IModelContentTreeDefinitionProps) {\n this._idsCache = props.idsCache;\n this._hierarchyConfig = props.hierarchyConfig;\n this._impl = createPredicateBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps) =>\n this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this._hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),\n childNodes: [\n {\n parentInstancesNodePredicate: CLASS_NAME_Subject,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_ISubModeledElement,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel3d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel2d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_SpatialCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_DrawingCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Model,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createModelChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GroupInformationElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createGroupInformationElementChildElementsQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"ChildrenNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createChildrenNodeChildrenQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"MembersNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createGroupInformationElementMemberElementsQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Element,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createElementChildrenQuery(requestProps),\n },\n ],\n },\n });\n this._nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n this._selectQueryFactory = createNodesQueryClauseFactory({\n imodelAccess: props.imodelAccess,\n instanceLabelSelectClauseFactory: this._nodeLabelSelectClauseFactory,\n });\n }\n\n public async postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode> {\n if (ProcessedHierarchyNode.isGroupingNode(node)) {\n const label = node.children.length ? `${node.label} (${node.children.length})` : node.label;\n return { ...node, label, extendedData: { ...node.extendedData, imageId: \"icon-ec-class\" } };\n }\n return node;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this._impl.defineHierarchyLevel(props);\n }\n\n private async createSubjectChildrenQuery({\n parentNodeInstanceIds: parentSubjectIds,\n instanceFilter,\n }: Pick<DefineInstanceNodeChildHierarchyLevelProps, \"parentNodeInstanceIds\" | \"instanceFilter\">): Promise<HierarchyLevelDefinition> {\n const [subjectFilterClauses, modelFilterClauses] = await Promise.all([\n this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Subject, alias: \"this\" },\n }),\n this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Model, alias: \"this\" },\n }),\n ]);\n const [childSubjectIds, childModelIds] = parentSubjectIds.length\n ? await Promise.all([this._idsCache.getChildSubjectIds(parentSubjectIds), this._idsCache.getChildSubjectModelIds(parentSubjectIds)])\n : [[IModel.rootSubjectId], []];\n const defs = new Array<HierarchyNodesDefinition>();\n childSubjectIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Subject,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_Subject,\n }),\n },\n hasChildren: { selector: `InVirtualSet(?, this.ECInstanceId)` },\n grouping: { byLabel: { action: \"merge\", groupId: \"subject\" } },\n extendedData: {\n imageId: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, 'icon-imodel-hollow-2', 'icon-folder')` },\n },\n autoExpand: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, true, false)` },\n supportsFiltering: true,\n })}\n FROM ${subjectFilterClauses.from} this\n ${subjectFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childSubjectIds.map(() => \"?\").join(\",\")})\n ${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : \"\"}\n `,\n bindings: [\n { type: \"idset\", value: await this._idsCache.getParentSubjectIds() },\n ...childSubjectIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n ],\n },\n });\n childModelIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT model.ECInstanceId AS ECInstanceId, model.*\n FROM (\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"m.ECClassId\" },\n ecInstanceId: { selector: \"m.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"partition\",\n className: CLASS_NAME_InformationPartitionElement,\n }),\n },\n hideNodeInHierarchy: {\n selector: `\n CASE\n WHEN (\n json_extract([partition].JsonProperties, '$.PhysicalPartition.Model.Content') IS NOT NULL\n OR json_extract([partition].JsonProperties, '$.GraphicalPartition3d.Model.Content') IS NOT NULL\n ) THEN 1\n ELSE 0\n END\n `,\n },\n extendedData: {\n imageId: \"icon-model\",\n },\n supportsFiltering: true,\n })}\n FROM ${CLASS_NAME_Model} m\n JOIN ${CLASS_NAME_InformationPartitionElement} [partition] ON [partition].ECInstanceId = m.ModeledElement.Id\n WHERE\n m.ECInstanceId IN (${childModelIds.map(() => \"?\").join(\",\")})\n ) model\n JOIN ${modelFilterClauses.from} this ON this.ECInstanceId = model.ECInstanceId\n ${modelFilterClauses.joins}\n ${modelFilterClauses.where ? `WHERE (model.${NodeSelectClauseColumnNames.HideNodeInHierarchy} OR ${modelFilterClauses.where})` : \"\"}\n `,\n bindings: childModelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createISubModeledElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n // note: we do not apply hierarchy level filtering on this hierarchy level, because it's always\n // hidden - the filter will get applied on the child hierarchy levels\n return [\n {\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: \"\", // doesn't matter - the node is always hidden\n hideNodeInHierarchy: true,\n })}\n FROM ${CLASS_NAME_Model} this\n WHERE\n this.ModeledElement.Id IN (${elementIds.map(() => \"?\").join(\",\")})\n AND NOT this.IsPrivate\n `,\n bindings: [...elementIds.map((id): ECSqlBinding => ({ type: \"id\", value: id }))],\n },\n },\n ];\n }\n\n private async createGeometricModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n viewType,\n }: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const childCategoryIds = await this._idsCache.getModelCategoryIds(modelIds);\n\n const { categoryClass } = getClassesByView(viewType);\n const categoryFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: categoryClass, alias: \"this\" },\n });\n const informationContentElementFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.InformationContentElement\", alias: \"this\" },\n });\n\n const defs = new Array<HierarchyNodesDefinition>();\n childCategoryIds.length &&\n defs.push({\n fullClassName: categoryClass,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: categoryClass,\n }),\n },\n grouping: { byLabel: { action: \"merge\", groupId: \"category\" } },\n extendedData: {\n imageId: \"icon-layers\",\n modelIds: { selector: createIdsSelector(modelIds) },\n },\n hasChildren: true,\n supportsFiltering: true,\n })}\n FROM ${categoryFilterClauses.from} this\n ${categoryFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childCategoryIds.map(() => \"?\").join(\",\")})\n ${categoryFilterClauses.where ? `AND ${categoryFilterClauses.where}` : \"\"}\n `,\n bindings: childCategoryIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n defs.push({\n fullClassName: \"BisCore.InformationContentElement\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.InformationContentElement\",\n }),\n },\n hasChildren: true,\n grouping: {\n byClass: true,\n },\n supportsFiltering: true,\n })}\n FROM ${informationContentElementFilterClauses.from} this\n ${informationContentElementFilterClauses.joins}\n WHERE\n this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${informationContentElementFilterClauses.where ? `AND ${informationContentElementFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id) => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createCategoryChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: categoryIds, parentNode, instanceFilter, viewType } = props;\n const modelIds = parseIdsSelectorResult(parentNode.extendedData?.modelIds);\n\n // We only want to handle a category added as a child of `GeometricModel2d` or `GeometricModel3d`.\n // ModelIds is not empty only if parent node is a geometric model.\n if (modelIds.length === 0) {\n return this.createElementChildrenQuery(props);\n }\n\n const { elementClass, modelClass } = getClassesByView(viewType);\n return Promise.all(\n getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClass, alias: \"this\" },\n });\n return {\n fullClassName: elementClass,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: elementClass,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Category.Id IN (${categoryIds.map(() => \"?\").join(\",\")})\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n AND this.Parent.Id IS NULL\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: [...categoryIds.map((id) => ({ type: \"id\", value: id })), ...modelIds.map((id) => ({ type: \"id\", value: id }))] as ECSqlBinding[],\n },\n };\n }),\n );\n }\n\n private async createModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps?.hasChildren,\n supportsFiltering: selectProps?.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IS NULL\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementChildElementsQuery({\n parentNodeInstanceIds: groupIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return [\n {\n node: {\n key: \"ChildrenNode\",\n label: \"Children\",\n extendedData: {\n groupIds,\n imageId: \"icon-hierarchy-tree\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n {\n node: {\n key: \"MembersNode\",\n label: \"Members\",\n extendedData: {\n groupIds,\n imageId: \"icon-group\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n ];\n }\n\n private async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n grouping: { byClass: true },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementMemberElementsQuery({\n parentNode,\n instanceFilter,\n }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ElementGroupsMembers egm ON egm.TargetECInstanceId = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n egm.SourceECInstanceId IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.Element p ON p.ECInstanceId = this.Parent.Id\n ${instanceFilterClauses.joins}\n WHERE\n p.ECInstanceId IN (${elementIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: elementIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? CLASS_NAME_Model;\n const elementClassFullName = props?.elementClass ?? CLASS_NAME_Element;\n const result = [\n {\n classFullName: elementClassFullName,\n whereClause: \"this.ECClassId IS NOT (BisCore.GroupInformationElement)\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${elementClassFullName}\n UNION ALL\n SELECT sm.ModeledElement.Id ParentId FROM ${modelClassFullName} sm WHERE EXISTS (SELECT 1 FROM ${elementClassFullName} WHERE Model.Id = sm.ECInstanceId)\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: true,\n },\n },\n ];\n\n if (!props?.elementClass) {\n result.push({\n classFullName: \"BisCore.GroupInformationElement\",\n whereClause: \"\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${CLASS_NAME_Element}\n UNION ALL\n SELECT SourceECInstanceId ParentId FROM BisCore.ElementGroupsMembers\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: false,\n },\n });\n }\n\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelContentTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,oB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EAAE,CAAC,CAAC;iBAC9D;aACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,KAA2G;IACzI,MAAM,kBAAkB,GAAG,KAAK,EAAE,UAAU,IAAI,gBAAgB,CAAC;IACjE,MAAM,oBAAoB,GAAG,KAAK,EAAE,YAAY,IAAI,kBAAkB,CAAC;IACvE,MAAM,MAAM,GAAG;QACb;YACE,aAAa,EAAE,oBAAoB;YACnC,WAAW,EAAE,yDAAyD;YACtE,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;+CAI2B,oBAAoB;;0DAET,kBAAkB,mCAAmC,oBAAoB;;;;;SAK1H;iBACA;gBACD,iBAAiB,EAAE,IAAI;aACxB;SACF;KACF,CAAC;IAEF,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC;YACV,aAAa,EAAE,iCAAiC;YAChD,WAAW,EAAE,EAAE;YACf,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;iDAI6B,kBAAkB;;;;;;;WAOxD;iBACF;gBACD,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,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 { IModel } from \"@itwin/core-common\";\nimport {\n createNodesQueryClauseFactory,\n createPredicateBasedHierarchyDefinition,\n NodeSelectClauseColumnNames,\n ProcessedHierarchyNode,\n} from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport {\n CLASS_NAME_DrawingCategory,\n CLASS_NAME_Element,\n CLASS_NAME_GeometricModel2d,\n CLASS_NAME_GeometricModel3d,\n CLASS_NAME_InformationPartitionElement,\n CLASS_NAME_ISubModeledElement,\n CLASS_NAME_Model,\n CLASS_NAME_SpatialCategory,\n CLASS_NAME_Subject,\n} from \"../common/internal/ClassNameDefinitions.js\";\nimport { createIdsSelector, getClassesByView, parseIdsSelectorResult } from \"../common/internal/Utils.js\";\n\nimport type {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n NodesQueryClauseFactory,\n} from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlBinding, IInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport type { IModelContentTreeIdsCache } from \"./internal/IModelContentTreeIdsCache.js\";\n\n/**\n * Defines hierarchy configuration supported by `IModelContentTree`.\n * @beta\n */\nexport interface IModelContentTreeHierarchyConfiguration {\n /** Should the root Subject node be hidden. Defaults to `false`. */\n hideRootSubject: boolean;\n}\n\n/** @internal */\nexport const defaultHierarchyConfiguration: IModelContentTreeHierarchyConfiguration = {\n hideRootSubject: false,\n};\n\ninterface IModelContentTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;\n idsCache: IModelContentTreeIdsCache;\n hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n}\n\n/** @internal */\nexport class IModelContentTreeDefinition implements HierarchyDefinition {\n #impl: HierarchyDefinition;\n #idsCache: IModelContentTreeIdsCache;\n #hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n #selectQueryFactory: NodesQueryClauseFactory;\n #nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n public constructor(props: IModelContentTreeDefinitionProps) {\n this.#idsCache = props.idsCache;\n this.#hierarchyConfig = props.hierarchyConfig;\n this.#impl = createPredicateBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps) =>\n this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.#hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),\n childNodes: [\n {\n parentInstancesNodePredicate: CLASS_NAME_Subject,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_ISubModeledElement,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel3d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel2d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_SpatialCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_DrawingCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Model,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createModelChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GroupInformationElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createGroupInformationElementChildElementsQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"ChildrenNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createChildrenNodeChildrenQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"MembersNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createGroupInformationElementMemberElementsQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Element,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createElementChildrenQuery(requestProps),\n },\n ],\n },\n });\n this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n this.#selectQueryFactory = createNodesQueryClauseFactory({\n imodelAccess: props.imodelAccess,\n instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,\n });\n }\n\n public async postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode> {\n if (ProcessedHierarchyNode.isGroupingNode(node)) {\n const label = node.children.length ? `${node.label} (${node.children.length})` : node.label;\n return { ...node, label, extendedData: { ...node.extendedData, imageId: \"icon-ec-class\" } };\n }\n return node;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this.#impl.defineHierarchyLevel(props);\n }\n\n private async createSubjectChildrenQuery({\n parentNodeInstanceIds: parentSubjectIds,\n instanceFilter,\n }: Pick<DefineInstanceNodeChildHierarchyLevelProps, \"parentNodeInstanceIds\" | \"instanceFilter\">): Promise<HierarchyLevelDefinition> {\n const [subjectFilterClauses, modelFilterClauses] = await Promise.all([\n this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Subject, alias: \"this\" },\n }),\n this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Model, alias: \"this\" },\n }),\n ]);\n const [childSubjectIds, childModelIds] = parentSubjectIds.length\n ? await Promise.all([this.#idsCache.getChildSubjectIds(parentSubjectIds), this.#idsCache.getChildSubjectModelIds(parentSubjectIds)])\n : [[IModel.rootSubjectId], []];\n const defs = new Array<HierarchyNodesDefinition>();\n childSubjectIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Subject,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_Subject,\n }),\n },\n hasChildren: { selector: `InVirtualSet(?, this.ECInstanceId)` },\n grouping: { byLabel: { action: \"merge\", groupId: \"subject\" } },\n extendedData: {\n imageId: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, 'icon-imodel-hollow-2', 'icon-folder')` },\n },\n autoExpand: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, true, false)` },\n supportsFiltering: true,\n })}\n FROM ${subjectFilterClauses.from} this\n ${subjectFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childSubjectIds.map(() => \"?\").join(\",\")})\n ${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : \"\"}\n `,\n bindings: [\n { type: \"idset\", value: await this.#idsCache.getParentSubjectIds() },\n ...childSubjectIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n ],\n },\n });\n childModelIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT model.ECInstanceId AS ECInstanceId, model.*\n FROM (\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"m.ECClassId\" },\n ecInstanceId: { selector: \"m.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"partition\",\n className: CLASS_NAME_InformationPartitionElement,\n }),\n },\n hideNodeInHierarchy: {\n selector: `\n CASE\n WHEN (\n json_extract([partition].JsonProperties, '$.PhysicalPartition.Model.Content') IS NOT NULL\n OR json_extract([partition].JsonProperties, '$.GraphicalPartition3d.Model.Content') IS NOT NULL\n ) THEN 1\n ELSE 0\n END\n `,\n },\n extendedData: {\n imageId: \"icon-model\",\n },\n supportsFiltering: true,\n })}\n FROM ${CLASS_NAME_Model} m\n JOIN ${CLASS_NAME_InformationPartitionElement} [partition] ON [partition].ECInstanceId = m.ModeledElement.Id\n WHERE\n m.ECInstanceId IN (${childModelIds.map(() => \"?\").join(\",\")})\n ) model\n JOIN ${modelFilterClauses.from} this ON this.ECInstanceId = model.ECInstanceId\n ${modelFilterClauses.joins}\n ${modelFilterClauses.where ? `WHERE (model.${NodeSelectClauseColumnNames.HideNodeInHierarchy} OR ${modelFilterClauses.where})` : \"\"}\n `,\n bindings: childModelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createISubModeledElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n // note: we do not apply hierarchy level filtering on this hierarchy level, because it's always\n // hidden - the filter will get applied on the child hierarchy levels\n return [\n {\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: \"\", // doesn't matter - the node is always hidden\n hideNodeInHierarchy: true,\n })}\n FROM ${CLASS_NAME_Model} this\n WHERE\n this.ModeledElement.Id IN (${elementIds.map(() => \"?\").join(\",\")})\n AND NOT this.IsPrivate\n `,\n bindings: [...elementIds.map((id): ECSqlBinding => ({ type: \"id\", value: id }))],\n },\n },\n ];\n }\n\n private async createGeometricModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n viewType,\n }: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const childCategoryIds = await this.#idsCache.getModelCategoryIds(modelIds);\n\n const { categoryClass } = getClassesByView(viewType);\n const categoryFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: categoryClass, alias: \"this\" },\n });\n const informationContentElementFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.InformationContentElement\", alias: \"this\" },\n });\n\n const defs = new Array<HierarchyNodesDefinition>();\n childCategoryIds.length &&\n defs.push({\n fullClassName: categoryClass,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: categoryClass,\n }),\n },\n grouping: { byLabel: { action: \"merge\", groupId: \"category\" } },\n extendedData: {\n imageId: \"icon-layers\",\n modelIds: { selector: createIdsSelector(modelIds) },\n },\n hasChildren: true,\n supportsFiltering: true,\n })}\n FROM ${categoryFilterClauses.from} this\n ${categoryFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childCategoryIds.map(() => \"?\").join(\",\")})\n ${categoryFilterClauses.where ? `AND ${categoryFilterClauses.where}` : \"\"}\n `,\n bindings: childCategoryIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n defs.push({\n fullClassName: \"BisCore.InformationContentElement\",\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.InformationContentElement\",\n }),\n },\n hasChildren: true,\n grouping: {\n byClass: true,\n },\n supportsFiltering: true,\n })}\n FROM ${informationContentElementFilterClauses.from} this\n ${informationContentElementFilterClauses.joins}\n WHERE\n this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${informationContentElementFilterClauses.where ? `AND ${informationContentElementFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id) => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createCategoryChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: categoryIds, parentNode, instanceFilter, viewType } = props;\n const modelIds = parseIdsSelectorResult(parentNode.extendedData?.modelIds);\n\n // We only want to handle a category added as a child of `GeometricModel2d` or `GeometricModel3d`.\n // ModelIds is not empty only if parent node is a geometric model.\n if (modelIds.length === 0) {\n return this.createElementChildrenQuery(props);\n }\n\n const { elementClass, modelClass } = getClassesByView(viewType);\n return Promise.all(\n getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClass, alias: \"this\" },\n });\n return {\n fullClassName: elementClass,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: elementClass,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Category.Id IN (${categoryIds.map(() => \"?\").join(\",\")})\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n AND this.Parent.Id IS NULL\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: [...categoryIds.map((id) => ({ type: \"id\", value: id })), ...modelIds.map((id) => ({ type: \"id\", value: id }))] as ECSqlBinding[],\n },\n };\n }),\n );\n }\n\n private async createModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps?.hasChildren,\n supportsFiltering: selectProps?.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IS NULL\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementChildElementsQuery({\n parentNodeInstanceIds: groupIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return [\n {\n node: {\n key: \"ChildrenNode\",\n label: \"Children\",\n extendedData: {\n groupIds,\n imageId: \"icon-hierarchy-tree\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n {\n node: {\n key: \"MembersNode\",\n label: \"Members\",\n extendedData: {\n groupIds,\n imageId: \"icon-group\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n ];\n }\n\n private async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n grouping: { byClass: true },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementMemberElementsQuery({\n parentNode,\n instanceFilter,\n }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ElementGroupsMembers egm ON egm.TargetECInstanceId = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n egm.SourceECInstanceId IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.Element p ON p.ECInstanceId = this.Parent.Id\n ${instanceFilterClauses.joins}\n WHERE\n p.ECInstanceId IN (${elementIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: elementIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? CLASS_NAME_Model;\n const elementClassFullName = props?.elementClass ?? CLASS_NAME_Element;\n const result = [\n {\n classFullName: elementClassFullName,\n whereClause: \"this.ECClassId IS NOT (BisCore.GroupInformationElement)\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${elementClassFullName}\n UNION ALL\n SELECT sm.ModeledElement.Id ParentId FROM ${modelClassFullName} sm WHERE EXISTS (SELECT 1 FROM ${elementClassFullName} WHERE Model.Id = sm.ECInstanceId)\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: true,\n },\n },\n ];\n\n if (!props?.elementClass) {\n result.push({\n classFullName: \"BisCore.GroupInformationElement\",\n whereClause: \"\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${CLASS_NAME_Element}\n UNION ALL\n SELECT SourceECInstanceId ParentId FROM BisCore.ElementGroupsMembers\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: false,\n },\n });\n }\n\n return result;\n}\n"]}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { Id64Array } from "@itwin/core-bentley";
|
|
1
|
+
import type { GuidString, Id64Array } from "@itwin/core-bentley";
|
|
2
2
|
import type { LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies";
|
|
3
3
|
/** @internal */
|
|
4
4
|
export declare class IModelContentTreeIdsCache {
|
|
5
|
-
private
|
|
6
|
-
|
|
7
|
-
private _parentSubjectIds;
|
|
8
|
-
private _modelInfos;
|
|
9
|
-
constructor(_queryExecutor: LimitingECSqlQueryExecutor);
|
|
5
|
+
#private;
|
|
6
|
+
constructor(queryExecutor: LimitingECSqlQueryExecutor, componentId?: GuidString);
|
|
10
7
|
private querySubjects;
|
|
11
8
|
private queryModels;
|
|
12
9
|
private getSubjectInfos;
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { assert } from "@itwin/core-bentley";
|
|
5
|
+
import { assert, Guid } from "@itwin/core-bentley";
|
|
6
6
|
import { CLASS_NAME_GeometricElement2d, CLASS_NAME_GeometricElement3d, CLASS_NAME_InformationPartitionElement, CLASS_NAME_Model, CLASS_NAME_Subject, } from "../../common/internal/ClassNameDefinitions.js";
|
|
7
7
|
import { pushToMap } from "../../common/internal/Utils.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export class IModelContentTreeIdsCache {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
#subjectInfos;
|
|
11
|
+
#parentSubjectIds; // the list should contain a subject id if its node should be shown as having children
|
|
12
|
+
#modelInfos;
|
|
13
|
+
#queryExecutor;
|
|
14
|
+
#componentId;
|
|
15
|
+
#componentName;
|
|
16
|
+
constructor(queryExecutor, componentId) {
|
|
17
|
+
this.#queryExecutor = queryExecutor;
|
|
18
|
+
this.#componentId = componentId ?? Guid.createValue();
|
|
19
|
+
this.#componentName = "IModelContentTreeIdsCache";
|
|
16
20
|
}
|
|
17
21
|
async *querySubjects() {
|
|
18
22
|
const subjectsQuery = `
|
|
@@ -35,7 +39,7 @@ export class IModelContentTreeIdsCache {
|
|
|
35
39
|
END hideInHierarchy
|
|
36
40
|
FROM ${CLASS_NAME_Subject} s
|
|
37
41
|
`;
|
|
38
|
-
for await (const row of this.
|
|
42
|
+
for await (const row of this.#queryExecutor.createQueryReader({ ecsql: subjectsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/subjects` })) {
|
|
39
43
|
yield { id: row.id, parentId: row.parentId, targetPartitionId: row.targetPartitionId, hideInHierarchy: !!row.hideInHierarchy };
|
|
40
44
|
}
|
|
41
45
|
}
|
|
@@ -46,12 +50,12 @@ export class IModelContentTreeIdsCache {
|
|
|
46
50
|
INNER JOIN ${CLASS_NAME_Model} m ON m.ModeledElement.Id = p.ECInstanceId
|
|
47
51
|
WHERE NOT m.IsPrivate
|
|
48
52
|
`;
|
|
49
|
-
for await (const row of this.
|
|
53
|
+
for await (const row of this.#queryExecutor.createQueryReader({ ecsql: modelsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/models` })) {
|
|
50
54
|
yield { id: row.id, parentId: row.parentId };
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
async getSubjectInfos() {
|
|
54
|
-
this
|
|
58
|
+
this.#subjectInfos ??= (async () => {
|
|
55
59
|
const [subjectInfos, targetPartitionSubjects] = await Promise.all([
|
|
56
60
|
(async () => {
|
|
57
61
|
const result = new Map();
|
|
@@ -93,11 +97,11 @@ export class IModelContentTreeIdsCache {
|
|
|
93
97
|
}
|
|
94
98
|
return subjectInfos;
|
|
95
99
|
})();
|
|
96
|
-
return this
|
|
100
|
+
return this.#subjectInfos;
|
|
97
101
|
}
|
|
98
102
|
/** Returns ECInstanceIDs of Subjects that either have direct Model or at least one child Subject with a Model. */
|
|
99
103
|
async getParentSubjectIds() {
|
|
100
|
-
this
|
|
104
|
+
this.#parentSubjectIds ??= (async () => {
|
|
101
105
|
const subjectInfos = await this.getSubjectInfos();
|
|
102
106
|
const parentSubjectIds = new Set();
|
|
103
107
|
subjectInfos.forEach((subjectInfo, subjectId) => {
|
|
@@ -113,7 +117,7 @@ export class IModelContentTreeIdsCache {
|
|
|
113
117
|
});
|
|
114
118
|
return [...parentSubjectIds];
|
|
115
119
|
})();
|
|
116
|
-
return this
|
|
120
|
+
return this.#parentSubjectIds;
|
|
117
121
|
}
|
|
118
122
|
/**
|
|
119
123
|
* Returns child subjects of the specified parent subjects as they're displayed in the hierarchy - taking into
|
|
@@ -165,12 +169,12 @@ export class IModelContentTreeIdsCache {
|
|
|
165
169
|
WHERE Parent.Id IS NULL
|
|
166
170
|
GROUP BY Model.Id, Category.Id
|
|
167
171
|
`;
|
|
168
|
-
for await (const row of this.
|
|
172
|
+
for await (const row of this.#queryExecutor.createQueryReader({ ecsql: query }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/model-categories` })) {
|
|
169
173
|
yield { modelId: row.modelId, categoryId: row.categoryId };
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
async getModelInfos() {
|
|
173
|
-
this
|
|
177
|
+
this.#modelInfos ??= (async () => {
|
|
174
178
|
const modelInfos = new Map();
|
|
175
179
|
for await (const { modelId, categoryId } of this.queryModelCategories()) {
|
|
176
180
|
const entry = modelInfos.get(modelId);
|
|
@@ -183,7 +187,7 @@ export class IModelContentTreeIdsCache {
|
|
|
183
187
|
}
|
|
184
188
|
return modelInfos;
|
|
185
189
|
})();
|
|
186
|
-
return this
|
|
190
|
+
return this.#modelInfos;
|
|
187
191
|
}
|
|
188
192
|
async getModelCategoryIds(modelIds) {
|
|
189
193
|
const modelInfos = await this.getModelInfos();
|