UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

35 lines (34 loc) 1.35 kB
import type { ClassValue, Option } from 'jamis-core'; import React from 'react'; import type { ResultBoxProps } from '../types'; interface ResultBoxState { isFocused: boolean; } /** * 包装了输入框和单选/多选标签的强化输入组件 */ export declare class ResultBox extends React.Component<ResultBoxProps, ResultBoxState> { static defaultProps: Partial<ResultBoxProps>; inputRef: React.RefObject<HTMLInputElement>; constructor(props: ResultBoxProps); componentDidMount(): void; componentDidUpdate(): void; focus(): void; blur(): void; clearValue: (e: React.MouseEvent<any>) => void; handleFocus(e: any): void; handleBlur(e: any): void; removeItem: (e: React.MouseEvent<HTMLElement>) => void; handleChange(e: React.ChangeEvent<HTMLInputElement>): void; /** * 计算input里的placeholder, 在单选情况下, 要考虑显示选中值的情况 */ calcPlaceholder: (readOnly: boolean) => string; calcSingleValue: (result: Option | string) => string; renderResultValue: (item: any, itemIndex: number, paramClassName?: ClassValue) => JSX.Element; renderMultipeTags(tags: any[]): JSX.Element[]; calcInputValue: (readOnly: boolean) => string | undefined; render(): JSX.Element; } declare const _default: typeof ResultBox; export default _default;