/** * @author Hanz * @date 2022/5/30 上午9:59 * @description tabs */ import React, { FC, ReactNode } from 'react'; import { TabPane, TabsProps as RcTabsProps, TabPaneProps } from 'rc-tabs'; import { PopConfirmProps } from '../PopConfirm'; import { HelpProps } from '../Help'; import { TooltipProps } from '../Tooltip'; import './index.scss'; export type TabsType = 'line' | 'card' | 'editable-card' | 'track' | 'card-container'; export type { TabPaneProps }; export interface TabProps { /** tab text */ label?: ReactNode; /** tab panel */ content?: ReactNode; /** tab key */ value?: any; /** 禁用 */ disabled?: boolean; /** 禁用文案提示 */ disabledTooltip?: TooltipProps; /** 可关闭标签 */ closable?: boolean; /** 显示帮助提示 Help */ showHelp?: boolean; /** help props */ helpProps?: HelpProps; [name: string]: any; } export interface TabsProps extends Omit { /** tabs 类型 */ type?: TabsType; /** 模式:线性、卡片*/ mode?: TabsType; /** 大小 */ size?: 'small' | 'medium' | 'large'; /** 隐藏添加图标 */ hideAdd?: boolean; /** 标签居中展示 */ centered?: boolean; /** 添加图标 */ addIcon?: ReactNode; /** 编辑标签 */ editable?: boolean; /** 显示添加图标 */ showAdd?: boolean; /**显示 popconfirm,editable 为true 有效*/ showPopConfirm?: boolean; /** popConfirm props*/ popConfirmProps?: PopConfirmProps; /** 数据列表*/ data?: TabProps[]; /** 选中的 value*/ value?: any; /** 是否开启单选 */ radio?: boolean; /** 单选值 */ radioValue?: any; /** 默认单选值 */ defaultRadioValue?: any; /** 线性选项卡导航栏主轴是否具有间距,开启为20px间距,关闭为0间距,默认开启 */ navWithPadding?: boolean; /** 单选值切换的回调 */ onRadioChange?: (radioValue: any) => void; /** 新增按钮回调 showAdd 为 true 时有效*/ onAdd?: (e?: React.MouseEvent) => void; /** 切换标签页的回调 */ onChange?: (activeKey: any, item?: TabProps) => void; /** 新增和删除页签的回调 */ onEdit?: (item: TabProps, e?: React.MouseEvent | React.KeyboardEvent | string, action?: 'add' | 'remove') => void; [name: string]: any; } export declare const Tabs: FC; type mergedTabs = typeof Tabs & { TabPane: typeof TabPane; }; declare const _default: mergedTabs; export default _default;