mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
* updating File picker Text input Text area DateRangePicker Datepicker PasswordInput NumberInput TextInput codeEditor, to include border radius style option * change to number input * theme file updated to remove override for border radius * change to number input * text input updated with border radius style * updated with border radius * date range picker border radius removed * removing overiding class
35 lines
1 KiB
JavaScript
35 lines
1 KiB
JavaScript
import React from 'react';
|
|
|
|
export const PasswordInput = ({ height, validate, properties, styles, exposedVariables, setExposedVariable }) => {
|
|
const value = exposedVariables.value;
|
|
const { visibility, disabledState, borderRadius } = styles;
|
|
const placeholder = properties.placeholder;
|
|
|
|
const currentValidState = exposedVariables.isValid;
|
|
|
|
const validationData = validate(value);
|
|
|
|
const { isValid, validationError } = validationData;
|
|
|
|
if (currentValidState !== isValid) {
|
|
setExposedVariable('isValid', isValid);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<input
|
|
disabled={disabledState}
|
|
onChange={(e) => {
|
|
setExposedVariable('value', e.target.value);
|
|
}}
|
|
type={'password'}
|
|
className={`form-control ${!isValid ? 'is-invalid' : ''} validation-without-icon`}
|
|
placeholder={placeholder}
|
|
value={exposedVariables.value}
|
|
style={{ height, display: visibility ? '' : 'none', borderRadius: `${borderRadius}px` }}
|
|
/>
|
|
|
|
<div className="invalid-feedback">{validationError}</div>
|
|
</div>
|
|
);
|
|
};
|