From ba4c6261538ce8fab2c2702e199e2bef1820297c Mon Sep 17 00:00:00 2001 From: Andrei Firsov Date: Tue, 2 Apr 2019 13:38:15 +0300 Subject: [PATCH] feat(Input): adds step, min, max attributes --- src/common/Tag/Tag.js | 3 +++ src/components/Input/Input.js | 9 +++++++++ src/components/InputField/InputField.js | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/src/common/Tag/Tag.js b/src/common/Tag/Tag.js index 4f49a4c1..43fb9132 100644 --- a/src/common/Tag/Tag.js +++ b/src/common/Tag/Tag.js @@ -78,6 +78,9 @@ const COLLECTED_PROPS = [ 'href', 'target', 'rel', + 'step', + 'min', + 'max', ]; const HTML_TAGS = [ diff --git a/src/components/Input/Input.js b/src/components/Input/Input.js index 00e1c45c..d770cfda 100644 --- a/src/components/Input/Input.js +++ b/src/components/Input/Input.js @@ -59,6 +59,9 @@ type InputProps = { onBlur?: (?SyntheticFocusEvent) => void, /** callback which called on clear */ onClear?: () => void, + step?: string | number, + min?: string | number, + max?: string | number, } & InputCommonProps; class Input extends PureComponent { @@ -124,6 +127,9 @@ class Input extends PureComponent { clearable, onClear, autoFocus, + step, + min, + max, ...rest } = this.props; const hasLeftIcon = !!leftIcon; @@ -149,6 +155,9 @@ class Input extends PureComponent { readOnly, stretch, autoFocus, + step, + min, + max, }; return ( diff --git a/src/components/InputField/InputField.js b/src/components/InputField/InputField.js index 6b37a0dd..f6ba696c 100644 --- a/src/components/InputField/InputField.js +++ b/src/components/InputField/InputField.js @@ -41,6 +41,9 @@ type InputFieldProps = { onClear?: () => void, /** html auto-focus representation */ autoFocus?: boolean, + step?: string | number, + min?: string | number, + max?: string | number, }; const InputField = ({ @@ -66,6 +69,9 @@ const InputField = ({ autoComplete, autoFocus, onClear, + step, + min, + max, ...rest }: InputFieldProps) => { const { name, value, onChange, onFocus, onBlur } = input; @@ -106,6 +112,9 @@ const InputField = ({ rightIcon={ rightIcon } onClear={ onClear } autoFocus={ autoFocus } + step={ step } + min={ min } + max={ max } /> );