{this.renderTextTooltip()}
>
)}
);
}
}
PasswordInput.propTypes = {
/** Allows setting the component id */
id: PropTypes.string,
/** Allows setting the component auto-complete */
autoComplete: PropTypes.string,
/** Facilitates the correct display of values inside the input*/
inputType: PropTypes.oneOf(["text", "password"]),
/** Input name */
inputName: PropTypes.string,
/** Required to associate the password field with the email field */
emailInputName: PropTypes.string,
/** Input value */
inputValue: PropTypes.string,
/** Sets a callback function that is triggered on PasswordInput */
onChange: PropTypes.func,
/** Default event that is triggered when the button is already pressed but not released */
onKeyDown: PropTypes.func,
/** Event that is triggered when the focused item is lost */
onBlur: PropTypes.func,
/** Sets the input width manually */
inputWidth: PropTypes.string,
/** Notifies if the error occurs */
hasError: PropTypes.bool,
/** Notifies if the warning occurs */
hasWarning: PropTypes.bool,
/** Default placeholder input */
placeholder: PropTypes.string,
/** Tab index input */
tabIndex: PropTypes.number,
/** Default maxLength input */
maxLength: PropTypes.number,
/** Accepts class */
className: PropTypes.string,
/** Accepts css style */
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
/** Sets the input disabled */
isDisabled: PropTypes.bool,
size: PropTypes.oneOf(["base", "middle", "big", "huge", "large"]),
/** Indicates that the input field has scale */
scale: PropTypes.bool,
/** Allows to hide Tooltip */
isDisableTooltip: PropTypes.bool,
/** Allows to show Tooltip text */
isTextTooltipVisible: PropTypes.bool,
/** Prompts to copy the email and password data to clipboard */
clipActionResource: PropTypes.string,
/** Prompts to copy the email data to clipboard */
clipEmailResource: PropTypes.string,
/** Prompts to copy the password data to clipboard */
clipPasswordResource: PropTypes.string,
/** Prompts that the data has been copied to clipboard */
clipCopiedResource: PropTypes.string,
/** Title that indicates that the tooltip must contain a password */
tooltipPasswordTitle: PropTypes.string,
/** Prompt that indicates the minimal password length */
tooltipPasswordLength: PropTypes.string,
/** Prompt that instructs to include digits into the password */
tooltipPasswordDigits: PropTypes.string,
/** Prompt that indicates that capital letters are allowed */
tooltipPasswordCapital: PropTypes.string,
/** Prompt that indicates that special characters are allowed */
tooltipPasswordSpecial: PropTypes.string,
/** Set of special characters for password generator and validator */
generatorSpecial: PropTypes.string,
/** Set of settings for password generator and validator */
passwordSettings: PropTypes.object,
/** Sets a callback function that is triggered on PasswordInput. Returns bool value */
onValidateInput: PropTypes.func,
/** Sets a callback function that is triggered when the copy button is clicked. Returns formatted value */
onCopyToClipboard: PropTypes.func,
/** Sets the tooltip offset to the left */
tooltipOffsetLeft: PropTypes.number,
/** Sets the tooltip offset to the top */
tooltipOffsetTop: PropTypes.number,
/** Sets the password input view to simple (without tooltips, password progress bar and several additional buttons (copy and generate password) */
simpleView: PropTypes.bool,
/** Sets a title of the password generation button */
generatePasswordTitle: PropTypes.string,
/** Setting display block to set element to full width*/
isfullwidth: PropTypes.bool,
};
PasswordInput.defaultProps = {
inputType: "password",
inputName: "passwordInput",
autoComplete: "new-password",
isDisabled: false,
size: "base",
scale: true,
isDisableTooltip: false,
isTextTooltipVisible: false,
clipEmailResource: "E-mail ",
clipPasswordResource: "Password ",
clipCopiedResource: "Copied",
generatorSpecial: "!@#$%^&*",
className: "",
simpleView: false,
passwordSettings: {
minLength: 8,
upperCase: false,
digits: false,
specSymbols: false,
digitsRegexStr: "(?=.*\\d)",
upperCaseRegexStr: "(?=.*[A-Z])",
specSymbolsRegexStr: "(?=.*[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E])",
},
isfullwidth: false,
};
export default PasswordInput;