ele-admin-plus 1.1.9 → 1.2.0-beta.1

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 (149) hide show
  1. package/es/core-export.d.ts +1 -0
  2. package/es/core-export.js +1 -0
  3. package/es/ele-alert/index.d.ts +2 -2
  4. package/es/ele-alert/props.d.ts +1 -1
  5. package/es/ele-app/components/message-body.d.ts +39 -0
  6. package/es/ele-app/components/message-body.js +92 -0
  7. package/es/ele-app/el.d.ts +2 -0
  8. package/es/ele-app/style/message/css-var.scss +0 -4
  9. package/es/ele-app/style/message/index.scss +199 -77
  10. package/es/ele-app/style/overwrite/input/index.scss +2 -0
  11. package/es/ele-app/style/overwrite/message-box/index.scss +31 -0
  12. package/es/ele-app/style/overwrite/tag/css-var.scss +0 -16
  13. package/es/ele-app/style/overwrite/tag/index.scss +57 -14
  14. package/es/ele-app/types.d.ts +6 -1
  15. package/es/ele-config-provider/components/receiver-view.js +3 -3
  16. package/es/ele-config-provider/index.d.ts +8 -4
  17. package/es/ele-config-provider/index.js +19 -5
  18. package/es/ele-config-provider/props.d.ts +9 -4
  19. package/es/ele-config-provider/props.js +9 -5
  20. package/es/ele-config-provider/receiver.js +2 -2
  21. package/es/ele-config-provider/types.d.ts +22 -1
  22. package/es/ele-data-table/types.d.ts +2 -0
  23. package/es/ele-drawer/index.d.ts +2 -2
  24. package/es/ele-edit-tag/index.d.ts +9 -4
  25. package/es/ele-edit-tag/index.js +4 -2
  26. package/es/ele-edit-tag/props.d.ts +3 -1
  27. package/es/ele-edit-tag/props.js +2 -0
  28. package/es/ele-edit-tag/style/index.scss +11 -4
  29. package/es/ele-icon-select/index.d.ts +10 -12
  30. package/es/ele-icon-select/props.d.ts +1 -1
  31. package/es/ele-map-picker/index.d.ts +1 -1
  32. package/es/ele-menus/index.d.ts +2 -2
  33. package/es/ele-menus/index.js +11 -0
  34. package/es/ele-modal/index.d.ts +3 -3
  35. package/es/ele-modal/style/index.scss +2 -0
  36. package/es/ele-modal/util.d.ts +1 -1
  37. package/es/ele-modal/util.js +2 -4
  38. package/es/ele-popconfirm/index.d.ts +3 -3
  39. package/es/ele-popconfirm/props.d.ts +1 -1
  40. package/es/ele-popover/index.d.ts +2 -2
  41. package/es/ele-pro-layout/components/pro-header.d.ts +1 -1
  42. package/es/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
  43. package/es/ele-pro-layout/index.js +1 -1
  44. package/es/ele-pro-layout/types.d.ts +4 -4
  45. package/es/ele-pro-table/components/table-tools.d.ts +11 -2
  46. package/es/ele-pro-table/components/table-tools.js +14 -26
  47. package/es/ele-pro-table/components/tool-column.d.ts +1 -0
  48. package/es/ele-pro-table/components/tool-export.d.ts +29 -56
  49. package/es/ele-pro-table/components/tool-export.js +100 -52
  50. package/es/ele-pro-table/components/tool-print-body-cell.js +50 -6
  51. package/es/ele-pro-table/components/tool-print-header-cell.js +4 -1
  52. package/es/ele-pro-table/components/tool-print.d.ts +29 -50
  53. package/es/ele-pro-table/components/tool-print.js +174 -69
  54. package/es/ele-pro-table/index.js +59 -50
  55. package/es/ele-pro-table/style/index.scss +9 -0
  56. package/es/ele-pro-table/types.d.ts +32 -0
  57. package/es/ele-pro-table/util.d.ts +18 -3
  58. package/es/ele-pro-table/util.js +160 -28
  59. package/es/ele-table/style/index.scss +16 -0
  60. package/es/ele-tooltip/index.d.ts +3 -3
  61. package/es/ele-virtual-table/util.d.ts +3 -1
  62. package/es/ele-virtual-table/util.js +7 -2
  63. package/es/icons/LoadingOutlined.js +1 -1
  64. package/es/lang/en_US.js +7 -1
  65. package/es/lang/zh_CN.js +7 -1
  66. package/es/lang/zh_TW.js +7 -1
  67. package/es/style/themes/default.scss +82 -85
  68. package/es/style/themes/rounded.scss +11 -15
  69. package/es/utils/core.d.ts +7 -0
  70. package/es/utils/core.js +16 -2
  71. package/es/utils/message-box.d.ts +25 -0
  72. package/es/utils/message-box.js +71 -0
  73. package/es/utils/message.d.ts +44 -20
  74. package/es/utils/message.js +220 -37
  75. package/lib/core-export.cjs +8 -0
  76. package/lib/core-export.d.ts +1 -0
  77. package/lib/ele-alert/index.d.ts +2 -2
  78. package/lib/ele-alert/props.d.ts +1 -1
  79. package/lib/ele-app/components/message-body.cjs +91 -0
  80. package/lib/ele-app/components/message-body.d.ts +39 -0
  81. package/lib/ele-app/el.d.ts +2 -0
  82. package/lib/ele-app/style/message/css-var.scss +0 -4
  83. package/lib/ele-app/style/message/index.scss +199 -77
  84. package/lib/ele-app/style/overwrite/input/index.scss +2 -0
  85. package/lib/ele-app/style/overwrite/message-box/index.scss +31 -0
  86. package/lib/ele-app/style/overwrite/tag/css-var.scss +0 -16
  87. package/lib/ele-app/style/overwrite/tag/index.scss +57 -14
  88. package/lib/ele-app/types.d.ts +6 -1
  89. package/lib/ele-config-provider/components/receiver-view.cjs +1 -1
  90. package/lib/ele-config-provider/index.cjs +18 -4
  91. package/lib/ele-config-provider/index.d.ts +8 -4
  92. package/lib/ele-config-provider/props.cjs +9 -5
  93. package/lib/ele-config-provider/props.d.ts +9 -4
  94. package/lib/ele-config-provider/receiver.cjs +1 -1
  95. package/lib/ele-config-provider/types.d.ts +22 -1
  96. package/lib/ele-data-table/types.d.ts +2 -0
  97. package/lib/ele-drawer/index.d.ts +2 -2
  98. package/lib/ele-edit-tag/index.cjs +4 -2
  99. package/lib/ele-edit-tag/index.d.ts +9 -4
  100. package/lib/ele-edit-tag/props.cjs +2 -0
  101. package/lib/ele-edit-tag/props.d.ts +3 -1
  102. package/lib/ele-edit-tag/style/index.scss +11 -4
  103. package/lib/ele-icon-select/index.d.ts +10 -12
  104. package/lib/ele-icon-select/props.d.ts +1 -1
  105. package/lib/ele-map-picker/index.d.ts +1 -1
  106. package/lib/ele-menus/index.cjs +11 -0
  107. package/lib/ele-menus/index.d.ts +2 -2
  108. package/lib/ele-modal/index.d.ts +3 -3
  109. package/lib/ele-modal/style/index.scss +2 -0
  110. package/lib/ele-modal/util.cjs +1 -3
  111. package/lib/ele-modal/util.d.ts +1 -1
  112. package/lib/ele-popconfirm/index.d.ts +3 -3
  113. package/lib/ele-popconfirm/props.d.ts +1 -1
  114. package/lib/ele-popover/index.d.ts +2 -2
  115. package/lib/ele-pro-layout/components/pro-header.d.ts +1 -1
  116. package/lib/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
  117. package/lib/ele-pro-layout/index.cjs +1 -1
  118. package/lib/ele-pro-layout/types.d.ts +4 -4
  119. package/lib/ele-pro-table/components/table-tools.cjs +14 -26
  120. package/lib/ele-pro-table/components/table-tools.d.ts +11 -2
  121. package/lib/ele-pro-table/components/tool-column.d.ts +1 -0
  122. package/lib/ele-pro-table/components/tool-export.cjs +99 -51
  123. package/lib/ele-pro-table/components/tool-export.d.ts +29 -56
  124. package/lib/ele-pro-table/components/tool-print-body-cell.cjs +49 -5
  125. package/lib/ele-pro-table/components/tool-print-header-cell.cjs +4 -1
  126. package/lib/ele-pro-table/components/tool-print.cjs +172 -67
  127. package/lib/ele-pro-table/components/tool-print.d.ts +29 -50
  128. package/lib/ele-pro-table/index.cjs +59 -50
  129. package/lib/ele-pro-table/style/index.scss +9 -0
  130. package/lib/ele-pro-table/types.d.ts +32 -0
  131. package/lib/ele-pro-table/util.cjs +160 -28
  132. package/lib/ele-pro-table/util.d.ts +18 -3
  133. package/lib/ele-table/style/index.scss +16 -0
  134. package/lib/ele-tooltip/index.d.ts +3 -3
  135. package/lib/ele-virtual-table/util.cjs +7 -2
  136. package/lib/ele-virtual-table/util.d.ts +3 -1
  137. package/lib/icons/LoadingOutlined.cjs +1 -1
  138. package/lib/lang/en_US.cjs +7 -1
  139. package/lib/lang/zh_CN.cjs +7 -1
  140. package/lib/lang/zh_TW.cjs +7 -1
  141. package/lib/style/themes/default.scss +82 -85
  142. package/lib/style/themes/rounded.scss +11 -15
  143. package/lib/utils/core.cjs +16 -2
  144. package/lib/utils/core.d.ts +7 -0
  145. package/lib/utils/message-box.cjs +71 -0
  146. package/lib/utils/message-box.d.ts +25 -0
  147. package/lib/utils/message.cjs +216 -33
  148. package/lib/utils/message.d.ts +44 -20
  149. package/package.json +14 -14
