vdesign-ui 0.2.9 → 0.2.11
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/dist/components/list/style.less +1 -1
- package/dist/components/tabs/index.vue +14 -4
- package/dist/components/tabs/style.less +26 -31
- package/dist/components/toast/index.js +12 -1
- package/dist/vdesign-ui.common.js +159 -8365
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +163 -8369
- package/dist/vdesign-ui.umd.min.js +2 -8
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="vd-tabs" :class="stickyClasses">
|
|
3
3
|
<div class="vd-tabs__wrap" :class="menuClasses" ref="wrap">
|
|
4
|
-
<div class="vd-tabs__nav" :class="[barType,
|
|
4
|
+
<div class="vd-tabs__nav" :class="[barType, scrollspyClasses]" ref="nav">
|
|
5
5
|
<div
|
|
6
6
|
v-for="(tab, index) in tabs"
|
|
7
7
|
:key="tab.name !== undefined ? tab.name : index"
|
|
@@ -39,9 +39,12 @@
|
|
|
39
39
|
|
|
40
40
|
<script>
|
|
41
41
|
import VdIcon from "../icon";
|
|
42
|
+
import languageMixin from '../mixins/languageMixin.js';
|
|
43
|
+
|
|
42
44
|
const prefixCls = "vd-tabs";
|
|
43
45
|
export default {
|
|
44
46
|
name: "vd-tabs",
|
|
47
|
+
mixins: [languageMixin],
|
|
45
48
|
components: {
|
|
46
49
|
VdIcon,
|
|
47
50
|
},
|
|
@@ -65,6 +68,7 @@ export default {
|
|
|
65
68
|
sticky: Boolean,
|
|
66
69
|
lazyRender: Boolean,
|
|
67
70
|
animated: Boolean,
|
|
71
|
+
scrollspy:Boolean
|
|
68
72
|
},
|
|
69
73
|
data() {
|
|
70
74
|
return {
|
|
@@ -89,7 +93,11 @@ export default {
|
|
|
89
93
|
const activeIndex = this.tabs.findIndex((tab, index) => {
|
|
90
94
|
return this.isTabActive(tab, index);
|
|
91
95
|
});
|
|
92
|
-
|
|
96
|
+
|
|
97
|
+
const offset = activeIndex * 100;
|
|
98
|
+
// 根据文本方向调整 translateX 值
|
|
99
|
+
const translateX = this.language === 'ar' ? offset : -offset;
|
|
100
|
+
// const translateX = -activeIndex * 100;
|
|
93
101
|
return {
|
|
94
102
|
transform: `translateX(${translateX}%)`,
|
|
95
103
|
transitionDuration: '0.3s',
|
|
@@ -104,8 +112,10 @@ export default {
|
|
|
104
112
|
}
|
|
105
113
|
},
|
|
106
114
|
// 计算滚动监视的类名
|
|
107
|
-
|
|
108
|
-
return
|
|
115
|
+
scrollspyClasses() {
|
|
116
|
+
return {
|
|
117
|
+
[`${prefixCls}--complete`]:this.scrollspy
|
|
118
|
+
}
|
|
109
119
|
},
|
|
110
120
|
// 计算标签文字是否需要省略号的类名
|
|
111
121
|
ellipsisClasses() {
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&__nav{
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
18
20
|
&--primary {
|
|
19
21
|
position: relative;
|
|
20
22
|
white-space: nowrap;
|
|
@@ -50,6 +52,11 @@
|
|
|
50
52
|
border-radius: var(--radius-tab-primary_bar);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
&__none--line {
|
|
56
|
+
&::before {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
62
|
|
|
@@ -92,6 +99,11 @@
|
|
|
92
99
|
border-radius: 1px;
|
|
93
100
|
}
|
|
94
101
|
}
|
|
102
|
+
&__none--line {
|
|
103
|
+
&::before {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
|
|
@@ -130,6 +142,11 @@
|
|
|
130
142
|
border-radius: var(--radius-tab-secondary-bar_top) var(--radius-tab-secondary-bar_top) var(--radius-tab-secondary-bar_bottom) var(--radius-tab-secondary-bar_bottom);
|
|
131
143
|
}
|
|
132
144
|
}
|
|
145
|
+
&__none--line {
|
|
146
|
+
&::before {
|
|
147
|
+
display: none;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
133
150
|
}
|
|
134
151
|
|
|
135
152
|
}
|
|
@@ -167,20 +184,12 @@
|
|
|
167
184
|
font-size: var(--en-single-f-c-s-fontSize);
|
|
168
185
|
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
169
186
|
background-color: var(--color-tab-capsule_btn-bg-active);
|
|
170
|
-
|
|
171
|
-
// .@{tab-prefix-cls}__arrow {
|
|
172
|
-
// color: var(--color-tab-filter_down-active);
|
|
173
|
-
// transform: rotate(180deg);
|
|
174
|
-
// }
|
|
175
187
|
}
|
|
176
188
|
}
|
|
177
189
|
}
|
|
178
190
|
|
|
179
191
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
&--selector-l {
|
|
192
|
+
&--selector-l {
|
|
184
193
|
position: relative;
|
|
185
194
|
display: flex;
|
|
186
195
|
background-color: var(--color-tab-selector-bg-default);
|
|
@@ -216,7 +225,7 @@
|
|
|
216
225
|
|
|
217
226
|
|
|
218
227
|
|
|
219
|
-
|
|
228
|
+
&--selector-m{
|
|
220
229
|
position: relative;
|
|
221
230
|
display: flex;
|
|
222
231
|
background-color: var(--color-tab-selector-bg-default);
|
|
@@ -251,7 +260,7 @@
|
|
|
251
260
|
}
|
|
252
261
|
|
|
253
262
|
|
|
254
|
-
|
|
263
|
+
&--filter {
|
|
255
264
|
position: relative;
|
|
256
265
|
display: flex;
|
|
257
266
|
height: var(--height-tab-filter);
|
|
@@ -271,20 +280,14 @@
|
|
|
271
280
|
color: var(--color-tab-filter-text-active);
|
|
272
281
|
font-size: var(--en-single-f-c-s-fontSize);
|
|
273
282
|
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
274
|
-
|
|
275
|
-
// .@{tab-prefix-cls}__arrow {
|
|
276
|
-
// color: var(--color-tab-filter_down);
|
|
277
|
-
// transform: rotate(180deg);
|
|
278
|
-
// }
|
|
283
|
+
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
286
|
|
|
282
287
|
|
|
283
288
|
}
|
|
284
289
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
&--click-filter {
|
|
290
|
+
&--click-filter {
|
|
288
291
|
position: relative;
|
|
289
292
|
display: flex;
|
|
290
293
|
height: var(--height-tab-filter);
|
|
@@ -363,6 +366,10 @@
|
|
|
363
366
|
&__track {
|
|
364
367
|
display: flex;
|
|
365
368
|
transition: transform 0.3s;
|
|
369
|
+
position: relative;
|
|
370
|
+
width: 100%;
|
|
371
|
+
height: 100%;
|
|
372
|
+
will-change: left;
|
|
366
373
|
}
|
|
367
374
|
|
|
368
375
|
|
|
@@ -376,13 +383,6 @@
|
|
|
376
383
|
justify-content: center;
|
|
377
384
|
}
|
|
378
385
|
|
|
379
|
-
// &__arrow {
|
|
380
|
-
// display: inline-block;
|
|
381
|
-
// vertical-align: -1px;
|
|
382
|
-
// font-size: var(--icon-small) !important;
|
|
383
|
-
// color: var(--color-tab-filter_down);
|
|
384
|
-
// }
|
|
385
|
-
|
|
386
386
|
&__text--ellipsis {
|
|
387
387
|
display: -webkit-box;
|
|
388
388
|
overflow: hidden;
|
|
@@ -390,11 +390,6 @@
|
|
|
390
390
|
-webkit-box-orient: vertical;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
&__none--line {
|
|
394
|
-
&::before {
|
|
395
|
-
display: none;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
393
|
&__pane {
|
|
399
394
|
flex-shrink: 0;
|
|
400
395
|
width: 100%;
|
|
@@ -3,6 +3,7 @@ import ToastComponent from './index.vue';
|
|
|
3
3
|
import { inBrowser } from '../utils/env';
|
|
4
4
|
|
|
5
5
|
let queueResult = []
|
|
6
|
+
let allowMultiple = false
|
|
6
7
|
|
|
7
8
|
function getType(value) {
|
|
8
9
|
if (value !== value) return 'NaN';
|
|
@@ -13,8 +14,8 @@ class VdToast extends Vue.extend(ToastComponent) {
|
|
|
13
14
|
constructor(options) {
|
|
14
15
|
super();
|
|
15
16
|
this.vm = this.$mount();
|
|
16
|
-
|
|
17
17
|
this.timer = null
|
|
18
|
+
this.allowMultiple = allowMultiple
|
|
18
19
|
|
|
19
20
|
// 判断传入的 options 类型,并进行赋值
|
|
20
21
|
if (typeof options === 'string' || typeof options === 'number') {
|
|
@@ -34,6 +35,12 @@ class VdToast extends Vue.extend(ToastComponent) {
|
|
|
34
35
|
init() {
|
|
35
36
|
if (inBrowser) {
|
|
36
37
|
document.body.appendChild(this.vm.$el)
|
|
38
|
+
if (!this.allowMultiple) {
|
|
39
|
+
queueResult.forEach(toast => {
|
|
40
|
+
toast.clear()
|
|
41
|
+
})
|
|
42
|
+
queueResult = [];
|
|
43
|
+
}
|
|
37
44
|
this.start()
|
|
38
45
|
}
|
|
39
46
|
}
|
|
@@ -83,4 +90,8 @@ Toast.clear = () => {
|
|
|
83
90
|
queueResult = [];
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
Toast.allowMultiple = () => {
|
|
94
|
+
allowMultiple = true
|
|
95
|
+
}
|
|
96
|
+
|
|
86
97
|
export default Toast
|