vdesign-ui 0.2.18 → 0.2.20
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/README.md +58 -77
- package/dist/components/badge/style.less +1 -1
- package/dist/components/data-list/style.less +1 -1
- package/dist/components/headnav/style.less +1 -1
- package/dist/components/icon/font/iconfont.css +3 -3
- package/dist/components/icon/font/iconfont.js +1 -1
- package/dist/components/input/style.less +1 -1
- package/dist/components/mixins/languageMixin.js +7 -5
- package/dist/components/noticebar/style.less +8 -3
- package/dist/components/radio/style.less +26 -19
- package/dist/components/step/style.less +1 -1
- package/dist/components/step-item/style.less +1 -1
- package/dist/components/tabs/index.vue +36 -20
- package/dist/components/tabs/style.less +90 -44
- package/dist/components/toast/index.js +89 -47
- package/dist/components/toast/index.vue +2 -1
- package/dist/components/toast/style.less +1 -0
- package/dist/components/upload/style.less +1 -1
- package/dist/token.css +1561 -78
- package/dist/vdesign-ui.common.js +166 -88
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +166 -88
- package/dist/vdesign-ui.umd.min.js +2 -2
- package/package.json +1 -1
|
@@ -313,27 +313,69 @@
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
&__scroll {
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
overflow-x: auto;
|
|
317
|
+
position: relative;
|
|
318
|
+
height: 100%;
|
|
319
|
+
&--left{
|
|
318
320
|
position: absolute;
|
|
319
|
-
z-index: 1;
|
|
320
|
-
top: 0;
|
|
321
321
|
left: 0;
|
|
322
|
-
|
|
323
|
-
height:
|
|
324
|
-
|
|
322
|
+
top: 0;
|
|
323
|
+
height: 100%;
|
|
324
|
+
z-index: 10;
|
|
325
|
+
&::before {
|
|
326
|
+
content: '';
|
|
327
|
+
position: absolute;
|
|
328
|
+
z-index: 1;
|
|
329
|
+
top: 50%;
|
|
330
|
+
transform: translateY(-50%);
|
|
331
|
+
left: 0;
|
|
332
|
+
width: 20px;
|
|
333
|
+
height: 48px;
|
|
334
|
+
background-color: var(--bg-color-1);
|
|
335
|
+
}
|
|
336
|
+
&::after {
|
|
337
|
+
content: '';
|
|
338
|
+
box-shadow: 4px 0 6px rgba(0, 0, 0, 0.05);
|
|
339
|
+
position: absolute;
|
|
340
|
+
top: 50%;
|
|
341
|
+
transform: translateY(-50%);
|
|
342
|
+
left: 0;
|
|
343
|
+
width: 20px;
|
|
344
|
+
height: 30px;
|
|
345
|
+
background-color: transparent;
|
|
346
|
+
}
|
|
325
347
|
}
|
|
326
|
-
|
|
327
|
-
content: '';
|
|
328
|
-
box-shadow: 4px 0 6px rgba(0, 0, 0, 0.05);
|
|
348
|
+
&--right{
|
|
329
349
|
position: absolute;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
350
|
+
right: 0;
|
|
351
|
+
top: 0;
|
|
352
|
+
height: 100%;
|
|
353
|
+
z-index: 10;
|
|
354
|
+
&::before {
|
|
355
|
+
content: '';
|
|
356
|
+
position: absolute;
|
|
357
|
+
z-index: 1;
|
|
358
|
+
top: 50%;
|
|
359
|
+
transform: translateY(-50%);
|
|
360
|
+
right: 0;
|
|
361
|
+
width: 20px;
|
|
362
|
+
height: 48px;
|
|
363
|
+
background-color: var(--bg-color-1);
|
|
364
|
+
}
|
|
365
|
+
&::after {
|
|
366
|
+
content: '';
|
|
367
|
+
box-shadow: -4px 0 6px rgba(0, 0, 0, 0.05);
|
|
368
|
+
position: absolute;
|
|
369
|
+
top: 50%;
|
|
370
|
+
transform: translateY(-50%);
|
|
371
|
+
right: 0;
|
|
372
|
+
width: 20px;
|
|
373
|
+
height: 30px;
|
|
374
|
+
background-color: transparent;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
|
|
337
379
|
}
|
|
338
380
|
|
|
339
381
|
&__menu {
|
|
@@ -344,22 +386,26 @@
|
|
|
344
386
|
|
|
345
387
|
&--right {
|
|
346
388
|
position: relative;
|
|
389
|
+
z-index: 11;
|
|
390
|
+
// margin-inline-start: -12px;
|
|
347
391
|
display: flex;
|
|
348
392
|
height: var(--icon-large);
|
|
349
393
|
padding-inline-end: var(--spacing-tab-primary_icon-margin_right);
|
|
350
394
|
color: var(--text-color-h1);
|
|
351
395
|
|
|
352
|
-
&::before {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
396
|
+
// &::before {
|
|
397
|
+
// content: '';
|
|
398
|
+
// position: absolute;
|
|
399
|
+
// margin-inline-start: -16px;
|
|
400
|
+
// width: 16px;
|
|
401
|
+
// height: 100%;
|
|
402
|
+
// background-image: linear-gradient(to left, var(--bg-color-1) 0%, rgba(255, 255, 255, 0) 100%);
|
|
403
|
+
// }
|
|
361
404
|
|
|
362
405
|
}
|
|
406
|
+
&--margin{
|
|
407
|
+
margin-inline-start: -12px;
|
|
408
|
+
}
|
|
363
409
|
&--btn {
|
|
364
410
|
cursor: pointer;
|
|
365
411
|
font-size: var(--icon-large)!important;
|
|
@@ -425,18 +471,18 @@
|
|
|
425
471
|
|
|
426
472
|
|
|
427
473
|
|
|
428
|
-
[lang
|
|
429
|
-
.@{tabs-prefix-cls}__scroll {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
474
|
+
[lang|='ar'] , [dir='rtl']{
|
|
475
|
+
// .@{tabs-prefix-cls}__scroll {
|
|
476
|
+
// &::before {
|
|
477
|
+
// right: 0;
|
|
478
|
+
// left: auto;
|
|
479
|
+
// }
|
|
480
|
+
// &::after {
|
|
481
|
+
// right: 0;
|
|
482
|
+
// left: auto;
|
|
483
|
+
// box-shadow: -4px 0 6px rgba(0, 0, 0, 0.05);
|
|
484
|
+
// }
|
|
485
|
+
// }
|
|
440
486
|
.@{tabs-prefix-cls}__menu--right::before {
|
|
441
487
|
transform: scaleX(-1);
|
|
442
488
|
}
|
|
@@ -450,10 +496,10 @@
|
|
|
450
496
|
}
|
|
451
497
|
}
|
|
452
498
|
|
|
453
|
-
[theme='dark'][lang
|
|
454
|
-
.@{tabs-prefix-cls}__scroll {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
499
|
+
[theme='dark'][lang|='ar'], [dir='rtl']{
|
|
500
|
+
// .@{tabs-prefix-cls}__scroll {
|
|
501
|
+
// &::after {
|
|
502
|
+
// box-shadow: -4px 0 6px rgba(0, 0, 0, 0.35);
|
|
503
|
+
// }
|
|
504
|
+
// }
|
|
459
505
|
}
|
|
@@ -1,97 +1,139 @@
|
|
|
1
|
-
import Vue from
|
|
2
|
-
import ToastComponent from
|
|
3
|
-
import { inBrowser } from
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import ToastComponent from "./index.vue";
|
|
3
|
+
import { inBrowser } from "../utils/env";
|
|
4
4
|
|
|
5
|
-
let queueResult = []
|
|
6
|
-
let
|
|
5
|
+
let queueResult = [];
|
|
6
|
+
let globalAllowMultiple = false;
|
|
7
|
+
let allTimer = null;
|
|
7
8
|
|
|
8
9
|
function getType(value) {
|
|
9
|
-
if (value !== value) return
|
|
10
|
+
if (value !== value) return "NaN";
|
|
10
11
|
return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
function normalizeOptions(raw) {
|
|
15
|
+
let opts = {};
|
|
16
|
+
|
|
17
|
+
if (getType(raw) === 'string' || getType(raw) === 'number') {
|
|
18
|
+
opts.message = String(raw);
|
|
19
|
+
} else if (getType(raw) === 'object') {
|
|
20
|
+
opts = { ...raw };
|
|
21
|
+
} else {
|
|
22
|
+
opts.message = '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 默认值 & 全局/局部 allowMultiple
|
|
26
|
+
opts.duration = getType(opts.duration) === 'number' ? opts.duration : 1500;
|
|
27
|
+
opts.allowMultiple = 'allowMultiple' in opts ? !!opts.allowMultiple : globalAllowMultiple;
|
|
28
|
+
|
|
29
|
+
return opts;
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
class VdToast extends Vue.extend(ToastComponent) {
|
|
14
33
|
constructor(options) {
|
|
15
34
|
super();
|
|
16
35
|
this.vm = this.$mount();
|
|
17
|
-
this.timer = null
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
36
|
+
this.timer = null;
|
|
37
|
+
// // 局部优先,回退全局
|
|
38
|
+
// const localAllowMultiple =
|
|
39
|
+
// getType(options) === "object" && "allowMultiple" in options
|
|
40
|
+
// ? options.allowMultiple
|
|
41
|
+
// : globalAllowMultiple;
|
|
42
|
+
// this.allowMultiple = localAllowMultiple;
|
|
43
|
+
// // 判断传入的 options 类型,并进行赋值
|
|
44
|
+
// if (getType(options) === "string" || getType(options) === "number") {
|
|
45
|
+
// this.message = options;
|
|
46
|
+
// } else if (getType(options) === "object") {
|
|
47
|
+
// this.message = options.message || "";
|
|
48
|
+
// this.duration = options.duration || 1500;
|
|
49
|
+
// Object.assign(this, options);
|
|
50
|
+
// }
|
|
51
|
+
Object.assign(this, options);
|
|
28
52
|
|
|
29
53
|
this.init();
|
|
30
54
|
}
|
|
31
|
-
|
|
32
55
|
/**
|
|
33
56
|
* 初始化方法
|
|
34
57
|
*/
|
|
35
58
|
init() {
|
|
36
59
|
if (inBrowser) {
|
|
37
|
-
document.body.appendChild(this.vm.$el)
|
|
38
60
|
if (!this.allowMultiple) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
61
|
+
if (allTimer) {
|
|
62
|
+
clearTimeout(allTimer);
|
|
63
|
+
}
|
|
64
|
+
queueResult.forEach((toast) => {
|
|
65
|
+
toast.clear();
|
|
66
|
+
});
|
|
42
67
|
queueResult = [];
|
|
68
|
+
queueResult.push(this);
|
|
69
|
+
allTimer = setTimeout(() => {
|
|
70
|
+
document.body.appendChild(this.vm.$el);
|
|
71
|
+
}, 50);
|
|
72
|
+
} else {
|
|
73
|
+
queueResult.push(this);
|
|
74
|
+
document.body.appendChild(this.vm.$el);
|
|
43
75
|
}
|
|
44
|
-
this.start()
|
|
76
|
+
this.start();
|
|
45
77
|
}
|
|
46
78
|
}
|
|
47
|
-
|
|
48
79
|
start() {
|
|
49
|
-
clearTimeout(this.timer)
|
|
80
|
+
clearTimeout(this.timer);
|
|
50
81
|
/**
|
|
51
82
|
* 在挂载真实 DOM 树后显示过渡效果
|
|
52
83
|
*/
|
|
53
84
|
setTimeout(() => {
|
|
54
|
-
this.isShow = true
|
|
85
|
+
this.isShow = true;
|
|
55
86
|
if (this.duration > 0) {
|
|
56
87
|
this.end();
|
|
57
88
|
}
|
|
58
|
-
}, 0)
|
|
89
|
+
}, 0);
|
|
59
90
|
}
|
|
60
|
-
|
|
61
91
|
end() {
|
|
62
92
|
/**
|
|
63
93
|
* 关闭过渡效果之后移除真实 DOM 树节点
|
|
64
94
|
*/
|
|
65
95
|
this.timer = setTimeout(() => {
|
|
66
|
-
this.clear()
|
|
67
|
-
}, this.duration)
|
|
96
|
+
this.clear();
|
|
97
|
+
}, this.duration);
|
|
68
98
|
}
|
|
69
|
-
|
|
70
99
|
clear() {
|
|
71
|
-
this.isShow = false
|
|
100
|
+
this.isShow = false;
|
|
72
101
|
if (inBrowser && this.vm.$el) {
|
|
73
102
|
setTimeout(() => {
|
|
74
|
-
this.vm.$el.parentNode &&
|
|
75
|
-
|
|
103
|
+
this.vm.$el.parentNode &&
|
|
104
|
+
this.vm.$el.parentNode.removeChild(this.vm.$el);
|
|
105
|
+
}, 500);
|
|
76
106
|
}
|
|
77
107
|
}
|
|
78
108
|
}
|
|
79
109
|
|
|
80
|
-
const Toast = (options) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
// const Toast = (options) => {
|
|
111
|
+
// const localAllowMultiple =
|
|
112
|
+
// getType(options) === "object" && "allowMultiple" in options
|
|
113
|
+
// ? options.allowMultiple
|
|
114
|
+
// : globalAllowMultiple;
|
|
115
|
+
|
|
116
|
+
// if(getType(options) === "object") {
|
|
117
|
+
// options.allowMultiple = localAllowMultiple;
|
|
118
|
+
// }
|
|
119
|
+
// return new VdToast(options);
|
|
120
|
+
// };
|
|
121
|
+
|
|
122
|
+
const Toast = (rawOptions) => {
|
|
123
|
+
const opts = normalizeOptions(rawOptions);
|
|
124
|
+
return new VdToast(opts);
|
|
125
|
+
};
|
|
126
|
+
|
|
85
127
|
|
|
86
128
|
Toast.clear = () => {
|
|
87
|
-
queueResult.forEach(toast => {
|
|
88
|
-
toast.clear()
|
|
89
|
-
})
|
|
129
|
+
queueResult.forEach((toast) => {
|
|
130
|
+
toast.clear();
|
|
131
|
+
});
|
|
90
132
|
queueResult = [];
|
|
91
|
-
}
|
|
133
|
+
};
|
|
92
134
|
|
|
93
|
-
Toast.allowMultiple = () => {
|
|
94
|
-
|
|
95
|
-
}
|
|
135
|
+
Toast.allowMultiple = (value = true) => {
|
|
136
|
+
globalAllowMultiple = value;
|
|
137
|
+
};
|
|
96
138
|
|
|
97
|
-
export default Toast
|
|
139
|
+
export default Toast;
|