/** * @author Hanz * @date 2022/1/12 下午1:16 * @description tag group */ import React, { FunctionComponent } from 'react'; import { TagProps } from './index'; import './index.scss'; interface TagItem extends Omit { /** * label */ label: string; /** * value */ value: string; } type Item = string | number; export interface TagGroupProps { /** * cls */ className?: string; /** * 添加输入框的样式 */ inputClassName?: string; /** * 添加输入框的宽度 */ inputWidth?: number; /** * 样式 */ style?: React.CSSProperties; /** * 大小 */ size?: 'small' | 'large'; /** * input 默认值 */ defaultInputValue?: string; /** * 动态添加 */ increased?: boolean; /** * 动态添加按钮 increased 为true 有效 */ increasedTag?: { /** 图标 */ icon?: React.ReactNode; /** 文字 */ text?: string; }; /** * 组数据源 */ data?: TagItem[] | Item[]; /** 下边距 默认8px */ marginBottom?: string; /** 右边距 默认8px */ marginRight?: string; /** * onchange * @param tagData * @param value */ onChange?: (tagData: TagItem[], value: string[]) => void; } declare const TagGroup: FunctionComponent; export default TagGroup;