@itwin/grouping-mapping-widget 0.35.4 → 0.36.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/lib/cjs/GroupingMappingWidget.d.ts +28 -0
- package/lib/cjs/GroupingMappingWidget.js +71 -0
- package/lib/cjs/GroupingMappingWidget.js.map +1 -0
- package/lib/cjs/WidgetShell/GroupingMapping.js +4 -3
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +6 -5
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/cjs/common/utils.js +12 -11
- package/lib/cjs/common/utils.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js +3 -2
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +2 -2
- package/lib/cjs/components/Groups/Editing/GroupAction.js +8 -7
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetails.js +4 -3
- package/lib/cjs/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.d.ts +2 -2
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js +5 -4
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/cjs/components/Groups/GroupMenuActions.js +5 -4
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js +2 -1
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.js +2 -1
- package/lib/cjs/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js +2 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.js +4 -3
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +9 -6
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js +3 -2
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +6 -5
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js +4 -3
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -2
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js +3 -2
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js +2 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +2 -2
- package/lib/cjs/components/Mappings/Editing/MappingAction.js +9 -8
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +17 -6
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +12 -11
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +19 -18
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectIModel.js +9 -8
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectITwin.js +14 -13
- package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectMappings.js +10 -9
- package/lib/cjs/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js +5 -4
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/cjs/components/Mappings/Mappings.d.ts +2 -2
- package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -2
- package/lib/cjs/components/Mappings/MappingsView.js +17 -15
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +2 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +3 -2
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +2 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.js +3 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupInformationPanel.js +3 -2
- package/lib/cjs/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +28 -26
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +12 -11
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js +5 -4
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +2 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js +2 -1
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTableToolbar.js +3 -5
- package/lib/cjs/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useValidator.d.ts +2 -2
- package/lib/cjs/components/Properties/hooks/useValidator.js +12 -9
- package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/cjs/components/SharedComponents/ActionPanel.js +3 -2
- package/lib/cjs/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/cjs/components/SharedComponents/DeleteModal.js +5 -4
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js +3 -2
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/cjs/components/customUI/DefaultGroupingUI.d.ts +1 -1
- package/lib/cjs/components/customUI/DefaultGroupingUI.js +7 -5
- package/lib/cjs/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +3 -2
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +5 -4
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +5 -4
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
- package/lib/cjs/grouping-mapping-widget.js +4 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +5 -5
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/setup.d.ts +2 -0
- package/lib/cjs/test/setup.js +10 -0
- package/lib/cjs/test/setup.js.map +1 -0
- package/lib/esm/GroupingMappingWidget.d.ts +28 -0
- package/lib/esm/GroupingMappingWidget.js +67 -0
- package/lib/esm/GroupingMappingWidget.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMapping.js +5 -4
- package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +6 -5
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/esm/common/utils.js +12 -11
- package/lib/esm/common/utils.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js +3 -2
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupAction.d.ts +2 -2
- package/lib/esm/components/Groups/Editing/GroupAction.js +8 -7
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetails.js +4 -3
- package/lib/esm/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.d.ts +2 -2
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js +5 -4
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/esm/components/Groups/GroupMenuActions.js +5 -4
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js +2 -1
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.js +2 -1
- package/lib/esm/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.js +2 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.js +4 -3
- package/lib/esm/components/Groups/GroupsView.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +9 -6
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualizationActions.js +3 -2
- package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +6 -5
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js +4 -3
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -2
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/esm/components/Groups/ToggleGroupVisibility.js +3 -2
- package/lib/esm/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js +2 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +2 -2
- package/lib/esm/components/Mappings/Editing/MappingAction.js +9 -8
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js +17 -6
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +12 -11
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +19 -18
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectIModel.js +9 -8
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectITwin.js +14 -13
- package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectMappings.js +10 -9
- package/lib/esm/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.js +5 -4
- package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/esm/components/Mappings/Mappings.d.ts +2 -2
- package/lib/esm/components/Mappings/Mappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.d.ts +2 -2
- package/lib/esm/components/Mappings/MappingsView.js +15 -14
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +2 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +3 -2
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +2 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.js +3 -2
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupInformationPanel.js +3 -2
- package/lib/esm/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +26 -25
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +12 -11
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js +5 -4
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +2 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.js +2 -1
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTableToolbar.js +3 -5
- package/lib/esm/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useValidator.d.ts +2 -2
- package/lib/esm/components/Properties/hooks/useValidator.js +9 -8
- package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/esm/components/SharedComponents/ActionPanel.js +3 -2
- package/lib/esm/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/esm/components/SharedComponents/DeleteModal.js +5 -4
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/esm/components/SharedComponents/LoadingOverlay.js +3 -2
- package/lib/esm/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/esm/components/customUI/DefaultGroupingUI.d.ts +1 -1
- package/lib/esm/components/customUI/DefaultGroupingUI.js +5 -4
- package/lib/esm/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +3 -2
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js +5 -4
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js +5 -4
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +3 -0
- package/lib/esm/grouping-mapping-widget.js +2 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +5 -5
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/setup.d.ts +2 -0
- package/lib/esm/test/setup.js +8 -0
- package/lib/esm/test/setup.js.map +1 -0
- package/lib/public/locales/en/GroupingMappingWidget.json +220 -0
- package/package.json +3 -3
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _a, _GroupingMappingWidget_i18n, _GroupingMappingWidget_initialized, _GroupingMappingWidget_localizationOverrides;
|
|
13
|
+
/*---------------------------------------------------------------------------------------------
|
|
14
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
15
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
16
|
+
*--------------------------------------------------------------------------------------------*/
|
|
17
|
+
import { BentleyError, BentleyStatus } from "@itwin/core-bentley";
|
|
18
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
19
|
+
/**
|
|
20
|
+
* Entry point for static initialization required by various components used in the package.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export class GroupingMappingWidget {
|
|
24
|
+
/**
|
|
25
|
+
* Called to initialize the Grouping & Mapping Widget localization.
|
|
26
|
+
* @param config - Optional configuration with custom localization service and overrides.
|
|
27
|
+
*/
|
|
28
|
+
static async initialize(config) {
|
|
29
|
+
if (__classPrivateFieldGet(this, _a, "f", _GroupingMappingWidget_initialized)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
__classPrivateFieldSet(GroupingMappingWidget, _a, true, "f", _GroupingMappingWidget_initialized);
|
|
33
|
+
__classPrivateFieldSet(GroupingMappingWidget, _a, config?.localization ?? IModelApp.localization, "f", _GroupingMappingWidget_i18n);
|
|
34
|
+
__classPrivateFieldSet(GroupingMappingWidget, _a, config?.localizationOverrides, "f", _GroupingMappingWidget_localizationOverrides);
|
|
35
|
+
return __classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_i18n).registerNamespace(GroupingMappingWidget.i18nNamespace);
|
|
36
|
+
}
|
|
37
|
+
/** Unregisters the GroupingMappingWidget internationalization service namespace */
|
|
38
|
+
static terminate() {
|
|
39
|
+
if (__classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_i18n)) {
|
|
40
|
+
__classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_i18n).unregisterNamespace(GroupingMappingWidget.i18nNamespace);
|
|
41
|
+
__classPrivateFieldSet(GroupingMappingWidget, _a, undefined, "f", _GroupingMappingWidget_i18n);
|
|
42
|
+
}
|
|
43
|
+
__classPrivateFieldSet(GroupingMappingWidget, _a, false, "f", _GroupingMappingWidget_initialized);
|
|
44
|
+
}
|
|
45
|
+
/** The internationalization service created by the IModelApp. */
|
|
46
|
+
static get i18n() {
|
|
47
|
+
if (!__classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_i18n)) {
|
|
48
|
+
throw new BentleyError(BentleyStatus.ERROR, "GroupingMappingWidget not initialized");
|
|
49
|
+
}
|
|
50
|
+
return __classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_i18n);
|
|
51
|
+
}
|
|
52
|
+
/** The internationalization service namespace. */
|
|
53
|
+
static get i18nNamespace() {
|
|
54
|
+
return "GroupingMappingWidget";
|
|
55
|
+
}
|
|
56
|
+
/** Calls i18n.getLocalizedString with the "GroupingMappingWidget" namespace. Do NOT include the namespace in the key. */
|
|
57
|
+
static translate(key, options) {
|
|
58
|
+
const keyStr = Array.isArray(key) ? key[0] : key;
|
|
59
|
+
return (__classPrivateFieldGet(GroupingMappingWidget, _a, "f", _GroupingMappingWidget_localizationOverrides)?.get(keyStr) ??
|
|
60
|
+
GroupingMappingWidget.i18n.getLocalizedString(`${GroupingMappingWidget.i18nNamespace}:${key}`, options));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_a = GroupingMappingWidget;
|
|
64
|
+
_GroupingMappingWidget_i18n = { value: void 0 };
|
|
65
|
+
_GroupingMappingWidget_initialized = { value: void 0 };
|
|
66
|
+
_GroupingMappingWidget_localizationOverrides = { value: void 0 };
|
|
67
|
+
//# sourceMappingURL=GroupingMappingWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupingMappingWidget.js","sourceRoot":"","sources":["../../src/GroupingMappingWidget.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAWjD;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAKhC;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAoC;QACjE,IAAI,uBAAA,IAAI,8CAAa,EAAE;YACrB,OAAO;SACR;QAED,uBAAA,qBAAqB,MAAgB,IAAI,0CAAA,CAAC;QAC1C,uBAAA,qBAAqB,MAAS,MAAM,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,mCAAA,CAAC;QAC7E,uBAAA,qBAAqB,MAA0B,MAAM,EAAE,qBAAqB,oDAAA,CAAC;QAC7E,OAAO,uBAAA,qBAAqB,uCAAM,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5F,CAAC;IAED,mFAAmF;IAC5E,MAAM,CAAC,SAAS;QACrB,IAAI,uBAAA,qBAAqB,uCAAM,EAAE;YAC/B,uBAAA,qBAAqB,uCAAM,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;YACrF,uBAAA,qBAAqB,MAAS,SAAS,mCAAA,CAAC;SACzC;QAED,uBAAA,qBAAqB,MAAgB,KAAK,0CAAA,CAAC;IAC7C,CAAC;IAED,iEAAiE;IAC1D,MAAM,KAAK,IAAI;QACpB,IAAI,CAAC,uBAAA,qBAAqB,uCAAM,EAAE;YAChC,MAAM,IAAI,YAAY,CAAC,aAAa,CAAC,KAAK,EAAE,uCAAuC,CAAC,CAAC;SACtF;QACD,OAAO,uBAAA,qBAAqB,uCAAM,CAAC;IACrC,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,aAAa;QAC7B,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,yHAAyH;IAClH,MAAM,CAAC,SAAS,CAAC,GAAsB,EAAE,OAA4B;QAC1E,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACjD,OAAO,CACL,uBAAA,qBAAqB,wDAAuB,EAAE,GAAG,CAAC,MAAM,CAAC;YACzD,qBAAqB,CAAC,IAAI,CAAC,kBAAkB,CAC3C,GAAG,qBAAqB,CAAC,aAAa,IAAI,GAAG,EAAE,EAC/C,OAAO,CACR,CACF,CAAC;IACJ,CAAC;CACF;;AArDC,+CAA4B,CAAA;AAC5B,sDAA8B,CAAA;AAC9B,gEAAoD,CAAA","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 { BentleyError, BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nimport type { Localization, TranslationOptions } from \"@itwin/core-common\";\n\n/** @public */\nexport interface GroupingMappingWidgetConfig {\n localization?: Localization;\n /** Override specific translation keys at runtime. Keys correspond to those in GroupingMappingWidget.json. */\n localizationOverrides?: Map<string, string>;\n}\n\n/**\n * Entry point for static initialization required by various components used in the package.\n * @public\n */\nexport class GroupingMappingWidget {\n static #i18n?: Localization;\n static #initialized?: boolean;\n static #localizationOverrides?: Map<string, string>;\n\n /**\n * Called to initialize the Grouping & Mapping Widget localization.\n * @param config - Optional configuration with custom localization service and overrides.\n */\n public static async initialize(config?: GroupingMappingWidgetConfig): Promise<void> {\n if (this.#initialized) {\n return;\n }\n\n GroupingMappingWidget.#initialized = true;\n GroupingMappingWidget.#i18n = config?.localization ?? IModelApp.localization;\n GroupingMappingWidget.#localizationOverrides = config?.localizationOverrides;\n return GroupingMappingWidget.#i18n.registerNamespace(GroupingMappingWidget.i18nNamespace);\n }\n\n /** Unregisters the GroupingMappingWidget internationalization service namespace */\n public static terminate() {\n if (GroupingMappingWidget.#i18n) {\n GroupingMappingWidget.#i18n.unregisterNamespace(GroupingMappingWidget.i18nNamespace);\n GroupingMappingWidget.#i18n = undefined;\n }\n\n GroupingMappingWidget.#initialized = false;\n }\n\n /** The internationalization service created by the IModelApp. */\n public static get i18n(): Localization {\n if (!GroupingMappingWidget.#i18n) {\n throw new BentleyError(BentleyStatus.ERROR, \"GroupingMappingWidget not initialized\");\n }\n return GroupingMappingWidget.#i18n;\n }\n\n /** The internationalization service namespace. */\n public static get i18nNamespace(): string {\n return \"GroupingMappingWidget\";\n }\n\n /** Calls i18n.getLocalizedString with the \"GroupingMappingWidget\" namespace. Do NOT include the namespace in the key. */\n public static translate(key: string | string[], options?: TranslationOptions): string {\n const keyStr = Array.isArray(key) ? key[0] : key;\n return (\n GroupingMappingWidget.#localizationOverrides?.get(keyStr) ??\n GroupingMappingWidget.i18n.getLocalizedString(\n `${GroupingMappingWidget.i18nNamespace}:${key}`,\n options\n )\n );\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { GroupingMappingWidget } from "../GroupingMappingWidget";
|
|
2
3
|
import { GroupingMappingContext } from "../components/GroupingMappingContext";
|
|
3
4
|
import "./GroupingMapping.scss";
|
|
4
5
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
@@ -6,7 +7,7 @@ import { GroupingMappingCustomUIType } from "../components/customUI/GroupingMapp
|
|
|
6
7
|
import { SvgList } from "@itwin/itwinui-icons-react";
|
|
7
8
|
import { GroupingMappingContent } from "./GroupingMappingContent";
|
|
8
9
|
import { GroupingMappingHeader } from "./GroupingMappingHeader";
|
|
9
|
-
import {
|
|
10
|
+
import { getDefaultGroupingUI } from "../components/customUI/DefaultGroupingUI";
|
|
10
11
|
export var RouteStep;
|
|
11
12
|
(function (RouteStep) {
|
|
12
13
|
RouteStep[RouteStep["Mappings"] = 0] = "Mappings";
|
|
@@ -20,7 +21,7 @@ export var RouteStep;
|
|
|
20
21
|
RouteStep[RouteStep["CustomCalculationPropertyAction"] = 8] = "CustomCalculationPropertyAction";
|
|
21
22
|
})(RouteStep || (RouteStep = {}));
|
|
22
23
|
const GroupingMapping = (props) => {
|
|
23
|
-
const [routingHistory, setRoutingHistory] = useState([{ step: RouteStep.Mappings, title: "
|
|
24
|
+
const [routingHistory, setRoutingHistory] = useState([{ step: RouteStep.Mappings, title: GroupingMappingWidget.translate("mappings.mappings"), groupingRouteFields: {} }]);
|
|
24
25
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
25
26
|
const activeIModelConnection = useActiveIModelConnection();
|
|
26
27
|
const iModelConnection = props.iModelConnection ?? activeIModelConnection;
|
|
@@ -37,7 +38,7 @@ const GroupingMapping = (props) => {
|
|
|
37
38
|
const injectedCustomUI = useMemo(() => [
|
|
38
39
|
{
|
|
39
40
|
name: "Properties",
|
|
40
|
-
displayLabel: "
|
|
41
|
+
displayLabel: GroupingMappingWidget.translate("customUI.properties"),
|
|
41
42
|
type: GroupingMappingCustomUIType.Context,
|
|
42
43
|
icon: React.createElement(SvgList, null),
|
|
43
44
|
onClick: (group) => navigateTo((prev) => ({
|
|
@@ -47,7 +48,7 @@ const GroupingMapping = (props) => {
|
|
|
47
48
|
})),
|
|
48
49
|
},
|
|
49
50
|
// No group UI's provided means the widget provides its own
|
|
50
|
-
...(props.customUIs ??
|
|
51
|
+
...(props.customUIs ?? getDefaultGroupingUI()),
|
|
51
52
|
], [props.customUIs, navigateTo]);
|
|
52
53
|
return (React.createElement(GroupingMappingContext, { iModelId: iModelId, changeSetId: changeSetId, ...props, customUIs: injectedCustomUI },
|
|
53
54
|
React.createElement("div", { className: "gmw-group-mapping-container" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMapping.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMapping.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupingMapping.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMapping.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0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C","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 { GroupMinimal, Mapping, Property } from \"@itwin/insights-client\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\nimport type { GroupingMappingContextProps } from \"../components/GroupingMappingContext\";\nimport { GroupingMappingContext } from \"../components/GroupingMappingContext\";\nimport \"./GroupingMapping.scss\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport type { ContextCustomUI, GroupingMappingCustomUI } from \"../components/customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../components/customUI/GroupingMappingCustomUI\";\nimport { SvgList } from \"@itwin/itwinui-icons-react\";\nimport { GroupingMappingContent } from \"./GroupingMappingContent\";\nimport { GroupingMappingHeader } from \"./GroupingMappingHeader\";\nimport { getDefaultGroupingUI } from \"../components/customUI/DefaultGroupingUI\";\n\nexport type GroupingMappingProps = Omit<GroupingMappingContextProps, \"iModelId\" | \"changesetId\"> & {\n hideRefreshIcon?: boolean;\n groupsAction?: JSX.Element;\n};\n\nexport enum RouteStep {\n Mappings,\n MappingsAction,\n Groups,\n GroupAction,\n GroupContextCustomUI,\n Properties,\n PropertyAction,\n CalculatedPropertyAction,\n CustomCalculationPropertyAction,\n}\n\nexport interface Route {\n step: RouteStep;\n title: string;\n groupingRouteFields: GroupingRouteFields;\n}\n\nexport interface GroupingRouteFields {\n mapping?: Mapping;\n group?: GroupMinimal;\n property?: Property;\n calculatedProperty?: Property;\n customCalculation?: Property;\n // Optional prop but cannot be declared undefined.\n groupContextCustomUI?: Exclude<ContextCustomUI[\"uiComponent\"], undefined>;\n queryGenerationType?: string;\n}\n\nconst GroupingMapping = (props: GroupingMappingProps) => {\n const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.Mappings, title: GroupingMappingWidget.translate(\"mappings.mappings\"), groupingRouteFields: {} }]);\n const currentRoute = routingHistory[routingHistory.length - 1];\n const activeIModelConnection = useActiveIModelConnection();\n const iModelConnection = props.iModelConnection ?? activeIModelConnection;\n const iModelId = iModelConnection?.iModelId ?? \"\";\n const changeSetId = iModelConnection?.changeset.id ?? \"\";\n const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {\n setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);\n }, []);\n\n const goBack = useCallback(() => {\n const updatedRouting = [...routingHistory];\n updatedRouting.pop();\n setRoutingHistory(updatedRouting);\n }, [routingHistory]);\n\n const injectedCustomUI = useMemo<GroupingMappingCustomUI[]>(\n () => [\n {\n name: \"Properties\",\n displayLabel: GroupingMappingWidget.translate(\"customUI.properties\"),\n type: GroupingMappingCustomUIType.Context,\n icon: <SvgList />,\n onClick: (group) =>\n navigateTo((prev) => ({\n step: RouteStep.Properties,\n title: group.groupName,\n groupingRouteFields: { ...prev?.groupingRouteFields, group },\n })),\n },\n // No group UI's provided means the widget provides its own\n ...(props.customUIs ?? getDefaultGroupingUI()),\n ],\n [props.customUIs, navigateTo],\n );\n\n return (\n <GroupingMappingContext iModelId={iModelId} changeSetId={changeSetId} {...props} customUIs={injectedCustomUI}>\n <div className=\"gmw-group-mapping-container\">\n <GroupingMappingHeader goBack={goBack} currentRoute={currentRoute} />\n <GroupingMappingContent\n routingHistory={routingHistory}\n navigateTo={navigateTo}\n goBack={goBack}\n hideRefreshIcon={props.hideRefreshIcon}\n groupsAction={props.groupsAction}\n />\n </div>\n </GroupingMappingContext>\n );\n};\n\nexport default GroupingMapping;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StagePanelLocation, StagePanelSection, StageUsage } from "@itwin/appui-react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { GroupingMappingWidget as GMWidget } from "../GroupingMappingWidget";
|
|
3
4
|
import GroupingMapping from "./GroupingMapping";
|
|
4
5
|
/**
|
|
5
6
|
* UI Provider for Grouping & Mapping Widget
|
|
@@ -15,7 +16,7 @@ export class GroupingMappingProvider {
|
|
|
15
16
|
if (location === StagePanelLocation.Left && section === StagePanelSection.Start && stageUsage === StageUsage.General) {
|
|
16
17
|
const GroupingMappingWidget = {
|
|
17
18
|
id: "GroupingMappingWidget",
|
|
18
|
-
label: "
|
|
19
|
+
label: GMWidget.translate("widget.label"),
|
|
19
20
|
content: React.createElement(GroupingMapping, { ...this._props }),
|
|
20
21
|
};
|
|
21
22
|
widgets.push(GroupingMappingWidget);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingWidget.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMappingWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupingMappingWidget.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMappingWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAGlC,YAA6B,SAA+B,EAAE;QAAjC,WAAM,GAAN,MAAM,CAA2B;QAF9C,OAAE,GAAG,yBAAyB,CAAC;IAEkB,CAAC;IAE3D,cAAc,CAAC,QAAgB,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B;QACnH,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,IAAI,QAAQ,KAAK,kBAAkB,CAAC,IAAI,IAAI,OAAO,KAAK,iBAAiB,CAAC,KAAK,IAAI,UAAU,KAAK,UAAU,CAAC,OAAO,EAAE;YACpH,MAAM,qBAAqB,GAAW;gBACpC,EAAE,EAAE,uBAAuB;gBAC3B,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC;gBACzC,OAAO,EAAE,oBAAC,eAAe,OAAK,IAAI,CAAC,MAAM,GAAI;aAC9C,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;SACrC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { UiItemsProvider, Widget } from \"@itwin/appui-react\";\nimport { StagePanelLocation, StagePanelSection, StageUsage } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport { GroupingMappingWidget as GMWidget } from \"../GroupingMappingWidget\";\nimport type { GroupingMappingProps } from \"./GroupingMapping\";\nimport GroupingMapping from \"./GroupingMapping\";\n\n/**\n * UI Provider for Grouping & Mapping Widget\n * @public\n */\nexport class GroupingMappingProvider implements UiItemsProvider {\n public readonly id = \"GroupingMappingProvider\";\n\n constructor(private readonly _props: GroupingMappingProps = {}) {}\n\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): ReadonlyArray<Widget> {\n const widgets: Widget[] = [];\n if (location === StagePanelLocation.Left && section === StagePanelSection.Start && stageUsage === StageUsage.General) {\n const GroupingMappingWidget: Widget = {\n id: \"GroupingMappingWidget\",\n label: GMWidget.translate(\"widget.label\"),\n content: <GroupingMapping {...this._props} />,\n };\n\n widgets.push(GroupingMappingWidget);\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -12,13 +12,14 @@ import { MappingAction } from "../../components/Mappings/Editing/MappingAction";
|
|
|
12
12
|
import { PropertyMenuWithVisualization } from "../../components/Properties/PropertyMenuWithVisualization";
|
|
13
13
|
import { GroupsVisualization } from "../../components/Groups/GroupsVisualization";
|
|
14
14
|
import { useGroupHilitedElementsContext } from "../../components/context/GroupHilitedElementsContext";
|
|
15
|
+
import { GroupingMappingWidget as GMWidget } from "../../GroupingMappingWidget";
|
|
15
16
|
export const GroupingMappingRouter = ({ currentRoute, navigateTo, goBack, hideRefreshIcon, groupsAction, }) => {
|
|
16
17
|
const { iModelId } = useGroupingMappingApiConfig();
|
|
17
18
|
const { mapping, group, property, groupContextCustomUI, queryGenerationType } = currentRoute.groupingRouteFields;
|
|
18
19
|
const { showGroupColor, groupColors } = useGroupHilitedElementsContext();
|
|
19
20
|
switch (currentRoute.step) {
|
|
20
21
|
case RouteStep.Mappings:
|
|
21
|
-
return (React.createElement(Mappings, { onClickAddMapping: () => navigateTo(() => ({ step: RouteStep.MappingsAction, title: "
|
|
22
|
+
return (React.createElement(Mappings, { onClickAddMapping: () => navigateTo(() => ({ step: RouteStep.MappingsAction, title: GMWidget.translate("mappings.addMapping"), groupingRouteFields: {} })), onClickMappingTitle: (mapping) => {
|
|
22
23
|
navigateTo(() => ({
|
|
23
24
|
step: RouteStep.Groups,
|
|
24
25
|
groupingRouteFields: { mapping },
|
|
@@ -38,7 +39,7 @@ export const GroupingMappingRouter = ({ currentRoute, navigateTo, goBack, hideRe
|
|
|
38
39
|
return (React.createElement(GroupsVisualization, { mapping: mapping, onClickAddGroup: (qType) => navigateTo((prev) => ({
|
|
39
40
|
step: RouteStep.GroupAction,
|
|
40
41
|
groupingRouteFields: { ...prev?.groupingRouteFields, queryGenerationType: qType },
|
|
41
|
-
title: "
|
|
42
|
+
title: GMWidget.translate("groups.addGroup"),
|
|
42
43
|
})), onClickGroupTitle: (g) => navigateTo((prev) => ({
|
|
43
44
|
step: RouteStep.Properties,
|
|
44
45
|
title: g.groupName,
|
|
@@ -72,13 +73,13 @@ export const GroupingMappingRouter = ({ currentRoute, navigateTo, goBack, hideRe
|
|
|
72
73
|
return null;
|
|
73
74
|
case RouteStep.Properties:
|
|
74
75
|
if (mapping && group) {
|
|
75
|
-
return (React.createElement(PropertyMenuWithVisualization, { mapping: mapping, group: group, color: showGroupColor ? groupColors.get(group.id) ?? "red" : "red", onClickAddGroupProperty: () => navigateTo((prev) => ({ step: RouteStep.PropertyAction, title: "
|
|
76
|
+
return (React.createElement(PropertyMenuWithVisualization, { mapping: mapping, group: group, color: showGroupColor ? groupColors.get(group.id) ?? "red" : "red", onClickAddGroupProperty: () => navigateTo((prev) => ({ step: RouteStep.PropertyAction, title: GMWidget.translate("properties.addPropertyTitle"), groupingRouteFields: { ...prev?.groupingRouteFields } })), onClickModifyGroupProperty: (gp) => navigateTo((prev) => ({
|
|
76
77
|
step: RouteStep.PropertyAction,
|
|
77
78
|
title: gp.propertyName,
|
|
78
79
|
groupingRouteFields: { ...prev?.groupingRouteFields, property: gp },
|
|
79
80
|
})), onClickAddCalculatedProperty: () => navigateTo((prev) => ({
|
|
80
81
|
step: RouteStep.CalculatedPropertyAction,
|
|
81
|
-
title: "
|
|
82
|
+
title: GMWidget.translate("properties.createCalculatedProperty"),
|
|
82
83
|
groupingRouteFields: { ...prev?.groupingRouteFields },
|
|
83
84
|
})), onClickModifyCalculatedProperty: (cp) => navigateTo((prev) => ({
|
|
84
85
|
step: RouteStep.CalculatedPropertyAction,
|
|
@@ -86,7 +87,7 @@ export const GroupingMappingRouter = ({ currentRoute, navigateTo, goBack, hideRe
|
|
|
86
87
|
groupingRouteFields: { ...prev?.groupingRouteFields, calculatedProperty: cp },
|
|
87
88
|
})), onClickAddCustomCalculationProperty: () => navigateTo((prev) => ({
|
|
88
89
|
step: RouteStep.CustomCalculationPropertyAction,
|
|
89
|
-
title: "
|
|
90
|
+
title: GMWidget.translate("properties.createCustomCalculation"),
|
|
90
91
|
groupingRouteFields: { ...prev?.groupingRouteFields },
|
|
91
92
|
})), onClickModifyCustomCalculation: (cc) => navigateTo((prev) => ({
|
|
92
93
|
step: RouteStep.CustomCalculationPropertyAction,
|
|
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------------------------------------------------------------------------\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 React from \"react\";\nimport { useGroupingMappingApiConfig } from \"../../components/context/GroupingApiConfigContext\";\nimport { GroupAction } from \"../../components/Groups/Editing/GroupAction\";\nimport type { Route } from \"../GroupingMapping\";\nimport { RouteStep } from \"../GroupingMapping\";\nimport { GroupPropertyAction } from \"../../components/Properties/GroupProperties/GroupPropertyAction\";\nimport { Mappings } from \"../../components/Mappings/Mappings\";\nimport { MappingAction } from \"../../components/Mappings/Editing/MappingAction\";\nimport { PropertyMenuWithVisualization } from \"../../components/Properties/PropertyMenuWithVisualization\";\nimport { GroupsVisualization } from \"../../components/Groups/GroupsVisualization\";\nimport { useGroupHilitedElementsContext } from \"../../components/context/GroupHilitedElementsContext\";\n\nexport const GroupingMappingRouter = ({\n currentRoute,\n navigateTo,\n goBack,\n hideRefreshIcon,\n groupsAction,\n}: {\n currentRoute: Route;\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n hideRefreshIcon?: boolean;\n groupsAction?: JSX.Element;\n}) => {\n const { iModelId } = useGroupingMappingApiConfig();\n const { mapping, group, property, groupContextCustomUI, queryGenerationType } = currentRoute.groupingRouteFields;\n const { showGroupColor, groupColors } = useGroupHilitedElementsContext();\n\n switch (currentRoute.step) {\n case RouteStep.Mappings:\n return (\n <Mappings\n onClickAddMapping={() => navigateTo(() => ({ step: RouteStep.MappingsAction, title: \"Add Mapping\", groupingRouteFields: {} }))}\n onClickMappingTitle={(mapping) => {\n navigateTo(() => ({\n step: RouteStep.Groups,\n groupingRouteFields: { mapping },\n title: mapping.mappingName,\n }));\n }}\n onClickMappingModify={(mapping) => {\n navigateTo(() => ({\n step: RouteStep.MappingsAction,\n groupingRouteFields: { mapping },\n title: mapping.mappingName,\n }));\n }}\n hideRefreshIcon={hideRefreshIcon}\n />\n );\n case RouteStep.MappingsAction:\n return <MappingAction mapping={mapping} onClickCancel={goBack} onSaveSuccess={goBack} />;\n case RouteStep.Groups:\n if (mapping) {\n return (\n <GroupsVisualization\n mapping={mapping}\n onClickAddGroup={(qType) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupAction,\n groupingRouteFields: { ...prev?.groupingRouteFields, queryGenerationType: qType },\n title: \"Add Group\",\n }))\n }\n onClickGroupTitle={(g) =>\n navigateTo((prev) => ({\n step: RouteStep.Properties,\n title: g.groupName,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g },\n }))\n }\n onClickGroupModify={(g, qType) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupAction,\n title: g.groupName,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g, queryGenerationType: qType },\n }))\n }\n onClickRenderContextCustomUI={(ccUI, g, displayLabel) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupContextCustomUI,\n title: displayLabel,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g, groupContextCustomUI: ccUI },\n }))\n }\n hideRefreshIcon={hideRefreshIcon}\n groupsAction={groupsAction}\n />\n );\n }\n return null;\n case RouteStep.GroupAction:\n if (mapping) {\n if (queryGenerationType) {\n return (\n <GroupAction\n shouldVisualize\n mappingId={mapping.id}\n group={group}\n onClickCancel={goBack}\n onSaveSuccess={goBack}\n queryGenerationType={queryGenerationType}\n />\n );\n }\n }\n return null;\n case RouteStep.GroupContextCustomUI:\n if (mapping && group && groupContextCustomUI) {\n return React.createElement(groupContextCustomUI, {\n iModelId,\n mappingId: mapping.id,\n groupId: group.id,\n });\n }\n return null;\n case RouteStep.Properties:\n if (mapping && group) {\n return (\n <PropertyMenuWithVisualization\n mapping={mapping}\n group={group}\n color={showGroupColor ? groupColors.get(group.id) ?? \"red\" : \"red\"}\n onClickAddGroupProperty={() =>\n navigateTo((prev) => ({ step: RouteStep.PropertyAction, title: \"Add Property\", groupingRouteFields: { ...prev?.groupingRouteFields } }))\n }\n onClickModifyGroupProperty={(gp) =>\n navigateTo((prev) => ({\n step: RouteStep.PropertyAction,\n title: gp.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, property: gp },\n }))\n }\n onClickAddCalculatedProperty={() =>\n navigateTo((prev) => ({\n step: RouteStep.CalculatedPropertyAction,\n title: \"Create Calculated Property\",\n groupingRouteFields: { ...prev?.groupingRouteFields },\n }))\n }\n onClickModifyCalculatedProperty={(cp) =>\n navigateTo((prev) => ({\n step: RouteStep.CalculatedPropertyAction,\n title: cp.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, calculatedProperty: cp },\n }))\n }\n onClickAddCustomCalculationProperty={() =>\n navigateTo((prev) => ({\n step: RouteStep.CustomCalculationPropertyAction,\n title: \"Create Custom Calculation\",\n groupingRouteFields: { ...prev?.groupingRouteFields },\n }))\n }\n onClickModifyCustomCalculation={(cc) =>\n navigateTo((prev) => ({\n step: RouteStep.CustomCalculationPropertyAction,\n title: cc.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, customCalculation: cc },\n }))\n }\n hideRefreshIcon={hideRefreshIcon}\n />\n );\n }\n return null;\n case RouteStep.PropertyAction: {\n if (mapping && group) {\n return <GroupPropertyAction mappingId={mapping.id} group={group} groupProperty={property} onSaveSuccess={goBack} onClickCancel={goBack} />;\n }\n return null;\n }\n default:\n return null;\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupingMappingRouter.js","sourceRoot":"","sources":["../../../../src/WidgetShell/Router/GroupingMappingRouter.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,MAA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,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,EAAE,EAAE;qBAC9E,CAAC,CAAC,EAEL,mCAAmC,EAAE,GAAG,EAAE,CACxC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBACpB,IAAI,EAAE,SAAS,CAAC,+BAA+B;wBAC/C,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,oCAAoC,CAAC;wBAC/D,mBAAmB,EAAE,EAAE,GAAG,IAAI,EAAE,mBAAmB,EAAE;qBACtD,CAAC,CAAC,EAEL,8BAA8B,EAAE,CAAC,EAAE,EAAE,EAAE,CACrC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBACpB,IAAI,EAAE,SAAS,CAAC,+BAA+B;wBAC/C,KAAK,EAAE,EAAE,CAAC,YAAY;wBACtB,mBAAmB,EAAE,EAAE,GAAG,IAAI,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,EAAE,EAAE;qBAC7E,CAAC,CAAC,EAEL,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;aACH;YACD,OAAO,IAAI,CAAC;QACd,KAAK,SAAS,CAAC,cAAc,CAAC,CAAC;YAC7B,IAAI,OAAO,IAAI,KAAK,EAAE;gBACpB,OAAO,oBAAC,mBAAmB,IAAC,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAI,CAAC;aAC5I;YACD,OAAO,IAAI,CAAC;SACb;QACD;YACE,OAAO,IAAI,CAAC;KACf;AACH,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 React from \"react\";\nimport { useGroupingMappingApiConfig } from \"../../components/context/GroupingApiConfigContext\";\nimport { GroupAction } from \"../../components/Groups/Editing/GroupAction\";\nimport type { Route } from \"../GroupingMapping\";\nimport { RouteStep } from \"../GroupingMapping\";\nimport { GroupPropertyAction } from \"../../components/Properties/GroupProperties/GroupPropertyAction\";\nimport { Mappings } from \"../../components/Mappings/Mappings\";\nimport { MappingAction } from \"../../components/Mappings/Editing/MappingAction\";\nimport { PropertyMenuWithVisualization } from \"../../components/Properties/PropertyMenuWithVisualization\";\nimport { GroupsVisualization } from \"../../components/Groups/GroupsVisualization\";\nimport { useGroupHilitedElementsContext } from \"../../components/context/GroupHilitedElementsContext\";\nimport { GroupingMappingWidget as GMWidget } from \"../../GroupingMappingWidget\";\n\nexport const GroupingMappingRouter = ({\n currentRoute,\n navigateTo,\n goBack,\n hideRefreshIcon,\n groupsAction,\n}: {\n currentRoute: Route;\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n hideRefreshIcon?: boolean;\n groupsAction?: JSX.Element;\n}) => {\n const { iModelId } = useGroupingMappingApiConfig();\n const { mapping, group, property, groupContextCustomUI, queryGenerationType } = currentRoute.groupingRouteFields;\n const { showGroupColor, groupColors } = useGroupHilitedElementsContext();\n\n switch (currentRoute.step) {\n case RouteStep.Mappings:\n return (\n <Mappings\n onClickAddMapping={() => navigateTo(() => ({ step: RouteStep.MappingsAction, title: GMWidget.translate(\"mappings.addMapping\"), groupingRouteFields: {} }))}\n onClickMappingTitle={(mapping) => {\n navigateTo(() => ({\n step: RouteStep.Groups,\n groupingRouteFields: { mapping },\n title: mapping.mappingName,\n }));\n }}\n onClickMappingModify={(mapping) => {\n navigateTo(() => ({\n step: RouteStep.MappingsAction,\n groupingRouteFields: { mapping },\n title: mapping.mappingName,\n }));\n }}\n hideRefreshIcon={hideRefreshIcon}\n />\n );\n case RouteStep.MappingsAction:\n return <MappingAction mapping={mapping} onClickCancel={goBack} onSaveSuccess={goBack} />;\n case RouteStep.Groups:\n if (mapping) {\n return (\n <GroupsVisualization\n mapping={mapping}\n onClickAddGroup={(qType) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupAction,\n groupingRouteFields: { ...prev?.groupingRouteFields, queryGenerationType: qType },\n title: GMWidget.translate(\"groups.addGroup\"),\n }))\n }\n onClickGroupTitle={(g) =>\n navigateTo((prev) => ({\n step: RouteStep.Properties,\n title: g.groupName,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g },\n }))\n }\n onClickGroupModify={(g, qType) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupAction,\n title: g.groupName,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g, queryGenerationType: qType },\n }))\n }\n onClickRenderContextCustomUI={(ccUI, g, displayLabel) =>\n navigateTo((prev) => ({\n step: RouteStep.GroupContextCustomUI,\n title: displayLabel,\n groupingRouteFields: { ...prev?.groupingRouteFields, group: g, groupContextCustomUI: ccUI },\n }))\n }\n hideRefreshIcon={hideRefreshIcon}\n groupsAction={groupsAction}\n />\n );\n }\n return null;\n case RouteStep.GroupAction:\n if (mapping) {\n if (queryGenerationType) {\n return (\n <GroupAction\n shouldVisualize\n mappingId={mapping.id}\n group={group}\n onClickCancel={goBack}\n onSaveSuccess={goBack}\n queryGenerationType={queryGenerationType}\n />\n );\n }\n }\n return null;\n case RouteStep.GroupContextCustomUI:\n if (mapping && group && groupContextCustomUI) {\n return React.createElement(groupContextCustomUI, {\n iModelId,\n mappingId: mapping.id,\n groupId: group.id,\n });\n }\n return null;\n case RouteStep.Properties:\n if (mapping && group) {\n return (\n <PropertyMenuWithVisualization\n mapping={mapping}\n group={group}\n color={showGroupColor ? groupColors.get(group.id) ?? \"red\" : \"red\"}\n onClickAddGroupProperty={() =>\n navigateTo((prev) => ({ step: RouteStep.PropertyAction, title: GMWidget.translate(\"properties.addPropertyTitle\"), groupingRouteFields: { ...prev?.groupingRouteFields } }))\n }\n onClickModifyGroupProperty={(gp) =>\n navigateTo((prev) => ({\n step: RouteStep.PropertyAction,\n title: gp.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, property: gp },\n }))\n }\n onClickAddCalculatedProperty={() =>\n navigateTo((prev) => ({\n step: RouteStep.CalculatedPropertyAction,\n title: GMWidget.translate(\"properties.createCalculatedProperty\"),\n groupingRouteFields: { ...prev?.groupingRouteFields },\n }))\n }\n onClickModifyCalculatedProperty={(cp) =>\n navigateTo((prev) => ({\n step: RouteStep.CalculatedPropertyAction,\n title: cp.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, calculatedProperty: cp },\n }))\n }\n onClickAddCustomCalculationProperty={() =>\n navigateTo((prev) => ({\n step: RouteStep.CustomCalculationPropertyAction,\n title: GMWidget.translate(\"properties.createCustomCalculation\"),\n groupingRouteFields: { ...prev?.groupingRouteFields },\n }))\n }\n onClickModifyCustomCalculation={(cc) =>\n navigateTo((prev) => ({\n step: RouteStep.CustomCalculationPropertyAction,\n title: cc.propertyName,\n groupingRouteFields: { ...prev?.groupingRouteFields, customCalculation: cc },\n }))\n }\n hideRefreshIcon={hideRefreshIcon}\n />\n );\n }\n return null;\n case RouteStep.PropertyAction: {\n if (mapping && group) {\n return <GroupPropertyAction mappingId={mapping.id} group={group} groupProperty={property} onSaveSuccess={goBack} onClickCancel={goBack} />;\n }\n return null;\n }\n default:\n return null;\n }\n};\n"]}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SvgChevronLeft } from "@itwin/itwinui-icons-react";
|
|
6
6
|
import { Icon, Text } from "@itwin/itwinui-react";
|
|
7
|
-
import "./WidgetHeader.scss";
|
|
8
7
|
import React from "react";
|
|
8
|
+
import { GroupingMappingWidget } from "../../GroupingMappingWidget";
|
|
9
|
+
import "./WidgetHeader.scss";
|
|
9
10
|
export const WidgetHeader = ({ title, disabled = false, returnFn }) => {
|
|
10
11
|
return (React.createElement("div", { className: "gmw-widget-header-container" },
|
|
11
|
-
returnFn && (React.createElement(Icon, { className: `${disabled ? "gmw-chevron-disabled" : "gmw-chevron"}`, size: "large", onClick: disabled ? undefined : returnFn, title: "
|
|
12
|
+
returnFn && (React.createElement(Icon, { className: `${disabled ? "gmw-chevron-disabled" : "gmw-chevron"}`, size: "large", onClick: disabled ? undefined : returnFn, title: GroupingMappingWidget.translate("common.back") },
|
|
12
13
|
React.createElement(SvgChevronLeft, null))),
|
|
13
14
|
React.createElement(Text, { className: "gmw-title", variant: "title" }, title)));
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetHeader.js","sourceRoot":"","sources":["../../../../src/WidgetShell/WidgetHeader/WidgetHeader.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"WidgetHeader.js","sourceRoot":"","sources":["../../../../src/WidgetShell/WidgetHeader/WidgetHeader.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,qBAAqB,CAAC;AAQ7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,6BAAK,SAAS,EAAC,6BAA6B;QACzC,QAAQ,IAAI,CACX,oBAAC,IAAI,IAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;YACnL,oBAAC,cAAc,OAAG,CACb,CACR;QACD,oBAAC,IAAI,IAAC,SAAS,EAAC,WAAW,EAAC,OAAO,EAAC,OAAO,IACxC,KAAK,CACD,CACH,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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport { Icon, Text } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\nimport \"./WidgetHeader.scss\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({ title, disabled = false, returnFn }: WidgetHeaderProps) => {\n return (\n <div className=\"gmw-widget-header-container\">\n {returnFn && (\n <Icon className={`${disabled ? \"gmw-chevron-disabled\" : \"gmw-chevron\"}`} size=\"large\" onClick={disabled ? undefined : returnFn} title={GroupingMappingWidget.translate(\"common.back\")}>\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"gmw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n"]}
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { QueryRowFormat } from "@itwin/core-common";
|
|
6
6
|
import { IModelApp } from "@itwin/core-frontend";
|
|
7
7
|
import { toaster } from "@itwin/itwinui-react";
|
|
8
|
+
import { GroupingMappingWidget } from "../GroupingMappingWidget";
|
|
8
9
|
export function debounce(f, delay) {
|
|
9
10
|
let timer;
|
|
10
11
|
return (...args) => {
|
|
@@ -40,29 +41,29 @@ export const fetchIdsFromQuery = async (query, iModelConnection) => {
|
|
|
40
41
|
export const getErrorMessage = (errorStatus) => {
|
|
41
42
|
switch (errorStatus) {
|
|
42
43
|
case 401:
|
|
43
|
-
return "
|
|
44
|
+
return GroupingMappingWidget.translate("errors.unauthorized");
|
|
44
45
|
case 403:
|
|
45
|
-
return "
|
|
46
|
+
return GroupingMappingWidget.translate("errors.forbidden");
|
|
46
47
|
case 404:
|
|
47
|
-
return "
|
|
48
|
+
return GroupingMappingWidget.translate("errors.notFound");
|
|
48
49
|
case 409:
|
|
49
|
-
return "
|
|
50
|
+
return GroupingMappingWidget.translate("errors.conflict");
|
|
50
51
|
case 422:
|
|
51
|
-
return "
|
|
52
|
+
return GroupingMappingWidget.translate("errors.unprocessable");
|
|
52
53
|
case 429:
|
|
53
|
-
return "
|
|
54
|
+
return GroupingMappingWidget.translate("errors.tooManyRequests");
|
|
54
55
|
case 500:
|
|
55
|
-
return "
|
|
56
|
+
return GroupingMappingWidget.translate("errors.internalServerError");
|
|
56
57
|
case 502:
|
|
57
|
-
return "
|
|
58
|
+
return GroupingMappingWidget.translate("errors.badGateway");
|
|
58
59
|
case 503:
|
|
59
|
-
return "
|
|
60
|
+
return GroupingMappingWidget.translate("errors.serviceUnavailable");
|
|
60
61
|
default:
|
|
61
|
-
return "
|
|
62
|
+
return GroupingMappingWidget.translate("errors.generic");
|
|
62
63
|
}
|
|
63
64
|
};
|
|
64
65
|
export const handleError = (errorStatus) => {
|
|
65
|
-
const baseErrorMessage = "
|
|
66
|
+
const baseErrorMessage = GroupingMappingWidget.translate("errors.errorPrefix");
|
|
66
67
|
const specificErrorMessage = getErrorMessage(errorStatus);
|
|
67
68
|
const fullErrorMessage = `${baseErrorMessage} ${specificErrorMessage}`;
|
|
68
69
|
toaster.negative(fullErrorMessage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,E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AC,CAAC;KACjE;IAED,OAAO,KAAK,CAAC;AACf,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 { QueryRowFormat } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n\nexport function debounce<F extends (...args: any[]) => void>(f: F, delay: number) {\n let timer: number | undefined;\n return (...args: any[]) => {\n timer && window.clearTimeout(timer);\n timer = window.setTimeout(f, delay, ...args);\n };\n}\n\nexport const fetchIdsFromQuery = async (query: string, iModelConnection: IModelConnection) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n } else if (Object.keys(value).includes(\"eCInstanceId\")) {\n ids.push(value.eCInstanceId);\n }\n }\n return ids;\n};\n\nexport const getErrorMessage = (errorStatus: number): string => {\n switch (errorStatus) {\n case 401:\n return GroupingMappingWidget.translate(\"errors.unauthorized\");\n case 403:\n return GroupingMappingWidget.translate(\"errors.forbidden\");\n case 404:\n return GroupingMappingWidget.translate(\"errors.notFound\");\n case 409:\n return GroupingMappingWidget.translate(\"errors.conflict\");\n case 422:\n return GroupingMappingWidget.translate(\"errors.unprocessable\");\n case 429:\n return GroupingMappingWidget.translate(\"errors.tooManyRequests\");\n case 500:\n return GroupingMappingWidget.translate(\"errors.internalServerError\");\n case 502:\n return GroupingMappingWidget.translate(\"errors.badGateway\");\n case 503:\n return GroupingMappingWidget.translate(\"errors.serviceUnavailable\");\n default:\n return GroupingMappingWidget.translate(\"errors.generic\");\n }\n};\n\nexport const handleError = (errorStatus: number) => {\n const baseErrorMessage = GroupingMappingWidget.translate(\"errors.errorPrefix\");\n const specificErrorMessage = getErrorMessage(errorStatus);\n const fullErrorMessage = `${baseErrorMessage} ${specificErrorMessage}`;\n\n toaster.negative(fullErrorMessage);\n};\n\nexport const handleInputChange = <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: (newValues: T) => void) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const enableExperimentalFeatures = async (iModelConnection: IModelConnection) => {\n const reader = iModelConnection.createQueryReader(\"PRAGMA experimental_features_enabled=true\");\n await reader.step();\n};\n\nexport const getLocalizedStringPresentation = (input: string): string => {\n // https://www.itwinjs.org/presentation/advanced/localization/\n // Check if the string starts and ends with \"@\"\n if (input.startsWith(\"@\") && input.endsWith(\"@\")) {\n // Remove the leading and trailing \"@\" from the string\n const trimmedString = input.substring(1, input.length - 1);\n\n return IModelApp.localization.getLocalizedString(trimmedString);\n }\n\n return input;\n};\n"]}
|
|
@@ -18,6 +18,7 @@ import { TErrCodes } from "./Constants";
|
|
|
18
18
|
import { ExtractionStatusJobContext } from "./context/ExtractionStateJobContext";
|
|
19
19
|
import { createGroupsClient, GroupsClientContext } from "./context/GroupsClientContext";
|
|
20
20
|
import { createPropertiesClient, PropertiesClientContext } from "./context/PropertiesClientContext";
|
|
21
|
+
import { GroupingMappingWidget } from "../GroupingMappingWidget";
|
|
21
22
|
const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
22
23
|
const defaultQueryClient = new QueryClient({
|
|
23
24
|
defaultOptions: {
|
|
@@ -36,7 +37,7 @@ const defaultQueryClient = new QueryClient({
|
|
|
36
37
|
if (error.status)
|
|
37
38
|
toaster.negative(getErrorMessage(error.status));
|
|
38
39
|
else
|
|
39
|
-
toaster.negative("
|
|
40
|
+
toaster.negative(GroupingMappingWidget.translate("errors.fetchError"));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
},
|
|
@@ -46,7 +47,7 @@ const defaultQueryClient = new QueryClient({
|
|
|
46
47
|
if (error.status)
|
|
47
48
|
toaster.negative(getErrorMessage(error.status));
|
|
48
49
|
else
|
|
49
|
-
toaster.negative("
|
|
50
|
+
toaster.negative(GroupingMappingWidget.translate("errors.networkError"));
|
|
50
51
|
},
|
|
51
52
|
}),
|
|
52
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingContext.js","sourceRoot":"","sources":["../../../src/components/GroupingMappingContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAGzH,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEpG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAA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K,EAAE,gBAAgB;4BACvD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,8BAA8B;gCACxE,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,oBAAoB;oCAClE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,2BAA2B;wCACtE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,IAAG,KAAK,CAAC,QAAQ,CAAwC,CACvF,CACC,CACN,CACL,CACF,CACN,CACD,CACS,CACvB,CACvB,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 React, { useEffect, useMemo, useState } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { GroupingMappingApiConfigContext } from \"./context/GroupingApiConfigContext\";\nimport { createMappingClient, MappingClientContext } from \"./context/MappingClientContext\";\nimport type { Group, IExtractionClient, IGroupsClient, IMappingsClient, IPropertiesClient } from \"@itwin/insights-client\";\nimport { createGroupingMappingCustomUI, GroupingMappingCustomUIContext } from \"./context/GroupingMappingCustomUIContext\";\nimport type { GroupingMappingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport type { OverlappedElementsMetadata } from \"./context/GroupHilitedElementsContext\";\nimport { GroupHilitedElementsContext } from \"./context/GroupHilitedElementsContext\";\nimport { PropertiesGroupColorContext } from \"./context/PropertiesGroupColorContext\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { createExtractionClient, ExtractionClientContext } from \"./context/ExtractionClientContext\";\nimport type { Query } from \"@tanstack/react-query\";\nimport { MutationCache, QueryCache, QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { getErrorMessage } from \"../common/utils\";\nimport { TErrCodes } from \"./Constants\";\nimport { ExtractionStatusJobContext } from \"./context/ExtractionStateJobContext\";\nimport { createGroupsClient, GroupsClientContext } from \"./context/GroupsClientContext\";\nimport { createPropertiesClient, PropertiesClientContext } from \"./context/PropertiesClientContext\";\n\n/**\n * Props for the {@link GroupingMappingContext} component.\n * @public\n */\nexport interface GroupingMappingContextProps {\n /**\n * Custom callback to retrieve access token.\n */\n getAccessToken?: GetAccessTokenFn;\n /**\n * The iTwin iModel Id.\n */\n iModelId: string;\n /**\n * Used for iTwin and iModel APIs.\n * Also used for Mapping API if a custom IMappingsClient is not provided.\n */\n changeSetId?: string;\n prefix?: ClientPrefix;\n /**\n * A custom implementation of MappingClient.\n */\n mappingsClient?: IMappingsClient;\n /**\n * A custom implementation of GroupsClient.\n */\n groupsClient?: IGroupsClient;\n /**\n * A custom implementation of PropertiesClient.\n */\n propertiesClient?: IPropertiesClient;\n /**\n * A custom implementation of ExtractionClient.\n */\n extractionClient?: IExtractionClient;\n /**\n * Custom UI to add and update groups or provide additional group context capabilities.\n */\n customUIs?: GroupingMappingCustomUI[];\n /**\n * A custom iModelConnection to use instead of the active iModelConnection from UiFramework.\n */\n iModelConnection?: IModelConnection;\n /**\n * A custom QueryClient. If not provided, a default QueryClient will be used.\n */\n queryClient?: QueryClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n staleTime: 20 * 60 * 1000, // 20 minutes\n },\n },\n queryCache: new QueryCache({\n onError: (error: any, query: Query) => {\n switch (query.meta?.errorCode) {\n case TErrCodes.QUERY_HILITE_FETCH_FAILED:\n toaster.negative(query.meta?.message as string);\n break;\n default: {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(\"An error occurred while fetching data.\");\n }\n }\n },\n }),\n mutationCache: new MutationCache({\n onError: (error: any) => {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(\"A network error occured while processing this action.\");\n },\n }),\n});\n\n/**\n * Grouping and Mapping Context providers required for all components.\n * @public\n */\nexport const GroupingMappingContext = (props: GroupingMappingContextProps) => {\n const activeIModelConnection = useActiveIModelConnection();\n const mappingsClientProp: IMappingsClient | ClientPrefix = props.mappingsClient ?? props.prefix;\n const groupsClientProp: IGroupsClient | ClientPrefix = props.groupsClient ?? props.prefix;\n const propertiesClientProp: IPropertiesClient | ClientPrefix = props.propertiesClient ?? props.prefix;\n const extractionClientProp: IExtractionClient | ClientPrefix = props.extractionClient ?? props.prefix;\n const [mappingClient, setMappingClient] = useState<IMappingsClient>(createMappingClient(mappingsClientProp));\n const [groupsClient, setGroupsClient] = useState<IGroupsClient>(createGroupsClient(groupsClientProp));\n const [propertiesClient, setPropertiesClient] = useState<IPropertiesClient>(createPropertiesClient(propertiesClientProp));\n const [extractionClient, setExtractionClient] = useState<IExtractionClient>(createExtractionClient(extractionClientProp));\n const [customUIs, setCustomUIs] = useState<GroupingMappingCustomUI[]>(createGroupingMappingCustomUI(props.customUIs));\n const [apiConfig, setApiConfig] = useState<GroupingMappingApiConfig>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelId: props.iModelId,\n prefix: props.prefix,\n changeSetId: props.changeSetId,\n });\n const [hiddenGroupsIds, setHiddenGroupsIds] = useState<Set<string>>(new Set());\n const [showGroupColor, setShowGroupColor] = useState<boolean>(false);\n const [propertiesShowGroup, setPropertiesShowGroup] = useState<boolean>(false);\n const [groupColors, setGroupColors] = useState<Map<string, string>>(new Map());\n const [groups, setGroups] = useState<Group[]>([]);\n const [numberOfVisualizedGroups, setNumberOfVisualizedGroups] = useState(0);\n const [isOverlappedColored, setIsOverlappedColored] = useState<boolean>(false);\n const [currentHilitedGroups, setCurrentHilitedGroups] = useState<number>(1);\n const [isVisualizationsEnabled, setIsVisualizationsEnabled] = useState<boolean>(false);\n const [overlappedElementsMetadata, setOverlappedElementsMetadata] = useState<OverlappedElementsMetadata>({\n overlappedElementsInfo: new Map(),\n groupElementsInfo: new Map(),\n overlappedElementGroupPairs: [],\n });\n const queryClient = props.queryClient ?? defaultQueryClient;\n const [mappingIdJobInfo, setMappingIdJobInfo] = useState<Map<string, string>>(new Map());\n\n useEffect(() => {\n setApiConfig(() => ({\n prefix: props.prefix,\n iModelId: props.iModelId,\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelConnection: props.iModelConnection ?? activeIModelConnection,\n changeSetId: props.changeSetId,\n }));\n }, [activeIModelConnection, props.changeSetId, props.getAccessToken, props.iModelConnection, props.iModelId, props.prefix]);\n\n useEffect(() => {\n setMappingClient(createMappingClient(mappingsClientProp));\n }, [mappingsClientProp]);\n\n useEffect(() => {\n setGroupsClient(createGroupsClient(groupsClientProp));\n }, [groupsClientProp]);\n\n useEffect(() => {\n setPropertiesClient(createPropertiesClient(propertiesClientProp));\n }, [propertiesClientProp]);\n\n useEffect(() => {\n setExtractionClient(createExtractionClient(extractionClientProp));\n }, [extractionClientProp]);\n\n useEffect(() => {\n setCustomUIs(createGroupingMappingCustomUI(props.customUIs));\n }, [props.customUIs]);\n\n const hilitedElementsContextValue = useMemo(\n () => ({\n showGroupColor,\n setShowGroupColor,\n hiddenGroupsIds,\n setHiddenGroupsIds,\n groups,\n setGroups,\n numberOfVisualizedGroups,\n setNumberOfVisualizedGroups,\n isOverlappedColored,\n setIsOverlappedColored,\n currentHilitedGroups,\n setCurrentHilitedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n groupColors,\n setGroupColors,\n }),\n [\n showGroupColor,\n hiddenGroupsIds,\n groups,\n numberOfVisualizedGroups,\n isOverlappedColored,\n currentHilitedGroups,\n isVisualizationsEnabled,\n overlappedElementsMetadata,\n groupColors,\n setGroupColors,\n ],\n );\n\n const propertiesContextValue = useMemo(\n () => ({\n showGroupColor: propertiesShowGroup,\n setShowGroupColor: setPropertiesShowGroup,\n }),\n [propertiesShowGroup],\n );\n\n const customUIContextValue = useMemo(\n () => ({\n customUIs,\n setCustomUIs,\n }),\n [customUIs],\n );\n\n const extractionStateJobContextValue = useMemo(\n () => ({\n mappingIdJobInfo,\n setMappingIdJobInfo,\n }),\n [mappingIdJobInfo],\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <GroupingMappingApiConfigContext.Provider value={apiConfig}>\n <MappingClientContext.Provider value={mappingClient}>\n <GroupsClientContext.Provider value={groupsClient}>\n <PropertiesClientContext.Provider value={propertiesClient}>\n <ExtractionClientContext.Provider value={extractionClient}>\n <ExtractionStatusJobContext.Provider value={extractionStateJobContextValue}>\n <GroupingMappingCustomUIContext.Provider value={customUIContextValue}>\n <GroupHilitedElementsContext.Provider value={hilitedElementsContextValue}>\n <PropertiesGroupColorContext.Provider value={propertiesContextValue}>{props.children}</PropertiesGroupColorContext.Provider>\n </GroupHilitedElementsContext.Provider>\n </GroupingMappingCustomUIContext.Provider>\n </ExtractionStatusJobContext.Provider>\n </ExtractionClientContext.Provider>\n </PropertiesClientContext.Provider>\n </GroupsClientContext.Provider>\n </MappingClientContext.Provider>\n </GroupingMappingApiConfigContext.Provider>\n </QueryClientProvider>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupingMappingContext.js","sourceRoot":"","sources":["../../../src/components/GroupingMappingContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAA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EAAE,CAAC,CAAC;QACL,SAAS;QACT,YAAY;KACb,CAAC,EACF,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,8BAA8B,GAAG,OAAO,CAC5C,GAAG,EAAE,CAAC,CAAC;QACL,gBAAgB;QAChB,mBAAmB;KACpB,CAAC,EACF,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;QACtC,oBAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS;YACxD,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa;gBACjD,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;oBAC/C,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB;wBACvD,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB;4BACvD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,8BAA8B;gCACxE,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,oBAAoB;oCAClE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,2BAA2B;wCACtE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,IAAG,KAAK,CAAC,QAAQ,CAAwC,CACvF,CACC,CACN,CACL,CACF,CACN,CACD,CACS,CACvB,CACvB,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 React, { useEffect, useMemo, useState } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { GroupingMappingApiConfigContext } from \"./context/GroupingApiConfigContext\";\nimport { createMappingClient, MappingClientContext } from \"./context/MappingClientContext\";\nimport type { Group, IExtractionClient, IGroupsClient, IMappingsClient, IPropertiesClient } from \"@itwin/insights-client\";\nimport { createGroupingMappingCustomUI, GroupingMappingCustomUIContext } from \"./context/GroupingMappingCustomUIContext\";\nimport type { GroupingMappingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport type { OverlappedElementsMetadata } from \"./context/GroupHilitedElementsContext\";\nimport { GroupHilitedElementsContext } from \"./context/GroupHilitedElementsContext\";\nimport { PropertiesGroupColorContext } from \"./context/PropertiesGroupColorContext\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { createExtractionClient, ExtractionClientContext } from \"./context/ExtractionClientContext\";\nimport type { Query } from \"@tanstack/react-query\";\nimport { MutationCache, QueryCache, QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { getErrorMessage } from \"../common/utils\";\nimport { TErrCodes } from \"./Constants\";\nimport { ExtractionStatusJobContext } from \"./context/ExtractionStateJobContext\";\nimport { createGroupsClient, GroupsClientContext } from \"./context/GroupsClientContext\";\nimport { createPropertiesClient, PropertiesClientContext } from \"./context/PropertiesClientContext\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\n\n/**\n * Props for the {@link GroupingMappingContext} component.\n * @public\n */\nexport interface GroupingMappingContextProps {\n /**\n * Custom callback to retrieve access token.\n */\n getAccessToken?: GetAccessTokenFn;\n /**\n * The iTwin iModel Id.\n */\n iModelId: string;\n /**\n * Used for iTwin and iModel APIs.\n * Also used for Mapping API if a custom IMappingsClient is not provided.\n */\n changeSetId?: string;\n prefix?: ClientPrefix;\n /**\n * A custom implementation of MappingClient.\n */\n mappingsClient?: IMappingsClient;\n /**\n * A custom implementation of GroupsClient.\n */\n groupsClient?: IGroupsClient;\n /**\n * A custom implementation of PropertiesClient.\n */\n propertiesClient?: IPropertiesClient;\n /**\n * A custom implementation of ExtractionClient.\n */\n extractionClient?: IExtractionClient;\n /**\n * Custom UI to add and update groups or provide additional group context capabilities.\n */\n customUIs?: GroupingMappingCustomUI[];\n /**\n * A custom iModelConnection to use instead of the active iModelConnection from UiFramework.\n */\n iModelConnection?: IModelConnection;\n /**\n * A custom QueryClient. If not provided, a default QueryClient will be used.\n */\n queryClient?: QueryClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n staleTime: 20 * 60 * 1000, // 20 minutes\n },\n },\n queryCache: new QueryCache({\n onError: (error: any, query: Query) => {\n switch (query.meta?.errorCode) {\n case TErrCodes.QUERY_HILITE_FETCH_FAILED:\n toaster.negative(query.meta?.message as string);\n break;\n default: {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(GroupingMappingWidget.translate(\"errors.fetchError\"));\n }\n }\n },\n }),\n mutationCache: new MutationCache({\n onError: (error: any) => {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(GroupingMappingWidget.translate(\"errors.networkError\"));\n },\n }),\n});\n\n/**\n * Grouping and Mapping Context providers required for all components.\n * @public\n */\nexport const GroupingMappingContext = (props: GroupingMappingContextProps) => {\n const activeIModelConnection = useActiveIModelConnection();\n const mappingsClientProp: IMappingsClient | ClientPrefix = props.mappingsClient ?? props.prefix;\n const groupsClientProp: IGroupsClient | ClientPrefix = props.groupsClient ?? props.prefix;\n const propertiesClientProp: IPropertiesClient | ClientPrefix = props.propertiesClient ?? props.prefix;\n const extractionClientProp: IExtractionClient | ClientPrefix = props.extractionClient ?? props.prefix;\n const [mappingClient, setMappingClient] = useState<IMappingsClient>(createMappingClient(mappingsClientProp));\n const [groupsClient, setGroupsClient] = useState<IGroupsClient>(createGroupsClient(groupsClientProp));\n const [propertiesClient, setPropertiesClient] = useState<IPropertiesClient>(createPropertiesClient(propertiesClientProp));\n const [extractionClient, setExtractionClient] = useState<IExtractionClient>(createExtractionClient(extractionClientProp));\n const [customUIs, setCustomUIs] = useState<GroupingMappingCustomUI[]>(createGroupingMappingCustomUI(props.customUIs));\n const [apiConfig, setApiConfig] = useState<GroupingMappingApiConfig>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelId: props.iModelId,\n prefix: props.prefix,\n changeSetId: props.changeSetId,\n });\n const [hiddenGroupsIds, setHiddenGroupsIds] = useState<Set<string>>(new Set());\n const [showGroupColor, setShowGroupColor] = useState<boolean>(false);\n const [propertiesShowGroup, setPropertiesShowGroup] = useState<boolean>(false);\n const [groupColors, setGroupColors] = useState<Map<string, string>>(new Map());\n const [groups, setGroups] = useState<Group[]>([]);\n const [numberOfVisualizedGroups, setNumberOfVisualizedGroups] = useState(0);\n const [isOverlappedColored, setIsOverlappedColored] = useState<boolean>(false);\n const [currentHilitedGroups, setCurrentHilitedGroups] = useState<number>(1);\n const [isVisualizationsEnabled, setIsVisualizationsEnabled] = useState<boolean>(false);\n const [overlappedElementsMetadata, setOverlappedElementsMetadata] = useState<OverlappedElementsMetadata>({\n overlappedElementsInfo: new Map(),\n groupElementsInfo: new Map(),\n overlappedElementGroupPairs: [],\n });\n const queryClient = props.queryClient ?? defaultQueryClient;\n const [mappingIdJobInfo, setMappingIdJobInfo] = useState<Map<string, string>>(new Map());\n\n useEffect(() => {\n setApiConfig(() => ({\n prefix: props.prefix,\n iModelId: props.iModelId,\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelConnection: props.iModelConnection ?? activeIModelConnection,\n changeSetId: props.changeSetId,\n }));\n }, [activeIModelConnection, props.changeSetId, props.getAccessToken, props.iModelConnection, props.iModelId, props.prefix]);\n\n useEffect(() => {\n setMappingClient(createMappingClient(mappingsClientProp));\n }, [mappingsClientProp]);\n\n useEffect(() => {\n setGroupsClient(createGroupsClient(groupsClientProp));\n }, [groupsClientProp]);\n\n useEffect(() => {\n setPropertiesClient(createPropertiesClient(propertiesClientProp));\n }, [propertiesClientProp]);\n\n useEffect(() => {\n setExtractionClient(createExtractionClient(extractionClientProp));\n }, [extractionClientProp]);\n\n useEffect(() => {\n setCustomUIs(createGroupingMappingCustomUI(props.customUIs));\n }, [props.customUIs]);\n\n const hilitedElementsContextValue = useMemo(\n () => ({\n showGroupColor,\n setShowGroupColor,\n hiddenGroupsIds,\n setHiddenGroupsIds,\n groups,\n setGroups,\n numberOfVisualizedGroups,\n setNumberOfVisualizedGroups,\n isOverlappedColored,\n setIsOverlappedColored,\n currentHilitedGroups,\n setCurrentHilitedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n groupColors,\n setGroupColors,\n }),\n [\n showGroupColor,\n hiddenGroupsIds,\n groups,\n numberOfVisualizedGroups,\n isOverlappedColored,\n currentHilitedGroups,\n isVisualizationsEnabled,\n overlappedElementsMetadata,\n groupColors,\n setGroupColors,\n ],\n );\n\n const propertiesContextValue = useMemo(\n () => ({\n showGroupColor: propertiesShowGroup,\n setShowGroupColor: setPropertiesShowGroup,\n }),\n [propertiesShowGroup],\n );\n\n const customUIContextValue = useMemo(\n () => ({\n customUIs,\n setCustomUIs,\n }),\n [customUIs],\n );\n\n const extractionStateJobContextValue = useMemo(\n () => ({\n mappingIdJobInfo,\n setMappingIdJobInfo,\n }),\n [mappingIdJobInfo],\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <GroupingMappingApiConfigContext.Provider value={apiConfig}>\n <MappingClientContext.Provider value={mappingClient}>\n <GroupsClientContext.Provider value={groupsClient}>\n <PropertiesClientContext.Provider value={propertiesClient}>\n <ExtractionClientContext.Provider value={extractionClient}>\n <ExtractionStatusJobContext.Provider value={extractionStateJobContextValue}>\n <GroupingMappingCustomUIContext.Provider value={customUIContextValue}>\n <GroupHilitedElementsContext.Provider value={hilitedElementsContextValue}>\n <PropertiesGroupColorContext.Provider value={propertiesContextValue}>{props.children}</PropertiesGroupColorContext.Provider>\n </GroupHilitedElementsContext.Provider>\n </GroupingMappingCustomUIContext.Provider>\n </ExtractionStatusJobContext.Provider>\n </ExtractionClientContext.Provider>\n </PropertiesClientContext.Provider>\n </GroupsClientContext.Provider>\n </MappingClientContext.Provider>\n </GroupingMappingApiConfigContext.Provider>\n </QueryClientProvider>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./GroupAction.scss";
|
|
3
3
|
import type { GroupMinimal } from "@itwin/insights-client";
|
|
4
|
-
declare const
|
|
4
|
+
declare const getDefaultDisplayStrings: () => {
|
|
5
5
|
groupDetails: string;
|
|
6
6
|
groupBy: string;
|
|
7
7
|
};
|
|
@@ -16,7 +16,7 @@ export interface GroupActionProps {
|
|
|
16
16
|
queryGenerationType: string;
|
|
17
17
|
onSaveSuccess: () => void;
|
|
18
18
|
onClickCancel?: () => void;
|
|
19
|
-
displayStrings?: Partial<typeof
|
|
19
|
+
displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Component to create or update a group.
|