ele-admin-plus 1.1.9-beta.2 → 1.1.9-beta.4
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-app/el.d.ts +9 -0
- package/es/ele-app/style/overwrite/message-box/index.scss +5 -0
- package/es/ele-basic-select/index.d.ts +2 -2
- package/es/ele-check-card/index.d.ts +1 -1
- package/es/ele-drawer/index.d.ts +1 -1
- package/es/ele-dropdown/index.d.ts +2 -2
- package/es/ele-dropdown/index.js +1 -0
- package/es/ele-icon-select/index.d.ts +3 -3
- package/es/ele-map-picker/index.d.ts +1 -1
- package/es/ele-menus/index.d.ts +10 -2
- package/es/ele-menus/index.js +17 -4
- package/es/ele-menus/props.d.ts +8 -2
- package/es/ele-menus/props.js +9 -3
- package/es/ele-menus/style/index.scss +12 -11
- package/es/ele-menus/types.d.ts +9 -9
- package/es/ele-menus/util.d.ts +21 -15
- package/es/ele-menus/util.js +92 -83
- package/es/ele-modal/index.d.ts +2 -2
- package/es/ele-modal/index.js +27 -4
- package/es/ele-modal/style/index.scss +58 -12
- package/es/ele-modal/types.d.ts +2 -10
- package/es/ele-modal/util.d.ts +3 -3
- package/es/ele-modal/util.js +22 -57
- package/es/ele-printer/util.js +3 -1
- package/es/ele-pro-layout/components/pro-header.d.ts +23 -11
- package/es/ele-pro-layout/components/pro-header.js +68 -15
- package/es/ele-pro-layout/components/pro-iframe.js +46 -23
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +21 -15
- package/es/ele-pro-layout/components/pro-sidebar.js +36 -14
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +23 -11
- package/es/ele-pro-layout/components/pro-sidebox.js +46 -14
- package/es/ele-pro-layout/components/tab-dropdown.js +5 -1
- package/es/ele-pro-layout/index.d.ts +40 -27
- package/es/ele-pro-layout/index.js +269 -52
- package/es/ele-pro-layout/props.d.ts +5 -0
- package/es/ele-pro-layout/props.js +5 -0
- package/es/ele-pro-layout/types.d.ts +29 -3
- package/es/ele-segmented/index.d.ts +1 -1
- package/es/ele-table-select/index.d.ts +5 -5
- package/es/ele-tree-select/index.d.ts +5 -5
- package/es/ele-upload-list/components/list-item.d.ts +5 -1
- package/es/ele-upload-list/components/list-item.js +7 -4
- package/es/ele-upload-list/index.d.ts +10 -6
- package/es/ele-upload-list/index.js +7 -5
- package/es/ele-upload-list/props.d.ts +6 -2
- package/es/ele-upload-list/props.js +5 -1
- package/es/ele-virtual-table/components/body-cell.d.ts +1 -1
- package/es/ele-virtual-table/index.d.ts +1 -1
- package/lib/ele-app/el.d.ts +9 -0
- package/lib/ele-app/style/overwrite/message-box/index.scss +5 -0
- package/lib/ele-basic-select/index.d.ts +2 -2
- package/lib/ele-check-card/index.d.ts +1 -1
- package/lib/ele-drawer/index.d.ts +1 -1
- package/lib/ele-dropdown/index.cjs +1 -0
- package/lib/ele-dropdown/index.d.ts +2 -2
- package/lib/ele-icon-select/index.d.ts +3 -3
- package/lib/ele-map-picker/index.d.ts +1 -1
- package/lib/ele-menus/index.cjs +17 -4
- package/lib/ele-menus/index.d.ts +10 -2
- package/lib/ele-menus/props.cjs +9 -3
- package/lib/ele-menus/props.d.ts +8 -2
- package/lib/ele-menus/style/index.scss +12 -11
- package/lib/ele-menus/types.d.ts +9 -9
- package/lib/ele-menus/util.cjs +92 -83
- package/lib/ele-menus/util.d.ts +21 -15
- package/lib/ele-modal/index.cjs +27 -4
- package/lib/ele-modal/index.d.ts +2 -2
- package/lib/ele-modal/style/index.scss +58 -12
- package/lib/ele-modal/types.d.ts +2 -10
- package/lib/ele-modal/util.cjs +22 -57
- package/lib/ele-modal/util.d.ts +3 -3
- package/lib/ele-printer/util.cjs +3 -1
- package/lib/ele-pro-layout/components/pro-header.cjs +67 -14
- package/lib/ele-pro-layout/components/pro-header.d.ts +23 -11
- package/lib/ele-pro-layout/components/pro-iframe.cjs +45 -22
- package/lib/ele-pro-layout/components/pro-sidebar.cjs +36 -14
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +21 -15
- package/lib/ele-pro-layout/components/pro-sidebox.cjs +46 -14
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +23 -11
- package/lib/ele-pro-layout/components/tab-dropdown.cjs +5 -1
- package/lib/ele-pro-layout/index.cjs +269 -52
- package/lib/ele-pro-layout/index.d.ts +40 -27
- package/lib/ele-pro-layout/props.cjs +5 -0
- package/lib/ele-pro-layout/props.d.ts +5 -0
- package/lib/ele-pro-layout/types.d.ts +29 -3
- package/lib/ele-segmented/index.d.ts +1 -1
- package/lib/ele-table-select/index.d.ts +5 -5
- package/lib/ele-tree-select/index.d.ts +5 -5
- package/lib/ele-upload-list/components/list-item.cjs +6 -3
- package/lib/ele-upload-list/components/list-item.d.ts +5 -1
- package/lib/ele-upload-list/index.cjs +7 -5
- package/lib/ele-upload-list/index.d.ts +10 -6
- package/lib/ele-upload-list/props.cjs +5 -1
- package/lib/ele-upload-list/props.d.ts +6 -2
- package/lib/ele-virtual-table/components/body-cell.d.ts +1 -1
- package/lib/ele-virtual-table/index.d.ts +1 -1
- package/package.json +1 -1
package/es/ele-menus/util.js
CHANGED
|
@@ -5,26 +5,22 @@ import { isExternalLink, getCurrentStyle, debounce } from "../utils/core";
|
|
|
5
5
|
import { ArrowDown, ArrowRight } from "../icons";
|
|
6
6
|
const linkClass = "ele-menu-link";
|
|
7
7
|
const titleClass = "ele-menu-title";
|
|
8
|
+
const triggerClass = "ele-menu-trigger";
|
|
8
9
|
const overflowClass = "ele-menu-overflow";
|
|
9
10
|
const ellipsisClass = "ele-sub-menu-ellipsis";
|
|
10
|
-
function getLinkNode(
|
|
11
|
-
if (
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (isExternalLink(item.path)) {
|
|
11
|
+
function getLinkNode(path) {
|
|
12
|
+
if (isExternalLink(path)) {
|
|
15
13
|
return h("a", {
|
|
16
|
-
href:
|
|
14
|
+
href: path,
|
|
17
15
|
target: "_blank",
|
|
18
|
-
class: linkClass
|
|
19
|
-
onClick: (e) => {
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
onItemClick && onItemClick(item);
|
|
22
|
-
}
|
|
16
|
+
class: linkClass
|
|
23
17
|
});
|
|
24
18
|
}
|
|
25
|
-
|
|
19
|
+
if (path) {
|
|
20
|
+
return h(RouterLink, { to: path, class: linkClass });
|
|
21
|
+
}
|
|
26
22
|
}
|
|
27
|
-
function getNodes(icons, titles, badge,
|
|
23
|
+
function getNodes(icons, titles, badge, trigger) {
|
|
28
24
|
const nodes = [];
|
|
29
25
|
if (icons) {
|
|
30
26
|
icons.forEach((t) => {
|
|
@@ -39,18 +35,19 @@ function getNodes(icons, titles, badge, link) {
|
|
|
39
35
|
if (badge) {
|
|
40
36
|
nodes.push(badge);
|
|
41
37
|
}
|
|
42
|
-
if (
|
|
43
|
-
nodes.push(
|
|
38
|
+
if (trigger) {
|
|
39
|
+
nodes.push(trigger);
|
|
44
40
|
}
|
|
45
41
|
return nodes;
|
|
46
42
|
}
|
|
47
|
-
function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorful, popupColorful, firstPopClass, first, onItemClick) {
|
|
43
|
+
function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorful, popupColorful, firstPopClass, first, onItemClick, onItemMouseenter, onItemMouseleave, webkit) {
|
|
48
44
|
const nodes = [];
|
|
49
45
|
if (!items) {
|
|
50
46
|
return nodes;
|
|
51
47
|
}
|
|
52
48
|
items.forEach((item) => {
|
|
53
49
|
var _a;
|
|
50
|
+
const key = item.key || item.index || item.path;
|
|
54
51
|
const iNodes = sIcon ? sIcon({ item, icon: item.icon }) ?? [] : [];
|
|
55
52
|
if (!iNodes.length && item.icon) {
|
|
56
53
|
iNodes.push(
|
|
@@ -65,27 +62,40 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
|
|
|
65
62
|
}
|
|
66
63
|
const bNode = item.badge != null ? h(ElBadge, item.badge) : null;
|
|
67
64
|
if (!((_a = item.children) == null ? void 0 : _a.length)) {
|
|
68
|
-
const
|
|
69
|
-
|
|
65
|
+
const triggerNode = h(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
class: triggerClass,
|
|
69
|
+
onClick: (e) => {
|
|
70
|
+
onItemClick && onItemClick(item, e);
|
|
71
|
+
},
|
|
72
|
+
onMouseenter: (e) => {
|
|
73
|
+
onItemMouseenter && onItemMouseenter(item, e);
|
|
74
|
+
},
|
|
75
|
+
onMouseleave: (e) => {
|
|
76
|
+
onItemMouseleave && onItemMouseleave(item, e);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
getLinkNode(item.path)
|
|
80
|
+
);
|
|
70
81
|
nodes.push(
|
|
71
82
|
h(
|
|
72
83
|
ElMenuItem,
|
|
73
84
|
{
|
|
74
85
|
key: key + "-" + tipDisabled,
|
|
75
|
-
index: item.index,
|
|
86
|
+
index: item.index || item.path,
|
|
76
87
|
route: item.route,
|
|
77
88
|
disabled: item.disabled,
|
|
78
89
|
class: item.overflow ? overflowClass : void 0,
|
|
79
90
|
onClick: () => {
|
|
80
|
-
onItemClick && onItemClick(item);
|
|
81
91
|
}
|
|
82
92
|
},
|
|
83
93
|
{
|
|
84
94
|
default: () => {
|
|
85
|
-
if (
|
|
86
|
-
return getNodes(iNodes,
|
|
95
|
+
if (first && !tipDisabled) {
|
|
96
|
+
return getNodes(iNodes, void 0, bNode, triggerNode);
|
|
87
97
|
}
|
|
88
|
-
return getNodes(iNodes,
|
|
98
|
+
return getNodes(iNodes, tNodes, bNode, triggerNode);
|
|
89
99
|
},
|
|
90
100
|
title: first && !tipDisabled ? () => tNodes : void 0
|
|
91
101
|
}
|
|
@@ -95,47 +105,45 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
|
|
|
95
105
|
}
|
|
96
106
|
if (item.group === true) {
|
|
97
107
|
nodes.push(
|
|
98
|
-
h(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
)
|
|
108
|
+
h(ElMenuItemGroup, { key }, {
|
|
109
|
+
default: () => {
|
|
110
|
+
return renderItems(
|
|
111
|
+
item.children,
|
|
112
|
+
sIcon,
|
|
113
|
+
sTitle,
|
|
114
|
+
tipDisabled,
|
|
115
|
+
theme,
|
|
116
|
+
popTheme,
|
|
117
|
+
colorful,
|
|
118
|
+
popupColorful,
|
|
119
|
+
firstPopClass,
|
|
120
|
+
first,
|
|
121
|
+
onItemClick,
|
|
122
|
+
onItemMouseenter,
|
|
123
|
+
onItemMouseleave
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
title: () => getNodes(iNodes, tNodes, bNode)
|
|
127
|
+
})
|
|
120
128
|
);
|
|
121
129
|
return;
|
|
122
130
|
}
|
|
123
|
-
const popperClass = getPopperClass(
|
|
124
|
-
item.popperClass,
|
|
125
|
-
theme,
|
|
126
|
-
popTheme,
|
|
127
|
-
colorful,
|
|
128
|
-
popupColorful,
|
|
129
|
-
firstPopClass,
|
|
130
|
-
first
|
|
131
|
-
);
|
|
132
131
|
nodes.push(
|
|
133
132
|
h(
|
|
134
133
|
ElSubMenu,
|
|
135
134
|
{
|
|
136
|
-
key
|
|
137
|
-
index: item.index,
|
|
138
|
-
popperClass
|
|
135
|
+
key,
|
|
136
|
+
index: item.index || item.path,
|
|
137
|
+
popperClass: getPopperClass(
|
|
138
|
+
item.popperClass,
|
|
139
|
+
theme,
|
|
140
|
+
popTheme,
|
|
141
|
+
colorful,
|
|
142
|
+
popupColorful,
|
|
143
|
+
firstPopClass,
|
|
144
|
+
first,
|
|
145
|
+
webkit
|
|
146
|
+
),
|
|
139
147
|
showTimeout: item.showTimeout,
|
|
140
148
|
hideTimeout: item.hideTimeout,
|
|
141
149
|
disabled: item.disabled,
|
|
@@ -164,7 +172,9 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
|
|
|
164
172
|
popupColorful,
|
|
165
173
|
firstPopClass,
|
|
166
174
|
false,
|
|
167
|
-
onItemClick
|
|
175
|
+
onItemClick,
|
|
176
|
+
onItemMouseenter,
|
|
177
|
+
onItemMouseleave
|
|
168
178
|
);
|
|
169
179
|
},
|
|
170
180
|
title: () => getNodes(iNodes, tNodes, bNode)
|
|
@@ -174,6 +184,25 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
|
|
|
174
184
|
});
|
|
175
185
|
return nodes;
|
|
176
186
|
}
|
|
187
|
+
function getPopperClass(customerClass, theme, popTheme, colorful, popupColorful, firstPopClass, first, webkit) {
|
|
188
|
+
const popperClass = ["ele-menu"];
|
|
189
|
+
if (webkit) {
|
|
190
|
+
popperClass.push("is-webkit");
|
|
191
|
+
}
|
|
192
|
+
if (popTheme === "dark" || popTheme === "auto" && theme === "dark") {
|
|
193
|
+
popperClass.push("is-night ele-menu-dark");
|
|
194
|
+
}
|
|
195
|
+
if (popupColorful === true || popupColorful === "auto" && colorful) {
|
|
196
|
+
popperClass.push("is-colorful ele-menu-colorful");
|
|
197
|
+
}
|
|
198
|
+
if (first && firstPopClass) {
|
|
199
|
+
popperClass.push(firstPopClass);
|
|
200
|
+
}
|
|
201
|
+
if (customerClass) {
|
|
202
|
+
popperClass.push(customerClass);
|
|
203
|
+
}
|
|
204
|
+
return popperClass.join(" ");
|
|
205
|
+
}
|
|
177
206
|
function getMenuItems(menus, index, horizontal) {
|
|
178
207
|
if (!horizontal || !menus || !menus.length) {
|
|
179
208
|
return { items: menus };
|
|
@@ -188,36 +217,16 @@ function getMenuItems(menus, index, horizontal) {
|
|
|
188
217
|
const moreItems = index === 0 ? data : data.slice(index);
|
|
189
218
|
moreItems.forEach((d) => {
|
|
190
219
|
var _a;
|
|
191
|
-
const children = ((_a = d.children) == null ? void 0 : _a.length) ? [null] : void 0;
|
|
192
220
|
items.push({
|
|
193
221
|
...d,
|
|
222
|
+
key: `overflow-${d.key || d.index || d.path}`,
|
|
223
|
+
index: `overflow-${d.index || d.path}`,
|
|
194
224
|
overflow: true,
|
|
195
|
-
|
|
196
|
-
index: `overflow-${d.index}`,
|
|
197
|
-
children
|
|
225
|
+
children: ((_a = d.children) == null ? void 0 : _a.length) ? [null] : void 0
|
|
198
226
|
});
|
|
199
227
|
});
|
|
200
228
|
return { items, moreItems };
|
|
201
229
|
}
|
|
202
|
-
function getPopperClass(customerClass, theme, popTheme, colorful, popupColorful, firstPopClass, first) {
|
|
203
|
-
const popperClass = ["ele-menu"];
|
|
204
|
-
if (navigator.userAgent.includes("WebKit")) {
|
|
205
|
-
popperClass.push("is-webkit");
|
|
206
|
-
}
|
|
207
|
-
if (popTheme === "dark" || popTheme === "auto" && theme === "dark") {
|
|
208
|
-
popperClass.push("is-night ele-menu-dark");
|
|
209
|
-
}
|
|
210
|
-
if (popupColorful === true || popupColorful === "auto" && colorful) {
|
|
211
|
-
popperClass.push("is-colorful ele-menu-colorful");
|
|
212
|
-
}
|
|
213
|
-
if (first && firstPopClass) {
|
|
214
|
-
popperClass.push(firstPopClass);
|
|
215
|
-
}
|
|
216
|
-
if (customerClass) {
|
|
217
|
-
popperClass.push(customerClass);
|
|
218
|
-
}
|
|
219
|
-
return popperClass.join(" ");
|
|
220
|
-
}
|
|
221
230
|
function getMenuWidth(el) {
|
|
222
231
|
if (!el) {
|
|
223
232
|
return;
|
|
@@ -237,8 +246,7 @@ function getItemWidth(el) {
|
|
|
237
246
|
return el.offsetWidth + ml + mr;
|
|
238
247
|
}
|
|
239
248
|
function getMenuChilds(el) {
|
|
240
|
-
|
|
241
|
-
return childs.filter((t) => {
|
|
249
|
+
return Array.from(el.childNodes ?? []).filter((t) => {
|
|
242
250
|
return t.nodeName === "LI" && !t.classList.contains(ellipsisClass);
|
|
243
251
|
});
|
|
244
252
|
}
|
|
@@ -310,5 +318,6 @@ export {
|
|
|
310
318
|
overflowClass,
|
|
311
319
|
renderItems,
|
|
312
320
|
titleClass,
|
|
321
|
+
triggerClass,
|
|
313
322
|
useMenuEllipsis
|
|
314
323
|
};
|
package/es/ele-modal/index.d.ts
CHANGED
|
@@ -198,11 +198,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
198
198
|
title: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
199
199
|
ariaLevel: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, unknown, unknown, "2", boolean>;
|
|
200
200
|
}>> & {
|
|
201
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
201
202
|
onOpen?: (() => any) | undefined;
|
|
202
203
|
onClose?: (() => any) | undefined;
|
|
203
204
|
onOpenAutoFocus?: (() => any) | undefined;
|
|
204
205
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
205
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
206
206
|
onOpened?: (() => any) | undefined;
|
|
207
207
|
onClosed?: (() => any) | undefined;
|
|
208
208
|
"onUpdate:fullscreen"?: ((_fullscreen: boolean) => any) | undefined;
|
|
@@ -229,8 +229,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
229
229
|
showClose: import("element-plus/es/utils/index").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
230
230
|
ariaLevel: string;
|
|
231
231
|
minWidth: number;
|
|
232
|
-
minHeight: number;
|
|
233
232
|
multiple: boolean;
|
|
233
|
+
minHeight: number;
|
|
234
234
|
responsive: boolean;
|
|
235
235
|
resetOnClose: boolean;
|
|
236
236
|
maxable: boolean;
|
package/es/ele-modal/index.js
CHANGED
|
@@ -38,6 +38,29 @@ const _sfc_main = defineComponent({
|
|
|
38
38
|
if (props.form) {
|
|
39
39
|
classes.push("ele-modal-form");
|
|
40
40
|
}
|
|
41
|
+
if (props.position) {
|
|
42
|
+
if (props.position === "top") {
|
|
43
|
+
classes.push("ele-modal-top");
|
|
44
|
+
} else if (props.position === "bottom") {
|
|
45
|
+
classes.push("ele-modal-bottom");
|
|
46
|
+
} else if (props.position === "left") {
|
|
47
|
+
classes.push("ele-modal-left");
|
|
48
|
+
} else if (props.position === "right") {
|
|
49
|
+
classes.push("ele-modal-right");
|
|
50
|
+
} else if (props.position === "leftTop") {
|
|
51
|
+
classes.push("ele-modal-left-top");
|
|
52
|
+
} else if (props.position === "leftBottom") {
|
|
53
|
+
classes.push("ele-modal-left-bottom");
|
|
54
|
+
} else if (props.position === "rightTop") {
|
|
55
|
+
classes.push("ele-modal-right-top");
|
|
56
|
+
} else if (props.position === "rightBottom") {
|
|
57
|
+
classes.push("ele-modal-right-bottom");
|
|
58
|
+
} else if (props.position === "center") {
|
|
59
|
+
classes.push("ele-modal-center");
|
|
60
|
+
}
|
|
61
|
+
} else if (props.alignCenter) {
|
|
62
|
+
classes.push("ele-modal-center");
|
|
63
|
+
}
|
|
41
64
|
if (props.draggable) {
|
|
42
65
|
classes.push(movableClass);
|
|
43
66
|
}
|
|
@@ -97,7 +120,7 @@ const _sfc_main = defineComponent({
|
|
|
97
120
|
return classes.join(" ");
|
|
98
121
|
});
|
|
99
122
|
const dialogProps = computed(() => {
|
|
100
|
-
const
|
|
123
|
+
const option = {
|
|
101
124
|
fullscreen: false,
|
|
102
125
|
modal: props.multiple ? false : props.modal,
|
|
103
126
|
appendToBody: false,
|
|
@@ -107,7 +130,7 @@ const _sfc_main = defineComponent({
|
|
|
107
130
|
destroyOnClose: false,
|
|
108
131
|
modalClass: dialogClass.value
|
|
109
132
|
};
|
|
110
|
-
return Object.assign({}, attrs, pick(props, dialogPropKeys),
|
|
133
|
+
return Object.assign({}, attrs, pick(props, dialogPropKeys), option);
|
|
111
134
|
});
|
|
112
135
|
const teleportDisabled = computed(() => {
|
|
113
136
|
const appendTo = props.appendTo || "body";
|
|
@@ -148,7 +171,7 @@ const _sfc_main = defineComponent({
|
|
|
148
171
|
if (props.resetOnClose) {
|
|
149
172
|
resetModalStyle(modalEl, props.width, props.top);
|
|
150
173
|
}
|
|
151
|
-
if (props.position) {
|
|
174
|
+
if (props.position && typeof props.position === "object") {
|
|
152
175
|
setInitPosition(
|
|
153
176
|
modalEl,
|
|
154
177
|
props.resizable,
|
|
@@ -210,7 +233,7 @@ const _sfc_main = defineComponent({
|
|
|
210
233
|
watch(
|
|
211
234
|
() => props.position,
|
|
212
235
|
(position) => {
|
|
213
|
-
if (position &&
|
|
236
|
+
if (props.modelValue && position && typeof position === "object") {
|
|
214
237
|
setInitPosition(
|
|
215
238
|
getModalEl(),
|
|
216
239
|
props.resizable,
|
|
@@ -11,15 +11,23 @@
|
|
|
11
11
|
|
|
12
12
|
& > .el-overlay-dialog {
|
|
13
13
|
position: absolute;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
align-items: center;
|
|
14
18
|
|
|
15
19
|
& > .el-dialog {
|
|
20
|
+
padding: 0;
|
|
21
|
+
position: relative;
|
|
16
22
|
background: eleVar('modal', 'bg');
|
|
17
23
|
border-radius: eleVar('modal', 'radius');
|
|
18
|
-
padding: 0;
|
|
19
24
|
|
|
25
|
+
& > .el-dialog__header,
|
|
20
26
|
& > .el-dialog__footer {
|
|
27
|
+
flex-shrink: 0;
|
|
21
28
|
border: none;
|
|
22
29
|
padding: 0;
|
|
30
|
+
margin: 0;
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
& > .el-dialog__body {
|
|
@@ -27,12 +35,6 @@
|
|
|
27
35
|
color: inherit;
|
|
28
36
|
font-size: inherit;
|
|
29
37
|
}
|
|
30
|
-
|
|
31
|
-
& > .el-dialog__header {
|
|
32
|
-
margin: 0;
|
|
33
|
-
padding: 0;
|
|
34
|
-
border: none;
|
|
35
|
-
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -101,6 +103,55 @@
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
/* 默认位置 */
|
|
107
|
+
.ele-modal-center > .el-overlay-dialog > .el-dialog,
|
|
108
|
+
.ele-modal-top > .el-overlay-dialog > .el-dialog,
|
|
109
|
+
.ele-modal-bottom > .el-overlay-dialog > .el-dialog,
|
|
110
|
+
.ele-modal-left > .el-overlay-dialog > .el-dialog,
|
|
111
|
+
.ele-modal-right > .el-overlay-dialog > .el-dialog,
|
|
112
|
+
.ele-modal-left-top > .el-overlay-dialog > .el-dialog,
|
|
113
|
+
.ele-modal-left-bottom > .el-overlay-dialog > .el-dialog,
|
|
114
|
+
.ele-modal-right-top > .el-overlay-dialog > .el-dialog,
|
|
115
|
+
.ele-modal-right-bottom > .el-overlay-dialog > .el-dialog {
|
|
116
|
+
margin: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ele-modal-center > .el-overlay-dialog {
|
|
120
|
+
justify-content: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ele-modal-bottom > .el-overlay-dialog {
|
|
124
|
+
justify-content: flex-end;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ele-modal-left > .el-overlay-dialog {
|
|
128
|
+
justify-content: center;
|
|
129
|
+
align-items: flex-start;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ele-modal-right > .el-overlay-dialog {
|
|
133
|
+
justify-content: center;
|
|
134
|
+
align-items: flex-end;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ele-modal-left-top > .el-overlay-dialog {
|
|
138
|
+
align-items: flex-start;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ele-modal-left-bottom > .el-overlay-dialog {
|
|
142
|
+
justify-content: flex-end;
|
|
143
|
+
align-items: flex-start;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ele-modal-right-top > .el-overlay-dialog {
|
|
147
|
+
align-items: flex-end;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ele-modal-right-bottom > .el-overlay-dialog {
|
|
151
|
+
justify-content: flex-end;
|
|
152
|
+
align-items: flex-end;
|
|
153
|
+
}
|
|
154
|
+
|
|
104
155
|
/* 支持拖拽 */
|
|
105
156
|
.ele-modal-movable > .el-overlay-dialog > .el-dialog > .el-dialog__header {
|
|
106
157
|
cursor: move;
|
|
@@ -135,10 +186,6 @@
|
|
|
135
186
|
display: flex;
|
|
136
187
|
flex-direction: column;
|
|
137
188
|
|
|
138
|
-
& > .el-dialog__header {
|
|
139
|
-
flex-shrink: 0;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
189
|
& > .el-dialog__body {
|
|
143
190
|
flex: auto;
|
|
144
191
|
overflow: auto;
|
|
@@ -186,7 +233,6 @@
|
|
|
186
233
|
|
|
187
234
|
& > .el-overlay-dialog {
|
|
188
235
|
pointer-events: none;
|
|
189
|
-
position: absolute;
|
|
190
236
|
overflow: hidden;
|
|
191
237
|
|
|
192
238
|
& > .el-dialog {
|
package/es/ele-modal/types.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export type MoveOut = boolean | MoveOutValue[];
|
|
|
19
19
|
export interface PositionObject {
|
|
20
20
|
top?: string | number;
|
|
21
21
|
left?: string | number;
|
|
22
|
+
bottom?: string | number;
|
|
23
|
+
right?: string | number;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/**
|
|
@@ -39,13 +41,3 @@ export type PositionValue =
|
|
|
39
41
|
* 初始位置类型
|
|
40
42
|
*/
|
|
41
43
|
export type Position = PositionValue | PositionObject;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 弹窗坐标
|
|
45
|
-
*/
|
|
46
|
-
export interface Location {
|
|
47
|
-
top?: number;
|
|
48
|
-
left?: number;
|
|
49
|
-
topValue?: string;
|
|
50
|
-
leftValue?: string;
|
|
51
|
-
}
|
package/es/ele-modal/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Resizable,
|
|
1
|
+
import type { Resizable, PositionObject, MoveOut } from './types';
|
|
2
2
|
import type { ModalProps } from './props';
|
|
3
3
|
export declare const wrapperClass = "ele-modal";
|
|
4
4
|
export declare const containerId = "ele-modal-container";
|
|
@@ -58,7 +58,7 @@ export declare function resetModalStyle(modalEl?: HTMLElement, width?: string |
|
|
|
58
58
|
* @param resizable 是否可以拉伸
|
|
59
59
|
* @param moveOut 是否可以拉出容器
|
|
60
60
|
*/
|
|
61
|
-
export declare function setModalPosition(modalEl?: HTMLElement, resizable?: Resizable, position?:
|
|
61
|
+
export declare function setModalPosition(modalEl?: HTMLElement, resizable?: Resizable, position?: PositionObject, moveOut?: MoveOut): void;
|
|
62
62
|
/**
|
|
63
63
|
* 设置弹窗初始位置
|
|
64
64
|
* @param modalEl 弹窗节点
|
|
@@ -67,4 +67,4 @@ export declare function setModalPosition(modalEl?: HTMLElement, resizable?: Resi
|
|
|
67
67
|
* @param moveOut 是否可以拉出容器
|
|
68
68
|
* @param force 是否强制更新
|
|
69
69
|
*/
|
|
70
|
-
export declare function setInitPosition(modalEl?: HTMLElement, resizable?: Resizable, position?:
|
|
70
|
+
export declare function setInitPosition(modalEl?: HTMLElement, resizable?: Resizable, position?: PositionObject, moveOut?: MoveOut, force?: boolean): void;
|
package/es/ele-modal/util.js
CHANGED
|
@@ -28,7 +28,7 @@ function initModalStyle(modalEl, resizable) {
|
|
|
28
28
|
modalEl.style.bottom = "auto";
|
|
29
29
|
modalEl.style.right = "auto";
|
|
30
30
|
modalEl.style.margin = "0";
|
|
31
|
-
modalEl.style.position = "
|
|
31
|
+
modalEl.style.position = "absolute";
|
|
32
32
|
modalEl.style.display = resizable ? "inline-flex" : "inline-block";
|
|
33
33
|
modalEl.style.verticalAlign = "top";
|
|
34
34
|
}
|
|
@@ -245,78 +245,43 @@ function resetModalStyle(modalEl, width, top) {
|
|
|
245
245
|
modalEl.style.minWidth = "";
|
|
246
246
|
}
|
|
247
247
|
function setModalPosition(modalEl, resizable, position, moveOut) {
|
|
248
|
-
if (!modalEl) {
|
|
248
|
+
if (!position || typeof position !== "object" || !modalEl) {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
const wrapEl = modalEl.parentElement;
|
|
252
252
|
if (!wrapEl) {
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
-
const location = {};
|
|
256
255
|
initModalStyle(modalEl, resizable);
|
|
256
|
+
const location = {};
|
|
257
257
|
const canOutB = canMoveOut(moveOut, "bottom");
|
|
258
258
|
const canOutR = canMoveOut(moveOut, "right");
|
|
259
259
|
const t = wrapEl.clientHeight - modalEl.clientHeight - (canOutB ? 0 : fixTop);
|
|
260
260
|
const maxTop = t < 0 ? 0 : t;
|
|
261
261
|
const l = wrapEl.clientWidth - modalEl.clientWidth - (canOutR ? 0 : fixLeft);
|
|
262
262
|
const maxLeft = l < 0 ? 0 : l;
|
|
263
|
-
if (position
|
|
264
|
-
location.top =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
location.left = maxLeft / 2;
|
|
269
|
-
} else if (position === "left") {
|
|
270
|
-
location.top = maxTop / 2;
|
|
271
|
-
location.left = 0;
|
|
272
|
-
} else if (position === "right") {
|
|
263
|
+
if (position.top != null) {
|
|
264
|
+
location.top = position.top;
|
|
265
|
+
} else if (position.bottom != null) {
|
|
266
|
+
location.bottom = position.bottom;
|
|
267
|
+
} else if (position.left != null || position.right != null) {
|
|
273
268
|
location.top = maxTop / 2;
|
|
274
|
-
location.left = maxLeft;
|
|
275
|
-
} else if (position === "leftTop") {
|
|
276
|
-
location.top = 0;
|
|
277
|
-
location.left = 0;
|
|
278
|
-
} else if (position === "leftBottom") {
|
|
279
|
-
location.top = maxTop;
|
|
280
|
-
location.left = 0;
|
|
281
|
-
} else if (position === "rightTop") {
|
|
282
|
-
location.top = 0;
|
|
283
|
-
location.left = maxLeft;
|
|
284
|
-
} else if (position === "rightBottom") {
|
|
285
|
-
location.top = maxTop;
|
|
286
|
-
location.left = maxLeft;
|
|
287
|
-
} else if (position === "center") {
|
|
288
|
-
location.top = maxTop / 2;
|
|
289
|
-
location.left = maxLeft / 2;
|
|
290
|
-
} else if (typeof position === "object") {
|
|
291
|
-
if (position.top != null) {
|
|
292
|
-
if (typeof position.top === "number") {
|
|
293
|
-
location.top = position.top;
|
|
294
|
-
} else {
|
|
295
|
-
location.topValue = position.top;
|
|
296
|
-
}
|
|
297
|
-
} else if (position.left != null) {
|
|
298
|
-
location.top = maxTop / 2;
|
|
299
|
-
}
|
|
300
|
-
if (position.left != null) {
|
|
301
|
-
if (typeof position.left === "number") {
|
|
302
|
-
location.left = position.left;
|
|
303
|
-
} else {
|
|
304
|
-
location.leftValue = position.left;
|
|
305
|
-
}
|
|
306
|
-
} else if (position.top != null) {
|
|
307
|
-
location.left = maxLeft / 2;
|
|
308
|
-
}
|
|
309
269
|
}
|
|
310
|
-
if (
|
|
311
|
-
|
|
312
|
-
} else if (
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
modalEl.style.left = `${Math.floor(location.left)}px`;
|
|
317
|
-
} else if (location.leftValue != null) {
|
|
318
|
-
modalEl.style.left = location.leftValue;
|
|
270
|
+
if (position.left != null) {
|
|
271
|
+
location.left = position.left;
|
|
272
|
+
} else if (position.right != null) {
|
|
273
|
+
location.right = position.right;
|
|
274
|
+
} else if (position.top != null || position.bottom != null) {
|
|
275
|
+
location.left = maxLeft / 2;
|
|
319
276
|
}
|
|
277
|
+
Object.keys(location).forEach((key) => {
|
|
278
|
+
const value = location[key];
|
|
279
|
+
if (typeof value === "number") {
|
|
280
|
+
modalEl.style[key] = `${Math.floor(value)}px`;
|
|
281
|
+
} else if (value != null) {
|
|
282
|
+
modalEl.style[key] = value;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
320
285
|
}
|
|
321
286
|
function setInitPosition(modalEl, resizable, position, moveOut, force) {
|
|
322
287
|
const attr = "ele-position";
|
package/es/ele-printer/util.js
CHANGED
|
@@ -134,10 +134,12 @@ function usePrinter(done) {
|
|
|
134
134
|
function printPdf(option) {
|
|
135
135
|
const pFrame = getPrintFrame();
|
|
136
136
|
pFrame.onload = () => {
|
|
137
|
-
|
|
137
|
+
const url = pFrame.getAttribute("src");
|
|
138
|
+
if (!!url) {
|
|
138
139
|
pFrame.focus();
|
|
139
140
|
pFrame.contentWindow && pFrame.contentWindow.print(option.options);
|
|
140
141
|
option.done && option.done();
|
|
142
|
+
URL.revokeObjectURL(url);
|
|
141
143
|
}
|
|
142
144
|
};
|
|
143
145
|
const doPrint2 = (buffer) => {
|