@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
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { PropertyRecord } from "@itwin/appui-abstract";
|
|
3
|
-
import type { Orientation, RatioChangeResult } from "@itwin/core-react";
|
|
4
|
-
import type { ActionButtonRenderer, PropertyUpdatedArgs, PropertyValueRendererManager } from "@itwin/components-react";
|
|
5
|
-
import type { PropertyGridColumnInfo } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns";
|
|
6
|
-
import type { HighlightingComponentProps } from "@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps";
|
|
7
|
-
/** Properties shared by all renderers and PropertyView
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface SharedRendererProps {
|
|
11
|
-
/** PropertyRecord to render */
|
|
12
|
-
propertyRecord: PropertyRecord;
|
|
13
|
-
/** Unique string, that identifies this property component. Should be used if onClick or onRightClick are provided */
|
|
14
|
-
uniqueKey?: string;
|
|
15
|
-
/** Orientation to use for displaying the property */
|
|
16
|
-
orientation: Orientation;
|
|
17
|
-
/** Controls component selection */
|
|
18
|
-
isSelected?: boolean;
|
|
19
|
-
/** Called when property gets clicked. If undefined, clicking is disabled */
|
|
20
|
-
onClick?: (property: PropertyRecord, key?: string) => void;
|
|
21
|
-
/** Called when property gets right clicked. If undefined, right clicking is not working */
|
|
22
|
-
onRightClick?: (property: PropertyRecord, key?: string) => void;
|
|
23
|
-
/** Called to show a context menu for properties */
|
|
24
|
-
onContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;
|
|
25
|
-
/** Ratio between label and value cells */
|
|
26
|
-
columnRatio?: number;
|
|
27
|
-
/** Callback to column ratio changed event */
|
|
28
|
-
onColumnRatioChanged?: (ratio: number) => void | RatioChangeResult;
|
|
29
|
-
/** Indicates that properties have *hover* effect */
|
|
30
|
-
isHoverable?: boolean;
|
|
31
|
-
/** Indicates that properties can be selected */
|
|
32
|
-
isSelectable?: boolean;
|
|
33
|
-
/** Width of the whole property element */
|
|
34
|
-
width?: number;
|
|
35
|
-
/** Array of action button renderers @beta */
|
|
36
|
-
actionButtonRenderers?: ActionButtonRenderer[];
|
|
37
|
-
/** Is resize handle hovered */
|
|
38
|
-
isResizeHandleHovered?: boolean;
|
|
39
|
-
/** Callback to hover event change */
|
|
40
|
-
onResizeHandleHoverChanged?: (isHovered: boolean) => void;
|
|
41
|
-
/** Is resize handle being dragged */
|
|
42
|
-
isResizeHandleBeingDragged?: boolean;
|
|
43
|
-
/** Callback to drag event change */
|
|
44
|
-
onResizeHandleDragChanged?: (isDragStarted: boolean) => void;
|
|
45
|
-
/** Information for styling property grid columns */
|
|
46
|
-
columnInfo?: PropertyGridColumnInfo;
|
|
47
|
-
}
|
|
48
|
-
/** Properties of [[PropertyRenderer]] React component
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
export interface PropertyRendererProps extends SharedRendererProps {
|
|
52
|
-
/** Custom value renderer */
|
|
53
|
-
propertyValueRendererManager?: PropertyValueRendererManager;
|
|
54
|
-
/** Multiplier of how much the property is indented to the right */
|
|
55
|
-
indentation?: number;
|
|
56
|
-
/** Indicates property is being edited @beta */
|
|
57
|
-
isEditing?: boolean;
|
|
58
|
-
/** Called when property edit is committed. @beta */
|
|
59
|
-
onEditCommit?: (args: PropertyUpdatedArgs) => void;
|
|
60
|
-
/** Called when property edit is cancelled. @beta */
|
|
61
|
-
onEditCancel?: () => void;
|
|
62
|
-
/** Props used for highlighting. @beta */
|
|
63
|
-
highlight?: HighlightingComponentProps;
|
|
64
|
-
}
|
|
65
|
-
/** State of [[PropertyRenderer]] React component
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
interface PropertyRendererState {
|
|
69
|
-
/** Currently loaded property value */
|
|
70
|
-
displayValue?: React.ReactNode;
|
|
71
|
-
}
|
|
72
|
-
/** A React component that renders properties
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
export declare class PropertyRenderer extends React.Component<PropertyRendererProps, PropertyRendererState> {
|
|
76
|
-
/** @internal */
|
|
77
|
-
readonly state: Readonly<PropertyRendererState>;
|
|
78
|
-
static getLabelOffset(indentation?: number, orientation?: Orientation, width?: number, columnRatio?: number, minColumnLabelWidth?: number): number;
|
|
79
|
-
private updateDisplayValue;
|
|
80
|
-
private _onEditCommit;
|
|
81
|
-
private _onEditCancel;
|
|
82
|
-
/** Display property record value in an editor */
|
|
83
|
-
updateDisplayValueAsEditor(props: PropertyRendererProps): void;
|
|
84
|
-
/** @internal */
|
|
85
|
-
componentDidMount(): void;
|
|
86
|
-
/** @internal */
|
|
87
|
-
componentDidUpdate(prevProps: PropertyRendererProps): void;
|
|
88
|
-
/** @internal */
|
|
89
|
-
render(): JSX.Element;
|
|
90
|
-
}
|
|
91
|
-
export {};
|
|
92
|
-
//# sourceMappingURL=PropertyRender.d.ts.map
|
|
@@ -1,109 +0,0 @@
|
|
|
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.PropertyRenderer = 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
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
29
|
-
const components_react_1 = require("@itwin/components-react");
|
|
30
|
-
const NonPrimitivePropertyRenderer_1 = require("./NonPrimitivePropertyRenderer");
|
|
31
|
-
const PrimitivePropertyRenderer_1 = require("./PrimitivePropertyRenderer");
|
|
32
|
-
const CommonPropertyRenderer_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer");
|
|
33
|
-
const createNewDisplayValue_1 = require("./createNewDisplayValue");
|
|
34
|
-
/** A React component that renders properties
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
class PropertyRenderer extends React.Component {
|
|
38
|
-
constructor() {
|
|
39
|
-
super(...arguments);
|
|
40
|
-
/** @internal */
|
|
41
|
-
this.state = {
|
|
42
|
-
displayValue: components_react_1.UiComponents.translate("general.loading"),
|
|
43
|
-
};
|
|
44
|
-
this._onEditCommit = (args) => {
|
|
45
|
-
// istanbul ignore else
|
|
46
|
-
if (this.props.onEditCommit) {
|
|
47
|
-
this.props.onEditCommit(args);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
this._onEditCancel = () => {
|
|
51
|
-
// istanbul ignore else
|
|
52
|
-
if (this.props.onEditCancel) {
|
|
53
|
-
this.props.onEditCancel();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
static getLabelOffset(indentation, orientation, width, columnRatio, minColumnLabelWidth) {
|
|
58
|
-
return CommonPropertyRenderer_1.CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, minColumnLabelWidth);
|
|
59
|
-
}
|
|
60
|
-
updateDisplayValue(props) {
|
|
61
|
-
if (props.isEditing) {
|
|
62
|
-
this.updateDisplayValueAsEditor(props);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const displayValue = createNewDisplayValue_1.createNewDisplayValue(props.orientation, props.propertyRecord, props.indentation, props.propertyValueRendererManager);
|
|
66
|
-
this.setState({ displayValue });
|
|
67
|
-
}
|
|
68
|
-
/** Display property record value in an editor */
|
|
69
|
-
updateDisplayValueAsEditor(props) {
|
|
70
|
-
this.setState({
|
|
71
|
-
displayValue: (React.createElement(components_react_1.EditorContainer, { propertyRecord: props.propertyRecord, onCommit: this._onEditCommit, onCancel: this._onEditCancel, setFocus: true })),
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/** @internal */
|
|
75
|
-
componentDidMount() {
|
|
76
|
-
this.updateDisplayValue(this.props);
|
|
77
|
-
}
|
|
78
|
-
/** @internal */
|
|
79
|
-
componentDidUpdate(prevProps) {
|
|
80
|
-
if (prevProps.propertyRecord !== this.props.propertyRecord ||
|
|
81
|
-
prevProps.isEditing !== this.props.isEditing ||
|
|
82
|
-
prevProps.orientation !== this.props.orientation) {
|
|
83
|
-
this.updateDisplayValue(this.props);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/** @internal */
|
|
87
|
-
render() {
|
|
88
|
-
const { ...props } = this.props;
|
|
89
|
-
const primitiveRendererProps = {
|
|
90
|
-
...props,
|
|
91
|
-
valueElement: this.state.displayValue,
|
|
92
|
-
indentation: this.props.indentation,
|
|
93
|
-
};
|
|
94
|
-
switch (this.props.propertyRecord.value.valueFormat) {
|
|
95
|
-
case appui_abstract_1.PropertyValueFormat.Primitive:
|
|
96
|
-
return (React.createElement(PrimitivePropertyRenderer_1.PrimitivePropertyRenderer, { ...primitiveRendererProps }));
|
|
97
|
-
case appui_abstract_1.PropertyValueFormat.Array:
|
|
98
|
-
// If array is empty, render it as a primitive property
|
|
99
|
-
if (this.props.propertyRecord.value.valueFormat === appui_abstract_1.PropertyValueFormat.Array
|
|
100
|
-
&& this.props.propertyRecord.value.items.length === 0)
|
|
101
|
-
return (React.createElement(PrimitivePropertyRenderer_1.PrimitivePropertyRenderer, { ...primitiveRendererProps }));
|
|
102
|
-
// eslint-disable-next-line no-fallthrough
|
|
103
|
-
case appui_abstract_1.PropertyValueFormat.Struct:
|
|
104
|
-
return (React.createElement(NonPrimitivePropertyRenderer_1.NonPrimitivePropertyRenderer, { isCollapsible: true, ...primitiveRendererProps }));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.PropertyRenderer = PropertyRenderer;
|
|
109
|
-
//# sourceMappingURL=PropertyRender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyRender.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAE/B,0DAA4D;AAQ5D,8DAGiC;AAEjC,iFAA8E;AAC9E,2EAAwE;AAGxE,yIAAsI;AACtI,mEAAgE;AAsEhE;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK,CAAC,SAG3C;IAHD;;QAIE,gBAAgB;QACS,UAAK,GAAoC;YAChE,YAAY,EAAE,+BAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC;SACxD,CAAC;QAiCM,kBAAa,GAAG,CAAC,IAAyB,EAAE,EAAE;YACpD,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;aAC/B;QACH,CAAC,CAAC;QAEM,kBAAa,GAAG,GAAG,EAAE;YAC3B,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;aAC3B;QACH,CAAC,CAAC;IA+DJ,CAAC;IA1GQ,MAAM,CAAC,cAAc,CAC1B,WAAoB,EACpB,WAAyB,EACzB,KAAc,EACd,WAAoB,EACpB,mBAA4B;QAE5B,OAAO,+CAAsB,CAAC,cAAc,CAC1C,WAAW,EACX,WAAW,EACX,KAAK,EACL,WAAW,EACX,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAEO,kBAAkB,CAAC,KAA4B;QACrD,IAAI,KAAK,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC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,KAAK,CAAC,WAAW,EAAE;YACnD,KAAK,oCAAmB,CAAC,SAAS;gBAChC,OAAO,CACL,oBAAC,qDAAyB,OAAK,sBAAsB,GAAI,CAC1D,CAAC;YACJ,KAAK,oCAAmB,CAAC,KAAK;gBAC5B,uDAAuD;gBACvD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,KAAK;uBACxE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;oBACrD,OAAO,CACL,oBAAC,qDAAyB,OAAK,sBAAsB,GAAI,CAC1D,CAAC;YACN,0CAA0C;YAC1C,KAAK,oCAAmB,CAAC,MAAM;gBAC7B,OAAO,CACL,oBAAC,2DAA4B,IAC3B,aAAa,EAAE,IAAI,KACf,sBAAsB,GAC1B,CACH,CAAC;SACL;IACH,CAAC;CACF;AAnHD,4CAmHC","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 { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { Orientation, RatioChangeResult } from \"@itwin/core-react\";\nimport type {\n ActionButtonRenderer,\n PrimitiveRendererProps,\n PropertyUpdatedArgs,\n PropertyValueRendererManager,\n} from \"@itwin/components-react\";\nimport {\n EditorContainer,\n UiComponents,\n} from \"@itwin/components-react\";\n\nimport { NonPrimitivePropertyRenderer } from \"./NonPrimitivePropertyRenderer\";\nimport { PrimitivePropertyRenderer } from \"./PrimitivePropertyRenderer\";\nimport type { PropertyGridColumnInfo } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\nimport type { HighlightingComponentProps } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { createNewDisplayValue } from \"./createNewDisplayValue\";\n\n/** Properties shared by all renderers and PropertyView\n * @public\n */\nexport interface SharedRendererProps {\n /** PropertyRecord to render */\n propertyRecord: PropertyRecord;\n /** Unique string, that identifies this property component. Should be used if onClick or onRightClick are provided */\n uniqueKey?: string;\n /** Orientation to use for displaying the property */\n orientation: Orientation;\n /** Controls component selection */\n isSelected?: boolean;\n /** Called when property gets clicked. If undefined, clicking is disabled */\n onClick?: (property: PropertyRecord, key?: string) => void;\n /** Called when property gets right clicked. If undefined, right clicking is not working */\n onRightClick?: (property: PropertyRecord, key?: string) => void;\n /** Called to show a context menu for properties */\n onContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\n /** Ratio between label and value cells */\n columnRatio?: number;\n /** Callback to column ratio changed event */\n onColumnRatioChanged?: (ratio: number) => void | RatioChangeResult;\n /** Indicates that properties have *hover* effect */\n isHoverable?: boolean;\n /** Indicates that properties can be selected */\n isSelectable?: boolean;\n /** Width of the whole property element */\n width?: number;\n /** Array of action button renderers @beta */\n actionButtonRenderers?: ActionButtonRenderer[];\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n /** Information for styling property grid columns */\n columnInfo?: PropertyGridColumnInfo;\n}\n\n/** Properties of [[PropertyRenderer]] React component\n * @public\n */\nexport interface PropertyRendererProps extends SharedRendererProps {\n /** Custom value renderer */\n propertyValueRendererManager?: PropertyValueRendererManager;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Indicates property is being edited @beta */\n isEditing?: boolean;\n /** Called when property edit is committed. @beta */\n onEditCommit?: (args: PropertyUpdatedArgs) => void;\n /** Called when property edit is cancelled. @beta */\n onEditCancel?: () => void;\n /** Props used for highlighting. @beta */\n highlight?: HighlightingComponentProps;\n}\n\n/** State of [[PropertyRenderer]] React component\n * @internal\n */\ninterface PropertyRendererState {\n /** Currently loaded property value */\n displayValue?: React.ReactNode;\n}\n\n/** A React component that renders properties\n * @public\n */\nexport class PropertyRenderer extends React.Component<\nPropertyRendererProps,\nPropertyRendererState\n> {\n /** @internal */\n public override readonly state: Readonly<PropertyRendererState> = {\n displayValue: UiComponents.translate(\"general.loading\"),\n };\n\n public static getLabelOffset(\n indentation?: number,\n orientation?: Orientation,\n width?: number,\n columnRatio?: number,\n minColumnLabelWidth?: number,\n ): number {\n return CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n minColumnLabelWidth,\n );\n }\n\n private updateDisplayValue(props: PropertyRendererProps) {\n if (props.isEditing) {\n this.updateDisplayValueAsEditor(props);\n return;\n }\n\n const displayValue = createNewDisplayValue(\n props.orientation,\n props.propertyRecord,\n props.indentation,\n props.propertyValueRendererManager,\n );\n this.setState({ displayValue });\n }\n\n private _onEditCommit = (args: PropertyUpdatedArgs) => {\n // istanbul ignore else\n if (this.props.onEditCommit) {\n this.props.onEditCommit(args);\n }\n };\n\n private _onEditCancel = () => {\n // istanbul ignore else\n if (this.props.onEditCancel) {\n this.props.onEditCancel();\n }\n };\n\n /** Display property record value in an editor */\n public updateDisplayValueAsEditor(props: PropertyRendererProps) {\n this.setState({\n displayValue: (\n <EditorContainer\n propertyRecord={props.propertyRecord}\n onCommit={this._onEditCommit}\n onCancel={this._onEditCancel}\n setFocus={true}\n />\n ),\n });\n }\n\n /** @internal */\n public override componentDidMount() {\n this.updateDisplayValue(this.props);\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyRendererProps) {\n if (\n prevProps.propertyRecord !== this.props.propertyRecord ||\n prevProps.isEditing !== this.props.isEditing ||\n prevProps.orientation !== this.props.orientation\n ) {\n this.updateDisplayValue(this.props);\n }\n }\n\n /** @internal */\n public override render() {\n const { ...props } = this.props;\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...props,\n valueElement: this.state.displayValue,\n indentation: this.props.indentation,\n };\n\n switch (this.props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (\n <PrimitivePropertyRenderer {...primitiveRendererProps} />\n );\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n && this.props.propertyRecord.value.items.length === 0)\n return (\n <PrimitivePropertyRenderer {...primitiveRendererProps} />\n );\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n return (\n <NonPrimitivePropertyRenderer\n isCollapsible={true}\n {...primitiveRendererProps}\n />\n );\n }\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./PropertyView.scss";
|
|
3
|
-
import type { SharedRendererProps } from "./PropertyRender";
|
|
4
|
-
/** Properties of [[PropertyView]] React component
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface PropertyViewProps extends SharedRendererProps {
|
|
8
|
-
/** Property label as a React element */
|
|
9
|
-
labelElement: React.ReactNode;
|
|
10
|
-
/** Property value as a React element */
|
|
11
|
-
valueElement?: React.ReactNode;
|
|
12
|
-
/** Render callback for property value. If specified, `valueElement` is ignored. */
|
|
13
|
-
valueElementRenderer?: () => React.ReactNode;
|
|
14
|
-
/** Multiplier of how much the property is indented to the right */
|
|
15
|
-
indentation?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A React component that renders property as label/value pair
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare const PropertyView: (props: PropertyViewProps) => JSX.Element;
|
|
22
|
-
//# sourceMappingURL=PropertyView.d.ts.map
|
|
@@ -1,232 +0,0 @@
|
|
|
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.PropertyView = 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_1 = __importStar(require("react"));
|
|
28
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
29
|
-
const core_react_1 = require("@itwin/core-react");
|
|
30
|
-
const components_react_1 = require("@itwin/components-react");
|
|
31
|
-
require("./PropertyView.scss");
|
|
32
|
-
const PropertyGridColumns_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns");
|
|
33
|
-
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
-
const CommonPropertyRenderer_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer");
|
|
35
|
-
const PropertyGridWrapperContext_1 = require("../context/PropertyGridWrapperContext");
|
|
36
|
-
/**
|
|
37
|
-
* A React component that renders property as label/value pair
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
const PropertyView = (props) => {
|
|
41
|
-
var _a;
|
|
42
|
-
const [isCheckboxLoading, setIsCheckboxLoading] = react_1.useState(false);
|
|
43
|
-
const { currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery, isUpdating, } = PropertyGridWrapperContext_1.usePropertyGridWrapper();
|
|
44
|
-
const _validatePropertySelection = () => {
|
|
45
|
-
if (currentPropertyList.includes(props.propertyRecord)) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
// Check if all subproperties are selected
|
|
49
|
-
if (!_validateNestedPropertiesSelection(props.propertyRecord)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
};
|
|
54
|
-
const _validateNestedPropertiesSelection = (prop) => {
|
|
55
|
-
switch (prop.value.valueFormat) {
|
|
56
|
-
case appui_abstract_1.PropertyValueFormat.Primitive:
|
|
57
|
-
if (!currentPropertyList.includes(prop)) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
break;
|
|
61
|
-
case appui_abstract_1.PropertyValueFormat.Array:
|
|
62
|
-
if (prop.value.items.length === 0) {
|
|
63
|
-
if (!currentPropertyList.includes(prop)) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
case appui_abstract_1.PropertyValueFormat.Struct:
|
|
69
|
-
for (const subPropName in prop.value.members) {
|
|
70
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
71
|
-
if (!_validateNestedPropertiesSelection(prop.value.members[subPropName])) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
};
|
|
79
|
-
const [isHovered, setIsHovered] = react_1.useState(false);
|
|
80
|
-
const [isPropertySelected, setIsPropertySelected] = react_1.useState(_validatePropertySelection());
|
|
81
|
-
const _addSelectedProperty = react_1.useCallback(async (prop) => {
|
|
82
|
-
var _a;
|
|
83
|
-
// TODO: roof selected item/category value is an object but format is primitive(needs further exploration)
|
|
84
|
-
if (!currentPropertyList.includes(prop) &&
|
|
85
|
-
prop.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive) {
|
|
86
|
-
if (!(await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.addProperty(prop)))) {
|
|
87
|
-
setIsCheckboxLoading(false);
|
|
88
|
-
setIsPropertySelected(false);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
setCurrentPropertyList(currentPropertyList.concat(prop));
|
|
92
|
-
setQuery((_a = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _a !== void 0 ? _a : "");
|
|
93
|
-
}
|
|
94
|
-
}, [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]);
|
|
95
|
-
const _addNestedProperties = react_1.useCallback((prop) => {
|
|
96
|
-
switch (prop.value.valueFormat) {
|
|
97
|
-
case appui_abstract_1.PropertyValueFormat.Primitive:
|
|
98
|
-
void _addSelectedProperty(prop);
|
|
99
|
-
break;
|
|
100
|
-
case appui_abstract_1.PropertyValueFormat.Array:
|
|
101
|
-
if (prop.value.items.length === 0) {
|
|
102
|
-
void _addSelectedProperty(prop);
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
case appui_abstract_1.PropertyValueFormat.Struct:
|
|
106
|
-
for (const subPropName in prop.value.members) {
|
|
107
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
108
|
-
_addNestedProperties(prop.value.members[subPropName]);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, [_addSelectedProperty]);
|
|
113
|
-
const _removeSelectedProperty = react_1.useCallback(async (prop) => {
|
|
114
|
-
var _a;
|
|
115
|
-
if (currentPropertyList.includes(prop)) {
|
|
116
|
-
setCurrentPropertyList(currentPropertyList.filter((x) => x !== prop));
|
|
117
|
-
await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.removeProperty(prop));
|
|
118
|
-
setQuery((_a = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _a !== void 0 ? _a : "");
|
|
119
|
-
}
|
|
120
|
-
}, [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]);
|
|
121
|
-
const _removeNestedProperties = react_1.useCallback((prop) => {
|
|
122
|
-
switch (prop.value.valueFormat) {
|
|
123
|
-
case appui_abstract_1.PropertyValueFormat.Primitive:
|
|
124
|
-
void _removeSelectedProperty(prop);
|
|
125
|
-
break;
|
|
126
|
-
case appui_abstract_1.PropertyValueFormat.Array:
|
|
127
|
-
if (prop.value.items.length === 0) {
|
|
128
|
-
void _removeSelectedProperty(prop);
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
case appui_abstract_1.PropertyValueFormat.Struct:
|
|
132
|
-
for (const subPropName in prop.value.members) {
|
|
133
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
134
|
-
_removeNestedProperties(prop.value.members[subPropName]);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}, [_removeSelectedProperty]);
|
|
139
|
-
react_1.useEffect(() => {
|
|
140
|
-
if (!currentPropertyList.includes(props.propertyRecord)) {
|
|
141
|
-
setIsPropertySelected(false);
|
|
142
|
-
}
|
|
143
|
-
}, [currentPropertyList, props.propertyRecord]);
|
|
144
|
-
react_1.useEffect(() => {
|
|
145
|
-
if (props === null || props === void 0 ? void 0 : props.propertyRecord) {
|
|
146
|
-
if (isPropertySelected) {
|
|
147
|
-
if (isUpdating) {
|
|
148
|
-
setIsCheckboxLoading(true);
|
|
149
|
-
}
|
|
150
|
-
_addNestedProperties(props.propertyRecord);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
_removeNestedProperties(props.propertyRecord);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, [
|
|
157
|
-
_addNestedProperties,
|
|
158
|
-
_removeNestedProperties,
|
|
159
|
-
isPropertySelected,
|
|
160
|
-
props.propertyRecord,
|
|
161
|
-
isUpdating,
|
|
162
|
-
]);
|
|
163
|
-
react_1.useEffect(() => {
|
|
164
|
-
if (!isUpdating) {
|
|
165
|
-
setIsCheckboxLoading(false);
|
|
166
|
-
}
|
|
167
|
-
}, [isUpdating]);
|
|
168
|
-
const _onPropertySelectionChanged = () => {
|
|
169
|
-
setIsPropertySelected(!isPropertySelected);
|
|
170
|
-
};
|
|
171
|
-
const _onClick = () => {
|
|
172
|
-
if (props.onClick) {
|
|
173
|
-
props.onClick(props.propertyRecord, props.uniqueKey);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const _onMouseEnter = () => {
|
|
177
|
-
if (props.isHoverable) {
|
|
178
|
-
setIsHovered(true);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const _onMouseLeave = () => {
|
|
182
|
-
if (props.isHoverable) {
|
|
183
|
-
setIsHovered(false);
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
const _onContextMenu = (e) => {
|
|
187
|
-
if (props.onContextMenu) {
|
|
188
|
-
props.onContextMenu(props.propertyRecord, e);
|
|
189
|
-
}
|
|
190
|
-
if (props.onRightClick) {
|
|
191
|
-
props.onRightClick(props.propertyRecord, props.uniqueKey);
|
|
192
|
-
}
|
|
193
|
-
e.preventDefault();
|
|
194
|
-
return false;
|
|
195
|
-
};
|
|
196
|
-
const getClassName = (viewProps) => {
|
|
197
|
-
let propertyRecordClassName = viewProps.orientation === core_react_1.Orientation.Horizontal
|
|
198
|
-
? "gmw-components-property-record--horizontal"
|
|
199
|
-
: "gmw-components-property-record--vertical";
|
|
200
|
-
if (viewProps.isSelected) {
|
|
201
|
-
propertyRecordClassName += " components--selected";
|
|
202
|
-
}
|
|
203
|
-
if (viewProps.onClick) {
|
|
204
|
-
propertyRecordClassName += " components--clickable";
|
|
205
|
-
}
|
|
206
|
-
if (viewProps.isHoverable) {
|
|
207
|
-
propertyRecordClassName += " components--hoverable";
|
|
208
|
-
}
|
|
209
|
-
return propertyRecordClassName;
|
|
210
|
-
};
|
|
211
|
-
const ratio = props.columnRatio ? props.columnRatio : 0.25;
|
|
212
|
-
const needElementSeparator = props.orientation === core_react_1.Orientation.Horizontal &&
|
|
213
|
-
!!props.onColumnRatioChanged;
|
|
214
|
-
const needActionButtons = !!props.actionButtonRenderers;
|
|
215
|
-
const columnsStyleProvider = new PropertyGridColumns_1.PropertyGridColumnStyleProvider(props.columnInfo);
|
|
216
|
-
const offset = CommonPropertyRenderer_1.CommonPropertyRenderer.getLabelOffset(props.indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
|
|
217
|
-
return (react_1.default.createElement("div", { style: columnsStyleProvider.getStyle(props.orientation, needActionButtons, ratio, needElementSeparator), className: getClassName(props), onClick: _onClick, onContextMenu: _onContextMenu, onMouseEnter: _onMouseEnter, onMouseLeave: _onMouseLeave, role: "presentation" },
|
|
218
|
-
react_1.default.createElement("div", { className: "gmw-components-property-record-label" },
|
|
219
|
-
props.propertyRecord.value.valueFormat ===
|
|
220
|
-
appui_abstract_1.PropertyValueFormat.Primitive && (react_1.default.createElement(itwinui_react_1.Checkbox, { style: { marginLeft: offset }, className: "gmw-components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: isUpdating ||
|
|
221
|
-
props.propertyRecord.value.value === undefined, isLoading: isCheckboxLoading })),
|
|
222
|
-
props.labelElement),
|
|
223
|
-
needElementSeparator ? (react_1.default.createElement(core_react_1.ElementSeparator, { movableArea: props.width, onRatioChanged: props.onColumnRatioChanged, ratio: ratio, orientation: props.orientation, isResizeHandleHovered: props.isResizeHandleHovered, onResizeHandleHoverChanged: props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: props.isResizeHandleBeingDragged, onResizeHandleDragChanged: props.onResizeHandleDragChanged })) : undefined,
|
|
224
|
-
props.propertyRecord.value.valueFormat ===
|
|
225
|
-
appui_abstract_1.PropertyValueFormat.Primitive ? (react_1.default.createElement("div", { className: "gmw-components-property-record-value" },
|
|
226
|
-
react_1.default.createElement("span", null, props.valueElementRenderer
|
|
227
|
-
? props.valueElementRenderer()
|
|
228
|
-
: props.valueElement))) : undefined,
|
|
229
|
-
props.actionButtonRenderers ? (react_1.default.createElement(components_react_1.ActionButtonList, { orientation: props.orientation, property: props.propertyRecord, isPropertyHovered: isHovered, actionButtonRenderers: props.actionButtonRenderers })) : undefined));
|
|
230
|
-
};
|
|
231
|
-
exports.PropertyView = PropertyView;
|
|
232
|
-
//# sourceMappingURL=PropertyView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAgE;AAEhE,0DAA4D;AAC5D,kDAAkE;AAClE,8DAA2D;AAC3D,+BAA6B;AAE7B,mIAA4I;AAC5I,wDAAgD;AAChD,yIAAsI;AACtI,sFAA+E;AAgB/E;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;;IACvD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,gBAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,EACJ,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,QAAQ,EACR,UAAU,GACX,GAAG,mDAAsB,EAAE,CAAC;IAE7B,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAA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ACL,oBAAoB,CAAC,CAAC,CAAC,CACtB,8BAAC,6BAAgB,IACf,WAAW,EAAE,KAAK,CAAC,KAAK,EACxB,cAAc,EAAE,KAAK,CAAC,oBAAoB,EAC1C,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,GAC1D,CACH,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW;YACrC,oCAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAC9B,uCAAK,SAAS,EAAC,sCAAsC;YACnD,4CACG,KAAK,CAAC,oBAAoB;gBACzB,CAAC,CAAC,KAAK,CAAC,oBAAoB,EAAE;gBAC9B,CAAC,CAAC,KAAK,CAAC,YAAY,CACjB,CACH,CACP,CAAC,CAAC,CAAC,SAAS;QACd,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAC7B,8BAAC,mCAAgB,IACf,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,iBAAiB,EAAE,SAAS,EAC5B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CAAC,CAAC,CAAC,SAAS,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AAvTW,QAAA,YAAY,gBAuTvB","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, useState } from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { ElementSeparator, Orientation } from \"@itwin/core-react\";\nimport { ActionButtonList } from \"@itwin/components-react\";\nimport \"./PropertyView.scss\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { PropertyGridColumnStyleProvider } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { usePropertyGridWrapper } from \"../context/PropertyGridWrapperContext\";\n\n/** Properties of [[PropertyView]] React component\n * @public\n */\nexport interface PropertyViewProps extends SharedRendererProps {\n /** Property label as a React element */\n labelElement: React.ReactNode;\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored. */\n valueElementRenderer?: () => React.ReactNode;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n}\n\n/**\n * A React component that renders property as label/value pair\n * @public\n */\nexport const PropertyView = (props: PropertyViewProps) => {\n const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);\n const {\n currentPropertyList,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n isUpdating,\n } = usePropertyGridWrapper();\n\n const _validatePropertySelection = () => {\n if (currentPropertyList.includes(props.propertyRecord)) {\n return true;\n }\n // Check if all subproperties are selected\n if (!_validateNestedPropertiesSelection(props.propertyRecord)) {\n return false;\n }\n return true;\n };\n\n const _validateNestedPropertiesSelection = (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n if (!currentPropertyList.includes(prop)) {\n return false;\n }\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n if (!currentPropertyList.includes(prop)) {\n return false;\n }\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n if (\n !_validateNestedPropertiesSelection(\n prop.value.members[subPropName]\n )\n ) {\n return false;\n }\n }\n }\n }\n return true;\n };\n\n const [isHovered, setIsHovered] = useState<boolean>(false);\n const [isPropertySelected, setIsPropertySelected] = useState<boolean>(\n _validatePropertySelection()\n );\n\n const _addSelectedProperty = useCallback(\n async (prop: PropertyRecord) => {\n // TODO: roof selected item/category value is an object but format is primitive(needs further exploration)\n if (\n !currentPropertyList.includes(prop) &&\n prop.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n if (!(await queryBuilder?.addProperty(prop))) {\n setIsCheckboxLoading(false);\n setIsPropertySelected(false);\n return;\n }\n setCurrentPropertyList(\n currentPropertyList.concat(prop)\n );\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n },\n [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]\n );\n\n const _addNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _addSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _addSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _addNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_addSelectedProperty]\n );\n\n const _removeSelectedProperty = useCallback(\n async (prop: PropertyRecord): Promise<void> => {\n if (currentPropertyList.includes(prop)) {\n setCurrentPropertyList(\n currentPropertyList.filter((x: PropertyRecord) => x !== prop)\n );\n await queryBuilder?.removeProperty(prop);\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n },\n [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]\n );\n\n const _removeNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _removeSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _removeSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _removeNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_removeSelectedProperty]\n );\n\n useEffect(() => {\n if (!currentPropertyList.includes(props.propertyRecord)) {\n setIsPropertySelected(false);\n }\n }, [currentPropertyList, props.propertyRecord]);\n\n useEffect(() => {\n if (props?.propertyRecord) {\n if (isPropertySelected) {\n if (isUpdating) {\n setIsCheckboxLoading(true);\n }\n _addNestedProperties(props.propertyRecord);\n } else {\n _removeNestedProperties(props.propertyRecord);\n }\n }\n }, [\n _addNestedProperties,\n _removeNestedProperties,\n isPropertySelected,\n props.propertyRecord,\n isUpdating,\n ]);\n\n useEffect(() => {\n if (!isUpdating) {\n setIsCheckboxLoading(false);\n }\n }, [isUpdating]);\n\n const _onPropertySelectionChanged = () => {\n setIsPropertySelected(!isPropertySelected);\n };\n\n const _onClick = () => {\n if (props.onClick) {\n props.onClick(props.propertyRecord, props.uniqueKey);\n }\n };\n\n const _onMouseEnter = () => {\n if (props.isHoverable) {\n setIsHovered(true);\n }\n };\n\n const _onMouseLeave = () => {\n if (props.isHoverable) {\n setIsHovered(false);\n }\n };\n\n const _onContextMenu = (e: React.MouseEvent) => {\n if (props.onContextMenu) {\n props.onContextMenu(props.propertyRecord, e);\n }\n if (props.onRightClick) {\n props.onRightClick(props.propertyRecord, props.uniqueKey);\n }\n e.preventDefault();\n return false;\n };\n\n const getClassName = (viewProps: PropertyViewProps) => {\n let propertyRecordClassName =\n viewProps.orientation === Orientation.Horizontal\n ? \"gmw-components-property-record--horizontal\"\n : \"gmw-components-property-record--vertical\";\n if (viewProps.isSelected) {\n propertyRecordClassName += \" components--selected\";\n }\n if (viewProps.onClick) {\n propertyRecordClassName += \" components--clickable\";\n }\n if (viewProps.isHoverable) {\n propertyRecordClassName += \" components--hoverable\";\n }\n return propertyRecordClassName;\n };\n\n const ratio = props.columnRatio ? props.columnRatio : 0.25;\n const needElementSeparator =\n props.orientation === Orientation.Horizontal &&\n !!props.onColumnRatioChanged;\n const needActionButtons = !!props.actionButtonRenderers;\n const columnsStyleProvider = new PropertyGridColumnStyleProvider(\n props.columnInfo\n );\n\n const offset = CommonPropertyRenderer.getLabelOffset(\n props.indentation,\n props.orientation,\n props.width,\n props.columnRatio,\n props.columnInfo?.minLabelWidth\n );\n\n return (\n <div\n style={columnsStyleProvider.getStyle(\n props.orientation,\n needActionButtons,\n ratio,\n needElementSeparator\n )}\n className={getClassName(props)}\n onClick={_onClick}\n onContextMenu={_onContextMenu}\n onMouseEnter={_onMouseEnter}\n onMouseLeave={_onMouseLeave}\n role=\"presentation\"\n >\n <div className=\"gmw-components-property-record-label\">\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive && (\n <Checkbox\n style={{ marginLeft: offset }}\n className=\"gmw-components-property-selection-checkbox\"\n checked={isPropertySelected}\n onChange={_onPropertySelectionChanged}\n disabled={\n isUpdating ||\n props.propertyRecord.value.value === undefined\n }\n isLoading={isCheckboxLoading}\n />\n )}\n {props.labelElement}\n </div>\n {needElementSeparator ? (\n <ElementSeparator\n movableArea={props.width}\n onRatioChanged={props.onColumnRatioChanged}\n ratio={ratio}\n orientation={props.orientation}\n isResizeHandleHovered={props.isResizeHandleHovered}\n onResizeHandleHoverChanged={props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={props.onResizeHandleDragChanged}\n />\n ) : undefined}\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive ? (\n <div className=\"gmw-components-property-record-value\">\n <span>\n {props.valueElementRenderer\n ? props.valueElementRenderer()\n : props.valueElement}\n </span>\n </div>\n ) : undefined}\n {props.actionButtonRenderers ? (\n <ActionButtonList\n orientation={props.orientation}\n property={props.propertyRecord}\n isPropertyHovered={isHovered}\n actionButtonRenderers={props.actionButtonRenderers}\n />\n ) : undefined}\n </div>\n );\n};\n"]}
|
|
@@ -1,77 +0,0 @@
|
|
|
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/core-react/lib/cjs/core-react/style/themecolors';
|
|
6
|
-
@import '~@itwin/itwinui-css/scss/style/typography';
|
|
7
|
-
@import '~@itwin/itwinui-css/scss/variables';
|
|
8
|
-
|
|
9
|
-
$text-font-size: $iui-font-size;
|
|
10
|
-
$text-font-color: $buic-text-color;
|
|
11
|
-
|
|
12
|
-
.gmw-components-property-record--horizontal {
|
|
13
|
-
height: 100%;
|
|
14
|
-
display: grid;
|
|
15
|
-
padding: 0 8px;
|
|
16
|
-
|
|
17
|
-
.gmw-components-property-record-label {
|
|
18
|
-
font-size: $iui-font-size-small;
|
|
19
|
-
color: $buic-foreground-muted;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.gmw-components-property-record-value {
|
|
23
|
-
min-height: 24px;
|
|
24
|
-
font-size: $text-font-size;
|
|
25
|
-
color: $text-font-color;
|
|
26
|
-
padding: 0px 5px;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.gmw-components-property-record--vertical {
|
|
31
|
-
height: 100%;
|
|
32
|
-
padding: 0 8px;
|
|
33
|
-
display: grid;
|
|
34
|
-
align-content: center;
|
|
35
|
-
|
|
36
|
-
.gmw-components-property-record-label {
|
|
37
|
-
font-size: $iui-font-size-small;
|
|
38
|
-
color: $buic-foreground-muted;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.gmw-components-property-record-value {
|
|
42
|
-
min-height: 22px;
|
|
43
|
-
font-size: $text-font-size;
|
|
44
|
-
color: $text-font-color;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@mixin gmw-record-cell {
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.gmw-components-property-record-label {
|
|
54
|
-
@include gmw-record-cell;
|
|
55
|
-
position: relative;
|
|
56
|
-
.gmw-components-property-selection-checkbox {
|
|
57
|
-
flex-shrink: 0;
|
|
58
|
-
position: absolute;
|
|
59
|
-
z-index: 1;
|
|
60
|
-
}
|
|
61
|
-
// Radial does not respect checkbox positioning, have to force it.
|
|
62
|
-
> .gmw-iui-progress-indicator-radial {
|
|
63
|
-
position: absolute;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.gmw-components-property-record-value {
|
|
68
|
-
@include gmw-record-cell;
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
|
|
71
|
-
span {
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
text-overflow: ellipsis;
|
|
75
|
-
width: 100%;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Common
|
|
3
|
-
*/
|
|
4
|
-
/** Counts how many times string 'lookup' is repeated in string 'str'.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare function countMatchesInString(str: string, lookup: string): number;
|
|
8
|
-
//# sourceMappingURL=countMatchesInString.d.ts.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/* @author Vitim.us https://gist.github.com/victornpb/7736865 */
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.countMatchesInString = void 0;
|
|
9
|
-
/** @packageDocumentation
|
|
10
|
-
* @module Common
|
|
11
|
-
*/
|
|
12
|
-
/** Counts how many times string 'lookup' is repeated in string 'str'.
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
function countMatchesInString(str, lookup) {
|
|
16
|
-
if (!str.length || !lookup.length)
|
|
17
|
-
return 0;
|
|
18
|
-
let n = 0, pos = 0;
|
|
19
|
-
const step = lookup.length;
|
|
20
|
-
while (true) {
|
|
21
|
-
pos = str.indexOf(lookup, pos);
|
|
22
|
-
if (pos >= 0) {
|
|
23
|
-
++n;
|
|
24
|
-
pos += step;
|
|
25
|
-
}
|
|
26
|
-
else
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
return n;
|
|
30
|
-
}
|
|
31
|
-
exports.countMatchesInString = countMatchesInString;
|
|
32
|
-
//# sourceMappingURL=countMatchesInString.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"countMatchesInString.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/countMatchesInString.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,gEAAgE;;;AAEhE;;GAEG;AAEH;;GAEG;AACH,SAAgB,oBAAoB,CAAC,GAAW,EAAE,MAAc;IAC9D,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM;QAC/B,OAAO,CAAC,CAAC;IAEX,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAE3B,OAAO,IAAI,EAAE;QACX,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,GAAG,IAAI,CAAC,EAAE;YACZ,EAAE,CAAC,CAAC;YACJ,GAAG,IAAI,IAAI,CAAC;SACb;;YACC,MAAM;KACT;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAhBD,oDAgBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* @author Vitim.us https://gist.github.com/victornpb/7736865 */\n\n/** @packageDocumentation\n * @module Common\n */\n\n/** Counts how many times string 'lookup' is repeated in string 'str'.\n * @internal\n */\nexport function countMatchesInString(str: string, lookup: string) {\n if (!str.length || !lookup.length)\n return 0;\n\n let n = 0, pos = 0;\n const step = lookup.length;\n\n while (true) {\n pos = str.indexOf(lookup, pos);\n if (pos >= 0) {\n ++n;\n pos += step;\n } else\n break;\n }\n return n;\n}\n"]}
|