@pipelinesolucoes/form 1.2.0-beta.26 → 1.2.0-beta.28
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.
- package/README.md +4 -0
- package/dist/components/TextFieldBirthDateWithAge.d.ts +9 -27
- package/dist/components/TextFieldBirthDateWithAge.js +47 -37
- package/dist/components/TextFieldBirthDateWithAge.js.map +1 -1
- package/dist/components/TextFieldCPFValidate.d.ts +37 -0
- package/dist/components/TextFieldCPFValidate.js +147 -0
- package/dist/components/TextFieldCPFValidate.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/formatCEP.d.ts +20 -0
- package/dist/utils/formatCEP.js +35 -0
- package/dist/utils/formatCEP.js.map +1 -0
- package/dist/utils/formatCpf.d.ts +14 -0
- package/dist/utils/formatCpf.js +35 -0
- package/dist/utils/formatCpf.js.map +1 -0
- package/dist/utils/validateCpf.d.ts +40 -0
- package/dist/utils/validateCpf.js +67 -0
- package/dist/utils/validateCpf.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,10 @@ A biblioteca inclui os seguintes componentes:
|
|
|
43
43
|
validações comuns (required, min/maxLength, pattern) + validação customizada,
|
|
44
44
|
e cálculo automático de idade exibido na label.
|
|
45
45
|
|
|
46
|
+
- **TextFieldCPFValidate**
|
|
47
|
+
Campo de CPF com entrada somente numérica, máscara `000.000.000-00`,
|
|
48
|
+
validações comuns (required, min/maxLength, pattern) + validação customizada.
|
|
49
|
+
|
|
46
50
|
- **NotificationSnackbar**
|
|
47
51
|
Componente que exibe uma notificação no topo da tela utilizando o Snackbar e Alert do Material UI.
|
|
48
52
|
---
|
|
@@ -29,53 +29,35 @@ interface TextFieldBirthDateWithAgeProps extends Omit<ColorProps, 'backgroundHov
|
|
|
29
29
|
* validações comuns (required, min/maxLength, pattern) + validação customizada,
|
|
30
30
|
* e cálculo automático de idade exibido na label.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
* -
|
|
34
|
-
*
|
|
35
|
-
* - Quando a data estiver completa e for válida, a idade é calculada e exibida na label.
|
|
36
|
-
* - Erros sempre têm prioridade no helperText (a label não exibe idade quando há erro).
|
|
37
|
-
*
|
|
38
|
-
* Tokens de estilo (ordem de prioridade):
|
|
39
|
-
* - props do componente
|
|
40
|
-
* - `theme.pipelinesolucoes.forms.field`
|
|
41
|
-
* - fallback interno (constantes `fb*`)
|
|
32
|
+
* Regra adicional:
|
|
33
|
+
* - Se o usuário digitar ano com 2 dígitos (ex.: `25/11/78`), o componente converte para `25/11/2078`
|
|
34
|
+
* (sempre prefixando `20` no ano).
|
|
42
35
|
*
|
|
43
36
|
* @param {string} [id] Identificador do campo.
|
|
44
37
|
* @param {string} [label] Rótulo exibido acima do campo.
|
|
45
38
|
* @param {string} [placeholder='dd/mm/aaaa'] Placeholder do input.
|
|
46
39
|
* @param {string} [value] Valor do campo (controlado).
|
|
47
40
|
* @param {boolean} [disabled=false] Define se o campo está desabilitado.
|
|
48
|
-
*
|
|
49
41
|
* @param {number} [minLength] Número mínimo de caracteres para validação (após máscara).
|
|
50
42
|
* @param {number} [maxLength] Número máximo de caracteres para validação (após máscara).
|
|
51
|
-
*
|
|
52
43
|
* @param {boolean} [required=false] Define se é obrigatório.
|
|
53
44
|
* @param {string} [requiredMessage='Campo obrigatório'] Mensagem de obrigatório.
|
|
54
45
|
* @param {RegExp | string} [pattern] Pattern para validação do valor formatado.
|
|
55
46
|
* @param {string} [patternMessage='Formato inválido'] Mensagem do pattern.
|
|
56
47
|
* @param {'change' | 'blur'} [showErrorOn='blur'] Momento de exibir o erro.
|
|
57
48
|
* @param {(value: string) => string | null | undefined} [validate] Validação customizada do valor formatado.
|
|
58
|
-
*
|
|
59
49
|
* @param {(age: number | null) => void} [onAgeChange] Callback com a idade calculada (ou null se inválido/incompleto).
|
|
60
50
|
* @param {(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onChange] Callback disparado ao alterar (já com valor formatado).
|
|
61
51
|
* @param {(event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onBlur] Callback disparado ao perder o foco.
|
|
62
52
|
*
|
|
63
53
|
* @example
|
|
64
54
|
* ```tsx
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* value={birthDate}
|
|
72
|
-
* required
|
|
73
|
-
* showErrorOn="blur"
|
|
74
|
-
* onChange={(e) => setBirthDate(e.target.value)}
|
|
75
|
-
* onAgeChange={(age) => console.log('idade', age)}
|
|
76
|
-
* />
|
|
77
|
-
* );
|
|
78
|
-
* };
|
|
55
|
+
* <TextFieldBirthDateWithAge
|
|
56
|
+
* label="Data de nascimento"
|
|
57
|
+
* value={birthDate}
|
|
58
|
+
* onChange={(e) => setBirthDate(e.target.value)}
|
|
59
|
+
* onAgeChange={(age) => console.log(age)}
|
|
60
|
+
* />
|
|
79
61
|
* ```
|
|
80
62
|
*/
|
|
81
63
|
declare const TextFieldBirthDateWithAge: React.FC<TextFieldBirthDateWithAgeProps>;
|
|
@@ -4,8 +4,42 @@ import { useTheme } from '@mui/material/styles';
|
|
|
4
4
|
import { TextFieldStyled } from '../style/TextFieldStyle';
|
|
5
5
|
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbpadding, } from '../constant';
|
|
6
6
|
const onlyNumbers = (raw) => (raw !== null && raw !== void 0 ? raw : '').replace(/[^\d]/g, '');
|
|
7
|
+
const expandTwoDigitYearToFour = (yy) => {
|
|
8
|
+
// Regra solicitada: 78 -> 2078 (sempre prefixa 20)
|
|
9
|
+
// Também cobre 00..99 -> 2000..2099
|
|
10
|
+
if (yy.length !== 2)
|
|
11
|
+
return yy;
|
|
12
|
+
return `20${yy}`;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Expande ano de 2 dígitos SOMENTE quando o usuário digitou no formato com barra (dd/mm/yy).
|
|
16
|
+
* Ex.: "25/11/78" -> "25/11/2078"
|
|
17
|
+
*/
|
|
7
18
|
const formatBirthDate = (raw) => {
|
|
8
|
-
const
|
|
19
|
+
const v = raw !== null && raw !== void 0 ? raw : '';
|
|
20
|
+
// 1) Se o usuário estiver digitando com barras, aceita dd/mm/yy e expande para dd/mm/yyyy
|
|
21
|
+
// Ex.: 25/11/78 -> 25/11/2078
|
|
22
|
+
if (v.includes('/')) {
|
|
23
|
+
const digits = onlyNumbers(v).slice(0, 8); // ddmmyyyy (máx)
|
|
24
|
+
const dd = digits.slice(0, 2);
|
|
25
|
+
const mm = digits.slice(2, 4);
|
|
26
|
+
const year = digits.slice(4); // pode ser 0..4
|
|
27
|
+
if (digits.length <= 2)
|
|
28
|
+
return dd;
|
|
29
|
+
if (digits.length <= 4)
|
|
30
|
+
return `${dd}/${mm}`;
|
|
31
|
+
// se ano tem 1..2 dígitos -> expande prefixando 20 quando tiver exatamente 2
|
|
32
|
+
if (year.length <= 2) {
|
|
33
|
+
if (year.length === 2)
|
|
34
|
+
return `${dd}/${mm}/20${year}`;
|
|
35
|
+
return `${dd}/${mm}/${year}`;
|
|
36
|
+
}
|
|
37
|
+
// ano completo (3..4)
|
|
38
|
+
return `${dd}/${mm}/${year}`;
|
|
39
|
+
}
|
|
40
|
+
// 2) Se o usuário digitar só números (ddmmyyyy), NÃO expande em 6 dígitos.
|
|
41
|
+
// Assim ele consegue digitar 1978 normalmente.
|
|
42
|
+
const digits = onlyNumbers(v).slice(0, 8);
|
|
9
43
|
if (digits.length <= 2)
|
|
10
44
|
return digits;
|
|
11
45
|
if (digits.length <= 4)
|
|
@@ -30,7 +64,6 @@ const isValidBirthDate = (formatted) => {
|
|
|
30
64
|
const date = new Date(yyyy, mm - 1, dd);
|
|
31
65
|
if (Number.isNaN(date.getTime()))
|
|
32
66
|
return false;
|
|
33
|
-
// garante que não "normalizou" (ex.: 31/02 vira 02/03)
|
|
34
67
|
return (date.getFullYear() === yyyy &&
|
|
35
68
|
date.getMonth() === mm - 1 &&
|
|
36
69
|
date.getDate() === dd);
|
|
@@ -44,7 +77,6 @@ const calculateAgeFromFormatted = (formatted) => {
|
|
|
44
77
|
const yyyy = Number(yyyyStr);
|
|
45
78
|
const birth = new Date(yyyy, mm - 1, dd);
|
|
46
79
|
const today = new Date();
|
|
47
|
-
// Não permitir data no futuro
|
|
48
80
|
const todayAtMidnight = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
|
49
81
|
if (birth.getTime() > todayAtMidnight.getTime())
|
|
50
82
|
return null;
|
|
@@ -59,12 +91,10 @@ const computeError = (value, { required, requiredMessage, minLength, maxLength,
|
|
|
59
91
|
const v = value !== null && value !== void 0 ? value : '';
|
|
60
92
|
if (required && v.trim().length === 0)
|
|
61
93
|
return requiredMessage || 'Campo obrigatório';
|
|
62
|
-
if (typeof minLength === 'number' && v.length < minLength)
|
|
94
|
+
if (typeof minLength === 'number' && v.length < minLength)
|
|
63
95
|
return `Mínimo de ${minLength} caracteres`;
|
|
64
|
-
|
|
65
|
-
if (typeof maxLength === 'number' && v.length > maxLength) {
|
|
96
|
+
if (typeof maxLength === 'number' && v.length > maxLength)
|
|
66
97
|
return `Máximo de ${maxLength} caracteres`;
|
|
67
|
-
}
|
|
68
98
|
if (pattern) {
|
|
69
99
|
const re = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
|
|
70
100
|
if (!re.test(v))
|
|
@@ -82,53 +112,35 @@ const computeError = (value, { required, requiredMessage, minLength, maxLength,
|
|
|
82
112
|
* validações comuns (required, min/maxLength, pattern) + validação customizada,
|
|
83
113
|
* e cálculo automático de idade exibido na label.
|
|
84
114
|
*
|
|
85
|
-
*
|
|
86
|
-
* -
|
|
87
|
-
*
|
|
88
|
-
* - Quando a data estiver completa e for válida, a idade é calculada e exibida na label.
|
|
89
|
-
* - Erros sempre têm prioridade no helperText (a label não exibe idade quando há erro).
|
|
90
|
-
*
|
|
91
|
-
* Tokens de estilo (ordem de prioridade):
|
|
92
|
-
* - props do componente
|
|
93
|
-
* - `theme.pipelinesolucoes.forms.field`
|
|
94
|
-
* - fallback interno (constantes `fb*`)
|
|
115
|
+
* Regra adicional:
|
|
116
|
+
* - Se o usuário digitar ano com 2 dígitos (ex.: `25/11/78`), o componente converte para `25/11/2078`
|
|
117
|
+
* (sempre prefixando `20` no ano).
|
|
95
118
|
*
|
|
96
119
|
* @param {string} [id] Identificador do campo.
|
|
97
120
|
* @param {string} [label] Rótulo exibido acima do campo.
|
|
98
121
|
* @param {string} [placeholder='dd/mm/aaaa'] Placeholder do input.
|
|
99
122
|
* @param {string} [value] Valor do campo (controlado).
|
|
100
123
|
* @param {boolean} [disabled=false] Define se o campo está desabilitado.
|
|
101
|
-
*
|
|
102
124
|
* @param {number} [minLength] Número mínimo de caracteres para validação (após máscara).
|
|
103
125
|
* @param {number} [maxLength] Número máximo de caracteres para validação (após máscara).
|
|
104
|
-
*
|
|
105
126
|
* @param {boolean} [required=false] Define se é obrigatório.
|
|
106
127
|
* @param {string} [requiredMessage='Campo obrigatório'] Mensagem de obrigatório.
|
|
107
128
|
* @param {RegExp | string} [pattern] Pattern para validação do valor formatado.
|
|
108
129
|
* @param {string} [patternMessage='Formato inválido'] Mensagem do pattern.
|
|
109
130
|
* @param {'change' | 'blur'} [showErrorOn='blur'] Momento de exibir o erro.
|
|
110
131
|
* @param {(value: string) => string | null | undefined} [validate] Validação customizada do valor formatado.
|
|
111
|
-
*
|
|
112
132
|
* @param {(age: number | null) => void} [onAgeChange] Callback com a idade calculada (ou null se inválido/incompleto).
|
|
113
133
|
* @param {(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onChange] Callback disparado ao alterar (já com valor formatado).
|
|
114
134
|
* @param {(event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onBlur] Callback disparado ao perder o foco.
|
|
115
135
|
*
|
|
116
136
|
* @example
|
|
117
137
|
* ```tsx
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* value={birthDate}
|
|
125
|
-
* required
|
|
126
|
-
* showErrorOn="blur"
|
|
127
|
-
* onChange={(e) => setBirthDate(e.target.value)}
|
|
128
|
-
* onAgeChange={(age) => console.log('idade', age)}
|
|
129
|
-
* />
|
|
130
|
-
* );
|
|
131
|
-
* };
|
|
138
|
+
* <TextFieldBirthDateWithAge
|
|
139
|
+
* label="Data de nascimento"
|
|
140
|
+
* value={birthDate}
|
|
141
|
+
* onChange={(e) => setBirthDate(e.target.value)}
|
|
142
|
+
* onAgeChange={(age) => console.log(age)}
|
|
143
|
+
* />
|
|
132
144
|
* ```
|
|
133
145
|
*/
|
|
134
146
|
const TextFieldBirthDateWithAge = ({ id, label, placeholder = 'dd/mm/aaaa', value = '', textVariant, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, height, disabled = false, minLength, maxLength, required = false, requiredMessage = 'Campo obrigatório', pattern, patternMessage = 'Formato inválido', validate, showErrorOn = 'blur', onChange, onBlur, onAgeChange, }) => {
|
|
@@ -152,9 +164,7 @@ const TextFieldBirthDateWithAge = ({ id, label, placeholder = 'dd/mm/aaaa', valu
|
|
|
152
164
|
: null;
|
|
153
165
|
if (baseError)
|
|
154
166
|
return baseError;
|
|
155
|
-
if (v.length === 10 &&
|
|
156
|
-
return 'Data inválida';
|
|
157
|
-
if (v.length === 10 && isValidBirthDate(v) && computedAge === null)
|
|
167
|
+
if (v.length === 10 && computedAge === null)
|
|
158
168
|
return 'Data inválida';
|
|
159
169
|
return null;
|
|
160
170
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldBirthDateWithAge.js","sourceRoot":"","sources":["../../src/components/TextFieldBirthDateWithAge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,aAAa,CAAC;AAsCrB,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAEvE,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"TextFieldBirthDateWithAge.js","sourceRoot":"","sources":["../../src/components/TextFieldBirthDateWithAge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,aAAa,CAAC;AAsCrB,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAEvE,MAAM,wBAAwB,GAAG,CAAC,EAAU,EAAE,EAAE;IAC9C,mD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AAW,GAAG,2BAA2B,CAAC;AAEpE,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TypographyVariant } from '@mui/material/styles';
|
|
3
|
+
import { BorderProps, ColorProps, LayoutProps } from '@pipelinesolucoes/theme';
|
|
4
|
+
interface TextFieldCPFValidateProps extends Omit<ColorProps, 'backgroundHover' | 'colorHover'>, Omit<BorderProps, 'border'>, Pick<LayoutProps, 'height' | 'padding'> {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
textVariant?: TypographyVariant;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
minLength?: number;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
requiredMessage?: string;
|
|
15
|
+
pattern?: RegExp | string;
|
|
16
|
+
patternMessage?: string;
|
|
17
|
+
showErrorOn?: 'change' | 'blur';
|
|
18
|
+
validate?: (value: string) => string | null | undefined;
|
|
19
|
+
invalidCpfMessage?: string;
|
|
20
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
21
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Campo de CPF com entrada somente numérica, máscara `000.000.000-00`,
|
|
25
|
+
* validações comuns (required, min/maxLength, pattern) + validação customizada.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <TextFieldCPFValidate
|
|
30
|
+
* label="CPF"
|
|
31
|
+
* value={cpf}
|
|
32
|
+
* onChange={(e) => setCpf(e.target.value)} // recebe SEMPRE o valor formatado
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const TextFieldCPFValidate: React.FC<TextFieldCPFValidateProps>;
|
|
37
|
+
export default TextFieldCPFValidate;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTheme } from '@mui/material/styles';
|
|
4
|
+
import { TextFieldStyled } from '../style/TextFieldStyle';
|
|
5
|
+
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbpadding, } from '../constant';
|
|
6
|
+
import { formatCpf } from '@/utils/formatCpf';
|
|
7
|
+
import { validateCpf } from '@/utils/validateCpf';
|
|
8
|
+
const onlyNumbers = (raw) => (raw !== null && raw !== void 0 ? raw : '').replace(/[^\d]/g, '');
|
|
9
|
+
const isValidCpfFormatted = (formatted) => {
|
|
10
|
+
// aceita com máscara completa
|
|
11
|
+
if (!/^\d{3}\.\d{3}\.\d{3}-\d{2}$/.test(formatted))
|
|
12
|
+
return false;
|
|
13
|
+
const digits = onlyNumbers(formatted);
|
|
14
|
+
return validateCpf(digits);
|
|
15
|
+
};
|
|
16
|
+
const computeError = (value, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate, }) => {
|
|
17
|
+
const v = value !== null && value !== void 0 ? value : '';
|
|
18
|
+
if (required && v.trim().length === 0)
|
|
19
|
+
return requiredMessage || 'Campo obrigatório';
|
|
20
|
+
if (typeof minLength === 'number' && v.length < minLength)
|
|
21
|
+
return `Mínimo de ${minLength} caracteres`;
|
|
22
|
+
if (typeof maxLength === 'number' && v.length > maxLength)
|
|
23
|
+
return `Máximo de ${maxLength} caracteres`;
|
|
24
|
+
if (pattern) {
|
|
25
|
+
const re = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
|
|
26
|
+
if (!re.test(v))
|
|
27
|
+
return patternMessage || 'Formato inválido';
|
|
28
|
+
}
|
|
29
|
+
if (validate) {
|
|
30
|
+
const customMsg = validate(v);
|
|
31
|
+
if (typeof customMsg === 'string' && customMsg)
|
|
32
|
+
return customMsg;
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Campo de CPF com entrada somente numérica, máscara `000.000.000-00`,
|
|
38
|
+
* validações comuns (required, min/maxLength, pattern) + validação customizada.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <TextFieldCPFValidate
|
|
43
|
+
* label="CPF"
|
|
44
|
+
* value={cpf}
|
|
45
|
+
* onChange={(e) => setCpf(e.target.value)} // recebe SEMPRE o valor formatado
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
const TextFieldCPFValidate = ({ id, label = 'CPF', placeholder = '000.000.000-00', value = '', textVariant, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, height, disabled = false, minLength, maxLength, required = false, requiredMessage = 'Campo obrigatório', pattern, patternMessage = 'Formato inválido', validate, showErrorOn = 'blur', invalidCpfMessage = 'CPF inválido', onChange, onBlur, }) => {
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
51
|
+
const [touched, setTouched] = React.useState(false);
|
|
52
|
+
const formattedValue = React.useMemo(() => formatCpf(value), [value]);
|
|
53
|
+
const cpfValid = React.useMemo(() => {
|
|
54
|
+
// só valida quando estiver completo (14 com máscara)
|
|
55
|
+
if (formattedValue.length !== 14)
|
|
56
|
+
return null; // incompleto
|
|
57
|
+
return isValidCpfFormatted(formattedValue);
|
|
58
|
+
}, [formattedValue]);
|
|
59
|
+
const errorMessage = React.useMemo(() => {
|
|
60
|
+
const v = formattedValue;
|
|
61
|
+
const baseError = showErrorOn === 'change'
|
|
62
|
+
? computeError(v, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate })
|
|
63
|
+
: showErrorOn === 'blur' && touched
|
|
64
|
+
? computeError(v, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate })
|
|
65
|
+
: null;
|
|
66
|
+
if (baseError)
|
|
67
|
+
return baseError;
|
|
68
|
+
// valida CPF apenas quando completo
|
|
69
|
+
if (v.length === 14 && cpfValid === false)
|
|
70
|
+
return invalidCpfMessage;
|
|
71
|
+
return null;
|
|
72
|
+
}, [
|
|
73
|
+
formattedValue,
|
|
74
|
+
required,
|
|
75
|
+
requiredMessage,
|
|
76
|
+
minLength,
|
|
77
|
+
maxLength,
|
|
78
|
+
pattern,
|
|
79
|
+
patternMessage,
|
|
80
|
+
validate,
|
|
81
|
+
showErrorOn,
|
|
82
|
+
touched,
|
|
83
|
+
cpfValid,
|
|
84
|
+
invalidCpfMessage,
|
|
85
|
+
]);
|
|
86
|
+
const handleBlur = (event) => {
|
|
87
|
+
if (!touched)
|
|
88
|
+
setTouched(true);
|
|
89
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
90
|
+
};
|
|
91
|
+
const handleChange = (event) => {
|
|
92
|
+
if (!onChange)
|
|
93
|
+
return;
|
|
94
|
+
const next = formatCpf(event.target.value);
|
|
95
|
+
const syntheticEvent = Object.assign(Object.assign({}, event), { target: Object.assign(Object.assign({}, event.target), { value: next }), currentTarget: Object.assign(Object.assign({}, event.currentTarget), { value: next }) });
|
|
96
|
+
onChange(syntheticEvent);
|
|
97
|
+
};
|
|
98
|
+
const handleKeyDown = (event) => {
|
|
99
|
+
const allowed = [
|
|
100
|
+
'Backspace',
|
|
101
|
+
'Delete',
|
|
102
|
+
'Tab',
|
|
103
|
+
'Enter',
|
|
104
|
+
'Escape',
|
|
105
|
+
'ArrowLeft',
|
|
106
|
+
'ArrowRight',
|
|
107
|
+
'ArrowUp',
|
|
108
|
+
'ArrowDown',
|
|
109
|
+
'Home',
|
|
110
|
+
'End',
|
|
111
|
+
];
|
|
112
|
+
if (allowed.includes(event.key))
|
|
113
|
+
return;
|
|
114
|
+
if (event.ctrlKey || event.metaKey)
|
|
115
|
+
return;
|
|
116
|
+
if (!/^\d$/.test(event.key)) {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const theme = useTheme();
|
|
121
|
+
const field = (_b = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.forms) === null || _b === void 0 ? void 0 : _b.field;
|
|
122
|
+
const bg = (_c = background !== null && background !== void 0 ? background : field === null || field === void 0 ? void 0 : field.background) !== null && _c !== void 0 ? _c : fbbackground;
|
|
123
|
+
const bgFocused = (_d = backgroundFocused !== null && backgroundFocused !== void 0 ? backgroundFocused : field === null || field === void 0 ? void 0 : field.backgroundFocused) !== null && _d !== void 0 ? _d : bg;
|
|
124
|
+
const bgDisabled = (_e = backgroundDisabled !== null && backgroundDisabled !== void 0 ? backgroundDisabled : field === null || field === void 0 ? void 0 : field.backgroundDisabled) !== null && _e !== void 0 ? _e : fbbackgroundDisabled;
|
|
125
|
+
const txt = (_f = color !== null && color !== void 0 ? color : field === null || field === void 0 ? void 0 : field.color) !== null && _f !== void 0 ? _f : fbcolor;
|
|
126
|
+
const txtDisabled = (_g = colorDisabled !== null && colorDisabled !== void 0 ? colorDisabled : field === null || field === void 0 ? void 0 : field.colorDisabled) !== null && _g !== void 0 ? _g : fbcolorDisabled;
|
|
127
|
+
const br = (_h = borderRadius !== null && borderRadius !== void 0 ? borderRadius : field === null || field === void 0 ? void 0 : field.borderRadius) !== null && _h !== void 0 ? _h : fbborderRadius;
|
|
128
|
+
const sh = (_j = boxShadow !== null && boxShadow !== void 0 ? boxShadow : field === null || field === void 0 ? void 0 : field.boxShadow) !== null && _j !== void 0 ? _j : fbboxShadow;
|
|
129
|
+
const bd = (_k = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _k !== void 0 ? _k : fbborderColor;
|
|
130
|
+
const bdFocused = (_l = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _l !== void 0 ? _l : fbcolorFocused;
|
|
131
|
+
const pad = (_m = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _m !== void 0 ? _m : fbpadding;
|
|
132
|
+
const hg = (_o = height !== null && height !== void 0 ? height : field === null || field === void 0 ? void 0 : field.height) !== null && _o !== void 0 ? _o : fbheigth;
|
|
133
|
+
const typo = (_q = (_p = (textVariant && theme.typography[textVariant])) !== null && _p !== void 0 ? _p : field === null || field === void 0 ? void 0 : field.typography) !== null && _q !== void 0 ? _q : theme.typography.body1;
|
|
134
|
+
const helperText = errorMessage ? errorMessage : '\u00A0';
|
|
135
|
+
return (_jsx(TextFieldStyled, { id: id, label: label, placeholder: placeholder, value: formattedValue, typo: typo, onChange: handleChange, onBlur: handleBlur, background: bg, backgroundFocused: bgFocused, backgroundDisabled: bgDisabled, colorText: txt, colorFocused: bdFocused, colorDisabled: txtDisabled, borderRadius: br, boxShadow: sh, borderColor: bd, padding: pad, disabled: disabled, required: required, fullWidth: true, height: hg, error: Boolean(errorMessage), helperText: helperText, onKeyDown: handleKeyDown, slotProps: {
|
|
136
|
+
input: {
|
|
137
|
+
inputProps: {
|
|
138
|
+
inputMode: 'numeric',
|
|
139
|
+
pattern: '[0-9]*',
|
|
140
|
+
maxLength: 14, // 000.000.000-00
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
} }));
|
|
144
|
+
};
|
|
145
|
+
TextFieldCPFValidate.displayName = 'TextFieldCPFValidate';
|
|
146
|
+
export default TextFieldCPFValidate;
|
|
147
|
+
//# sourceMappingURL=TextFieldCPFValidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextFieldCPFValidate.js","sourceRoot":"","sources":["../../src/components/TextFieldCPFValidate.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,y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.d.ts
CHANGED
|
@@ -10,5 +10,9 @@ export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
|
10
10
|
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
11
11
|
export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
|
|
12
12
|
export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
|
|
13
|
+
export { default as TextFieldCPFValidate } from './components/TextFieldCPFValidate';
|
|
13
14
|
export * from './utils/validateTelefone';
|
|
14
15
|
export * from './utils/validateEmail';
|
|
16
|
+
export * from './utils/validateCpf';
|
|
17
|
+
export * from './utils/formatCpf';
|
|
18
|
+
export * from './utils/formatCEP';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,10 @@ export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
|
10
10
|
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
11
11
|
export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
|
|
12
12
|
export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
|
|
13
|
+
export { default as TextFieldCPFValidate } from './components/TextFieldCPFValidate';
|
|
13
14
|
export * from './utils/validateTelefone';
|
|
14
15
|
export * from './utils/validateEmail';
|
|
16
|
+
export * from './utils/validateCpf';
|
|
17
|
+
export * from './utils/formatCpf';
|
|
18
|
+
export * from './utils/formatCEP';
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAC,MA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