ant-design-vue/components/tooltip/abstractTooltipProps.ts

54 lines
2.0 KiB
TypeScript
Raw Normal View History

import type { CSSProperties, PropType } from 'vue';
import type { AlignType, BuildInPlacements } from '../vc-trigger/interface';
2023-01-30 14:28:00 +00:00
import type { AdjustOverflow } from '../_util/placements';
export type TriggerType = 'hover' | 'focus' | 'click' | 'contextmenu';
2023-01-26 03:13:29 +00:00
import type { PresetColorType } from '../_util/colors';
import type { LiteralUnion } from '../_util/type';
2023-01-30 14:28:00 +00:00
import { objectType } from '../_util/type';
export type TooltipPlacement =
| 'top'
| 'left'
| 'right'
| 'bottom'
| 'topLeft'
| 'topRight'
| 'bottomLeft'
| 'bottomRight'
| 'leftTop'
| 'leftBottom'
| 'rightTop'
| 'rightBottom';
2020-10-18 14:14:39 +00:00
2018-01-15 09:33:34 +00:00
export default () => ({
trigger: [String, Array] as PropType<TriggerType | TriggerType[]>,
2023-01-30 14:28:00 +00:00
open: { type: Boolean, default: undefined },
/** @deprecated Please use `open` instead. */
visible: { type: Boolean, default: undefined },
placement: String as PropType<TooltipPlacement>,
2023-01-26 03:13:29 +00:00
color: String as PropType<LiteralUnion<PresetColorType>>,
transitionName: String,
2023-01-30 14:28:00 +00:00
overlayStyle: objectType<CSSProperties>(),
overlayInnerStyle: objectType<CSSProperties>(),
overlayClassName: String,
openClassName: String,
prefixCls: String,
mouseEnterDelay: Number,
mouseLeaveDelay: Number,
getPopupContainer: Function as PropType<(triggerNode: HTMLElement) => HTMLElement>,
arrowPointAtCenter: { type: Boolean, default: undefined },
autoAdjustOverflow: {
type: [Boolean, Object] as PropType<boolean | AdjustOverflow>,
default: undefined as boolean | AdjustOverflow,
},
destroyTooltipOnHide: { type: Boolean, default: undefined },
2023-01-30 14:28:00 +00:00
align: objectType<AlignType>(),
builtinPlacements: objectType<BuildInPlacements>(),
children: Array,
2023-01-30 14:28:00 +00:00
/** @deprecated Please use `onOpenChange` instead. */
onVisibleChange: Function as PropType<(vis: boolean) => void>,
2023-01-30 14:28:00 +00:00
/** @deprecated Please use `onUpdate:open` instead. */
'onUpdate:visible': Function as PropType<(vis: boolean) => void>,
2023-01-30 14:28:00 +00:00
onOpenChange: Function as PropType<(vis: boolean) => void>,
'onUpdate:open': Function as PropType<(vis: boolean) => void>,
2019-01-12 03:33:27 +00:00
});