@itwin/tree-widget-react 3.15.1 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/lib/cjs/tree-widget-react/TreeWidget.d.ts +1 -2
  3. package/lib/cjs/tree-widget-react/TreeWidget.js +12 -12
  4. package/lib/cjs/tree-widget-react/TreeWidget.js.map +1 -1
  5. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +2 -3
  6. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +5 -4
  7. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
  8. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +4 -7
  9. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +39 -31
  10. package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
  11. package/lib/cjs/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +6 -2
  12. package/lib/cjs/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
  13. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +3 -11
  14. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +45 -36
  15. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -1
  16. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.d.ts +1 -3
  17. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.js +30 -30
  18. package/lib/cjs/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.js.map +1 -1
  19. package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +2 -7
  20. package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +8 -21
  21. package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +1 -1
  22. package/lib/cjs/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +3 -0
  23. package/lib/cjs/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +7 -7
  24. package/lib/cjs/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -1
  25. package/lib/cjs/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
  26. package/lib/cjs/tree-widget-react/components/trees/common/useGuid.js +14 -0
  27. package/lib/cjs/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
  28. package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +4 -1
  29. package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
  30. package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +4 -6
  31. package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +31 -26
  32. package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
  33. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +1 -1
  34. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +4 -2
  35. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
  36. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +1 -5
  37. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +44 -44
  38. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
  39. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +3 -6
  40. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +20 -16
  41. package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
  42. package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +3 -1
  43. package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
  44. package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +6 -10
  45. package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +107 -64
  46. package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
  47. package/lib/cjs/tree-widget-react/components/trees/models-tree/UseModelsTree.js +18 -8
  48. package/lib/cjs/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
  49. package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.d.ts +24 -0
  50. package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.js +46 -0
  51. package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.js.map +1 -1
  52. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +40 -9
  53. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +68 -39
  54. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -1
  55. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +13 -5
  56. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +20 -14
  57. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +1 -1
  58. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +4 -13
  59. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +62 -60
  60. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
  61. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +6 -2
  62. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +155 -177
  63. package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +1 -1
  64. package/lib/esm/tree-widget-react/TreeWidget.d.ts +1 -2
  65. package/lib/esm/tree-widget-react/TreeWidget.js +12 -12
  66. package/lib/esm/tree-widget-react/TreeWidget.js.map +1 -1
  67. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +2 -3
  68. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +5 -3
  69. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
  70. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +4 -7
  71. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +39 -31
  72. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
  73. package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +6 -2
  74. package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
  75. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +3 -11
  76. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +45 -36
  77. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -1
  78. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.d.ts +1 -3
  79. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.js +30 -30
  80. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesVisibilityHandler.js.map +1 -1
  81. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +2 -7
  82. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +8 -20
  83. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +1 -1
  84. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +3 -0
  85. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +7 -7
  86. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -1
  87. package/lib/esm/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
  88. package/lib/esm/tree-widget-react/components/trees/common/useGuid.js +11 -0
  89. package/lib/esm/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
  90. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +4 -1
  91. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
  92. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +4 -6
  93. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +31 -26
  94. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
  95. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +1 -1
  96. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +4 -2
  97. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
  98. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +1 -5
  99. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +44 -44
  100. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
  101. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +3 -6
  102. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +21 -17
  103. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
  104. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +3 -1
  105. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
  106. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +6 -10
  107. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +107 -64
  108. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
  109. package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +18 -8
  110. package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
  111. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.d.ts +24 -0
  112. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js +44 -0
  113. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js.map +1 -1
  114. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +40 -9
  115. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +70 -41
  116. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -1
  117. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +13 -5
  118. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +22 -16
  119. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +1 -1
  120. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +4 -13
  121. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +63 -61
  122. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
  123. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +6 -2
  124. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +157 -179
  125. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +1 -1
  126. package/package.json +8 -8
@@ -11,18 +11,18 @@ export const defaultHierarchyConfiguration = {
11
11
  hideRootSubject: false,
12
12
  };
