Skip to content

Commit

Permalink
chore: add and organize typings
Browse files Browse the repository at this point in the history
  • Loading branch information
HederAlves committed Nov 1, 2023
1 parent fa208bf commit 8a9655b
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions src/core/inputs/mask-field/index.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
import React, { ChangeEvent } from 'react'
import TextField from '@/core/inputs/text-field'
import TextField, { IOption } from '@/core/inputs/text-field'
import { NumericFormatProps, NumberFormatBase } from 'react-number-format'
import { FormatInputValueFunction } from 'react-number-format/types/types'

export interface MaskFieldProps extends NumericFormatProps {
children?: React.ReactNode
error?: boolean
value?: number | string
style?: React.CSSProperties
margin?: string
id?: string
showEdit?: boolean
hasClear?: boolean
autoFocus?: boolean
multiline?: boolean
select?: boolean
fullWidth?: boolean
required?: boolean
disabled?: boolean
InputProps?: object
inputProps?: object
InputLabelProps?: object
placeholder?: string
label?: string
defaultValue?: string | number
fixedDecimalScale?: boolean
thousandSeparator?: boolean | string
margin?: string
id?: string
name?: string
mask?: string
type?: 'text' | 'tel' | 'password'
placeholder?: string
label?: string
autoComplete?: string
decimalSeparator?: string
format?: string | FormatInputValueFunction
defaultValue?: string | number
value?: string | number
rows?: string | number
rowsMax?: string | number
decimalScale?: number
thousandSeparator?: boolean | string
fixedDecimalScale?: boolean
SelectProps?: object
InputProps?: object
inputProps?: object
InputLabelProps?: object
options?: IOption[] | string
children?: React.ReactNode
helperText?: React.ReactNode
helperIcon?: React.ReactNode
style?: React.CSSProperties
inputRef?: React.Ref<HTMLInputElement>
type?: 'text' | 'tel' | 'password'
variant?: 'standard' | 'outlined' | 'filled'
color?: 'primary' | 'secondary' | undefined
customInput?: React.ComponentType
onClear?: () => void
onBlur?: () => void
onHelperClick?: () => void
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
customInput?: React.ComponentType
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void
onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void
}

export const MaskField = (props: MaskFieldProps) => {
Expand Down

0 comments on commit 8a9655b

Please sign in to comment.