Web: PhoneInput: added prop scaled
This commit is contained in:
parent
84f1167c49
commit
2c71e239b1
@ -26,8 +26,6 @@ const InputPhone = (props) => {
|
||||
const str = e.target.value.replace(/\s/g, "");
|
||||
const el = options.find((option) => option.dialCode === str);
|
||||
|
||||
console.log(phoneValue);
|
||||
|
||||
if (e.target.value === "" || phoneValue) {
|
||||
setIsValid(false);
|
||||
setCountry((prev) => ({ ...prev, icon: InvalidFlag }));
|
||||
@ -112,7 +110,7 @@ const InputPhone = (props) => {
|
||||
hasError={!isValid}
|
||||
displayProp="flex"
|
||||
alignItems="center"
|
||||
scale={props.scale}
|
||||
scaled={props.scaled}
|
||||
>
|
||||
<ComboBox
|
||||
onClick={handleClick}
|
||||
@ -192,8 +190,8 @@ InputPhone.propTypes = {
|
||||
phonePlaceholderText: PropTypes.string,
|
||||
/** Text displayed on the SearchInput placeholder */
|
||||
searchPlaceholderText: PropTypes.string,
|
||||
/** Indicates the input field has scale */
|
||||
scale: PropTypes.bool,
|
||||
/** Indicates the input field has scaled */
|
||||
scaled: PropTypes.bool,
|
||||
/** Called when value is changed */
|
||||
onChange: PropTypes.func,
|
||||
/** Gets the country mask */
|
||||
@ -211,7 +209,7 @@ InputPhone.defaultProps = {
|
||||
},
|
||||
phonePlaceholderText: "",
|
||||
searchPlaceholderText: "",
|
||||
scale: false,
|
||||
scaled: false,
|
||||
searchEmptyMessage: "",
|
||||
errorMessage: "",
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ Default.args = {
|
||||
},
|
||||
phonePlaceholderText: "7 XXX XXX-XX-XX",
|
||||
searchPlaceholderText: "Search",
|
||||
scale: false,
|
||||
scaled: false,
|
||||
searchEmptyMessage: "Nothing found",
|
||||
errorMessage: "Сountry code is invalid",
|
||||
};
|
||||
|
@ -4,7 +4,7 @@ import Base from "../themes/base";
|
||||
|
||||
export const StyledBox = styled(Box)`
|
||||
position: relative;
|
||||
width: ${(props) => (props.scale ? "100%" : props.theme.inputPhone.width)};
|
||||
width: ${(props) => (props.scaled ? "100%" : props.theme.inputPhone.width)};
|
||||
border: 1px solid ${(props) =>
|
||||
props.hasError
|
||||
? props.theme.inputPhone.errorBorderColor
|
||||
|
@ -45,7 +45,7 @@ Default.args = {
|
||||
isReadOnly: false,
|
||||
hasError: false,
|
||||
hasWarning: false,
|
||||
scale: false,
|
||||
scaled: false,
|
||||
autoComplete: "off",
|
||||
tabIndex: 1,
|
||||
withBorder: true,
|
||||
|
Loading…
Reference in New Issue
Block a user