@itwin/tree-widget-react 4.0.0-alpha.2 → 4.0.0-alpha.20

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 (309) hide show
  1. package/CHANGELOG.md +281 -1
  2. package/README.md +190 -63
  3. package/lib/esm/tree-widget-react/TreeWidget.d.ts +7 -4
  4. package/lib/esm/tree-widget-react/TreeWidget.js +32 -12
  5. package/lib/esm/tree-widget-react/TreeWidget.js.map +1 -1
  6. package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.d.ts +7 -1
  7. package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js +22 -23
  8. package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js.map +1 -1
  9. package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +4 -3
  10. package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
  11. package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js +4 -3
  12. package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js.map +1 -1
  13. package/lib/esm/tree-widget-react/components/tree-header/SearchBox.d.ts +1 -1
  14. package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js +6 -6
  15. package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js.map +1 -1
  16. package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.css +3 -2
  17. package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.d.ts +4 -4
  18. package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js +1 -1
  19. package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js.map +1 -1
  20. package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.css +1 -0
  21. package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.d.ts +12 -5
  22. package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js +13 -9
  23. package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js.map +1 -1
  24. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +3 -3
  25. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +3 -2
  26. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js.map +1 -1
  27. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +11 -7
  28. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +64 -14
  29. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
  30. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +8 -6
  31. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +4 -4
  32. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +1 -1
  33. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +41 -8
  34. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +700 -125
  35. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
  36. package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.d.ts +18 -7
  37. package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +124 -83
  38. package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
  39. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +70 -0
  40. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +504 -0
  41. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -0
  42. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.d.ts +41 -0
  43. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js +50 -0
  44. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js.map +1 -0
  45. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.d.ts +27 -0
  46. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js +136 -0
  47. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js.map +1 -0
  48. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +54 -0
  49. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +291 -0
  50. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js.map +1 -0
  51. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.d.ts +64 -0
  52. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +94 -0
  53. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js.map +1 -0
  54. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.d.ts +36 -0
  55. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js +219 -0
  56. package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js.map +1 -0
  57. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts +12 -0
  58. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js +19 -0
  59. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map +1 -0
  60. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +30 -0
  61. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +47 -0
  62. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js.map +1 -0
  63. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.d.ts +45 -0
  64. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js +569 -0
  65. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js.map +1 -0
  66. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.d.ts +6 -0
  67. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js +33 -0
  68. package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js.map +1 -0
  69. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.d.ts +24 -0
  70. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +115 -0
  71. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js.map +1 -0
  72. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.d.ts +44 -0
  73. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js +61 -0
  74. package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js.map +1 -0
  75. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.d.ts +50 -0
  76. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +364 -0
  77. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js.map +1 -0
  78. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.d.ts +19 -0
  79. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js +32 -0
  80. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js.map +1 -0
  81. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.d.ts +20 -0
  82. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js +53 -0
  83. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js.map +1 -0
  84. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +37 -0
  85. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +177 -0
  86. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js.map +1 -0
  87. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.d.ts +55 -0
  88. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js +53 -0
  89. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js.map +1 -0
  90. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.d.ts +32 -0
  91. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js +168 -0
  92. package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js.map +1 -0
  93. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +11 -23
  94. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +22 -76
  95. package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +1 -1
  96. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.d.ts +28 -4
  97. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js +73 -2
  98. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js.map +1 -1
  99. package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js +1 -0
  100. package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js.map +1 -1
  101. package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.d.ts +186 -0
  102. package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js +79 -0
  103. package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js.map +1 -0
  104. package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.d.ts +15 -7
  105. package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +33 -22
  106. package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
  107. package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +1 -0
  108. package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js +2 -1
  109. package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js.map +1 -1
  110. package/lib/esm/tree-widget-react/components/trees/common/Utils.d.ts +45 -23
  111. package/lib/esm/tree-widget-react/components/trees/common/Utils.js +110 -44
  112. package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
  113. package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.d.ts +2 -3
  114. package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js +4 -5
  115. package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js.map +1 -1
  116. package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.d.ts +1 -0
  117. package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js +1 -0
  118. package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js.map +1 -1
  119. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.css +25 -0
  120. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.d.ts +27 -0
  121. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js +47 -0
  122. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js.map +1 -0
  123. package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.d.ts +1 -0
  124. package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js +4 -3
  125. package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +1 -1
  126. package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.css +16 -0
  127. package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.d.ts +7 -0
  128. package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js +19 -0
  129. package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js.map +1 -0
  130. package/lib/esm/tree-widget-react/components/trees/common/components/Tree.css +11 -0
  131. package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +9 -12
  132. package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +55 -38
  133. package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
  134. package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.css +2 -1
  135. package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts +24 -8
  136. package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js +41 -25
  137. package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map +1 -1
  138. package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.d.ts +6 -1
  139. package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js +13 -4
  140. package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js.map +1 -1
  141. package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.d.ts +6 -5
  142. package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js +7 -7
  143. package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js.map +1 -1
  144. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.d.ts +5 -5
  145. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js +10 -6
  146. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +1 -1
  147. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts +5 -3
  148. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +17 -15
  149. package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map +1 -1
  150. package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.d.ts +74 -0
  151. package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js +207 -0
  152. package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -0
  153. package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.d.ts +43 -0
  154. package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js +47 -0
  155. package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js.map +1 -0
  156. package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.d.ts +12 -0
  157. package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js +112 -0
  158. package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js.map +1 -0
  159. package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.d.ts → internal/Rxjs.d.ts} +9 -2
  160. package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.js → internal/Rxjs.js} +10 -2
  161. package/lib/esm/tree-widget-react/components/trees/common/internal/Rxjs.js.map +1 -0
  162. package/lib/esm/tree-widget-react/components/trees/common/{Tooltip.d.ts → internal/Tooltip.d.ts} +4 -8
  163. package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js +18 -0
  164. package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js.map +1 -0
  165. package/lib/esm/tree-widget-react/components/trees/common/internal/Types.d.ts +14 -0
  166. package/lib/esm/tree-widget-react/components/{tree-header/SearchBox.css → trees/common/internal/Types.js} +2 -4
  167. package/lib/esm/tree-widget-react/components/trees/common/internal/Types.js.map +1 -0
  168. package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.d.ts +6 -0
  169. package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js +24 -0
  170. package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js.map +1 -0
  171. package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.d.ts → internal/UseHierarchiesLocalization.d.ts} +3 -2
  172. package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.js → internal/UseHierarchiesLocalization.js} +6 -2
  173. package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchiesLocalization.js.map +1 -0
  174. package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.d.ts → internal/UseHierarchyFiltering.d.ts} +1 -1
  175. package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.js → internal/UseHierarchyFiltering.js} +5 -4
  176. package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchyFiltering.js.map +1 -0
  177. package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.d.ts +17 -0
  178. package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js +32 -0
  179. package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js.map +1 -0
  180. package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.d.ts → internal/UseIModelChangeListener.d.ts} +1 -0
  181. package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.js → internal/UseIModelChangeListener.js} +1 -0
  182. package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelChangeListener.js.map +1 -0
  183. package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +70 -0
  184. package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +172 -0
  185. package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js.map +1 -0
  186. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.d.ts +20 -0
  187. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js +60 -0
  188. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js.map +1 -0
  189. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.d.ts +39 -0
  190. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +160 -0
  191. package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js.map +1 -0
  192. package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.d.ts +3 -0
  193. package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js +12 -0
  194. package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js.map +1 -0
  195. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +68 -0
  196. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +170 -0
  197. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js.map +1 -0
  198. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +20 -0
  199. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +46 -0
  200. package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -0
  201. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.d.ts +91 -0
  202. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js +112 -0
  203. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js.map +1 -0
  204. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +236 -0
  205. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +600 -0
  206. package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -0
  207. package/lib/esm/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
  208. package/lib/esm/tree-widget-react/components/trees/common/useGuid.js +11 -0
  209. package/lib/esm/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
  210. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +7 -2
  211. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +29 -20
  212. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
  213. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +2 -6
  214. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +2 -2
  215. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
  216. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +5 -6
  217. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +36 -21
  218. package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
  219. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +9 -2
  220. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +48 -36
  221. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
  222. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +2 -6
  223. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js +2 -2
  224. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
  225. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +13 -4
  226. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +80 -74
  227. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
  228. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +7 -10
  229. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +45 -36
  230. package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
  231. package/lib/esm/tree-widget-react/components/trees/index.d.ts +16 -5
  232. package/lib/esm/tree-widget-react/components/trees/index.js +16 -4
  233. package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
  234. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +3 -3
  235. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +3 -2
  236. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js.map +1 -1
  237. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.d.ts +3 -3
  238. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +34 -24
  239. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
  240. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +14 -7
  241. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +11 -7
  242. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
  243. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +24 -20
  244. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +193 -154
  245. package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
  246. package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.d.ts +60 -10
  247. package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +97 -238
  248. package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
  249. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +22 -25
  250. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +280 -298
  251. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
  252. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.d.ts +1 -1
  253. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +1 -1
  254. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.d.ts +41 -0
  255. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js +253 -0
  256. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js.map +1 -0
  257. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.d.ts +27 -0
  258. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js +148 -0
  259. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js.map +1 -0
  260. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +76 -0
  261. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +269 -0
  262. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -0
  263. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.d.ts +53 -0
  264. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js +71 -0
  265. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js.map +1 -0
  266. package/lib/esm/tree-widget-react-internal.d.ts +12 -0
  267. package/lib/esm/tree-widget-react-internal.js +18 -0
  268. package/lib/esm/tree-widget-react-internal.js.map +1 -0
  269. package/lib/public/locales/en/TreeWidget.json +41 -54
  270. package/package.json +76 -79
  271. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.d.ts +0 -28
  272. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js +0 -87
  273. package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js.map +0 -1
  274. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.d.ts +0 -7
  275. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js +0 -66
  276. package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js.map +0 -1
  277. package/lib/esm/tree-widget-react/components/trees/common/Rxjs.js.map +0 -1
  278. package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js +0 -24
  279. package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js.map +0 -1
  280. package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.d.ts +0 -7
  281. package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js +0 -21
  282. package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js.map +0 -1
  283. package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.d.ts +0 -11
  284. package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js +0 -24
  285. package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js.map +0 -1
  286. package/lib/esm/tree-widget-react/components/trees/common/UseHierarchiesLocalization.js.map +0 -1
  287. package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.js.map +0 -1
  288. package/lib/esm/tree-widget-react/components/trees/common/UseIModelChangeListener.js.map +0 -1
  289. package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.d.ts +0 -20
  290. package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js +0 -127
  291. package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js.map +0 -1
  292. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.d.ts +0 -7
  293. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js +0 -12
  294. package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js.map +0 -1
  295. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.d.ts +0 -7
  296. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js +0 -21
  297. package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js.map +0 -1
  298. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +0 -29
  299. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +0 -138
  300. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +0 -1
  301. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +0 -25
  302. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +0 -173
  303. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +0 -1
  304. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +0 -106
  305. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +0 -663
  306. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +0 -1
  307. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.d.ts +0 -12
  308. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js +0 -48
  309. package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js.map +0 -1
