@ssplib/react-components 0.0.334 → 0.0.335

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.
@@ -1,21 +1,41 @@
1
+ import { GridProps, InputLabelProps, TextFieldProps } from '@mui/material';
1
2
  import React from 'react';
2
- type InputType = 'cnpj' | 'cpf' | 'input' | 'email' | 'cpf_cnpj' | 'phone' | 'number' | 'rg' | 'password' | 'cep' | 'sei';
3
- interface InputProps {
3
+ type HTMLInputType = React.InputHTMLAttributes<HTMLInputElement>['type'];
4
+ export type MaskedInputType = 'cnpj' | 'cpf' | 'cpf_cnpj' | 'phone' | 'number' | 'rg' | 'cep' | 'sei';
5
+ export type InputType = MaskedInputType | HTMLInputType;
6
+ type OmittedTextFieldProps = 'name' | 'type' | 'value' | 'onChange' | 'error' | 'helperText' | 'fullWidth' | 'size' | 'placeholder';
7
+ interface InputOwnProps {
8
+ /** Tipo do campo - define máscara e validação */
4
9
  type?: InputType;
10
+ /** Nome do campo no formulário (obrigatório) */
5
11
  name: string;
12
+ /** Label exibido acima do campo */
6
13
  title?: string;
14
+ /** Campo obrigatório */
7
15
  required?: boolean;
16
+ /** Máscara customizada para type="number" */
8
17
  numberMask?: string;
18
+ /** Placeholder customizado (sobrescreve title) */
9
19
  customPlaceholder?: string;
20
+ /** Valor inicial do campo */
10
21
  defaultValue?: string;
22
+ /** Tamanho mínimo para validação (type="input") */
11
23
  inputMinLength?: number;
24
+ /** Tamanho máximo para validação (type="input") */
12
25
  inputMaxLength?: number;
13
- xs?: number;
14
- sm?: number;
15
- md?: number;
16
- disabled?: boolean;
26
+ /** Validação customizada */
17
27
  customValidate?: (value: string, form: Record<string, any>) => string | undefined;
28
+ /** Props do Grid container */
29
+ gridProps?: Omit<GridProps, 'item' | 'xs' | 'sm' | 'md'>;
30
+ /** Props do InputLabel */
31
+ labelProps?: Omit<InputLabelProps, 'required'>;
18
32
  }
19
- export declare function Input({ type, numberMask, xs, sm, md, inputMinLength, inputMaxLength, defaultValue, disabled, name, title, required, customPlaceholder, customValidate, }: InputProps): JSX.Element;
33
+ interface GridLayoutProps {
34
+ xs?: GridProps['xs'];
35
+ sm?: GridProps['sm'];
36
+ md?: GridProps['md'];
37
+ }
38
+ export type InputProps = InputOwnProps & GridLayoutProps & Omit<TextFieldProps, OmittedTextFieldProps | keyof InputOwnProps>;
39
+ export declare function Input({ type, name, title, required, numberMask, customPlaceholder, defaultValue, inputMinLength, inputMaxLength, customValidate, xs, sm, md, gridProps, labelProps, disabled, sx, InputProps: inputPropsFromUser, InputLabelProps: inputLabelPropsFromUser, ...textFieldProps }: InputProps): JSX.Element;
20
40
  declare const _default: React.MemoExoticComponent<typeof Input>;
21
41
  export default _default;