vben
authored
|
1
|
import type { PropType, CSSProperties } from 'vue';
|
Vben
authored
|
2
|
import type { ModalWrapperProps } from './typing';
|
vben
authored
|
3
|
import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
|
vben
authored
|
4
|
import { useI18n } from '/@/hooks/web/useI18n';
|
Vben
authored
|
5
|
|
vben
authored
|
6
|
const { t } = useI18n();
|
vben
authored
|
7
|
|
|
8
|
export const modalProps = {
|
Vben
authored
|
9
10
11
12
|
visible: { type: Boolean },
scrollTop: { type: Boolean, default: true },
height: { type: Number },
minHeight: { type: Number },
|
|
13
|
// open drag
|
Vben
authored
|
14
15
16
17
|
draggable: { type: Boolean, default: true },
centered: { type: Boolean },
cancelText: { type: String, default: t('common.cancelText') },
okText: { type: String, default: t('common.okText') },
|
vben
authored
|
18
|
|
|
19
20
21
22
|
closeFunc: Function as PropType<() => Promise<boolean>>,
};
export const basicProps = Object.assign({}, modalProps, {
|
Vben
authored
|
23
|
defaultFullscreen: { type: Boolean },
|
|
24
|
// Can it be full screen
|
Vben
authored
|
25
|
canFullscreen: { type: Boolean, default: true },
|
|
26
|
// After enabling the wrapper, the bottom can be increased in height
|
Vben
authored
|
27
|
wrapperFooterOffset: { type: Number, default: 0 },
|
|
28
29
|
// Warm reminder message
helpMessage: [String, Array] as PropType<string | string[]>,
|
vben
authored
|
30
|
// Whether to setting wrapper
|
Vben
authored
|
31
32
33
|
useWrapper: { type: Boolean, default: true },
loading: { type: Boolean },
loadingTip: { type: String },
|
|
34
35
36
|
/**
* @description: Show close button
*/
|
Vben
authored
|
37
|
showCancelBtn: { type: Boolean, default: true },
|
|
38
39
40
|
/**
* @description: Show confirmation button
*/
|
Vben
authored
|
41
|
showOkBtn: { type: Boolean, default: true },
|
|
42
|
|
vben
authored
|
43
|
wrapperProps: Object as PropType<Partial<ModalWrapperProps>>,
|
|
44
|
|
vben
authored
|
45
|
afterClose: Function as PropType<() => Promise<VueNode>>,
|
|
46
|
|
vben
authored
|
47
|
bodyStyle: Object as PropType<CSSProperties>,
|
|
48
|
|
Vben
authored
|
49
|
closable: { type: Boolean, default: true },
|
|
50
|
|
vben
authored
|
51
|
closeIcon: Object as PropType<VueNode>,
|
|
52
|
|
Vben
authored
|
53
|
confirmLoading: { type: Boolean },
|
|
54
|
|
Vben
authored
|
55
|
destroyOnClose: { type: Boolean },
|
|
56
|
|
vben
authored
|
57
|
footer: Object as PropType<VueNode>,
|
|
58
59
60
|
getContainer: Function as PropType<() => any>,
|
Vben
authored
|
61
|
mask: { type: Boolean, default: true },
|
|
62
|
|
Vben
authored
|
63
64
|
maskClosable: { type: Boolean, default: true },
keyboard: { type: Boolean, default: true },
|
|
65
|
|
vben
authored
|
66
|
maskStyle: Object as PropType<CSSProperties>,
|
|
67
|
|
Vben
authored
|
68
|
okType: { type: String, default: 'primary' },
|
|
69
|
|
vben
authored
|
70
|
okButtonProps: Object as PropType<ButtonProps>,
|
|
71
|
|
vben
authored
|
72
|
cancelButtonProps: Object as PropType<ButtonProps>,
|
|
73
|
|
Vben
authored
|
74
|
title: { type: String },
|
|
75
|
|
Vben
authored
|
76
|
visible: { type: Boolean },
|
|
77
78
79
|
width: [String, Number] as PropType<string | number>,
|
Vben
authored
|
80
|
wrapClassName: { type: String },
|
|
81
|
|
Vben
authored
|
82
|
zIndex: { type: Number },
|
|
83
|
});
|