UNPKG

@ray-js/components

Version:

Ray basic components

96 lines (95 loc) 2.7 kB
import { GenericEvent } from '@ray-js/adapter'; import { BaseProps } from '../types'; import * as React from 'react'; export type InputType = 'text' | 'number' | 'digit' | 'idcard'; export interface InputProps extends BaseProps { /** * @description.en content * @description.zh 内容 * @default undefined */ value?: string; /** * @description.en type * @description.zh 类型 * @default text */ type?: InputType; /** * @description.en is password * @description.zh 是否为密码 * @default false */ password?: boolean; /** * @description.en placeholder * @description.zh 占位内容 * @default undefined */ placeholder?: string; /** * @description.en placeholder * @description.zh 占位符的样式 * @default undefined */ placeholderStyle?: React.CSSProperties | string; /** * @description.en disabled * @description.zh 是否禁用 * @default false */ disabled?: boolean; /** * @description.en Maximum input length. When the value is set to -1, the maximum input length is not limited * @description.zh 最大输入长度,设置为 -1 的时候不限制最大长度 * @default undefined */ maxLength?: number; /** * @description.en Set the text of the button in the lower right corner of the keyboard, effective only when type='text' * @description.zh 设置键盘右下角按钮的文字,仅在type='text'时生效 * @default done */ confirmType?: 'send' | 'search' | 'next' | 'go' | 'done'; /** * @description 输入框内容左侧内容缩进,仅在涂鸦小程序有效 */ indentStart?: string | number; /** * @description 输入框内容右侧内容缩进,仅在涂鸦小程序有效 */ indentEnd?: string | number; /** * @description.en Input events * @description.zh 输入事件 * @default undefined */ onInput?: (event: GenericEvent<{ value: any; }>) => void; /** * @description.en onConfirm * @description.zh 确认事件 * @default undefined */ onConfirm?: (event: GenericEvent<{ value: any; }>) => void; /** * @description.en onFocus * @description.zh 焦点事件 * @default undefined */ onFocus?: (event: GenericEvent<{ value: any; }>) => void; /** * @description.en onBlur * @description.zh 丢焦事件 * @default undefined */ onBlur?: (event: GenericEvent<{ value: any; }>) => void; } export declare const defaultInputProps: Partial<InputProps>;