@itwin/grouping-mapping-widget 0.35.3 → 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 +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,sDAAoD;AACpD,qFAAqF;AAErF,mFAAgF;AAChF,sFAAgF;
|
|
1
|
+
{"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,sDAAoD;AACpD,qFAAqF;AAErF,mFAAgF;AAChF,sFAAgF;AAChF,0EAAuE;AAavE;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAAC,EAClD,KAAK,EACL,sBAAsB,EACtB,SAAS,EACT,yBAAyB,GACgB,EAAE,EAAE;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,GAAuC,CAAC;IAC1F,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,GAA0C,CAAC;IACzG,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACnE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,4CAAmB,EAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAEpE,MAAM,iBAAiB,GAAG,IAAA,eA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AyB,EACpD,YAAY,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAC1D,8BAAC,wBAAQ;oBACP,uCAAK,SAAS,EAAC,qBAAqB;wBAClC,2CAAM,MAAM,CAAC,KAAK,CAAO;wBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACG,CACZ,EACD,oBAAoB,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAClE,uCAAK,SAAS,EAAC,iBAAiB;oBAC9B,2CAAM,MAAM,CAAC,KAAK,CAAO;oBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACP,GACD,CACS,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AAnGW,QAAA,mCAAmC,uCAmG9C","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 { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { InputGroup, MenuItem, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { BboxDimension, BboxDimensionsDecorator } from \"../../../decorators/BboxDimensionsDecorator\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../../common/viewerUtils\";\nimport \"./CalculatedPropertyActionWithVisuals.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedPropertyType, GroupMinimal } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupKeySetQuery } from \"../../Groups/hooks/useKeySetHiliteQueries\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link CalculatedPropertyActionWithVisuals} component.\n * @internal\n */\nexport interface CalculatedPropertyActionWithVisualsProps {\n group: GroupMinimal;\n calculatedPropertyType?: CalculatedPropertyType;\n isLoading?: boolean;\n setCalculatedPropertyType: (calculatedPropertyType: CalculatedPropertyType | undefined) => void;\n}\n\n/**\n * Component to create or update a calculated property with visualizations.\n * @internal\n */\nexport const CalculatedPropertyActionWithVisuals = ({\n group,\n calculatedPropertyType,\n isLoading,\n setCalculatedPropertyType,\n}: CalculatedPropertyActionWithVisualsProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [bboxDecorator, setBboxDecorator] = useState<BboxDimensionsDecorator | undefined>();\n const [inferredSpatialData, setInferredSpatialData] = useState<Map<BboxDimension, number> | undefined>();\n const [colorProperty, setColorProperty] = useState<boolean>(false);\n const { data } = useGroupKeySetQuery(group, iModelConnection, true);\n\n const resolvedHiliteIds = useMemo(() => {\n // Resolved ids, default to an empty array if not available\n return data?.result?.ids ?? [];\n }, [data?.result?.ids]);\n\n useEffect(() => {\n const decorator = new BboxDimensionsDecorator();\n IModelApp.viewManager.addDecorator(decorator);\n setBboxDecorator(decorator);\n return () => {\n IModelApp.viewManager.dropDecorator(decorator);\n };\n }, []);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n clearAll();\n return;\n }\n visualizeElements(resolvedHiliteIds, \"red\");\n void zoomToElements([resolvedHiliteIds[0]]);\n }, [colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n return;\n }\n const setContext = async () => {\n if (bboxDecorator) {\n await bboxDecorator.setContext(resolvedHiliteIds[0]);\n setInferredSpatialData(bboxDecorator.getInferredSpatialData());\n }\n };\n void setContext();\n }, [bboxDecorator, colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {\n inferredSpatialData.has(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension]) && colorProperty\n ? bboxDecorator.drawContext(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension])\n : bboxDecorator.clearContext();\n } else {\n bboxDecorator?.clearContext();\n }\n }, [bboxDecorator, colorProperty, inferredSpatialData, calculatedPropertyType]);\n\n const getSpatialData = (value: string | undefined) =>\n value &&\n inferredSpatialData?.has(BboxDimension[value as keyof typeof BboxDimension]) && (\n <div>{`${inferredSpatialData?.get(BboxDimension[value as keyof typeof BboxDimension])?.toPrecision(4)}m`}</div>\n );\n\n return (\n <div className=\"gmw-calculated-properties-action-container\">\n <InputGroup className=\"gmw-details-form\">\n <ToggleSwitch\n className=\"gmw-field-legend-container\"\n label={GroupingMappingWidget.translate(\"properties.visualizeDimensions\")}\n labelPosition=\"left\"\n disabled={isLoading}\n checked={colorProperty}\n onChange={() => setColorProperty((b) => !b)}\n ></ToggleSwitch>\n <SharedCalculatedPropertyForms\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n itemRenderer={(option: SelectOption<string | undefined>) => (\n <MenuItem>\n <div className=\"gmw-gr-cp-menu-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n </MenuItem>\n )}\n selectedItemRenderer={(option: SelectOption<string | undefined>) => (\n <div className=\"gmw-select-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n )}\n />\n </InputGroup>\n </div>\n );\n};\n"]}
|
|
@@ -31,11 +31,12 @@ exports.SharedCalculatedPropertyForms = void 0;
|
|
|
31
31
|
const insights_client_1 = require("@itwin/insights-client");
|
|
32
32
|
const react_1 = __importStar(require("react"));
|
|
33
33
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
+
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
34
35
|
const SharedCalculatedPropertyForms = ({ calculatedPropertyType, setCalculatedPropertyType, itemRenderer, selectedItemRenderer, }) => {
|
|
35
36
|
const generateOptionsFromCalculatedPropertyType = (0, react_1.useCallback)(() => {
|
|
36
37
|
const options = [];
|
|
37
38
|
const indexableEnum = insights_client_1.CalculatedPropertyType;
|
|
38
|
-
options.push({ value: undefined, label: "
|
|
39
|
+
options.push({ value: undefined, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noCalculatedPropertyType") });
|
|
39
40
|
for (const key in indexableEnum) {
|
|
40
41
|
if (typeof indexableEnum[key] === "string" && key !== "Undefined") {
|
|
41
42
|
// Generate labels by adding space between capitals
|
|
@@ -49,7 +50,7 @@ const SharedCalculatedPropertyForms = ({ calculatedPropertyType, setCalculatedPr
|
|
|
49
50
|
return options;
|
|
50
51
|
}, []);
|
|
51
52
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
52
|
-
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "
|
|
53
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.calculatedPropertyType"), options: generateOptionsFromCalculatedPropertyType(), value: calculatedPropertyType, onChange: setCalculatedPropertyType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, placeholder: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noCalculatedPropertyType"), onShow: () => { }, onHide: () => { } })));
|
|
53
54
|
};
|
|
54
55
|
exports.SharedCalculatedPropertyForms = SharedCalculatedPropertyForms;
|
|
55
56
|
//# sourceMappingURL=SharedCalculatedPropertyForms.js.map
|
package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAgE;AAChE,+CAA2C;AAE3C,wDAAqD;
|
|
1
|
+
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.ts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E,oBAAoB,EAC1C,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EACnF,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,6BAA6B,iCAuCxC","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 { CalculatedPropertyType } from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\ninterface SharedCalculatedPropertyFormsProps {\n calculatedPropertyType: CalculatedPropertyType | undefined;\n setCalculatedPropertyType: (value: CalculatedPropertyType | undefined) => void;\n itemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n calculatedPropertyType,\n setCalculatedPropertyType,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType | undefined>[] = [];\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n \n options.push({value: undefined, label: GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")});\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledSelect<CalculatedPropertyType | undefined>\n label={GroupingMappingWidget.translate(\"properties.calculatedPropertyType\")}\n options={generateOptionsFromCalculatedPropertyType()}\n value={calculatedPropertyType}\n onChange={setCalculatedPropertyType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n placeholder={GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
|
|
@@ -11,18 +11,19 @@ exports.CustomCalculationAction = void 0;
|
|
|
11
11
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
12
12
|
const react_1 = __importDefault(require("react"));
|
|
13
13
|
require("./CustomCalculationAction.scss");
|
|
14
|
+
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
14
15
|
/**
|
|
15
16
|
* Component to create or update a custom calculation property.
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
19
|
const CustomCalculationAction = ({ formula, setFormula, formulaErrorMessage, forceValidation, disabled }) => {
|
|
19
20
|
return (react_1.default.createElement(itwinui_react_1.InputGroup, { className: "gmw-custom-calculation-action-container" },
|
|
20
|
-
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational", clickableText: "
|
|
21
|
+
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational", clickableText: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formulaDocLink"), clickableTextProps: {
|
|
21
22
|
href: "https://developer.bentley.com/apis/grouping-and-mapping/operations/create-property/#customcalculations",
|
|
22
23
|
target: "_blank",
|
|
23
24
|
rel: "noreferrer",
|
|
24
|
-
} }, "
|
|
25
|
-
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { className: "gmw-details-form", value: formula, name: "formula", label: "
|
|
25
|
+
} }, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formulaDocMessage")),
|
|
26
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { className: "gmw-details-form", value: formula, name: "formula", label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formula"), disabled: disabled, onChange: (event) => {
|
|
26
27
|
setFormula(event.target.value);
|
|
27
28
|
}, message: formulaErrorMessage, status: formulaErrorMessage ? "negative" : undefined, onBlur: (event) => {
|
|
28
29
|
if (event.target.textLength === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,wDAA0E;AAC1E,kDAA0B;AAC1B,0CAAwC;
|
|
1
|
+
{"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,wDAA0E;AAC1E,kDAA0B;AAC1B,0CAAwC;AACxC,0EAAuE;AAcvE;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAgC,EAAE,EAAE;IAC/I,OAAO,CACL,8BAAC,0BAAU,IAAC,SAAS,EAAC,yCAAyC;QAC7D,8BAAC,qBAAK,IACJ,IAAI,EAAC,eAAe,EACpB,aAAa,EAAE,6CAAqB,CAAC,SAAS,CAAC,2BAA2B,CAAC,EAC3E,kBAAkB,EAAE;gBAClB,IAAI,EAAE,wGAAwG;gBAC9G,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,YAAY;aAClB,IAEA,6CAAqB,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAC1D;QACR,8BAAC,+BAAe,IACd,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,OAAO,EACd,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAC5D,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,EACD,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,KAAK,CAAC;oBAAE,UAAU,CAAC,SAAS,CAAC,CAAC;YAC3D,CAAC,EACD,aAAa,EAAE,GAAG,EAAE;gBAClB,eAAe,EAAE,CAAC;YACpB,CAAC,GACD,CACS,CACd,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,uBAAuB,2BAkClC","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 { Alert, InputGroup, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport \"./CustomCalculationAction.scss\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link CustomCalculationAction} component.\n * @internal\n */\nexport interface CustomCalculationActionProps {\n formula?: string;\n setFormula: (formula: string | undefined) => void;\n formulaErrorMessage?: string;\n forceValidation: () => void;\n disabled?: boolean;\n}\n\n/**\n * Component to create or update a custom calculation property.\n * @internal\n */\nexport const CustomCalculationAction = ({ formula, setFormula, formulaErrorMessage, forceValidation, disabled }: CustomCalculationActionProps) => {\n return (\n <InputGroup className=\"gmw-custom-calculation-action-container\">\n <Alert\n type=\"informational\"\n clickableText={GroupingMappingWidget.translate(\"properties.formulaDocLink\")}\n clickableTextProps={{\n href: \"https://developer.bentley.com/apis/grouping-and-mapping/operations/create-property/#customcalculations\",\n target: \"_blank\",\n rel: \"noreferrer\",\n }}\n >\n {GroupingMappingWidget.translate(\"properties.formulaDocMessage\")}\n </Alert>\n <LabeledTextarea\n className=\"gmw-details-form\"\n value={formula}\n name=\"formula\"\n label={GroupingMappingWidget.translate(\"properties.formula\")}\n disabled={disabled}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n onBlur={(event) => {\n if (event.target.textLength === 0) setFormula(undefined);\n }}\n onBlurCapture={() => {\n forceValidation();\n }}\n />\n </InputGroup>\n );\n};\n"]}
|
|
@@ -38,6 +38,7 @@ const PropertiesGroupColorContext_1 = require("../context/PropertiesGroupColorCo
|
|
|
38
38
|
const react_query_1 = require("@tanstack/react-query");
|
|
39
39
|
const useIsMounted_1 = require("../../common/hooks/useIsMounted");
|
|
40
40
|
const GroupHilitedElementsContext_1 = require("../context/GroupHilitedElementsContext");
|
|
41
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
41
42
|
const GroupColorToggle = ({ color, group, disableZoom, ...rest }) => {
|
|
42
43
|
const { iModelConnection } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
43
44
|
if (!iModelConnection) {
|
|
@@ -57,7 +58,7 @@ const GroupColorToggle = ({ color, group, disableZoom, ...rest }) => {
|
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
onError: (error) => {
|
|
60
|
-
itwinui_react_1.toaster.negative("
|
|
61
|
+
itwinui_react_1.toaster.negative(GroupingMappingWidget_1.GroupingMappingWidget.translate("errors.visualizingGroup"));
|
|
61
62
|
// eslint-disable-next-line no-console
|
|
62
63
|
console.error(error);
|
|
63
64
|
},
|
|
@@ -79,7 +80,7 @@ const GroupColorToggle = ({ color, group, disableZoom, ...rest }) => {
|
|
|
79
80
|
});
|
|
80
81
|
}, [setShowGroupColor]);
|
|
81
82
|
const isLoading = isFetching || isVisualizing;
|
|
82
|
-
return react_1.default.createElement(itwinui_react_1.ToggleSwitch, { label: "
|
|
83
|
+
return react_1.default.createElement(itwinui_react_1.ToggleSwitch, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("groups.colorGroup"), disabled: isLoading, checked: showGroupColor, onChange: handleToggleChange, ...rest });
|
|
83
84
|
};
|
|
84
85
|
exports.GroupColorToggle = GroupColorToggle;
|
|
85
86
|
//# sourceMappingURL=GroupColorToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAsD;AAEtD,wDAA6D;AAE7D,0DAAuF;AACvF,wEAA4D;AAC5D,kFAAkF;AAElF,mFAA6E;AAC7E,wFAAwF;AACxF,uDAAoD;AACpD,kEAA+D;AAC/D,wFAAwF;
|
|
1
|
+
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAsD;AAEtD,wDAA6D;AAE7D,0DAAuF;AACvF,wEAA4D;AAC5D,kFAAkF;AAElF,mFAA6E;AAC7E,wFAAwF;AACxF,uDAAoD;AACpD,kEAA+D;AAC/D,wFAAwF;AACxF,uEAAoE;AAQ7D,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IAChG,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,IAAA,4DAA8B,GAAE,CAAC;IAC/E,MAAM,EAAE,cAAc,EAAE,uBAAuB,EAAE,GAAG,IAAA,4DAA8B,GAAE,CAAC;IAC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iBAAiB,CAAC,CAAC,CAAC;IAEjD,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC1C,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,IAAI,CAAC,EAAE;gBACL,IAAA,sBAAQ,GAAE,CAAC;aACZ;YACD,OAAO,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,SAAS,GAAG,UAAU,IAAI,aAAa,CAAC;IAE9C,OAAO,8BAAC,4BAAY,IAAC,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,KAAM,IAAI,GAAiB,CAAC;AAC1L,CAAC,CAAC;AAhDW,QAAA,gBAAgB,oBAgD3B","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, { useCallback, useEffect } from \"react\";\nimport type { ToggleSwitchProps } from \"@itwin/itwinui-react\";\nimport { toaster, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../common/viewerUtils\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { QueryResults } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { useGroupKeySetQuery } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { usePropertiesGroupColorContext } from \"../context/PropertiesGroupColorContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\nexport type GroupColorToggleProps = Partial<ToggleSwitchProps> & {\n color: string;\n group: GroupMinimal;\n disableZoom?: boolean;\n};\n\nexport const GroupColorToggle = ({ color, group, disableZoom, ...rest }: GroupColorToggleProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const { showGroupColor, setShowGroupColor } = usePropertiesGroupColorContext();\n const { showGroupColor: isGroupsVisualizationOn } = useGroupHilitedElementsContext();\n const { data: hiliteIdsResult, isFetched, isFetching } = useGroupKeySetQuery(group, iModelConnection, showGroupColor);\n const isMounted = useIsMounted();\n\n const { mutate: mutateVisualization, isLoading: isVisualizing } = useMutation({\n mutationFn: async (hiliteIds: QueryResults) => {\n clearAll();\n Presentation.selection.clearSelection(\"GroupingMappingWidget\", iModelConnection);\n visualizeElements(hiliteIds.result.ids, color);\n if (!disableZoom) {\n await zoomToElements(hiliteIds.result.ids);\n }\n },\n onError: (error) => {\n toaster.negative(GroupingMappingWidget.translate(\"errors.visualizingGroup\"));\n // eslint-disable-next-line no-console\n console.error(error);\n },\n });\n\n useEffect(() => {\n isFetched && showGroupColor && hiliteIdsResult && isMounted && mutateVisualization(hiliteIdsResult);\n }, [hiliteIdsResult, isFetched, isMounted, showGroupColor, mutateVisualization]);\n\n useEffect(() => {\n if (isGroupsVisualizationOn) {\n setShowGroupColor(true);\n }\n }, [isGroupsVisualizationOn, setShowGroupColor]);\n\n const handleToggleChange = useCallback(() => {\n setShowGroupColor((b) => {\n if (b) {\n clearAll();\n }\n return !b;\n });\n }, [setShowGroupColor]);\n\n const isLoading = isFetching || isVisualizing;\n\n return <ToggleSwitch label={GroupingMappingWidget.translate(\"groups.colorGroup\")} disabled={isLoading} checked={showGroupColor} onChange={handleToggleChange} {...rest}></ToggleSwitch>;\n};\n"]}
|
|
@@ -11,13 +11,14 @@ exports.GroupInformationPanel = void 0;
|
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
require("./GroupInformationPanel.scss");
|
|
14
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
14
15
|
const GroupInformationPanel = ({ isOpen, onClose, groupName, query }) => {
|
|
15
16
|
return (react_1.default.createElement(itwinui_react_1.InformationPanel, { isOpen: isOpen },
|
|
16
17
|
react_1.default.createElement(itwinui_react_1.InformationPanelHeader, { onClose: onClose },
|
|
17
|
-
react_1.default.createElement(itwinui_react_1.Text, { variant: "subheading" },
|
|
18
|
+
react_1.default.createElement(itwinui_react_1.Text, { variant: "subheading" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.groupInformationTitle", { groupName }))),
|
|
18
19
|
react_1.default.createElement(itwinui_react_1.InformationPanelBody, null,
|
|
19
20
|
react_1.default.createElement("div", { className: "gmw-group-information-body" },
|
|
20
|
-
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: "
|
|
21
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.query"), rows: 15, readOnly: true, defaultValue: query })))));
|
|
21
22
|
};
|
|
22
23
|
exports.GroupInformationPanel = GroupInformationPanel;
|
|
23
24
|
//# sourceMappingURL=GroupInformationPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupInformationPanel.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupInformationPanel.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAA6H;AAC7H,wCAAsC;
|
|
1
|
+
{"version":3,"file":"GroupInformationPanel.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupInformationPanel.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAA6H;AAC7H,wCAAsC;AACtC,uEAAoE;AAS7D,MAAM,qBAAqB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAA8B,EAAE,EAAE;IACzG,OAAO,CACL,8BAAC,gCAAgB,IAAC,MAAM,EAAE,MAAM;QAC9B,8BAAC,sCAAsB,IAAC,OAAO,EAAE,OAAO;YACtC,8BAAC,oBAAI,IAAC,OAAO,EAAC,YAAY,IAAE,6CAAqB,CAAC,SAAS,CAAC,kCAAkC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAQ,CAC/F;QACzB,8BAAC,oCAAoB;YACnB,uCAAK,SAAS,EAAC,4BAA4B;gBACzC,8BAAC,+BAAe,IAAC,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,QAAC,YAAY,EAAE,KAAK,GAAI,CACnH,CACe,CACN,CACpB,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,qBAAqB,yBAahC","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 { InformationPanel, InformationPanelBody, InformationPanelHeader, LabeledTextarea, Text } from \"@itwin/itwinui-react\";\nimport \"./GroupInformationPanel.scss\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\nexport interface GroupInformationPanelProps {\n isOpen: boolean;\n onClose: () => void;\n groupName: string;\n query: string;\n}\n\nexport const GroupInformationPanel = ({ isOpen, onClose, groupName, query }: GroupInformationPanelProps) => {\n return (\n <InformationPanel isOpen={isOpen}>\n <InformationPanelHeader onClose={onClose}>\n <Text variant=\"subheading\">{GroupingMappingWidget.translate(\"properties.groupInformationTitle\", { groupName })}</Text>\n </InformationPanelHeader>\n <InformationPanelBody>\n <div className=\"gmw-group-information-body\">\n <LabeledTextarea label={GroupingMappingWidget.translate(\"properties.query\")} rows={15} readOnly defaultValue={query} />\n </div>\n </InformationPanelBody>\n </InformationPanel>\n );\n};\n"]}
|
|
@@ -14,7 +14,7 @@ export interface GroupPropertyActionProps {
|
|
|
14
14
|
onSaveSuccess: () => void;
|
|
15
15
|
onClickCancel?: () => void;
|
|
16
16
|
}
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const getQuantityTypesSelectionOptions: () => SelectOption<QuantityType | undefined>[];
|
|
18
18
|
/**
|
|
19
19
|
* Component to create or update a group.
|
|
20
20
|
* @public
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.GroupPropertyAction = exports.
|
|
29
|
+
exports.GroupPropertyAction = exports.getQuantityTypesSelectionOptions = void 0;
|
|
30
30
|
/*---------------------------------------------------------------------------------------------
|
|
31
31
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
32
32
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -53,16 +53,18 @@ const CustomCalculationAction_1 = require("../CustomCalculations/CustomCalculati
|
|
|
53
53
|
const usePropertiesQuery_1 = require("../hooks/usePropertiesQuery");
|
|
54
54
|
const useFormulaValidation_1 = require("../hooks/useFormulaValidation");
|
|
55
55
|
const ScrollableExpandableBlock_1 = require("../ScrollableExpandableBlock");
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{ value: insights_client_1.QuantityType.
|
|
59
|
-
{ value: insights_client_1.QuantityType.
|
|
60
|
-
{ value: insights_client_1.QuantityType.
|
|
61
|
-
{ value: insights_client_1.QuantityType.
|
|
62
|
-
{ value: insights_client_1.QuantityType.
|
|
63
|
-
{ value: insights_client_1.QuantityType.
|
|
64
|
-
{ value:
|
|
56
|
+
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
57
|
+
const getQuantityTypesSelectionOptions = () => [
|
|
58
|
+
{ value: insights_client_1.QuantityType.Area, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityArea") },
|
|
59
|
+
{ value: insights_client_1.QuantityType.Distance, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityDistance") },
|
|
60
|
+
{ value: insights_client_1.QuantityType.Force, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityForce") },
|
|
61
|
+
{ value: insights_client_1.QuantityType.Mass, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityMass") },
|
|
62
|
+
{ value: insights_client_1.QuantityType.Monetary, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityMonetary") },
|
|
63
|
+
{ value: insights_client_1.QuantityType.Time, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityTime") },
|
|
64
|
+
{ value: insights_client_1.QuantityType.Volume, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityVolume") },
|
|
65
|
+
{ value: undefined, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noQuantityType") },
|
|
65
66
|
];
|
|
67
|
+
exports.getQuantityTypesSelectionOptions = getQuantityTypesSelectionOptions;
|
|
66
68
|
/**
|
|
67
69
|
* Component to create or update a group.
|
|
68
70
|
* @public
|
|
@@ -201,39 +203,39 @@ const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, o
|
|
|
201
203
|
const isLoading = isLoadingProperties || isSaving || isLoadingGroupProperties;
|
|
202
204
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
203
205
|
react_1.default.createElement("div", { className: "gmw-group-property-action-container", ref: actionContainerRef },
|
|
204
|
-
react_1.default.createElement(itwinui_react_1.Fieldset, { disabled: isLoading, className: "gmw-property-options", legend: "
|
|
205
|
-
react_1.default.createElement(itwinui_react_1.Text, { variant: "small", as: "small", className: "gmw-field-legend" }, "
|
|
206
|
-
react_1.default.createElement(itwinui_react_1.LabeledInput, { id: "propertyName", label: "
|
|
206
|
+
react_1.default.createElement(itwinui_react_1.Fieldset, { disabled: isLoading, className: "gmw-property-options", legend: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.propertyDetails") },
|
|
207
|
+
react_1.default.createElement(itwinui_react_1.Text, { variant: "small", as: "small", className: "gmw-field-legend" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.mandatoryFields")),
|
|
208
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { id: "propertyName", label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.propertyName"), value: propertyName, required: true, onChange: (event) => {
|
|
207
209
|
setPropertyName(event.target.value);
|
|
208
210
|
validator.showMessageFor("propertyName");
|
|
209
211
|
}, message: validator.message("propertyName", propertyName, useValidator_1.NAME_REQUIREMENTS), status: validator.message("propertyName", propertyName, useValidator_1.NAME_REQUIREMENTS) ? "negative" : undefined, onBlur: () => {
|
|
210
212
|
validator.showMessageFor("propertyName");
|
|
211
213
|
} }),
|
|
212
|
-
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "
|
|
213
|
-
{ value: insights_client_1.DataType.Boolean, label: "
|
|
214
|
-
{ value: insights_client_1.DataType.Integer, label: "
|
|
215
|
-
{ value: insights_client_1.DataType.Double, label: "
|
|
216
|
-
{ value: insights_client_1.DataType.String, label: "
|
|
214
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.dataType"), id: "dataType", options: [
|
|
215
|
+
{ value: insights_client_1.DataType.Boolean, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.boolean") },
|
|
216
|
+
{ value: insights_client_1.DataType.Integer, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.integer") },
|
|
217
|
+
{ value: insights_client_1.DataType.Double, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.double") },
|
|
218
|
+
{ value: insights_client_1.DataType.String, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.string") },
|
|
217
219
|
], required: true, value: calculatedPropertyType ? insights_client_1.DataType.Double : dataType, onChange: (value) => {
|
|
218
220
|
validator.showMessageFor("dataType");
|
|
219
221
|
setDataType(value);
|
|
220
222
|
}, message: validator.message("dataType", propertyName, "required"), status: validator.message("dataType", propertyName, "required") ? "negative" : undefined, onBlur: () => {
|
|
221
223
|
validator.showMessageFor("dataType");
|
|
222
224
|
}, disabled: calculatedPropertyType ? true : false, onShow: () => { }, onHide: () => { } }),
|
|
223
|
-
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "
|
|
224
|
-
propertiesNotFoundAlert && (react_1.default.createElement(itwinui_react_1.Alert, { type: "warning" }, "
|
|
225
|
-
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { title: "
|
|
225
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.quantityType"), options: (0, exports.getQuantityTypesSelectionOptions)(), value: quantityType, onChange: setQuantityType, onShow: () => { }, onHide: () => { }, placeholder: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noQuantityType") })),
|
|
226
|
+
propertiesNotFoundAlert && (react_1.default.createElement(itwinui_react_1.Alert, { type: "warning" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.savedPropertiesWarning"))),
|
|
227
|
+
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { title: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.mappedProperties"), endIcon: react_1.default.createElement(itwinui_react_1.Icon, { fill: selectedProperties.length > 0 ? "informational" : "default" },
|
|
226
228
|
react_1.default.createElement(itwinui_icons_react_1.SvgLabel, null)), isExpanded: isMappedBlockExpanded, setIsExpanded: setIsMappedBlockExpanded },
|
|
227
229
|
react_1.default.createElement("div", { className: "gmw-property-view-container" },
|
|
228
230
|
react_1.default.createElement("div", { className: "gmw-property-view-button" },
|
|
229
|
-
react_1.default.createElement(itwinui_react_1.Button, { onClick: async () => setShowPropertiesSelectionModal(true), disabled: isLoading }, "
|
|
231
|
+
react_1.default.createElement(itwinui_react_1.Button, { onClick: async () => setShowPropertiesSelectionModal(true), disabled: isLoading }, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.selectProperties"))),
|
|
230
232
|
react_1.default.createElement("div", { className: "gmw-properties-list" }, selectedProperties.length === 0 && !isLoading ? (react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
231
|
-
react_1.default.createElement(itwinui_react_1.Text, null, "
|
|
232
|
-
react_1.default.createElement(itwinui_react_1.Text, null, "
|
|
233
|
-
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { parentRef: actionContainerRef, ref: calculatedPropertyActionRef, title: "
|
|
233
|
+
react_1.default.createElement(itwinui_react_1.Text, null, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noSelected")),
|
|
234
|
+
react_1.default.createElement(itwinui_react_1.Text, null, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.selectPropertiesHint")))) : (selectedProperties.map((property) => (react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { key: property.key, content: `${property.displayLabel}`, title: `${property.actualECClassName}`, description: property.categoryLabel }))))))),
|
|
235
|
+
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { parentRef: actionContainerRef, ref: calculatedPropertyActionRef, title: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.calculatedProperty"), endIcon: react_1.default.createElement(itwinui_react_1.Icon, { fill: calculatedPropertyType ? "informational" : "default" },
|
|
234
236
|
react_1.default.createElement(itwinui_icons_react_1.SvgMeasure, null)), isExpanded: isCalculatedBlockExpanded, setIsExpanded: setIsCalculatedBlockExpanded },
|
|
235
237
|
react_1.default.createElement(CalculatedPropertyActionWithVisuals_1.CalculatedPropertyActionWithVisuals, { group: group, calculatedPropertyType: calculatedPropertyType, setCalculatedPropertyType: setCalculatedPropertyType })),
|
|
236
|
-
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { parentRef: actionContainerRef, ref: customCalculationActionRef, title: "
|
|
238
|
+
react_1.default.createElement(ScrollableExpandableBlock_1.ScrollableExpandableBlock, { parentRef: actionContainerRef, ref: customCalculationActionRef, title: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.customCalculation"), endIcon: react_1.default.createElement(itwinui_react_1.Icon, { fill: formula ? "informational" : "default" },
|
|
237
239
|
react_1.default.createElement(itwinui_icons_react_1.SvgFunction, null)), isExpanded: isFormulaBlockExpanded, setIsExpanded: setIsFormulaBlockExpanded },
|
|
238
240
|
react_1.default.createElement(CustomCalculationAction_1.CustomCalculationAction, { formula: formula, setFormula: setFormula, formulaErrorMessage: formulaErrorMessage, forceValidation: forceValidation, disabled: isLoading }))),
|
|
239
241
|
react_1.default.createElement(ActionPanel_1.default, { onSave: handleSaveClick, onCancel: onClickCancel, onSaveCapture: viewerUtils_1.clearAll, onCancelCapture: viewerUtils_1.clearAll, isLoading: isLoading, isSavingDisabled: !propertyName || dataType === undefined || formulaErrorMessage !== undefined }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAAiE;AAEjE,wDAAwG;AACxG,+CAAwE;AACxE,qFAA6D;AAC7D,sEAAwE;AACxE,qFAAqF;AACrF,4DAAgE;AAEhE,sCAAoC;AAEpC,6DAAqI;AACrI,6DAAwE;AACxE,2CAAwC;AACxC,qFAAkF;AAClF,uDAA8E;AAC9E,mEAAgE;AAChE,mFAA4E;AAC5E,oEAA+E;AAC/E,qHAAkH;AAClH,iDAAoD;AACpD,2FAAwF;AACxF,oEAAiE;AACjE,wEAAqE;AACrE,4EAAyE;AAc5D,QAAA,6BAA6B,GAA6C;IACrF,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,E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mBAAmB,KAAK,SAAS,GAC9F;QACF,8BAAC,+DAA8B,IAC7B,SAAS,EAAE,4BAA4B,EACvC,YAAY,EAAE,+BAA+B,EAC7C,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,GACtC;QACF,8BAAC,qBAAS,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,yBAAyB,GAAI,CACrG,CACJ,CAAC;AACJ,CAAC,CAAC;AAvTW,QAAA,mBAAmB,uBAuT9B","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 { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Alert, Button, Fieldset, Icon, LabeledInput, LabeledSelect, Text } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type { CalculatedPropertyType, GroupMinimal, Property, PropertyModify } from \"@itwin/insights-client\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport { convertPresentationFields, convertToECProperties, fetchPresentationDescriptor, findProperties } from \"./GroupPropertyUtils\";\nimport { clearAll, manufactureKeys } from \"../../../common/viewerUtils\";\nimport { SaveModal } from \"./SaveModal\";\nimport { GroupsPropertiesSelectionModal } from \"./GroupsPropertiesSelectionModal\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { GroupPropertyListItem } from \"./GroupPropertyListItem\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\nimport { SvgFunction, SvgLabel, SvgMeasure } from \"@itwin/itwinui-icons-react\";\nimport { CalculatedPropertyActionWithVisuals } from \"../CalculatedProperties/CalculatedPropertyActionWithVisuals\";\nimport { handleError } from \"../../../common/utils\";\nimport { CustomCalculationAction } from \"../CustomCalculations/CustomCalculationAction\";\nimport { usePropertiesQuery } from \"../hooks/usePropertiesQuery\";\nimport { useFormulaValidation } from \"../hooks/useFormulaValidation\";\nimport { ScrollableExpandableBlock } from \"../ScrollableExpandableBlock\";\n\n/**\n * Props for the {@link GroupPropertyAction} component.\n * @public\n */\nexport interface GroupPropertyActionProps {\n mappingId: string;\n group: GroupMinimal;\n groupProperty?: Property;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType | undefined>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: undefined, label: \"No Quantity Type\" },\n];\n\n/**\n * Component to create or update a group.\n * @public\n */\nexport const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, onClickCancel }: GroupPropertyActionProps) => {\n const actionContainerRef = useRef<HTMLDivElement>(null);\n const calculatedPropertyActionRef = useRef<HTMLDivElement>(null);\n const customCalculationActionRef = useRef<HTMLDivElement>(null);\n const propertiesClient = usePropertiesClient();\n const queryClient = useQueryClient();\n\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [oldPropertyName, setOldPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(groupProperty?.dataType ?? DataType.String);\n const [quantityType, setQuantityType] = useState<QuantityType | undefined>(groupProperty?.quantityType ?? undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [showPropertiesSelectionModal, setShowPropertiesSelectionModal] = useState<boolean>(false);\n const [showSaveConfirmationModal, setShowSaveConfirmationModal] = useState<boolean>(false);\n const [calculatedPropertyType, setCalculatedPropertyType] = useState<CalculatedPropertyType | undefined>(groupProperty?.calculatedPropertyType ?? undefined);\n const [isCalculatedBlockExpanded, setIsCalculatedBlockExpanded] = useState<boolean>(!!calculatedPropertyType);\n const [isMappedBlockExpanded, setIsMappedBlockExpanded] = useState<boolean>((groupProperty?.ecProperties?.length ?? 0) > 0);\n const [isFormulaBlockExpanded, setIsFormulaBlockExpanded] = useState<boolean>(!!groupProperty?.formula);\n const [formula, setFormula] = useState<string | undefined>(groupProperty?.formula ?? undefined);\n const [formulaErrorMessage, setFormulaErrorMessage] = useState<string | undefined>(undefined);\n\n const { getAccessToken, iModelId, iModelConnection } = useGroupingMappingApiConfig();\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = usePropertiesQuery(iModelId, mappingId, group.id, getAccessToken, propertiesClient);\n const { forceValidation } = useFormulaValidation(propertyName.toLowerCase(), formula, groupProperties?.properties ?? [], setFormulaErrorMessage, dataType);\n\n const reset = useCallback(() => {\n setPropertyName(\"\");\n setDataType(DataType.String);\n setQuantityType(undefined);\n setSelectedProperties([]);\n setCalculatedPropertyType(undefined);\n setFormula(undefined);\n }, []);\n\n const fetchPropertiesMetadata = useCallback(async () => {\n if (!iModelConnection) return;\n\n const result = await manufactureKeys(group.query, iModelConnection);\n const descriptor = await fetchPresentationDescriptor(iModelConnection, result);\n\n // Only allow primitives and structs\n const propertyFields =\n descriptor?.fields.filter((field) => field.type.valueFormat === PropertyValueFormat.Primitive || field.type.valueFormat === PropertyValueFormat.Struct) ??\n [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n let groupPropertyDetails = null;\n if (groupProperty) {\n const accessToken = await getAccessToken();\n groupPropertyDetails = await propertiesClient.getProperty(accessToken, mappingId, group.id, groupProperty.id);\n }\n\n return { propertiesMetaData, groupPropertyDetails };\n }, [getAccessToken, group.id, group.query, groupProperty, iModelConnection, mappingId, propertiesClient]);\n\n const scrollToFormulaErrorMessage = useCallback(() => {\n setTimeout(() => {\n if (actionContainerRef.current && customCalculationActionRef.current) {\n actionContainerRef.current.scrollTo({\n top: customCalculationActionRef.current.offsetTop,\n behavior: \"smooth\",\n });\n }\n }, 500);\n }, [actionContainerRef]);\n\n const {\n data,\n isFetching: isLoadingProperties,\n isSuccess: isLoadingPropertiesSuccessful,\n } = useQuery([\"properties\", iModelId, mappingId, group.id, groupProperty?.id, \"metadata\"], fetchPropertiesMetadata);\n\n useEffect(() => {\n if (isLoadingPropertiesSuccessful && data?.propertiesMetaData) {\n setPropertiesMetaData(data.propertiesMetaData);\n\n if (data.groupPropertyDetails) {\n setPropertyName(data.groupPropertyDetails.propertyName);\n setOldPropertyName(data.groupPropertyDetails.propertyName);\n setDataType(data.groupPropertyDetails.dataType);\n if (data.groupPropertyDetails.quantityType) setQuantityType(data.groupPropertyDetails.quantityType);\n\n if (data.groupPropertyDetails.ecProperties) {\n const properties = findProperties(data.groupPropertyDetails.ecProperties, data.propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n setSelectedProperties(properties);\n }\n }\n }\n }, [data, isLoadingPropertiesSuccessful]);\n\n useEffect(() => {\n if (calculatedPropertyType) {\n setDataType(DataType.Double);\n }\n\n if (isCalculatedBlockExpanded === false || !calculatedPropertyType) {\n clearAll();\n }\n }, [calculatedPropertyType, isCalculatedBlockExpanded]);\n\n useEffect(() => {\n if (formulaErrorMessage) {\n scrollToFormulaErrorMessage();\n }\n }, [formulaErrorMessage, scrollToFormulaErrorMessage]);\n\n const { mutate: onSave, isLoading: isSaving } = useMutation({\n mutationFn: async () => {\n const accessToken = await getAccessToken();\n const newGroupProperty: PropertyModify = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.length > 0 ? selectedProperties.map((p) => convertToECProperties(p)).flat() : undefined,\n calculatedPropertyType,\n formula,\n };\n\n return groupProperty\n ? propertiesClient.updateProperty(accessToken, mappingId, group.id, groupProperty.id, newGroupProperty)\n : propertiesClient.createProperty(accessToken, mappingId, group.id, newGroupProperty);\n },\n onSuccess: async () => {\n onSaveSuccess();\n reset();\n await queryClient.invalidateQueries([\"properties\", iModelId, mappingId, group.id]);\n },\n onError(error: any) {\n handleError(error.status);\n },\n });\n\n const handleSaveClick = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (oldPropertyName !== propertyName && oldPropertyName !== \"\") {\n setShowSaveConfirmationModal(true);\n } else {\n onSave();\n }\n };\n\n const handleCloseSaveModal = () => {\n setShowSaveConfirmationModal(false);\n };\n\n const isLoading = isLoadingProperties || isSaving || isLoadingGroupProperties;\n\n return (\n <>\n <div className=\"gmw-group-property-action-container\" ref={actionContainerRef}>\n <Fieldset disabled={isLoading} className=\"gmw-property-options\" legend=\"Property Details\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id=\"propertyName\"\n label=\"Property Name\"\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)}\n status={validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id=\"dataType\"\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Integer, label: \"Integer\" },\n { value: DataType.Double, label: \"Double\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={calculatedPropertyType ? DataType.Double : dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={validator.message(\"dataType\", propertyName, \"required\") ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n disabled={calculatedPropertyType ? true : false}\n onShow={() => {}}\n onHide={() => {}}\n />\n <LabeledSelect<QuantityType | undefined>\n label=\"Quantity Type\"\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => {}}\n onHide={() => {}}\n placeholder=\"No Quantity Type\"\n />\n </Fieldset>\n {propertiesNotFoundAlert && (\n <Alert type=\"warning\">\n Warning: Could not match saved properties from the current generated list. It does not confirm or deny validity. Overwriting will occur if a new\n selection is made and saved.\n </Alert>\n )}\n <ScrollableExpandableBlock\n title={\"Mapped Properties\"}\n endIcon={\n <Icon fill={selectedProperties.length > 0 ? \"informational\" : \"default\"}>\n <SvgLabel />\n </Icon>\n }\n isExpanded={isMappedBlockExpanded}\n setIsExpanded={setIsMappedBlockExpanded}\n >\n <div className=\"gmw-property-view-container\">\n <div className=\"gmw-property-view-button\">\n <Button onClick={async () => setShowPropertiesSelectionModal(true)} disabled={isLoading}>\n Select Properties\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ? (\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Press the "Select Properties" button for options.</Text>\n </div>\n ) : (\n selectedProperties.map((property) => (\n <GroupPropertyListItem\n key={property.key}\n content={`${property.displayLabel}`}\n title={`${property.actualECClassName}`}\n description={property.categoryLabel}\n />\n ))\n )}\n </div>\n </div>\n </ScrollableExpandableBlock>\n <ScrollableExpandableBlock\n parentRef={actionContainerRef}\n ref={calculatedPropertyActionRef}\n title={\"Calculated Property\"}\n endIcon={\n <Icon fill={calculatedPropertyType ? \"informational\" : \"default\"}>\n <SvgMeasure />\n </Icon>\n }\n isExpanded={isCalculatedBlockExpanded}\n setIsExpanded={setIsCalculatedBlockExpanded}\n >\n <CalculatedPropertyActionWithVisuals\n group={group}\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n />\n </ScrollableExpandableBlock>\n <ScrollableExpandableBlock\n parentRef={actionContainerRef}\n ref={customCalculationActionRef}\n title={\"Custom Calculation\"}\n endIcon={\n <Icon fill={formula ? \"informational\" : \"default\"}>\n <SvgFunction />\n </Icon>\n }\n isExpanded={isFormulaBlockExpanded}\n setIsExpanded={setIsFormulaBlockExpanded}\n >\n <CustomCalculationAction\n formula={formula}\n setFormula={setFormula}\n formulaErrorMessage={formulaErrorMessage}\n forceValidation={forceValidation}\n disabled={isLoading}\n />\n </ScrollableExpandableBlock>\n </div>\n <ActionPanel\n onSave={handleSaveClick}\n onCancel={onClickCancel}\n onSaveCapture={clearAll}\n onCancelCapture={clearAll}\n isLoading={isLoading}\n isSavingDisabled={!propertyName || dataType === undefined || formulaErrorMessage !== undefined}\n />\n <GroupsPropertiesSelectionModal\n showModal={showPropertiesSelectionModal}\n setShowModal={setShowPropertiesSelectionModal}\n selectedProperties={selectedProperties}\n setSelectedProperties={setSelectedProperties}\n propertiesMetaData={propertiesMetaData}\n />\n <SaveModal onSave={onSave} onClose={handleCloseSaveModal} showSaveModal={showSaveConfirmationModal} />\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAAiE;AAEjE,wDAAwG;AACxG,+CAAwE;AACxE,qFAA6D;AAC7D,sEAAwE;AACxE,qFAAqF;AACrF,4DAAgE;AAEhE,sCAAoC;AAEpC,6DAAqI;AACrI,6DAAwE;AACxE,2CAAwC;AACxC,qFAAkF;AAClF,uDAA8E;AAC9E,mEAAgE;AAChE,mFAA4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C,YAAY,EAAE,+BAA+B,EAC7C,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,GACtC;QACF,8BAAC,qBAAS,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,yBAAyB,GAAI,CACrG,CACJ,CAAC;AACJ,CAAC,CAAC;AAtTW,QAAA,mBAAmB,uBAsT9B","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 { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Alert, Button, Fieldset, Icon, LabeledInput, LabeledSelect, Text } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type { CalculatedPropertyType, GroupMinimal, Property, PropertyModify } from \"@itwin/insights-client\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport { convertPresentationFields, convertToECProperties, fetchPresentationDescriptor, findProperties } from \"./GroupPropertyUtils\";\nimport { clearAll, manufactureKeys } from \"../../../common/viewerUtils\";\nimport { SaveModal } from \"./SaveModal\";\nimport { GroupsPropertiesSelectionModal } from \"./GroupsPropertiesSelectionModal\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { GroupPropertyListItem } from \"./GroupPropertyListItem\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\nimport { SvgFunction, SvgLabel, SvgMeasure } from \"@itwin/itwinui-icons-react\";\nimport { CalculatedPropertyActionWithVisuals } from \"../CalculatedProperties/CalculatedPropertyActionWithVisuals\";\nimport { handleError } from \"../../../common/utils\";\nimport { CustomCalculationAction } from \"../CustomCalculations/CustomCalculationAction\";\nimport { usePropertiesQuery } from \"../hooks/usePropertiesQuery\";\nimport { useFormulaValidation } from \"../hooks/useFormulaValidation\";\nimport { ScrollableExpandableBlock } from \"../ScrollableExpandableBlock\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link GroupPropertyAction} component.\n * @public\n */\nexport interface GroupPropertyActionProps {\n mappingId: string;\n group: GroupMinimal;\n groupProperty?: Property;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nexport const getQuantityTypesSelectionOptions = (): SelectOption<QuantityType | undefined>[] => [\n { value: QuantityType.Area, label: GroupingMappingWidget.translate(\"properties.quantityArea\") },\n { value: QuantityType.Distance, label: GroupingMappingWidget.translate(\"properties.quantityDistance\") },\n { value: QuantityType.Force, label: GroupingMappingWidget.translate(\"properties.quantityForce\") },\n { value: QuantityType.Mass, label: GroupingMappingWidget.translate(\"properties.quantityMass\") },\n { value: QuantityType.Monetary, label: GroupingMappingWidget.translate(\"properties.quantityMonetary\") },\n { value: QuantityType.Time, label: GroupingMappingWidget.translate(\"properties.quantityTime\") },\n { value: QuantityType.Volume, label: GroupingMappingWidget.translate(\"properties.quantityVolume\") },\n { value: undefined, label: GroupingMappingWidget.translate(\"properties.noQuantityType\") },\n];\n\n/**\n * Component to create or update a group.\n * @public\n */\nexport const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, onClickCancel }: GroupPropertyActionProps) => {\n const actionContainerRef = useRef<HTMLDivElement>(null);\n const calculatedPropertyActionRef = useRef<HTMLDivElement>(null);\n const customCalculationActionRef = useRef<HTMLDivElement>(null);\n const propertiesClient = usePropertiesClient();\n const queryClient = useQueryClient();\n\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [oldPropertyName, setOldPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(groupProperty?.dataType ?? DataType.String);\n const [quantityType, setQuantityType] = useState<QuantityType | undefined>(groupProperty?.quantityType ?? undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [showPropertiesSelectionModal, setShowPropertiesSelectionModal] = useState<boolean>(false);\n const [showSaveConfirmationModal, setShowSaveConfirmationModal] = useState<boolean>(false);\n const [calculatedPropertyType, setCalculatedPropertyType] = useState<CalculatedPropertyType | undefined>(groupProperty?.calculatedPropertyType ?? undefined);\n const [isCalculatedBlockExpanded, setIsCalculatedBlockExpanded] = useState<boolean>(!!calculatedPropertyType);\n const [isMappedBlockExpanded, setIsMappedBlockExpanded] = useState<boolean>((groupProperty?.ecProperties?.length ?? 0) > 0);\n const [isFormulaBlockExpanded, setIsFormulaBlockExpanded] = useState<boolean>(!!groupProperty?.formula);\n const [formula, setFormula] = useState<string | undefined>(groupProperty?.formula ?? undefined);\n const [formulaErrorMessage, setFormulaErrorMessage] = useState<string | undefined>(undefined);\n\n const { getAccessToken, iModelId, iModelConnection } = useGroupingMappingApiConfig();\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = usePropertiesQuery(iModelId, mappingId, group.id, getAccessToken, propertiesClient);\n const { forceValidation } = useFormulaValidation(propertyName.toLowerCase(), formula, groupProperties?.properties ?? [], setFormulaErrorMessage, dataType);\n\n const reset = useCallback(() => {\n setPropertyName(\"\");\n setDataType(DataType.String);\n setQuantityType(undefined);\n setSelectedProperties([]);\n setCalculatedPropertyType(undefined);\n setFormula(undefined);\n }, []);\n\n const fetchPropertiesMetadata = useCallback(async () => {\n if (!iModelConnection) return;\n\n const result = await manufactureKeys(group.query, iModelConnection);\n const descriptor = await fetchPresentationDescriptor(iModelConnection, result);\n\n // Only allow primitives and structs\n const propertyFields =\n descriptor?.fields.filter((field) => field.type.valueFormat === PropertyValueFormat.Primitive || field.type.valueFormat === PropertyValueFormat.Struct) ??\n [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n let groupPropertyDetails = null;\n if (groupProperty) {\n const accessToken = await getAccessToken();\n groupPropertyDetails = await propertiesClient.getProperty(accessToken, mappingId, group.id, groupProperty.id);\n }\n\n return { propertiesMetaData, groupPropertyDetails };\n }, [getAccessToken, group.id, group.query, groupProperty, iModelConnection, mappingId, propertiesClient]);\n\n const scrollToFormulaErrorMessage = useCallback(() => {\n setTimeout(() => {\n if (actionContainerRef.current && customCalculationActionRef.current) {\n actionContainerRef.current.scrollTo({\n top: customCalculationActionRef.current.offsetTop,\n behavior: \"smooth\",\n });\n }\n }, 500);\n }, [actionContainerRef]);\n\n const {\n data,\n isFetching: isLoadingProperties,\n isSuccess: isLoadingPropertiesSuccessful,\n } = useQuery([\"properties\", iModelId, mappingId, group.id, groupProperty?.id, \"metadata\"], fetchPropertiesMetadata);\n\n useEffect(() => {\n if (isLoadingPropertiesSuccessful && data?.propertiesMetaData) {\n setPropertiesMetaData(data.propertiesMetaData);\n\n if (data.groupPropertyDetails) {\n setPropertyName(data.groupPropertyDetails.propertyName);\n setOldPropertyName(data.groupPropertyDetails.propertyName);\n setDataType(data.groupPropertyDetails.dataType);\n if (data.groupPropertyDetails.quantityType) setQuantityType(data.groupPropertyDetails.quantityType);\n\n if (data.groupPropertyDetails.ecProperties) {\n const properties = findProperties(data.groupPropertyDetails.ecProperties, data.propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n setSelectedProperties(properties);\n }\n }\n }\n }, [data, isLoadingPropertiesSuccessful]);\n\n useEffect(() => {\n if (calculatedPropertyType) {\n setDataType(DataType.Double);\n }\n\n if (isCalculatedBlockExpanded === false || !calculatedPropertyType) {\n clearAll();\n }\n }, [calculatedPropertyType, isCalculatedBlockExpanded]);\n\n useEffect(() => {\n if (formulaErrorMessage) {\n scrollToFormulaErrorMessage();\n }\n }, [formulaErrorMessage, scrollToFormulaErrorMessage]);\n\n const { mutate: onSave, isLoading: isSaving } = useMutation({\n mutationFn: async () => {\n const accessToken = await getAccessToken();\n const newGroupProperty: PropertyModify = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.length > 0 ? selectedProperties.map((p) => convertToECProperties(p)).flat() : undefined,\n calculatedPropertyType,\n formula,\n };\n\n return groupProperty\n ? propertiesClient.updateProperty(accessToken, mappingId, group.id, groupProperty.id, newGroupProperty)\n : propertiesClient.createProperty(accessToken, mappingId, group.id, newGroupProperty);\n },\n onSuccess: async () => {\n onSaveSuccess();\n reset();\n await queryClient.invalidateQueries([\"properties\", iModelId, mappingId, group.id]);\n },\n onError(error: any) {\n handleError(error.status);\n },\n });\n\n const handleSaveClick = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (oldPropertyName !== propertyName && oldPropertyName !== \"\") {\n setShowSaveConfirmationModal(true);\n } else {\n onSave();\n }\n };\n\n const handleCloseSaveModal = () => {\n setShowSaveConfirmationModal(false);\n };\n\n const isLoading = isLoadingProperties || isSaving || isLoadingGroupProperties;\n\n return (\n <>\n <div className=\"gmw-group-property-action-container\" ref={actionContainerRef}>\n <Fieldset disabled={isLoading} className=\"gmw-property-options\" legend={GroupingMappingWidget.translate(\"properties.propertyDetails\")}>\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n {GroupingMappingWidget.translate(\"common.mandatoryFields\")}\n </Text>\n <LabeledInput\n id=\"propertyName\"\n label={GroupingMappingWidget.translate(\"properties.propertyName\")}\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)}\n status={validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={GroupingMappingWidget.translate(\"properties.dataType\")}\n id=\"dataType\"\n options={[\n { value: DataType.Boolean, label: GroupingMappingWidget.translate(\"properties.boolean\") },\n { value: DataType.Integer, label: GroupingMappingWidget.translate(\"properties.integer\") },\n { value: DataType.Double, label: GroupingMappingWidget.translate(\"properties.double\") },\n { value: DataType.String, label: GroupingMappingWidget.translate(\"properties.string\") },\n ]}\n required\n value={calculatedPropertyType ? DataType.Double : dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={validator.message(\"dataType\", propertyName, \"required\") ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n disabled={calculatedPropertyType ? true : false}\n onShow={() => {}}\n onHide={() => {}}\n />\n <LabeledSelect<QuantityType | undefined>\n label={GroupingMappingWidget.translate(\"properties.quantityType\")}\n options={getQuantityTypesSelectionOptions()}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => {}}\n onHide={() => {}}\n placeholder={GroupingMappingWidget.translate(\"properties.noQuantityType\")}\n />\n </Fieldset>\n {propertiesNotFoundAlert && (\n <Alert type=\"warning\">\n {GroupingMappingWidget.translate(\"properties.savedPropertiesWarning\")}\n </Alert>\n )}\n <ScrollableExpandableBlock\n title={GroupingMappingWidget.translate(\"properties.mappedProperties\")}\n endIcon={\n <Icon fill={selectedProperties.length > 0 ? \"informational\" : \"default\"}>\n <SvgLabel />\n </Icon>\n }\n isExpanded={isMappedBlockExpanded}\n setIsExpanded={setIsMappedBlockExpanded}\n >\n <div className=\"gmw-property-view-container\">\n <div className=\"gmw-property-view-button\">\n <Button onClick={async () => setShowPropertiesSelectionModal(true)} disabled={isLoading}>\n {GroupingMappingWidget.translate(\"properties.selectProperties\")}\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ? (\n <div className=\"gmw-empty-selection\">\n <Text>{GroupingMappingWidget.translate(\"properties.noSelected\")}</Text>\n <Text>{GroupingMappingWidget.translate(\"properties.selectPropertiesHint\")}</Text>\n </div>\n ) : (\n selectedProperties.map((property) => (\n <GroupPropertyListItem\n key={property.key}\n content={`${property.displayLabel}`}\n title={`${property.actualECClassName}`}\n description={property.categoryLabel}\n />\n ))\n )}\n </div>\n </div>\n </ScrollableExpandableBlock>\n <ScrollableExpandableBlock\n parentRef={actionContainerRef}\n ref={calculatedPropertyActionRef}\n title={GroupingMappingWidget.translate(\"properties.calculatedProperty\")}\n endIcon={\n <Icon fill={calculatedPropertyType ? \"informational\" : \"default\"}>\n <SvgMeasure />\n </Icon>\n }\n isExpanded={isCalculatedBlockExpanded}\n setIsExpanded={setIsCalculatedBlockExpanded}\n >\n <CalculatedPropertyActionWithVisuals\n group={group}\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n />\n </ScrollableExpandableBlock>\n <ScrollableExpandableBlock\n parentRef={actionContainerRef}\n ref={customCalculationActionRef}\n title={GroupingMappingWidget.translate(\"properties.customCalculation\")}\n endIcon={\n <Icon fill={formula ? \"informational\" : \"default\"}>\n <SvgFunction />\n </Icon>\n }\n isExpanded={isFormulaBlockExpanded}\n setIsExpanded={setIsFormulaBlockExpanded}\n >\n <CustomCalculationAction\n formula={formula}\n setFormula={setFormula}\n formulaErrorMessage={formulaErrorMessage}\n forceValidation={forceValidation}\n disabled={isLoading}\n />\n </ScrollableExpandableBlock>\n </div>\n <ActionPanel\n onSave={handleSaveClick}\n onCancel={onClickCancel}\n onSaveCapture={clearAll}\n onCancelCapture={clearAll}\n isLoading={isLoading}\n isSavingDisabled={!propertyName || dataType === undefined || formulaErrorMessage !== undefined}\n />\n <GroupsPropertiesSelectionModal\n showModal={showPropertiesSelectionModal}\n setShowModal={setShowPropertiesSelectionModal}\n selectedProperties={selectedProperties}\n setSelectedProperties={setSelectedProperties}\n propertiesMetaData={propertiesMetaData}\n />\n <SaveModal onSave={onSave} onClose={handleCloseSaveModal} showSaveModal={showSaveConfirmationModal} />\n </>\n );\n};\n"]}
|
|
@@ -36,6 +36,7 @@ const PropertyTable_1 = require("../PropertyTable");
|
|
|
36
36
|
const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigContext");
|
|
37
37
|
const react_query_1 = require("@tanstack/react-query");
|
|
38
38
|
const PropertiesClientContext_1 = require("../../context/PropertiesClientContext");
|
|
39
|
+
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
39
40
|
const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, refresh, hideRefreshIcon, onGroupPropertyDelete, }) => {
|
|
40
41
|
const propertiesClient = (0, PropertiesClientContext_1.usePropertiesClient)();
|
|
41
42
|
const { getAccessToken, iModelId } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
@@ -66,15 +67,15 @@ const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isL
|
|
|
66
67
|
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 0, onClick: () => {
|
|
67
68
|
onClickModify(value.row.original);
|
|
68
69
|
close();
|
|
69
|
-
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, "
|
|
70
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.modify")),
|
|
70
71
|
]
|
|
71
72
|
: [],
|
|
72
73
|
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 1, onClick: () => {
|
|
73
74
|
handleShowDeleteModal(value.row.original);
|
|
74
75
|
close();
|
|
75
|
-
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, "
|
|
76
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.remove")),
|
|
76
77
|
].flatMap((p) => p) },
|
|
77
|
-
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: "
|
|
78
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.propertyOptions") },
|
|
78
79
|
react_1.default.createElement(itwinui_icons_react_1.SvgMore, null))));
|
|
79
80
|
},
|
|
80
81
|
},
|
|
@@ -88,7 +89,7 @@ const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isL
|
|
|
88
89
|
await queryClient.invalidateQueries({ queryKey: ["properties", iModelId, mappingId, groupId] });
|
|
89
90
|
},
|
|
90
91
|
});
|
|
91
|
-
return (react_1.default.createElement(PropertyTable_1.PropertyTable, { propertyType: "
|
|
92
|
+
return (react_1.default.createElement(PropertyTable_1.PropertyTable, { propertyType: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.group"), columnsFactory: columnsFactory, data: groupProperties, isLoading: isLoading, onClickAdd: onClickAdd, refreshProperties: refresh, deleteProperty: deleteProperty, hideRefreshIcon: hideRefreshIcon, onGroupPropertyDelete: onGroupPropertyDelete }));
|
|
92
93
|
};
|
|
93
94
|
exports.GroupPropertyTable = GroupPropertyTable;
|
|
94
95
|
//# sourceMappingURL=GroupPropertyTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAA4G;AAC5G,wDAAsF;AACtF,+CAA2C;AAG3C,0DAAuD;AACvD,oDAAiD;AACjD,qFAAqF;AACrF,uDAAoE;AACpE,mFAA4E;
|
|
1
|
+
{"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;A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W,EAAE,cAAc,EAAE,GAAG,IAAA,yBAAW,EAAC;QAClD,UAAU,EAAE,KAAK,EAAE,UAAkB,EAAE,EAAE;YACvC,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;YAC3C,MAAM,gBAAgB,CAAC,cAAc,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrF,CAAC;QACD,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,MAAM,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAClG,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,CACL,8BAAC,6BAAa,IACZ,YAAY,EAAE,6CAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,EACjE,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,eAAe,EACrB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,kBAAkB,sBA2G7B","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 { SvgDelete, SvgEdit, SvgFunction, SvgLabel, SvgMeasure, SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { DropdownMenu, Flex, Icon, IconButton, MenuItem } from \"@itwin/itwinui-react\";\nimport React, { useCallback } from \"react\";\nimport type { CellProps, Column } from \"react-table\";\nimport type { Property } from \"@itwin/insights-client\";\nimport { PropertyNameCell } from \"../PropertyNameCell\";\nimport { PropertyTable } from \"../PropertyTable\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nexport interface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n onClickAdd?: () => void;\n onClickModify?: (value: Property) => void;\n isLoading: boolean;\n groupProperties: Property[];\n refresh: () => Promise<void>;\n hideRefreshIcon?: boolean;\n onGroupPropertyDelete?: () => void;\n}\n\nexport const GroupPropertyTable = ({\n mappingId,\n groupId,\n onClickAdd,\n onClickModify,\n isLoading,\n groupProperties,\n refresh,\n hideRefreshIcon,\n onGroupPropertyDelete,\n}: GroupPropertyTableProps) => {\n const propertiesClient = usePropertiesClient();\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const queryClient = useQueryClient();\n\n const columnsFactory = useCallback(\n (handleShowDeleteModal: (value: Property) => void): Column<Property>[] => [\n {\n id: \"propertyName\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<Property>) => <PropertyNameCell property={value.row.original} onClickModify={onClickModify} />,\n },\n {\n id: \"propertyTypeIcons\",\n Cell: (value: CellProps<Property>) => (\n <Flex flexDirection={\"row\"} gap=\"xs\">\n <Icon fill={value.row.original.ecProperties ? \"informational\" : \"default\"}>\n <SvgLabel />\n </Icon>\n <Icon fill={value.row.original.calculatedPropertyType ? \"informational\" : \"default\"}>\n <SvgMeasure />\n </Icon>\n <Icon fill={value.row.original.formula ? \"informational\" : \"default\"}>\n <SvgFunction />\n </Icon>\n </Flex>\n ),\n },\n {\n id: \"dropdown\",\n width: 80,\n Cell: (value: CellProps<Property>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) =>\n [\n onClickModify\n ? [\n <MenuItem\n key={0}\n onClick={() => {\n onClickModify(value.row.original);\n close();\n }}\n icon={<SvgEdit />}\n >\n {GroupingMappingWidget.translate(\"common.modify\")}\n </MenuItem>,\n ]\n : [],\n <MenuItem\n key={1}\n onClick={() => {\n handleShowDeleteModal(value.row.original);\n close();\n }}\n icon={<SvgDelete />}\n >\n {GroupingMappingWidget.translate(\"common.remove\")}\n </MenuItem>,\n ].flatMap((p) => p)\n }\n >\n <IconButton styleType=\"borderless\" title={GroupingMappingWidget.translate(\"properties.propertyOptions\")}>\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n [onClickModify],\n );\n\n const { mutateAsync: deleteProperty } = useMutation({\n mutationFn: async (propertyId: string) => {\n const accessToken = await getAccessToken();\n await propertiesClient.deleteProperty(accessToken, mappingId, groupId, propertyId);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, groupId] });\n },\n });\n\n return (\n <PropertyTable\n propertyType={GroupingMappingWidget.translate(\"properties.group\")}\n columnsFactory={columnsFactory}\n data={groupProperties}\n isLoading={isLoading}\n onClickAdd={onClickAdd}\n refreshProperties={refresh}\n deleteProperty={deleteProperty}\n hideRefreshIcon={hideRefreshIcon}\n onGroupPropertyDelete={onGroupPropertyDelete}\n />\n );\n};\n"]}
|