ele-admin-plus 1.1.3 → 1.1.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ele-alert/index.d.ts +10 -10
- package/es/ele-alert/props.d.ts +6 -6
- package/es/ele-app/style/message.scss +1 -0
- package/es/ele-app/style/overwrite.scss +84 -3
- package/es/ele-app/types/index.d.ts +7 -6
- package/es/ele-avatar-group/index.d.ts +7 -8
- package/es/ele-avatar-group/props.d.ts +3 -4
- package/es/ele-basic-select/style/index.scss +4 -6
- package/es/ele-bottom-bar/index.d.ts +4 -4
- package/es/ele-bottom-bar/props.d.ts +2 -3
- package/es/ele-card/index.d.ts +6 -6
- package/es/ele-card/props.d.ts +3 -4
- package/es/ele-check-card/components/card-item.d.ts +2 -3
- package/es/ele-check-card/index.d.ts +4 -4
- package/es/ele-check-card/props.d.ts +3 -3
- package/es/ele-config-provider/receiver.d.ts +1 -1
- package/es/ele-config-provider/receiver.js +29 -29
- package/es/ele-copyable/index.d.ts +8 -8
- package/es/ele-copyable/index.js +5 -4
- package/es/ele-copyable/props.d.ts +5 -5
- package/es/ele-copyable/style/index.scss +4 -0
- package/es/ele-count-up/index.d.ts +2 -2
- package/es/ele-count-up/index.js +2 -1
- package/es/ele-count-up/props.d.ts +1 -1
- package/es/ele-cropper/index.js +2 -2
- package/es/ele-dashboard/index.d.ts +1 -2
- package/es/ele-drawer/index.d.ts +16 -10
- package/es/ele-drawer/props.d.ts +7 -6
- package/es/ele-dropdown/index.d.ts +2 -2
- package/es/ele-dropdown/props.d.ts +1 -2
- package/es/ele-edit-tag/index.d.ts +4 -4
- package/es/ele-edit-tag/props.d.ts +2 -3
- package/es/ele-ellipsis/index.d.ts +4 -5
- package/es/ele-ellipsis/props.d.ts +1 -1
- package/es/ele-ellipsis/style/index.scss +4 -0
- package/es/ele-file-list/index.d.ts +2 -7
- package/es/ele-file-list/index.js +2 -2
- package/es/ele-file-list/types/index.d.ts +0 -4
- package/es/ele-icon-select/components/icon-grid.d.ts +5 -5
- package/es/ele-icon-select/components/icon-popper.d.ts +15 -15
- package/es/ele-icon-select/index.d.ts +15 -16
- package/es/ele-icon-select/props.d.ts +8 -8
- package/es/ele-loading/index.d.ts +26 -1
- package/es/ele-loading/index.js +53 -11
- package/es/ele-loading/props.d.ts +11 -1
- package/es/ele-loading/props.js +16 -1
- package/es/ele-loading/style/css-var.scss +7 -0
- package/es/ele-loading/style/index.js +1 -0
- package/es/ele-loading/style/index.scss +90 -0
- package/es/ele-loading/types/index.d.ts +17 -0
- package/es/ele-map-picker/components/map-view.d.ts +2 -2
- package/es/ele-map-picker/index.d.ts +2 -2
- package/es/ele-map-picker/props.d.ts +3 -3
- package/es/ele-menus/index.d.ts +2 -0
- package/es/ele-menus/index.js +11 -5
- package/es/ele-menus/props.d.ts +10 -0
- package/es/ele-menus/props.js +7 -1
- package/es/ele-menus/style/index.scss +18 -18
- package/es/ele-menus/types/index.d.ts +4 -0
- package/es/ele-menus/util.d.ts +4 -3
- package/es/ele-menus/util.js +23 -12
- package/es/ele-modal/index.d.ts +19 -13
- package/es/ele-modal/props.d.ts +8 -7
- package/es/ele-modal/types/index.d.ts +9 -0
- package/es/ele-modal/util.js +45 -32
- package/es/ele-pagination/index.d.ts +1 -1
- package/es/ele-popconfirm/index.d.ts +10 -10
- package/es/ele-popconfirm/index.js +8 -2
- package/es/ele-popconfirm/props.d.ts +6 -6
- package/es/ele-popover/index.d.ts +6 -6
- package/es/ele-popover/props.d.ts +3 -4
- package/es/ele-printer/index.d.ts +7 -6
- package/es/ele-printer/index.js +11 -4
- package/es/ele-printer/props.d.ts +3 -4
- package/es/ele-pro-layout/components/pro-header.d.ts +7 -2
- package/es/ele-pro-layout/components/pro-header.js +15 -5
- package/es/ele-pro-layout/components/pro-iframe.js +10 -7
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +7 -2
- package/es/ele-pro-layout/components/pro-sidebar.js +14 -5
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +11 -4
- package/es/ele-pro-layout/components/pro-sidebox.js +16 -5
- package/es/ele-pro-layout/components/tab-dropdown.js +1 -4
- package/es/ele-pro-layout/index.d.ts +17 -3
- package/es/ele-pro-layout/index.js +208 -105
- package/es/ele-pro-layout/props.d.ts +6 -1
- package/es/ele-pro-layout/props.js +10 -0
- package/es/ele-pro-layout/style/collapse.scss +9 -10
- package/es/ele-pro-layout/style/index.js +0 -1
- package/es/ele-pro-layout/style/layout-mobile.scss +1 -0
- package/es/ele-pro-layout/types/index.d.ts +9 -0
- package/es/ele-pro-layout/util.d.ts +4 -2
- package/es/ele-pro-layout/util.js +20 -17
- package/es/ele-pro-table/components/table-view.d.ts +9 -3
- package/es/ele-pro-table/components/table-view.js +27 -24
- package/es/ele-pro-table/components/tool-column.d.ts +2 -1
- package/es/ele-pro-table/components/tool-column.js +26 -18
- package/es/ele-pro-table/index.d.ts +46 -25
- package/es/ele-pro-table/index.js +182 -196
- package/es/ele-pro-table/props.d.ts +27 -15
- package/es/ele-pro-table/props.js +15 -3
- package/es/ele-pro-table/style/index.js +1 -1
- package/es/ele-pro-table/style/index.scss +64 -8
- package/es/ele-pro-table/types/index.d.ts +39 -5
- package/es/ele-pro-table/util.d.ts +84 -49
- package/es/ele-pro-table/util.js +193 -78
- package/es/ele-qr-code/index.d.ts +3 -3
- package/es/ele-qr-code/props.d.ts +1 -2
- package/es/ele-qr-code-svg/index.d.ts +3 -3
- package/es/ele-split-panel/index.d.ts +6 -6
- package/es/ele-split-panel/props.d.ts +3 -4
- package/es/ele-table/style/index.scss +1 -0
- package/es/ele-tabs/index.js +4 -3
- package/es/ele-tabs/types/index.d.ts +3 -0
- package/es/ele-text/index.d.ts +3 -3
- package/es/ele-text/props.d.ts +2 -2
- package/es/ele-toolbar/index.d.ts +6 -6
- package/es/ele-toolbar/props.d.ts +3 -4
- package/es/ele-tooltip/index.d.ts +3 -3
- package/es/ele-tooltip/props.d.ts +1 -2
- package/es/ele-tour/index.d.ts +2 -3
- package/es/ele-tour/style/index.scss +1 -1
- package/es/ele-tour/util.js +3 -3
- package/es/ele-upload-list/index.d.ts +8 -7
- package/es/ele-upload-list/index.js +18 -11
- package/es/ele-upload-list/props.d.ts +4 -4
- package/es/ele-upload-list/props.js +1 -1
- package/es/ele-watermark/index.d.ts +16 -8
- package/es/ele-watermark/index.js +18 -12
- package/es/ele-watermark/props.d.ts +3 -1
- package/es/ele-watermark/props.js +5 -1
- package/es/ele-watermark/util.js +1 -1
- package/es/ele-xg-player/index.js +1 -0
- package/es/style/index.scss +1 -0
- package/es/style/nprogress.scss +2 -2
- package/es/style/themes/default.scss +36 -12
- package/es/style/themes/rounded.scss +4 -2
- package/es/style/themes/theme-util.scss +2 -0
- package/es/utils/core.d.ts +1 -1
- package/es/utils/core.js +17 -15
- package/es/utils/resolvers.js +2 -2
- package/lib/ele-alert/index.d.ts +10 -10
- package/lib/ele-alert/props.d.ts +6 -6
- package/lib/ele-app/style/message.scss +1 -0
- package/lib/ele-app/style/overwrite.scss +84 -3
- package/lib/ele-app/types/index.d.ts +7 -6
- package/lib/ele-avatar-group/index.d.ts +7 -8
- package/lib/ele-avatar-group/props.d.ts +3 -4
- package/lib/ele-basic-select/style/index.scss +4 -6
- package/lib/ele-bottom-bar/index.d.ts +4 -4
- package/lib/ele-bottom-bar/props.d.ts +2 -3
- package/lib/ele-card/index.d.ts +6 -6
- package/lib/ele-card/props.d.ts +3 -4
- package/lib/ele-check-card/components/card-item.d.ts +2 -3
- package/lib/ele-check-card/index.d.ts +4 -4
- package/lib/ele-check-card/props.d.ts +3 -3
- package/lib/ele-config-provider/receiver.d.ts +1 -1
- package/lib/ele-config-provider/receiver.js +2 -2
- package/lib/ele-copyable/index.d.ts +8 -8
- package/lib/ele-copyable/index.js +4 -3
- package/lib/ele-copyable/props.d.ts +5 -5
- package/lib/ele-copyable/style/index.scss +4 -0
- package/lib/ele-count-up/index.d.ts +2 -2
- package/lib/ele-count-up/index.js +2 -1
- package/lib/ele-count-up/props.d.ts +1 -1
- package/lib/ele-cropper/index.js +2 -2
- package/lib/ele-dashboard/index.d.ts +1 -2
- package/lib/ele-drawer/index.d.ts +16 -10
- package/lib/ele-drawer/props.d.ts +7 -6
- package/lib/ele-dropdown/index.d.ts +2 -2
- package/lib/ele-dropdown/props.d.ts +1 -2
- package/lib/ele-edit-tag/index.d.ts +4 -4
- package/lib/ele-edit-tag/props.d.ts +2 -3
- package/lib/ele-ellipsis/index.d.ts +4 -5
- package/lib/ele-ellipsis/props.d.ts +1 -1
- package/lib/ele-ellipsis/style/index.scss +4 -0
- package/lib/ele-file-list/index.d.ts +2 -7
- package/lib/ele-file-list/index.js +2 -2
- package/lib/ele-file-list/types/index.d.ts +0 -4
- package/lib/ele-icon-select/components/icon-grid.d.ts +5 -5
- package/lib/ele-icon-select/components/icon-popper.d.ts +15 -15
- package/lib/ele-icon-select/index.d.ts +15 -16
- package/lib/ele-icon-select/props.d.ts +8 -8
- package/lib/ele-loading/index.d.ts +26 -1
- package/lib/ele-loading/index.js +52 -10
- package/lib/ele-loading/props.d.ts +11 -1
- package/lib/ele-loading/props.js +16 -1
- package/lib/ele-loading/style/css-var.scss +7 -0
- package/lib/ele-loading/style/index.js +1 -0
- package/lib/ele-loading/style/index.scss +90 -0
- package/lib/ele-loading/types/index.d.ts +17 -0
- package/lib/ele-map-picker/components/map-view.d.ts +2 -2
- package/lib/ele-map-picker/index.d.ts +2 -2
- package/lib/ele-map-picker/props.d.ts +3 -3
- package/lib/ele-menus/index.d.ts +2 -0
- package/lib/ele-menus/index.js +9 -3
- package/lib/ele-menus/props.d.ts +10 -0
- package/lib/ele-menus/props.js +6 -0
- package/lib/ele-menus/style/index.scss +18 -18
- package/lib/ele-menus/types/index.d.ts +4 -0
- package/lib/ele-menus/util.d.ts +4 -3
- package/lib/ele-menus/util.js +23 -12
- package/lib/ele-modal/index.d.ts +19 -13
- package/lib/ele-modal/props.d.ts +8 -7
- package/lib/ele-modal/types/index.d.ts +9 -0
- package/lib/ele-modal/util.js +45 -32
- package/lib/ele-pagination/index.d.ts +1 -1
- package/lib/ele-popconfirm/index.d.ts +10 -10
- package/lib/ele-popconfirm/index.js +8 -2
- package/lib/ele-popconfirm/props.d.ts +6 -6
- package/lib/ele-popover/index.d.ts +6 -6
- package/lib/ele-popover/props.d.ts +3 -4
- package/lib/ele-printer/index.d.ts +7 -6
- package/lib/ele-printer/index.js +10 -3
- package/lib/ele-printer/props.d.ts +3 -4
- package/lib/ele-pro-layout/components/pro-header.d.ts +7 -2
- package/lib/ele-pro-layout/components/pro-header.js +15 -5
- package/lib/ele-pro-layout/components/pro-iframe.js +10 -7
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +7 -2
- package/lib/ele-pro-layout/components/pro-sidebar.js +14 -5
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +11 -4
- package/lib/ele-pro-layout/components/pro-sidebox.js +16 -5
- package/lib/ele-pro-layout/components/tab-dropdown.js +1 -4
- package/lib/ele-pro-layout/index.d.ts +17 -3
- package/lib/ele-pro-layout/index.js +205 -102
- package/lib/ele-pro-layout/props.d.ts +6 -1
- package/lib/ele-pro-layout/props.js +10 -0
- package/lib/ele-pro-layout/style/collapse.scss +9 -10
- package/lib/ele-pro-layout/style/index.js +0 -1
- package/lib/ele-pro-layout/style/layout-mobile.scss +1 -0
- package/lib/ele-pro-layout/types/index.d.ts +9 -0
- package/lib/ele-pro-layout/util.d.ts +4 -2
- package/lib/ele-pro-layout/util.js +19 -16
- package/lib/ele-pro-table/components/table-view.d.ts +9 -3
- package/lib/ele-pro-table/components/table-view.js +25 -22
- package/lib/ele-pro-table/components/tool-column.d.ts +2 -1
- package/lib/ele-pro-table/components/tool-column.js +25 -17
- package/lib/ele-pro-table/index.d.ts +46 -25
- package/lib/ele-pro-table/index.js +180 -194
- package/lib/ele-pro-table/props.d.ts +27 -15
- package/lib/ele-pro-table/props.js +15 -3
- package/lib/ele-pro-table/style/index.js +1 -1
- package/lib/ele-pro-table/style/index.scss +64 -8
- package/lib/ele-pro-table/types/index.d.ts +39 -5
- package/lib/ele-pro-table/util.d.ts +84 -49
- package/lib/ele-pro-table/util.js +192 -77
- package/lib/ele-qr-code/index.d.ts +3 -3
- package/lib/ele-qr-code/props.d.ts +1 -2
- package/lib/ele-qr-code-svg/index.d.ts +3 -3
- package/lib/ele-split-panel/index.d.ts +6 -6
- package/lib/ele-split-panel/props.d.ts +3 -4
- package/lib/ele-table/style/index.scss +1 -0
- package/lib/ele-tabs/index.js +4 -3
- package/lib/ele-tabs/types/index.d.ts +3 -0
- package/lib/ele-text/index.d.ts +3 -3
- package/lib/ele-text/props.d.ts +2 -2
- package/lib/ele-toolbar/index.d.ts +6 -6
- package/lib/ele-toolbar/props.d.ts +3 -4
- package/lib/ele-tooltip/index.d.ts +3 -3
- package/lib/ele-tooltip/props.d.ts +1 -2
- package/lib/ele-tour/index.d.ts +2 -3
- package/lib/ele-tour/style/index.scss +1 -1
- package/lib/ele-tour/util.js +3 -3
- package/lib/ele-upload-list/index.d.ts +8 -7
- package/lib/ele-upload-list/index.js +17 -10
- package/lib/ele-upload-list/props.d.ts +4 -4
- package/lib/ele-upload-list/props.js +1 -1
- package/lib/ele-watermark/index.d.ts +16 -8
- package/lib/ele-watermark/index.js +17 -11
- package/lib/ele-watermark/props.d.ts +3 -1
- package/lib/ele-watermark/props.js +5 -1
- package/lib/ele-watermark/util.js +1 -1
- package/lib/ele-xg-player/index.js +1 -0
- package/lib/style/index.scss +1 -0
- package/lib/style/nprogress.scss +2 -2
- package/lib/style/themes/default.scss +36 -12
- package/lib/style/themes/rounded.scss +4 -2
- package/lib/style/themes/theme-util.scss +2 -0
- package/lib/utils/core.d.ts +1 -1
- package/lib/utils/core.js +17 -15
- package/lib/utils/resolvers.js +2 -2
- package/package.json +25 -23
- package/typings/global.d.ts +52 -52
- package/es/ele-alert/types/index.d.ts +0 -0
- package/lib/ele-alert/types/index.d.ts +0 -0
package/lib/ele-modal/util.js
CHANGED
|
@@ -22,6 +22,8 @@ const singleSidebarClass = "ele-state-single-sidebar";
|
|
|
22
22
|
const topLayoutClass = "ele-state-top-layout";
|
|
23
23
|
const expandedClass = "ele-state-expanded";
|
|
24
24
|
const mobileClass = "ele-state-mobile";
|
|
25
|
+
const fixTop = 0.65;
|
|
26
|
+
const fixLeft = 0.65;
|
|
25
27
|
function initModalStyle(modalEl, resizable) {
|
|
26
28
|
modalEl.style.top = modalEl.offsetTop + "px";
|
|
27
29
|
modalEl.style.left = modalEl.offsetLeft + "px";
|
|
@@ -104,8 +106,8 @@ function handleMovable(event, props) {
|
|
|
104
106
|
left: e.clientX - downX + downOL,
|
|
105
107
|
top: e.clientY - downY + downOT
|
|
106
108
|
};
|
|
107
|
-
const limitL = wrapEl.clientWidth - modalEl.clientWidth -
|
|
108
|
-
const limitT = wrapEl.clientHeight - modalEl.clientHeight -
|
|
109
|
+
const limitL = wrapEl.clientWidth - modalEl.clientWidth - fixLeft;
|
|
110
|
+
const limitT = wrapEl.clientHeight - modalEl.clientHeight - fixTop;
|
|
109
111
|
if (!props.moveOut) {
|
|
110
112
|
if (position.left < 0) {
|
|
111
113
|
position.left = 0;
|
|
@@ -140,8 +142,8 @@ function handleMovable(event, props) {
|
|
|
140
142
|
position.top = minLimitT;
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
|
-
modalEl.style.left = `${position.left}px`;
|
|
144
|
-
modalEl.style.top = `${position.top}px`;
|
|
145
|
+
modalEl.style.left = `${Math.floor(position.left)}px`;
|
|
146
|
+
modalEl.style.top = `${Math.floor(position.top)}px`;
|
|
145
147
|
};
|
|
146
148
|
const mouseupFn = function() {
|
|
147
149
|
modalEl.style.userSelect = "";
|
|
@@ -184,7 +186,7 @@ function handleResizable(event, props) {
|
|
|
184
186
|
const mousemoveFn = function(e) {
|
|
185
187
|
if (props.resizable !== "vertical") {
|
|
186
188
|
const w = e.clientX - downX + downW;
|
|
187
|
-
const maxW = wrapEl.clientWidth - modalEl.offsetLeft -
|
|
189
|
+
const maxW = wrapEl.clientWidth - modalEl.offsetLeft - fixLeft;
|
|
188
190
|
const nw = (w < props.minWidth ? props.minWidth : !canMoveOut(props.moveOut, "right") && w > maxW ? maxW : w) + "px";
|
|
189
191
|
modalEl.style.width = nw;
|
|
190
192
|
modalEl.style.maxWidth = nw;
|
|
@@ -192,7 +194,7 @@ function handleResizable(event, props) {
|
|
|
192
194
|
}
|
|
193
195
|
if (props.resizable !== "horizontal") {
|
|
194
196
|
const h = e.clientY - downY + downH;
|
|
195
|
-
const maxH = wrapEl.clientHeight - modalEl.offsetTop -
|
|
197
|
+
const maxH = wrapEl.clientHeight - modalEl.offsetTop - fixTop;
|
|
196
198
|
const nh = (h < props.minHeight ? props.minHeight : !canMoveOut(props.moveOut, "bottom") && h > maxH ? maxH : h) + "px";
|
|
197
199
|
modalEl.style.height = nh;
|
|
198
200
|
modalEl.style.maxHeight = nh;
|
|
@@ -250,60 +252,71 @@ function setModalPosition(modalEl, resizable, position, moveOut) {
|
|
|
250
252
|
if (!wrapEl) {
|
|
251
253
|
return;
|
|
252
254
|
}
|
|
255
|
+
const location = {};
|
|
253
256
|
initModalStyle(modalEl, resizable);
|
|
254
257
|
const canOutB = canMoveOut(moveOut, "bottom");
|
|
255
258
|
const canOutR = canMoveOut(moveOut, "right");
|
|
256
|
-
const t = wrapEl.clientHeight - modalEl.clientHeight - (canOutB ? 0 :
|
|
259
|
+
const t = wrapEl.clientHeight - modalEl.clientHeight - (canOutB ? 0 : fixTop);
|
|
257
260
|
const maxTop = t < 0 ? 0 : t;
|
|
258
|
-
const l = wrapEl.clientWidth - modalEl.clientWidth - (canOutR ? 0 :
|
|
261
|
+
const l = wrapEl.clientWidth - modalEl.clientWidth - (canOutR ? 0 : fixLeft);
|
|
259
262
|
const maxLeft = l < 0 ? 0 : l;
|
|
260
263
|
if (position === "top") {
|
|
261
|
-
|
|
262
|
-
|
|
264
|
+
location.top = 0;
|
|
265
|
+
location.left = maxLeft / 2;
|
|
263
266
|
} else if (position === "bottom") {
|
|
264
|
-
|
|
265
|
-
|
|
267
|
+
location.top = maxTop;
|
|
268
|
+
location.left = maxLeft / 2;
|
|
266
269
|
} else if (position === "left") {
|
|
267
|
-
|
|
268
|
-
|
|
270
|
+
location.top = maxTop / 2;
|
|
271
|
+
location.left = 0;
|
|
269
272
|
} else if (position === "right") {
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
location.top = maxTop / 2;
|
|
274
|
+
location.left = maxLeft;
|
|
272
275
|
} else if (position === "leftTop") {
|
|
273
|
-
|
|
274
|
-
|
|
276
|
+
location.top = 0;
|
|
277
|
+
location.left = 0;
|
|
275
278
|
} else if (position === "leftBottom") {
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
location.top = maxTop;
|
|
280
|
+
location.left = 0;
|
|
278
281
|
} else if (position === "rightTop") {
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
location.top = 0;
|
|
283
|
+
location.left = maxLeft;
|
|
281
284
|
} else if (position === "rightBottom") {
|
|
282
|
-
|
|
283
|
-
|
|
285
|
+
location.top = maxTop;
|
|
286
|
+
location.left = maxLeft;
|
|
284
287
|
} else if (position === "center") {
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
location.top = maxTop / 2;
|
|
289
|
+
location.left = maxLeft / 2;
|
|
287
290
|
} else if (typeof position === "object") {
|
|
288
291
|
if (position.top != null) {
|
|
289
292
|
if (typeof position.top === "number") {
|
|
290
|
-
|
|
293
|
+
location.top = position.top;
|
|
291
294
|
} else {
|
|
292
|
-
|
|
295
|
+
location.topValue = position.top;
|
|
293
296
|
}
|
|
294
297
|
} else if (position.left != null) {
|
|
295
|
-
|
|
298
|
+
location.top = maxTop / 2;
|
|
296
299
|
}
|
|
297
300
|
if (position.left != null) {
|
|
298
301
|
if (typeof position.left === "number") {
|
|
299
|
-
|
|
302
|
+
location.left = position.left;
|
|
300
303
|
} else {
|
|
301
|
-
|
|
304
|
+
location.leftValue = position.left;
|
|
302
305
|
}
|
|
303
306
|
} else if (position.top != null) {
|
|
304
|
-
|
|
307
|
+
location.left = maxLeft / 2;
|
|
305
308
|
}
|
|
306
309
|
}
|
|
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;
|
|
319
|
+
}
|
|
307
320
|
}
|
|
308
321
|
function setInitPosition(modalEl, resizable, position, moveOut, force) {
|
|
309
322
|
const attr = "ele-position";
|
|
@@ -58,6 +58,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
58
|
popperClass: string;
|
|
59
59
|
disabled: boolean;
|
|
60
60
|
small: boolean;
|
|
61
|
+
background: boolean;
|
|
61
62
|
pagerCount: number;
|
|
62
63
|
layout: string;
|
|
63
64
|
pageSizes: number[];
|
|
@@ -65,7 +66,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
66
|
prevIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>;
|
|
66
67
|
nextText: string;
|
|
67
68
|
nextIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>;
|
|
68
|
-
background: boolean;
|
|
69
69
|
hideOnSinglePage: boolean;
|
|
70
70
|
}, {}>;
|
|
71
71
|
export default _default;
|
|
@@ -23,15 +23,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
hideIcon: BooleanConstructor;
|
|
24
24
|
hideConfirmButton: BooleanConstructor;
|
|
25
25
|
hideCancelButton: BooleanConstructor;
|
|
26
|
-
iconStyle: import("vue").PropType<import("
|
|
26
|
+
iconStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
27
27
|
iconProps: import("vue").PropType<ElIconProps>;
|
|
28
28
|
confirmButtonProps: import("vue").PropType<import("../ele-app/types").ElButtonProps>;
|
|
29
29
|
cancelButtonProps: import("vue").PropType<import("../ele-app/types").ElButtonProps>;
|
|
30
|
-
footerStyle: import("vue").PropType<import("
|
|
30
|
+
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
31
31
|
bodyClass: StringConstructor;
|
|
32
|
-
bodyStyle: import("vue").PropType<import("
|
|
33
|
-
titleStyle: import("vue").PropType<import("
|
|
34
|
-
contentStyle: import("vue").PropType<import("
|
|
32
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
33
|
+
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
34
|
+
contentStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
35
35
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
36
36
|
effect: {
|
|
37
37
|
readonly default: "light";
|
|
@@ -113,15 +113,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
113
113
|
hideIcon: BooleanConstructor;
|
|
114
114
|
hideConfirmButton: BooleanConstructor;
|
|
115
115
|
hideCancelButton: BooleanConstructor;
|
|
116
|
-
iconStyle: import("vue").PropType<import("
|
|
116
|
+
iconStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
117
117
|
iconProps: import("vue").PropType<ElIconProps>;
|
|
118
118
|
confirmButtonProps: import("vue").PropType<import("../ele-app/types").ElButtonProps>;
|
|
119
119
|
cancelButtonProps: import("vue").PropType<import("../ele-app/types").ElButtonProps>;
|
|
120
|
-
footerStyle: import("vue").PropType<import("
|
|
120
|
+
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
121
121
|
bodyClass: StringConstructor;
|
|
122
|
-
bodyStyle: import("vue").PropType<import("
|
|
123
|
-
titleStyle: import("vue").PropType<import("
|
|
124
|
-
contentStyle: import("vue").PropType<import("
|
|
122
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
123
|
+
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
124
|
+
contentStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
125
125
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
126
126
|
effect: {
|
|
127
127
|
readonly default: "light";
|
|
@@ -60,9 +60,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
60
60
|
}
|
|
61
61
|
const classes = ["ele-popconfirm-icon"];
|
|
62
62
|
if (options.class) {
|
|
63
|
-
|
|
63
|
+
if (Array.isArray(options.class)) {
|
|
64
|
+
options.class.forEach((c) => {
|
|
65
|
+
classes.push(c);
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
classes.push(options.class);
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
|
-
options.class = classes
|
|
71
|
+
options.class = classes;
|
|
66
72
|
return options;
|
|
67
73
|
});
|
|
68
74
|
const confirmText = vue.computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ElIconProps, ElButtonProps } from '../ele-app/types';
|
|
3
3
|
/**
|
|
4
4
|
* 属性
|
|
5
5
|
*/
|
|
@@ -26,15 +26,15 @@ export declare const popconfirmProps: {
|
|
|
26
26
|
hideIcon: BooleanConstructor;
|
|
27
27
|
hideConfirmButton: BooleanConstructor;
|
|
28
28
|
hideCancelButton: BooleanConstructor;
|
|
29
|
-
iconStyle: PropType<
|
|
29
|
+
iconStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
30
30
|
iconProps: PropType<ElIconProps>;
|
|
31
31
|
confirmButtonProps: PropType<ElButtonProps>;
|
|
32
32
|
cancelButtonProps: PropType<ElButtonProps>;
|
|
33
|
-
footerStyle: PropType<
|
|
33
|
+
footerStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
34
34
|
bodyClass: StringConstructor;
|
|
35
|
-
bodyStyle: PropType<
|
|
36
|
-
titleStyle: PropType<
|
|
37
|
-
contentStyle: PropType<
|
|
35
|
+
bodyStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
36
|
+
titleStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
37
|
+
contentStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
38
38
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
39
39
|
effect: {
|
|
40
40
|
readonly default: "light";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ElPopoverProps, ElPopoverInstance, ElPopperInstance } from '../ele-app/types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
bodyClass: StringConstructor;
|
|
4
|
-
bodyStyle: import("vue").PropType<import("
|
|
5
|
-
titleStyle: import("vue").PropType<import("
|
|
6
|
-
contentStyle: import("vue").PropType<import("
|
|
4
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
5
|
+
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
6
|
+
contentStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
7
7
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
8
8
|
trigger: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
9
9
|
effect: {
|
|
@@ -60,9 +60,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
60
|
'after-leave': () => boolean;
|
|
61
61
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
62
|
bodyClass: StringConstructor;
|
|
63
|
-
bodyStyle: import("vue").PropType<import("
|
|
64
|
-
titleStyle: import("vue").PropType<import("
|
|
65
|
-
contentStyle: import("vue").PropType<import("
|
|
63
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
64
|
+
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
65
|
+
contentStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
66
66
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
67
67
|
trigger: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
68
68
|
effect: {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { StyleValue } from '../ele-app/types';
|
|
3
2
|
/**
|
|
4
3
|
* 属性
|
|
5
4
|
*/
|
|
6
5
|
export declare const popoverProps: {
|
|
7
6
|
bodyClass: StringConstructor;
|
|
8
|
-
bodyStyle: PropType<
|
|
9
|
-
titleStyle: PropType<
|
|
10
|
-
contentStyle: PropType<
|
|
7
|
+
bodyStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
8
|
+
titleStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
9
|
+
contentStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
11
10
|
offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
|
|
12
11
|
trigger: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import("element-plus").TooltipTriggerType[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
13
12
|
effect: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
modelValue: BooleanConstructor;
|
|
3
|
-
headerStyle: import("vue").PropType<import("
|
|
4
|
-
bodyStyle: import("vue").PropType<import("
|
|
5
|
-
footerStyle: import("vue").PropType<import("
|
|
3
|
+
headerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
4
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
5
|
+
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
6
6
|
title: StringConstructor;
|
|
7
7
|
margin: (StringConstructor | NumberConstructor)[];
|
|
8
8
|
direction: import("vue").PropType<import("./types").PrintDirection | null>;
|
|
@@ -12,15 +12,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
}, {
|
|
13
13
|
container: import("vue").ShallowRef<Element>;
|
|
14
14
|
visible: import("vue").Ref<boolean>;
|
|
15
|
+
isStatic: import("vue").ComputedRef<boolean>;
|
|
15
16
|
print: () => void;
|
|
16
17
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
18
|
'update:modelValue': (_value: boolean) => boolean;
|
|
18
19
|
done: () => boolean;
|
|
19
20
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
21
|
modelValue: BooleanConstructor;
|
|
21
|
-
headerStyle: import("vue").PropType<import("
|
|
22
|
-
bodyStyle: import("vue").PropType<import("
|
|
23
|
-
footerStyle: import("vue").PropType<import("
|
|
22
|
+
headerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
23
|
+
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
24
|
+
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
24
25
|
title: StringConstructor;
|
|
25
26
|
margin: (StringConstructor | NumberConstructor)[];
|
|
26
27
|
direction: import("vue").PropType<import("./types").PrintDirection | null>;
|
package/lib/ele-printer/index.js
CHANGED
|
@@ -15,6 +15,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
15
15
|
});
|
|
16
16
|
const container = vue.shallowRef(util.getPrintContainer());
|
|
17
17
|
const visible = vue.ref(false);
|
|
18
|
+
const isStatic = vue.computed(() => {
|
|
19
|
+
return props2.static;
|
|
20
|
+
});
|
|
18
21
|
const print = () => {
|
|
19
22
|
if (!authenticated.value) {
|
|
20
23
|
updateModelValue(false);
|
|
@@ -55,7 +58,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
55
58
|
},
|
|
56
59
|
{ immediate: true }
|
|
57
60
|
);
|
|
58
|
-
return { container, visible, print };
|
|
61
|
+
return { container, visible, isStatic, print };
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
64
|
const _export_sfc = (sfc, props2) => {
|
|
@@ -70,10 +73,14 @@ const _hoisted_2 = { key: 1 };
|
|
|
70
73
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
74
|
return vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
72
75
|
to: _ctx.container,
|
|
73
|
-
disabled: _ctx.
|
|
76
|
+
disabled: _ctx.isStatic && !_ctx.visible
|
|
74
77
|
}, [
|
|
75
78
|
vue.createElementVNode("table", {
|
|
76
|
-
class: vue.normalizeClass([
|
|
79
|
+
class: vue.normalizeClass([
|
|
80
|
+
"ele-printer",
|
|
81
|
+
{ "is-open": _ctx.visible },
|
|
82
|
+
{ "is-static": _ctx.isStatic }
|
|
83
|
+
])
|
|
77
84
|
}, [
|
|
78
85
|
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_1, [
|
|
79
86
|
vue.createElementVNode("tr", null, [
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { StyleValue } from '../ele-app/types';
|
|
3
2
|
import type { PrintDirection, PrintOrientation, PrintTarget } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* 属性
|
|
6
5
|
*/
|
|
7
6
|
export declare const printerProps: {
|
|
8
7
|
modelValue: BooleanConstructor;
|
|
9
|
-
headerStyle: PropType<
|
|
10
|
-
bodyStyle: PropType<
|
|
11
|
-
footerStyle: PropType<
|
|
8
|
+
headerStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
9
|
+
bodyStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
10
|
+
footerStyle: PropType<Partial<import("vue").CSSProperties>>;
|
|
12
11
|
title: StringConstructor;
|
|
13
12
|
margin: (StringConstructor | NumberConstructor)[];
|
|
14
13
|
direction: PropType<PrintDirection | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import { BreadcrumbItem } from '../../ele-breadcrumb/types';
|
|
3
3
|
import type { EllipsisProps } from '../../ele-menus/types';
|
|
4
|
-
import type { MenuItem, LevelItem, HeaderStyle } from '../types';
|
|
4
|
+
import type { MenuItem, LevelItem, HeaderStyle, MenuItemTrigger, MenuItemProps } from '../types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
menus: {
|
|
7
7
|
type: PropType<MenuItem[]>;
|
|
@@ -12,6 +12,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
ellipsis: BooleanConstructor;
|
|
13
13
|
ellipsisProps: PropType<EllipsisProps>;
|
|
14
14
|
menuTrigger: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "hover" | "click", unknown> | undefined>;
|
|
15
|
+
itemTrigger: PropType<MenuItemTrigger>;
|
|
15
16
|
collapse: BooleanConstructor;
|
|
16
17
|
sidebar: BooleanConstructor;
|
|
17
18
|
titleSlot: StringConstructor;
|
|
@@ -26,17 +27,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
27
|
isHome: BooleanConstructor;
|
|
27
28
|
}, {
|
|
28
29
|
levelItems: import("vue").ShallowRef<BreadcrumbItem[]>;
|
|
29
|
-
menuItems: import("vue").ComputedRef<
|
|
30
|
+
menuItems: import("vue").ComputedRef<MenuItemProps[]>;
|
|
30
31
|
isDark: import("vue").ComputedRef<boolean>;
|
|
31
32
|
isPrimary: import("vue").ComputedRef<boolean>;
|
|
32
33
|
isIconSeparator: import("vue").ComputedRef<boolean>;
|
|
33
34
|
onLogoClick: () => void;
|
|
34
35
|
onOpen: (index: string, indexPath: string[]) => void;
|
|
35
36
|
onClose: (index: string, indexPath: string[]) => void;
|
|
37
|
+
onItemClick: (item: MenuItemProps) => void;
|
|
36
38
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
39
|
logoClick: () => true;
|
|
38
40
|
open: (_index: string, _indexPath: string[]) => true;
|
|
39
41
|
close: (_index: string, _indexPath: string[]) => true;
|
|
42
|
+
itemClick: (_item: MenuItemProps) => true;
|
|
40
43
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
41
44
|
menus: {
|
|
42
45
|
type: PropType<MenuItem[]>;
|
|
@@ -47,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
50
|
ellipsis: BooleanConstructor;
|
|
48
51
|
ellipsisProps: PropType<EllipsisProps>;
|
|
49
52
|
menuTrigger: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "hover" | "click", unknown> | undefined>;
|
|
53
|
+
itemTrigger: PropType<MenuItemTrigger>;
|
|
50
54
|
collapse: BooleanConstructor;
|
|
51
55
|
sidebar: BooleanConstructor;
|
|
52
56
|
titleSlot: StringConstructor;
|
|
@@ -62,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
66
|
}>> & {
|
|
63
67
|
onOpen?: ((_index: string, _indexPath: string[]) => any) | undefined;
|
|
64
68
|
onClose?: ((_index: string, _indexPath: string[]) => any) | undefined;
|
|
69
|
+
onItemClick?: ((_item: MenuItemProps) => any) | undefined;
|
|
65
70
|
onLogoClick?: (() => any) | undefined;
|
|
66
71
|
}, {
|
|
67
72
|
collapse: boolean;
|
|
@@ -23,6 +23,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
23
23
|
ellipsisProps: Object,
|
|
24
24
|
// 子菜单触发方式
|
|
25
25
|
menuTrigger: String,
|
|
26
|
+
// 菜单项触发模式
|
|
27
|
+
itemTrigger: String,
|
|
26
28
|
// 侧栏是否折叠
|
|
27
29
|
collapse: Boolean,
|
|
28
30
|
// 当前是否有侧栏
|
|
@@ -48,11 +50,14 @@ const _sfc_main = vue.defineComponent({
|
|
|
48
50
|
emits: {
|
|
49
51
|
logoClick: () => true,
|
|
50
52
|
open: (_index, _indexPath) => true,
|
|
51
|
-
close: (_index, _indexPath) => true
|
|
53
|
+
close: (_index, _indexPath) => true,
|
|
54
|
+
itemClick: (_item) => true
|
|
52
55
|
},
|
|
53
56
|
setup(props, { emit }) {
|
|
54
57
|
const levelItems = vue.shallowRef([]);
|
|
55
|
-
const menuItems = vue.computed(() =>
|
|
58
|
+
const menuItems = vue.computed(() => {
|
|
59
|
+
return util.getMenuItems(props.menus, props.itemTrigger != "click");
|
|
60
|
+
});
|
|
56
61
|
const isDark = vue.computed(() => props.headerStyle === "dark");
|
|
57
62
|
const isPrimary = vue.computed(() => props.headerStyle === "primary");
|
|
58
63
|
const isIconSeparator = vue.computed(() => {
|
|
@@ -67,6 +72,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
67
72
|
const onClose = (index, indexPath) => {
|
|
68
73
|
emit("close", index, indexPath);
|
|
69
74
|
};
|
|
75
|
+
const onItemClick = (item) => {
|
|
76
|
+
emit("itemClick", item);
|
|
77
|
+
};
|
|
70
78
|
vue.watch(
|
|
71
79
|
[() => props.isHome, () => props.homePath, () => props.levels],
|
|
72
80
|
() => {
|
|
@@ -96,7 +104,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
96
104
|
isIconSeparator,
|
|
97
105
|
onLogoClick,
|
|
98
106
|
onOpen,
|
|
99
|
-
onClose
|
|
107
|
+
onClose,
|
|
108
|
+
onItemClick
|
|
100
109
|
};
|
|
101
110
|
}
|
|
102
111
|
});
|
|
@@ -170,7 +179,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
170
179
|
defaultActive: _ctx.active,
|
|
171
180
|
menuTrigger: _ctx.menuTrigger,
|
|
172
181
|
onOpen: _ctx.onOpen,
|
|
173
|
-
onClose: _ctx.onClose
|
|
182
|
+
onClose: _ctx.onClose,
|
|
183
|
+
onItemClick: _ctx.onItemClick
|
|
174
184
|
}, vue.createSlots({ _: 2 }, [
|
|
175
185
|
_ctx.iconSlot && _ctx.$slots[_ctx.iconSlot] ? {
|
|
176
186
|
name: "icon",
|
|
@@ -186,7 +196,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
186
196
|
]),
|
|
187
197
|
key: "1"
|
|
188
198
|
} : void 0
|
|
189
|
-
]), 1032, ["items", "theme", "popupTheme", "ellipsis", "ellipsisProps", "defaultActive", "menuTrigger", "onOpen", "onClose"])) : vue.createCommentVNode("", true)
|
|
199
|
+
]), 1032, ["items", "theme", "popupTheme", "ellipsis", "ellipsisProps", "defaultActive", "menuTrigger", "onOpen", "onClose", "onItemClick"])) : vue.createCommentVNode("", true)
|
|
190
200
|
]),
|
|
191
201
|
_ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
192
202
|
vue.renderSlot(_ctx.$slots, "right", { sidebar: _ctx.sidebar })
|
|
@@ -58,14 +58,17 @@ const _sfc_main = vue.defineComponent({
|
|
|
58
58
|
state.timer = null;
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
vue.watch(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
vue.watch(
|
|
62
|
+
() => props.tabActive,
|
|
63
|
+
() => {
|
|
64
|
+
clearTimer();
|
|
65
|
+
if (visible.value) {
|
|
66
|
+
active.value = null;
|
|
67
|
+
} else {
|
|
68
|
+
onAfterLeave(props.transitionDelay);
|
|
69
|
+
}
|
|
67
70
|
}
|
|
68
|
-
|
|
71
|
+
);
|
|
69
72
|
vue.onBeforeUnmount(() => {
|
|
70
73
|
clearTimer();
|
|
71
74
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { ElScrollbarInstance } from '../../ele-app/types';
|
|
3
|
-
import type { MenuItem, SidebarStyle } from '../types';
|
|
3
|
+
import type { MenuItem, SidebarStyle, MenuItemTrigger, MenuItemProps } from '../types';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
menus: {
|
|
6
6
|
type: PropType<MenuItem[]>;
|
|
@@ -13,16 +13,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
uniqueOpened: BooleanConstructor;
|
|
14
14
|
defaultOpeneds: PropType<string[]>;
|
|
15
15
|
popperEffect: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "light" | "dark", unknown>>;
|
|
16
|
+
itemTrigger: PropType<MenuItemTrigger>;
|
|
16
17
|
titleSlot: StringConstructor;
|
|
17
18
|
iconSlot: StringConstructor;
|
|
18
19
|
}, {
|
|
19
20
|
menusRef: import("vue").Ref<ElScrollbarInstance>;
|
|
20
|
-
menuItems: import("vue").ComputedRef<
|
|
21
|
+
menuItems: import("vue").ComputedRef<MenuItemProps[]>;
|
|
21
22
|
onOpen: (index: string, indexPath: string[]) => void;
|
|
22
23
|
onClose: (index: string, indexPath: string[]) => void;
|
|
24
|
+
onItemClick: (item: MenuItemProps) => void;
|
|
23
25
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
26
|
open: (_index: string, _indexPath: string[]) => true;
|
|
25
27
|
close: (_index: string, _indexPath: string[]) => true;
|
|
28
|
+
itemClick: (_item: MenuItemProps) => true;
|
|
26
29
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
30
|
menus: {
|
|
28
31
|
type: PropType<MenuItem[]>;
|
|
@@ -35,11 +38,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
38
|
uniqueOpened: BooleanConstructor;
|
|
36
39
|
defaultOpeneds: PropType<string[]>;
|
|
37
40
|
popperEffect: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "light" | "dark", unknown>>;
|
|
41
|
+
itemTrigger: PropType<MenuItemTrigger>;
|
|
38
42
|
titleSlot: StringConstructor;
|
|
39
43
|
iconSlot: StringConstructor;
|
|
40
44
|
}>> & {
|
|
41
45
|
onOpen?: ((_index: string, _indexPath: string[]) => any) | undefined;
|
|
42
46
|
onClose?: ((_index: string, _indexPath: string[]) => any) | undefined;
|
|
47
|
+
onItemClick?: ((_item: MenuItemProps) => any) | undefined;
|
|
43
48
|
}, {
|
|
44
49
|
uniqueOpened: boolean;
|
|
45
50
|
collapse: boolean;
|
|
@@ -26,6 +26,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
26
26
|
defaultOpeneds: Array,
|
|
27
27
|
// tooltip 主题
|
|
28
28
|
popperEffect: String,
|
|
29
|
+
// 菜单项触发模式
|
|
30
|
+
itemTrigger: String,
|
|
29
31
|
// 标题插槽名称
|
|
30
32
|
titleSlot: String,
|
|
31
33
|
// 图标插槽名称
|
|
@@ -33,7 +35,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
33
35
|
},
|
|
34
36
|
emits: {
|
|
35
37
|
open: (_index, _indexPath) => true,
|
|
36
|
-
close: (_index, _indexPath) => true
|
|
38
|
+
close: (_index, _indexPath) => true,
|
|
39
|
+
itemClick: (_item) => true
|
|
37
40
|
},
|
|
38
41
|
setup(props, { emit }) {
|
|
39
42
|
const { scrollIntoView } = util.useMenuScroll(() => {
|
|
@@ -41,13 +44,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
41
44
|
return (_a = menusRef.value) == null ? void 0 : _a.$el;
|
|
42
45
|
});
|
|
43
46
|
const menusRef = vue.ref(null);
|
|
44
|
-
const menuItems = vue.computed(() =>
|
|
47
|
+
const menuItems = vue.computed(() => {
|
|
48
|
+
return util.getMenuItems(props.menus, props.itemTrigger != "click");
|
|
49
|
+
});
|
|
45
50
|
const onOpen = (index, indexPath) => {
|
|
46
51
|
emit("open", index, indexPath);
|
|
47
52
|
};
|
|
48
53
|
const onClose = (index, indexPath) => {
|
|
49
54
|
emit("close", index, indexPath);
|
|
50
55
|
};
|
|
56
|
+
const onItemClick = (item) => {
|
|
57
|
+
emit("itemClick", item);
|
|
58
|
+
};
|
|
51
59
|
vue.watch(
|
|
52
60
|
() => props.active,
|
|
53
61
|
() => {
|
|
@@ -56,7 +64,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
56
64
|
});
|
|
57
65
|
}
|
|
58
66
|
);
|
|
59
|
-
return { menusRef, menuItems, onOpen, onClose };
|
|
67
|
+
return { menusRef, menuItems, onOpen, onClose, onItemClick };
|
|
60
68
|
}
|
|
61
69
|
});
|
|
62
70
|
const _export_sfc = (sfc, props) => {
|
|
@@ -88,7 +96,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
88
96
|
popperEffect: _ctx.popperEffect,
|
|
89
97
|
collapseTransition: false,
|
|
90
98
|
onOpen: _ctx.onOpen,
|
|
91
|
-
onClose: _ctx.onClose
|
|
99
|
+
onClose: _ctx.onClose,
|
|
100
|
+
onItemClick: _ctx.onItemClick
|
|
92
101
|
}, vue.createSlots({ _: 2 }, [
|
|
93
102
|
_ctx.iconSlot && _ctx.$slots[_ctx.iconSlot] ? {
|
|
94
103
|
name: "icon",
|
|
@@ -104,7 +113,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
104
113
|
]),
|
|
105
114
|
key: "1"
|
|
106
115
|
} : void 0
|
|
107
|
-
]), 1032, ["items", "theme", "colorful", "collapse", "defaultActive", "defaultOpeneds", "uniqueOpened", "popperEffect", "onOpen", "onClose"])
|
|
116
|
+
]), 1032, ["items", "theme", "colorful", "collapse", "defaultActive", "defaultOpeneds", "uniqueOpened", "popperEffect", "onOpen", "onClose", "onItemClick"])
|
|
108
117
|
]),
|
|
109
118
|
_: 3
|
|
110
119
|
}, 512),
|