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.
Files changed (97) hide show
  1. package/es/ele-app/el.d.ts +9 -0
  2. package/es/ele-app/style/overwrite/message-box/index.scss +5 -0
  3. package/es/ele-basic-select/index.d.ts +2 -2
  4. package/es/ele-check-card/index.d.ts +1 -1
  5. package/es/ele-drawer/index.d.ts +1 -1
  6. package/es/ele-dropdown/index.d.ts +2 -2
  7. package/es/ele-dropdown/index.js +1 -0
  8. package/es/ele-icon-select/index.d.ts +3 -3
  9. package/es/ele-map-picker/index.d.ts +1 -1
  10. package/es/ele-menus/index.d.ts +10 -2
  11. package/es/ele-menus/index.js +17 -4
  12. package/es/ele-menus/props.d.ts +8 -2
  13. package/es/ele-menus/props.js +9 -3
  14. package/es/ele-menus/style/index.scss +12 -11
  15. package/es/ele-menus/types.d.ts +9 -9
  16. package/es/ele-menus/util.d.ts +21 -15
  17. package/es/ele-menus/util.js +92 -83
  18. package/es/ele-modal/index.d.ts +2 -2
  19. package/es/ele-modal/index.js +27 -4
  20. package/es/ele-modal/style/index.scss +58 -12
  21. package/es/ele-modal/types.d.ts +2 -10
  22. package/es/ele-modal/util.d.ts +3 -3
  23. package/es/ele-modal/util.js +22 -57
  24. package/es/ele-printer/util.js +3 -1
  25. package/es/ele-pro-layout/components/pro-header.d.ts +23 -11
  26. package/es/ele-pro-layout/components/pro-header.js +68 -15
  27. package/es/ele-pro-layout/components/pro-iframe.js +46 -23
  28. package/es/ele-pro-layout/components/pro-sidebar.d.ts +21 -15
  29. package/es/ele-pro-layout/components/pro-sidebar.js +36 -14
  30. package/es/ele-pro-layout/components/pro-sidebox.d.ts +23 -11
  31. package/es/ele-pro-layout/components/pro-sidebox.js +46 -14
  32. package/es/ele-pro-layout/components/tab-dropdown.js +5 -1
  33. package/es/ele-pro-layout/index.d.ts +40 -27
  34. package/es/ele-pro-layout/index.js +269 -52
  35. package/es/ele-pro-layout/props.d.ts +5 -0
  36. package/es/ele-pro-layout/props.js +5 -0
  37. package/es/ele-pro-layout/types.d.ts +29 -3
  38. package/es/ele-segmented/index.d.ts +1 -1
  39. package/es/ele-table-select/index.d.ts +5 -5
  40. package/es/ele-tree-select/index.d.ts +5 -5
  41. package/es/ele-upload-list/components/list-item.d.ts +5 -1
  42. package/es/ele-upload-list/components/list-item.js +7 -4
  43. package/es/ele-upload-list/index.d.ts +10 -6
  44. package/es/ele-upload-list/index.js +7 -5
  45. package/es/ele-upload-list/props.d.ts +6 -2
  46. package/es/ele-upload-list/props.js +5 -1
  47. package/es/ele-virtual-table/components/body-cell.d.ts +1 -1
  48. package/es/ele-virtual-table/index.d.ts +1 -1
  49. package/lib/ele-app/el.d.ts +9 -0
  50. package/lib/ele-app/style/overwrite/message-box/index.scss +5 -0
  51. package/lib/ele-basic-select/index.d.ts +2 -2
  52. package/lib/ele-check-card/index.d.ts +1 -1
  53. package/lib/ele-drawer/index.d.ts +1 -1
  54. package/lib/ele-dropdown/index.cjs +1 -0
  55. package/lib/ele-dropdown/index.d.ts +2 -2
  56. package/lib/ele-icon-select/index.d.ts +3 -3
  57. package/lib/ele-map-picker/index.d.ts +1 -1
  58. package/lib/ele-menus/index.cjs +17 -4
  59. package/lib/ele-menus/index.d.ts +10 -2
  60. package/lib/ele-menus/props.cjs +9 -3
  61. package/lib/ele-menus/props.d.ts +8 -2
  62. package/lib/ele-menus/style/index.scss +12 -11
  63. package/lib/ele-menus/types.d.ts +9 -9
  64. package/lib/ele-menus/util.cjs +92 -83
  65. package/lib/ele-menus/util.d.ts +21 -15
  66. package/lib/ele-modal/index.cjs +27 -4
  67. package/lib/ele-modal/index.d.ts +2 -2
  68. package/lib/ele-modal/style/index.scss +58 -12
  69. package/lib/ele-modal/types.d.ts +2 -10
  70. package/lib/ele-modal/util.cjs +22 -57
  71. package/lib/ele-modal/util.d.ts +3 -3
  72. package/lib/ele-printer/util.cjs +3 -1
  73. package/lib/ele-pro-layout/components/pro-header.cjs +67 -14
  74. package/lib/ele-pro-layout/components/pro-header.d.ts +23 -11
  75. package/lib/ele-pro-layout/components/pro-iframe.cjs +45 -22
  76. package/lib/ele-pro-layout/components/pro-sidebar.cjs +36 -14
  77. package/lib/ele-pro-layout/components/pro-sidebar.d.ts +21 -15
  78. package/lib/ele-pro-layout/components/pro-sidebox.cjs +46 -14
  79. package/lib/ele-pro-layout/components/pro-sidebox.d.ts +23 -11
  80. package/lib/ele-pro-layout/components/tab-dropdown.cjs +5 -1
  81. package/lib/ele-pro-layout/index.cjs +269 -52
  82. package/lib/ele-pro-layout/index.d.ts +40 -27
  83. package/lib/ele-pro-layout/props.cjs +5 -0
  84. package/lib/ele-pro-layout/props.d.ts +5 -0
  85. package/lib/ele-pro-layout/types.d.ts +29 -3
  86. package/lib/ele-segmented/index.d.ts +1 -1
  87. package/lib/ele-table-select/index.d.ts +5 -5
  88. package/lib/ele-tree-select/index.d.ts +5 -5
  89. package/lib/ele-upload-list/components/list-item.cjs +6 -3
  90. package/lib/ele-upload-list/components/list-item.d.ts +5 -1
  91. package/lib/ele-upload-list/index.cjs +7 -5
  92. package/lib/ele-upload-list/index.d.ts +10 -6
  93. package/lib/ele-upload-list/props.cjs +5 -1
  94. package/lib/ele-upload-list/props.d.ts +6 -2
  95. package/lib/ele-virtual-table/components/body-cell.d.ts +1 -1
  96. package/lib/ele-virtual-table/index.d.ts +1 -1
  97. package/package.json +1 -1