@@ -1,42 +1,30 @@
1
- import type { Viewport } from "@itwin/core-frontend";
1
+ import type { Id64Array, Id64String } from "@itwin/core-bentley";
2
+ import type { TreeWidgetViewport } from "./TreeWidgetViewport.js";
2
3
  /**
3
4
  * Data structure that describes category.
4
5
  * @beta
5
6
  */
6
7
  export interface CategoryInfo {
7
- categoryId: string;
8
- subCategoryIds?: string[];
8
+ categoryId: Id64String;
9
+ subCategoryIds?: Id64Array;
9
10
  }
10
- /**
11
- * Toggles visibility of categories to show or hide.
12
- */
13
- export declare function toggleAllCategories(viewport: Viewport, display: boolean): Promise<void>;
14
- /**
15
- * Gets ids of all categories from specified imodel and viewport.
16
- */
17
- export declare function getCategories(viewport: Viewport): Promise<string[]>;
18
- /**
19
- * Changes category display in the viewport.
20
- */
21
- export declare function enableCategoryDisplay(viewport: Viewport, ids: string[], enabled: boolean, enableAllSubCategories?: boolean): Promise<void>;
22
- /**
23
- * Changes subcategory display in the viewport
24
- */
25
- export declare function enableSubCategoryDisplay(viewport: Viewport, key: string, enabled: boolean): void;
26
- export declare function loadCategoriesFromViewport(vp: Viewport): Promise<CategoryInfo[]>;
27
11
  /**
28
12
  * Enable display of all given categories.
29
13
  * @public
30
14
  */
31
- export declare function showAllCategories(categories: string[], viewport: Viewport): Promise<void>;
15
+ export declare function showAllCategories(categories: Id64Array, viewport: TreeWidgetViewport): Promise<void>;
32
16
  /**
33
17
  * Disable display of all given categories.
34
18
  * @public
35
19
  */
36
- export declare function hideAllCategories(categories: string[], viewport: Viewport): Promise<void>;
20
+ export declare function hideAllCategories(categories: Id64Array, viewport: TreeWidgetViewport): Promise<void>;
37
21
  /**
38
22
  * Invert display of all given categories.
23
+ * Categories are inverted like this:
24
+ * - If category is visible, it will be hidden.
25
+ * - If category is hidden, it will be visible.
26
+ * - If category is partially visible, it will be fully visible.
39
27
  * @public
40
28
  */
