import type { ExtractPropTypes } from 'vue'; import PropTypes from '../_util/vue-types'; import type { MouseEventHandler } from '../_util/EventInterface'; import { stringType, booleanType, functionType, objectType } from '../_util/type'; import type { BadgeProps } from '../badge'; export type FloatButtonType = 'default' | 'primary'; export type FloatButtonShape = 'circle' | 'square'; export type FloatButtonGroupTrigger = 'click' | 'hover'; export type FloatButtonBadgeProps = Omit; export const floatButtonProps = () => { return { prefixCls: String, description: PropTypes.any, type: stringType('default'), shape: stringType('circle'), tooltip: PropTypes.any, href: String, target: functionType<() => Window | HTMLElement | null>(), badge: objectType(), onClick: functionType(), }; }; export type FloatButtonProps = Partial>>; export const floatButtonContentProps = () => { return { prefixCls: stringType(), }; }; export type FloatButtonContentProps = Partial< ExtractPropTypes> >; export const floatButtonGroupProps = () => { return { ...floatButtonProps(), // 包含的 Float Button // 触发方式 (有触发方式为菜单模式) trigger: stringType(), // 受控展开 open: booleanType(), // 展开收起的回调 onOpenChange: functionType<(open: boolean) => void>(), 'onUpdate:open': functionType<(open: boolean) => void>(), }; }; export type FloatButtonGroupProps = Partial< ExtractPropTypes> >; export const backTopProps = () => { return { ...floatButtonProps(), prefixCls: String, duration: Number, target: functionType<() => HTMLElement | Window | Document>(), visibilityHeight: Number, onClick: functionType(), }; }; export type BackTopProps = Partial>>;