mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-02 09:08:52 +08:00
* feat: added status prop to set color by states test: check status success, warning and error * docs: added playground example and API reference fix: replaced ´_´ as it's not recommended to use fix: removed redundant return refactor: renamed prop from status to type test: update test with the renamed prop * docs: update prop references from status to type fix: status prop not updated to type fix: missing return * fix(select): set icons and hover state to follow the theme * test(slider): update snapshots * chore: always use relative paths when import types Co-authored-by: unix <unix.bio@gmail.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import React from 'react'
|
|
import { NormalSizes, NormalTypes } from '../utils/prop-types'
|
|
|
|
export interface Props {
|
|
value?: string
|
|
initialValue?: string
|
|
placeholder?: string
|
|
size?: NormalSizes
|
|
type?: NormalTypes
|
|
hymlType?: string
|
|
readOnly?: boolean
|
|
disabled?: boolean
|
|
label?: string
|
|
labelRight?: string
|
|
icon?: React.ReactNode
|
|
iconRight?: React.ReactNode
|
|
iconClickable?: boolean
|
|
width?: string
|
|
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,
|
|
width: 'initial',
|
|
size: 'medium' as NormalSizes,
|
|
type: 'default' as NormalTypes,
|
|
htmlType: 'text',
|
|
autoComplete: 'off',
|
|
className: '',
|
|
placeholder: '',
|
|
initialValue: '',
|
|
}
|