13
13
  export class IModelContentTreeDefinition {
14
- _impl;
15
- _idsCache;
16
- _hierarchyConfig;
17
- _selectQueryFactory;
18
- _nodeLabelSelectClauseFactory;
14
+ #impl;
15
+ #idsCache;
16
+ #hierarchyConfig;
17
+ #selectQueryFactory;
18
+ #nodeLabelSelectClauseFactory;
19
19
  constructor(props) {
20
- this._idsCache = props.idsCache;
21
- this._hierarchyConfig = props.hierarchyConfig;
22
- this._impl = createPredicateBasedHierarchyDefinition({
20
+ this.#idsCache = props.idsCache;
21
+ this.#hierarchyConfig = props.hierarchyConfig;
22
+ this.#impl = createPredicateBasedHierarchyDefinition({
23
23
  classHierarchyInspector: props.imodelAccess,
24
24
  hierarchy: {
25
- rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this._hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),
25
+ rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.#hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),
26
26
  childNodes: [
27
27
  {
28
28
  parentInstancesNodePredicate: "BisCore.Subject",
@@ -73,10 +73,10 @@ export class IModelContentTreeDefinition {
73
73
  ],
74
74
  },
75
75
  });
76
- this._nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });
77
- this._selectQueryFactory = createNodesQueryClauseFactory({
76
+ this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });
77
+ this.#selectQueryFactory = createNodesQueryClauseFactory({
78
78
  imodelAccess: props.imodelAccess,
79
- instanceLabelSelectClauseFactory: this._nodeLabelSelectClauseFactory,
79
+ instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,
80
80
  });
81
81
  }
