Blame view

src/components/Modal/src/props.ts 2.33 KB
1
import type { PropType, CSSProperties } from 'vue';
2
import type { ModalWrapperProps } from './typing';
3
import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
vben authored
4
import { useI18n } from '/@/hooks/web/useI18n';
5
6
const { t } = useI18n();
vben authored
7
陈文彬 authored
8
export const modalProps = {
9
10
11
12
  visible: { type: Boolean },
  scrollTop: { type: Boolean, default: true },
  height: { type: Number },
  minHeight: { type: Number },
陈文彬 authored
13
  // open drag
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
陈文彬 authored
19
20
21
22
  closeFunc: Function as PropType<() => Promise<boolean>>,
};

export const basicProps = Object.assign({}, modalProps, {
23
  defaultFullscreen: { type: Boolean },
陈文彬 authored
24
  // Can it be full screen
25
  canFullscreen: { type: Boolean, default: true },
陈文彬 authored
26
  // After enabling the wrapper, the bottom can be increased in height
27
  wrapperFooterOffset: { type: Number, default: 0 },
陈文彬 authored
28
29
  // Warm reminder message
  helpMessage: [String, Array] as PropType<string | string[]>,
vben authored
30
  // Whether to setting wrapper
31
32
33
  useWrapper: { type: Boolean, default: true },
  loading: { type: Boolean },
  loadingTip: { type: String },
陈文彬 authored
34
35
36
  /**
   * @description: Show close button
   */
37
  showCancelBtn: { type: Boolean, default: true },
陈文彬 authored
38
39
40
  /**
   * @description: Show confirmation button
   */
41
  showOkBtn: { type: Boolean, default: true },
陈文彬 authored
42
43
  wrapperProps: Object as PropType<Partial<ModalWrapperProps>>,
陈文彬 authored
44
45
  afterClose: Function as PropType<() => Promise<VueNode>>,
陈文彬 authored
46
47
  bodyStyle: Object as PropType<CSSProperties>,
陈文彬 authored
48
49
  closable: { type: Boolean, default: true },
陈文彬 authored
50
51
  closeIcon: Object as PropType<VueNode>,
陈文彬 authored
52
53
  confirmLoading: { type: Boolean },
陈文彬 authored
54
55
  destroyOnClose: { type: Boolean },
陈文彬 authored
56
57
  footer: Object as PropType<VueNode>,
陈文彬 authored
58
59
60

  getContainer: Function as PropType<() => any>,
61
  mask: { type: Boolean, default: true },
陈文彬 authored
62
63
64
  maskClosable: { type: Boolean, default: true },
  keyboard: { type: Boolean, default: true },
陈文彬 authored
65
66
  maskStyle: Object as PropType<CSSProperties>,
陈文彬 authored
67
68
  okType: { type: String, default: 'primary' },
陈文彬 authored
69
70
  okButtonProps: Object as PropType<ButtonProps>,
陈文彬 authored
71
72
  cancelButtonProps: Object as PropType<ButtonProps>,
陈文彬 authored
73
74
  title: { type: String },
陈文彬 authored
75
76
  visible: { type: Boolean },
陈文彬 authored
77
78
79

  width: [String, Number] as PropType<string | number>,
80
  wrapClassName: { type: String },
陈文彬 authored
81
82
  zIndex: { type: Number },
陈文彬 authored
83
});