jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
33 lines (32 loc) • 1.17 kB
TypeScript
/**
* 用来显示选择结果,垂直显示。支持移出、排序等操作。
*/
import React from 'react';
import Sortable from 'sortablejs';
import type { Option, Options } from 'jamis-core';
import type { ResultListProps } from '../types';
interface ResultListState {
searchResult: Options | null;
}
declare function itemRender(option: any): JSX.Element;
export declare class ResultList extends React.Component<ResultListProps, ResultListState> {
static itemRender: typeof itemRender;
static defaultProps: Pick<ResultListProps, 'placeholder' | 'itemRender'>;
state: ResultListState;
cancelSearch?: () => void;
id: string;
sortable?: Sortable;
unmounted: boolean;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
initSortable(): void;
desposeSortable(): void;
handleValueChange(index: number, value: any, name: string): void;
search(inputValue: string): void;
clearSearch(): void;
handleCloseItem(e: React.MouseEvent<HTMLElement>, option: Option): void;
renderNormalList(value?: Options): JSX.Element;
render(): JSX.Element;
}
export default ResultList;