@itwin/tree-widget-react 3.4.1 → 4.0.0-alpha.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.
- package/CHANGELOG.md +1 -18
- package/README.md +3 -76
- package/lib/esm/tree-widget-react/components/SelectableTree.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/SelectableTree.js +4 -4
- package/lib/esm/tree-widget-react/components/SelectableTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeSelector.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/TreeSelector.js +11 -14
- package/lib/esm/tree-widget-react/components/TreeSelector.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +3 -5
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/TreeHeader.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/tree-header/TreeHeader.js +6 -49
- package/lib/esm/tree-widget-react/components/tree-header/TreeHeader.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/TreeHeader.scss +0 -1
- package/lib/esm/tree-widget-react/components/tree-header/TreeWithHeader.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +10 -8
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.d.ts +4 -28
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js +2 -73
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.d.ts +7 -0
- package/lib/{cjs/tree-widget-react/components/trees/common/FocusedInstancesContext.js → esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js} +14 -34
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +12 -10
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js +3 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +4 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +11 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.css +8 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts +28 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js +34 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.d.ts +6 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js +5 -31
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.d.ts +13 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseMultiCheckboxHandler.js → components/UseVisibilityButtonHandler.js} +7 -7
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts +3 -4
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +9 -8
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +0 -1
- package/lib/esm/tree-widget-react/components/trees/index.js +0 -1
- package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +1 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.d.ts +8 -9
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +19 -16
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +2 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +9 -13
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +7 -14
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +1 -1
- package/package.json +18 -25
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/tree-widget-react/TreeWidget.d.ts +0 -24
- package/lib/cjs/tree-widget-react/TreeWidget.js +0 -54
- package/lib/cjs/tree-widget-react/TreeWidget.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/SelectableTree.d.ts +0 -47
- package/lib/cjs/tree-widget-react/components/SelectableTree.js +0 -107
- package/lib/cjs/tree-widget-react/components/SelectableTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/SelectableTree.scss +0 -18
- package/lib/cjs/tree-widget-react/components/TreeSelector.d.ts +0 -31
- package/lib/cjs/tree-widget-react/components/TreeSelector.js +0 -30
- package/lib/cjs/tree-widget-react/components/TreeSelector.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/TreeSelector.scss +0 -27
- package/lib/cjs/tree-widget-react/components/TreeWidgetUiItemsProvider.d.ts +0 -36
- package/lib/cjs/tree-widget-react/components/TreeWidgetUiItemsProvider.js +0 -74
- package/lib/cjs/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/TreeWidgetUiItemsProvider.scss +0 -9
- package/lib/cjs/tree-widget-react/components/tree-header/TreeHeader.d.ts +0 -33
- package/lib/cjs/tree-widget-react/components/tree-header/TreeHeader.js +0 -75
- package/lib/cjs/tree-widget-react/components/tree-header/TreeHeader.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/tree-header/TreeHeader.scss +0 -57
- package/lib/cjs/tree-widget-react/components/tree-header/TreeWithHeader.d.ts +0 -13
- package/lib/cjs/tree-widget-react/components/tree-header/TreeWithHeader.js +0 -20
- package/lib/cjs/tree-widget-react/components/tree-header/TreeWithHeader.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/tree-header/TreeWithHeader.scss +0 -23
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +0 -12
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +0 -22
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +0 -47
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +0 -75
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +0 -53
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +0 -73
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +0 -23
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +0 -207
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.d.ts +0 -28
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js +0 -91
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.d.ts +0 -22
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +0 -117
- package/lib/cjs/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +0 -42
- package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +0 -119
- package/lib/cjs/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/FocusedInstancesContext.d.ts +0 -35
- package/lib/cjs/tree-widget-react/components/trees/common/FocusedInstancesContext.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/Rxjs.d.ts +0 -10
- package/lib/cjs/tree-widget-react/components/trees/common/Rxjs.js +0 -46
- package/lib/cjs/tree-widget-react/components/trees/common/Rxjs.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/Tooltip.d.ts +0 -17
- package/lib/cjs/tree-widget-react/components/trees/common/Tooltip.js +0 -29
- package/lib/cjs/tree-widget-react/components/trees/common/Tooltip.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/TreeErrors.d.ts +0 -9
- package/lib/cjs/tree-widget-react/components/trees/common/TreeErrors.js +0 -19
- package/lib/cjs/tree-widget-react/components/trees/common/TreeErrors.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseActiveViewport.d.ts +0 -7
- package/lib/cjs/tree-widget-react/components/trees/common/UseActiveViewport.js +0 -25
- package/lib/cjs/tree-widget-react/components/trees/common/UseActiveViewport.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseFiltering.d.ts +0 -11
- package/lib/cjs/tree-widget-react/components/trees/common/UseFiltering.js +0 -28
- package/lib/cjs/tree-widget-react/components/trees/common/UseFiltering.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchiesLocalization.d.ts +0 -7
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchiesLocalization.js +0 -33
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchiesLocalization.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyFiltering.d.ts +0 -13
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyFiltering.js +0 -158
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyFiltering.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyVisibility.d.ts +0 -55
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +0 -114
- package/lib/cjs/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseIModelChangeListener.d.ts +0 -8
- package/lib/cjs/tree-widget-react/components/trees/common/UseIModelChangeListener.js +0 -19
- package/lib/cjs/tree-widget-react/components/trees/common/UseIModelChangeListener.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseMultiCheckboxHandler.d.ts +0 -12
- package/lib/cjs/tree-widget-react/components/trees/common/UseMultiCheckboxHandler.js +0 -34
- package/lib/cjs/tree-widget-react/components/trees/common/UseMultiCheckboxHandler.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseNodeHighlighting.d.ts +0 -20
- package/lib/cjs/tree-widget-react/components/trees/common/UseNodeHighlighting.js +0 -131
- package/lib/cjs/tree-widget-react/components/trees/common/UseNodeHighlighting.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +0 -29
- package/lib/cjs/tree-widget-react/components/trees/common/UseTelemetryContext.js +0 -49
- package/lib/cjs/tree-widget-react/components/trees/common/UseTelemetryContext.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/Utils.d.ts +0 -27
- package/lib/cjs/tree-widget-react/components/trees/common/Utils.js +0 -66
- package/lib/cjs/tree-widget-react/components/trees/common/Utils.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/Delayed.d.ts +0 -5
- package/lib/cjs/tree-widget-react/components/trees/common/components/Delayed.js +0 -30
- package/lib/cjs/tree-widget-react/components/trees/common/components/Delayed.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/ProgressOverlay.d.ts +0 -4
- package/lib/cjs/tree-widget-react/components/trees/common/components/ProgressOverlay.js +0 -15
- package/lib/cjs/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/ProgressOverlay.scss +0 -21
- package/lib/cjs/tree-widget-react/components/trees/common/components/Tree.d.ts +0 -44
- package/lib/cjs/tree-widget-react/components/trees/common/components/Tree.js +0 -98
- package/lib/cjs/tree-widget-react/components/trees/common/components/Tree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.d.ts +0 -27
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.js +0 -27
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeRenderer.d.ts +0 -11
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeRenderer.js +0 -19
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeNodeRenderer.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeRenderer.d.ts +0 -19
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeRenderer.js +0 -48
- package/lib/cjs/tree-widget-react/components/trees/common/components/TreeRenderer.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTree.d.ts +0 -21
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTree.js +0 -26
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts +0 -11
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +0 -26
- package/lib/cjs/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +0 -11
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +0 -38
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +0 -26
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +0 -35
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +0 -24
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +0 -265
- package/lib/cjs/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +0 -11
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +0 -50
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +0 -26
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js +0 -35
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +0 -29
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +0 -622
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +0 -26
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +0 -203
- package/lib/cjs/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/index.d.ts +0 -18
- package/lib/cjs/tree-widget-react/components/trees/index.js +0 -39
- package/lib/cjs/tree-widget-react/components/trees/index.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +0 -12
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTree.js +0 -26
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.d.ts +0 -65
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +0 -144
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +0 -78
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +0 -106
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +0 -79
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +0 -650
- package/lib/cjs/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/UseModelsTree.d.ts +0 -44
- package/lib/cjs/tree-widget-react/components/trees/models-tree/UseModelsTree.js +0 -312
- package/lib/cjs/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.d.ts +0 -7
- package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.js +0 -25
- package/lib/cjs/tree-widget-react/components/trees/models-tree/Utils.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +0 -29
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +0 -142
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +0 -25
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +0 -178
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +0 -44
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +0 -385
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.d.ts +0 -37
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js +0 -57
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +0 -106
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +0 -672
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.d.ts +0 -12
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js +0 -52
- package/lib/cjs/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js.map +0 -1
- package/lib/cjs/tree-widget-react/components/utils/IsPromiseLike.d.ts +0 -6
- package/lib/cjs/tree-widget-react/components/utils/IsPromiseLike.js +0 -16
- package/lib/cjs/tree-widget-react/components/utils/IsPromiseLike.js.map +0 -1
- package/lib/cjs/tree-widget-react.d.ts +0 -6
- package/lib/cjs/tree-widget-react.js +0 -32
- package/lib/cjs/tree-widget-react.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseMultiCheckboxHandler.d.ts +0 -12
- package/lib/esm/tree-widget-react/components/trees/common/UseMultiCheckboxHandler.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.d.ts +0 -27
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.js +0 -23
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeRenderer.d.ts +0 -11
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeRenderer.js +0 -16
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeRenderer.js.map +0 -1
package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./TreeNodeVisibilityButton.css";
|
|
2
|
+
import { IconButton } from "@itwin/itwinui-react/bricks";
|
|
3
|
+
import type { PresentationHierarchyNode, PresentationTreeNode } from "@itwin/presentation-hierarchies-react";
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Data structure that describes tree node checkbox state.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
interface TreeItemVisibilityButtonState {
|
|
10
|
+
state: "visible" | "partial" | "hidden";
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
}
|
|
14
|
+
/** @beta */
|
|
15
|
+
export interface TreeItemVisibilityButtonProps {
|
|
16
|
+
/** Callback that should be invoked when checkbox is clicked. */
|
|
17
|
+
onVisibilityButtonClick: (node: PresentationHierarchyNode, state: TreeItemVisibilityButtonState["state"]) => void;
|
|
18
|
+
/** Callback that should be used to determine current checkbox state. */
|
|
19
|
+
getVisibilityButtonState: (node: PresentationHierarchyNode) => TreeItemVisibilityButtonState;
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
type TreeNodeCheckboxProps = TreeItemVisibilityButtonProps & Omit<ComponentPropsWithoutRef<typeof IconButton>, "onClick" | "aria-disabled" | "title" | "label" | "icon">;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare function TreeItemVisibilityButton({ node, onVisibilityButtonClick, getVisibilityButtonState, ...props }: TreeNodeCheckboxProps & {
|
|
25
|
+
node: PresentationTreeNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=TreeNodeVisibilityButton.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import "./TreeNodeVisibilityButton.css";
|
|
7
|
+
import cx from "classnames";
|
|
8
|
+
import { IconButton } from "@itwin/itwinui-react/bricks";
|
|
9
|
+
import { isPresentationHierarchyNode } from "@itwin/presentation-hierarchies-react";
|
|
10
|
+
const visibilityShowIcon = new URL("@itwin/itwinui-icons/visibility-show.svg", import.meta.url).href;
|
|
11
|
+
const visibilityHideIcon = new URL("@itwin/itwinui-icons/visibility-hide.svg", import.meta.url).href;
|
|
12
|
+
const visibilityPartialIcon = new URL("@itwin/itwinui-icons/state-inherited-dot.svg", import.meta.url).href;
|
|
13
|
+
/** @internal */
|
|
14
|
+
export function TreeItemVisibilityButton({ node, onVisibilityButtonClick, getVisibilityButtonState, ...props }) {
|
|
15
|
+
if ("type" in node || !isPresentationHierarchyNode(node)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const checkboxState = getVisibilityButtonState(node);
|
|
19
|
+
const getIcon = () => {
|
|
20
|
+
switch (checkboxState.state) {
|
|
21
|
+
case "visible":
|
|
22
|
+
return visibilityShowIcon;
|
|
23
|
+
case "hidden":
|
|
24
|
+
return visibilityHideIcon;
|
|
25
|
+
case "partial":
|
|
26
|
+
return visibilityPartialIcon;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return (_jsx(IconButton, { ...props, label: checkboxState.tooltip ?? "Determining visibility...", variant: "ghost", className: cx(`tw-tree-node-visibility-button-${checkboxState.state}`, props.className), onClick: (e) => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
onVisibilityButtonClick(node, checkboxState.state);
|
|
32
|
+
}, "aria-disabled": checkboxState.isDisabled, icon: getIcon() }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=TreeNodeVisibilityButton.js.map
|
package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeVisibilityButton.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAKpF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,0CAA0C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AACrG,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,0CAA0C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AACrG,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,8CAA8C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AAwB5G,gBAAgB;AAChB,MAAM,UAAU,wBAAwB,CAAC,EACvC,IAAI,EACJ,uBAAuB,EACvB,wBAAwB,EACxB,GAAG,KAAK,EAC+C;IACvD,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE;QACxD,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAErD,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,QAAQ,aAAa,CAAC,KAAK,EAAE;YAC3B,KAAK,SAAS;gBACZ,OAAO,kBAAkB,CAAC;YAC5B,KAAK,QAAQ;gBACX,OAAO,kBAAkB,CAAC;YAC5B,KAAK,SAAS;gBACZ,OAAO,qBAAqB,CAAC;SAChC;IACH,CAAC,CAAC;IACF,OAAO,CACL,KAAC,UAAU,OACL,KAAK,EACT,KAAK,EAAE,aAAa,CAAC,OAAO,IAAI,2BAA2B,EAC3D,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CAAC,kCAAkC,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,EACvF,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,uBAAuB,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC,mBACc,aAAa,CAAC,UAAU,EACvC,IAAI,EAAE,OAAO,EAAE,GACf,CACH,CAAC;AACJ,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 \"./TreeNodeVisibilityButton.css\";\nimport cx from \"classnames\";\nimport { IconButton } from \"@itwin/itwinui-react/bricks\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { PresentationHierarchyNode, PresentationTreeNode } from \"@itwin/presentation-hierarchies-react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nconst visibilityShowIcon = new URL(\"@itwin/itwinui-icons/visibility-show.svg\", import.meta.url).href;\nconst visibilityHideIcon = new URL(\"@itwin/itwinui-icons/visibility-hide.svg\", import.meta.url).href;\nconst visibilityPartialIcon = new URL(\"@itwin/itwinui-icons/state-inherited-dot.svg\", import.meta.url).href;\n\n/**\n * Data structure that describes tree node checkbox state.\n * @beta\n */\ninterface TreeItemVisibilityButtonState {\n state: \"visible\" | \"partial\" | \"hidden\";\n isDisabled?: boolean;\n tooltip?: string;\n}\n\n/** @beta */\nexport interface TreeItemVisibilityButtonProps {\n /** Callback that should be invoked when checkbox is clicked. */\n onVisibilityButtonClick: (node: PresentationHierarchyNode, state: TreeItemVisibilityButtonState[\"state\"]) => void;\n /** Callback that should be used to determine current checkbox state. */\n getVisibilityButtonState: (node: PresentationHierarchyNode) => TreeItemVisibilityButtonState;\n}\n\n/** @internal */\ntype TreeNodeCheckboxProps = TreeItemVisibilityButtonProps &\n Omit<ComponentPropsWithoutRef<typeof IconButton>, \"onClick\" | \"aria-disabled\" | \"title\" | \"label\" | \"icon\">;\n\n/** @internal */\nexport function TreeItemVisibilityButton({\n node,\n onVisibilityButtonClick,\n getVisibilityButtonState,\n ...props\n}: TreeNodeCheckboxProps & { node: PresentationTreeNode }) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n const checkboxState = getVisibilityButtonState(node);\n\n const getIcon = () => {\n switch (checkboxState.state) {\n case \"visible\":\n return visibilityShowIcon;\n case \"hidden\":\n return visibilityHideIcon;\n case \"partial\":\n return visibilityPartialIcon;\n }\n };\n return (\n <IconButton\n {...props}\n label={checkboxState.tooltip ?? \"Determining visibility...\"}\n variant={\"ghost\"}\n className={cx(`tw-tree-node-visibility-button-${checkboxState.state}`, props.className)}\n onClick={(e) => {\n e.stopPropagation();\n onVisibilityButtonClick(node, checkboxState.state);\n }}\n aria-disabled={checkboxState.isDisabled}\n icon={getIcon()}\n />\n );\n}\n"]}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import type { PresentationHierarchyNode, PresentationTreeNode, RenderedTreeNode } from "@itwin/presentation-hierarchies-react";
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TreeRenderer as PresentationTree } from "@itwin/presentation-hierarchies-react";
|
|
3
|
+
import type { TreeItemVisibilityButtonProps } from "./TreeNodeVisibilityButton.js";
|
|
5
4
|
/** @beta */
|
|
6
|
-
export type TreeRendererProps =
|
|
7
|
-
|
|
8
|
-
rootNodes: PresentationTreeNode[];
|
|
9
|
-
/** Callback to check if specific node is selected. */
|
|
10
|
-
isNodeSelected: (nodeId: string) => boolean;
|
|
11
|
-
/** Callback that is invoked when node is double clicked. */
|
|
12
|
-
onNodeDoubleClick?: (node: PresentationHierarchyNode, isSelected: boolean) => void;
|
|
5
|
+
export type TreeRendererProps = React.ComponentPropsWithoutRef<typeof PresentationTree> & {
|
|
6
|
+
visibilityButtonProps?: TreeItemVisibilityButtonProps;
|
|
13
7
|
};
|
|
14
8
|
/**
|
|
15
9
|
* Default renderer for rendering tree data.
|
|
16
10
|
* @beta
|
|
17
11
|
*/
|
|
18
|
-
export declare function TreeRenderer({ rootNodes,
|
|
12
|
+
export declare function TreeRenderer({ rootNodes, onNodeClick, expandNode, visibilityButtonProps, ...props }: TreeRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
19
13
|
//# sourceMappingURL=TreeRenderer.d.ts.map
|
|
@@ -3,42 +3,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { createRenderedTreeNodeData, LocalizationContextProvider } from "@itwin/presentation-hierarchies-react";
|
|
9
|
-
import { TreeNodeRenderer } from "./TreeNodeRenderer.js";
|
|
6
|
+
/* eslint-disable @itwin/no-internal */
|
|
7
|
+
import { LocalizationContextProvider, TreeRenderer as PresentationTree } from "@itwin/presentation-hierarchies-react";
|
|
10
8
|
import { useHierarchiesLocalization } from "../UseHierarchiesLocalization.js";
|
|
9
|
+
import { TreeItemVisibilityButton } from "./TreeNodeVisibilityButton.js";
|
|
11
10
|
/**
|
|
12
11
|
* Default renderer for rendering tree data.
|
|
13
12
|
* @beta
|
|
14
13
|
*/
|
|
15
|
-
export function TreeRenderer({ rootNodes,
|
|
14
|
+
export function TreeRenderer({ rootNodes, onNodeClick, expandNode, visibilityButtonProps, ...props }) {
|
|
16
15
|
const localizedStrings = useHierarchiesLocalization();
|
|
17
|
-
|
|
18
|
-
return (_jsx(TreeNodeRenderer, { ...nodeProps, onNodeClick: (node, isSelected, event) => {
|
|
19
|
-
if (onNodeDoubleClick && event.detail === 2) {
|
|
20
|
-
onNodeDoubleClick?.(node, !!nodeProps.isSelected);
|
|
21
|
-
// Click node to not lose selection
|
|
22
|
-
return onNodeClick?.(node, true, event);
|
|
23
|
-
}
|
|
24
|
-
onNodeClick?.(node, isSelected, event);
|
|
25
|
-
}, expandNode: expandNode, onNodeKeyDown: onNodeKeyDown, getIcon: getIcon, getLabel: getLabel, getSublabel: getSublabel, onFilterClick: onFilterClick, getHierarchyLevelDetails: getHierarchyLevelDetails, checkboxProps: checkboxProps, reloadTree: reloadTree, size: size, filterButtonsVisibility: filterButtonsVisibility }));
|
|
26
|
-
}, [
|
|
27
|
-
expandNode,
|
|
28
|
-
onNodeClick,
|
|
29
|
-
onNodeKeyDown,
|
|
30
|
-
onNodeDoubleClick,
|
|
31
|
-
getHierarchyLevelDetails,
|
|
32
|
-
getIcon,
|
|
33
|
-
getLabel,
|
|
34
|
-
getSublabel,
|
|
35
|
-
onFilterClick,
|
|
36
|
-
checkboxProps,
|
|
37
|
-
filterButtonsVisibility,
|
|
38
|
-
reloadTree,
|
|
39
|
-
size,
|
|
40
|
-
]);
|
|
41
|
-
const getNode = useCallback((node) => createRenderedTreeNodeData(node, isNodeSelected), [isNodeSelected]);
|
|
42
|
-
return (_jsx(LocalizationContextProvider, { localizedStrings: localizedStrings, children: _jsx(Tree, { ...props, data: rootNodes, nodeRenderer: nodeRenderer, getNode: getNode, enableVirtualization: enableVirtualization ?? true, style: { height: "100%" }, size: size }) }));
|
|
16
|
+
return (_jsx(LocalizationContextProvider, { localizedStrings: localizedStrings, children: _jsx(PresentationTree, { ...props, onNodeClick: onNodeClick, expandNode: expandNode, rootNodes: rootNodes, actionsRenderer: visibilityButtonProps ? (node) => _jsx(TreeItemVisibilityButton, { ...visibilityButtonProps, node: node }) : undefined }) }));
|
|
43
17
|
}
|
|
44
18
|
//# sourceMappingURL=TreeRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"TreeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,uCAAuC;AAEvC,OAAO,EAAE,2BAA2B,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,KAAK,EAAqB;IACrH,MAAM,gBAAgB,GAAG,0BAA0B,EAAE,CAAC;IACtD,OAAO,CACL,KAAC,2BAA2B,IAAC,gBAAgB,EAAE,gBAAgB,YAC7D,KAAC,gBAAgB,OACX,KAAK,EACT,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,wBAAwB,OAAK,qBAAqB,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,SAAS,GAClI,GAC0B,CAC/B,CAAC;AACJ,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/* eslint-disable @itwin/no-internal */\n\nimport { LocalizationContextProvider, TreeRenderer as PresentationTree } from \"@itwin/presentation-hierarchies-react\";\nimport { useHierarchiesLocalization } from \"../UseHierarchiesLocalization.js\";\nimport { TreeItemVisibilityButton } from \"./TreeNodeVisibilityButton.js\";\n\nimport type { TreeItemVisibilityButtonProps } from \"./TreeNodeVisibilityButton.js\";\n/** @beta */\nexport type TreeRendererProps = React.ComponentPropsWithoutRef<typeof PresentationTree> & { visibilityButtonProps?: TreeItemVisibilityButtonProps };\n\n/**\n * Default renderer for rendering tree data.\n * @beta\n */\nexport function TreeRenderer({ rootNodes, onNodeClick, expandNode, visibilityButtonProps, ...props }: TreeRendererProps) {\n const localizedStrings = useHierarchiesLocalization();\n return (\n <LocalizationContextProvider localizedStrings={localizedStrings}>\n <PresentationTree\n {...props}\n onNodeClick={onNodeClick}\n expandNode={expandNode}\n rootNodes={rootNodes}\n actionsRenderer={visibilityButtonProps ? (node) => <TreeItemVisibilityButton {...visibilityButtonProps} node={node} /> : undefined}\n />\n </LocalizationContextProvider>\n );\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PresentationTreeNode } from "@itwin/presentation-hierarchies-react";
|
|
2
|
+
import type { TreeItemVisibilityButtonProps } from "./TreeNodeVisibilityButton.js";
|
|
3
|
+
interface UseVisibilityButtonHandlerProps {
|
|
4
|
+
rootNodes: PresentationTreeNode[] | undefined;
|
|
5
|
+
isNodeSelected?: (nodeId: string) => boolean;
|
|
6
|
+
onClick: TreeItemVisibilityButtonProps["onVisibilityButtonClick"];
|
|
7
|
+
}
|
|
8
|
+
interface UseVisibilityButtonHandlerResult {
|
|
9
|
+
onVisibilityButtonClick: TreeItemVisibilityButtonProps["onVisibilityButtonClick"];
|
|
10
|
+
}
|
|
11
|
+
export declare function useVisibilityButtonHandler({ rootNodes, isNodeSelected, onClick }: UseVisibilityButtonHandlerProps): UseVisibilityButtonHandlerResult;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=UseVisibilityButtonHandler.d.ts.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { useCallback } from "react";
|
|
6
6
|
import { isPresentationHierarchyNode } from "@itwin/presentation-hierarchies-react";
|
|
7
|
-
export function
|
|
8
|
-
const
|
|
9
|
-
if (!isNodeSelected(clickedNode.id)) {
|
|
10
|
-
onClick(clickedNode,
|
|
7
|
+
export function useVisibilityButtonHandler({ rootNodes, isNodeSelected, onClick }) {
|
|
8
|
+
const onVisibilityButtonClick = useCallback((clickedNode, state) => {
|
|
9
|
+
if (!isNodeSelected?.(clickedNode.id)) {
|
|
10
|
+
onClick(clickedNode, state);
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
rootNodes && forEachSelectedNode(rootNodes, isNodeSelected, (node) => onClick(node,
|
|
13
|
+
rootNodes && forEachSelectedNode(rootNodes, isNodeSelected, (node) => onClick(node, state));
|
|
14
14
|
}, [rootNodes, isNodeSelected, onClick]);
|
|
15
|
-
return {
|
|
15
|
+
return { onVisibilityButtonClick };
|
|
16
16
|
}
|
|
17
17
|
function forEachSelectedNode(nodes, isNodeSelected, callback) {
|
|
18
18
|
nodes.forEach((node) => {
|
|
@@ -27,4 +27,4 @@ function forEachSelectedNode(nodes, isNodeSelected, callback) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=UseVisibilityButtonHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseVisibilityButtonHandler.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAepF,MAAM,UAAU,0BAA0B,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAmC;IAChH,MAAM,uBAAuB,GAAG,WAAW,CACzC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE;QACrB,IAAI,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;YACrC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAC5B,OAAO;SACR;QACD,SAAS,IAAI,mBAAmB,CAAC,SAAS,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9F,CAAC,EACD,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CACrC,CAAC;IAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACrC,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAkC,EAClC,cAA2C,EAC3C,QAAmD;IAEnD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE;YACtC,OAAO;SACR;QACD,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAC3B,QAAQ,CAAC,IAAI,CAAC,CAAC;SAChB;QACD,IAAI,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;YACzD,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;SAC9D;IACH,CAAC,CAAC,CAAC;AACL,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 { useCallback } from \"react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { PresentationHierarchyNode, PresentationTreeNode } from \"@itwin/presentation-hierarchies-react\";\nimport type { TreeItemVisibilityButtonProps } from \"./TreeNodeVisibilityButton.js\";\n\ninterface UseVisibilityButtonHandlerProps {\n rootNodes: PresentationTreeNode[] | undefined;\n isNodeSelected?: (nodeId: string) => boolean;\n onClick: TreeItemVisibilityButtonProps[\"onVisibilityButtonClick\"];\n}\n\ninterface UseVisibilityButtonHandlerResult {\n onVisibilityButtonClick: TreeItemVisibilityButtonProps[\"onVisibilityButtonClick\"];\n}\n\nexport function useVisibilityButtonHandler({ rootNodes, isNodeSelected, onClick }: UseVisibilityButtonHandlerProps): UseVisibilityButtonHandlerResult {\n const onVisibilityButtonClick = useCallback<TreeItemVisibilityButtonProps[\"onVisibilityButtonClick\"]>(\n (clickedNode, state) => {\n if (!isNodeSelected?.(clickedNode.id)) {\n onClick(clickedNode, state);\n return;\n }\n rootNodes && forEachSelectedNode(rootNodes, isNodeSelected, (node) => onClick(node, state));\n },\n [rootNodes, isNodeSelected, onClick],\n );\n\n return { onVisibilityButtonClick };\n}\n\nfunction forEachSelectedNode(\n nodes: Array<PresentationTreeNode>,\n isNodeSelected: (nodeId: string) => boolean,\n callback: (node: PresentationHierarchyNode) => void,\n) {\n nodes.forEach((node) => {\n if (!isPresentationHierarchyNode(node)) {\n return;\n }\n if (isNodeSelected(node.id)) {\n callback(node);\n }\n if (node.isExpanded && typeof node.children !== \"boolean\") {\n forEachSelectedNode(node.children, isNodeSelected, callback);\n }\n });\n}\n"]}
|
|
@@ -11,11 +11,11 @@ export type VisibilityTreeProps = Omit<TreeProps, "treeRenderer" | "imodelAccess
|
|
|
11
11
|
imodelAccess: ECClassHierarchyInspector;
|
|
12
12
|
}) => HierarchyVisibilityHandler;
|
|
13
13
|
/** Tree renderer that should be used to render tree data. */
|
|
14
|
-
treeRenderer: (treeProps: FunctionProps<TreeProps["treeRenderer"]> & Pick<VisibilityTreeRendererProps, "
|
|
14
|
+
treeRenderer: (treeProps: FunctionProps<TreeProps["treeRenderer"]> & Pick<VisibilityTreeRendererProps, "getVisibilityButtonState" | "onVisibilityButtonClick">) => ReactNode;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Tree component that can control visibility of instances represented by tree nodes.
|
|
18
18
|
* @beta
|
|
19
19
|
*/
|
|
20
|
-
export declare function VisibilityTree({ visibilityHandlerFactory, treeRenderer, ...props }: VisibilityTreeProps): JSX.Element;
|
|
20
|
+
export declare function VisibilityTree({ visibilityHandlerFactory, treeRenderer, ...props }: VisibilityTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
//# sourceMappingURL=VisibilityTree.d.ts.map
|
|
@@ -14,9 +14,9 @@ import { Tree } from "./Tree.js";
|
|
|
14
14
|
export function VisibilityTree({ visibilityHandlerFactory, treeRenderer, ...props }) {
|
|
15
15
|
const { imodel, getSchemaContext } = props;
|
|
16
16
|
const imodelAccess = useMemo(() => createIModelAccess({ imodel, getSchemaContext }), [imodel, getSchemaContext]);
|
|
17
|
-
const {
|
|
17
|
+
const { getVisibilityButtonState, onVisibilityButtonClick, triggerRefresh } = useHierarchyVisibility({
|
|
18
18
|
visibilityHandlerFactory: useCallback(() => visibilityHandlerFactory({ imodelAccess }), [visibilityHandlerFactory, imodelAccess]),
|
|
19
19
|
});
|
|
20
|
-
return (_jsx(Tree, { ...props, onReload: triggerRefresh, imodelAccess: imodelAccess, treeRenderer: (treeProps) => treeRenderer({ ...treeProps,
|
|
20
|
+
return (_jsx(Tree, { ...props, onReload: triggerRefresh, imodelAccess: imodelAccess, treeRenderer: (treeProps) => treeRenderer({ ...treeProps, getVisibilityButtonState, onVisibilityButtonClick }) }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=VisibilityTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisibilityTree.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/VisibilityTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmBjC;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAuB;IACtG,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACjH,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"VisibilityTree.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/VisibilityTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmBjC;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAuB;IACtG,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACjH,MAAM,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,cAAc,EAAE,GAAG,sBAAsB,CAAC;QACnG,wBAAwB,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;KAClI,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,IAAI,OACC,KAAK,EACT,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC,GAC9G,CACH,CAAC;AACJ,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 { useCallback, useMemo } from \"react\";\nimport { useHierarchyVisibility } from \"../UseHierarchyVisibility.js\";\nimport { createIModelAccess } from \"../Utils.js\";\nimport { Tree } from \"./Tree.js\";\n\nimport type { FunctionProps } from \"../Utils.js\";\nimport type { TreeProps } from \"./Tree.js\";\nimport type { ReactNode } from \"react\";\nimport type { VisibilityTreeRendererProps } from \"./VisibilityTreeRenderer.js\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { HierarchyVisibilityHandler } from \"../UseHierarchyVisibility.js\";\n\n/** @beta */\nexport type VisibilityTreeProps = Omit<TreeProps, \"treeRenderer\" | \"imodelAccess\"> & {\n /** Callback for creating visibility handler used to control visibility of instances represented by tree nodes. */\n visibilityHandlerFactory: (props: { imodelAccess: ECClassHierarchyInspector }) => HierarchyVisibilityHandler;\n /** Tree renderer that should be used to render tree data. */\n treeRenderer: (\n treeProps: FunctionProps<TreeProps[\"treeRenderer\"]> & Pick<VisibilityTreeRendererProps, \"getVisibilityButtonState\" | \"onVisibilityButtonClick\">,\n ) => ReactNode;\n};\n\n/**\n * Tree component that can control visibility of instances represented by tree nodes.\n * @beta\n */\nexport function VisibilityTree({ visibilityHandlerFactory, treeRenderer, ...props }: VisibilityTreeProps) {\n const { imodel, getSchemaContext } = props;\n const imodelAccess = useMemo(() => createIModelAccess({ imodel, getSchemaContext }), [imodel, getSchemaContext]);\n const { getVisibilityButtonState, onVisibilityButtonClick, triggerRefresh } = useHierarchyVisibility({\n visibilityHandlerFactory: useCallback(() => visibilityHandlerFactory({ imodelAccess }), [visibilityHandlerFactory, imodelAccess]),\n });\n\n return (\n <Tree\n {...props}\n onReload={triggerRefresh}\n imodelAccess={imodelAccess}\n treeRenderer={(treeProps) => treeRenderer({ ...treeProps, getVisibilityButtonState, onVisibilityButtonClick })}\n />\n );\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { TreeRendererProps } from "./TreeRenderer.js";
|
|
3
|
-
import type {
|
|
2
|
+
import type { TreeItemVisibilityButtonProps } from "./TreeNodeVisibilityButton.js";
|
|
4
3
|
/** @beta */
|
|
5
|
-
export type VisibilityTreeRendererProps = TreeRendererProps &
|
|
4
|
+
export type VisibilityTreeRendererProps = TreeRendererProps & TreeItemVisibilityButtonProps;
|
|
6
5
|
/**
|
|
7
6
|
* Tree renderer that renders tree nodes with eye checkboxes for controlling visibility of instances represented by tree nodes.
|
|
8
7
|
* @beta
|
|
9
8
|
*/
|
|
10
|
-
export declare function VisibilityTreeRenderer({
|
|
9
|
+
export declare function VisibilityTreeRenderer({ getVisibilityButtonState, onVisibilityButtonClick: onClick, ...props }: VisibilityTreeRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=VisibilityTreeRenderer.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js
CHANGED
|
@@ -3,20 +3,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/* eslint-disable @itwin/no-internal */
|
|
6
7
|
import { useMemo } from "react";
|
|
7
|
-
import { useMultiCheckboxHandler } from "../UseMultiCheckboxHandler.js";
|
|
8
8
|
import { TreeRenderer } from "./TreeRenderer.js";
|
|
9
|
+
import { useVisibilityButtonHandler } from "./UseVisibilityButtonHandler.js";
|
|
9
10
|
/**
|
|
10
11
|
* Tree renderer that renders tree nodes with eye checkboxes for controlling visibility of instances represented by tree nodes.
|
|
11
12
|
* @beta
|
|
12
13
|
*/
|
|
13
|
-
export function VisibilityTreeRenderer({
|
|
14
|
-
const {
|
|
15
|
-
const
|
|
14
|
+
export function VisibilityTreeRenderer({ getVisibilityButtonState, onVisibilityButtonClick: onClick, ...props }) {
|
|
15
|
+
const { onVisibilityButtonClick } = useVisibilityButtonHandler({ rootNodes: props.rootNodes, isNodeSelected: props.isNodeSelected, onClick });
|
|
16
|
+
const visibilityButtonProps = useMemo(() => ({
|
|
16
17
|
variant: "eyeball",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}), [
|
|
20
|
-
return _jsx(TreeRenderer, { ...props,
|
|
18
|
+
getVisibilityButtonState,
|
|
19
|
+
onVisibilityButtonClick,
|
|
20
|
+
}), [getVisibilityButtonState, onVisibilityButtonClick]);
|
|
21
|
+
return _jsx(TreeRenderer, { ...props, visibilityButtonProps: visibilityButtonProps });
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=VisibilityTreeRenderer.js.map
|
package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisibilityTreeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"VisibilityTreeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,uCAAuC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAO7E;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,KAAK,EAA+B;IAC1I,MAAM,EAAE,uBAAuB,EAAE,GAAG,0BAA0B,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9I,MAAM,qBAAqB,GAAkC,OAAO,CAClE,GAAG,EAAE,CAAC,CAAC;QACL,OAAO,EAAE,SAAS;QAClB,wBAAwB;QACxB,uBAAuB;KACxB,CAAC,EACF,CAAC,wBAAwB,EAAE,uBAAuB,CAAC,CACpD,CAAC;IAEF,OAAO,KAAC,YAAY,OAAK,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,GAAI,CAAC;AACnF,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/* eslint-disable @itwin/no-internal */\n\nimport { useMemo } from \"react\";\nimport { TreeRenderer } from \"./TreeRenderer.js\";\nimport { useVisibilityButtonHandler } from \"./UseVisibilityButtonHandler.js\";\n\nimport type { TreeRendererProps } from \"./TreeRenderer.js\";\nimport type { TreeItemVisibilityButtonProps } from \"./TreeNodeVisibilityButton.js\";\n/** @beta */\nexport type VisibilityTreeRendererProps = TreeRendererProps & TreeItemVisibilityButtonProps;\n\n/**\n * Tree renderer that renders tree nodes with eye checkboxes for controlling visibility of instances represented by tree nodes.\n * @beta\n */\nexport function VisibilityTreeRenderer({ getVisibilityButtonState, onVisibilityButtonClick: onClick, ...props }: VisibilityTreeRendererProps) {\n const { onVisibilityButtonClick } = useVisibilityButtonHandler({ rootNodes: props.rootNodes, isNodeSelected: props.isNodeSelected, onClick });\n const visibilityButtonProps: TreeItemVisibilityButtonProps = useMemo(\n () => ({\n variant: \"eyeball\",\n getVisibilityButtonState,\n onVisibilityButtonClick,\n }),\n [getVisibilityButtonState, onVisibilityButtonClick],\n );\n\n return <TreeRenderer {...props} visibilityButtonProps={visibilityButtonProps} />;\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { TreeProps } from "../common/components/Tree.js";
|
|
3
2
|
/** @beta */
|
|
4
3
|
export type ExternalSourcesTreeProps = Pick<TreeProps, "imodel" | "getSchemaContext" | "selectionStorage" | "density" | "selectionMode"> & {
|
|
@@ -7,5 +6,5 @@ export type ExternalSourcesTreeProps = Pick<TreeProps, "imodel" | "getSchemaCont
|
|
|
7
6
|
};
|
|
8
7
|
};
|
|
9
8
|
/** @beta */
|
|
10
|
-
export declare function ExternalSourcesTree(props: ExternalSourcesTreeProps): JSX.Element;
|
|
9
|
+
export declare function ExternalSourcesTree(props: ExternalSourcesTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=ExternalSourcesTree.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { ExternalSourcesTreeProps } from "./ExternalSourcesTree.js";
|
|
3
2
|
/** @beta */
|
|
4
3
|
interface ExternalSourcesTreeComponentProps extends Pick<ExternalSourcesTreeProps, "getSchemaContext" | "selectionStorage" | "selectionMode" | "density" | "hierarchyLevelConfig" | "selectionMode"> {
|
|
@@ -10,7 +9,7 @@ interface ExternalSourcesTreeComponentProps extends Pick<ExternalSourcesTreeProp
|
|
|
10
9
|
* @beta
|
|
11
10
|
*/
|
|
12
11
|
export declare const ExternalSourcesTreeComponent: {
|
|
13
|
-
({ onFeatureUsed, onPerformanceMeasured, ...props }: ExternalSourcesTreeComponentProps): JSX.Element | null;
|
|
12
|
+
({ onFeatureUsed, onPerformanceMeasured, ...props }: ExternalSourcesTreeComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
13
|
/**
|
|
15
14
|
* Id of the component. May be used when a creating a `TreeDefinition` for `SelectableTree`.
|
|
16
15
|
* @beta
|
package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { TreeProps } from "../common/components/Tree.js";
|
|
3
2
|
/** @beta */
|
|
4
3
|
export type IModelContentTreeProps = Pick<TreeProps, "imodel" | "getSchemaContext" | "selectionStorage" | "density" | "selectionMode"> & {
|
|
@@ -7,5 +6,5 @@ export type IModelContentTreeProps = Pick<TreeProps, "imodel" | "getSchemaContex
|
|
|
7
6
|
};
|
|
8
7
|
};
|
|
9
8
|
/** @beta */
|
|
10
|
-
export declare function IModelContentTree(props: IModelContentTreeProps): JSX.Element;
|
|
9
|
+
export declare function IModelContentTree(props: IModelContentTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=IModelContentTree.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { IModelContentTreeProps } from "./IModelContentTree.js";
|
|
3
2
|
/** @beta */
|
|
4
3
|
interface IModelContentTreeComponentProps extends Pick<IModelContentTreeProps, "getSchemaContext" | "selectionStorage" | "density" | "hierarchyLevelConfig" | "selectionMode"> {
|
|
@@ -10,7 +9,7 @@ interface IModelContentTreeComponentProps extends Pick<IModelContentTreeProps, "
|
|
|
10
9
|
* @beta
|
|
11
10
|
*/
|
|
12
11
|
export declare const IModelContentTreeComponent: {
|
|
13
|
-
({ onFeatureUsed, onPerformanceMeasured, ...props }: IModelContentTreeComponentProps): JSX.Element | null;
|
|
12
|
+
({ onFeatureUsed, onPerformanceMeasured, ...props }: IModelContentTreeComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
13
|
/**
|
|
15
14
|
* Id of the component. May be used when a creating a `TreeDefinition` for `SelectableTree`.
|
|
16
15
|
* @beta
|
|
@@ -6,7 +6,6 @@ export { useModelsTree } from "./models-tree/UseModelsTree.js";
|
|
|
6
6
|
export { useCategoriesTree } from "./categories-tree/UseCategoriesTree.js";
|
|
7
7
|
export { useModelsTreeButtonProps } from "./models-tree/ModelsTreeButtons.js";
|
|
8
8
|
export { useCategoriesTreeButtonProps } from "./categories-tree/CategoriesTreeButtons.js";
|
|
9
|
-
export { FocusedInstancesContextProvider, useFocusedInstancesContext } from "./common/FocusedInstancesContext.js";
|
|
10
9
|
export { Tree } from "./common/components/Tree.js";
|
|
11
10
|
export { VisibilityTree } from "./common/components/VisibilityTree.js";
|
|
12
11
|
export { TreeRenderer } from "./common/components/TreeRenderer.js";
|
|
@@ -10,7 +10,6 @@ export { useModelsTree } from "./models-tree/UseModelsTree.js";
|
|
|
10
10
|
export { useCategoriesTree } from "./categories-tree/UseCategoriesTree.js";
|
|
11
11
|
export { useModelsTreeButtonProps } from "./models-tree/ModelsTreeButtons.js";
|
|
12
12
|
export { useCategoriesTreeButtonProps } from "./categories-tree/CategoriesTreeButtons.js";
|
|
13
|
-
export { FocusedInstancesContextProvider, useFocusedInstancesContext } from "./common/FocusedInstancesContext.js";
|
|
14
13
|
export { Tree } from "./common/components/Tree.js";
|
|
15
14
|
export { VisibilityTree } from "./common/components/VisibilityTree.js";
|
|
16
15
|
export { TreeRenderer } from "./common/components/TreeRenderer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tree-widget-react/components/trees/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tree-widget-react/components/trees/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nexport { ModelsTreeComponent } from \"./models-tree/ModelsTreeComponent.js\";\nexport { CategoriesTreeComponent } from \"./categories-tree/CategoriesTreeComponent.js\";\nexport { IModelContentTreeComponent } from \"./imodel-content-tree/IModelContentTreeComponent.js\";\nexport { ExternalSourcesTreeComponent } from \"./external-sources-tree/ExternalSourcesTreeComponent.js\";\n\nexport { useModelsTree } from \"./models-tree/UseModelsTree.js\";\nexport { useCategoriesTree } from \"./categories-tree/UseCategoriesTree.js\";\n\nexport { useModelsTreeButtonProps } from \"./models-tree/ModelsTreeButtons.js\";\nexport { useCategoriesTreeButtonProps } from \"./categories-tree/CategoriesTreeButtons.js\";\n\nexport { Tree } from \"./common/components/Tree.js\";\nexport { VisibilityTree } from \"./common/components/VisibilityTree.js\";\nexport { TreeRenderer } from \"./common/components/TreeRenderer.js\";\nexport { VisibilityTreeRenderer } from \"./common/components/VisibilityTreeRenderer.js\";\nexport { HierarchyVisibilityHandler, VisibilityStatus } from \"./common/UseHierarchyVisibility.js\";\nexport { TelemetryContextProvider } from \"./common/UseTelemetryContext.js\";\nexport { FilterLimitExceededError } from \"./common/TreeErrors.js\";\n\nexport { ModelsTreeVisibilityHandlerOverrides } from \"./models-tree/internal/ModelsTreeVisibilityHandler.js\";\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { UseModelsTreeProps } from "./UseModelsTree.js";
|
|
3
2
|
import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js";
|
|
4
3
|
/** @beta */
|
|
@@ -8,5 +7,5 @@ export type ModelsTreeProps = Pick<VisibilityTreeProps, "imodel" | "getSchemaCon
|
|
|
8
7
|
};
|
|
9
8
|
};
|
|
10
9
|
/** @beta */
|
|
11
|
-
export declare function ModelsTree({ imodel, getSchemaContext, selectionStorage, activeView, filter, density, hierarchyLevelConfig, hierarchyConfig, selectionMode, selectionPredicate, visibilityHandlerOverrides, getFilteredPaths, onModelsFiltered, }: ModelsTreeProps): JSX.Element;
|
|
10
|
+
export declare function ModelsTree({ imodel, getSchemaContext, selectionStorage, activeView, filter, density, hierarchyLevelConfig, hierarchyConfig, selectionMode, selectionPredicate, visibilityHandlerOverrides, getFilteredPaths, onModelsFiltered, }: ModelsTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
//# sourceMappingURL=ModelsTree.d.ts.map
|
|
@@ -46,20 +46,19 @@ export declare function useModelsTreeButtonProps({ imodel, viewport }: {
|
|
|
46
46
|
onModelsFiltered: (models: Id64String[] | undefined) => void;
|
|
47
47
|
};
|
|
48
48
|
/** @public */
|
|
49
|
-
export type ModelsTreeHeaderButtonType = (props: ModelsTreeHeaderButtonProps) =>
|
|
49
|
+
export type ModelsTreeHeaderButtonType = (props: ModelsTreeHeaderButtonProps) => React.ReactElement | null;
|
|
50
50
|
/** @public */
|
|
51
|
-
export declare function ShowAllButton(props: ModelsTreeHeaderButtonProps): JSX.Element;
|
|
51
|
+
export declare function ShowAllButton(props: ModelsTreeHeaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
52
52
|
/** @public */
|
|
53
|
-
export declare function HideAllButton(props: ModelsTreeHeaderButtonProps): JSX.Element;
|
|
53
|
+
export declare function HideAllButton(props: ModelsTreeHeaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
/** @public */
|
|
55
|
-
export declare function InvertButton(props: ModelsTreeHeaderButtonProps): JSX.Element;
|
|
55
|
+
export declare function InvertButton(props: ModelsTreeHeaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
/** @public */
|
|
57
|
-
export declare function View2DButton(props: ModelsTreeHeaderButtonProps): JSX.Element;
|
|
57
|
+
export declare function View2DButton(props: ModelsTreeHeaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
/** @public */
|
|
59
|
-
export declare function View3DButton(props: ModelsTreeHeaderButtonProps): JSX.Element;
|
|
59
|
+
export declare function View3DButton(props: ModelsTreeHeaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
/** @public */
|
|
61
|
-
export declare function ToggleInstancesFocusButton({
|
|
62
|
-
density?: "default" | "enlarged";
|
|
61
|
+
export declare function ToggleInstancesFocusButton({ onFeatureUsed }: {
|
|
63
62
|
onFeatureUsed?: (feature: string) => void;
|
|
64
|
-
}): JSX.Element;
|
|
63
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
65
64
|
//# sourceMappingURL=ModelsTreeButtons.d.ts.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
import { useEffect, useMemo, useState } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import { Button, IconButton, Tooltip } from "@itwin/itwinui-react";
|
|
7
|
+
import { Button, Icon, IconButton, Tooltip } from "@itwin/itwinui-react/bricks";
|
|
9
8
|
import { TreeWidget } from "../../../TreeWidget.js";
|
|
10
9
|
import { useFocusedInstancesContext } from "../common/FocusedInstancesContext.js";
|
|
11
10
|
import { areAllModelsVisible, hideAllModels, invertAllModels, showAllModels, toggleModels } from "./internal/ModelsTreeVisibilityHandler.js";
|
|
11
|
+
const visibilityShowIcon = new URL("@itwin/itwinui-icons/visibility-show.svg", import.meta.url).href;
|
|
12
|
+
const visibilityHideIcon = new URL("@itwin/itwinui-icons/visibility-hide.svg", import.meta.url).href;
|
|
13
|
+
const visibilityHalfIcon = new URL("@itwin/itwinui-icons/state-inherited-dot.svg", import.meta.url).href; // temporary icon
|
|
14
|
+
const cursorClickIcon = new URL("@itwin/itwinui-icons/placeholder.svg", import.meta.url).href; // temporary icon
|
|
12
15
|
/**
|
|
13
16
|
* Custom hook that creates props required to render `ModelsTreeComponent` header button.
|
|
14
17
|
*
|
|
@@ -71,24 +74,24 @@ async function queryModelsForHeaderActions(iModel) {
|
|
|
71
74
|
}
|
|
72
75
|
/** @public */
|
|
73
76
|
export function ShowAllButton(props) {
|
|
74
|
-
return (_jsx(IconButton, {
|
|
77
|
+
return (_jsx(IconButton, { label: TreeWidget.translate("modelsTree.buttons.showAll.tooltip"), onClick: () => {
|
|
75
78
|
props.onFeatureUsed?.("models-tree-showall");
|
|
76
79
|
void showAllModels(props.models.map((model) => model.id), props.viewport);
|
|
77
|
-
},
|
|
80
|
+
}, icon: visibilityShowIcon }));
|
|
78
81
|
}
|
|
79
82
|
/** @public */
|
|
80
83
|
export function HideAllButton(props) {
|
|
81
|
-
return (_jsx(IconButton, {
|
|
84
|
+
return (_jsx(IconButton, { label: TreeWidget.translate("modelsTree.buttons.hideAll.tooltip"), onClick: () => {
|
|
82
85
|
props.onFeatureUsed?.("models-tree-hideall");
|
|
83
86
|
void hideAllModels(props.models.map((model) => model.id), props.viewport);
|
|
84
|
-
},
|
|
87
|
+
}, icon: visibilityHideIcon }));
|
|
85
88
|
}
|
|
86
89
|
/** @public */
|
|
87
90
|
export function InvertButton(props) {
|
|
88
|
-
return (_jsx(IconButton, {
|
|
91
|
+
return (_jsx(IconButton, { label: TreeWidget.translate("modelsTree.buttons.invert.tooltip"), onClick: () => {
|
|
89
92
|
props.onFeatureUsed?.("models-tree-invert");
|
|
90
93
|
void invertAllModels(props.models.map((model) => model.id), props.viewport);
|
|
91
|
-
},
|
|
94
|
+
}, icon: visibilityHalfIcon }));
|
|
92
95
|
}
|
|
93
96
|
/** @public */
|
|
94
97
|
export function View2DButton(props) {
|
|
@@ -100,10 +103,10 @@ export function View2DButton(props) {
|
|
|
100
103
|
setIs2dToggleActive(areAllModelsVisible(models2d, props.viewport));
|
|
101
104
|
return props.viewport.onViewedModelsChanged.addListener((vp) => setIs2dToggleActive(areAllModelsVisible(models2d, vp)));
|
|
102
105
|
}, [models2d, props.viewport]);
|
|
103
|
-
return (_jsx(Tooltip, { content: TreeWidget.translate("modelsTree.buttons.toggle2d.tooltip"), children:
|
|
106
|
+
return (_jsx(Tooltip, { content: TreeWidget.translate("modelsTree.buttons.toggle2d.tooltip"), children: _jsxs(Button, { onClick: () => {
|
|
104
107
|
props.onFeatureUsed?.("models-tree-view2d");
|
|
105
108
|
void toggleModels(models2d, is2dToggleActive, props.viewport);
|
|
106
|
-
}, disabled: models2d.length === 0,
|
|
109
|
+
}, disabled: models2d.length === 0, children: [TreeWidget.translate("modelsTree.buttons.toggle2d.label"), _jsx(Icon, { href: is2dToggleActive ? visibilityShowIcon : visibilityHideIcon })] }) }));
|
|
107
110
|
}
|
|
108
111
|
/** @public */
|
|
109
112
|
export function View3DButton(props) {
|
|
@@ -115,20 +118,20 @@ export function View3DButton(props) {
|
|
|
115
118
|
setIs3dToggleActive(areAllModelsVisible(models3d, props.viewport));
|
|
116
119
|
return props.viewport.onViewedModelsChanged.addListener((vp) => setIs3dToggleActive(areAllModelsVisible(models3d, vp)));
|
|
117
120
|
}, [models3d, props.viewport]);
|
|
118
|
-
return (_jsx(Tooltip, { content: TreeWidget.translate("modelsTree.buttons.toggle3d.tooltip"), children:
|
|
121
|
+
return (_jsx(Tooltip, { content: TreeWidget.translate("modelsTree.buttons.toggle3d.tooltip"), children: _jsxs(Button, { onClick: () => {
|
|
119
122
|
props.onFeatureUsed?.("models-tree-view3d");
|
|
120
123
|
void toggleModels(models3d, is3dToggleActive, props.viewport);
|
|
121
|
-
}, disabled: models3d.length === 0,
|
|
124
|
+
}, disabled: models3d.length === 0, children: [TreeWidget.translate("modelsTree.buttons.toggle3d.label"), _jsx(Icon, { href: is3dToggleActive ? visibilityShowIcon : visibilityHideIcon })] }) }));
|
|
122
125
|
}
|
|
123
126
|
/** @public */
|
|
124
|
-
export function ToggleInstancesFocusButton({
|
|
127
|
+
export function ToggleInstancesFocusButton({ onFeatureUsed }) {
|
|
125
128
|
const { enabled, toggle } = useFocusedInstancesContext();
|
|
126
129
|
const label = enabled
|
|
127
130
|
? TreeWidget.translate("modelsTree.buttons.toggleFocusMode.disable.tooltip")
|
|
128
131
|
: TreeWidget.translate("modelsTree.buttons.toggleFocusMode.enable.tooltip");
|
|
129
|
-
return (_jsx(IconButton, {
|
|
132
|
+
return (_jsx(IconButton, { variant: "ghost", label: label, onClick: () => {
|
|
130
133
|
onFeatureUsed?.("models-tree-instancesfocus");
|
|
131
134
|
toggle();
|
|
132
|
-
}, isActive: enabled,
|
|
135
|
+
}, isActive: enabled, icon: cursorClickIcon }));
|
|
133
136
|
}
|
|
134
137
|
//# sourceMappingURL=ModelsTreeButtons.js.map
|