/** * @author Hanz * @date 2022/1/11 上午10:15 * @description tag */ import React, { PropsWithChildren } from 'react'; import TagGroup, { TagGroupProps } from './TagGroup'; import './index.scss'; type PresetColorTypes = 'blue' | 'green' | 'yellow' | 'red'; type TagType = 'normal' | 'outline'; export interface TagProps extends React.HTMLAttributes { /** 标签是否描边 */ type?: TagType; /** 颜色 */ color?: string | PresetColorTypes; /** 可关闭 */ closable?: boolean; /** 可编辑 */ editable?: boolean; /** 关闭图标 */ closeIcon?: React.ReactNode; /** 是否显示 */ visible?: boolean; /** onclose */ onClose?: (event: React.MouseEvent) => void; /** onclose */ onEdit?: (event: React.MouseEvent) => void; /** 获取标签宽度 */ getWidth?: (width: number) => void; /** 获取标签宽度 */ tagChange?: (value: string) => void; /** 图标 */ icon?: React.ReactNode; /** 标签最大宽度 */ maxWidth?: number | string; /** cls */ className?: string; /** 大小 */ size?: 'small' | 'large'; /** 编辑输入框样式 */ editInputClassName?: string; /** 编辑输入框宽度 */ editInputWidth?: number; /** 提示最大宽度 */ tipMaxWidth?: number | string; /** 下边距 */ marginBottom?: string; /** 右边距 */ marginRight?: string; } export type TagPropsWithChild = PropsWithChildren; export type { TagGroupProps }; export { TagGroup }; export declare const Tag: React.FC; export default Tag;