@itwin/grouping-mapping-widget 0.25.1 → 0.26.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/WidgetShell/GroupingMapping.d.ts +5 -5
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.d.ts +4 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +4 -0
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.d.ts +19 -3
- package/lib/cjs/components/GroupingMappingContext.js +27 -9
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +10 -2
- package/lib/cjs/components/Groups/Editing/GroupAction.js +9 -5
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/GroupColorLegend.d.ts +3 -3
- package/lib/cjs/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/cjs/components/Groups/GroupListItem.d.ts +4 -4
- package/lib/cjs/components/Groups/GroupListItem.js +6 -3
- package/lib/cjs/components/Groups/GroupListItem.js.map +1 -1
- package/lib/cjs/components/Groups/GroupListItem.scss +14 -0
- package/lib/cjs/components/Groups/GroupMenuActions.d.ts +4 -4
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/cjs/components/Groups/GroupMenuActions.scss +2 -0
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/cjs/components/Groups/Groups.d.ts +12 -4
- package/lib/cjs/components/Groups/Groups.js +4 -0
- package/lib/cjs/components/Groups/Groups.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.d.ts +4 -4
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.d.ts +19 -11
- package/lib/cjs/components/Groups/GroupsView.js +4 -0
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.d.ts +8 -0
- package/lib/cjs/components/Groups/GroupsVisualization.js +8 -4
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +3 -3
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +2 -2
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -2
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useFetchGroups.d.ts +3 -3
- package/lib/cjs/components/Groups/hooks/useFetchGroups.js +6 -5
- package/lib/cjs/components/Groups/hooks/useFetchGroups.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +15 -7
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js +9 -5
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +8 -0
- package/lib/cjs/components/Mappings/Editing/MappingAction.js +7 -2
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +4 -2
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +4 -3
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Mappings.d.ts +8 -0
- package/lib/cjs/components/Mappings/Mappings.js +4 -0
- package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.d.ts +7 -0
- package/lib/cjs/components/Mappings/MappingsView.js +4 -0
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +1 -2
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +9 -8
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +5 -4
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappings.js +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappings.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +12 -8
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +20 -14
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +10 -2
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +20 -7
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +19 -7
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +6 -4
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +10 -2
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +52 -34
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +6 -4
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.d.ts +2 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +12 -4
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +24 -18
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +3 -3
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +6 -4
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +0 -26
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +3 -3
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenu.d.ts +13 -5
- package/lib/cjs/components/Properties/PropertyMenu.js +12 -14
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +4 -0
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +8 -4
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
- package/lib/cjs/components/context/ExtractionClientContext.js +3 -3
- package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/cjs/components/context/GroupingApiConfigContext.d.ts +16 -0
- package/lib/cjs/components/context/GroupingApiConfigContext.js +7 -0
- package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/cjs/components/context/GroupsClientContext.d.ts +20 -0
- package/lib/cjs/components/context/GroupsClientContext.js +45 -0
- package/lib/cjs/components/context/GroupsClientContext.js.map +1 -0
- package/lib/cjs/components/context/MappingClientContext.d.ts +12 -0
- package/lib/cjs/components/context/MappingClientContext.js +14 -2
- package/lib/cjs/components/context/MappingClientContext.js.map +1 -1
- package/lib/cjs/components/context/PropertiesClientContext.d.ts +20 -0
- package/lib/cjs/components/context/PropertiesClientContext.js +45 -0
- package/lib/cjs/components/context/PropertiesClientContext.js.map +1 -0
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.d.ts +4 -0
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +4 -0
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js +3 -0
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.d.ts +4 -0
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +4 -0
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.d.ts +4 -0
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +4 -0
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/formula/FormulaDataTypeResolver.d.ts +1 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js +1 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/FormulaFunctionProvider.js +41 -41
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaOperatorsProvider.js +3 -3
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +2 -2
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/IResult.d.ts +3 -0
- package/lib/cjs/formula/IResult.js.map +1 -1
- package/lib/cjs/formula/Types.d.ts +16 -1
- package/lib/cjs/formula/Types.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +2 -0
- package/lib/cjs/grouping-mapping-widget.js +11 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupPropertyUtils.test.js +0 -39
- package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +19 -8
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMapping.d.ts +5 -5
- package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.d.ts +4 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +4 -0
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.d.ts +19 -3
- package/lib/esm/components/GroupingMappingContext.js +27 -9
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupAction.d.ts +10 -2
- package/lib/esm/components/Groups/Editing/GroupAction.js +9 -5
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/GroupColorLegend.d.ts +3 -3
- package/lib/esm/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/esm/components/Groups/GroupListItem.d.ts +4 -4
- package/lib/esm/components/Groups/GroupListItem.js +6 -3
- package/lib/esm/components/Groups/GroupListItem.js.map +1 -1
- package/lib/esm/components/Groups/GroupListItem.scss +14 -0
- package/lib/esm/components/Groups/GroupMenuActions.d.ts +4 -4
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/esm/components/Groups/GroupMenuActions.scss +2 -0
- package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
- package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
- package/lib/esm/components/Groups/Groups.d.ts +12 -4
- package/lib/esm/components/Groups/Groups.js +4 -0
- package/lib/esm/components/Groups/Groups.js.map +1 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.d.ts +4 -4
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.d.ts +19 -11
- package/lib/esm/components/Groups/GroupsView.js +4 -0
- package/lib/esm/components/Groups/GroupsView.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.d.ts +8 -0
- package/lib/esm/components/Groups/GroupsVisualization.js +8 -4
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +3 -3
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +2 -2
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -2
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useFetchGroups.d.ts +3 -3
- package/lib/esm/components/Groups/hooks/useFetchGroups.js +6 -5
- package/lib/esm/components/Groups/hooks/useFetchGroups.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +15 -7
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js +9 -5
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +8 -0
- package/lib/esm/components/Mappings/Editing/MappingAction.js +7 -2
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +4 -2
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +4 -3
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/components/Mappings/Mappings.d.ts +8 -0
- package/lib/esm/components/Mappings/Mappings.js +4 -0
- package/lib/esm/components/Mappings/Mappings.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.d.ts +7 -0
- package/lib/esm/components/Mappings/MappingsView.js +4 -0
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +1 -2
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +9 -8
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +6 -5
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappings.js +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappings.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +13 -9
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js +20 -14
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +10 -2
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +21 -8
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +20 -8
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +6 -4
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +10 -2
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +53 -35
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +6 -4
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.d.ts +2 -2
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +12 -4
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +24 -18
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +3 -3
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +6 -4
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +0 -26
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +3 -3
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenu.d.ts +13 -5
- package/lib/esm/components/Properties/PropertyMenu.js +12 -14
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +4 -0
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js +8 -4
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
- package/lib/esm/components/context/ExtractionClientContext.js +3 -3
- package/lib/esm/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/esm/components/context/GroupingApiConfigContext.d.ts +16 -0
- package/lib/esm/components/context/GroupingApiConfigContext.js +7 -0
- package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/esm/components/context/GroupsClientContext.d.ts +20 -0
- package/lib/esm/components/context/GroupsClientContext.js +39 -0
- package/lib/esm/components/context/GroupsClientContext.js.map +1 -0
- package/lib/esm/components/context/MappingClientContext.d.ts +12 -0
- package/lib/esm/components/context/MappingClientContext.js +15 -3
- package/lib/esm/components/context/MappingClientContext.js.map +1 -1
- package/lib/esm/components/context/PropertiesClientContext.d.ts +20 -0
- package/lib/esm/components/context/PropertiesClientContext.js +39 -0
- package/lib/esm/components/context/PropertiesClientContext.js.map +1 -0
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.d.ts +4 -0
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +4 -0
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
- package/lib/esm/components/customUI/GroupingMappingCustomUI.js +3 -0
- package/lib/esm/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.d.ts +4 -0
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js +4 -0
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.d.ts +4 -0
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js +4 -0
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/formula/FormulaDataTypeResolver.d.ts +1 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js +1 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/FormulaFunctionProvider.js +41 -41
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/esm/formula/FormulaOperatorsProvider.js +3 -3
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js +2 -2
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/IResult.d.ts +3 -0
- package/lib/esm/formula/IResult.js.map +1 -1
- package/lib/esm/formula/Types.d.ts +16 -1
- package/lib/esm/formula/Types.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +2 -0
- package/lib/esm/grouping-mapping-widget.js +2 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupPropertyUtils.test.js +0 -39
- package/lib/esm/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +19 -8
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +0 -12
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +0 -8
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAMA,4DAAkD;AAWlD,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAexC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAY,EAAE;IAC7C,QAAQ,IAAI,EAAE;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB;YACE,OAAO,0BAAQ,CAAC,MAAM,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,uBAA2C,EAC3C,iBAAyB,EACzB,iBAA2B,EACnB,EAAE;IACV,OAAO,GAAG,uBAAuB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1F,CAAC,CAAC;AAEF,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GAAG,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACpE,MAAM;aACP;YACD,IAAI,CAAC,KAAK,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,QAAQ,GAAG,IAAI,CAAC;aACjB;SACF;QACD,IAAI,QAAQ;YACV,MAAM;KACT;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAClD,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAAE,gBAAkC,EAAE,MAAc,EAAE,EAAE;IACtG,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,+BAAS,CAAC,OAAO;gBAC3B,cAAc,EAAE;oBACd;wBACE,QAAQ,EAAE,+CAAyB,CAAC,qBAAqB;wBACzD,iBAAiB,EAAE,CAAC;gCAClB,IAAI,EAAE,GAAG;gCACT,WAAW,EAAE,IAAI;6BAClB,CAAC;qBACH;iBACF;aACF;SAAC;KACL,CAAC;IACF,MAAM,cAAc,GAA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3BW,QAAA,2BAA2B,+BA2BtC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n propertyType: DataType;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst convertType = (type: string): DataType => {\n switch (type) {\n case \"int\":\n case \"enum\":\n case \"long\":\n return DataType.Integer;\n case \"boolean\":\n return DataType.Boolean;\n case \"double\":\n return DataType.Double;\n case \"number\":\n return DataType.Number;\n default:\n return DataType.String;\n }\n};\n\nconst generateKey = (\n parentPropertyClassName: string | undefined,\n actualECClassName: string,\n propertyTraversal: string[]\n): string => {\n return `${parentPropertyClassName}|${actualECClassName}|${propertyTraversal.join(\"|\")}`;\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n /* Presentation assigns primitive navigations properties as a long type due to how it stores the\n ECInstanceId of the class in the meta.ECClassDef table on the C++ layer.\n We are handling this special case.\n */\n const propertyType = primitiveNavigationClass ? DataType.String : convertType(property.property.type);\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const propertyType = convertType(member.type.typeName);\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] => {\n const uniquePropertiesMap = new Map<string, PropertyMetaData>();\n\n propertyFields.forEach((property) => {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n // Generate base ECProperty\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n extractedPrimitives.forEach((extractedPrimitive) => {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n uniquePropertiesMap.set(extractedPrimitive.key, extractedPrimitive);\n });\n break;\n }\n case PropertyValueFormat.Struct: {\n // Get structs\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n const propertyWithSchema = { ...ecProperty, sourceSchema, sourceClassName };\n uniquePropertiesMap.set(propertyWithSchema.key, propertyWithSchema);\n });\n }\n break;\n }\n case RelationshipMeaning.RelatedInstance: {\n // Navigation properties\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const extractedNested = extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const extractedStruct = extractStruct(property);\n extractedStruct.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n }\n }\n }\n }\n });\n\n return Array.from(uniquePropertiesMap.values());\n};\n\nexport const convertToECProperties = (property: PropertyMetaData): ECProperty[] => {\n const ecProperty: ECProperty = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyType: property.propertyType,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECProperty[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n propertyOverrides: [{\n name: \"*\",\n isDisplayed: true,\n }],\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAgBA,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAcxC,MAAM,WAAW,GAAG,CAClB,uBAA2C,EAC3C,iBAAyB,EACzB,iBAA2B,EACnB,EAAE;IACV,OAAO,GAAG,uBAAuB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACxB,iBAA2B,EAC3B,aAA8B,EACV,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;IACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5C,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;IACzC,kCAAkC;IAClC,MAAM,uBAAuB,GAAG,aAAa,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAC5E,MAAM,wBAAwB,GAAG,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC;IAChG,MAAM,iBAAiB,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;IAC3D,MAAM,oBAAoB,GAAG,CAAC,GAAG,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAElE,OAAO,CACL;QACE,YAAY;QACZ,YAAY,EAAE,GAAG;QACjB,eAAe,EAAE,GAAG;QACpB,mBAAmB,EAAE,oBAAoB;QACzC,wBAAwB;QACxB,iBAAiB;QACjB,uBAAuB;QACvB,GAAG,EAAE,WAAW,CAAC,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,CAAC;QAClF,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK;KA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wB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrD,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACpE,MAAM;aACP;YACD,IAAI,CAAC,KAAK,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,QAAQ,GAAG,IAAI,CAAC;aACjB;SACF;QACD,IAAI,QAAQ;YACV,MAAM;KACT;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAClD,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAAE,gBAAkC,EAAE,MAAc,EAAE,EAAE;IACtG,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,+BAAS,CAAC,OAAO;gBAC3B,cAAc,EAAE;oBACd;wBACE,QAAQ,EAAE,+CAAyB,CAAC,qBAAqB;wBACzD,iBAAiB,EAAE,CAAC;gCAClB,IAAI,EAAE,GAAG;gCACT,WAAW,EAAE,IAAI;6BAClB,CAAC;qBACH;iBACF;aACF;SAAC;KACL,CAAC;IACF,MAAM,cAAc,GAA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3BW,QAAA,2BAA2B,+BA2BtC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ECPropertyReference } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst generateKey = (\n parentPropertyClassName: string | undefined,\n actualECClassName: string,\n propertyTraversal: string[]\n): string => {\n return `${parentPropertyClassName}|${actualECClassName}|${propertyTraversal.join(\"|\")}`;\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] => {\n const uniquePropertiesMap = new Map<string, PropertyMetaData>();\n\n propertyFields.forEach((property) => {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n // Generate base ECProperty\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n extractedPrimitives.forEach((extractedPrimitive) => {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n uniquePropertiesMap.set(extractedPrimitive.key, extractedPrimitive);\n });\n break;\n }\n case PropertyValueFormat.Struct: {\n // Get structs\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n const propertyWithSchema = { ...ecProperty, sourceSchema, sourceClassName };\n uniquePropertiesMap.set(propertyWithSchema.key, propertyWithSchema);\n });\n }\n break;\n }\n case RelationshipMeaning.RelatedInstance: {\n // Navigation properties\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const extractedNested = extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const extractedStruct = extractStruct(property);\n extractedStruct.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n }\n }\n }\n }\n });\n\n return Array.from(uniquePropertiesMap.values());\n};\n\nexport const convertToECProperties = (property: PropertyMetaData): ECPropertyReference[] => {\n const ecProperty: ECPropertyReference = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECPropertyReference[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n propertyOverrides: [{\n name: \"*\",\n isDisplayed: true,\n }],\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
@@ -118,7 +118,7 @@ const GroupsPropertiesSelectionModal = ({ showModal, setShowModal, selectedPrope
|
|
|
118
118
|
filteredProperties.length === 0 ?
|
|
119
119
|
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
120
120
|
react_1.default.createElement(itwinui_react_1.Text, null, "No properties available. ")) :
|
|
121
|
-
react_1.default.createElement("div", { className: "gmw-properties-list" }, filteredProperties.map((property) => (react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { key: property.key, content: `${property.displayLabel}
|
|
121
|
+
react_1.default.createElement("div", { className: "gmw-properties-list" }, filteredProperties.map((property) => (react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { key: property.key, content: `${property.displayLabel}`, title: `${property.actualECClassName}`, description: (0, utils_1.getLocalizedStringPresentation)(property.categoryLabel), selected: selectedProperties.some((p) => property.key === p.key), onClick: () => setSelectedProperties((sp) => sp.some((p) => property.key === p.key)
|
|
122
122
|
? sp.filter((p) => property.key !== p.key)
|
|
123
123
|
: [...sp, property]) }))))),
|
|
124
124
|
react_1.default.createElement(itwinui_react_1.Surface, { className: "gmw-selected-properties", elevation: 1 },
|
|
@@ -128,7 +128,7 @@ const GroupsPropertiesSelectionModal = ({ showModal, setShowModal, selectedPrope
|
|
|
128
128
|
react_1.default.createElement(itwinui_react_1.Text, null, "No properties selected."),
|
|
129
129
|
react_1.default.createElement(itwinui_react_1.Text, null, "Add some by clicking on the properties shown left.")) :
|
|
130
130
|
react_1.default.createElement("div", { className: "gmw-properties-list" },
|
|
131
|
-
react_1.default.createElement(sortable_1.SortableContext, { items: selectedProperties.map((p) => p.key), strategy: sortable_1.verticalListSortingStrategy }, selectedProperties.map((property) => react_1.default.createElement(SortableHorizontalTile_1.SortableHorizontalTile, { key: property.key, id: property.key, content: `${property.displayLabel}
|
|
131
|
+
react_1.default.createElement(sortable_1.SortableContext, { items: selectedProperties.map((p) => p.key), strategy: sortable_1.verticalListSortingStrategy }, selectedProperties.map((property) => react_1.default.createElement(SortableHorizontalTile_1.SortableHorizontalTile, { key: property.key, id: property.key, content: `${property.displayLabel}`, title: `${property.actualECClassName}`, description: (0, utils_1.getLocalizedStringPresentation)(property.categoryLabel), action: react_1.default.createElement("div", null,
|
|
132
132
|
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: "Remove", onClick: () => {
|
|
133
133
|
setSelectedProperties((sp) => sp.filter((p) => property.key !== p.key));
|
|
134
134
|
} },
|
|
@@ -139,7 +139,7 @@ const GroupsPropertiesSelectionModal = ({ showModal, setShowModal, selectedPrope
|
|
|
139
139
|
clearSearch();
|
|
140
140
|
}, styleType: "high-visibility" }, "Close"))),
|
|
141
141
|
react_1.default.createElement(core_1.DragOverlay, { zIndex: 9999 }, activeDragProperty ?
|
|
142
|
-
react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { content: `${activeDragProperty.displayLabel}
|
|
142
|
+
react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { content: `${activeDragProperty.displayLabel}`, title: `${activeDragProperty.actualECClassName}`, description: (0, utils_1.getLocalizedStringPresentation)(activeDragProperty.categoryLabel), action: react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless" },
|
|
143
143
|
react_1.default.createElement(itwinui_icons_react_1.SvgRemove, null)), dragHandle: react_1.default.createElement(itwinui_react_1.Icon, { className: "gmw-drag-icon", size: "large" },
|
|
144
144
|
react_1.default.createElement(itwinui_icons_react_1.SvgDragHandleVertical, null)) }) : null)));
|
|
145
145
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsPropertiesSelectionModal.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAAwD;AACxD,wDAU8B;AAC9B,+CAAyE;AACzE,oEAMoC;AACpC,wCAEuB;AACvB,gDAG2B;AAC3B,qEAAkE;AAClE,8DAAgC;AAChC,iDAA+C;AAE/C,iDAAuE;AACvE,wCAOuB;AACvB,gDAG2B;AAE3B,mEAAgE;AAUzD,MAAM,8BAA8B,GAAG,CAC5C,EACE,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACiB,EACrC,EAAE;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IAC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A8B,kCA2OzC","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 { renderToStaticMarkup } from \"react-dom/server\";\nimport {\n Button,\n Icon,\n IconButton,\n Label,\n LabeledInput,\n Modal,\n ModalButtonBar,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n DragOverlay,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { SortableHorizontalTile } from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupsPropertiesSelectionModal.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport { getLocalizedStringPresentation } from \"../../../common/utils\";\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\nimport { GroupPropertyListItem } from \"./GroupPropertyListItem\";\n\nexport interface GroupPropertiesSelectionModalProps {\n showModal: boolean;\n setShowModal: (showModal: boolean) => void;\n selectedProperties: PropertyMetaData[];\n setSelectedProperties: (selectedProperties: (selectedProperties: PropertyMetaData[]) => PropertyMetaData[]) => void;\n propertiesMetaData: PropertyMetaData[];\n}\n\nexport const GroupsPropertiesSelectionModal = (\n {\n showModal,\n setShowModal,\n selectedProperties,\n setSelectedProperties,\n propertiesMetaData,\n }: GroupPropertiesSelectionModalProps\n) => {\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties, setSelectedProperties]);\n\n const clearSearch = useCallback(() => {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n setSearched(false);\n }, []);\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\n setActiveSearchInput(searchInput);\n setSearched(true);\n }, [searchInput]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n useEffect(() => {\n if (searchInput.length === 0) {\n setSearched(false);\n clearSearch();\n }\n }, [searchInput, setSearched, clearSearch]);\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(\n <Icon className=\"gmw-gutter-drag-icon\" size=\"large\">\n <SvgMoreVerticalSmall />\n </Icon>\n );\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\n placeholder=\"Search....\"\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n }}\n svgIcon={\n searched ? (\n <IconButton onClick={clearSearch} styleType=\"borderless\" title='Clear Search'>\n <SvgClose />\n </IconButton>\n ) : (\n <IconButton onClick={startSearch} styleType=\"borderless\" title='Search'>\n <SvgSearch />\n </IconButton>\n )\n }\n />\n </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <GroupPropertyListItem\n key={property.key}\n content={`${property.displayLabel} (${property.propertyType})`}\n title={`${property.actualECClassName}`}\n description={getLocalizedStringPresentation(property.categoryLabel)}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n content={`${property.displayLabel} (${property.propertyType})`}\n title={`${property.actualECClassName}`}\n description={getLocalizedStringPresentation(property.categoryLabel)}\n action={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <GroupPropertyListItem\n content={`${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`}\n title={`${activeDragProperty.actualECClassName}`}\n description={getLocalizedStringPresentation(activeDragProperty.categoryLabel)}\n action={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={\n <Icon className=\"gmw-drag-icon\" size=\"large\">\n <SvgDragHandleVertical />\n </Icon>\n }\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupsPropertiesSelectionModal.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAAwD;AACxD,wDAU8B;AAC9B,+CAAyE;AACzE,oEAMoC;AACpC,wCAEuB;AACvB,gDAG2B;AAC3B,qEAAkE;AAClE,8DAAgC;AAChC,iDAA+C;AAE/C,iDAAuE;AACvE,wCAOuB;AACvB,gDAG2B;AAE3B,mEAAgE;AAUzD,MAAM,8BAA8B,GAAG,CAC5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OAAG,CACpB,GAET,CAAC,CAAC,CAAC,IAAI,CACC,CACH,CACd,CAAC;AACJ,CAAC,CAAC;AA3OW,QAAA,8BAA8B,kCA2OzC","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 { renderToStaticMarkup } from \"react-dom/server\";\nimport {\n Button,\n Icon,\n IconButton,\n Label,\n LabeledInput,\n Modal,\n ModalButtonBar,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n DragOverlay,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { SortableHorizontalTile } from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupsPropertiesSelectionModal.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport { getLocalizedStringPresentation } from \"../../../common/utils\";\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\nimport { GroupPropertyListItem } from \"./GroupPropertyListItem\";\n\nexport interface GroupPropertiesSelectionModalProps {\n showModal: boolean;\n setShowModal: (showModal: boolean) => void;\n selectedProperties: PropertyMetaData[];\n setSelectedProperties: (selectedProperties: (selectedProperties: PropertyMetaData[]) => PropertyMetaData[]) => void;\n propertiesMetaData: PropertyMetaData[];\n}\n\nexport const GroupsPropertiesSelectionModal = (\n {\n showModal,\n setShowModal,\n selectedProperties,\n setSelectedProperties,\n propertiesMetaData,\n }: GroupPropertiesSelectionModalProps\n) => {\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties, setSelectedProperties]);\n\n const clearSearch = useCallback(() => {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n setSearched(false);\n }, []);\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\n setActiveSearchInput(searchInput);\n setSearched(true);\n }, [searchInput]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n useEffect(() => {\n if (searchInput.length === 0) {\n setSearched(false);\n clearSearch();\n }\n }, [searchInput, setSearched, clearSearch]);\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(\n <Icon className=\"gmw-gutter-drag-icon\" size=\"large\">\n <SvgMoreVerticalSmall />\n </Icon>\n );\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\n placeholder=\"Search....\"\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n }}\n svgIcon={\n searched ? (\n <IconButton onClick={clearSearch} styleType=\"borderless\" title='Clear Search'>\n <SvgClose />\n </IconButton>\n ) : (\n <IconButton onClick={startSearch} styleType=\"borderless\" title='Search'>\n <SvgSearch />\n </IconButton>\n )\n }\n />\n </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <GroupPropertyListItem\n key={property.key}\n content={`${property.displayLabel}`}\n title={`${property.actualECClassName}`}\n description={getLocalizedStringPresentation(property.categoryLabel)}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n content={`${property.displayLabel}`}\n title={`${property.actualECClassName}`}\n description={getLocalizedStringPresentation(property.categoryLabel)}\n action={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <GroupPropertyListItem\n content={`${activeDragProperty.displayLabel}`}\n title={`${activeDragProperty.actualECClassName}`}\n description={getLocalizedStringPresentation(activeDragProperty.categoryLabel)}\n action={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={\n <Icon className=\"gmw-drag-icon\" size=\"large\">\n <SvgDragHandleVertical />\n </Icon>\n }\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n"]}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./PropertyMenu.scss";
|
|
3
|
-
import type {
|
|
3
|
+
import type { GroupMinimal, Mapping, Property } from "@itwin/insights-client";
|
|
4
|
+
/**
|
|
5
|
+
* Props for the {@link PropertyMenu} component.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
4
8
|
export interface PropertyMenuProps {
|
|
5
9
|
mapping: Mapping;
|
|
6
|
-
group:
|
|
10
|
+
group: GroupMinimal;
|
|
7
11
|
onClickAddGroupProperty?: () => void;
|
|
8
|
-
onClickModifyGroupProperty?: (groupProperty:
|
|
12
|
+
onClickModifyGroupProperty?: (groupProperty: Property) => void;
|
|
9
13
|
onClickAddCalculatedProperty?: () => void;
|
|
10
|
-
onClickModifyCalculatedProperty?: (calculatedProperty:
|
|
14
|
+
onClickModifyCalculatedProperty?: (calculatedProperty: Property) => void;
|
|
11
15
|
onClickAddCustomCalculationProperty?: () => void;
|
|
12
|
-
onClickModifyCustomCalculation?: (customCalculation:
|
|
16
|
+
onClickModifyCustomCalculation?: (customCalculation: Property) => void;
|
|
13
17
|
hideGroupProps?: boolean;
|
|
14
18
|
hideCalculatedProps?: boolean;
|
|
15
19
|
hideCustomCalculationProps?: boolean;
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Component to display the properties of a group.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
17
25
|
export declare const PropertyMenu: ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps, hideCalculatedProps, hideCustomCalculationProps, }: PropertyMenuProps) => JSX.Element;
|
|
18
26
|
//# sourceMappingURL=PropertyMenu.d.ts.map
|
|
@@ -31,30 +31,28 @@ exports.PropertyMenu = void 0;
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
require("./PropertyMenu.scss");
|
|
33
33
|
const GroupPropertyTable_1 = require("./GroupProperties/GroupPropertyTable");
|
|
34
|
-
const MappingClientContext_1 = require("../context/MappingClientContext");
|
|
35
34
|
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
36
35
|
const CalculatedPropertyTable_1 = require("./CalculatedProperties/CalculatedPropertyTable");
|
|
37
36
|
const CustomCalculationTable_1 = require("./CustomCalculations/CustomCalculationTable");
|
|
38
|
-
const
|
|
39
|
-
const useCalculatedPropertiesQuery_1 = require("./hooks/useCalculatedPropertiesQuery");
|
|
40
|
-
const useCustomCalculationsQuery_1 = require("./hooks/useCustomCalculationsQuery");
|
|
37
|
+
const usePropertiesQuery_1 = require("./hooks/usePropertiesQuery");
|
|
41
38
|
const react_query_1 = require("@tanstack/react-query");
|
|
39
|
+
const PropertiesClientContext_1 = require("../context/PropertiesClientContext");
|
|
40
|
+
/**
|
|
41
|
+
* Component to display the properties of a group.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
42
44
|
const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
|
|
43
45
|
const groupId = group.id;
|
|
44
46
|
const mappingId = mapping.id;
|
|
45
47
|
const { getAccessToken, iModelId } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
46
|
-
const
|
|
48
|
+
const propertiesClient = (0, PropertiesClientContext_1.usePropertiesClient)();
|
|
47
49
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
48
|
-
const { data: groupProperties, isFetching: isLoadingGroupProperties } = (0,
|
|
49
|
-
const
|
|
50
|
-
const { data: customCalculationProperties, isFetching: isLoadingCustomCalculations } = (0, useCustomCalculationsQuery_1.useCustomCalculationsQuery)(iModelId, mappingId, groupId, getAccessToken, mappingClient);
|
|
51
|
-
const refreshGroupProperties = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["groupProperties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
52
|
-
const refreshCalculatedProperties = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["calculatedProperties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
53
|
-
const refreshCustomCalculations = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["customCalculations", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
50
|
+
const { data: groupProperties, isFetching: isLoadingGroupProperties } = (0, usePropertiesQuery_1.usePropertiesQuery)(iModelId, mappingId, groupId, getAccessToken, propertiesClient);
|
|
51
|
+
const refreshGroupProperties = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["properties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
54
52
|
return (react_1.default.createElement("div", { className: 'gmw-property-menu-wrapper' },
|
|
55
|
-
!hideGroupProps && (react_1.default.createElement(GroupPropertyTable_1.GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties
|
|
56
|
-
!hideCalculatedProps && (react_1.default.createElement(CalculatedPropertyTable_1.CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading:
|
|
57
|
-
!hideCustomCalculationProps && (react_1.default.createElement(CustomCalculationTable_1.CustomCalculationTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCustomCalculationProperty, onClickModify: onClickModifyCustomCalculation, isLoading:
|
|
53
|
+
!hideGroupProps && (react_1.default.createElement(GroupPropertyTable_1.GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties ? groupProperties.properties : [], refresh: refreshGroupProperties })),
|
|
54
|
+
!hideCalculatedProps && (react_1.default.createElement(CalculatedPropertyTable_1.CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingGroupProperties, calculatedProperties: groupProperties ? groupProperties.properties : [], refresh: refreshGroupProperties })),
|
|
55
|
+
!hideCustomCalculationProps && (react_1.default.createElement(CustomCalculationTable_1.CustomCalculationTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCustomCalculationProperty, onClickModify: onClickModifyCustomCalculation, isLoading: isLoadingGroupProperties, customCalculations: groupProperties ? groupProperties.properties : [], refresh: refreshGroupProperties }))));
|
|
58
56
|
};
|
|
59
57
|
exports.PropertyMenu = PropertyMenu;
|
|
60
58
|
//# sourceMappingURL=PropertyMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAA2C;AAC3C,+BAA6B;AAC7B,6EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAA2C;AAC3C,+BAA6B;AAC7B,6EAA0E;AAC1E,kFAAkF;AAElF,4FAAyF;AACzF,wFAAqF;AACrF,mEAAgE;AAChE,uDAAuD;AACvD,gFAAyE;AAoBzE;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,cAAc,GAAG,KAAK,EACtB,mBAAmB,GAAG,KAAK,EAC3B,0BAA0B,GAAG,KAAK,GAChB,EAAE,EAAE;IACtB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IACnE,MAAM,gBAAgB,GAAG,IAAA,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B,IACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,mCAAmC,EAC/C,aAAa,EAAE,8BAA8B,EAC7C,SAAS,EAAE,wBAAwB,EACnC,kBAAkB,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EACrE,OAAO,EAAE,sBAAsB,GAC/B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,YAAY,gBA6DvB","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 } from \"react\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupProperties/GroupPropertyTable\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { GroupMinimal, Mapping, Property } from \"@itwin/insights-client\";\nimport { CalculatedPropertyTable } from \"./CalculatedProperties/CalculatedPropertyTable\";\nimport { CustomCalculationTable } from \"./CustomCalculations/CustomCalculationTable\";\nimport { usePropertiesQuery } from \"./hooks/usePropertiesQuery\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../context/PropertiesClientContext\";\n\n/**\n * Props for the {@link PropertyMenu} component.\n * @public\n */\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: GroupMinimal;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: Property) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: Property) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: Property) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\n/**\n * Component to display the properties of a group.\n * @public\n */\nexport const PropertyMenu = ({\n mapping,\n group,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n onClickAddCalculatedProperty,\n onClickModifyCalculatedProperty,\n onClickAddCustomCalculationProperty,\n onClickModifyCustomCalculation,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const propertiesClient = usePropertiesClient();\n const queryClient = useQueryClient();\n\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = usePropertiesQuery(iModelId, mappingId, groupId, getAccessToken, propertiesClient);\n\n const refreshGroupProperties = useCallback(async () => queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);\n\n return (\n <div className='gmw-property-menu-wrapper'>\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ? groupProperties.properties : []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCalculatedProps && (\n <CalculatedPropertyTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCalculatedProperty}\n onClickModify={onClickModifyCalculatedProperty}\n isLoading={isLoadingGroupProperties}\n calculatedProperties={groupProperties ? groupProperties.properties : []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCustomCalculationProps && (\n <CustomCalculationTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCustomCalculationProperty}\n onClickModify={onClickModifyCustomCalculation}\n isLoading={isLoadingGroupProperties}\n customCalculations={groupProperties ? groupProperties.properties : []}\n refresh={refreshGroupProperties}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PropertyMenuProps } from "./PropertyMenu";
|
|
3
3
|
import "./PropertyMenuWithVisualization.scss";
|
|
4
|
+
/**
|
|
5
|
+
* Properties for the {@link PropertyMenuWithVisualization} component.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
4
8
|
export interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {
|
|
5
9
|
color: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Component to display a property menu with visualization.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
7
15
|
export declare const PropertyMenuWithVisualization: ({ group, color, ...rest }: PropertyMenuWithVisualizationProps) => JSX.Element;
|
|
8
16
|
//# sourceMappingURL=PropertyMenuWithVisualization.d.ts.map
|
|
@@ -35,6 +35,10 @@ const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
|
35
35
|
const GroupInformationPanel_1 = require("./GroupInformationPanel");
|
|
36
36
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
37
37
|
require("./PropertyMenuWithVisualization.scss");
|
|
38
|
+
/**
|
|
39
|
+
* Component to display a property menu with visualization.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
38
42
|
const PropertyMenuWithVisualization = ({ group, color, ...rest }) => {
|
|
39
43
|
const [isInformationPanelOpen, setIsInformationPanelOpen] = (0, react_1.useState)(false);
|
|
40
44
|
return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'gmw-property-menu-vis-wrapper' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenuWithVisualization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAwC;AAExC,iDAA8C;AAC9C,yDAAsD;AACtD,wDAA2E;AAC3E,mEAAgE;AAChE,oEAA2D;AAC3D,gDAA8C;
|
|
1
|
+
{"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenuWithVisualization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAwC;AAExC,iDAA8C;AAC9C,yDAAsD;AACtD,wDAA2E;AAC3E,mEAAgE;AAChE,oEAA2D;AAC3D,gDAA8C;AAU9C;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,EAC5C,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EAC4B,EAAE,EAAE;IACvC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAErF,OAAO,CACL,8BAAC,uCAAuB,IAAC,SAAS,EAAC,+BAA+B;QAChE,uCAAK,SAAS,EAAC,+BAA+B;YAC5C,8BAAC,mCAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,MAAM,GAAG;YACrE,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAC9C,KAAK,EAAC,mBAAmB;gBAEzB,8BAAC,mCAAa,OAAG,CACN,CACT;QACN,8BAAC,2BAAY,IAAC,KAAK,EAAE,KAAK,KAAM,IAAI,GAAI;QACxC,8BAAC,6CAAqB,IACpB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACsB,CAC3B,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,6BAA6B,iCA4BxC","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, { useState } from \"react\";\nimport type { PropertyMenuProps } from \"./PropertyMenu\";\nimport { PropertyMenu } from \"./PropertyMenu\";\nimport { GroupColorToggle } from \"./GroupColorToggle\";\nimport { IconButton, InformationPanelWrapper } from \"@itwin/itwinui-react\";\nimport { GroupInformationPanel } from \"./GroupInformationPanel\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport \"./PropertyMenuWithVisualization.scss\";\n\n/**\n * Properties for the {@link PropertyMenuWithVisualization} component.\n * @public\n */\nexport interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {\n color: string;\n}\n\n/**\n * Component to display a property menu with visualization.\n * @public\n */\nexport const PropertyMenuWithVisualization = ({\n group,\n color,\n ...rest\n}: PropertyMenuWithVisualizationProps) => {\n const [isInformationPanelOpen, setIsInformationPanelOpen] = useState<boolean>(false);\n\n return (\n <InformationPanelWrapper className='gmw-property-menu-vis-wrapper'>\n <div className=\"gmw-property-menu-vis-toolbar\">\n <GroupColorToggle group={group} color={color} labelPosition=\"left\" />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n title='Group Information'\n >\n <SvgProperties />\n </IconButton>\n </div>\n <PropertyMenu group={group} {...rest} />\n <GroupInformationPanel\n isOpen={isInformationPanelOpen}\n onClose={() => setIsInformationPanelOpen(false)}\n query={group.query}\n groupName={group.groupName}\n />\n </InformationPanelWrapper>\n );\n};\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { PropertyMap } from "../../../formula/Types";
|
|
1
|
+
import type { DataType, PropertyMap } from "../../../formula/Types";
|
|
2
2
|
export declare function useFormulaValidation(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void): {
|
|
3
3
|
isValid: boolean;
|
|
4
|
+
inferredDataType: DataType | undefined;
|
|
4
5
|
forceValidation: () => boolean;
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=useFormulaValidation.d.ts.map
|
|
@@ -8,22 +8,26 @@ exports.useFormulaValidation = void 0;
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const FormulaDataTypeResolver_1 = require("../../../formula/FormulaDataTypeResolver");
|
|
10
10
|
const utils_1 = require("../../../common/utils");
|
|
11
|
-
function validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid) {
|
|
11
|
+
function validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) {
|
|
12
12
|
if (!formula) {
|
|
13
13
|
setFormulaErrorMessage("");
|
|
14
14
|
setIsValid(false);
|
|
15
|
+
setDataType(undefined);
|
|
15
16
|
return false;
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const resolveFormulaType = (0, FormulaDataTypeResolver_1.resolveFormulaDataType)(formulaName, formula, properties);
|
|
19
|
+
const error = resolveFormulaType.errorMessage ?? "";
|
|
18
20
|
setFormulaErrorMessage(error);
|
|
19
21
|
setIsValid(!error);
|
|
22
|
+
setDataType(resolveFormulaType.value);
|
|
20
23
|
return !error;
|
|
21
24
|
}
|
|
22
25
|
const debouncedValidationFunc = (0, utils_1.debounce)(validate, 5000);
|
|
23
26
|
function useFormulaValidation(formulaName, formula, properties, setFormulaErrorMessage) {
|
|
24
27
|
const [isValid, setIsValid] = (0, react_1.useState)(false);
|
|
25
|
-
(0, react_1.
|
|
26
|
-
|
|
28
|
+
const [inferredDataType, setDataType] = (0, react_1.useState)(undefined);
|
|
29
|
+
(0, react_1.useEffect)(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType), [formulaName, formula, properties, setFormulaErrorMessage]);
|
|
30
|
+
return { isValid, inferredDataType, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) };
|
|
27
31
|
}
|
|
28
32
|
exports.useFormulaValidation = useFormulaValidation;
|
|
29
33
|
//# sourceMappingURL=useFormulaValidation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormulaValidation.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFormulaValidation.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,iCAA4C;AAC5C,sFAAkF;AAElF,iDAAiD;AAEjD,SAAS,QAAQ,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C,EAAE,UAAgC;
|
|
1
|
+
{"version":3,"file":"useFormulaValidation.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFormulaValidation.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,iCAA4C;AAC5C,sFAAkF;AAElF,iDAAiD;AAEjD,SAAS,QAAQ,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C,EAAE,UAAgC,EAAE,WAA6D;IAC3N,IAAI,CAAC,OAAO,EAAE;QACZ,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,WAAW,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,kBAAkB,GAAG,IAAA,gDAAsB,EAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,kBAAkB,CAAC,YAAY,IAAI,EAAE,CAAC;IACpD,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9B,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC;IACnB,WAAW,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,MAAM,uBAAuB,GAAG,IAAA,gBAAQ,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAEzD,SAAgB,oBAAoB,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C;IAC7I,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAuB,SAAS,CAAC,CAAC;IAClF,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;IACxL,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC;AAC3J,CAAC;AALD,oDAKC","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 { useEffect, useState } from \"react\";\nimport { resolveFormulaDataType } from \"../../../formula/FormulaDataTypeResolver\";\nimport type { DataType, PropertyMap } from \"../../../formula/Types\";\nimport { debounce } from \"../../../common/utils\";\n\nfunction validate(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void, setIsValid: (b: boolean) => void, setDataType: (inferredDataType: DataType | undefined) => void ): boolean {\n if (!formula) {\n setFormulaErrorMessage(\"\");\n setIsValid(false);\n setDataType(undefined);\n return false;\n }\n\n const resolveFormulaType = resolveFormulaDataType(formulaName, formula, properties);\n const error = resolveFormulaType.errorMessage ?? \"\";\n setFormulaErrorMessage(error);\n setIsValid(!error);\n setDataType(resolveFormulaType.value);\n return !error;\n}\n\nconst debouncedValidationFunc = debounce(validate, 5000);\n\nexport function useFormulaValidation(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void) {\n const [isValid, setIsValid] = useState(false);\n const [inferredDataType, setDataType] = useState<DataType | undefined>(undefined);\n useEffect(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType), [formulaName, formula, properties, setFormulaErrorMessage]);\n return { isValid, inferredDataType, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) };\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IPropertiesClient } from "@itwin/insights-client";
|
|
2
|
+
import type { GetAccessTokenFn } from "../../context/GroupingApiConfigContext";
|
|
3
|
+
export declare const usePropertiesQuery: (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, propertiesClient: IPropertiesClient) => import("@tanstack/react-query").UseQueryResult<import("@itwin/insights-client").PropertyList, unknown>;
|
|
4
|
+
//# sourceMappingURL=usePropertiesQuery.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePropertiesQuery = void 0;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const usePropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, propertiesClient) => {
|
|
6
|
+
return (0, react_query_1.useQuery)({
|
|
7
|
+
queryKey: ["properties", iModelId, mappingId, groupId],
|
|
8
|
+
queryFn: async () => propertiesClient.getProperties(await getAccessToken(), mappingId, groupId),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.usePropertiesQuery = usePropertiesQuery;
|
|
12
|
+
//# sourceMappingURL=usePropertiesQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/usePropertiesQuery.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAG1C,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,gBAAmC,EAAE,EAAE;IAChK,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QACtD,OAAO,EAAG,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,MAAM,cAAc,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC;KACjG,CAAC,CAAC;AACL,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IPropertiesClient } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\n\nexport const usePropertiesQuery = (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, propertiesClient: IPropertiesClient) => {\n return useQuery({\n queryKey: [\"properties\", iModelId, mappingId, groupId],\n queryFn: async () => propertiesClient.getProperties(await getAccessToken(), mappingId, groupId),\n });\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useExtractionClient = exports.ExtractionClientContext = exports.createExtractionClient = exports.createDefaultExtractionClient = void 0;
|
|
4
|
-
const insights_client_1 = require("@itwin/insights-client");
|
|
5
4
|
const react_1 = require("react");
|
|
5
|
+
const insights_client_1 = require("@itwin/insights-client");
|
|
6
6
|
const prefixUrl = (baseUrl, prefix) => {
|
|
7
7
|
if (prefix && baseUrl) {
|
|
8
8
|
return baseUrl.replace("api.bentley.com", `${prefix}-api.bentley.com`);
|
|
@@ -10,8 +10,8 @@ const prefixUrl = (baseUrl, prefix) => {
|
|
|
10
10
|
return baseUrl;
|
|
11
11
|
};
|
|
12
12
|
const createDefaultExtractionClient = (prefix) => {
|
|
13
|
-
const url = prefixUrl(insights_client_1.
|
|
14
|
-
return new insights_client_1.ExtractionClient(url);
|
|
13
|
+
const url = prefixUrl(insights_client_1.GROUPING_AND_MAPPING_BASE_PATH, prefix);
|
|
14
|
+
return new insights_client_1.ExtractionClient(undefined, url);
|
|
15
15
|
};
|
|
16
16
|
exports.createDefaultExtractionClient = createDefaultExtractionClient;
|
|
17
17
|
const createExtractionClient = (clientProp) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractionClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/ExtractionClientContext.ts"],"names":[],"mappings":";;;AAKA,
|
|
1
|
+
{"version":3,"file":"ExtractionClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/ExtractionClientContext.ts"],"names":[],"mappings":";;;AAKA,iCAAkD;AAClD,4DAA0F;AAG1F,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEK,MAAM,6BAA6B,GAAG,CAAC,MAAqB,EAAqB,EAAE;IACxF,MAAM,GAAG,GAAG,SAAS,CAAC,gDAA8B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAI,kCAAgB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAHW,QAAA,6BAA6B,iCAGxC;AAEK,MAAM,sBAAsB,GAAG,CAAC,UAA4C,EAAE,EAAE;IACrF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,IAAA,qCAA6B,EAAC,UAA0B,CAAC,CAAC;KAClE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AALW,QAAA,sBAAsB,0BAKjC;AAEW,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAAoB,IAAA,qCAA6B,GAAE,CAAC,CAAC;AAElG,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IExtractionClient } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH } from \"@itwin/insights-client\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\nexport const createDefaultExtractionClient = (prefix?: ClientPrefix): IExtractionClient => {\n const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);\n return new ExtractionClient(undefined, url);\n};\n\nexport const createExtractionClient = (clientProp: IExtractionClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultExtractionClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\nexport const ExtractionClientContext = createContext<IExtractionClient>(createDefaultExtractionClient());\n\nexport const useExtractionClient = () => {\n const context = useContext(ExtractionClientContext);\n if (!context) {\n throw new Error(\n \"useExtractionClient should be used within a ExtractionClientContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
2
|
import type { IModelConnection } from "@itwin/core-frontend";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export declare type ClientPrefix = "" | "dev" | "qa" | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
5
11
|
export declare type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
6
15
|
export interface GroupingMappingApiConfig {
|
|
7
16
|
getAccessToken: GetAccessTokenFn;
|
|
8
17
|
iModelId: string;
|
|
9
18
|
iModelConnection?: IModelConnection;
|
|
10
19
|
prefix?: ClientPrefix;
|
|
11
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
12
24
|
export declare const GroupingMappingApiConfigContext: React.Context<GroupingMappingApiConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Hook to access the GroupingMappingApiConfig from the context.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
13
29
|
export declare const useGroupingMappingApiConfig: () => GroupingMappingApiConfig;
|
|
14
30
|
//# sourceMappingURL=GroupingApiConfigContext.d.ts.map
|
|
@@ -26,12 +26,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.useGroupingMappingApiConfig = exports.GroupingMappingApiConfigContext = void 0;
|
|
27
27
|
const React = __importStar(require("react"));
|
|
28
28
|
const react_1 = require("react");
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
29
32
|
exports.GroupingMappingApiConfigContext = (0, react_1.createContext)({
|
|
30
33
|
getAccessToken: async () => "",
|
|
31
34
|
iModelId: "",
|
|
32
35
|
prefix: undefined,
|
|
33
36
|
iModelConnection: undefined,
|
|
34
37
|
});
|
|
38
|
+
/**
|
|
39
|
+
* Hook to access the GroupingMappingApiConfig from the context.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
35
42
|
const useGroupingMappingApiConfig = () => {
|
|
36
43
|
const context = React.useContext(exports.GroupingMappingApiConfigContext);
|
|
37
44
|
if (!context) {
|