@itwin/components-react 4.15.5 → 4.16.1
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 +25 -1
- package/lib/cjs/components-react/UiComponents.d.ts.map +1 -1
- package/lib/cjs/components-react/UiComponents.js +2 -0
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/common/CheckBoxState.d.ts +13 -0
- package/lib/cjs/components-react/common/CheckBoxState.d.ts.map +1 -0
- package/lib/cjs/components-react/common/CheckBoxState.js +17 -0
- package/lib/cjs/components-react/common/CheckBoxState.js.map +1 -0
- package/lib/cjs/components-react/common/HighlightedText.d.ts.map +1 -1
- package/lib/cjs/components-react/common/HighlightedText.js +78 -16
- package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/cjs/components-react/common/Orientation.d.ts +13 -0
- package/lib/cjs/components-react/common/Orientation.d.ts.map +1 -0
- package/lib/cjs/components-react/common/Orientation.js +17 -0
- package/lib/cjs/components-react/common/Orientation.js.map +1 -0
- package/lib/cjs/components-react/common/TimeFormat.d.ts +13 -0
- package/lib/cjs/components-react/common/TimeFormat.d.ts.map +1 -0
- package/lib/cjs/components-react/common/TimeFormat.js +17 -0
- package/lib/cjs/components-react/common/TimeFormat.js.map +1 -0
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js +8 -8
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.d.ts.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.js +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/BooleanEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.js +0 -5
- package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js +1 -5
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js +0 -5
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.js +73 -2
- package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js +0 -4
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.js +0 -5
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.js +0 -4
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js +0 -4
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/NumericInputEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.js +0 -5
- package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.d.ts +0 -3
- package/lib/cjs/components-react/editors/PopupButton.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.js +1 -4
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.scss +3 -4
- package/lib/cjs/components-react/editors/SliderEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/SliderEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.js +6 -7
- package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js +1 -5
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/TextareaEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.js +0 -5
- package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/ToggleEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.js +0 -5
- package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js +2 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts +0 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +3 -7
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.d.ts +0 -4
- package/lib/cjs/components-react/filtering/ResultSelector.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.js +0 -4
- package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +0 -3
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +1 -7
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/l10n/LocalizationProvider.d.ts +10 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.js +46 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/cjs/components-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/cjs/components-react/{useTranslation.js → l10n/useTranslation.js} +2 -2
- package/lib/cjs/components-react/l10n/useTranslation.js.map +1 -0
- package/lib/cjs/components-react/properties/ValueRendererManager.d.ts +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.d.ts +1 -2
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js +2 -3
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +3 -3
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -5
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +0 -2
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js +3 -3
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.d.ts +1 -5
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js +0 -4
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.js +3 -3
- package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +2 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts +1 -2
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +0 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +0 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +3 -4
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +3 -3
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +0 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +0 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.d.ts +1 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyList.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js +2 -3
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -4
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +14 -8
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +9 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +0 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +0 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +2 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts +15 -8
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +25 -17
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts +12 -8
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js +8 -9
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.scss +0 -7
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts +4 -2
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +4 -3
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts +14 -2
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js +3 -2
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +3 -0
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js +2 -2
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +9 -2
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/cjs/components-react.d.ts +10 -6
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +10 -6
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/UiComponents.d.ts.map +1 -1
- package/lib/esm/components-react/UiComponents.js +2 -0
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/common/CheckBoxState.d.ts +13 -0
- package/lib/esm/components-react/common/CheckBoxState.d.ts.map +1 -0
- package/lib/esm/components-react/common/CheckBoxState.js +14 -0
- package/lib/esm/components-react/common/CheckBoxState.js.map +1 -0
- package/lib/esm/components-react/common/HighlightedText.d.ts.map +1 -1
- package/lib/esm/components-react/common/HighlightedText.js +56 -14
- package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/esm/components-react/common/Orientation.d.ts +13 -0
- package/lib/esm/components-react/common/Orientation.d.ts.map +1 -0
- package/lib/esm/components-react/common/Orientation.js +14 -0
- package/lib/esm/components-react/common/Orientation.js.map +1 -0
- package/lib/esm/components-react/common/TimeFormat.d.ts +13 -0
- package/lib/esm/components-react/common/TimeFormat.d.ts.map +1 -0
- package/lib/esm/components-react/common/TimeFormat.js +14 -0
- package/lib/esm/components-react/common/TimeFormat.js.map +1 -0
- package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.d.ts.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.js +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/BooleanEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.js +0 -5
- package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js +1 -5
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js +0 -5
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.js +74 -3
- package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js +0 -4
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.js +0 -5
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.js +0 -4
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js +0 -4
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/NumericInputEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.js +0 -5
- package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.d.ts +0 -3
- package/lib/esm/components-react/editors/PopupButton.d.ts.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.js +1 -4
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.scss +3 -4
- package/lib/esm/components-react/editors/SliderEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/SliderEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.js +6 -7
- package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js +1 -5
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/TextareaEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.js +0 -5
- package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/ToggleEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.js +0 -5
- package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js +2 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts +0 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js +3 -7
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.d.ts +0 -4
- package/lib/esm/components-react/filtering/ResultSelector.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.js +0 -4
- package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +0 -3
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +1 -7
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/l10n/LocalizationProvider.d.ts +10 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.js +19 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/esm/components-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/esm/components-react/{useTranslation.js → l10n/useTranslation.js} +2 -2
- package/lib/esm/components-react/l10n/useTranslation.js.map +1 -0
- package/lib/esm/components-react/properties/ValueRendererManager.d.ts +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.d.ts.map +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.d.ts +1 -2
- package/lib/esm/components-react/properties/renderers/ActionButtonList.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js +1 -2
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -5
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +0 -2
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.d.ts +1 -5
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js +0 -4
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.js +2 -2
- package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +2 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts +1 -2
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +3 -4
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +0 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +0 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.d.ts +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyList.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.js +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -4
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +12 -6
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +9 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +0 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +0 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts +15 -8
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +25 -17
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.d.ts +12 -8
- package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js +9 -10
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.scss +0 -7
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts +4 -2
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +4 -3
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts +14 -2
- package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js +3 -2
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +3 -0
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +9 -2
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react.d.ts +10 -6
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +10 -6
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +3 -5
- package/lib/cjs/components-react/useTranslation.d.ts.map +0 -1
- package/lib/cjs/components-react/useTranslation.js.map +0 -1
- package/lib/esm/components-react/useTranslation.d.ts.map +0 -1
- package/lib/esm/components-react/useTranslation.js.map +0 -1
- /package/lib/cjs/components-react/{useTranslation.d.ts → l10n/useTranslation.d.ts} +0 -0
- /package/lib/esm/components-react/{useTranslation.d.ts → l10n/useTranslation.d.ts} +0 -0
|
@@ -27,14 +27,10 @@ export declare class IconEditor extends React.PureComponent<PropertyEditorProps,
|
|
|
27
27
|
get hasFocus(): boolean;
|
|
28
28
|
private setFocus;
|
|
29
29
|
private _onIconChange;
|
|
30
|
-
/** @internal */
|
|
31
30
|
componentDidMount(): void;
|
|
32
|
-
/** @internal */
|
|
33
31
|
componentWillUnmount(): void;
|
|
34
|
-
/** @internal */
|
|
35
32
|
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
36
33
|
private setStateFromProps;
|
|
37
|
-
/** @internal */
|
|
38
34
|
render(): React.JSX.Element;
|
|
39
35
|
}
|
|
40
36
|
/** Icon Property Editor registered for the "text" and "string" type names and the "icon-picker" editor name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/IconEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAIV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAIjC,gBAAgB;AAChB,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,UACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,eAAe,CAChE,YAAW,UAAU;IAErB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAqC;gBAE5C,KAAK,EAAE,mBAAmB;IA+BzB,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WA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vB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -81,16 +81,13 @@ export class IconEditor extends React.PureComponent {
|
|
|
81
81
|
this._control.setFocus();
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
/** @internal */
|
|
85
84
|
componentDidMount() {
|
|
86
85
|
this._isMounted = true;
|
|
87
86
|
void this.setStateFromProps();
|
|
88
87
|
}
|
|
89
|
-
/** @internal */
|
|
90
88
|
componentWillUnmount() {
|
|
91
89
|
this._isMounted = false;
|
|
92
90
|
}
|
|
93
|
-
/** @internal */
|
|
94
91
|
componentDidUpdate(prevProps) {
|
|
95
92
|
if (this.props.propertyRecord !== prevProps.propertyRecord) {
|
|
96
93
|
void this.setStateFromProps();
|
|
@@ -111,7 +108,6 @@ export class IconEditor extends React.PureComponent {
|
|
|
111
108
|
}
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
|
-
/** @internal */
|
|
115
111
|
render() {
|
|
116
112
|
const { icon, icons, numColumns } = this.state;
|
|
117
113
|
return (React.createElement("div", { className: classnames("components-icon-editor", this.props.className), style: this.props.style, ref: this._divElement },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/IconEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAajC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AAC,QAAQ,EAAE,CAAC;oBACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC/C,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACrE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,GAAG,EAAE,IAAI,CAAC,WAAW;YAErB,oBAAC,gBAAgB,IACf,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,EAC3C,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC/B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,YAAY,EAAE,IAAI,CAAC,aAAa,iBACpB,wBAAwB,GACpC,CACE,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,IAAI,EACtB,kBAAkB,EAClB,mBAAmB,CAAC,UAAU,CAC/B,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,kBAAkB,EAClB,mBAAmB,CAAC,UAAU,CAC/B,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 PropertyEditors\n */\n\nimport \"./IconEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n IconListEditorParams,\n PropertyEditorParams,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n StandardEditorNames,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport { IconPickerButton } from \"../iconpicker/IconPickerButton\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\nimport {\n PropertyEditorBase,\n PropertyEditorManager,\n} from \"./PropertyEditorManager\";\n\n// cspell:ignore iconpicker\n\n/** @internal */\ninterface IconEditorState {\n icon: string;\n icons: string[];\n numColumns: number;\n readonly?: boolean;\n isDisabled?: boolean;\n}\n\n/** IconEditor React component that is a property editor with button and popup\n * @alpha\n */\nexport class IconEditor\n extends React.PureComponent<PropertyEditorProps, IconEditorState>\n implements TypeEditor\n{\n private _control: any = null;\n private _isMounted = false;\n private _divElement = React.createRef<HTMLDivElement>();\n\n constructor(props: PropertyEditorProps) {\n super(props);\n\n let icon = \"\";\n let numColumns = 4;\n const icons: string[] = [];\n const readonly = false;\n\n // TODO: add support for following if we need to specify set of weights to display\n const record = props.propertyRecord;\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const iconParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.IconListData.valueOf()\n ) as IconListEditorParams;\n if (iconParams) {\n if (iconParams.iconValue) icon = iconParams.iconValue;\n if (iconParams.numColumns) numColumns = iconParams.numColumns;\n if (iconParams.iconValues)\n iconParams.iconValues.forEach((i: string) => icons.push(i));\n }\n }\n\n this.state = { icon, icons, numColumns, readonly };\n }\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.icon,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._divElement.current;\n }\n\n public get hasFocus(): boolean {\n let containsFocus = false;\n if (this._divElement.current)\n containsFocus = this._divElement.current.contains(document.activeElement);\n return containsFocus;\n }\n\n private setFocus(): void {\n if (this._control && !this.state.isDisabled) {\n this._control.setFocus();\n }\n }\n\n private _onIconChange = (icon: string) => {\n const propertyRecord = this.props.propertyRecord as PropertyRecord;\n\n this.setState(\n {\n icon,\n },\n async () => {\n if (propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue) {\n this.props.onCommit({ propertyRecord, newValue: propertyValue });\n }\n }\n }\n );\n };\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = \"\";\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as string;\n }\n\n const readonly =\n record && undefined !== record.isReadonly ? record.isReadonly : false;\n const isDisabled = record ? record.isDisabled : undefined;\n\n if (this._isMounted)\n this.setState({ icon: initialValue, readonly, isDisabled }, () => {\n if (this.props.setFocus) {\n this.setFocus();\n }\n });\n }\n\n /** @internal */\n public override render() {\n const { icon, icons, numColumns } = this.state;\n return (\n <div\n className={classnames(\"components-icon-editor\", this.props.className)}\n style={this.props.style}\n ref={this._divElement}\n >\n <IconPickerButton\n ref={(control) => (this._control = control)}\n icon={icon}\n icons={icons}\n numColumns={numColumns}\n disabled={this.state.isDisabled}\n readonly={this.state.readonly}\n onIconChange={this._onIconChange}\n data-testid=\"components-icon-editor\"\n />\n </div>\n );\n }\n}\n\n/** Icon Property Editor registered for the \"text\" and \"string\" type names and the \"icon-picker\" editor name.\n * It uses the [[IconEditor]] React component.\n * @alpha\n */\nexport class IconPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <IconEditor />;\n }\n}\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Text,\n IconPropertyEditor,\n StandardEditorNames.IconPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.String,\n IconPropertyEditor,\n StandardEditorNames.IconPicker\n);\n"]}
|
|
1
|
+
{"version":3,"file":"IconEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/IconEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAajC;;GAEG;AACH,MAAM,OAAO,UACX,SAAQ,KAAK,CAAC,aAAmD;IAOjE,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QALP,aAAQ,GAAQ,IAAI,CAAC;QACrB,eAAU,GAAG,KAAK,CAAC;QACnB,gBAAW,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAiEhD,kBAAa,GAAG,CAAC,IAAY,EAAE,EAAE;YACvC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAgC,CAAC;YAEnE,IAAI,CAAC,QAAQ,CACX;gBACE,IAAI;aACL,EACD,KAAK,IAAI,EAAE;gBACT,IAAI,cAAc,IAAI,I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AI,CAAC,QAAQ,GAAG,OAAO,CAAC,EAC3C,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC/B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,YAAY,EAAE,IAAI,CAAC,aAAa,iBACpB,wBAAwB,GACpC,CACE,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,IAAI,EACtB,kBAAkB,EAClB,mBAAmB,CAAC,UAAU,CAC/B,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,kBAAkB,EAClB,mBAAmB,CAAC,UAAU,CAC/B,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 PropertyEditors\n */\n\nimport \"./IconEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n IconListEditorParams,\n PropertyEditorParams,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n StandardEditorNames,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport { IconPickerButton } from \"../iconpicker/IconPickerButton\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\nimport {\n PropertyEditorBase,\n PropertyEditorManager,\n} from \"./PropertyEditorManager\";\n\n// cspell:ignore iconpicker\n\n/** @internal */\ninterface IconEditorState {\n icon: string;\n icons: string[];\n numColumns: number;\n readonly?: boolean;\n isDisabled?: boolean;\n}\n\n/** IconEditor React component that is a property editor with button and popup\n * @alpha\n */\nexport class IconEditor\n extends React.PureComponent<PropertyEditorProps, IconEditorState>\n implements TypeEditor\n{\n private _control: any = null;\n private _isMounted = false;\n private _divElement = React.createRef<HTMLDivElement>();\n\n constructor(props: PropertyEditorProps) {\n super(props);\n\n let icon = \"\";\n let numColumns = 4;\n const icons: string[] = [];\n const readonly = false;\n\n // TODO: add support for following if we need to specify set of weights to display\n const record = props.propertyRecord;\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const iconParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.IconListData.valueOf()\n ) as IconListEditorParams;\n if (iconParams) {\n if (iconParams.iconValue) icon = iconParams.iconValue;\n if (iconParams.numColumns) numColumns = iconParams.numColumns;\n if (iconParams.iconValues)\n iconParams.iconValues.forEach((i: string) => icons.push(i));\n }\n }\n\n this.state = { icon, icons, numColumns, readonly };\n }\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.icon,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._divElement.current;\n }\n\n public get hasFocus(): boolean {\n let containsFocus = false;\n if (this._divElement.current)\n containsFocus = this._divElement.current.contains(document.activeElement);\n return containsFocus;\n }\n\n private setFocus(): void {\n if (this._control && !this.state.isDisabled) {\n this._control.setFocus();\n }\n }\n\n private _onIconChange = (icon: string) => {\n const propertyRecord = this.props.propertyRecord as PropertyRecord;\n\n this.setState(\n {\n icon,\n },\n async () => {\n if (propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue) {\n this.props.onCommit({ propertyRecord, newValue: propertyValue });\n }\n }\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = \"\";\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as string;\n }\n\n const readonly =\n record && undefined !== record.isReadonly ? record.isReadonly : false;\n const isDisabled = record ? record.isDisabled : undefined;\n\n if (this._isMounted)\n this.setState({ icon: initialValue, readonly, isDisabled }, () => {\n if (this.props.setFocus) {\n this.setFocus();\n }\n });\n }\n\n public override render() {\n const { icon, icons, numColumns } = this.state;\n return (\n <div\n className={classnames(\"components-icon-editor\", this.props.className)}\n style={this.props.style}\n ref={this._divElement}\n >\n <IconPickerButton\n ref={(control) => (this._control = control)}\n icon={icon}\n icons={icons}\n numColumns={numColumns}\n disabled={this.state.isDisabled}\n readonly={this.state.readonly}\n onIconChange={this._onIconChange}\n data-testid=\"components-icon-editor\"\n />\n </div>\n );\n }\n}\n\n/** Icon Property Editor registered for the \"text\" and \"string\" type names and the \"icon-picker\" editor name.\n * It uses the [[IconEditor]] React component.\n * @alpha\n */\nexport class IconPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <IconEditor />;\n }\n}\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Text,\n IconPropertyEditor,\n StandardEditorNames.IconPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.String,\n IconPropertyEditor,\n StandardEditorNames.IconPicker\n);\n"]}
|
|
@@ -22,16 +22,12 @@ interface ImageCheckBoxEditorState {
|
|
|
22
22
|
export declare class ImageCheckBoxEditor extends React.PureComponent<PropertyEditorProps, ImageCheckBoxEditorState> implements TypeEditor {
|
|
23
23
|
private _isMounted;
|
|
24
24
|
private _inputElement;
|
|
25
|
-
/** @internal */
|
|
26
25
|
readonly state: Readonly<ImageCheckBoxEditorState>;
|
|
27
26
|
getPropertyValue(): Promise<PropertyValue | undefined>;
|
|
28
27
|
get htmlElement(): HTMLElement | null;
|
|
29
28
|
get hasFocus(): boolean;
|
|
30
|
-
/** @internal */
|
|
31
29
|
componentDidMount(): void;
|
|
32
|
-
/** @internal */
|
|
33
30
|
componentWillUnmount(): void;
|
|
34
|
-
/** @internal */
|
|
35
31
|
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
36
32
|
private setStateFromProps;
|
|
37
33
|
private _handleClick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCheckBoxEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/ImageCheckBoxEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAKjC,gBAAgB;AAChB,UAAU,wBAAwB;IAChC,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD;;;GAGG;AACH,qBAAa,mBACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,wBAAwB,CACzE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAwD;IAE7E,
|
|
1
|
+
{"version":3,"file":"ImageCheckBoxEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/ImageCheckBoxEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAKjC,gBAAgB;AAChB,UAAU,wBAAwB;IAChC,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD;;;GAGG;AACH,qBAAa,mBACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,wBAAwB,CACzE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAwD;IAE7E,SAAyB,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAKhE;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAEe,iBAAiB;IAKjB,oBAAoB;IAIpB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;IAMjE,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,YAAY,CAiBlB;IAEc,MAAM;CAyBvB;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -20,7 +20,6 @@ export class ImageCheckBoxEditor extends React.PureComponent {
|
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this._isMounted = false;
|
|
22
22
|
this._inputElement = React.createRef();
|
|
23
|
-
/** @internal */
|
|
24
23
|
this.state = {
|
|
25
24
|
imageOff: "",
|
|
26
25
|
imageOn: "",
|
|
@@ -61,16 +60,13 @@ export class ImageCheckBoxEditor extends React.PureComponent {
|
|
|
61
60
|
get hasFocus() {
|
|
62
61
|
return document.activeElement === this._inputElement.current;
|
|
63
62
|
}
|
|
64
|
-
/** @internal */
|
|
65
63
|
componentDidMount() {
|
|
66
64
|
this._isMounted = true;
|
|
67
65
|
this.setStateFromProps();
|
|
68
66
|
}
|
|
69
|
-
/** @internal */
|
|
70
67
|
componentWillUnmount() {
|
|
71
68
|
this._isMounted = false;
|
|
72
69
|
}
|
|
73
|
-
/** @internal */
|
|
74
70
|
componentDidUpdate(prevProps) {
|
|
75
71
|
if (this.props.propertyRecord !== prevProps.propertyRecord) {
|
|
76
72
|
this.setStateFromProps();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCheckBoxEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/ImageCheckBoxEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAalD;;;GAGG;AACH,MAAM,OAAO,mBACX,SAAQ,KAAK,CAAC,aAA4D;IAD5E;;QAIU,eAAU,GAAG,KAAK,CAAC;QACnB,kBAAa,GAAsC,KAAK,CAAC,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageCheckBoxEditor.js","s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,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,IAAI,CAAC,YAAY,iBACd,iCAAiC,GAC7C,CACH,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS;QAClB,OAAO,oBAAC,mBAAmB,OAAG,CAAC;IACjC,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,OAAO,EACzB,2BAA2B,EAC3B,mBAAmB,CAAC,aAAa,CAClC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,IAAI,EACtB,2BAA2B,EAC3B,mBAAmB,CAAC,aAAa,CAClC,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 PropertyEditors\n */\n\nimport \"./ImageCheckBoxEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n ImageCheckBoxParams,\n PropertyEditorParams,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n StandardEditorNames,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\nimport {\n PropertyEditorBase,\n PropertyEditorManager,\n} from \"./PropertyEditorManager\";\nimport { ImageCheckBox } from \"@itwin/core-react\";\n\n// cSpell:ignore imagecheckbox\n\n/** @internal */\ninterface ImageCheckBoxEditorState {\n /** Image for the \"checked\" state */\n imageOn: string;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string;\n checkboxValue: boolean;\n isDisabled?: boolean;\n}\n/** [[ImageCheckBoxEditor]]\n * Boolean editor that renders with an image instead of checkbox\n * @public\n */\nexport class ImageCheckBoxEditor\n extends React.PureComponent<PropertyEditorProps, ImageCheckBoxEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement: React.RefObject<HTMLInputElement> = React.createRef();\n\n public override readonly state: Readonly<ImageCheckBoxEditorState> = {\n imageOff: \"\",\n imageOn: \"\",\n checkboxValue: false,\n isDisabled: false,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.checkboxValue,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n public get hasFocus(): boolean {\n return document.activeElement === this._inputElement.current;\n }\n\n public override componentDidMount() {\n this._isMounted = true;\n this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n this.setStateFromProps();\n }\n }\n\n private setStateFromProps() {\n const { propertyRecord } = this.props;\n let checkboxValue = false;\n let imageOn = \"\";\n let imageOff = \"\";\n let isDisabled = false;\n\n if (\n propertyRecord &&\n propertyRecord.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n const primitiveValue = propertyRecord.value.value;\n checkboxValue = primitiveValue as boolean;\n }\n\n if (propertyRecord && propertyRecord.isDisabled)\n isDisabled = propertyRecord.isDisabled;\n\n if (\n propertyRecord &&\n propertyRecord.property &&\n propertyRecord.property.editor &&\n propertyRecord.property.editor.params\n ) {\n const imageCheckBoxParams = propertyRecord.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.CheckBoxImages.valueOf()\n ) as ImageCheckBoxParams;\n if (imageCheckBoxParams) {\n imageOn = imageCheckBoxParams.imageOn;\n imageOff = imageCheckBoxParams.imageOff;\n }\n }\n this.setState({ imageOn, imageOff, checkboxValue, isDisabled });\n }\n\n private _handleClick = (checked: boolean) => {\n this.setState(\n {\n checkboxValue: checked,\n },\n async () => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (this._isMounted && propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n }\n );\n };\n\n public override render() {\n const className = classnames(\n \"components-cell-editor\",\n \"components-imagecheckbox-editor\",\n this.props.className\n );\n const checked = this.state.checkboxValue;\n const isDisabled = !!this.state.isDisabled;\n\n return (\n // eslint-disable-next-line deprecation/deprecation\n <ImageCheckBox\n inputRef={this._inputElement}\n imageOff={this.state.imageOff}\n imageOn={this.state.imageOn}\n className={className}\n border={true}\n style={this.props.style}\n checked={checked}\n disabled={isDisabled}\n onClick={this._handleClick}\n data-testid=\"components-imagecheckbox-editor\"\n />\n );\n }\n}\n\n/** ImageCheckBox Property Editor registered for the \"bool\" and \"boolean\" type names.\n * It uses the [[ImageCheckBoxEditor]] React component.\n * @public\n */\nexport class ImageCheckBoxPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <ImageCheckBoxEditor />;\n }\n}\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Boolean,\n ImageCheckBoxPropertyEditor,\n StandardEditorNames.ImageCheckBox\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Bool,\n ImageCheckBoxPropertyEditor,\n StandardEditorNames.ImageCheckBox\n);\n"]}
|
|
@@ -25,20 +25,15 @@ export declare class NumericInputEditor extends React.PureComponent<PropertyEdit
|
|
|
25
25
|
private _isMounted;
|
|
26
26
|
private _inputElement;
|
|
27
27
|
hasFocus: boolean;
|
|
28
|
-
/** @internal */
|
|
29
28
|
readonly state: Readonly<NumericInputEditorState>;
|
|
30
29
|
getPropertyValue(): Promise<PropertyValue | undefined>;
|
|
31
30
|
get htmlElement(): HTMLElement | null;
|
|
32
31
|
private _handleCommit;
|
|
33
32
|
private _updateValue;
|
|
34
|
-
/** @internal */
|
|
35
33
|
componentDidMount(): void;
|
|
36
|
-
/** @internal */
|
|
37
34
|
componentWillUnmount(): void;
|
|
38
|
-
/** @internal */
|
|
39
35
|
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
40
36
|
private setStateFromProps;
|
|
41
|
-
/** @internal */
|
|
42
37
|
render(): React.ReactNode;
|
|
43
38
|
}
|
|
44
39
|
/** Numeric Input Property Editor registered for the "number" type name and "numeric-input" editor name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInputEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAEjC,gBAAgB;AAChB,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,kBACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,uBAAuB,CACxE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAwD;IACtE,QAAQ,UAAS;IAExB,
|
|
1
|
+
{"version":3,"file":"NumericInputEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAEjC,gBAAgB;AAChB,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,kBACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,uBAAuB,CACxE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAwD;IACtE,QAAQ,UAAS;IAExB,SAAyB,KAAK,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAG/D;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,OAAO,CAAC,aAAa,CAUnB;IAEF,OAAO,CAAC,YAAY,CAelB;IAEc,iBAAiB;IAKjB,oBAAoB;IAIpB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IA4Df,MAAM,IAAI,KAAK,CAAC,SAAS;CAgC1C;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,kBAAkB;IAChE,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;IACD,IAAoB,qBAAqB,IAAI,OAAO,CAGnD;CACF"}
|
|
@@ -20,7 +20,6 @@ export class NumericInputEditor extends React.PureComponent {
|
|
|
20
20
|
this._isMounted = false;
|
|
21
21
|
this._inputElement = React.createRef();
|
|
22
22
|
this.hasFocus = false; // hot used since containerHandlesEnter is false
|
|
23
|
-
/** @internal */
|
|
24
23
|
this.state = {
|
|
25
24
|
value: 0,
|
|
26
25
|
readonly: false,
|
|
@@ -61,16 +60,13 @@ export class NumericInputEditor extends React.PureComponent {
|
|
|
61
60
|
get htmlElement() {
|
|
62
61
|
return this._inputElement.current;
|
|
63
62
|
}
|
|
64
|
-
/** @internal */
|
|
65
63
|
componentDidMount() {
|
|
66
64
|
this._isMounted = true;
|
|
67
65
|
void this.setStateFromProps();
|
|
68
66
|
}
|
|
69
|
-
/** @internal */
|
|
70
67
|
componentWillUnmount() {
|
|
71
68
|
this._isMounted = false;
|
|
72
69
|
}
|
|
73
|
-
/** @internal */
|
|
74
70
|
componentDidUpdate(prevProps) {
|
|
75
71
|
if (this.props.propertyRecord !== prevProps.propertyRecord) {
|
|
76
72
|
void this.setStateFromProps();
|
|
@@ -122,7 +118,6 @@ export class NumericInputEditor extends React.PureComponent {
|
|
|
122
118
|
precision,
|
|
123
119
|
});
|
|
124
120
|
}
|
|
125
|
-
/** @internal */
|
|
126
121
|
render() {
|
|
127
122
|
const className = classnames("components-cell-editor", "components-numeric-input-editor", this.props.className);
|
|
128
123
|
const minSize = this.state.size ? this.state.size : 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInputEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAgBjC;;GAEG;AACH,MAAM,OAAO,kBACX,SAAQ,KAAK,CAAC,aAA2D;IAD3E;;QAIU,eAAU,GAAG,KAAK,CAAC;QACnB,kBAAa,GAAsC,KAAK,CAAC,SAAS,EAAE,CAAC;QACtE,aAAQ,GAAG,KAAK,CAAC,CAAC,gDAAgD;QAEzE,gBAAgB;QACS,UAAK,GAAsC;YAClE,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,KAAK;SAChB,CAAC;QAqBM,kBAAa,GAAG,KAAK,IAAmB,EAAE;YAChD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACrD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACpD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAChC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;wBAClB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc;wBACzC,QAAQ,EAAE,aAAa;qBACxB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEM,iBAAY,GAAG,CACrB,KAAyB,EACzB,YAAoB,EACd,EA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AG,EACnB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EACxD,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,GAC7C,CACH,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAChE,IAAW,SAAS;QAClB,OAAO,oBAAC,kBAAkB,OAAG,CAAC;IAChC,CAAC;IACD,IAAoB,qBAAqB;QACvC,qCAAqC;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,GAAG,EACrB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,KAAK,EACvB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,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 PropertyEditors\n */\n\nimport \"./NumericInputEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n InputEditorSizeParams,\n PropertyEditorParams,\n PropertyValue,\n RangeEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n StandardEditorNames,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport { NumberInput } from \"@itwin/core-react\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\nimport {\n PropertyEditorBase,\n PropertyEditorManager,\n} from \"./PropertyEditorManager\";\n\n/** @internal */\ninterface NumericInputEditorState {\n value: number;\n readonly: boolean;\n isDisabled?: boolean;\n size?: number;\n maxLength?: number;\n\n min?: number;\n max?: number;\n step?: number;\n precision?: number;\n}\n\n/** NumericInputEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n */\nexport class NumericInputEditor\n extends React.PureComponent<PropertyEditorProps, NumericInputEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement: React.RefObject<HTMLInputElement> = React.createRef();\n public hasFocus = false; // hot used since containerHandlesEnter is false\n\n /** @internal */\n public override readonly state: Readonly<NumericInputEditorState> = {\n value: 0,\n readonly: false,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private _updateValue = (\n value: number | undefined,\n _stringValue: string\n ): void => {\n const newValue = value !== undefined ? value : 0;\n\n if (this._isMounted)\n this.setState(\n {\n value: newValue,\n },\n async () => {\n await this._handleCommit();\n }\n );\n };\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n const readonly =\n record && undefined !== record.isReadonly ? record.isReadonly : false;\n let size: number | undefined;\n let maxLength: number | undefined;\n let min: number | undefined;\n let max: number | undefined;\n let step: number | undefined;\n let precision: number | undefined;\n\n const isDisabled = record ? record.isDisabled : undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const rangeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Range.valueOf()\n ) as RangeEditorParams;\n if (rangeParams) {\n min = rangeParams.minimum;\n max = rangeParams.maximum;\n step = rangeParams.step;\n precision = rangeParams.precision;\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n readonly,\n size,\n maxLength,\n isDisabled,\n min,\n max,\n step,\n precision,\n });\n }\n\n /** @internal */\n public override render(): React.ReactNode {\n const className = classnames(\n \"components-cell-editor\",\n \"components-numeric-input-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize * 0.75}em`,\n };\n\n return (\n // eslint-disable-next-line deprecation/deprecation\n <NumberInput\n ref={this._inputElement}\n className={className}\n style={style}\n value={this.state.value}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n precision={this.state.precision}\n readOnly={this.state.readonly}\n maxLength={this.state.maxLength}\n onBlur={this.props.onBlur}\n onChange={this._updateValue}\n autoFocus={this.props.setFocus && !this.state.isDisabled} // eslint-disable-line jsx-a11y/no-autofocus\n isControlled={this.props.shouldCommitOnChange}\n />\n );\n }\n}\n\n/** Numeric Input Property Editor registered for the \"number\" type name and \"numeric-input\" editor name.\n * It uses the [[NumericInputEditor]] React component.\n * @public\n */\nexport class NumericInputPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <NumericInputEditor />;\n }\n public override get containerHandlesEnter(): boolean {\n // let input editor process enter key\n return false;\n }\n}\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Int,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Float,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Double,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\n"]}
|
|
1
|
+
{"version":3,"file":"NumericInputEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AA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K,CAAC,oBAAoB,GAC7C,CACH,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAChE,IAAW,SAAS;QAClB,OAAO,oBAAC,kBAAkB,OAAG,CAAC;IAChC,CAAC;IACD,IAAoB,qBAAqB;QACvC,qCAAqC;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,GAAG,EACrB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,KAAK,EACvB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CACjC,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 PropertyEditors\n */\n\nimport \"./NumericInputEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n InputEditorSizeParams,\n PropertyEditorParams,\n PropertyValue,\n RangeEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n StandardEditorNames,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport { NumberInput } from \"@itwin/core-react\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\nimport {\n PropertyEditorBase,\n PropertyEditorManager,\n} from \"./PropertyEditorManager\";\n\n/** @internal */\ninterface NumericInputEditorState {\n value: number;\n readonly: boolean;\n isDisabled?: boolean;\n size?: number;\n maxLength?: number;\n\n min?: number;\n max?: number;\n step?: number;\n precision?: number;\n}\n\n/** NumericInputEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n */\nexport class NumericInputEditor\n extends React.PureComponent<PropertyEditorProps, NumericInputEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement: React.RefObject<HTMLInputElement> = React.createRef();\n public hasFocus = false; // hot used since containerHandlesEnter is false\n\n public override readonly state: Readonly<NumericInputEditorState> = {\n value: 0,\n readonly: false,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private _updateValue = (\n value: number | undefined,\n _stringValue: string\n ): void => {\n const newValue = value !== undefined ? value : 0;\n\n if (this._isMounted)\n this.setState(\n {\n value: newValue,\n },\n async () => {\n await this._handleCommit();\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n const readonly =\n record && undefined !== record.isReadonly ? record.isReadonly : false;\n let size: number | undefined;\n let maxLength: number | undefined;\n let min: number | undefined;\n let max: number | undefined;\n let step: number | undefined;\n let precision: number | undefined;\n\n const isDisabled = record ? record.isDisabled : undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const rangeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Range.valueOf()\n ) as RangeEditorParams;\n if (rangeParams) {\n min = rangeParams.minimum;\n max = rangeParams.maximum;\n step = rangeParams.step;\n precision = rangeParams.precision;\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n readonly,\n size,\n maxLength,\n isDisabled,\n min,\n max,\n step,\n precision,\n });\n }\n\n public override render(): React.ReactNode {\n const className = classnames(\n \"components-cell-editor\",\n \"components-numeric-input-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize * 0.75}em`,\n };\n\n return (\n // eslint-disable-next-line deprecation/deprecation\n <NumberInput\n ref={this._inputElement}\n className={className}\n style={style}\n value={this.state.value}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n precision={this.state.precision}\n readOnly={this.state.readonly}\n maxLength={this.state.maxLength}\n onBlur={this.props.onBlur}\n onChange={this._updateValue}\n autoFocus={this.props.setFocus && !this.state.isDisabled} // eslint-disable-line jsx-a11y/no-autofocus\n isControlled={this.props.shouldCommitOnChange}\n />\n );\n }\n}\n\n/** Numeric Input Property Editor registered for the \"number\" type name and \"numeric-input\" editor name.\n * It uses the [[NumericInputEditor]] React component.\n * @public\n */\nexport class NumericInputPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <NumericInputEditor />;\n }\n public override get containerHandlesEnter(): boolean {\n // let input editor process enter key\n return false;\n }\n}\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Int,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Float,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Double,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput\n);\n"]}
|
|
@@ -43,15 +43,12 @@ interface PopupButtonState {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare class PopupButton extends React.PureComponent<PopupButtonProps, PopupButtonState> {
|
|
45
45
|
private _buttonRef;
|
|
46
|
-
/** @internal */
|
|
47
46
|
readonly state: Readonly<PopupButtonState>;
|
|
48
|
-
/** @internal */
|
|
49
47
|
componentDidMount(): void;
|
|
50
48
|
private _togglePopup;
|
|
51
49
|
closePopup(): void;
|
|
52
50
|
private _closePopup;
|
|
53
51
|
private _handleKeyDown;
|
|
54
|
-
/** @internal */
|
|
55
52
|
render(): React.ReactNode;
|
|
56
53
|
}
|
|
57
54
|
/** Popup content with padding
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupButton.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/PopupButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrE;;GAEG;AAEH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,KAA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YAAY,CAAC,KAAK,EAAE,cAAc,qBAGjD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,qBA+BxD"}
|
|
@@ -13,7 +13,7 @@ import { RelativePosition } from "@itwin/appui-abstract";
|
|
|
13
13
|
import { Div, Icon, Popup } from "@itwin/core-react";
|
|
14
14
|
import { Button } from "@itwin/itwinui-react";
|
|
15
15
|
import { SvgCheckmark, SvgChevronDown, SvgRemove, } from "@itwin/itwinui-icons-react";
|
|
16
|
-
import { useTranslation } from "../useTranslation";
|
|
16
|
+
import { useTranslation } from "../l10n/useTranslation";
|
|
17
17
|
/** PopupButton React component that is a button and property editor popup host
|
|
18
18
|
* @alpha
|
|
19
19
|
*/
|
|
@@ -21,7 +21,6 @@ export class PopupButton extends React.PureComponent {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this._buttonRef = React.createRef();
|
|
24
|
-
/** @internal */
|
|
25
24
|
this.state = {
|
|
26
25
|
showPopup: false,
|
|
27
26
|
};
|
|
@@ -46,7 +45,6 @@ export class PopupButton extends React.PureComponent {
|
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
|
-
/** @internal */
|
|
50
48
|
componentDidMount() {
|
|
51
49
|
if (this.props.setFocus && this._buttonRef.current)
|
|
52
50
|
this._buttonRef.current.focus();
|
|
@@ -54,7 +52,6 @@ export class PopupButton extends React.PureComponent {
|
|
|
54
52
|
closePopup() {
|
|
55
53
|
this._closePopup();
|
|
56
54
|
}
|
|
57
|
-
/** @internal */
|
|
58
55
|
render() {
|
|
59
56
|
const showArrow = this.props.showArrow ?? false;
|
|
60
57
|
const showShadow = this.props.showShadow ?? false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupButton.js","sourceRoot":"","sources":["../../../../src/components-react/editors/PopupButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,GACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA2CnD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,aAGtC;IAHD;;QAIU,eAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAEvD,gBAAgB;QACS,UAAK,GAA+B;YAC3D,SAAS,EAAE,KAAK;SACjB,CAAC;QAQM,iBAAY,GAAG,CAAC,KAAuB,EAAE,EAAE;YACjD,IAAI,CAAC,QAAQ,CACX,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EACpD,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CACtD,CAAC;QACJ,CAAC,CAAC;QAMM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE;gBAC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AU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,YAAY,EACV,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAClD,sCAAsC,CACvC,IAAI,SAAS,IAGf,IAAI,CAAC,KAAK,CAAC,QAAQ,CACd,CACJ,CACP,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,mDAAmD;AACnD,MAAM,UAAU,YAAY,CAAC,KAAqB;IAChD,mDAAmD;IACnD,OAAO,oBAAC,GAAG,OAAK,KAAK,EAAE,aAAa,EAAC,iCAAiC,GAAG,CAAC;AAC5E,CAAC;AAUD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAoB;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,MAAM,IACL,SAAS,EAAE,UAAU,CACnB,+BAA+B,EAC/B,4BAA4B,CAC7B,iBACW,4BAA4B,EACxC,SAAS,EAAC,KAAK,EACf,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,OAAO,EAAE,KAAK,CAAC,IAAI;YAEnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,YAAY,OAAG,GAAI,CAC7B;QACT,oBAAC,MAAM,IACL,SAAS,EAAE,UAAU,CACnB,+BAA+B,EAC/B,gCAAgC,CACjC,iBACW,gCAAgC,EAC5C,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,EACjC,OAAO,EAAE,KAAK,CAAC,QAAQ;YAEvB,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,SAAS,OAAG,GAAI,CAC1B,CACL,CACP,CAAC;AACJ,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 PropertyEditors\n */\n\nimport \"./PopupButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type { CommonDivProps, CommonProps } from \"@itwin/core-react\";\nimport { Div, Icon, Popup } from \"@itwin/core-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport {\n SvgCheckmark,\n SvgChevronDown,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../useTranslation\";\n\n/** Properties for [[PopupButton]] component\n * @alpha\n */\n// eslint-disable-next-line deprecation/deprecation\nexport interface PopupButtonProps extends CommonProps {\n /** Label to display in click area. */\n label?: string | React.ReactNode;\n /* Placeholder text used when there is no label yet */\n placeholder?: string;\n /** Contents of the popup */\n children: React.ReactNode;\n /** Title to display as tooltip. */\n title?: string;\n\n /** Set focus to popup - default is to set focus */\n moveFocus?: boolean;\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\n focusTarget?: React.RefObject<HTMLElement> | string;\n\n /** Show or hide the box shadow (defaults to false) */\n showShadow?: boolean;\n /** Show or hide the arrow (defaults to false) */\n showArrow?: boolean;\n /** Indicates whether to set focus to the input element */\n setFocus?: boolean;\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\n closeOnEnter?: boolean;\n\n /** Listens for click events on button area */\n onClick?: (event: React.MouseEvent) => void;\n /** Listens for popup close events */\n onClose?: () => void;\n /** Listens for Enter key in popup */\n onEnter?: () => void;\n}\n\n/** @internal */\ninterface PopupButtonState {\n showPopup: boolean;\n}\n\n/** PopupButton React component that is a button and property editor popup host\n * @alpha\n */\nexport class PopupButton extends React.PureComponent<\n PopupButtonProps,\n PopupButtonState\n> {\n private _buttonRef = React.createRef<HTMLDivElement>();\n\n /** @internal */\n public override readonly state: Readonly<PopupButtonState> = {\n showPopup: false,\n };\n\n /** @internal */\n public override componentDidMount() {\n if (this.props.setFocus && this._buttonRef.current)\n this._buttonRef.current.focus();\n }\n\n private _togglePopup = (event: React.MouseEvent) => {\n this.setState(\n (prevState) => ({ showPopup: !prevState.showPopup }),\n () => this.props.onClick && this.props.onClick(event)\n );\n };\n\n public closePopup() {\n this._closePopup();\n }\n\n private _closePopup = () => {\n this.setState({ showPopup: false }, () => {\n this.props.onClose && this.props.onClose();\n\n if (this._buttonRef.current) this._buttonRef.current.focus();\n });\n };\n\n private _handleKeyDown = (event: React.KeyboardEvent) => {\n if (\n (event.key === Key.ArrowDown.valueOf() ||\n event.key === \" \" ||\n event.key === Key.Enter.valueOf()) &&\n !this.state.showPopup\n ) {\n event.preventDefault();\n event.stopPropagation();\n this.setState({ showPopup: true });\n }\n };\n\n /** @internal */\n public override render(): React.ReactNode {\n const showArrow = this.props.showArrow ?? false;\n const showShadow = this.props.showShadow ?? false;\n const moveFocus = this.props.moveFocus ?? true;\n const showPlaceholder =\n this.props.label === undefined && this.props.placeholder !== undefined;\n\n const classNames = classnames(\n \"components-popup-button\",\n this.state.showPopup && \"components-popup-expanded\"\n );\n\n const valueClassNames = classnames(\n \"components-popup-button-value\",\n showPlaceholder && \"components-popup-button-placeholder\"\n );\n\n return (\n <div className={this.props.className}>\n <div\n className={classNames}\n onClick={this._togglePopup}\n onKeyDown={this._handleKeyDown}\n data-testid=\"components-popup-button\"\n tabIndex={0}\n ref={this._buttonRef}\n title={this.props.title}\n role=\"button\"\n >\n <div className={valueClassNames}>\n {this.props.label || this.props.placeholder}\n </div>\n <div className={\"components-popup-button-arrow\"}>\n <div\n className={classnames(\n \"components-popup-button-arrow-icon\",\n \"icon\"\n )}\n >\n <Icon iconSpec={<SvgChevronDown />} />\n </div>\n </div>\n </div>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Popup\n className=\"components-popup-button-popup\"\n isOpen={this.state.showPopup}\n position={RelativePosition.Bottom}\n onClose={this._closePopup}\n onEnter={this.props.onEnter}\n closeOnEnter={this.props.closeOnEnter}\n target={this._buttonRef.current}\n showArrow={showArrow}\n showShadow={showShadow}\n moveFocus={moveFocus}\n focusTarget={this.props.focusTarget}\n portalTarget={\n this._buttonRef.current?.ownerDocument.querySelector(\n \".uifw-configurableui-portalContainer\"\n ) ?? undefined\n }\n >\n {this.props.children}\n </Popup>\n </div>\n );\n }\n}\n\n/** Popup content with padding\n * @alpha\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function PopupContent(props: CommonDivProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <Div {...props} mainClassName=\"components-editor-popup-content\" />;\n}\n\n/** Properties for [[PopupOkCancelButtons]] component\n * @alpha\n */\nexport interface OkCancelProps {\n onOk: (event: React.MouseEvent) => void;\n onCancel: (event: React.MouseEvent) => void;\n}\n\n/** OK/Cancel Buttons\n * @alpha\n */\nexport function PopupOkCancelButtons(props: OkCancelProps) {\n const { translate } = useTranslation();\n return (\n <div className=\"components-popup-bottom-buttons\">\n <Button\n className={classnames(\n \"components-popup-large-button\",\n \"components-popup-ok-button\"\n )}\n data-testid=\"components-popup-ok-button\"\n styleType=\"cta\"\n title={translate(\"dialog.ok\")}\n onClick={props.onOk}\n >\n <Icon iconSpec={<SvgCheckmark />} />\n </Button>\n <Button\n className={classnames(\n \"components-popup-large-button\",\n \"components-popup-cancel-button\"\n )}\n data-testid=\"components-popup-cancel-button\"\n title={translate(\"dialog.cancel\")}\n onClick={props.onCancel}\n >\n <Icon iconSpec={<SvgRemove />} />\n </Button>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PopupButton.js","sourceRoot":"","sources":["../../../../src/components-react/editors/PopupButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;A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AAC,GAAG,OAAK,KAAK,EAAE,aAAa,EAAC,iCAAiC,GAAG,CAAC;AAC5E,CAAC;AAUD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAoB;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,MAAM,IACL,SAAS,EAAE,UAAU,CACnB,+BAA+B,EAC/B,4BAA4B,CAC7B,iBACW,4BAA4B,EACxC,SAAS,EAAC,KAAK,EACf,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,OAAO,EAAE,KAAK,CAAC,IAAI;YAGnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,YAAY,OAAG,GAAI,CAC7B;QACT,oBAAC,MAAM,IACL,SAAS,EAAE,UAAU,CACnB,+BAA+B,EAC/B,gCAAgC,CACjC,iBACW,gCAAgC,EAC5C,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,EACjC,OAAO,EAAE,KAAK,CAAC,QAAQ;YAGvB,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,SAAS,OAAG,GAAI,CAC1B,CACL,CACP,CAAC;AACJ,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 PropertyEditors\n */\n\nimport \"./PopupButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type { CommonDivProps, CommonProps } from \"@itwin/core-react\";\nimport { Div, Icon, Popup } from \"@itwin/core-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport {\n SvgCheckmark,\n SvgChevronDown,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../l10n/useTranslation\";\n\n/** Properties for [[PopupButton]] component\n * @alpha\n */\n// eslint-disable-next-line deprecation/deprecation\nexport interface PopupButtonProps extends CommonProps {\n /** Label to display in click area. */\n label?: string | React.ReactNode;\n /* Placeholder text used when there is no label yet */\n placeholder?: string;\n /** Contents of the popup */\n children: React.ReactNode;\n /** Title to display as tooltip. */\n title?: string;\n\n /** Set focus to popup - default is to set focus */\n moveFocus?: boolean;\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\n focusTarget?: React.RefObject<HTMLElement> | string;\n\n /** Show or hide the box shadow (defaults to false) */\n showShadow?: boolean;\n /** Show or hide the arrow (defaults to false) */\n showArrow?: boolean;\n /** Indicates whether to set focus to the input element */\n setFocus?: boolean;\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\n closeOnEnter?: boolean;\n\n /** Listens for click events on button area */\n onClick?: (event: React.MouseEvent) => void;\n /** Listens for popup close events */\n onClose?: () => void;\n /** Listens for Enter key in popup */\n onEnter?: () => void;\n}\n\n/** @internal */\ninterface PopupButtonState {\n showPopup: boolean;\n}\n\n/** PopupButton React component that is a button and property editor popup host\n * @alpha\n */\nexport class PopupButton extends React.PureComponent<\n PopupButtonProps,\n PopupButtonState\n> {\n private _buttonRef = React.createRef<HTMLDivElement>();\n\n public override readonly state: Readonly<PopupButtonState> = {\n showPopup: false,\n };\n\n public override componentDidMount() {\n if (this.props.setFocus && this._buttonRef.current)\n this._buttonRef.current.focus();\n }\n\n private _togglePopup = (event: React.MouseEvent) => {\n this.setState(\n (prevState) => ({ showPopup: !prevState.showPopup }),\n () => this.props.onClick && this.props.onClick(event)\n );\n };\n\n public closePopup() {\n this._closePopup();\n }\n\n private _closePopup = () => {\n this.setState({ showPopup: false }, () => {\n this.props.onClose && this.props.onClose();\n\n if (this._buttonRef.current) this._buttonRef.current.focus();\n });\n };\n\n private _handleKeyDown = (event: React.KeyboardEvent) => {\n if (\n (event.key === Key.ArrowDown.valueOf() ||\n event.key === \" \" ||\n event.key === Key.Enter.valueOf()) &&\n !this.state.showPopup\n ) {\n event.preventDefault();\n event.stopPropagation();\n this.setState({ showPopup: true });\n }\n };\n\n public override render(): React.ReactNode {\n const showArrow = this.props.showArrow ?? false;\n const showShadow = this.props.showShadow ?? false;\n const moveFocus = this.props.moveFocus ?? true;\n const showPlaceholder =\n this.props.label === undefined && this.props.placeholder !== undefined;\n\n const classNames = classnames(\n \"components-popup-button\",\n this.state.showPopup && \"components-popup-expanded\"\n );\n\n const valueClassNames = classnames(\n \"components-popup-button-value\",\n showPlaceholder && \"components-popup-button-placeholder\"\n );\n\n return (\n <div className={this.props.className}>\n <div\n className={classNames}\n onClick={this._togglePopup}\n onKeyDown={this._handleKeyDown}\n data-testid=\"components-popup-button\"\n tabIndex={0}\n ref={this._buttonRef}\n title={this.props.title}\n role=\"button\"\n >\n <div className={valueClassNames}>\n {this.props.label || this.props.placeholder}\n </div>\n <div className={\"components-popup-button-arrow\"}>\n <div\n className={classnames(\n \"components-popup-button-arrow-icon\",\n \"icon\"\n )}\n >\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Icon iconSpec={<SvgChevronDown />} />\n </div>\n </div>\n </div>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Popup\n className=\"components-popup-button-popup\"\n isOpen={this.state.showPopup}\n position={RelativePosition.Bottom}\n onClose={this._closePopup}\n onEnter={this.props.onEnter}\n closeOnEnter={this.props.closeOnEnter}\n target={this._buttonRef.current}\n showArrow={showArrow}\n showShadow={showShadow}\n moveFocus={moveFocus}\n focusTarget={this.props.focusTarget}\n portalTarget={\n this._buttonRef.current?.ownerDocument.querySelector(\n \".uifw-configurableui-portalContainer\"\n ) ?? undefined\n }\n >\n {this.props.children}\n </Popup>\n </div>\n );\n }\n}\n\n/** Popup content with padding\n * @alpha\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function PopupContent(props: CommonDivProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <Div {...props} mainClassName=\"components-editor-popup-content\" />;\n}\n\n/** Properties for [[PopupOkCancelButtons]] component\n * @alpha\n */\nexport interface OkCancelProps {\n onOk: (event: React.MouseEvent) => void;\n onCancel: (event: React.MouseEvent) => void;\n}\n\n/** OK/Cancel Buttons\n * @alpha\n */\nexport function PopupOkCancelButtons(props: OkCancelProps) {\n const { translate } = useTranslation();\n return (\n <div className=\"components-popup-bottom-buttons\">\n <Button\n className={classnames(\n \"components-popup-large-button\",\n \"components-popup-ok-button\"\n )}\n data-testid=\"components-popup-ok-button\"\n styleType=\"cta\"\n title={translate(\"dialog.ok\")}\n onClick={props.onOk}\n >\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Icon iconSpec={<SvgCheckmark />} />\n </Button>\n <Button\n className={classnames(\n \"components-popup-large-button\",\n \"components-popup-cancel-button\"\n )}\n data-testid=\"components-popup-cancel-button\"\n title={translate(\"dialog.cancel\")}\n onClick={props.onCancel}\n >\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Icon iconSpec={<SvgRemove />} />\n </Button>\n </div>\n );\n}\n"]}
|
|
@@ -45,14 +45,13 @@
|
|
|
45
45
|
|
|
46
46
|
> .components-popup-button-arrow-icon {
|
|
47
47
|
transition: transform 0.2s;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-size: var(--iui-font-size-0);
|
|
50
|
+
line-height: var(--iui-size-l);
|
|
48
51
|
|
|
49
52
|
&:hover {
|
|
50
53
|
color: var(--iui-color-text-accent);
|
|
51
54
|
}
|
|
52
|
-
|
|
53
|
-
text-align: center;
|
|
54
|
-
font-size: var(--iui-font-size-0);
|
|
55
|
-
line-height: var(--iui-size-l);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -30,17 +30,13 @@ export declare class SliderEditor extends React.PureComponent<PropertyEditorProp
|
|
|
30
30
|
private _isMounted;
|
|
31
31
|
private _enterKey;
|
|
32
32
|
private _divElement;
|
|
33
|
-
/** @internal */
|
|
34
33
|
readonly state: Readonly<SliderEditorState>;
|
|
35
34
|
getPropertyValue(): Promise<PropertyValue | undefined>;
|
|
36
35
|
get htmlElement(): HTMLElement | null;
|
|
37
36
|
get hasFocus(): boolean;
|
|
38
37
|
private _handleChange;
|
|
39
|
-
/** @internal */
|
|
40
38
|
componentDidMount(): void;
|
|
41
|
-
/** @internal */
|
|
42
39
|
componentWillUnmount(): void;
|
|
43
|
-
/** @internal */
|
|
44
40
|
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
45
41
|
private internalFormatTooltip;
|
|
46
42
|
private setStateFromProps;
|
|
@@ -50,7 +46,6 @@ export declare class SliderEditor extends React.PureComponent<PropertyEditorProp
|
|
|
50
46
|
private _handleCancel;
|
|
51
47
|
private _handleCommit;
|
|
52
48
|
private tooltipProps;
|
|
53
|
-
/** @internal */
|
|
54
49
|
render(): React.ReactNode;
|
|
55
50
|
}
|
|
56
51
|
/** Slider Property Editor registered for the "number" type name and "slider" editor name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/SliderEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAKjC,gBAAgB;AAChB,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,C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AI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -22,7 +22,6 @@ export class SliderEditor extends React.PureComponent {
|
|
|
22
22
|
this._isMounted = false;
|
|
23
23
|
this._enterKey = false;
|
|
24
24
|
this._divElement = React.createRef();
|
|
25
|
-
/** @internal */
|
|
26
25
|
this.state = {
|
|
27
26
|
value: 0,
|
|
28
27
|
min: 0,
|
|
@@ -107,16 +106,13 @@ export class SliderEditor extends React.PureComponent {
|
|
|
107
106
|
containsFocus = this.htmlElement.contains(document.activeElement);
|
|
108
107
|
return containsFocus;
|
|
109
108
|
}
|
|
110
|
-
/** @internal */
|
|
111
109
|
componentDidMount() {
|
|
112
110
|
this._isMounted = true;
|
|
113
111
|
void this.setStateFromProps();
|
|
114
112
|
}
|
|
115
|
-
/** @internal */
|
|
116
113
|
componentWillUnmount() {
|
|
117
114
|
this._isMounted = false;
|
|
118
115
|
}
|
|
119
|
-
/** @internal */
|
|
120
116
|
componentDidUpdate(prevProps) {
|
|
121
117
|
if (this.props.propertyRecord !== prevProps.propertyRecord) {
|
|
122
118
|
void this.setStateFromProps();
|
|
@@ -157,8 +153,12 @@ export class SliderEditor extends React.PureComponent {
|
|
|
157
153
|
showTooltip = sliderParams.showTooltip;
|
|
158
154
|
tooltipBelow = sliderParams.tooltipBelow;
|
|
159
155
|
formatTooltip = sliderParams.formatTooltip;
|
|
160
|
-
minLabel = !sliderParams.showMinMax ? ("") : sliderParams.minIconSpec ? (
|
|
161
|
-
|
|
156
|
+
minLabel = !sliderParams.showMinMax ? ("") : sliderParams.minIconSpec ? (
|
|
157
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
158
|
+
React.createElement(Icon, { iconSpec: sliderParams.minIconSpec })) : undefined;
|
|
159
|
+
maxLabel = !sliderParams.showMinMax ? ("") : sliderParams.maxIconSpec ? (
|
|
160
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
161
|
+
React.createElement(Icon, { iconSpec: sliderParams.maxIconSpec })) : undefined;
|
|
162
162
|
if (sliderParams.showTicks) {
|
|
163
163
|
const count = sliderParams.getTickCount
|
|
164
164
|
? sliderParams.getTickCount()
|
|
@@ -207,7 +207,6 @@ export class SliderEditor extends React.PureComponent {
|
|
|
207
207
|
thumbMode,
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
/** @internal */
|
|
211
210
|
render() {
|
|
212
211
|
const className = classnames("components-cell-editor", "components-slider-editor", this.props.className);
|
|
213
212
|
const minSize = this.state.size ? this.state.size : 100;
|