ele-admin-plus 1.1.9-beta.2 → 1.1.9-beta.3

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.
@@ -1,5 +1,6 @@
1
1
  import type { ExtractPropTypes } from 'vue';
2
2
  import type {
3
+ CascaderProps,
3
4
  IconProps,
4
5
  RowProps,
5
6
  ColProps,
@@ -29,6 +30,7 @@ import type {
29
30
  TabPaneProps,
30
31
  TableProps,
31
32
  TableV2Props,
33
+ ElCascader,
32
34
  ElPopper,
33
35
  ElPopover,
34
36
  ElTooltip,
@@ -56,6 +58,8 @@ import type { ComponentProps } from './types';
56
58
  /**
57
59
  * 组件属性
58
60
  */
61
+ export type ElCascaderProps = ComponentProps<CascaderProps>;
62
+
59
63
  export type ElIconProps = ComponentProps<IconProps>;
60
64
 
61
65
  export type ElRowProps = ComponentProps<RowProps>;
@@ -129,6 +133,8 @@ export type ElTreeV2Props = ComponentProps<TreeProps>;
129
133
  /**
130
134
  * 组件实例
131
135
  */
136
+ export type ElCascaderInstance = InstanceType<typeof ElCascader> | null;
137
+
132
138
  export type ElPopperInstance = InstanceType<typeof ElPopper> | null;
133
139
 
134
140
  export type ElPopoverInstance = InstanceType<typeof ElPopover> | null;
@@ -60,6 +60,7 @@
60
60
  }
61
61
 
62
62
  .el-message-box__status {
63
+ flex-shrink: 0;
63
64
  font-size: eleVar('message-box', 'status-size');
64
65
  }
65
66
 
@@ -83,6 +84,10 @@
83
84
  }
84
85
  }
85
86
 
