ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes';
 
import type { ComputedRef, VNodeChild } from 'vue';
 
import type { ScrollContainerOptions } from '../../container';
 
export interface PopupHeaderProps {
  /**
   * The cancel button props, follow jsx rules
   * @type object
   */
  cancelButtonProps: { on: object; props: ButtonProps };
  /**
   * Text of the Cancel button
   * @default 'cancel'
   * @type string
   */
  cancelText: string;
  /**
   * Whether to apply loading visual effect for OK button or not
   * @default false
   * @type boolean
   */
  confirmLoading: boolean;
  continueButtonProps: { on: object; props: ButtonProps };
  continueLoading?: boolean;
  continueText?: string;
  continueType?: 'danger' | 'dashed' | 'default' | 'ghost' | 'primary';
  helpMessage?: Array<any> | string;
 
  /**
   * The ok button props, follow jsx rules
   * @type object
   */
  okButtonProps: { on: object; props: ButtonProps };
 
  /**
   * Text of the OK button
   * @default 'OK'
   * @type string
   */
  okText: string;
 
  /**
   * Button type of the OK button
   * @default 'primary'
   * @type string
   */
  okType: 'danger' | 'dashed' | 'default' | 'ghost' | 'primary';
  showBackIcon: boolean;
 
  showCancelBtn: boolean;
 
  showContinueBtn: boolean;
  showOkBtn: boolean;
 
  /**
   * The title for Popup.
   * @type any (string | slot)
   */
  title?: JSX.Element | VNodeChild;
}
export interface PopupProps extends PopupHeaderProps {
  class?: string;
  /**
   * Whether a close (x) button is open on top right of the Popup dialog or not.
   * @default true
   * @type boolean
   */
  closable?: boolean;
  closeFunc?: () => Promise<any>;
  defaultFullscreen?: boolean;
  /**
   * Whether to unmount child components on closing popup or not.
   * @default false
   * @type boolean
   */
  destroyOnClose?: boolean;
  /**
   * Return the mounted node for Popup.
   * @default 'body'
   * @type any ( HTMLElement| () => HTMLElement | string)
   */
  getContainer?: () => HTMLElement | string;
  loading?: boolean;
 
  /**
   * Specify a callback that will be called when a user clicks mask, close button or Cancel button.
   */
  onClose?: (e?: Event) => void;
 
  open?: boolean;
 
  /**
   * Built-in ScrollContainer component configuration
   * @type ScrollContainerOptions
   */
  scrollOptions?: ScrollContainerOptions;
 
  triggerWindowResize?: boolean;
 
  /**
   * Width of the Popup dialog.
   * @default 100%
   * @type string | number
   */
  width?: number | string;
 
  /**
   * The z-index of the Popup.
   * @default 1000
   * @type number
   */
  zIndex?: number;
}
export interface PopupActionType {
  getScrollWrap: () => Element | null;
  scrollBottom: () => void;
  scrollTo: (to: number) => void;
}
 
export interface PopupInstance {
  emitOpen?: (open: boolean, uid: number) => void;
  setPopupProps: (props: Partial<PopupProps>) => void;
}
 
export interface PopupReturnMethods extends PopupInstance {
  closePopup: () => void;
  getOpen?: ComputedRef<boolean>;
  openPopup: <T = any>(open?: boolean, data?: T, openOnSet?: boolean) => void;
}
 
export type PopupRegisterFn = (popupInstance: PopupInstance, uuid: string) => void;
 
export interface PopupReturnInnerMethods extends PopupInstance {
  changeContinueLoading: (loading: boolean) => void;
  changeLoading: (loading: boolean) => void;
  changeOkLoading: (loading: boolean) => void;
  closePopup: () => void;
  getOpen?: ComputedRef<boolean>;
}
 
export type UsePopupReturnType = [PopupRegisterFn, PopupReturnMethods];
 
export type UsePopupInnerReturnType = [PopupRegisterFn, PopupReturnInnerMethods];