yuang-framework-ui-pc 1.1.14 → 1.1.16
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/core-components.d.ts +1 -1
- package/es/core-components.js +3 -4
- package/es/ele-app/plus.d.ts +1 -1
- package/es/ele-cropper-modal/index.js +1 -1
- package/es/ele-cropper-modal/style/index.js +1 -1
- package/es/ele-dialog/index.d.ts +2 -2
- package/es/ele-dialog/index.js +38 -38
- package/es/ele-dialog/props.d.ts +3 -3
- package/es/ele-dialog/props.js +5 -5
- package/es/ele-dialog/style/css-var.scss +3 -3
- package/es/ele-dialog/style/index.scss +52 -52
- package/es/ele-dialog/util.d.ts +11 -11
- package/es/ele-dialog/util.js +96 -104
- package/es/ele-drawer/index.js +2 -2
- package/es/ele-map-picker/index.js +1 -1
- package/es/ele-map-picker/style/index.js +1 -1
- package/es/ele-map-picker/style/index.scss +4 -4
- package/es/ele-pro-table/components/tool-export.js +1 -1
- package/es/ele-pro-table/components/tool-print.js +1 -1
- package/es/ele-pro-table/style/index.js +1 -1
- package/es/style/plus.scss +3 -1
- package/es/style/themes/default.scss +26 -0
- package/es/style/themes/theme-util.scss +2 -2
- package/lib/core-components.cjs +54 -55
- package/lib/core-components.d.ts +1 -1
- package/lib/ele-app/plus.d.ts +1 -1
- package/lib/ele-cropper-modal/index.cjs +1 -1
- package/lib/ele-cropper-modal/style/index.cjs +1 -1
- package/lib/ele-dialog/index.cjs +36 -36
- package/lib/ele-dialog/index.d.ts +2 -2
- package/lib/ele-dialog/props.cjs +5 -5
- package/lib/ele-dialog/props.d.ts +3 -3
- package/lib/ele-dialog/style/css-var.scss +3 -3
- package/lib/ele-dialog/style/index.scss +52 -52
- package/lib/ele-dialog/util.cjs +96 -104
- package/lib/ele-dialog/util.d.ts +11 -11
- package/lib/ele-drawer/index.cjs +2 -2
- package/lib/ele-map-picker/index.cjs +1 -1
- package/lib/ele-map-picker/style/index.cjs +1 -1
- package/lib/ele-map-picker/style/index.scss +4 -4
- package/lib/ele-pro-table/components/tool-export.cjs +1 -1
- package/lib/ele-pro-table/components/tool-print.cjs +1 -1
- package/lib/ele-pro-table/style/index.cjs +1 -1
- package/lib/style/plus.scss +3 -1
- package/lib/style/themes/default.scss +26 -0
- package/lib/style/themes/theme-util.scss +2 -2
- package/package.json +2 -2
- package/typings/global.d.ts +0 -1
- package/es/ele-modal/index.d.ts +0 -245
- package/es/ele-modal/index.js +0 -342
- package/es/ele-modal/props.d.ts +0 -135
- package/es/ele-modal/props.js +0 -71
- package/es/ele-modal/style/css-var.scss +0 -8
- package/es/ele-modal/style/index.d.ts +0 -1
- package/es/ele-modal/style/index.js +0 -3
- package/es/ele-modal/style/index.scss +0 -259
- package/es/ele-modal/types.d.ts +0 -43
- package/es/ele-modal/util.d.ts +0 -52
- package/es/ele-modal/util.js +0 -301
- package/lib/ele-modal/index.cjs +0 -341
- package/lib/ele-modal/index.d.ts +0 -245
- package/lib/ele-modal/props.cjs +0 -71
- package/lib/ele-modal/props.d.ts +0 -135
- package/lib/ele-modal/style/css-var.scss +0 -8
- package/lib/ele-modal/style/index.cjs +0 -4
- package/lib/ele-modal/style/index.d.ts +0 -1
- package/lib/ele-modal/style/index.scss +0 -259
- package/lib/ele-modal/types.d.ts +0 -43
- package/lib/ele-modal/util.cjs +0 -301
- package/lib/ele-modal/util.d.ts +0 -52
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@use '../../style/util.scss' as *;
|
|
3
3
|
@use './css-var.scss' as *;
|
|
4
4
|
|
|
5
|
-
@include set-
|
|
5
|
+
@include set-dialog-var($ele);
|
|
6
6
|
|
|
7
|
-
.ele-
|
|
7
|
+
.ele-dialog {
|
|
8
8
|
&.el-overlay {
|
|
9
9
|
height: auto;
|
|
10
10
|
}
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
padding: 0;
|
|
21
21
|
flex-shrink: 0;
|
|
22
22
|
position: relative;
|
|
23
|
-
background: eleVar('
|
|
24
|
-
border-radius: eleVar('
|
|
25
|
-
margin-bottom: eleVar('
|
|
23
|
+
background: eleVar('dialog', 'bg');
|
|
24
|
+
border-radius: eleVar('dialog', 'radius');
|
|
25
|
+
margin-bottom: eleVar('dialog', 'mobile-space');
|
|
26
26
|
|
|
27
27
|
// 让 model 外层不出现滚动条
|
|
28
28
|
position: absolute!important;
|
|
@@ -55,118 +55,118 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/* header */
|
|
58
|
-
.ele-
|
|
58
|
+
.ele-dialog-header {
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: center;
|
|
61
61
|
box-sizing: border-box;
|
|
62
|
-
padding: eleVar('
|
|
63
|
-
border-bottom: eleVar('
|
|
62
|
+
padding: eleVar('dialog', 'header-padding');
|
|
63
|
+
border-bottom: eleVar('dialog', 'header-border');
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.ele-
|
|
66
|
+
.ele-dialog-title {
|
|
67
67
|
flex: 1;
|
|
68
|
-
color: eleVar('
|
|
69
|
-
font-size: eleVar('
|
|
70
|
-
line-height: eleVar('
|
|
71
|
-
font-weight: eleVar('
|
|
68
|
+
color: eleVar('dialog', 'header-color');
|
|
69
|
+
font-size: eleVar('dialog', 'header-font-size');
|
|
70
|
+
line-height: eleVar('dialog', 'header-line-height');
|
|
71
|
+
font-weight: eleVar('dialog', 'header-font-weight');
|
|
72
72
|
box-sizing: border-box;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/* 图标按钮 */
|
|
76
|
-
.ele-
|
|
76
|
+
.ele-dialog-tool {
|
|
77
77
|
flex-shrink: 0;
|
|
78
78
|
display: flex;
|
|
79
79
|
align-items: center;
|
|
80
80
|
justify-content: center;
|
|
81
|
-
width: eleVar('
|
|
82
|
-
height: eleVar('
|
|
83
|
-
line-height: eleVar('
|
|
84
|
-
color: eleVar('
|
|
85
|
-
font-size: eleVar('
|
|
86
|
-
border-radius: eleVar('
|
|
81
|
+
width: eleVar('dialog', 'icon-size');
|
|
82
|
+
height: eleVar('dialog', 'icon-size');
|
|
83
|
+
line-height: eleVar('dialog', 'icon-size');
|
|
84
|
+
color: eleVar('dialog', 'icon-color');
|
|
85
|
+
font-size: eleVar('dialog', 'icon-font-size');
|
|
86
|
+
border-radius: eleVar('dialog', 'icon-radius');
|
|
87
87
|
transition: (color $transition-base, background-color $transition-base);
|
|
88
88
|
box-sizing: border-box;
|
|
89
89
|
cursor: pointer;
|
|
90
90
|
|
|
91
91
|
&:hover {
|
|
92
|
-
color: eleVar('
|
|
93
|
-
background: eleVar('
|
|
92
|
+
color: eleVar('dialog', 'icon-hover-color');
|
|
93
|
+
background: eleVar('dialog', 'icon-hover-bg');
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
& + .ele-
|
|
97
|
-
margin-left: eleVar('
|
|
96
|
+
& + .ele-dialog-tool {
|
|
97
|
+
margin-left: eleVar('dialog', 'icon-space');
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/* body */
|
|
102
|
-
.ele-
|
|
103
|
-
padding: eleVar('
|
|
102
|
+
.ele-dialog-body {
|
|
103
|
+
padding: eleVar('dialog', 'body-padding');
|
|
104
104
|
box-sizing: border-box;
|
|
105
105
|
|
|
106
106
|
&.is-form {
|
|
107
|
-
padding: eleVar('
|
|
107
|
+
padding: eleVar('dialog', 'form-body-padding');
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/* footer */
|
|
112
|
-
.ele-
|
|
113
|
-
padding: eleVar('
|
|
114
|
-
border-top: eleVar('
|
|
112
|
+
.ele-dialog-footer {
|
|
113
|
+
padding: eleVar('dialog', 'footer-padding');
|
|
114
|
+
border-top: eleVar('dialog', 'footer-border');
|
|
115
115
|
box-sizing: border-box;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/* 默认位置 */
|
|
119
|
-
.ele-
|
|
119
|
+
.ele-dialog-top > .el-overlay-dialog > .el-dialog {
|
|
120
120
|
margin: 0;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.ele-
|
|
123
|
+
.ele-dialog-center > .el-overlay-dialog > .el-dialog {
|
|
124
124
|
margin: auto;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.ele-
|
|
127
|
+
.ele-dialog-bottom > .el-overlay-dialog > .el-dialog {
|
|
128
128
|
margin: auto auto 0 auto;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.ele-
|
|
131
|
+
.ele-dialog-left > .el-overlay-dialog > .el-dialog {
|
|
132
132
|
margin: auto auto auto 0;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
.ele-
|
|
135
|
+
.ele-dialog-right > .el-overlay-dialog > .el-dialog {
|
|
136
136
|
margin: auto 0 auto auto;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
.ele-
|
|
139
|
+
.ele-dialog-left-top > .el-overlay-dialog > .el-dialog {
|
|
140
140
|
margin: 0 auto 0 0;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
.ele-
|
|
143
|
+
.ele-dialog-left-bottom > .el-overlay-dialog > .el-dialog {
|
|
144
144
|
margin: auto auto 0 0;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.ele-
|
|
147
|
+
.ele-dialog-right-top > .el-overlay-dialog > .el-dialog {
|
|
148
148
|
margin: 0 0 0 auto;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.ele-
|
|
151
|
+
.ele-dialog-right-bottom > .el-overlay-dialog > .el-dialog {
|
|
152
152
|
margin: auto 0 0 auto;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/* 支持拖拽 */
|
|
156
|
-
.ele-
|
|
156
|
+
.ele-dialog-movable > .el-overlay-dialog > .el-dialog > .el-dialog__header {
|
|
157
157
|
cursor: move;
|
|
158
158
|
user-select: none;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/* 支持拉伸 */
|
|
162
|
-
.ele-
|
|
162
|
+
.ele-dialog-resize-icon {
|
|
163
163
|
position: absolute;
|
|
164
164
|
right: 2px;
|
|
165
165
|
bottom: 2px;
|
|
166
166
|
display: flex;
|
|
167
167
|
align-items: center;
|
|
168
168
|
justify-content: center;
|
|
169
|
-
color: eleVar('
|
|
169
|
+
color: eleVar('dialog', 'icon-color');
|
|
170
170
|
font-size: 12px;
|
|
171
171
|
cursor: se-resize;
|
|
172
172
|
|
|
@@ -179,8 +179,8 @@
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
.ele-
|
|
183
|
-
.ele-
|
|
182
|
+
.ele-dialog-resizable > .el-overlay-dialog > .el-dialog,
|
|
183
|
+
.ele-dialog-fullscreen > .el-overlay-dialog > .el-dialog {
|
|
184
184
|
display: flex;
|
|
185
185
|
flex-direction: column;
|
|
186
186
|
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/* 全屏 */
|
|
194
|
-
.ele-
|
|
194
|
+
.ele-dialog-fullscreen > .el-overlay-dialog > .el-dialog {
|
|
195
195
|
top: 0 !important;
|
|
196
196
|
left: 0 !important;
|
|
197
197
|
margin: 0 !important;
|
|
@@ -207,14 +207,14 @@
|
|
|
207
207
|
& > .el-dialog__header {
|
|
208
208
|
cursor: default;
|
|
209
209
|
|
|
210
|
-
& > .ele-
|
|
210
|
+
& > .ele-dialog-resize-icon {
|
|
211
211
|
display: none;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
/* 同时打开多个 */
|
|
217
|
-
.ele-
|
|
217
|
+
.ele-dialog-container {
|
|
218
218
|
position: absolute;
|
|
219
219
|
top: 0;
|
|
220
220
|
left: 0;
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
overflow: hidden;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
.ele-
|
|
231
|
+
.ele-dialog-multiple {
|
|
232
232
|
pointer-events: none !important;
|
|
233
233
|
position: absolute !important;
|
|
234
234
|
|
|
@@ -243,17 +243,17 @@
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/* 失活状态 */
|
|
246
|
-
.ele-
|
|
246
|
+
.ele-dialog-hide {
|
|
247
247
|
display: none !important;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/* 最大宽度适应屏幕 */
|
|
251
|
-
.ele-
|
|
252
|
-
max-width: calc(100% - #{eleVar('
|
|
251
|
+
.ele-dialog-responsive > .el-overlay-dialog > .el-dialog {
|
|
252
|
+
max-width: calc(100% - #{eleVar('dialog', 'mobile-space')} * 2);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/* 限制在主体区域 */
|
|
256
|
-
.ele-admin-
|
|
256
|
+
.ele-admin-dialogs > .ele-dialog {
|
|
257
257
|
pointer-events: auto;
|
|
258
258
|
position: absolute !important;
|
|
259
259
|
}
|
package/lib/ele-dialog/util.cjs
CHANGED
|
@@ -3,23 +3,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const core = require("../utils/core");
|
|
5
5
|
const hook = require("../utils/hook");
|
|
6
|
-
const containerClass = "ele-
|
|
7
|
-
const wrapperClass = "ele-
|
|
8
|
-
const closedClass = "ele-
|
|
6
|
+
const containerClass = "ele-dialog-container";
|
|
7
|
+
const wrapperClass = "ele-dialog";
|
|
8
|
+
const closedClass = "ele-dialog-closed";
|
|
9
9
|
const fixTop = 0.65;
|
|
10
10
|
const fixLeft = 0.65;
|
|
11
|
-
function
|
|
11
|
+
function getDialogEl(dialogRef) {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
const el = (_b = vue.unref((_a = vue.unref(dialogRef)) == null ? void 0 : _a.dialogContentRef)) == null ? void 0 : _b.$el;
|
|
14
14
|
return el;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function initDialogStyle(dialogEl) {
|
|
17
|
+
dialogEl.style.top = dialogEl.offsetTop + "px";
|
|
18
|
+
dialogEl.style.left = dialogEl.offsetLeft + "px";
|
|
19
|
+
dialogEl.style.right = "auto";
|
|
20
|
+
dialogEl.style.bottom = "auto";
|
|
21
|
+
dialogEl.style.position = "absolute";
|
|
22
|
+
dialogEl.style.margin = "0";
|
|
23
23
|
}
|
|
24
24
|
function canMoveOut(moveOut, direction) {
|
|
25
25
|
if (direction && moveOut != null && Array.isArray(moveOut)) {
|
|
@@ -27,9 +27,9 @@ function canMoveOut(moveOut, direction) {
|
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function getDialogContainer(inner, multiple, appendTo, dialogsEl) {
|
|
31
31
|
if (multiple) {
|
|
32
|
-
const parent = (inner ?
|
|
32
|
+
const parent = (inner ? dialogsEl : void 0) || document.body;
|
|
33
33
|
const wrapper = core.queryChild(parent, containerClass);
|
|
34
34
|
if (wrapper) {
|
|
35
35
|
return wrapper;
|
|
@@ -39,37 +39,37 @@ function getModalContainer(inner, multiple, appendTo, modalsEl) {
|
|
|
39
39
|
parent.appendChild(elem);
|
|
40
40
|
return elem;
|
|
41
41
|
}
|
|
42
|
-
if (inner &&
|
|
43
|
-
return
|
|
42
|
+
if (inner && dialogsEl) {
|
|
43
|
+
return dialogsEl;
|
|
44
44
|
}
|
|
45
45
|
return appendTo || "body";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let
|
|
47
|
+
function useDialogMove(dialogRef, props, isFullscreen) {
|
|
48
|
+
let dialogEl = null;
|
|
49
49
|
let wrapEl = null;
|
|
50
50
|
let downOL = null;
|
|
51
51
|
let downOT = null;
|
|
52
52
|
const { handleMousedown, handleTouchstart } = hook.useMoveEvent({
|
|
53
53
|
start: () => {
|
|
54
|
-
|
|
55
|
-
wrapEl =
|
|
56
|
-
if (!
|
|
54
|
+
dialogEl = getDialogEl(dialogRef);
|
|
55
|
+
wrapEl = dialogEl == null ? void 0 : dialogEl.parentElement;
|
|
56
|
+
if (!dialogEl || !wrapEl || !props.draggable || isFullscreen.value) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
downOL =
|
|
62
|
-
downOT =
|
|
59
|
+
dialogEl.style.userSelect = "none";
|
|
60
|
+
initDialogStyle(dialogEl);
|
|
61
|
+
downOL = dialogEl.offsetLeft;
|
|
62
|
+
downOT = dialogEl.offsetTop;
|
|
63
63
|
},
|
|
64
64
|
move: ({ distanceX, distanceY, e }) => {
|
|
65
|
-
if (!
|
|
65
|
+
if (!dialogEl || !wrapEl || downOL == null || downOT == null || distanceX == null || distanceY == null) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
e.preventDefault();
|
|
69
69
|
let positionLeft = distanceX + downOL;
|
|
70
70
|
let positionTop = distanceY + downOT;
|
|
71
|
-
const limitL = wrapEl.clientWidth -
|
|
72
|
-
const limitT = wrapEl.clientHeight -
|
|
71
|
+
const limitL = wrapEl.clientWidth - dialogEl.clientWidth - fixLeft;
|
|
72
|
+
const limitT = wrapEl.clientHeight - dialogEl.clientHeight - fixTop;
|
|
73
73
|
if (!props.moveOut) {
|
|
74
74
|
if (positionLeft < 0) {
|
|
75
75
|
positionLeft = 0;
|
|
@@ -104,16 +104,16 @@ function useModalMove(dialogRef, props, isFullscreen) {
|
|
|
104
104
|
positionTop = minLimitT;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
dialogEl.style.left = `${Math.floor(positionLeft)}px`;
|
|
108
|
+
dialogEl.style.top = `${Math.floor(positionTop)}px`;
|
|
109
109
|
},
|
|
110
110
|
end: () => {
|
|
111
|
-
if (
|
|
112
|
-
|
|
111
|
+
if (dialogEl) {
|
|
112
|
+
dialogEl.style.userSelect = "";
|
|
113
113
|
}
|
|
114
114
|
downOL = null;
|
|
115
115
|
downOT = null;
|
|
116
|
-
|
|
116
|
+
dialogEl = null;
|
|
117
117
|
wrapEl = null;
|
|
118
118
|
},
|
|
119
119
|
touchmoveOptions: { passive: false }
|
|
@@ -123,52 +123,52 @@ function useModalMove(dialogRef, props, isFullscreen) {
|
|
|
123
123
|
handleHeaderTouchstart: handleTouchstart
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
let
|
|
126
|
+
function useDialogResize(dialogRef, props, isFullscreen) {
|
|
127
|
+
let dialogEl = null;
|
|
128
128
|
let wrapEl = null;
|
|
129
129
|
let downW = null;
|
|
130
130
|
let downH = null;
|
|
131
131
|
const { handleMousedown, handleTouchstart } = hook.useMoveEvent({
|
|
132
132
|
start: () => {
|
|
133
|
-
|
|
134
|
-
wrapEl =
|
|
135
|
-
if (!
|
|
133
|
+
dialogEl = getDialogEl(dialogRef);
|
|
134
|
+
wrapEl = dialogEl == null ? void 0 : dialogEl.parentElement;
|
|
135
|
+
if (!dialogEl || !wrapEl || !props.resizable || isFullscreen.value) {
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
downW =
|
|
141
|
-
downH =
|
|
138
|
+
dialogEl.style.userSelect = "none";
|
|
139
|
+
initDialogStyle(dialogEl);
|
|
140
|
+
downW = dialogEl.clientWidth;
|
|
141
|
+
downH = dialogEl.clientHeight;
|
|
142
142
|
},
|
|
143
143
|
move: ({ distanceX, distanceY, e }) => {
|
|
144
|
-
if (!
|
|
144
|
+
if (!dialogEl || !wrapEl || downW == null || downH == null || distanceX == null || distanceY == null) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
e.preventDefault();
|
|
148
148
|
if (props.resizable !== "vertical") {
|
|
149
149
|
const w = distanceX + downW;
|
|
150
|
-
const maxW = wrapEl.clientWidth -
|
|
150
|
+
const maxW = wrapEl.clientWidth - dialogEl.offsetLeft - fixLeft;
|
|
151
151
|
const nw = (w < props.minWidth ? props.minWidth : !canMoveOut(props.moveOut, "right") && w > maxW ? maxW : w) + "px";
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
dialogEl.style.width = nw;
|
|
153
|
+
dialogEl.style.maxWidth = nw;
|
|
154
|
+
dialogEl.style.minWidth = nw;
|
|
155
155
|
}
|
|
156
156
|
if (props.resizable !== "horizontal") {
|
|
157
157
|
const h = distanceY + downH;
|
|
158
|
-
const maxH = wrapEl.clientHeight -
|
|
158
|
+
const maxH = wrapEl.clientHeight - dialogEl.offsetTop - fixTop;
|
|
159
159
|
const nh = (h < props.minHeight ? props.minHeight : !canMoveOut(props.moveOut, "bottom") && h > maxH ? maxH : h) + "px";
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
dialogEl.style.height = nh;
|
|
161
|
+
dialogEl.style.maxHeight = nh;
|
|
162
|
+
dialogEl.style.minHeight = nh;
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
end: () => {
|
|
166
|
-
if (
|
|
167
|
-
|
|
166
|
+
if (dialogEl) {
|
|
167
|
+
dialogEl.style.userSelect = "";
|
|
168
168
|
}
|
|
169
169
|
downW = null;
|
|
170
170
|
downH = null;
|
|
171
|
-
|
|
171
|
+
dialogEl = null;
|
|
172
172
|
wrapEl = null;
|
|
173
173
|
},
|
|
174
174
|
touchmoveOptions: { passive: false }
|
|
@@ -178,38 +178,30 @@ function useModalResize(dialogRef, props, isFullscreen) {
|
|
|
178
178
|
handleResizeTouchstart: handleTouchstart
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
const { handleHeaderMousedown, handleHeaderTouchstart } =
|
|
183
|
-
|
|
184
|
-
props,
|
|
185
|
-
isFullscreen
|
|
186
|
-
);
|
|
187
|
-
const { handleResizeMousedown, handleResizeTouchstart } = useModalResize(
|
|
188
|
-
dialogRef,
|
|
189
|
-
props,
|
|
190
|
-
isFullscreen
|
|
191
|
-
);
|
|
181
|
+
function useDialogEvent(dialogRef, props, isFullscreen) {
|
|
182
|
+
const { handleHeaderMousedown, handleHeaderTouchstart } = useDialogMove(dialogRef, props, isFullscreen);
|
|
183
|
+
const { handleResizeMousedown, handleResizeTouchstart } = useDialogResize(dialogRef, props, isFullscreen);
|
|
192
184
|
let isInitPosition = true;
|
|
193
185
|
const getZIndex = () => {
|
|
194
186
|
return props.zIndex ?? 2e3;
|
|
195
187
|
};
|
|
196
|
-
const
|
|
188
|
+
const topDialog = (el) => {
|
|
197
189
|
var _a;
|
|
198
|
-
const
|
|
199
|
-
const overlayEl = (_a =
|
|
190
|
+
const dialogEl = el ?? getDialogEl(dialogRef);
|
|
191
|
+
const overlayEl = (_a = dialogEl == null ? void 0 : dialogEl.parentElement) == null ? void 0 : _a.parentElement;
|
|
200
192
|
if (!overlayEl) {
|
|
201
193
|
return;
|
|
202
194
|
}
|
|
203
195
|
const currentIndex = core.getCurrentStyle(overlayEl).zIndex;
|
|
204
196
|
const containerEl = overlayEl.parentElement;
|
|
205
197
|
const cls = `.${wrapperClass}:not(.${closedClass})`;
|
|
206
|
-
const
|
|
198
|
+
const dialogs = containerEl ? containerEl.querySelectorAll(cls) : void 0;
|
|
207
199
|
let maxIndex = 0;
|
|
208
|
-
(
|
|
209
|
-
const zIndex = core.getCurrentStyle(
|
|
200
|
+
(dialogs ? Array.from(dialogs) : []).forEach((dialogEl2) => {
|
|
201
|
+
const zIndex = core.getCurrentStyle(dialogEl2).zIndex;
|
|
210
202
|
if (zIndex != null) {
|
|
211
203
|
const index = Number(zIndex);
|
|
212
|
-
if (index >= maxIndex && (!overlayEl ||
|
|
204
|
+
if (index >= maxIndex && (!overlayEl || dialogEl2 !== overlayEl)) {
|
|
213
205
|
maxIndex = index + 1;
|
|
214
206
|
}
|
|
215
207
|
}
|
|
@@ -220,21 +212,21 @@ function useModalEvent(dialogRef, props, isFullscreen) {
|
|
|
220
212
|
};
|
|
221
213
|
const mousedownListener = (event) => {
|
|
222
214
|
if (props.multiple) {
|
|
223
|
-
|
|
215
|
+
topDialog(event.currentTarget);
|
|
224
216
|
}
|
|
225
217
|
};
|
|
226
218
|
const bindAutoTopEvent = () => {
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
219
|
+
const dialogEl = getDialogEl(dialogRef);
|
|
220
|
+
if (dialogEl) {
|
|
221
|
+
dialogEl.addEventListener("mousedown", mousedownListener);
|
|
222
|
+
dialogEl.addEventListener("touchstart", mousedownListener);
|
|
231
223
|
}
|
|
232
224
|
};
|
|
233
225
|
const unbindAutoTopEvent = () => {
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
|
|
226
|
+
const dialogEl = getDialogEl(dialogRef);
|
|
227
|
+
if (dialogEl) {
|
|
228
|
+
dialogEl.removeEventListener("mousedown", mousedownListener);
|
|
229
|
+
dialogEl.removeEventListener("touchstart", mousedownListener);
|
|
238
230
|
}
|
|
239
231
|
};
|
|
240
232
|
const getPositionMargin = (position) => {
|
|
@@ -255,29 +247,29 @@ function useModalEvent(dialogRef, props, isFullscreen) {
|
|
|
255
247
|
const setInitPosition = () => {
|
|
256
248
|
if (isInitPosition) {
|
|
257
249
|
isInitPosition = false;
|
|
258
|
-
const
|
|
250
|
+
const dialogEl = getDialogEl(dialogRef);
|
|
259
251
|
const margin = getPositionMargin(getPosition());
|
|
260
|
-
if (
|
|
261
|
-
|
|
252
|
+
if (dialogEl && margin != null) {
|
|
253
|
+
dialogEl.style.margin = margin;
|
|
262
254
|
}
|
|
263
255
|
}
|
|
264
256
|
};
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
if (
|
|
257
|
+
const resetDialogStyle = () => {
|
|
258
|
+
const dialogEl = getDialogEl(dialogRef);
|
|
259
|
+
if (dialogEl) {
|
|
268
260
|
const w = props.width;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
261
|
+
dialogEl.style.margin = getPositionMargin(getPosition()) || "";
|
|
262
|
+
dialogEl.style.position = "";
|
|
263
|
+
dialogEl.style.top = "";
|
|
264
|
+
dialogEl.style.left = "";
|
|
265
|
+
dialogEl.style.right = "";
|
|
266
|
+
dialogEl.style.bottom = "";
|
|
267
|
+
dialogEl.style.height = "";
|
|
268
|
+
dialogEl.style.maxHeight = "";
|
|
269
|
+
dialogEl.style.minHeight = "";
|
|
270
|
+
dialogEl.style.width = typeof w === "number" ? `${w}px` : w ?? "";
|
|
271
|
+
dialogEl.style.maxWidth = "";
|
|
272
|
+
dialogEl.style.minWidth = "";
|
|
281
273
|
}
|
|
282
274
|
};
|
|
283
275
|
return {
|
|
@@ -287,15 +279,15 @@ function useModalEvent(dialogRef, props, isFullscreen) {
|
|
|
287
279
|
handleResizeTouchstart,
|
|
288
280
|
bindAutoTopEvent,
|
|
289
281
|
unbindAutoTopEvent,
|
|
290
|
-
|
|
282
|
+
topDialog,
|
|
291
283
|
setInitPosition,
|
|
292
|
-
|
|
284
|
+
resetDialogStyle
|
|
293
285
|
};
|
|
294
286
|
}
|
|
295
287
|
exports.closedClass = closedClass;
|
|
296
288
|
exports.containerClass = containerClass;
|
|
297
|
-
exports.
|
|
298
|
-
exports.
|
|
299
|
-
exports.
|
|
300
|
-
exports.
|
|
289
|
+
exports.getDialogContainer = getDialogContainer;
|
|
290
|
+
exports.useDialogEvent = useDialogEvent;
|
|
291
|
+
exports.useDialogMove = useDialogMove;
|
|
292
|
+
exports.useDialogResize = useDialogResize;
|
|
301
293
|
exports.wrapperClass = wrapperClass;
|
package/lib/ele-dialog/util.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ElDialogInstance } from '../ele-app/el';
|
|
3
|
-
import {
|
|
3
|
+
import { DialogProps } from './props';
|
|
4
4
|
|
|
5
|
-
export declare const containerClass = "ele-
|
|
6
|
-
export declare const wrapperClass = "ele-
|
|
7
|
-
export declare const closedClass = "ele-
|
|
5
|
+
export declare const containerClass = "ele-dialog-container";
|
|
6
|
+
export declare const wrapperClass = "ele-dialog";
|
|
7
|
+
export declare const closedClass = "ele-dialog-closed";
|
|
8
8
|
/**
|
|
9
9
|
* 获取弹窗容器
|
|
10
10
|
* @param inner 是否限制在主体内部
|
|
11
11
|
* @param multiple 是否支持同时打开多个
|
|
12
12
|
* @param appendTo 自定义插入的容器
|
|
13
|
-
* @param
|
|
13
|
+
* @param dialogsEl 限制在主体内部时的容器
|
|
14
14
|
*/
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function getDialogContainer(inner?: boolean, multiple?: boolean, appendTo?: string | HTMLElement, dialogsEl?: HTMLElement | null): HTMLElement | string;
|
|
16
16
|
/**
|
|
17
17
|
* 弹窗支持移动
|
|
18
18
|
* @param dialogRef 弹窗实例
|
|
19
19
|
* @param props 属性
|
|
20
20
|
* @param isFullscreen 全屏状态
|
|
21
21
|
*/
|
|
22
|
-
export declare function
|
|
22
|
+
export declare function useDialogMove(dialogRef: Ref<ElDialogInstance>, props: DialogProps, isFullscreen: Ref<boolean>): {
|
|
23
23
|
handleHeaderMousedown: (e: MouseEvent) => void;
|
|
24
24
|
handleHeaderTouchstart: (e: TouchEvent) => void;
|
|
25
25
|
};
|
|
@@ -29,7 +29,7 @@ export declare function useModalMove(dialogRef: Ref<ElDialogInstance>, props: Mo
|
|
|
29
29
|
* @param props 属性
|
|
30
30
|
* @param isFullscreen 全屏状态
|
|
31
31
|
*/
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function useDialogResize(dialogRef: Ref<ElDialogInstance>, props: DialogProps, isFullscreen: Ref<boolean>): {
|
|
33
33
|
handleResizeMousedown: (e: MouseEvent) => void;
|
|
34
34
|
handleResizeTouchstart: (e: TouchEvent) => void;
|
|
35
35
|
};
|
|
@@ -39,14 +39,14 @@ export declare function useModalResize(dialogRef: Ref<ElDialogInstance>, props:
|
|
|
39
39
|
* @param props 属性
|
|
40
40
|
* @param isFullscreen 全屏状态
|
|
41
41
|
*/
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function useDialogEvent(dialogRef: Ref<ElDialogInstance>, props: DialogProps, isFullscreen: Ref<boolean>): {
|
|
43
43
|
handleHeaderMousedown: (e: MouseEvent) => void;
|
|
44
44
|
handleHeaderTouchstart: (e: TouchEvent) => void;
|
|
45
45
|
handleResizeMousedown: (e: MouseEvent) => void;
|
|
46
46
|
handleResizeTouchstart: (e: TouchEvent) => void;
|
|
47
47
|
bindAutoTopEvent: () => void;
|
|
48
48
|
unbindAutoTopEvent: () => void;
|
|
49
|
-
|
|
49
|
+
topDialog: (el?: HTMLElement) => void;
|
|
50
50
|
setInitPosition: () => void;
|
|
51
|
-
|
|
51
|
+
resetDialogStyle: () => void;
|
|
52
52
|
};
|
package/lib/ele-drawer/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const elementPlus = require("element-plus");
|
|
|
4
4
|
const icons = require("../icons");
|
|
5
5
|
const ReceiverView = require("../ele-config-provider/components/receiver-view");
|
|
6
6
|
const util = require("../ele-pro-layout/util");
|
|
7
|
-
const util$1 = require("../ele-
|
|
7
|
+
const util$1 = require("../ele-dialog/util");
|
|
8
8
|
const props = require("./props");
|
|
9
9
|
const _sfc_main = vue.defineComponent({
|
|
10
10
|
name: "EleDrawer",
|
|
@@ -32,7 +32,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
32
32
|
return classes.join(" ");
|
|
33
33
|
});
|
|
34
34
|
const teleportTo = vue.computed(() => {
|
|
35
|
-
return util$1.
|
|
35
|
+
return util$1.getDialogContainer(
|
|
36
36
|
props2.inner,
|
|
37
37
|
false,
|
|
38
38
|
props2.appendTo,
|