@wfrog/vc-ui 1.11.10 → 1.11.11
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/dist/es/chunk/Bw0Rhd-r.mjs +110 -0
- package/dist/es/chunk/CqTdDZkE.mjs +31 -0
- package/dist/es/chunk/{DAnWZLYj.mjs → CzWfBa_8.mjs} +96 -2
- package/dist/es/chunk/D229kQ56.mjs +28 -0
- package/dist/es/chunk/{Cxx_YWUC.mjs → DcouM6gM.mjs} +6 -548
- package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
- package/dist/es/chunk/KanuIcmc.mjs +412 -0
- package/dist/es/chunk/{B71xEPfK.mjs → uuUHUjSk.mjs} +4 -35
- package/dist/es/components/backbottom/backbottom.mjs +3 -2
- package/dist/es/components/button/button.mjs +4 -5
- package/dist/es/components/choice/choice.mjs +4 -4
- package/dist/es/components/choice/index.css +1 -1
- package/dist/es/components/color-switch/color-switch.mjs +73 -1046
- package/dist/es/components/color-switch/index.css +1 -1
- package/dist/es/components/cropper/cropper.mjs +11 -117
- package/dist/es/components/cropper/index.css +1 -1
- package/dist/es/components/currency/currency.mjs +4 -5
- package/dist/es/components/daterange-picker/daterange-picker.mjs +8 -6253
- package/dist/es/components/dialog/dialog.mjs +7 -400
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +10 -11
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +4 -3
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +9 -1374
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -2
- package/dist/es/components/drawer/drawer.mjs +10 -352
- package/dist/es/components/drawer/index.css +1 -1
- package/dist/es/components/easy-pagination/easy-pagination.mjs +3 -2
- package/dist/es/components/explorer/explorer.mjs +3 -3
- package/dist/es/components/explorer-column-table/explorer-column-table.mjs +5 -7
- package/dist/es/components/explorer-column-table/index.css +1 -1
- package/dist/es/components/explorer-container/explorer-container.d.ts +1 -1
- package/dist/es/components/explorer-container/explorer-container.mjs +4 -3
- package/dist/es/components/explorer-filter/explorer-filter.mjs +5 -4
- package/dist/es/components/explorer-footer/explorer-footer.mjs +4 -8
- package/dist/es/components/explorer-form/explorer-form.mjs +4 -3
- package/dist/es/components/explorer-list/explorer-list.mjs +5 -4
- package/dist/es/components/explorer-modal-form/explorer-modal-form.mjs +4 -3
- package/dist/es/components/explorer-panel/explorer-panel.mjs +3 -3
- package/dist/es/components/explorer-query/explorer-query.mjs +9 -2201
- package/dist/es/components/explorer-query/index.css +1 -1
- package/dist/es/components/explorer-table/explorer-table.mjs +5 -8
- package/dist/es/components/explorer-tools/explorer-tools.mjs +13 -264
- package/dist/es/components/explorer-tools/index.css +1 -1
- package/dist/es/components/explorer-tree/explorer-tree.mjs +4 -5
- package/dist/es/components/icon-picker/icon-picker.mjs +8 -12
- package/dist/es/components/image/image.mjs +4 -4
- package/dist/es/components/info-tooltip/info-tooltip.mjs +336 -4
- package/dist/es/components/input/input.mjs +3 -2
- package/dist/es/components/input-number/input-number.mjs +3 -3
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +443 -601
- package/dist/es/components/screenfull/screenfull.mjs +4 -3
- package/dist/es/components/scrollbar/scrollbar.mjs +3 -2
- package/dist/es/components/select/select.mjs +3 -5
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +10 -1087
- package/dist/es/components/splitter/splitter.mjs +3 -3
- package/dist/es/components/splitter-panel/splitter-panel.mjs +3 -3
- package/dist/es/components/switch/index.css +1 -1
- package/dist/es/components/switch/switch.mjs +9 -395
- package/dist/es/components/tags/tags.mjs +7 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +3 -3
- package/dist/es/components/thousand-input/thousand-input.mjs +33 -1
- package/dist/es/components/tinymce/tinymce.mjs +4 -3
- package/dist/es/components/transfer/transfer.mjs +3 -4
- package/dist/es/components/transfer-panel/transfer-panel.mjs +5 -4
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +5 -10
- package/dist/es/index.mjs +1 -1
- package/dist/index.css +13 -40
- package/package.json +1 -1
- package/dist/es/chunk/B-rxnVJv.mjs +0 -3
- package/dist/es/chunk/B5HpgPRt.mjs +0 -69
- package/dist/es/chunk/BBhZKpIc.mjs +0 -2179
- package/dist/es/chunk/BDcsaNYa.mjs +0 -59
- package/dist/es/chunk/BTSSEFfD.mjs +0 -319
- package/dist/es/chunk/BTpNRPQW.mjs +0 -55
- package/dist/es/chunk/BVBK1U57.mjs +0 -96
- package/dist/es/chunk/Bc6yUGLs.mjs +0 -45
- package/dist/es/chunk/BjVI1XMz.mjs +0 -40
- package/dist/es/chunk/BlzQCBDu.mjs +0 -5741
- package/dist/es/chunk/BpJKnxlF.mjs +0 -476
- package/dist/es/chunk/Brp-qSBw.mjs +0 -2003
- package/dist/es/chunk/BunQI8Jb.mjs +0 -390
- package/dist/es/chunk/C0XgBrDz.mjs +0 -775
- package/dist/es/chunk/C0pTANRX.mjs +0 -109
- package/dist/es/chunk/CBMjhoFP.mjs +0 -101
- package/dist/es/chunk/CBiNtNvQ.mjs +0 -242
- package/dist/es/chunk/CBlJeNBO.mjs +0 -890
- package/dist/es/chunk/CCVL_Zj-.mjs +0 -427
- package/dist/es/chunk/CEl4MyfJ.mjs +0 -252
- package/dist/es/chunk/CJK5_jsA.mjs +0 -53
- package/dist/es/chunk/CKOcwq5V.mjs +0 -44
- package/dist/es/chunk/COs9dJZa.mjs +0 -66
- package/dist/es/chunk/CPt6MxJW.mjs +0 -375
- package/dist/es/chunk/CVqW0jzp.mjs +0 -107
- package/dist/es/chunk/CccIsEqA.mjs +0 -128
- package/dist/es/chunk/CjLR27-a.mjs +0 -582
- package/dist/es/chunk/CoGexPPD.mjs +0 -2192
- package/dist/es/chunk/CsLIbnzG.mjs +0 -64
- package/dist/es/chunk/Ct6q2FXg.mjs +0 -5
- package/dist/es/chunk/Cuq5meQh.mjs +0 -184
- package/dist/es/chunk/CvYIOfT1.mjs +0 -23
- package/dist/es/chunk/CxHJBf4l.mjs +0 -31
- package/dist/es/chunk/CzdaOBtA.mjs +0 -66
- package/dist/es/chunk/D0QTifnI.mjs +0 -54
- package/dist/es/chunk/D1QnA2iT.mjs +0 -229
- package/dist/es/chunk/D3AvJlVX.mjs +0 -188
- package/dist/es/chunk/D9Lr0Bzb.mjs +0 -1136
- package/dist/es/chunk/DCkPv0hy.mjs +0 -29
- package/dist/es/chunk/DRwwUUhy.mjs +0 -49
- package/dist/es/chunk/DX-2VRY2.mjs +0 -836
- package/dist/es/chunk/DZ2oTFad.mjs +0 -687
- package/dist/es/chunk/D_bou1py.mjs +0 -55
- package/dist/es/chunk/Da199A5L.mjs +0 -314
- package/dist/es/chunk/DbhQlaOz.mjs +0 -94
- package/dist/es/chunk/Dgu95mOy.mjs +0 -237
- package/dist/es/chunk/DhGOsWxx.mjs +0 -6
- package/dist/es/chunk/Dm_Sj5aH.mjs +0 -487
- package/dist/es/chunk/Dmi-1GRO.mjs +0 -163
- package/dist/es/chunk/DodoD9a9.mjs +0 -52
- package/dist/es/chunk/DrrVDcwm.mjs +0 -955
- package/dist/es/chunk/Du_zJ1Fz.mjs +0 -49
- package/dist/es/chunk/DxxbB5jY.mjs +0 -34
- package/dist/es/chunk/Gk1J52Yw.mjs +0 -207
- package/dist/es/chunk/NsldgdCh.mjs +0 -704
- package/dist/es/chunk/V6KjsUQN.mjs +0 -35
- package/dist/es/chunk/eEsLFV3s.mjs +0 -76
- package/dist/es/chunk/fqiLhk0V.mjs +0 -2065
- package/dist/es/chunk/nxVM7re4.mjs +0 -35
- package/dist/es/chunk/s7HLrANj.mjs +0 -215
- package/dist/es/chunk/vPhxogl3.mjs +0 -19
- package/dist/es/components/icon/icon2.mjs +0 -27
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createVNode, h, renderSlot, getCurrentInstance, ref, computed, watch, nextTick, onMounted } from 'vue';
|
|
2
|
-
import { N as NOOP, b as buildProps, u as useNamespace, d as definePropType, p as defaultNamespace, j as isObject, a as debugWarn, c as isArray, f as isFunction } from './Gk1J52Yw.mjs';
|
|
3
|
-
import { P as PatchFlags } from './DRwwUUhy.mjs';
|
|
4
|
-
import { i as iconPropType } from '../components/icon/icon2.mjs';
|
|
5
|
-
import { t as teleportProps } from './CoGexPPD.mjs';
|
|
6
|
-
import { U as UPDATE_MODEL_EVENT } from './Ct6q2FXg.mjs';
|
|
7
|
-
import { d as isBoolean } from './Bc6yUGLs.mjs';
|
|
8
|
-
import { useTimeoutFn, isClient } from '@vueuse/core';
|
|
9
|
-
import { u as useLockscreen } from './CJK5_jsA.mjs';
|
|
10
|
-
import { u as useZIndex } from './BjVI1XMz.mjs';
|
|
11
|
-
import { u as useId } from './nxVM7re4.mjs';
|
|
12
|
-
import { u as useGlobalConfig } from './C0pTANRX.mjs';
|
|
13
|
-
import { a as addUnit } from './DodoD9a9.mjs';
|
|
14
|
-
|
|
15
|
-
const useSameTarget = (handleClick) => {
|
|
16
|
-
if (!handleClick) {
|
|
17
|
-
return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
|
|
18
|
-
}
|
|
19
|
-
let mousedownTarget = false;
|
|
20
|
-
let mouseupTarget = false;
|
|
21
|
-
const onClick = (e) => {
|
|
22
|
-
if (mousedownTarget && mouseupTarget) {
|
|
23
|
-
handleClick(e);
|
|
24
|
-
}
|
|
25
|
-
mousedownTarget = mouseupTarget = false;
|
|
26
|
-
};
|
|
27
|
-
const onMousedown = (e) => {
|
|
28
|
-
mousedownTarget = e.target === e.currentTarget;
|
|
29
|
-
};
|
|
30
|
-
const onMouseup = (e) => {
|
|
31
|
-
mouseupTarget = e.target === e.currentTarget;
|
|
32
|
-
};
|
|
33
|
-
return { onClick, onMousedown, onMouseup };
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const overlayProps = buildProps({
|
|
37
|
-
mask: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true
|
|
40
|
-
},
|
|
41
|
-
customMaskEvent: Boolean,
|
|
42
|
-
overlayClass: {
|
|
43
|
-
type: definePropType([
|
|
44
|
-
String,
|
|
45
|
-
Array,
|
|
46
|
-
Object
|
|
47
|
-
])
|
|
48
|
-
},
|
|
49
|
-
zIndex: {
|
|
50
|
-
type: definePropType([String, Number])
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const overlayEmits = {
|
|
54
|
-
click: (evt) => evt instanceof MouseEvent
|
|
55
|
-
};
|
|
56
|
-
const BLOCK = "overlay";
|
|
57
|
-
var Overlay = defineComponent({
|
|
58
|
-
name: "ElOverlay",
|
|
59
|
-
props: overlayProps,
|
|
60
|
-
emits: overlayEmits,
|
|
61
|
-
setup(props, { slots, emit }) {
|
|
62
|
-
const ns = useNamespace(BLOCK);
|
|
63
|
-
const onMaskClick = (e) => {
|
|
64
|
-
emit("click", e);
|
|
65
|
-
};
|
|
66
|
-
const { onClick, onMousedown, onMouseup } = useSameTarget(
|
|
67
|
-
props.customMaskEvent ? void 0 : onMaskClick
|
|
68
|
-
);
|
|
69
|
-
return () => {
|
|
70
|
-
return props.mask ? createVNode(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
class: [ns.b(), props.overlayClass],
|
|
74
|
-
style: {
|
|
75
|
-
zIndex: props.zIndex
|
|
76
|
-
},
|
|
77
|
-
onClick,
|
|
78
|
-
onMousedown,
|
|
79
|
-
onMouseup
|
|
80
|
-
},
|
|
81
|
-
[renderSlot(slots, "default")],
|
|
82
|
-
PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS,
|
|
83
|
-
["onClick", "onMouseup", "onMousedown"]
|
|
84
|
-
) : h(
|
|
85
|
-
"div",
|
|
86
|
-
{
|
|
87
|
-
class: props.overlayClass,
|
|
88
|
-
style: {
|
|
89
|
-
zIndex: props.zIndex,
|
|
90
|
-
position: "fixed",
|
|
91
|
-
top: "0px",
|
|
92
|
-
right: "0px",
|
|
93
|
-
bottom: "0px",
|
|
94
|
-
left: "0px"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
[renderSlot(slots, "default")]
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
const ElOverlay = Overlay;
|
|
104
|
-
|
|
105
|
-
const dialogInjectionKey = Symbol("dialogInjectionKey");
|
|
106
|
-
const DEFAULT_DIALOG_TRANSITION = "dialog-fade";
|
|
107
|
-
|
|
108
|
-
const dialogContentProps = buildProps({
|
|
109
|
-
center: Boolean,
|
|
110
|
-
alignCenter: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: void 0
|
|
113
|
-
},
|
|
114
|
-
closeIcon: {
|
|
115
|
-
type: iconPropType
|
|
116
|
-
},
|
|
117
|
-
draggable: {
|
|
118
|
-
type: Boolean,
|
|
119
|
-
default: void 0
|
|
120
|
-
},
|
|
121
|
-
overflow: {
|
|
122
|
-
type: Boolean,
|
|
123
|
-
default: void 0
|
|
124
|
-
},
|
|
125
|
-
fullscreen: Boolean,
|
|
126
|
-
headerClass: String,
|
|
127
|
-
bodyClass: String,
|
|
128
|
-
footerClass: String,
|
|
129
|
-
showClose: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: true
|
|
132
|
-
},
|
|
133
|
-
title: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: ""
|
|
136
|
-
},
|
|
137
|
-
ariaLevel: {
|
|
138
|
-
type: String,
|
|
139
|
-
default: "2"
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
const dialogContentEmits = {
|
|
143
|
-
close: () => true
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const dialogProps = buildProps({
|
|
147
|
-
...dialogContentProps,
|
|
148
|
-
appendToBody: Boolean,
|
|
149
|
-
appendTo: {
|
|
150
|
-
type: teleportProps.to.type,
|
|
151
|
-
default: "body"
|
|
152
|
-
},
|
|
153
|
-
beforeClose: {
|
|
154
|
-
type: definePropType(Function)
|
|
155
|
-
},
|
|
156
|
-
destroyOnClose: Boolean,
|
|
157
|
-
closeOnClickModal: {
|
|
158
|
-
type: Boolean,
|
|
159
|
-
default: true
|
|
160
|
-
},
|
|
161
|
-
closeOnPressEscape: {
|
|
162
|
-
type: Boolean,
|
|
163
|
-
default: true
|
|
164
|
-
},
|
|
165
|
-
lockScroll: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
default: true
|
|
168
|
-
},
|
|
169
|
-
modal: {
|
|
170
|
-
type: Boolean,
|
|
171
|
-
default: true
|
|
172
|
-
},
|
|
173
|
-
modalPenetrable: Boolean,
|
|
174
|
-
openDelay: {
|
|
175
|
-
type: Number,
|
|
176
|
-
default: 0
|
|
177
|
-
},
|
|
178
|
-
closeDelay: {
|
|
179
|
-
type: Number,
|
|
180
|
-
default: 0
|
|
181
|
-
},
|
|
182
|
-
top: {
|
|
183
|
-
type: String
|
|
184
|
-
},
|
|
185
|
-
modelValue: Boolean,
|
|
186
|
-
modalClass: String,
|
|
187
|
-
headerClass: String,
|
|
188
|
-
bodyClass: String,
|
|
189
|
-
footerClass: String,
|
|
190
|
-
width: {
|
|
191
|
-
type: [String, Number]
|
|
192
|
-
},
|
|
193
|
-
zIndex: {
|
|
194
|
-
type: Number
|
|
195
|
-
},
|
|
196
|
-
trapFocus: Boolean,
|
|
197
|
-
headerAriaLevel: {
|
|
198
|
-
type: String,
|
|
199
|
-
default: "2"
|
|
200
|
-
},
|
|
201
|
-
transition: {
|
|
202
|
-
type: definePropType([String, Object]),
|
|
203
|
-
default: void 0
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
const dialogEmits = {
|
|
207
|
-
open: () => true,
|
|
208
|
-
opened: () => true,
|
|
209
|
-
close: () => true,
|
|
210
|
-
closed: () => true,
|
|
211
|
-
[UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
|
|
212
|
-
openAutoFocus: () => true,
|
|
213
|
-
closeAutoFocus: () => true
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const COMPONENT_NAME = "ElDialog";
|
|
217
|
-
const useDialog = (props, targetRef) => {
|
|
218
|
-
var _a;
|
|
219
|
-
const instance = getCurrentInstance();
|
|
220
|
-
const emit = instance.emit;
|
|
221
|
-
const { nextZIndex } = useZIndex();
|
|
222
|
-
let lastPosition = "";
|
|
223
|
-
const titleId = useId();
|
|
224
|
-
const bodyId = useId();
|
|
225
|
-
const visible = ref(false);
|
|
226
|
-
const closed = ref(false);
|
|
227
|
-
const rendered = ref(false);
|
|
228
|
-
const zIndex = ref((_a = props.zIndex) != null ? _a : nextZIndex());
|
|
229
|
-
const closing = ref(false);
|
|
230
|
-
let openTimer = void 0;
|
|
231
|
-
let closeTimer = void 0;
|
|
232
|
-
const config = useGlobalConfig();
|
|
233
|
-
const namespace = computed(() => {
|
|
234
|
-
var _a2, _b;
|
|
235
|
-
return (_b = (_a2 = config.value) == null ? void 0 : _a2.namespace) != null ? _b : defaultNamespace;
|
|
236
|
-
});
|
|
237
|
-
const globalConfig = computed(() => {
|
|
238
|
-
var _a2;
|
|
239
|
-
return (_a2 = config.value) == null ? void 0 : _a2.dialog;
|
|
240
|
-
});
|
|
241
|
-
const style = computed(() => {
|
|
242
|
-
const style2 = {};
|
|
243
|
-
const varPrefix = `--${namespace.value}-dialog`;
|
|
244
|
-
if (!props.fullscreen) {
|
|
245
|
-
if (props.top) {
|
|
246
|
-
style2[`${varPrefix}-margin-top`] = props.top;
|
|
247
|
-
}
|
|
248
|
-
const width = addUnit(props.width);
|
|
249
|
-
if (width) {
|
|
250
|
-
style2[`${varPrefix}-width`] = width;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return style2;
|
|
254
|
-
});
|
|
255
|
-
const _draggable = computed(
|
|
256
|
-
() => {
|
|
257
|
-
var _a2, _b, _c;
|
|
258
|
-
return ((_c = (_b = props.draggable) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.draggable) != null ? _c : false) && !props.fullscreen;
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
const _alignCenter = computed(
|
|
262
|
-
() => {
|
|
263
|
-
var _a2, _b, _c;
|
|
264
|
-
return (_c = (_b = props.alignCenter) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.alignCenter) != null ? _c : false;
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
const _overflow = computed(
|
|
268
|
-
() => {
|
|
269
|
-
var _a2, _b, _c;
|
|
270
|
-
return (_c = (_b = props.overflow) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.overflow) != null ? _c : false;
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
const overlayDialogStyle = computed(() => {
|
|
274
|
-
if (_alignCenter.value) {
|
|
275
|
-
return { display: "flex" };
|
|
276
|
-
}
|
|
277
|
-
return {};
|
|
278
|
-
});
|
|
279
|
-
const transitionConfig = computed(() => {
|
|
280
|
-
var _a2, _b, _c;
|
|
281
|
-
const transition = (_c = (_b = props.transition) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.transition) != null ? _c : DEFAULT_DIALOG_TRANSITION;
|
|
282
|
-
const baseConfig = {
|
|
283
|
-
name: transition,
|
|
284
|
-
onAfterEnter: afterEnter,
|
|
285
|
-
onBeforeLeave: beforeLeave,
|
|
286
|
-
onAfterLeave: afterLeave
|
|
287
|
-
};
|
|
288
|
-
if (isObject(transition)) {
|
|
289
|
-
const config2 = { ...transition };
|
|
290
|
-
const _mergeHook = (userHook, defaultHook) => {
|
|
291
|
-
return (el) => {
|
|
292
|
-
if (isArray(userHook)) {
|
|
293
|
-
userHook.forEach((fn) => {
|
|
294
|
-
if (isFunction(fn))
|
|
295
|
-
fn(el);
|
|
296
|
-
});
|
|
297
|
-
} else if (isFunction(userHook)) {
|
|
298
|
-
userHook(el);
|
|
299
|
-
}
|
|
300
|
-
defaultHook();
|
|
301
|
-
};
|
|
302
|
-
};
|
|
303
|
-
config2.onAfterEnter = _mergeHook(config2.onAfterEnter, afterEnter);
|
|
304
|
-
config2.onBeforeLeave = _mergeHook(config2.onBeforeLeave, beforeLeave);
|
|
305
|
-
config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave);
|
|
306
|
-
if (!config2.name) {
|
|
307
|
-
config2.name = DEFAULT_DIALOG_TRANSITION;
|
|
308
|
-
debugWarn(
|
|
309
|
-
COMPONENT_NAME,
|
|
310
|
-
`transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
return config2;
|
|
314
|
-
}
|
|
315
|
-
return baseConfig;
|
|
316
|
-
});
|
|
317
|
-
function afterEnter() {
|
|
318
|
-
emit("opened");
|
|
319
|
-
}
|
|
320
|
-
function afterLeave() {
|
|
321
|
-
emit("closed");
|
|
322
|
-
emit(UPDATE_MODEL_EVENT, false);
|
|
323
|
-
if (props.destroyOnClose) {
|
|
324
|
-
rendered.value = false;
|
|
325
|
-
}
|
|
326
|
-
closing.value = false;
|
|
327
|
-
}
|
|
328
|
-
function beforeLeave() {
|
|
329
|
-
closing.value = true;
|
|
330
|
-
emit("close");
|
|
331
|
-
}
|
|
332
|
-
function open() {
|
|
333
|
-
closeTimer == null ? void 0 : closeTimer();
|
|
334
|
-
openTimer == null ? void 0 : openTimer();
|
|
335
|
-
if (props.openDelay && props.openDelay > 0) {
|
|
336
|
-
({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
|
|
337
|
-
} else {
|
|
338
|
-
doOpen();
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function close() {
|
|
342
|
-
openTimer == null ? void 0 : openTimer();
|
|
343
|
-
closeTimer == null ? void 0 : closeTimer();
|
|
344
|
-
if (props.closeDelay && props.closeDelay > 0) {
|
|
345
|
-
({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
|
|
346
|
-
} else {
|
|
347
|
-
doClose();
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
function handleClose() {
|
|
351
|
-
function hide(shouldCancel) {
|
|
352
|
-
if (shouldCancel)
|
|
353
|
-
return;
|
|
354
|
-
closed.value = true;
|
|
355
|
-
visible.value = false;
|
|
356
|
-
}
|
|
357
|
-
if (props.beforeClose) {
|
|
358
|
-
props.beforeClose(hide);
|
|
359
|
-
} else {
|
|
360
|
-
close();
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function onModalClick() {
|
|
364
|
-
if (props.closeOnClickModal) {
|
|
365
|
-
handleClose();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function doOpen() {
|
|
369
|
-
if (!isClient)
|
|
370
|
-
return;
|
|
371
|
-
visible.value = true;
|
|
372
|
-
}
|
|
373
|
-
function doClose() {
|
|
374
|
-
visible.value = false;
|
|
375
|
-
}
|
|
376
|
-
function onOpenAutoFocus() {
|
|
377
|
-
emit("openAutoFocus");
|
|
378
|
-
}
|
|
379
|
-
function onCloseAutoFocus() {
|
|
380
|
-
emit("closeAutoFocus");
|
|
381
|
-
}
|
|
382
|
-
function onFocusoutPrevented(event) {
|
|
383
|
-
var _a2;
|
|
384
|
-
if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
|
|
385
|
-
event.preventDefault();
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
if (props.lockScroll) {
|
|
389
|
-
useLockscreen(visible);
|
|
390
|
-
}
|
|
391
|
-
function onCloseRequested() {
|
|
392
|
-
if (props.closeOnPressEscape) {
|
|
393
|
-
handleClose();
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
watch(
|
|
397
|
-
() => props.zIndex,
|
|
398
|
-
() => {
|
|
399
|
-
var _a2;
|
|
400
|
-
zIndex.value = (_a2 = props.zIndex) != null ? _a2 : nextZIndex();
|
|
401
|
-
}
|
|
402
|
-
);
|
|
403
|
-
watch(
|
|
404
|
-
() => props.modelValue,
|
|
405
|
-
(val) => {
|
|
406
|
-
var _a2;
|
|
407
|
-
if (val) {
|
|
408
|
-
closed.value = false;
|
|
409
|
-
closing.value = false;
|
|
410
|
-
open();
|
|
411
|
-
rendered.value = true;
|
|
412
|
-
zIndex.value = (_a2 = props.zIndex) != null ? _a2 : nextZIndex();
|
|
413
|
-
nextTick(() => {
|
|
414
|
-
emit("open");
|
|
415
|
-
if (targetRef.value) {
|
|
416
|
-
targetRef.value.parentElement.scrollTop = 0;
|
|
417
|
-
targetRef.value.parentElement.scrollLeft = 0;
|
|
418
|
-
targetRef.value.scrollTop = 0;
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
} else {
|
|
422
|
-
if (visible.value) {
|
|
423
|
-
close();
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
);
|
|
428
|
-
watch(
|
|
429
|
-
() => props.fullscreen,
|
|
430
|
-
(val) => {
|
|
431
|
-
if (!targetRef.value)
|
|
432
|
-
return;
|
|
433
|
-
if (val) {
|
|
434
|
-
lastPosition = targetRef.value.style.transform;
|
|
435
|
-
targetRef.value.style.transform = "";
|
|
436
|
-
} else {
|
|
437
|
-
targetRef.value.style.transform = lastPosition;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
onMounted(() => {
|
|
442
|
-
if (props.modelValue) {
|
|
443
|
-
visible.value = true;
|
|
444
|
-
rendered.value = true;
|
|
445
|
-
open();
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
return {
|
|
449
|
-
afterEnter,
|
|
450
|
-
afterLeave,
|
|
451
|
-
beforeLeave,
|
|
452
|
-
handleClose,
|
|
453
|
-
onModalClick,
|
|
454
|
-
close,
|
|
455
|
-
doClose,
|
|
456
|
-
onOpenAutoFocus,
|
|
457
|
-
onCloseAutoFocus,
|
|
458
|
-
onCloseRequested,
|
|
459
|
-
onFocusoutPrevented,
|
|
460
|
-
titleId,
|
|
461
|
-
bodyId,
|
|
462
|
-
closed,
|
|
463
|
-
style,
|
|
464
|
-
overlayDialogStyle,
|
|
465
|
-
rendered,
|
|
466
|
-
visible,
|
|
467
|
-
zIndex,
|
|
468
|
-
transitionConfig,
|
|
469
|
-
_draggable,
|
|
470
|
-
_alignCenter,
|
|
471
|
-
_overflow,
|
|
472
|
-
closing
|
|
473
|
-
};
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
export { ElOverlay as E, dialogProps as a, dialogContentEmits as b, dialogContentProps as c, dialogEmits as d, dialogInjectionKey as e, useSameTarget as f, useDialog as u };
|