@@ -7,26 +7,22 @@ const core = require("../utils/core");
7
7
  const icons = require("../icons");
8
8
  const linkClass = "ele-menu-link";
9
9
  const titleClass = "ele-menu-title";
10
+ const triggerClass = "ele-menu-trigger";
10
11
  const overflowClass = "ele-menu-overflow";
11
12
  const ellipsisClass = "ele-sub-menu-ellipsis";
12
- function getLinkNode(item, onItemClick) {
13
- if (!(item == null ? void 0 : item.path)) {
14
- return;
15
- }
16
- if (core.isExternalLink(item.path)) {
13
+ function getLinkNode(path) {
14
+ if (core.isExternalLink(path)) {
17
15
  return vue.h("a", {
18
- href: item.path,
16
+ href: path,
19
17
  target: "_blank",
20
- class: linkClass,
21
- onClick: (e) => {
22
- e.stopPropagation();
23
- onItemClick && onItemClick(item);
24
- }
18
+ class: linkClass
25
19
  });
26
20
  }
27
- return vue.h(vueRouter.RouterLink, { to: item.path, class: linkClass });
21
+ if (path) {
22
+ return vue.h(vueRouter.RouterLink, { to: path, class: linkClass });
23
+ }
28
24
  }
29
- function getNodes(icons2, titles, badge, link) {
25
+ function getNodes(icons2, titles, badge, trigger) {
30
26
  const nodes = [];
31
27
  if (icons2) {
32
28
  icons2.forEach((t) => {
@@ -41,18 +37,19 @@ function getNodes(icons2, titles, badge, link) {
41
37
  if (badge) {
42
38
  nodes.push(badge);
43
39
  }
44
- if (link) {
45
- nodes.push(link);
40
+ if (trigger) {
41
+ nodes.push(trigger);
46
42
  }
47
43
  return nodes;
48
44
  }
49
- function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorful, popupColorful, firstPopClass, first, onItemClick) {
45
+ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorful, popupColorful, firstPopClass, first, onItemClick, onItemMouseenter, onItemMouseleave, webkit) {
50
46
  const nodes = [];
51
47
  if (!items) {
52
48
  return nodes;
53
49
  }
54
50
  items.forEach((item) => {
55
51
  var _a;
52
+ const key = item.key || item.index || item.path;
56
53
  const iNodes = sIcon ? sIcon({ item, icon: item.icon }) ?? [] : [];
57
54
  if (!iNodes.length && item.icon) {
58
55
  iNodes.push(
@@ -67,27 +64,40 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
67
64
  }
68
65
  const bNode = item.badge != null ? vue.h(elementPlus.ElBadge, item.badge) : null;
69
66
  if (!((_a = item.children) == null ? void 0 : _a.length)) {
70
- const linkNode = getLinkNode(item, onItemClick);
71
- const key = item.key || item.index || item.path;
67
+ const triggerNode = vue.h(
68
+ "div",
69
+ {
70
+ class: triggerClass,
71
+ onClick: (e) => {
72
+ onItemClick && onItemClick(item, e);
73
+ },
74
+ onMouseenter: (e) => {
75
+ onItemMouseenter && onItemMouseenter(item, e);
76
+ },
77
+ onMouseleave: (e) => {
78
+ onItemMouseleave && onItemMouseleave(item, e);
79
+ }
80
+ },
81
+ getLinkNode(item.path)
82
+ );
72
83
  nodes.push(
73
84
  vue.h(
74
85
  elementPlus.ElMenuItem,
75
86
  {
76
87
  key: key + "-" + tipDisabled,
77
- index: item.index,
88
+ index: item.index || item.path,
78
89
  route: item.route,
79
90
  disabled: item.disabled,
80
91
  class: item.overflow ? overflowClass : void 0,
81
92
  onClick: () => {
82
- onItemClick && onItemClick(item);
83
93
  }
84
94
  },
85
95
  {
86
96
  default: () => {
87
- if (!first || tipDisabled) {
88
- return getNodes(iNodes, tNodes, bNode, linkNode);
97
+ if (first && !tipDisabled) {
98
+ return getNodes(iNodes, void 0, bNode, triggerNode);
89
99
  }
90
- return getNodes(iNodes, void 0, bNode, linkNode);
100
+ return getNodes(iNodes, tNodes, bNode, triggerNode);
91
101
  },
92
102
  title: first && !tipDisabled ? () => tNodes : void 0
93
103
  }
@@ -97,47 +107,45 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
97
107
  }
98
108
  if (item.group === true) {
99
109
  nodes.push(
100
- vue.h(
101
- elementPlus.ElMenuItemGroup,
102
- { key: item.key || item.index },
103
- {
104
- default: () => {
105
- return renderItems(
106
- item.children,
107
- sIcon,
108
- sTitle,
109
- tipDisabled,
110
- theme,
111
- popTheme,
112
- colorful,
113
- popupColorful,
114
- firstPopClass,
115
- first,
116
- onItemClick
117
- );
118
- },
119
- title: () => getNodes(iNodes, tNodes, bNode)
120
- }
121
- )
110
+ vue.h(elementPlus.ElMenuItemGroup, { key }, {
111
+ default: () => {
112
+ return renderItems(
113
+ item.children,
114
+ sIcon,
115
+ sTitle,
116
+ tipDisabled,
117
+ theme,
118
+ popTheme,
119
+ colorful,
120
+ popupColorful,
121
+ firstPopClass,
122
+ first,
123
+ onItemClick,
124
+ onItemMouseenter,
125
+ onItemMouseleave
126
+ );
127
+ },
128
+ title: () => getNodes(iNodes, tNodes, bNode)
129
+ })
122
130
  );
123
131
  return;
124
132
  }
125
- const popperClass = getPopperClass(
126
- item.popperClass,
127
- theme,
128
- popTheme,
129
- colorful,
130
- popupColorful,
131
- firstPopClass,
132
- first
133
- );
134
133
  nodes.push(
135
134
  vue.h(
136
135
  elementPlus.ElSubMenu,
137
136
  {
138
- key: item.key || item.index,
139
- index: item.index,
140
- popperClass,
137
+ key,
138
+ index: item.index || item.path,
139
+ popperClass: getPopperClass(
140
+ item.popperClass,
141
+ theme,
142
+ popTheme,
143
+ colorful,
144
+ popupColorful,
145
+ firstPopClass,
146
+ first,
147
+ webkit
148
+ ),
141
149
  showTimeout: item.showTimeout,
142
150
  hideTimeout: item.hideTimeout,
143
151
  disabled: item.disabled,
@@ -166,7 +174,9 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
166
174
  popupColorful,
167
175
  firstPopClass,
168
176
  false,
169
- onItemClick
177
+ onItemClick,
178
+ onItemMouseenter,
179
+ onItemMouseleave
170
180
  );
171
181
  },
172
182
  title: () => getNodes(iNodes, tNodes, bNode)
@@ -176,6 +186,25 @@ function renderItems(items, sIcon, sTitle, tipDisabled, theme, popTheme, colorfu
176
186
  });
177
187
  return nodes;
178
188
  }
189
+ function getPopperClass(customerClass, theme, popTheme, colorful, popupColorful, firstPopClass, first, webkit) {
190
+ const popperClass = ["ele-menu"];
191
+ if (webkit) {
192
+ popperClass.push("is-webkit");
193
+ }
194
+ if (popTheme === "dark" || popTheme === "auto" && theme === "dark") {
195
+ popperClass.push("is-night ele-menu-dark");
196
+ }
197
+ if (popupColorful === true || popupColorful === "auto" && colorful) {
198
+ popperClass.push("is-colorful ele-menu-colorful");
199
+ }
200
+ if (first && firstPopClass) {
201
+ popperClass.push(firstPopClass);
202
+ }
203
+ if (customerClass) {
204
+ popperClass.push(customerClass);
205
+ }
206
+ return popperClass.join(" ");
207
+ }
179
208
  function getMenuItems(menus, index, horizontal) {
180
209
  if (!horizontal || !menus || !menus.length) {
181
210
  return { items: menus };
@@ -190,36 +219,16 @@ function getMenuItems(menus, index, horizontal) {
190
219
  const moreItems = index === 0 ? data : data.slice(index);
191
220
  moreItems.forEach((d) => {
192
221
  var _a;
193
- const children = ((_a = d.children) == null ? void 0 : _a.length) ? [null] : void 0;
194
222
  items.push({
195
223
  ...d,
224
+ key: `overflow-${d.key || d.index || d.path}`,
225
+ index: `overflow-${d.index || d.path}`,
196
226
  overflow: true,
197
- key: `overflow-${d.key || d.index}`,
198
- index: `overflow-${d.index}`,
199
- children
227
+ children: ((_a = d.children) == null ? void 0 : _a.length) ? [null] : void 0
200
228
  });
201
229
  });
202
230
  return { items, moreItems };
203
231
  }
204
- function getPopperClass(customerClass, theme, popTheme, colorful, popupColorful, firstPopClass, first) {
205
- const popperClass = ["ele-menu"];
206
- if (navigator.userAgent.includes("WebKit")) {
207
- popperClass.push("is-webkit");
208
- }
209
- if (popTheme === "dark" || popTheme === "auto" && theme === "dark") {
210
- popperClass.push("is-night ele-menu-dark");
211
- }
212
- if (popupColorful === true || popupColorful === "auto" && colorful) {
213
- popperClass.push("is-colorful ele-menu-colorful");
214
- }
215
- if (first && firstPopClass) {
216
- popperClass.push(firstPopClass);
217
- }
218
- if (customerClass) {
219
- popperClass.push(customerClass);
220
- }
221
- return popperClass.join(" ");
222
- }
223
232
  function getMenuWidth(el) {
224
233
  if (!el) {
225
234
  return;
@@ -239,8 +248,7 @@ function getItemWidth(el) {
239
248
  return el.offsetWidth + ml + mr;
240
249
  }
241
250
  function getMenuChilds(el) {
242
- const childs = Array.from(el.childNodes ?? []);
243
- return childs.filter((t) => {
251
+ return Array.from(el.childNodes ?? []).filter((t) => {
244
252
  return t.nodeName === "LI" && !t.classList.contains(ellipsisClass);
245
253
  });
246
254
  }
@@ -311,4 +319,5 @@ exports.linkClass = linkClass;
311
319
  exports.overflowClass = overflowClass;
312
320
  exports.renderItems = renderItems;
313
321
  exports.titleClass = titleClass;
322
+ exports.triggerClass = triggerClass;
314
323
  exports.useMenuEllipsis = useMenuEllipsis;
@@ -1,9 +1,11 @@
1
1
  import type { VNode, Slot } from 'vue';
2
- import type { MenuItem, MenuTheme, PopupMenuTheme, PopupColorful, MenuResult, MenuEllipsisOption, ItemClick } from './types';
3
- /** 菜单链接类名 */
2
+ import type { MenuItem, MenuTheme, PopupMenuTheme, PopupColorful, MenuResult, MenuEllipsisOption, MenuItemEvent } from './types';
3
+ /** 子菜单项链接类名 */
4
4
  export declare const linkClass = "ele-menu-link";
5
5
  /** 菜单标题类名 */
6
6
  export declare const titleClass = "ele-menu-title";
7
+ /** 子菜单项事件触发元素类名 */
8
+ export declare const triggerClass = "ele-menu-trigger";
7
9
  /** 菜单溢出隐藏项类名 */
8
10
  export declare const overflowClass = "ele-menu-overflow";
9
11
  /** 菜单省略项的类名 */
@@ -12,20 +14,20 @@ export declare const ellipsisClass = "ele-sub-menu-ellipsis";
12
14
  * 生成菜单链接节点
13
15
  * @param path 链接地址
14
16
  */
15
- export declare function getLinkNode(item: MenuItem, onItemClick?: ItemClick): VNode | undefined;
17
+ export declare function getLinkNode(path?: string): VNode | undefined;
16
18
  /**
17
19
  * 生成菜单内容节点
18
20
  * @param icons 图标节点
19
21
  * @param titles 标题节点
20
22
  * @param badge 徽章节点
21
- * @param link 链接节点
23
+ * @param trigger 子菜单项事件触发元素节点
22
24
  */
23
- export declare function getNodes(icons?: VNode[], titles?: VNode[], badge?: VNode | null, link?: VNode | null): VNode[];
25
+ export declare function getNodes(icons?: VNode[], titles?: VNode[], badge?: VNode | null, trigger?: VNode | null): VNode[];
24
26
  /**
25
27
  * 递归生成菜单节点
26
28
  * @param items 菜单数据
27
29
  * @param sIcon 图标插槽
28
- * @param sTitle 白哦提插槽
30
+ * @param sTitle 标题插槽
29
31
  * @param tipDisabled 是否禁用折叠的tooltip
30
32
  * @param theme 主题
31
33
  * @param popTheme 气泡菜单主题
@@ -33,15 +35,12 @@ export declare function getNodes(icons?: VNode[], titles?: VNode[], badge?: VNod
33
35
  * @param popupColorful 气泡菜单是否彩色图标
34
36
  * @param firstPopClass 第一级气泡菜单类名
35
37
  * @param first 是否是第一级菜单
38
+ * @param onItemClick 子菜单项点击事件
39
+ * @param onItemMouseenter 子菜单项鼠标进入事件
40
+ * @param onItemMouseenter 子菜单项鼠标离开事件
41
+ * @param webkit 是否时webkit内核
36
42
  */
37
- export declare function renderItems(items?: MenuItem[], sIcon?: Slot, sTitle?: Slot, tipDisabled?: boolean, theme?: MenuTheme, popTheme?: PopupMenuTheme, colorful?: boolean, popupColorful?: PopupColorful, firstPopClass?: string, first?: boolean, onItemClick?: ItemClick): VNode[];
38
- /**
39
- * 生成菜单数据
40
- * @param items 菜单数据
41
- * @param index 省略位置
42
- * @param horizontal 是否是水平菜单
43
- */
44
- export declare function getMenuItems(menus?: MenuItem[], index?: number, horizontal?: boolean): MenuResult;
43
+ export declare function renderItems(items?: MenuItem[], sIcon?: Slot, sTitle?: Slot, tipDisabled?: boolean, theme?: MenuTheme, popTheme?: PopupMenuTheme, colorful?: boolean, popupColorful?: PopupColorful, firstPopClass?: string, first?: boolean, onItemClick?: MenuItemEvent, onItemMouseenter?: MenuItemEvent, onItemMouseleave?: MenuItemEvent, webkit?: boolean): VNode[];
45
44
  /**
46
45
  * 生成气泡菜单的类名
47
46
  * @param customerClass 自定义的类名
@@ -52,7 +51,14 @@ export declare function getMenuItems(menus?: MenuItem[], index?: number, horizon
52
51
  * @param firstPopClass 第一级气泡菜单类名
53
52
  * @param first 是否是第一级菜单
54
53
  */
55
- export declare function getPopperClass(customerClass?: string, theme?: MenuTheme, popTheme?: PopupMenuTheme, colorful?: boolean, popupColorful?: PopupColorful, firstPopClass?: string, first?: boolean): string;
54
+ export declare function getPopperClass(customerClass?: string, theme?: MenuTheme, popTheme?: PopupMenuTheme, colorful?: boolean, popupColorful?: PopupColorful, firstPopClass?: string, first?: boolean, webkit?: boolean): string;
55
+ /**
56
+ * 生成菜单数据
57
+ * @param items 菜单数据
58
+ * @param index 省略位置
59
+ * @param horizontal 是否是水平菜单
60
+ */
61
+ export declare function getMenuItems(menus?: MenuItem[], index?: number, horizontal?: boolean): MenuResult;
56
62
  /**
57
63
  * 获取菜单节点宽度
58
64
  * @param el 菜单节点
@@ -39,6 +39,29 @@ const _sfc_main = vue.defineComponent({
39
39
  if (props$1.form) {
40
40
  classes.push("ele-modal-form");
41
41
  }
42
+ if (props$1.position) {
43
+ if (props$1.position === "top") {
44
+ classes.push("ele-modal-top");
45
+ } else if (props$1.position === "bottom") {
46
+ classes.push("ele-modal-bottom");
47
+ } else if (props$1.position === "left") {
48
+ classes.push("ele-modal-left");
49
+ } else if (props$1.position === "right") {
50
+ classes.push("ele-modal-right");
51
+ } else if (props$1.position === "leftTop") {
52
+ classes.push("ele-modal-left-top");
53
+ } else if (props$1.position === "leftBottom") {
54
+ classes.push("ele-modal-left-bottom");
55
+ } else if (props$1.position === "rightTop") {
56
+ classes.push("ele-modal-right-top");
57
+ } else if (props$1.position === "rightBottom") {
58
+ classes.push("ele-modal-right-bottom");
59
+ } else if (props$1.position === "center") {
60
+ classes.push("ele-modal-center");
61
+ }
62
+ } else if (props$1.alignCenter) {
63
+ classes.push("ele-modal-center");
64
+ }
42
65
  if (props$1.draggable) {
43
66
  classes.push(util.movableClass);
44
67
  }
@@ -98,7 +121,7 @@ const _sfc_main = vue.defineComponent({
98
121
  return classes.join(" ");
99
122
  });
100
123
  const dialogProps = vue.computed(() => {
101
- const opt = {
124
+ const option = {
102
125
  fullscreen: false,
103
126
  modal: props$1.multiple ? false : props$1.modal,
104
127
  appendToBody: false,
@@ -108,7 +131,7 @@ const _sfc_main = vue.defineComponent({
108
131
  destroyOnClose: false,
109
132
  modalClass: dialogClass.value
110
133
  };
111
- return Object.assign({}, attrs, core.pick(props$1, props.dialogPropKeys), opt);
134
+ return Object.assign({}, attrs, core.pick(props$1, props.dialogPropKeys), option);
112
135
  });
113
136
  const teleportDisabled = vue.computed(() => {
114
137
  const appendTo = props$1.appendTo || "body";
@@ -149,7 +172,7 @@ const _sfc_main = vue.defineComponent({
149
172
  if (props$1.resetOnClose) {
150
173
  util.resetModalStyle(modalEl, props$1.width, props$1.top);
151
174
  }
152
- if (props$1.position) {
175
+ if (props$1.position && typeof props$1.position === "object") {
153
176
  util.setInitPosition(
154
177
  modalEl,
155
178
  props$1.resizable,
@@ -211,7 +234,7 @@ const _sfc_main = vue.defineComponent({
211
234
  vue.watch(
212
235
  () => props$1.position,
213
236
  (position) => {
214
- if (position && props$1.modelValue) {
237
+ if (props$1.modelValue && position && typeof position === "object") {
215
238
  util.setInitPosition(
216
239
  getModalEl(),
217
240
  props$1.resizable,
@@ -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;
@@ -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 {
@@ -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
- }
@@ -30,7 +30,7 @@ function initModalStyle(modalEl, resizable) {
30
30
  modalEl.style.bottom = "auto";
31
31
  modalEl.style.right = "auto";
32
32
  modalEl.style.margin = "0";
33
- modalEl.style.position = "relative";
33
+ modalEl.style.position = "absolute";
34
34
  modalEl.style.display = resizable ? "inline-flex" : "inline-block";
35
35
  modalEl.style.verticalAlign = "top";
36
36
  }
@@ -247,78 +247,43 @@ function resetModalStyle(modalEl, width, top) {
247
247
  modalEl.style.minWidth = "";
248
248
  }
249
249
  function setModalPosition(modalEl, resizable, position, moveOut) {
250
- if (!modalEl) {
250
+ if (!position || typeof position !== "object" || !modalEl) {
251
251
  return;
252
252
  }
253
253
  const wrapEl = modalEl.parentElement;
254
254
  if (!wrapEl) {
255
255
  return;
256
256
  }
257
- const location = {};
258
257
  initModalStyle(modalEl, resizable);
258
+ const location = {};
259
259
  const canOutB = canMoveOut(moveOut, "bottom");
260
260
  const canOutR = canMoveOut(moveOut, "right");
261
261
  const t = wrapEl.clientHeight - modalEl.clientHeight - (canOutB ? 0 : fixTop);
262
262
  const maxTop = t < 0 ? 0 : t;
263
263
  const l = wrapEl.clientWidth - modalEl.clientWidth - (canOutR ? 0 : fixLeft);
264
264
  const maxLeft = l < 0 ? 0 : l;
265
- if (position === "top") {
266
- location.top = 0;
267
- location.left = maxLeft / 2;
268
- } else if (position === "bottom") {
269
- location.top = maxTop;
270
- location.left = maxLeft / 2;
271
- } else if (position === "left") {
272
- location.top = maxTop / 2;
273
- location.left = 0;
274
- } else if (position === "right") {
265
+ if (position.top != null) {
266
+ location.top = position.top;
267
+ } else if (position.bottom != null) {
268
+ location.bottom = position.bottom;
269
+ } else if (position.left != null || position.right != null) {
275
270
  location.top = maxTop / 2;
276
- location.left = maxLeft;
277
- } else if (position === "leftTop") {
278
- location.top = 0;
279
- location.left = 0;
280
- } else if (position === "leftBottom") {
281
- location.top = maxTop;
282
- location.left = 0;
283
- } else if (position === "rightTop") {
284
- location.top = 0;
285
- location.left = maxLeft;
286
- } else if (position === "rightBottom") {
287
- location.top = maxTop;
288
- location.left = maxLeft;
289
- } else if (position === "center") {
290
- location.top = maxTop / 2;
291
- location.left = maxLeft / 2;
292
- } else if (typeof position === "object") {
293
- if (position.top != null) {
294
- if (typeof position.top === "number") {
295
- location.top = position.top;
296
- } else {
297
- location.topValue = position.top;
298
- }
299
- } else if (position.left != null) {
300
- location.top = maxTop / 2;
301
- }
302
- if (position.left != null) {
303
- if (typeof position.left === "number") {
304
- location.left = position.left;
305
- } else {
306
- location.leftValue = position.left;
307
- }
308
- } else if (position.top != null) {
309
- location.left = maxLeft / 2;
310
- }
311
271
  }
312
- if (location.top != null) {
313
- modalEl.style.top = `${Math.floor(location.top)}px`;
314
- } else if (location.topValue != null) {
315
- modalEl.style.top = location.topValue;
316
- }
317
- if (location.left != null) {
318
- modalEl.style.left = `${Math.floor(location.left)}px`;
319
- } else if (location.leftValue != null) {
320
- modalEl.style.left = location.leftValue;
272
+ if (position.left != null) {
273
+ location.left = position.left;
274
+ } else if (position.right != null) {
275
+ location.right = position.right;
276
+ } else if (position.top != null || position.bottom != null) {
277
+ location.left = maxLeft / 2;
321
278
  }
279
+ Object.keys(location).forEach((key) => {
280
+ const value = location[key];
281
+ if (typeof value === "number") {
282
+ modalEl.style[key] = `${Math.floor(value)}px`;
283
+ } else if (value != null) {
284
+ modalEl.style[key] = value;
285
+ }
286
+ });
322
287
  }
323
288
  function setInitPosition(modalEl, resizable, position, moveOut, force) {
324
289
  const attr = "ele-position";