@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,91 +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.NonPrimitivePropertyRenderer = 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 CommonPropertyRenderer_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer");
|
|
30
|
-
const components_react_1 = require("@itwin/components-react");
|
|
31
|
-
const PropertyRender_1 = require("./PropertyRender");
|
|
32
|
-
const PropertyView_1 = require("./PropertyView");
|
|
33
|
-
/** React Component that renders struct and array properties
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
class NonPrimitivePropertyRenderer extends React.Component {
|
|
37
|
-
constructor() {
|
|
38
|
-
super(...arguments);
|
|
39
|
-
/** @internal */
|
|
40
|
-
this.state = {
|
|
41
|
-
/** If it's not collapsible, that means it's expanded by default and can't be collapsed */
|
|
42
|
-
isExpanded: !this.props.isCollapsible || this.props.propertyRecord.autoExpand,
|
|
43
|
-
};
|
|
44
|
-
this._onExpanded = () => {
|
|
45
|
-
this.setState({ isExpanded: true });
|
|
46
|
-
};
|
|
47
|
-
this._onCollapsed = () => {
|
|
48
|
-
this.setState({ isExpanded: false });
|
|
49
|
-
};
|
|
50
|
-
this._renderPropertyForItem = (item) => {
|
|
51
|
-
const prefix = this.props.uniqueKey
|
|
52
|
-
? this.props.uniqueKey
|
|
53
|
-
: this.props.propertyRecord.property.name;
|
|
54
|
-
const uniqueKey = `${prefix}_${item.property.name}`;
|
|
55
|
-
return (React.createElement(PropertyRender_1.PropertyRenderer, { key: uniqueKey, uniqueKey: uniqueKey, propertyRecord: item, indentation: this.props.indentation ? this.props.indentation + 1 : 1, orientation: this.props.orientation, columnRatio: this.props.columnRatio, actionButtonRenderers: this.props.actionButtonRenderers, onColumnRatioChanged: this.props.onColumnRatioChanged, width: this.props.width, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged, columnInfo: this.props.columnInfo }));
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
getLabel(props, state) {
|
|
59
|
-
const { orientation, indentation, width, columnRatio, columnInfo } = props;
|
|
60
|
-
const offset = CommonPropertyRenderer_1.CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.minLabelWidth);
|
|
61
|
-
let displayLabel = props.propertyRecord.property.displayLabel;
|
|
62
|
-
if (this.props.propertyRecord.value.valueFormat === appui_abstract_1.PropertyValueFormat.Array) {
|
|
63
|
-
displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;
|
|
64
|
-
}
|
|
65
|
-
return (React.createElement(components_react_1.NonPrimitivePropertyLabelRenderer, { isExpanded: !!state.isExpanded, onExpand: this._onExpanded, onCollapse: this._onCollapsed, offset: offset, renderColon: false }, displayLabel));
|
|
66
|
-
}
|
|
67
|
-
overrideArrayChildrenNames(items) {
|
|
68
|
-
const modifiedProperties = items.map((item, index) => {
|
|
69
|
-
const newProperty = { ...item.property };
|
|
70
|
-
newProperty.displayLabel = `[${index + 1}]`;
|
|
71
|
-
newProperty.name = `${newProperty.name}_${index}`;
|
|
72
|
-
return new appui_abstract_1.PropertyRecord(item.value, newProperty);
|
|
73
|
-
});
|
|
74
|
-
return modifiedProperties;
|
|
75
|
-
}
|
|
76
|
-
/** @internal */
|
|
77
|
-
render() {
|
|
78
|
-
let items = this.props.propertyRecord.getChildrenRecords();
|
|
79
|
-
if (this.props.propertyRecord.value.valueFormat === appui_abstract_1.PropertyValueFormat.Array) {
|
|
80
|
-
items = this.overrideArrayChildrenNames(items);
|
|
81
|
-
}
|
|
82
|
-
const { ...props } = this.props;
|
|
83
|
-
return (React.createElement(React.Fragment, null,
|
|
84
|
-
this.props.isCollapsible ? (React.createElement(PropertyView_1.PropertyView, { labelElement: this.getLabel(this.props, this.state), ...props })) : undefined,
|
|
85
|
-
this.state.isExpanded
|
|
86
|
-
? items.map(this._renderPropertyForItem)
|
|
87
|
-
: undefined));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.NonPrimitivePropertyRenderer = NonPrimitivePropertyRenderer;
|
|
91
|
-
//# sourceMappingURL=NonPrimitivePropertyRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAC/B,0DAA4E;AAC5E,yIAAsI;AACtI,8DAA4E;AAC5E,qDAAoD;AACpD,iDAA8C;AAoB9C;;GAEG;AACH,MAAa,4BAA6B,SAAQ,KAAK,CAAC,SAGvD;IAHD;;QAIE,gBAAgB;QACS,UAAK,GAAsC;YAClE,0FAA0F;YAC1F,UAAU,EACR,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU;SACpE,CAAC;QAEM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC;QAEM,iBAAY,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC;QAgDM,2BAAsB,GAAG,CAAC,IAAoB,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS;gBACjC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS;gBACtB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5C,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,OAAO,CACL,oBAAC,iCAAgB,IACf,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,IAAI,EACpB,WAAW,EAAE,IAAI,CAAC,KAAK,C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,KAC/C,KAAK,GACT,CACH,CAAC,CAAC,CAAC,SAAS;YAEZ,IAAI,CAAC,KAAK,CAAC,UAAU;gBACpB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC;gBACxC,CAAC,CAAC,SAAS,CACZ,CACJ,CAAC;IACJ,CAAC;CACF;AApHD,oEAoHC","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 { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"@itwin/components-react\";\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport { PropertyView } from \"./PropertyView\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\n\n/** Properties of [[NonPrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface NonPrimitivePropertyRendererProps\n extends PrimitiveRendererProps {\n /** Can struct/array property be collapsed */\n isCollapsible?: boolean;\n}\n\n/** State of [[NonPrimitivePropertyRenderer]] React component\n * @internal\n */\ninterface NonPrimitivePropertyRendererState {\n /** Is struct/array property expanded */\n isExpanded?: boolean;\n}\n\n/** React Component that renders struct and array properties\n * @public\n */\nexport class NonPrimitivePropertyRenderer extends React.Component<\nNonPrimitivePropertyRendererProps,\nNonPrimitivePropertyRendererState\n> {\n /** @internal */\n public override readonly state: NonPrimitivePropertyRendererState = {\n /** If it's not collapsible, that means it's expanded by default and can't be collapsed */\n isExpanded:\n !this.props.isCollapsible || this.props.propertyRecord.autoExpand,\n };\n\n private _onExpanded = () => {\n this.setState({ isExpanded: true });\n };\n\n private _onCollapsed = () => {\n this.setState({ isExpanded: false });\n };\n\n private getLabel(\n props: NonPrimitivePropertyRendererProps,\n state: NonPrimitivePropertyRendererState,\n ): React.ReactNode {\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n columnInfo?.minLabelWidth,\n );\n\n let displayLabel = props.propertyRecord.property.displayLabel;\n if (\n this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n ) {\n displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;\n }\n\n return (\n <NonPrimitivePropertyLabelRenderer\n isExpanded={!!state.isExpanded}\n onExpand={this._onExpanded}\n onCollapse={this._onCollapsed}\n offset={offset}\n renderColon={false}\n >\n {displayLabel}\n </NonPrimitivePropertyLabelRenderer>\n );\n }\n\n private overrideArrayChildrenNames(items: PropertyRecord[]) {\n const modifiedProperties: PropertyRecord[] = items.map(\n (item, index): PropertyRecord => {\n const newProperty = { ...item.property };\n newProperty.displayLabel = `[${index + 1}]`;\n newProperty.name = `${newProperty.name}_${index}`;\n return new PropertyRecord(item.value, newProperty);\n },\n );\n\n return modifiedProperties;\n }\n\n private _renderPropertyForItem = (item: PropertyRecord) => {\n const prefix = this.props.uniqueKey\n ? this.props.uniqueKey\n : this.props.propertyRecord.property.name;\n const uniqueKey = `${prefix}_${item.property.name}`;\n return (\n <PropertyRenderer\n key={uniqueKey}\n uniqueKey={uniqueKey}\n propertyRecord={item}\n indentation={this.props.indentation ? this.props.indentation + 1 : 1}\n orientation={this.props.orientation}\n columnRatio={this.props.columnRatio}\n actionButtonRenderers={this.props.actionButtonRenderers}\n onColumnRatioChanged={this.props.onColumnRatioChanged}\n width={this.props.width}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n columnInfo={this.props.columnInfo}\n />\n );\n };\n\n /** @internal */\n public override render() {\n let items: PropertyRecord[] =\n this.props.propertyRecord.getChildrenRecords();\n if (\n this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n ) {\n items = this.overrideArrayChildrenNames(items);\n }\n\n const { ...props } = this.props;\n return (\n <>\n {this.props.isCollapsible ? (\n <PropertyView\n labelElement={this.getLabel(this.props, this.state)}\n {...props}\n />\n ) : undefined}\n\n {this.state.isExpanded\n ? items.map(this._renderPropertyForItem)\n : undefined}\n </>\n );\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { HighlightingComponentProps } from "@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps";
|
|
3
|
-
import type { SharedRendererProps } from "./PropertyRender";
|
|
4
|
-
/** Properties of [[PrimitivePropertyRenderer]] React component
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface PrimitiveRendererProps extends SharedRendererProps {
|
|
8
|
-
/** Property value as a React element */
|
|
9
|
-
valueElement?: React.ReactNode;
|
|
10
|
-
/** Render callback for property value. If specified, `valueElement` is ignored. */
|
|
11
|
-
valueElementRenderer?: () => React.ReactNode;
|
|
12
|
-
/** Multiplier of how much the property is indented to the right */
|
|
13
|
-
indentation?: number;
|
|
14
|
-
/** Properties used for highlighting
|
|
15
|
-
* @beta
|
|
16
|
-
*/
|
|
17
|
-
highlight?: HighlightingComponentProps;
|
|
18
|
-
}
|
|
19
|
-
/** React Component that renders primitive properties
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {
|
|
23
|
-
/** @internal */
|
|
24
|
-
render(): JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=PrimitivePropertyRenderer.d.ts.map
|
|
@@ -1,62 +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.PrimitivePropertyRenderer = 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 core_react_1 = require("@itwin/core-react");
|
|
29
|
-
const components_react_1 = require("@itwin/components-react");
|
|
30
|
-
const HighlightedText_1 = require("@itwin/components-react/lib/cjs/components-react/common/HighlightedText");
|
|
31
|
-
const PropertyView_1 = require("./PropertyView");
|
|
32
|
-
const CommonPropertyRenderer_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer");
|
|
33
|
-
/** React Component that renders primitive properties
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
class PrimitivePropertyRenderer extends React.Component {
|
|
37
|
-
/** @internal */
|
|
38
|
-
render() {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
const { highlight, indentation, ...props } = this.props;
|
|
41
|
-
const displayLabel = this.props.propertyRecord.property.displayLabel;
|
|
42
|
-
const offset = CommonPropertyRenderer_1.CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
|
|
43
|
-
const activeMatchIndex = this.props.propertyRecord.property.name ===
|
|
44
|
-
((_b = highlight === null || highlight === void 0 ? void 0 : highlight.activeHighlight) === null || _b === void 0 ? void 0 : _b.highlightedItemIdentifier)
|
|
45
|
-
? highlight.activeHighlight.highlightIndex
|
|
46
|
-
: undefined;
|
|
47
|
-
const label = highlight
|
|
48
|
-
? HighlightedText_1.HighlightedText({
|
|
49
|
-
text: displayLabel,
|
|
50
|
-
searchText: highlight.highlightedText,
|
|
51
|
-
activeMatchIndex,
|
|
52
|
-
})
|
|
53
|
-
: displayLabel;
|
|
54
|
-
return (React.createElement(PropertyView_1.PropertyView, { ...this.props, labelElement: React.createElement(components_react_1.PrimitivePropertyLabelRenderer
|
|
55
|
-
// Added offset to account for checkbox
|
|
56
|
-
, {
|
|
57
|
-
// Added offset to account for checkbox
|
|
58
|
-
offset: offset + 24, renderColon: this.props.orientation === core_react_1.Orientation.Horizontal, tooltip: displayLabel }, label) }));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.PrimitivePropertyRenderer = PrimitivePropertyRenderer;
|
|
62
|
-
//# sourceMappingURL=PrimitivePropertyRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAC/B,kDAAgD;AAChD,8DAAyE;AAEzE,6GAA0G;AAE1G,iDAA8C;A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------------------\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 { Orientation } from \"@itwin/core-react\";\nimport { PrimitivePropertyLabelRenderer } from \"@itwin/components-react\";\nimport type { HighlightingComponentProps } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps\";\nimport { HighlightedText } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightedText\";\n\nimport { PropertyView } from \"./PropertyView\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\n\n/** Properties of [[PrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface PrimitiveRendererProps extends SharedRendererProps {\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 /** Properties used for highlighting\n * @beta\n */\n highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders primitive properties\n * @public\n */\nexport class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {\n /** @internal */\n public override render() {\n const { highlight, indentation, ...props } = this.props;\n const displayLabel = this.props.propertyRecord.property.displayLabel;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n props.orientation,\n props.width,\n props.columnRatio,\n props.columnInfo?.minLabelWidth,\n );\n\n const activeMatchIndex =\n this.props.propertyRecord.property.name ===\n highlight?.activeHighlight?.highlightedItemIdentifier\n ? highlight.activeHighlight.highlightIndex\n : undefined;\n const label = highlight\n ? HighlightedText({\n text: displayLabel,\n searchText: highlight.highlightedText,\n activeMatchIndex,\n })\n : displayLabel;\n\n return (\n <PropertyView\n {...this.props}\n labelElement={\n <PrimitivePropertyLabelRenderer\n // Added offset to account for checkbox\n offset={offset + 24}\n renderColon={this.props.orientation === Orientation.Horizontal}\n tooltip={displayLabel}\n >\n {label}\n </PrimitivePropertyLabelRenderer>\n }\n />\n );\n }\n}\n"]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { PropertyRecord } from "@itwin/appui-abstract";
|
|
3
|
-
import type { CommonPropertyGridProps, PropertyCategory } from "@itwin/components-react";
|
|
4
|
-
import { Orientation } from "@itwin/core-react";
|
|
5
|
-
import "./PropertyGrid.scss";
|
|
6
|
-
import type { PresentationPropertyDataProvider } from "@itwin/presentation-components";
|
|
7
|
-
/** Properties for [[PropertyGrid]] React component
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface PropertyGridProps extends CommonPropertyGridProps {
|
|
11
|
-
/** Property data provider */
|
|
12
|
-
dataProvider: PresentationPropertyDataProvider;
|
|
13
|
-
}
|
|
14
|
-
/** Property Category in the [[PropertyGrid]] state
|
|
15
|
-
* @public
|
|
16
|
-
* @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.
|
|
17
|
-
*/
|
|
18
|
-
export interface PropertyGridCategory {
|
|
19
|
-
propertyCategory: PropertyCategory;
|
|
20
|
-
propertyCount: number;
|
|
21
|
-
properties: PropertyRecord[];
|
|
22
|
-
}
|
|
23
|
-
interface CategorizedPropertyGridRecords {
|
|
24
|
-
category: PropertyCategory;
|
|
25
|
-
records: PropertyRecord[];
|
|
26
|
-
children: CategorizedPropertyGridRecords[];
|
|
27
|
-
}
|
|
28
|
-
/** State of [[PropertyGrid]] React component
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
interface PropertyGridState {
|
|
32
|
-
/** List of PropertyGrid categories */
|
|
33
|
-
categories: CategorizedPropertyGridRecords[];
|
|
34
|
-
/** Actual orientation used by the property grid */
|
|
35
|
-
orientation: Orientation;
|
|
36
|
-
/** If property grid currently loading data, the loading start time */
|
|
37
|
-
loadStart?: Date;
|
|
38
|
-
/** Width of PropertyGrid */
|
|
39
|
-
width: number;
|
|
40
|
-
}
|
|
41
|
-
/** PropertyGrid React component.
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export declare class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {
|
|
45
|
-
private _dataChangesListenerDisposeFunc?;
|
|
46
|
-
private _isMounted;
|
|
47
|
-
private _isInDataRequest;
|
|
48
|
-
private _hasPendingDataRequest;
|
|
49
|
-
static contextType: React.Context<import("../context/PropertyGridWrapperContext").PropertySelection>;
|
|
50
|
-
/** @internal */
|
|
51
|
-
constructor(props: PropertyGridProps);
|
|
52
|
-
/** @internal */
|
|
53
|
-
componentDidMount(): void;
|
|
54
|
-
/** @internal */
|
|
55
|
-
componentWillUnmount(): void;
|
|
56
|
-
componentDidUpdate(prevProps: PropertyGridProps): void;
|
|
57
|
-
private _onPropertyDataChanged;
|
|
58
|
-
private gatherData;
|
|
59
|
-
private getPreferredOrientation;
|
|
60
|
-
private _onResize;
|
|
61
|
-
private _onCategoryExpansionToggled;
|
|
62
|
-
private updateOrientation;
|
|
63
|
-
/** @internal */
|
|
64
|
-
render(): JSX.Element;
|
|
65
|
-
}
|
|
66
|
-
export {};
|
|
67
|
-
//# sourceMappingURL=PropertyGrid.d.ts.map
|
|
@@ -1,198 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.PropertyGrid = void 0;
|
|
26
|
-
/*---------------------------------------------------------------------------------------------
|
|
27
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
28
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
29
|
-
*--------------------------------------------------------------------------------------------*/
|
|
30
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
31
|
-
const immer_1 = require("immer");
|
|
32
|
-
const React = __importStar(require("react"));
|
|
33
|
-
const components_react_1 = require("@itwin/components-react");
|
|
34
|
-
const ColumnResizingPropertyListPropsSupplier_1 = require("@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier");
|
|
35
|
-
const core_react_1 = require("@itwin/core-react");
|
|
36
|
-
const PropertyList_1 = require("./PropertyList");
|
|
37
|
-
require("./PropertyGrid.scss");
|
|
38
|
-
const PropertyGridWrapperContext_1 = require("../context/PropertyGridWrapperContext");
|
|
39
|
-
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
40
|
-
/** PropertyGrid React component.
|
|
41
|
-
* @public
|
|
42
|
-
*/
|
|
43
|
-
class PropertyGrid extends React.Component {
|
|
44
|
-
/** @internal */
|
|
45
|
-
constructor(props) {
|
|
46
|
-
super(props);
|
|
47
|
-
this._isMounted = false;
|
|
48
|
-
this._isInDataRequest = false;
|
|
49
|
-
this._hasPendingDataRequest = false;
|
|
50
|
-
this._onPropertyDataChanged = () => {
|
|
51
|
-
void this.gatherData();
|
|
52
|
-
};
|
|
53
|
-
this._onResize = (width) => {
|
|
54
|
-
this.updateOrientation(width);
|
|
55
|
-
};
|
|
56
|
-
this._onCategoryExpansionToggled = (categoryName) => {
|
|
57
|
-
this.setState((state) => {
|
|
58
|
-
return immer_1.produce(state, (draft) => {
|
|
59
|
-
const records = findCategory(draft.categories, categoryName, true);
|
|
60
|
-
// istanbul ignore else
|
|
61
|
-
if (records) {
|
|
62
|
-
const category = records.category;
|
|
63
|
-
category.expand = !category.expand;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
this.state = {
|
|
69
|
-
categories: [],
|
|
70
|
-
orientation: this.getPreferredOrientation(),
|
|
71
|
-
width: 0,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/** @internal */
|
|
75
|
-
componentDidMount() {
|
|
76
|
-
this._isMounted = true;
|
|
77
|
-
this._dataChangesListenerDisposeFunc =
|
|
78
|
-
this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
79
|
-
void this.gatherData();
|
|
80
|
-
}
|
|
81
|
-
/** @internal */
|
|
82
|
-
componentWillUnmount() {
|
|
83
|
-
// istanbul ignore else
|
|
84
|
-
if (this._dataChangesListenerDisposeFunc) {
|
|
85
|
-
this._dataChangesListenerDisposeFunc();
|
|
86
|
-
this._dataChangesListenerDisposeFunc = undefined;
|
|
87
|
-
}
|
|
88
|
-
this._isMounted = false;
|
|
89
|
-
}
|
|
90
|
-
componentDidUpdate(prevProps) {
|
|
91
|
-
if (this.props.dataProvider !== prevProps.dataProvider) {
|
|
92
|
-
// istanbul ignore else
|
|
93
|
-
if (this._dataChangesListenerDisposeFunc) {
|
|
94
|
-
this._dataChangesListenerDisposeFunc();
|
|
95
|
-
}
|
|
96
|
-
this._dataChangesListenerDisposeFunc =
|
|
97
|
-
this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
98
|
-
void this.gatherData();
|
|
99
|
-
}
|
|
100
|
-
if (this.props.orientation !== prevProps.orientation ||
|
|
101
|
-
this.props.isOrientationFixed !== prevProps.isOrientationFixed ||
|
|
102
|
-
this.props.horizontalOrientationMinWidth !==
|
|
103
|
-
prevProps.horizontalOrientationMinWidth) {
|
|
104
|
-
this.updateOrientation(this.state.width);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
async gatherData() {
|
|
108
|
-
if (this._isInDataRequest) {
|
|
109
|
-
this._hasPendingDataRequest = true;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });
|
|
113
|
-
this._isInDataRequest = true;
|
|
114
|
-
let propertyData;
|
|
115
|
-
try {
|
|
116
|
-
propertyData = await this.props.dataProvider.getData();
|
|
117
|
-
}
|
|
118
|
-
finally {
|
|
119
|
-
this._isInDataRequest = false;
|
|
120
|
-
}
|
|
121
|
-
if (!this._isMounted) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (this._hasPendingDataRequest) {
|
|
125
|
-
this._hasPendingDataRequest = false;
|
|
126
|
-
return this.gatherData();
|
|
127
|
-
}
|
|
128
|
-
this.setState((prevState) => {
|
|
129
|
-
const buildCategoriesHierarchy = (newCategories, stateCategories) => newCategories.map((category) => {
|
|
130
|
-
var _a, _b, _c, _d;
|
|
131
|
-
const matchingStateCategory = findCategory(stateCategories !== null && stateCategories !== void 0 ? stateCategories : [], category.name, false);
|
|
132
|
-
return {
|
|
133
|
-
category: {
|
|
134
|
-
...category,
|
|
135
|
-
expand: (_b = (_a = matchingStateCategory === null || matchingStateCategory === void 0 ? void 0 : matchingStateCategory.category) === null || _a === void 0 ? void 0 : _a.expand) !== null && _b !== void 0 ? _b : category.expand,
|
|
136
|
-
},
|
|
137
|
-
records: (_c = propertyData.records[category.name]) !== null && _c !== void 0 ? _c : [],
|
|
138
|
-
children: buildCategoriesHierarchy((_d = category.childCategories) !== null && _d !== void 0 ? _d : [], matchingStateCategory === null || matchingStateCategory === void 0 ? void 0 : matchingStateCategory.children),
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
return {
|
|
142
|
-
categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),
|
|
143
|
-
loadStart: undefined,
|
|
144
|
-
};
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
getPreferredOrientation() {
|
|
148
|
-
return this.props.orientation !== undefined
|
|
149
|
-
? this.props.orientation
|
|
150
|
-
: core_react_1.Orientation.Horizontal;
|
|
151
|
-
}
|
|
152
|
-
updateOrientation(width) {
|
|
153
|
-
const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {
|
|
154
|
-
...this.props,
|
|
155
|
-
};
|
|
156
|
-
const currentOrientation = components_react_1.PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
|
|
157
|
-
if (currentOrientation !== this.state.orientation ||
|
|
158
|
-
width !== this.state.width) {
|
|
159
|
-
this.setState({ orientation: currentOrientation, width });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/** @internal */
|
|
163
|
-
render() {
|
|
164
|
-
var _a, _b;
|
|
165
|
-
if (this.state.loadStart) {
|
|
166
|
-
return (React.createElement("div", { className: "gmw-components-property-grid-loader" },
|
|
167
|
-
React.createElement(itwinui_react_1.ProgressRadial, { indeterminate: true })));
|
|
168
|
-
}
|
|
169
|
-
return (React.createElement("div", { className: "gmw-table-box-inner" },
|
|
170
|
-
React.createElement(components_react_1.PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: (_a = this.props.isPropertySelectionEnabled) !== null && _a !== void 0 ? _a : false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: (_b = this.props.isPropertyHoverEnabled) !== null && _b !== void 0 ? _b : false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: classnames_1.default("gmw-components-property-grid-wrapper", this.props.className), style: this.props.style },
|
|
171
|
-
React.createElement("div", { className: classnames_1.default("gmw-components-property-grid", "components-smallEditor-host") },
|
|
172
|
-
React.createElement("div", { className: "gmw-property-categories" }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
|
|
173
|
-
React.createElement(core_react_1.ResizableContainerObserver, { onResize: this._onResize }))))));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
exports.PropertyGrid = PropertyGrid;
|
|
177
|
-
PropertyGrid.contextType = PropertyGridWrapperContext_1.PropertyGridWrapperContext;
|
|
178
|
-
function findCategory(categories, lookupName, recurseIntoChildren) {
|
|
179
|
-
for (const category of categories) {
|
|
180
|
-
if (category.category.name === lookupName) {
|
|
181
|
-
return category;
|
|
182
|
-
}
|
|
183
|
-
if (recurseIntoChildren) {
|
|
184
|
-
const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);
|
|
185
|
-
if (matchingChild) {
|
|
186
|
-
return matchingChild;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
const NestedCategoryBlock = (props) => {
|
|
193
|
-
const [width, setWidth] = React.useState(1);
|
|
194
|
-
return (React.createElement(components_react_1.PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
|
|
195
|
-
props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier_1.ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation, width: width }, (partialListProps) => (React.createElement(PropertyList_1.PropertyList, { ...partialListProps, orientation: props.orientation, category: props.categorizedRecords.category, properties: props.categorizedRecords.records, selectedPropertyKey: props.selectedPropertyKey, onPropertyClicked: props.onPropertyClicked, onPropertyRightClicked: props.onPropertyRightClicked, onPropertyContextMenu: props.onPropertyContextMenu, propertyValueRendererManager: props.propertyValueRendererManager, editingPropertyKey: props.editingPropertyKey, onEditCommit: props.onEditCommit, onEditCancel: props.onEditCancel, isPropertyHoverEnabled: props.isPropertyHoverEnabled, isPropertySelectionEnabled: props.isPropertySelectionEnabled, isPropertyRightClickSelectionEnabled: props.isPropertyRightClickSelectionEnabled, actionButtonRenderers: props.actionButtonRenderers, setWidth: setWidth, width: width })))) : undefined,
|
|
196
|
-
props.categorizedRecords.children.length ? (React.createElement("div", { className: "gmw-property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
|
|
197
|
-
};
|
|
198
|
-
//# sourceMappingURL=PropertyGrid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,4DAAoC;AACpC,iCAAgC;AAChC,6CAA+B;AAQ/B,8DAIiC;AAEjC,6KAA0K;AAC1K,kDAA4E;AAG5E,iDAA8C;AAC9C,+BAA6B;AAG7B,sFAAmF;AACnF,wDAAsD;AAwCtD;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK,CAAC,SAGvC;IAQC,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QARP,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,C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AK,EAAE,KAAK,GACZ,CACH,CACuC,CAC3C,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1C,6BAAK,SAAS,EAAC,yBAAyB,IACrC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAClE,oBAAC,mBAAmB,OACd,KAAK,EACT,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAC1C,kBAAkB,EAAE,uBAAuB,GAC3C,CACH,CAAC,CACE,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport classnames from \"classnames\";\nimport { produce } from \"immer\";\nimport * as React from \"react\";\nimport type { DisposeFunc } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n CommonPropertyGridProps,\n PropertyCategory,\n PropertyData,\n} from \"@itwin/components-react\";\nimport {\n PropertyCategoryBlock,\n PropertyGridCommons,\n PropertyGridEventsRelatedPropsSupplier,\n} from \"@itwin/components-react\";\nimport type { ColumnResizeRelatedPropertyListProps } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { ColumnResizingPropertyListPropsSupplier } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\n\nimport type { PropertyListProps } from \"./PropertyList\";\nimport { PropertyList } from \"./PropertyList\";\nimport \"./PropertyGrid.scss\";\n\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/** Properties for [[PropertyGrid]] React component\n * @public\n */\nexport interface PropertyGridProps extends CommonPropertyGridProps {\n /** Property data provider */\n dataProvider: PresentationPropertyDataProvider;\n}\n\n/** Property Category in the [[PropertyGrid]] state\n * @public\n * @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\n */\nexport interface PropertyGridCategory {\n propertyCategory: PropertyCategory;\n propertyCount: number;\n properties: PropertyRecord[];\n}\n\ninterface CategorizedPropertyGridRecords {\n category: PropertyCategory;\n records: PropertyRecord[];\n children: CategorizedPropertyGridRecords[];\n}\n\n/** State of [[PropertyGrid]] React component\n * @internal\n */\ninterface PropertyGridState {\n /** List of PropertyGrid categories */\n categories: CategorizedPropertyGridRecords[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** If property grid currently loading data, the loading start time */\n loadStart?: Date;\n /** Width of PropertyGrid */\n width: number;\n}\n\n/** PropertyGrid React component.\n * @public\n */\nexport class PropertyGrid extends React.Component<\nPropertyGridProps,\nPropertyGridState\n> {\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\n private _isMounted = false;\n private _isInDataRequest = false;\n private _hasPendingDataRequest = false;\n\n static override contextType = PropertyGridWrapperContext;\n\n /** @internal */\n constructor(props: PropertyGridProps) {\n super(props);\n this.state = {\n categories: [],\n orientation: this.getPreferredOrientation(),\n width: 0,\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n this._dataChangesListenerDisposeFunc = undefined;\n }\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyGridProps) {\n if (this.props.dataProvider !== prevProps.dataProvider) {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n }\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth\n ) {\n this.updateOrientation(this.state.width);\n }\n }\n\n private _onPropertyDataChanged = () => {\n void this.gatherData();\n };\n\n private async gatherData(): Promise<void> {\n if (this._isInDataRequest) {\n this._hasPendingDataRequest = true;\n return;\n }\n\n this.setState((prev) =>\n prev.loadStart ? null : { loadStart: new Date() }\n );\n\n this._isInDataRequest = true;\n let propertyData: PropertyData;\n try {\n propertyData = await this.props.dataProvider.getData();\n } finally {\n this._isInDataRequest = false;\n }\n\n if (!this._isMounted) {\n return;\n }\n\n if (this._hasPendingDataRequest) {\n this._hasPendingDataRequest = false;\n return this.gatherData();\n }\n\n this.setState((prevState) => {\n const buildCategoriesHierarchy = (\n newCategories: PropertyCategory[],\n stateCategories: CategorizedPropertyGridRecords[] | undefined\n ) =>\n newCategories.map((category): CategorizedPropertyGridRecords => {\n const matchingStateCategory = findCategory(\n stateCategories ?? [],\n category.name,\n false\n );\n return {\n category: {\n ...category,\n expand:\n matchingStateCategory?.category?.expand ?? category.expand,\n },\n records: propertyData.records[category.name] ?? [],\n children: buildCategoriesHierarchy(\n category.childCategories ?? [],\n matchingStateCategory?.children\n ),\n };\n });\n return {\n categories: buildCategoriesHierarchy(\n propertyData.categories,\n prevState.categories\n ),\n loadStart: undefined,\n };\n });\n }\n\n private getPreferredOrientation(): Orientation {\n return this.props.orientation !== undefined\n ? this.props.orientation\n : Orientation.Horizontal;\n }\n\n private _onResize = (width: number) => {\n this.updateOrientation(width);\n };\n\n private _onCategoryExpansionToggled = (categoryName: string) => {\n this.setState((state) => {\n return produce(state, (draft) => {\n const records = findCategory(draft.categories, categoryName, true);\n // istanbul ignore else\n if (records) {\n const category = records.category;\n category.expand = !category.expand;\n }\n });\n });\n };\n\n private updateOrientation(width: number): void {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (\n currentOrientation !== this.state.orientation ||\n width !== this.state.width\n ) {\n this.setState({ orientation: currentOrientation, width });\n }\n }\n\n /** @internal */\n public override render() {\n if (this.state.loadStart) {\n return (\n <div className=\"gmw-components-property-grid-loader\">\n <ProgressRadial indeterminate />\n </div>\n );\n }\n\n return (\n <div className=\"gmw-table-box-inner\">\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n >\n {(selectionContext) => (\n <div\n className={classnames(\n \"gmw-components-property-grid-wrapper\",\n this.props.className\n )}\n style={this.props.style}\n >\n <div\n className={classnames(\n \"gmw-components-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <div className=\"gmw-property-categories\">\n {this.state.categories.map(\n (categorizedRecords: CategorizedPropertyGridRecords) => (\n <NestedCategoryBlock\n {...selectionContext}\n key={categorizedRecords.category.name}\n categorizedRecords={categorizedRecords}\n onCategoryExpansionToggled={\n this._onCategoryExpansionToggled\n }\n orientation={this.state.orientation}\n propertyValueRendererManager={\n this.props.propertyValueRendererManager\n }\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n )\n )}\n </div>\n </div>\n <ResizableContainerObserver onResize={this._onResize} />\n </div>\n )}\n </PropertyGridEventsRelatedPropsSupplier>\n </div>\n );\n }\n}\n\nfunction findCategory(\n categories: CategorizedPropertyGridRecords[],\n lookupName: string,\n recurseIntoChildren: boolean\n): CategorizedPropertyGridRecords | undefined {\n for (const category of categories) {\n if (category.category.name === lookupName) {\n return category;\n }\n if (recurseIntoChildren) {\n const matchingChild = findCategory(\n category.children,\n lookupName,\n recurseIntoChildren\n );\n if (matchingChild) {\n return matchingChild;\n }\n }\n }\n return undefined;\n}\n\ninterface NestedCategoryBlockProps\n extends Omit<\n PropertyListProps,\n keyof ColumnResizeRelatedPropertyListProps | \"properties\"\n > {\n categorizedRecords: CategorizedPropertyGridRecords;\n onCategoryExpansionToggled: (categoryName: string) => void;\n orientation: Orientation;\n}\nconst NestedCategoryBlock = (props: NestedCategoryBlockProps) => {\n const [width, setWidth] = React.useState(1);\n return (\n <PropertyCategoryBlock\n category={props.categorizedRecords.category}\n onExpansionToggled={props.onCategoryExpansionToggled}\n >\n {props.categorizedRecords.records.length ? (\n <ColumnResizingPropertyListPropsSupplier\n orientation={props.orientation}\n width={width}\n >\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\n <PropertyList\n {...partialListProps}\n orientation={props.orientation}\n category={props.categorizedRecords.category}\n properties={props.categorizedRecords.records}\n selectedPropertyKey={props.selectedPropertyKey}\n onPropertyClicked={props.onPropertyClicked}\n onPropertyRightClicked={props.onPropertyRightClicked}\n onPropertyContextMenu={props.onPropertyContextMenu}\n propertyValueRendererManager={props.propertyValueRendererManager}\n editingPropertyKey={props.editingPropertyKey}\n onEditCommit={props.onEditCommit}\n onEditCancel={props.onEditCancel}\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\n isPropertyRightClickSelectionEnabled={\n props.isPropertyRightClickSelectionEnabled\n }\n actionButtonRenderers={props.actionButtonRenderers}\n setWidth={setWidth}\n width={width}\n />\n )}\n </ColumnResizingPropertyListPropsSupplier>\n ) : undefined}\n {props.categorizedRecords.children.length ? (\n <div className=\"gmw-property-categories\">\n {props.categorizedRecords.children.map((categorizedChildRecords) => (\n <NestedCategoryBlock\n {...props}\n key={categorizedChildRecords.category.name}\n categorizedRecords={categorizedChildRecords}\n />\n ))}\n </div>\n ) : undefined}\n </PropertyCategoryBlock>\n );\n};\n"]}
|
|
@@ -1,71 +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/expandable/list';
|
|
6
|
-
@import '~@itwin/core-react/lib/cjs/core-react/scrollbar';
|
|
7
|
-
|
|
8
|
-
.gmw-components-property-grid-loader {
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.gmw-components-property-grid {
|
|
15
|
-
.gmw-property-categories {
|
|
16
|
-
@include uicore-expandable-blocks-list;
|
|
17
|
-
|
|
18
|
-
display: grid;
|
|
19
|
-
grid-row-gap: 6px;
|
|
20
|
-
padding: 3px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
padding-top: 6px;
|
|
24
|
-
padding-bottom: 6px;
|
|
25
|
-
|
|
26
|
-
user-select: none;
|
|
27
|
-
color: $buic-foreground-body;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.gmw-components-property-grid-wrapper {
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
overflow-y: auto;
|
|
34
|
-
|
|
35
|
-
@include uicore-touch-scrolling;
|
|
36
|
-
@include uicore-scrollbar();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@mixin gmw-components-property-list {
|
|
40
|
-
width: 100%;
|
|
41
|
-
|
|
42
|
-
.gmw-components--selected {
|
|
43
|
-
background-color: $buic-row-selection;
|
|
44
|
-
outline: 1px solid $buic-foreground-primary;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.gmw-components--clickable {
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
|
|
50
|
-
&:hover {
|
|
51
|
-
background: $buic-row-hover;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.gmw-components--hoverable:hover {
|
|
56
|
-
background-color: $buic-row-hover;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.gmw-components-property-list--horizontal {
|
|
61
|
-
@include gmw-components-property-list;
|
|
62
|
-
|
|
63
|
-
display: grid;
|
|
64
|
-
grid-row-gap: 0px;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.gmw-components-property-list--vertical {
|
|
69
|
-
@include gmw-components-property-list;
|
|
70
|
-
// margin-top: -13px;
|
|
71
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PresentationPropertyDataProvider } from "@itwin/presentation-components";
|
|
3
|
-
import "../customUI/GroupQueryBuilderCustomUI.scss";
|
|
4
|
-
import type { KeySet } from "@itwin/presentation-common";
|
|
5
|
-
import type { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
-
interface PropertyGridWrapperState {
|
|
7
|
-
dataProvider?: PresentationPropertyDataProvider;
|
|
8
|
-
}
|
|
9
|
-
interface PropertyProps {
|
|
10
|
-
keys: KeySet;
|
|
11
|
-
imodel?: IModelConnection;
|
|
12
|
-
}
|
|
13
|
-
export declare class PropertyGridWrapper extends React.Component<PropertyProps, PropertyGridWrapperState> {
|
|
14
|
-
static contextType: React.Context<import("../context/PropertyGridWrapperContext").PropertySelection>;
|
|
15
|
-
constructor(props: PropertyProps | Readonly<PropertyProps>);
|
|
16
|
-
private createPropertyDataProvider;
|
|
17
|
-
private createDataProvider;
|
|
18
|
-
componentDidMount(): void;
|
|
19
|
-
componentDidUpdate(prevProps: PropertyProps): void;
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=PropertyGridWrapper.d.ts.map
|