yuang-framework-ui-pc 1.1.11 → 1.1.13

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.
@@ -26,32 +26,33 @@ const index$m = require("./ele-image-viewer/index");
26
26
  const index$n = require("./ele-loading/index");
27
27
  const index$o = require("./ele-menus/index");
28
28
  const index$p = require("./ele-modal/index");
29
- const index$q = require("./ele-page/index");
30
- const index$r = require("./ele-pagination/index");
31
- const index$s = require("./ele-popconfirm/index");
32
- const index$t = require("./ele-popover/index");
33
- const index$u = require("./ele-printer/index");
34
- const index$v = require("./ele-pro-layout/index");
35
- const index$w = require("./ele-pro-table/index");
36
- const index$x = require("./ele-qr-code/index");
37
- const index$y = require("./ele-qr-code-svg/index");
38
- const index$z = require("./ele-segmented/index");
39
- const index$A = require("./ele-split-panel/index");
40
- const index$B = require("./ele-steps/index");
41
- const index$C = require("./ele-tabs/index");
42
- const index$D = require("./ele-tab-tool/index");
43
- const index$E = require("./ele-tab-wrap/index");
44
- const index$F = require("./ele-table/index");
45
- const index$G = require("./ele-table-select/index");
46
- const index$H = require("./ele-text/index");
47
- const index$I = require("./ele-tool/index");
48
- const index$J = require("./ele-toolbar/index");
49
- const index$K = require("./ele-tooltip/index");
50
- const index$L = require("./ele-tour/index");
51
- const index$M = require("./ele-tree-select/index");
52
- const index$N = require("./ele-upload-list/index");
53
- const index$O = require("./ele-virtual-table/index");
54
- const index$P = require("./ele-watermark/index");
29
+ const index$q = require("./ele-dialog/index");
30
+ const index$r = require("./ele-page/index");
31
+ const index$s = require("./ele-pagination/index");
32
+ const index$t = require("./ele-popconfirm/index");
33
+ const index$u = require("./ele-popover/index");
34
+ const index$v = require("./ele-printer/index");
35
+ const index$w = require("./ele-pro-layout/index");
36
+ const index$x = require("./ele-pro-table/index");
37
+ const index$y = require("./ele-qr-code/index");
38
+ const index$z = require("./ele-qr-code-svg/index");
39
+ const index$A = require("./ele-segmented/index");
40
+ const index$B = require("./ele-split-panel/index");
41
+ const index$C = require("./ele-steps/index");
42
+ const index$D = require("./ele-tabs/index");
43
+ const index$E = require("./ele-tab-tool/index");
44
+ const index$F = require("./ele-tab-wrap/index");
45
+ const index$G = require("./ele-table/index");
46
+ const index$H = require("./ele-table-select/index");
47
+ const index$I = require("./ele-text/index");
48
+ const index$J = require("./ele-tool/index");
49
+ const index$K = require("./ele-toolbar/index");
50
+ const index$L = require("./ele-tooltip/index");
51
+ const index$M = require("./ele-tour/index");
52
+ const index$N = require("./ele-tree-select/index");
53
+ const index$O = require("./ele-upload-list/index");
54
+ const index$P = require("./ele-virtual-table/index");
55
+ const index$Q = require("./ele-watermark/index");
55
56
  exports.EleAdminLayout = index;
56
57
  exports.EleAlert = index$1;
57
58
  exports.EleApp = index$2;
@@ -78,29 +79,30 @@ exports.EleImageViewer = index$m;
78
79
  exports.EleLoading = index$n;
79
80
  exports.EleMenus = index$o;
80
81
  exports.EleModal = index$p;
