ele-admin-plus 1.1.9-beta.10 → 1.1.9-beta.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/es/ele-alert/index.js +2 -2
- package/es/ele-basic-select/index.d.ts +1 -1
- package/es/ele-basic-select/index.js +7 -1
- package/es/ele-config-provider/types.d.ts +3 -1
- package/es/ele-cropper-modal/index.js +1 -1
- package/es/ele-drawer/index.d.ts +8 -5
- package/es/ele-drawer/index.js +107 -113
- package/es/ele-drawer/style/index.scss +48 -105
- package/es/ele-edit-tag/index.js +1 -1
- package/es/ele-file-list/components/file-grid-item.js +1 -1
- package/es/ele-file-list/components/file-table-item.js +1 -1
- package/es/ele-icon-select/components/icon-grid.js +1 -1
- package/es/ele-loading/index.d.ts +0 -4
- package/es/ele-loading/index.js +10 -16
- package/es/ele-map-picker/components/map-view.js +1 -1
- package/es/ele-map-picker/index.js +1 -1
- package/es/ele-menus/index.d.ts +4 -6
- package/es/ele-menus/index.js +1 -1
- package/es/ele-menus/props.d.ts +1 -3
- package/es/ele-menus/props.js +1 -3
- package/es/ele-menus/style/css-var.scss +1 -5
- package/es/ele-modal/index.d.ts +12 -6
- package/es/ele-modal/index.js +163 -184
- package/es/ele-modal/props.d.ts +2 -0
- package/es/ele-modal/props.js +2 -0
- package/es/ele-modal/style/index.scss +85 -146
- package/es/ele-modal/util.d.ts +18 -44
- package/es/ele-modal/util.js +53 -179
- package/es/ele-pagination/index.d.ts +9 -0
- package/es/ele-pagination/index.js +4 -1
- package/es/ele-pagination/props.d.ts +5 -0
- package/es/ele-pagination/props.js +5 -0
- package/es/ele-popconfirm/index.d.ts +3 -3
- package/es/ele-popconfirm/index.js +6 -28
- package/es/ele-popover/index.d.ts +2 -2
- package/es/ele-popover/index.js +6 -14
- package/es/ele-pro-layout/components/pro-header.d.ts +66 -11
- package/es/ele-pro-layout/components/pro-header.js +110 -20
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +2 -7
- package/es/ele-pro-layout/components/pro-sidebar.js +2 -5
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +2 -7
- package/es/ele-pro-layout/components/pro-sidebox.js +2 -5
- package/es/ele-pro-layout/components/tab-dropdown.js +1 -1
- package/es/ele-pro-layout/index.d.ts +25 -27
- package/es/ele-pro-layout/index.js +45 -29
- package/es/ele-pro-layout/props.d.ts +3 -6
- package/es/ele-pro-layout/props.js +2 -4
- package/es/ele-pro-layout/style/css-var.scss +3 -18
- package/es/ele-pro-layout/style/header.scss +74 -9
- package/es/ele-pro-layout/style/layout-mobile.scss +2 -2
- package/es/ele-pro-layout/style/layout-style.scss +8 -3
- package/es/ele-pro-layout/style/layout-theme.scss +48 -23
- package/es/ele-pro-layout/style/layout.scss +23 -3
- package/es/ele-pro-layout/style/sidebar.scss +0 -1
- package/es/ele-pro-layout/style/tabs.scss +19 -11
- package/es/ele-pro-layout/types.d.ts +1 -1
- package/es/ele-pro-table/components/tool-print.js +0 -3
- package/es/ele-pro-table/index.d.ts +3 -5
- package/es/ele-pro-table/index.js +2 -1
- package/es/ele-pro-table/util.d.ts +1 -1
- package/es/ele-tab-wrap/index.js +2 -1
- package/es/ele-table-select/index.d.ts +13 -12
- package/es/ele-table-select/index.js +27 -26
- package/es/ele-tabs/index.js +1 -0
- package/es/ele-tabs/style/css-var.scss +1 -30
- package/es/ele-tabs/style/index.scss +372 -241
- package/es/ele-tabs/types.d.ts +2 -1
- package/es/ele-tooltip/index.js +3 -0
- package/es/ele-tooltip/props.d.ts +5 -0
- package/es/ele-tooltip/props.js +2 -0
- package/es/ele-virtual-table/style/index.scss +1 -1
- package/es/icons/ResizeOutlined.d.ts +2 -0
- package/es/icons/ResizeOutlined.js +30 -0
- package/es/icons/index.d.ts +1 -0
- package/es/icons/index.js +50 -48
- package/es/style/themes/dark.scss +9 -15
- package/es/style/themes/default.scss +56 -80
- package/es/style/themes/rounded.scss +16 -30
- package/lib/ele-alert/index.cjs +2 -2
- package/lib/ele-basic-select/index.cjs +7 -1
- package/lib/ele-basic-select/index.d.ts +1 -1
- package/lib/ele-config-provider/types.d.ts +3 -1
- package/lib/ele-cropper-modal/index.cjs +1 -1
- package/lib/ele-drawer/index.cjs +105 -111
- package/lib/ele-drawer/index.d.ts +8 -5
- package/lib/ele-drawer/style/index.scss +48 -105
- package/lib/ele-edit-tag/index.cjs +1 -1
- package/lib/ele-file-list/components/file-grid-item.cjs +1 -1
- package/lib/ele-file-list/components/file-table-item.cjs +1 -1
- package/lib/ele-icon-select/components/icon-grid.cjs +1 -1
- package/lib/ele-loading/index.cjs +9 -15
- package/lib/ele-loading/index.d.ts +0 -4
- package/lib/ele-map-picker/components/map-view.cjs +1 -1
- package/lib/ele-map-picker/index.cjs +1 -1
- package/lib/ele-menus/index.cjs +1 -1
- package/lib/ele-menus/index.d.ts +4 -6
- package/lib/ele-menus/props.cjs +1 -3
- package/lib/ele-menus/props.d.ts +1 -3
- package/lib/ele-menus/style/css-var.scss +1 -5
- package/lib/ele-modal/index.cjs +176 -197
- package/lib/ele-modal/index.d.ts +12 -6
- package/lib/ele-modal/props.cjs +2 -0
- package/lib/ele-modal/props.d.ts +2 -0
- package/lib/ele-modal/style/index.scss +85 -146
- package/lib/ele-modal/util.cjs +53 -179
- package/lib/ele-modal/util.d.ts +18 -44
- package/lib/ele-pagination/index.cjs +4 -1
- package/lib/ele-pagination/index.d.ts +9 -0
- package/lib/ele-pagination/props.cjs +5 -0
- package/lib/ele-pagination/props.d.ts +5 -0
- package/lib/ele-popconfirm/index.cjs +5 -27
- package/lib/ele-popconfirm/index.d.ts +3 -3
- package/lib/ele-popover/index.cjs +5 -13
- package/lib/ele-popover/index.d.ts +2 -2
- package/lib/ele-pro-layout/components/pro-header.cjs +109 -19
- package/lib/ele-pro-layout/components/pro-header.d.ts +66 -11
- package/lib/ele-pro-layout/components/pro-sidebar.cjs +2 -5
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +2 -7
- package/lib/ele-pro-layout/components/pro-sidebox.cjs +2 -5
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +2 -7
- package/lib/ele-pro-layout/components/tab-dropdown.cjs +1 -1
- package/lib/ele-pro-layout/index.cjs +45 -29
- package/lib/ele-pro-layout/index.d.ts +25 -27
- package/lib/ele-pro-layout/props.cjs +2 -4
- package/lib/ele-pro-layout/props.d.ts +3 -6
- package/lib/ele-pro-layout/style/css-var.scss +3 -18
- package/lib/ele-pro-layout/style/header.scss +74 -9
- package/lib/ele-pro-layout/style/layout-mobile.scss +2 -2
- package/lib/ele-pro-layout/style/layout-style.scss +8 -3
- package/lib/ele-pro-layout/style/layout-theme.scss +48 -23
- package/lib/ele-pro-layout/style/layout.scss +23 -3
- package/lib/ele-pro-layout/style/sidebar.scss +0 -1
- package/lib/ele-pro-layout/style/tabs.scss +19 -11
- package/lib/ele-pro-layout/types.d.ts +1 -1
- package/lib/ele-pro-table/components/tool-print.cjs +0 -3
- package/lib/ele-pro-table/index.cjs +2 -1
- package/lib/ele-pro-table/index.d.ts +3 -5
- package/lib/ele-pro-table/util.d.ts +1 -1
- package/lib/ele-tab-wrap/index.cjs +2 -1
- package/lib/ele-table-select/index.cjs +27 -26
- package/lib/ele-table-select/index.d.ts +13 -12
- package/lib/ele-tabs/index.cjs +1 -0
- package/lib/ele-tabs/style/css-var.scss +1 -30
- package/lib/ele-tabs/style/index.scss +372 -241
- package/lib/ele-tabs/types.d.ts +2 -1
- package/lib/ele-tooltip/index.cjs +3 -0
- package/lib/ele-tooltip/props.cjs +2 -0
- package/lib/ele-tooltip/props.d.ts +5 -0
- package/lib/ele-virtual-table/style/index.scss +1 -1
- package/lib/icons/ResizeOutlined.cjs +29 -0
- package/lib/icons/ResizeOutlined.d.ts +2 -0
- package/lib/icons/index.cjs +2 -0
- package/lib/icons/index.d.ts +1 -0
- package/lib/style/themes/dark.scss +9 -15
- package/lib/style/themes/default.scss +56 -80
- package/lib/style/themes/rounded.scss +16 -30
- package/package.json +9 -9
package/es/ele-modal/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, unref, watch, onActivated, onDeactivated, nextTick, resolveComponent, openBlock, createBlock, Teleport, createVNode, mergeProps, createSlots, withCtx, createElementVNode, normalizeStyle,
|
|
1
|
+
import { defineComponent, ref, computed, unref, watch, onMounted, onActivated, onDeactivated, nextTick, resolveComponent, openBlock, createBlock, Teleport, createVNode, mergeProps, createSlots, withCtx, createElementVNode, normalizeStyle, renderSlot, createTextVNode, toDisplayString, createElementBlock, withModifiers, createCommentVNode, resolveDynamicComponent, normalizeClass } from "vue";
|
|
2
2
|
import { ElDialog, ElIcon } from "element-plus";
|
|
3
|
-
import { CloseOutlined, CompressOutlined, ExpandOutlined } from "../icons";
|
|
4
|
-
import { pick } from "../utils/core";
|
|
3
|
+
import { CloseOutlined, CompressOutlined, ExpandOutlined, ResizeOutlined } from "../icons";
|
|
5
4
|
import { useLayoutState } from "../ele-config-provider/receiver";
|
|
6
5
|
import ReceiverView from "../ele-config-provider/components/receiver-view";
|
|
7
|
-
import { getModalContainer,
|
|
8
|
-
import { modalProps, modalEmits
|
|
6
|
+
import { getModalContainer, wrapperClass, closedClass, getPositionMargin, handleMove, handleResize, topModal, resetModalStyle } from "./util";
|
|
7
|
+
import { modalProps, modalEmits } from "./props";
|
|
9
8
|
const _sfc_main = defineComponent({
|
|
10
9
|
name: "EleModal",
|
|
11
10
|
components: {
|
|
@@ -14,129 +13,81 @@ const _sfc_main = defineComponent({
|
|
|
14
13
|
CloseOutlined,
|
|
15
14
|
CompressOutlined,
|
|
16
15
|
ExpandOutlined,
|
|
16
|
+
ResizeOutlined,
|
|
17
17
|
ReceiverView
|
|
18
18
|
},
|
|
19
19
|
inheritAttrs: false,
|
|
20
20
|
props: modalProps,
|
|
21
21
|
emits: modalEmits,
|
|
22
|
-
setup(props, { emit
|
|
22
|
+
setup(props, { emit }) {
|
|
23
|
+
const state = { isInit: true };
|
|
23
24
|
const layoutProvide = useLayoutState();
|
|
24
25
|
const dialogRef = ref(null);
|
|
25
|
-
const teleportTo = ref(
|
|
26
|
-
getModalContainer(props.multiple, props.appendTo)
|
|
27
|
-
);
|
|
28
26
|
const isFullscreen = ref(props.fullscreen ?? false);
|
|
29
27
|
const isActivated = ref(true);
|
|
30
|
-
const dialogEnable = ref(
|
|
31
|
-
props.destroyOnClose && !props.modelValue ? false : true
|
|
32
|
-
);
|
|
33
28
|
const dialogClass = computed(() => {
|
|
34
29
|
const layoutState = unref(layoutProvide);
|
|
35
30
|
const classes = [wrapperClass];
|
|
36
31
|
if (props.responsive ?? (layoutState == null ? void 0 : layoutState.responsive) ?? true) {
|
|
37
|
-
classes.push(
|
|
32
|
+
classes.push("ele-modal-responsive");
|
|
38
33
|
}
|
|
39
|
-
if (props.
|
|
40
|
-
classes.push("ele-modal-form");
|
|
41
|
-
}
|
|
42
|
-
if (props.position) {
|
|
43
|
-
if (props.position === "top") {
|
|
44
|
-
classes.push("ele-modal-top");
|
|
45
|
-
} else if (props.position === "bottom") {
|
|
46
|
-
classes.push("ele-modal-bottom");
|
|
47
|
-
} else if (props.position === "left") {
|
|
48
|
-
classes.push("ele-modal-left");
|
|
49
|
-
} else if (props.position === "right") {
|
|
50
|
-
classes.push("ele-modal-right");
|
|
51
|
-
} else if (props.position === "leftTop") {
|
|
52
|
-
classes.push("ele-modal-left-top");
|
|
53
|
-
} else if (props.position === "leftBottom") {
|
|
54
|
-
classes.push("ele-modal-left-bottom");
|
|
55
|
-
} else if (props.position === "rightTop") {
|
|
56
|
-
classes.push("ele-modal-right-top");
|
|
57
|
-
} else if (props.position === "rightBottom") {
|
|
58
|
-
classes.push("ele-modal-right-bottom");
|
|
59
|
-
} else if (props.position === "center") {
|
|
60
|
-
classes.push("ele-modal-center");
|
|
61
|
-
}
|
|
62
|
-
} else if (props.alignCenter) {
|
|
34
|
+
if (props.alignCenter || props.position === "center") {
|
|
63
35
|
classes.push("ele-modal-center");
|
|
36
|
+
} else if (props.position === "top") {
|
|
37
|
+
classes.push("ele-modal-top");
|
|
38
|
+
} else if (props.position === "bottom") {
|
|
39
|
+
classes.push("ele-modal-bottom");
|
|
40
|
+
} else if (props.position === "left") {
|
|
41
|
+
classes.push("ele-modal-left");
|
|
42
|
+
} else if (props.position === "right") {
|
|
43
|
+
classes.push("ele-modal-right");
|
|
44
|
+
} else if (props.position === "leftTop") {
|
|
45
|
+
classes.push("ele-modal-left-top");
|
|
46
|
+
} else if (props.position === "leftBottom") {
|
|
47
|
+
classes.push("ele-modal-left-bottom");
|
|
48
|
+
} else if (props.position === "rightTop") {
|
|
49
|
+
classes.push("ele-modal-right-top");
|
|
50
|
+
} else if (props.position === "rightBottom") {
|
|
51
|
+
classes.push("ele-modal-right-bottom");
|
|
64
52
|
}
|
|
65
53
|
if (props.draggable) {
|
|
66
|
-
classes.push(
|
|
54
|
+
classes.push("ele-modal-movable");
|
|
67
55
|
}
|
|
68
56
|
if (props.resizable) {
|
|
69
|
-
classes.push(
|
|
70
|
-
if (typeof props.resizable === "string") {
|
|
71
|
-
classes.push(resizableClass + "-" + props.resizable);
|
|
72
|
-
}
|
|
57
|
+
classes.push("ele-modal-resizable");
|
|
73
58
|
}
|
|
74
59
|
if (props.multiple) {
|
|
75
|
-
classes.push(
|
|
60
|
+
classes.push("ele-modal-multiple");
|
|
76
61
|
}
|
|
77
62
|
if (isFullscreen.value) {
|
|
78
|
-
classes.push(
|
|
63
|
+
classes.push("ele-modal-fullscreen");
|
|
79
64
|
}
|
|
80
65
|
if (!props.modelValue) {
|
|
81
66
|
classes.push(closedClass);
|
|
82
67
|
}
|
|
83
68
|
if (!isActivated.value && props.modelValue) {
|
|
84
|
-
classes.push(
|
|
69
|
+
classes.push("ele-modal-hide");
|
|
85
70
|
}
|
|
86
71
|
if (props.inner) {
|
|
87
|
-
classes.push(
|
|
88
|
-
if (layoutState && layoutState.sidebar != null) {
|
|
89
|
-
if (layoutState.collapse && !layoutState.topLayout) {
|
|
90
|
-
classes.push(collapseClass);
|
|
91
|
-
}
|
|
92
|
-
if (layoutState.compact && layoutState.mixSidebar && !layoutState.topLayout) {
|
|
93
|
-
classes.push(compactClass);
|
|
94
|
-
}
|
|
95
|
-
if (layoutState.maximized) {
|
|
96
|
-
classes.push(maximizedClass);
|
|
97
|
-
}
|
|
98
|
-
if (layoutState.tabBar) {
|
|
99
|
-
classes.push(hasTabClass);
|
|
100
|
-
}
|
|
101
|
-
if (layoutState.mixSidebar && !layoutState.topLayout) {
|
|
102
|
-
classes.push(mixSidebarClass);
|
|
103
|
-
if (!layoutState.sidebar) {
|
|
104
|
-
classes.push(singleSidebarClass);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (layoutState.topLayout) {
|
|
108
|
-
classes.push(topLayoutClass);
|
|
109
|
-
}
|
|
110
|
-
if (layoutState.maximized && layoutState.expanded) {
|
|
111
|
-
classes.push(expandedClass);
|
|
112
|
-
}
|
|
113
|
-
if (layoutState.mobile) {
|
|
114
|
-
classes.push(mobileClass);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
72
|
+
classes.push("ele-modal-inner");
|
|
117
73
|
}
|
|
118
74
|
if (props.modalClass) {
|
|
119
75
|
classes.push(props.modalClass);
|
|
120
76
|
}
|
|
121
77
|
return classes.join(" ");
|
|
122
78
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
alignCenter: false,
|
|
131
|
-
destroyOnClose: false,
|
|
132
|
-
modalClass: dialogClass.value
|
|
133
|
-
};
|
|
134
|
-
return Object.assign({}, attrs, pick(props, dialogPropKeys), option);
|
|
79
|
+
const teleportTo = computed(() => {
|
|
80
|
+
return getModalContainer(
|
|
81
|
+
props.inner,
|
|
82
|
+
props.multiple,
|
|
83
|
+
props.appendTo,
|
|
84
|
+
layoutProvide ? unref(layoutProvide).modalsEl : void 0
|
|
85
|
+
);
|
|
135
86
|
});
|
|
136
87
|
const teleportDisabled = computed(() => {
|
|
137
88
|
const appendTo = props.appendTo || "body";
|
|
138
89
|
const disabled = appendTo === "body" ? !props.appendToBody : false;
|
|
139
|
-
return props.multiple ? false : disabled;
|
|
90
|
+
return props.multiple || props.inner ? false : disabled;
|
|
140
91
|
});
|
|
141
92
|
const getModalEl = () => {
|
|
142
93
|
var _a, _b;
|
|
@@ -145,64 +96,84 @@ const _sfc_main = defineComponent({
|
|
|
145
96
|
const getZIndex = () => {
|
|
146
97
|
return props.zIndex ?? 2e3;
|
|
147
98
|
};
|
|
99
|
+
const getPosition = () => {
|
|
100
|
+
if (props.alignCenter) {
|
|
101
|
+
return "center";
|
|
102
|
+
}
|
|
103
|
+
if (props.top != null && props.top !== "") {
|
|
104
|
+
return { top: props.top };
|
|
105
|
+
}
|
|
106
|
+
return props.position;
|
|
107
|
+
};
|
|
108
|
+
const setInitPosition = () => {
|
|
109
|
+
if (state.isInit) {
|
|
110
|
+
state.isInit = false;
|
|
111
|
+
const modalEl = getModalEl();
|
|
112
|
+
const margin = getPositionMargin(getPosition());
|
|
113
|
+
if (modalEl && margin != null) {
|
|
114
|
+
modalEl.style.margin = margin;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const mousedownListener = (event) => {
|
|
119
|
+
if (props.multiple) {
|
|
120
|
+
topModal(event.currentTarget, getZIndex());
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const handleHeaderMousedown = (event) => {
|
|
124
|
+
const modalEl = getModalEl();
|
|
125
|
+
if (!modalEl || !props.draggable || isFullscreen.value) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
handleMove(modalEl, event, props);
|
|
129
|
+
};
|
|
130
|
+
const handleResizeMousedown = (event) => {
|
|
131
|
+
const modalEl = getModalEl();
|
|
132
|
+
if (!modalEl || !props.resizable || isFullscreen.value) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
handleResize(modalEl, event, props);
|
|
136
|
+
};
|
|
148
137
|
const updateModelValue = (modelValue) => {
|
|
149
138
|
emit("update:modelValue", modelValue);
|
|
150
139
|
};
|
|
151
140
|
const toggleFullscreen = (fullscreen) => {
|
|
152
|
-
isFullscreen.value = fullscreen
|
|
141
|
+
isFullscreen.value = fullscreen ?? !isFullscreen.value;
|
|
153
142
|
nextTick(() => {
|
|
154
|
-
|
|
143
|
+
topModal(getModalEl(), getZIndex());
|
|
155
144
|
});
|
|
156
145
|
emit("update:fullscreen", isFullscreen.value);
|
|
157
146
|
};
|
|
158
|
-
const mousedownListener = (event) => {
|
|
159
|
-
handleMovable(event, props);
|
|
160
|
-
handleResizable(event, props);
|
|
161
|
-
setModalTop(event.currentTarget, getZIndex());
|
|
162
|
-
};
|
|
163
147
|
const onOpen = () => {
|
|
164
148
|
if (props.resetOnClose || props.destroyOnClose) {
|
|
165
149
|
isFullscreen.value = props.fullscreen ?? false;
|
|
166
150
|
}
|
|
167
|
-
if (!dialogEnable.value) {
|
|
168
|
-
dialogEnable.value = true;
|
|
169
|
-
}
|
|
170
151
|
nextTick(() => {
|
|
171
152
|
const modalEl = getModalEl();
|
|
172
153
|
if (props.resetOnClose) {
|
|
173
|
-
resetModalStyle(modalEl, props.width,
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
setInitPosition(
|
|
177
|
-
modalEl,
|
|
178
|
-
props.resizable,
|
|
179
|
-
props.position,
|
|
180
|
-
props.moveOut,
|
|
181
|
-
props.resetOnClose
|
|
182
|
-
);
|
|
154
|
+
resetModalStyle(modalEl, props.width, getPosition());
|
|
155
|
+
} else {
|
|
156
|
+
setInitPosition();
|
|
183
157
|
}
|
|
184
|
-
|
|
158
|
+
topModal(modalEl, getZIndex());
|
|
185
159
|
});
|
|
186
160
|
emit("open");
|
|
187
161
|
};
|
|
188
162
|
const onOpened = () => {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
|
|
163
|
+
const modalEl = getModalEl();
|
|
164
|
+
if (modalEl) {
|
|
165
|
+
modalEl.addEventListener("mousedown", mousedownListener);
|
|
192
166
|
}
|
|
193
167
|
emit("opened");
|
|
194
168
|
};
|
|
195
169
|
const onClose = () => {
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
|
|
170
|
+
const modalEl = getModalEl();
|
|
171
|
+
if (modalEl) {
|
|
172
|
+
modalEl.removeEventListener("mousedown", mousedownListener);
|
|
199
173
|
}
|
|
200
174
|
emit("close");
|
|
201
175
|
};
|
|
202
176
|
const onClosed = () => {
|
|
203
|
-
if (props.destroyOnClose && dialogEnable.value) {
|
|
204
|
-
dialogEnable.value = false;
|
|
205
|
-
}
|
|
206
177
|
emit("closed");
|
|
207
178
|
};
|
|
208
179
|
const onOpenAutoFocus = () => {
|
|
@@ -211,52 +182,17 @@ const _sfc_main = defineComponent({
|
|
|
211
182
|
const onCloseAutoFocus = () => {
|
|
212
183
|
emit("closeAutoFocus");
|
|
213
184
|
};
|
|
214
|
-
watch(
|
|
215
|
-
() => props.multiple,
|
|
216
|
-
(multiple) => {
|
|
217
|
-
teleportTo.value = getModalContainer(multiple, props.appendTo);
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
watch(
|
|
221
|
-
() => props.appendTo,
|
|
222
|
-
(appendTo) => {
|
|
223
|
-
if (!props.multiple) {
|
|
224
|
-
teleportTo.value = getModalContainer(false, appendTo);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
185
|
watch(
|
|
229
186
|
() => props.fullscreen,
|
|
230
187
|
(fullscreen) => {
|
|
231
188
|
isFullscreen.value = fullscreen ?? false;
|
|
232
189
|
}
|
|
233
190
|
);
|
|
234
|
-
|
|
235
|
-
()
|
|
236
|
-
|
|
237
|
-
if (props.modelValue && position && typeof position === "object") {
|
|
238
|
-
setInitPosition(
|
|
239
|
-
getModalEl(),
|
|
240
|
-
props.resizable,
|
|
241
|
-
position,
|
|
242
|
-
props.moveOut,
|
|
243
|
-
true
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
watch(
|
|
249
|
-
() => props.destroyOnClose,
|
|
250
|
-
(destroyOnClose) => {
|
|
251
|
-
if (destroyOnClose) {
|
|
252
|
-
if (!props.modelValue && dialogEnable.value) {
|
|
253
|
-
dialogEnable.value = false;
|
|
254
|
-
}
|
|
255
|
-
} else if (!dialogEnable.value) {
|
|
256
|
-
dialogEnable.value = true;
|
|
257
|
-
}
|
|
191
|
+
onMounted(() => {
|
|
192
|
+
if (props.modelValue) {
|
|
193
|
+
setInitPosition();
|
|
258
194
|
}
|
|
259
|
-
);
|
|
195
|
+
});
|
|
260
196
|
onActivated(() => {
|
|
261
197
|
isActivated.value = true;
|
|
262
198
|
});
|
|
@@ -265,11 +201,12 @@ const _sfc_main = defineComponent({
|
|
|
265
201
|
});
|
|
266
202
|
return {
|
|
267
203
|
dialogRef,
|
|
268
|
-
teleportTo,
|
|
269
204
|
isFullscreen,
|
|
270
|
-
|
|
271
|
-
|
|
205
|
+
dialogClass,
|
|
206
|
+
teleportTo,
|
|
272
207
|
teleportDisabled,
|
|
208
|
+
handleHeaderMousedown,
|
|
209
|
+
handleResizeMousedown,
|
|
273
210
|
updateModelValue,
|
|
274
211
|
toggleFullscreen,
|
|
275
212
|
onOpen,
|
|
@@ -288,20 +225,41 @@ const _export_sfc = (sfc, props) => {
|
|
|
288
225
|
}
|
|
289
226
|
return target;
|
|
290
227
|
};
|
|
291
|
-
const _hoisted_1 = ["onClick"];
|
|
292
228
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
293
229
|
const _component_CompressOutlined = resolveComponent("CompressOutlined");
|
|
294
230
|
const _component_ExpandOutlined = resolveComponent("ExpandOutlined");
|
|
295
231
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
296
232
|
const _component_CloseOutlined = resolveComponent("CloseOutlined");
|
|
233
|
+
const _component_ResizeOutlined = resolveComponent("ResizeOutlined");
|
|
297
234
|
const _component_ReceiverView = resolveComponent("ReceiverView");
|
|
298
235
|
const _component_ElDialog = resolveComponent("ElDialog");
|
|
299
236
|
return openBlock(), createBlock(Teleport, {
|
|
300
237
|
to: _ctx.teleportTo,
|
|
301
238
|
disabled: _ctx.teleportDisabled
|
|
302
239
|
}, [
|
|
303
|
-
createVNode(_component_ElDialog, mergeProps(_ctx
|
|
240
|
+
createVNode(_component_ElDialog, mergeProps(_ctx.$attrs, {
|
|
304
241
|
ref: "dialogRef",
|
|
242
|
+
modelValue: _ctx.modelValue,
|
|
243
|
+
title: _ctx.title,
|
|
244
|
+
width: _ctx.width,
|
|
245
|
+
fullscreen: false,
|
|
246
|
+
modal: _ctx.multiple ? false : _ctx.modal,
|
|
247
|
+
modalClass: _ctx.dialogClass,
|
|
248
|
+
appendToBody: false,
|
|
249
|
+
lockScroll: _ctx.inner || _ctx.multiple ? false : _ctx.lockScroll,
|
|
250
|
+
openDelay: _ctx.openDelay,
|
|
251
|
+
closeDelay: _ctx.closeDelay,
|
|
252
|
+
closeOnClickModal: _ctx.closeOnClickModal,
|
|
253
|
+
closeOnPressEscape: _ctx.closeOnPressEscape,
|
|
254
|
+
showClose: false,
|
|
255
|
+
beforeClose: _ctx.beforeClose,
|
|
256
|
+
draggable: false,
|
|
257
|
+
overflow: false,
|
|
258
|
+
center: _ctx.center,
|
|
259
|
+
alignCenter: false,
|
|
260
|
+
destroyOnClose: _ctx.destroyOnClose,
|
|
261
|
+
zIndex: _ctx.zIndex,
|
|
262
|
+
headerAriaLevel: _ctx.headerAriaLevel,
|
|
305
263
|
"onUpdate:modelValue": _ctx.updateModelValue,
|
|
306
264
|
onOpen: _ctx.onOpen,
|
|
307
265
|
onOpened: _ctx.onOpened,
|
|
@@ -312,11 +270,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
312
270
|
}), createSlots({
|
|
313
271
|
header: withCtx(({ close, titleId, titleClass }) => [
|
|
314
272
|
createElementVNode("div", {
|
|
273
|
+
style: normalizeStyle(_ctx.headerStyle),
|
|
315
274
|
class: "ele-modal-header",
|
|
316
|
-
|
|
275
|
+
onMousedown: _cache[4] || (_cache[4] = (...args) => _ctx.handleHeaderMousedown && _ctx.handleHeaderMousedown(...args))
|
|
317
276
|
}, [
|
|
318
|
-
|
|
319
|
-
key: 0,
|
|
277
|
+
createElementVNode("div", {
|
|
320
278
|
class: "ele-modal-title",
|
|
321
279
|
style: normalizeStyle(_ctx.titleStyle)
|
|
322
280
|
}, [
|
|
@@ -327,12 +285,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
327
285
|
}, () => [
|
|
328
286
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
329
287
|
])
|
|
330
|
-
], 4)
|
|
331
|
-
_ctx.
|
|
332
|
-
key:
|
|
288
|
+
], 4),
|
|
289
|
+
_ctx.maxable ? (openBlock(), createElementBlock("div", {
|
|
290
|
+
key: 0,
|
|
333
291
|
class: "ele-modal-tool",
|
|
334
292
|
style: normalizeStyle(_ctx.fullscreenBtnStyle),
|
|
335
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggleFullscreen())
|
|
293
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggleFullscreen()),
|
|
294
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
295
|
+
}, ["stop"]))
|
|
336
296
|
}, [
|
|
337
297
|
renderSlot(_ctx.$slots, "maxIcon", { fullscreen: _ctx.isFullscreen }, () => [
|
|
338
298
|
createVNode(_component_ElIcon, null, {
|
|
@@ -342,53 +302,72 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
342
302
|
_: 1
|
|
343
303
|
})
|
|
344
304
|
])
|
|
345
|
-
],
|
|
346
|
-
_ctx.
|
|
347
|
-
key:
|
|
305
|
+
], 36)) : createCommentVNode("", true),
|
|
306
|
+
_ctx.showClose ? (openBlock(), createElementBlock("div", {
|
|
307
|
+
key: 1,
|
|
348
308
|
class: "ele-modal-tool",
|
|
349
309
|
style: normalizeStyle(_ctx.closeBtnStyle),
|
|
350
|
-
onClick:
|
|
310
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.updateModelValue(false)),
|
|
311
|
+
onMousedown: _cache[3] || (_cache[3] = withModifiers(() => {
|
|
312
|
+
}, ["stop"]))
|
|
351
313
|
}, [
|
|
352
314
|
renderSlot(_ctx.$slots, "closeIcon", {}, () => [
|
|
353
315
|
createVNode(_component_ElIcon, null, {
|
|
354
316
|
default: withCtx(() => [
|
|
355
|
-
|
|
317
|
+
_ctx.closeIcon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon), { key: 0 })) : (openBlock(), createBlock(_component_CloseOutlined, { key: 1 }))
|
|
356
318
|
]),
|
|
357
319
|
_: 1
|
|
358
320
|
})
|
|
359
321
|
])
|
|
360
|
-
],
|
|
361
|
-
],
|
|
322
|
+
], 36)) : createCommentVNode("", true)
|
|
323
|
+
], 36),
|
|
324
|
+
_ctx.resizable ? (openBlock(), createElementBlock("div", {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: normalizeClass([
|
|
327
|
+
"ele-modal-resize-icon",
|
|
328
|
+
{ "is-horizontal": _ctx.resizable === "horizontal" },
|
|
329
|
+
{ "is-vertical": _ctx.resizable === "vertical" }
|
|
330
|
+
]),
|
|
331
|
+
style: normalizeStyle(_ctx.resizeIconStyle),
|
|
332
|
+
onMousedown: _cache[5] || (_cache[5] = (...args) => _ctx.handleResizeMousedown && _ctx.handleResizeMousedown(...args))
|
|
333
|
+
}, [
|
|
334
|
+
renderSlot(_ctx.$slots, "resizeIcon", {}, () => [
|
|
335
|
+
createVNode(_component_ElIcon, null, {
|
|
336
|
+
default: withCtx(() => [
|
|
337
|
+
createVNode(_component_ResizeOutlined)
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
})
|
|
341
|
+
])
|
|
342
|
+
], 38)) : createCommentVNode("", true)
|
|
362
343
|
]),
|
|
363
344
|
default: withCtx(() => [
|
|
364
|
-
|
|
365
|
-
key: 0,
|
|
345
|
+
createVNode(_component_ReceiverView, {
|
|
366
346
|
wrapPosition: false,
|
|
367
|
-
class: "ele-modal-body",
|
|
347
|
+
class: normalizeClass(["ele-modal-body", { "is-form": _ctx.form }]),
|
|
368
348
|
style: normalizeStyle(_ctx.bodyStyle)
|
|
369
349
|
}, {
|
|
370
350
|
default: withCtx(() => [
|
|
371
351
|
renderSlot(_ctx.$slots, "default")
|
|
372
352
|
]),
|
|
373
353
|
_: 3
|
|
374
|
-
}, 8, ["
|
|
354
|
+
}, 8, ["class", "style"])
|
|
375
355
|
]),
|
|
376
356
|
_: 2
|
|
377
357
|
}, [
|
|
378
358
|
_ctx.$slots.footer ? {
|
|
379
359
|
name: "footer",
|
|
380
360
|
fn: withCtx(() => [
|
|
381
|
-
|
|
382
|
-
key: 0,
|
|
361
|
+
createElementVNode("div", {
|
|
383
362
|
class: "ele-modal-footer",
|
|
384
363
|
style: normalizeStyle(_ctx.footerStyle)
|
|
385
364
|
}, [
|
|
386
365
|
renderSlot(_ctx.$slots, "footer")
|
|
387
|
-
], 4)
|
|
366
|
+
], 4)
|
|
388
367
|
]),
|
|
389
368
|
key: "0"
|
|
390
369
|
} : void 0
|
|
391
|
-
]), 1040, ["onUpdate:modelValue", "onOpen", "onOpened", "onClose", "onClosed", "onOpenAutoFocus", "onCloseAutoFocus"])
|
|
370
|
+
]), 1040, ["modelValue", "title", "width", "modal", "modalClass", "lockScroll", "openDelay", "closeDelay", "closeOnClickModal", "closeOnPressEscape", "beforeClose", "center", "destroyOnClose", "zIndex", "headerAriaLevel", "onUpdate:modelValue", "onOpen", "onOpened", "onClose", "onClosed", "onOpenAutoFocus", "onCloseAutoFocus"])
|
|
392
371
|
], 8, ["to", "disabled"]);
|
|
393
372
|
}
|
|
394
373
|
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
package/es/ele-modal/props.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export declare const modalProps: {
|
|
|
53
53
|
closeBtnStyle: PropType<Partial<import('vue').CSSProperties>>;
|
|
54
54
|
/** 自定义全屏按钮样式 */
|
|
55
55
|
fullscreenBtnStyle: PropType<Partial<import('vue').CSSProperties>>;
|
|
56
|
+
/** 拉伸图标样式 */
|
|
57
|
+
resizeIconStyle: PropType<Partial<import('vue').CSSProperties>>;
|
|
56
58
|
/** 是否开启响应式 */
|
|
57
59
|
responsive: {
|
|
58
60
|
type: BooleanConstructor;
|