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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes';
 
import type { ComputedRef, CSSProperties, VNodeChild } from 'vue';
 
import type { ScrollContainerOptions } from '../../container';
 
export interface DrawerFooterProps {
  /**
   * 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';
 
  footerHeight: number | 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';
  showCancelBtn: boolean;
 
  showContinueBtn: boolean;
 
  showFooter: boolean;
  showOkBtn: boolean;
}
export interface DrawerProps extends DrawerFooterProps {
  afterOpenChange?: (open?: boolean) => void;
  /**
   * Style of floating layer, typically used for adjusting its position.
   * @type object
   */
  bodyStyle?: CSSProperties;
  class?: string;
  /**
   * Whether a close (x) button is open on top right of the Drawer dialog or not.
   * @default true
   * @type boolean
   */
  closable?: boolean;
  closeFunc?: () => Promise<any>;
  /**
   * Whether to unmount child components on closing drawer or not.
   * @default false
   * @type boolean
   */
  destroyOnClose?: boolean;
  /**
   * Style of the popup layer element
   * @type object
   */
  drawerStyle?: CSSProperties;
  /**
   * Return the mounted node for Drawer.
   * @default 'body'
   * @type any ( HTMLElement| () => HTMLElement | string)
   */
  getContainer?: () => HTMLElement | string;
 
  headerStyle?: CSSProperties;
 
  /**
   * placement is top or bottom, height of the Drawer dialog.
   * @type string | number
   */
  height?: number | string;
 
  isDetail?: boolean;
 
  keyboard?: boolean;
 
  loading?: boolean;
 
  /**
   * Whether to show mask or not.
   * @default true
   * @type boolean
   */
  mask?: boolean;
  /**
   * Clicking on the mask (area outside the Drawer) to close the Drawer or not.
   * @default true
   * @type boolean
   */
  maskClosable?: boolean;
  /**
   * Style for Drawer's mask element.
   * @default {}
   * @type object
   */
  maskStyle?: CSSProperties;
  /**
   * Specify a callback that will be called when a user clicks mask, close button or Cancel button.
   */
  onClose?: (e?: Event) => void;
  open?: boolean;
 
  /**
   * The placement of the Drawer.
   * @default 'right'
   * @type string
   */
  placement?: 'bottom' | 'left' | 'right' | 'top';
 
  rootClassName?: string;
  /**
   * Built-in ScrollContainer component configuration
   * @type ScrollContainerOptions
   */
  scrollOptions?: ScrollContainerOptions;
 
  showDetailBack?: boolean;
 
  /**
   * The title for Drawer.
   * @type any (string | slot)
   */
  title?: JSX.Element | VNodeChild;
 
  triggerWindowResize?: boolean;
 
  /**
   * Width of the Drawer dialog.
   * @default 256
   * @type string | number
   */
  width?: number | string;
  /**
   * The class name of the container of the Drawer dialog.
   * @type string
   */
  wrapClassName?: string;
  /**
   * Style of wrapper element which **contains mask** compare to `drawerStyle`
   * @type object
   */
  wrapStyle?: CSSProperties;
  /**
   * The z-index of the Drawer.
   * @default 1000
   * @type number
   */
  zIndex?: number;
}
export interface DrawerActionType {
  getScrollWrap: () => Element | null;
  scrollBottom: () => void;
  scrollTo: (to: number) => void;
}
 
export interface DrawerInstance {
  emitOpen?: (open: boolean, uid: number) => void;
  setDrawerProps: (props: Partial<DrawerProps>) => void;
}
 
export interface DrawerReturnMethods extends DrawerInstance {
  closeDrawer: () => void;
  getOpen?: ComputedRef<boolean>;
  openDrawer: <T = any>(open?: boolean, data?: T, openOnSet?: boolean) => void;
}
 
export type DrawerRegisterFn = (drawerInstance: DrawerInstance, uuid: string) => void;
 
export interface DrawerReturnInnerMethods extends DrawerInstance {
  changeContinueLoading: (loading: boolean) => void;
  changeLoading: (loading: boolean) => void;
  changeOkLoading: (loading: boolean) => void;
  closeDrawer: () => void;
  getOpen?: ComputedRef<boolean>;
}
 
export type UseDrawerReturnType = [DrawerRegisterFn, DrawerReturnMethods];
 
export type UseDrawerInnerReturnType = [DrawerRegisterFn, DrawerReturnInnerMethods];