82
82
  async postProcessNode(node) {
@@ -87,21 +87,21 @@ export class IModelContentTreeDefinition {
87
87
  return node;
88
88
  }
89
89
  async defineHierarchyLevel(props) {
90
- return this._impl.defineHierarchyLevel(props);
90
+ return this.#impl.defineHierarchyLevel(props);
91
91
  }
92
92
  async createSubjectChildrenQuery({ parentNodeInstanceIds: parentSubjectIds, instanceFilter, }) {
93
93
  const [subjectFilterClauses, modelFilterClauses] = await Promise.all([
94
- this._selectQueryFactory.createFilterClauses({
94
+ this.#selectQueryFactory.createFilterClauses({
95
95
  filter: instanceFilter,
96
96
  contentClass: { fullName: "BisCore.Subject", alias: "this" },
97
97
  }),
98
- this._selectQueryFactory.createFilterClauses({
98
+ this.#selectQueryFactory.createFilterClauses({
99
99
  filter: instanceFilter,
100
100
  contentClass: { fullName: "BisCore.Model", alias: "this" },
101
101
  }),
102
102
  ]);
103
103
  const [childSubjectIds, childModelIds] = parentSubjectIds.length
104
- ? await Promise.all([this._idsCache.getChildSubjectIds(parentSubjectIds), this._idsCache.getChildSubjectModelIds(parentSubjectIds)])
104
+ ? await Promise.all([this.#idsCache.getChildSubjectIds(parentSubjectIds), this.#idsCache.getChildSubjectModelIds(parentSubjectIds)])
105
105
  : [[IModel.rootSubjectId], []];
106
106
  const defs = new Array();
107
107
  childSubjectIds.length &&
@@ -110,11 +110,11 @@ export class IModelContentTreeDefinition {
110
110
  query: {
111
111
  ecsql: `
112
112
  SELECT
113
- ${await this._selectQueryFactory.createSelectClause({
113
+ ${await this.#selectQueryFactory.createSelectClause({
114
114
  ecClassId: { selector: "this.ECClassId" },
115
115
  ecInstanceId: { selector: "this.ECInstanceId" },
116
116
  nodeLabel: {
117
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
117
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
118
118
  classAlias: "this",
119
119
  className: "BisCore.Subject",
120
120
  }),
@@ -134,7 +134,7 @@ export class IModelContentTreeDefinition {
134
134
  ${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : ""}
135
135
  `,
136
136
  bindings: [
137
- { type: "idset", value: await this._idsCache.getParentSubjectIds() },
137
+ { type: "idset", value: await this.#idsCache.getParentSubjectIds() },
138
138
  ...childSubjectIds.map((id) => ({ type: "id", value: id })),
139
139
  ],
140
140
  },
@@ -147,11 +147,11 @@ export class IModelContentTreeDefinition {
147
147
  SELECT model.ECInstanceId AS ECInstanceId, model.*
148
148
  FROM (
149
149
  SELECT
150
- ${await this._selectQueryFactory.createSelectClause({
150
+ ${await this.#selectQueryFactory.createSelectClause({
151
151
  ecClassId: { selector: "m.ECClassId" },
152
152
  ecInstanceId: { selector: "m.ECInstanceId" },
153
153
  nodeLabel: {
154
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
154
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
155
155
  classAlias: "partition",
156
156
  className: "BisCore.InformationPartitionElement",
157
157
  }),
@@ -195,7 +195,7 @@ export class IModelContentTreeDefinition {
195
195
  query: {
196
196
  ecsql: `
197
197
  SELECT
198
- ${await this._selectQueryFactory.createSelectClause({
198
+ ${await this.#selectQueryFactory.createSelectClause({
199
199
  ecClassId: { selector: "this.ECClassId" },
200
200
  ecInstanceId: { selector: "this.ECInstanceId" },
201
201
  nodeLabel: "", // doesn't matter - the node is always hidden
@@ -212,13 +212,13 @@ export class IModelContentTreeDefinition {
212
212
  ];
213
213
  }
214
214
  async createGeometricModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, viewType, }) {
215
- const childCategoryIds = await this._idsCache.getModelCategories(modelIds);
215
+ const childCategoryIds = await this.#idsCache.getModelCategories(modelIds);
216
216
  const { categoryClass } = getClassNameByViewType(viewType);
217
- const categoryFilterClauses = await this._selectQueryFactory.createFilterClauses({
217
+ const categoryFilterClauses = await this.#selectQueryFactory.createFilterClauses({
218
218
  filter: instanceFilter,
219
219
  contentClass: { fullName: categoryClass, alias: "this" },
220
220
  });
221
- const informationContentElementFilterClauses = await this._selectQueryFactory.createFilterClauses({
221
+ const informationContentElementFilterClauses = await this.#selectQueryFactory.createFilterClauses({
222
222
  filter: instanceFilter,
223
223
  contentClass: { fullName: "BisCore.InformationContentElement", alias: "this" },
224
224
  });
@@ -229,11 +229,11 @@ export class IModelContentTreeDefinition {
229
229
  query: {
230
230
  ecsql: `
231
231
  SELECT
232
- ${await this._selectQueryFactory.createSelectClause({
232
+ ${await this.#selectQueryFactory.createSelectClause({
233
233
  ecClassId: { selector: "this.ECClassId" },
234
234
  ecInstanceId: { selector: "this.ECInstanceId" },
235
235
  nodeLabel: {
236
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
236
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
237
237
  classAlias: "this",
238
238
  className: categoryClass,
239
239
  }),
@@ -260,11 +260,11 @@ export class IModelContentTreeDefinition {
260
260
  query: {
261
261
  ecsql: `
262
262
  SELECT
263
- ${await this._selectQueryFactory.createSelectClause({
263
+ ${await this.#selectQueryFactory.createSelectClause({
264
264
  ecClassId: { selector: "this.ECClassId" },
265
265
  ecInstanceId: { selector: "this.ECInstanceId" },
266
266
  nodeLabel: {
267
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
267
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
268
268
  classAlias: "this",
269
269
  className: "BisCore.InformationContentElement",
270
270
  }),
@@ -296,7 +296,7 @@ export class IModelContentTreeDefinition {
296
296
  }
297
297
  const { elementClass, modelClass } = getClassNameByViewType(viewType);
298
298
  return Promise.all(getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {
299
- const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
299
+ const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
300
300
  filter: instanceFilter,
301
301
  contentClass: { fullName: elementClass, alias: "this" },
302
302
  });
@@ -305,11 +305,11 @@ export class IModelContentTreeDefinition {
305
305
  query: {
306
306
  ecsql: `
307
307
  SELECT
308
- ${await this._selectQueryFactory.createSelectClause({
308
+ ${await this.#selectQueryFactory.createSelectClause({
309
309
  ecClassId: { selector: "this.ECClassId" },
310
310
  ecInstanceId: { selector: "this.ECInstanceId" },
311
311
  nodeLabel: {
312
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
312
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
313
313
  classAlias: "this",
314
314
  className: elementClass,
315
315
  }),
@@ -339,7 +339,7 @@ export class IModelContentTreeDefinition {
339
339
  }
340
340
  async createModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, }) {
341
341
  return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
342
- const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
342
+ const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
343
343
  filter: instanceFilter,
344
344
  contentClass: { fullName: classFullName, alias: "this" },
345
345
  });
@@ -348,11 +348,11 @@ export class IModelContentTreeDefinition {
348
348
  query: {
349
349
  ecsql: `
350
350
  SELECT
351
- ${await this._selectQueryFactory.createSelectClause({
351
+ ${await this.#selectQueryFactory.createSelectClause({
352
352
  ecClassId: { selector: "this.ECClassId" },
353
353
  ecInstanceId: { selector: "this.ECInstanceId" },
354
354
  nodeLabel: {
355
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
355
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
356
356
  classAlias: "this",
357
357
  className: classFullName,
358
358
  }),
@@ -414,7 +414,7 @@ export class IModelContentTreeDefinition {
414
414
  async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }) {
415
415
  const groupIds = parentNode.extendedData?.groupIds;
416
416
  return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
417
- const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
417
+ const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
418
418
  filter: instanceFilter,
419
419
  contentClass: { fullName: classFullName, alias: "this" },
420
420
  });
@@ -423,11 +423,11 @@ export class IModelContentTreeDefinition {
423
423
  query: {
424
424
  ecsql: `
425
425
  SELECT
426
- ${await this._selectQueryFactory.createSelectClause({
426
+ ${await this.#selectQueryFactory.createSelectClause({
427
427
  ecClassId: { selector: "this.ECClassId" },
428
428
  ecInstanceId: { selector: "this.ECInstanceId" },
429
429
  nodeLabel: {
430
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
430
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
431
431
  classAlias: "this",
432
432
  className: classFullName,
433
433
  }),
@@ -454,7 +454,7 @@ export class IModelContentTreeDefinition {
454
454
  async createGroupInformationElementMemberElementsQuery({ parentNode, instanceFilter, }) {
455
455
  const groupIds = parentNode.extendedData?.groupIds;
456
456
  return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
457
- const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
457
+ const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
458
458
  filter: instanceFilter,
459
459
  contentClass: { fullName: classFullName, alias: "this" },
460
460
  });
@@ -463,11 +463,11 @@ export class IModelContentTreeDefinition {
463
463
  query: {
464
464
  ecsql: `
465
465
  SELECT
466
- ${await this._selectQueryFactory.createSelectClause({
466
+ ${await this.#selectQueryFactory.createSelectClause({
467
467
  ecClassId: { selector: "this.ECClassId" },
468
468
  ecInstanceId: { selector: "this.ECInstanceId" },
469
469
  nodeLabel: {
470
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
470
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
471
471
  classAlias: "this",
472
472
  className: classFullName,
473
473
  }),
@@ -494,7 +494,7 @@ export class IModelContentTreeDefinition {
494
494
  }
495
495
  async createElementChildrenQuery({ parentNodeInstanceIds: elementIds, instanceFilter, }) {
496
496
  return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
497
- const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
497
+ const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
498
498
  filter: instanceFilter,
499
499
  contentClass: { fullName: classFullName, alias: "this" },
500
500
  });
@@ -503,11 +503,11 @@ export class IModelContentTreeDefinition {
503
503
  query: {
504
504
  ecsql: `
505
505
  SELECT
506
- ${await this._selectQueryFactory.createSelectClause({
506
+ ${await this.#selectQueryFactory.createSelectClause({
507
507
  ecClassId: { selector: "this.ECClassId" },
508
508
  ecInstanceId: { selector: "this.ECInstanceId" },
509
509
  nodeLabel: {
510
- selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
510
+ selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
511
511
  classAlias: "this",
512
512
  className: classFullName,
513
513
  }),
@@ -1 +1 @@
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,oBAAoB,CAAC;AAC5C,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yCAAyC,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,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U,IAAI,eAAe,CAAC;IAChE,MAAM,oBAAoB,GAAG,KAAK,EAAE,YAAY,IAAI,iBAAiB,CAAC;IACtE,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;;;;;;;;;;;WAWT;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 { createIdsSelector, parseIdsSelectorResult } from \"../common/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\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: \"BisCore.Subject\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.ISubModeledElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel3d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel2d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.SpatialCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.DrawingCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.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: \"BisCore.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: \"BisCore.Subject\", alias: \"this\" },\n }),\n this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.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: \"BisCore.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: \"BisCore.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: \"BisCore.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: \"BisCore.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 BisCore.Model m\n JOIN BisCore.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: \"BisCore.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 BisCore.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.getModelCategories(modelIds);\n\n const { categoryClass } = getClassNameByViewType(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 } = getClassNameByViewType(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 getClassNameByViewType(view: \"2d\" | \"3d\") {\n if (view === \"2d\") {\n return { categoryClass: \"BisCore.DrawingCategory\", elementClass: \"BisCore.GeometricElement2d\", modelClass: \"BisCore.GeometricModel2d\" } as const;\n }\n return { categoryClass: \"BisCore.SpatialCategory\", elementClass: \"BisCore.GeometricElement3d\", modelClass: \"BisCore.GeometricModel3d\" } as const;\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? \"BisCore.Model\";\n const elementClassFullName = props?.elementClass ?? \"BisCore.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 BisCore.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,oBAAoB,CAAC;AAC5C,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yCAAyC,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAuB/E,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAA4C;IACpF,eAAe,EAAE,KAAK;CACvB,CAAC;AAQF,MAAM,OAA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,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;;;;;;;;;;;WAWT;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 { createIdsSelector, parseIdsSelectorResult } from \"../common/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\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: \"BisCore.Subject\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.ISubModeledElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel3d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel2d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.SpatialCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.DrawingCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.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: \"BisCore.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: \"BisCore.Subject\", alias: \"this\" },\n }),\n this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.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: \"BisCore.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: \"BisCore.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: \"BisCore.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: \"BisCore.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 BisCore.Model m\n JOIN BisCore.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: \"BisCore.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 BisCore.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.getModelCategories(modelIds);\n\n const { categoryClass } = getClassNameByViewType(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 } = getClassNameByViewType(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 getClassNameByViewType(view: \"2d\" | \"3d\") {\n if (view === \"2d\") {\n return { categoryClass: \"BisCore.DrawingCategory\", elementClass: \"BisCore.GeometricElement2d\", modelClass: \"BisCore.GeometricModel2d\" } as const;\n }\n return { categoryClass: \"BisCore.SpatialCategory\", elementClass: \"BisCore.GeometricElement3d\", modelClass: \"BisCore.GeometricModel3d\" } as const;\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? \"BisCore.Model\";\n const elementClassFullName = props?.elementClass ?? \"BisCore.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 BisCore.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, Id64String } from "@itwin/core-bentley";
1
+ import type { GuidString, Id64Array, Id64String } from "@itwin/core-bentley";
2
2
  import type { LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies";
3
3
  /** @internal */
4
4
  export declare class IModelContentTreeIdsCache {
5
- private _queryExecutor;
6
- private _subjectInfos;
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,16 +2,20 @@
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 { pushToMap } from "../../common/Utils.js";
7
7
  /** @internal */
8
8
  export class IModelContentTreeIdsCache {
9
- _queryExecutor;
10
- _subjectInfos;
11
- _parentSubjectIds; // the list should contain a subject id if its node should be shown as having children
12
- _modelInfos;
13
- constructor(_queryExecutor) {
14
- this._queryExecutor = _queryExecutor;
9
+ #subjectInfos;
10
+ #parentSubjectIds; // the list should contain a subject id if its node should be shown as having children
11
+ #modelInfos;
12
+ #queryExecutor;
13
+ #componentId;
14
+ #componentName;
15
+ constructor(queryExecutor, componentId) {
16
+ this.#queryExecutor = queryExecutor;
17
+ this.#componentId = componentId ?? Guid.createValue();
18
+ this.#componentName = "IModelContentTreeIdsCache";
15
19
  }
16
20
  async *querySubjects() {
17
21
  const subjectsQuery = `
@@ -34,7 +38,7 @@ export class IModelContentTreeIdsCache {
34
38
  END hideInHierarchy
35
39
  FROM bis.Subject s
36
40
  `;
37
- for await (const row of this._queryExecutor.createQueryReader({ ecsql: subjectsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded" })) {
41
+ for await (const row of this.#queryExecutor.createQueryReader({ ecsql: subjectsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/subjects` })) {
38
42
  yield { id: row.id, parentId: row.parentId, targetPartitionId: row.targetPartitionId, hideInHierarchy: !!row.hideInHierarchy };
39
43
  }
40
44
  }
@@ -45,12 +49,12 @@ export class IModelContentTreeIdsCache {
45
49
  INNER JOIN bis.Model m ON m.ModeledElement.Id = p.ECInstanceId
46
50
  WHERE NOT m.IsPrivate
47
51
  `;
48
- for await (const row of this._queryExecutor.createQueryReader({ ecsql: modelsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded" })) {
52
+ for await (const row of this.#queryExecutor.createQueryReader({ ecsql: modelsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/models` })) {
49
53
  yield { id: row.id, parentId: row.parentId };
50
54
  }
51
55
  }
52
56
  async getSubjectInfos() {
53
- this._subjectInfos ??= (async () => {
57
+ this.#subjectInfos ??= (async () => {
54
58
  const [subjectInfos, targetPartitionSubjects] = await Promise.all([
55
59
  (async () => {
56
60
  const result = new Map();
@@ -92,11 +96,11 @@ export class IModelContentTreeIdsCache {
92
96
  }
93
97
  return subjectInfos;
94
98
  })();
95
- return this._subjectInfos;
99
+ return this.#subjectInfos;
96
100
  }
97
101
  /** Returns ECInstanceIDs of Subjects that either have direct Model or at least one child Subject with a Model. */
98
102
  async getParentSubjectIds() {
99
- this._parentSubjectIds ??= (async () => {
103
+ this.#parentSubjectIds ??= (async () => {
100
104
  const subjectInfos = await this.getSubjectInfos();
101
105
  const parentSubjectIds = new Set();
102
106
  subjectInfos.forEach((subjectInfo, subjectId) => {
@@ -112,7 +116,7 @@ export class IModelContentTreeIdsCache {
112
116
  });
113
117
  return [...parentSubjectIds];
114
118
  })();
115
- return this._parentSubjectIds;
119
+ return this.#parentSubjectIds;
116
120
  }
117
121
  /**
118
122
  * Returns child subjects of the specified parent subjects as they're displayed in the hierarchy - taking into
@@ -153,7 +157,7 @@ export class IModelContentTreeIdsCache {
153
157
  return modelIds;
154
158
  }
155
159
  async *queryModelCategories() {
156
- const query = /* sql */ `
160
+ const query = `
157
161
  SELECT Model.Id modelId, Category.Id categoryId
158
162
  FROM BisCore.GeometricElement3d
159
163
  WHERE Parent.Id IS NULL
@@ -164,12 +168,12 @@ export class IModelContentTreeIdsCache {
164
168
  WHERE Parent.Id IS NULL
165
169
  GROUP BY Model.Id, Category.Id
166
170
  `;
167
- for await (const row of this._queryExecutor.createQueryReader({ ecsql: query }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded" })) {
171
+ for await (const row of this.#queryExecutor.createQueryReader({ ecsql: query }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/model-categories` })) {
168
172
  yield { modelId: row.modelId, categoryId: row.categoryId };
169
173
  }
170
174
  }
171
175
  async getModelInfos() {
172
- this._modelInfos ??= (async () => {
176
+ this.#modelInfos ??= (async () => {
173
177
  const modelInfos = new Map();
174
178
  for await (const { modelId, categoryId } of this.queryModelCategories()) {
175
179
  const entry = modelInfos.get(modelId);
@@ -182,7 +186,7 @@ export class IModelContentTreeIdsCache {
182
186
  }
183
187
  return modelInfos;
184
188
  })();
185
- return this._modelInfos;
189
+ return this.#modelInfos;
186
190
  }
187
191
  async getModelCategories(modelIds) {
188
192
  const modelInfos = await this.getModelInfos();