ele-admin-plus 1.1.9-beta.5 → 1.1.9-beta.7
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-app/el.d.ts +3 -0
- package/es/ele-basic-select/index.d.ts +1 -1
- package/es/ele-data-table/index.d.ts +1 -1
- package/es/ele-data-table/props.d.ts +2 -2
- package/es/ele-ellipsis/index.js +2 -23
- package/es/ele-icon-select/index.d.ts +1 -1
- package/es/ele-map-picker/components/map-view.d.ts +47 -24
- package/es/ele-map-picker/components/map-view.js +227 -176
- package/es/ele-map-picker/index.d.ts +38 -16
- package/es/ele-map-picker/index.js +21 -39
- package/es/ele-map-picker/props.d.ts +33 -9
- package/es/ele-map-picker/props.js +20 -6
- package/es/ele-map-picker/style/index.scss +195 -166
- package/es/ele-map-picker/types.d.ts +8 -4
- package/es/ele-menus/index.d.ts +12 -3
- package/es/ele-menus/index.js +57 -5
- package/es/ele-menus/props.d.ts +8 -0
- package/es/ele-menus/props.js +10 -2
- package/es/ele-menus/style/index.scss +1 -1
- package/es/ele-menus/util.d.ts +15 -3
- package/es/ele-menus/util.js +47 -21
- package/es/ele-modal/index.js +1 -1
- package/es/ele-modal/style/index.scss +1 -0
- package/es/ele-popconfirm/index.d.ts +3 -3
- package/es/ele-popover/index.d.ts +3 -3
- package/es/ele-popover/props.d.ts +1 -1
- package/es/ele-pro-layout/components/pro-header.d.ts +9 -0
- package/es/ele-pro-layout/components/pro-header.js +8 -2
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +9 -0
- package/es/ele-pro-layout/components/pro-sidebar.js +8 -2
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +9 -0
- package/es/ele-pro-layout/components/pro-sidebox.js +8 -2
- package/es/ele-pro-layout/index.d.ts +43 -40
- package/es/ele-pro-layout/index.js +9 -3
- package/es/ele-pro-layout/props.d.ts +9 -5
- package/es/ele-pro-layout/props.js +9 -5
- package/es/ele-pro-table/index.d.ts +5 -5
- package/es/ele-table-select/index.d.ts +3 -3
- package/es/ele-tooltip/index.d.ts +1 -1
- package/es/ele-tree-select/index.d.ts +1 -1
- package/es/ele-upload-list/style/index.scss +2 -1
- package/es/ele-virtual-table/index.d.ts +1 -1
- package/es/ele-virtual-table/props.d.ts +2 -2
- package/es/ele-virtual-table/util.js +2 -18
- package/es/lang/en_US.js +2 -1
- package/es/lang/zh_CN.js +2 -1
- package/es/lang/zh_TW.js +2 -1
- package/es/style/themes/default.scss +1 -1
- package/es/style/themes/rounded.scss +1 -1
- package/es/utils/core.d.ts +5 -0
- package/es/utils/core.js +28 -0
- package/lib/ele-app/el.d.ts +3 -0
- package/lib/ele-basic-select/index.d.ts +1 -1
- package/lib/ele-data-table/index.d.ts +1 -1
- package/lib/ele-data-table/props.d.ts +2 -2
- package/lib/ele-ellipsis/index.cjs +1 -22
- package/lib/ele-icon-select/index.d.ts +1 -1
- package/lib/ele-map-picker/components/map-view.cjs +225 -174
- package/lib/ele-map-picker/components/map-view.d.ts +47 -24
- package/lib/ele-map-picker/index.cjs +20 -38
- package/lib/ele-map-picker/index.d.ts +38 -16
- package/lib/ele-map-picker/props.cjs +20 -6
- package/lib/ele-map-picker/props.d.ts +33 -9
- package/lib/ele-map-picker/style/index.scss +195 -166
- package/lib/ele-map-picker/types.d.ts +8 -4
- package/lib/ele-menus/index.cjs +55 -3
- package/lib/ele-menus/index.d.ts +12 -3
- package/lib/ele-menus/props.cjs +10 -2
- package/lib/ele-menus/props.d.ts +8 -0
- package/lib/ele-menus/style/index.scss +1 -1
- package/lib/ele-menus/util.cjs +47 -21
- package/lib/ele-menus/util.d.ts +15 -3
- package/lib/ele-modal/index.cjs +1 -1
- package/lib/ele-modal/style/index.scss +1 -0
- package/lib/ele-popconfirm/index.d.ts +3 -3
- package/lib/ele-popover/index.d.ts +3 -3
- package/lib/ele-popover/props.d.ts +1 -1
- package/lib/ele-pro-layout/components/pro-header.cjs +8 -2
- package/lib/ele-pro-layout/components/pro-header.d.ts +9 -0
- package/lib/ele-pro-layout/components/pro-sidebar.cjs +8 -2
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +9 -0
- package/lib/ele-pro-layout/components/pro-sidebox.cjs +8 -2
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +9 -0
- package/lib/ele-pro-layout/index.cjs +9 -3
- package/lib/ele-pro-layout/index.d.ts +43 -40
- package/lib/ele-pro-layout/props.cjs +9 -5
- package/lib/ele-pro-layout/props.d.ts +9 -5
- package/lib/ele-pro-table/index.d.ts +5 -5
- package/lib/ele-table-select/index.d.ts +3 -3
- package/lib/ele-tooltip/index.d.ts +1 -1
- package/lib/ele-tree-select/index.d.ts +1 -1
- package/lib/ele-upload-list/style/index.scss +2 -1
- package/lib/ele-virtual-table/index.d.ts +1 -1
- package/lib/ele-virtual-table/props.d.ts +2 -2
- package/lib/ele-virtual-table/util.cjs +1 -17
- package/lib/lang/en_US.cjs +2 -1
- package/lib/lang/zh_CN.cjs +2 -1
- package/lib/lang/zh_TW.cjs +2 -1
- package/lib/style/themes/default.scss +1 -1
- package/lib/style/themes/rounded.scss +1 -1
- package/lib/utils/core.cjs +28 -0
- package/lib/utils/core.d.ts +5 -0
- package/package.json +2 -2
|
@@ -4,193 +4,234 @@
|
|
|
4
4
|
|
|
5
5
|
@include set-map-var($ele);
|
|
6
6
|
|
|
7
|
-
.ele-map-picker
|
|
7
|
+
.ele-modal .ele-map-picker .ele-modal-body {
|
|
8
8
|
padding: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
.ele-map-picker {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* 主体区域 */
|
|
16
|
+
.ele-map-view {
|
|
13
17
|
display: flex;
|
|
14
|
-
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
padding: eleVar('map', 'header-padding');
|
|
18
|
+
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/* 地图容器 */
|
|
21
|
+
.ele-map-view-body {
|
|
22
|
+
flex: 1;
|
|
23
|
+
height: 100%;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
position: relative;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/* 地图中心图标 */
|
|
30
|
+
.ele-map-view-body-icon {
|
|
31
|
+
width: 26px;
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: 50%;
|
|
34
|
+
bottom: 50%;
|
|
35
|
+
margin-left: -13px;
|
|
36
|
+
}
|
|
29
37
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
.ele-map-view-icon-plus {
|
|
39
|
+
color: #1677ff;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 50%;
|
|
43
|
+
left: 50%;
|
|
44
|
+
transform: translate(-50%, -50%);
|
|
34
45
|
}
|
|
35
46
|
|
|
36
|
-
/*
|
|
37
|
-
.ele-map-view-
|
|
47
|
+
/* 列表区域 */
|
|
48
|
+
.ele-map-view-side {
|
|
49
|
+
width: 40%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
flex-shrink: 0;
|
|
38
52
|
display: flex;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.ele-map-view-main {
|
|
44
|
-
flex: 1;
|
|
45
|
-
position: relative;
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
}
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
}
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
margin-left: -13px;
|
|
55
|
-
}
|
|
57
|
+
/* 列表顶部搜索框 */
|
|
58
|
+
.ele-map-view-search {
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
padding: eleVar('map', 'search-padding');
|
|
61
|
+
box-sizing: border-box;
|
|
56
62
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 50%;
|
|
62
|
-
left: 50%;
|
|
63
|
-
transform: translate(-50%, -50%);
|
|
63
|
+
.el-autocomplete,
|
|
64
|
+
.el-input {
|
|
65
|
+
width: 100%;
|
|
64
66
|
}
|
|
67
|
+
}
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
box-sizing: border-box;
|
|
74
|
-
}
|
|
69
|
+
/* 列表底部提示信息 */
|
|
70
|
+
.ele-map-view-extra {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
padding: 6px 12px;
|
|
73
|
+
box-sizing: border-box;
|
|
75
74
|
|
|
76
|
-
/*
|
|
77
|
-
.ele-map-view-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
box-sizing: border-box;
|
|
75
|
+
/* 确定按钮 */
|
|
76
|
+
.ele-map-view-btn-ok {
|
|
77
|
+
width: 100%;
|
|
78
|
+
display: block;
|
|
81
79
|
}
|
|
80
|
+
}
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
.ele-map-view-message {
|
|
83
|
+
padding: 4px 8px;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
color: elVar('color-error');
|
|
86
|
+
font-size: elVar('font-size', 'small');
|
|
87
|
+
background: elVar('color-error', 'light-9');
|
|
88
|
+
border: 1px solid elVar('color-error', 'light-8');
|
|
89
|
+
border-radius: elVar('border-radius', 'base');
|
|
90
|
+
text-align: center;
|
|
91
|
+
}
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
/* 列表空图标 */
|
|
94
|
+
.ele-map-view-empty {
|
|
95
|
+
height: 100%;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
}
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
101
|
+
/* poi列表 */
|
|
102
|
+
.ele-map-view-list {
|
|
103
|
+
flex: 1;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
overflow: auto;
|
|
106
|
+
}
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
.ele-map-view-item {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
padding: 8px 14px;
|
|
112
|
+
transition: background-color $ele-transition;
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
position: relative;
|
|
115
|
+
cursor: pointer;
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
117
|
+
&:hover {
|
|
118
|
+
background: elVar('fill-color', 'light');
|
|
121
119
|
}
|
|
122
120
|
|
|
123
|
-
.ele-map-view-item
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
& + .ele-map-view-item::before {
|
|
122
|
+
content: '';
|
|
123
|
+
border-top: 1px solid elVar('border-color', 'light');
|
|
126
124
|
position: absolute;
|
|
127
|
-
top:
|
|
125
|
+
top: 0;
|
|
128
126
|
left: 12px;
|
|
129
|
-
|
|
127
|
+
right: 12px;
|
|
130
128
|
}
|
|
129
|
+
}
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
.ele-map-view-item-body {
|
|
132
|
+
flex: 1;
|
|
133
|
+
padding: 0 0 0 6px;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
}
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
138
|
+
.ele-map-view-item-title {
|
|
139
|
+
font-size: elVar('font-size', 'base');
|
|
140
|
+
word-break: break-all;
|
|
141
|
+
}
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
font-size: 14px;
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
143
|
+
.ele-map-view-item-text {
|
|
144
|
+
color: elVar('text-color', 'secondary');
|
|
145
|
+
font-size: elVar('font-size', 'extra-small');
|
|
146
|
+
word-break: break-all;
|
|
147
|
+
margin-top: 2px;
|
|
148
|
+
}
|
|
151
149
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
.ele-map-view-item-icon {
|
|
151
|
+
flex-shrink: 0;
|
|
152
|
+
font-size: 18px;
|
|
153
|
+
color: elVar('text-color', 'secondary');
|
|
154
|
+
}
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
.ele-map-view-item-radio {
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
color: elVar('color-primary');
|
|
159
|
+
margin: 0 -4px 0 0;
|
|
160
|
+
visibility: hidden;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
75%,
|
|
167
|
-
90%,
|
|
168
|
-
to {
|
|
169
|
-
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
170
|
-
}
|
|
163
|
+
.ele-map-view-item.is-active .ele-map-view-item-radio {
|
|
164
|
+
visibility: visible;
|
|
165
|
+
}
|
|
171
166
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
/* 地图底部提示信息 */
|
|
168
|
+
.ele-map-view-body {
|
|
169
|
+
& > .ele-map-view-search {
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: 8px;
|
|
172
|
+
left: 8px;
|
|
173
|
+
padding: 8px;
|
|
174
|
+
width: 228px;
|
|
175
|
+
max-width: calc(100% - 16px);
|
|
176
|
+
background: elVar('bg-color');
|
|
177
|
+
box-shadow: elVar('box-shadow', 'lighter');
|
|
178
|
+
border-radius: elVar('border-radius', 'base');
|
|
175
179
|
}
|
|
176
180
|
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
& > .ele-map-view-message,
|
|
182
|
+
& > .ele-map-view-btn-ok {
|
|
183
|
+
position: absolute;
|
|
184
|
+
bottom: 20px;
|
|
185
|
+
left: 0;
|
|
186
|
+
right: 0;
|
|
187
|
+
margin: 0 auto;
|
|
188
|
+
width: max-content;
|
|
189
|
+
max-width: calc(100% - 32px);
|
|
190
|
+
box-shadow: elVar('box-shadow', 'light');
|
|
179
191
|
}
|
|
180
192
|
|
|
181
|
-
|
|
182
|
-
|
|
193
|
+
& > .ele-map-view-btn-ok {
|
|
194
|
+
width: 120px;
|
|
195
|
+
border-radius: 32px;
|
|
183
196
|
}
|
|
197
|
+
}
|
|
184
198
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
/* 搜索建议列表 */
|
|
200
|
+
.ele-map-suggest-popper.el-popper .el-autocomplete-suggestion__list > li {
|
|
201
|
+
height: auto;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ele-map-suggest-item {
|
|
205
|
+
line-height: normal;
|
|
206
|
+
box-sizing: border-box;
|
|
207
|
+
padding: 6px 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ele-map-suggest-title {
|
|
211
|
+
word-break: break-all;
|
|
188
212
|
}
|
|
189
213
|
|
|
190
214
|
.ele-map-suggest-text {
|
|
191
215
|
color: elVar('text-color', 'secondary');
|
|
192
216
|
font-size: elVar('font-size', 'small');
|
|
193
|
-
|
|
217
|
+
word-break: break-all;
|
|
218
|
+
margin-top: 2px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* 地图图标跳动动画 */
|
|
222
|
+
.ele-map-view-anim-bounce {
|
|
223
|
+
animation: mapAnimBounce 0.6s;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@keyframes mapAnimBounce {
|
|
227
|
+
from,
|
|
228
|
+
to {
|
|
229
|
+
transform: translateY(0);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
50% {
|
|
233
|
+
transform: translateY(-20px);
|
|
234
|
+
}
|
|
194
235
|
}
|
|
195
236
|
|
|
196
237
|
/* 小屏幕适应 */
|
|
@@ -198,10 +239,11 @@
|
|
|
198
239
|
.ele-map-picker.is-responsive {
|
|
199
240
|
top: 0 !important;
|
|
200
241
|
left: 0 !important;
|
|
242
|
+
margin: 0 !important;
|
|
201
243
|
width: 100% !important;
|
|
202
244
|
max-width: 100% !important;
|
|
203
245
|
height: 100% !important;
|
|
204
|
-
|
|
246
|
+
border-radius: 0 !important;
|
|
205
247
|
display: flex !important;
|
|
206
248
|
flex-direction: column !important;
|
|
207
249
|
|
|
@@ -220,33 +262,20 @@
|
|
|
220
262
|
}
|
|
221
263
|
|
|
222
264
|
.ele-map-view {
|
|
223
|
-
|
|
265
|
+
height: 100% !important;
|
|
224
266
|
flex-direction: column;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.ele-map-view-header {
|
|
228
|
-
flex-shrink: 0;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.ele-map-view-body {
|
|
232
|
-
flex: 1;
|
|
233
|
-
flex-direction: column;
|
|
234
|
-
overflow: hidden;
|
|
235
|
-
height: auto;
|
|
267
|
+
}
|
|
236
268
|
|
|
237
|
-
|
|
238
|
-
|
|
269
|
+
.ele-map-view-body {
|
|
270
|
+
height: auto;
|
|
271
|
+
}
|
|
239
272
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
273
|
+
.ele-map-view-side {
|
|
274
|
+
width: 100%;
|
|
275
|
+
height: 68%;
|
|
244
276
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
width: auto;
|
|
248
|
-
overflow: hidden;
|
|
249
|
-
}
|
|
277
|
+
& > .ele-map-view-search {
|
|
278
|
+
padding-top: 6px;
|
|
250
279
|
}
|
|
251
280
|
}
|
|
252
281
|
}
|
|
@@ -43,13 +43,11 @@ export interface PoiLocation {
|
|
|
43
43
|
*/
|
|
44
44
|
export interface PoiItem {
|
|
45
45
|
/** 地点名称 */
|
|
46
|
-
name
|
|
46
|
+
name?: string;
|
|
47
47
|
/** 详细地址 */
|
|
48
|
-
address
|
|
48
|
+
address?: string;
|
|
49
49
|
/** 经纬度坐标 */
|
|
50
50
|
location: PoiLocation;
|
|
51
|
-
/** 是否选中 */
|
|
52
|
-
selected?: boolean;
|
|
53
51
|
/** 数据唯一标识 */
|
|
54
52
|
id?: string;
|
|
55
53
|
/** 输入建议唯一标识 */
|
|
@@ -62,6 +60,11 @@ export interface PoiItem {
|
|
|
62
60
|
value?: string;
|
|
63
61
|
}
|
|
64
62
|
|
|
63
|
+
/**
|
|
64
|
+
* 位置选择模式
|
|
65
|
+
*/
|
|
66
|
+
export type SelectMode = 'lnglat' | 'poi' | 'keyword';
|
|
67
|
+
|
|
65
68
|
/**
|
|
66
69
|
* 实例
|
|
67
70
|
*/
|
|
@@ -90,4 +93,5 @@ export interface MapLocale {
|
|
|
90
93
|
placeholder: string;
|
|
91
94
|
message: string;
|
|
92
95
|
ok: string;
|
|
96
|
+
clickMessage: string;
|
|
93
97
|
}
|
package/lib/ele-menus/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
3
|
const elementPlus = require("element-plus");
|
|
4
|
+
const EleTooltip = require("../ele-tooltip/index");
|
|
4
5
|
const receiver = require("../ele-config-provider/receiver");
|
|
5
6
|
const core = require("../utils/core");
|
|
6
7
|
const icons = require("../icons");
|
|
@@ -16,6 +17,9 @@ const index = vue.defineComponent({
|
|
|
16
17
|
const menuRef = vue.ref(null);
|
|
17
18
|
const ellipsisRef = vue.ref(null);
|
|
18
19
|
const sliceIndex = vue.ref(-1);
|
|
20
|
+
const tooltipVirtualRef = vue.ref();
|
|
21
|
+
const tooltipContent = vue.ref("");
|
|
22
|
+
const tooltipVisible = vue.ref(false);
|
|
19
23
|
const isHorizontal = vue.computed(() => props$1.mode === "horizontal");
|
|
20
24
|
const { observe, unobserve, computedEllipsis } = util.useMenuEllipsis({
|
|
21
25
|
getMenuEl: () => {
|
|
@@ -59,15 +63,45 @@ const index = vue.defineComponent({
|
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
);
|
|
66
|
+
const triggerTooltip = (e) => {
|
|
67
|
+
var _a;
|
|
68
|
+
if (props$1.textEllipsisTooltip) {
|
|
69
|
+
const itemEl = (_a = e.currentTarget) == null ? void 0 : _a.parentNode;
|
|
70
|
+
if (itemEl) {
|
|
71
|
+
const titleEl = itemEl.querySelector(`.${util.titleClass}`);
|
|
72
|
+
const text = titleEl == null ? void 0 : titleEl.innerText;
|
|
73
|
+
if (text && core.contentIsEllipsis(titleEl, "horizontal")) {
|
|
74
|
+
tooltipVirtualRef.value = itemEl;
|
|
75
|
+
tooltipContent.value = text;
|
|
76
|
+
tooltipVisible.value = true;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
hideTooltip();
|
|
82
|
+
};
|
|
83
|
+
const hideTooltip = () => {
|
|
84
|
+
tooltipVisible.value = false;
|
|
85
|
+
};
|
|
62
86
|
const onItemClick = (item, e) => {
|
|
63
87
|
emit("itemClick", item, e);
|
|
64
88
|
};
|
|
65
89
|
const onItemMouseenter = (item, e) => {
|
|
90
|
+
triggerTooltip(e);
|
|
66
91
|
emit("itemMouseenter", item, e);
|
|
67
92
|
};
|
|
68
93
|
const onItemMouseleave = (item, e) => {
|
|
94
|
+
hideTooltip();
|
|
69
95
|
emit("itemMouseleave", item, e);
|
|
70
96
|
};
|
|
97
|
+
const onParentMouseenter = (item, e) => {
|
|
98
|
+
triggerTooltip(e);
|
|
99
|
+
emit("parentMouseenter", item, e);
|
|
100
|
+
};
|
|
101
|
+
const onParentMouseleave = (item, e) => {
|
|
102
|
+
hideTooltip();
|
|
103
|
+
emit("parentMouseleave", item, e);
|
|
104
|
+
};
|
|
71
105
|
const exposeValue = {
|
|
72
106
|
menuRef,
|
|
73
107
|
open: (index2) => {
|
|
@@ -126,7 +160,9 @@ const index = vue.defineComponent({
|
|
|
126
160
|
onItemClick,
|
|
127
161
|
onItemMouseenter,
|
|
128
162
|
onItemMouseleave,
|
|
129
|
-
isWebkit
|
|
163
|
+
isWebkit,
|
|
164
|
+
onParentMouseenter,
|
|
165
|
+
onParentMouseleave
|
|
130
166
|
);
|
|
131
167
|
if (moreItems) {
|
|
132
168
|
const ellipsisProps = props$1.ellipsisProps || {};
|
|
@@ -137,7 +173,8 @@ const index = vue.defineComponent({
|
|
|
137
173
|
props$1.colorful,
|
|
138
174
|
props$1.popupColorful,
|
|
139
175
|
props$1.firstPopperClass,
|
|
140
|
-
true
|
|
176
|
+
true,
|
|
177
|
+
isWebkit
|
|
141
178
|
);
|
|
142
179
|
nodes.push(
|
|
143
180
|
vue.h(
|
|
@@ -167,7 +204,9 @@ const index = vue.defineComponent({
|
|
|
167
204
|
onItemClick,
|
|
168
205
|
onItemMouseenter,
|
|
169
206
|
onItemMouseleave,
|
|
170
|
-
isWebkit
|
|
207
|
+
isWebkit,
|
|
208
|
+
onParentMouseenter,
|
|
209
|
+
onParentMouseleave
|
|
171
210
|
);
|
|
172
211
|
},
|
|
173
212
|
title: () => {
|
|
@@ -182,6 +221,19 @@ const index = vue.defineComponent({
|
|
|
182
221
|
)
|
|
183
222
|
);
|
|
184
223
|
}
|
|
224
|
+
if (props$1.textEllipsisTooltip) {
|
|
225
|
+
nodes.push(
|
|
226
|
+
vue.h(EleTooltip, {
|
|
227
|
+
trigger: "click",
|
|
228
|
+
placement: "right",
|
|
229
|
+
...props$1.textEllipsisTooltipProps || {},
|
|
230
|
+
virtualTriggering: true,
|
|
231
|
+
virtualRef: tooltipVirtualRef.value,
|
|
232
|
+
content: tooltipContent.value,
|
|
233
|
+
visible: tooltipVisible.value
|
|
234
|
+
})
|
|
235
|
+
);
|
|
236
|
+
}
|
|
185
237
|
return nodes;
|
|
186
238
|
}
|
|
187
239
|
);
|
package/lib/ele-menus/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
firstPopperClass: StringConstructor;
|
|
20
20
|
tooltipDisabled: BooleanConstructor;
|
|
21
21
|
ellipsisProps: import("vue").PropType<import("./types").EllipsisProps>;
|
|
22
|
+
textEllipsisTooltip: BooleanConstructor;
|
|
23
|
+
textEllipsisTooltipProps: import("vue").PropType<Partial<import("../ele-tooltip/props").TooltipProps>>;
|
|
22
24
|
mode: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
23
25
|
defaultActive: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
26
|
defaultOpeneds: import("element-plus/es/utils/index").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => [], boolean>;
|
|
@@ -43,9 +45,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
45
|
open: (index: string) => void;
|
|
44
46
|
close: (index: string) => void;
|
|
45
47
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
-
itemClick: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
47
|
-
itemMouseenter: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
48
|
+
itemClick: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean; /** 文本溢出提示是否显示 */
|
|
49
|
+
itemMouseenter: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
48
50
|
itemMouseleave: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
51
|
+
parentMouseenter: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
52
|
+
parentMouseleave: (_item: import("./types").MenuItem, _e: MouseEvent) => boolean;
|
|
49
53
|
close: (index: string, indexPath: string[]) => boolean;
|
|
50
54
|
open: (index: string, indexPath: string[]) => boolean;
|
|
51
55
|
select: (index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure> | undefined) => boolean;
|
|
@@ -67,6 +71,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
71
|
firstPopperClass: StringConstructor;
|
|
68
72
|
tooltipDisabled: BooleanConstructor;
|
|
69
73
|
ellipsisProps: import("vue").PropType<import("./types").EllipsisProps>;
|
|
74
|
+
textEllipsisTooltip: BooleanConstructor;
|
|
75
|
+
textEllipsisTooltipProps: import("vue").PropType<Partial<import("../ele-tooltip/props").TooltipProps>>;
|
|
70
76
|
mode: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
71
77
|
defaultActive: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
72
78
|
defaultOpeneds: import("element-plus/es/utils/index").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => [], boolean>;
|
|
@@ -87,12 +93,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
93
|
showTimeout: import("element-plus/es/utils/index").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
88
94
|
hideTimeout: import("element-plus/es/utils/index").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
89
95
|
}>> & {
|
|
96
|
+
onSelect?: ((index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure> | undefined) => any) | undefined;
|
|
90
97
|
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
91
98
|
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
92
|
-
onSelect?: ((index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure> | undefined) => any) | undefined;
|
|
93
99
|
onItemClick?: ((_item: import("./types").MenuItem, _e: MouseEvent) => any) | undefined;
|
|
94
100
|
onItemMouseenter?: ((_item: import("./types").MenuItem, _e: MouseEvent) => any) | undefined;
|
|
95
101
|
onItemMouseleave?: ((_item: import("./types").MenuItem, _e: MouseEvent) => any) | undefined;
|
|
102
|
+
onParentMouseenter?: ((_item: import("./types").MenuItem, _e: MouseEvent) => any) | undefined;
|
|
103
|
+
onParentMouseleave?: ((_item: import("./types").MenuItem, _e: MouseEvent) => any) | undefined;
|
|
96
104
|
}, {
|
|
97
105
|
showTimeout: number;
|
|
98
106
|
hideTimeout: number;
|
|
@@ -113,5 +121,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
113
121
|
colorful: boolean;
|
|
114
122
|
popupColorful: import("./types").PopupColorful;
|
|
115
123
|
tooltipDisabled: boolean;
|
|
124
|
+
textEllipsisTooltip: boolean;
|
|
116
125
|
}, {}>;
|
|
117
126
|
export default _default;
|
package/lib/ele-menus/props.cjs
CHANGED
|
@@ -27,7 +27,11 @@ const menusProps = {
|
|
|
27
27
|
/** 禁用 tooltip */
|
|
28
28
|
tooltipDisabled: Boolean,
|
|
29
29
|
/** 省略菜单的属性 */
|
|
30
|
-
ellipsisProps: Object
|
|
30
|
+
ellipsisProps: Object,
|
|
31
|
+
/** 是否开启菜单文本溢出提示 */
|
|
32
|
+
textEllipsisTooltip: Boolean,
|
|
33
|
+
/** 菜单文本溢出提示属性 */
|
|
34
|
+
textEllipsisTooltipProps: Object
|
|
31
35
|
};
|
|
32
36
|
const menuPropKeys = Object.keys(elementPlus.menuProps);
|
|
33
37
|
const menusEmits = {
|
|
@@ -37,7 +41,11 @@ const menusEmits = {
|
|
|
37
41
|
/** 子菜单项鼠标进入事件 */
|
|
38
42
|
itemMouseenter: (_item, _e) => true,
|
|
39
43
|
/** 子菜单项鼠标离开事件 */
|
|
40
|
-
itemMouseleave: (_item, _e) => true
|
|
44
|
+
itemMouseleave: (_item, _e) => true,
|
|
45
|
+
/** 父级菜单项鼠标进入事件 */
|
|
46
|
+
parentMouseenter: (_item, _e) => true,
|
|
47
|
+
/** 父级菜单项鼠标离开事件 */
|
|
48
|
+
parentMouseleave: (_item, _e) => true
|
|
41
49
|
};
|
|
42
50
|
exports.menuPropKeys = menuPropKeys;
|
|
43
51
|
exports.menusEmits = menusEmits;
|
package/lib/ele-menus/props.d.ts
CHANGED
|
@@ -30,6 +30,10 @@ export declare const menusProps: {
|
|
|
30
30
|
tooltipDisabled: BooleanConstructor;
|
|
31
31
|
/** 省略菜单的属性 */
|
|
32
32
|
ellipsisProps: PropType<EllipsisProps>;
|
|
33
|
+
/** 是否开启菜单文本溢出提示 */
|
|
34
|
+
textEllipsisTooltip: BooleanConstructor;
|
|
35
|
+
/** 菜单文本溢出提示属性 */
|
|
36
|
+
textEllipsisTooltipProps: PropType<Partial<import("../ele-tooltip/props").TooltipProps>>;
|
|
33
37
|
mode: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
34
38
|
defaultActive: import("element-plus/es/utils/index").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
35
39
|
defaultOpeneds: import("element-plus/es/utils/index").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => [], boolean>;
|
|
@@ -66,6 +70,10 @@ export declare const menusEmits: {
|
|
|
66
70
|
itemMouseenter: (_item: MenuItem, _e: MouseEvent) => boolean;
|
|
67
71
|
/** 子菜单项鼠标离开事件 */
|
|
68
72
|
itemMouseleave: (_item: MenuItem, _e: MouseEvent) => boolean;
|
|
73
|
+
/** 父级菜单项鼠标进入事件 */
|
|
74
|
+
parentMouseenter: (_item: MenuItem, _e: MouseEvent) => boolean;
|
|
75
|
+
/** 父级菜单项鼠标离开事件 */
|
|
76
|
+
parentMouseleave: (_item: MenuItem, _e: MouseEvent) => boolean;
|
|
69
77
|
close: (index: string, indexPath: string[]) => boolean;
|
|
70
78
|
open: (index: string, indexPath: string[]) => boolean;
|
|
71
79
|
select: (index: string, indexPath: string[], item: import("element-plus").MenuItemClicked, routerResult?: Promise<void | import("vue-router").NavigationFailure> | undefined) => boolean;
|