81
- exports.ElePage = index$q;
82
- exports.ElePagination = index$r;
83
- exports.ElePopconfirm = index$s;
84
- exports.ElePopover = index$t;
85
- exports.ElePrinter = index$u;
86
- exports.EleProLayout = index$v;
87
- exports.EleProTable = index$w;
88
- exports.EleQrCode = index$x;
89
- exports.EleQrCodeSvg = index$y;
90
- exports.EleSegmented = index$z;
91
- exports.EleSplitPanel = index$A;
92
- exports.EleSteps = index$B;
93
- exports.EleTabs = index$C;
94
- exports.EleTabTool = index$D;
95
- exports.EleTabWrap = index$E;
96
- exports.EleTable = index$F;
97
- exports.EleTableSelect = index$G;
98
- exports.EleText = index$H;
99
- exports.EleTool = index$I;
100
- exports.EleToolbar = index$J;
101
- exports.EleTooltip = index$K;
102
- exports.EleTour = index$L;
103
- exports.EleTreeSelect = index$M;
104
- exports.EleUploadList = index$N;
105
- exports.EleVirtualTable = index$O;
106
- exports.EleWatermark = index$P;
82
+ exports.EleDialog = index$q;
83
+ exports.ElePage = index$r;
84
+ exports.ElePagination = index$s;
85
+ exports.ElePopconfirm = index$t;
86
+ exports.ElePopover = index$u;
87
+ exports.ElePrinter = index$v;
88
+ exports.EleProLayout = index$w;
89
+ exports.EleProTable = index$x;
90
+ exports.EleQrCode = index$y;
91
+ exports.EleQrCodeSvg = index$z;
92
+ exports.EleSegmented = index$A;
93
+ exports.EleSplitPanel = index$B;
94
+ exports.EleSteps = index$C;
95
+ exports.EleTabs = index$D;
96
+ exports.EleTabTool = index$E;
97
+ exports.EleTabWrap = index$F;
98
+ exports.EleTable = index$G;
99
+ exports.EleTableSelect = index$H;
100
+ exports.EleText = index$I;
101
+ exports.EleTool = index$J;
102
+ exports.EleToolbar = index$K;
103
+ exports.EleTooltip = index$L;
104
+ exports.EleTour = index$M;
105
+ exports.EleTreeSelect = index$N;
106
+ exports.EleUploadList = index$O;
107
+ exports.EleVirtualTable = index$P;
108
+ exports.EleWatermark = index$Q;
@@ -24,6 +24,7 @@ export { default as EleImageViewer } from './ele-image-viewer/index';
24
24
  export { default as EleLoading } from './ele-loading/index';
25
25
  export { default as EleMenus } from './ele-menus/index';
26
26
  export { default as EleModal } from './ele-modal/index';
27
+ export { default as EleDialog } from './ele-dialog/index';
27
28
  export { default as ElePage } from './ele-page/index';
28
29
  export { default as ElePagination } from './ele-pagination/index';