41
- export declare function invertAllCategories(categories: CategoryInfo[], viewport: Viewport): Promise<void>;
29
+ export declare function invertAllCategories(categories: CategoryInfo[], viewport: TreeWidgetViewport): Promise<void>;
42
30
  //# sourceMappingURL=CategoriesVisibilityUtils.d.ts.map
@@ -2,64 +2,7 @@
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 { QueryRowFormat } from "@itwin/core-common";
6
- import { PerModelCategoryVisibility } from "@itwin/core-frontend";
7
- /**
8
- * Toggles visibility of categories to show or hide.
9
- */
10
- export async function toggleAllCategories(viewport, display) {
11
- const ids = await getCategories(viewport);
12
- if (ids.length === 0) {
13
- return;
14
- }
15
- await enableCategoryDisplay(viewport, ids, display);
16
- }
17
- /**
18
- * Gets ids of all categories from specified imodel and viewport.
19
- */
20
- export async function getCategories(viewport) {
21
- const categories = await loadCategoriesFromViewport(viewport);
22
- return categories.map((category) => category.categoryId);
23
- }
24
- /**
25
- * Changes category display in the viewport.
26
- */
27
- export async function enableCategoryDisplay(viewport, ids, enabled, enableAllSubCategories = true) {
28
- viewport.changeCategoryDisplay(ids, enabled, enableAllSubCategories);
29
- // remove category overrides per model
30
- const modelsContainingOverrides = [];
31
- for (const ovr of viewport.perModelCategoryVisibility) {
32
- if (ids.findIndex((id) => id === ovr.categoryId) !== -1) {
33
- modelsContainingOverrides.push(ovr.modelId);
34
- }
35
- }
36
- viewport.perModelCategoryVisibility.setOverride(modelsContainingOverrides, ids, PerModelCategoryVisibility.Override.None);
37
- // changeCategoryDisplay only enables subcategories, it does not disabled them. So we must do that ourselves.
38
- if (false === enabled) {
39
- (await viewport.iModel.categories.getCategoryInfo(ids)).forEach((categoryInfo) => {
40
- categoryInfo.subCategories.forEach((value) => enableSubCategoryDisplay(viewport, value.id, false));
41
- });
42
- }
43
- }
44
- /**
45
- * Changes subcategory display in the viewport
46
- */
47
- export function enableSubCategoryDisplay(viewport, key, enabled) {
48
- viewport.changeSubCategoryDisplay(key, enabled);
49
- }
50
- export async function loadCategoriesFromViewport(vp) {
51
- // Query categories and add them to state
52
- const selectUsedSpatialCategoryIds = "SELECT DISTINCT Category.Id as id from BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId from BisCore.SpatialCategory)";
53
- const selectUsedDrawingCategoryIds = "SELECT DISTINCT Category.Id as id from BisCore.GeometricElement2d WHERE Model.Id=? AND Category.Id IN (SELECT ECInstanceId from BisCore.DrawingCategory)";
54
- const ecsql = vp.view.is3d() ? selectUsedSpatialCategoryIds : selectUsedDrawingCategoryIds;
55
- const ecsql2 = `SELECT ECInstanceId as id FROM ${vp.view.is3d() ? "BisCore.SpatialCategory" : "BisCore.DrawingCategory"} WHERE ECInstanceId IN (${ecsql})`;
56
- const categories = [];
57
- const rows = await vp.iModel.createQueryReader(ecsql2, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }).toArray();
58
- (await vp.iModel.categories.getCategoryInfo(rows.map((row) => row.id))).forEach((val) => {
59
- categories.push({ categoryId: val.id, subCategoryIds: val.subCategories.size ? [...val.subCategories.keys()] : undefined });
60
- });
61
- return categories;
62
- }
5
+ import { enableCategoryDisplay } from "./internal/VisibilityUtils.js";
63
6
  /**
64
7
  * Enable display of all given categories.
65
8
  * @public
@@ -76,33 +19,36 @@ export async function hideAllCategories(categories, viewport) {
76
19
  }
77
20
  /**
78
21
  * Invert display of all given categories.
22
+ * Categories are inverted like this:
23
+ * - If category is visible, it will be hidden.
24
+ * - If category is hidden, it will be visible.
25
+ * - If category is partially visible, it will be fully visible.
79
26
  * @public
80
27
  */
