import { CSSProperties, ReactNode } from 'react'; /** * Tabbar 数据源项类型 */ export interface TabbarDataSource { /** 唯一标识 */ id: string | number; /** 店铺ID */ shop_id?: number; /** 父级ID */ parent_id?: number; /** 显示名称 */ name: string; /** URL slug */ slug?: string; /** 图标 URL 或图标名称 */ icon?: string; /** 子级数据 */ children?: TabbarDataSource[]; /** 自定义点击事件标识 */ customClick?: boolean; /** 唯一 key */ key?: string; } /** * 层级配置 */ export interface TabbarLevelConfig { /** SuperTabs 背景色 */ superTabsBg: string; /** 卡片宽度 */ cardWidth: number; /** 卡片高度 */ cardHeight: number; /** 左侧缩进 */ paddingLeft?: number; } /** * 展开配置 */ export interface ExpandConfig { /** 激活状态配置 */ active: { icon: string; text: string; }; /** 未激活状态配置 */ inactive: { icon: string; text: string; }; } /** * 展开状态 */ export interface ExpandState { level1: boolean; level2: boolean; level3: boolean; } /** * 层级类型 */ export declare type LevelType = 'level1' | 'level2' | 'level3'; /** * TabbarLevel 组件属性 */ export interface TabbarLevelProps { /** SKU ID */ skuId: string; /** 数据源 */ dataSource: TabbarDataSource[]; /** 当前激活的面板 key */ activePanelKey: string | number; /** 层级 */ level: LevelType; /** 设置激活面板 key */ setActivePanelKey: (key: string | number, item?: TabbarDataSource) => void; /** 是否展开 */ expand: boolean; /** 展开处理函数 */ handleExpand: () => void; /** 渲染子级内容 */ renderChildren?: (panelProps: any) => ReactNode; /** 层级配置 */ levelConfig?: TabbarLevelConfig; /** 展开配置 */ expandConfig?: ExpandConfig; } /** * PisellTabbar 组件属性 */ export interface PisellTabbarProps { /** 数据源 */ dataSource?: TabbarDataSource[]; /** 当前选中的值(多层级 key 数组) */ value?: (string | number)[]; /** 值变化回调 */ onChange?: (value: (string | number)[]) => void; /** 自定义类名 */ className?: string; /** 自定义样式 */ style?: CSSProperties; /** 层级配置(可按层级自定义) */ levelConfig?: Partial>>; /** 展开配置 */ expandConfig?: ExpandConfig; /** 最大层级数 */ maxLevel?: 1 | 2 | 3; __designMode?: boolean; }