29
30
  export { default as ElePopconfirm } from './ele-popconfirm/index';
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const elementPlus = require("element-plus");
4
+ const icons = require("../icons");
5
+ const ReceiverView = require("../ele-config-provider/components/receiver-view");
6
+ const util = require("../ele-pro-layout/util");
7
+ const util$1 = require("./util");
8
+ const props = require("./props");
9
+ const _sfc_main = vue.defineComponent({
10
+ name: "EleModal",
11
+ components: {
12
+ ElDialog: elementPlus.ElDialog,
13
+ ElIcon: elementPlus.ElIcon,
14
+ CloseOutlined: icons.CloseOutlined,
15
+ CompressOutlined: icons.CompressOutlined,
16
+ ExpandOutlined: icons.ExpandOutlined,
17
+ ResizeOutlined: icons.ResizeOutlined,
18
+ ReceiverView
19
+ },
20
+ inheritAttrs: false,
21
+ props: props.modalProps,
22
+ emits: props.modalEmits,
23
+ setup(props2, { emit }) {
24
+ const layoutState = util.useLayoutState();
25
+ const isResponsive = util.useResponsive(props2);
26
+ const dialogRef = vue.ref(null);
27
+ const isFullscreen = vue.ref(props2.fullscreen ?? false);
28
+ const isActivated = vue.ref(true);
29
+ const dialogClass = vue.computed(() => {
30
+ const classes = [util$1.wrapperClass];
31
+ if (props2.responsive ?? isResponsive.value ?? true) {
32
+ classes.push("ele-modal-responsive");
33
+ }
34
+ if (props2.alignCenter || props2.position === "center") {
35
+ classes.push("ele-modal-center");
36
+ } else if (props2.position === "top") {
37
+ classes.push("ele-modal-top");
38
+ } else if (props2.position === "bottom") {
39
+ classes.push("ele-modal-bottom");
40
+ } else if (props2.position === "left") {
41
+ classes.push("ele-modal-left");
42
+ } else if (props2.position === "right") {
43
+ classes.push("ele-modal-right");
44
+ } else if (props2.position === "leftTop") {
45
+ classes.push("ele-modal-left-top");
46
+ } else if (props2.position === "leftBottom") {
47
+ classes.push("ele-modal-left-bottom");
48
+ } else if (props2.position === "rightTop") {
49
+ classes.push("ele-modal-right-top");
50
+ } else if (props2.position === "rightBottom") {
51
+ classes.push("ele-modal-right-bottom");
52
+ }
53
+ if (props2.draggable) {
54
+ classes.push("ele-modal-movable");
55
+ }
56
+ if (props2.resizable) {
57
+ classes.push("ele-modal-resizable");
58
+ }
59
+ if (props2.multiple) {
60
+ classes.push("ele-modal-multiple");
61
+ }
62
+ if (isFullscreen.value) {
63
+ classes.push("ele-modal-fullscreen");
64
+ }
65
+ if (!props2.modelValue) {
66
+ classes.push(util$1.closedClass);
67
+ }
68
+ if (!isActivated.value && props2.modelValue) {
69
+ classes.push("ele-modal-hide");
70
+ }
71
+ if (props2.inner) {
72
+ classes.push("ele-modal-inner");
73
+ }
74
+ if (props2.modalClass) {
75
+ classes.push(props2.modalClass);
76
+ }
77
+ return classes.join(" ");
78
+ });
79
+ const teleportTo = vue.computed(() => {
80
+ return util$1.getModalContainer(
81
+ props2.inner,
82
+ props2.multiple,
83
+ props2.appendTo,
84
+ layoutState.modalsEl
85
+ );
86
+ });
87
+ const teleportDisabled = vue.computed(() => {
88
+ const appendTo = props2.appendTo || "body";
89
+ const disabled = appendTo === "body" ? !props2.appendToBody : false;
90
+ return props2.multiple || props2.inner ? false : disabled;
91
+ });
92
+ const {
93
+ handleHeaderMousedown,
94
+ handleHeaderTouchstart,
95
+ handleResizeMousedown,
96
+ handleResizeTouchstart,
97
+ bindAutoTopEvent,
98
+ unbindAutoTopEvent,
99
+ topModal,
100
+ setInitPosition,
101
+ resetModalStyle
102
+ } = util$1.useModalEvent(dialogRef, props2, isFullscreen);
103
+ const updateModelValue = (modelValue) => {
104
+ emit("update:modelValue", modelValue);
105
+ };
106
+ const toggleFullscreen = (fullscreen) => {
107
+ isFullscreen.value = fullscreen ?? !isFullscreen.value;
108
+ vue.nextTick(() => {
109
+ topModal();
110
+ });
111
+ emit("update:fullscreen", isFullscreen.value);
112
+ };
113
+ const handleOpen = () => {
114
+ if (props2.resetOnClose || props2.destroyOnClose) {
115
+ isFullscreen.value = props2.fullscreen ?? false;
116
+ }
117
+ vue.nextTick(() => {
118
+ if (props2.resetOnClose) {
119
+ resetModalStyle();
120
+ } else {
121
+ setInitPosition();
122
+ }
123
+ topModal();
124
+ });
125
+ emit("open");
126
+ };
127
+ const handleOpened = () => {
128
+ bindAutoTopEvent();
129
+ emit("opened");
130
+ };
131
+ const handleClose = () => {
132
+ unbindAutoTopEvent();
133
+ emit("close");
134
+ };
135
+ const handleClosed = () => {
136
+ emit("closed");
137
+ };
138
+ const handleOpenAutoFocus = () => {
139
+ emit("openAutoFocus");
140
+ };
141
+ const handleCloseAutoFocus = () => {
142
+ emit("closeAutoFocus");
143
+ };
144
+ vue.watch(
145
+ () => props2.fullscreen,
146
+ (fullscreen) => {
147
+ isFullscreen.value = fullscreen ?? false;
148
+ }
149
+ );
150
+ vue.onMounted(() => {
151
+ if (props2.modelValue) {
152
+ setInitPosition();
153
+ }
154
+ });
155
+ vue.onActivated(() => {
156
+ isActivated.value = true;
157
+ });
158
+ vue.onDeactivated(() => {
159
+ isActivated.value = false;
160
+ });
161
+ return {
162
+ dialogRef,
163
+ isFullscreen,
164
+ dialogClass,
165
+ teleportTo,
166
+ teleportDisabled,
167
+ handleHeaderMousedown,
168
+ handleHeaderTouchstart,
169
+ handleResizeMousedown,
170
+ handleResizeTouchstart,
171
+ updateModelValue,
172
+ toggleFullscreen,
173
+ handleOpen,
174
+ handleOpened,
175
+ handleClose,
176
+ handleClosed,
177
+ handleOpenAutoFocus,
178
+ handleCloseAutoFocus
179
+ };
180
+ }
181
+ });
182
+ const _export_sfc = (sfc, props2) => {
183
+ const target = sfc.__vccOpts || sfc;
184
+ for (const [key, val] of props2) {
185
+ target[key] = val;
186
+ }
187
+ return target;
188
+ };
189
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
190
+ const _component_CompressOutlined = vue.resolveComponent("CompressOutlined");
191
+ const _component_ExpandOutlined = vue.resolveComponent("ExpandOutlined");
192
+ const _component_ElIcon = vue.resolveComponent("ElIcon");
193
+ const _component_CloseOutlined = vue.resolveComponent("CloseOutlined");
194
+ const _component_ResizeOutlined = vue.resolveComponent("ResizeOutlined");
195
+ const _component_ReceiverView = vue.resolveComponent("ReceiverView");
196
+ const _component_ElDialog = vue.resolveComponent("ElDialog");
197
+ return vue.openBlock(), vue.createBlock(vue.Teleport, {
198
+ to: _ctx.teleportTo,
199
+ disabled: _ctx.teleportDisabled
200
+ }, [
201
+ vue.createVNode(_component_ElDialog, vue.mergeProps(_ctx.$attrs, {
202
+ ref: "dialogRef",
203
+ modelValue: _ctx.modelValue,
204
+ title: _ctx.title,
205
+ width: _ctx.width,
206
+ fullscreen: false,
207
+ modal: _ctx.multiple ? false : _ctx.modal,
208
+ modalClass: _ctx.dialogClass,
209
+ appendToBody: false,
210
+ lockScroll: _ctx.inner || _ctx.multiple ? false : _ctx.lockScroll,
211
+ openDelay: _ctx.openDelay,
212
+ closeDelay: _ctx.closeDelay,
213
+ closeOnClickModal: _ctx.closeOnClickModal,
214
+ closeOnPressEscape: _ctx.closeOnPressEscape,
215
+ showClose: false,
216
+ beforeClose: _ctx.beforeClose,
217
+ draggable: false,
218
+ overflow: false,
219
+ center: _ctx.center,
220
+ alignCenter: false,
221
+ destroyOnClose: _ctx.destroyOnClose,
222
+ zIndex: _ctx.zIndex,
223
+ headerAriaLevel: _ctx.headerAriaLevel,
224
+ "onUpdate:modelValue": _ctx.updateModelValue,
225
+ onOpen: _ctx.handleOpen,
226
+ onOpened: _ctx.handleOpened,
227
+ onClose: _ctx.handleClose,
228
+ onClosed: _ctx.handleClosed,
229
+ onOpenAutoFocus: _ctx.handleOpenAutoFocus,
230
+ onCloseAutoFocus: _ctx.handleCloseAutoFocus
231
+ }), vue.createSlots({
232
+ header: vue.withCtx(({ close, titleId, titleClass }) => [
233
+ vue.createElementVNode("div", {
234
+ style: vue.normalizeStyle(_ctx.headerStyle),
235
+ class: "ele-modal-header",
236
+ onMousedown: _cache[6] || (_cache[6] = (...args) => _ctx.handleHeaderMousedown && _ctx.handleHeaderMousedown(...args)),
237
+ onTouchstart: _cache[7] || (_cache[7] = (...args) => _ctx.handleHeaderTouchstart && _ctx.handleHeaderTouchstart(...args))
238
+ }, [
239
+ vue.createElementVNode("div", {
240
+ class: "ele-modal-title",
241
+ style: vue.normalizeStyle(_ctx.titleStyle)
242
+ }, [
243
+ vue.renderSlot(_ctx.$slots, "header", {
244
+ close,
245
+ titleId,
246
+ titleClass
247
+ }, () => [
248
+ vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
249
+ ])
250
+ ], 4),
251
+ _ctx.maxable ? (vue.openBlock(), vue.createElementBlock("div", {
252
+ key: 0,
253
+ class: "ele-modal-tool ele-modal-tool-max",
254
+ style: vue.normalizeStyle(_ctx.fullscreenBtnStyle),
255
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggleFullscreen()),
256
+ onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
257
+ }, ["stop"])),
258
+ onTouchstart: _cache[2] || (_cache[2] = vue.withModifiers(() => {
259
+ }, ["stop"]))
260
+ }, [
261
+ vue.renderSlot(_ctx.$slots, "maxIcon", { fullscreen: _ctx.isFullscreen }, () => [
262
+ vue.createVNode(_component_ElIcon, null, {
263
+ default: vue.withCtx(() => [
264
+ _ctx.isFullscreen ? (vue.openBlock(), vue.createBlock(_component_CompressOutlined, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_ExpandOutlined, { key: 1 }))
265
+ ]),
266
+ _: 1
267
+ })
268
+ ])
269
+ ], 36)) : vue.createCommentVNode("", true),
270
+ _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("div", {
271
+ key: 1,
272
+ class: "ele-modal-tool",
273
+ style: vue.normalizeStyle(_ctx.closeBtnStyle),
274
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.updateModelValue(false)),
275
+ onMousedown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
276
+ }, ["stop"])),
277
+ onTouchstart: _cache[5] || (_cache[5] = vue.withModifiers(() => {
278
+ }, ["stop"]))
279
+ }, [
280
+ vue.renderSlot(_ctx.$slots, "closeIcon", {}, () => [
281
+ vue.createVNode(_component_ElIcon, null, {
282
+ default: vue.withCtx(() => [
283
+ _ctx.closeIcon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon), { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_CloseOutlined, { key: 1 }))
284
+ ]),
285
+ _: 1
286
+ })
287
+ ])
288
+ ], 36)) : vue.createCommentVNode("", true)
289
+ ], 36),
290
+ _ctx.resizable ? (vue.openBlock(), vue.createElementBlock("div", {
291
+ key: 0,
292
+ class: vue.normalizeClass([
293
+ "ele-modal-resize-icon",
294
+ { "is-horizontal": _ctx.resizable === "horizontal" },
295
+ { "is-vertical": _ctx.resizable === "vertical" }
296
+ ]),
297
+ style: vue.normalizeStyle(_ctx.resizeIconStyle),
298
+ onMousedown: _cache[8] || (_cache[8] = (...args) => _ctx.handleResizeMousedown && _ctx.handleResizeMousedown(...args)),
299
+ onTouchstart: _cache[9] || (_cache[9] = (...args) => _ctx.handleResizeTouchstart && _ctx.handleResizeTouchstart(...args))
300
+ }, [
301
+ vue.renderSlot(_ctx.$slots, "resizeIcon", {}, () => [
302
+ vue.createVNode(_component_ElIcon, null, {
303
+ default: vue.withCtx(() => [
304
+ vue.createVNode(_component_ResizeOutlined)
305
+ ]),
306
+ _: 1
307
+ })
308
+ ])
309
+ ], 38)) : vue.createCommentVNode("", true)
310
+ ]),
311
+ default: vue.withCtx(() => [
312
+ vue.createVNode(_component_ReceiverView, {
313
+ wrapPosition: false,
314
+ class: vue.normalizeClass(["ele-modal-body", { "is-form": _ctx.form }]),
315
+ style: vue.normalizeStyle(_ctx.bodyStyle)
316
+ }, {
317
+ default: vue.withCtx(() => [
318
+ vue.renderSlot(_ctx.$slots, "default")
319
+ ]),
320
+ _: 3
321
+ }, 8, ["class", "style"])
322
+ ]),
323
+ _: 2
324
+ }, [
325
+ _ctx.$slots.footer ? {
326
+ name: "footer",
327
+ fn: vue.withCtx(() => [
328
+ vue.createElementVNode("div", {
329
+ class: "ele-modal-footer",
330
+ style: vue.normalizeStyle(_ctx.footerStyle)
331
+ }, [
332
+ vue.renderSlot(_ctx.$slots, "footer")
333
+ ], 4)
334
+ ]),
335
+ key: "0"
336
+ } : void 0
337
+ ]), 1040, ["modelValue", "title", "width", "modal", "modalClass", "lockScroll", "openDelay", "closeDelay", "closeOnClickModal", "closeOnPressEscape", "beforeClose", "center", "destroyOnClose", "zIndex", "headerAriaLevel", "onUpdate:modelValue", "onOpen", "onOpened", "onClose", "onClosed", "onOpenAutoFocus", "onCloseAutoFocus"])
338
+ ], 8, ["to", "disabled"]);
339
+ }
340
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
341
+ module.exports = index;