@itwin/grouping-mapping-widget 0.25.2 → 0.26.1
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/LICENSE.md +9 -9
- package/README.md +115 -115
- package/lib/cjs/WidgetShell/GroupingMapping.d.ts +5 -5
- package/lib/cjs/WidgetShell/GroupingMapping.js +2 -4
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingContent.js +4 -4
- package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingHeader.d.ts +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingHeader.js +5 -5
- package/lib/cjs/WidgetShell/GroupingMappingHeader.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.d.ts +4 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +5 -3
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +28 -8
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.d.ts +1 -1
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js +7 -7
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/cjs/common/hooks/useIsMounted.js +3 -3
- package/lib/cjs/common/hooks/useIsMounted.js.map +1 -1
- package/lib/cjs/common/hooks/useMemoizedCollectionPick.js +3 -3
- package/lib/cjs/common/hooks/useMemoizedCollectionPick.js.map +1 -1
- package/lib/cjs/common/utils.js +3 -3
- package/lib/cjs/common/utils.js.map +1 -1
- package/lib/cjs/common/viewerUtils.js +2 -2
- package/lib/cjs/common/viewerUtils.js.map +1 -1
- package/lib/cjs/components/Constants.js +4 -4
- package/lib/cjs/components/Constants.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.d.ts +19 -3
- package/lib/cjs/components/GroupingMappingContext.js +40 -13
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +10 -2
- package/lib/cjs/components/Groups/Editing/GroupAction.js +16 -14
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetails.d.ts +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetails.js +5 -7
- package/lib/cjs/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.d.ts +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js +4 -4
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js +4 -4
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/cjs/components/Groups/GroupColorLegend.d.ts +3 -3
- package/lib/cjs/components/Groups/GroupColorLegend.js +3 -3
- package/lib/cjs/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/cjs/components/Groups/GroupListItem.d.ts +4 -4
- package/lib/cjs/components/Groups/GroupListItem.js +6 -4
- package/lib/cjs/components/Groups/GroupListItem.js.map +1 -1
- package/lib/cjs/components/Groups/GroupListItem.scss +14 -0
- package/lib/cjs/components/Groups/GroupMenuActions.d.ts +4 -4
- package/lib/cjs/components/Groups/GroupMenuActions.js +17 -6
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/cjs/components/Groups/GroupMenuActions.scss +2 -0
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/cjs/components/Groups/Groups.d.ts +12 -4
- package/lib/cjs/components/Groups/Groups.js +7 -3
- package/lib/cjs/components/Groups/Groups.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.d.ts +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.js +4 -4
- package/lib/cjs/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.scss +1 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.d.ts +5 -5
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js +2 -2
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.d.ts +19 -11
- package/lib/cjs/components/Groups/GroupsView.js +12 -10
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.scss +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.d.ts +8 -0
- package/lib/cjs/components/Groups/GroupsVisualization.js +27 -24
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js +4 -4
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +4 -4
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +4 -4
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.scss +7 -7
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js +13 -35
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +4 -4
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +3 -3
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +4 -4
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js +4 -4
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js +3 -3
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -2
- package/lib/cjs/components/Groups/groupsHelpers.js +8 -4
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useFetchGroups.d.ts +3 -3
- package/lib/cjs/components/Groups/hooks/useFetchGroups.js +6 -5
- package/lib/cjs/components/Groups/hooks/useFetchGroups.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +16 -8
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js +14 -10
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js +2 -4
- package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/cjs/components/Mappings/BlockingOverlay.js +3 -3
- package/lib/cjs/components/Mappings/BlockingOverlay.js.map +1 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +8 -0
- package/lib/cjs/components/Mappings/Editing/MappingAction.js +16 -15
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.d.ts +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +12 -7
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +3 -3
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +9 -9
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatusIcon.js +4 -4
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatusIcon.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +30 -33
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.d.ts +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +4 -4
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.d.ts +1 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.js +5 -5
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.js +2 -2
- package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.scss +1 -1
- package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +1 -1
- package/lib/cjs/components/Mappings/Import/SelectMappings.js +7 -7
- package/lib/cjs/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.d.ts +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js +6 -6
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/cjs/components/Mappings/Mappings.d.ts +8 -0
- package/lib/cjs/components/Mappings/Mappings.js +7 -3
- package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.d.ts +7 -0
- 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.d.ts +1 -2
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +11 -8
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +8 -7
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappings.js +2 -2
- package/lib/cjs/components/Mappings/hooks/useFetchMappings.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +44 -22
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +2 -2
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +27 -19
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +11 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +28 -15
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +30 -20
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +7 -5
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +4 -6
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +11 -3
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +74 -50
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.scss +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +21 -15
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.d.ts +2 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js +4 -4
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupInformationPanel.js +3 -3
- package/lib/cjs/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +13 -5
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +41 -42
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.js +5 -5
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +4 -4
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +20 -16
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +20 -65
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +20 -29
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.d.ts +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js +7 -7
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +4 -4
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyAction.js +9 -21
- package/lib/cjs/components/Properties/PropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenu.d.ts +13 -5
- package/lib/cjs/components/Properties/PropertyMenu.js +16 -18
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +9 -5
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyNameCell.d.ts +1 -1
- package/lib/cjs/components/Properties/PropertyNameCell.js +4 -4
- package/lib/cjs/components/Properties/PropertyNameCell.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js +5 -6
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTableToolbar.d.ts +1 -1
- package/lib/cjs/components/Properties/PropertyTableToolbar.js +4 -4
- package/lib/cjs/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +11 -7
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useValidator.js +4 -4
- package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/cjs/components/SharedComponents/ActionPanel.d.ts +1 -1
- package/lib/cjs/components/SharedComponents/ActionPanel.js +9 -10
- package/lib/cjs/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +1 -1
- package/lib/cjs/components/SharedComponents/DeleteModal.js +9 -10
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/cjs/components/SharedComponents/EmptyMessage.js +4 -4
- package/lib/cjs/components/SharedComponents/EmptyMessage.js.map +1 -1
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js +4 -4
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/cjs/components/SharedComponents/LoadingSpinner.js +3 -3
- package/lib/cjs/components/SharedComponents/LoadingSpinner.js.map +1 -1
- package/lib/cjs/components/SharedComponents/StatusIcon.js +3 -3
- package/lib/cjs/components/SharedComponents/StatusIcon.js.map +1 -1
- package/lib/cjs/components/context/ExtractionClientContext.js +3 -3
- package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/cjs/components/context/ExtractionStateJobContext.js +3 -3
- package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -1
- package/lib/cjs/components/context/GroupHilitedElementsContext.js +3 -3
- package/lib/cjs/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/components/context/GroupingApiConfigContext.d.ts +16 -0
- package/lib/cjs/components/context/GroupingApiConfigContext.js +7 -0
- package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/cjs/components/context/GroupingMappingCustomUIContext.js +3 -3
- package/lib/cjs/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/cjs/components/context/GroupsClientContext.d.ts +20 -0
- package/lib/cjs/components/context/GroupsClientContext.js +45 -0
- package/lib/cjs/components/context/GroupsClientContext.js.map +1 -0
- package/lib/cjs/components/context/IModelsClientContext.js.map +1 -1
- package/lib/cjs/components/context/ITwinsClientContext.js +3 -3
- package/lib/cjs/components/context/ITwinsClientContext.js.map +1 -1
- package/lib/cjs/components/context/MappingClientContext.d.ts +12 -0
- package/lib/cjs/components/context/MappingClientContext.js +14 -2
- package/lib/cjs/components/context/MappingClientContext.js.map +1 -1
- package/lib/cjs/components/context/PropertiesClientContext.d.ts +20 -0
- package/lib/cjs/components/context/PropertiesClientContext.js +45 -0
- package/lib/cjs/components/context/PropertiesClientContext.js.map +1 -0
- package/lib/cjs/components/context/PropertiesGroupColorContext.js +3 -3
- package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -1
- package/lib/cjs/components/context/PropertyGridWrapperContext.js +3 -3
- package/lib/cjs/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/cjs/components/customUI/DefaultGroupingUI.js +3 -3
- package/lib/cjs/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.d.ts +5 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +17 -18
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js +3 -0
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.d.ts +5 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +12 -8
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.d.ts +5 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +20 -45
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/decorators/BboxDimensionsDecorator.js +3 -10
- package/lib/cjs/decorators/BboxDimensionsDecorator.js.map +1 -1
- package/lib/cjs/formula/FormulaDataTypeResolver.d.ts +1 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js +4 -3
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/FormulaFunctionProvider.js +146 -65
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaOperatorsProvider.js +139 -45
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaSplitter.js +63 -13
- package/lib/cjs/formula/FormulaSplitter.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +9 -16
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/IResult.d.ts +3 -0
- package/lib/cjs/formula/IResult.js.map +1 -1
- package/lib/cjs/formula/InfixToPostfixConverter.js +4 -4
- package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -1
- package/lib/cjs/formula/InputStream.js +3 -3
- package/lib/cjs/formula/InputStream.js.map +1 -1
- package/lib/cjs/formula/ParenthesisValidator.js +3 -3
- package/lib/cjs/formula/ParenthesisValidator.js.map +1 -1
- package/lib/cjs/formula/Queue.js +3 -3
- package/lib/cjs/formula/Queue.js.map +1 -1
- package/lib/cjs/formula/Stack.js +3 -3
- package/lib/cjs/formula/Stack.js.map +1 -1
- package/lib/cjs/formula/StringBuilder.js +3 -3
- package/lib/cjs/formula/StringBuilder.js.map +1 -1
- package/lib/cjs/formula/Types.d.ts +16 -1
- package/lib/cjs/formula/Types.js.map +1 -1
- package/lib/cjs/formula/Utils.js +4 -4
- package/lib/cjs/formula/Utils.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +5 -3
- package/lib/cjs/grouping-mapping-widget.js +14 -4
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupPropertyUtils.test.js +27 -65
- package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +21 -12
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/MockFactory.js +3 -3
- package/lib/cjs/test/MockFactory.js.map +1 -1
- package/lib/cjs/test/PropertyFieldsHelpers.js +3 -3
- package/lib/cjs/test/PropertyFieldsHelpers.js.map +1 -1
- package/lib/cjs/test/QueryBuilder.test.js +3 -3
- package/lib/cjs/test/QueryBuilder.test.js.map +1 -1
- package/lib/cjs/test/QueryBuilder.testdata.js +3 -3
- package/lib/cjs/test/QueryBuilder.testdata.js.map +1 -1
- package/lib/cjs/test/QueryBuilderTestData.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.js +4 -4
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMapping.d.ts +5 -5
- package/lib/esm/WidgetShell/GroupingMapping.js +3 -5
- package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingContent.js +4 -4
- package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingHeader.d.ts +1 -1
- package/lib/esm/WidgetShell/GroupingMappingHeader.js +5 -5
- package/lib/esm/WidgetShell/GroupingMappingHeader.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.d.ts +4 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +6 -4
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +28 -8
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.d.ts +1 -1
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js +7 -7
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/esm/common/hooks/useIsMounted.js +3 -3
- package/lib/esm/common/hooks/useIsMounted.js.map +1 -1
- package/lib/esm/common/hooks/useMemoizedCollectionPick.js +3 -3
- package/lib/esm/common/hooks/useMemoizedCollectionPick.js.map +1 -1
- package/lib/esm/common/utils.js +3 -3
- package/lib/esm/common/utils.js.map +1 -1
- package/lib/esm/common/viewerUtils.js +2 -2
- package/lib/esm/common/viewerUtils.js.map +1 -1
- package/lib/esm/components/Constants.js +4 -4
- package/lib/esm/components/Constants.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.d.ts +19 -3
- package/lib/esm/components/GroupingMappingContext.js +41 -14
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupAction.d.ts +10 -2
- package/lib/esm/components/Groups/Editing/GroupAction.js +17 -15
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetails.d.ts +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetails.js +5 -7
- package/lib/esm/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.d.ts +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js +4 -4
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js +4 -4
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/esm/components/Groups/GroupColorLegend.d.ts +3 -3
- package/lib/esm/components/Groups/GroupColorLegend.js +3 -3
- package/lib/esm/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/esm/components/Groups/GroupListItem.d.ts +4 -4
- package/lib/esm/components/Groups/GroupListItem.js +6 -4
- package/lib/esm/components/Groups/GroupListItem.js.map +1 -1
- package/lib/esm/components/Groups/GroupListItem.scss +14 -0
- package/lib/esm/components/Groups/GroupMenuActions.d.ts +4 -4
- package/lib/esm/components/Groups/GroupMenuActions.js +17 -6
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/esm/components/Groups/GroupMenuActions.scss +2 -0
- package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/esm/components/Groups/Groups.d.ts +12 -4
- package/lib/esm/components/Groups/Groups.js +7 -3
- package/lib/esm/components/Groups/Groups.js.map +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.d.ts +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.js +4 -4
- package/lib/esm/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.scss +1 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.d.ts +5 -5
- package/lib/esm/components/Groups/GroupsShowHideButtons.js +2 -2
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.d.ts +19 -11
- package/lib/esm/components/Groups/GroupsView.js +14 -12
- package/lib/esm/components/Groups/GroupsView.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.scss +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.d.ts +8 -0
- package/lib/esm/components/Groups/GroupsVisualization.js +29 -26
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualizationActions.js +4 -4
- package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +4 -4
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +5 -5
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.scss +7 -7
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js +13 -35
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +4 -4
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +3 -3
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +4 -4
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js +4 -4
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/esm/components/Groups/ToggleGroupVisibility.js +3 -3
- package/lib/esm/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -2
- package/lib/esm/components/Groups/groupsHelpers.js +9 -5
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useFetchGroups.d.ts +3 -3
- package/lib/esm/components/Groups/hooks/useFetchGroups.js +6 -5
- package/lib/esm/components/Groups/hooks/useFetchGroups.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +16 -8
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js +14 -10
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js +3 -5
- package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/esm/components/Mappings/BlockingOverlay.js +3 -3
- package/lib/esm/components/Mappings/BlockingOverlay.js.map +1 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +8 -0
- package/lib/esm/components/Mappings/Editing/MappingAction.js +16 -15
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.d.ts +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +12 -7
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +3 -3
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js +9 -9
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatusIcon.js +4 -4
- package/lib/esm/components/Mappings/Extraction/ExtractionStatusIcon.js.map +1 -1
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +31 -34
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.d.ts +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +4 -4
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.d.ts +1 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.js +5 -5
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.js +2 -2
- package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.scss +1 -1
- package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +1 -1
- package/lib/esm/components/Mappings/Import/SelectMappings.js +8 -8
- package/lib/esm/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingListItem.js.map +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.d.ts +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.js +8 -8
- package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/esm/components/Mappings/Mappings.d.ts +8 -0
- package/lib/esm/components/Mappings/Mappings.js +7 -3
- package/lib/esm/components/Mappings/Mappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.d.ts +7 -0
- package/lib/esm/components/Mappings/MappingsView.js +19 -17
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +1 -2
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +11 -8
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +9 -8
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappings.js +2 -2
- package/lib/esm/components/Mappings/hooks/useFetchMappings.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +45 -23
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +2 -2
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js +27 -19
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +11 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +30 -17
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +33 -23
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +8 -6
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +5 -7
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +11 -3
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +76 -52
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.scss +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +23 -17
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.d.ts +2 -2
- package/lib/esm/components/Properties/GroupColorToggle.js +4 -4
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupInformationPanel.js +3 -3
- package/lib/esm/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +13 -5
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +43 -44
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.js +5 -5
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +4 -4
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +22 -18
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +21 -66
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +26 -35
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SaveModal.d.ts +1 -1
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js +8 -8
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +4 -4
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/esm/components/Properties/PropertyAction.js +9 -21
- package/lib/esm/components/Properties/PropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenu.d.ts +13 -5
- package/lib/esm/components/Properties/PropertyMenu.js +16 -18
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +9 -5
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/esm/components/Properties/PropertyNameCell.d.ts +1 -1
- package/lib/esm/components/Properties/PropertyNameCell.js +4 -4
- package/lib/esm/components/Properties/PropertyNameCell.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.js +5 -6
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTableToolbar.d.ts +1 -1
- package/lib/esm/components/Properties/PropertyTableToolbar.js +4 -4
- package/lib/esm/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js +11 -7
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useValidator.js +4 -4
- package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/esm/components/SharedComponents/ActionPanel.d.ts +1 -1
- package/lib/esm/components/SharedComponents/ActionPanel.js +9 -10
- package/lib/esm/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/esm/components/SharedComponents/DeleteModal.d.ts +1 -1
- package/lib/esm/components/SharedComponents/DeleteModal.js +10 -11
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/esm/components/SharedComponents/EmptyMessage.js +4 -4
- package/lib/esm/components/SharedComponents/EmptyMessage.js.map +1 -1
- package/lib/esm/components/SharedComponents/LoadingOverlay.js +4 -4
- package/lib/esm/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/esm/components/SharedComponents/LoadingSpinner.js +3 -3
- package/lib/esm/components/SharedComponents/LoadingSpinner.js.map +1 -1
- package/lib/esm/components/SharedComponents/StatusIcon.js +3 -3
- package/lib/esm/components/SharedComponents/StatusIcon.js.map +1 -1
- package/lib/esm/components/context/ExtractionClientContext.js +3 -3
- package/lib/esm/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/esm/components/context/ExtractionStateJobContext.js +3 -3
- package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -1
- package/lib/esm/components/context/GroupHilitedElementsContext.js +3 -3
- package/lib/esm/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/components/context/GroupingApiConfigContext.d.ts +16 -0
- package/lib/esm/components/context/GroupingApiConfigContext.js +7 -0
- package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/esm/components/context/GroupingMappingCustomUIContext.js +3 -3
- package/lib/esm/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/esm/components/context/GroupsClientContext.d.ts +20 -0
- package/lib/esm/components/context/GroupsClientContext.js +39 -0
- package/lib/esm/components/context/GroupsClientContext.js.map +1 -0
- package/lib/esm/components/context/IModelsClientContext.js.map +1 -1
- package/lib/esm/components/context/ITwinsClientContext.js +3 -3
- package/lib/esm/components/context/ITwinsClientContext.js.map +1 -1
- package/lib/esm/components/context/MappingClientContext.d.ts +12 -0
- package/lib/esm/components/context/MappingClientContext.js +15 -3
- package/lib/esm/components/context/MappingClientContext.js.map +1 -1
- package/lib/esm/components/context/PropertiesClientContext.d.ts +20 -0
- package/lib/esm/components/context/PropertiesClientContext.js +39 -0
- package/lib/esm/components/context/PropertiesClientContext.js.map +1 -0
- package/lib/esm/components/context/PropertiesGroupColorContext.js +3 -3
- package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -1
- package/lib/esm/components/context/PropertyGridWrapperContext.js +3 -3
- package/lib/esm/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/esm/components/customUI/DefaultGroupingUI.js +3 -3
- package/lib/esm/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.d.ts +5 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +18 -19
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
- package/lib/esm/components/customUI/GroupingMappingCustomUI.js +3 -0
- package/lib/esm/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.d.ts +5 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js +12 -8
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.d.ts +5 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js +20 -45
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/decorators/BboxDimensionsDecorator.js +5 -12
- package/lib/esm/decorators/BboxDimensionsDecorator.js.map +1 -1
- package/lib/esm/formula/FormulaDataTypeResolver.d.ts +1 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js +4 -3
- package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/FormulaFunctionProvider.js +146 -65
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/esm/formula/FormulaOperatorsProvider.js +139 -45
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/esm/formula/FormulaSplitter.js +63 -13
- package/lib/esm/formula/FormulaSplitter.js.map +1 -1
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js +9 -16
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/IResult.d.ts +3 -0
- package/lib/esm/formula/IResult.js.map +1 -1
- package/lib/esm/formula/InfixToPostfixConverter.js +5 -5
- package/lib/esm/formula/InfixToPostfixConverter.js.map +1 -1
- package/lib/esm/formula/InputStream.js +3 -3
- package/lib/esm/formula/InputStream.js.map +1 -1
- package/lib/esm/formula/ParenthesisValidator.js +3 -3
- package/lib/esm/formula/ParenthesisValidator.js.map +1 -1
- package/lib/esm/formula/Queue.js +3 -3
- package/lib/esm/formula/Queue.js.map +1 -1
- package/lib/esm/formula/Stack.js +3 -3
- package/lib/esm/formula/Stack.js.map +1 -1
- package/lib/esm/formula/StringBuilder.js +3 -3
- package/lib/esm/formula/StringBuilder.js.map +1 -1
- package/lib/esm/formula/Types.d.ts +16 -1
- package/lib/esm/formula/Types.js.map +1 -1
- package/lib/esm/formula/Utils.js +4 -4
- package/lib/esm/formula/Utils.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +5 -3
- package/lib/esm/grouping-mapping-widget.js +8 -6
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupPropertyUtils.test.js +28 -66
- package/lib/esm/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +21 -12
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/MockFactory.js +3 -3
- package/lib/esm/test/MockFactory.js.map +1 -1
- package/lib/esm/test/PropertyFieldsHelpers.js +3 -3
- package/lib/esm/test/PropertyFieldsHelpers.js.map +1 -1
- package/lib/esm/test/QueryBuilder.test.js +3 -3
- package/lib/esm/test/QueryBuilder.test.js.map +1 -1
- package/lib/esm/test/QueryBuilder.testdata.js +3 -3
- package/lib/esm/test/QueryBuilder.testdata.js.map +1 -1
- package/lib/esm/test/QueryBuilderTestData.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.js +4 -4
- package/lib/esm/test/test-utils.js.map +1 -1
- package/package.json +10 -5
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { useGroupHilitedElementsContext } from "../context/GroupHilitedElementsContext";
|
|
3
|
-
import { generateOverlappedGroups, hideGroupConsideringOverlaps, hideGroupIds, visualizeGroupColors
|
|
4
|
-
import { clearEmphasizedElements, clearEmphasizedOverriddenElements, clearHiddenElements, hideElements, zoomToElements
|
|
3
|
+
import { generateOverlappedGroups, hideGroupConsideringOverlaps, hideGroupIds, visualizeGroupColors } from "./groupsHelpers";
|
|
4
|
+
import { clearEmphasizedElements, clearEmphasizedOverriddenElements, clearHiddenElements, hideElements, zoomToElements } from "../../common/viewerUtils";
|
|
5
5
|
import { Groups } from "./Groups";
|
|
6
6
|
import { GroupColorLegend } from "./GroupColorLegend";
|
|
7
7
|
import { GroupVisualizationActions } from "./GroupsVisualizationActions";
|
|
@@ -10,11 +10,15 @@ import "./GroupsVisualization.scss";
|
|
|
10
10
|
import { useGroupingMappingApiConfig } from "../context/GroupingApiConfigContext";
|
|
11
11
|
import { Alert, Icon, Text } from "@itwin/itwinui-react";
|
|
12
12
|
import { SvgMore } from "@itwin/itwinui-icons-react";
|
|
13
|
-
import { useMappingClient } from "../context/MappingClientContext";
|
|
14
13
|
import { useMutation } from "@tanstack/react-query";
|
|
15
14
|
import { useIsMounted } from "../../common/hooks/useIsMounted";
|
|
16
15
|
import { useFetchGroups } from "./hooks/useFetchGroups";
|
|
17
16
|
import { useKeySetHiliteQueries } from "./hooks/useKeySetHiliteQueries";
|
|
17
|
+
import { useGroupsClient } from "../context/GroupsClientContext";
|
|
18
|
+
/**
|
|
19
|
+
* Component to visualize groups and their elements.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
18
22
|
export const GroupsVisualization = ({ emphasizeElements = true, isNonEmphasizedSelectable = false, onClickGroupModify, onClickAddGroup, mapping, ...rest }) => {
|
|
19
23
|
const { iModelConnection } = useGroupingMappingApiConfig();
|
|
20
24
|
if (!iModelConnection) {
|
|
@@ -23,9 +27,9 @@ export const GroupsVisualization = ({ emphasizeElements = true, isNonEmphasizedS
|
|
|
23
27
|
const [isAlertClosed, setIsAlertClosed] = useState(true);
|
|
24
28
|
const [isAlertExpanded, setIsAlertExpanded] = useState(false);
|
|
25
29
|
const { hiddenGroupsIds, showGroupColor, setShowGroupColor, isOverlappedColored, setHiddenGroupsIds, setNumberOfVisualizedGroups, isVisualizationsEnabled, setIsVisualizationsEnabled, overlappedElementsMetadata, setOverlappedElementsMetadata, } = useGroupHilitedElementsContext();
|
|
26
|
-
const { getAccessToken
|
|
27
|
-
const
|
|
28
|
-
const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(
|
|
30
|
+
const { getAccessToken } = useGroupingMappingApiConfig();
|
|
31
|
+
const groupsClient = useGroupsClient();
|
|
32
|
+
const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(mapping.id, getAccessToken, groupsClient);
|
|
29
33
|
const isMounted = useIsMounted();
|
|
30
34
|
const [enableGroupQueries, setEnableGroupQueries] = useState(false);
|
|
31
35
|
const { groupQueries } = useKeySetHiliteQueries(groups ?? [], enableGroupQueries, iModelConnection);
|
|
@@ -143,11 +147,7 @@ export const GroupsVisualization = ({ emphasizeElements = true, isNonEmphasizedS
|
|
|
143
147
|
return;
|
|
144
148
|
hideAllGroups();
|
|
145
149
|
setHiddenGroupsIds(new Set(groups.map((g) => g.id)));
|
|
146
|
-
}, [
|
|
147
|
-
setHiddenGroupsIds,
|
|
148
|
-
groups,
|
|
149
|
-
hideAllGroups,
|
|
150
|
-
]);
|
|
150
|
+
}, [setHiddenGroupsIds, groups, hideAllGroups]);
|
|
151
151
|
const onModify = useCallback((group, type) => {
|
|
152
152
|
if (!onClickGroupModify)
|
|
153
153
|
return;
|
|
@@ -164,21 +164,24 @@ export const GroupsVisualization = ({ emphasizeElements = true, isNonEmphasizedS
|
|
|
164
164
|
onClickAddGroup(type);
|
|
165
165
|
clearEmphasizedElements();
|
|
166
166
|
}, [onClickAddGroup]);
|
|
167
|
-
const groupActionButtonRenderers = useMemo(() => isVisualizationsEnabled
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
167
|
+
const groupActionButtonRenderers = useMemo(() => isVisualizationsEnabled
|
|
168
|
+
? [
|
|
169
|
+
(props) => (showGroupColor ? React.createElement(GroupColorLegend, { ...props, groups: groups ?? [] }) : []),
|
|
170
|
+
(props) => (React.createElement(GroupsShowHideButtons, { ...props, isLoadingQuery: !(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady), showGroup: showGroup, hideGroup: hideSingleGroupWrapper })),
|
|
171
|
+
].flat()
|
|
172
|
+
: [], [groups, hideSingleGroupWrapper, isGroupsFetched, isGroupsQueriesReady, isVisualizationsEnabled, showGroup, showGroupColor]);
|
|
173
|
+
const overlappedAlert = useMemo(() => overlappedElementsMetadata.overlappedElementsInfo.size > 0 && isAlertClosed && showGroupColor ? (React.createElement(Alert, { onClose: () => setIsAlertClosed(false), clickableText: isAlertExpanded ? "Less Details" : "More Details", clickableTextProps: { onClick: () => setIsAlertExpanded(!isAlertExpanded) } },
|
|
174
|
+
"Overlapping elements are colored ",
|
|
175
|
+
React.createElement(Text, { className: "gmw-red-text" }, "red"),
|
|
176
|
+
" in the viewer.",
|
|
177
|
+
isAlertExpanded ? (React.createElement(React.Fragment, null,
|
|
178
|
+
React.createElement("br", null),
|
|
179
|
+
"To get overlap info in detail, click the",
|
|
180
|
+
" ",
|
|
181
|
+
React.createElement(Icon, null,
|
|
182
|
+
React.createElement(SvgMore, null)),
|
|
183
|
+
" ",
|
|
184
|
+
"button then \u201COverlap Info\u201D")) : undefined)) : undefined, [isAlertClosed, isAlertExpanded, overlappedElementsMetadata.overlappedElementsInfo.size, showGroupColor]);
|
|
182
185
|
const progressConfig = useMemo(() => isVisualizationsEnabled && isResolvingGroupQueries
|
|
183
186
|
? {
|
|
184
187
|
hilitedGroupsProgress: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsVisualization.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualization.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,mBAAmB,EACnB,YAAY,EACZ,cAAc,GACf,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,O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AAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACvE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAChB;QACF,oBAAC,MAAM,IACL,kBAAkB,EAAE,QAAQ,EAC5B,eAAe,EAAE,UAAU,EAC3B,qBAAqB,EAAE,0BAA0B,EACjD,OAAO,EAAE,OAAO,KACZ,IAAI,EACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,eAAe,GACtB,CACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { Group } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { OverlappedElementGroupPairs } from \"../context/GroupHilitedElementsContext\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport {\n generateOverlappedGroups,\n hideGroupConsideringOverlaps,\n hideGroupIds,\n visualizeGroupColors,\n} from \"./groupsHelpers\";\nimport {\n clearEmphasizedElements,\n clearEmphasizedOverriddenElements,\n clearHiddenElements,\n hideElements,\n zoomToElements,\n} from \"../../common/viewerUtils\";\nimport type { GroupsProps } from \"./Groups\";\nimport { Groups } from \"./Groups\";\nimport { GroupColorLegend } from \"./GroupColorLegend\";\nimport { GroupVisualizationActions } from \"./GroupsVisualizationActions\";\nimport { GroupsShowHideButtons } from \"./GroupsShowHideButtons\";\nimport \"./GroupsVisualization.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { ActionButtonRenderer, ActionButtonRendererProps } from \"./GroupsView\";\nimport { Alert, Icon, Text } from \"@itwin/itwinui-react\";\nimport { SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { useMappingClient } from \"../context/MappingClientContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useFetchGroups } from \"./hooks/useFetchGroups\";\nimport { useKeySetHiliteQueries } from \"./hooks/useKeySetHiliteQueries\";\n\nexport interface GroupsVisualizationProps extends GroupsProps {\n isNonEmphasizedSelectable?: boolean;\n emphasizeElements?: boolean;\n}\n\nexport const GroupsVisualization = ({\n emphasizeElements = true,\n isNonEmphasizedSelectable = false,\n onClickGroupModify,\n onClickAddGroup,\n mapping,\n ...rest\n}: GroupsVisualizationProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [isAlertClosed, setIsAlertClosed] = useState<boolean>(true);\n const [isAlertExpanded, setIsAlertExpanded] = useState<boolean>(false);\n const {\n hiddenGroupsIds,\n showGroupColor,\n setShowGroupColor,\n isOverlappedColored,\n setHiddenGroupsIds,\n setNumberOfVisualizedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n } = useGroupHilitedElementsContext();\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(iModelId, mapping.id, getAccessToken, mappingClient);\n const isMounted = useIsMounted();\n const [enableGroupQueries, setEnableGroupQueries] = useState<boolean>(false);\n const { groupQueries } = useKeySetHiliteQueries(groups ?? [], enableGroupQueries, iModelConnection);\n\n const triggerVisualization = useCallback(async (groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) =>\n visualizeGroupColors(\n hiddenGroupsIds,\n groupsWithGroupedOverlaps,\n setNumberOfVisualizedGroups,\n emphasizeElements,\n ), [emphasizeElements, hiddenGroupsIds, setNumberOfVisualizedGroups]);\n\n const zoomToElementsMutation = useMutation({\n mutationFn: zoomToElements,\n onSuccess: () => {\n if (isMounted) {\n isNonEmphasizedSelectable && clearEmphasizedElements();\n }\n },\n });\n\n const visualizationMutation = useMutation({\n mutationFn: triggerVisualization,\n onSuccess: (allIds) => {\n if (isMounted) {\n zoomToElementsMutation.mutate(allIds);\n }\n },\n });\n\n const isGroupsQueriesReady = useMemo(() =>\n groupQueries.every((query) => query.isFetched && query.data) && groupQueries.length > 0, [groupQueries]\n );\n const groupQueriesProgressCount = useMemo(() => groupQueries.filter((query) => query.isFetched).length, [groupQueries]);\n const isResolvingGroupQueries = useMemo(() => groupQueries.some((query) => query.isFetching), [groupQueries]);\n\n const hiliteIds = useMemo(() => {\n if (!isGroupsQueriesReady || !groups) return [];\n\n // Map to track which groups have been processed for each query to ensure unique associations between groups and queries\n const processedGroupIds = new Map<string, string[]>();\n\n return groupQueries.flatMap((query) => {\n // Find all groups that match the current query and haven't been processed yet for this query\n const matchingGroups = groups.filter((group) => {\n const isMatch = group.query === query.data!.query;\n const isProcessed = processedGroupIds.get(query.data!.query)?.includes(group.id);\n return isMatch && !isProcessed;\n });\n\n matchingGroups.forEach((group) => {\n const existingGroupIds = processedGroupIds.get(query.data!.query);\n if (existingGroupIds) {\n existingGroupIds.push(group.id);\n } else {\n processedGroupIds.set(query.data!.query, [group.id]);\n }\n });\n\n // Map each matching group to an object with groupId and elementIds\n return matchingGroups.map((group) => ({\n groupId: group.id,\n elementIds: query.data!.result.ids,\n }));\n });\n }, [groupQueries, isGroupsQueriesReady, groups]);\n\n const getHiliteIdsFromGroupsWrapper = useCallback(\n (groups: Group[]) =>\n hiliteIds.filter((id) => groups.some((group) => group.id === id.groupId)).flatMap((id) => id.elementIds),\n [hiliteIds]\n );\n\n useEffect(() => {\n const processOverlappedGroups = async () => {\n const results = generateOverlappedGroups(hiliteIds);\n const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = results;\n\n setOverlappedElementsMetadata({\n overlappedElementsInfo,\n groupElementsInfo: numberOfElementsInGroups,\n overlappedElementGroupPairs: groupsWithGroupedOverlaps,\n });\n\n if (showGroupColor) {\n await visualizationMutation.mutateAsync(groupsWithGroupedOverlaps);\n } else {\n clearEmphasizedOverriddenElements();\n }\n\n clearHiddenElements();\n hideGroupIds(hiddenGroupsIds, groupsWithGroupedOverlaps);\n };\n\n const shouldProcessOverlappedGroups = () => !isOverlappedColored && hiliteIds.length > 0 && !isGroupsFetching;\n\n if (shouldProcessOverlappedGroups()) {\n void processOverlappedGroups();\n }\n // We don't want to trigger full visualization when toggling individual groups.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showGroupColor, isOverlappedColored, hiliteIds]);\n\n useEffect(() => {\n if (isVisualizationsEnabled) {\n setEnableGroupQueries(true);\n } else {\n setShowGroupColor(false);\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }\n }, [isVisualizationsEnabled, setHiddenGroupsIds, setIsVisualizationsEnabled, setShowGroupColor]);\n\n const hideAllGroups = useCallback(\n () => {\n if (!groups) return;\n hideElements(getHiliteIdsFromGroupsWrapper(groups));\n },\n [getHiliteIdsFromGroupsWrapper, groups]\n );\n\n const hideSingleGroupWrapper = useCallback(\n (groupToHide: Group) => {\n hideGroupConsideringOverlaps(overlappedElementsMetadata.overlappedElementGroupPairs, groupToHide.id, hiddenGroupsIds);\n },\n [hiddenGroupsIds, overlappedElementsMetadata.overlappedElementGroupPairs]\n );\n\n const showGroup = useCallback(\n (viewGroup: Group) => {\n if (!groups) return;\n clearHiddenElements();\n\n // hide group Ids filter\n const newHiddenGroups: Group[] = groups.filter((g) => hiddenGroupsIds.has(g.id) && g.id !== viewGroup.id);\n\n // view group Ids filter\n const viewGroups = groups.filter((g) => !hiddenGroupsIds.has(g.id) || g.id === viewGroup.id);\n const viewIds = getHiliteIdsFromGroupsWrapper(viewGroups);\n\n let hiddenIds = getHiliteIdsFromGroupsWrapper(newHiddenGroups);\n hiddenIds = hiddenIds.filter((id) => !viewIds.includes(id));\n hideElements(hiddenIds);\n },\n [groups, hiddenGroupsIds, getHiliteIdsFromGroupsWrapper]\n );\n\n const showAll = useCallback(() => {\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }, [setHiddenGroupsIds]);\n\n const hideAll = useCallback(() => {\n if (!groups) return;\n hideAllGroups();\n setHiddenGroupsIds(\n new Set(groups.map((g) => g.id))\n );\n\n }, [\n setHiddenGroupsIds,\n groups,\n hideAllGroups,\n ]);\n\n const onModify = useCallback(\n (group: Group, type: string) => {\n if (!onClickGroupModify) return;\n if (group.id && hiddenGroupsIds.has(group.id)) {\n showGroup(group);\n setHiddenGroupsIds(new Set([...hiddenGroupsIds].filter((id) => id !== group.id)));\n }\n clearEmphasizedElements();\n onClickGroupModify(group, type);\n },\n [hiddenGroupsIds, onClickGroupModify, setHiddenGroupsIds, showGroup]\n );\n\n const onAddGroup = useCallback(\n (type: string) => {\n if (!onClickAddGroup) return;\n onClickAddGroup(type);\n clearEmphasizedElements();\n },\n [onClickAddGroup]\n );\n\n const groupActionButtonRenderers: ActionButtonRenderer[] = useMemo(() => isVisualizationsEnabled ? [\n (props: ActionButtonRendererProps) =>\n showGroupColor ? <GroupColorLegend {...props} groups={groups ?? []} /> : [],\n (props: ActionButtonRendererProps) => (\n <GroupsShowHideButtons\n {...props}\n isLoadingQuery={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n showGroup={showGroup}\n hideGroup={hideSingleGroupWrapper}\n />\n ),\n ].flat() : [], [groups, hideSingleGroupWrapper, isGroupsFetched, isGroupsQueriesReady, isVisualizationsEnabled, showGroup, showGroupColor]);\n\n const overlappedAlert = useMemo(() =>\n overlappedElementsMetadata.overlappedElementsInfo.size > 0 && isAlertClosed && showGroupColor ?\n <Alert\n onClose={() => setIsAlertClosed(false)}\n clickableText={isAlertExpanded ? \"Less Details\" : \"More Details\"}\n clickableTextProps={{ onClick: () => setIsAlertExpanded(!isAlertExpanded) }}\n >\n Overlapping elements are colored <Text className=\"gmw-red-text\">red</Text> in the viewer.\n {isAlertExpanded ? (\n <>\n <br />\n To get overlap info in detail, click the <Icon><SvgMore /></Icon> button then “Overlap Info”\n </>\n ) : undefined}\n </Alert> : undefined, [isAlertClosed, isAlertExpanded, overlappedElementsMetadata.overlappedElementsInfo.size, showGroupColor]\n );\n\n const progressConfig = useMemo(\n () =>\n isVisualizationsEnabled && isResolvingGroupQueries\n ? {\n hilitedGroupsProgress: {\n currentHilitedGroups: groupQueriesProgressCount,\n totalNumberOfGroups: groups?.length ?? 0,\n },\n }\n : undefined,\n [groupQueriesProgressCount, groups, isResolvingGroupQueries, isVisualizationsEnabled],\n );\n\n return (\n <div className=\"gmw-groups-vis-container\">\n <GroupVisualizationActions\n disabled={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n isVisualizationEnabled={isVisualizationsEnabled}\n onClickVisualizationButton={() => setIsVisualizationsEnabled((b) => !b)}\n showAll={showAll}\n hideAll={hideAll}\n />\n <Groups\n onClickGroupModify={onModify}\n onClickAddGroup={onAddGroup}\n actionButtonRenderers={groupActionButtonRenderers}\n mapping={mapping}\n {...rest}\n progressConfig={progressConfig}\n alert={overlappedAlert}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupsVisualization.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualization.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8B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AAoB,EAAE,yBAAyB;gBAC/C,mBAAmB,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;aACzC;SACF;QACH,CAAC,CAAC,SAAS,EACf,CAAC,yBAAyB,EAAE,MAAM,EAAE,uBAAuB,EAAE,uBAAuB,CAAC,CACtF,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B;QACvC,oBAAC,yBAAyB,IACxB,QAAQ,EAAE,CAAC,CAAC,uBAAuB,IAAI,eAAe,IAAI,oBAAoB,CAAC,EAC/E,sBAAsB,EAAE,uBAAuB,EAC/C,0BAA0B,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACvE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAChB;QACF,oBAAC,MAAM,IACL,kBAAkB,EAAE,QAAQ,EAC5B,eAAe,EAAE,UAAU,EAC3B,qBAAqB,EAAE,0BAA0B,EACjD,OAAO,EAAE,OAAO,KACZ,IAAI,EACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,eAAe,GACtB,CACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { OverlappedElementGroupPairs } from \"../context/GroupHilitedElementsContext\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { generateOverlappedGroups, hideGroupConsideringOverlaps, hideGroupIds, visualizeGroupColors } from \"./groupsHelpers\";\nimport { clearEmphasizedElements, clearEmphasizedOverriddenElements, clearHiddenElements, hideElements, zoomToElements } from \"../../common/viewerUtils\";\nimport type { GroupsProps } from \"./Groups\";\nimport { Groups } from \"./Groups\";\nimport { GroupColorLegend } from \"./GroupColorLegend\";\nimport { GroupVisualizationActions } from \"./GroupsVisualizationActions\";\nimport { GroupsShowHideButtons } from \"./GroupsShowHideButtons\";\nimport \"./GroupsVisualization.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { ActionButtonRenderer, ActionButtonRendererProps } from \"./GroupsView\";\nimport { Alert, Icon, Text } from \"@itwin/itwinui-react\";\nimport { SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useFetchGroups } from \"./hooks/useFetchGroups\";\nimport { useKeySetHiliteQueries } from \"./hooks/useKeySetHiliteQueries\";\nimport { useGroupsClient } from \"../context/GroupsClientContext\";\n\n/**\n * Props for the {@link GroupsVisualization} component.\n * @public\n */\nexport interface GroupsVisualizationProps extends GroupsProps {\n isNonEmphasizedSelectable?: boolean;\n emphasizeElements?: boolean;\n}\n\n/**\n * Component to visualize groups and their elements.\n * @public\n */\nexport const GroupsVisualization = ({\n emphasizeElements = true,\n isNonEmphasizedSelectable = false,\n onClickGroupModify,\n onClickAddGroup,\n mapping,\n ...rest\n}: GroupsVisualizationProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [isAlertClosed, setIsAlertClosed] = useState<boolean>(true);\n const [isAlertExpanded, setIsAlertExpanded] = useState<boolean>(false);\n const {\n hiddenGroupsIds,\n showGroupColor,\n setShowGroupColor,\n isOverlappedColored,\n setHiddenGroupsIds,\n setNumberOfVisualizedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n } = useGroupHilitedElementsContext();\n const { getAccessToken } = useGroupingMappingApiConfig();\n const groupsClient = useGroupsClient();\n const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(mapping.id, getAccessToken, groupsClient);\n const isMounted = useIsMounted();\n const [enableGroupQueries, setEnableGroupQueries] = useState<boolean>(false);\n const { groupQueries } = useKeySetHiliteQueries(groups ?? [], enableGroupQueries, iModelConnection);\n\n const triggerVisualization = useCallback(\n async (groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) =>\n visualizeGroupColors(hiddenGroupsIds, groupsWithGroupedOverlaps, setNumberOfVisualizedGroups, emphasizeElements),\n [emphasizeElements, hiddenGroupsIds, setNumberOfVisualizedGroups],\n );\n\n const zoomToElementsMutation = useMutation({\n mutationFn: zoomToElements,\n onSuccess: () => {\n if (isMounted) {\n isNonEmphasizedSelectable && clearEmphasizedElements();\n }\n },\n });\n\n const visualizationMutation = useMutation({\n mutationFn: triggerVisualization,\n onSuccess: (allIds) => {\n if (isMounted) {\n zoomToElementsMutation.mutate(allIds);\n }\n },\n });\n\n const isGroupsQueriesReady = useMemo(() => groupQueries.every((query) => query.isFetched && query.data) && groupQueries.length > 0, [groupQueries]);\n const groupQueriesProgressCount = useMemo(() => groupQueries.filter((query) => query.isFetched).length, [groupQueries]);\n const isResolvingGroupQueries = useMemo(() => groupQueries.some((query) => query.isFetching), [groupQueries]);\n\n const hiliteIds = useMemo(() => {\n if (!isGroupsQueriesReady || !groups) return [];\n\n // Map to track which groups have been processed for each query to ensure unique associations between groups and queries\n const processedGroupIds = new Map<string, string[]>();\n\n return groupQueries.flatMap((query) => {\n // Find all groups that match the current query and haven't been processed yet for this query\n const matchingGroups = groups.filter((group) => {\n const isMatch = group.query === query.data!.query;\n const isProcessed = processedGroupIds.get(query.data!.query)?.includes(group.id);\n return isMatch && !isProcessed;\n });\n\n matchingGroups.forEach((group) => {\n const existingGroupIds = processedGroupIds.get(query.data!.query);\n if (existingGroupIds) {\n existingGroupIds.push(group.id);\n } else {\n processedGroupIds.set(query.data!.query, [group.id]);\n }\n });\n\n // Map each matching group to an object with groupId and elementIds\n return matchingGroups.map((group) => ({\n groupId: group.id,\n elementIds: query.data!.result.ids,\n }));\n });\n }, [groupQueries, isGroupsQueriesReady, groups]);\n\n const getHiliteIdsFromGroupsWrapper = useCallback(\n (groups: GroupMinimal[]) => hiliteIds.filter((id) => groups.some((group) => group.id === id.groupId)).flatMap((id) => id.elementIds),\n [hiliteIds],\n );\n\n useEffect(() => {\n const processOverlappedGroups = async () => {\n const results = generateOverlappedGroups(hiliteIds);\n const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = results;\n\n setOverlappedElementsMetadata({\n overlappedElementsInfo,\n groupElementsInfo: numberOfElementsInGroups,\n overlappedElementGroupPairs: groupsWithGroupedOverlaps,\n });\n\n if (showGroupColor) {\n await visualizationMutation.mutateAsync(groupsWithGroupedOverlaps);\n } else {\n clearEmphasizedOverriddenElements();\n }\n\n clearHiddenElements();\n hideGroupIds(hiddenGroupsIds, groupsWithGroupedOverlaps);\n };\n\n const shouldProcessOverlappedGroups = () => !isOverlappedColored && hiliteIds.length > 0 && !isGroupsFetching;\n\n if (shouldProcessOverlappedGroups()) {\n void processOverlappedGroups();\n }\n // We don't want to trigger full visualization when toggling individual groups.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showGroupColor, isOverlappedColored, hiliteIds]);\n\n useEffect(() => {\n if (isVisualizationsEnabled) {\n setEnableGroupQueries(true);\n } else {\n setShowGroupColor(false);\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }\n }, [isVisualizationsEnabled, setHiddenGroupsIds, setIsVisualizationsEnabled, setShowGroupColor]);\n\n const hideAllGroups = useCallback(() => {\n if (!groups) return;\n hideElements(getHiliteIdsFromGroupsWrapper(groups));\n }, [getHiliteIdsFromGroupsWrapper, groups]);\n\n const hideSingleGroupWrapper = useCallback(\n (groupToHide: GroupMinimal) => {\n hideGroupConsideringOverlaps(overlappedElementsMetadata.overlappedElementGroupPairs, groupToHide.id, hiddenGroupsIds);\n },\n [hiddenGroupsIds, overlappedElementsMetadata.overlappedElementGroupPairs],\n );\n\n const showGroup = useCallback(\n (viewGroup: GroupMinimal) => {\n if (!groups) return;\n clearHiddenElements();\n\n // hide group Ids filter\n const newHiddenGroups: GroupMinimal[] = groups.filter((g) => hiddenGroupsIds.has(g.id) && g.id !== viewGroup.id);\n\n // view group Ids filter\n const viewGroups = groups.filter((g) => !hiddenGroupsIds.has(g.id) || g.id === viewGroup.id);\n const viewIds = getHiliteIdsFromGroupsWrapper(viewGroups);\n\n let hiddenIds = getHiliteIdsFromGroupsWrapper(newHiddenGroups);\n hiddenIds = hiddenIds.filter((id) => !viewIds.includes(id));\n hideElements(hiddenIds);\n },\n [groups, hiddenGroupsIds, getHiliteIdsFromGroupsWrapper],\n );\n\n const showAll = useCallback(() => {\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }, [setHiddenGroupsIds]);\n\n const hideAll = useCallback(() => {\n if (!groups) return;\n hideAllGroups();\n setHiddenGroupsIds(new Set(groups.map((g) => g.id)));\n }, [setHiddenGroupsIds, groups, hideAllGroups]);\n\n const onModify = useCallback(\n (group: GroupMinimal, type: string) => {\n if (!onClickGroupModify) return;\n if (group.id && hiddenGroupsIds.has(group.id)) {\n showGroup(group);\n setHiddenGroupsIds(new Set([...hiddenGroupsIds].filter((id) => id !== group.id)));\n }\n clearEmphasizedElements();\n onClickGroupModify(group, type);\n },\n [hiddenGroupsIds, onClickGroupModify, setHiddenGroupsIds, showGroup],\n );\n\n const onAddGroup = useCallback(\n (type: string) => {\n if (!onClickAddGroup) return;\n onClickAddGroup(type);\n clearEmphasizedElements();\n },\n [onClickAddGroup],\n );\n\n const groupActionButtonRenderers: ActionButtonRenderer[] = useMemo(\n () =>\n isVisualizationsEnabled\n ? [\n (props: ActionButtonRendererProps) => (showGroupColor ? <GroupColorLegend {...props} groups={groups ?? []} /> : []),\n (props: ActionButtonRendererProps) => (\n <GroupsShowHideButtons\n {...props}\n isLoadingQuery={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n showGroup={showGroup}\n hideGroup={hideSingleGroupWrapper}\n />\n ),\n ].flat()\n : [],\n [groups, hideSingleGroupWrapper, isGroupsFetched, isGroupsQueriesReady, isVisualizationsEnabled, showGroup, showGroupColor],\n );\n\n const overlappedAlert = useMemo(\n () =>\n overlappedElementsMetadata.overlappedElementsInfo.size > 0 && isAlertClosed && showGroupColor ? (\n <Alert\n onClose={() => setIsAlertClosed(false)}\n clickableText={isAlertExpanded ? \"Less Details\" : \"More Details\"}\n clickableTextProps={{ onClick: () => setIsAlertExpanded(!isAlertExpanded) }}\n >\n Overlapping elements are colored <Text className=\"gmw-red-text\">red</Text> in the viewer.\n {isAlertExpanded ? (\n <>\n <br />\n To get overlap info in detail, click the{\" \"}\n <Icon>\n <SvgMore />\n </Icon>{\" \"}\n button then “Overlap Info”\n </>\n ) : undefined}\n </Alert>\n ) : undefined,\n [isAlertClosed, isAlertExpanded, overlappedElementsMetadata.overlappedElementsInfo.size, showGroupColor],\n );\n\n const progressConfig = useMemo(\n () =>\n isVisualizationsEnabled && isResolvingGroupQueries\n ? {\n hilitedGroupsProgress: {\n currentHilitedGroups: groupQueriesProgressCount,\n totalNumberOfGroups: groups?.length ?? 0,\n },\n }\n : undefined,\n [groupQueriesProgressCount, groups, isResolvingGroupQueries, isVisualizationsEnabled],\n );\n\n return (\n <div className=\"gmw-groups-vis-container\">\n <GroupVisualizationActions\n disabled={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n isVisualizationEnabled={isVisualizationsEnabled}\n onClickVisualizationButton={() => setIsVisualizationsEnabled((b) => !b)}\n showAll={showAll}\n hideAll={hideAll}\n />\n <Groups\n onClickGroupModify={onModify}\n onClickAddGroup={onAddGroup}\n actionButtonRenderers={groupActionButtonRenderers}\n mapping={mapping}\n {...rest}\n progressConfig={progressConfig}\n alert={overlappedAlert}\n />\n </div>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ButtonGroup, IconButton, ToggleSwitch } from "@itwin/itwinui-react";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { ToggleGroupVisibility } from "./ToggleGroupVisibility";
|
|
@@ -9,7 +9,7 @@ import { SvgVisibilityHide, SvgVisibilityShow } from "@itwin/itwinui-icons-react
|
|
|
9
9
|
import "./GroupsVisualizationActions.scss";
|
|
10
10
|
import { useGroupHilitedElementsContext } from "../context/GroupHilitedElementsContext";
|
|
11
11
|
export const GroupVisualizationActions = ({ disabled, isVisualizationEnabled, onClickVisualizationButton, showAll, hideAll, }) => {
|
|
12
|
-
const { showGroupColor, setShowGroupColor
|
|
12
|
+
const { showGroupColor, setShowGroupColor } = useGroupHilitedElementsContext();
|
|
13
13
|
return (React.createElement(ButtonGroup, { className: "gmw-visual-buttons" },
|
|
14
14
|
React.createElement(ToggleSwitch, { label: "Visualization", labelPosition: "left", checked: isVisualizationEnabled, onChange: onClickVisualizationButton }),
|
|
15
15
|
React.createElement(ButtonGroup, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsVisualizationActions.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualizationActions.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GroupsVisualizationActions.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualizationActions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAUxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACxC,QAAQ,EACR,sBAAsB,EACtB,0BAA0B,EAC1B,OAAO,EACP,OAAO,GACwB,EAAE,EAAE;IACnC,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,8BAA8B,EAAE,CAAC;IAE/E,OAAO,CACL,oBAAC,WAAW,IAAC,SAAS,EAAC,oBAAoB;QACzC,oBAAC,YAAY,IAAC,KAAK,EAAC,eAAe,EAAC,aAAa,EAAC,MAAM,EAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,0BAA0B,GAAI;QAClI,oBAAC,WAAW;YACV,oBAAC,qBAAqB,IAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,GAAI;YACzH,oBAAC,UAAU,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,YAAY;gBACvF,oBAAC,iBAAiB,OAAG,CACV;YACb,oBAAC,UAAU,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,YAAY;gBACvF,oBAAC,iBAAiB,OAAG,CACV,CACD,CACF,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { ButtonGroup, IconButton, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport { ToggleGroupVisibility } from \"./ToggleGroupVisibility\";\nimport { SvgVisibilityHide, SvgVisibilityShow } from \"@itwin/itwinui-icons-react\";\nimport \"./GroupsVisualizationActions.scss\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\n\ninterface GroupVisualizationActionsProps {\n disabled: boolean;\n isVisualizationEnabled: boolean;\n onClickVisualizationButton: () => void;\n showAll: () => void;\n hideAll: () => void;\n}\n\nexport const GroupVisualizationActions = ({\n disabled,\n isVisualizationEnabled,\n onClickVisualizationButton,\n showAll,\n hideAll,\n}: GroupVisualizationActionsProps) => {\n const { showGroupColor, setShowGroupColor } = useGroupHilitedElementsContext();\n\n return (\n <ButtonGroup className=\"gmw-visual-buttons\">\n <ToggleSwitch label=\"Visualization\" labelPosition=\"left\" checked={isVisualizationEnabled} onChange={onClickVisualizationButton} />\n <ButtonGroup>\n <ToggleGroupVisibility isLoadingQuery={disabled} showGroupColor={showGroupColor} setShowGroupColor={setShowGroupColor} />\n <IconButton title=\"Show All\" onClick={showAll} disabled={disabled} styleType=\"borderless\">\n <SvgVisibilityShow />\n </IconButton>\n <IconButton title=\"Hide All\" onClick={hideAll} disabled={disabled} styleType=\"borderless\">\n <SvgVisibilityHide />\n </IconButton>\n </ButtonGroup>\n </ButtonGroup>\n );\n};\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./OverlappedElementsInformationPanel.scss";
|
|
3
|
-
import type {
|
|
3
|
+
import type { GroupMinimal } from "@itwin/insights-client";
|
|
4
4
|
import type { OverlappedInfo } from "../context/GroupHilitedElementsContext";
|
|
5
5
|
export interface OverlappedElementsInformationPanelProps {
|
|
6
|
-
group?:
|
|
6
|
+
group?: GroupMinimal;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
overlappedElementsInfo: Map<string, OverlappedInfo[]>;
|
|
9
|
-
groups:
|
|
9
|
+
groups: GroupMinimal[];
|
|
10
10
|
}
|
|
11
11
|
export interface OverlappedElementsDisplayProps {
|
|
12
12
|
overlappedElements: string;
|
|
13
13
|
groups: string[];
|
|
14
14
|
elementsIds: string[];
|
|
15
15
|
}
|
|
16
|
-
export declare const OverlappedElementsInformationPanel: ({ group, onClose, overlappedElementsInfo, groups
|
|
16
|
+
export declare const OverlappedElementsInformationPanel: ({ group, onClose, overlappedElementsInfo, groups }: OverlappedElementsInformationPanelProps) => JSX.Element;
|
|
17
17
|
//# sourceMappingURL=OverlappedElementsInformationPanel.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { useCallback, useMemo, useState } from "react";
|
|
7
|
-
import { InformationPanel, InformationPanelBody, InformationPanelHeader, Table, Text, toaster
|
|
7
|
+
import { InformationPanel, InformationPanelBody, InformationPanelHeader, Table, Text, toaster } from "@itwin/itwinui-react";
|
|
8
8
|
import "./OverlappedElementsInformationPanel.scss";
|
|
9
9
|
import { useGroupHilitedElementsContext } from "../context/GroupHilitedElementsContext";
|
|
10
10
|
import { clearEmphasizedOverriddenElements, clearHiddenElements, visualizeElements, zoomToElements } from "../../common/viewerUtils";
|
|
11
|
-
export const OverlappedElementsInformationPanel = ({ group, onClose, overlappedElementsInfo, groups
|
|
11
|
+
export const OverlappedElementsInformationPanel = ({ group, onClose, overlappedElementsInfo, groups }) => {
|
|
12
12
|
const [isOverlappedInfoLoading, setIsOverlappedInfoLoading] = useState(false);
|
|
13
13
|
const { setIsOverlappedColored } = useGroupHilitedElementsContext();
|
|
14
14
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlappedElementsInformationPanel.js","sourceRoot":"","sources":["../../../../src/components/Groups/OverlappedElementsInformationPanel.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"OverlappedElementsInformationPanel.js","sourceRoot":"","sources":["../../../../src/components/Groups/OverlappedElementsInformationPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC5H,OAAO,2CAA2C,CAAC;AAInD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAgBrI,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAA2C,EAAE,EAAE;IAChJ,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACvF,MAAM,EAAE,sBAAsB,EAAE,GAAG,8BAA8B,EAAE,CAAC;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,OAAO,CACrB,GAA8B,EAAE,CAAC;QAC/B;YACE,EAAE,EAAE,QAAQ;YACZ,MAAM,EAAE,qBAAqB;YAC7B,QAAQ,EAAE,oBAAoB;SAC/B;QACD;YACE,EAAE,EAAE,QAAQ;YACZ,MAAM,EAAE,Q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oBAAC,KAAK,IACJ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,EACT,iBAAiB,EAAC,cAAc,EAChC,SAAS,EAAE,uBAAuB,EAClC,UAAU,EAAE,IAAI,EAChB,YAAY,QACZ,aAAa,EAAC,QAAQ,EACtB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS,GAC9B,CACmB,CACN,CACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../../common/utils\";\nimport { InformationPanel, InformationPanelBody, InformationPanelHeader, Table, Text, toaster } from \"@itwin/itwinui-react\";\nimport \"./OverlappedElementsInformationPanel.scss\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport type { OverlappedInfo } from \"../context/GroupHilitedElementsContext\";\nimport type { CellProps, Column } from \"react-table\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, clearHiddenElements, visualizeElements, zoomToElements } from \"../../common/viewerUtils\";\n\nexport interface OverlappedElementsInformationPanelProps {\n group?: GroupMinimal;\n onClose: () => void;\n overlappedElementsInfo: Map<string, OverlappedInfo[]>;\n groups: GroupMinimal[];\n}\n\nexport interface OverlappedElementsDisplayProps {\n overlappedElements: string;\n groups: string[];\n elementsIds: string[];\n}\ntype OverlappedTyped = CreateTypeFromInterface<OverlappedElementsDisplayProps>;\n\nexport const OverlappedElementsInformationPanel = ({ group, onClose, overlappedElementsInfo, groups }: OverlappedElementsInformationPanelProps) => {\n const [isOverlappedInfoLoading, setIsOverlappedInfoLoading] = useState<boolean>(false);\n const { setIsOverlappedColored } = useGroupHilitedElementsContext();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const columns = useMemo(\n (): Column<OverlappedTyped>[] => [\n {\n id: \"number\",\n Header: \"Overlapped elements\",\n accessor: \"overlappedElements\",\n },\n {\n id: \"groups\",\n Header: \"Groups\",\n accessor: \"groups\",\n Cell: (value: CellProps<OverlappedTyped>) => {\n return (\n <div>\n {value.row.original.groups.map((groupName, index) => (\n <div key={index}>{groupName}</div>\n ))}\n </div>\n );\n },\n },\n ],\n [],\n );\n\n const key = group ? group.id : \"\";\n const overlappedInfo = overlappedElementsInfo.get(key);\n\n const arr: OverlappedElementsDisplayProps[] = useMemo(() => {\n setIsOverlappedInfoLoading(true);\n const result: OverlappedElementsDisplayProps[] = [];\n if (overlappedInfo) {\n setIsOverlappedColored(true);\n overlappedInfo.forEach((array) => {\n const groupNames: string[] = [];\n array.groupIds.forEach((groupId) => {\n const group = groups.find((group) => group.id === groupId);\n if (group) {\n groupNames.push(group.groupName);\n }\n });\n result.push({\n overlappedElements: array.elements.length.toString(),\n groups: groupNames,\n elementsIds: array.elements,\n });\n });\n }\n setIsOverlappedInfoLoading(false);\n return result;\n }, [overlappedInfo, groups, setIsOverlappedColored]);\n\n const handleClose = () => {\n setIsOverlappedColored(false);\n onClose();\n };\n\n const onSelect = useCallback(async (selectedData: CreateTypeFromInterface<OverlappedElementsDisplayProps>[] | undefined) => {\n try {\n setIsLoading(true);\n clearEmphasizedOverriddenElements();\n clearHiddenElements();\n if (selectedData && selectedData.length !== 0) {\n visualizeElements(selectedData[0].elementsIds, \"red\");\n await zoomToElements(selectedData[0].elementsIds);\n }\n } catch (error) {\n toaster.negative(\"There was an error visualizing overlapped elements.\");\n /* eslint-disable no-console */\n console.error(error);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n return (\n <InformationPanel isOpen={!!group} className=\"gmw-overlap-information\">\n <InformationPanelHeader onClose={handleClose}>\n <Text variant=\"leading\">{`Overlap Info of ${group?.groupName}`}</Text>\n </InformationPanelHeader>\n <InformationPanelBody className=\"gmw-information-body\">\n <Table<OverlappedTyped>\n columns={columns}\n data={arr}\n emptyTableContent=\"No Overlaps.\"\n isLoading={isOverlappedInfoLoading}\n isSortable={true}\n isSelectable\n selectionMode=\"single\"\n onSelect={onSelect}\n isRowDisabled={() => isLoading}\n />\n </InformationPanelBody>\n </InformationPanel>\n );\n};\n"]}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
.gmw-overlap-information {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
.gmw-information-body {
|
|
10
|
+
textarea {
|
|
11
|
+
resize: vertical;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -17,7 +17,7 @@ export class QueryBuilder {
|
|
|
17
17
|
for (const queryClass of classes) {
|
|
18
18
|
for (const classJoin of queryClass.classJoins) {
|
|
19
19
|
const querySegment = [
|
|
20
|
-
...querySegments.get(classJoin.joinClassName) ?? [],
|
|
20
|
+
...(querySegments.get(classJoin.joinClassName) ?? []),
|
|
21
21
|
`${queryClass.className}.${classJoin.classProperty} = ${classJoin.joinClassName}.${classJoin.joinClassProperty}`,
|
|
22
22
|
];
|
|
23
23
|
querySegments.set(classJoin.joinClassName, querySegment);
|
|
@@ -27,9 +27,9 @@ export class QueryBuilder {
|
|
|
27
27
|
};
|
|
28
28
|
this.propertyQuerySegment = (className, property, needsQuote) => {
|
|
29
29
|
if (this.isFloat(property.value))
|
|
30
|
-
return `ROUND(${className}.${property.name}, ` +
|
|
30
|
+
return (`ROUND(${className}.${property.name}, ` +
|
|
31
31
|
`${QueryBuilder.DEFAULT_DOUBLE_PRECISION}) = ` +
|
|
32
|
-
`${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}
|
|
32
|
+
`${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`);
|
|
33
33
|
const propertyValue = needsQuote ? `'${property.value}'` : property.value;
|
|
34
34
|
return `${className}.${property.name} = ${propertyValue}`;
|
|
35
35
|
};
|
|
@@ -69,34 +69,20 @@ export class QueryBuilder {
|
|
|
69
69
|
return str.split(match).join(replacement);
|
|
70
70
|
}
|
|
71
71
|
// if property value has single quote, escape
|
|
72
|
-
if ((typeof prop.value.value === "string" ||
|
|
73
|
-
prop.value.value instanceof String) &&
|
|
74
|
-
String(prop.value.value).indexOf("'") >= 0) {
|
|
72
|
+
if ((typeof prop.value.value === "string" || prop.value.value instanceof String) && String(prop.value.value).indexOf("'") >= 0) {
|
|
75
73
|
prop.value.value = replaceAll(prop.value.value.toString(), "'", "''");
|
|
76
74
|
}
|
|
77
75
|
const pathToPrimaryClass = propertiesField.parent?.pathToPrimaryClass;
|
|
78
76
|
// get the special cases
|
|
79
77
|
const isNavigation = prop.property.typename.toLowerCase() === "navigation";
|
|
80
78
|
const isCategory = isNavigation && this.isCategory(propertiesField);
|
|
81
|
-
const isAspect = pathToPrimaryClass?.find((a) => a.relationshipInfo?.name ===
|
|
82
|
-
QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||
|
|
83
|
-
a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS) !== undefined;
|
|
79
|
+
const isAspect = pathToPrimaryClass?.find((a) => a.relationshipInfo?.name === QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS || a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS) !== undefined;
|
|
84
80
|
for (let i = 0; i < propertiesField.properties.length; i++) {
|
|
85
81
|
const property = propertiesField.properties[i].property;
|
|
86
82
|
const className = property.classInfo.name.replace(":", ".");
|
|
87
|
-
const propertyName = isNavigation
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
: `${property.name}.id`
|
|
91
|
-
: property.name;
|
|
92
|
-
const propertyValue = isNavigation
|
|
93
|
-
? isCategory
|
|
94
|
-
? prop.value.displayValue ?? ""
|
|
95
|
-
: prop.value.value.id
|
|
96
|
-
: prop.value.value;
|
|
97
|
-
if (!isAspect &&
|
|
98
|
-
pathToPrimaryClass &&
|
|
99
|
-
pathToPrimaryClass.length > 0) {
|
|
83
|
+
const propertyName = isNavigation ? (isCategory ? `${property.name}.CodeValue` : `${property.name}.id`) : property.name;
|
|
84
|
+
const propertyValue = isNavigation ? (isCategory ? prop.value.displayValue ?? "" : prop.value.value.id) : prop.value.value;
|
|
85
|
+
if (!isAspect && pathToPrimaryClass && pathToPrimaryClass.length > 0) {
|
|
100
86
|
this.addRelatedToQuery(i, propertiesField, propertyName, propertyValue);
|
|
101
87
|
}
|
|
102
88
|
else {
|
|
@@ -116,16 +102,11 @@ export class QueryBuilder {
|
|
|
116
102
|
const sourceClassName = path.sourceClassInfo?.name.replace(":", ".");
|
|
117
103
|
const targetClassName = path.targetClassInfo?.name.replace(":", ".");
|
|
118
104
|
const relClassName = path.relationshipInfo?.name.replace(":", ".");
|
|
119
|
-
const relClassProperty = path.isForwardRelationship
|
|
120
|
-
|
|
121
|
-
: `TargetECInstanceId`;
|
|
122
|
-
const relPropertyValue = path.isForwardRelationship
|
|
123
|
-
? `TargetECInstanceId`
|
|
124
|
-
: `SourceECInstanceId`;
|
|
105
|
+
const relClassProperty = path.isForwardRelationship ? `SourceECInstanceId` : `TargetECInstanceId`;
|
|
106
|
+
const relPropertyValue = path.isForwardRelationship ? `TargetECInstanceId` : `SourceECInstanceId`;
|
|
125
107
|
this.addClassToQuery(unionIndex, targetClassName, `ECInstanceId`, relClassName, relPropertyValue);
|
|
126
108
|
this.addClassToQuery(unionIndex, relClassName, relClassProperty, sourceClassName, `ECInstanceId`);
|
|
127
|
-
if (path.sourceClassInfo?.name
|
|
128
|
-
=== propertyField.parent?.contentClassInfo.name) {
|
|
109
|
+
if (path.sourceClassInfo?.name === propertyField.parent?.contentClassInfo.name) {
|
|
129
110
|
this.addPropertyToQuery(unionIndex, sourceClassName, propertyName, propertyValue, this.needsQuote(propertyField), false, false);
|
|
130
111
|
}
|
|
131
112
|
});
|
|
@@ -195,8 +176,7 @@ export class QueryBuilder {
|
|
|
195
176
|
}
|
|
196
177
|
buildQueryString() {
|
|
197
178
|
this.regenerateQuery();
|
|
198
|
-
if (this.query === undefined ||
|
|
199
|
-
(this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0))) {
|
|
179
|
+
if (this.query === undefined || this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0)) {
|
|
200
180
|
return "";
|
|
201
181
|
}
|
|
202
182
|
const unionSegments = [];
|
|
@@ -217,9 +197,7 @@ export class QueryBuilder {
|
|
|
217
197
|
whereSegments.push(this.categoryWhereQuery(property.classProperties[0].value.toString()));
|
|
218
198
|
continue;
|
|
219
199
|
}
|
|
220
|
-
const joinIdName = property.isAspect
|
|
221
|
-
? `${property.className}.Element.id`
|
|
222
|
-
: `${property.className}.ECInstanceId`;
|
|
200
|
+
const joinIdName = property.isAspect ? `${property.className}.Element.id` : `${property.className}.ECInstanceId`;
|
|
223
201
|
if (!querySegments.has(property.className) && property.className !== baseClassName)
|
|
224
202
|
querySegments.set(property.className, [`${joinIdName} = ${baseIdName}`]);
|
|
225
203
|
for (const prop of property.classProperties) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../../src/components/Groups/QueryBuilder/QueryBuilder.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAyC/C,4FAA4F;AAC5F,MAAM,OAAO,YAAY;IAUvB,YAAY,QAA0C;QAU9C,iBAAY,GAA+B,IAAI,GAAG,EAAE,CAAC;QAEtD,sBAAiB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,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CAAC,CAAC;aAC7E;YAED,MAAM,WAAW,GAAG,SAAS,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAE3D,aAAa,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,GAAG,WAAW,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3E;QAED,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAEO,YAAY,CAAC,YAAuC,EAAE,SAAiC;QAC7F,IAAI,SAAS,EAAE;YACb,OAAO,UAAU,SAAS,CAAC,SAAS,kBAAkB,SAAS,CAAC,SAAS,mBAAmB,SAAS,CAAC,SAAS,EAAE,CAAC;SACnH;QAED,IAAI,YAAY,EAAE;YAChB,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ;gBACtC,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,0BAA0B;gBACrD,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,kBAAkB,YAAY,CAAC,SAAS,YAAY,CAAC;YAElF,OAAO,UAAU,UAAU,SAAS,YAAY,CAAC,SAAS,EAAE,CAAC;SAC9D;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IA0BO,kBAAkB,CAAC,SAAiB;QAC1C,OAAO,mCAAmC,SAAS,wCAAwC,SAAS,KAAK,CAAC;IAC5G,CAAC;IAEO,OAAO,CAAC,CAAU;QACxB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;;AArZuB,uCAA0B,GAChD,iCAAiC,CAAC;AACZ,wCAA2B,GACjD,iCAAiC,CAAC;AACZ,qCAAwB,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type {\n InstanceKey,\n PropertiesField,\n} from \"@itwin/presentation-common\";\nimport type { Primitives, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { toaster } from \"@itwin/itwinui-react\";\n\nexport interface Query {\n unions: QueryUnion[];\n}\n\nexport interface QueryUnion {\n classes: QueryClass[];\n properties: QueryProperty[];\n}\n\nexport interface QueryClass {\n // schemaName.className\n className: string;\n classJoins: ClassJoin[];\n}\n\nexport interface ClassJoin {\n classProperty: string;\n joinClassName: string;\n joinClassProperty: string;\n}\n\nexport interface QueryProperty {\n className: string;\n classProperties: ClassProperty[];\n isCategory: boolean;\n isAspect: boolean;\n}\n\nexport interface ClassProperty {\n name: string;\n value: Primitives.Value;\n needsQuote: boolean;\n}\n\nexport interface AddedProperty {\n propertyRecord: PropertyRecord;\n propertiesField: PropertiesField;\n}\n\n/* This class is to build adaptive and dynamic query for find similar property selections */\nexport class QueryBuilder {\n private static readonly MULTI_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsMultiAspects\";\n private static readonly UNIQUE_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsUniqueAspect\";\n private static readonly DEFAULT_DOUBLE_PRECISION = 4;\n\n private dataProvider: PresentationPropertyDataProvider;\n private query: Query | undefined;\n\n constructor(provider: PresentationPropertyDataProvider) {\n this.dataProvider = provider;\n }\n\n private isCategory(propertyField: PropertiesField): boolean {\n const classInfo =\n propertyField.properties[0].property.navigationPropertyInfo?.classInfo;\n return classInfo?.name === \"BisCore:GeometricElement3dIsInCategory\";\n }\n\n private _propertyMap: Map<string, AddedProperty> = new Map();\n\n public resetQueryBuilder = () => {\n this._propertyMap = new Map();\n };\n\n private regenerateQuery = () => {\n this.query = undefined;\n\n for (const property of this._propertyMap.values()) {\n this.buildProperty(property.propertyRecord, property.propertiesField);\n }\n };\n\n public async addProperty(prop: PropertyRecord): Promise<boolean> {\n // TODO: only handle primitive properties now\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive) {\n toaster.warning(\"Only primitive types are supported for now.\");\n return false;\n }\n if (prop.value.value === undefined) {\n return false;\n }\n\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n if (!propertyField) {\n toaster.negative(\n \"Error. Failed to fetch field for this property record.\",\n );\n return false;\n }\n\n this._propertyMap.set(JSON.stringify(propertyField.getFieldDescriptor()), { propertyRecord: prop, propertiesField: propertyField });\n return true;\n }\n\n public async removeProperty(prop: PropertyRecord) {\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n this._propertyMap.delete(JSON.stringify(propertyField.getFieldDescriptor()));\n }\n\n private buildProperty(prop: PropertyRecord, propertiesField: PropertiesField) {\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive || prop.value.value === undefined) {\n toaster.negative(\n \"Error. An unexpected error has occured while building a query.\",\n );\n return;\n }\n\n function replaceAll(str: string, match: string, replacement: string) {\n return str.split(match).join(replacement);\n }\n // if property value has single quote, escape\n if (\n (typeof prop.value.value === \"string\" ||\n prop.value.value instanceof String) &&\n String(prop.value.value).indexOf(\"'\") >= 0\n ) {\n prop.value.value = replaceAll(prop.value.value.toString(), \"'\", \"''\");\n }\n\n const pathToPrimaryClass = propertiesField.parent?.pathToPrimaryClass;\n\n // get the special cases\n const isNavigation: boolean =\n prop.property.typename.toLowerCase() === \"navigation\";\n const isCategory: boolean = isNavigation && this.isCategory(propertiesField);\n\n const isAspect: boolean =\n pathToPrimaryClass?.find(\n (a) =>\n a.relationshipInfo?.name ===\n QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||\n a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS,\n ) !== undefined;\n\n for (let i = 0; i < propertiesField.properties.length; i++) {\n const property = propertiesField.properties[i].property;\n\n const className = property.classInfo.name.replace(\":\", \".\");\n const propertyName = isNavigation\n ? isCategory\n ? `${property.name}.CodeValue`\n : `${property.name}.id`\n : property.name;\n const propertyValue = isNavigation\n ? isCategory\n ? prop.value.displayValue ?? \"\"\n : (prop.value.value as InstanceKey).id\n : prop.value.value;\n\n if (\n !isAspect &&\n pathToPrimaryClass &&\n pathToPrimaryClass.length > 0\n ) {\n this.addRelatedToQuery(\n i,\n propertiesField,\n propertyName,\n propertyValue,\n );\n } else {\n this.addPropertyToQuery(\n i,\n className,\n propertyName,\n propertyValue,\n this.needsQuote(propertiesField),\n isCategory,\n isAspect,\n );\n }\n }\n return true;\n }\n\n private needsQuote(propertyField: PropertiesField): boolean {\n // list of property types that need quote around property value\n const typeName = propertyField.type.typeName.toLowerCase();\n return \"string\" === typeName || \"uri\" === typeName;\n }\n\n private addRelatedToQuery(\n unionIndex: number,\n propertyField: PropertiesField,\n propertyName: string,\n propertyValue: Primitives.Value,\n ) {\n const paths = [...(propertyField.parent?.pathToPrimaryClass ?? [])];\n paths.reverse().forEach((path) => {\n const sourceClassName = path.sourceClassInfo?.name.replace(\":\", \".\");\n const targetClassName = path.targetClassInfo?.name.replace(\":\", \".\");\n const relClassName = path.relationshipInfo?.name.replace(\":\", \".\");\n\n const relClassProperty = path.isForwardRelationship\n ? `SourceECInstanceId`\n : `TargetECInstanceId`;\n\n const relPropertyValue = path.isForwardRelationship\n ? `TargetECInstanceId`\n : `SourceECInstanceId`;\n\n this.addClassToQuery(\n unionIndex,\n targetClassName,\n `ECInstanceId`,\n relClassName,\n relPropertyValue\n );\n\n this.addClassToQuery(\n unionIndex,\n relClassName,\n relClassProperty,\n sourceClassName,\n `ECInstanceId`\n );\n\n if (path.sourceClassInfo?.name\n === propertyField.parent?.contentClassInfo.name) {\n this.addPropertyToQuery(\n unionIndex,\n sourceClassName,\n propertyName,\n propertyValue,\n this.needsQuote(propertyField),\n false,\n false,\n );\n }\n });\n }\n\n private addClassToQuery(\n unionIndex: number,\n className: string,\n classProperty: string,\n joinClassName: string,\n joinClassProperty: string,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const classJoin: ClassJoin = {\n classProperty,\n joinClassName,\n joinClassProperty,\n };\n\n const queryClass: QueryClass = {\n className,\n classJoins: [classJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [queryClass],\n properties: [],\n });\n return;\n }\n\n const foundClass = this.query.unions[unionIndex].classes.find((c) =>\n c.className === className\n );\n\n if (foundClass) {\n const foundJoin = foundClass.classJoins.find((join) =>\n join.classProperty === classProperty && join.joinClassName === joinClassName && join.joinClassProperty === joinClassProperty\n );\n\n if (!foundJoin)\n foundClass.classJoins.push(classJoin);\n return;\n }\n\n this.query.unions[unionIndex].classes.push(queryClass);\n }\n\n private addPropertyToQuery(\n unionIndex: number,\n className: string,\n propertyName: string,\n propertyValue: Primitives.Value,\n needsQuote: boolean,\n isCategory: boolean,\n isAspect: boolean,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const queryJoin: ClassProperty = {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n };\n\n const queryProperty: QueryProperty = {\n className,\n isCategory,\n isAspect,\n classProperties: [queryJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [],\n properties: [queryProperty],\n });\n return;\n }\n\n const foundPropertyClass = this.query.unions[unionIndex].properties.find((p) =>\n p.className === className\n );\n\n if (foundPropertyClass) {\n const foundJoin = foundPropertyClass?.classProperties.find((join) =>\n join.name === propertyName\n );\n\n if (foundJoin) {\n foundJoin.value = propertyValue;\n return;\n }\n\n foundPropertyClass.classProperties.push(queryJoin);\n return;\n }\n\n this.query.unions[unionIndex].properties.push(queryProperty);\n }\n\n public buildQueryString() {\n this.regenerateQuery();\n if (\n this.query === undefined ||\n (this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0))\n ) {\n return \"\";\n }\n\n const unionSegments: string[] = [];\n for (const union of this.query.unions) {\n\n const baseClass = union.classes[0];\n const baseProperty = union.properties[0];\n const baseClassName = baseClass ? baseClass.className : baseProperty?.className;\n const baseIdName = `${baseClassName}.ECInstanceId`;\n\n const selectClause = this.selectClause(baseProperty, baseClass);\n\n let querySegments: Map<string, string[]> = new Map();\n querySegments = this.relationalJoinSegments(union.classes, querySegments);\n\n const whereSegments: string[] = [];\n for (const property of union.properties) {\n if (property.isCategory) {\n if (property.className !== baseClassName)\n querySegments.set(\"BisCore.GeometricElement3d\", [`BisCore.GeometricElement3d.ECInstanceId = ${baseIdName}`]);\n\n querySegments.set(\"BisCore.Category\", [`BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id`]);\n whereSegments.push(this.categoryWhereQuery(property.classProperties[0].value.toString()));\n continue;\n }\n\n const joinIdName = property.isAspect\n ? `${property.className}.Element.id`\n : `${property.className}.ECInstanceId`;\n\n if (!querySegments.has(property.className) && property.className !== baseClassName)\n querySegments.set(property.className, [`${joinIdName} = ${baseIdName}`]);\n\n for (const prop of property.classProperties) {\n whereSegments.push(this.propertyQuerySegment(property.className, prop, prop.needsQuote));\n }\n }\n\n const joinClauses: string[] = [];\n for (const key of querySegments.keys()) {\n joinClauses.push(`JOIN ${key} ON ${querySegments.get(key)?.join(\" AND \")}`);\n }\n\n const whereClause = `WHERE ${whereSegments.join(\" AND \")}`;\n\n unionSegments.push([selectClause, ...joinClauses, whereClause].join(\" \"));\n }\n\n return unionSegments.join(\" UNION \");\n }\n\n private selectClause(baseProperty: QueryProperty | undefined, baseClass: QueryClass | undefined) {\n if (baseClass) {\n return `SELECT ${baseClass.className}.ECInstanceId, ${baseClass.className}.ECClassId FROM ${baseClass.className}`;\n }\n\n if (baseProperty) {\n const baseIdName = baseProperty.isAspect\n ? `${baseProperty.className}.Element.id ECInstanceId`\n : `${baseProperty.className}.ECInstanceId, ${baseProperty.className}.ECClassId`;\n\n return `SELECT ${baseIdName} FROM ${baseProperty.className}`;\n }\n\n return \"\";\n }\n\n private relationalJoinSegments = (classes: QueryClass[], querySegments: Map<string, string[]>): Map<string, string[]> => {\n for (const queryClass of classes) {\n for (const classJoin of queryClass.classJoins) {\n const querySegment = [\n ...querySegments.get(classJoin.joinClassName) ?? [],\n `${queryClass.className}.${classJoin.classProperty} = ${classJoin.joinClassName}.${classJoin.joinClassProperty}`,\n ];\n querySegments.set(classJoin.joinClassName, querySegment);\n }\n }\n\n return querySegments;\n };\n\n private propertyQuerySegment = (className: string, property: ClassProperty, needsQuote: boolean): string => {\n if (this.isFloat(property.value))\n return `ROUND(${className}.${property.name}, ` +\n `${QueryBuilder.DEFAULT_DOUBLE_PRECISION}) = ` +\n `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;\n\n const propertyValue = needsQuote ? `'${property.value}'` : property.value;\n return `${className}.${property.name} = ${propertyValue}`;\n };\n\n private categoryWhereQuery(codeValue: string): string {\n return `((BisCore.Category.CodeValue = '${codeValue}') OR (BisCore.Category.UserLabel = '${codeValue}'))`;\n }\n\n private isFloat(n: unknown): boolean {\n return Number(n) === n && n % 1 !== 0;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../../src/components/Groups/QueryBuilder/QueryBuilder.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAyC/C,4FAA4F;AAC5F,MAAM,OAAO,YAAY;IAQvB,YAAY,QAA0C;QAS9C,iBAAY,GAA+B,IAAI,GAAG,EAAE,CAAC;QAEtD,sBAAiB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC,CAAC;QAEM,oBAAe,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;YAEvB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE;gBACjD,IAAI,CA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,EAAE,GAAG,WAAW,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3E;QAED,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAEO,YAAY,CAAC,YAAuC,EAAE,SAAiC;QAC7F,IAAI,SAAS,EAAE;YACb,OAAO,UAAU,SAAS,CAAC,SAAS,kBAAkB,SAAS,CAAC,SAAS,mBAAmB,SAAS,CAAC,SAAS,EAAE,CAAC;SACnH;QAED,IAAI,YAAY,EAAE;YAChB,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ;gBACtC,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,0BAA0B;gBACrD,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,kBAAkB,YAAY,CAAC,SAAS,YAAY,CAAC;YAElF,OAAO,UAAU,UAAU,SAAS,YAAY,CAAC,SAAS,EAAE,CAAC;SAC9D;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IA4BO,kBAAkB,CAAC,SAAiB;QAC1C,OAAO,mCAAmC,SAAS,wCAAwC,SAAS,KAAK,CAAC;IAC5G,CAAC;IAEO,OAAO,CAAC,CAAU;QACxB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;;AA1TuB,uCAA0B,GAAG,iCAAiC,CAAC;AAC/D,wCAA2B,GAAG,iCAAiC,CAAC;AAChE,qCAAwB,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type { InstanceKey, PropertiesField } from \"@itwin/presentation-common\";\nimport type { Primitives, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { toaster } from \"@itwin/itwinui-react\";\n\nexport interface Query {\n unions: QueryUnion[];\n}\n\nexport interface QueryUnion {\n classes: QueryClass[];\n properties: QueryProperty[];\n}\n\nexport interface QueryClass {\n // schemaName.className\n className: string;\n classJoins: ClassJoin[];\n}\n\nexport interface ClassJoin {\n classProperty: string;\n joinClassName: string;\n joinClassProperty: string;\n}\n\nexport interface QueryProperty {\n className: string;\n classProperties: ClassProperty[];\n isCategory: boolean;\n isAspect: boolean;\n}\n\nexport interface ClassProperty {\n name: string;\n value: Primitives.Value;\n needsQuote: boolean;\n}\n\nexport interface AddedProperty {\n propertyRecord: PropertyRecord;\n propertiesField: PropertiesField;\n}\n\n/* This class is to build adaptive and dynamic query for find similar property selections */\nexport class QueryBuilder {\n private static readonly MULTI_ASPECT_PRIMARY_CLASS = \"BisCore:ElementOwnsMultiAspects\";\n private static readonly UNIQUE_ASPECT_PRIMARY_CLASS = \"BisCore:ElementOwnsUniqueAspect\";\n private static readonly DEFAULT_DOUBLE_PRECISION = 4;\n\n private dataProvider: PresentationPropertyDataProvider;\n private query: Query | undefined;\n\n constructor(provider: PresentationPropertyDataProvider) {\n this.dataProvider = provider;\n }\n\n private isCategory(propertyField: PropertiesField): boolean {\n const classInfo = propertyField.properties[0].property.navigationPropertyInfo?.classInfo;\n return classInfo?.name === \"BisCore:GeometricElement3dIsInCategory\";\n }\n\n private _propertyMap: Map<string, AddedProperty> = new Map();\n\n public resetQueryBuilder = () => {\n this._propertyMap = new Map();\n };\n\n private regenerateQuery = () => {\n this.query = undefined;\n\n for (const property of this._propertyMap.values()) {\n this.buildProperty(property.propertyRecord, property.propertiesField);\n }\n };\n\n public async addProperty(prop: PropertyRecord): Promise<boolean> {\n // TODO: only handle primitive properties now\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive) {\n toaster.warning(\"Only primitive types are supported for now.\");\n return false;\n }\n if (prop.value.value === undefined) {\n return false;\n }\n\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(prop)) as PropertiesField;\n\n if (!propertyField) {\n toaster.negative(\"Error. Failed to fetch field for this property record.\");\n return false;\n }\n\n this._propertyMap.set(JSON.stringify(propertyField.getFieldDescriptor()), { propertyRecord: prop, propertiesField: propertyField });\n return true;\n }\n\n public async removeProperty(prop: PropertyRecord) {\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(prop)) as PropertiesField;\n\n this._propertyMap.delete(JSON.stringify(propertyField.getFieldDescriptor()));\n }\n\n private buildProperty(prop: PropertyRecord, propertiesField: PropertiesField) {\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive || prop.value.value === undefined) {\n toaster.negative(\"Error. An unexpected error has occured while building a query.\");\n return;\n }\n\n function replaceAll(str: string, match: string, replacement: string) {\n return str.split(match).join(replacement);\n }\n // if property value has single quote, escape\n if ((typeof prop.value.value === \"string\" || prop.value.value instanceof String) && String(prop.value.value).indexOf(\"'\") >= 0) {\n prop.value.value = replaceAll(prop.value.value.toString(), \"'\", \"''\");\n }\n\n const pathToPrimaryClass = propertiesField.parent?.pathToPrimaryClass;\n\n // get the special cases\n const isNavigation: boolean = prop.property.typename.toLowerCase() === \"navigation\";\n const isCategory: boolean = isNavigation && this.isCategory(propertiesField);\n\n const isAspect: boolean =\n pathToPrimaryClass?.find(\n (a) => a.relationshipInfo?.name === QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS || a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS,\n ) !== undefined;\n\n for (let i = 0; i < propertiesField.properties.length; i++) {\n const property = propertiesField.properties[i].property;\n\n const className = property.classInfo.name.replace(\":\", \".\");\n const propertyName = isNavigation ? (isCategory ? `${property.name}.CodeValue` : `${property.name}.id`) : property.name;\n const propertyValue = isNavigation ? (isCategory ? prop.value.displayValue ?? \"\" : (prop.value.value as InstanceKey).id) : prop.value.value;\n\n if (!isAspect && pathToPrimaryClass && pathToPrimaryClass.length > 0) {\n this.addRelatedToQuery(i, propertiesField, propertyName, propertyValue);\n } else {\n this.addPropertyToQuery(i, className, propertyName, propertyValue, this.needsQuote(propertiesField), isCategory, isAspect);\n }\n }\n return true;\n }\n\n private needsQuote(propertyField: PropertiesField): boolean {\n // list of property types that need quote around property value\n const typeName = propertyField.type.typeName.toLowerCase();\n return \"string\" === typeName || \"uri\" === typeName;\n }\n\n private addRelatedToQuery(unionIndex: number, propertyField: PropertiesField, propertyName: string, propertyValue: Primitives.Value) {\n const paths = [...(propertyField.parent?.pathToPrimaryClass ?? [])];\n paths.reverse().forEach((path) => {\n const sourceClassName = path.sourceClassInfo?.name.replace(\":\", \".\");\n const targetClassName = path.targetClassInfo?.name.replace(\":\", \".\");\n const relClassName = path.relationshipInfo?.name.replace(\":\", \".\");\n\n const relClassProperty = path.isForwardRelationship ? `SourceECInstanceId` : `TargetECInstanceId`;\n\n const relPropertyValue = path.isForwardRelationship ? `TargetECInstanceId` : `SourceECInstanceId`;\n\n this.addClassToQuery(unionIndex, targetClassName, `ECInstanceId`, relClassName, relPropertyValue);\n\n this.addClassToQuery(unionIndex, relClassName, relClassProperty, sourceClassName, `ECInstanceId`);\n\n if (path.sourceClassInfo?.name === propertyField.parent?.contentClassInfo.name) {\n this.addPropertyToQuery(unionIndex, sourceClassName, propertyName, propertyValue, this.needsQuote(propertyField), false, false);\n }\n });\n }\n\n private addClassToQuery(unionIndex: number, className: string, classProperty: string, joinClassName: string, joinClassProperty: string) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const classJoin: ClassJoin = {\n classProperty,\n joinClassName,\n joinClassProperty,\n };\n\n const queryClass: QueryClass = {\n className,\n classJoins: [classJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [queryClass],\n properties: [],\n });\n return;\n }\n\n const foundClass = this.query.unions[unionIndex].classes.find((c) => c.className === className);\n\n if (foundClass) {\n const foundJoin = foundClass.classJoins.find(\n (join) => join.classProperty === classProperty && join.joinClassName === joinClassName && join.joinClassProperty === joinClassProperty,\n );\n\n if (!foundJoin) foundClass.classJoins.push(classJoin);\n return;\n }\n\n this.query.unions[unionIndex].classes.push(queryClass);\n }\n\n private addPropertyToQuery(\n unionIndex: number,\n className: string,\n propertyName: string,\n propertyValue: Primitives.Value,\n needsQuote: boolean,\n isCategory: boolean,\n isAspect: boolean,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const queryJoin: ClassProperty = {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n };\n\n const queryProperty: QueryProperty = {\n className,\n isCategory,\n isAspect,\n classProperties: [queryJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [],\n properties: [queryProperty],\n });\n return;\n }\n\n const foundPropertyClass = this.query.unions[unionIndex].properties.find((p) => p.className === className);\n\n if (foundPropertyClass) {\n const foundJoin = foundPropertyClass?.classProperties.find((join) => join.name === propertyName);\n\n if (foundJoin) {\n foundJoin.value = propertyValue;\n return;\n }\n\n foundPropertyClass.classProperties.push(queryJoin);\n return;\n }\n\n this.query.unions[unionIndex].properties.push(queryProperty);\n }\n\n public buildQueryString() {\n this.regenerateQuery();\n if (this.query === undefined || this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0)) {\n return \"\";\n }\n\n const unionSegments: string[] = [];\n for (const union of this.query.unions) {\n const baseClass = union.classes[0];\n const baseProperty = union.properties[0];\n const baseClassName = baseClass ? baseClass.className : baseProperty?.className;\n const baseIdName = `${baseClassName}.ECInstanceId`;\n\n const selectClause = this.selectClause(baseProperty, baseClass);\n\n let querySegments: Map<string, string[]> = new Map();\n querySegments = this.relationalJoinSegments(union.classes, querySegments);\n\n const whereSegments: string[] = [];\n for (const property of union.properties) {\n if (property.isCategory) {\n if (property.className !== baseClassName)\n querySegments.set(\"BisCore.GeometricElement3d\", [`BisCore.GeometricElement3d.ECInstanceId = ${baseIdName}`]);\n\n querySegments.set(\"BisCore.Category\", [`BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id`]);\n whereSegments.push(this.categoryWhereQuery(property.classProperties[0].value.toString()));\n continue;\n }\n\n const joinIdName = property.isAspect ? `${property.className}.Element.id` : `${property.className}.ECInstanceId`;\n\n if (!querySegments.has(property.className) && property.className !== baseClassName)\n querySegments.set(property.className, [`${joinIdName} = ${baseIdName}`]);\n\n for (const prop of property.classProperties) {\n whereSegments.push(this.propertyQuerySegment(property.className, prop, prop.needsQuote));\n }\n }\n\n const joinClauses: string[] = [];\n for (const key of querySegments.keys()) {\n joinClauses.push(`JOIN ${key} ON ${querySegments.get(key)?.join(\" AND \")}`);\n }\n\n const whereClause = `WHERE ${whereSegments.join(\" AND \")}`;\n\n unionSegments.push([selectClause, ...joinClauses, whereClause].join(\" \"));\n }\n\n return unionSegments.join(\" UNION \");\n }\n\n private selectClause(baseProperty: QueryProperty | undefined, baseClass: QueryClass | undefined) {\n if (baseClass) {\n return `SELECT ${baseClass.className}.ECInstanceId, ${baseClass.className}.ECClassId FROM ${baseClass.className}`;\n }\n\n if (baseProperty) {\n const baseIdName = baseProperty.isAspect\n ? `${baseProperty.className}.Element.id ECInstanceId`\n : `${baseProperty.className}.ECInstanceId, ${baseProperty.className}.ECClassId`;\n\n return `SELECT ${baseIdName} FROM ${baseProperty.className}`;\n }\n\n return \"\";\n }\n\n private relationalJoinSegments = (classes: QueryClass[], querySegments: Map<string, string[]>): Map<string, string[]> => {\n for (const queryClass of classes) {\n for (const classJoin of queryClass.classJoins) {\n const querySegment = [\n ...(querySegments.get(classJoin.joinClassName) ?? []),\n `${queryClass.className}.${classJoin.classProperty} = ${classJoin.joinClassName}.${classJoin.joinClassProperty}`,\n ];\n querySegments.set(classJoin.joinClassName, querySegment);\n }\n }\n\n return querySegments;\n };\n\n private propertyQuerySegment = (className: string, property: ClassProperty, needsQuote: boolean): string => {\n if (this.isFloat(property.value))\n return (\n `ROUND(${className}.${property.name}, ` +\n `${QueryBuilder.DEFAULT_DOUBLE_PRECISION}) = ` +\n `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`\n );\n\n const propertyValue = needsQuote ? `'${property.value}'` : property.value;\n return `${className}.${property.name} = ${propertyValue}`;\n };\n\n private categoryWhereQuery(codeValue: string): string {\n return `((BisCore.Category.CodeValue = '${codeValue}') OR (BisCore.Category.UserLabel = '${codeValue}'))`;\n }\n\n private isFloat(n: unknown): boolean {\n return Number(n) === n && n % 1 !== 0;\n }\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Button } from "@itwin/itwinui-react";
|
|
6
6
|
import React from "react";
|
|
7
7
|
export const QueryBuilderActionPanel = ({ onClickNext }) => {
|
|
8
|
-
return (React.createElement(Button, { styleType:
|
|
8
|
+
return (React.createElement(Button, { styleType: "high-visibility", id: "save-app", onClick: onClickNext }, "Next"));
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=QueryBuilderActionPanel.js.map
|