@itwin/grouping-mapping-widget 0.35.3 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/GroupingMappingWidget.d.ts +28 -0
- package/lib/cjs/GroupingMappingWidget.js +71 -0
- package/lib/cjs/GroupingMappingWidget.js.map +1 -0
- package/lib/cjs/WidgetShell/GroupingMapping.js +4 -3
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +6 -5
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/cjs/common/utils.js +12 -11
- package/lib/cjs/common/utils.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js +3 -2
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +2 -2
- package/lib/cjs/components/Groups/Editing/GroupAction.js +8 -7
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetails.js +4 -3
- package/lib/cjs/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.d.ts +2 -2
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js +5 -4
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/cjs/components/Groups/GroupMenuActions.js +5 -4
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js +2 -1
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.js +2 -1
- package/lib/cjs/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js +2 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.js +4 -3
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +9 -6
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js +3 -2
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +6 -5
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js +4 -3
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -2
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js +3 -2
- package/lib/cjs/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js +2 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +2 -2
- package/lib/cjs/components/Mappings/Editing/MappingAction.js +9 -8
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +17 -6
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +12 -11
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +19 -18
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectIModel.js +9 -8
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectITwin.js +14 -13
- package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +2 -2
- package/lib/cjs/components/Mappings/Import/SelectMappings.js +10 -9
- package/lib/cjs/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js +5 -4
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/cjs/components/Mappings/Mappings.d.ts +2 -2
- package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -2
- package/lib/cjs/components/Mappings/MappingsView.js +17 -15
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +2 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +3 -2
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +2 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.js +3 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupInformationPanel.js +3 -2
- package/lib/cjs/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +28 -26
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +12 -11
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js +5 -4
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +2 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js +2 -1
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTableToolbar.js +3 -5
- package/lib/cjs/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useValidator.d.ts +2 -2
- package/lib/cjs/components/Properties/hooks/useValidator.js +12 -9
- package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/cjs/components/SharedComponents/ActionPanel.js +3 -2
- package/lib/cjs/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/cjs/components/SharedComponents/DeleteModal.js +5 -4
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js +3 -2
- package/lib/cjs/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/cjs/components/customUI/DefaultGroupingUI.d.ts +1 -1
- package/lib/cjs/components/customUI/DefaultGroupingUI.js +7 -5
- package/lib/cjs/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +3 -2
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +5 -4
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +5 -4
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
- package/lib/cjs/grouping-mapping-widget.js +4 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +5 -5
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/setup.d.ts +2 -0
- package/lib/cjs/test/setup.js +10 -0
- package/lib/cjs/test/setup.js.map +1 -0
- package/lib/esm/GroupingMappingWidget.d.ts +28 -0
- package/lib/esm/GroupingMappingWidget.js +67 -0
- package/lib/esm/GroupingMappingWidget.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMapping.js +5 -4
- package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +6 -5
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
- package/lib/esm/common/utils.js +12 -11
- package/lib/esm/common/utils.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js +3 -2
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupAction.d.ts +2 -2
- package/lib/esm/components/Groups/Editing/GroupAction.js +8 -7
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetails.js +4 -3
- package/lib/esm/components/Groups/Editing/GroupDetails.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.d.ts +2 -2
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js +5 -4
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
- package/lib/esm/components/Groups/GroupMenuActions.js +5 -4
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js +2 -1
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.js +2 -1
- package/lib/esm/components/Groups/GroupsAddButton.js.map +1 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.js +2 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.js +4 -3
- package/lib/esm/components/Groups/GroupsView.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +9 -6
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualizationActions.js +3 -2
- package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +6 -5
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js +4 -3
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -2
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
- package/lib/esm/components/Groups/ToggleGroupVisibility.js +3 -2
- package/lib/esm/components/Groups/ToggleGroupVisibility.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js +2 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +2 -2
- package/lib/esm/components/Mappings/Editing/MappingAction.js +9 -8
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js +17 -6
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +12 -11
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +19 -18
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectIModel.js +9 -8
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectITwin.js +14 -13
- package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +2 -2
- package/lib/esm/components/Mappings/Import/SelectMappings.js +10 -9
- package/lib/esm/components/Mappings/Import/SelectMappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.js +5 -4
- package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/esm/components/Mappings/Mappings.d.ts +2 -2
- package/lib/esm/components/Mappings/Mappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.d.ts +2 -2
- package/lib/esm/components/Mappings/MappingsView.js +15 -14
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +2 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +3 -2
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +2 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.js +3 -2
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupInformationPanel.js +3 -2
- package/lib/esm/components/Properties/GroupInformationPanel.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +26 -25
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +12 -11
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js +5 -4
- package/lib/esm/components/Properties/GroupProperties/SaveModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +2 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.js +2 -1
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTableToolbar.js +3 -5
- package/lib/esm/components/Properties/PropertyTableToolbar.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useValidator.d.ts +2 -2
- package/lib/esm/components/Properties/hooks/useValidator.js +9 -8
- package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/esm/components/SharedComponents/ActionPanel.js +3 -2
- package/lib/esm/components/SharedComponents/ActionPanel.js.map +1 -1
- package/lib/esm/components/SharedComponents/DeleteModal.js +5 -4
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/esm/components/SharedComponents/LoadingOverlay.js +3 -2
- package/lib/esm/components/SharedComponents/LoadingOverlay.js.map +1 -1
- package/lib/esm/components/customUI/DefaultGroupingUI.d.ts +1 -1
- package/lib/esm/components/customUI/DefaultGroupingUI.js +5 -4
- package/lib/esm/components/customUI/DefaultGroupingUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +3 -2
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js +5 -4
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js +5 -4
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +3 -0
- package/lib/esm/grouping-mapping-widget.js +2 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +5 -5
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/setup.d.ts +2 -0
- package/lib/esm/test/setup.js +8 -0
- package/lib/esm/test/setup.js.map +1 -0
- package/lib/public/locales/en/GroupingMappingWidget.json +220 -0
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getDefaultGroupingUI = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -14,27 +14,29 @@ const GroupingMappingCustomUI_1 = require("./GroupingMappingCustomUI");
|
|
|
14
14
|
const GroupQueryBuilderCustomUI_1 = require("./GroupQueryBuilderCustomUI");
|
|
15
15
|
const ManualGroupingCustomUI_1 = require("./ManualGroupingCustomUI");
|
|
16
16
|
const SearchGroupingCustomUI_1 = require("./SearchGroupingCustomUI");
|
|
17
|
-
|
|
17
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
18
|
+
const getDefaultGroupingUI = () => [
|
|
18
19
|
{
|
|
19
20
|
name: "Selection",
|
|
20
|
-
displayLabel: "
|
|
21
|
+
displayLabel: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.selection"),
|
|
21
22
|
type: GroupingMappingCustomUI_1.GroupingMappingCustomUIType.Grouping,
|
|
22
23
|
icon: react_1.default.createElement(itwinui_icons_react_1.SvgCursor, null),
|
|
23
24
|
uiComponent: GroupQueryBuilderCustomUI_1.GroupQueryBuilderCustomUI,
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
27
|
name: "Query Keywords",
|
|
27
|
-
displayLabel: "
|
|
28
|
+
displayLabel: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.queryKeywords"),
|
|
28
29
|
type: GroupingMappingCustomUI_1.GroupingMappingCustomUIType.Grouping,
|
|
29
30
|
icon: react_1.default.createElement(itwinui_icons_react_1.SvgSearch, null),
|
|
30
31
|
uiComponent: SearchGroupingCustomUI_1.SearchGroupingCustomUI,
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
name: "Manual",
|
|
34
|
-
displayLabel: "
|
|
35
|
+
displayLabel: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.manual"),
|
|
35
36
|
type: GroupingMappingCustomUI_1.GroupingMappingCustomUIType.Grouping,
|
|
36
37
|
icon: react_1.default.createElement(itwinui_icons_react_1.SvgDraw, null),
|
|
37
38
|
uiComponent: ManualGroupingCustomUI_1.ManualGroupingCustomUI,
|
|
38
39
|
},
|
|
39
40
|
];
|
|
41
|
+
exports.getDefaultGroupingUI = getDefaultGroupingUI;
|
|
40
42
|
//# sourceMappingURL=DefaultGroupingUI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultGroupingUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/DefaultGroupingUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,oEAA2E;AAE3E,uEAAwE;AACxE,2EAAwE;AACxE,qEAAkE;AAClE,qEAAkE;
|
|
1
|
+
{"version":3,"file":"DefaultGroupingUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/DefaultGroupingUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,oEAA2E;AAE3E,uEAAwE;AACxE,2EAAwE;AACxE,qEAAkE;AAClE,qEAAkE;AAClE,uEAAoE;AAE7D,MAAM,oBAAoB,GAAG,GAA8B,EAAE,CAAC;IACnE;QACE,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,6CAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QACnE,IAAI,EAAE,qDAA2B,CAAC,QAAQ;QAC1C,IAAI,EAAE,8BAAC,+BAAS,OAAG;QACnB,WAAW,EAAE,qDAAyB;KACvC;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,YAAY,EAAE,6CAAqB,CAAC,SAAS,CAAC,wBAAwB,CAAC;QACvE,IAAI,EAAE,qDAA2B,CAAC,QAAQ;QAC1C,IAAI,EAAE,8BAAC,+BAAS,OAAG;QACnB,WAAW,EAAE,+CAAsB;KACpC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,6CAAqB,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAChE,IAAI,EAAE,qDAA2B,CAAC,QAAQ;QAC1C,IAAI,EAAE,8BAAC,6BAAO,OAAG;QACjB,WAAW,EAAE,+CAAsB;KACpC;CACF,CAAC;AAtBW,QAAA,oBAAoB,wBAsB/B","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 { SvgCursor, SvgDraw, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport type { GroupingMappingCustomUI } from \"./GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"./GroupingMappingCustomUI\";\nimport { GroupQueryBuilderCustomUI } from \"./GroupQueryBuilderCustomUI\";\nimport { ManualGroupingCustomUI } from \"./ManualGroupingCustomUI\";\nimport { SearchGroupingCustomUI } from \"./SearchGroupingCustomUI\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\nexport const getDefaultGroupingUI = (): GroupingMappingCustomUI[] => [\n {\n name: \"Selection\",\n displayLabel: GroupingMappingWidget.translate(\"customUI.selection\"),\n type: GroupingMappingCustomUIType.Grouping,\n icon: <SvgCursor />,\n uiComponent: GroupQueryBuilderCustomUI,\n },\n {\n name: \"Query Keywords\",\n displayLabel: GroupingMappingWidget.translate(\"customUI.queryKeywords\"),\n type: GroupingMappingCustomUIType.Grouping,\n icon: <SvgSearch />,\n uiComponent: SearchGroupingCustomUI,\n },\n {\n name: \"Manual\",\n displayLabel: GroupingMappingWidget.translate(\"customUI.manual\"),\n type: GroupingMappingCustomUIType.Grouping,\n icon: <SvgDraw />,\n uiComponent: ManualGroupingCustomUI,\n },\n];\n"]}
|
|
@@ -42,6 +42,7 @@ const PropertyAction_1 = require("../Properties/PropertyAction");
|
|
|
42
42
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
43
43
|
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
44
44
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
45
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
45
46
|
const createPropertyDataProvider = async (keys, iModelConnection) => {
|
|
46
47
|
const dataProvider = new presentation_components_1.PresentationPropertyDataProvider({
|
|
47
48
|
imodel: iModelConnection,
|
|
@@ -106,13 +107,13 @@ const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView }) => {
|
|
|
106
107
|
isUpdating: isUpdating ?? false,
|
|
107
108
|
}), [currentPropertyList, isUpdating, queryBuilder, updateQuery]);
|
|
108
109
|
const actionButtonRenderers = (0, react_1.useMemo)(() => [({ property }) => react_1.default.createElement(PropertyAction_1.PropertyAction, { property: property })], []);
|
|
109
|
-
return (react_1.default.createElement("div", { className: "gmw-select-query-generator-container" }, !dataProvider || selectionKeySet.size === 0 ? (react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" }, "
|
|
110
|
+
return (react_1.default.createElement("div", { className: "gmw-select-query-generator-container" }, !dataProvider || selectionKeySet.size === 0 ? (react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.queryBuilderAlert"))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
110
111
|
react_1.default.createElement("div", { className: "gmw-select-property-grid-container" },
|
|
111
112
|
react_1.default.createElement(core_react_1.ResizableContainerObserver, { onResize: resize }),
|
|
112
113
|
react_1.default.createElement(PropertyGridWrapperContext_1.PropertyGridWrapperContext.Provider, { value: propertyContextValues },
|
|
113
114
|
react_1.default.createElement(components_react_1.VirtualizedPropertyGridWithDataProvider, { dataProvider: dataProvider, width: size.width, height: size.height, actionButtonRenderers: actionButtonRenderers }))),
|
|
114
115
|
react_1.default.createElement("div", { className: "gmw-select-reset-button" },
|
|
115
|
-
react_1.default.createElement(itwinui_react_1.Button, { styleType: "default", size: "small", onClick: onClickResetButton }, "
|
|
116
|
+
react_1.default.createElement(itwinui_react_1.Button, { styleType: "default", size: "small", onClick: onClickResetButton }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.reset")))))));
|
|
116
117
|
};
|
|
117
118
|
exports.GroupQueryBuilderCustomUI = GroupQueryBuilderCustomUI;
|
|
118
119
|
//# sourceMappingURL=GroupQueryBuilderCustomUI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAyE;AACzE,wEAA4D;AAC5D,uDAAoD;AAEpD,oEAAoD;AACpD,4CAA0C;AAC1C,sEAAmE;AAEnE,4EAAiH;AAGjH,8DAAkF;AAClF,kDAA+D;AAE/D,sFAAmF;AACnF,iEAA8D;AAC9D,wDAAqD;AACrD,kFAAkF;AAClF,wDAAiD;AAEjD,MAAM,0BAA0B,GAAG,KAAK,EAAE,IAAY,EAAE,gBAAkC,EAA6C,EAAE;IACvI,MAAM,YAAY,GAAG,IAAI,0DAAgC,CAAC;QACxD,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,uDAA6B;KACvC,CAAC,CAAC;IACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,uCAAuC,GAAG,IAAI,CAAC;IAC5D,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAC3C,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,0CAA0C,CAAC,CACvH,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,EACnC,GAAG,EAAE,CAAC,CAAC;QACL,mBAAmB;QACnB,sBAAsB;QACtB,YAAY;QACZ,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE,UAAU,IAAI,KAAK;KAChC,CAAC,EACF,CAAC,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAC7D,CAAC;IAEF,MAAM,qBAAqB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAA6B,EAAE,EAAE,CAAC,8BAAC,+BAAc,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEvI,OAAO,CACL,uCAAK,SAAS,EAAC,sCAAsC,IAClD,CAAC,YAAY,IAAI,eAAe,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAC7C,8BAAC,qBAAK,IAAC,IAAI,EAAC,eAAe,6GAA+G,CAC3I,CAAC,CAAC,CAAC,CACF;QACE,uCAAK,SAAS,EAAC,oCAAoC;YACjD,8BAAC,uCAA0B,IAAC,QAAQ,EAAE,MAAM,GAAI;YAChD,8BAAC,uDAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,qBAAqB;gBAC/D,8BAAC,0DAAuC,IACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,qBAAqB,EAAE,qBAAqB,GAC5C,CACkC,CAClC;QACN,uCAAK,SAAS,EAAC,yBAAyB;YACtC,8BAAC,sBAAM,IAAC,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,kBAAkB,YAE3D,CACL,CACL,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,yBAAyB,6BAmFpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../Groups/QueryBuilder/QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { DEFAULT_PROPERTY_GRID_RULESET, PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../Properties/PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nconst createPropertyDataProvider = async (keys: KeySet, iModelConnection: IModelConnection): Promise<PresentationPropertyDataProvider> => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n const data = await dataProvider.getData();\n const selectedCategory = data.categories.find(\n (category) => category.label === IModelApp.localization.getLocalizedString(\"Presentation:selectedItems.categoryLabel\"),\n );\n if (selectedCategory) {\n selectedCategory.expand = true;\n }\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses the property grid to generate queries.\n * @public\n */\nexport const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView }: GroupingCustomUIProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] = useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (evt: SelectionChangeEventArgs, selectionProvider: ISelectionProvider) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = await createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider, iModelConnection));\n };\n\n return iModelConnection ? Presentation.selection.selectionChange.addListener(onSelectionChanged) : () => {};\n }, [iModelConnection]);\n \n const resetMutation = useMutation({\n mutationFn: resetView,\n /* eslint-disable no-console */\n onError: (e) => console.error(e),\n });\n\n const onClickResetButton = useCallback(() => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n if (currentPropertyList.length > 0) {\n setCurrentPropertyList([]);\n } else if (iModelConnection) {\n Presentation.selection.clearSelection(\"GroupQueryBuilderCustomUI\", iModelConnection);\n }\n resetMutation.mutate();\n\n }, [iModelConnection, currentPropertyList, resetMutation, queryBuilder, updateQuery]);\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery],\n );\n\n const actionButtonRenderers = useMemo(() => [({ property }: ActionButtonRendererProps) => <PropertyAction property={property} />], []);\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type=\"informational\">Please select on an element within the viewer first, then select properties to generate a group query.</Alert>\n ) : (\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button styleType=\"default\" size=\"small\" onClick={onClickResetButton}>\n Reset\n </Button>\n </div>\n </>\n )}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAyE;AACzE,wEAA4D;AAC5D,uDAAoD;AAEpD,oEAAoD;AACpD,4CAA0C;AAC1C,sEAAmE;AAEnE,4EAAiH;AAGjH,8DAAkF;AAClF,kDAA+D;AAE/D,sFAAmF;AACnF,iEAA8D;AAC9D,wDAAqD;AACrD,kFAAkF;AAClF,wDAAiD;AACjD,uEAAoE;AAEpE,MAAM,0BAA0B,GAAG,KAAK,EAAE,IAAY,EAAE,gBAAkC,EAA6C,EAAE;IACvI,MAAM,YAAY,GAAG,IAAI,0DAAgC,CAAC;QACxD,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,uDAA6B;KACvC,CAAC,CAAC;IACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,uCAAuC,GAAG,IAAI,CAAC;IAC5D,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,gB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OAAO,EAAC,OAAO,EAAE,kBAAkB,IACjE,6CAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CACzC,CACL,CACL,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,yBAAyB,6BAmFpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../Groups/QueryBuilder/QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { DEFAULT_PROPERTY_GRID_RULESET, PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../Properties/PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\nconst createPropertyDataProvider = async (keys: KeySet, iModelConnection: IModelConnection): Promise<PresentationPropertyDataProvider> => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n const data = await dataProvider.getData();\n const selectedCategory = data.categories.find(\n (category) => category.label === IModelApp.localization.getLocalizedString(\"Presentation:selectedItems.categoryLabel\"),\n );\n if (selectedCategory) {\n selectedCategory.expand = true;\n }\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses the property grid to generate queries.\n * @public\n */\nexport const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView }: GroupingCustomUIProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] = useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (evt: SelectionChangeEventArgs, selectionProvider: ISelectionProvider) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = await createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider, iModelConnection));\n };\n\n return iModelConnection ? Presentation.selection.selectionChange.addListener(onSelectionChanged) : () => {};\n }, [iModelConnection]);\n \n const resetMutation = useMutation({\n mutationFn: resetView,\n /* eslint-disable no-console */\n onError: (e) => console.error(e),\n });\n\n const onClickResetButton = useCallback(() => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n if (currentPropertyList.length > 0) {\n setCurrentPropertyList([]);\n } else if (iModelConnection) {\n Presentation.selection.clearSelection(\"GroupQueryBuilderCustomUI\", iModelConnection);\n }\n resetMutation.mutate();\n\n }, [iModelConnection, currentPropertyList, resetMutation, queryBuilder, updateQuery]);\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery],\n );\n\n const actionButtonRenderers = useMemo(() => [({ property }: ActionButtonRendererProps) => <PropertyAction property={property} />], []);\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type=\"informational\">{GroupingMappingWidget.translate(\"customUI.queryBuilderAlert\")}</Alert>\n ) : (\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button styleType=\"default\" size=\"small\" onClick={onClickResetButton}>\n {GroupingMappingWidget.translate(\"common.reset\")}\n </Button>\n </div>\n </>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -12,6 +12,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
const LoadingSpinner_1 = require("../SharedComponents/LoadingSpinner");
|
|
14
14
|
require("./ManualGroupingCustomUI.scss");
|
|
15
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
15
16
|
/**
|
|
16
17
|
* A default group query builder for the Grouping Mapping Widget that uses a manual input to generate queries.
|
|
17
18
|
* @public
|
|
@@ -19,18 +20,18 @@ require("./ManualGroupingCustomUI.scss");
|
|
|
19
20
|
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery }) => {
|
|
20
21
|
const [manualInput, setManualInput] = react_1.default.useState(initialEditModeQuery ?? "");
|
|
21
22
|
return (react_1.default.createElement("div", { className: "gmw-manual-form" },
|
|
22
|
-
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" },
|
|
23
|
-
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: "
|
|
23
|
+
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.manualQueryAlert")),
|
|
24
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.manualQueryLabel"), required: true, value: manualInput, onChange: (event) => setManualInput(event.target.value), disabled: isUpdating, placeholder: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.manualQueryPlaceholder") }),
|
|
24
25
|
react_1.default.createElement("div", { className: "gmw-manual-actions" },
|
|
25
26
|
isUpdating && react_1.default.createElement(LoadingSpinner_1.LoadingSpinner, null),
|
|
26
|
-
react_1.default.createElement(itwinui_react_1.Button, { disabled: isUpdating, onClick: () => updateQuery(manualInput) }, "
|
|
27
|
+
react_1.default.createElement(itwinui_react_1.Button, { disabled: isUpdating, onClick: () => updateQuery(manualInput) }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.apply")),
|
|
27
28
|
react_1.default.createElement(itwinui_react_1.Button, { disabled: isUpdating, onClick: async () => {
|
|
28
29
|
updateQuery("");
|
|
29
30
|
setManualInput("");
|
|
30
31
|
if (resetView) {
|
|
31
32
|
await resetView();
|
|
32
33
|
}
|
|
33
|
-
} }, "
|
|
34
|
+
} }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.clear")))));
|
|
34
35
|
};
|
|
35
36
|
exports.ManualGroupingCustomUI = ManualGroupingCustomUI;
|
|
36
37
|
//# sourceMappingURL=ManualGroupingCustomUI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAAsE;AACtE,uEAAoE;AACpE,yCAAuC;
|
|
1
|
+
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAAsE;AACtE,uEAAoE;AACpE,yCAAuC;AAEvC,uEAAoE;AAEpE;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,oBAAoB,EAAyB,EAAE,EAAE;IAC5H,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IAEjF,OAAO,CACL,uCAAK,SAAS,EAAC,iBAAiB;QAC9B,8BAAC,qBAAK,IAAC,IAAI,EAAC,eAAe,IAAE,6CAAqB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAS;QAClG,8BAAC,+BAAe,IACd,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,2BAA2B,CAAC,EACnE,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,iCAAiC,CAAC,GAC/E;QACF,uCAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,8BAAC,+BAAc,OAAG;YACjC,8BAAC,sBAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,IAClE,6CAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CACzC;YACT,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,IAEA,6CAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CACzC,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,sBAAsB,0BAkCjC","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 { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses a manual input to generate queries.\n * @public\n */\nexport const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery }: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\n\n return (\n <div className=\"gmw-manual-form\">\n <Alert type=\"informational\">{GroupingMappingWidget.translate(\"customUI.manualQueryAlert\")}</Alert>\n <LabeledTextarea\n label={GroupingMappingWidget.translate(\"customUI.manualQueryLabel\")}\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={GroupingMappingWidget.translate(\"customUI.manualQueryPlaceholder\")}\n />\n <div className=\"gmw-manual-actions\">\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n {GroupingMappingWidget.translate(\"common.apply\")}\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n {GroupingMappingWidget.translate(\"common.clear\")}\n </Button>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -12,6 +12,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
const LoadingSpinner_1 = require("../SharedComponents/LoadingSpinner");
|
|
14
14
|
require("./SearchGroupingCustomUI.scss");
|
|
15
|
+
const GroupingMappingWidget_1 = require("../../GroupingMappingWidget");
|
|
15
16
|
/**
|
|
16
17
|
* A default group query builder for the Grouping Mapping Widget that uses a generic query template to search for elements.
|
|
17
18
|
* @public
|
|
@@ -51,8 +52,8 @@ const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView }) => {
|
|
|
51
52
|
updateQuery(generatedSearchQuery);
|
|
52
53
|
};
|
|
53
54
|
return (react_1.default.createElement("div", { className: "gmw-search-form" },
|
|
54
|
-
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" },
|
|
55
|
-
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: "
|
|
55
|
+
react_1.default.createElement(itwinui_react_1.Alert, { type: "informational" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.searchQueryAlert")),
|
|
56
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.searchQueryLabel"), required: true, value: searchInput, onChange: (event) => setSearchInput(event.target.value), disabled: isUpdating, placeholder: GroupingMappingWidget_1.GroupingMappingWidget.translate("customUI.searchQueryPlaceholder") }),
|
|
56
57
|
react_1.default.createElement("div", { className: "gmw-search-actions" },
|
|
57
58
|
isUpdating && react_1.default.createElement(LoadingSpinner_1.LoadingSpinner, null),
|
|
58
59
|
react_1.default.createElement(itwinui_react_1.Button, { disabled: isUpdating, onClick: () => generateSearchQuery(searchInput
|
|
@@ -60,14 +61,14 @@ const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView }) => {
|
|
|
60
61
|
.replace(/(\r\n|\n|\r)/gm, "")
|
|
61
62
|
.trim()
|
|
62
63
|
.split(" ")
|
|
63
|
-
: []) }, "
|
|
64
|
+
: []) }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.apply")),
|
|
64
65
|
react_1.default.createElement(itwinui_react_1.Button, { disabled: isUpdating, onClick: async () => {
|
|
65
66
|
updateQuery("");
|
|
66
67
|
setSearchInput("");
|
|
67
68
|
if (resetView) {
|
|
68
69
|
await resetView();
|
|
69
70
|
}
|
|
70
|
-
} }, "
|
|
71
|
+
} }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.clear")))));
|
|
71
72
|
};
|
|
72
73
|
exports.SearchGroupingCustomUI = SearchGroupingCustomUI;
|
|
73
74
|
//# sourceMappingURL=SearchGroupingCustomUI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAAsE;AAEtE,uEAAoE;AACpE,yCAAuC;AAEvC;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAyB,EAAE,EAAE;IACtG,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAC,KAAa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,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,kBAAkB,GAC/B;QACF,uCAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,8BAAC,+BAAc,OAAG;YACjC,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,GAAG,EAAE,CACZ,mBAAmB,CACjB,WAAW;oBACT,CAAC,CAAC,WAAW;yBACR,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;yBAC7B,IAAI,EAAE;yBACN,KAAK,CAAC,GAAG,CAAC;oBACf,CAAC,CAAC,EAAE,CACP,YAII;YACT,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAtHW,QAAA,sBAAsB,0BAsHjC","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 { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./SearchGroupingCustomUI.scss\";\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses a generic query template to search for elements.\n * @public\n */\nexport const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView }: GroupingCustomUIProps) => {\n const [searchInput, setSearchInput] = React.useState(\"\");\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (token: string, index: number, searchQuery: string[]) =>\n isWrappedInQuotes(token) || (index === 1 && isWrappedInQuotes(searchQuery[0]));\n\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n updateQuery(\"\");\n return;\n }\n\n let generatedSearchQuery = `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} ecc.name LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) `;\n\n updateQuery(generatedSearchQuery);\n };\n\n return (\n <div className=\"gmw-search-form\">\n <Alert type=\"informational\">Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria.</Alert>\n <LabeledTextarea\n label=\"Query Keywords\"\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"red\" chair`}\n />\n <div className=\"gmw-search-actions\">\n {isUpdating && <LoadingSpinner />}\n <Button\n disabled={isUpdating}\n onClick={() =>\n generateSearchQuery(\n searchInput\n ? searchInput\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .trim()\n .split(\" \")\n : [],\n )\n }\n >\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setSearchInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,wDAAsE;AAEtE,uEAAoE;AACpE,yCAAuC;AACvC,uEAAoE;AAEpE;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,E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BAAsB,0BAsHjC","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 { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./SearchGroupingCustomUI.scss\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses a generic query template to search for elements.\n * @public\n */\nexport const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView }: GroupingCustomUIProps) => {\n const [searchInput, setSearchInput] = React.useState(\"\");\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (token: string, index: number, searchQuery: string[]) =>\n isWrappedInQuotes(token) || (index === 1 && isWrappedInQuotes(searchQuery[0]));\n\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n updateQuery(\"\");\n return;\n }\n\n let generatedSearchQuery = `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} ecc.name LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.codevalue LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.userlabel LIKE '%${\n isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) `;\n\n updateQuery(generatedSearchQuery);\n };\n\n return (\n <div className=\"gmw-search-form\">\n <Alert type=\"informational\">{GroupingMappingWidget.translate(\"customUI.searchQueryAlert\")}</Alert>\n <LabeledTextarea\n label={GroupingMappingWidget.translate(\"customUI.searchQueryLabel\")}\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isUpdating}\n placeholder={GroupingMappingWidget.translate(\"customUI.searchQueryPlaceholder\")}\n />\n <div className=\"gmw-search-actions\">\n {isUpdating && <LoadingSpinner />}\n <Button\n disabled={isUpdating}\n onClick={() =>\n generateSearchQuery(\n searchInput\n ? searchInput\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .trim()\n .split(\" \")\n : [],\n )\n }\n >\n {GroupingMappingWidget.translate(\"common.apply\")}\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setSearchInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n {GroupingMappingWidget.translate(\"common.clear\")}\n </Button>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** Localization */
|
|
2
|
+
export { GroupingMappingWidget } from "./GroupingMappingWidget";
|
|
3
|
+
export type { GroupingMappingWidgetConfig } from "./GroupingMappingWidget";
|
|
1
4
|
/** UI Provider for iTwin Viewer Applications */
|
|
2
5
|
export * from "./WidgetShell/GroupingMappingWidget";
|
|
3
6
|
/** Interfaces for providing custom MappingClient and API configuration */
|
|
@@ -14,11 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.resolveFormulaDataType = exports.GroupingMappingCustomUIType = exports.GroupQueryBuilderCustomUI = exports.ManualGroupingCustomUI = exports.SearchGroupingCustomUI = exports.CalculatedPropertyAction = exports.GroupPropertyAction = exports.PropertyMenuWithVisualization = exports.PropertyMenu = exports.GroupAction = exports.GroupsVisualization = exports.Groups = exports.GroupHilitedElementsContext = exports.useGroupHilitedElementsContext = exports.GroupingMappingContext = exports.GroupsView = exports.useGroupsOperations = exports.MappingsView = exports.MappingAction = exports.useMappingsOperations = exports.Mappings = exports.useGroupingMappingApiConfig = exports.GroupingMappingApiConfigContext = exports.usePropertiesClient = exports.PropertiesClientContext = exports.createPropertiesClient = exports.createDefaultPropertiesClient = exports.useGroupsClient = exports.GroupsClientContext = exports.createGroupsClient = exports.createDefaultGroupsClient = exports.useMappingClient = exports.MappingClientContext = exports.createMappingClient = exports.createDefaultMappingClient = void 0;
|
|
17
|
+
exports.resolveFormulaDataType = exports.GroupingMappingCustomUIType = exports.GroupQueryBuilderCustomUI = exports.ManualGroupingCustomUI = exports.SearchGroupingCustomUI = exports.CalculatedPropertyAction = exports.GroupPropertyAction = exports.PropertyMenuWithVisualization = exports.PropertyMenu = exports.GroupAction = exports.GroupsVisualization = exports.Groups = exports.GroupHilitedElementsContext = exports.useGroupHilitedElementsContext = exports.GroupingMappingContext = exports.GroupsView = exports.useGroupsOperations = exports.MappingsView = exports.MappingAction = exports.useMappingsOperations = exports.Mappings = exports.useGroupingMappingApiConfig = exports.GroupingMappingApiConfigContext = exports.usePropertiesClient = exports.PropertiesClientContext = exports.createPropertiesClient = exports.createDefaultPropertiesClient = exports.useGroupsClient = exports.GroupsClientContext = exports.createGroupsClient = exports.createDefaultGroupsClient = exports.useMappingClient = exports.MappingClientContext = exports.createMappingClient = exports.createDefaultMappingClient = exports.GroupingMappingWidget = void 0;
|
|
18
18
|
/*---------------------------------------------------------------------------------------------
|
|
19
19
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
20
20
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
21
21
|
*--------------------------------------------------------------------------------------------*/
|
|
22
|
+
/** Localization */
|
|
23
|
+
var GroupingMappingWidget_1 = require("./GroupingMappingWidget");
|
|
24
|
+
Object.defineProperty(exports, "GroupingMappingWidget", { enumerable: true, get: function () { return GroupingMappingWidget_1.GroupingMappingWidget; } });
|
|
22
25
|
/** UI Provider for iTwin Viewer Applications */
|
|
23
26
|
__exportStar(require("./WidgetShell/GroupingMappingWidget"), exports);
|
|
24
27
|
/** Interfaces for providing custom MappingClient and API configuration */
|
|
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,8IAAA,6BAA6B,OAAA;AACtC,mGAA4H;AAAnH,0HAAA,mBAAmB,OAAA;AAC5B,kHAAgJ;AAAvI,oIAAA,wBAAwB,OAAA;AACjC,uFAAsF;AAA7E,gIAAA,sBAAsB,OAAA;AAC/B,uFAAsF;AAA7E,gIAAA,sBAAsB,OAAA;AAC/B,6FAA4F;AAAnF,sIAAA,yBAAyB,OAAA;AAClC,yFAOuD;AALrD,sIAAA,2BAA2B,OAAA;AAO7B,gCAAgC;AAChC,6EAA2E;AAAlE,iIAAA,sBAAsB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./WidgetShell/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./components/context/MappingClientContext\";\nexport { createDefaultGroupsClient, createGroupsClient, GroupsClientContext, useGroupsClient } from \"./components/context/GroupsClientContext\";\nexport {\n createDefaultPropertiesClient,\n createPropertiesClient,\n PropertiesClientContext,\n usePropertiesClient,\n} from \"./components/context/PropertiesClientContext\";\nexport {\n ClientPrefix,\n GetAccessTokenFn,\n GroupingMappingApiConfig,\n GroupingMappingApiConfigContext,\n useGroupingMappingApiConfig,\n} from \"./components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./components/Mappings/Mappings\";\nexport { useMappingsOperations, MappingsOperationsProps } from \"./components/Mappings/hooks/useMappingsOperations\";\nexport { MappingAction, MappingActionProps } from \"./components/Mappings/Editing/MappingAction\";\nexport { MappingsView, MappingsViewProps } from \"./components/Mappings/MappingsView\";\nexport { useGroupsOperations, GroupsOperationsProps } from \"./components/Groups/hooks/useGroupsOperations\";\nexport { GroupsView, GroupsViewProps } from \"./components/Groups/GroupsView\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./components/GroupingMappingContext\";\nexport { useGroupHilitedElementsContext, GroupHilitedElements, GroupHilitedElementsContext } from \"./components/context/GroupHilitedElementsContext\";\nexport { Groups, GroupsProps } from \"./components/Groups/Groups\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./components/Groups/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./components/Groups/Editing/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./components/Properties/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./components/Properties/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./components/Properties/GroupProperties/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./components/Properties/CalculatedProperties/CalculatedPropertyAction\";\nexport { SearchGroupingCustomUI } from \"./components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./components/customUI/GroupQueryBuilderCustomUI\";\nexport {\n GroupingMappingCustomUI,\n GroupingMappingCustomUIType,\n ContextCustomUI,\n GroupingCustomUI,\n GroupingCustomUIProps,\n ContextCustomUIProps,\n} from \"./components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
|
|
1
|
+
{"version":3,"file":"grouping-mapping-widget.js","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,mBAAmB;AACnB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAG9B,gDAAgD;AAChD,sEAAoD;AAEpD,0EAA0E;AAC1E,kFAAoJ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B,6FAA4F;AAAnF,sIAAA,yBAAyB,OAAA;AAClC,yFAOuD;AALrD,sIAAA,2BAA2B,OAAA;AAO7B,gCAAgC;AAChC,6EAA2E;AAAlE,iIAAA,sBAAsB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** Localization */\nexport { GroupingMappingWidget } from \"./GroupingMappingWidget\";\nexport type { GroupingMappingWidgetConfig } from \"./GroupingMappingWidget\";\n\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./WidgetShell/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./components/context/MappingClientContext\";\nexport { createDefaultGroupsClient, createGroupsClient, GroupsClientContext, useGroupsClient } from \"./components/context/GroupsClientContext\";\nexport {\n createDefaultPropertiesClient,\n createPropertiesClient,\n PropertiesClientContext,\n usePropertiesClient,\n} from \"./components/context/PropertiesClientContext\";\nexport {\n ClientPrefix,\n GetAccessTokenFn,\n GroupingMappingApiConfig,\n GroupingMappingApiConfigContext,\n useGroupingMappingApiConfig,\n} from \"./components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./components/Mappings/Mappings\";\nexport { useMappingsOperations, MappingsOperationsProps } from \"./components/Mappings/hooks/useMappingsOperations\";\nexport { MappingAction, MappingActionProps } from \"./components/Mappings/Editing/MappingAction\";\nexport { MappingsView, MappingsViewProps } from \"./components/Mappings/MappingsView\";\nexport { useGroupsOperations, GroupsOperationsProps } from \"./components/Groups/hooks/useGroupsOperations\";\nexport { GroupsView, GroupsViewProps } from \"./components/Groups/GroupsView\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./components/GroupingMappingContext\";\nexport { useGroupHilitedElementsContext, GroupHilitedElements, GroupHilitedElementsContext } from \"./components/context/GroupHilitedElementsContext\";\nexport { Groups, GroupsProps } from \"./components/Groups/Groups\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./components/Groups/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./components/Groups/Editing/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./components/Properties/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./components/Properties/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./components/Properties/GroupProperties/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./components/Properties/CalculatedProperties/CalculatedPropertyAction\";\nexport { SearchGroupingCustomUI } from \"./components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./components/customUI/GroupQueryBuilderCustomUI\";\nexport {\n GroupingMappingCustomUI,\n GroupingMappingCustomUIType,\n ContextCustomUI,\n GroupingCustomUI,\n GroupingCustomUIProps,\n ContextCustomUIProps,\n} from \"./components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
|
|
@@ -143,7 +143,7 @@ describe("Groups View", () => {
|
|
|
143
143
|
// Should only have the permanent delete context item.
|
|
144
144
|
const contextMenuItems = test_utils_1.screen.getAllByTestId("gmw-context-menu-item");
|
|
145
145
|
expect(contextMenuItems).toHaveLength(1);
|
|
146
|
-
expect(contextMenuItems[0]).toHaveTextContent("
|
|
146
|
+
expect(contextMenuItems[0]).toHaveTextContent("common.remove");
|
|
147
147
|
});
|
|
148
148
|
it("Set up grouping custom UI", async () => {
|
|
149
149
|
// Arange
|
|
@@ -176,7 +176,7 @@ describe("Groups View", () => {
|
|
|
176
176
|
// Should have 2 context menu items
|
|
177
177
|
const contextMenuItems = test_utils_1.screen.getAllByTestId("gmw-context-menu-item");
|
|
178
178
|
expect(contextMenuItems).toHaveLength(2);
|
|
179
|
-
expect(contextMenuItems[0]).toHaveTextContent("
|
|
179
|
+
expect(contextMenuItems[0]).toHaveTextContent("common.edit");
|
|
180
180
|
// Hover on 'Edit'
|
|
181
181
|
await user.hover(contextMenuItems[0]);
|
|
182
182
|
// Should have exactly 1 sub menu item
|
|
@@ -214,7 +214,7 @@ describe("Groups View", () => {
|
|
|
214
214
|
const contextMenuItems = test_utils_1.screen.getAllByTestId("gmw-context-menu-item");
|
|
215
215
|
expect(contextMenuItems).toHaveLength(2);
|
|
216
216
|
expect(contextMenuItems[0]).toHaveTextContent(mockContextUI.displayLabel);
|
|
217
|
-
expect(contextMenuItems[1]).toHaveTextContent("
|
|
217
|
+
expect(contextMenuItems[1]).toHaveTextContent("common.remove");
|
|
218
218
|
// Click on the context ui
|
|
219
219
|
await user.click(contextMenuItems[0]);
|
|
220
220
|
// Callback should have been called with correct parameters
|
|
@@ -264,9 +264,9 @@ describe("Groups View", () => {
|
|
|
264
264
|
// Should have 3 context menu items
|
|
265
265
|
const contextMenuItems = test_utils_1.screen.getAllByTestId("gmw-context-menu-item");
|
|
266
266
|
expect(contextMenuItems).toHaveLength(3);
|
|
267
|
-
expect(contextMenuItems[0]).toHaveTextContent("
|
|
267
|
+
expect(contextMenuItems[0]).toHaveTextContent("common.edit");
|
|
268
268
|
expect(contextMenuItems[1]).toHaveTextContent(mockContextUI.displayLabel);
|
|
269
|
-
expect(contextMenuItems[2]).toHaveTextContent("
|
|
269
|
+
expect(contextMenuItems[2]).toHaveTextContent("common.remove");
|
|
270
270
|
// Click on the context ui
|
|
271
271
|
await user.click(contextMenuItems[1]);
|
|
272
272
|
// Callback should have been called with correct parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingCustomUI.test.js","sourceRoot":"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AC,iBAAiB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAC1E,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAExD,0BAA0B;QAC1B,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,2DAA2D;QAC3D,MAAM,CAAC,gCAAgC,CAAC,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtI,CAAC,CAAC,CAAC;AACL,CAAC,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 \"@testing-library/jest-dom\";\nimport { faker } from \"@faker-js/faker\";\nimport { GroupingMappingCustomUIType, Groups } from \"../grouping-mapping-widget\";\nimport type { GroupMinimalList, IGroupsClient, IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport * as moq from \"typemoq\";\nimport type { IModelConnection, ViewManager } from \"@itwin/core-frontend\";\nimport type { ContextCustomUIProps, GroupingCustomUIProps, GroupingMappingCustomUI } from \"../grouping-mapping-widget\";\nimport userEvent from \"@testing-library/user-event\";\nimport { render, screen, waitForElementToBeRemoved, within } from \"../test/test-utils\";\n\nconst mockITwinId = faker.datatype.uuid();\nconst mockIModelId = faker.datatype.uuid();\nconst mockMappingId = faker.datatype.uuid();\nconst mockMapping: Mapping = {\n id: mockMappingId,\n mappingName: \"mOcKmApPiNg1\",\n description: \"mOcKmApPiNgDeScRiPtIoN1\",\n createdBy: faker.random.alpha(),\n createdOn: faker.date.past().toDateString(),\n modifiedBy: faker.random.alpha(),\n modifiedOn: faker.date.past().toDateString(),\n extractionEnabled: false,\n _links: {\n iModel: {\n href: \"\",\n },\n },\n};\n\nconst groupsFactory = (): GroupMinimalList => ({\n groups: Array.from({ length: faker.datatype.number({ min: 3, max: 5 }) }, (_, index) => ({\n id: `${faker.datatype.uuid()}`,\n groupName: `mOcKgRoUp${index}`,\n description: `mOcKgRoUpDeScRiPtIoN${index}`,\n query: `mOcKgRoUpQuErY${index}`,\n _links: {\n iModel: {\n href: \"\",\n },\n mapping: {\n href: \"\",\n },\n },\n })),\n _links: {\n next: undefined,\n self: {\n href: \"\",\n },\n },\n});\n\nconst connectionMock = moq.Mock.ofType<IModelConnection>();\nconst viewManagerMock = moq.Mock.ofType<ViewManager>();\nconst mappingClientMock = moq.Mock.ofType<IMappingsClient>();\nconst groupsClientMock = moq.Mock.ofType<IGroupsClient>();\n\njest.mock(\"@itwin/appui-react\", () => ({\n ...jest.requireActual(\"@itwin/appui-react\"),\n useActiveIModelConnection: () => connectionMock.object,\n}));\n\njest.mock(\"@itwin/core-frontend\", () => ({\n ...jest.requireActual(\"@itwin/core-frontend\"),\n IModelApp: {\n viewManager: {},\n },\n}));\n\njest.mock(\"../components/context/MappingClientContext\", () => {\n const actualMappingContextModule = jest.requireActual(\"../components/context/MappingClientContext\");\n return {\n ...actualMappingContextModule,\n useMappingClient: () => mappingClientMock.object,\n };\n});\n\njest.mock(\"../components/context/GroupsClientContext\", () => {\n const actualGroupsContextModule = jest.requireActual(\"../components/context/GroupsClientContext\");\n return {\n ...actualGroupsContextModule,\n useGroupsClient: () => groupsClientMock.object,\n };\n});\n\njest.mock(\"../common/utils\", () => ({\n ...jest.requireActual(\"../common/utils\"),\n enableExperimentalFeatures: jest.fn,\n}));\n\nconst mockGroups = groupsFactory();\n\ndescribe(\"Groups View\", () => {\n beforeEach(async () => {\n connectionMock.setup((x) => x.iModelId).returns(() => mockIModelId);\n connectionMock.setup((x) => x.iTwinId).returns(() => mockITwinId);\n\n groupsClientMock.setup(async (x) => x.getGroups(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(async () => Promise.resolve(mockGroups));\n });\n\n afterEach(() => {\n connectionMock.reset();\n mappingClientMock.reset();\n viewManagerMock.reset();\n });\n\n it(\"List all groups\", async () => {\n // Arange\n\n // Act\n const user = userEvent.setup();\n render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={jest.fn()}\n />,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n\n // Should have the correct random mockGroups.groups count listed\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n horizontalTiles.forEach((horizontalTile, index) => {\n const groupTile = within(horizontalTile);\n expect(groupTile.getByText(mockGroups.groups[index].groupName)).toBeInTheDocument();\n expect(groupTile.getByText(mockGroups.groups[index].description ?? \"\")).toBeInTheDocument();\n });\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should only have the permanent delete context item.\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(1);\n expect(contextMenuItems[0]).toHaveTextContent(\"Remove\");\n });\n\n it(\"Set up grouping custom UI\", async () => {\n // Arange\n const mockedUIComponent = (_props: GroupingCustomUIProps) => React.createElement(\"div\");\n const mockGroupingUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Grouping,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockGroupingUI];\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={jest.fn()}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n const addButton = screen.getAllByTestId(\"gmw-add-group-button\");\n expect(addButton).toHaveLength(1);\n\n // Click on 'Add Group' button\n await user.click(addButton[0]);\n\n // Should have exactly 1 add method with given configuration\n const addCustom = screen.getAllByTestId(\"gmw-add-0\");\n expect(addCustom).toHaveLength(1);\n expect(addCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n // Each group should have a more icon button\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n expect(moreButton.length).toBeGreaterThan(0);\n\n // Click on first more icon\n await user.click(moreButton[0]);\n\n // Should have 2 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(2);\n expect(contextMenuItems[0]).toHaveTextContent(\"Edit\");\n\n // Hover on 'Edit'\n await user.hover(contextMenuItems[0]);\n\n // Should have exactly 1 sub menu item\n const editCustom = screen.getAllByTestId(`gmw-edit-0`);\n expect(editCustom).toHaveLength(1);\n expect(editCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n // Click on the edit custom UI\n await user.click(editCustom[0]);\n\n const groupName = screen.getAllByText(mockGroups.groups[0].groupName);\n expect(groupName).toHaveLength(1);\n });\n\n it(\"Set up context custom UI - should have add context menu\", async () => {\n // Arange\n const mockedUIComponent = (_props: ContextCustomUIProps) => React.createElement(\"div\");\n const mockContextUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Context,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockContextUI];\n const onClickRenderContextCustomUIMock = jest.fn();\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={onClickRenderContextCustomUIMock}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n\n // Should have the right group number\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should have 2 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(2);\n expect(contextMenuItems[0]).toHaveTextContent(mockContextUI.displayLabel);\n expect(contextMenuItems[1]).toHaveTextContent(\"Remove\");\n\n // Click on the context ui\n await user.click(contextMenuItems[0]);\n\n // Callback should have been called with correct parameters\n expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);\n });\n\n it(\"Set up both grouping and context custom UI\", async () => {\n // Arange\n const mockedGroupingUIComponent = (_props: GroupingCustomUIProps) => React.createElement(\"div\");\n const mockedContextUIComponent = (_props: ContextCustomUIProps) => React.createElement(\"div\");\n const mockGroupingUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Grouping,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedGroupingUIComponent,\n };\n const mockContextUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Context,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedContextUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockContextUI, mockGroupingUI];\n const onClickAddGroup = jest.fn();\n const onClickRenderContextCustomUIMock = jest.fn();\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={onClickAddGroup}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={onClickRenderContextCustomUIMock}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n const addButton = screen.getAllByTestId(\"gmw-add-group-button\");\n expect(addButton).toHaveLength(1);\n\n // Click on 'Add Group' button\n await user.click(addButton[0]);\n\n // Should have exactly 1 add method with given configuration\n const addCustom = screen.getAllByTestId(\"gmw-add-0\");\n expect(addCustom).toHaveLength(1);\n expect(addCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n await user.click(addCustom[0]);\n\n // Callback should have been called with correct parameters\n expect(onClickAddGroup).toBeCalledWith(mockGroupingUI.name);\n\n // Check the group tile number\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should have 3 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n\n expect(contextMenuItems).toHaveLength(3);\n expect(contextMenuItems[0]).toHaveTextContent(\"Edit\");\n expect(contextMenuItems[1]).toHaveTextContent(mockContextUI.displayLabel);\n expect(contextMenuItems[2]).toHaveTextContent(\"Remove\");\n\n // Click on the context ui\n await user.click(contextMenuItems[1]);\n\n // Callback should have been called with correct parameters\n expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedContextUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"GroupingMappingCustomUI.test.js","sourceRoot":"","sources":["../../../src/test/GroupingMappingCustomUI.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,qCAAmC;AACnC,2CAAwC;AACxC,wEAAiF;AAEjF,6CAA+B;AAG/B,6EAAoD;AACpD,mDAAuF;AAEvF,MAAM,WAAW,GAAG,aAAK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2DAA2D;QAC3D,MAAM,CAAC,gCAAgC,CAAC,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtI,CAAC,CAAC,CAAC;AACL,CAAC,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 \"@testing-library/jest-dom\";\nimport { faker } from \"@faker-js/faker\";\nimport { GroupingMappingCustomUIType, Groups } from \"../grouping-mapping-widget\";\nimport type { GroupMinimalList, IGroupsClient, IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport * as moq from \"typemoq\";\nimport type { IModelConnection, ViewManager } from \"@itwin/core-frontend\";\nimport type { ContextCustomUIProps, GroupingCustomUIProps, GroupingMappingCustomUI } from \"../grouping-mapping-widget\";\nimport userEvent from \"@testing-library/user-event\";\nimport { render, screen, waitForElementToBeRemoved, within } from \"../test/test-utils\";\n\nconst mockITwinId = faker.datatype.uuid();\nconst mockIModelId = faker.datatype.uuid();\nconst mockMappingId = faker.datatype.uuid();\nconst mockMapping: Mapping = {\n id: mockMappingId,\n mappingName: \"mOcKmApPiNg1\",\n description: \"mOcKmApPiNgDeScRiPtIoN1\",\n createdBy: faker.random.alpha(),\n createdOn: faker.date.past().toDateString(),\n modifiedBy: faker.random.alpha(),\n modifiedOn: faker.date.past().toDateString(),\n extractionEnabled: false,\n _links: {\n iModel: {\n href: \"\",\n },\n },\n};\n\nconst groupsFactory = (): GroupMinimalList => ({\n groups: Array.from({ length: faker.datatype.number({ min: 3, max: 5 }) }, (_, index) => ({\n id: `${faker.datatype.uuid()}`,\n groupName: `mOcKgRoUp${index}`,\n description: `mOcKgRoUpDeScRiPtIoN${index}`,\n query: `mOcKgRoUpQuErY${index}`,\n _links: {\n iModel: {\n href: \"\",\n },\n mapping: {\n href: \"\",\n },\n },\n })),\n _links: {\n next: undefined,\n self: {\n href: \"\",\n },\n },\n});\n\nconst connectionMock = moq.Mock.ofType<IModelConnection>();\nconst viewManagerMock = moq.Mock.ofType<ViewManager>();\nconst mappingClientMock = moq.Mock.ofType<IMappingsClient>();\nconst groupsClientMock = moq.Mock.ofType<IGroupsClient>();\n\njest.mock(\"@itwin/appui-react\", () => ({\n ...jest.requireActual(\"@itwin/appui-react\"),\n useActiveIModelConnection: () => connectionMock.object,\n}));\n\njest.mock(\"@itwin/core-frontend\", () => ({\n ...jest.requireActual(\"@itwin/core-frontend\"),\n IModelApp: {\n viewManager: {},\n },\n}));\n\njest.mock(\"../components/context/MappingClientContext\", () => {\n const actualMappingContextModule = jest.requireActual(\"../components/context/MappingClientContext\");\n return {\n ...actualMappingContextModule,\n useMappingClient: () => mappingClientMock.object,\n };\n});\n\njest.mock(\"../components/context/GroupsClientContext\", () => {\n const actualGroupsContextModule = jest.requireActual(\"../components/context/GroupsClientContext\");\n return {\n ...actualGroupsContextModule,\n useGroupsClient: () => groupsClientMock.object,\n };\n});\n\njest.mock(\"../common/utils\", () => ({\n ...jest.requireActual(\"../common/utils\"),\n enableExperimentalFeatures: jest.fn,\n}));\n\nconst mockGroups = groupsFactory();\n\ndescribe(\"Groups View\", () => {\n beforeEach(async () => {\n connectionMock.setup((x) => x.iModelId).returns(() => mockIModelId);\n connectionMock.setup((x) => x.iTwinId).returns(() => mockITwinId);\n\n groupsClientMock.setup(async (x) => x.getGroups(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(async () => Promise.resolve(mockGroups));\n });\n\n afterEach(() => {\n connectionMock.reset();\n mappingClientMock.reset();\n viewManagerMock.reset();\n });\n\n it(\"List all groups\", async () => {\n // Arange\n\n // Act\n const user = userEvent.setup();\n render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={jest.fn()}\n />,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n\n // Should have the correct random mockGroups.groups count listed\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n horizontalTiles.forEach((horizontalTile, index) => {\n const groupTile = within(horizontalTile);\n expect(groupTile.getByText(mockGroups.groups[index].groupName)).toBeInTheDocument();\n expect(groupTile.getByText(mockGroups.groups[index].description ?? \"\")).toBeInTheDocument();\n });\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should only have the permanent delete context item.\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(1);\n expect(contextMenuItems[0]).toHaveTextContent(\"common.remove\");\n });\n\n it(\"Set up grouping custom UI\", async () => {\n // Arange\n const mockedUIComponent = (_props: GroupingCustomUIProps) => React.createElement(\"div\");\n const mockGroupingUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Grouping,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockGroupingUI];\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={jest.fn()}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n const addButton = screen.getAllByTestId(\"gmw-add-group-button\");\n expect(addButton).toHaveLength(1);\n\n // Click on 'Add Group' button\n await user.click(addButton[0]);\n\n // Should have exactly 1 add method with given configuration\n const addCustom = screen.getAllByTestId(\"gmw-add-0\");\n expect(addCustom).toHaveLength(1);\n expect(addCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n // Each group should have a more icon button\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n expect(moreButton.length).toBeGreaterThan(0);\n\n // Click on first more icon\n await user.click(moreButton[0]);\n\n // Should have 2 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(2);\n expect(contextMenuItems[0]).toHaveTextContent(\"common.edit\");\n\n // Hover on 'Edit'\n await user.hover(contextMenuItems[0]);\n\n // Should have exactly 1 sub menu item\n const editCustom = screen.getAllByTestId(`gmw-edit-0`);\n expect(editCustom).toHaveLength(1);\n expect(editCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n // Click on the edit custom UI\n await user.click(editCustom[0]);\n\n const groupName = screen.getAllByText(mockGroups.groups[0].groupName);\n expect(groupName).toHaveLength(1);\n });\n\n it(\"Set up context custom UI - should have add context menu\", async () => {\n // Arange\n const mockedUIComponent = (_props: ContextCustomUIProps) => React.createElement(\"div\");\n const mockContextUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Context,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockContextUI];\n const onClickRenderContextCustomUIMock = jest.fn();\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={jest.fn()}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={onClickRenderContextCustomUIMock}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n\n // Should have the right group number\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should have 2 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n expect(contextMenuItems).toHaveLength(2);\n expect(contextMenuItems[0]).toHaveTextContent(mockContextUI.displayLabel);\n expect(contextMenuItems[1]).toHaveTextContent(\"common.remove\");\n\n // Click on the context ui\n await user.click(contextMenuItems[0]);\n\n // Callback should have been called with correct parameters\n expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);\n });\n\n it(\"Set up both grouping and context custom UI\", async () => {\n // Arange\n const mockedGroupingUIComponent = (_props: GroupingCustomUIProps) => React.createElement(\"div\");\n const mockedContextUIComponent = (_props: ContextCustomUIProps) => React.createElement(\"div\");\n const mockGroupingUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Grouping,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedGroupingUIComponent,\n };\n const mockContextUI: GroupingMappingCustomUI = {\n type: GroupingMappingCustomUIType.Context,\n name: \"mOcKgRoUpInGuI\",\n displayLabel: \"Mock Grouping UI\",\n uiComponent: mockedContextUIComponent,\n };\n\n const groupingMappingCustomUIMock = [mockContextUI, mockGroupingUI];\n const onClickAddGroup = jest.fn();\n const onClickRenderContextCustomUIMock = jest.fn();\n\n // Act\n const { user } = render(\n <Groups\n mapping={mockMapping}\n onClickAddGroup={onClickAddGroup}\n onClickGroupModify={jest.fn()}\n onClickGroupTitle={jest.fn}\n onClickRenderContextCustomUI={onClickRenderContextCustomUIMock}\n />,\n groupingMappingCustomUIMock,\n );\n\n await waitForElementToBeRemoved(() => screen.getByText(/loading/i));\n\n // Assert\n const addButton = screen.getAllByTestId(\"gmw-add-group-button\");\n expect(addButton).toHaveLength(1);\n\n // Click on 'Add Group' button\n await user.click(addButton[0]);\n\n // Should have exactly 1 add method with given configuration\n const addCustom = screen.getAllByTestId(\"gmw-add-0\");\n expect(addCustom).toHaveLength(1);\n expect(addCustom[0]).toHaveTextContent(mockGroupingUI.displayLabel);\n\n await user.click(addCustom[0]);\n\n // Callback should have been called with correct parameters\n expect(onClickAddGroup).toBeCalledWith(mockGroupingUI.name);\n\n // Check the group tile number\n const horizontalTiles = screen.getAllByTestId(\"group-list-item\");\n expect(horizontalTiles).toHaveLength(mockGroups.groups.length);\n\n // Click on first group more icon\n const moreButton = screen.getAllByTestId(\"gmw-more-button\");\n expect(moreButton).toHaveLength(mockGroups.groups.length);\n\n await user.click(moreButton[0]);\n\n // Should have 3 context menu items\n const contextMenuItems = screen.getAllByTestId(\"gmw-context-menu-item\");\n\n expect(contextMenuItems).toHaveLength(3);\n expect(contextMenuItems[0]).toHaveTextContent(\"common.edit\");\n expect(contextMenuItems[1]).toHaveTextContent(mockContextUI.displayLabel);\n expect(contextMenuItems[2]).toHaveTextContent(\"common.remove\");\n\n // Click on the context ui\n await user.click(contextMenuItems[1]);\n\n // Callback should have been called with correct parameters\n expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedContextUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);\n });\n});\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
const core_common_1 = require("@itwin/core-common");
|
|
8
|
+
const GroupingMappingWidget_1 = require("../GroupingMappingWidget");
|
|
9
|
+
void GroupingMappingWidget_1.GroupingMappingWidget.initialize({ localization: new core_common_1.EmptyLocalization() });
|
|
10
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/test/setup.ts"],"names":[],"mappings":";;AAAA;;;gGAGgG;AAChG,oDAAuD;AACvD,oEAAiE;AAEjE,KAAK,6CAAqB,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,IAAI,+BAAiB,EAAE,EAAE,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 { EmptyLocalization } from \"@itwin/core-common\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\n\nvoid GroupingMappingWidget.initialize({ localization: new EmptyLocalization() });\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Localization, TranslationOptions } from "@itwin/core-common";
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface GroupingMappingWidgetConfig {
|
|
4
|
+
localization?: Localization;
|
|
5
|
+
/** Override specific translation keys at runtime. Keys correspond to those in GroupingMappingWidget.json. */
|
|
6
|
+
localizationOverrides?: Map<string, string>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Entry point for static initialization required by various components used in the package.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare class GroupingMappingWidget {
|
|
13
|
+
#private;
|
|
14
|
+
/**
|
|
15
|
+
* Called to initialize the Grouping & Mapping Widget localization.
|
|
16
|
+
* @param config - Optional configuration with custom localization service and overrides.
|
|
17
|
+
*/
|
|
18
|
+
static initialize(config?: GroupingMappingWidgetConfig): Promise<void>;
|
|
19
|
+
/** Unregisters the GroupingMappingWidget internationalization service namespace */
|
|
20
|
+
static terminate(): void;
|
|
21
|
+
/** The internationalization service created by the IModelApp. */
|
|
22
|
+
static get i18n(): Localization;
|
|
23
|
+
/** The internationalization service namespace. */
|
|
24
|
+
static get i18nNamespace(): string;
|
|
25
|
+
/** Calls i18n.getLocalizedString with the "GroupingMappingWidget" namespace. Do NOT include the namespace in the key. */
|
|
26
|
+
static translate(key: string | string[], options?: TranslationOptions): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=GroupingMappingWidget.d.ts.map
|