@oceanbase/ui
Version:
The UI library based on OceanBase Design
163 lines (162 loc) • 4 kB
TypeScript
import type { BadgeProps } from '@oceanbase/design/es/badge/index';
import type { TooltipPropsWithTitle } from '@oceanbase/design/es/tooltip/index';
import React from 'react';
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
import './index.less';
export type SideTipType = 'primary' | 'default';
export type SideTipSize = 'small' | 'default';
export interface Position {
/**
* @title 距离右侧
* @description 设置悬浮按钮距离右侧边框的像素距离
* @default "32"
*/
right?: number;
/**
* @title 距离底部
* @description 设置悬浮按钮距离底部边框的像素距离
* @default "32"
*/
bottom?: number;
}
export interface SideTipProps extends LocaleWrapperProps {
/**
* @description 自定义前缀
* @ignore
*/
prefix?: string;
/**
* @title 按钮类型
* @description 按钮类型
*/
type?: SideTipType;
/**
* @title 按钮尺寸
* @description 按钮尺寸
*/
size?: SideTipSize;
/**
* @title icon 地址
* @description icon地址,可以设置图片地址或 ReactNode
*/
icon?: string | React.ReactNode;
/**
* @title 指定是否打开
* @description 指定是否打开
* @default false
*/
open?: boolean;
/**
* @title 指定是否打开
* @description 指定是否打开
* @default false
* @deprecated
*/
visible?: boolean;
/**
* @title 加载中
* @description 指定是否loading
*/
loading?: boolean;
/**
* @title 是否可隐藏
* @description 是否可隐藏
* @default true
*/
hideable?: boolean;
/**
* @title 组件 ID
* @description 若页面中有多个侧边提示组件,则通过 id 标识当前组件,用于缓存侧边提示组件是否隐藏配置
*/
id?: string;
/**
* @description style 属性
* @ignore
*/
style?: React.CSSProperties;
/**
* @description className
* @ignore
*/
className?: string;
/**
* @title 按钮 style 属性
* @description 按钮的 style 属性
*/
buttonStyle?: React.CSSProperties;
/**
* @title 按钮的 className 属性
* @description 按钮的 className 属性
*/
buttonClassName?: string;
/**
* @title 徽标属性
* @description 徽标属性,详见antd [badge](https://ant.design/components/badge-cn/#API)属性
*/
badge?: BadgeProps;
/**
* @title ToolTip 相关属性
* @description ToolTip 相关属性
*/
tooltip?: TooltipPropsWithTitle;
/**
* @title 默认是否隐藏
* @description 按钮默认是否隐藏
* @default false
*/
defaultHide?: boolean;
/**
* @title 初始位置
* @description 初始位置
*/
position?: Position;
/**
* @description 点击气泡事件
*/
onClick?: (e: any) => void;
/**
* @description 开始拖动
*/
onDragStart?: () => void;
/**
* @description 结束拖动
*/
onDragEnd?: () => void;
/**
* @description 正在拖动
*/
onDrag?: (offset: any) => void;
/**
* 鼠标移入事件
*/
onMouseEnter?: (e: MouseEvent) => void;
/**
* 鼠标离开事件
*/
onMouseLeave?: (e: MouseEvent) => void;
/**
* @title 不可用
* @description 不可用
* @default false
*/
disabled?: boolean;
/**
* @title 返回气泡弹出所在的容器
* @description 返回气泡弹出所在的容器
* @default "() => document.body"
*/
getPopupContainer?: () => HTMLElement;
children?: any;
/**
* @title 是否可拖拽
* @description 是否可拖拽
* @default true
*/
draggable?: boolean;
}
export interface SideTipState {
hide?: boolean;
hovered?: boolean;
}
declare const _default: any;
export default _default;