@ssplib/react-components 0.0.333 → 0.0.334

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,9 +1,8 @@
1
1
  import React from 'react';
2
- import { IMaskConfig } from './MaskInput';
3
- export declare function Input({ type, numberMask, xs, sm, inputMinLength, inputMaxLength, defaultValue, md, disabled, watchValue, ...props }: {
4
- type: 'cnpj' | 'cpf' | 'input' | 'email' | 'cpf_cnpj' | 'phone' | 'input' | 'number' | 'rg' | 'password' | 'cep' | 'sei';
2
+ type InputType = 'cnpj' | 'cpf' | 'input' | 'email' | 'cpf_cnpj' | 'phone' | 'number' | 'rg' | 'password' | 'cep' | 'sei';
3
+ interface InputProps {
4
+ type?: InputType;
5
5
  name: string;
6
- watchValue?: string;
7
6
  title?: string;
8
7
  required?: boolean;
9
8
  numberMask?: string;
@@ -15,8 +14,8 @@ export declare function Input({ type, numberMask, xs, sm, inputMinLength, inputM
15
14
  sm?: number;
16
15
  md?: number;
17
16
  disabled?: boolean;
18
- imaskConfig?: IMaskConfig;
19
- customValidate?: (value: string, form: any) => string | undefined;
20
- }): JSX.Element;
17
+ customValidate?: (value: string, form: Record<string, any>) => string | undefined;
18
+ }
19
+ export declare function Input({ type, numberMask, xs, sm, md, inputMinLength, inputMaxLength, defaultValue, disabled, name, title, required, customPlaceholder, customValidate, }: InputProps): JSX.Element;
21
20
  declare const _default: React.MemoExoticComponent<typeof Input>;
22
21
  export default _default;
@@ -1,11 +1,14 @@
1
1
  import React from 'react';
2
2
  import { IMaskInput } from 'react-imask';
3
3
  export type IMaskConfig = Partial<React.ComponentProps<typeof IMaskInput>>;
4
- export default function MaskInput(props: {
5
- formConfig: object;
4
+ interface MaskInputProps {
5
+ formConfig: {
6
+ name: string;
7
+ } & Record<string, any>;
6
8
  defaultValue?: string;
7
9
  disabled?: boolean;
8
- watchValue?: string;
9
- onMask?: (value: string, setMask: React.Dispatch<React.SetStateAction<string>>) => void;
10
- imaskConfig?: IMaskConfig;
11
- }): JSX.Element;
10
+ imaskConfig: IMaskConfig;
11
+ onMaskChange?: (value: string, setMask: React.Dispatch<React.SetStateAction<IMaskConfig['mask']>>) => void;
12
+ }
13
+ export default function MaskInput({ formConfig, disabled, imaskConfig, onMaskChange }: MaskInputProps): JSX.Element;
14
+ export {};