UNPKG

tdesign-react

Version:
31 lines (30 loc) 1.09 kB
import React, { MouseEvent, KeyboardEvent, ReactNode } from 'react'; import { TagInputChangeContext, TagInputValue, TdTagInputProps } from './type'; import { InputValue } from '../input'; import { DragSortInnerProps } from '../hooks/useDragSorter'; export type ChangeParams = [TagInputChangeContext]; interface TagInputProps extends TdTagInputProps, DragSortInnerProps { options?: any[]; } export default function useTagList(props: TagInputProps): { tagValue: TagInputValue; clearAll: (context: { e: MouseEvent<SVGSVGElement>; }) => void; onClose: (p: { e?: MouseEvent<SVGSVGElement>; index: number; }) => void; onInnerEnter: (value: InputValue, context: { e: KeyboardEvent<HTMLInputElement>; }) => void; onInputBackspaceKeyDown: (value: InputValue, context: { e: KeyboardEvent<HTMLInputElement>; }) => void; onInputBackspaceKeyUp: (value: InputValue) => void; renderLabel: ({ displayNode, label }: { displayNode: ReactNode; label: ReactNode; }) => React.JSX.Element[]; }; export {};