@itwin/components-react 4.13.2 → 4.13.4
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/CHANGELOG.md +13 -1
- package/lib/cjs/components-react/UiComponents.js +1 -1
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
- package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/cjs/components-react/common/Links.js.map +1 -1
- package/lib/cjs/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseElementsScrollStorage.js.map +1 -1
- package/lib/cjs/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionModes.js +2 -2
- package/lib/cjs/components-react/common/selection/SelectionModes.js.map +1 -1
- package/lib/cjs/components-react/converters/BooleanTypeConverter.js +1 -1
- package/lib/cjs/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.js +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/PropertyEditorManager.js +1 -1
- package/lib/cjs/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.js +2 -2
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.d.ts +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.d.ts.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +3 -3
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/cjs/components-react/toolbar/utilities/Direction.js +4 -4
- package/lib/cjs/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.js +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/cjs/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeComponentTestId.js +1 -1
- package/lib/cjs/components-react/tree/TreeComponentTestId.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/cjs/components-react/useTranslation.js.map +1 -1
- package/lib/esm/components-react/UiComponents.js +1 -2
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/common/DateUtils.js.map +1 -1
- package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.js +1 -2
- package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/esm/components-react/common/Links.js.map +1 -1
- package/lib/esm/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseElementsScrollStorage.js.map +1 -1
- package/lib/esm/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/esm/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/components-react/converters/BooleanTypeConverter.js +1 -2
- package/lib/esm/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverterManager.js +1 -2
- package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/PropertyEditorManager.js +1 -2
- package/lib/esm/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +1 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.d.ts +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.d.ts.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/esm/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -2
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +1 -2
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/esm/components-react/toolbar/Items.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/esm/components-react/toolbar/utilities/Direction.js +2 -4
- package/lib/esm/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/esm/components-react/tree/HighlightingEngine.js +1 -2
- package/lib/esm/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/esm/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react/useTranslation.js.map +1 -1
- package/package.json +13 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonPropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CommonPropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,kDAAgD;AAChD,4EAAyE;AACzE,kEAA+D;AAG/D,kEAGiC;AAEjC;;GAEG;AACH,MAAa,sBAAsB;IAC1B,MAAM,CAAC,cAAc,CAC1B,WAAoB,EACpB,WAAyB,EACzB,KAAc,EACd,WAAoB,EACpB,mBAA4B;QAE5B,IAAI,CAAC,WAAW;YAAE,OAAO,CAAC,CAAC;QAE3B,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,IACE,WAAW,KAAK,wBAAW,CAAC,UAAU;YACtC,CAAC,KAAK;YACN,CAAC,W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,oDAAoD;QACpD,IAAI,WAAW,KAAK,wBAAW,CAAC,QAAQ;YACtC,YAAY,GAAG,CACb,8BACE,KAAK,EAAE;oBACL,WAAW,EAAE,sBAAsB,CAAC,cAAc,CAChD,WAAW,EACX,WAAW,CACZ;iBACF,IAEA,YAAY,CACR,CACR,CAAC;QAEJ,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,MAAM,CAAC,uBAAuB,CACpC,SAAiE,EACjE,cAA8B;QAE9B,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC;QAC9C,MAAM,YAAY,GAAG,WAAW,EAAE,yBAAyB,CAAC;QAC5D,MAAM,UAAU,GAAG,WAAW,EAAE,cAAc,IAAI,CAAC,CAAC;QACpD,IAAI,YAAoB,CAAC;QAEzB,IAAI,SAAS,CAAC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"CommonPropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CommonPropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,kDAAgD;AAChD,4EAAyE;AACzE,kEAA+D;AAG/D,kEAGiC;AAEjC;;GAEG;AACH,MAAa,sBAAsB;IAC1B,MAAM,CAAC,cAAc,CAC1B,WAAoB,EACpB,WAAyB,EACzB,KAAc,EACd,WAAoB,EACpB,mBAA4B;QAE5B,IAAI,CAAC,WAAW;YAAE,OAAO,CAAC,CAAC;QAE3B,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,IACE,WAAW,KAAK,wBAAW,CAAC,UAAU;YACtC,CAAC,KAAK;YACN,CAAC,WAAW;YACZ,CAAC,mBAAmB;YAEpB,OAAO,WAAW,GAAG,SAAS,CAAC;QAEjC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC;QACnD,MAAM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AW,CACZ;iBACF,IAEA,YAAY,CACR,CACR,CAAC;QAEJ,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,MAAM,CAAC,uBAAuB,CACpC,SAAiE,EACjE,cAA8B;QAE9B,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC;QAC9C,MAAM,YAAY,GAAG,WAAW,EAAE,yBAAyB,CAAC;QAC5D,MAAM,UAAU,GAAG,WAAW,EAAE,cAAc,IAAI,CAAC,CAAC;QACpD,IAAI,YAAoB,CAAC;QAEzB,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;YAC3B,YAAY,GAAG,IAAA,2CAAoB,EACjC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,EAClD,SAAS,CAAC,eAAe,CAC1B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,CAAC,CAAC;QACnB,CAAC;QAED,MAAM,gBAAgB,GACpB,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;YAC7C,UAAU,GAAG,YAAY,IAAI,CAAC;YAC5B,CAAC,CAAC,UAAU,GAAG,YAAY;YAC3B,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAC1C,oBAAC,iCAAe,IACd,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,SAAS,CAAC,eAAe,GACrC,CACH,CAAC;QAEF,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AApID,wDAoIC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { countMatchesInString } from \"../../common/countMatchesInString\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyValueRendererContext } from \"../ValueRendererManager\";\nimport {\n PropertyContainerType,\n PropertyValueRendererManager,\n} from \"../ValueRendererManager\";\n\n/**\n * @internal\n */\nexport class CommonPropertyRenderer {\n public static getLabelOffset(\n indentation?: number,\n orientation?: Orientation,\n width?: number,\n columnRatio?: number,\n minColumnLabelWidth?: number\n ): number {\n if (!indentation) return 0;\n\n const maxIndent = 17;\n const minIndent = 6;\n if (\n orientation !== Orientation.Horizontal ||\n !width ||\n !columnRatio ||\n !minColumnLabelWidth\n )\n return indentation * maxIndent;\n\n const currentSize = Math.ceil(width * columnRatio);\n const shrinkThreshold = minColumnLabelWidth + maxIndent * indentation;\n if (currentSize >= shrinkThreshold) return indentation * maxIndent;\n\n const minShrink =\n minColumnLabelWidth + minIndent + maxIndent * (indentation - 1);\n if (currentSize <= minShrink)\n return (\n minIndent +\n this.getLabelOffset(\n indentation - 1,\n orientation,\n width,\n columnRatio,\n minColumnLabelWidth\n )\n );\n\n return currentSize - minColumnLabelWidth;\n }\n\n public static createNewDisplayValue(\n orientation: Orientation,\n propertyRecord: PropertyRecord,\n indentation?: number,\n propertyValueRendererManager?: PropertyValueRendererManager,\n isExpanded?: boolean,\n onExpansionToggled?: () => void,\n onHeightChanged?: (newHeight: number) => void,\n highlight?: HighlightingComponentProps & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n }\n ) {\n const highlightCallback = highlight?.applyOnValue\n ? CommonPropertyRenderer.createHighlightCallback(\n highlight,\n propertyRecord\n )\n : undefined;\n const rendererContext: PropertyValueRendererContext = {\n orientation,\n containerType: PropertyContainerType.PropertyPane,\n isExpanded,\n onExpansionToggled,\n onHeightChanged,\n textHighlighter: highlightCallback,\n };\n\n let displayValue: React.ReactNode | undefined;\n if (propertyValueRendererManager)\n displayValue = propertyValueRendererManager.render(\n propertyRecord,\n rendererContext\n );\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(\n propertyRecord,\n rendererContext\n );\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = (\n <span\n style={{\n paddingLeft: CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation\n ),\n }}\n >\n {displayValue}\n </span>\n );\n\n return displayValue;\n }\n\n private static createHighlightCallback(\n highlight: HighlightingComponentProps & { applyOnLabel: boolean },\n propertyRecord: PropertyRecord\n ) {\n const activeMatch = highlight.activeHighlight;\n const propertyName = activeMatch?.highlightedItemIdentifier;\n const matchIndex = activeMatch?.highlightIndex ?? 0;\n let labelMatches: number;\n\n if (highlight.applyOnLabel) {\n labelMatches = countMatchesInString(\n propertyRecord.property.displayLabel.toLowerCase(),\n highlight.highlightedText\n );\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex =\n propertyRecord.property.name === propertyName &&\n matchIndex - labelMatches >= 0\n ? matchIndex - labelMatches\n : undefined;\n const highlightCallback = (text: string) => (\n <HighlightedText\n text={text}\n activeMatchIndex={activeMatchIndex}\n searchText={highlight.highlightedText}\n />\n );\n\n return highlightCallback;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGridColumns.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyGridColumns.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kDAAgD;AAUhD,gBAAgB;AAChB,MAAa,+BAA+B;IAM1C,YAAmB,UAA8C;QALzD,mBAAc,GAAW,CAAC,CAAC;QAC3B,mBAAc,GAAW,CAAC,CAAC;QAC3B,uBAAkB,GAAW,CAAC,CAAC;QAIrC,IAAI,CAAC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"PropertyGridColumns.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyGridColumns.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kDAAgD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CAAC;IACH,CAAC;IAED,oFAAoF;IAC5E,kBAAkB,CACxB,OAAkC;QAElC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;QACnD,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACpD,CAAC;IAEO,kBAAkB,CACxB,iBAA0B,EAC1B,KAAa,EACb,oBAA6B;QAE7B,MAAM,eAAe,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACjE,MAAM,kBAAkB,GAAG,iBAAiB;YAC1C,CAAC,CAAC,IAAI,CAAC,iBAAiB;gBACtB,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,IAAI;gBAC/B,CAAC,CAAC,MAAM;YACV,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,CAAC,IAAI,CAAC,0BAA0B;YAClC,OAAO,IAAI,CAAC,kBAAkB,CAAC;gBAC7B,GAAG,KAAK,GAAG,GAAG,GAAG;gBACjB,eAAe;gBACf,MAAM;gBACN,kBAAkB;aACnB,CAAC,CAAC;QAEL,MAAM,WAAW,GAAG,UAAU,IAAI,CAAC,aAAa,OAAO,KAAK,GAAG,GAAG,IAAI,CAAC;QACvE,MAAM,WAAW,GAAG,UAAU,IAAI,CAAC,aAAa,UAAU,CAAC;QAE3D,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,WAAW;YACX,eAAe;YACf,WAAW;YACX,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB,CAAC,iBAA0B;QACjD,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,MAAM;YACN,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAtGD,0EAsGC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport { Orientation } from \"@itwin/core-react\";\n\n/** @internal */\nexport interface PropertyGridColumnInfo {\n minLabelWidth: number;\n minValueWidth: number;\n actionButtonWidth: number;\n isMinimumColumnSizeEnabled: boolean;\n}\n\n/** @internal */\nexport class PropertyGridColumnStyleProvider {\n private _minLabelWidth: number = 0;\n private _minValueWidth: number = 0;\n private _actionButtonWidth: number = 0;\n private _isMinimumColumnSizeEnabled: boolean;\n\n public constructor(columnInfo: PropertyGridColumnInfo | undefined) {\n if (!columnInfo) {\n this._isMinimumColumnSizeEnabled = false;\n return;\n }\n\n this._minLabelWidth = columnInfo.minLabelWidth;\n this._minValueWidth = columnInfo.minValueWidth;\n this._actionButtonWidth = columnInfo.actionButtonWidth;\n this._isMinimumColumnSizeEnabled = columnInfo.isMinimumColumnSizeEnabled;\n }\n\n public get minLabelWidth() {\n return this._minLabelWidth;\n }\n\n public get minValueWidth() {\n return this._minValueWidth;\n }\n\n public get actionButtonWidth() {\n return this._actionButtonWidth;\n }\n\n public get isMinimumColumnSizeEnabled() {\n return this._isMinimumColumnSizeEnabled;\n }\n\n public getStyle(\n orientation: Orientation,\n needActionButtons: boolean,\n ratio: number,\n needElementSeparator: boolean\n ): React.CSSProperties {\n switch (orientation) {\n case Orientation.Horizontal:\n return this.getHorizontalStyle(\n needActionButtons,\n ratio,\n needElementSeparator\n );\n case Orientation.Vertical:\n return this.getVerticalStyle(needActionButtons);\n /* istanbul ignore next */\n default:\n const unhandledOrientationType: never = orientation; // Compile time check that all cases handled\n throw new Error(\n `Unhandled orientation type: ${unhandledOrientationType}. Was new orientation added ? `\n );\n }\n }\n\n /** Join columns together in sequence, filtering out undefined column definitions */\n private columnStyleBuilder(\n columns: Array<string | undefined>\n ): React.CSSProperties {\n columns = columns.filter((el) => el !== undefined);\n return { gridTemplateColumns: columns.join(\" \") };\n }\n\n private getHorizontalStyle(\n needActionButtons: boolean,\n ratio: number,\n needElementSeparator: boolean\n ): React.CSSProperties {\n const separatorColumn = needElementSeparator ? \"1px\" : undefined;\n const actionButtonColumn = needActionButtons\n ? this.actionButtonWidth\n ? `${this.actionButtonWidth}px`\n : \"auto\"\n : undefined;\n if (!this.isMinimumColumnSizeEnabled)\n return this.columnStyleBuilder([\n `${ratio * 100}%`,\n separatorColumn,\n \"auto\",\n actionButtonColumn,\n ]);\n\n const labelColumn = `minmax(${this.minLabelWidth}px, ${ratio * 100}%)`;\n const valueColumn = `minmax(${this.minValueWidth}px, 1fr)`;\n\n return this.columnStyleBuilder([\n labelColumn,\n separatorColumn,\n valueColumn,\n actionButtonColumn,\n ]);\n }\n\n private getVerticalStyle(needActionButtons: boolean): React.CSSProperties {\n return this.columnStyleBuilder([\n \"auto\",\n needActionButtons ? \"auto\" : undefined,\n ]);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA4D;AAI5D,mEAAgE;AAChE,qDAAkD;AAGlD,qEAAkE;AAClE,iFAA8E;AAE9E,2EAAwE;AAyExE;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK,CAAC,SAG3C;IAMC,YAAY,KAA4B;QACtC,KAAK,CAAC,KAAK,CAAC,CAAC;QANf,gBAAgB;QACS,UAAK,GAAoC;YAChE,YAAY,EAAE,2BAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC;SACxD,CAAC;QAqCM,kBAAa,GAAG,CAAC,IAAyB,EAAE,EAAE;YACpD,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY;gBAAE,IAAI,CAAC,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jE,IACE,SAAS,CAAC,cAAc,KAAK,IAAI,CAAC,KAAK,CAAC,cAAc;YACtD,SAAS,CAAC,SAAS,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS;YAC5C,SAAS,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW;YAEhD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,EACJ,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,GAAG,KAAK,EACT,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,MAAM,sBAAsB,GAA2B;YACrD,GAAG,KAAK;YACR,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY;YACrC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;SACpC,CAAC;QAEF,QAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE;YACnD,KAAK,oCAAmB,CAAC,SAAS;gBAChC,OAAO,oBAAC,qDAAyB,OAAK,sBAAsB,GAAI,CAAC;YACnE,KAAK,oCAAmB,CAAC,KAAK;gBAC5B,uDAAuD;gBACvD,IACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW;oBACzC,oCAAmB,CAAC,KAAK;oBAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;oBAElD,OAAO,oBAAC,qDAAyB,OAAK,sBAAsB,GAAI,CAAC;YACrE,0CAA0C;YAC1C,KAAK,oCAAmB,CAAC,MAAM;gBAC7B,OAAO,CACL,oBAAC,2DAA4B,IAC3B,aAAa,EAAE,IAAI,KACf,sBAAsB,GAC1B,CACH,CAAC;SACL;IACH,CAAC;CACF;AAvHD,4CAuHC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport { EditorContainer } from \"../../editors/EditorContainer\";\nimport { UiComponents } from \"../../UiComponents\";\nimport type { PropertyValueRendererManager } from \"../ValueRendererManager\";\nimport type { ActionButtonRenderer } from \"./ActionButtonRenderer\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { NonPrimitivePropertyRenderer } from \"./NonPrimitivePropertyRenderer\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport { PrimitivePropertyRenderer } from \"./PrimitivePropertyRenderer\";\nimport type { PropertyGridColumnInfo } from \"./PropertyGridColumns\";\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 | {\n ratio: number;\n };\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 */\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 */\n isEditing?: boolean;\n /** Called when property edit is committed. */\n onEditCommit?: (args: PropertyUpdatedArgs) => void;\n /** Called when property edit is cancelled. */\n onEditCancel?: () => void;\n /** Props used for highlighting. */\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<\n PropertyRendererProps,\n PropertyRendererState\n> {\n /** @internal */\n public override readonly state: Readonly<PropertyRendererState> = {\n displayValue: UiComponents.translate(\"general.loading\"),\n };\n\n constructor(props: PropertyRendererProps) {\n super(props);\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 = CommonPropertyRenderer.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) this.props.onEditCommit(args);\n };\n\n private _onEditCancel = () => {\n // istanbul ignore else\n if (this.props.onEditCancel) this.props.onEditCancel();\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 /** @internal */\n public override render() {\n const {\n propertyValueRendererManager,\n isEditing,\n onEditCommit,\n onEditCancel,\n ...props\n } = 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 <PrimitivePropertyRenderer {...primitiveRendererProps} />;\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (\n this.props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Array &&\n this.props.propertyRecord.value.items.length === 0\n )\n return <PrimitivePropertyRenderer {...primitiveRendererProps} />;\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
|
+
{"version":3,"file":"PropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AACh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B,CAAC,KAAK;gBAC5B,uDAAuD;gBACvD,IACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW;oBACzC,oCAAmB,CAAC,KAAK;oBAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;oBAElD,OAAO,oBAAC,qDAAyB,OAAK,sBAAsB,GAAI,CAAC;YACrE,0CAA0C;YAC1C,KAAK,oCAAmB,CAAC,MAAM;gBAC7B,OAAO,CACL,oBAAC,2DAA4B,IAC3B,aAAa,EAAE,IAAI,KACf,sBAAsB,GAC1B,CACH,CAAC;QACN,CAAC;IACH,CAAC;CACF;AAvHD,4CAuHC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport { EditorContainer } from \"../../editors/EditorContainer\";\nimport { UiComponents } from \"../../UiComponents\";\nimport type { PropertyValueRendererManager } from \"../ValueRendererManager\";\nimport type { ActionButtonRenderer } from \"./ActionButtonRenderer\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { NonPrimitivePropertyRenderer } from \"./NonPrimitivePropertyRenderer\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport { PrimitivePropertyRenderer } from \"./PrimitivePropertyRenderer\";\nimport type { PropertyGridColumnInfo } from \"./PropertyGridColumns\";\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 | {\n ratio: number;\n };\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 */\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 */\n isEditing?: boolean;\n /** Called when property edit is committed. */\n onEditCommit?: (args: PropertyUpdatedArgs) => void;\n /** Called when property edit is cancelled. */\n onEditCancel?: () => void;\n /** Props used for highlighting. */\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<\n PropertyRendererProps,\n PropertyRendererState\n> {\n /** @internal */\n public override readonly state: Readonly<PropertyRendererState> = {\n displayValue: UiComponents.translate(\"general.loading\"),\n };\n\n constructor(props: PropertyRendererProps) {\n super(props);\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 = CommonPropertyRenderer.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) this.props.onEditCommit(args);\n };\n\n private _onEditCancel = () => {\n // istanbul ignore else\n if (this.props.onEditCancel) this.props.onEditCancel();\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 /** @internal */\n public override render() {\n const {\n propertyValueRendererManager,\n isEditing,\n onEditCommit,\n onEditCancel,\n ...props\n } = 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 <PrimitivePropertyRenderer {...primitiveRendererProps} />;\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (\n this.props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Array &&\n this.props.propertyRecord.value.items.length === 0\n )\n return <PrimitivePropertyRenderer {...primitiveRendererProps} />;\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"]}
|
|
@@ -11,6 +11,6 @@ export declare class ArrayPropertyValueRenderer implements IPropertyValueRendere
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=ArrayPropertyValueRenderer.d.ts.map
|
package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/ArrayPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA4D;AAC5D,kDAAgD;AAKhD,qEAAmE;AACnE,mEAAqE;AACrE,yDAAsD;AAEtD;;GAEG;AACH,MAAa,0BAA0B;IACrC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,KAAK,CAAC;IAChE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,MAAM,WAAW,GAAI,MAAM,CAAC,KAAoB,CAAC,KAAK,CAAC;QAEvD,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"ArrayPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/ArrayPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA4D;AAC5D,kDAAgD;AAKhD,qEAAmE;AACnE,mEAAqE;AACrE,yDAAsD;AAEtD;;GAEG;AACH,MAAa,0BAA0B;IACrC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,KAAK,CAAC;IAChE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,MAAM,WAAW,GAAI,MAAM,CAAC,KAAoB,CAAC,KAAK,CAAC;QAEvD,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,KAAK,EAAE,CAAC;YACrE,OAAO,IAAA,mCAAgB,EACrB,oBAAC,4CAAuB,IACtB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,OAAO,CAAC,YAAY,EAClC,WAAW,EACT,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAW,CAAC,UAAU,GAEpE,EACF,OAAO,CACR,CAAC;QACJ,CAAC;QAED,IACE,OAAO;YACP,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,YAAY,EAC5D,CAAC;YACD,OAAO,IAAA,mCAAgB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,IAAA,mCAAgB,EACrB,WAAW,CAAC,MAAM,KAAK,CAAC;YACtB,CAAC,CAAC,GAAI,MAAM,CAAC,KAAoB,CAAC,aAAa,IAAI,WAAW,CAAC,MAAM,GAAG;YACxE,CAAC,CAAC,GAAI,MAAM,CAAC,KAAoB,CAAC,aAAa,IAAI,EACrD,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAxCD,gEAwCC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { ArrayValue, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type {\n IPropertyValueRenderer,\n PropertyValueRendererContext,\n} from \"../../ValueRendererManager\";\nimport { PropertyContainerType } from \"../../ValueRendererManager\";\nimport { TableArrayValueRenderer } from \"./table/ArrayValueRenderer\";\nimport { withContextStyle } from \"./WithContextStyle\";\n\n/** Default Array Property Renderer\n * @public\n */\nexport class ArrayPropertyValueRenderer implements IPropertyValueRenderer {\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return record.value.valueFormat === PropertyValueFormat.Array;\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(\n record: PropertyRecord,\n context?: PropertyValueRendererContext\n ) {\n const recordItems = (record.value as ArrayValue).items;\n\n if (context && context.containerType === PropertyContainerType.Table) {\n return withContextStyle(\n <TableArrayValueRenderer\n propertyRecord={record}\n onDialogOpen={context.onDialogOpen}\n orientation={\n context.orientation ? context.orientation : Orientation.Horizontal\n }\n />,\n context\n );\n }\n\n if (\n context &&\n context.containerType === PropertyContainerType.PropertyPane\n ) {\n return withContextStyle(\"\", context);\n }\n\n return withContextStyle(\n recordItems.length !== 0\n ? `${(record.value as ArrayValue).itemsTypeName}[${recordItems.length}]`\n : `${(record.value as ArrayValue).itemsTypeName}[]`,\n context\n );\n }\n}\n"]}
|
package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ export declare class MergedPropertyValueRenderer implements IPropertyValueRender
|
|
|
10
10
|
/** Checks if the renderer can handle given property */
|
|
11
11
|
canRender(record: PropertyRecord): boolean;
|
|
12
12
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
13
|
-
render(_record: PropertyRecord, context?: PropertyValueRendererContext): import("react").ReactNode;
|
|
13
|
+
render(_record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=MergedPropertyValueRenderer.d.ts.map
|
package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export declare class StructPropertyValueRenderer implements IPropertyValueRender
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=StructPropertyValueRenderer.d.ts.map
|
package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/StructPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA4D;AAC5D,kDAAgD;AAKhD,qEAAmE;AACnE,qEAAuE;AACvE,yDAAsD;AAEtD;;GAEG;AACH,MAAa,2BAA2B;IACtC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,MAAM,CAAC;IACjE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"StructPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/StructPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA4D;AAC5D,kDAAgD;AAKhD,qEAAmE;AACnE,qEAAuE;AACvE,yDAAsD;AAEtD;;GAEG;AACH,MAAa,2BAA2B;IACtC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,MAAM,CAAC;IACjE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,KAAK,EAAE,CAAC;YACrE,OAAO,IAAA,mCAAgB,EACrB,oBAAC,8CAAwB,IACvB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,OAAO,CAAC,YAAY,EAClC,WAAW,EACT,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAW,CAAC,UAAU,GAEpE,EACF,OAAO,CACR,CAAC;QACJ,CAAC;QAED,IACE,OAAO;YACP,OAAO,CAAC,aAAa,KAAK,4CAAqB,CAAC,YAAY,EAC5D,CAAC;YACD,OAAO,IAAA,mCAAgB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,IAAA,mCAAgB,EAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AAjCD,kEAiCC","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/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type {\n IPropertyValueRenderer,\n PropertyValueRendererContext,\n} from \"../../ValueRendererManager\";\nimport { PropertyContainerType } from \"../../ValueRendererManager\";\nimport { TableStructValueRenderer } from \"./table/StructValueRenderer\";\nimport { withContextStyle } from \"./WithContextStyle\";\n\n/** Default Struct Property Renderer\n * @public\n */\nexport class StructPropertyValueRenderer implements IPropertyValueRenderer {\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return record.value.valueFormat === PropertyValueFormat.Struct;\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(\n record: PropertyRecord,\n context?: PropertyValueRendererContext\n ) {\n if (context && context.containerType === PropertyContainerType.Table) {\n return withContextStyle(\n <TableStructValueRenderer\n propertyRecord={record}\n onDialogOpen={context.onDialogOpen}\n orientation={\n context.orientation ? context.orientation : Orientation.Horizontal\n }\n />,\n context\n );\n }\n\n if (\n context &&\n context.containerType === PropertyContainerType.PropertyPane\n ) {\n return withContextStyle(\"\", context);\n }\n\n return withContextStyle(`{${record.property.typename}}`, context);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/UrlPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA+E;AAK/E,qFAAsF;AACtF,qCAAiD;AAEjD;;;;;GAKG;AACH,MAAa,wBAAwB;IACnC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,CACL,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,SAAS;YAC1D;gBACE,kCAAiB,CAAC,GAAG;gBACrB,kCAAiB,CAAC,MAAM;gBACxB,kCAAiB,CAAC,IAAI;aACvB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,QAA6B,CAAC,CAC1D,CAAC;IACJ,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,OAAO,CACL,oBAAC,mEAAkC,IACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,8BAAqB,EAC5C,YAAY,EAAE,yBAAyB,GACvC,CACH,CAAC;IACJ,CAAC;CACF;AA3BD,4DA2BC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACtD,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;
|
|
1
|
+
{"version":3,"file":"UrlPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/UrlPropertyValueRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAA+E;AAK/E,qFAAsF;AACtF,qCAAiD;AAEjD;;;;;GAKG;AACH,MAAa,wBAAwB;IACnC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,CACL,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,SAAS;YAC1D;gBACE,kCAAiB,CAAC,GAAG;gBACrB,kCAAiB,CAAC,MAAM;gBACxB,kCAAiB,CAAC,IAAI;aACvB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,QAA6B,CAAC,CAC1D,CAAC;IACJ,CAAC;IAED,iEAAiE;IAC1D,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,OAAO,CACL,oBAAC,mEAAkC,IACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,8BAAqB,EAC5C,YAAY,EAAE,yBAAyB,GACvC,CACH,CAAC;IACJ,CAAC;CACF;AA3BD,4DA2BC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACtD,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB,CAAC;QACJ,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/C,IAAI,UAAU;YAAE,UAAU,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;AACH,CAAC;AAED,MAAM,yBAAyB,GAAqB;IAClD,OAAO,EAAE,UAAU;CACpB,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { LinkElementsInfo, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport type {\n IPropertyValueRenderer,\n PropertyValueRendererContext,\n} from \"../../ValueRendererManager\";\nimport { PrimitivePropertyValueRendererImpl } from \"./PrimitivePropertyValueRenderer\";\nimport { convertRecordToString } from \"./Common\";\n\n/**\n * URL property value renderer that renders the whole value as a URL without matching it\n * against URL regex.\n *\n * @public\n */\nexport class UrlPropertyValueRenderer implements IPropertyValueRenderer {\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return (\n record.value.valueFormat === PropertyValueFormat.Primitive &&\n [\n StandardTypeNames.URL,\n StandardTypeNames.String,\n StandardTypeNames.Text,\n ].includes(record.property.typename as StandardTypeNames)\n );\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(\n record: PropertyRecord,\n context?: PropertyValueRendererContext\n ) {\n return (\n <PrimitivePropertyValueRendererImpl\n record={record}\n context={context}\n stringValueCalculator={convertRecordToString}\n linksHandler={URI_PROPERTY_LINK_HANDLER}\n />\n );\n }\n}\n\n/**\n * Default URI onClick event, sets location.href to the whole URI value without matching it\n * against URL regex.\n */\nfunction urlOnClick(text: string) {\n if (text.startsWith(\"mailto:\") || text.startsWith(\"pw:\"))\n location.href = text;\n else {\n const windowOpen = window.open(text, \"_blank\");\n if (windowOpen) windowOpen.focus();\n }\n}\n\nconst URI_PROPERTY_LINK_HANDLER: LinkElementsInfo = {\n onClick: urlOnClick,\n};\n"]}
|
|
@@ -6,5 +6,5 @@ import type { PropertyValueRendererContext } from "../../ValueRendererManager";
|
|
|
6
6
|
/** Wraps a React component with a span element with a given style attribute
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => React.ReactNode;
|
|
9
|
+
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
10
10
|
//# sourceMappingURL=WithContextStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,
|
|
1
|
+
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,iGAIvC,CAAC"}
|
|
@@ -38,6 +38,6 @@ class PropertyCategoryRendererManager {
|
|
|
38
38
|
this._categoryRenderers.delete(rendererName);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
PropertyCategoryRendererManager.defaultManager = new PropertyCategoryRendererManager();
|
|
42
41
|
exports.PropertyCategoryRendererManager = PropertyCategoryRendererManager;
|
|
42
|
+
PropertyCategoryRendererManager.defaultManager = new PropertyCategoryRendererManager();
|
|
43
43
|
//# sourceMappingURL=PropertyCategoryRendererManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA2BH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IAuC3E,CAAC;IAnCC,mFAAmF;IAC5E,oBAAoB,CACzB,YAA8B;QAE9B,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA2BH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IAuC3E,CAAC;IAnCC,mFAAmF;IAC5E,oBAAoB,CACzB,YAA8B;QAE9B,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAChC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAC3C,EAAE,CAAC,YAAY,CAAC,CAAC;IACpB,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAChB,YAAoB,EACpB,gBAA0C,EAC1C,QAAQ,GAAG,KAAK;QAEhB,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GACd,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CACpH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AAvCH,0EAwCC;AArCe,8CAAc,GAAG,IAAI,+BAA+B,EAAE,AAAxC,CAAyC","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/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type * as React from \"react\";\nimport type { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\nimport type { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\n\n/**\n * Props that property category renderer receives.\n * @public\n */\nexport interface PropertyCategoryRendererProps {\n /** The category being rendered. */\n categoryItem: GridCategoryItem;\n /** Context of the surrounding property grid. */\n gridContext: VirtualizedPropertyGridContext;\n /** Sets the allocated height for category contents. */\n onHeightChanged: (newHeight: number) => void;\n}\n\n/**\n * Factory function that produces custom property category components.\n * @public\n */\nexport type PropertyCategoryRenderer = (\n categoryItem: GridCategoryItem\n) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\n\n/**\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\n * each category.\n * @public\n */\nexport class PropertyCategoryRendererManager {\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\n\n public static defaultManager = new PropertyCategoryRendererManager();\n\n /** Retrieves a category rendering component based for the passed category item. */\n public getCategoryComponent(\n categoryItem: GridCategoryItem\n ): React.ComponentType<PropertyCategoryRendererProps> | undefined {\n if (categoryItem.derivedCategory.renderer === undefined) {\n return undefined;\n }\n\n return this._categoryRenderers.get(\n categoryItem.derivedCategory.renderer.name\n )?.(categoryItem);\n }\n\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\n public addRenderer(\n rendererName: string,\n categoryRenderer: PropertyCategoryRenderer,\n override = false\n ): void {\n if (this._categoryRenderers.has(rendererName) && !override) {\n const className = PropertyCategoryRendererManager.name;\n const methodName =\n PropertyCategoryRendererManager.prototype.addRenderer.name;\n throw new Error(\n `${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`\n );\n }\n\n this._categoryRenderers.set(rendererName, categoryRenderer);\n }\n\n /** Removes previous renderer factory registration. */\n public removeRenderer(rendererName: string): void {\n this._categoryRenderers.delete(rendererName);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimplePropertyDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/SimplePropertyDataProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAAuD;AAMvD,iEAAiE;AAEjE;;;GAGG;AACH,MAAa,0BAA0B;IAUrC;QAPO,UAAK,GAAmB,+BAAc,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAEtD,eAAU,GAAuB,EAAE,CAAC;QACpC,YAAO,GAAiD,EAAE,CAAC;QAC3D,kBAAa,GAAG,IAAI,8CAAuB,EAAE,CAAC;QAInD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACjD,CAAC;IAEO,kBAAkB;QACxB,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;IAEO,kBAAkB;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC/C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAEM,WAAW,CAAC,QAA0B;QAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACrD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,iBAAiB,CAAC,QAA0B;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CACrC,CAAC,YAA8B,EAAE,EAAE;YACjC,OAAO,YAAY,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC;QAC7C,CAAC,CACF,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,WAAW,CAChB,cAA8B,EAC9B,WAAmB;QAEnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACrE,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEM,cAAc,CACnB,cAA8B,EAC9B,WAAmB;QAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CACrE,CAAC,MAAsB,EAAE,EAAE;YACzB,OAAO,MAAM,KAAK,cAAc,CAAC;QACnC,CAAC,CACF,CAAC;QAEF,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,uBAAuB;QACvB,IAAI,KAAK,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"SimplePropertyDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/SimplePropertyDataProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAAuD;AAMvD,iEAAiE;AAEjE;;;GAGG;AACH,MAAa,0BAA0B;IAUrC;QAPO,UAAK,GAAmB,+BAAc,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAEtD,eAAU,GAAuB,EAAE,CAAC;QACpC,YAAO,GAAiD,EAAE,CAAC;QAC3D,kBAAa,GAAG,IAAI,8CAAuB,EAAE,CAAC;QAInD,IAAI,CA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AAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CACrE,CAAC,MAAsB,EAAE,EAAE;YACzB,OAAO,MAAM,KAAK,cAAc,CAAC;QACnC,CAAC,CACF,CAAC;QAEF,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,uBAAuB;QACvB,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACjE,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,eAAe,CACpB,cAA8B,EAC9B,WAAmB,EACnB,SAAyB;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CACrE,CAAC,MAAsB,EAAE,EAAE;YACzB,OAAO,MAAM,KAAK,cAAc,CAAC;QACnC,CAAC,CACF,CAAC;QAEF,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,uBAAuB;QACvB,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CACpD,KAAK,EACL,CAAC,EACD,SAAS,CACV,CAAC;YACF,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF;AArGD,gEAqGC","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/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n IPropertyDataProvider,\n PropertyCategory,\n PropertyData,\n} from \"./PropertyDataProvider\";\nimport { PropertyDataChangeEvent } from \"./PropertyDataProvider\";\n\n/**\n * Implementation of [IPropertyDataProvider] that uses an associative array.\n * @public\n */\nexport class SimplePropertyDataProvider\n implements IPropertyDataProvider, PropertyData\n{\n public label: PropertyRecord = PropertyRecord.fromString(\"\");\n public description?: string;\n public categories: PropertyCategory[] = [];\n public records: { [categoryName: string]: PropertyRecord[] } = {};\n public onDataChanged = new PropertyDataChangeEvent();\n private _propertyData: PropertyData;\n\n constructor() {\n this._propertyData = this.createPropertyData();\n }\n\n private createPropertyData(): PropertyData {\n return {\n label: this.label,\n description: this.description,\n categories: this.categories,\n records: this.records,\n };\n }\n\n private updatePropertyData() {\n this._propertyData = this.createPropertyData();\n this.onDataChanged.raiseEvent();\n }\n\n public addCategory(category: PropertyCategory): number {\n const categoryIdx = this.categories.push(category) - 1;\n this.records[this.categories[categoryIdx].name] = [];\n this.updatePropertyData();\n return categoryIdx;\n }\n\n public findCategoryIndex(category: PropertyCategory): number {\n const index = this.categories.findIndex(\n (testCategory: PropertyCategory) => {\n return testCategory.name === category.name;\n }\n );\n return index;\n }\n\n public addProperty(\n propertyRecord: PropertyRecord,\n categoryIdx: number\n ): void {\n this.records[this.categories[categoryIdx].name].push(propertyRecord);\n this.updatePropertyData();\n }\n\n public removeProperty(\n propertyRecord: PropertyRecord,\n categoryIdx: number\n ): boolean {\n const index = this.records[this.categories[categoryIdx].name].findIndex(\n (record: PropertyRecord) => {\n return record === propertyRecord;\n }\n );\n\n let result = false;\n\n // istanbul ignore else\n if (index >= 0) {\n this.records[this.categories[categoryIdx].name].splice(index, 1);\n this.updatePropertyData();\n result = true;\n }\n return result;\n }\n\n public replaceProperty(\n propertyRecord: PropertyRecord,\n categoryIdx: number,\n newRecord: PropertyRecord\n ): boolean {\n const index = this.records[this.categories[categoryIdx].name].findIndex(\n (record: PropertyRecord) => {\n return record === propertyRecord;\n }\n );\n\n let result = false;\n\n // istanbul ignore else\n if (index >= 0) {\n this.records[this.categories[categoryIdx].name].splice(\n index,\n 1,\n newRecord\n );\n result = true;\n }\n return result;\n }\n\n public async getData(): Promise<PropertyData> {\n return this._propertyData;\n }\n}\n"]}
|
package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js
CHANGED
|
@@ -129,9 +129,9 @@ class ColumnResizingPropertyListPropsSupplier extends React.Component {
|
|
|
129
129
|
return this.props.children(listProps);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
exports.ColumnResizingPropertyListPropsSupplier = ColumnResizingPropertyListPropsSupplier;
|
|
132
133
|
ColumnResizingPropertyListPropsSupplier.defaultProps = {
|
|
133
134
|
minLabelWidth: 100,
|
|
134
135
|
minValueWidth: 100,
|
|
135
136
|
};
|
|
136
|
-
exports.ColumnResizingPropertyListPropsSupplier = ColumnResizingPropertyListPropsSupplier;
|
|
137
137
|
//# sourceMappingURL=ColumnResizingPropertyListPropsSupplier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnResizingPropertyListPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAC/B,kDAA4D;AAG5D,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,eAAe,GAAG,EAAE,CAAC;AA2C3B;;;GAGG;AACH,MAAa,uCAAwC,SAAQ,KAAK,CAAC,SAGlE;IAHD;;QAImB,kBAAa,GAAG,IAAI,CAAC;QACrB,qBAAgB,GAAG,IAAI,CAAC;QACxB,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AC,KAAK,CAAC,iBAAiB,IAAI,CAAC,CAAC;QAE5D,8DAA8D;QAC9D,wBAAwB;QACxB,gBAAgB;QAChB,wBAAwB;QACxB,0BAA0B;QAC1B,6BAA6B;QAC7B,YAAY;QACZ,MAAM,aAAa,GACjB,IAAI,CAAC,KAAK,CAAC,aAAc;YACzB,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,aAAc;YACzB,iBAAiB;YACjB,YAAY;YACZ,gBAAgB,CAAC;QACnB,gFAAgF;QAChF,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"ColumnResizingPropertyListPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAC/B,kDAA4D;AAG5D,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,eAAe,GAAG,EAAE,CAAC;AA2C3B;;;GAGG;AACH,MAAa,uCAAwC,SAAQ,KAAK,CAAC,SAGlE;IAHD;;QAImB,kBAAa,GAAG,IAAI,CAAC;QACrB,qBAAgB,GAAG,IAAI,CAAC;QACxB,qBAAgB,GAAG,GAAG,CAAC;QAChC,cAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClC,cAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAE1B,UAAK,GAAiD;YACpE,WAAW,EAAE,IAAI,CAAC,aAAa;YAC/B,qBAAqB,EAAE,KAAK;YAC5B,0BAA0B,EAAE,KAAK;SAClC,CAAC;QAQM,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YAChD,KAAK,GAAG,uBAAU,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAChE,I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YAC1D,UAAU,EAAE;gBACV,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAc;gBACxC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAc;gBACxC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAkB;gBAChD,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,EAAE;aAC9D;SACF,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;;AA9GH,0FA+GC;AA/Fe,oDAAY,GACxB;IACE,aAAa,EAAE,GAAG;IAClB,aAAa,EAAE,GAAG;CACnB,AAJuB,CAItB","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 { Orientation, UiGeometry } from \"@itwin/core-react\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\nconst BORDER_WIDTH = 10;\nconst PROPERTY_PADDING = 16;\nconst VALUE_MIN_WIDTH = 10;\n\n/** @internal */\nexport type ColumnResizeRelatedPropertyListProps = Required<\n Pick<\n PropertyListProps,\n | \"onColumnChanged\"\n | \"columnRatio\"\n | \"isResizeHandleHovered\"\n | \"onResizeHandleHoverChanged\"\n | \"isResizeHandleBeingDragged\"\n | \"onResizeHandleDragChanged\"\n | \"columnInfo\"\n | \"orientation\"\n | \"width\"\n >\n>;\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierProps {\n /** Orientation of the properties */\n orientation: Orientation;\n /** Width of the property list */\n width: number;\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n /** Maximum depth of the properties shown */\n maxPropertyDepth?: number;\n /** A callback that receives the required column-resize-related props for the [[PropertyList]] component */\n children: (props: ColumnResizeRelatedPropertyListProps) => React.ReactNode;\n}\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierState {\n columnRatio: number;\n isResizeHandleHovered: boolean;\n isResizeHandleBeingDragged: boolean;\n}\n\n/**\n * Wrapped PropertyCategoryBlock React component with list of properties and render optimization\n * @internal\n */\nexport class ColumnResizingPropertyListPropsSupplier extends React.Component<\n ColumnResizingPropertyListPropsSupplierProps,\n ColumnResizingPropertyListPropsSupplierState\n> {\n private readonly _initialRatio = 0.25;\n private readonly _defaultMinRatio = 0.15;\n private readonly _defaultMaxRatio = 0.6;\n private _minRatio = this._defaultMinRatio;\n private _maxRatio = this._defaultMaxRatio;\n\n public override state: ColumnResizingPropertyListPropsSupplierState = {\n columnRatio: this._initialRatio,\n isResizeHandleHovered: false,\n isResizeHandleBeingDragged: false,\n };\n\n public static defaultProps: Partial<ColumnResizingPropertyListPropsSupplierProps> =\n {\n minLabelWidth: 100,\n minValueWidth: 100,\n };\n\n private _onColumnRatioChanged = (ratio: number) => {\n ratio = UiGeometry.clamp(ratio, this._minRatio, this._maxRatio);\n if (this.state.columnRatio === ratio) return { ratio };\n\n this.setState({ columnRatio: ratio });\n return { ratio };\n };\n\n // istanbul ignore next\n private _onResizeHandleHoverChanged = (isHovered: boolean) => {\n this.setState({ isResizeHandleHovered: isHovered });\n };\n\n private _onResizeHandleDragChanged = (isDragStarted: boolean) => {\n this.setState({ isResizeHandleBeingDragged: isDragStarted });\n };\n\n private isMinimumColumnSizeEnabled() {\n if (this.props.orientation !== Orientation.Horizontal) return false;\n\n // calculated how much width all the borders of nested properties takes up.\n const bordersWidth = this.props.maxPropertyDepth\n ? this.props.maxPropertyDepth * BORDER_WIDTH\n : 0;\n const actionButtonWidth = this.props.actionButtonWidth ?? 0;\n\n // minimum with required to render property. This consists of:\n // * minimum label width\n // * 1px resizer\n // * minimum value width\n // * actions buttons width\n // * all nested borders width\n // * padding\n const propertyWidth =\n this.props.minLabelWidth! +\n 1 +\n this.props.minValueWidth! +\n actionButtonWidth +\n bordersWidth +\n PROPERTY_PADDING;\n // default behavior for screens that are too small to have minimum column widths\n if (this.props.width < propertyWidth) {\n this._minRatio = this._defaultMinRatio;\n // if there are action buttons calculate maximum ratio for label. Otherwise use default.\n this._maxRatio = this.props.actionButtonWidth\n ? (this.props.width -\n this.props.actionButtonWidth -\n bordersWidth -\n PROPERTY_PADDING -\n VALUE_MIN_WIDTH) /\n this.props.width\n : this._defaultMaxRatio;\n return false;\n }\n\n this._minRatio = this.props.minLabelWidth! / this.props.width;\n this._maxRatio =\n (this.props.width - actionButtonWidth - this.props.minValueWidth!) /\n this.props.width;\n return true;\n }\n\n private getValidColumnRatio(): number {\n return UiGeometry.clamp(\n this.state.columnRatio,\n this._minRatio,\n this._maxRatio\n );\n }\n\n public override render() {\n const listProps: ColumnResizeRelatedPropertyListProps = {\n orientation: this.props.orientation,\n width: this.props.width,\n onColumnChanged: this._onColumnRatioChanged,\n columnRatio: this.getValidColumnRatio(),\n isResizeHandleHovered: this.state.isResizeHandleHovered,\n onResizeHandleHoverChanged: this._onResizeHandleHoverChanged,\n isResizeHandleBeingDragged: this.state.isResizeHandleBeingDragged,\n onResizeHandleDragChanged: this._onResizeHandleDragChanged,\n columnInfo: {\n minLabelWidth: this.props.minLabelWidth!,\n minValueWidth: this.props.minValueWidth!,\n actionButtonWidth: this.props.actionButtonWidth!,\n isMinimumColumnSizeEnabled: this.isMinimumColumnSizeEnabled(),\n },\n };\n return this.props.children(listProps);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatItemNestedBorderWrapper.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/FlatItemNestedBorderWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAoC;AACpC,6CAA+B;AAa/B;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,KAA+B;IACzE,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"FlatItemNestedBorderWrapper.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/FlatItemNestedBorderWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAoC;AACpC,6CAA+B;AAa/B;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,KAA+B;IACzE,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,6BAAK,SAAS,EAAE,KAAK,CAAC,SAAS,IAAG,KAAK,CAAC,QAAQ,CAAO,CAAC;IACjE,CAAC;IAED,MAAM,oBAAoB,GACxB,KAAK,CAAC,iBAAiB,IAAI,CAAC;QAC5B,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,WAAW,CAAC;IAC/C,MAAM,UAAU,GAAW,IAAA,oBAAU,EACnC,sBAAsB,EACtB,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAC1D,CAAC;IAEF,IAAI,wBAAwB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACvD,IAAI,oBAAoB;QAAE,wBAAwB,EAAE,CAAC;IAErD,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU;QACxB,oBAAC,2BAA2B,IAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,EAClC,iBAAiB,EAAE,wBAAwB,IAE1C,KAAK,CAAC,QAAQ,CACa,CAC1B,CACP,CAAC;AACJ,CAAC;AA3BD,kEA2BC","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 * as React from \"react\";\n\n/** @internal */\nexport interface NestedBorderWrapperProps {\n className?: string;\n /** Number of bottom borders to draw (no more than side borders) */\n bottomBorderCount: number;\n /** Number of side borders to draw */\n borderCount: number;\n /** Node to wrap around */\n children: React.ReactNode;\n}\n\n/**\n * FlatItemNestedBorderWrapper React component.\n * Wraps provided ReactNode in nested borders recursively according to provided borderCount.\n * @internal\n */\nexport function FlatItemNestedBorderWrapper(props: NestedBorderWrapperProps) {\n if (props.borderCount <= 0) {\n return <div className={props.className}>{props.children}</div>;\n }\n\n const isBottomBorderNeeded =\n props.bottomBorderCount >= 0 &&\n props.bottomBorderCount >= props.borderCount;\n const classNames: string = classnames(\n \"nested-border-middle\",\n isBottomBorderNeeded ? \"nested-border-bottom\" : undefined\n );\n\n let currentBottomBorderCount = props.bottomBorderCount;\n if (isBottomBorderNeeded) currentBottomBorderCount--;\n\n return (\n <div className={classNames}>\n <FlatItemNestedBorderWrapper\n className={props.className}\n borderCount={props.borderCount - 1}\n bottomBorderCount={currentBottomBorderCount}\n >\n {props.children}\n </FlatItemNestedBorderWrapper>\n </div>\n );\n}\n"]}
|
|
@@ -43,6 +43,7 @@ class PropertyGridCommons {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
exports.PropertyGridCommons = PropertyGridCommons;
|
|
46
47
|
/**
|
|
47
48
|
* A helper method to get links from string.
|
|
48
49
|
* @internal
|
|
@@ -52,5 +53,4 @@ PropertyGridCommons.getLinks = (value) => {
|
|
|
52
53
|
return { start: linkInfo.index, end: linkInfo.lastIndex };
|
|
53
54
|
});
|
|
54
55
|
};
|
|
55
|
-
exports.PropertyGridCommons = PropertyGridCommons;
|
|
56
56
|
//# sourceMappingURL=PropertyGridCommons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,kDAAgD;AAEhD,8CAAgD;AAgGhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CACjC,KAAa,EACb,oBAAkC,EAClC,kBAA4B,EAC5B,6BAAsC;QAEtC,MAAM,WAAW,GAAG,oBAAoB,IAAI,wBAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YAAE,OAAO,WAAW,CAAC;QAE3C,6BAA6B,GAAG,6BAA6B,IAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YAAE,OAAO,wBAAW,CAAC,QAAQ,CAAC;QAEvE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QACnC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,kDAAgD;AAEhD,8CAAgD;AAgGhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CACjC,KAAa,EACb,oBAAkC,EAClC,kBAA4B,EAC5B,6BAAsC;QAEtC,MAAM,WAAW,GAAG,oBAAoB,IAAI,wBAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YAAE,OAAO,WAAW,CAAC;QAE3C,6BAA6B,GAAG,6BAA6B,IAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YAAE,OAAO,wBAAW,CAAC,QAAQ,CAAC;QAEvE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QACnC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC9D,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC;iBAC3B,CAAC;gBACJ,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,UAAU;oBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;;AAlCH,kDAiDC;AAbC;;;GAGG;AACW,4BAAQ,GAAG,CACvB,KAAa,EAC0B,EAAE;IACzC,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,GAAG,CAC1B,CAAC,QAA8C,EAAE,EAAE;QACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CACF,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { matchLinks } from \"../../common/Links\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\nimport type { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\nimport type { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\n\n/** Arguments for the Property Editing event callback\n * @public\n */\nexport interface PropertyEditingArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** Unique key of currently edited property */\n propertyKey?: string;\n}\n\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\n * @public\n */\nexport interface PropertyGridContextMenuArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** An event which caused the context menu callback */\n event: React.MouseEvent;\n}\n\n/**\n * Common Property Grid Props to be used by Property Grid Variants\n * @public\n */\nexport interface CommonPropertyGridProps extends CommonProps {\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\n orientation?: Orientation;\n\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n\n /** Called to show a context menu when properties are right-clicked */\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\n\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property selection with right click */\n isPropertySelectionOnRightClickEnabled?: boolean;\n /** Callback to property selection */\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\n\n /** Enables/disables property editing */\n isPropertyEditingEnabled?: boolean;\n /** Callback for when properties are being edited */\n onPropertyEditing?: (\n args: PropertyEditingArgs,\n category: PropertyCategory\n ) => void;\n /** Callback for when properties are updated */\n onPropertyUpdated?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => Promise<boolean>;\n\n /** Custom property value renderer manager */\n propertyValueRendererManager?: PropertyValueRendererManager;\n\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */\n isOrientationFixed?: boolean;\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */\n horizontalOrientationMinWidth?: number;\n\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n\n /**\n * Array of action button renderers. Each renderer is called for each property and can decide\n * to render an action button for the property or not.\n */\n actionButtonRenderers?: ActionButtonRenderer[];\n}\n\n/**\n * Properties for highlighting text in property grid.\n * @public\n */\nexport interface PropertyGridContentHighlightProps\n extends HighlightingComponentProps {\n /**\n * Specifies what the highlighting should be applied on - category labels, property labels and / or property values.\n * Defaults to \"nowhere\".\n */\n filteredTypes?: FilteredType[];\n}\n\n/** @internal */\nexport class PropertyGridCommons {\n public static getCurrentOrientation(\n width: number,\n preferredOrientation?: Orientation,\n isOrientationFixed?: boolean,\n horizontalOrientationMinWidth?: number\n ): Orientation {\n const orientation = preferredOrientation ?? Orientation.Horizontal;\n if (isOrientationFixed) return orientation;\n\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\n // Switch to Vertical if width too small\n if (width < horizontalOrientationMinWidth) return Orientation.Vertical;\n\n return orientation;\n }\n\n /**\n * Helper method to handle link clicks\n * @internal\n */\n public static handleLinkClick(text: string) {\n const linksArray = matchLinks(text);\n if (linksArray.length <= 0) return;\n const foundLink = linksArray[0];\n // istanbul ignore else\n if (foundLink && foundLink.url) {\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\n location.href = foundLink.url;\n else {\n const windowOpen = window.open(foundLink.url, \"_blank\");\n if (windowOpen) windowOpen.focus();\n }\n }\n }\n\n /**\n * A helper method to get links from string.\n * @internal\n */\n public static getLinks = (\n value: string\n ): Array<{ start: number; end: number }> => {\n return matchLinks(value).map(\n (linkInfo: { index: number; lastIndex: number }) => {\n return { start: linkInfo.index, end: linkInfo.lastIndex };\n }\n );\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG;;GAEG;AACH,+BAA6B;AAC7B,6CAA+B;AA4D/B;;GAEG;AACH,MAAa,sCAAuC,SAAQ,KAAK,CAAC,SAGjE;IACC,gBAAgB;IAChB,YAAY,KAAkD;QAC5D,KAAK,CAAC,KAAK,CAAC,CAAC;QAeP,4BAAuB,GAAG,CAChC,QAAwB,EACxB,GAAY,EACZ,EAAE;YACF,uBAAuB;YACvB,IAAI,IAAI,CAAC,sBAAsB,EAAE;gBAC/B,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACtD,CAAC,CAAC;QAEM,uBAAkB,GAAG,CAAC,QAAwB,EAAE,GAAY,EAAE,EAAE;YACtE,uBAAuB;YACvB,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC1B,IAAI,CAAC,4BAA4B,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACrD,CAAC,CAAC;QAEM,2BAAsB,GAAG,CAC/B,QAAwB,EACxB,CAAmB,EACnB,EAAE;YACF,IAAI,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE;gBACpC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aAC1E;QACH,CAAC,CAAC;QAEM,kBAAa,GAAG,KAAK,EAC3B,IAAyB,EACzB,QAA0B,EAC1B,EAAE;YACF,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;gBAChC,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACnD,IA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AI,CAAC,uBAAuB;gBAC9B,CAAC,CAAC,SAAS;YACb,qBAAqB,EAAE,IAAI,CAAC,sBAAsB;SACnD,CAAC;QAEF,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAkB,CACtE,CAAC;IACJ,CAAC;CACF;AAnID,wFAmIC","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\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport \"./PropertyGrid.scss\";\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\nimport type { CommonPropertyGridProps } from \"./PropertyGridCommons\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\n/** @internal */\nexport type PropertyGridEventsRelatedProps = Pick<\n PropertyListProps,\n | \"onPropertyClicked\"\n | \"onPropertyRightClicked\"\n | \"onPropertyContextMenu\"\n | \"onEditCommit\"\n | \"onEditCancel\"\n | \"selectedPropertyKey\"\n | \"editingPropertyKey\"\n> &\n Pick<\n CommonPropertyGridProps,\n \"isPropertySelectionOnRightClickEnabled\" | \"isPropertyEditingEnabled\"\n > &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n >;\n\n/** Properties for [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\nexport type PropertyGridEventsRelatedPropsSupplierProps = Pick<\n CommonPropertyGridProps,\n | \"onPropertyContextMenu\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"onPropertySelectionChanged\"\n | \"isPropertyEditingEnabled\"\n | \"onPropertyUpdated\"\n> &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n > & {\n children: (context: PropertyGridEventsRelatedProps) => React.ReactNode;\n };\n\n/** State of [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\ninterface PropertyGridEventsRelatedPropsSupplierState {\n /** Unique key of currently selected property */\n selectedPropertyKey?: string;\n /** Unique key of currently edited property */\n editingPropertyKey?: string;\n}\n\n/** PropertyGridEventsRelatedPropsSupplier React component.\n * @internal\n */\nexport class PropertyGridEventsRelatedPropsSupplier extends React.Component<\n PropertyGridEventsRelatedPropsSupplierProps,\n PropertyGridEventsRelatedPropsSupplierState\n> {\n /** @internal */\n constructor(props: PropertyGridEventsRelatedPropsSupplierProps) {\n super(props);\n this.state = {};\n }\n\n private _isClickSupported() {\n return (\n this.props.isPropertySelectionEnabled ||\n this.props.isPropertyEditingEnabled\n );\n }\n\n private _isRightClickSupported() {\n return this.props.isPropertySelectionOnRightClickEnabled;\n }\n\n private _onPropertyRightClicked = (\n property: PropertyRecord,\n key?: string\n ) => {\n // istanbul ignore else\n if (this._isRightClickSupported())\n this.onEnabledPropertyRightClicked(property, key);\n };\n\n private _onPropertyClicked = (property: PropertyRecord, key?: string) => {\n // istanbul ignore else\n if (this._isClickSupported())\n this.onEnabledPropertyLeftClicked(property, key);\n };\n\n private _onPropertyContextMenu = (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => {\n if (this.props.onPropertyContextMenu) {\n this.props.onPropertyContextMenu({ propertyRecord: property, event: e });\n }\n };\n\n private _onEditCommit = async (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => {\n // istanbul ignore else\n if (this.props.onPropertyUpdated) {\n await this.props.onPropertyUpdated(args, category);\n this.setState({ editingPropertyKey: undefined });\n }\n };\n\n private _onEditCancel = () => {\n this.setState({ editingPropertyKey: undefined });\n };\n\n private onEnabledPropertyRightClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n editingPropertyKey = undefined;\n if (selectedPropertyKey !== key) selectedPropertyKey = key;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n private onEnabledPropertyLeftClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n const isEditingEnabled = this.props.isPropertyEditingEnabled;\n const isSelectionEnabled = this.props.isPropertySelectionEnabled;\n\n if (isEditingEnabled) {\n // Deselect editing key only if another selection was made\n editingPropertyKey =\n isSelectionEnabled && selectedPropertyKey !== key ? undefined : key;\n }\n\n if (editingPropertyKey === key) {\n this.setState({ editingPropertyKey });\n return;\n }\n\n // Select/Deselect\n selectedPropertyKey = selectedPropertyKey !== key ? key : undefined;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n /** @internal */\n public override render() {\n const renderContext: PropertyGridEventsRelatedProps = {\n isPropertyHoverEnabled: this.props.isPropertyHoverEnabled,\n isPropertySelectionEnabled: this.props.isPropertySelectionEnabled,\n isPropertySelectionOnRightClickEnabled:\n this.props.isPropertySelectionOnRightClickEnabled,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n selectedPropertyKey: this.state.selectedPropertyKey,\n editingPropertyKey: this.state.editingPropertyKey,\n onEditCommit: this._onEditCommit,\n onEditCancel: this._onEditCancel,\n onPropertyClicked: this._isClickSupported()\n ? this._onPropertyClicked\n : undefined,\n onPropertyRightClicked: this._isRightClickSupported()\n ? this._onPropertyRightClicked\n : undefined,\n onPropertyContextMenu: this._onPropertyContextMenu,\n };\n\n return (\n <React.Fragment>{this.props.children(renderContext)}</React.Fragment>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG;;GAEG;AACH,+BAA6B;AAC7B,6CAA+B;AA4D/B;;GAEG;AACH,MAAa,sCAAuC,SAAQ,KAAK,CAAC,SAGjE;IACC,gBAAgB;IAChB,YAAY,KAAkD;QAC5D,KAAK,CAAC,KAAK,CAAC,CAAC;QAeP,4BAAuB,GAAG,CAChC,QAAwB,EACxB,GAAY,EACZ,EAAE;YACF,uBAAuB;YACvB,IAAI,IAAI,CAAC,sBAAsB,EAAE;gBAC/B,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACtD,CAAC,CAAC;QAEM,uBAAkB,GAAG,CAAC,QAAwB,EAAE,GAAY,EAAE,EAAE;YACtE,uBAAuB;YACvB,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC1B,IAAI,CAAC,4BAA4B,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACrD,CAAC,CAAC;QAEM,2BAAsB,GAAG,CAC/B,QAAwB,EACxB,CAAmB,EACnB,EAAE;YACF,IAAI,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;gBACrC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC,CAAC;QAEM,kBAAa,GAAG,KAAK,EAC3B,IAAyB,EACzB,QAA0B,EAC1B,EAAE;YACF,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBACjC,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACnD,IAAI,CAAC,QAAQ,CAAC,EA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C,IAAI,CAAC,uBAAuB;gBAC9B,CAAC,CAAC,SAAS;YACb,qBAAqB,EAAE,IAAI,CAAC,sBAAsB;SACnD,CAAC;QAEF,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAkB,CACtE,CAAC;IACJ,CAAC;CACF;AAnID,wFAmIC","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\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport \"./PropertyGrid.scss\";\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\nimport type { CommonPropertyGridProps } from \"./PropertyGridCommons\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\n/** @internal */\nexport type PropertyGridEventsRelatedProps = Pick<\n PropertyListProps,\n | \"onPropertyClicked\"\n | \"onPropertyRightClicked\"\n | \"onPropertyContextMenu\"\n | \"onEditCommit\"\n | \"onEditCancel\"\n | \"selectedPropertyKey\"\n | \"editingPropertyKey\"\n> &\n Pick<\n CommonPropertyGridProps,\n \"isPropertySelectionOnRightClickEnabled\" | \"isPropertyEditingEnabled\"\n > &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n >;\n\n/** Properties for [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\nexport type PropertyGridEventsRelatedPropsSupplierProps = Pick<\n CommonPropertyGridProps,\n | \"onPropertyContextMenu\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"onPropertySelectionChanged\"\n | \"isPropertyEditingEnabled\"\n | \"onPropertyUpdated\"\n> &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n > & {\n children: (context: PropertyGridEventsRelatedProps) => React.ReactNode;\n };\n\n/** State of [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\ninterface PropertyGridEventsRelatedPropsSupplierState {\n /** Unique key of currently selected property */\n selectedPropertyKey?: string;\n /** Unique key of currently edited property */\n editingPropertyKey?: string;\n}\n\n/** PropertyGridEventsRelatedPropsSupplier React component.\n * @internal\n */\nexport class PropertyGridEventsRelatedPropsSupplier extends React.Component<\n PropertyGridEventsRelatedPropsSupplierProps,\n PropertyGridEventsRelatedPropsSupplierState\n> {\n /** @internal */\n constructor(props: PropertyGridEventsRelatedPropsSupplierProps) {\n super(props);\n this.state = {};\n }\n\n private _isClickSupported() {\n return (\n this.props.isPropertySelectionEnabled ||\n this.props.isPropertyEditingEnabled\n );\n }\n\n private _isRightClickSupported() {\n return this.props.isPropertySelectionOnRightClickEnabled;\n }\n\n private _onPropertyRightClicked = (\n property: PropertyRecord,\n key?: string\n ) => {\n // istanbul ignore else\n if (this._isRightClickSupported())\n this.onEnabledPropertyRightClicked(property, key);\n };\n\n private _onPropertyClicked = (property: PropertyRecord, key?: string) => {\n // istanbul ignore else\n if (this._isClickSupported())\n this.onEnabledPropertyLeftClicked(property, key);\n };\n\n private _onPropertyContextMenu = (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => {\n if (this.props.onPropertyContextMenu) {\n this.props.onPropertyContextMenu({ propertyRecord: property, event: e });\n }\n };\n\n private _onEditCommit = async (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => {\n // istanbul ignore else\n if (this.props.onPropertyUpdated) {\n await this.props.onPropertyUpdated(args, category);\n this.setState({ editingPropertyKey: undefined });\n }\n };\n\n private _onEditCancel = () => {\n this.setState({ editingPropertyKey: undefined });\n };\n\n private onEnabledPropertyRightClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n editingPropertyKey = undefined;\n if (selectedPropertyKey !== key) selectedPropertyKey = key;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n private onEnabledPropertyLeftClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n const isEditingEnabled = this.props.isPropertyEditingEnabled;\n const isSelectionEnabled = this.props.isPropertySelectionEnabled;\n\n if (isEditingEnabled) {\n // Deselect editing key only if another selection was made\n editingPropertyKey =\n isSelectionEnabled && selectedPropertyKey !== key ? undefined : key;\n }\n\n if (editingPropertyKey === key) {\n this.setState({ editingPropertyKey });\n return;\n }\n\n // Select/Deselect\n selectedPropertyKey = selectedPropertyKey !== key ? key : undefined;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n /** @internal */\n public override render() {\n const renderContext: PropertyGridEventsRelatedProps = {\n isPropertyHoverEnabled: this.props.isPropertyHoverEnabled,\n isPropertySelectionEnabled: this.props.isPropertySelectionEnabled,\n isPropertySelectionOnRightClickEnabled:\n this.props.isPropertySelectionOnRightClickEnabled,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n selectedPropertyKey: this.state.selectedPropertyKey,\n editingPropertyKey: this.state.editingPropertyKey,\n onEditCommit: this._onEditCommit,\n onEditCancel: this._onEditCancel,\n onPropertyClicked: this._isClickSupported()\n ? this._onPropertyClicked\n : undefined,\n onPropertyRightClicked: this._isRightClickSupported()\n ? this._onPropertyRightClicked\n : undefined,\n onPropertyContextMenu: this._onPropertyContextMenu,\n };\n\n return (\n <React.Fragment>{this.props.children(renderContext)}</React.Fragment>\n );\n }\n}\n"]}
|