mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Refacto Input library scss
This commit is contained in:
parent
6aaa064822
commit
69dad2ac95
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -14,6 +14,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputAddon from 'components/InputAddon';
|
import InputAddon from 'components/InputAddon';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -93,7 +94,7 @@ class InputAddonWithErrors extends React.Component { // eslint-disable-line reac
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
|
@ -3,7 +3,3 @@
|
|||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { includes, isEmpty, isObject, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isObject, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -15,6 +15,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputCheckbox from 'components/InputCheckbox';
|
import InputCheckbox from 'components/InputCheckbox';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ class InputCheckboxWithErrors extends React.Component {
|
|||||||
const handleBlur = onBlur ? onBlur : () => {};
|
const handleBlur = onBlur ? onBlur : () => {};
|
||||||
let inputTitle = '';
|
let inputTitle = '';
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
font-family: 'Lato';
|
font-family: 'Lato';
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputCheckboxDescriptionContainer {
|
.inputCheckboxDescriptionContainer {
|
||||||
width: 150%;
|
width: 150%;
|
||||||
margin-top: .2rem;
|
margin-top: .2rem;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { get, includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { get, isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -14,6 +14,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputDate from 'components/InputDate';
|
import InputDate from 'components/InputDate';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -92,7 +93,7 @@ class InputDateWithErrors extends React.Component { // eslint-disable-line react
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
|
@ -30,7 +30,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -14,6 +14,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputEmail from 'components/InputEmail';
|
import InputEmail from 'components/InputEmail';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -90,7 +91,7 @@ class InputEmailWithErrors extends React.Component { // eslint-disable-line reac
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
@ -98,7 +99,7 @@ class InputEmailWithErrors extends React.Component { // eslint-disable-line reac
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerEmail,
|
||||||
this.props.customBootstrapClass,
|
this.props.customBootstrapClass,
|
||||||
!isEmpty(this.props.className) && this.props.className,
|
!isEmpty(this.props.className) && this.props.className,
|
||||||
)}
|
)}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
.container {
|
.containerEmail {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -13,6 +13,7 @@ import { isEmpty } from 'lodash';
|
|||||||
import Label from 'components/Label';
|
import Label from 'components/Label';
|
||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputFile from 'components/InputFile';
|
import InputFile from 'components/InputFile';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
@ -35,8 +36,8 @@ class InputFileWithErrors extends React.Component {
|
|||||||
value,
|
value,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const labelClass = labelClassName === '' ? styles.label : labelClassName;
|
const labelClass = labelClassName === '' ? styles.labelFile : labelClassName;
|
||||||
const spacer = isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
const spacer = isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.labelFile {
|
||||||
margin-bottom: 9px;
|
margin-bottom: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: 1.4rem;
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -8,6 +8,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputNumber from 'components/InputNumber';
|
import InputNumber from 'components/InputNumber';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -86,7 +87,7 @@ class InputNumberWithErrors extends React.Component { // eslint-disable-line rea
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
@ -94,7 +95,7 @@ class InputNumberWithErrors extends React.Component { // eslint-disable-line rea
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerInputNumber,
|
||||||
customBootstrapClass,
|
customBootstrapClass,
|
||||||
!isEmpty(className) && className,
|
!isEmpty(className) && className,
|
||||||
)}
|
)}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
.container {
|
.containerInputNumber {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -14,6 +14,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputPassword from 'components/InputPassword';
|
import InputPassword from 'components/InputPassword';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -71,6 +72,7 @@ class InputPasswordWithErrors extends React.Component {
|
|||||||
errorsClassName,
|
errorsClassName,
|
||||||
errorsStyle,
|
errorsStyle,
|
||||||
inputClassName,
|
inputClassName,
|
||||||
|
inputDescription,
|
||||||
inputDescriptionClassName,
|
inputDescriptionClassName,
|
||||||
inputDescriptionStyle,
|
inputDescriptionStyle,
|
||||||
inputStyle,
|
inputStyle,
|
||||||
@ -87,9 +89,15 @@ class InputPasswordWithErrors extends React.Component {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(this.props.onBlur) ? this.props.onBlur : this.handleBlur;
|
const handleBlur = isFunction(this.props.onBlur) ? this.props.onBlur : this.handleBlur;
|
||||||
|
|
||||||
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
|
spacer = <div />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerInputPassword,
|
||||||
this.props.customBootstrapClass,
|
this.props.customBootstrapClass,
|
||||||
!isEmpty(this.props.className) && this.props.className,
|
!isEmpty(this.props.className) && this.props.className,
|
||||||
)}
|
)}
|
||||||
@ -118,7 +126,7 @@ class InputPasswordWithErrors extends React.Component {
|
|||||||
/>
|
/>
|
||||||
<InputDescription
|
<InputDescription
|
||||||
className={inputDescriptionClassName}
|
className={inputDescriptionClassName}
|
||||||
message={this.props.inputDescription}
|
message={inputDescription}
|
||||||
style={inputDescriptionStyle}
|
style={inputDescriptionStyle}
|
||||||
/>
|
/>
|
||||||
<InputErrors
|
<InputErrors
|
||||||
@ -126,6 +134,7 @@ class InputPasswordWithErrors extends React.Component {
|
|||||||
errors={!noErrorsDescription && this.state.errors || []}
|
errors={!noErrorsDescription && this.state.errors || []}
|
||||||
style={errorsStyle}
|
style={errorsStyle}
|
||||||
/>
|
/>
|
||||||
|
{spacer}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.container {
|
.containerInputPassword {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -14,6 +14,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputSearch from 'components/InputSearch';
|
import InputSearch from 'components/InputSearch';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -90,7 +91,7 @@ class InputSearchWithErrors extends React.Component { // eslint-disable-line rea
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
|
@ -3,7 +3,3 @@
|
|||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -67,7 +67,7 @@ class InputSelectWithErrors extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerSelect,
|
||||||
customBootstrapClass,
|
customBootstrapClass,
|
||||||
!isEmpty(className) && className,
|
!isEmpty(className) && className,
|
||||||
)}
|
)}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.container {
|
.containerSelect {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* InputSpacer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import styles from './styles.scss';
|
||||||
|
|
||||||
|
function InputSpacer() {
|
||||||
|
return <div className={styles.spacerInput} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default InputSpacer;
|
@ -0,0 +1,3 @@
|
|||||||
|
.spacerInput {
|
||||||
|
height: .5rem;
|
||||||
|
}
|
@ -13,7 +13,7 @@ function InputText(props) {
|
|||||||
<input
|
<input
|
||||||
autoFocus={props.autoFocus}
|
autoFocus={props.autoFocus}
|
||||||
className={cn(
|
className={cn(
|
||||||
styles.input,
|
styles.textInput,
|
||||||
'form-control',
|
'form-control',
|
||||||
!props.deactivateErrorHighlight && props.error && 'is-invalid',
|
!props.deactivateErrorHighlight && props.error && 'is-invalid',
|
||||||
!isEmpty(props.className) && props.className,
|
!isEmpty(props.className) && props.className,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.input {
|
.textInput {
|
||||||
height: 3.4rem;
|
height: 3.4rem;
|
||||||
margin-top: .9rem;
|
margin-top: .9rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -8,6 +8,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputTextArea from 'components/InputTextArea';
|
import InputTextArea from 'components/InputTextArea';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -86,7 +87,7 @@ class InputTextAreaWithErrors extends React.Component { // eslint-disable-line r
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
@ -94,7 +95,7 @@ class InputTextAreaWithErrors extends React.Component { // eslint-disable-line r
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerTextArea,
|
||||||
customBootstrapClass,
|
customBootstrapClass,
|
||||||
!isEmpty(className) && className,
|
!isEmpty(className) && className,
|
||||||
)}
|
)}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.container {
|
.containerTextArea {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
font-family: 'Lato';
|
font-family: 'Lato';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction } from 'lodash';
|
import { isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
@ -8,6 +8,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputText from 'components/InputText';
|
import InputText from 'components/InputText';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import validateInput from 'utils/inputsValidations';
|
import validateInput from 'utils/inputsValidations';
|
||||||
@ -86,7 +87,7 @@ class InputTextWithErrors extends React.Component { // eslint-disable-line react
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
.container {
|
.containerText {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -13,6 +13,7 @@ import Label from 'components/Label';
|
|||||||
import InputDescription from 'components/InputDescription';
|
import InputDescription from 'components/InputDescription';
|
||||||
import InputErrors from 'components/InputErrors';
|
import InputErrors from 'components/InputErrors';
|
||||||
import InputToggle from 'components/InputToggle';
|
import InputToggle from 'components/InputToggle';
|
||||||
|
import InputSpacer from 'components/InputSpacer';
|
||||||
|
|
||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ class InputToggleWithErrors extends React.Component {
|
|||||||
value,
|
value,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
let spacer = !isEmpty(inputDescription) ? <div className={styles.spacer} /> : <div />;
|
let spacer = !isEmpty(inputDescription) ? <InputSpacer /> : <div />;
|
||||||
|
|
||||||
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
if (!noErrorsDescription && !isEmpty(this.state.errors)) {
|
||||||
spacer = <div />;
|
spacer = <div />;
|
||||||
@ -69,7 +70,7 @@ class InputToggleWithErrors extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
styles.container,
|
styles.containerToggleErrors,
|
||||||
customBootstrapClass,
|
customBootstrapClass,
|
||||||
!isEmpty(className) && className,
|
!isEmpty(className) && className,
|
||||||
)}
|
)}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.container {
|
.containerToggleErrors {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
}
|
}
|
||||||
@ -7,7 +7,3 @@
|
|||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
font-weight: 500 !important;
|
font-weight: 500 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
|
||||||
height: .5rem;
|
|
||||||
}
|
|
||||||
|
@ -10,7 +10,7 @@ import { isEmpty } from 'lodash';
|
|||||||
// Design
|
// Design
|
||||||
import InputAddonWithErrors from 'components/InputAddonWithErrors';
|
import InputAddonWithErrors from 'components/InputAddonWithErrors';
|
||||||
import InputCheckboxWithErrors from 'components/InputCheckboxWithErrors';
|
import InputCheckboxWithErrors from 'components/InputCheckboxWithErrors';
|
||||||
import InputDateWithErrors from 'components/InputDateWithErrors';
|
// import InputDateWithErrors from 'components/InputDateWithErrors';
|
||||||
import InputEmailWithErrors from 'components/InputEmailWithErrors';
|
import InputEmailWithErrors from 'components/InputEmailWithErrors';
|
||||||
import InputFileWithErrors from 'components/InputFileWithErrors';
|
import InputFileWithErrors from 'components/InputFileWithErrors';
|
||||||
import InputNumberWithErrors from 'components/InputNumberWithErrors';
|
import InputNumberWithErrors from 'components/InputNumberWithErrors';
|
||||||
@ -26,7 +26,7 @@ const DefaultInputError = ({ type }) => <div>Your input type: <b>{type}</b> does
|
|||||||
const inputs = {
|
const inputs = {
|
||||||
addon: InputAddonWithErrors,
|
addon: InputAddonWithErrors,
|
||||||
checkbox: InputCheckboxWithErrors,
|
checkbox: InputCheckboxWithErrors,
|
||||||
date: InputDateWithErrors,
|
// date: InputDateWithErrors,
|
||||||
email: InputEmailWithErrors,
|
email: InputEmailWithErrors,
|
||||||
file: InputFileWithErrors,
|
file: InputFileWithErrors,
|
||||||
number: InputNumberWithErrors,
|
number: InputNumberWithErrors,
|
||||||
@ -60,17 +60,3 @@ InputsIndex.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default InputsIndex;
|
export default InputsIndex;
|
||||||
export {
|
|
||||||
InputAddonWithErrors,
|
|
||||||
InputCheckboxWithErrors,
|
|
||||||
InputDateWithErrors,
|
|
||||||
InputEmailWithErrors,
|
|
||||||
InputFileWithErrors,
|
|
||||||
InputNumberWithErrors,
|
|
||||||
InputPasswordWithErrors,
|
|
||||||
InputSearchWithErrors,
|
|
||||||
InputSelectWithErrors,
|
|
||||||
InputTextWithErrors,
|
|
||||||
InputTextAreaWithErrors,
|
|
||||||
InputToggleWithErrors,
|
|
||||||
};
|
|
||||||
|
@ -23,7 +23,7 @@ function Label(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<label
|
<label
|
||||||
className={cn(styles.label, props.className)}
|
className={cn(styles.labelCompo, props.className)}
|
||||||
htmlFor={props.htmlFor}
|
htmlFor={props.htmlFor}
|
||||||
style={props.style}
|
style={props.style}
|
||||||
>
|
>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.label {
|
.labelCompo {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user