81
28
  export async function invertAllCategories(categories, viewport) {
82
- const enabled = [];
83
- const disabled = [];
84
- const enabledSubCategories = [];
85
- const disabledSubCategories = [];
29
+ const categoriesToEnable = new Set();
30
+ const categoriesToDisable = new Set();
86
31
  for (const category of categories) {
87
- if (!viewport.view.viewsCategory(category.categoryId)) {
88
- disabled.push(category.categoryId);
32
+ if (!viewport.viewsCategory(category.categoryId)) {
33
+ categoriesToEnable.add(category.categoryId);
89
34
  continue;
90
35
  }
91
- // First, we need to check if at least one subcategory is disabled. If it is true, then only subcategories should change display, not categories.
92
- if (category.subCategoryIds?.some((subCategory) => !viewport.isSubCategoryVisible(subCategory))) {
93
- for (const subCategory of category.subCategoryIds) {
94
- viewport.isSubCategoryVisible(subCategory) ? enabledSubCategories.push(subCategory) : disabledSubCategories.push(subCategory);
95
- }
36
+ // Check if category is in partial state
37
+ if (category.subCategoryIds?.some((subCategory) => !viewport.viewsSubCategory(subCategory))) {
38
+ categoriesToEnable.add(category.categoryId);
96
39
  }
97
40
  else {
98
- enabled.push(category.categoryId);
41
+ categoriesToDisable.add(category.categoryId);
42
+ }
43
+ }
44
+ // collect per model overrides that need to be inverted
45
+ for (const { categoryId, visible } of viewport.perModelCategoryOverrides) {
46
+ if (!visible && categoriesToDisable.has(categoryId)) {
47
+ categoriesToEnable.add(categoryId);
48
+ categoriesToDisable.delete(categoryId);
99
49
  }
100
50
  }
101
- // Disable enabled
102
- enabledSubCategories.forEach((subCategory) => enableSubCategoryDisplay(viewport, subCategory, false));
103
- await enableCategoryDisplay(viewport, enabled, false, true);
104
- // Enable disabled
105
- disabledSubCategories.forEach((subCategory) => enableSubCategoryDisplay(viewport, subCategory, true));
106
- await enableCategoryDisplay(viewport, disabled, true, true);
51
+ await enableCategoryDisplay(viewport, categoriesToDisable, false, true);
52
+ await enableCategoryDisplay(viewport, categoriesToEnable, true, true);
107
53
  }
108
54
  //# sourceMappingURL=CategoriesVisibilityUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CategoriesVisibilityUtils.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAalE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAkB,EAAE,OAAgB;IAC5E,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;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CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAC/H;SACF;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;SACnC;KACF;IAED,kBAAkB;IAClB,oBAAoB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAEtG,MAAM,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAE5D,kBAAkB;IAClB,qBAAqB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IAEtG,MAAM,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9D,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 { QueryRowFormat } from \"@itwin/core-common\";\nimport { PerModelCategoryVisibility } from \"@itwin/core-frontend\";\n\nimport type { Viewport } from \"@itwin/core-frontend\";\n\n/**\n * Data structure that describes category.\n * @beta\n */\nexport interface CategoryInfo {\n categoryId: string;\n subCategoryIds?: string[];\n}\n\n/**\n * Toggles visibility of categories to show or hide.\n */\nexport async function toggleAllCategories(viewport: Viewport, display: boolean) {\n const ids = await getCategories(viewport);\n if (ids.length === 0) {\n return;\n }\n\n await enableCategoryDisplay(viewport, ids, display);\n}\n\n/**\n * Gets ids of all categories from specified imodel and viewport.\n */\nexport async function getCategories(viewport: Viewport) {\n const categories = await loadCategoriesFromViewport(viewport);\n return categories.map((category) => category.categoryId);\n}\n\n/**\n * Changes category display in the viewport.\n */\nexport async function enableCategoryDisplay(viewport: Viewport, ids: string[], enabled: boolean, enableAllSubCategories = true) {\n viewport.changeCategoryDisplay(ids, enabled, enableAllSubCategories);\n\n // remove category overrides per model\n const modelsContainingOverrides: string[] = [];\n for (const ovr of viewport.perModelCategoryVisibility) {\n if (ids.findIndex((id) => id === ovr.categoryId) !== -1) {\n modelsContainingOverrides.push(ovr.modelId);\n }\n }\n viewport.perModelCategoryVisibility.setOverride(modelsContainingOverrides, ids, PerModelCategoryVisibility.Override.None);\n\n // changeCategoryDisplay only enables subcategories, it does not disabled them. So we must do that ourselves.\n if (false === enabled) {\n (await viewport.iModel.categories.getCategoryInfo(ids)).forEach((categoryInfo) => {\n categoryInfo.subCategories.forEach((value) => enableSubCategoryDisplay(viewport, value.id, false));\n });\n }\n}\n\n/**\n * Changes subcategory display in the viewport\n */\nexport function enableSubCategoryDisplay(viewport: Viewport, key: string, enabled: boolean) {\n viewport.changeSubCategoryDisplay(key, enabled);\n}\n\nexport async function loadCategoriesFromViewport(vp: Viewport) {\n // Query categories and add them to state\n const selectUsedSpatialCategoryIds =\n \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId from BisCore.SpatialCategory)\";\n const selectUsedDrawingCategoryIds =\n \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement2d WHERE Model.Id=? AND Category.Id IN (SELECT ECInstanceId from BisCore.DrawingCategory)\";\n const ecsql = vp.view.is3d() ? selectUsedSpatialCategoryIds : selectUsedDrawingCategoryIds;\n const ecsql2 = `SELECT ECInstanceId as id FROM ${vp.view.is3d() ? \"BisCore.SpatialCategory\" : \"BisCore.DrawingCategory\"} WHERE ECInstanceId IN (${ecsql})`;\n\n const categories: CategoryInfo[] = [];\n\n const rows = await vp.iModel.createQueryReader(ecsql2, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }).toArray();\n (await vp.iModel.categories.getCategoryInfo(rows.map((row) => row.id))).forEach((val) => {\n categories.push({ categoryId: val.id, subCategoryIds: val.subCategories.size ? [...val.subCategories.keys()] : undefined });\n });\n return categories;\n}\n\n/**\n * Enable display of all given categories.\n * @public\n */\nexport async function showAllCategories(categories: string[], viewport: Viewport) {\n await enableCategoryDisplay(viewport, categories, true, true);\n}\n\n/**\n * Disable display of all given categories.\n * @public\n */\nexport async function hideAllCategories(categories: string[], viewport: Viewport) {\n await enableCategoryDisplay(viewport, categories, false, true);\n}\n\n/**\n * Invert display of all given categories.\n * @public\n */\nexport async function invertAllCategories(categories: CategoryInfo[], viewport: Viewport) {\n const enabled: string[] = [];\n const disabled: string[] = [];\n const enabledSubCategories: string[] = [];\n const disabledSubCategories: string[] = [];\n\n for (const category of categories) {\n if (!viewport.view.viewsCategory(category.categoryId)) {\n disabled.push(category.categoryId);\n continue;\n }\n // First, we need to check if at least one subcategory is disabled. If it is true, then only subcategories should change display, not categories.\n if (category.subCategoryIds?.some((subCategory) => !viewport.isSubCategoryVisible(subCategory))) {\n for (const subCategory of category.subCategoryIds) {\n viewport.isSubCategoryVisible(subCategory) ? enabledSubCategories.push(subCategory) : disabledSubCategories.push(subCategory);\n }\n } else {\n enabled.push(category.categoryId);\n }\n }\n\n // Disable enabled\n enabledSubCategories.forEach((subCategory) => enableSubCategoryDisplay(viewport, subCategory, false));\n\n await enableCategoryDisplay(viewport, enabled, false, true);\n\n // Enable disabled\n disabledSubCategories.forEach((subCategory) => enableSubCategoryDisplay(viewport, subCategory, true));\n\n await enableCategoryDisplay(viewport, disabled, true, true);\n}\n"]}
1
+ {"version":3,"file":"CategoriesVisibilityUtils.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AActE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAqB,EAAE,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CAAC;YACnC,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,MAAM,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAExE,MAAM,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACxE,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 { enableCategoryDisplay } from \"./internal/VisibilityUtils.js\";\n\nimport type { Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport type { TreeWidgetViewport } from \"./TreeWidgetViewport.js\";\n\n/**\n * Data structure that describes category.\n * @beta\n */\nexport interface CategoryInfo {\n categoryId: Id64String;\n subCategoryIds?: Id64Array;\n}\n\n/**\n * Enable display of all given categories.\n * @public\n */\nexport async function showAllCategories(categories: Id64Array, viewport: TreeWidgetViewport) {\n await enableCategoryDisplay(viewport, categories, true, true);\n}\n\n/**\n * Disable display of all given categories.\n * @public\n */\nexport async function hideAllCategories(categories: Id64Array, viewport: TreeWidgetViewport) {\n await enableCategoryDisplay(viewport, categories, false, true);\n}\n\n/**\n * Invert display of all given categories.\n * Categories are inverted like this:\n * - If category is visible, it will be hidden.\n * - If category is hidden, it will be visible.\n * - If category is partially visible, it will be fully visible.\n * @public\n */\nexport async function invertAllCategories(categories: CategoryInfo[], viewport: TreeWidgetViewport) {\n const categoriesToEnable = new Set<Id64String>();\n const categoriesToDisable = new Set<Id64String>();\n\n for (const category of categories) {\n if (!viewport.viewsCategory(category.categoryId)) {\n categoriesToEnable.add(category.categoryId);\n continue;\n }\n // Check if category is in partial state\n if (category.subCategoryIds?.some((subCategory) => !viewport.viewsSubCategory(subCategory))) {\n categoriesToEnable.add(category.categoryId);\n } else {\n categoriesToDisable.add(category.categoryId);\n }\n }\n\n // collect per model overrides that need to be inverted\n for (const { categoryId, visible } of viewport.perModelCategoryOverrides) {\n if (!visible && categoriesToDisable.has(categoryId)) {\n categoriesToEnable.add(categoryId);\n categoriesToDisable.delete(categoryId);\n }\n }\n\n await enableCategoryDisplay(viewport, categoriesToDisable, false, true);\n\n await enableCategoryDisplay(viewport, categoriesToEnable, true, true);\n}\n"]}
@@ -1,11 +1,35 @@
1
- /// <reference types="react" />
2
- import type { InstanceKey } from "@itwin/presentation-shared";
1
+ import type { PropsWithChildren } from "react";
3
2
  import type { GroupingHierarchyNode } from "@itwin/presentation-hierarchies";
4
- export interface FocusedInstancesContext {
3
+ import type { SelectionStorage } from "@itwin/presentation-hierarchies-react";
4
+ import type { InstanceKey } from "@itwin/presentation-shared";
5
+ /** @public */
6
+ interface FocusedInstancesContext {
7
+ /**
8
+ * A function, returning an async iterator of items that should be focused. The function is not set
9
+ * when instances focus mode is disabled or selection is empty.
10
+ */
5
11
  loadFocusedItems?: () => AsyncIterableIterator<InstanceKey | GroupingHierarchyNode>;
12
+ /** A flag indicating whether instances focus mode is enabled. */
6
13
  enabled: boolean;
14
+ /** Toggle enable or disable instances focus mode. */
7
15
  toggle: () => void;
8
16
  }
9
- export declare const focusedInstancesContext: import("react").Context<FocusedInstancesContext>;
17
+ /**
18
+ * A React hook for getting focused instances context. The context must be provided
19
+ * using `FocusedInstancesContextProvider`.
20
+ *
21
+ * @public
22
+ */
10
23
  export declare function useFocusedInstancesContext(): FocusedInstancesContext;
24
+ /**
25
+ * A React context provider for setting up focused instances context, which can then be acquired
26
+ * using `useFocusedInstancesContext` hook.
27
+ *
28
+ * @public
29
+ */
30
+ export declare function FocusedInstancesContextProvider({ selectionStorage, imodelKey, children, }: PropsWithChildren<{
31
+ selectionStorage: SelectionStorage;
32
+ imodelKey: string;
33
+ }>): import("react/jsx-runtime").JSX.Element;
34
+ export {};
11
35
  //# sourceMappingURL=FocusedInstancesContext.d.ts.map
@@ -1,10 +1,81 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /*---------------------------------------------------------------------------------------------
2
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
5
  *--------------------------------------------------------------------------------------------*/
5
- import { createContext, useContext } from "react";
6
- export const focusedInstancesContext = createContext({ enabled: false, toggle: () => { } });
6
+ import { createContext, useContext, useEffect, useState } from "react";
7
+ import { HierarchyNode } from "@itwin/presentation-hierarchies-react";
8
+ import { Selectable, Selectables } from "@itwin/unified-selection";
9
+ const focusedInstancesContext = createContext({ enabled: false, toggle: () => { } });
10
+ /**
11
+ * A React hook for getting focused instances context. The context must be provided
12
+ * using `FocusedInstancesContextProvider`.
13
+ *
14
+ * @public
15
+ */
7
16
  export function useFocusedInstancesContext() {
8
17
  return useContext(focusedInstancesContext);
9
18
  }
19
+ /**
20
+ * A React context provider for setting up focused instances context, which can then be acquired
21
+ * using `useFocusedInstancesContext` hook.
22
+ *
23
+ * @public
24
+ */
25
+ export function FocusedInstancesContextProvider({ selectionStorage, imodelKey, children, }) {
26
+ const [state, setState] = useState({
27
+ enabled: false,
28
+ toggle: () => {
29
+ setState((prev) => ({ ...prev, enabled: !prev.enabled }));
30
+ },
31
+ });
32
+ const enabled = state.enabled;
33
+ useEffect(() => {
34
+ if (!enabled) {
35
+ setState((prev) => ({ ...prev, loadFocusedItems: undefined }));
36
+ return;
37
+ }
38
+ const onSelectionChanged = () => {
39
+ const selection = selectionStorage.getSelection({ imodelKey, level: 0 });
40
+ if (Selectables.isEmpty(selection)) {
41
+ setState((prev) => ({ ...prev, loadFocusedItems: undefined }));
42
+ return;
43
+ }
44
+ const selected = [];
45
+ Selectables.forEach(selection, (selectable) => {
46
+ if (Selectable.isInstanceKey(selectable)) {
47
+ selected.push(selectable);
48
+ return;
49
+ }
50
+ if (isHierarchyNode(selectable.data) && HierarchyNode.isGroupingNode(selectable.data)) {
51
+ selected.push(selectable.data);
52
+ return;
53
+ }
54
+ selected.push(selectable.loadInstanceKeys);
55
+ });
56
+ const loadFocusedItems = async function* () {
57
+ for (const item of selected) {
58
+ if (typeof item === "function") {
59
+ yield* item();
60
+ }
61
+ else {
62
+ yield item;
63
+ }
64
+ }
65
+ };
66
+ setState((prev) => ({ ...prev, loadFocusedItems }));
67
+ };
68
+ onSelectionChanged();
69
+ return selectionStorage.selectionChangeEvent.addListener(({ imodelKey: changeImodelKey, level }) => {
70
+ if (changeImodelKey !== imodelKey || level !== 0) {
71
+ return;
72
+ }
73
+ onSelectionChanged();
74
+ });
75
+ }, [enabled, imodelKey, selectionStorage]);
76
+ return _jsx(focusedInstancesContext.Provider, { value: state, children: children });
77
+ }
78
+ function isHierarchyNode(data) {
79
+ return !!data && typeof data === "object" && "key" in data;
80
+ }
10
81
  //# sourceMappingURL=FocusedInstancesContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusedInstancesContext.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/FocusedInstancesContext.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAWlD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAA0B,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC,CAAC;AAEpH,MAAM,UAAU,0BAA0B;IACxC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,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 { createContext, useContext } from \"react\";\n\nimport type { InstanceKey } from \"@itwin/presentation-shared\";\nimport type { GroupingHierarchyNode } from \"@itwin/presentation-hierarchies\";\n\nexport interface FocusedInstancesContext {\n loadFocusedItems?: () => AsyncIterableIterator<InstanceKey | GroupingHierarchyNode>;\n enabled: boolean;\n toggle: () => void;\n}\n\nexport const focusedInstancesContext = createContext<FocusedInstancesContext>({ enabled: false, toggle: () => {} });\n\nexport function useFocusedInstancesContext() {\n return useContext(focusedInstancesContext);\n}\n"]}
1
+ {"version":3,"file":"FocusedInstancesContext.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/FocusedInstancesContext.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAsBnE,MAAM,uBAAuB,GAAG,aAAa,CAA0B,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC,CAAC;AAE7G;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,EAC9C,gBAAgB,EAChB,SAAS,EACT,QAAQ,GACqE;IAC7E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAA0B;QAC1D,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,GAAG,EAAE;YACX,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAE9B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,QAAQ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BAAM,CAAC;wBACN,MAAM,IAAI,CAAC;oBACb,CAAC;gBACH,CAAC;YACH,CAAC,CAAC;YAEF,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,kBAAkB,EAAE,CAAC;QACrB,OAAO,gBAAgB,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE;YACjG,IAAI,eAAe,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACjD,OAAO;YACT,CAAC;YACD,kBAAkB,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE3C,OAAO,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAoC,CAAC;AACvG,CAAC;AAED,SAAS,eAAe,CAAC,IAAa;IACpC,OAAO,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC;AAC7D,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 { createContext, useContext, useEffect, useState } from \"react\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies-react\";\nimport { Selectable, Selectables } from \"@itwin/unified-selection\";\n\nimport type { PropsWithChildren } from \"react\";\nimport type { GroupingHierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport type { SelectionStorage } from \"@itwin/presentation-hierarchies-react\";\nimport type { InstanceKey } from \"@itwin/presentation-shared\";\n\n/** @public */\ninterface FocusedInstancesContext {\n /**\n * A function, returning an async iterator of items that should be focused. The function is not set\n * when instances focus mode is disabled or selection is empty.\n */\n loadFocusedItems?: () => AsyncIterableIterator<InstanceKey | GroupingHierarchyNode>;\n\n /** A flag indicating whether instances focus mode is enabled. */\n enabled: boolean;\n\n /** Toggle enable or disable instances focus mode. */\n toggle: () => void;\n}\n\nconst focusedInstancesContext = createContext<FocusedInstancesContext>({ enabled: false, toggle: () => {} });\n\n/**\n * A React hook for getting focused instances context. The context must be provided\n * using `FocusedInstancesContextProvider`.\n *\n * @public\n */\nexport function useFocusedInstancesContext(): FocusedInstancesContext {\n return useContext(focusedInstancesContext);\n}\n\n/**\n * A React context provider for setting up focused instances context, which can then be acquired\n * using `useFocusedInstancesContext` hook.\n *\n * @public\n */\nexport function FocusedInstancesContextProvider({\n selectionStorage,\n imodelKey,\n children,\n}: PropsWithChildren<{ selectionStorage: SelectionStorage; imodelKey: string }>) {\n const [state, setState] = useState<FocusedInstancesContext>({\n enabled: false,\n toggle: () => {\n setState((prev) => ({ ...prev, enabled: !prev.enabled }));\n },\n });\n const enabled = state.enabled;\n\n useEffect(() => {\n if (!enabled) {\n setState((prev) => ({ ...prev, loadFocusedItems: undefined }));\n return;\n }\n\n const onSelectionChanged = () => {\n const selection = selectionStorage.getSelection({ imodelKey, level: 0 });\n if (Selectables.isEmpty(selection)) {\n setState((prev) => ({ ...prev, loadFocusedItems: undefined }));\n return;\n }\n\n const selected: Array<InstanceKey | GroupingHierarchyNode | (() => AsyncIterableIterator<InstanceKey>)> = [];\n Selectables.forEach(selection, (selectable) => {\n if (Selectable.isInstanceKey(selectable)) {\n selected.push(selectable);\n return;\n }\n\n if (isHierarchyNode(selectable.data) && HierarchyNode.isGroupingNode(selectable.data)) {\n selected.push(selectable.data);\n return;\n }\n\n selected.push(selectable.loadInstanceKeys);\n });\n\n const loadFocusedItems: () => AsyncIterableIterator<InstanceKey | GroupingHierarchyNode> = async function* () {\n for (const item of selected) {\n if (typeof item === \"function\") {\n yield* item();\n } else {\n yield item;\n }\n }\n };\n\n setState((prev) => ({ ...prev, loadFocusedItems }));\n };\n\n onSelectionChanged();\n return selectionStorage.selectionChangeEvent.addListener(({ imodelKey: changeImodelKey, level }) => {\n if (changeImodelKey !== imodelKey || level !== 0) {\n return;\n }\n onSelectionChanged();\n });\n }, [enabled, imodelKey, selectionStorage]);\n\n return <focusedInstancesContext.Provider value={state}>{children}</focusedInstancesContext.Provider>;\n}\n\nfunction isHierarchyNode(data: unknown): data is HierarchyNode {\n return !!data && typeof data === \"object\" && \"key\" in data;\n}\n"]}
@@ -7,6 +7,7 @@
7
7
  * @beta
8
8
  */
9
9
  export class FilterLimitExceededError extends Error {
10
+ limit;
10
11
  constructor(limit) {
11
12
  super("Too many filter matches");
12
13
  this.limit = limit;
@@ -1 +1 @@
1
- {"version":3,"file":"TreeErrors.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/TreeErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAmC,KAAa;QAC9C,KAAK,CAAC,yBAAyB,CAAC,CAAC;QADA,UAAK,GAAL,KAAK,CAAQ;IAEhD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Error that is thrown when too many matches are found while filtering the tree.\n * @beta\n */\nexport class FilterLimitExceededError extends Error {\n public constructor(public readonly limit: number) {\n super(\"Too many filter matches\");\n }\n}\n"]}
1
+ {"version":3,"file":"TreeErrors.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/TreeErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACd;IAAnC,YAAmC,KAAa;QAC9C,KAAK,CAAC,yBAAyB,CAAC,CAAC;QADA,UAAK,GAAL,KAAK,CAAQ;IAEhD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Error that is thrown when too many matches are found while filtering the tree.\n * @beta\n */\nexport class FilterLimitExceededError extends Error {\n public constructor(public readonly limit: number) {\n super(\"Too many filter matches\");\n }\n}\n"]}
@@ -0,0 +1,186 @@
1
+ import type { BeEvent, Id64Arg, Id64String } from "@itwin/core-bentley";
2
+ import type { IModelConnection, Viewport } from "@itwin/core-frontend";
3
+ /** @public */
4
+ export type PerModelCategoryOverride = "show" | "hide" | "none";
5
+ /**
6
+ * Creates a `TreeWidgetViewport`.
7
+ * @beta
8
+ */
9
+ export declare function createTreeWidgetViewport(viewport: Viewport): TreeWidgetViewport;
10
+ /**
11
+ * A simplified interface for a Viewport that is used by the Tree Widget to control and determine visibility.
12
+ *
13
+ * Viewport should only display elements. Since elements have model, category and sub-category assigned to them, each of these can affect element visibility.
14
+ *
15
+ * The order of precedence for visibility is:
16
+ * 1. Model visibility - if model is not visible, elements from that model should never be displayed.
17
+ * 2. `neverDrawn` set - elements in that set should never be displayed.
18
+ * 3. `alwaysDrawn` set - elements in that set should always be displayed.
19
+ * 4. Per-model category visibility overrides:
20
+ * - if a per-model-category has `Hide` override, elements which have that category and model should not be displayed.
21
+ * - if a per-model-category has `Show` override, elements which have that category and model should be displayed.
22
+ * 5. Category and sub-category visibility - if element's category or sub-category is turned off, it should not be displayed.
23
+ *
24
+ * Based on this order of precedence, element can only be displayed in these scenarios:
25
+ * - Model is visible *AND* element is in `alwaysDrawn` set.
26
+ * - Model is visible *AND* element is not in `neverDrawn` set *AND* per-model category override is set to show `Show`.
27
+ * - Model is visible *AND* element is not in `neverDrawn` set *AND* per-model category override is not set to `Hide` *AND* category and sub-category are visible.
28
+ * @public
29
+ */
30
+ export interface TreeWidgetViewport {
31
+ /**
32
+ * The type of the view. Generally it should be either `3d` or `2d`.
33
+ *
34
+ * The `other` value is reserved for edge cases when viewport doesn't show any elements, e.g. a blank viewport.
35
+ */
36
+ viewType: "2d" | "3d" | "other";
37
+ /** The iModel of this Viewport. */
38
+ iModel: IModelConnection;
39
+ /**
40
+ * Should return true if model specified by `modelId` is visible in the viewport.
41
+ *
42
+ * Model display should not take into account its' child elements display.
43
+ *
44
+ * When model is not displayed, all elements that have that model should not be shown in the viewport.
45
+ */
46
+ viewsModel: (modelId: Id64String) => boolean;
47
+ /**
48
+ * Should add or remove a set of models from those models currently displayed in this viewport.
49
+ *
50
+ * **NOTE** When turning model display to:
51
+ * - `true`, model display should be turned on. This does not mean that any elements should be turned on, it only means that
52
+ * model visibility should not interfere with elements visibility.
53
+ * - `false`, model display should be turned off. All elements which have that model should not be displayed in the viewport.
54
+ */
55
+ changeModelDisplay: (props: {
56
+ modelIds: Id64Arg;
57
+ display: boolean;
58
+ }) => void;
59
+ /**
60
+ * Should return true if category specified by `categoryId` is visible in the viewport.
61
+ *
62
+ * Category display should not take into account its' child elements or sub-categories display.
63
+ *
64
+ * When category is not displayed, all elements and sub-categories which have that category should not be shown in the viewport.
65
+ *
66
+ * **NOTE** Elements might still be visible if per-model category `Show` override or `alwaysDrawn` set makes them visible.
67
+ */
68
+ viewsCategory: (categoryId: Id64String) => boolean;
69
+ /**
70
+ * Should enable or disable display of elements belonging to a set of categories specified by Id.
71
+ *
72
+ * Visibility of individual sub-categories belonging to a category can be controlled separately through the use of `changeSubCategoryDisplay`.
73
+ *
74
+ * By default, enabling display of a category does not affect display of sub-categories thereof which have been set to be invisible.
75
+ *
76
+ * Changing category visibility should not change per-model category overrides.
77
+ *
78
+ * **NOTE** When turning category display to:
79
+ * - `true`, category display should be turned on. All elements which have specified category should be turned on if model is visible,
80
+ * category does not have per-model `hide` override and element is not in the `neverDrawn` set.
81
+ * - `false`, category and its' sub-categories display should be turned off. All elements which have that category should not be displayed in the viewport,
82
+ * unless element has per-model category `Show` override, or is in the `alwaysDrawn` set.
83
+ */
84
+ changeCategoryDisplay: (props: {
85
+ categoryIds: Id64Arg;
86
+ display: boolean;
87
+ enableAllSubCategories?: boolean;
88
+ }) => void;
89
+ /**
90
+ * Should return true if sub-category specified by `subCategoryId` is visible in the viewport.
91
+ *
92
+ * Sub-category display should not take into account its' child elements.
93
+ *
94
+ * When sub-category is not displayed, all elements that have that sub-category should not be shown in the viewport, unless they have per-model category `Show` override or are in the `alwaysDrawn` list.
95
+ */
96
+ viewsSubCategory: (subCategoryId: Id64String) => boolean;
97
+ /**
98
+ * Should enable or disable display of elements belonging to sub-category specified by Id.
99
+ *
100
+ * Changing sub-category display should not change category display.
101
+ *
102
+ * **NOTE** When turning sub-category display to:
103
+ * - `true`, sub-category display should be turned on. All elements which have specified sub-category should be turned on if model and category are visible,
104
+ * category does not have per-model `hide` override and element is not in the `neverDrawn` set.
105
+ * - `false`, sub-category display should be turned off. All elements that have that sub-category should not be displayed in the viewport,
106
+ * unless element has per-model category `Show` override, or is in the `alwaysDrawn` set.
107
+ */
108
+ changeSubCategoryDisplay: (props: {
109
+ subCategoryId: Id64String;
110
+ display: boolean;
111
+ }) => void;
112
+ /** Returns an iterable of per-model-category overrides. */
113
+ perModelCategoryOverrides: Readonly<Iterable<{
114
+ modelId: Id64String;
115
+ categoryId: Id64String;
116
+ visible: boolean;
117
+ }>>;
118
+ /** Should change the override state of one or more categories for one or more models. */
119
+ setPerModelCategoryOverride: (props: {
120
+ modelIds: Id64Arg;
121
+ categoryIds: Id64Arg;
122
+ override: PerModelCategoryOverride;
123
+ }) => void;
124
+ /** Should return the per-model category override. */
125
+ getPerModelCategoryOverride: (props: {
126
+ modelId: Id64String;
127
+ categoryId: Id64String;
128
+ }) => PerModelCategoryOverride;
129
+ /** Should remove per-model category override for the specified models. */
130
+ clearPerModelCategoryOverrides: (props?: {
131
+ modelIds?: Id64Arg;
132
+ }) => void;
133
+ /**
134
+ * Ids of elements which should not be displayed.
135
+ *
136
+ * This set takes precedence over category and sub-category display, per-model category overrides, and the `alwaysDrawn` set.
137
+ */
138
+ neverDrawn: ReadonlySet<Id64String> | undefined;
139
+ /** Ids of elements which should not be displayed in the viewport, regardless of category and sub-category visibility. */
140
+ setNeverDrawn: (props: {
141
+ elementIds: Set<Id64String>;
142
+ }) => void;
143
+ /** Should clear the set of never-drawn elements. */
144
+ clearNeverDrawn: () => void;
145
+ /**
146
+ * Ids of elements which should be displayed.
147
+ *
148
+ * Elements in this set should be displayed only when model is displayed as well.
149
+ *
150
+ * This set takes precedence over category and sub-category display and per-model category override.
151
+ */
152
+ alwaysDrawn: ReadonlySet<Id64String> | undefined;
153
+ /**
154
+ * Ids of elements which should be displayed in the viewport, regardless of category and sub-category visibility.
155
+ *
156
+ * These elements should be displayed only when their models are displayed as well.
157
+ *
158
+ * When the `exclusive` prop is set to `true`, only the specified elements should be drawn.
159
+ */
160
+ setAlwaysDrawn: (props: {
161
+ elementIds: Set<Id64String>;
162
+ exclusive?: boolean;
163
+ }) => void;
164
+ /** Should clear the set of always-drawn elements. */
165
+ clearAlwaysDrawn: () => void;
166
+ /**
167
+ * Should return true if elements in the [[alwaysDrawn]] set are the *only* elements that are displayed when their models are visible.
168
+ *
169
+ * Should be set to true when `setAlwaysDrawn` is called with `exclusive` flag. Should be set to false
170
+ * when `setAlwaysDrawn` is called with `exclusive` set to `false` or `undefined`, or when `clearAlwaysDrawn` is called.
171
+ */
172
+ readonly isAlwaysDrawnExclusive: boolean;
173
+ /** Event that should be raised when set of always-drawn elements changes. */
174
+ onAlwaysDrawnChanged: BeEvent<() => void>;
175
+ /** Event that should be raised when set of never-drawn elements changes. */
176
+ onNeverDrawnChanged: BeEvent<() => void>;
177
+ /** Event that should be raised when per-model category overrides changes. */
178
+ onPerModelCategoriesOverridesChanged: BeEvent<() => void>;
179
+ /** Event that should be raised when category display changes. */
180
+ onDisplayedCategoriesChanged: BeEvent<() => void>;
181
+ /** Event that should be raised when model display changes. */
182
+ onDisplayedModelsChanged: BeEvent<() => void>;
183
+ /** Event that should be raised when view changes between `2d`, `3d` or `other`. */
184
+ onDisplayStyleChanged: BeEvent<() => void>;
185
+ }
186
+ //# sourceMappingURL=TreeWidgetViewport.d.ts.map
@@ -0,0 +1,79 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { PerModelCategoryVisibility } from "@itwin/core-frontend";
6
+ /**
7
+ * Creates a `TreeWidgetViewport`.
8
+ * @beta
9
+ */
10
+ export function createTreeWidgetViewport(viewport) {
11
+ return {
12
+ get viewType() {
13
+ return viewport.view.is2d() ? "2d" : viewport.view.isSpatialView() ? "3d" : "other";
14
+ },
15
+ get iModel() {
16
+ return viewport.iModel;
17
+ },
18
+ viewsModel: (modelId) => viewport.view.viewsModel(modelId),
19
+ changeModelDisplay: (props) => {
20
+ if (props.display) {
21
+ void viewport.addViewedModels(props.modelIds);
22
+ return;
23
+ }
24
+ viewport.changeModelDisplay(props.modelIds, false);
25
+ },
26
+ viewsCategory: (categoryId) => viewport.view.viewsCategory(categoryId),
27
+ changeCategoryDisplay: (props) => viewport.changeCategoryDisplay(props.categoryIds, props.display, props.enableAllSubCategories),
28
+ viewsSubCategory: (subCategoryId) => viewport.isSubCategoryVisible(subCategoryId),
29
+ changeSubCategoryDisplay: (props) => viewport.changeSubCategoryDisplay(props.subCategoryId, props.display),
30
+ get perModelCategoryOverrides() {
31
+ return viewport.perModelCategoryVisibility;
32
+ },
33
+ setPerModelCategoryOverride: (props) => {
34
+ const override = props.override === "show"
35
+ ? PerModelCategoryVisibility.Override.Show
36
+ : props.override === "hide"
37
+ ? PerModelCategoryVisibility.Override.Hide
38
+ : PerModelCategoryVisibility.Override.None;
39
+ viewport.perModelCategoryVisibility.setOverride(props.modelIds, props.categoryIds, override);
40
+ },
41
+ getPerModelCategoryOverride: (props) => {
42
+ const override = viewport.perModelCategoryVisibility.getOverride(props.modelId, props.categoryId);
43
+ return override === PerModelCategoryVisibility.Override.Show ? "show" : override === PerModelCategoryVisibility.Override.Hide ? "hide" : "none";
44
+ },
45
+ clearPerModelCategoryOverrides: (props) => viewport.perModelCategoryVisibility.clearOverrides(props?.modelIds),
46
+ get neverDrawn() {
47
+ return viewport.neverDrawn;
48
+ },
49
+ setNeverDrawn: (props) => viewport.setNeverDrawn(props.elementIds),
50
+ clearNeverDrawn: () => viewport.clearNeverDrawn(),
51
+ get alwaysDrawn() {
52
+ return viewport.alwaysDrawn;
53
+ },
54
+ setAlwaysDrawn: (props) => viewport.setAlwaysDrawn(props.elementIds, props.exclusive),
55
+ clearAlwaysDrawn: () => viewport.clearAlwaysDrawn(),
56
+ get isAlwaysDrawnExclusive() {
57
+ return viewport.isAlwaysDrawnExclusive;
58
+ },
59
+ get onAlwaysDrawnChanged() {
60
+ return viewport.onAlwaysDrawnChanged;
61
+ },
62
+ get onNeverDrawnChanged() {
63
+ return viewport.onNeverDrawnChanged;
64
+ },
65
+ get onDisplayStyleChanged() {
66
+ return viewport.view.onDisplayStyleChanged;
67
+ },
68
+ get onDisplayedModelsChanged() {
69
+ return viewport.onViewedModelsChanged;
70
+ },
71
+ get onDisplayedCategoriesChanged() {
72
+ return viewport.onViewedCategoriesChanged;
73
+ },
74
+ get onPerModelCategoriesOverridesChanged() {
75
+ return viewport.onViewedCategoriesPerModelChanged;
76
+ },
77
+ };
78
+ }
79
+ //# sourceMappingURL=TreeWidgetViewport.js.map