@npm_leadtech/legal-lib-components 7.4.2 → 7.4.3
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.
|
@@ -12,6 +12,7 @@ export const Input = React.forwardRef(({ value, name, placeholder, className, on
|
|
|
12
12
|
setHidden(!hidden);
|
|
13
13
|
};
|
|
14
14
|
const isCurrency = prefix === 'currency';
|
|
15
|
+
const isPercent = prefix === 'percent';
|
|
15
16
|
const euro = country === 'DE';
|
|
16
17
|
const otherCurrency = country !== 'DE';
|
|
17
18
|
let finalClassName = className;
|
|
@@ -26,7 +27,9 @@ export const Input = React.forwardRef(({ value, name, placeholder, className, on
|
|
|
26
27
|
return (_jsxs(_Fragment, { children: [isCurrency && !!prefix && otherCurrency && (_jsx("div", { className: 'input-icon-currency-prefix', children: _jsx("img", { src: currencyOthers, alt: 'currency' }) })), _jsx("input", { type: !hidden && type === 'password' ? 'text' : type, name: name, id: name, className: finalClassName, maxLength: maxLength, placeholder: placeholder, onChange: onChange, onClick: onClick, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onBlur: onBlur, value: value, "data-qa": name, disabled: disabled, ref: ref }), type === 'password' && (_jsx("button", { type: 'button', className: 'input-icon-password-button', onClick: showPassword, onKeyDown: (e) => {
|
|
27
28
|
if (e.key === 'Enter')
|
|
28
29
|
showPassword();
|
|
29
|
-
}, children: _jsx("img", { src: hidden ? eyeIcon : eyeCloseIcon, alt: '' }) })), isCurrency
|
|
30
|
-
|
|
30
|
+
}, children: _jsx("img", { src: hidden ? eyeIcon : eyeCloseIcon, alt: '' }) })), isCurrency
|
|
31
|
+
? !!prefix &&
|
|
32
|
+
euro && (_jsx("div", { className: 'input-icon-currency-suffix', children: _jsx("img", { src: currencyEuro, alt: 'currency' }) }))
|
|
33
|
+
: isPercent && (_jsx("div", { className: 'input-icon-percent-suffix', children: _jsx("img", { src: percent, alt: 'percent' }) }))] }));
|
|
31
34
|
});
|
|
32
35
|
Input.displayName = 'Input';
|
|
@@ -50,6 +50,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const isCurrency = prefix === 'currency'
|
|
53
|
+
const isPercent = prefix === 'percent'
|
|
53
54
|
const euro = country === 'DE'
|
|
54
55
|
const otherCurrency = country !== 'DE'
|
|
55
56
|
|
|
@@ -98,18 +99,18 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
98
99
|
<img src={hidden ? eyeIcon : eyeCloseIcon} alt='' />
|
|
99
100
|
</button>
|
|
100
101
|
)}
|
|
101
|
-
{isCurrency
|
|
102
|
-
!!prefix &&
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
{isCurrency
|
|
103
|
+
? !!prefix &&
|
|
104
|
+
euro && (
|
|
105
|
+
<div className='input-icon-currency-suffix'>
|
|
106
|
+
<img src={currencyEuro} alt='currency' />
|
|
107
|
+
</div>
|
|
108
|
+
)
|
|
109
|
+
: isPercent && (
|
|
110
|
+
<div className='input-icon-percent-suffix'>
|
|
111
|
+
<img src={percent} alt='percent' />
|
|
112
|
+
</div>
|
|
113
|
+
)}
|
|
113
114
|
</>
|
|
114
115
|
)
|
|
115
116
|
}
|