mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-02 09:08:52 +08:00
* feat: export all types related to components fix(tooltip): fix the vertical offset of the arrow * refactor: optimize events of all popup related components * test: append testcases for popup base component * test: add testcase for visible events * test: update snapshots
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import React from 'react'
|
|
import { NormalTypes } from '../utils/prop-types'
|
|
|
|
export type InputTypes = NormalTypes
|
|
export interface Props {
|
|
value?: string
|
|
initialValue?: string
|
|
placeholder?: string
|
|
type?: InputTypes
|
|
hymlType?: string
|
|
readOnly?: boolean
|
|
disabled?: boolean
|
|
label?: string
|
|
labelRight?: string
|
|
icon?: React.ReactNode
|
|
iconRight?: React.ReactNode
|
|
iconClickable?: boolean
|
|
className?: string
|
|
clearable?: boolean
|
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
onClearClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void
|
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void
|
|
onIconClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
|
autoComplete?: string
|
|
}
|
|
|
|
export const defaultProps = {
|
|
disabled: false,
|
|
readOnly: false,
|
|
clearable: false,
|
|
iconClickable: false,
|
|
type: 'default' as InputTypes,
|
|
htmlType: 'text',
|
|
autoComplete: 'off',
|
|
className: '',
|
|
placeholder: '',
|
|
initialValue: '',
|
|
}
|