forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.ts
58 lines (48 loc) · 1.7 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { Point, AlignType, StretchType, MobileConfig } from '../interface';
import type { ExtractPropTypes, PropType } from 'vue';
export const innerProps = {
visible: Boolean,
prefixCls: String,
zIndex: Number,
destroyPopupOnHide: Boolean,
forceRender: Boolean,
// Legacy Motion
animation: [String, Object],
transitionName: String,
// Measure
stretch: { type: String as PropType<StretchType> },
// Align
align: { type: Object as PropType<AlignType> },
point: { type: Object as PropType<Point> },
getRootDomNode: { type: Function as PropType<() => HTMLElement> },
getClassNameFromAlign: { type: Function as PropType<(align: AlignType) => string> },
onAlign: {
type: Function as PropType<(popupDomNode: HTMLElement, align: AlignType) => void>,
},
onMouseenter: { type: Function as PropType<(align: MouseEvent) => void> },
onMouseleave: { type: Function as PropType<(align: MouseEvent) => void> },
onMousedown: { type: Function as PropType<(align: MouseEvent) => void> },
onTouchstart: { type: Function as PropType<(align: MouseEvent) => void> },
};
export type PopupInnerProps = Partial<ExtractPropTypes<typeof innerProps>> & {
align?: AlignType;
};
export const mobileProps = {
...innerProps,
mobile: { type: Object as PropType<MobileConfig> },
};
export type MobilePopupProps = Partial<ExtractPropTypes<typeof mobileProps>> & {
align?: AlignType;
mobile: MobileConfig;
};
export const popupProps = {
...innerProps,
mask: Boolean,
mobile: { type: Object as PropType<MobileConfig> },
maskAnimation: String,
maskTransitionName: String,
};
export type PopupProps = Partial<ExtractPropTypes<typeof popupProps>> & {
align?: AlignType;
mobile: MobileConfig;
};