@itwin/grouping-mapping-widget 0.19.1 → 0.20.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/README.md +1 -1
- package/lib/cjs/WidgetShell/GroupingMapping.d.ts +34 -0
- package/lib/cjs/WidgetShell/GroupingMapping.js +79 -0
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -0
- package/lib/cjs/WidgetShell/GroupingMappingContent.js +51 -0
- package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -0
- package/lib/cjs/WidgetShell/GroupingMappingHeader.js +24 -0
- package/lib/cjs/WidgetShell/GroupingMappingHeader.js.map +1 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.d.ts +10 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +31 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -0
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.d.ts +8 -0
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +107 -0
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -0
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -0
- package/lib/cjs/common/utils.d.ts +11 -0
- package/lib/cjs/common/utils.js +89 -0
- package/lib/cjs/common/utils.js.map +1 -0
- package/lib/cjs/common/viewerUtils.d.ts +30 -0
- package/lib/cjs/common/viewerUtils.js +293 -0
- package/lib/cjs/common/viewerUtils.js.map +1 -0
- package/lib/cjs/components/GroupingMappingContext.d.ts +39 -0
- package/lib/cjs/components/GroupingMappingContext.js +123 -0
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -0
- package/lib/cjs/components/Groups/Editing/GroupAction.js +156 -0
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -0
- package/lib/cjs/components/Groups/Editing/GroupDetails.js +34 -0
- package/lib/cjs/components/Groups/Editing/GroupDetails.js.map +1 -0
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -0
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js.map +1 -0
- package/lib/cjs/components/Groups/GroupColorLegend.js.map +1 -0
- package/lib/cjs/components/Groups/GroupItem.d.ts +13 -0
- package/lib/cjs/components/Groups/GroupItem.js +23 -0
- package/lib/cjs/components/Groups/GroupItem.js.map +1 -0
- package/lib/cjs/components/Groups/GroupMenuActions.d.ts +14 -0
- package/lib/cjs/components/Groups/GroupMenuActions.js +80 -0
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -0
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +11 -0
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js +18 -0
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -0
- package/lib/cjs/components/Groups/Groups.d.ts +18 -0
- package/lib/cjs/components/Groups/Groups.js +47 -0
- package/lib/cjs/components/Groups/Groups.js.map +1 -0
- package/lib/cjs/components/Groups/GroupsAddButton.d.ts +10 -0
- package/lib/cjs/components/Groups/GroupsAddButton.js.map +1 -0
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js +45 -0
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -0
- package/lib/cjs/components/Groups/GroupsView.d.ts +43 -0
- package/lib/cjs/components/Groups/GroupsView.js +49 -0
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -0
- package/lib/cjs/components/Groups/GroupsView.scss +53 -0
- package/lib/cjs/components/Groups/GroupsVisualization.js +153 -0
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -0
- package/lib/cjs/components/Groups/GroupsVisualization.scss +18 -0
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js +27 -0
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -0
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +17 -0
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +91 -0
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -0
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.scss +14 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +13 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +28 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -0
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -0
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js.map +1 -0
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +11 -0
- package/lib/cjs/components/Groups/groupsHelpers.js +202 -0
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -0
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +26 -0
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js +71 -0
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -0
- package/lib/cjs/components/Groups/hooks/useVisualization.js +68 -0
- package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -0
- package/lib/cjs/components/Mappings/BlockingOverlay.js +20 -0
- package/lib/cjs/components/Mappings/BlockingOverlay.js.map +1 -0
- package/lib/cjs/components/Mappings/ConfirmMappingsImport.js +134 -0
- package/lib/cjs/components/Mappings/ConfirmMappingsImport.js.map +1 -0
- package/lib/cjs/components/Mappings/Editing/MappingAction.js +109 -0
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +42 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.d.ts +11 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +129 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatusIcon.js.map +1 -0
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +125 -0
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -0
- package/lib/cjs/components/Mappings/Import/SelectIModel.js +102 -0
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -0
- package/lib/cjs/components/Mappings/Import/SelectITwin.js +115 -0
- package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -0
- package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +16 -0
- package/lib/cjs/components/Mappings/Import/SelectMappings.js +88 -0
- package/lib/cjs/components/Mappings/Import/SelectMappings.js.map +1 -0
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -0
- package/lib/cjs/components/Mappings/Mappings.d.ts +13 -0
- package/lib/cjs/components/Mappings/Mappings.js +45 -0
- package/lib/cjs/components/Mappings/Mappings.js.map +1 -0
- package/lib/cjs/components/Mappings/MappingsView.js +64 -0
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +35 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +120 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +84 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +150 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +84 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -0
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +12 -0
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +185 -0
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -0
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +84 -0
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -0
- package/lib/cjs/components/Properties/GroupColorToggle.js +69 -0
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -0
- package/lib/cjs/components/Properties/GroupInformationPanel.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +287 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +81 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +8 -0
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +52 -0
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyAction.js +99 -0
- package/lib/cjs/components/Properties/PropertyAction.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyMenu.js +60 -0
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyNameCell.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyTable.js +53 -0
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -0
- package/lib/cjs/components/Properties/PropertyTableToolbar.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useFetchData.js +43 -0
- package/lib/cjs/components/Properties/hooks/useFetchData.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.d.ts +6 -0
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +29 -0
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -0
- package/lib/cjs/components/SharedComponents/ActionPanel.js +39 -0
- package/lib/cjs/components/SharedComponents/ActionPanel.js.map +1 -0
- package/lib/cjs/components/SharedComponents/DeleteModal.js +62 -0
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -0
- package/lib/cjs/components/SharedComponents/EmptyMessage.d.ts +7 -0
- package/lib/cjs/components/SharedComponents/EmptyMessage.js +17 -0
- package/lib/cjs/components/SharedComponents/EmptyMessage.js.map +1 -0
- package/lib/cjs/components/SharedComponents/EmptyMessage.scss +12 -0
- package/lib/cjs/components/SharedComponents/HorizontalTile.d.ts +19 -0
- package/lib/cjs/components/SharedComponents/HorizontalTile.js +27 -0
- package/lib/cjs/components/SharedComponents/HorizontalTile.js.map +1 -0
- package/lib/cjs/components/SharedComponents/HorizontalTile.scss +58 -0
- package/lib/cjs/components/SharedComponents/LoadingOverlay.d.ts +4 -0
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js +19 -0
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js.map +1 -0
- package/lib/cjs/components/SharedComponents/LoadingOverlay.scss +13 -0
- package/lib/cjs/components/SharedComponents/LoadingSpinner.d.ts +4 -0
- package/lib/cjs/components/SharedComponents/LoadingSpinner.js +19 -0
- package/lib/cjs/components/SharedComponents/LoadingSpinner.js.map +1 -0
- package/lib/cjs/components/SharedComponents/LoadingSpinner.scss +8 -0
- package/lib/cjs/components/SharedComponents/StatusIcon.js.map +1 -0
- package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -0
- package/lib/cjs/components/context/GroupHilitedElementsContext.d.ts +38 -0
- package/lib/cjs/components/context/GroupHilitedElementsContext.js +55 -0
- package/lib/cjs/components/context/GroupHilitedElementsContext.js.map +1 -0
- package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/cjs/components/context/GroupingMappingCustomUIContext.js.map +1 -0
- package/lib/cjs/components/context/IModelsClientContext.js.map +1 -0
- package/lib/cjs/components/context/ITwinsClientContext.js.map +1 -0
- package/lib/cjs/components/context/MappingClientContext.js.map +1 -0
- package/lib/cjs/components/context/PropertiesContext.js.map +1 -0
- package/lib/cjs/components/context/PropertyGridWrapperContext.d.ts +13 -0
- package/lib/cjs/components/context/PropertyGridWrapperContext.js.map +1 -0
- package/lib/cjs/components/customUI/DefaultGroupingUI.js.map +1 -0
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +107 -0
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -0
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -0
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +32 -0
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -0
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +98 -0
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -0
- package/lib/cjs/grouping-mapping-widget.d.ts +23 -23
- package/lib/cjs/grouping-mapping-widget.js +23 -23
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupPropertyUtils.test.js +1 -1
- package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +4 -4
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/QueryBuilder.test.js +1 -1
- package/lib/cjs/test/QueryBuilder.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +1 -1
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.js +1 -1
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMapping.d.ts +34 -0
- package/lib/esm/WidgetShell/GroupingMapping.js +57 -0
- package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMappingContent.js +28 -0
- package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMappingHeader.js +17 -0
- package/lib/esm/WidgetShell/GroupingMappingHeader.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.d.ts +10 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +24 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -0
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.d.ts +8 -0
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +100 -0
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -0
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -0
- package/lib/esm/common/utils.d.ts +11 -0
- package/lib/esm/common/utils.js +80 -0
- package/lib/esm/common/utils.js.map +1 -0
- package/lib/esm/common/viewerUtils.d.ts +30 -0
- package/lib/esm/common/viewerUtils.js +268 -0
- package/lib/esm/common/viewerUtils.js.map +1 -0
- package/lib/esm/components/GroupingMappingContext.d.ts +39 -0
- package/lib/esm/components/GroupingMappingContext.js +100 -0
- package/lib/esm/components/GroupingMappingContext.js.map +1 -0
- package/lib/esm/components/Groups/Editing/GroupAction.js +130 -0
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -0
- package/lib/esm/components/Groups/Editing/GroupDetails.js +27 -0
- package/lib/esm/components/Groups/Editing/GroupDetails.js.map +1 -0
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -0
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js.map +1 -0
- package/lib/esm/components/Groups/GroupColorLegend.js.map +1 -0
- package/lib/esm/components/Groups/GroupItem.d.ts +13 -0
- package/lib/esm/components/Groups/GroupItem.js +16 -0
- package/lib/esm/components/Groups/GroupItem.js.map +1 -0
- package/lib/esm/components/Groups/GroupMenuActions.d.ts +14 -0
- package/lib/esm/components/Groups/GroupMenuActions.js +57 -0
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -0
- package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +11 -0
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js +11 -0
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -0
- package/lib/esm/components/Groups/Groups.d.ts +18 -0
- package/lib/esm/components/Groups/Groups.js +24 -0
- package/lib/esm/components/Groups/Groups.js.map +1 -0
- package/lib/esm/components/Groups/GroupsAddButton.d.ts +10 -0
- package/lib/esm/components/Groups/GroupsAddButton.js.map +1 -0
- package/lib/esm/components/Groups/GroupsShowHideButtons.js +22 -0
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -0
- package/lib/esm/components/Groups/GroupsView.d.ts +43 -0
- package/lib/esm/components/Groups/GroupsView.js +42 -0
- package/lib/esm/components/Groups/GroupsView.js.map +1 -0
- package/lib/esm/components/Groups/GroupsView.scss +53 -0
- package/lib/esm/components/Groups/GroupsVisualization.js +130 -0
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -0
- package/lib/esm/components/Groups/GroupsVisualization.scss +18 -0
- package/lib/esm/components/Groups/GroupsVisualizationActions.js +20 -0
- package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -0
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +17 -0
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +84 -0
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -0
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.scss +14 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +13 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +21 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -0
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -0
- package/lib/esm/components/Groups/ToggleGroupVisibility.js.map +1 -0
- package/lib/esm/components/Groups/groupsHelpers.d.ts +11 -0
- package/lib/esm/components/Groups/groupsHelpers.js +192 -0
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -0
- package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +26 -0
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js +67 -0
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -0
- package/lib/esm/components/Groups/hooks/useVisualization.js +64 -0
- package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -0
- package/lib/esm/components/Mappings/BlockingOverlay.js +13 -0
- package/lib/esm/components/Mappings/BlockingOverlay.js.map +1 -0
- package/lib/esm/components/Mappings/ConfirmMappingsImport.js +113 -0
- package/lib/esm/components/Mappings/ConfirmMappingsImport.js.map +1 -0
- package/lib/esm/components/Mappings/Editing/MappingAction.js +83 -0
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js +19 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.d.ts +11 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +106 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatusIcon.js.map +1 -0
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +99 -0
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -0
- package/lib/esm/components/Mappings/Import/SelectIModel.js +81 -0
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -0
- package/lib/esm/components/Mappings/Import/SelectITwin.js +94 -0
- package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -0
- package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +16 -0
- package/lib/esm/components/Mappings/Import/SelectMappings.js +67 -0
- package/lib/esm/components/Mappings/Import/SelectMappings.js.map +1 -0
- package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -0
- package/lib/esm/components/Mappings/Mappings.d.ts +13 -0
- package/lib/esm/components/Mappings/Mappings.js +22 -0
- package/lib/esm/components/Mappings/Mappings.js.map +1 -0
- package/lib/esm/components/Mappings/MappingsView.js +57 -0
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +35 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +116 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +58 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +124 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +61 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -0
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +12 -0
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +159 -0
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -0
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +61 -0
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -0
- package/lib/esm/components/Properties/GroupColorToggle.js +46 -0
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -0
- package/lib/esm/components/Properties/GroupInformationPanel.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +261 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +58 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +8 -0
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +31 -0
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -0
- package/lib/esm/components/Properties/PropertyAction.js +76 -0
- package/lib/esm/components/Properties/PropertyAction.js.map +1 -0
- package/lib/esm/components/Properties/PropertyMenu.js +37 -0
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -0
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/esm/components/Properties/PropertyNameCell.js.map +1 -0
- package/lib/esm/components/Properties/PropertyTable.js +27 -0
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -0
- package/lib/esm/components/Properties/PropertyTableToolbar.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useFetchData.js +37 -0
- package/lib/esm/components/Properties/hooks/useFetchData.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useFormulaValidation.d.ts +6 -0
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js +25 -0
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -0
- package/lib/esm/components/SharedComponents/ActionPanel.js +18 -0
- package/lib/esm/components/SharedComponents/ActionPanel.js.map +1 -0
- package/lib/esm/components/SharedComponents/DeleteModal.js +39 -0
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -0
- package/lib/esm/components/SharedComponents/EmptyMessage.d.ts +7 -0
- package/lib/esm/components/SharedComponents/EmptyMessage.js +10 -0
- package/lib/esm/components/SharedComponents/EmptyMessage.js.map +1 -0
- package/lib/esm/components/SharedComponents/EmptyMessage.scss +12 -0
- package/lib/esm/components/SharedComponents/HorizontalTile.d.ts +19 -0
- package/lib/esm/components/SharedComponents/HorizontalTile.js +20 -0
- package/lib/esm/components/SharedComponents/HorizontalTile.js.map +1 -0
- package/lib/esm/components/SharedComponents/HorizontalTile.scss +58 -0
- package/lib/esm/components/SharedComponents/LoadingOverlay.d.ts +4 -0
- package/lib/esm/components/SharedComponents/LoadingOverlay.js +12 -0
- package/lib/esm/components/SharedComponents/LoadingOverlay.js.map +1 -0
- package/lib/esm/components/SharedComponents/LoadingOverlay.scss +13 -0
- package/lib/esm/components/SharedComponents/LoadingSpinner.d.ts +4 -0
- package/lib/esm/components/SharedComponents/LoadingSpinner.js +12 -0
- package/lib/esm/components/SharedComponents/LoadingSpinner.js.map +1 -0
- package/lib/esm/components/SharedComponents/LoadingSpinner.scss +8 -0
- package/lib/esm/components/SharedComponents/StatusIcon.js.map +1 -0
- package/lib/esm/components/context/ExtractionClientContext.js.map +1 -0
- package/lib/esm/components/context/GroupHilitedElementsContext.d.ts +38 -0
- package/lib/esm/components/context/GroupHilitedElementsContext.js +32 -0
- package/lib/esm/components/context/GroupHilitedElementsContext.js.map +1 -0
- package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/esm/components/context/GroupingMappingCustomUIContext.js.map +1 -0
- package/lib/esm/components/context/IModelsClientContext.js.map +1 -0
- package/lib/esm/components/context/ITwinsClientContext.js.map +1 -0
- package/lib/esm/components/context/MappingClientContext.js.map +1 -0
- package/lib/esm/components/context/PropertiesContext.js.map +1 -0
- package/lib/esm/components/context/PropertyGridWrapperContext.d.ts +13 -0
- package/lib/esm/components/context/PropertyGridWrapperContext.js.map +1 -0
- package/lib/esm/components/customUI/DefaultGroupingUI.js.map +1 -0
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +84 -0
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -0
- package/lib/esm/components/customUI/GroupingMappingCustomUI.js.map +1 -0
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js +25 -0
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -0
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js +91 -0
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -0
- package/lib/esm/grouping-mapping-widget.d.ts +23 -23
- package/lib/esm/grouping-mapping-widget.js +23 -23
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupPropertyUtils.test.js +1 -1
- package/lib/esm/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +4 -4
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/QueryBuilder.test.js +1 -1
- package/lib/esm/test/QueryBuilder.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +1 -1
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.js +1 -1
- package/lib/esm/test/test-utils.js.map +1 -1
- package/package.json +2 -2
- package/lib/cjs/widget/GroupingMappingWidget.d.ts +0 -10
- package/lib/cjs/widget/GroupingMappingWidget.js +0 -31
- package/lib/cjs/widget/GroupingMappingWidget.js.map +0 -1
- package/lib/cjs/widget/components/ActionPanel.js +0 -39
- package/lib/cjs/widget/components/ActionPanel.js.map +0 -1
- package/lib/cjs/widget/components/BlockingOverlay.js +0 -20
- package/lib/cjs/widget/components/BlockingOverlay.js.map +0 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +0 -84
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +0 -1
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +0 -150
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +0 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +0 -84
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +0 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +0 -134
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +0 -1
- package/lib/cjs/widget/components/CustomCalculationAction.d.ts +0 -13
- package/lib/cjs/widget/components/CustomCalculationAction.js +0 -186
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +0 -1
- package/lib/cjs/widget/components/CustomCalculationTable.js +0 -84
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +0 -1
- package/lib/cjs/widget/components/DeleteModal.js +0 -61
- package/lib/cjs/widget/components/DeleteModal.js.map +0 -1
- package/lib/cjs/widget/components/ExtractionLogCustomFilter.js +0 -42
- package/lib/cjs/widget/components/ExtractionLogCustomFilter.js.map +0 -1
- package/lib/cjs/widget/components/ExtractionMessageModal.d.ts +0 -11
- package/lib/cjs/widget/components/ExtractionMessageModal.js +0 -87
- package/lib/cjs/widget/components/ExtractionMessageModal.js.map +0 -1
- package/lib/cjs/widget/components/ExtractionStatusIcon.js.map +0 -1
- package/lib/cjs/widget/components/GroupAction.js +0 -155
- package/lib/cjs/widget/components/GroupAction.js.map +0 -1
- package/lib/cjs/widget/components/GroupColorLegend.js.map +0 -1
- package/lib/cjs/widget/components/GroupColorToggle.js +0 -69
- package/lib/cjs/widget/components/GroupColorToggle.js.map +0 -1
- package/lib/cjs/widget/components/GroupDetails.js +0 -34
- package/lib/cjs/widget/components/GroupDetails.js.map +0 -1
- package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +0 -1
- package/lib/cjs/widget/components/GroupDetailsStep.js.map +0 -1
- package/lib/cjs/widget/components/GroupInformationPanel.js.map +0 -1
- package/lib/cjs/widget/components/GroupItem.d.ts +0 -12
- package/lib/cjs/widget/components/GroupItem.js +0 -19
- package/lib/cjs/widget/components/GroupItem.js.map +0 -1
- package/lib/cjs/widget/components/GroupMenuActions.d.ts +0 -13
- package/lib/cjs/widget/components/GroupMenuActions.js +0 -68
- package/lib/cjs/widget/components/GroupMenuActions.js.map +0 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +0 -287
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +0 -1
- package/lib/cjs/widget/components/GroupPropertyTable.js +0 -81
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +0 -1
- package/lib/cjs/widget/components/GroupPropertyUtils.js.map +0 -1
- package/lib/cjs/widget/components/GroupingMapping.d.ts +0 -34
- package/lib/cjs/widget/components/GroupingMapping.js +0 -79
- package/lib/cjs/widget/components/GroupingMapping.js.map +0 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js +0 -51
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +0 -1
- package/lib/cjs/widget/components/GroupingMappingContext.d.ts +0 -40
- package/lib/cjs/widget/components/GroupingMappingContext.js +0 -109
- package/lib/cjs/widget/components/GroupingMappingContext.js.map +0 -1
- package/lib/cjs/widget/components/GroupingMappingHeader.js +0 -24
- package/lib/cjs/widget/components/GroupingMappingHeader.js.map +0 -1
- package/lib/cjs/widget/components/GroupingMappingRouter.d.ts +0 -8
- package/lib/cjs/widget/components/GroupingMappingRouter.js +0 -107
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +0 -1
- package/lib/cjs/widget/components/Groups.d.ts +0 -16
- package/lib/cjs/widget/components/Groups.js +0 -46
- package/lib/cjs/widget/components/Groups.js.map +0 -1
- package/lib/cjs/widget/components/GroupsAddButton.d.ts +0 -10
- package/lib/cjs/widget/components/GroupsAddButton.js.map +0 -1
- package/lib/cjs/widget/components/GroupsShowHideButtons.js +0 -45
- package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +0 -1
- package/lib/cjs/widget/components/GroupsView.d.ts +0 -31
- package/lib/cjs/widget/components/GroupsView.js +0 -37
- package/lib/cjs/widget/components/GroupsView.js.map +0 -1
- package/lib/cjs/widget/components/GroupsView.scss +0 -49
- package/lib/cjs/widget/components/GroupsVisualization.js +0 -141
- package/lib/cjs/widget/components/GroupsVisualization.js.map +0 -1
- package/lib/cjs/widget/components/GroupsVisualization.scss +0 -12
- package/lib/cjs/widget/components/GroupsVisualizationActions.js +0 -27
- package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +0 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts +0 -15
- package/lib/cjs/widget/components/HorizontalTile.js +0 -24
- package/lib/cjs/widget/components/HorizontalTile.js.map +0 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +0 -57
- package/lib/cjs/widget/components/MappingAction.js +0 -109
- package/lib/cjs/widget/components/MappingAction.js.map +0 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js +0 -125
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +0 -1
- package/lib/cjs/widget/components/MappingViewActionGroup.js.map +0 -1
- package/lib/cjs/widget/components/Mappings.d.ts +0 -13
- package/lib/cjs/widget/components/Mappings.js +0 -45
- package/lib/cjs/widget/components/Mappings.js.map +0 -1
- package/lib/cjs/widget/components/MappingsView.js +0 -63
- package/lib/cjs/widget/components/MappingsView.js.map +0 -1
- package/lib/cjs/widget/components/PropertyAction.js +0 -99
- package/lib/cjs/widget/components/PropertyAction.js.map +0 -1
- package/lib/cjs/widget/components/PropertyMenu.js +0 -60
- package/lib/cjs/widget/components/PropertyMenu.js.map +0 -1
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +0 -1
- package/lib/cjs/widget/components/PropertyNameCell.js.map +0 -1
- package/lib/cjs/widget/components/PropertyTable.js +0 -53
- package/lib/cjs/widget/components/PropertyTable.js.map +0 -1
- package/lib/cjs/widget/components/PropertyTableToolbar.js.map +0 -1
- package/lib/cjs/widget/components/QueryBuilder.js.map +0 -1
- package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +0 -1
- package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +0 -13
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js +0 -28
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +0 -1
- package/lib/cjs/widget/components/QueryBuilderStep.js.map +0 -1
- package/lib/cjs/widget/components/SaveModal.js.map +0 -1
- package/lib/cjs/widget/components/SelectIModel.js +0 -102
- package/lib/cjs/widget/components/SelectIModel.js.map +0 -1
- package/lib/cjs/widget/components/SelectITwin.js +0 -115
- package/lib/cjs/widget/components/SelectITwin.js.map +0 -1
- package/lib/cjs/widget/components/SelectMappings.d.ts +0 -16
- package/lib/cjs/widget/components/SelectMappings.js +0 -88
- package/lib/cjs/widget/components/SelectMappings.js.map +0 -1
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +0 -1
- package/lib/cjs/widget/components/SortableHorizontalTile.d.ts +0 -8
- package/lib/cjs/widget/components/SortableHorizontalTile.js +0 -52
- package/lib/cjs/widget/components/SortableHorizontalTile.js.map +0 -1
- package/lib/cjs/widget/components/StatusIcon.js.map +0 -1
- package/lib/cjs/widget/components/ToggleGroupVisibility.js.map +0 -1
- package/lib/cjs/widget/components/WidgetHeader.js.map +0 -1
- package/lib/cjs/widget/components/context/ExtractionClientContext.js.map +0 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +0 -22
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +0 -47
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +0 -1
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +0 -1
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js.map +0 -1
- package/lib/cjs/widget/components/context/IModelsClientContext.js.map +0 -1
- package/lib/cjs/widget/components/context/ITwinsClientContext.js.map +0 -1
- package/lib/cjs/widget/components/context/MappingClientContext.js.map +0 -1
- package/lib/cjs/widget/components/context/PropertiesContext.js.map +0 -1
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +0 -13
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +0 -1
- package/lib/cjs/widget/components/customUI/DefaultGroupingUI.js.map +0 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +0 -107
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +0 -1
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +0 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +0 -32
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +0 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +0 -98
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +0 -1
- package/lib/cjs/widget/components/groupsHelpers.d.ts +0 -10
- package/lib/cjs/widget/components/groupsHelpers.js +0 -84
- package/lib/cjs/widget/components/groupsHelpers.js.map +0 -1
- package/lib/cjs/widget/components/hooks/useGroupsOperations.d.ts +0 -20
- package/lib/cjs/widget/components/hooks/useGroupsOperations.js +0 -67
- package/lib/cjs/widget/components/hooks/useGroupsOperations.js.map +0 -1
- package/lib/cjs/widget/components/hooks/useMappingsOperations.d.ts +0 -35
- package/lib/cjs/widget/components/hooks/useMappingsOperations.js +0 -120
- package/lib/cjs/widget/components/hooks/useMappingsOperations.js.map +0 -1
- package/lib/cjs/widget/components/utils.d.ts +0 -16
- package/lib/cjs/widget/components/utils.js +0 -99
- package/lib/cjs/widget/components/utils.js.map +0 -1
- package/lib/cjs/widget/components/utils.scss +0 -18
- package/lib/cjs/widget/components/viewerUtils.d.ts +0 -30
- package/lib/cjs/widget/components/viewerUtils.js +0 -293
- package/lib/cjs/widget/components/viewerUtils.js.map +0 -1
- package/lib/cjs/widget/hooks/useFetchData.js +0 -43
- package/lib/cjs/widget/hooks/useFetchData.js.map +0 -1
- package/lib/cjs/widget/hooks/useFormulaValidation.d.ts +0 -6
- package/lib/cjs/widget/hooks/useFormulaValidation.js +0 -29
- package/lib/cjs/widget/hooks/useFormulaValidation.js.map +0 -1
- package/lib/cjs/widget/hooks/useValidator.js.map +0 -1
- package/lib/cjs/widget/hooks/useVisualization.js +0 -68
- package/lib/cjs/widget/hooks/useVisualization.js.map +0 -1
- package/lib/cjs/widget/utils.d.ts +0 -5
- package/lib/cjs/widget/utils.js +0 -12
- package/lib/cjs/widget/utils.js.map +0 -1
- package/lib/esm/widget/GroupingMappingWidget.d.ts +0 -10
- package/lib/esm/widget/GroupingMappingWidget.js +0 -24
- package/lib/esm/widget/GroupingMappingWidget.js.map +0 -1
- package/lib/esm/widget/components/ActionPanel.js +0 -18
- package/lib/esm/widget/components/ActionPanel.js.map +0 -1
- package/lib/esm/widget/components/BlockingOverlay.js +0 -13
- package/lib/esm/widget/components/BlockingOverlay.js.map +0 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.js +0 -58
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +0 -1
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js +0 -124
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js.map +0 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.js +0 -61
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +0 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js +0 -113
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +0 -1
- package/lib/esm/widget/components/CustomCalculationAction.d.ts +0 -13
- package/lib/esm/widget/components/CustomCalculationAction.js +0 -160
- package/lib/esm/widget/components/CustomCalculationAction.js.map +0 -1
- package/lib/esm/widget/components/CustomCalculationTable.js +0 -61
- package/lib/esm/widget/components/CustomCalculationTable.js.map +0 -1
- package/lib/esm/widget/components/DeleteModal.js +0 -38
- package/lib/esm/widget/components/DeleteModal.js.map +0 -1
- package/lib/esm/widget/components/ExtractionLogCustomFilter.js +0 -19
- package/lib/esm/widget/components/ExtractionLogCustomFilter.js.map +0 -1
- package/lib/esm/widget/components/ExtractionMessageModal.d.ts +0 -11
- package/lib/esm/widget/components/ExtractionMessageModal.js +0 -64
- package/lib/esm/widget/components/ExtractionMessageModal.js.map +0 -1
- package/lib/esm/widget/components/ExtractionStatusIcon.js.map +0 -1
- package/lib/esm/widget/components/GroupAction.js +0 -129
- package/lib/esm/widget/components/GroupAction.js.map +0 -1
- package/lib/esm/widget/components/GroupColorLegend.js.map +0 -1
- package/lib/esm/widget/components/GroupColorToggle.js +0 -46
- package/lib/esm/widget/components/GroupColorToggle.js.map +0 -1
- package/lib/esm/widget/components/GroupDetails.js +0 -27
- package/lib/esm/widget/components/GroupDetails.js.map +0 -1
- package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +0 -1
- package/lib/esm/widget/components/GroupDetailsStep.js.map +0 -1
- package/lib/esm/widget/components/GroupInformationPanel.js.map +0 -1
- package/lib/esm/widget/components/GroupItem.d.ts +0 -12
- package/lib/esm/widget/components/GroupItem.js +0 -12
- package/lib/esm/widget/components/GroupItem.js.map +0 -1
- package/lib/esm/widget/components/GroupMenuActions.d.ts +0 -13
- package/lib/esm/widget/components/GroupMenuActions.js +0 -45
- package/lib/esm/widget/components/GroupMenuActions.js.map +0 -1
- package/lib/esm/widget/components/GroupPropertyAction.js +0 -261
- package/lib/esm/widget/components/GroupPropertyAction.js.map +0 -1
- package/lib/esm/widget/components/GroupPropertyTable.js +0 -58
- package/lib/esm/widget/components/GroupPropertyTable.js.map +0 -1
- package/lib/esm/widget/components/GroupPropertyUtils.js.map +0 -1
- package/lib/esm/widget/components/GroupingMapping.d.ts +0 -34
- package/lib/esm/widget/components/GroupingMapping.js +0 -57
- package/lib/esm/widget/components/GroupingMapping.js.map +0 -1
- package/lib/esm/widget/components/GroupingMappingContent.js +0 -28
- package/lib/esm/widget/components/GroupingMappingContent.js.map +0 -1
- package/lib/esm/widget/components/GroupingMappingContext.d.ts +0 -40
- package/lib/esm/widget/components/GroupingMappingContext.js +0 -86
- package/lib/esm/widget/components/GroupingMappingContext.js.map +0 -1
- package/lib/esm/widget/components/GroupingMappingHeader.js +0 -17
- package/lib/esm/widget/components/GroupingMappingHeader.js.map +0 -1
- package/lib/esm/widget/components/GroupingMappingRouter.d.ts +0 -8
- package/lib/esm/widget/components/GroupingMappingRouter.js +0 -100
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +0 -1
- package/lib/esm/widget/components/Groups.d.ts +0 -16
- package/lib/esm/widget/components/Groups.js +0 -23
- package/lib/esm/widget/components/Groups.js.map +0 -1
- package/lib/esm/widget/components/GroupsAddButton.d.ts +0 -10
- package/lib/esm/widget/components/GroupsAddButton.js.map +0 -1
- package/lib/esm/widget/components/GroupsShowHideButtons.js +0 -22
- package/lib/esm/widget/components/GroupsShowHideButtons.js.map +0 -1
- package/lib/esm/widget/components/GroupsView.d.ts +0 -31
- package/lib/esm/widget/components/GroupsView.js +0 -30
- package/lib/esm/widget/components/GroupsView.js.map +0 -1
- package/lib/esm/widget/components/GroupsView.scss +0 -49
- package/lib/esm/widget/components/GroupsVisualization.js +0 -118
- package/lib/esm/widget/components/GroupsVisualization.js.map +0 -1
- package/lib/esm/widget/components/GroupsVisualization.scss +0 -12
- package/lib/esm/widget/components/GroupsVisualizationActions.js +0 -20
- package/lib/esm/widget/components/GroupsVisualizationActions.js.map +0 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts +0 -15
- package/lib/esm/widget/components/HorizontalTile.js +0 -17
- package/lib/esm/widget/components/HorizontalTile.js.map +0 -1
- package/lib/esm/widget/components/HorizontalTile.scss +0 -57
- package/lib/esm/widget/components/MappingAction.js +0 -83
- package/lib/esm/widget/components/MappingAction.js.map +0 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js +0 -99
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +0 -1
- package/lib/esm/widget/components/MappingViewActionGroup.js.map +0 -1
- package/lib/esm/widget/components/Mappings.d.ts +0 -13
- package/lib/esm/widget/components/Mappings.js +0 -22
- package/lib/esm/widget/components/Mappings.js.map +0 -1
- package/lib/esm/widget/components/MappingsView.js +0 -56
- package/lib/esm/widget/components/MappingsView.js.map +0 -1
- package/lib/esm/widget/components/PropertyAction.js +0 -76
- package/lib/esm/widget/components/PropertyAction.js.map +0 -1
- package/lib/esm/widget/components/PropertyMenu.js +0 -37
- package/lib/esm/widget/components/PropertyMenu.js.map +0 -1
- package/lib/esm/widget/components/PropertyMenuWithVisualization.js.map +0 -1
- package/lib/esm/widget/components/PropertyNameCell.js.map +0 -1
- package/lib/esm/widget/components/PropertyTable.js +0 -27
- package/lib/esm/widget/components/PropertyTable.js.map +0 -1
- package/lib/esm/widget/components/PropertyTableToolbar.js.map +0 -1
- package/lib/esm/widget/components/QueryBuilder.js.map +0 -1
- package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +0 -1
- package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +0 -13
- package/lib/esm/widget/components/QueryBuilderCustomUI.js +0 -21
- package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +0 -1
- package/lib/esm/widget/components/QueryBuilderStep.js.map +0 -1
- package/lib/esm/widget/components/SaveModal.js.map +0 -1
- package/lib/esm/widget/components/SelectIModel.js +0 -81
- package/lib/esm/widget/components/SelectIModel.js.map +0 -1
- package/lib/esm/widget/components/SelectITwin.js +0 -94
- package/lib/esm/widget/components/SelectITwin.js.map +0 -1
- package/lib/esm/widget/components/SelectMappings.d.ts +0 -16
- package/lib/esm/widget/components/SelectMappings.js +0 -67
- package/lib/esm/widget/components/SelectMappings.js.map +0 -1
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.js.map +0 -1
- package/lib/esm/widget/components/SortableHorizontalTile.d.ts +0 -8
- package/lib/esm/widget/components/SortableHorizontalTile.js +0 -31
- package/lib/esm/widget/components/SortableHorizontalTile.js.map +0 -1
- package/lib/esm/widget/components/StatusIcon.js.map +0 -1
- package/lib/esm/widget/components/ToggleGroupVisibility.js.map +0 -1
- package/lib/esm/widget/components/WidgetHeader.js.map +0 -1
- package/lib/esm/widget/components/context/ExtractionClientContext.js.map +0 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +0 -22
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +0 -24
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +0 -1
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js.map +0 -1
- package/lib/esm/widget/components/context/GroupingMappingCustomUIContext.js.map +0 -1
- package/lib/esm/widget/components/context/IModelsClientContext.js.map +0 -1
- package/lib/esm/widget/components/context/ITwinsClientContext.js.map +0 -1
- package/lib/esm/widget/components/context/MappingClientContext.js.map +0 -1
- package/lib/esm/widget/components/context/PropertiesContext.js.map +0 -1
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +0 -13
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +0 -1
- package/lib/esm/widget/components/customUI/DefaultGroupingUI.js.map +0 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +0 -84
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +0 -1
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +0 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +0 -25
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +0 -1
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +0 -91
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +0 -1
- package/lib/esm/widget/components/groupsHelpers.d.ts +0 -10
- package/lib/esm/widget/components/groupsHelpers.js +0 -75
- package/lib/esm/widget/components/groupsHelpers.js.map +0 -1
- package/lib/esm/widget/components/hooks/useGroupsOperations.d.ts +0 -20
- package/lib/esm/widget/components/hooks/useGroupsOperations.js +0 -63
- package/lib/esm/widget/components/hooks/useGroupsOperations.js.map +0 -1
- package/lib/esm/widget/components/hooks/useMappingsOperations.d.ts +0 -35
- package/lib/esm/widget/components/hooks/useMappingsOperations.js +0 -116
- package/lib/esm/widget/components/hooks/useMappingsOperations.js.map +0 -1
- package/lib/esm/widget/components/utils.d.ts +0 -16
- package/lib/esm/widget/components/utils.js +0 -85
- package/lib/esm/widget/components/utils.js.map +0 -1
- package/lib/esm/widget/components/utils.scss +0 -18
- package/lib/esm/widget/components/viewerUtils.d.ts +0 -30
- package/lib/esm/widget/components/viewerUtils.js +0 -268
- package/lib/esm/widget/components/viewerUtils.js.map +0 -1
- package/lib/esm/widget/hooks/useFetchData.js +0 -37
- package/lib/esm/widget/hooks/useFetchData.js.map +0 -1
- package/lib/esm/widget/hooks/useFormulaValidation.d.ts +0 -6
- package/lib/esm/widget/hooks/useFormulaValidation.js +0 -25
- package/lib/esm/widget/hooks/useFormulaValidation.js.map +0 -1
- package/lib/esm/widget/hooks/useValidator.js.map +0 -1
- package/lib/esm/widget/hooks/useVisualization.js +0 -64
- package/lib/esm/widget/hooks/useVisualization.js.map +0 -1
- package/lib/esm/widget/utils.d.ts +0 -5
- package/lib/esm/widget/utils.js +0 -8
- package/lib/esm/widget/utils.js.map +0 -1
- /package/lib/cjs/{widget/components → WidgetShell}/GroupingMapping.scss +0 -0
- /package/lib/cjs/{widget/components → WidgetShell}/GroupingMappingContent.d.ts +0 -0
- /package/lib/cjs/{widget/components → WidgetShell}/GroupingMappingHeader.d.ts +0 -0
- /package/lib/cjs/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.d.ts +0 -0
- /package/lib/cjs/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.js +0 -0
- /package/lib/cjs/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupAction.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetails.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetailsActionPanel.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetailsActionPanel.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetailsStep.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetailsStep.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups/Editing}/GroupDetailsStep.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupColorLegend.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupColorLegend.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupColorLegend.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupMenuActions.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsAddButton.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsAddButton.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsShowHideButtons.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsVisualization.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsVisualizationActions.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/GroupsVisualizationActions.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilder.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilder.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilderActionPanel.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilderActionPanel.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.scss +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/ToggleGroupVisibility.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/ToggleGroupVisibility.js +0 -0
- /package/lib/cjs/{widget/components → components/Groups}/ToggleGroupVisibility.scss +0 -0
- /package/lib/cjs/{widget → components/Groups}/hooks/useVisualization.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/BlockingOverlay.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/BlockingOverlay.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/ConfirmMappingsImport.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/ConfirmMappingsImport.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Editing}/MappingAction.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Editing}/MappingAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Extraction}/ExtractionLogCustomFilter.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Extraction}/ExtractionMessageModal.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Extraction}/ExtractionStatusIcon.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Extraction}/ExtractionStatusIcon.js +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/MappingImportWizardModal.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/MappingImportWizardModal.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/SelectIModel.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/SelectIModel.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/SelectITwin.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/SelectITwin.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings/Import}/SelectMapping.scss +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/MappingViewActionGroup.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/MappingViewActionGroup.js +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/MappingsView.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Mappings}/MappingsView.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyAction.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyActionWithVisuals.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyActionWithVisuals.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyTable.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyTable.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/SharedCalculatedPropertyForms.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CalculatedProperties}/SharedCalculatedPropertyForms.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CustomCalculations}/CustomCalculationAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/CustomCalculations}/CustomCalculationTable.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/GroupColorToggle.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/GroupInformationPanel.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/GroupInformationPanel.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/GroupInformationPanel.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/GroupPropertyAction.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/GroupPropertyAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/GroupPropertyTable.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/GroupPropertyUtils.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/GroupPropertyUtils.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/SaveModal.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties/GroupProperties}/SaveModal.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyAction.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyAction.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyMenu.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyMenu.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyMenuWithVisualization.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyMenuWithVisualization.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyMenuWithVisualization.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyNameCell.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyNameCell.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyTable.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyTable.scss +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyTableToolbar.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyTableToolbar.js +0 -0
- /package/lib/cjs/{widget/components → components/Properties}/PropertyTableToolbar.scss +0 -0
- /package/lib/cjs/{widget → components/Properties}/hooks/useFetchData.d.ts +0 -0
- /package/lib/cjs/{widget → components/Properties}/hooks/useValidator.d.ts +0 -0
- /package/lib/cjs/{widget → components/Properties}/hooks/useValidator.js +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/ActionPanel.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/ActionPanel.scss +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/DeleteModal.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/DeleteModal.scss +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/StatusIcon.d.ts +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/StatusIcon.js +0 -0
- /package/lib/cjs/{widget/components → components/SharedComponents}/StatusIcon.scss +0 -0
- /package/lib/cjs/{widget/components → components}/context/ExtractionClientContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/ExtractionClientContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/GroupingApiConfigContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/GroupingApiConfigContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/GroupingMappingCustomUIContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/GroupingMappingCustomUIContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/IModelsClientContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/IModelsClientContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/ITwinsClientContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/ITwinsClientContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/MappingClientContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/MappingClientContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/PropertiesContext.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/context/PropertiesContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/context/PropertyGridWrapperContext.js +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/DefaultGroupingUI.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/DefaultGroupingUI.js +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/GroupQueryBuilderCustomUI.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/GroupQueryBuilderCustomUI.scss +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/GroupingMappingCustomUI.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/GroupingMappingCustomUI.js +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/ManualGroupingCustomUI.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/ManualGroupingCustomUI.scss +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/SearchGroupingCustomUI.d.ts +0 -0
- /package/lib/cjs/{widget/components → components}/customUI/SearchGroupingCustomUI.scss +0 -0
- /package/lib/esm/{widget/components → WidgetShell}/GroupingMapping.scss +0 -0
- /package/lib/esm/{widget/components → WidgetShell}/GroupingMappingContent.d.ts +0 -0
- /package/lib/esm/{widget/components → WidgetShell}/GroupingMappingHeader.d.ts +0 -0
- /package/lib/esm/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.d.ts +0 -0
- /package/lib/esm/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.js +0 -0
- /package/lib/esm/{widget/components → WidgetShell/WidgetHeader}/WidgetHeader.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupAction.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetails.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetailsActionPanel.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetailsActionPanel.js +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetailsStep.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetailsStep.js +0 -0
- /package/lib/esm/{widget/components → components/Groups/Editing}/GroupDetailsStep.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupColorLegend.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupColorLegend.js +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupColorLegend.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupMenuActions.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsAddButton.js +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsAddButton.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsShowHideButtons.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsVisualization.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsVisualizationActions.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups}/GroupsVisualizationActions.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilder.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilder.js +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilderActionPanel.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilderActionPanel.js +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.js +0 -0
- /package/lib/esm/{widget/components → components/Groups/QueryBuilder}/QueryBuilderStep.scss +0 -0
- /package/lib/esm/{widget/components → components/Groups}/ToggleGroupVisibility.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Groups}/ToggleGroupVisibility.js +0 -0
- /package/lib/esm/{widget/components → components/Groups}/ToggleGroupVisibility.scss +0 -0
- /package/lib/esm/{widget → components/Groups}/hooks/useVisualization.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/BlockingOverlay.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/BlockingOverlay.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/ConfirmMappingsImport.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/ConfirmMappingsImport.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Editing}/MappingAction.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Editing}/MappingAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Extraction}/ExtractionLogCustomFilter.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Extraction}/ExtractionMessageModal.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Extraction}/ExtractionStatusIcon.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Extraction}/ExtractionStatusIcon.js +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/MappingImportWizardModal.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/MappingImportWizardModal.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/SelectIModel.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/SelectIModel.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/SelectITwin.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/SelectITwin.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings/Import}/SelectMapping.scss +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/MappingViewActionGroup.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/MappingViewActionGroup.js +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/MappingsView.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Mappings}/MappingsView.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyAction.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyActionWithVisuals.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyActionWithVisuals.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyTable.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/CalculatedPropertyTable.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/SharedCalculatedPropertyForms.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/CalculatedProperties}/SharedCalculatedPropertyForms.js +0 -0
- /package/lib/esm/{widget/components → components/Properties/CustomCalculations}/CustomCalculationAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/CustomCalculations}/CustomCalculationTable.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/GroupColorToggle.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/GroupInformationPanel.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/GroupInformationPanel.js +0 -0
- /package/lib/esm/{widget/components → components/Properties}/GroupInformationPanel.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/GroupPropertyAction.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/GroupPropertyAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/GroupPropertyTable.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/GroupPropertyUtils.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/GroupPropertyUtils.js +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/SaveModal.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties/GroupProperties}/SaveModal.js +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyAction.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyAction.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyMenu.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyMenu.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyMenuWithVisualization.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyMenuWithVisualization.js +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyMenuWithVisualization.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyNameCell.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyNameCell.js +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyTable.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyTable.scss +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyTableToolbar.d.ts +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyTableToolbar.js +0 -0
- /package/lib/esm/{widget/components → components/Properties}/PropertyTableToolbar.scss +0 -0
- /package/lib/esm/{widget → components/Properties}/hooks/useFetchData.d.ts +0 -0
- /package/lib/esm/{widget → components/Properties}/hooks/useValidator.d.ts +0 -0
- /package/lib/esm/{widget → components/Properties}/hooks/useValidator.js +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/ActionPanel.d.ts +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/ActionPanel.scss +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/DeleteModal.d.ts +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/DeleteModal.scss +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/StatusIcon.d.ts +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/StatusIcon.js +0 -0
- /package/lib/esm/{widget/components → components/SharedComponents}/StatusIcon.scss +0 -0
- /package/lib/esm/{widget/components → components}/context/ExtractionClientContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/ExtractionClientContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/GroupingApiConfigContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/GroupingApiConfigContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/GroupingMappingCustomUIContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/GroupingMappingCustomUIContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/IModelsClientContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/IModelsClientContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/ITwinsClientContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/ITwinsClientContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/MappingClientContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/MappingClientContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/PropertiesContext.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/context/PropertiesContext.js +0 -0
- /package/lib/esm/{widget/components → components}/context/PropertyGridWrapperContext.js +0 -0
- /package/lib/esm/{widget/components → components}/customUI/DefaultGroupingUI.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/customUI/DefaultGroupingUI.js +0 -0
- /package/lib/esm/{widget/components → components}/customUI/GroupQueryBuilderCustomUI.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/customUI/GroupQueryBuilderCustomUI.scss +0 -0
- /package/lib/esm/{widget/components → components}/customUI/GroupingMappingCustomUI.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/customUI/GroupingMappingCustomUI.js +0 -0
- /package/lib/esm/{widget/components → components}/customUI/ManualGroupingCustomUI.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/customUI/ManualGroupingCustomUI.scss +0 -0
- /package/lib/esm/{widget/components → components}/customUI/SearchGroupingCustomUI.d.ts +0 -0
- /package/lib/esm/{widget/components → components}/customUI/SearchGroupingCustomUI.scss +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
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 { FeatureOverrideType } from "@itwin/core-common";
|
|
6
|
+
import { toaster } from "@itwin/itwinui-react";
|
|
7
|
+
import { KeySet } from "@itwin/presentation-common";
|
|
8
|
+
import { clearEmphasizedOverriddenElements, clearHiddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from "../../common/viewerUtils";
|
|
9
|
+
const GOLDEN_ANGLE_MULTIPLIER = 1.5; // Multiplier to spread colors more uniformly.
|
|
10
|
+
const BASE_HUE_OFFSET = 60; // Initial hue offset to avoid certain colors e.g 0 offset would begin with red.
|
|
11
|
+
const HUE_ADJUSTMENT_STEP = 15; // Step to adjust the hue to avoid the red spectrum.
|
|
12
|
+
const RED_HUE_LOWER_BOUND = 330; // Lower bound of the red hue spectrum to avoid.
|
|
13
|
+
const RED_HUE_UPPER_BOUND = 30; // Upper bound of the red hue spectrum to avoid.
|
|
14
|
+
const GOLDENANGLE = 180 * (3 - Math.sqrt(5));
|
|
15
|
+
const generateHSL = (hue, saturation = 100, lightness = 50) => {
|
|
16
|
+
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
|
17
|
+
};
|
|
18
|
+
export const getGroupColor = (index) => {
|
|
19
|
+
let hue = (index * GOLDENANGLE * GOLDEN_ANGLE_MULTIPLIER + BASE_HUE_OFFSET) % 360;
|
|
20
|
+
while (hue >= RED_HUE_LOWER_BOUND || hue <= RED_HUE_UPPER_BOUND) {
|
|
21
|
+
hue = (hue + HUE_ADJUSTMENT_STEP) % 360;
|
|
22
|
+
}
|
|
23
|
+
return generateHSL(hue);
|
|
24
|
+
};
|
|
25
|
+
export const getHiliteIdsFromGroups = async (iModelConnection, groups, hilitedElementsQueryCache) => {
|
|
26
|
+
const distinctQueries = new Set();
|
|
27
|
+
const promises = [];
|
|
28
|
+
for (const group of groups) {
|
|
29
|
+
if (!distinctQueries.has(group.query)) {
|
|
30
|
+
distinctQueries.add(group.query);
|
|
31
|
+
promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const results = await Promise.all(promises);
|
|
35
|
+
const allIds = results.flatMap((result) => result.ids);
|
|
36
|
+
return allIds;
|
|
37
|
+
};
|
|
38
|
+
export const hideGroups = async (iModelConnection, viewGroups, hilitedElementsQueryCache) => {
|
|
39
|
+
const distinctQueries = new Set();
|
|
40
|
+
const promises = [];
|
|
41
|
+
for (const viewGroup of viewGroups) {
|
|
42
|
+
if (!distinctQueries.has(viewGroup.query)) {
|
|
43
|
+
distinctQueries.add(viewGroup.query);
|
|
44
|
+
promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await Promise.all(promises);
|
|
48
|
+
};
|
|
49
|
+
export const hideGroup = async (iModelConnection, viewGroup, hilitedElementsQueryCache) => {
|
|
50
|
+
const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);
|
|
51
|
+
hideElements(result.ids);
|
|
52
|
+
};
|
|
53
|
+
const processGroupVisualization = async (overlappedElementGroupPairs, hiddenGroupsIds, doEmphasizeElements, color, replace, setNumberOfVisualizedGroups) => {
|
|
54
|
+
const hilitedIds = Array.from(overlappedElementGroupPairs.elementIds);
|
|
55
|
+
overrideElements(hilitedIds, color, FeatureOverrideType.ColorAndAlpha, replace);
|
|
56
|
+
setNumberOfVisualizedGroups((numberOfVisualizedGroups) => numberOfVisualizedGroups + 1);
|
|
57
|
+
doEmphasizeElements && emphasizeElements(hilitedIds, undefined);
|
|
58
|
+
for (const id of overlappedElementGroupPairs.groupIds) {
|
|
59
|
+
if (hiddenGroupsIds.has(id)) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return hilitedIds;
|
|
64
|
+
};
|
|
65
|
+
export const visualizeGroupColors = async (iModelConnection, groups, hiddenGroupsIds, hilitedElementsQueryCache, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs, doEmphasizeElements = true) => {
|
|
66
|
+
clearEmphasizedOverriddenElements();
|
|
67
|
+
const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = await generateOverlappedGroups(groups, iModelConnection, hilitedElementsQueryCache);
|
|
68
|
+
setOverlappedElementsInfo(overlappedElementsInfo);
|
|
69
|
+
setGroupElementsInfo(numberOfElementsInGroups);
|
|
70
|
+
setOverlappedElementGroupPairs(groupsWithGroupedOverlaps);
|
|
71
|
+
const singleGroupPromises = groupsWithGroupedOverlaps
|
|
72
|
+
.filter((group) => group.groupIds.size === 1)
|
|
73
|
+
.map(async (group, index) => processGroupVisualization(group, hiddenGroupsIds, doEmphasizeElements, getGroupColor(index), // color for single group
|
|
74
|
+
false, // Shouldn't matter as replacement only accounts for same colored overrides.
|
|
75
|
+
setNumberOfVisualizedGroups));
|
|
76
|
+
const overlappedGroupPromises = groupsWithGroupedOverlaps
|
|
77
|
+
.filter((group) => group.groupIds.size !== 1)
|
|
78
|
+
.map(async (group) => processGroupVisualization(group, hiddenGroupsIds, doEmphasizeElements, generateHSL(0), // color for group of overlapped elements
|
|
79
|
+
false, setNumberOfVisualizedGroups));
|
|
80
|
+
clearHiddenElements();
|
|
81
|
+
hiddenGroupsIds.forEach(async (groupId) => {
|
|
82
|
+
await hideGroupConsideringOverlaps(groupsWithGroupedOverlaps, groupId, hiddenGroupsIds);
|
|
83
|
+
});
|
|
84
|
+
const allPromises = [...singleGroupPromises, ...overlappedGroupPromises];
|
|
85
|
+
const allIds = (await Promise.all(allPromises)).flat();
|
|
86
|
+
await zoomToElements(allIds);
|
|
87
|
+
};
|
|
88
|
+
export const getHiliteIdsAndKeysetFromGroup = async (iModelConnection, group, hilitedElementsQueryCache) => {
|
|
89
|
+
const query = group.query;
|
|
90
|
+
if (hilitedElementsQueryCache.current.has(query)) {
|
|
91
|
+
return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const queryRowCount = await iModelConnection.queryRowCount(query);
|
|
95
|
+
if (queryRowCount === 0) {
|
|
96
|
+
toaster.warning(`${group.groupName}'s query is valid but produced no results.`);
|
|
97
|
+
}
|
|
98
|
+
const result = await getHiliteIds(query, iModelConnection);
|
|
99
|
+
hilitedElementsQueryCache.current.set(query, result);
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
toaster.negative(`Query could not be resolved.`);
|
|
104
|
+
return ({ keySet: new KeySet(), ids: [] });
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const getHiliteIdsForGroup = async (iModelConnection, group, hilitedElementsQueryCache) => {
|
|
108
|
+
const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
|
|
109
|
+
const hilitedIds = result.ids;
|
|
110
|
+
return hilitedIds;
|
|
111
|
+
};
|
|
112
|
+
const getOverlappedElementsInfo = (overlappedElements) => {
|
|
113
|
+
const overlappedElementsInfo = new Map();
|
|
114
|
+
overlappedElements.forEach((elementGroup) => {
|
|
115
|
+
const { elementIds, groupIds } = elementGroup;
|
|
116
|
+
groupIds.forEach((group) => {
|
|
117
|
+
const otherGroups = Array.from(groupIds).filter((grp) => grp !== group);
|
|
118
|
+
const overlappedInfoArray = overlappedElementsInfo.get(group) ?? [];
|
|
119
|
+
overlappedInfoArray.push({ groupIds: otherGroups, elements: Array.from(elementIds) });
|
|
120
|
+
overlappedElementsInfo.set(group, overlappedInfoArray);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
return overlappedElementsInfo;
|
|
124
|
+
};
|
|
125
|
+
const mergeElementsByGroup = (elems) => {
|
|
126
|
+
const mergedList = new Map();
|
|
127
|
+
elems.forEach((groupIds, elementId) => {
|
|
128
|
+
const sortedGroups = Array.from(groupIds).sort();
|
|
129
|
+
const key = sortedGroups.join("-");
|
|
130
|
+
const overlap = mergedList.get(key);
|
|
131
|
+
if (overlap) {
|
|
132
|
+
overlap.elementIds.add(elementId);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
mergedList.set(key, { elementIds: new Set([elementId]), groupIds });
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return mergedList;
|
|
139
|
+
};
|
|
140
|
+
const generateOverlappedGroups = async (groups, iModelConnection, hilitedElementsQueryCache) => {
|
|
141
|
+
const groupsElementIds = await Promise.all(groups.map(async (group) => ({
|
|
142
|
+
groupId: group.id,
|
|
143
|
+
elementIds: await getHiliteIdsForGroup(iModelConnection, group, hilitedElementsQueryCache),
|
|
144
|
+
})));
|
|
145
|
+
const elems = new Map();
|
|
146
|
+
const groupElementCount = new Map();
|
|
147
|
+
// Build the elems map for associations between elements and their groups.
|
|
148
|
+
for (const groupInfo of groupsElementIds) {
|
|
149
|
+
for (const elem of groupInfo.elementIds) {
|
|
150
|
+
const elemGroups = elems.get(elem) || new Set();
|
|
151
|
+
elemGroups.add(groupInfo.groupId);
|
|
152
|
+
elems.set(elem, elemGroups);
|
|
153
|
+
}
|
|
154
|
+
groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);
|
|
155
|
+
}
|
|
156
|
+
// Construct the unique list of all groups and their overlapped groups combinations
|
|
157
|
+
const allGroups = groupsElementIds.map((groupInfo) => {
|
|
158
|
+
const nonOverlappingElements = Array.from(new Set(groupInfo.elementIds)).filter((elem) => elems.get(elem).size === 1);
|
|
159
|
+
groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);
|
|
160
|
+
return { elementIds: new Set(nonOverlappingElements), groupIds: new Set([groupInfo.groupId]) };
|
|
161
|
+
});
|
|
162
|
+
const mergedList = mergeElementsByGroup(elems);
|
|
163
|
+
const overlappedGroupsInformation = Array.from(mergedList.values()).filter((value) => value.groupIds.size > 1);
|
|
164
|
+
return { groupsWithGroupedOverlaps: [...allGroups, ...overlappedGroupsInformation], overlappedElementsInfo: getOverlappedElementsInfo(overlappedGroupsInformation), numberOfElementsInGroups: groupElementCount };
|
|
165
|
+
};
|
|
166
|
+
export const hideGroupConsideringOverlaps = async (overlappedElementGroupPairs, groupIdToHide, hiddenGroupsIds) => {
|
|
167
|
+
const elementsToPotentiallyHide = new Set();
|
|
168
|
+
// Check each entry in overlappedElementGroupPairs
|
|
169
|
+
for (const entry of overlappedElementGroupPairs) {
|
|
170
|
+
// If the groupToHide is part of this entry
|
|
171
|
+
if (entry.groupIds.has(groupIdToHide)) {
|
|
172
|
+
// If this is a unique entry (no overlaps for this group), add all its elements to hide list
|
|
173
|
+
if (entry.groupIds.size === 1) {
|
|
174
|
+
for (const elem of entry.elementIds) {
|
|
175
|
+
elementsToPotentiallyHide.add(elem);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// If there are overlaps, only hide if all overlapping groups are hidden
|
|
180
|
+
const allOtherGroupsHidden = Array.from(entry.groupIds).every((groupId) => groupId === groupIdToHide || hiddenGroupsIds.has(groupId));
|
|
181
|
+
if (allOtherGroupsHidden) {
|
|
182
|
+
for (const elem of entry.elementIds) {
|
|
183
|
+
elementsToPotentiallyHide.add(elem);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Now hide all elements in elementsToPotentiallyHide
|
|
190
|
+
hideElements(Array.from(elementsToPotentiallyHide));
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=groupsHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/components/Groups/groupsHelpers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEnL,MAAM,uBAAuB,GAAG,GAAG,CAAC,CAAE,8CAA8C;AACpF,MAAM,eAAe,GAAG,EAAE,CAAC,CAAW,gFAAgF;AACtH,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAO,oDAAoD;AAC1F,MAAM,mBAAmB,GAAG,GAAG,CAAC,CAAM,gDAAgD;AACtF,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAO,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yB,CAAC,CAAC,CAAC;AACtD,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Group } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport type { OverlappedElementGroupPairs, OverlappedInfo, QueryCacheItem } from \"../context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, clearHiddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from \"../../common/viewerUtils\";\n\nconst GOLDEN_ANGLE_MULTIPLIER = 1.5; // Multiplier to spread colors more uniformly.\nconst BASE_HUE_OFFSET = 60; // Initial hue offset to avoid certain colors e.g 0 offset would begin with red.\nconst HUE_ADJUSTMENT_STEP = 15; // Step to adjust the hue to avoid the red spectrum.\nconst RED_HUE_LOWER_BOUND = 330; // Lower bound of the red hue spectrum to avoid.\nconst RED_HUE_UPPER_BOUND = 30; // Upper bound of the red hue spectrum to avoid.\nconst GOLDENANGLE = 180 * (3 - Math.sqrt(5));\n\nconst generateHSL = (hue: number, saturation: number = 100, lightness: number = 50) => {\n return `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n};\n\nexport const getGroupColor = (index: number) => {\n let hue = (index * GOLDENANGLE * GOLDEN_ANGLE_MULTIPLIER + BASE_HUE_OFFSET) % 360;\n\n while (hue >= RED_HUE_LOWER_BOUND || hue <= RED_HUE_UPPER_BOUND) {\n hue = (hue + HUE_ADJUSTMENT_STEP) % 360;\n }\n\n return generateHSL(hue);\n};\n\nexport const getHiliteIdsFromGroups = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<{ ids: string[] }>[] = [];\n for (const group of groups) {\n if (!distinctQueries.has(group.query)) {\n distinctQueries.add(group.query);\n promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));\n }\n }\n const results = await Promise.all(promises);\n const allIds = results.flatMap((result) => result.ids);\n return allIds;\n};\n\nexport const hideGroups = async (\n iModelConnection: IModelConnection,\n viewGroups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<void>[] = [];\n\n for (const viewGroup of viewGroups) {\n if (!distinctQueries.has(viewGroup.query)) {\n distinctQueries.add(viewGroup.query);\n promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));\n }\n }\n await Promise.all(promises);\n};\n\nexport const hideGroup = async (\n iModelConnection: IModelConnection,\n viewGroup: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);\n hideElements(result.ids);\n};\n\nconst processGroupVisualization = async (\n overlappedElementGroupPairs: OverlappedElementGroupPairs,\n hiddenGroupsIds: Set<string>,\n doEmphasizeElements: boolean,\n color: string,\n replace: boolean,\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n) => {\n const hilitedIds = Array.from(overlappedElementGroupPairs.elementIds);\n\n overrideElements(hilitedIds, color, FeatureOverrideType.ColorAndAlpha, replace);\n setNumberOfVisualizedGroups((numberOfVisualizedGroups) => numberOfVisualizedGroups + 1);\n\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n\n for (const id of overlappedElementGroupPairs.groupIds) {\n if (hiddenGroupsIds.has(id)) {\n return [];\n }\n }\n return hilitedIds;\n};\n\nexport const visualizeGroupColors = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hiddenGroupsIds: Set<string>,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n setOverlappedElementsInfo: (overlappedElementsInfo: Map<string, OverlappedInfo[]> | ((overlappedElementsInfo: Map<string, OverlappedInfo[]>) => Map<string, OverlappedInfo[]>)) => void,\n setGroupElementsInfo: (groupElementsInfo: Map<string, number> | ((groupElementsInfo: Map<string, number>) => Map<string, number>)) => void,\n setOverlappedElementGroupPairs: (overlappedElementGroupPairs: OverlappedElementGroupPairs[]) => void,\n doEmphasizeElements: boolean = true,\n) => {\n clearEmphasizedOverriddenElements();\n\n const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = await generateOverlappedGroups(groups, iModelConnection, hilitedElementsQueryCache);\n setOverlappedElementsInfo(overlappedElementsInfo);\n setGroupElementsInfo(numberOfElementsInGroups);\n setOverlappedElementGroupPairs(groupsWithGroupedOverlaps);\n\n const singleGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size === 1)\n .map(async (group, index) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n getGroupColor(index), // color for single group\n false, // Shouldn't matter as replacement only accounts for same colored overrides.\n setNumberOfVisualizedGroups,\n )\n );\n\n const overlappedGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size !== 1)\n .map(async (group) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n generateHSL(0), // color for group of overlapped elements\n false,\n setNumberOfVisualizedGroups,\n )\n );\n\n clearHiddenElements();\n\n hiddenGroupsIds.forEach(async (groupId) => {\n await hideGroupConsideringOverlaps(groupsWithGroupedOverlaps, groupId, hiddenGroupsIds);\n });\n\n const allPromises = [...singleGroupPromises, ...overlappedGroupPromises];\n\n const allIds = (await Promise.all(allPromises)).flat();\n\n await zoomToElements(allIds);\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const query = group.query;\n if (hilitedElementsQueryCache.current.has(query)) {\n return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });\n }\n try {\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\n `${group.groupName}'s query is valid but produced no results.`\n );\n }\n const result = await getHiliteIds(query, iModelConnection);\n hilitedElementsQueryCache.current.set(query, result);\n return result;\n } catch {\n toaster.negative(\n `Query could not be resolved.`\n );\n return ({ keySet: new KeySet(), ids: [] });\n }\n\n};\n\nconst getHiliteIdsForGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n const hilitedIds = result.ids;\n return hilitedIds;\n};\n\nconst getOverlappedElementsInfo = (overlappedElements: OverlappedElementGroupPairs[]) => {\n const overlappedElementsInfo: Map<string, OverlappedInfo[]> = new Map();\n\n overlappedElements.forEach((elementGroup) => {\n const { elementIds, groupIds } = elementGroup;\n\n groupIds.forEach((group) => {\n const otherGroups = Array.from(groupIds).filter((grp) => grp !== group);\n const overlappedInfoArray = overlappedElementsInfo.get(group) ?? [];\n overlappedInfoArray.push({ groupIds: otherGroups, elements: Array.from(elementIds) });\n overlappedElementsInfo.set(group, overlappedInfoArray);\n });\n });\n return overlappedElementsInfo;\n};\n\nconst mergeElementsByGroup = (elems: Map<string, Set<string>>) => {\n const mergedList: Map<string, OverlappedElementGroupPairs> = new Map();\n elems.forEach((groupIds, elementId) => {\n const sortedGroups = Array.from(groupIds).sort();\n const key = sortedGroups.join(\"-\");\n const overlap = mergedList.get(key);\n if (overlap) {\n overlap.elementIds.add(elementId);\n } else {\n mergedList.set(key, { elementIds: new Set([elementId]), groupIds });\n }\n });\n return mergedList;\n};\n\nconst generateOverlappedGroups = async (\n groups: Group[],\n iModelConnection: IModelConnection,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n) => {\n const groupsElementIds: { groupId: string, elementIds: string[] }[] = await Promise.all(groups.map(async (group) => ({\n groupId: group.id,\n elementIds: await getHiliteIdsForGroup(iModelConnection, group, hilitedElementsQueryCache),\n })));\n\n const elems: Map<string, Set<string>> = new Map();\n const groupElementCount: Map<string, number> = new Map();\n\n // Build the elems map for associations between elements and their groups.\n for (const groupInfo of groupsElementIds) {\n for (const elem of groupInfo.elementIds) {\n const elemGroups = elems.get(elem) || new Set<string>();\n elemGroups.add(groupInfo.groupId);\n elems.set(elem, elemGroups);\n }\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n }\n\n // Construct the unique list of all groups and their overlapped groups combinations\n const allGroups: OverlappedElementGroupPairs[] = groupsElementIds.map((groupInfo) => {\n const nonOverlappingElements = Array.from(new Set(groupInfo.elementIds)).filter((elem) => elems.get(elem)!.size === 1);\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n return { elementIds: new Set(nonOverlappingElements), groupIds: new Set([groupInfo.groupId]) };\n });\n\n const mergedList = mergeElementsByGroup(elems);\n const overlappedGroupsInformation: OverlappedElementGroupPairs[] = Array.from(mergedList.values()).filter((value) => value.groupIds.size > 1);\n\n return { groupsWithGroupedOverlaps: [...allGroups, ...overlappedGroupsInformation], overlappedElementsInfo: getOverlappedElementsInfo(overlappedGroupsInformation), numberOfElementsInGroups: groupElementCount };\n};\n\nexport const hideGroupConsideringOverlaps = async (\n overlappedElementGroupPairs: OverlappedElementGroupPairs[],\n groupIdToHide: string,\n hiddenGroupsIds: Set<string>\n) => {\n const elementsToPotentiallyHide = new Set<string>();\n\n // Check each entry in overlappedElementGroupPairs\n for (const entry of overlappedElementGroupPairs) {\n // If the groupToHide is part of this entry\n if (entry.groupIds.has(groupIdToHide)) {\n // If this is a unique entry (no overlaps for this group), add all its elements to hide list\n if (entry.groupIds.size === 1) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n } else {\n // If there are overlaps, only hide if all overlapping groups are hidden\n const allOtherGroupsHidden = Array.from(entry.groupIds).every(\n (groupId) =>\n groupId === groupIdToHide || hiddenGroupsIds.has(groupId)\n );\n if (allOtherGroupsHidden) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n }\n }\n }\n }\n\n // Now hide all elements in elementsToPotentiallyHide\n hideElements(Array.from(elementsToPotentiallyHide));\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Group } from "@itwin/insights-client";
|
|
3
|
+
import type { ContextCustomUI, GroupingCustomUI } from "../../customUI/GroupingMappingCustomUI";
|
|
4
|
+
export interface GroupsOperationsProps {
|
|
5
|
+
mappingId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useGroupsOperations: ({ mappingId, }: GroupsOperationsProps) => {
|
|
8
|
+
groups: Group[];
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
refresh: () => Promise<void>;
|
|
11
|
+
onDeleteGroup: (group: Group) => Promise<void>;
|
|
12
|
+
setShowDeleteModal: import("react").Dispatch<import("react").SetStateAction<Group | undefined>>;
|
|
13
|
+
showDeleteModal: Group | undefined;
|
|
14
|
+
groupUIs: GroupingCustomUI[];
|
|
15
|
+
contextUIs: ContextCustomUI[];
|
|
16
|
+
errorMessage: string | undefined;
|
|
17
|
+
setErrorMessage: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
18
|
+
activeOverlapInfoPanelGroup: Group | undefined;
|
|
19
|
+
setActiveOverlapInfoPanelGroup: import("react").Dispatch<import("react").SetStateAction<Group | undefined>>;
|
|
20
|
+
overlappedElementsInfo: Map<string, import("../../context/GroupHilitedElementsContext").OverlappedInfo[]>;
|
|
21
|
+
hilitedGroupsProgress: {
|
|
22
|
+
currentHilitedGroups: number;
|
|
23
|
+
totalNumberOfGroups: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useGroupsOperations.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { useCallback, useEffect, useState } from "react";
|
|
6
|
+
import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
|
|
7
|
+
import { getErrorMessage } from "../../../common/utils";
|
|
8
|
+
import { GroupingMappingCustomUIType } from "../../customUI/GroupingMappingCustomUI";
|
|
9
|
+
import { useGroupingMappingCustomUI } from "../../context/GroupingMappingCustomUIContext";
|
|
10
|
+
import { useGroupHilitedElementsContext } from "../../context/GroupHilitedElementsContext";
|
|
11
|
+
import { useMappingClient } from "../../context/MappingClientContext";
|
|
12
|
+
const fetchGroups = async (setGroups, iModelId, mappingId, setIsLoading, getAccessToken, mappingsClient, setErrorMessage) => {
|
|
13
|
+
try {
|
|
14
|
+
setIsLoading(true);
|
|
15
|
+
const accessToken = await getAccessToken();
|
|
16
|
+
const groups = await mappingsClient.getGroups(accessToken, iModelId, mappingId);
|
|
17
|
+
setGroups(groups.sort((a, b) => a.groupName.localeCompare(b.groupName)));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
setErrorMessage(getErrorMessage(error.status));
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
setIsLoading(false);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export const useGroupsOperations = ({ mappingId, }) => {
|
|
27
|
+
const { getAccessToken, iModelId } = useGroupingMappingApiConfig();
|
|
28
|
+
const { groups, setGroups, currentHilitedGroups, overlappedElementsInfo, overlappedElementGroupPairs } = useGroupHilitedElementsContext();
|
|
29
|
+
const mappingClient = useMappingClient();
|
|
30
|
+
const groupUIs = useGroupingMappingCustomUI().customUIs.filter((p) => p.type === GroupingMappingCustomUIType.Grouping);
|
|
31
|
+
const contextUIs = useGroupingMappingCustomUI().customUIs.filter((p) => p.type === GroupingMappingCustomUIType.Context);
|
|
32
|
+
const [showDeleteModal, setShowDeleteModal] = useState(undefined);
|
|
33
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
34
|
+
const [errorMessage, setErrorMessage] = useState(undefined);
|
|
35
|
+
const [activeOverlapInfoPanelGroup, setActiveOverlapInfoPanelGroup] = useState(undefined);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const initialize = async () => {
|
|
38
|
+
await fetchGroups(setGroups, iModelId, mappingId, setIsLoading, getAccessToken, mappingClient, setErrorMessage);
|
|
39
|
+
};
|
|
40
|
+
void initialize();
|
|
41
|
+
}, [getAccessToken, mappingClient, iModelId, mappingId, setGroups]);
|
|
42
|
+
const refresh = useCallback(async () => {
|
|
43
|
+
await fetchGroups(setGroups, iModelId, mappingId, setIsLoading, getAccessToken, mappingClient, setErrorMessage);
|
|
44
|
+
}, [getAccessToken, mappingClient, iModelId, mappingId, setGroups]);
|
|
45
|
+
const onDeleteGroup = useCallback(async (group) => {
|
|
46
|
+
const accessToken = await getAccessToken();
|
|
47
|
+
await mappingClient.deleteGroup(accessToken, iModelId, mappingId, group.id);
|
|
48
|
+
await refresh();
|
|
49
|
+
}, [getAccessToken, iModelId, mappingClient, mappingId, refresh]);
|
|
50
|
+
return {
|
|
51
|
+
groups,
|
|
52
|
+
isLoading,
|
|
53
|
+
refresh,
|
|
54
|
+
onDeleteGroup,
|
|
55
|
+
setShowDeleteModal,
|
|
56
|
+
showDeleteModal,
|
|
57
|
+
groupUIs,
|
|
58
|
+
contextUIs,
|
|
59
|
+
errorMessage,
|
|
60
|
+
setErrorMessage,
|
|
61
|
+
activeOverlapInfoPanelGroup,
|
|
62
|
+
setActiveOverlapInfoPanelGroup,
|
|
63
|
+
overlappedElementsInfo,
|
|
64
|
+
hilitedGroupsProgress: { currentHilitedGroups, totalNumberOfGroups: overlappedElementGroupPairs.length },
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=useGroupsOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroupsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useGroupsOperations.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,MAAM,WAAW,GAAG,KAAK,EACvB,SAAoC,EACpC,QAAgB,EAChB,SAAiB,EACjB,YAA0C,EAC1C,cAAgC,EAChC,cAA+B,EAC/B,eAAsD,EACvC,EAAE;IACjB,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,SAAS,CAC3C,WAAW,EACX,QAAQ,EACR,SAAS,CACV,CAAC;QACF,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAC1E;IAAC,OAAO,KAAU,EAAE;QACnB,eA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b,eAAe,CAChB,CAAC;QACJ,CAAC,CAAC;QACF,KAAK,UAAU,EAAE,CAAC;IACpB,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,WAAW,CACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,CAChB,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpE,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,EAAE,KAAY,EAAE,EAAE;QACvD,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,MAAM,aAAa,CAAC,WAAW,CAC7B,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,CAAC,EAAE,CACT,CAAC;QACF,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAElE,OAAO;QACL,MAAM;QACN,SAAS;QACT,OAAO;QACP,aAAa;QACb,kBAAkB;QAClB,eAAe;QACf,QAAQ;QACR,UAAU;QACV,YAAY;QACZ,eAAe;QACf,2BAA2B;QAC3B,8BAA8B;QAC9B,sBAAsB;QACtB,qBAAqB,EAAE,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,2BAA2B,CAAC,MAAM,EAAE;KACzG,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { useCallback, useEffect, useState } from \"react\";\nimport type { Group, IMappingsClient } from \"@itwin/insights-client\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { getErrorMessage } from \"../../../common/utils\";\nimport type { ContextCustomUI, GroupingCustomUI } from \"../../customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../../customUI/GroupingMappingCustomUI\";\nimport { useGroupingMappingCustomUI } from \"../../context/GroupingMappingCustomUIContext\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\n\nconst fetchGroups = async (\n setGroups: (groups: Group[]) => void,\n iModelId: string,\n mappingId: string,\n setIsLoading: (isLoading: boolean) => void,\n getAccessToken: GetAccessTokenFn,\n mappingsClient: IMappingsClient,\n setErrorMessage: (message: string | undefined) => void\n): Promise<void> => {\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const groups = await mappingsClient.getGroups(\n accessToken,\n iModelId,\n mappingId\n );\n setGroups(groups.sort((a, b) => a.groupName.localeCompare(b.groupName)));\n } catch (error: any) {\n setErrorMessage(getErrorMessage(error.status));\n } finally {\n setIsLoading(false);\n }\n};\n\nexport interface GroupsOperationsProps {\n mappingId: string;\n}\n\nexport const useGroupsOperations = ({\n mappingId,\n}: GroupsOperationsProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const { groups, setGroups, currentHilitedGroups, overlappedElementsInfo, overlappedElementGroupPairs } = useGroupHilitedElementsContext();\n const mappingClient = useMappingClient();\n const groupUIs: GroupingCustomUI[] =\n useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Grouping\n ) as GroupingCustomUI[];\n const contextUIs: ContextCustomUI[] =\n useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Context\n ) as ContextCustomUI[];\n const [showDeleteModal, setShowDeleteModal] = useState<Group | undefined>(\n undefined\n );\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n const [activeOverlapInfoPanelGroup, setActiveOverlapInfoPanelGroup] = useState<Group | undefined>(undefined);\n\n useEffect(() => {\n const initialize = async () => {\n await fetchGroups(\n setGroups,\n iModelId,\n mappingId,\n setIsLoading,\n getAccessToken,\n mappingClient,\n setErrorMessage\n );\n };\n void initialize();\n }, [getAccessToken, mappingClient, iModelId, mappingId, setGroups]);\n\n const refresh = useCallback(async () => {\n await fetchGroups(\n setGroups,\n iModelId,\n mappingId,\n setIsLoading,\n getAccessToken,\n mappingClient,\n setErrorMessage\n );\n }, [getAccessToken, mappingClient, iModelId, mappingId, setGroups]);\n\n const onDeleteGroup = useCallback(async (group: Group) => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteGroup(\n accessToken,\n iModelId,\n mappingId,\n group.id\n );\n await refresh();\n }, [getAccessToken, iModelId, mappingClient, mappingId, refresh]);\n\n return {\n groups,\n isLoading,\n refresh,\n onDeleteGroup,\n setShowDeleteModal,\n showDeleteModal,\n groupUIs,\n contextUIs,\n errorMessage,\n setErrorMessage,\n activeOverlapInfoPanelGroup,\n setActiveOverlapInfoPanelGroup,\n overlappedElementsInfo,\n hilitedGroupsProgress: { currentHilitedGroups, totalNumberOfGroups: overlappedElementGroupPairs.length },\n };\n};\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { toaster } from "@itwin/itwinui-react";
|
|
2
|
+
import { Presentation } from "@itwin/presentation-frontend";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { useGroupHilitedElementsContext } from "../../context/GroupHilitedElementsContext";
|
|
5
|
+
import { visualizeGroupColors } from "../groupsHelpers";
|
|
6
|
+
import { clearEmphasizedElements, clearOverriddenElements, transparentOverriddenElements, visualizeElementsByQuery, zoomToElements } from "../../../common/viewerUtils";
|
|
7
|
+
export const useVisualization = (shouldVisualize, iModelConnection, query, queryGenerationType) => {
|
|
8
|
+
const [isRendering, setIsRendering] = useState(false);
|
|
9
|
+
const { showGroupColor, groups, hiddenGroupsIds, hilitedElementsQueryCache, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs } = useGroupHilitedElementsContext();
|
|
10
|
+
const [simpleSelectionQuery, setSimpleSelectionQuery] = useState("");
|
|
11
|
+
const resetView = useCallback(async () => {
|
|
12
|
+
if (!shouldVisualize)
|
|
13
|
+
return;
|
|
14
|
+
if (showGroupColor) {
|
|
15
|
+
await visualizeGroupColors(iModelConnection, groups, hiddenGroupsIds, hilitedElementsQueryCache, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
clearOverriddenElements();
|
|
19
|
+
}
|
|
20
|
+
clearEmphasizedElements();
|
|
21
|
+
}, [groups, hiddenGroupsIds, hilitedElementsQueryCache, iModelConnection, showGroupColor, shouldVisualize, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!shouldVisualize)
|
|
24
|
+
return;
|
|
25
|
+
const removeListener = Presentation.selection.selectionChange.addListener(async (evt, selectionProvider) => {
|
|
26
|
+
if (queryGenerationType === "Selection") {
|
|
27
|
+
const selection = selectionProvider.getSelection(evt.imodel, evt.level);
|
|
28
|
+
const query = selection.instanceKeys.size > 0
|
|
29
|
+
? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}`
|
|
30
|
+
: "";
|
|
31
|
+
setSimpleSelectionQuery(query);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return removeListener;
|
|
35
|
+
}, [iModelConnection, queryGenerationType, shouldVisualize]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!shouldVisualize)
|
|
38
|
+
return;
|
|
39
|
+
const reemphasize = async () => {
|
|
40
|
+
try {
|
|
41
|
+
if (!query || query === "") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setIsRendering(true);
|
|
45
|
+
transparentOverriddenElements();
|
|
46
|
+
const resolvedHiliteIds = await visualizeElementsByQuery(query, "red", iModelConnection);
|
|
47
|
+
await zoomToElements(resolvedHiliteIds);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
toaster.negative("Sorry, we have failed to generate a valid query. 😔");
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setIsRendering(false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
void reemphasize();
|
|
57
|
+
}, [iModelConnection, query, shouldVisualize]);
|
|
58
|
+
const clearPresentationSelection = useCallback(() => shouldVisualize && Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection), [iModelConnection, shouldVisualize]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
clearPresentationSelection();
|
|
61
|
+
}, [clearPresentationSelection, iModelConnection]);
|
|
62
|
+
return { isRendering, setIsRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView };
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=useVisualization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVisualization.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useVisualization.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,cAAc,EAAE,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AC;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,0BAA0B,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,SAAS,EAAE,CAAC;AAE/H,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { visualizeGroupColors } from \"../groupsHelpers\";\nimport { clearEmphasizedElements, clearOverriddenElements, transparentOverriddenElements, visualizeElementsByQuery, zoomToElements } from \"../../../common/viewerUtils\";\n\nexport const useVisualization = (shouldVisualize: boolean, iModelConnection: IModelConnection, query: string, queryGenerationType: string) => {\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const { showGroupColor, groups, hiddenGroupsIds, hilitedElementsQueryCache, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs } = useGroupHilitedElementsContext();\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n\n const resetView = useCallback(async () => {\n if (!shouldVisualize) return;\n if (showGroupColor) {\n await visualizeGroupColors(iModelConnection, groups, hiddenGroupsIds, hilitedElementsQueryCache, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs);\n } else {\n clearOverriddenElements();\n }\n clearEmphasizedElements();\n }, [groups, hiddenGroupsIds, hilitedElementsQueryCache, iModelConnection, showGroupColor, shouldVisualize, setNumberOfVisualizedGroups, setOverlappedElementsInfo, setGroupElementsInfo, setOverlappedElementGroupPairs]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const removeListener = Presentation.selection.selectionChange.addListener(\n async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n ) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(\n evt.imodel,\n evt.level,\n );\n const query = selection.instanceKeys.size > 0\n ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}`\n : \"\";\n setSimpleSelectionQuery(query);\n }\n },\n );\n return removeListener;\n }, [iModelConnection, queryGenerationType, shouldVisualize]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(\n query,\n \"red\",\n iModelConnection,\n );\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query. 😔\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, shouldVisualize]);\n\n const clearPresentationSelection = useCallback(() =>\n shouldVisualize && Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n ), [iModelConnection, shouldVisualize]);\n\n useEffect(() => {\n clearPresentationSelection();\n }, [clearPresentationSelection, iModelConnection]);\n\n return { isRendering, setIsRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView };\n\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 classnames from "classnames";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { LoadingSpinner } from "../SharedComponents/LoadingSpinner";
|
|
8
|
+
import "./BlockingOverlay.scss";
|
|
9
|
+
export const BlockingOverlay = ({ isVisible }) => {
|
|
10
|
+
return (React.createElement("div", { className: classnames("gmw-group-mapping-blocking-overlay", isVisible && "gmw-visible") },
|
|
11
|
+
React.createElement(LoadingSpinner, null)));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=BlockingOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockingOverlay.js","sourceRoot":"","sources":["../../../../src/components/Mappings/BlockingOverlay.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,wBAAwB,CAAC;AAMhC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAwB,EAAE,EAAE;IACrE,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,oCAAoC,EAAE,SAAS,IAAI,aAAa,CAAC;QAC1F,oBAAC,cAAc,OAAG,CACd,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./BlockingOverlay.scss\";\n\nexport interface BlockingOverlayProps {\n isVisible: boolean;\n}\n\nexport const BlockingOverlay = ({ isVisible }: BlockingOverlayProps) => {\n return (\n <div className={classnames(\"gmw-group-mapping-blocking-overlay\", isVisible && \"gmw-visible\")}>\n <LoadingSpinner />\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
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 { Button, LabeledInput, MiddleTextTruncation, ProgressLinear, Text, } from "@itwin/itwinui-react";
|
|
6
|
+
import React, { useEffect, useState } from "react";
|
|
7
|
+
import "./ConfirmMappingsImport.scss";
|
|
8
|
+
import { SvgStatusSuccessHollow } from "@itwin/itwinui-icons-react";
|
|
9
|
+
import useValidator, { NAME_REQUIREMENTS } from "../Properties/hooks/useValidator";
|
|
10
|
+
import { handleError } from "../../common/utils";
|
|
11
|
+
import { useMappingClient } from "../context/MappingClientContext";
|
|
12
|
+
import { useGroupingMappingApiConfig } from "../context/GroupingApiConfigContext";
|
|
13
|
+
const defaultDisplayStrings = {
|
|
14
|
+
mappings: "Mappings",
|
|
15
|
+
};
|
|
16
|
+
const ConfirmMappingImport = ({ sourceiModelId, selectedMappings, importing, setImporting, setSelectedMappings, backFn, onCancel, onFinish, displayStrings: userDisplayStrings, }) => {
|
|
17
|
+
const { getAccessToken, iModelId } = useGroupingMappingApiConfig();
|
|
18
|
+
const mappingClient = useMappingClient();
|
|
19
|
+
const [importCount, setImportCount] = useState(0);
|
|
20
|
+
const [currentlyImporting, setCurrentlyImporting] = useState("");
|
|
21
|
+
const [validator, showValidationMessage] = useValidator();
|
|
22
|
+
const [errored, setErrored] = useState(false);
|
|
23
|
+
const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setSelectedMappings((selectedMappings) => selectedMappings.map((mapping) => ({
|
|
26
|
+
...mapping,
|
|
27
|
+
mappingName: `${mapping.mappingName}_Copy`,
|
|
28
|
+
})));
|
|
29
|
+
}, [setSelectedMappings]);
|
|
30
|
+
const handleChange = (e, index) => {
|
|
31
|
+
const newState = [...selectedMappings];
|
|
32
|
+
newState[index] = {
|
|
33
|
+
...newState[index],
|
|
34
|
+
mappingName: e.target.value,
|
|
35
|
+
};
|
|
36
|
+
setSelectedMappings(newState);
|
|
37
|
+
};
|
|
38
|
+
const onImport = async () => {
|
|
39
|
+
if (!validator.allValid()) {
|
|
40
|
+
showValidationMessage(true);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
setImporting(true);
|
|
44
|
+
try {
|
|
45
|
+
for (const selectedMapping of selectedMappings) {
|
|
46
|
+
setCurrentlyImporting(selectedMapping.mappingName ?? "");
|
|
47
|
+
const accessToken = await getAccessToken();
|
|
48
|
+
await mappingClient.copyMapping(accessToken, sourceiModelId, selectedMapping.id ?? "", {
|
|
49
|
+
targetIModelId: iModelId ?? "",
|
|
50
|
+
mappingName: selectedMapping.mappingName ?? "",
|
|
51
|
+
});
|
|
52
|
+
setImportCount((importCount) => importCount + 1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
handleError(error);
|
|
57
|
+
setErrored(true);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return (React.createElement(React.Fragment, null, importing ? (React.createElement("div", { className: 'gmw-import-progress-container' },
|
|
61
|
+
React.createElement("div", { className: 'gmw-import-progress-bar' },
|
|
62
|
+
React.createElement("div", { className: 'gmw-import-progress-bar-description' }, !errored ? importCount !== selectedMappings.length ? (React.createElement(React.Fragment, null,
|
|
63
|
+
React.createElement(Text, { variant: 'title' }, "Importing"),
|
|
64
|
+
React.createElement(Text, null, `We are currently importing the ${displayStrings.mappings.toLocaleLowerCase()}.`))) : (React.createElement(React.Fragment, null,
|
|
65
|
+
React.createElement(Text, { variant: 'title' }, "Done!"),
|
|
66
|
+
React.createElement(Text, null, `Your imported ${displayStrings.mappings.toLocaleLowerCase()} are ready.`))) :
|
|
67
|
+
React.createElement(React.Fragment, null,
|
|
68
|
+
React.createElement(Text, { variant: 'title' }, "Error!"),
|
|
69
|
+
React.createElement(Text, null, `Sorry, there was an error importing some or all ${displayStrings.mappings}.`))),
|
|
70
|
+
React.createElement(ProgressLinear, { value: (importCount / selectedMappings.length) * 100, labels: importCount === selectedMappings.length
|
|
71
|
+
? ["Import done!", React.createElement(SvgStatusSuccessHollow, { key: '0' })]
|
|
72
|
+
: [
|
|
73
|
+
React.createElement(React.Fragment, null,
|
|
74
|
+
React.createElement(Text, null, "Copying"),
|
|
75
|
+
React.createElement(MiddleTextTruncation, { text: currentlyImporting })),
|
|
76
|
+
`${importCount}/${selectedMappings.length}`,
|
|
77
|
+
], status: !errored ?
|
|
78
|
+
importCount === selectedMappings.length ? "positive" : undefined : "negative" })),
|
|
79
|
+
React.createElement("div", { className: 'gmw-import-action-panel' },
|
|
80
|
+
React.createElement(Button, { disabled: !errored && importCount !== selectedMappings.length, onClick: () => {
|
|
81
|
+
setImporting(false);
|
|
82
|
+
setImportCount(0);
|
|
83
|
+
setCurrentlyImporting("");
|
|
84
|
+
setErrored(false);
|
|
85
|
+
} }, "Back"),
|
|
86
|
+
React.createElement(Button, { styleType: 'high-visibility', disabled: !errored && importCount !== selectedMappings.length, onClick: () => onFinish() }, "Close")))) : (React.createElement("div", { className: 'gmw-rename-confirm-container ' },
|
|
87
|
+
React.createElement("div", { className: 'gmw-mapping-rename-container' },
|
|
88
|
+
React.createElement("div", { className: 'gmw-mapping-row-header-container' },
|
|
89
|
+
React.createElement("div", { className: 'gmw-mapping-row' },
|
|
90
|
+
React.createElement(Text, { variant: 'leading' }, displayStrings.mappings),
|
|
91
|
+
React.createElement(Text, { variant: 'leading' }, "Description"))),
|
|
92
|
+
React.createElement("div", { className: 'gmw-mapping-row-body' }, selectedMappings.map((mapping, index) => (React.createElement("div", { className: 'gmw-mapping-row-container', key: mapping.id },
|
|
93
|
+
React.createElement("div", { className: 'gmw-mapping-row' },
|
|
94
|
+
React.createElement(LabeledInput, { value: mapping.mappingName, name: `mapping_${mapping.id}`, required: true, onChange: (event) => {
|
|
95
|
+
handleChange(event, index);
|
|
96
|
+
validator.showMessageFor(`mapping_${mapping.id}`);
|
|
97
|
+
}, message: validator.message(`mapping_${mapping.id}`, mapping.mappingName, NAME_REQUIREMENTS), status: validator.message(`mapping_${mapping.id}`, mapping.mappingName, NAME_REQUIREMENTS)
|
|
98
|
+
? "negative"
|
|
99
|
+
: undefined, onBlur: () => {
|
|
100
|
+
validator.showMessageFor(`mapping_${mapping.id}`);
|
|
101
|
+
}, onBlurCapture: (event) => {
|
|
102
|
+
handleChange(event, index);
|
|
103
|
+
validator.showMessageFor(`mapping_${mapping.id}`);
|
|
104
|
+
} }),
|
|
105
|
+
React.createElement("div", null, mapping.description)),
|
|
106
|
+
React.createElement("div", { className: 'gmw-border-div' })))))),
|
|
107
|
+
React.createElement("div", { className: 'gmw-import-action-panel' },
|
|
108
|
+
React.createElement(Button, { onClick: backFn }, "Back"),
|
|
109
|
+
React.createElement(Button, { styleType: 'high-visibility', onClick: async () => onImport() }, "Import"),
|
|
110
|
+
React.createElement(Button, { onClick: onCancel }, "Cancel"))))));
|
|
111
|
+
};
|
|
112
|
+
export default ConfirmMappingImport;
|
|
113
|
+
//# sourceMappingURL=ConfirmMappingsImport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmMappingsImport.js","sourceRoot":"","sources":["../../../../src/components/Mappings/ConfirmMappingsImport.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,MAAM,EACN,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,YAAY,EAAE,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC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,EAAE,CAAC,CAAC;wBACpD,CAAC,EACD,OAAO,EAAE,SAAS,CAAC,OAAO,CACxB,WAAW,OAAO,CAAC,EAAE,EAAE,EACvB,OAAO,CAAC,WAAW,EACnB,iBAAiB,CAClB,EACD,MAAM,EACJ,SAAS,CAAC,OAAO,CACf,WAAW,OAAO,CAAC,EAAE,EAAE,EACvB,OAAO,CAAC,WAAW,EACnB,iBAAiB,CAClB;4BACC,CAAC,CAAC,UAAU;4BACZ,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,GAAG,EAAE;4BACX,SAAS,CAAC,cAAc,CAAC,WAAW,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;wBACpD,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;4BACvB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;4BAC3B,SAAS,CAAC,cAAc,CAAC,WAAW,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;wBACpD,CAAC,GACD;oBACF,iCAAM,OAAO,CAAC,WAAW,CAAO,CAC5B;gBACN,6BAAK,SAAS,EAAC,gBAAgB,GAAG,CAC9B,CACP,CAAC,CACE,CACF;QACN,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,oBAAC,MAAM,IAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,aAE1D;YACT,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,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*--------------------------------------------------------------------------------------------*/\nimport {\n Button,\n LabeledInput,\n MiddleTextTruncation,\n ProgressLinear,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useEffect, useState } from \"react\";\nimport type { IMappingTyped } from \"./Mappings\";\nimport \"./ConfirmMappingsImport.scss\";\nimport { SvgStatusSuccessHollow } from \"@itwin/itwinui-icons-react\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../Properties/hooks/useValidator\";\nimport { handleError } from \"../../common/utils\";\nimport { useMappingClient } from \"../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\n\ninterface ConfirmMappingImportProps {\n sourceiModelId: string;\n selectedMappings: IMappingTyped[];\n importing: boolean;\n setImporting: React.Dispatch<React.SetStateAction<boolean>>;\n setSelectedMappings: React.Dispatch<React.SetStateAction<IMappingTyped[]>>;\n backFn: () => void;\n onCancel: () => void;\n onFinish: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nconst ConfirmMappingImport = ({\n sourceiModelId,\n selectedMappings,\n importing,\n setImporting,\n setSelectedMappings,\n backFn,\n onCancel,\n onFinish,\n displayStrings: userDisplayStrings,\n}: ConfirmMappingImportProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n\n const [importCount, setImportCount] = useState<number>(0);\n const [currentlyImporting, setCurrentlyImporting] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [errored, setErrored] = useState<boolean>(false);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n useEffect(() => {\n setSelectedMappings((selectedMappings) =>\n selectedMappings.map((mapping) => ({\n ...mapping,\n mappingName: `${mapping.mappingName}_Copy`,\n })),\n );\n }, [setSelectedMappings]);\n\n const handleChange = (\n e: React.ChangeEvent<HTMLInputElement>,\n index: number,\n ) => {\n const newState = [...selectedMappings];\n newState[index] = {\n ...newState[index],\n mappingName: e.target.value,\n };\n setSelectedMappings(newState);\n };\n\n const onImport = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n setImporting(true);\n try {\n for (const selectedMapping of selectedMappings) {\n setCurrentlyImporting(selectedMapping.mappingName ?? \"\");\n const accessToken = await getAccessToken();\n await mappingClient.copyMapping(\n accessToken,\n sourceiModelId,\n selectedMapping.id ?? \"\",\n {\n targetIModelId: iModelId ?? \"\",\n mappingName: selectedMapping.mappingName ?? \"\",\n },\n );\n setImportCount((importCount) => importCount + 1);\n }\n } catch (error: any) {\n handleError(error);\n setErrored(true);\n }\n };\n\n return (\n <>\n {importing ? (\n <div className='gmw-import-progress-container'>\n <div className='gmw-import-progress-bar'>\n <div className='gmw-import-progress-bar-description'>\n {\n !errored ? importCount !== selectedMappings.length ? (\n <>\n <Text variant='title'>Importing</Text>\n <Text>{`We are currently importing the ${displayStrings.mappings.toLocaleLowerCase()}.`}</Text>\n </>\n ) : (\n <>\n <Text variant='title'>Done!</Text>\n <Text>{`Your imported ${displayStrings.mappings.toLocaleLowerCase()} are ready.`}</Text>\n </>\n ) :\n <>\n <Text variant='title'>Error!</Text>\n <Text>{`Sorry, there was an error importing some or all ${displayStrings.mappings}.`}</Text>\n </>}\n </div>\n <ProgressLinear\n value={(importCount / selectedMappings.length) * 100}\n labels={\n importCount === selectedMappings.length\n ? [\"Import done!\", <SvgStatusSuccessHollow key='0' />]\n : [\n <>\n <Text>Copying</Text>\n <MiddleTextTruncation text={currentlyImporting} />\n </>,\n `${importCount}/${selectedMappings.length}`,\n ]\n }\n status={\n !errored ?\n importCount === selectedMappings.length ? \"positive\" : undefined : \"negative\"\n }\n />\n </div>\n <div className='gmw-import-action-panel'>\n <Button\n disabled={!errored && importCount !== selectedMappings.length}\n onClick={() => {\n setImporting(false);\n setImportCount(0);\n setCurrentlyImporting(\"\");\n setErrored(false);\n }}\n >\n Back\n </Button>\n <Button\n styleType='high-visibility'\n disabled={!errored && importCount !== selectedMappings.length}\n onClick={() => onFinish()}\n >\n Close\n </Button>\n </div>\n </div>\n ) : (\n <div className='gmw-rename-confirm-container '>\n <div className='gmw-mapping-rename-container'>\n <div className='gmw-mapping-row-header-container'>\n <div className='gmw-mapping-row'>\n <Text variant='leading'>{displayStrings.mappings}</Text>\n <Text variant='leading'>Description</Text>\n </div>\n </div>\n <div className='gmw-mapping-row-body'>\n {selectedMappings.map((mapping, index) => (\n <div className='gmw-mapping-row-container' key={mapping.id}>\n <div className='gmw-mapping-row'>\n <LabeledInput\n value={mapping.mappingName}\n name={`mapping_${mapping.id}`}\n required\n onChange={(event) => {\n handleChange(event, index);\n validator.showMessageFor(`mapping_${mapping.id}`);\n }}\n message={validator.message(\n `mapping_${mapping.id}`,\n mapping.mappingName,\n NAME_REQUIREMENTS,\n )}\n status={\n validator.message(\n `mapping_${mapping.id}`,\n mapping.mappingName,\n NAME_REQUIREMENTS,\n )\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(`mapping_${mapping.id}`);\n }}\n onBlurCapture={(event) => {\n handleChange(event, index);\n validator.showMessageFor(`mapping_${mapping.id}`);\n }}\n />\n <div>{mapping.description}</div>\n </div>\n <div className='gmw-border-div' />\n </div>\n ))}\n </div>\n </div>\n <div className='gmw-import-action-panel'>\n <Button onClick={backFn}>Back</Button>\n <Button styleType='high-visibility' onClick={async () => onImport()}>\n Import\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport default ConfirmMappingImport;\n"]}
|