@itwin/grouping-mapping-widget 0.12.0 → 0.14.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 +3 -0
- package/lib/cjs/grouping-mapping-widget.js +7 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +2 -2
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -119
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.scss +1 -12
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +154 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -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/GroupAction.js +50 -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/GroupColorLegend.d.ts +10 -0
- package/lib/cjs/widget/components/GroupColorLegend.js +20 -0
- package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -0
- package/lib/cjs/widget/components/GroupColorLegend.scss +9 -0
- package/lib/cjs/widget/components/GroupColorToggle.d.ts +9 -0
- package/lib/cjs/widget/components/GroupColorToggle.js +69 -0
- package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -0
- 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/GroupItem.d.ts +12 -0
- package/lib/cjs/widget/components/GroupItem.js +19 -0
- package/lib/cjs/widget/components/GroupItem.js.map +1 -0
- package/lib/cjs/widget/components/GroupMenuActions.d.ts +13 -0
- package/lib/cjs/widget/components/GroupMenuActions.js +68 -0
- package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -0
- package/lib/cjs/widget/components/GroupMenuActions.scss +13 -0
- package/lib/cjs/widget/components/Grouping.d.ts +9 -5
- package/lib/cjs/widget/components/Grouping.js +15 -144
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +0 -16
- package/lib/cjs/widget/components/GroupingMapping.js +4 -6
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js +1 -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 +9 -2
- package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingRouter.js +20 -21
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/widget/components/GroupsAddButton.d.ts +3 -2
- package/lib/cjs/widget/components/GroupsAddButton.js +4 -3
- package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -1
- package/lib/cjs/widget/components/GroupsAddButton.scss +2 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.d.ts +11 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.js +45 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualization.d.ts +9 -0
- package/lib/cjs/widget/components/GroupsVisualization.js +137 -0
- package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualization.scss +12 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.d.ts +10 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.js +27 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.scss +9 -0
- package/lib/cjs/widget/components/Mapping.js +2 -3
- 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 +1 -2
- package/lib/cjs/widget/components/PropertyMenu.js +6 -49
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.scss +2 -17
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +45 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.scss +16 -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 +13 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js +28 -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/SharedCalculatedPropertyForms.d.ts +16 -0
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +62 -0
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
- 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/context/GroupHilitedElementsContext.d.ts +2 -2
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +1 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- 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/GroupingMappingCustomUI.d.ts +4 -0
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +3 -3
- 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 +1 -1
- package/lib/cjs/widget/components/groupsHelpers.js +11 -14
- package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +3 -0
- package/lib/esm/grouping-mapping-widget.js +3 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +2 -2
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.js +9 -121
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.scss +1 -12
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js +128 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -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/GroupAction.js +53 -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/GroupColorLegend.d.ts +10 -0
- package/lib/esm/widget/components/GroupColorLegend.js +13 -0
- package/lib/esm/widget/components/GroupColorLegend.js.map +1 -0
- package/lib/esm/widget/components/GroupColorLegend.scss +9 -0
- package/lib/esm/widget/components/GroupColorToggle.d.ts +9 -0
- package/lib/esm/widget/components/GroupColorToggle.js +46 -0
- package/lib/esm/widget/components/GroupColorToggle.js.map +1 -0
- 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/GroupItem.d.ts +12 -0
- package/lib/esm/widget/components/GroupItem.js +12 -0
- package/lib/esm/widget/components/GroupItem.js.map +1 -0
- package/lib/esm/widget/components/GroupMenuActions.d.ts +13 -0
- package/lib/esm/widget/components/GroupMenuActions.js +45 -0
- package/lib/esm/widget/components/GroupMenuActions.js.map +1 -0
- package/lib/esm/widget/components/GroupMenuActions.scss +13 -0
- package/lib/esm/widget/components/Grouping.d.ts +9 -5
- package/lib/esm/widget/components/Grouping.js +18 -147
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +0 -16
- package/lib/esm/widget/components/GroupingMapping.js +4 -6
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.js +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContext.js +1 -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 +9 -2
- package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingRouter.js +20 -21
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/widget/components/GroupsAddButton.d.ts +3 -2
- package/lib/esm/widget/components/GroupsAddButton.js +5 -4
- package/lib/esm/widget/components/GroupsAddButton.js.map +1 -1
- package/lib/esm/widget/components/GroupsAddButton.scss +2 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.d.ts +11 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.js +22 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualization.d.ts +9 -0
- package/lib/esm/widget/components/GroupsVisualization.js +114 -0
- package/lib/esm/widget/components/GroupsVisualization.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualization.scss +12 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.d.ts +10 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.js +20 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.scss +9 -0
- package/lib/esm/widget/components/Mapping.js +2 -3
- 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 +1 -2
- package/lib/esm/widget/components/PropertyMenu.js +7 -50
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/PropertyMenu.scss +2 -17
- package/lib/esm/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.js +22 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.scss +16 -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 +13 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.js +21 -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/SharedCalculatedPropertyForms.d.ts +16 -0
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.js +39 -0
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
- 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/context/GroupHilitedElementsContext.d.ts +2 -2
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +1 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- 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/GroupingMappingCustomUI.d.ts +4 -0
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +4 -4
- 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 +1 -1
- package/lib/esm/widget/components/groupsHelpers.js +11 -14
- package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectMappings.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,wDAK8B;AAC9B,+CAAyE;AAEzE,yEAAkE;AAElE,gCAA8B;AAC9B,mCAAsC;AAEtC,iFAAiF;AAEjF,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,aAAa,GAAG,KAAK,EACzB,WAA4D,EAC5D,QAAgB,EAChB,YAA2D,EAC3D,cAAgC,EAChC,cAA+B,EAC/B,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACzE,WAAW,CAAC,QAAQ,CAAC,CAAC;KACvB;IAAC,OAAO,KAAU,EAAE;QACnB,mBAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC3B;YAAS;QACR,YAAY,CAAC,KAAK,CAAC,CAAC;KACrB;AACH,CAAC,CAAC;AAUF,MAAM,cAAc,GAAG,CAAC,EACtB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,EAAE,kBAAkB,GACd,EAAE,EAAE;IACxB,MAAM,EAAE,cAAc,EAAE,GAAG,sDAA2B,EAAE,CAAC;IACzD,MAAM,aAAa,GAAG,uCAAgB,EAAE,CAAC;IACzC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,gBAAQ,CAAU,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,gBAAQ,CAAkB,EAAE,CAAC,CAAC;IAC9E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,gBAAQ,CAAY,EAAE,CAAC,CAAC;IAExD,iBAAS,CAAC,GAAG,EAAE;QACb,KAAK,aAAa,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IACzF,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE5D,MAAM,cAAc,GAAG,EAAE,GAAG,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectMappings.tsx"],"names":[],"mappings":"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","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 {\n TablePaginatorRendererProps,\n} from \"@itwin/itwinui-react\";\nimport {\n Button,\n Table,\n tableFilters,\n TablePaginator,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport \"./SelectMapping.scss\";\nimport { handleError } from \"./utils\";\nimport type { GetAccessTokenFn } from \"./context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\n\nconst fetchMappings = async (\n setMappings: React.Dispatch<React.SetStateAction<Mapping[]>>,\n iModelId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n getAccessToken: GetAccessTokenFn,\n mappingsClient: IMappingsClient\n) => {\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const mappings = await mappingsClient.getMappings(accessToken, iModelId);\n setMappings(mappings);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: IMappingTyped[]) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nconst SelectMappings = ({\n iModelId,\n onSelect,\n onCancel,\n backFn,\n displayStrings: userDisplayStrings,\n}: SelectMappingsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [mappings, setMappings] = useState<Mapping[]>([]);\n\n useEffect(() => {\n void fetchMappings(setMappings, iModelId, setIsLoading, getAccessToken, mappingClient);\n }, [getAccessToken, mappingClient, iModelId, setIsLoading]);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const mappingsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"mappingName\",\n Header: `${displayStrings.mappings}`,\n accessor: \"mappingName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n },\n ],\n [displayStrings.mappings]\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback(\n (props: TablePaginatorRendererProps) => (\n <TablePaginator {...props} pageSizeList={pageSizeList} />\n ),\n [pageSizeList]\n );\n\n return (\n <div className='gmw-select-mapping-container'>\n <Table<IMappingTyped>\n data={mappings}\n columns={mappingsColumns}\n className='gmw-select-mapping-table'\n emptyTableContent={`No ${displayStrings.mappings} available.`}\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: IMappingTyped[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className='gmw-import-action-panel'>\n <Button onClick={backFn}>Back</Button>\n <Button\n styleType='high-visibility'\n onClick={() => {\n onSelect(selectedMappings);\n }}\n disabled={isLoading || selectedMappings.length === 0}\n >\n Next\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectMappings;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CalculatedPropertyType } from "@itwin/insights-client";
|
|
3
|
+
import type { SelectOption } from "@itwin/itwinui-react";
|
|
4
|
+
import type SimpleReactValidator from "simple-react-validator";
|
|
5
|
+
interface SharedCalculatedPropertyFormsProps {
|
|
6
|
+
propertyName: string;
|
|
7
|
+
setPropertyName: (value: string) => void;
|
|
8
|
+
type: CalculatedPropertyType | undefined;
|
|
9
|
+
setType: (value: CalculatedPropertyType | undefined) => void;
|
|
10
|
+
validator: SimpleReactValidator;
|
|
11
|
+
itemRenderer?: (option: SelectOption<string>) => JSX.Element;
|
|
12
|
+
selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare const SharedCalculatedPropertyForms: ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }: SharedCalculatedPropertyFormsProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=SharedCalculatedPropertyForms.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
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.SharedCalculatedPropertyForms = 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 insights_client_1 = require("@itwin/insights-client");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const useValidator_1 = require("../hooks/useValidator");
|
|
30
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
|
+
const SharedCalculatedPropertyForms = ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }) => {
|
|
32
|
+
const generateOptionsFromCalculatedPropertyType = react_1.useCallback(() => {
|
|
33
|
+
const options = [];
|
|
34
|
+
const indexableEnum = insights_client_1.CalculatedPropertyType;
|
|
35
|
+
for (const key in indexableEnum) {
|
|
36
|
+
if (typeof indexableEnum[key] === "string" && key !== "Undefined") {
|
|
37
|
+
// Generate labels by adding space between capitals
|
|
38
|
+
const label = key
|
|
39
|
+
.replace(/([A-Z])/g, " $1")
|
|
40
|
+
.trim()
|
|
41
|
+
.replace(/^\w/, (c) => c.toUpperCase());
|
|
42
|
+
options.push({ value: indexableEnum[key], label });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return options;
|
|
46
|
+
}, []);
|
|
47
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
48
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { value: propertyName, required: true, name: "name", label: "Name", onChange: (event) => {
|
|
49
|
+
setPropertyName(event.target.value);
|
|
50
|
+
validator.showMessageFor("name");
|
|
51
|
+
}, message: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS), status: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS)
|
|
52
|
+
? "negative"
|
|
53
|
+
: undefined, onBlur: () => {
|
|
54
|
+
validator.showMessageFor("name");
|
|
55
|
+
}, onBlurCapture: (event) => {
|
|
56
|
+
setPropertyName(event.target.value);
|
|
57
|
+
validator.showMessageFor("name");
|
|
58
|
+
} }),
|
|
59
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "Quantity Type", required: true, options: generateOptionsFromCalculatedPropertyType(), value: type, onChange: setType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, onShow: () => { }, onHide: () => { } })));
|
|
60
|
+
};
|
|
61
|
+
exports.SharedCalculatedPropertyForms = SharedCalculatedPropertyForms;
|
|
62
|
+
//# sourceMappingURL=SharedCalculatedPropertyForms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../src/widget/components/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,4DAEgC;AAChC,+CAA2C;AAC3C,wDAA0D;AAE1D,wDAAmE;AAa5D,MAAM,6BAA6B,GAAG,CAAC,EAC5C,YAAY,EACZ,eAAe,EACf,IAAI,EACJ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,oBAAoB,GACe,EAAE,EAAE;IAEvC,MAAM,yCAAyC,GAAG,mBAAW,CAAC,GAAG,EAAE;QACjE,MAAM,OAAO,GAA2C,EAAE,CAAC;QAE3D,MAAM,aAAa,GAAG,wCAA8D,CAAC;QAErF,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;YAC/B,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,KAAK,WAAW,EAAE;gBACjE,mDAAmD;gBACnD,MAAM,KAAK,GAAG,GAAG;qBACd,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;qBAC1B,IAAI,EAAE;qBACN,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAA2B,EAAE,KAAK,EAAE,CAAC,CAAC;aAC9E;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL;QACE,8BAAC,4BAAY,IACX,KAAK,EAAE,YAAY,EACnB,QAAQ,QACR,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,MAAM,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,EACD,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,gCAAiB,CAAC,EACnE,MAAM,EACJ,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,gCAAiB,CAAC;gBACxD,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,GAAG,EAAE;gBACX,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,GACD;QACF,8BAAC,6BAAa,IACZ,KAAK,EAAC,eAAe,EACrB,QAAQ,QACR,OAAO,EAAE,yCAAyC,EAAE,EACpD,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,6BAA6B,iCAkExC","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 {\n CalculatedPropertyType,\n} from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledInput, LabeledSelect } from \"@itwin/itwinui-react\";\nimport type SimpleReactValidator from \"simple-react-validator\";\n\ninterface SharedCalculatedPropertyFormsProps {\n propertyName: string;\n setPropertyName: (value: string) => void;\n type: CalculatedPropertyType | undefined;\n setType: (value: CalculatedPropertyType | undefined) => void;\n validator: SimpleReactValidator;\n itemRenderer?: (option: SelectOption<string>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n propertyName,\n setPropertyName,\n type,\n setType,\n validator,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType>[] = [];\n\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledInput\n value={propertyName}\n required\n name=\"name\"\n label=\"Name\"\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", propertyName, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledSelect<CalculatedPropertyType>\n label=\"Quantity Type\"\n required\n options={generateOptionsFromCalculatedPropertyType()}\n value={type}\n onChange={setType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SvgInfoCircular, SvgStatusError, SvgStatusSuccess, SvgStatusWarning } from "@itwin/itwinui-icons-react";
|
|
3
|
+
import "./StatusIcon.scss";
|
|
4
|
+
declare const StatusIconMap: {
|
|
5
|
+
readonly success: typeof SvgStatusSuccess;
|
|
6
|
+
readonly error: typeof SvgStatusError;
|
|
7
|
+
readonly warning: typeof SvgStatusWarning;
|
|
8
|
+
readonly informational: typeof SvgInfoCircular;
|
|
9
|
+
};
|
|
10
|
+
export declare const StatusIcon: ({ status, className, ...rest }: {
|
|
11
|
+
status: keyof typeof StatusIconMap;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=StatusIcon.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StatusIcon = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
14
|
+
require("./StatusIcon.scss");
|
|
15
|
+
const StatusIconMap = {
|
|
16
|
+
success: itwinui_icons_react_1.SvgStatusSuccess,
|
|
17
|
+
error: itwinui_icons_react_1.SvgStatusError,
|
|
18
|
+
warning: itwinui_icons_react_1.SvgStatusWarning,
|
|
19
|
+
informational: itwinui_icons_react_1.SvgInfoCircular,
|
|
20
|
+
};
|
|
21
|
+
const StatusIcon = ({ status, className, ...rest }) => {
|
|
22
|
+
const Element = StatusIconMap[status];
|
|
23
|
+
return react_1.default.createElement(Element, { className: classnames_1.default("gmw-status-icon", `gmw-status-icon-${status}`, className), ...rest });
|
|
24
|
+
};
|
|
25
|
+
exports.StatusIcon = StatusIcon;
|
|
26
|
+
//# sourceMappingURL=StatusIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIcon.js","sourceRoot":"","sources":["../../../../src/widget/components/StatusIcon.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAC1B,4DAAoC;AACpC,oEAAiH;AACjH,6BAA2B;AAE3B,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,sCAAgB;IACzB,KAAK,EAAE,oCAAc;IACrB,OAAO,EAAE,sCAAgB;IACzB,aAAa,EAAE,qCAAe;CACtB,CAAC;AAEJ,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,8BAAC,OAAO,IAAC,SAAS,EAAE,oBAAU,CAAC,iBAAiB,EAAE,mBAAmB,MAAM,EAAE,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACjH,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB","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 classnames from \"classnames\";\nimport { SvgInfoCircular, SvgStatusError, SvgStatusSuccess, SvgStatusWarning } from \"@itwin/itwinui-icons-react\";\nimport \"./StatusIcon.scss\";\n\nconst StatusIconMap = {\n success: SvgStatusSuccess,\n error: SvgStatusError,\n warning: SvgStatusWarning,\n informational: SvgInfoCircular,\n} as const;\n\nexport const StatusIcon = ({\n status,\n className,\n ...rest\n}: {\n status: keyof typeof StatusIconMap;\n className?: string;\n}) => {\n const Element = StatusIconMap[status];\n return <Element className={classnames(\"gmw-status-icon\", `gmw-status-icon-${status}`, className)} {...rest} />;\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import "@itwin/itwinui-css/scss/icon/variables";
|
|
6
|
+
|
|
7
|
+
.gmw-status-icon {
|
|
8
|
+
width: $iui-icons-default;
|
|
9
|
+
height: $iui-icons-default;
|
|
10
|
+
|
|
11
|
+
&-success {
|
|
12
|
+
fill: var(--iui-icons-color-positive);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-error {
|
|
16
|
+
fill: var(--iui-icons-color-negative);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-warning {
|
|
20
|
+
fill: var(--iui-icons-color-warning);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-informational {
|
|
24
|
+
fill: var(--iui-icons-color-primary);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -8,11 +8,11 @@ export interface QueryCacheItem {
|
|
|
8
8
|
}
|
|
9
9
|
export interface GroupHilitedElements {
|
|
10
10
|
hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;
|
|
11
|
-
hiddenGroupsIds: string
|
|
11
|
+
hiddenGroupsIds: Set<string>;
|
|
12
12
|
showGroupColor: boolean;
|
|
13
13
|
groups: Group[];
|
|
14
14
|
setGroups: (groups: Group[]) => void;
|
|
15
|
-
setHiddenGroupsIds: (hiddenGroupIds: string
|
|
15
|
+
setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;
|
|
16
16
|
setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
|
|
17
17
|
}
|
|
18
18
|
export declare const GroupHilitedElementsContext: React.Context<GroupHilitedElements>;
|
|
@@ -27,7 +27,7 @@ exports.useGroupHilitedElementsContext = exports.GroupHilitedElementsContext = v
|
|
|
27
27
|
const React = __importStar(require("react"));
|
|
28
28
|
exports.GroupHilitedElementsContext = React.createContext({
|
|
29
29
|
hilitedElementsQueryCache: { current: new Map() },
|
|
30
|
-
hiddenGroupsIds:
|
|
30
|
+
hiddenGroupsIds: new Set(),
|
|
31
31
|
showGroupColor: false,
|
|
32
32
|
groups: [],
|
|
33
33
|
setGroups: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAkBlB,QAAA,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAkBlB,QAAA,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,IAAI,GAAG,EAAE;IAC1B,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;IACpB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEI,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,mCAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC","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 { MutableRefObject } from \"react\";\nimport type { Group } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nexport interface QueryCacheItem {\n keySet: KeySet;\n ids: string[];\n}\nexport interface GroupHilitedElements {\n hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;\n hiddenGroupsIds: Set<string>;\n showGroupColor: boolean;\n groups: Group[];\n setGroups: (groups: Group[]) => void;\n setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const GroupHilitedElementsContext = React.createContext<GroupHilitedElements>({\n hilitedElementsQueryCache: { current: new Map() },\n hiddenGroupsIds: new Set(),\n showGroupColor: false,\n groups: [],\n setGroups: () => { },\n setHiddenGroupsIds: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const useGroupHilitedElementsContext = (): GroupHilitedElements => {\n const context = React.useContext(GroupHilitedElementsContext);\n if (!context) {\n throw new Error(\n \"useGroupHilitedElementsContext should be used within a GroupHilitedElementsContext 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":"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","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
|
}
|
|
@@ -88,5 +88,9 @@ export interface GroupingCustomUIProps {
|
|
|
88
88
|
* To reset the viewer.
|
|
89
89
|
*/
|
|
90
90
|
resetView?: () => Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* The initial query for the Group being edited.
|
|
93
|
+
*/
|
|
94
|
+
initialEditModeQuery?: string;
|
|
91
95
|
}
|
|
92
96
|
//# sourceMappingURL=GroupingMappingCustomUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":";;;AAOA,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?:
|
|
1
|
+
{"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":";;;AAOA,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n /**\n * The initial query for the Group being edited.\n */\n initialEditModeQuery?: string;\n\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./ManualGroupingCustomUI.scss";
|
|
3
3
|
import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
|
|
4
|
-
export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
|
|
4
|
+
export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }: GroupingCustomUIProps) => JSX.Element;
|
|
5
5
|
//# sourceMappingURL=ManualGroupingCustomUI.d.ts.map
|
|
@@ -12,10 +12,10 @@ const react_1 = __importDefault(require("react"));
|
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
const utils_1 = require("../utils");
|
|
14
14
|
require("./ManualGroupingCustomUI.scss");
|
|
15
|
-
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
|
|
16
|
-
const [manualInput, setManualInput] = react_1.default.useState("");
|
|
15
|
+
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }) => {
|
|
16
|
+
const [manualInput, setManualInput] = react_1.default.useState(initialEditModeQuery !== null && initialEditModeQuery !== void 0 ? initialEditModeQuery : "");
|
|
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,EACT,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,EAAE,CAAC,CAAC;IAEjF,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;AAzCW,QAAA,sBAAsB,0BAyCjC","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 initialEditModeQuery,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\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),
|