jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
105 lines (104 loc) • 2.33 kB
TypeScript
import type { RendererProps, ThemeProps } from 'jamis-core';
import type { BaseSchema, SchemaIcon, SchemaUrlPath } from '../types';
export type ItemPlace = 'start' | 'middle' | 'end';
export type TooltipPositionType = 'top' | 'bottom' | 'left' | 'right';
export interface BreadcrumbBaseItem {
href?: string;
icon?: string;
label?: string;
dropdown?: Array<BreadcrumbBaseItem>;
}
export interface BreadcrumbItemProps {
item: BreadcrumbBaseItem;
itemPlace: ItemPlace;
labelMaxLength?: number;
tooltipContainer?: any;
tooltipPosition?: TooltipPositionType;
[propName: string]: any;
}
export interface BreadcrumbCompProps extends ThemeProps {
tooltipContainer?: any;
tooltipPosition?: TooltipPositionType;
items: Array<BreadcrumbBaseItem>;
[propName: string]: any;
}
export interface BreadcrumbItemDropDown extends Omit<BaseSchema, 'type'> {
/**
* 文字
*/
label?: string;
/**
* 图标类名
*/
icon?: SchemaIcon;
/**
* 链接地址
*/
href?: SchemaUrlPath;
}
export interface BreadcrumbItemSchema extends Omit<BaseSchema, 'type'> {
/**
* 文字
*/
label?: string;
/**
* 图标类名
*/
icon?: SchemaIcon;
/**
* 链接地址
*/
href?: SchemaUrlPath;
/**
* 下拉菜单
*/
dropdown?: Array<BreadcrumbItemDropDown>;
}
/**
* Breadcrumb 显示渲染器
*
*/
export interface BreadcrumbSchema extends BaseSchema {
/**
* 指定为面包屑显示控件
*/
type: 'breadcrumb';
/**
* 面包项类名
*/
itemClassName?: string;
/**
* 分隔符
*/
separator?: string;
/**
* 分隔符类名
*/
separatorClassName?: string;
/**
* 下拉菜单类名
*/
dropdownClassName?: string;
/**
* 下拉菜单项类名
*/
dropdownItemClassName?: string;
/**
* 列表
*/
items?: Array<BreadcrumbItemSchema>;
/**
* labelMaxLength
*/
labelMaxLength?: number;
/**
* 浮窗提示位置
*/
tooltipPosition?: TooltipPositionType;
/**
* 可用来通过 API 拉取 options。
*/
source?: string;
}
export interface BreadcrumbProps extends RendererProps, Omit<BreadcrumbSchema, 'type' | 'className'> {
}