@@ -1,60 +1,243 @@
1
- import { isVNode, h } from "vue";
2
- import { ElMessage, ElIcon } from "element-plus";
3
- import { LoadingOutlined } from "../icons";
4
- import { omit } from "./core";
5
- const normalizeOptions = function(options, loading) {
1
+ import { getCurrentInstance, provide, inject, onActivated, onDeactivated, isVNode, h, mergeProps } from "vue";
2
+ import { ElMessage } from "element-plus";
3
+ import { useLayoutState, useGlobalProps } from "../ele-config-provider/receiver";
4
+ import MessageBody from "../ele-app/components/message-body";
5
+ import { queryChild, omit } from "./core";
6
+ function blurCurrentFocus() {
6
7
  var _a;
7
- const isObj = typeof options === "object" && options != null && !isVNode(options);
8
- const opt = isObj ? { ...options } : { message: options };
9
- const classes = [];
10
- if (!opt.original) {
11
- classes.push("ele-message");
12
- if (opt.plain) {
13
- classes.push("is-plain");
14
- }
8
+ if (typeof ((_a = document == null ? void 0 : document.body) == null ? void 0 : _a.querySelector) === "function") {
9
+ const el = document.body.querySelector(":focus");
10
+ typeof (el == null ? void 0 : el.blur) === "function" && el.blur();
11
+ }
12
+ }
13
+ function getWrapEl(bodyEl, force, groupKey) {
14
+ const parent = bodyEl || document.body;
15
+ const className = "ele-message-wrapper";
16
+ const attr = "data-group";
17
+ const attrSelector = groupKey == null ? void 0 : [attr, groupKey];
18
+ const el = force ? void 0 : queryChild(parent, className, attrSelector);
19
+ if (el != null) {
20
+ return el;
21
+ }
22
+ const elem = document.createElement("div");
23
+ elem.classList.add(className);
24
+ if (groupKey) {
25
+ elem.setAttribute(attr, groupKey);
26
+ }
27
+ parent.appendChild(elem);
28
+ return elem;
29
+ }
30
+ function getDefaultGroupKey() {
31
+ const url = location == null ? void 0 : location.href;
32
+ const pi = url.indexOf("?");
33
+ return url.substring(0, pi < 0 ? void 0 : pi);
34
+ }
35
+ function getOffsetStyle(offset, userStyle) {
36
+ const mt = typeof offset === "number" ? `${offset}px` : offset;
37
+ return mergeProps({ style: { marginTop: mt } }, { style: userStyle }).style;
38
+ }
39
+ function isObjOpt(params) {
40
+ return params != null && typeof params === "object" && !isVNode(params);
41
+ }
42
+ function normalizeOption(params, globalOpt, onClose, type, loading, getWrapEl2, groupKey) {
43
+ const opt = { ...globalOpt || {} };
44
+ if (isObjOpt(params)) {
45
+ Object.assign(opt, params);
46
+ } else {
47
+ opt.message = params;
48
+ }
49
+ opt.type = type ?? opt.type;
50
+ opt.appendTo = opt.appendTo ?? (getWrapEl2 == null ? void 0 : getWrapEl2(opt.inner));
51
+ const classes = ["ele-message"];
52
+ if (opt.original === "plain") {
53
+ classes.push("is-plain-alert");
54
+ } else if (opt.original) {
55
+ classes.push("is-alert");
56
+ } else if (opt.plain) {
57
+ classes.push("is-plain");
15
58
  }
16
59
  if (loading) {
17
- classes.push("ele-message-loading");
60
+ classes.push("is-loading");
61
+ opt.duration = opt.duration ?? 0;
18
62
  if (opt.mask) {
19
- classes.push("ele-message-mask");
63
+ classes.push("is-show-mask");
20
64
  }
21
- opt.duration = opt.duration ?? 0;
22
- opt.icon = opt.icon ?? h(ElIcon, () => h(LoadingOutlined));
23
- if (typeof ((_a = document == null ? void 0 : document.body) == null ? void 0 : _a.querySelector) === "function") {
24
- const el = document.body.querySelector(":focus");
25
- typeof (el == null ? void 0 : el.blur) === "function" && el.blur();
65
+ if (opt.centered) {
66
+ classes.push("is-centered");
26
67
  }
27
68
  }
28
- if (opt.centered) {
29
- classes.push("is-centered");
69
+ if (opt.inner) {
70
+ classes.push("is-inner");
30
71
  }
31
72
  if (opt.customClass) {
32
73
  classes.push(opt.customClass);
33
74
  }
34
75
  opt.customClass = classes.join(" ");
35
- return omit(opt, ["original", "plain", "mask", "centered"]);
36
- };
37
- const EleMessage = function(options, context) {
38
- return ElMessage(normalizeOptions(options), context);
76
+ if (opt.offset != null && opt.offset !== "") {
77
+ opt.style = getOffsetStyle(opt.offset, opt.style);
78
+ }
79
+ const content = opt.message;
80
+ const isFn = typeof content === "function";
81
+ const isStr = !(isFn || isVNode(content));
82
+ opt.icon = h(
83
+ MessageBody,
84
+ {
85
+ message: isStr && content != null ? String(content) : void 0,
86
+ type: opt.type,
87
+ icon: opt.icon,
88
+ showClose: opt.showClose,
89
+ dangerouslyUseHTMLString: opt.dangerouslyUseHTMLString,
90
+ loading,
91
+ onClose
92
+ },
93
+ { default: isFn ? content : isStr ? void 0 : () => content }
94
+ );
95
+ const key = (opt.inner ? groupKey : void 0) ?? "";
96
+ opt.message = isStr ? `${key}_${content ?? ""}` : void 0;
97
+ opt.grouping = isStr ? opt.grouping : false;
98
+ return omit(opt, [
99
+ "showClose",
100
+ "dangerouslyUseHTMLString",
101
+ "offset",
102
+ "original",
103
+ "plain",
104
+ "mask",
105
+ "centered",
106
+ "inner",
107
+ "groupKey"
108
+ ]);
109
+ }
110
+ const EleMessage = function(params, context) {
111
+ const onClose = () => ins.close();
112
+ const getWrap = () => getWrapEl();
113
+ const opt = normalizeOption(params, null, onClose, null, null, getWrap);
114
+ const ins = ElMessage(opt, context);
115
+ return ins;
39
116
  };
40
- EleMessage.success = function(options, context) {
41
- return ElMessage.success(normalizeOptions(options), context);
117
+ EleMessage.success = function(params, context) {
118
+ const onClose = () => ins.close();
119
+ const getWrap = () => getWrapEl();
120
+ const opt = normalizeOption(params, null, onClose, "success", null, getWrap);
121
+ const ins = ElMessage(opt, context);
122
+ return ins;
42
123
  };
43
- EleMessage.warning = function(options, context) {
44
- return ElMessage.warning(normalizeOptions(options), context);
124
+ EleMessage.warning = function(params, context) {
125
+ const onClose = () => ins.close();
126
+ const getWrap = () => getWrapEl();
127
+ const opt = normalizeOption(params, null, onClose, "warning", null, getWrap);
128
+ const ins = ElMessage(opt, context);
129
+ return ins;
45
130
  };
46
- EleMessage.error = function(options, context) {
47
- return ElMessage.error(normalizeOptions(options), context);
131
+ EleMessage.error = function(params, context) {
132
+ const onClose = () => ins.close();
133
+ const getWrap = () => getWrapEl();
134
+ const opt = normalizeOption(params, null, onClose, "error", null, getWrap);
135
+ const ins = ElMessage(opt, context);
136
+ return ins;
48
137
  };
49
- EleMessage.info = function(options, context) {
50
- return ElMessage.info(normalizeOptions(options), context);
138
+ EleMessage.info = function(params, context) {
139
+ const onClose = () => ins.close();
140
+ const getWrap = () => getWrapEl();
141
+ const opt = normalizeOption(params, null, onClose, null, null, getWrap);
142
+ const ins = ElMessage(opt, context);
143
+ return ins;
51
144
  };
52
- EleMessage.loading = function(options, context) {
53
- return ElMessage.info(normalizeOptions(options, true), context);
145
+ EleMessage.loading = function(params, context) {
146
+ blurCurrentFocus();
147
+ const onClose = () => ins.close();
148
+ const getWrap = () => getWrapEl();
149
+ const opt = normalizeOption(params, null, onClose, null, true, getWrap);
150
+ const ins = ElMessage(opt, context);
151
+ return ins;
54
152
  };
55
153
  EleMessage.closeAll = function(type) {
56
154
  return ElMessage.closeAll(type);
57
155
  };
156
+ const MESSAGE_KEY = Symbol("message");
157
+ function useMessage(globalOpt) {
158
+ var _a, _b;
159
+ const layoutState = useLayoutState();
160
+ const globalProps = useGlobalProps("message");
161
+ const appContext = (_b = (_a = getCurrentInstance) == null ? void 0 : _a()) == null ? void 0 : _b.appContext;
162
+ const groupKey = (globalOpt == null ? void 0 : globalOpt.groupKey) || getDefaultGroupKey();
163
+ const state = { wrapEl: null, isActivated: true };
164
+ const hideClass = "is-hide";
165
+ provide(MESSAGE_KEY, { groupKey, getInnerWrap: () => getWrap(true) });
166
+ const parentMsg = inject(MESSAGE_KEY, null);
167
+ onActivated(() => {
168
+ state.isActivated = true;
169
+ state.wrapEl && state.wrapEl.classList.remove(hideClass);
170
+ });
171
+ onDeactivated(() => {
172
+ state.isActivated = false;
173
+ state.wrapEl && state.wrapEl.classList.add(hideClass);
174
+ });
175
+ const getWrap = (inner) => {
176
+ if (inner) {
177
+ if (parentMsg != null && parentMsg.groupKey === groupKey) {
178
+ return parentMsg.getInnerWrap();
179
+ }
180
+ if (state.wrapEl == null && layoutState.modalsEl != null) {
181
+ state.wrapEl = getWrapEl(layoutState.modalsEl, false, groupKey);
182
+ if (!state.isActivated) {
183
+ state.wrapEl.classList.add(hideClass);
184
+ }
185
+ }
186
+ if (state.wrapEl != null) {
187
+ return state.wrapEl;
188
+ }
189
+ }
190
+ return getWrapEl();
191
+ };
192
+ const getOption = function(params, onClose, type, loading) {
193
+ return normalizeOption(
194
+ params,
195
+ { ...globalProps.value || {}, ...globalOpt || {} },
196
+ onClose,
197
+ type,
198
+ loading,
199
+ getWrap,
200
+ groupKey
201
+ );
202
+ };
203
+ const message = function(params) {
204
+ const opt = getOption(params, () => ins.close());
205
+ const ins = ElMessage(opt, appContext);
206
+ return ins;
207
+ };
208
+ message.success = function(params) {
209
+ const opt = getOption(params, () => ins.close(), "success", false);
210
+ const ins = ElMessage(opt, appContext);
211
+ return ins;
212
+ };
213
+ message.warning = function(params) {
214
+ const opt = getOption(params, () => ins.close(), "warning", false);
215
+ const ins = ElMessage(opt, appContext);
216
+ return ins;
217
+ };
218
+ message.error = function(params) {
219
+ const opt = getOption(params, () => ins.close(), "error", false);
220
+ const ins = ElMessage(opt, appContext);
221
+ return ins;
222
+ };
223
+ message.info = function(params) {
224
+ const opt = getOption(params, () => ins.close());
225
+ const ins = ElMessage(opt, appContext);
226
+ return ins;
227
+ };
228
+ message.loading = function(params) {
229
+ blurCurrentFocus();
230
+ const opt = getOption(params, () => ins.close(), void 0, true);
231
+ const ins = ElMessage(opt, appContext);
232
+ return ins;
233
+ };
234
+ message.closeAll = function(type) {
235
+ return ElMessage.closeAll(type);
236
+ };
237
+ return message;
238
+ }
58
239
  export {
59
- EleMessage
240
+ EleMessage,
241
+ MESSAGE_KEY,
242
+ useMessage
60
243
  };
@@ -5,6 +5,7 @@ const chartTheme = require("./utils/chart-theme");
5
5
  const core = require("./utils/core");
6
6
  const menuUtil = require("./utils/menu-util");
7
7
  const message = require("./utils/message");
8
+ const messageBox = require("./utils/message-box");
8
9
  const validate = require("./utils/validate");
9
10
  const headerTool = require("./ele-pro-layout/components/header-tool");
10
11
  const sidebarTool = require("./ele-pro-layout/components/sidebar-tool");
@@ -47,6 +48,13 @@ Object.keys(message).forEach((k) => {
47
48
  get: () => message[k]
48
49
  });
49
50
  });
51
+ Object.keys(messageBox).forEach((k) => {
52
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
53
+ Object.defineProperty(exports, k, {
54
+ enumerable: true,
55
+ get: () => messageBox[k]
56
+ });
57
+ });
50
58
  Object.keys(validate).forEach((k) => {
51
59
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
52
60
  Object.defineProperty(exports, k, {
@@ -3,6 +3,7 @@ export * from './utils/chart-theme';
3
3
  export * from './utils/core';
4
4
  export * from './utils/menu-util';
5
5
  export * from './utils/message';
6
+ export * from './utils/message-box';
6
7
  export * from './utils/validate';
7
8
  export { default as HeaderTool } from "./ele-pro-layout/components/header-tool";
8
9
  export { default as SidebarTool } from "./ele-pro-layout/components/sidebar-tool";
@@ -1,6 +1,6 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  title: StringConstructor;
3
- type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "error", unknown> | undefined>;
3
+ type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown> | undefined>;
4
4
  description: StringConstructor;
5
5
  closable: {
6
6
  type: BooleanConstructor;
@@ -30,7 +30,7 @@ declare const _default: import('vue').DefineComponent<{
30
30
  close: (_e: MouseEvent) => boolean;
31
31
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
32
32
  title: StringConstructor;
33
- type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "error", unknown> | undefined>;
33
+ type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown> | undefined>;
34
34
  description: StringConstructor;
35
35
  closable: {
36
36
  type: BooleanConstructor;
@@ -8,7 +8,7 @@ export declare const alertProps: {
8
8
  /** 标题 */
9
9
  title: StringConstructor;
10
10
  /** 类型 */
11
- type: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "error", unknown> | undefined>;
11
+ type: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown> | undefined>;
12
12
  /** 描述 */
13
13
  description: StringConstructor;
14
14
  /** 是否可关闭 */
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const elementPlus = require("element-plus");
4
+ const icons = require("../../icons");
5
+ const _sfc_main = vue.defineComponent({
6
+ name: "MessageBody",
7
+ components: {
8
+ ElIcon: elementPlus.ElIcon,
9
+ CloseOutlined: icons.CloseOutlined,
10
+ InfoCircleFilled: icons.InfoCircleFilled,
11
+ CheckCircleFilled: icons.CheckCircleFilled,
12
+ ExclamationCircleFilled: icons.ExclamationCircleFilled,
13
+ CloseCircleFilled: icons.CloseCircleFilled,
14
+ LoadingOutlined: icons.LoadingOutlined
15
+ },
16
+ props: {
17
+ /** 内容 */
18
+ message: String,
19
+ /** 类型 */
20
+ type: String,
21
+ /** 图标 */
22
+ icon: [String, Object, Function],
23
+ /** 是否显示关闭按钮 */
24
+ showClose: Boolean,
25
+ /** 内容是否是富文本 */
26
+ dangerouslyUseHTMLString: Boolean,
27
+ /** 是否是加载框 */
28
+ loading: Boolean
29
+ },
30
+ emits: {
31
+ close: () => true
32
+ },
33
+ setup(_props, { emit }) {
34
+ return { onClose: () => emit("close") };
35
+ }
36
+ });
37
+ const _export_sfc = (sfc, props) => {
38
+ const target = sfc.__vccOpts || sfc;
39
+ for (const [key, val] of props) {
40
+ target[key] = val;
41
+ }
42
+ return target;
43
+ };
44
+ const _hoisted_1 = { class: "ele-message-icon" };
45
+ const _hoisted_2 = ["innerHTML"];
46
+ const _hoisted_3 = {
47
+ key: 1,
48
+ class: "ele-message-content"
49
+ };
50
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
51
+ const _component_LoadingOutlined = vue.resolveComponent("LoadingOutlined");
52
+ const _component_CheckCircleFilled = vue.resolveComponent("CheckCircleFilled");
53
+ const _component_ExclamationCircleFilled = vue.resolveComponent("ExclamationCircleFilled");
54
+ const _component_CloseCircleFilled = vue.resolveComponent("CloseCircleFilled");
55
+ const _component_InfoCircleFilled = vue.resolveComponent("InfoCircleFilled");
56
+ const _component_ElIcon = vue.resolveComponent("ElIcon");
57
+ const _component_CloseOutlined = vue.resolveComponent("CloseOutlined");
58
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
59
+ vue.createElementVNode("div", _hoisted_1, [
60
+ vue.createVNode(_component_ElIcon, {
61
+ class: vue.normalizeClass({ "is-loading": _ctx.loading })
62
+ }, {
63
+ default: vue.withCtx(() => [
64
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon), { key: 0 })) : _ctx.loading ? (vue.openBlock(), vue.createBlock(_component_LoadingOutlined, { key: 1 })) : _ctx.type === "success" ? (vue.openBlock(), vue.createBlock(_component_CheckCircleFilled, { key: 2 })) : _ctx.type === "warning" ? (vue.openBlock(), vue.createBlock(_component_ExclamationCircleFilled, { key: 3 })) : _ctx.type === "error" ? (vue.openBlock(), vue.createBlock(_component_CloseCircleFilled, { key: 4 })) : (vue.openBlock(), vue.createBlock(_component_InfoCircleFilled, { key: 5 }))
65
+ ]),
66
+ _: 1
67
+ }, 8, ["class"])
68
+ ]),
69
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
70
+ _ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("div", {
71
+ key: 0,
72
+ innerHTML: _ctx.message,
73
+ class: "ele-message-content"
74
+ }, null, 8, _hoisted_2)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(_ctx.message), 1))
75
+ ]),
76
+ _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("div", {
77
+ key: 0,
78
+ class: "ele-message-close",
79
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClose && _ctx.onClose(...args))
80
+ }, [
81
+ vue.createVNode(_component_ElIcon, null, {
82
+ default: vue.withCtx(() => [
83
+ vue.createVNode(_component_CloseOutlined)
84
+ ]),
85
+ _: 1
86
+ })
87
+ ])) : vue.createCommentVNode("", true)
88
+ ], 64);
89
+ }
90
+ const messageBody = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
91
+ module.exports = messageBody;
@@ -0,0 +1,39 @@
1
+ import { PropType } from 'vue';
2
+
3
+ declare const _default: import('vue').DefineComponent<{
4
+ /** 内容 */
5
+ message: StringConstructor;
6
+ /** 类型 */
7
+ type: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown> | undefined>;
8
+ /** 图标 */
9
+ icon: PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>))[], unknown, unknown> | undefined>;
10
+ /** 是否显示关闭按钮 */
11
+ showClose: BooleanConstructor;
12
+ /** 内容是否是富文本 */
13
+ dangerouslyUseHTMLString: BooleanConstructor;
14
+ /** 是否是加载框 */
15
+ loading: PropType<boolean | null>;
16
+ }, {
17
+ onClose: () => void;
18
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ close: () => true;
20
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
21
+ /** 内容 */
22
+ message: StringConstructor;
23
+ /** 类型 */
24
+ type: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown> | undefined>;
25
+ /** 图标 */
26
+ icon: PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions, {}, any>))[], unknown, unknown> | undefined>;
27
+ /** 是否显示关闭按钮 */
28
+ showClose: BooleanConstructor;
29
+ /** 内容是否是富文本 */
30
+ dangerouslyUseHTMLString: BooleanConstructor;
31
+ /** 是否是加载框 */
32
+ loading: PropType<boolean | null>;
33
+ }>> & {
34
+ onClose?: (() => any) | undefined;
35
+ }, {
36
+ dangerouslyUseHTMLString: boolean;
37
+ showClose: boolean;
38
+ }, {}>;
39
+ export default _default;
@@ -57,9 +57,11 @@ import type { dropdownProps } from 'element-plus';
57
57
  import type { dropdownItemProps } from 'element-plus';
58
58
  import type columnProps from 'element-plus/es/components/table/src/table-column/defaults';
59
59
  import type { TreeProps } from 'element-plus/es/components/tree-v2/src/types';
60
+ import type { MessageOptions } from 'element-plus/es/components/message';
60
61
  import type { ComponentProps } from './types';
61
62
 
62
63
  export type ElFormItemRule = Partial<FormItemRule>;
64
+ export type ElMessageOptions = Partial<MessageOptions>;
63
65
 
64
66
  /**
65
67
  * 组件属性
@@ -5,8 +5,4 @@
5
5
  .ele-message {
6
6
  @include set-ele-var('message', $var);
7
7
  }
8
-
9
- .ele-message-mask {
10
- @include set-ele-var('message-mask', $var);
11
- }
12
8
  }