fast-element-plus 2.0.19 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -20
- package/CONTRIBUTING.md +3 -4
- package/README.md +80 -27
- package/README.zh.md +66 -27
- package/dist/component.d.ts +110 -110
- package/dist/components/avatar/src/avatar.d.ts +26 -26
- package/dist/components/avatar/src/avatar.mjs +10 -10
- package/dist/components/avatar/src/avatar.mjs.map +1 -1
- package/dist/components/button/src/button.d.ts +32 -27
- package/dist/components/button/src/button.mjs +57 -36
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/carNumber/src/carNumber.d.ts +8 -8
- package/dist/components/carNumber/src/carNumber.mjs +5 -5
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.d.ts +6 -6
- package/dist/components/contextMenu/src/contextMenu.mjs +5 -5
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.type.d.ts +7 -7
- package/dist/components/dialog/src/dialog.d.ts +74 -74
- package/dist/components/dialog/src/dialog.mjs +31 -31
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +57 -57
- package/dist/components/drawer/src/drawer.mjs +24 -24
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/form/src/form.d.ts +30 -30
- package/dist/components/form/src/form.mjs +16 -16
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.d.ts +30 -30
- package/dist/components/form/src/formItem.mjs +13 -13
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/formItemTip/src/formItemTip.d.ts +9 -9
- package/dist/components/formItemTip/src/formItemTip.mjs +3 -3
- package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -1
- package/dist/components/icon/src/icon.d.ts +10 -10
- package/dist/components/icon/src/icon.mjs +4 -4
- package/dist/components/icon/src/icon.mjs.map +1 -1
- package/dist/components/iconSelector/src/iconSelector.d.ts +6 -6
- package/dist/components/iconSelector/src/iconSelector.mjs +4 -4
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +36 -36
- package/dist/components/image/src/image.mjs +11 -11
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +37 -37
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +16 -16
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +12 -12
- package/dist/components/layoutGrid/src/layoutGrid.mjs +6 -6
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.d.ts +18 -18
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +8 -8
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +88 -88
- package/dist/components/select/src/select.mjs +28 -28
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.d.ts +13 -13
- package/dist/components/select/src/selectOption.mjs +6 -6
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +78 -84
- package/dist/components/selectPage/src/selectPage.mjs +49 -35
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/index.mjs +2 -1
- package/dist/components/selectV2/index.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +160 -851
- package/dist/components/selectV2/src/selectV2.mjs +30 -338
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/index.mjs +3 -2
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/table/src/page.type.d.ts +1 -1
- package/dist/components/table/src/table.d.ts +211 -744
- package/dist/components/table/src/table.mjs +131 -327
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/table.state.d.ts +3 -3
- package/dist/components/table/src/table.type.d.ts +1 -9
- package/dist/components/table/src/table.type.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +102 -399
- package/dist/components/table/src/tableColumn.mjs +62 -213
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.d.ts +4 -4
- package/dist/components/table/src/tableColumnSettingDialog.mjs +3 -3
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.d.ts +4 -4
- package/dist/components/table/src/tablePagination.mjs +3 -3
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchForm.d.ts +12 -12
- package/dist/components/table/src/tableSearchForm.mjs +6 -6
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.d.ts +4 -4
- package/dist/components/table/src/tableSearchFormItem.mjs +2 -2
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
- package/dist/components/table/src/useTable.d.ts +1 -0
- package/dist/components/table/src/useTable.mjs +109 -65
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.d.ts +4 -4
- package/dist/components/table/utils/table.mjs +6 -6
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +86 -86
- package/dist/components/tree/src/tree.mjs +46 -46
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +144 -150
- package/dist/components/treeSelect/src/treeSelect.mjs +55 -55
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.d.ts +36 -36
- package/dist/components/upload/src/upload.mjs +17 -17
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +47 -47
- package/dist/components/uploadImage/src/uploadImage.mjs +23 -23
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +41 -41
- package/dist/components/uploadImages/src/uploadImages.mjs +21 -21
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/directives/click-debounce/index.mjs +19 -11
- package/dist/directives/click-debounce/index.mjs.map +1 -1
- package/dist/directives/click-throttle/index.d.ts +4 -2
- package/dist/directives/click-throttle/index.mjs +21 -11
- package/dist/directives/click-throttle/index.mjs.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal/props.d.ts +685 -0
- package/dist/internal/props.mjs +683 -0
- package/dist/internal/props.mjs.map +1 -0
- package/dist/utils/loading-tasks.d.ts +5 -0
- package/dist/utils/loading-tasks.mjs +32 -0
- package/dist/utils/loading-tasks.mjs.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +5 -10
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/** FaContextMenu 菜单项配置。 */
|
|
2
2
|
export interface FaContextMenuData<Data = any> {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 名称
|
|
5
5
|
*/
|
|
6
6
|
name: string;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 标签
|
|
9
9
|
*/
|
|
10
10
|
label: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* 图标
|
|
13
13
|
*/
|
|
14
14
|
icon?: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* 隐藏
|
|
17
17
|
*/
|
|
18
18
|
hide?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 禁用
|
|
21
21
|
*/
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* 点击事件
|
|
25
25
|
*/
|
|
26
26
|
click?: (event: MouseEvent, data: FaContextMenuData<Data>) => Promise<void> | void;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* 携带数据
|
|
29
29
|
*/
|
|
30
30
|
data?: Data;
|
|
31
31
|
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/** FaDialog 的运行时 Props
|
|
1
|
+
/** FaDialog 的运行时 Props 定义 */
|
|
2
2
|
export declare const faDialogProps: {
|
|
3
|
-
/**
|
|
3
|
+
/** whether to align the dialog both horizontally and vertically */
|
|
4
4
|
alignCenter: {
|
|
5
5
|
type: BooleanConstructor;
|
|
6
6
|
default: boolean;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
8
|
+
/** whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */
|
|
9
9
|
appendToBody: {
|
|
10
10
|
type: BooleanConstructor;
|
|
11
11
|
default: boolean;
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
13
|
+
/** enable dragging feature for Dialog */
|
|
14
14
|
draggable: {
|
|
15
15
|
type: BooleanConstructor;
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
18
|
+
/** destroy elements in Dialog when closed */
|
|
19
19
|
destroyOnClose: {
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
23
|
+
/** draggable Dialog can overflow the viewport */
|
|
24
24
|
overflow: {
|
|
25
25
|
type: BooleanConstructor;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
-
/**
|
|
28
|
+
/** value for `margin-top` of Dialog CSS, default is 15vh */
|
|
29
29
|
top: {
|
|
30
30
|
type: StringConstructor;
|
|
31
31
|
default: string;
|
|
32
32
|
};
|
|
33
|
-
/**
|
|
33
|
+
/** width of Dialog, default is 50% */
|
|
34
34
|
width: {
|
|
35
35
|
type: (NumberConstructor | StringConstructor)[];
|
|
36
36
|
default: string;
|
|
37
37
|
};
|
|
38
|
-
/**
|
|
38
|
+
/** 显示刷新按钮 */
|
|
39
39
|
showRefresh: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
default: boolean;
|
|
42
42
|
};
|
|
43
|
-
/**
|
|
43
|
+
/** 显示全屏图标 */
|
|
44
44
|
showFullscreen: {
|
|
45
45
|
type: BooleanConstructor;
|
|
46
46
|
default: boolean;
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
48
|
+
/** 显示关闭按钮 */
|
|
49
49
|
showCloseButton: {
|
|
50
50
|
type: BooleanConstructor;
|
|
51
51
|
default: boolean;
|
|
52
52
|
};
|
|
53
|
-
/**
|
|
53
|
+
/** 显示确认按钮 */
|
|
54
54
|
showConfirmButton: {
|
|
55
55
|
type: BooleanConstructor;
|
|
56
56
|
default: boolean;
|
|
57
57
|
};
|
|
58
|
-
/**
|
|
58
|
+
/** 禁用确认按钮 */
|
|
59
59
|
disabledConfirmButton: BooleanConstructor;
|
|
60
|
-
/**
|
|
60
|
+
/** 关闭按钮文字,默认取消 */
|
|
61
61
|
closeButtonText: {
|
|
62
62
|
type: StringConstructor;
|
|
63
63
|
default: string;
|
|
64
64
|
};
|
|
65
|
-
/**
|
|
65
|
+
/** 确认按钮文字,默认确认 */
|
|
66
66
|
confirmButtonText: {
|
|
67
67
|
type: StringConstructor;
|
|
68
68
|
default: string;
|
|
69
69
|
};
|
|
70
|
-
/**
|
|
70
|
+
/** 隐藏底部操作 */
|
|
71
71
|
hideFooter: BooleanConstructor;
|
|
72
|
-
/**
|
|
72
|
+
/** 撑满高度 */
|
|
73
73
|
fullHeight: BooleanConstructor;
|
|
74
|
-
/**
|
|
74
|
+
/** 显示关闭回调 */
|
|
75
75
|
showBeforeClose: BooleanConstructor;
|
|
76
|
-
/**
|
|
76
|
+
/** 打开之后 */
|
|
77
77
|
afterOpen: {
|
|
78
78
|
type: import("vue").PropType<() => void | Promise<void>>;
|
|
79
79
|
};
|
|
@@ -117,11 +117,11 @@ export declare const faDialogProps: {
|
|
|
117
117
|
title: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
118
118
|
ariaLevel: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "2", boolean>;
|
|
119
119
|
};
|
|
120
|
-
/** FaDialog 的运行时 Emits
|
|
120
|
+
/** FaDialog 的运行时 Emits 定义 */
|
|
121
121
|
export declare const faDialogEmits: {
|
|
122
|
-
/**
|
|
122
|
+
/** v-model 回调 */
|
|
123
123
|
"update:modelValue": (value: boolean) => boolean;
|
|
124
|
-
/**
|
|
124
|
+
/** 确认按钮点击事件 */
|
|
125
125
|
confirmClick: () => boolean;
|
|
126
126
|
open: () => boolean;
|
|
127
127
|
opened: () => boolean;
|
|
@@ -130,107 +130,107 @@ export declare const faDialogEmits: {
|
|
|
130
130
|
openAutoFocus: () => boolean;
|
|
131
131
|
closeAutoFocus: () => boolean;
|
|
132
132
|
};
|
|
133
|
-
/** FaDialog
|
|
133
|
+
/** FaDialog 的插槽参数 */
|
|
134
134
|
export interface FaDialogSlots extends Record<string, unknown> {
|
|
135
|
-
/**
|
|
135
|
+
/** 默认内容插槽 */
|
|
136
136
|
default: {
|
|
137
137
|
loading: boolean;
|
|
138
138
|
};
|
|
139
|
-
/**
|
|
139
|
+
/** 头部插槽 */
|
|
140
140
|
header: {
|
|
141
141
|
loading: boolean;
|
|
142
142
|
close: () => void;
|
|
143
143
|
titleId: string;
|
|
144
144
|
titleClass: string;
|
|
145
145
|
};
|
|
146
|
-
/**
|
|
146
|
+
/** 标题插槽 */
|
|
147
147
|
title: {
|
|
148
148
|
loading: boolean;
|
|
149
149
|
close: () => void;
|
|
150
150
|
titleId: string;
|
|
151
151
|
titleClass: string;
|
|
152
152
|
};
|
|
153
|
-
/**
|
|
153
|
+
/** 底部插槽 */
|
|
154
154
|
footer: {
|
|
155
155
|
loading: boolean;
|
|
156
156
|
close: () => void;
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
160
|
-
/**
|
|
160
|
+
/** whether to align the dialog both horizontally and vertically */
|
|
161
161
|
alignCenter: {
|
|
162
162
|
type: BooleanConstructor;
|
|
163
163
|
default: boolean;
|
|
164
164
|
};
|
|
165
|
-
/**
|
|
165
|
+
/** whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */
|
|
166
166
|
appendToBody: {
|
|
167
167
|
type: BooleanConstructor;
|
|
168
168
|
default: boolean;
|
|
169
169
|
};
|
|
170
|
-
/**
|
|
170
|
+
/** enable dragging feature for Dialog */
|
|
171
171
|
draggable: {
|
|
172
172
|
type: BooleanConstructor;
|
|
173
173
|
default: boolean;
|
|
174
174
|
};
|
|
175
|
-
/**
|
|
175
|
+
/** destroy elements in Dialog when closed */
|
|
176
176
|
destroyOnClose: {
|
|
177
177
|
type: BooleanConstructor;
|
|
178
178
|
default: boolean;
|
|
179
179
|
};
|
|
180
|
-
/**
|
|
180
|
+
/** draggable Dialog can overflow the viewport */
|
|
181
181
|
overflow: {
|
|
182
182
|
type: BooleanConstructor;
|
|
183
183
|
default: boolean;
|
|
184
184
|
};
|
|
185
|
-
/**
|
|
185
|
+
/** value for `margin-top` of Dialog CSS, default is 15vh */
|
|
186
186
|
top: {
|
|
187
187
|
type: StringConstructor;
|
|
188
188
|
default: string;
|
|
189
189
|
};
|
|
190
|
-
/**
|
|
190
|
+
/** width of Dialog, default is 50% */
|
|
191
191
|
width: {
|
|
192
192
|
type: (NumberConstructor | StringConstructor)[];
|
|
193
193
|
default: string;
|
|
194
194
|
};
|
|
195
|
-
/**
|
|
195
|
+
/** 显示刷新按钮 */
|
|
196
196
|
showRefresh: {
|
|
197
197
|
type: BooleanConstructor;
|
|
198
198
|
default: boolean;
|
|
199
199
|
};
|
|
200
|
-
/**
|
|
200
|
+
/** 显示全屏图标 */
|
|
201
201
|
showFullscreen: {
|
|
202
202
|
type: BooleanConstructor;
|
|
203
203
|
default: boolean;
|
|
204
204
|
};
|
|
205
|
-
/**
|
|
205
|
+
/** 显示关闭按钮 */
|
|
206
206
|
showCloseButton: {
|
|
207
207
|
type: BooleanConstructor;
|
|
208
208
|
default: boolean;
|
|
209
209
|
};
|
|
210
|
-
/**
|
|
210
|
+
/** 显示确认按钮 */
|
|
211
211
|
showConfirmButton: {
|
|
212
212
|
type: BooleanConstructor;
|
|
213
213
|
default: boolean;
|
|
214
214
|
};
|
|
215
|
-
/**
|
|
215
|
+
/** 禁用确认按钮 */
|
|
216
216
|
disabledConfirmButton: BooleanConstructor;
|
|
217
|
-
/**
|
|
217
|
+
/** 关闭按钮文字,默认取消 */
|
|
218
218
|
closeButtonText: {
|
|
219
219
|
type: StringConstructor;
|
|
220
220
|
default: string;
|
|
221
221
|
};
|
|
222
|
-
/**
|
|
222
|
+
/** 确认按钮文字,默认确认 */
|
|
223
223
|
confirmButtonText: {
|
|
224
224
|
type: StringConstructor;
|
|
225
225
|
default: string;
|
|
226
226
|
};
|
|
227
|
-
/**
|
|
227
|
+
/** 隐藏底部操作 */
|
|
228
228
|
hideFooter: BooleanConstructor;
|
|
229
|
-
/**
|
|
229
|
+
/** 撑满高度 */
|
|
230
230
|
fullHeight: BooleanConstructor;
|
|
231
|
-
/**
|
|
231
|
+
/** 显示关闭回调 */
|
|
232
232
|
showBeforeClose: BooleanConstructor;
|
|
233
|
-
/**
|
|
233
|
+
/** 打开之后 */
|
|
234
234
|
afterOpen: {
|
|
235
235
|
type: import("vue").PropType<() => void | Promise<void>>;
|
|
236
236
|
};
|
|
@@ -274,31 +274,31 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
274
274
|
title: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
275
275
|
ariaLevel: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "2", boolean>;
|
|
276
276
|
}>, {
|
|
277
|
-
/**
|
|
277
|
+
/** 调用原生关闭流程,并执行 beforeClose。 */
|
|
278
278
|
handleClose: import("vue").ComputedRef<(() => void) | undefined>;
|
|
279
|
-
/**
|
|
279
|
+
/** 弹窗内容引用 */
|
|
280
280
|
dialogContentRef: import("vue").ComputedRef<{
|
|
281
281
|
resetPosition: () => void;
|
|
282
282
|
updatePosition: () => void;
|
|
283
283
|
} | undefined>;
|
|
284
|
-
/**
|
|
284
|
+
/** 重置位置 */
|
|
285
285
|
resetPosition: import("vue").ComputedRef<(() => void) | undefined>;
|
|
286
|
-
/**
|
|
286
|
+
/** 加载状态 */
|
|
287
287
|
loading: import("vue").Ref<boolean, boolean>;
|
|
288
|
-
/**
|
|
288
|
+
/** 是否显示 */
|
|
289
289
|
visible: import("vue").Ref<boolean, boolean>;
|
|
290
|
-
/**
|
|
290
|
+
/** 打开弹窗 */
|
|
291
291
|
open: (openFunction?: () => void | Promise<void>) => Promise<void>;
|
|
292
|
-
/**
|
|
292
|
+
/** 关闭弹窗 */
|
|
293
293
|
close: (closeFunction?: () => void | Promise<void>) => Promise<void>;
|
|
294
|
-
/**
|
|
294
|
+
/** 刷新弹窗 */
|
|
295
295
|
refresh: () => Promise<void>;
|
|
296
|
-
/**
|
|
296
|
+
/** 弹窗加载 */
|
|
297
297
|
doLoading: (loadingFunction: () => void | Promise<void>) => Promise<void>;
|
|
298
298
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
299
|
-
/**
|
|
299
|
+
/** v-model 回调 */
|
|
300
300
|
"update:modelValue": (value: boolean) => boolean;
|
|
301
|
-
/**
|
|
301
|
+
/** 确认按钮点击事件 */
|
|
302
302
|
confirmClick: () => boolean;
|
|
303
303
|
open: () => boolean;
|
|
304
304
|
opened: () => boolean;
|
|
@@ -307,80 +307,80 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
307
307
|
openAutoFocus: () => boolean;
|
|
308
308
|
closeAutoFocus: () => boolean;
|
|
309
309
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
310
|
-
/**
|
|
310
|
+
/** whether to align the dialog both horizontally and vertically */
|
|
311
311
|
alignCenter: {
|
|
312
312
|
type: BooleanConstructor;
|
|
313
313
|
default: boolean;
|
|
314
314
|
};
|
|
315
|
-
/**
|
|
315
|
+
/** whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */
|
|
316
316
|
appendToBody: {
|
|
317
317
|
type: BooleanConstructor;
|
|
318
318
|
default: boolean;
|
|
319
319
|
};
|
|
320
|
-
/**
|
|
320
|
+
/** enable dragging feature for Dialog */
|
|
321
321
|
draggable: {
|
|
322
322
|
type: BooleanConstructor;
|
|
323
323
|
default: boolean;
|
|
324
324
|
};
|
|
325
|
-
/**
|
|
325
|
+
/** destroy elements in Dialog when closed */
|
|
326
326
|
destroyOnClose: {
|
|
327
327
|
type: BooleanConstructor;
|
|
328
328
|
default: boolean;
|
|
329
329
|
};
|
|
330
|
-
/**
|
|
330
|
+
/** draggable Dialog can overflow the viewport */
|
|
331
331
|
overflow: {
|
|
332
332
|
type: BooleanConstructor;
|
|
333
333
|
default: boolean;
|
|
334
334
|
};
|
|
335
|
-
/**
|
|
335
|
+
/** value for `margin-top` of Dialog CSS, default is 15vh */
|
|
336
336
|
top: {
|
|
337
337
|
type: StringConstructor;
|
|
338
338
|
default: string;
|
|
339
339
|
};
|
|
340
|
-
/**
|
|
340
|
+
/** width of Dialog, default is 50% */
|
|
341
341
|
width: {
|
|
342
342
|
type: (NumberConstructor | StringConstructor)[];
|
|
343
343
|
default: string;
|
|
344
344
|
};
|
|
345
|
-
/**
|
|
345
|
+
/** 显示刷新按钮 */
|
|
346
346
|
showRefresh: {
|
|
347
347
|
type: BooleanConstructor;
|
|
348
348
|
default: boolean;
|
|
349
349
|
};
|
|
350
|
-
/**
|
|
350
|
+
/** 显示全屏图标 */
|
|
351
351
|
showFullscreen: {
|
|
352
352
|
type: BooleanConstructor;
|
|
353
353
|
default: boolean;
|
|
354
354
|
};
|
|
355
|
-
/**
|
|
355
|
+
/** 显示关闭按钮 */
|
|
356
356
|
showCloseButton: {
|
|
357
357
|
type: BooleanConstructor;
|
|
358
358
|
default: boolean;
|
|
359
359
|
};
|
|
360
|
-
/**
|
|
360
|
+
/** 显示确认按钮 */
|
|
361
361
|
showConfirmButton: {
|
|
362
362
|
type: BooleanConstructor;
|
|
363
363
|
default: boolean;
|
|
364
364
|
};
|
|
365
|
-
/**
|
|
365
|
+
/** 禁用确认按钮 */
|
|
366
366
|
disabledConfirmButton: BooleanConstructor;
|
|
367
|
-
/**
|
|
367
|
+
/** 关闭按钮文字,默认取消 */
|
|
368
368
|
closeButtonText: {
|
|
369
369
|
type: StringConstructor;
|
|
370
370
|
default: string;
|
|
371
371
|
};
|
|
372
|
-
/**
|
|
372
|
+
/** 确认按钮文字,默认确认 */
|
|
373
373
|
confirmButtonText: {
|
|
374
374
|
type: StringConstructor;
|
|
375
375
|
default: string;
|
|
376
376
|
};
|
|
377
|
-
/**
|
|
377
|
+
/** 隐藏底部操作 */
|
|
378
378
|
hideFooter: BooleanConstructor;
|
|
379
|
-
/**
|
|
379
|
+
/** 撑满高度 */
|
|
380
380
|
fullHeight: BooleanConstructor;
|
|
381
|
-
/**
|
|
381
|
+
/** 显示关闭回调 */
|
|
382
382
|
showBeforeClose: BooleanConstructor;
|
|
383
|
-
/**
|
|
383
|
+
/** 打开之后 */
|
|
384
384
|
afterOpen: {
|
|
385
385
|
type: import("vue").PropType<() => void | Promise<void>>;
|
|
386
386
|
};
|
|
@@ -9,91 +9,91 @@ import { Fragment, computed, createVNode, defineComponent, mergeProps, nextTick,
|
|
|
9
9
|
import { Close, Eleme, Refresh } from "@element-plus/icons-vue";
|
|
10
10
|
import { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from "element-plus";
|
|
11
11
|
//#region src/components/dialog/src/dialog.tsx
|
|
12
|
-
/** FaDialog 的运行时 Props
|
|
12
|
+
/** FaDialog 的运行时 Props 定义 */
|
|
13
13
|
const faDialogProps = {
|
|
14
14
|
...dialogProps,
|
|
15
|
-
/**
|
|
15
|
+
/** whether to align the dialog both horizontally and vertically */
|
|
16
16
|
alignCenter: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: true
|
|
19
19
|
},
|
|
20
|
-
/**
|
|
20
|
+
/** whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */
|
|
21
21
|
appendToBody: {
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: true
|
|
24
24
|
},
|
|
25
|
-
/**
|
|
25
|
+
/** enable dragging feature for Dialog */
|
|
26
26
|
draggable: {
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: true
|
|
29
29
|
},
|
|
30
|
-
/**
|
|
30
|
+
/** destroy elements in Dialog when closed */
|
|
31
31
|
destroyOnClose: {
|
|
32
32
|
type: Boolean,
|
|
33
33
|
default: true
|
|
34
34
|
},
|
|
35
|
-
/**
|
|
35
|
+
/** draggable Dialog can overflow the viewport */
|
|
36
36
|
overflow: {
|
|
37
37
|
type: Boolean,
|
|
38
38
|
default: true
|
|
39
39
|
},
|
|
40
|
-
/**
|
|
40
|
+
/** value for `margin-top` of Dialog CSS, default is 15vh */
|
|
41
41
|
top: {
|
|
42
42
|
type: String,
|
|
43
43
|
default: "5vh"
|
|
44
44
|
},
|
|
45
|
-
/**
|
|
45
|
+
/** width of Dialog, default is 50% */
|
|
46
46
|
width: {
|
|
47
47
|
type: [String, Number],
|
|
48
48
|
default: "90%"
|
|
49
49
|
},
|
|
50
|
-
/**
|
|
50
|
+
/** 显示刷新按钮 */
|
|
51
51
|
showRefresh: {
|
|
52
52
|
type: Boolean,
|
|
53
53
|
default: true
|
|
54
54
|
},
|
|
55
|
-
/**
|
|
55
|
+
/** 显示全屏图标 */
|
|
56
56
|
showFullscreen: {
|
|
57
57
|
type: Boolean,
|
|
58
58
|
default: true
|
|
59
59
|
},
|
|
60
|
-
/**
|
|
60
|
+
/** 显示关闭按钮 */
|
|
61
61
|
showCloseButton: {
|
|
62
62
|
type: Boolean,
|
|
63
63
|
default: true
|
|
64
64
|
},
|
|
65
|
-
/**
|
|
65
|
+
/** 显示确认按钮 */
|
|
66
66
|
showConfirmButton: {
|
|
67
67
|
type: Boolean,
|
|
68
68
|
default: true
|
|
69
69
|
},
|
|
70
|
-
/**
|
|
70
|
+
/** 禁用确认按钮 */
|
|
71
71
|
disabledConfirmButton: Boolean,
|
|
72
|
-
/**
|
|
72
|
+
/** 关闭按钮文字,默认取消 */
|
|
73
73
|
closeButtonText: {
|
|
74
74
|
type: String,
|
|
75
75
|
default: "取消"
|
|
76
76
|
},
|
|
77
|
-
/**
|
|
77
|
+
/** 确认按钮文字,默认确认 */
|
|
78
78
|
confirmButtonText: {
|
|
79
79
|
type: String,
|
|
80
80
|
default: "确认"
|
|
81
81
|
},
|
|
82
|
-
/**
|
|
82
|
+
/** 隐藏底部操作 */
|
|
83
83
|
hideFooter: Boolean,
|
|
84
|
-
/**
|
|
84
|
+
/** 撑满高度 */
|
|
85
85
|
fullHeight: Boolean,
|
|
86
|
-
/**
|
|
86
|
+
/** 显示关闭回调 */
|
|
87
87
|
showBeforeClose: Boolean,
|
|
88
|
-
/**
|
|
88
|
+
/** 打开之后 */
|
|
89
89
|
afterOpen: { type: definePropType(Function) }
|
|
90
90
|
};
|
|
91
|
-
/** FaDialog 的运行时 Emits
|
|
91
|
+
/** FaDialog 的运行时 Emits 定义 */
|
|
92
92
|
const faDialogEmits = {
|
|
93
93
|
...dialogEmits,
|
|
94
|
-
/**
|
|
94
|
+
/** v-model 回调 */
|
|
95
95
|
"update:modelValue": (value) => typeof value === "boolean",
|
|
96
|
-
/**
|
|
96
|
+
/** 确认按钮点击事件 */
|
|
97
97
|
confirmClick: () => true
|
|
98
98
|
};
|
|
99
99
|
var dialog_default = defineComponent({
|
|
@@ -265,23 +265,23 @@ var dialog_default = defineComponent({
|
|
|
265
265
|
])] }
|
|
266
266
|
}));
|
|
267
267
|
return useExpose(expose, {
|
|
268
|
-
/**
|
|
268
|
+
/** 调用原生关闭流程,并执行 beforeClose。 */
|
|
269
269
|
handleClose: computed(() => dialogRef.value?.handleClose),
|
|
270
|
-
/**
|
|
270
|
+
/** 弹窗内容引用 */
|
|
271
271
|
dialogContentRef: computed(() => dialogRef.value?.dialogContentRef),
|
|
272
|
-
/**
|
|
272
|
+
/** 重置位置 */
|
|
273
273
|
resetPosition: computed(() => dialogRef.value?.resetPosition),
|
|
274
|
-
/**
|
|
274
|
+
/** 加载状态 */
|
|
275
275
|
loading: toRef(state, "loading"),
|
|
276
|
-
/**
|
|
276
|
+
/** 是否显示 */
|
|
277
277
|
visible: toRef(state, "visible"),
|
|
278
|
-
/**
|
|
278
|
+
/** 打开弹窗 */
|
|
279
279
|
open: handleOpen,
|
|
280
|
-
/**
|
|
280
|
+
/** 关闭弹窗 */
|
|
281
281
|
close: handleClose,
|
|
282
|
-
/**
|
|
282
|
+
/** 刷新弹窗 */
|
|
283
283
|
refresh: handleRefresh,
|
|
284
|
-
/**
|
|
284
|
+
/** 弹窗加载 */
|
|
285
285
|
doLoading: handleLoading
|
|
286
286
|
});
|
|
287
287
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","names":["update:modelValue"],"sources":["../../../../src/components/dialog/src/dialog.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, reactive, shallowRef, toRef, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { DialogInstance } from \"element-plus\";\n\n/** FaDialog 的运行时 Props 定义。 */\nexport const faDialogProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...dialogProps,\n\t/** @description whether to align the dialog both horizontally and vertically*/\n\talignCenter: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description draggable Dialog can overflow the viewport */\n\toverflow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description value for `margin-top` of Dialog CSS, default is 15vh */\n\ttop: {\n\t\ttype: String,\n\t\tdefault: \"5vh\",\n\t},\n\t/** @description width of Dialog, default is 50% */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"90%\",\n\t},\n\t/** @description 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** @description 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** @description 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** @description 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** @description 撑满高度 */\n\tfullHeight: Boolean,\n\t/** @description 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** @description 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void | Promise<void>>(Function),\n\t},\n};\n\n/** FaDialog 的运行时 Emits 定义。 */\nexport const faDialogEmits = {\n\t...dialogEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: boolean) => typeof value === \"boolean\",\n\t/** @description 确认按钮点击事件 */\n\tconfirmClick: () => true,\n};\n\n/** FaDialog 的插槽参数。 */\nexport interface FaDialogSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** @description 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDialog\",\n\tprops: faDialogProps,\n\temits: faDialogEmits,\n\tslots: makeSlots<FaDialogSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst dialogRef = shallowRef<DialogInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: false,\n\t\t\tfullscreen: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = async (openFunction?: () => void | Promise<void>) => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tawait nextTick();\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(props.afterOpen ?? openFunction);\n\t\t\t\temit(\"open\");\n\t\t\t} catch (error) {\n\t\t\t\tstate.visible = false;\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleClose = async (closeFunction?: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(closeFunction);\n\t\t\t\temit(\"close\");\n\t\t\t\tstate.visible = false;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleRefresh = async () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t\tsetTimeout(resolve, 500);\n\t\t\t\t});\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tawait handleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t} finally {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void) => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = () => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose, done).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tnewDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\thandleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elDialogProps = useProps(props, dialogProps, [\"modelValue\", \"fullscreen\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDialogEmits = useEmits(dialogEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDialog\n\t\t\t\t{...elDialogProps.value}\n\t\t\t\t{...elDialogEmits.value}\n\t\t\t\tref={dialogRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-dialog\",\n\t\t\t\t\t`fa-dialog-${globalSize.value}`,\n\t\t\t\t\t{ \"fa-dialog__full-height\": props.fullHeight, \"fa-dialog__fullscreen\": state.fullscreen },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tfullscreen={state.fullscreen}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-dialog__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleRefresh}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: () => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDialog>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 调用原生关闭流程,并执行 beforeClose。 */\n\t\t\thandleClose: computed(() => dialogRef.value?.handleClose),\n\t\t\t/** @description 弹窗内容引用 */\n\t\t\tdialogContentRef: computed<{ resetPosition: () => void; updatePosition: () => void } | undefined>(\n\t\t\t\t() => dialogRef.value?.dialogContentRef as { resetPosition: () => void; updatePosition: () => void } | undefined\n\t\t\t),\n\t\t\t/** @description 重置位置 */\n\t\t\tresetPosition: computed(() => dialogRef.value?.resetPosition),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: toRef(state, \"visible\"),\n\t\t\t/** @description 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** @description 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** @description 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** @description 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAQA,MAAa,gBAAgB;CAE5B,GAAG;;CAEH,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,WAAW;EACV,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,KAAK;EACJ,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EACl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AM,cAAc,EACxB,cAAc,CAAA,YAAA,UAAA,MAAA;IAEX,MAAM,SAAS;KAAE,SAAS,MAAM;KAAS,OAAO;IAAiB,CAAC;IAClE,MAAM,mBAAe,YAAA,UAAA;KAAA,YACD,MAAM;KAAO,WAAW;IAAgB,GAAA,EAAA,eAAA,CAC1D,MAAM,eAAe,EAAA,CAAA;IAGvB,MAAM,qBAAiB,YAAA,UAAA;KAAA,WAEb,MAAM;KAAO,eACT;KAAK,YACR,MAAM;KAAqB,QAAA;KAAA,WAE5B;IAAkB,GAAA,EAAA,eAAA,CAE1B,MAAM,UAAU,WAAW,MAAM,iBAAiB,EAAA,CAAA;GAEpD,CAAA,CAAA,EAGJ;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,kBAAkB,eACX,UAAU,OAAO,gBACxB;;GAEA,eAAe,eAAe,UAAU,OAAO,aAAa;;GAE5D,SAAS,MAAM,OAAO,SAAS;;GAE/B,SAAS,MAAM,OAAO,SAAS;;GAE/B,MAAM;;GAEN,OAAO;;GAEP,SAAS;;GAET,WAAW;EACZ,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"dialog.mjs","names":["update:modelValue"],"sources":["../../../../src/components/dialog/src/dialog.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, reactive, shallowRef, toRef, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDialog, ElIcon, ElMessage, ElMessageBox, ElScrollbar, dialogEmits, dialogProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { DialogInstance } from \"element-plus\";\n\n/** FaDialog 的运行时 Props 定义 */\nexport const faDialogProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...dialogProps,\n\t/** whether to align the dialog both horizontally and vertically */\n\talignCenter: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** draggable Dialog can overflow the viewport */\n\toverflow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** value for `margin-top` of Dialog CSS, default is 15vh */\n\ttop: {\n\t\ttype: String,\n\t\tdefault: \"5vh\",\n\t},\n\t/** width of Dialog, default is 50% */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"90%\",\n\t},\n\t/** 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** 撑满高度 */\n\tfullHeight: Boolean,\n\t/** 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void | Promise<void>>(Function),\n\t},\n};\n\n/** FaDialog 的运行时 Emits 定义 */\nexport const faDialogEmits = {\n\t...dialogEmits,\n\t/** v-model 回调 */\n\t\"update:modelValue\": (value: boolean) => typeof value === \"boolean\",\n\t/** 确认按钮点击事件 */\n\tconfirmClick: () => true,\n};\n\n/** FaDialog 的插槽参数 */\nexport interface FaDialogSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDialog\",\n\tprops: faDialogProps,\n\temits: faDialogEmits,\n\tslots: makeSlots<FaDialogSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst dialogRef = shallowRef<DialogInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: false,\n\t\t\tfullscreen: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = async (openFunction?: () => void | Promise<void>) => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tawait nextTick();\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(props.afterOpen ?? openFunction);\n\t\t\t\temit(\"open\");\n\t\t\t} catch (error) {\n\t\t\t\tstate.visible = false;\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleClose = async (closeFunction?: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(closeFunction);\n\t\t\t\temit(\"close\");\n\t\t\t\tstate.visible = false;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>) => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleRefresh = async () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t\tsetTimeout(resolve, 500);\n\t\t\t\t});\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tawait handleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t} finally {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void) => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = () => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose, done).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tnewDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = () => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = () => {\n\t\t\tif (state.loading) return;\n\t\t\thandleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elDialogProps = useProps(props, dialogProps, [\"modelValue\", \"fullscreen\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDialogEmits = useEmits(dialogEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDialog\n\t\t\t\t{...elDialogProps.value}\n\t\t\t\t{...elDialogEmits.value}\n\t\t\t\tref={dialogRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-dialog\",\n\t\t\t\t\t`fa-dialog-${globalSize.value}`,\n\t\t\t\t\t{ \"fa-dialog__full-height\": props.fullHeight, \"fa-dialog__fullscreen\": state.fullscreen },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tfullscreen={state.fullscreen}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-dialog__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleRefresh}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-dialog__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: () => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDialog>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 调用原生关闭流程,并执行 beforeClose。 */\n\t\t\thandleClose: computed(() => dialogRef.value?.handleClose),\n\t\t\t/** 弹窗内容引用 */\n\t\t\tdialogContentRef: computed<{ resetPosition: () => void; updatePosition: () => void } | undefined>(\n\t\t\t\t() => dialogRef.value?.dialogContentRef as { resetPosition: () => void; updatePosition: () => void } | undefined\n\t\t\t),\n\t\t\t/** 重置位置 */\n\t\t\tresetPosition: computed(() => dialogRef.value?.resetPosition),\n\t\t\t/** 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** 是否显示 */\n\t\t\tvisible: toRef(state, \"visible\"),\n\t\t\t/** 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAQA,MAAa,gBAAgB;CAE5B,GAAG;;CAEH,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,WAAW;EACV,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,KAAK;EACJ,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,uBAAuB;;CAEvB,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAA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