@itwin/grouping-mapping-widget 0.11.1 → 0.13.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/grouping-mapping-widget.d.ts +4 -1
- package/lib/cjs/grouping-mapping-widget.js +7 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +7 -9
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +49 -24
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +9 -16
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +29 -31
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.scss +9 -0
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationAction.d.ts +6 -9
- package/lib/cjs/widget/components/CustomCalculationAction.js +79 -9
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationTable.d.ts +8 -16
- package/lib/cjs/widget/components/CustomCalculationTable.js +22 -29
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
- package/lib/cjs/widget/components/DeleteModal.js +9 -13
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.js +51 -66
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.scss +0 -18
- package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
- package/lib/cjs/widget/components/GroupDetails.js +34 -0
- package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
- package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
- package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
- package/lib/cjs/widget/components/GroupInformationPanel.d.ts +10 -0
- package/lib/cjs/widget/components/GroupInformationPanel.js +23 -0
- package/lib/cjs/widget/components/GroupInformationPanel.js.map +1 -0
- package/lib/cjs/widget/components/GroupInformationPanel.scss +13 -0
- package/lib/cjs/widget/components/GroupPropertyAction.d.ts +6 -9
- package/lib/cjs/widget/components/GroupPropertyAction.js +26 -15
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyTable.d.ts +8 -15
- package/lib/cjs/widget/components/GroupPropertyTable.js +23 -28
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.d.ts +2 -1
- package/lib/cjs/widget/components/Grouping.js +13 -17
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +2 -9
- package/lib/cjs/widget/components/GroupingMapping.js +1 -2
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js +8 -4
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js +17 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
- package/lib/cjs/widget/components/GroupingMappingHeader.js +10 -3
- package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingRouter.js +23 -2
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/widget/components/GroupsAddButton.d.ts +9 -0
- package/lib/cjs/widget/components/GroupsAddButton.js +17 -0
- package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -0
- package/lib/cjs/widget/components/GroupsAddButton.scss +7 -0
- package/lib/cjs/widget/components/Mapping.js +7 -14
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.js +1 -1
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
- package/lib/cjs/widget/components/PropertyAction.js +100 -0
- package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
- package/lib/cjs/widget/components/PropertyAction.scss +9 -0
- package/lib/cjs/widget/components/PropertyMenu.d.ts +12 -17
- package/lib/cjs/widget/components/PropertyMenu.js +52 -155
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.scss +4 -28
- package/lib/cjs/widget/components/PropertyNameCell.d.ts +11 -0
- package/lib/cjs/widget/components/PropertyNameCell.js +15 -0
- package/lib/cjs/widget/components/PropertyNameCell.js.map +1 -0
- package/lib/cjs/widget/components/PropertyTable.d.ts +18 -0
- package/lib/cjs/widget/components/PropertyTable.js +54 -0
- package/lib/cjs/widget/components/PropertyTable.js.map +1 -0
- package/lib/cjs/widget/components/PropertyTable.scss +11 -0
- package/lib/cjs/widget/components/PropertyTableToolbar.d.ts +10 -0
- package/lib/cjs/widget/components/PropertyTableToolbar.js +23 -0
- package/lib/cjs/widget/components/PropertyTableToolbar.js.map +1 -0
- package/lib/cjs/widget/components/PropertyTableToolbar.scss +12 -0
- package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
- package/lib/cjs/widget/components/QueryBuilder.js +4 -4
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
- package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
- package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
- package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +11 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js +27 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
- package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
- package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
- package/lib/cjs/widget/components/SelectMappings.js +1 -1
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
- package/lib/cjs/widget/components/StatusIcon.js +26 -0
- package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
- package/lib/cjs/widget/components/StatusIcon.scss +26 -0
- package/lib/cjs/widget/components/ToggleGroupVisibility.d.ts +9 -0
- package/lib/cjs/widget/components/ToggleGroupVisibility.js +16 -0
- package/lib/cjs/widget/components/ToggleGroupVisibility.js.map +1 -0
- package/lib/cjs/widget/components/ToggleGroupVisibility.scss +9 -0
- package/lib/cjs/widget/components/WidgetHeader.d.ts +9 -0
- package/lib/cjs/widget/components/WidgetHeader.js +22 -0
- package/lib/cjs/widget/components/WidgetHeader.js.map +1 -0
- package/lib/cjs/widget/components/WidgetHeader.scss +36 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/widget/components/context/PropertiesContext.d.ts +15 -0
- package/lib/cjs/widget/components/context/PropertiesContext.js +43 -0
- package/lib/cjs/widget/components/context/PropertiesContext.js.map +1 -0
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
- package/lib/cjs/widget/components/groupsHelpers.d.ts +6 -3
- package/lib/cjs/widget/components/groupsHelpers.js +43 -40
- package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -7
- package/lib/cjs/widget/components/utils.js +1 -9
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +0 -29
- package/lib/cjs/widget/components/viewerUtils.d.ts +4 -2
- package/lib/cjs/widget/components/viewerUtils.js +4 -22
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
- package/lib/cjs/widget/hooks/useFetchData.d.ts +3 -5
- package/lib/cjs/widget/hooks/useFetchData.js +9 -7
- package/lib/cjs/widget/hooks/useFetchData.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +4 -1
- package/lib/esm/grouping-mapping-widget.js +3 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +1 -1
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +7 -9
- package/lib/esm/widget/components/CalculatedPropertyAction.js +50 -27
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +9 -16
- package/lib/esm/widget/components/CalculatedPropertyTable.js +30 -31
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.scss +9 -0
- package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationAction.d.ts +6 -9
- package/lib/esm/widget/components/CustomCalculationAction.js +79 -11
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationTable.d.ts +8 -16
- package/lib/esm/widget/components/CustomCalculationTable.js +23 -29
- package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
- package/lib/esm/widget/components/DeleteModal.js +9 -13
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.js +54 -69
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.scss +0 -18
- package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
- package/lib/esm/widget/components/GroupDetails.js +27 -0
- package/lib/esm/widget/components/GroupDetails.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
- package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
- package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
- package/lib/esm/widget/components/GroupInformationPanel.d.ts +10 -0
- package/lib/esm/widget/components/GroupInformationPanel.js +16 -0
- package/lib/esm/widget/components/GroupInformationPanel.js.map +1 -0
- package/lib/esm/widget/components/GroupInformationPanel.scss +13 -0
- package/lib/esm/widget/components/GroupPropertyAction.d.ts +6 -9
- package/lib/esm/widget/components/GroupPropertyAction.js +25 -15
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyTable.d.ts +8 -15
- package/lib/esm/widget/components/GroupPropertyTable.js +24 -28
- package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/Grouping.d.ts +2 -1
- package/lib/esm/widget/components/Grouping.js +15 -19
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +2 -9
- package/lib/esm/widget/components/GroupingMapping.js +1 -2
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.js +9 -5
- package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContext.js +17 -1
- package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
- package/lib/esm/widget/components/GroupingMappingHeader.js +10 -3
- package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingRouter.js +23 -2
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/widget/components/GroupsAddButton.d.ts +9 -0
- package/lib/esm/widget/components/GroupsAddButton.js +10 -0
- package/lib/esm/widget/components/GroupsAddButton.js.map +1 -0
- package/lib/esm/widget/components/GroupsAddButton.scss +7 -0
- package/lib/esm/widget/components/Mapping.js +7 -14
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.js +1 -1
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
- package/lib/esm/widget/components/PropertyAction.js +77 -0
- package/lib/esm/widget/components/PropertyAction.js.map +1 -0
- package/lib/esm/widget/components/PropertyAction.scss +9 -0
- package/lib/esm/widget/components/PropertyMenu.d.ts +12 -17
- package/lib/esm/widget/components/PropertyMenu.js +54 -154
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/PropertyMenu.scss +4 -28
- package/lib/esm/widget/components/PropertyNameCell.d.ts +11 -0
- package/lib/esm/widget/components/PropertyNameCell.js +8 -0
- package/lib/esm/widget/components/PropertyNameCell.js.map +1 -0
- package/lib/esm/widget/components/PropertyTable.d.ts +18 -0
- package/lib/esm/widget/components/PropertyTable.js +28 -0
- package/lib/esm/widget/components/PropertyTable.js.map +1 -0
- package/lib/esm/widget/components/PropertyTable.scss +11 -0
- package/lib/esm/widget/components/PropertyTableToolbar.d.ts +10 -0
- package/lib/esm/widget/components/PropertyTableToolbar.js +16 -0
- package/lib/esm/widget/components/PropertyTableToolbar.js.map +1 -0
- package/lib/esm/widget/components/PropertyTableToolbar.scss +12 -0
- package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
- package/lib/esm/widget/components/QueryBuilder.js +4 -4
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
- package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
- package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
- package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +11 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.js +20 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
- package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
- package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
- package/lib/esm/widget/components/SelectMappings.js +1 -1
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
- package/lib/esm/widget/components/StatusIcon.js +19 -0
- package/lib/esm/widget/components/StatusIcon.js.map +1 -0
- package/lib/esm/widget/components/StatusIcon.scss +26 -0
- package/lib/esm/widget/components/ToggleGroupVisibility.d.ts +9 -0
- package/lib/esm/widget/components/ToggleGroupVisibility.js +9 -0
- package/lib/esm/widget/components/ToggleGroupVisibility.js.map +1 -0
- package/lib/esm/widget/components/ToggleGroupVisibility.scss +9 -0
- package/lib/esm/widget/components/WidgetHeader.d.ts +9 -0
- package/lib/esm/widget/components/WidgetHeader.js +15 -0
- package/lib/esm/widget/components/WidgetHeader.js.map +1 -0
- package/lib/esm/widget/components/WidgetHeader.scss +36 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/widget/components/context/PropertiesContext.d.ts +15 -0
- package/lib/esm/widget/components/context/PropertiesContext.js +20 -0
- package/lib/esm/widget/components/context/PropertiesContext.js.map +1 -0
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
- package/lib/esm/widget/components/groupsHelpers.d.ts +6 -3
- package/lib/esm/widget/components/groupsHelpers.js +41 -40
- package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -7
- package/lib/esm/widget/components/utils.js +0 -7
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +0 -29
- package/lib/esm/widget/components/viewerUtils.d.ts +4 -2
- package/lib/esm/widget/components/viewerUtils.js +3 -20
- package/lib/esm/widget/components/viewerUtils.js.map +1 -1
- package/lib/esm/widget/hooks/useFetchData.d.ts +3 -5
- package/lib/esm/widget/hooks/useFetchData.js +9 -7
- package/lib/esm/widget/hooks/useFetchData.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
- package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
- package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
- package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
- package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
- package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
- package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
- package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
- package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
- package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
- package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
- package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
- package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
- package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
- package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
- package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
- package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.usePropertiesContext = exports.PropertiesContext = void 0;
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
exports.PropertiesContext = React.createContext({
|
|
29
|
+
showGroupColor: false,
|
|
30
|
+
setGroupProperties: () => { },
|
|
31
|
+
setCalculatedProperties: () => { },
|
|
32
|
+
setCustomCalculationProperties: () => { },
|
|
33
|
+
setShowGroupColor: () => { },
|
|
34
|
+
});
|
|
35
|
+
const usePropertiesContext = () => {
|
|
36
|
+
const context = React.useContext(exports.PropertiesContext);
|
|
37
|
+
if (!context) {
|
|
38
|
+
throw new Error("usePropertiesContext should be used within a PropertiesContext provider");
|
|
39
|
+
}
|
|
40
|
+
return context;
|
|
41
|
+
};
|
|
42
|
+
exports.usePropertiesContext = usePropertiesContext;
|
|
43
|
+
//# sourceMappingURL=PropertiesContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertiesContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/PropertiesContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAclB,QAAA,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAa;IAC/D,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC;IAClC,8BAA8B,EAAE,GAAG,EAAE,GAAG,CAAC;IACzC,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEI,MAAM,oBAAoB,GAAG,GAAe,EAAE;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAiB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,oBAAoB,wBAQ/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { CalculatedProperty, CustomCalculation, GroupProperty } from \"@itwin/insights-client\";\n\nexport interface Properties {\n showGroupColor: boolean;\n groupProperties?: GroupProperty[];\n calculatedProperties?: CalculatedProperty[];\n customCalculationProperties?: CustomCalculation[];\n setGroupProperties: (groupProperties: GroupProperty[]) => void;\n setCalculatedProperties: (calculatedProperties: CalculatedProperty[]) => void;\n setCustomCalculationProperties: (customCalculationProperties: CustomCalculation[]) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const PropertiesContext = React.createContext<Properties>({\n showGroupColor: false,\n setGroupProperties: () => { },\n setCalculatedProperties: () => { },\n setCustomCalculationProperties: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const usePropertiesContext = (): Properties => {\n const context = React.useContext(PropertiesContext);\n if (!context) {\n throw new Error(\n \"usePropertiesContext should be used within a PropertiesContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -3,12 +3,10 @@ import type { PropertyRecord } from "@itwin/appui-abstract";
|
|
|
3
3
|
import type { QueryBuilder } from "../QueryBuilder";
|
|
4
4
|
export interface PropertySelection {
|
|
5
5
|
currentPropertyList: PropertyRecord[];
|
|
6
|
-
setCurrentPropertyList: (value: PropertyRecord[]) => void;
|
|
6
|
+
setCurrentPropertyList: (value: PropertyRecord[] | ((value: PropertyRecord[]) => PropertyRecord[])) => void;
|
|
7
7
|
setQuery: (value: string) => void;
|
|
8
8
|
queryBuilder?: QueryBuilder;
|
|
9
|
-
setQueryBuilder: (value: QueryBuilder | undefined) => void;
|
|
10
9
|
isUpdating: boolean;
|
|
11
|
-
resetView: () => Promise<void>;
|
|
12
10
|
}
|
|
13
11
|
export declare const PropertyGridWrapperContext: React.Context<PropertySelection>;
|
|
14
12
|
export declare const usePropertyGridWrapper: () => PropertySelection;
|
|
@@ -29,9 +29,7 @@ exports.PropertyGridWrapperContext = React.createContext({
|
|
|
29
29
|
currentPropertyList: [],
|
|
30
30
|
setCurrentPropertyList: () => [],
|
|
31
31
|
setQuery: () => "",
|
|
32
|
-
setQueryBuilder: () => undefined,
|
|
33
32
|
isUpdating: false,
|
|
34
|
-
resetView: async () => { },
|
|
35
33
|
});
|
|
36
34
|
const usePropertyGridWrapper = () => {
|
|
37
35
|
const context = React.useContext(exports.PropertyGridWrapperContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGridWrapperContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/PropertyGridWrapperContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;
|
|
1
|
+
{"version":3,"file":"PropertyGridWrapperContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/PropertyGridWrapperContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAYlB,QAAA,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAoB;IAC/E,mBAAmB,EAAE,EAAE;IACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,EAAE;IAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,UAAU,EAAE,KAAK;CAClB,CAAC,CAAC;AAEI,MAAM,sBAAsB,GAAG,GAAsB,EAAE;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,kCAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC","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 * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { QueryBuilder } from \"../QueryBuilder\";\n\nexport interface PropertySelection {\n currentPropertyList: PropertyRecord[];\n setCurrentPropertyList: (value: PropertyRecord[] | ((value: PropertyRecord[]) => PropertyRecord[])) => void;\n setQuery: (value: string) => void;\n queryBuilder?: QueryBuilder;\n isUpdating: boolean;\n}\n\nexport const PropertyGridWrapperContext = React.createContext<PropertySelection>({\n currentPropertyList: [],\n setCurrentPropertyList: () => [],\n setQuery: () => \"\",\n isUpdating: false,\n});\n\nexport const usePropertyGridWrapper = (): PropertySelection => {\n const context = React.useContext(PropertyGridWrapperContext);\n if (!context) {\n throw new Error(\n \"usePropertyGridWrapperContext should be used within a PropertyGridWrapperContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./GroupQueryBuilderCustomUI.scss";
|
|
3
3
|
import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
|
|
4
|
-
export declare const GroupQueryBuilderCustomUI: ({ isUpdating, resetView,
|
|
4
|
+
export declare const GroupQueryBuilderCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
|
|
5
5
|
//# sourceMappingURL=GroupQueryBuilderCustomUI.d.ts.map
|
|
@@ -28,55 +28,74 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
const appui_react_1 = require("@itwin/appui-react");
|
|
29
29
|
const presentation_frontend_1 = require("@itwin/presentation-frontend");
|
|
30
30
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
31
|
-
|
|
31
|
+
require("./GroupQueryBuilderCustomUI.scss");
|
|
32
|
+
const QueryBuilder_1 = require("../QueryBuilder");
|
|
33
|
+
const presentation_components_1 = require("@itwin/presentation-components");
|
|
34
|
+
const components_react_1 = require("@itwin/components-react");
|
|
35
|
+
const core_react_1 = require("@itwin/core-react");
|
|
32
36
|
const PropertyGridWrapperContext_1 = require("../context/PropertyGridWrapperContext");
|
|
37
|
+
const PropertyAction_1 = require("../PropertyAction");
|
|
33
38
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
-
|
|
35
|
-
const
|
|
39
|
+
const createPropertyDataProvider = (keys, iModelConnection) => {
|
|
40
|
+
const dataProvider = new presentation_components_1.PresentationPropertyDataProvider({
|
|
41
|
+
imodel: iModelConnection,
|
|
42
|
+
ruleset: presentation_components_1.DEFAULT_PROPERTY_GRID_RULESET,
|
|
43
|
+
});
|
|
44
|
+
dataProvider.keys = keys;
|
|
45
|
+
dataProvider.isNestedPropertyCategoryGroupingEnabled = true;
|
|
46
|
+
return dataProvider;
|
|
47
|
+
};
|
|
48
|
+
const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
|
|
36
49
|
const iModelConnection = appui_react_1.useActiveIModelConnection();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
if (!iModelConnection) {
|
|
51
|
+
throw new Error("This component requires an active iModelConnection.");
|
|
52
|
+
}
|
|
53
|
+
const [size, setSize] = react_1.useState({ width: 0, height: 0 });
|
|
54
|
+
const [dataProvider, setDataProvider] = react_1.useState(undefined);
|
|
40
55
|
const [currentPropertyList, setCurrentPropertyList] = react_1.useState([]);
|
|
56
|
+
const [selectionKeySet, setSelectionKeyset] = react_1.useState(new presentation_common_1.KeySet());
|
|
57
|
+
const [queryBuilder, setQueryBuilder] = react_1.useState();
|
|
41
58
|
react_1.useEffect(() => {
|
|
42
|
-
|
|
43
|
-
throw new Error("This component requires an active iModelConnection.");
|
|
44
|
-
}
|
|
45
|
-
}, [iModelConnection]);
|
|
46
|
-
react_1.useEffect(() => {
|
|
47
|
-
const _onSelectionChanged = async (evt, selectionProvider) => {
|
|
48
|
-
setSelected(true);
|
|
49
|
-
setCurrentPropertyList([]);
|
|
59
|
+
const onSelectionChanged = async (evt, selectionProvider) => {
|
|
50
60
|
const selection = selectionProvider.getSelection(evt.imodel, evt.level);
|
|
51
61
|
const keys = new presentation_common_1.KeySet(selection);
|
|
52
|
-
|
|
62
|
+
setSelectionKeyset(keys);
|
|
63
|
+
const dataProvider = createPropertyDataProvider(keys, iModelConnection);
|
|
64
|
+
setDataProvider(dataProvider);
|
|
65
|
+
setQueryBuilder(new QueryBuilder_1.QueryBuilder(dataProvider));
|
|
53
66
|
};
|
|
54
67
|
return iModelConnection
|
|
55
|
-
? presentation_frontend_1.Presentation.selection.selectionChange.addListener(
|
|
56
|
-
() => { };
|
|
68
|
+
? presentation_frontend_1.Presentation.selection.selectionChange.addListener(onSelectionChanged)
|
|
69
|
+
: () => { };
|
|
57
70
|
}, [iModelConnection]);
|
|
58
|
-
const
|
|
71
|
+
const onClickResetButton = async () => {
|
|
72
|
+
queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.resetQueryBuilder();
|
|
59
73
|
updateQuery("");
|
|
60
|
-
queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.resetQuery();
|
|
61
74
|
setCurrentPropertyList([]);
|
|
62
75
|
if (resetView)
|
|
63
76
|
await resetView().catch((e) =>
|
|
64
77
|
/* eslint-disable no-console */
|
|
65
78
|
console.error(e));
|
|
66
79
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
const resize = react_1.useCallback((width, height) => setSize({ width, height }), []);
|
|
81
|
+
const propertyContextValues = react_1.useMemo(() => ({
|
|
82
|
+
currentPropertyList,
|
|
83
|
+
setCurrentPropertyList,
|
|
84
|
+
queryBuilder,
|
|
85
|
+
setQuery: updateQuery,
|
|
86
|
+
isUpdating: isUpdating !== null && isUpdating !== void 0 ? isUpdating : false,
|
|
87
|
+
}), [currentPropertyList, isUpdating, queryBuilder, updateQuery]);
|
|
88
|
+
const actionButtonRenderers = react_1.useMemo(() => [
|
|
89
|
+
({ property }) => (react_1.default.createElement(PropertyAction_1.PropertyAction, { property: property })),
|
|
90
|
+
], []);
|
|
91
|
+
return (react_1.default.createElement("div", { className: "gmw-select-query-generator-container" }, !dataProvider || selectionKeySet.size === 0 ? (react_1.default.createElement(itwinui_react_1.Alert, { type: 'informational' }, "Please select on an element within the viewer first, then select properties to generate a group query.")) :
|
|
92
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
93
|
+
react_1.default.createElement("div", { className: "gmw-select-property-grid-container" },
|
|
94
|
+
react_1.default.createElement(core_react_1.ResizableContainerObserver, { onResize: resize }),
|
|
95
|
+
react_1.default.createElement(PropertyGridWrapperContext_1.PropertyGridWrapperContext.Provider, { value: propertyContextValues },
|
|
96
|
+
react_1.default.createElement(components_react_1.VirtualizedPropertyGridWithDataProvider, { dataProvider: dataProvider, width: size.width, height: size.height, actionButtonRenderers: actionButtonRenderers }))),
|
|
97
|
+
react_1.default.createElement("div", { className: "gmw-select-reset-button" },
|
|
98
|
+
react_1.default.createElement(itwinui_react_1.Button, { styleType: "default", size: "small", onClick: onClickResetButton }, "Reset")))));
|
|
80
99
|
};
|
|
81
100
|
exports.GroupQueryBuilderCustomUI = GroupQueryBuilderCustomUI;
|
|
82
101
|
//# sourceMappingURL=GroupQueryBuilderCustomUI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+
|
|
1
|
+
{"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAyE;AACzE,oDAA+D;AAC/D,wEAA4D;AAK5D,oEAAoD;AACpD,4CAA0C;AAC1C,kDAA+C;AAE/C,4EAGwC;AAGxC,8DAAkF;AAClF,kDAA+D;AAE/D,sFAAmF;AACnF,sDAAmD;AACnD,wDAAqD;AAErD,MAAM,0BAA0B,GAAG,CACjC,IAAY,EACZ,gBAAkC,EACA,EAAE;IACpC,MAAM,YAAY,GAAG,IAAI,0DAAgC,CAAC;QACxD,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,uDAA6B;KACvC,CAAC,CAAC;IACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,uCAAuC,GAAG,IAAI,CAAC;IAC5D,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAOK,MAAM,yBAAyB,GAAG,CAAC,EACxC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,gBAAgB,GAAG,uCAAyB,EAAE,CAAC;IACrD,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM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AI;gBAChD,8BAAC,uDAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,qBAAqB;oBAC/D,8BAAC,0DAAuC,IACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,qBAAqB,EAAE,qBAAqB,GAC5C,CACkC,CAClC;YACN,uCAAK,SAAS,EAAC,yBAAyB;gBACtC,8BAAC,sBAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,kBAAkB,YAGpB,CACL,CACL,CAED,CACP,CAAC;AACJ,CAAC,CAAC;AAnGW,QAAA,yBAAyB,6BAmGpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport {\n DEFAULT_PROPERTY_GRID_RULESET,\n PresentationPropertyDataProvider,\n} from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\n\nconst createPropertyDataProvider = (\n keys: KeySet,\n iModelConnection: IModelConnection\n): PresentationPropertyDataProvider => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\nexport const GroupQueryBuilderCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const iModelConnection = useActiveIModelConnection();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] =\n useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider));\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(onSelectionChanged)\n : () => { };\n }, [iModelConnection]);\n\n const onClickResetButton = async () => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery]\n );\n\n const actionButtonRenderers = useMemo(\n () => [\n ({ property }: ActionButtonRendererProps) => (\n <PropertyAction property={property} />\n ),\n ],\n []\n );\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type='informational'>\n Please select on an element within the viewer first, then select properties to generate a group query.\n </Alert>\n ) :\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button\n styleType=\"default\"\n size=\"small\"\n onClick={onClickResetButton}\n >\n Reset\n </Button>\n </div>\n </>\n }\n </div>\n );\n};\n\n"]}
|
|
@@ -2,23 +2,31 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import
|
|
5
|
+
@import "~@itwin/itwinui-css/scss/variables";
|
|
6
6
|
|
|
7
|
-
.gmw-
|
|
8
|
-
color: var(--buic-foreground-body);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.gmw-button-container {
|
|
12
|
-
text-align: right;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.gmw-reset-button {
|
|
16
|
-
margin-left: 10px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.gmw-select-element-hint {
|
|
7
|
+
.gmw-select-query-generator-container {
|
|
20
8
|
display: flex;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
flex-grow: 1;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
min-height: 0;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
.gmw-select-element-hint {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
}
|
|
19
|
+
.gmw-select-property-grid-container {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex: 1 1;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
min-height: 0;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
.gmw-select-reset-button {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: right;
|
|
30
|
+
margin-top: $iui-baseline;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
@@ -15,7 +15,7 @@ require("./ManualGroupingCustomUI.scss");
|
|
|
15
15
|
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
|
|
16
16
|
const [manualInput, setManualInput] = react_1.default.useState("");
|
|
17
17
|
return (react_1.default.createElement("div", { className: 'gmw-manual-form' },
|
|
18
|
-
react_1.default.createElement(itwinui_react_1.
|
|
18
|
+
react_1.default.createElement(itwinui_react_1.Alert, { type: 'informational' }, "Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query."),
|
|
19
19
|
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: 'Query', required: true, value: manualInput, onChange: (event) => setManualInput(event.target.value), disabled: isUpdating, placeholder: `E.g. "SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement"` }),
|
|
20
20
|
react_1.default.createElement("div", { className: 'gmw-manual-actions' },
|
|
21
21
|
isUpdating && react_1.default.createElement(utils_1.LoadingSpinner, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAAsE;AACtE,oCAA0C;AAC1C,yCAAuC;AAGhC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzD,OAAO,CACL,uCAAK,SAAS,EAAC,iBAAiB;QAC9B,8BAAC,qBAAK,IAAC,IAAI,EAAC,eAAe,0GAEnB;QACR,8BAAC,+BAAe,IACd,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,oEAAoE,GACjF;QACF,uCAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,8BAAC,sBAAc,OAAG;YACjC,8BAAC,sBAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,YAE5D;YACT,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,sBAAsB,0BAwCjC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(\"\");\n\n return (\n <div className='gmw-manual-form'>\n <Alert type='informational'>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Alert>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -76,7 +76,7 @@ const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
|
|
|
76
76
|
updateQuery(generatedSearchQuery);
|
|
77
77
|
};
|
|
78
78
|
return (react_1.default.createElement("div", { className: 'gmw-search-form' },
|
|
79
|
-
react_1.default.createElement(itwinui_react_1.
|
|
79
|
+
react_1.default.createElement(itwinui_react_1.Alert, { type: 'informational' }, "Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria."),
|
|
80
80
|
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: 'Query Keywords', required: true, value: searchInput, onChange: (event) => setSearchInput(event.target.value), disabled: isUpdating, placeholder: `E.g. "red" chair` }),
|
|
81
81
|
react_1.default.createElement("div", { className: 'gmw-search-actions' },
|
|
82
82
|
isUpdating && react_1.default.createElement(utils_1.LoadingSpinner, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAAsE;AAEtE,oCAA0C;AAC1C,yCAAuC;AAEhC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CACvB,KAAa,EACb,KAAa,EACb,WAAqB,EACrB,EAAE,CACF,iBAAiB,CAAC,KAAK,CAAC;QACxB,CAAC,KAAK,KAAK,CAAC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,MAAM,mBAAmB,GAAG,CAAC,WAAqB,EAAE,EAAE;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,WAAW,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO;SACR;QAED,IAAI,oBAAoB,GAAG,sEAAs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yBACN,KAAK,CAAC,GAAG,CAAC;oBACb,CAAC,CAAC,EAAE,CACP,YAII;YACT,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA9JW,QAAA,sBAAsB,0BA8JjC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./SearchGroupingCustomUI.scss\";\n\nexport const SearchGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const [searchInput, setSearchInput] = React.useState(\"\");\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (\n token: string,\n index: number,\n searchQuery: string[],\n ) =>\n isWrappedInQuotes(token) ||\n (index === 1 && isWrappedInQuotes(searchQuery[0]));\n\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n updateQuery(\"\");\n return;\n }\n\n let generatedSearchQuery = `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } ecc.name LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) `;\n\n updateQuery(generatedSearchQuery);\n };\n\n return (\n <div className='gmw-search-form'>\n <Alert type='informational'>\n Generate a query by keywords. Keywords wrapped in double quotes will be\n considered a required criteria.\n </Alert>\n <LabeledTextarea\n label='Query Keywords'\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"red\" chair`}\n />\n <div className='gmw-search-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button\n disabled={isUpdating}\n onClick={() =>\n generateSearchQuery(\n searchInput\n ? searchInput\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .trim()\n .split(\" \")\n : [],\n )\n }\n >\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setSearchInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { IModelConnection } from "@itwin/core-frontend";
|
|
2
2
|
import type { Group } from "@itwin/insights-client";
|
|
3
|
+
import type { QueryCacheItem } from "./context/GroupHilitedElementsContext";
|
|
3
4
|
export declare const getGroupColor: (index: number) => string;
|
|
4
|
-
export declare const getHiliteIdsFromGroups: (iModelConnection: IModelConnection, groups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string,
|
|
5
|
-
export declare const hideGroups: (iModelConnection: IModelConnection, viewGroups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string,
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const getHiliteIdsFromGroups: (iModelConnection: IModelConnection, groups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<string[]>;
|
|
6
|
+
export declare const hideGroups: (iModelConnection: IModelConnection, viewGroups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
|
|
7
|
+
export declare const hideGroup: (iModelConnection: IModelConnection, viewGroup: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
|
|
8
|
+
export declare const visualizeGroupColors: (iModelConnection: IModelConnection, groups: Group[], viewGroups: Group[], hiddenGroupsIds: string[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>, doEmphasizeElements?: boolean) => Promise<void>;
|
|
9
|
+
export declare const getHiliteIdsAndKeysetFromGroup: (iModelConnection: IModelConnection, group: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<QueryCacheItem>;
|
|
7
10
|
//# sourceMappingURL=groupsHelpers.d.ts.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visualizeGroupColors = exports.hideGroups = exports.getHiliteIdsFromGroups = exports.getGroupColor = void 0;
|
|
3
|
+
exports.getHiliteIdsAndKeysetFromGroup = exports.visualizeGroupColors = exports.hideGroup = exports.hideGroups = exports.getHiliteIdsFromGroups = exports.getGroupColor = void 0;
|
|
4
4
|
/*---------------------------------------------------------------------------------------------
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
8
|
const core_common_1 = require("@itwin/core-common");
|
|
9
9
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
10
|
+
const presentation_common_1 = require("@itwin/presentation-common");
|
|
10
11
|
const viewerUtils_1 = require("./viewerUtils");
|
|
11
12
|
const goldenAngle = 180 * (3 - Math.sqrt(5));
|
|
12
13
|
const getGroupColor = function (index) {
|
|
@@ -14,56 +15,36 @@ const getGroupColor = function (index) {
|
|
|
14
15
|
};
|
|
15
16
|
exports.getGroupColor = getGroupColor;
|
|
16
17
|
const getHiliteIdsFromGroups = async (iModelConnection, groups, hilitedElementsQueryCache) => {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const distinctQueries = new Set();
|
|
19
|
+
const promises = [];
|
|
19
20
|
for (const group of groups) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
currentIds = (_a = hilitedElementsQueryCache.current.get(query)) !== null && _a !== void 0 ? _a : [];
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
try {
|
|
27
|
-
const queryRowCount = await iModelConnection.queryRowCount(query);
|
|
28
|
-
if (queryRowCount === 0) {
|
|
29
|
-
itwinui_react_1.toaster.warning(`${group.groupName}'s query is valid but produced no results.`);
|
|
30
|
-
}
|
|
31
|
-
currentIds = await viewerUtils_1.getHiliteIds(query, iModelConnection);
|
|
32
|
-
hilitedElementsQueryCache.current.set(query, currentIds);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
itwinui_react_1.toaster.negative(`Could not hide/show ${group.groupName}. Query could not be resolved.`);
|
|
36
|
-
}
|
|
21
|
+
if (!distinctQueries.has(group.query)) {
|
|
22
|
+
distinctQueries.add(group.query);
|
|
23
|
+
promises.push(exports.getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));
|
|
37
24
|
}
|
|
38
|
-
allIds = allIds.concat(currentIds);
|
|
39
25
|
}
|
|
26
|
+
const results = await Promise.all(promises);
|
|
27
|
+
const allIds = results.flatMap((result) => result.ids);
|
|
40
28
|
return allIds;
|
|
41
29
|
};
|
|
42
30
|
exports.getHiliteIdsFromGroups = getHiliteIdsFromGroups;
|
|
43
31
|
const hideGroups = async (iModelConnection, viewGroups, hilitedElementsQueryCache) => {
|
|
44
|
-
|
|
32
|
+
const distinctQueries = new Set();
|
|
33
|
+
const promises = [];
|
|
45
34
|
for (const viewGroup of viewGroups) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
viewerUtils_1.hideElements(hilitedIds);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
try {
|
|
53
|
-
const queryRowCount = await iModelConnection.queryRowCount(query);
|
|
54
|
-
if (queryRowCount === 0) {
|
|
55
|
-
itwinui_react_1.toaster.warning(`${viewGroup.groupName}'s query is valid but produced no results.`);
|
|
56
|
-
}
|
|
57
|
-
const hiliteIds = await viewerUtils_1.hideElementsByQuery(query, iModelConnection, false);
|
|
58
|
-
hilitedElementsQueryCache.current.set(query, hiliteIds);
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
itwinui_react_1.toaster.negative(`Could not hide/show ${viewGroup.groupName}. Query could not be resolved.`);
|
|
62
|
-
}
|
|
35
|
+
if (!distinctQueries.has(viewGroup.query)) {
|
|
36
|
+
distinctQueries.add(viewGroup.query);
|
|
37
|
+
promises.push(exports.hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));
|
|
63
38
|
}
|
|
64
39
|
}
|
|
40
|
+
await Promise.all(promises);
|
|
65
41
|
};
|
|
66
42
|
exports.hideGroups = hideGroups;
|
|
43
|
+
const hideGroup = async (iModelConnection, viewGroup, hilitedElementsQueryCache) => {
|
|
44
|
+
const result = await exports.getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);
|
|
45
|
+
viewerUtils_1.hideElements(result.ids);
|
|
46
|
+
};
|
|
47
|
+
exports.hideGroup = hideGroup;
|
|
67
48
|
const visualizeGroupColors = async (iModelConnection, groups, viewGroups, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements = true) => {
|
|
68
49
|
viewerUtils_1.clearEmphasizedOverriddenElements();
|
|
69
50
|
let allIds = [];
|
|
@@ -71,7 +52,8 @@ const visualizeGroupColors = async (iModelConnection, groups, viewGroups, hidden
|
|
|
71
52
|
const index = viewGroups.length > groups.length
|
|
72
53
|
? viewGroups.findIndex((g) => g.id === group.id)
|
|
73
54
|
: groups.findIndex((g) => g.id === group.id);
|
|
74
|
-
const
|
|
55
|
+
const result = await exports.getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
|
|
56
|
+
const hilitedIds = result.ids;
|
|
75
57
|
viewerUtils_1.overrideElements(hilitedIds, exports.getGroupColor(index), core_common_1.FeatureOverrideType.ColorAndAlpha);
|
|
76
58
|
doEmphasizeElements && viewerUtils_1.emphasizeElements(hilitedIds, undefined);
|
|
77
59
|
if (!hiddenGroupsIds.includes(group.id)) {
|
|
@@ -81,4 +63,25 @@ const visualizeGroupColors = async (iModelConnection, groups, viewGroups, hidden
|
|
|
81
63
|
await viewerUtils_1.zoomToElements(allIds);
|
|
82
64
|
};
|
|
83
65
|
exports.visualizeGroupColors = visualizeGroupColors;
|
|
66
|
+
const getHiliteIdsAndKeysetFromGroup = async (iModelConnection, group, hilitedElementsQueryCache) => {
|
|
67
|
+
var _a;
|
|
68
|
+
const query = group.query;
|
|
69
|
+
if (hilitedElementsQueryCache.current.has(query)) {
|
|
70
|
+
return (_a = hilitedElementsQueryCache.current.get(query)) !== null && _a !== void 0 ? _a : ({ keySet: new presentation_common_1.KeySet(), ids: [] });
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const queryRowCount = await iModelConnection.queryRowCount(query);
|
|
74
|
+
if (queryRowCount === 0) {
|
|
75
|
+
itwinui_react_1.toaster.warning(`${group.groupName}'s query is valid but produced no results.`);
|
|
76
|
+
}
|
|
77
|
+
const result = await viewerUtils_1.getHiliteIds(query, iModelConnection);
|
|
78
|
+
hilitedElementsQueryCache.current.set(query, result);
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
itwinui_react_1.toaster.negative(`Query could not be resolved.`);
|
|
83
|
+
return ({ keySet: new presentation_common_1.KeySet(), ids: [] });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.getHiliteIdsAndKeysetFromGroup = getHiliteIdsAndKeysetFromGroup;
|
|
84
87
|
//# sourceMappingURL=groupsHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/widget/components/groupsHelpers.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oDAAyD;AAGzD,wDAA+C;AAC/C,+
|
|
1
|
+
{"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/widget/components/groupsHelpers.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oDAAyD;AAGzD,wDAA+C;AAC/C,oEAAoD;AAEpD,+CAAmJ;AAEnJ,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,aAAa,GAAG,UAAU,KAAa;IAClD,OAAO,OAAO,KAAK,GAAG,WAAW,GAAG,EAAE,cAAc,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,MAAM,sBAAsB,GAAG,KAAK,EACzC,gBAAkC,EAClC,MAAe,EACf,yBAA8E,EAC9E,EAAE;IACF,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1C,MAAM,QAAQ,GAAiC,EAAE,CAAC;IAClD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACrC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjC,QAAQ,CAAC,IAAI,CAAC,sCAA8B,CAAC,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC;SACnG;KACF;IACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvD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AC,EAAE;YACvB,uBAAO,CAAC,OAAO,CACb,GAAG,KAAK,CAAC,SAAS,4CAA4C,CAC/D,CAAC;SACH;QACD,MAAM,MAAM,GAAG,MAAM,0BAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QAC3D,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC;KACf;IAAC,MAAM;QACN,uBAAO,CAAC,QAAQ,CACd,8BAA8B,CAC/B,CAAC;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,4BAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5C;AAEH,CAAC,CAAC;AA1BW,QAAA,8BAA8B,kCA0BzC","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 { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Group } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport type { QueryCacheItem } from \"./context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from \"./viewerUtils\";\n\nconst goldenAngle = 180 * (3 - Math.sqrt(5));\n\nexport const getGroupColor = function (index: number) {\n return `hsl(${index * goldenAngle + 60}, 100%, 50%)`;\n};\n\nexport const getHiliteIdsFromGroups = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<{ ids: string[] }>[] = [];\n for (const group of groups) {\n if (!distinctQueries.has(group.query)) {\n distinctQueries.add(group.query);\n promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));\n }\n }\n const results = await Promise.all(promises);\n const allIds = results.flatMap((result) => result.ids);\n return allIds;\n};\n\nexport const hideGroups = async (\n iModelConnection: IModelConnection,\n viewGroups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<void>[] = [];\n\n for (const viewGroup of viewGroups) {\n if (!distinctQueries.has(viewGroup.query)) {\n distinctQueries.add(viewGroup.query);\n promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));\n }\n }\n await Promise.all(promises);\n};\n\nexport const hideGroup = async (\n iModelConnection: IModelConnection,\n viewGroup: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);\n hideElements(result.ids);\n};\n\nexport const visualizeGroupColors = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n viewGroups: Group[],\n hiddenGroupsIds: string[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean = true\n) => {\n clearEmphasizedOverriddenElements();\n let allIds: string[] = [];\n for (const group of viewGroups) {\n const index =\n viewGroups.length > groups.length\n ? viewGroups.findIndex((g) => g.id === group.id)\n : groups.findIndex((g) => g.id === group.id);\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n const hilitedIds = result.ids;\n overrideElements(\n hilitedIds,\n getGroupColor(index),\n FeatureOverrideType.ColorAndAlpha,\n );\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n if (!hiddenGroupsIds.includes(group.id)) {\n allIds = allIds.concat(hilitedIds);\n }\n }\n\n await zoomToElements(allIds);\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const query = group.query;\n if (hilitedElementsQueryCache.current.has(query)) {\n return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });\n }\n try {\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\n `${group.groupName}'s query is valid but produced no results.`\n );\n }\n const result = await getHiliteIds(query, iModelConnection);\n hilitedElementsQueryCache.current.set(query, result);\n return result;\n } catch {\n toaster.negative(\n `Query could not be resolved.`\n );\n return ({ keySet: new KeySet(), ids: [] });\n }\n\n};\n"]}
|