87
+ .el-message-box__message {
88
+ word-break: break-all;
89
+ }
90
+
86
91
  body .el-overlay.is-message-box > .el-overlay-message-box {
87
92
  overflow-x: hidden;
88
93
  scrollbar-width: none;
@@ -99,10 +99,10 @@ declare const _default: import("vue").DefineComponent<{
99
99
  teleported: import("element-plus/es/utils/index").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
100
100
  }>> & {
101
101
  onClick?: (() => any) | undefined;
102
- "onUpdate:modelValue"?: ((_value: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
103
102
  onChange?: ((_active: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
104
- onCommand?: ((_command: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
103
+ "onUpdate:modelValue"?: ((_value: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
105
104
  onVisibleChange?: ((_visible: boolean) => any) | undefined;
105
+ onCommand?: ((_command: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
106
106
  }, {
107
107
  size: string;
108
108
  trigger: import("element-plus/es/utils/index").EpPropMergeType<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils/typescript").Arrayable<import("element-plus").TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils/typescript").Arrayable<import("element-plus").TooltipTriggerType>))[], unknown, unknown>;
@@ -16,6 +16,7 @@ const _sfc_main = defineComponent({
16
16
  "items",
17
17
  "modelValue",
18
18
  "menuStyle",
19
+ "iconProps",
19
20
  "onCommand",
20
21
  "onClick",
21
22
  "onVisibleChange"
@@ -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;
@@ -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 opt = {
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), opt);
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 && props.modelValue) {
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 {
@@ -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
- }
@@ -1,4 +1,4 @@
1
- import type { Resizable, Position, MoveOut } from './types';
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?: Position, moveOut?: MoveOut): void;
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?: Position, moveOut?: MoveOut, force?: boolean): void;
70
+ export declare function setInitPosition(modalEl?: HTMLElement, resizable?: Resizable, position?: PositionObject, moveOut?: MoveOut, force?: boolean): void;
@@ -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 = "relative";
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 === "top") {
264
- location.top = 0;
265
- location.left = maxLeft / 2;
266
- } else if (position === "bottom") {
267
- location.top = maxTop;
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 (location.top != null) {
311
- modalEl.style.top = `${Math.floor(location.top)}px`;
312
- } else if (location.topValue != null) {
313
- modalEl.style.top = location.topValue;
314
- }
315
- if (location.left != null) {
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";
@@ -134,10 +134,12 @@ function usePrinter(done) {
134
134
  function printPdf(option) {
135
135
  const pFrame = getPrintFrame();
136
136
  pFrame.onload = () => {
137
- if (!!pFrame.getAttribute("src")) {
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) => {
@@ -1,5 +1,6 @@
1
1
  import type { ExtractPropTypes } from 'vue';
2
2
  import type {
3
+ CascaderProps,
3
4
  IconProps,
4
5
  RowProps,
5
6
  ColProps,
@@ -29,6 +30,7 @@ import type {
29
30
  TabPaneProps,
30
31
  TableProps,
31
32
  TableV2Props,
33
+ ElCascader,
32
34
  ElPopper,
33
35
  ElPopover,
34
36
  ElTooltip,
@@ -56,6 +58,8 @@ import type { ComponentProps } from './types';
56
58
  /**
57
59
  * 组件属性
58
60
  */
61
+ export type ElCascaderProps = ComponentProps<CascaderProps>;
62
+
59
63
  export type ElIconProps = ComponentProps<IconProps>;
60
64
 
61
65
  export type ElRowProps = ComponentProps<RowProps>;
@@ -129,6 +133,8 @@ export type ElTreeV2Props = ComponentProps<TreeProps>;
129
133
  /**
130
134
  * 组件实例
131
135
  */
136
+ export type ElCascaderInstance = InstanceType<typeof ElCascader> | null;
137
+
132
138
  export type ElPopperInstance = InstanceType<typeof ElPopper> | null;
133
139
 
134
140
  export type ElPopoverInstance = InstanceType<typeof ElPopover> | null;
@@ -60,6 +60,7 @@
60
60
  }
61
61
 
62
62
  .el-message-box__status {
63
+ flex-shrink: 0;
63
64
  font-size: eleVar('message-box', 'status-size');
64
65
  }
65
66
 
@@ -83,6 +84,10 @@
83
84
  }
84
85
  }
85
86
 
87
+ .el-message-box__message {
88
+ word-break: break-all;
89
+ }
90
+
86
91
  body .el-overlay.is-message-box > .el-overlay-message-box {
87
92
  overflow-x: hidden;
88
93
  scrollbar-width: none;
@@ -17,6 +17,7 @@ const _sfc_main = vue.defineComponent({
17
17
  "items",
18
18
  "modelValue",
19
19
  "menuStyle",
20
+ "iconProps",
20
21
  "onCommand",
21
22
  "onClick",
22
23
  "onVisibleChange"
@@ -99,10 +99,10 @@ declare const _default: import("vue").DefineComponent<{
99
99
  teleported: import("element-plus/es/utils/index").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
100
100
  }>> & {
101
101
  onClick?: (() => any) | undefined;
102
- "onUpdate:modelValue"?: ((_value: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
103
102
  onChange?: ((_active: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
104
- onCommand?: ((_command: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
103
+ "onUpdate:modelValue"?: ((_value: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
105
104
  onVisibleChange?: ((_visible: boolean) => any) | undefined;
105
+ onCommand?: ((_command: import("element-plus/es/utils/index").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown> | undefined) => any) | undefined;
106
106
  }, {
107
107
  size: string;
108
108
  trigger: import("element-plus/es/utils/index").EpPropMergeType<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils/typescript").Arrayable<import("element-plus").TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils/typescript").Arrayable<import("element-plus").TooltipTriggerType>))[], unknown, unknown>;
@@ -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";
@@ -1,4 +1,4 @@
1
- import type { Resizable, Position, MoveOut } from './types';
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?: Position, moveOut?: MoveOut): void;
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?: Position, moveOut?: MoveOut, force?: boolean): void;
70
+ export declare function setInitPosition(modalEl?: HTMLElement, resizable?: Resizable, position?: PositionObject, moveOut?: MoveOut, force?: boolean): void;
@@ -136,10 +136,12 @@ function usePrinter(done) {
136
136
  function printPdf(option) {
137
137
  const pFrame = getPrintFrame();
138
138
  pFrame.onload = () => {
139
- if (!!pFrame.getAttribute("src")) {
139
+ const url = pFrame.getAttribute("src");
140
+ if (!!url) {
140
141
  pFrame.focus();
141
142
  pFrame.contentWindow && pFrame.contentWindow.print(option.options);
142
143
  option.done && option.done();
144
+ URL.revokeObjectURL(url);
143
145
  }
144
146
  };
145
147
  const doPrint2 = (buffer) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ele-admin-plus",
3
- "version": "1.1.9-beta.2",
3
+ "version": "1.1.9-beta.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts",