import React, { Component } from 'react'; import { DropResult } from 'react-beautiful-dnd'; import { InjectedIntl } from 'react-intl'; import './DragList.less'; interface OptionData { id: string; code: string; enabled: boolean; status: string; tempKey: string; value: string; } interface Props { disabled: boolean; data: Array; onChange?: (data: Array, status?: string) => void; onEdit?: (key: any, code: string, value: string) => void; onInvalid?: (key: any) => void; onActive?: (key: any) => void; onCreate?: (code: string, value: string) => void; onDelete?: (key: any) => void; formatMessage: InjectedIntl['formatMessage']; title?: string; tips: React.ReactNode; } interface StateProps { addItemVisible: boolean; tempKey: boolean | string; value: string; code: string; saveDisabled: boolean; } declare class DragList extends Component { constructor(props: Props); /** * 拖动完成时触发 * @param result */ onDragEnd: (result: DropResult) => void; onDragStart: () => void; /** * 排序 * @param list * @param startIndex * @param endIndex * @returns {Array} */ reorder: (list: Array, startIndex: number, endIndex: number) => OptionData[]; addItem: () => void; editItem: (tempKey: any) => void; edit: (tempKey: any) => void; invalid: (tempKey: any) => void; active: (tempKey: any) => void; create: () => void; remove: (tempKey: any) => void; cancel: () => void; onValueChange: (value: any) => void; onCodeChange: (v: string) => void; renderItem: ({ index, style, provided, isDragging, state, }: any) => JSX.Element; rowRenderer: ({ index, style, state }: any) => JSX.Element; render(): JSX.Element; } export default DragList;