@zydon/common 2.5.15 → 2.5.16
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,8 +12,9 @@ type PasswordProps = BaseField<TextFieldProps> & {
|
|
|
12
12
|
match?: {
|
|
13
13
|
fieldPassword: string;
|
|
14
14
|
};
|
|
15
|
+
showButtonViewPassword?: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
declare const Password: ({ name, sx, rules, passwordSize, specialCharacter, upperCaseChar, numberChar, showErrorMessage, match, helperText, InputProps, ...other }: PasswordProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare const Password: ({ name, sx, rules, passwordSize, specialCharacter, upperCaseChar, numberChar, showErrorMessage, match, helperText, InputProps, showButtonViewPassword, ...other }: PasswordProps) => react_jsx_runtime.JSX.Element;
|
|
18
19
|
|
|
19
20
|
export { Password as default };
|
|
@@ -4,10 +4,10 @@ import { a as a$1 } from '../../../chunk-MAK4JF5M.js';
|
|
|
4
4
|
import '../../../chunk-FUB7WQS5.js';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { useFormContext } from 'react-hook-form';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import y from '@mui/material/IconButton';
|
|
8
|
+
import N from '@mui/material/InputAdornment';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var O=({name:o,sx:P,rules:n,passwordSize:d$1,specialCharacter:i,upperCaseChar:p,numberChar:l,showErrorMessage:x,match:r,helperText:m,InputProps:u,showButtonViewPassword:I=!0,...g})=>{let{watch:f}=useFormContext(),v=f(o),[t,C]=useState(!1),{hasNumberChar:V,hasSpecialCharacter:A,hasUpperCaseChar:F,isLengthValid:S}=d(v,d$1,l,i,p),H=(!A||!F||!S||!V)&&!x?"none":void 0;return jsx(a,{"data-intercom-target":o,...g,name:o,type:t?"text":"password",InputProps:{...u,endAdornment:jsxs(N,{position:"end",children:[u?.endAdornment,I&&jsx(y,{onClick:()=>C(!t),edge:"end","aria-label":"Mostrar/Ocultar senha",tabIndex:-1,children:jsx(a$1,{icon:t?"VIEW_ON":"VIEW_OFF"})})]})},rules:{...n,validate:{...n?.validate,validationPassword:h=>{let e=d(h,d$1,l,i,p);return !e.hasNumberChar||!e.hasSpecialCharacter||!e.hasUpperCaseChar||!e.isLengthValid?"Senha inv\xE1lida":r&&r.fieldPassword&&f(r.fieldPassword)!==h?"As senhas devem ser iguais":!0}}},sx:{...P,"& .MuiFormHelperText-root":{display:m?void 0:H}},forceShowHelperText:!0,helperText:m})},G=O;
|
|
12
12
|
|
|
13
|
-
export {
|
|
13
|
+
export { G as default };
|