@pipelinesolucoes/form 1.2.0-beta.22 → 1.2.0-beta.25
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 +5 -1
- package/dist/components/SelectField.d.ts +1 -1
- package/dist/components/SelectField.js.map +1 -1
- package/dist/components/TextFieldBirthDateWithAge.d.ts +84 -0
- package/dist/components/TextFieldBirthDateWithAge.js +242 -0
- package/dist/components/TextFieldBirthDateWithAge.js.map +1 -0
- package/dist/components/TextFieldNumberValidate.d.ts +110 -0
- package/dist/components/TextFieldNumberValidate.js +196 -0
- package/dist/components/TextFieldNumberValidate.js.map +1 -0
- package/dist/components/TextFieldPassword.d.ts +1 -11
- package/dist/components/TextFieldPassword.js +8 -7
- package/dist/components/TextFieldPassword.js.map +1 -1
- package/dist/components/TextFieldValidate.d.ts +5 -6
- package/dist/components/TextFieldValidate.js +6 -5
- package/dist/components/TextFieldValidate.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/style/TextFieldStyle.d.ts +1 -0
- package/dist/style/TextFieldStyle.js +4 -3
- package/dist/style/TextFieldStyle.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/validateEmail.js +1 -1
- package/dist/utils/validateEmail.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,196 @@
|
|
|
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
|
+
const computeError = (value, { required, requiredMessage, minLength, pattern, patternMessage, validate, }) => {
|
|
7
|
+
const v = value !== null && value !== void 0 ? value : '';
|
|
8
|
+
if (required && v.trim().length === 0)
|
|
9
|
+
return requiredMessage || 'Campo obrigatório';
|
|
10
|
+
if (typeof minLength === 'number' && v.length < minLength)
|
|
11
|
+
return `Mínimo de ${minLength} caracteres`;
|
|
12
|
+
if (pattern) {
|
|
13
|
+
const re = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
|
|
14
|
+
if (!re.test(v))
|
|
15
|
+
return patternMessage || 'Formato inválido';
|
|
16
|
+
}
|
|
17
|
+
if (validate) {
|
|
18
|
+
const customMsg = validate(v);
|
|
19
|
+
if (typeof customMsg === 'string' && customMsg)
|
|
20
|
+
return customMsg;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
const sanitizeNumeric = (raw) => (raw !== null && raw !== void 0 ? raw : '').replace(/[^\d]/g, '');
|
|
25
|
+
/**
|
|
26
|
+
* Campo de texto numérico com suporte a validações comuns e customizadas, construído
|
|
27
|
+
* sobre o TextField do Material UI e estilizado via Design System da Pipeline.
|
|
28
|
+
*
|
|
29
|
+
* Diferença principal:
|
|
30
|
+
* - Este componente **aceita apenas números (0–9)**, removendo automaticamente qualquer caractere não numérico.
|
|
31
|
+
*
|
|
32
|
+
* Funcionalidades principais:
|
|
33
|
+
* - Suporte a modo controlado (`value`)
|
|
34
|
+
* - Validações nativas (obrigatório, tamanho mínimo, regex)
|
|
35
|
+
* - Validação customizada via função
|
|
36
|
+
* - Controle de momento de exibição do erro (`change` ou `blur`)
|
|
37
|
+
* - Suporte a campo multilinha (mantido por compatibilidade)
|
|
38
|
+
* - Customização visual via props e tokens de theme
|
|
39
|
+
*
|
|
40
|
+
* Tokens de estilo (ordem de prioridade):
|
|
41
|
+
* - `prop` do componente
|
|
42
|
+
* - `theme.pipelinesolucoes.forms.field`
|
|
43
|
+
* - Fallback interno (constantes `fb*`)
|
|
44
|
+
*
|
|
45
|
+
* Tipografia:
|
|
46
|
+
* - Suporte à tipografia do Material UI via `textVariant`
|
|
47
|
+
* - Fallback para `theme.pipelinesolucoes.forms.field.typography`
|
|
48
|
+
* - Fallback final para `theme.typography.body1`
|
|
49
|
+
*
|
|
50
|
+
* @param {string} [id] Identificador do campo, repassado ao input do Material UI.
|
|
51
|
+
* @param {string} [label] Texto do rótulo exibido acima do campo.
|
|
52
|
+
* @param {string} [placeholder] Texto exibido quando o campo está vazio.
|
|
53
|
+
* @param {string} [value] Valor atual do campo (modo controlado). Somente dígitos serão mantidos.
|
|
54
|
+
*
|
|
55
|
+
* @param {boolean} [disabled=false] Define se o campo está desabilitado.
|
|
56
|
+
*
|
|
57
|
+
* @param {number} [minLength] Número mínimo de caracteres permitidos.
|
|
58
|
+
* @param {number} [maxLength] Número máximo de caracteres permitidos.
|
|
59
|
+
*
|
|
60
|
+
* @param {boolean} [multiline=false] Define se o campo aceita múltiplas linhas (mantido por compatibilidade).
|
|
61
|
+
* @param {number} [rows=3] Quantidade de linhas visíveis quando `multiline` está ativo.
|
|
62
|
+
*
|
|
63
|
+
* ### Estilo / Aparência
|
|
64
|
+
* @param {import('@mui/material/styles').TypographyVariant} [textVariant] Variante tipográfica do Material UI aplicada ao texto e placeholder.
|
|
65
|
+
* @param {string} [background] Cor de fundo do campo.
|
|
66
|
+
* @param {string} [backgroundDisabled] Cor de fundo do campo quando desabilitado.
|
|
67
|
+
* @param {string} [backgroundFocused] Cor de fundo do campo quando focado.
|
|
68
|
+
* @param {string} [color] Cor do texto do campo (texto digitado e label).
|
|
69
|
+
* @param {string} [colorFocused] Cor aplicada ao estado focado (usada como cor de borda no focus).
|
|
70
|
+
* @param {string} [colorDisabled] Cor do texto do campo quando desabilitado.
|
|
71
|
+
* @param {string} [borderRadius] Raio da borda do campo.
|
|
72
|
+
* @param {string} [boxShadow] Sombra do campo.
|
|
73
|
+
* @param {string} [borderColor] Cor da borda do campo (estado padrão/hover).
|
|
74
|
+
* @param {string} [padding] Espaçamento interno do input (aplicado no texto e textarea).
|
|
75
|
+
*
|
|
76
|
+
* ---
|
|
77
|
+
* ### Validação
|
|
78
|
+
* @param {boolean} [required=false] Indica se o campo é obrigatório.
|
|
79
|
+
* @param {string} [requiredMessage] Mensagem exibida quando o campo obrigatório está vazio.
|
|
80
|
+
* @param {RegExp | string} [pattern] Expressão regular utilizada para validação do valor (aplicada após sanitização numérica).
|
|
81
|
+
* @param {string} [patternMessage] Mensagem exibida quando o valor não atende ao pattern.
|
|
82
|
+
* @param {'change' | 'blur'} [showErrorOn='blur'] Define quando o erro será exibido.
|
|
83
|
+
* @param {(value: string) => string | null | undefined} [validate] Função de validação customizada (recebe o valor sanitizado).
|
|
84
|
+
*
|
|
85
|
+
* ---
|
|
86
|
+
* ### Eventos
|
|
87
|
+
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] Callback disparado ao alterar o valor (com `event.target.value` já sanitizado).
|
|
88
|
+
* @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] Callback disparado ao perder o foco.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* const Example = () => {
|
|
93
|
+
* const [age, setAge] = React.useState('');
|
|
94
|
+
*
|
|
95
|
+
* return (
|
|
96
|
+
* <TextFieldNumberValidate
|
|
97
|
+
* label="Idade"
|
|
98
|
+
* placeholder="Somente números"
|
|
99
|
+
* value={age}
|
|
100
|
+
* onChange={(e) => setAge(e.target.value)}
|
|
101
|
+
* required
|
|
102
|
+
* minLength={1}
|
|
103
|
+
* maxLength={3}
|
|
104
|
+
* showErrorOn="blur"
|
|
105
|
+
* borderRadius="6px"
|
|
106
|
+
* textVariant="subtitle2"
|
|
107
|
+
* />
|
|
108
|
+
* );
|
|
109
|
+
* };
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
const TextFieldNumberValidate = ({ id, label, placeholder, value = '', textVariant, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, height, disabled = false, maxLength, minLength, required = false, requiredMessage = 'campo obrigatório', pattern, patternMessage = 'formato inválido', validate, showErrorOn = 'blur', onChange, onBlur, }) => {
|
|
113
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
114
|
+
const [touched, setTouched] = React.useState(false);
|
|
115
|
+
const sanitizedValue = React.useMemo(() => sanitizeNumeric(value), [value]);
|
|
116
|
+
const errorMessage = React.useMemo(() => {
|
|
117
|
+
const v = sanitizedValue;
|
|
118
|
+
if (showErrorOn === 'change') {
|
|
119
|
+
return computeError(v, { required, requiredMessage, minLength, pattern, patternMessage, validate });
|
|
120
|
+
}
|
|
121
|
+
if (showErrorOn === 'blur' && touched) {
|
|
122
|
+
return computeError(v, { required, requiredMessage, minLength, pattern, patternMessage, validate });
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}, [
|
|
126
|
+
sanitizedValue,
|
|
127
|
+
required,
|
|
128
|
+
requiredMessage,
|
|
129
|
+
minLength,
|
|
130
|
+
pattern,
|
|
131
|
+
patternMessage,
|
|
132
|
+
validate,
|
|
133
|
+
showErrorOn,
|
|
134
|
+
touched,
|
|
135
|
+
]);
|
|
136
|
+
const handleBlur = (event) => {
|
|
137
|
+
if (!touched)
|
|
138
|
+
setTouched(true);
|
|
139
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
140
|
+
};
|
|
141
|
+
const handleChange = (event) => {
|
|
142
|
+
if (!onChange)
|
|
143
|
+
return;
|
|
144
|
+
const next = sanitizeNumeric(event.target.value);
|
|
145
|
+
// Cria um "evento" compatível com o callback, garantindo value sanitizado
|
|
146
|
+
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 }) });
|
|
147
|
+
onChange(syntheticEvent);
|
|
148
|
+
};
|
|
149
|
+
const handleKeyDown = (event) => {
|
|
150
|
+
// Permite teclas de navegação/edição
|
|
151
|
+
const allowed = [
|
|
152
|
+
'Backspace',
|
|
153
|
+
'Delete',
|
|
154
|
+
'Tab',
|
|
155
|
+
'Enter',
|
|
156
|
+
'Escape',
|
|
157
|
+
'ArrowLeft',
|
|
158
|
+
'ArrowRight',
|
|
159
|
+
'ArrowUp',
|
|
160
|
+
'ArrowDown',
|
|
161
|
+
'Home',
|
|
162
|
+
'End',
|
|
163
|
+
];
|
|
164
|
+
if (allowed.includes(event.key))
|
|
165
|
+
return;
|
|
166
|
+
// Permite Ctrl/Cmd + atalhos (A, C, V, X)
|
|
167
|
+
if (event.ctrlKey || event.metaKey)
|
|
168
|
+
return;
|
|
169
|
+
// Bloqueia qualquer tecla que não seja dígito
|
|
170
|
+
if (!/^\d$/.test(event.key)) {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const theme = useTheme();
|
|
175
|
+
const field = (_b = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.forms) === null || _b === void 0 ? void 0 : _b.field;
|
|
176
|
+
const bg = (_c = background !== null && background !== void 0 ? background : field === null || field === void 0 ? void 0 : field.background) !== null && _c !== void 0 ? _c : fbbackground;
|
|
177
|
+
const bgFocused = (_d = backgroundFocused !== null && backgroundFocused !== void 0 ? backgroundFocused : field === null || field === void 0 ? void 0 : field.backgroundFocused) !== null && _d !== void 0 ? _d : bg;
|
|
178
|
+
const bgDisabled = (_e = backgroundDisabled !== null && backgroundDisabled !== void 0 ? backgroundDisabled : field === null || field === void 0 ? void 0 : field.backgroundDisabled) !== null && _e !== void 0 ? _e : fbbackgroundDisabled;
|
|
179
|
+
const txt = (_f = color !== null && color !== void 0 ? color : field === null || field === void 0 ? void 0 : field.color) !== null && _f !== void 0 ? _f : fbcolor;
|
|
180
|
+
const txtDisabled = (_g = colorDisabled !== null && colorDisabled !== void 0 ? colorDisabled : field === null || field === void 0 ? void 0 : field.colorDisabled) !== null && _g !== void 0 ? _g : fbcolorDisabled;
|
|
181
|
+
const br = (_h = borderRadius !== null && borderRadius !== void 0 ? borderRadius : field === null || field === void 0 ? void 0 : field.borderRadius) !== null && _h !== void 0 ? _h : fbborderRadius;
|
|
182
|
+
const sh = (_j = boxShadow !== null && boxShadow !== void 0 ? boxShadow : field === null || field === void 0 ? void 0 : field.boxShadow) !== null && _j !== void 0 ? _j : fbboxShadow;
|
|
183
|
+
const bd = (_k = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _k !== void 0 ? _k : fbborderColor;
|
|
184
|
+
const bdFocused = (_l = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _l !== void 0 ? _l : fbcolorFocused;
|
|
185
|
+
const pad = (_m = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _m !== void 0 ? _m : fbpadding;
|
|
186
|
+
const hg = (_o = height !== null && height !== void 0 ? height : field === null || field === void 0 ? void 0 : field.height) !== null && _o !== void 0 ? _o : fbheigth;
|
|
187
|
+
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;
|
|
188
|
+
return (_jsx(TextFieldStyled, { id: id, label: label, placeholder: placeholder, value: sanitizedValue, 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: errorMessage || ' ', onKeyDown: handleKeyDown, slotProps: {
|
|
189
|
+
input: {
|
|
190
|
+
inputProps: Object.assign({ inputMode: 'numeric', pattern: '[0-9]*' }, (typeof maxLength === 'number' ? { maxLength } : {})),
|
|
191
|
+
},
|
|
192
|
+
} }));
|
|
193
|
+
};
|
|
194
|
+
TextFieldNumberValidate.displayName = 'TextFieldNumberValidate';
|
|
195
|
+
export default TextFieldNumberValidate;
|
|
196
|
+
//# sourceMappingURL=TextFieldNumberValidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextFieldNumberValidate.js","sourceRoot":"","sources":["../../src/components/TextFieldNumberValidate.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;AAgCrB,MAAM,YAAY,GAAG,CACnB,KAAa,EACb,EACE,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,GAIT,EACc,EAAE;IACjB,MAAM,CAAC,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;IACtB,IAAI,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,eAAe,IAAI,mBAAmB,CAAC;IACrF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,SAAS;QAAE,OAAO,aAAa,SAAS,aAAa,CAAC;IAEtG,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACvE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,OAAO,cAAc,IAAI,kBAAkB,CAAC;IAC/D,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb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B,EAAE,UAAU,EAC9B,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,WAAW,EAC1B,YAAY,EAAE,EAAE,EAChB,SAAS,EAAE,EAAE,EACb,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,QACT,MAAM,EAAE,EAAE,EACV,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,EAC5B,UAAU,EAAE,YAAY,IAAI,GAAG,EAC/B,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,UAAU,kBACR,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,IACd,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxD;aACF;SACF,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;AAEhE,eAAe,uBAAuB,CAAC"}
|
|
@@ -8,22 +8,12 @@ interface PasswordValidationResult {
|
|
|
8
8
|
message: string;
|
|
9
9
|
value: string;
|
|
10
10
|
}
|
|
11
|
-
interface TextFieldPasswordProps extends
|
|
11
|
+
interface TextFieldPasswordProps extends Omit<ColorProps, 'backgroundHover' | 'colorHover'>, Omit<BorderProps, 'border'>, Pick<LayoutProps, 'height' | 'padding' | 'margin'> {
|
|
12
12
|
id?: string;
|
|
13
13
|
label?: string;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
value?: string;
|
|
16
16
|
textVariant?: TypographyVariant;
|
|
17
|
-
background?: string;
|
|
18
|
-
backgroundFocused?: string;
|
|
19
|
-
backgroundDisabled?: string;
|
|
20
|
-
color?: string;
|
|
21
|
-
colorFocused?: string;
|
|
22
|
-
colorDisabled?: string;
|
|
23
|
-
borderRadius?: string;
|
|
24
|
-
boxShadow?: string;
|
|
25
|
-
borderColor?: string;
|
|
26
|
-
padding?: string;
|
|
27
17
|
disabled?: boolean;
|
|
28
18
|
required?: boolean;
|
|
29
19
|
requiredMessage?: string;
|
|
@@ -7,7 +7,7 @@ import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
|
7
7
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
8
8
|
import { useTheme } from '@mui/material/styles';
|
|
9
9
|
import { TextFieldStyled } from '../style/TextFieldStyle';
|
|
10
|
-
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbpadding } from '../constant';
|
|
10
|
+
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbmargin, fbpadding } from '../constant';
|
|
11
11
|
/**
|
|
12
12
|
* Componente de campo de senha baseado no TextField do Material UI, com botão para alternar
|
|
13
13
|
* entre mostrar e ocultar a senha.
|
|
@@ -153,8 +153,8 @@ import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbbo
|
|
|
153
153
|
* />
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
|
-
const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, onValidationChange, disabled = false, required = true, pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/, requiredMessage = 'Senha obrigatória', patternMessage = 'A senha deve ter no mínimo 8 caracteres, com ao menos uma letra maiúscula, uma letra minúscula, um número e um caractere especial.', showErrorOn = 'blur', background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, height,
|
|
157
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
156
|
+
const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, onValidationChange, disabled = false, required = true, pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/, requiredMessage = 'Senha obrigatória', patternMessage = 'A senha deve ter no mínimo 8 caracteres, com ao menos uma letra maiúscula, uma letra minúscula, um número e um caractere especial.', showErrorOn = 'blur', background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, textVariant, padding, height, margin, onChange, onBlur, }) => {
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
158
158
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
159
159
|
const [touched, setTouched] = React.useState(false);
|
|
160
160
|
// fallback interno caso o usuário não use `value`
|
|
@@ -228,11 +228,12 @@ const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, on
|
|
|
228
228
|
const bd = (_k = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _k !== void 0 ? _k : fbborderColor;
|
|
229
229
|
const bdFocused = (_l = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _l !== void 0 ? _l : fbcolorFocused;
|
|
230
230
|
const pad = (_m = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _m !== void 0 ? _m : fbpadding;
|
|
231
|
-
const
|
|
232
|
-
const
|
|
233
|
-
|
|
231
|
+
const mg = (_o = margin !== null && margin !== void 0 ? margin : field === null || field === void 0 ? void 0 : field.margin) !== null && _o !== void 0 ? _o : fbmargin;
|
|
232
|
+
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;
|
|
233
|
+
const hg = (_r = height !== null && height !== void 0 ? height : field === null || field === void 0 ? void 0 : field.height) !== null && _r !== void 0 ? _r : fbheigth;
|
|
234
|
+
return (_jsx(TextFieldStyled, { type: showPassword ? 'text' : 'password', id: id, typo: typo, label: label, placeholder: placeholder, value: currentValue, background: bg, backgroundFocused: bgFocused, backgroundDisabled: bgDisabled, colorText: txt, colorFocused: bdFocused, colorDisabled: txtDisabled, borderRadius: br, boxShadow: sh, borderColor: bd, padding: pad, height: hg, marginField: mg, disabled: disabled, required: required, fullWidth: true, error: shouldShowError, helperText: helperText, slotProps: {
|
|
234
235
|
input: {
|
|
235
|
-
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => setShowPassword((prev) => !prev), edge: "end", "aria-label": showPassword ? 'Ocultar senha' : 'Mostrar senha', sx: { margin: '0
|
|
236
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => setShowPassword((prev) => !prev), edge: "end", "aria-label": showPassword ? 'Ocultar senha' : 'Mostrar senha', sx: { margin: '0 4px 0 0' }, children: showPassword ? _jsx(VisibilityOffIcon, {}) : _jsx(VisibilityIcon, {}) }) })),
|
|
236
237
|
},
|
|
237
238
|
}, onChange: handleChange, onBlur: handleBlur }));
|
|
238
239
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldPassword.js","sourceRoot":"","sources":["../../src/components/TextFieldPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EA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AC,KAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,KAAC,cAAc,KAAG,GAC/C,GACE,CAClB;aACF;SACF,EACD,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,GAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypographyVariant } from '@mui/material/styles';
|
|
3
3
|
import { BorderProps, ColorProps, LayoutProps } from '@pipelinesolucoes/theme';
|
|
4
|
-
interface TextFieldValidateProps extends
|
|
4
|
+
interface TextFieldValidateProps extends Omit<ColorProps, 'backgroundHover' | 'colorHover'>, Omit<BorderProps, 'border'>, Pick<LayoutProps, 'height' | 'padding' | 'margin'> {
|
|
5
5
|
id?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
value?: string;
|
|
9
9
|
textVariant?: TypographyVariant;
|
|
10
|
-
backgroundFocused?: string;
|
|
11
10
|
disabled?: boolean;
|
|
11
|
+
minLength?: number;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
multiline?: boolean;
|
|
14
|
+
rows?: number;
|
|
12
15
|
required?: boolean;
|
|
13
16
|
requiredMessage?: string;
|
|
14
17
|
pattern?: RegExp | string;
|
|
15
18
|
patternMessage?: string;
|
|
16
19
|
showErrorOn?: 'change' | 'blur';
|
|
17
|
-
minLength?: number;
|
|
18
|
-
maxLength?: number;
|
|
19
|
-
multiline?: boolean;
|
|
20
|
-
rows?: number;
|
|
21
20
|
validate?: (value: string) => string | null | undefined;
|
|
22
21
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
23
22
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useTheme } from '@mui/material/styles';
|
|
4
4
|
import { TextFieldStyled } from '../style/TextFieldStyle';
|
|
5
|
-
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbpadding } from '../constant';
|
|
5
|
+
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbmargin, fbpadding } from '../constant';
|
|
6
6
|
const computeError = (value, { required, requiredMessage, minLength, pattern, patternMessage, validate, }) => {
|
|
7
7
|
const v = value !== null && value !== void 0 ? value : '';
|
|
8
8
|
if (required && v.trim().length === 0)
|
|
@@ -138,8 +138,8 @@ const computeError = (value, { required, requiredMessage, minLength, pattern, pa
|
|
|
138
138
|
* };
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
|
-
const TextFieldValidate = ({ id, label, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, placeholder, disabled = false, value = '', onChange, onBlur, multiline = false, rows = 3, required = false, requiredMessage = 'campo obrigatório', minLength, pattern, patternMessage = 'formato inválido', validate, showErrorOn = 'blur', maxLength, padding, textVariant, height, }) => {
|
|
142
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
141
|
+
const TextFieldValidate = ({ id, label, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, placeholder, disabled = false, value = '', onChange, onBlur, multiline = false, rows = 3, required = false, requiredMessage = 'campo obrigatório', minLength, pattern, patternMessage = 'formato inválido', validate, showErrorOn = 'blur', maxLength, padding, textVariant, height, margin }) => {
|
|
142
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
143
143
|
const [touched, setTouched] = React.useState(false);
|
|
144
144
|
const errorMessage = React.useMemo(() => {
|
|
145
145
|
if (showErrorOn === 'change') {
|
|
@@ -194,8 +194,9 @@ const TextFieldValidate = ({ id, label, background, backgroundFocused, backgroun
|
|
|
194
194
|
const bdFocused = (_l = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _l !== void 0 ? _l : fbcolorFocused;
|
|
195
195
|
const pad = (_m = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _m !== void 0 ? _m : fbpadding;
|
|
196
196
|
const hg = multiline ? undefined : ((_o = height !== null && height !== void 0 ? height : field === null || field === void 0 ? void 0 : field.height) !== null && _o !== void 0 ? _o : fbheigth);
|
|
197
|
-
const
|
|
198
|
-
|
|
197
|
+
const mg = (_p = margin !== null && margin !== void 0 ? margin : field === null || field === void 0 ? void 0 : field.margin) !== null && _p !== void 0 ? _p : fbmargin;
|
|
198
|
+
const typo = (_r = (_q = (textVariant && theme.typography[textVariant])) !== null && _q !== void 0 ? _q : field === null || field === void 0 ? void 0 : field.typography) !== null && _r !== void 0 ? _r : theme.typography.body1;
|
|
199
|
+
return (_jsx(TextFieldStyled, { id: id, label: label, placeholder: placeholder, value: value, typo: typo, onChange: onChange, onBlur: handleBlur, background: bg, backgroundFocused: bgFocused, backgroundDisabled: bgDisabled, colorText: txt, colorFocused: bdFocused, colorDisabled: txtDisabled, borderRadius: br, boxShadow: sh, borderColor: bd, padding: pad, marginField: mg, disabled: disabled, multiline: multiline, required: required, rows: multiline ? rows : undefined, fullWidth: true, height: hg, error: Boolean(errorMessage), helperText: errorMessage || ' ', slotProps: {
|
|
199
200
|
input: {
|
|
200
201
|
inputProps: typeof maxLength === 'number' ? { maxLength } : undefined,
|
|
201
202
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldValidate.js","sourceRoot":"","sources":["../../src/components/TextFieldValidate.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAq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KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,mCAC9C,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,mCACjB,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;IAEzB,OAAO,CACL,KAAC,eAAe,IACd,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,EAAE,EACd,iBAAiB,EAAE,SAAS,EAC5B,kBAAkB,EAAE,UAAU,EAC9B,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,WAAW,EAC1B,YAAY,EAAE,EAAE,EAChB,SAAS,EAAE,EAAE,EACb,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,EAAE,EACf,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,QACT,MAAM,EAAE,EAAE,EACV,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,EAC5B,UAAU,EAAE,YAAY,IAAI,GAAG,EAC/B,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,UAAU,EAAE,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;aACtE;SACF,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export { default as FormSignUp } from './components/login/FormSignUp';
|
|
|
4
4
|
export { default as FormPasswordRecovery } from './components/login/FormPasswordRecovery';
|
|
5
5
|
export { default as RecaptchaForm } from './components/recaptcha/RecaptchaForm';
|
|
6
6
|
export { default as NotificationSnackbar } from './components/NotificationSnackbar';
|
|
7
|
-
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
8
|
-
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
9
7
|
export { default as SelectField } from './components/SelectField';
|
|
10
8
|
export { default as ChipList } from './components/ChipList';
|
|
9
|
+
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
10
|
+
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
11
|
+
export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
|
|
12
|
+
export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
|
|
11
13
|
export * from './utils/validateTelefone';
|
|
12
14
|
export * from './utils/validateEmail';
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,12 @@ export { default as FormSignUp } from './components/login/FormSignUp';
|
|
|
4
4
|
export { default as FormPasswordRecovery } from './components/login/FormPasswordRecovery';
|
|
5
5
|
export { default as RecaptchaForm } from './components/recaptcha/RecaptchaForm';
|
|
6
6
|
export { default as NotificationSnackbar } from './components/NotificationSnackbar';
|
|
7
|
-
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
8
|
-
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
9
7
|
export { default as SelectField } from './components/SelectField';
|
|
10
8
|
export { default as ChipList } from './components/ChipList';
|
|
9
|
+
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
10
|
+
export { default as TextFieldPassword } from './components/TextFieldPassword';
|
|
11
|
+
export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
|
|
12
|
+
export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
|
|
11
13
|
export * from './utils/validateTelefone';
|
|
12
14
|
export * from './utils/validateEmail';
|
|
13
15
|
//# 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,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;
|
|
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,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAE9F,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
|
|
@@ -13,6 +13,7 @@ export declare const TextFieldStyled: import("@emotion/styled").StyledComponent<
|
|
|
13
13
|
boxShadow?: string;
|
|
14
14
|
borderColor?: string;
|
|
15
15
|
padding?: string;
|
|
16
|
+
marginField?: string;
|
|
16
17
|
typo?: CSSObject | PipelineSolucoesTypographyTokens;
|
|
17
18
|
height?: string;
|
|
18
19
|
}, {}, {}>;
|
|
@@ -14,8 +14,9 @@ export const TextFieldStyled = styled(TextField, {
|
|
|
14
14
|
"padding",
|
|
15
15
|
"typo",
|
|
16
16
|
"heigth",
|
|
17
|
+
"marginField",
|
|
17
18
|
].includes(prop),
|
|
18
|
-
})(({ background, backgroundFocused, backgroundDisabled, colorText, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, typo, height }) => ({
|
|
19
|
+
})(({ background, backgroundFocused, backgroundDisabled, colorText, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, typo, height, marginField }) => ({
|
|
19
20
|
borderRadius,
|
|
20
21
|
boxShadow,
|
|
21
22
|
"& .MuiInputBase-root": {
|
|
@@ -26,8 +27,8 @@ export const TextFieldStyled = styled(TextField, {
|
|
|
26
27
|
borderRadius,
|
|
27
28
|
boxShadow,
|
|
28
29
|
height,
|
|
29
|
-
"& .MuiInputBase-input": Object.assign(Object.assign({}, (padding ? { padding } : {})), (typo !== null && typo !== void 0 ? typo : {})),
|
|
30
|
-
"& textarea.MuiInputBase-input": Object.assign(Object.assign({}, (padding ? { padding } : {})), (typo !== null && typo !== void 0 ? typo : {})),
|
|
30
|
+
"& .MuiInputBase-input": Object.assign(Object.assign({ margin: marginField }, (padding ? { padding } : {})), (typo !== null && typo !== void 0 ? typo : {})),
|
|
31
|
+
"& textarea.MuiInputBase-input": Object.assign(Object.assign({ margin: marginField }, (padding ? { padding } : {})), (typo !== null && typo !== void 0 ? typo : {})),
|
|
31
32
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
32
33
|
borderColor,
|
|
33
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldStyle.js","sourceRoot":"","sources":["../../src/style/TextFieldStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAkB,MAAM,sBAAsB,CAAC;AAG9D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE;IAC/C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,YAAY;QACZ,oBAAoB;QACpB,WAAW;QACX,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;QACX,aAAa;QACb,SAAS;QACT,MAAM;QACN,QAAQ;
|
|
1
|
+
{"version":3,"file":"TextFieldStyle.js","sourceRoot":"","sources":["../../src/style/TextFieldStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAkB,MAAM,sBAAsB,CAAC;AAG9D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE;IAC/C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,YAAY;QACZ,oBAAoB;QACpB,WAAW;QACX,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;QACX,aAAa;QACb,SAAS;QACT,MAAM;QACN,QAAQ;QACR,aAAa;KACd,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAeA,CAAC,EACC,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,W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