vdesign-ui 0.1.24-beta → 0.2.0-beta
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/activityviews/index.vue +1 -1
- package/dist/components/checkbox/checkbox-group/index.vue +2 -1
- package/dist/components/checkbox/index.vue +19 -20
- package/dist/components/dialog/index.vue +15 -11
- package/dist/components/footer/index.vue +5 -1
- package/dist/components/footnav/footnav-item/index.vue +10 -37
- package/dist/components/footnav/index.vue +13 -27
- package/dist/components/headnav/index.vue +52 -35
- package/dist/components/icon/font/iconfont.css +16 -16
- package/dist/components/icon/font/iconfont.js +1 -1
- package/dist/components/icon/index.vue +26 -18
- package/dist/components/input/index.vue +84 -109
- package/dist/components/input/search/index.vue +18 -22
- package/dist/components/input/stepper/index.vue +32 -26
- package/dist/components/input/style.less +20 -32
- package/dist/components/list/index.vue +57 -69
- package/dist/components/list/style.less +20 -92
- package/dist/components/loading/index.vue +17 -8
- package/dist/components/pagebreak/index.vue +12 -11
- package/dist/components/radio/index.vue +164 -135
- package/dist/components/radio/radio-group/index.vue +40 -52
- package/dist/components/selector/style.less +4 -0
- package/dist/components/step-item/index.vue +2 -2
- package/dist/components/tabs/index.vue +55 -32
- package/dist/components/tabs/tab/index.vue +13 -16
- package/dist/components/tag/index.vue +18 -4
- package/dist/components/tag/style.less +2 -2
- package/dist/components/title/index.vue +11 -8
- package/dist/components/title/style.less +6 -0
- package/dist/vdesign-ui.common.js +954 -939
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +954 -939
- package/dist/vdesign-ui.umd.min.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="vd-loading-wrapper">
|
|
3
|
-
<div
|
|
3
|
+
<div v-if="isLoading" class="vd-loading">
|
|
4
4
|
<slot>
|
|
5
5
|
<img src="./img_status_loading_white_ani.svg" alt="">
|
|
6
6
|
</slot>
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
export default {
|
|
19
19
|
name:'vd-loading',
|
|
20
20
|
props:{
|
|
21
|
+
type:{
|
|
22
|
+
type: String,
|
|
23
|
+
default:'null',
|
|
24
|
+
},
|
|
21
25
|
text:{
|
|
22
26
|
type: String,
|
|
23
27
|
default:''
|
|
@@ -28,17 +32,22 @@ export default {
|
|
|
28
32
|
},
|
|
29
33
|
size:{
|
|
30
34
|
type: String,
|
|
31
|
-
default:'large'
|
|
35
|
+
default:'large',
|
|
36
|
+
validator: value => ['large', 'small'].includes(value)
|
|
32
37
|
}
|
|
33
38
|
},
|
|
34
39
|
computed:{
|
|
40
|
+
isLoading() {
|
|
41
|
+
if (this.type === 'loading') {
|
|
42
|
+
return true;
|
|
43
|
+
} else if (this.type === 'refresh') {
|
|
44
|
+
return false;
|
|
45
|
+
} else {
|
|
46
|
+
return this.loading;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
35
49
|
refreshClasses() {
|
|
36
|
-
return [
|
|
37
|
-
'vd-refresh',
|
|
38
|
-
{
|
|
39
|
-
[`vd-refresh--${this.size}`]:this.size
|
|
40
|
-
}
|
|
41
|
-
]
|
|
50
|
+
return ['vd-refresh', `vd-refresh--${this.size}`];
|
|
42
51
|
}
|
|
43
52
|
},
|
|
44
53
|
methods:{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="vd-page-break">
|
|
3
|
-
<template v-if="drop">
|
|
3
|
+
<template v-if="drop === 'dropdot'">
|
|
4
4
|
<div v-for="pageNumber in totalPages" class="vd-page-break__cell"
|
|
5
5
|
:class="{ 'vd-page-break__cell--active': pageNumber === currentPage }" :key="pageNumber"
|
|
6
6
|
@click="changePage(pageNumber)">
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<div class="vd-page-break__number"
|
|
10
|
+
<div class="vd-page-break__number" v-else-if="drop === 'dropnum'">
|
|
11
11
|
<span class="vd-page-break__number--active" v-if="number">{{ number }}</span>
|
|
12
12
|
<span class="vd-page-break__number--line">/</span>
|
|
13
13
|
<span class="vd-page-break__number--total">{{ total }}</span>
|
|
@@ -19,26 +19,27 @@
|
|
|
19
19
|
export default {
|
|
20
20
|
name: 'vd-page-break',
|
|
21
21
|
props: {
|
|
22
|
+
drop: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'dropdot'
|
|
25
|
+
},
|
|
22
26
|
totalPages: {
|
|
23
27
|
type: Number,
|
|
24
28
|
default: 5
|
|
25
29
|
},
|
|
26
|
-
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: true
|
|
29
|
-
},
|
|
30
|
-
number: {
|
|
30
|
+
activePage: {
|
|
31
31
|
type: Number,
|
|
32
|
-
default: 1
|
|
32
|
+
default: 1 // 默认显示第一页
|
|
33
33
|
},
|
|
34
34
|
total: {
|
|
35
35
|
type: Number,
|
|
36
36
|
default: 9
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
number: {
|
|
39
39
|
type: Number,
|
|
40
|
-
default: 1
|
|
41
|
-
}
|
|
40
|
+
default: 1
|
|
41
|
+
},
|
|
42
|
+
|
|
42
43
|
},
|
|
43
44
|
data() {
|
|
44
45
|
return {
|
|
@@ -1,155 +1,184 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 常规单选框 -->
|
|
2
3
|
<label :class="wrapClasses" v-if="!radioButton">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<span :class="radioClasses">
|
|
5
|
+
<span :class="innerClasses"></span>
|
|
6
|
+
<input
|
|
7
|
+
type="radio"
|
|
8
|
+
:class="inputClasses"
|
|
9
|
+
:disabled="isDisabled"
|
|
10
|
+
:checked="currentValue"
|
|
11
|
+
@change="handleChange"
|
|
12
|
+
>
|
|
13
|
+
</span>
|
|
14
|
+
<!-- 标签内容 -->
|
|
15
|
+
<div class="vd-radio__label" v-if="$slots.default">
|
|
16
|
+
<div class="vd-radio__text">
|
|
17
|
+
<slot></slot>
|
|
12
18
|
</div>
|
|
19
|
+
</div>
|
|
13
20
|
</label>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<label
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
<!-- 按钮样式的单选框 -->
|
|
23
|
+
<label
|
|
24
|
+
class="vd-radio vd-radio-button"
|
|
25
|
+
:class="radioButtonClasses"
|
|
26
|
+
v-else
|
|
27
|
+
>
|
|
28
|
+
<input
|
|
29
|
+
type="radio"
|
|
30
|
+
:class="inputClasses"
|
|
31
|
+
:disabled="isDisabled"
|
|
32
|
+
:checked="currentValue"
|
|
33
|
+
@change="handleChange"
|
|
34
|
+
>
|
|
35
|
+
<span class="vd-radio-button-text">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</span>
|
|
21
38
|
</label>
|
|
22
|
-
</template>
|
|
23
|
-
<script>
|
|
24
|
-
import { findComponentUpward } from './assist';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
</template>
|
|
40
|
+
<script>
|
|
41
|
+
import { findComponentUpward } from './assist';
|
|
42
|
+
|
|
43
|
+
const prefixCls = 'vd-radio';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
28
46
|
name: 'vd-radio',
|
|
29
47
|
props: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
// 组件的值,用于 v-model 绑定
|
|
49
|
+
value: {
|
|
50
|
+
type: [String, Number, Boolean],
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
// 是否为按钮样式
|
|
54
|
+
radioButton: Boolean,
|
|
55
|
+
// 是否禁用
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
// 选中时的值
|
|
61
|
+
trueValue: {
|
|
62
|
+
type: [String, Number, Boolean],
|
|
63
|
+
default: true,
|
|
64
|
+
},
|
|
65
|
+
// 未选中时的值
|
|
66
|
+
falseValue: {
|
|
67
|
+
type: [String, Number, Boolean],
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
// 单选框的标识名称,在组内使用
|
|
71
|
+
name: {
|
|
72
|
+
type: [String, Number, Boolean],
|
|
73
|
+
},
|
|
74
|
+
// 类型,用于样式
|
|
75
|
+
type: String,
|
|
57
76
|
},
|
|
58
77
|
data() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
return {
|
|
79
|
+
// 当前是否选中
|
|
80
|
+
currentValue: this.value === this.trueValue,
|
|
81
|
+
// 是否属于单选框组
|
|
82
|
+
isGroup: false,
|
|
83
|
+
// 父级单选框组的引用
|
|
84
|
+
parentGroup: null,
|
|
85
|
+
};
|
|
67
86
|
},
|
|
68
87
|
computed: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
// 计算禁用状态,优先级:自身 > 组
|
|
89
|
+
isDisabled() {
|
|
90
|
+
return this.disabled || (this.isGroup && this.parentGroup.disabled);
|
|
91
|
+
},
|
|
92
|
+
// 包裹类名
|
|
93
|
+
wrapClasses() {
|
|
94
|
+
return [
|
|
95
|
+
`${prefixCls}`,
|
|
96
|
+
{
|
|
97
|
+
[`${prefixCls}--checked`]: this.currentValue,
|
|
98
|
+
[`${prefixCls}--disabled`]: this.isDisabled,
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
},
|
|
102
|
+
// 单选框的类名
|
|
103
|
+
radioClasses() {
|
|
104
|
+
return [`${prefixCls}__input`];
|
|
105
|
+
},
|
|
106
|
+
// 图标的类名
|
|
107
|
+
innerClasses() {
|
|
108
|
+
return [`${prefixCls}__icon`];
|
|
109
|
+
},
|
|
110
|
+
// 输入框的类名
|
|
111
|
+
inputClasses() {
|
|
112
|
+
return `${prefixCls}__original`;
|
|
113
|
+
},
|
|
114
|
+
// 按钮样式的类名
|
|
115
|
+
radioButtonClasses() {
|
|
116
|
+
return [
|
|
117
|
+
{
|
|
118
|
+
[`${prefixCls}-button--checked`]: this.currentValue,
|
|
119
|
+
[`${prefixCls}-button--${this.type}`]: this.type,
|
|
120
|
+
[`${prefixCls}-button--disabled`]: this.isDisabled,
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
},
|
|
101
124
|
},
|
|
102
125
|
mounted() {
|
|
103
|
-
|
|
104
|
-
|
|
126
|
+
// 查找父级 vd-radio-group 组件
|
|
127
|
+
this.parentGroup = findComponentUpward(this, 'vd-radio-group');
|
|
128
|
+
this.isGroup = !!this.parentGroup;
|
|
129
|
+
|
|
130
|
+
if (this.isGroup) {
|
|
131
|
+
// 如果在组内,注册到组中
|
|
132
|
+
this.parentGroup.updateValue();
|
|
133
|
+
} else {
|
|
134
|
+
// 如果不在组内,更新自身的选中状态
|
|
135
|
+
this.updateValue();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
methods: {
|
|
139
|
+
// 处理 change 事件
|
|
140
|
+
handleChange(event) {
|
|
141
|
+
if (this.isDisabled) {
|
|
142
|
+
return;
|
|
105
143
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
|
|
145
|
+
const checked = event.target.checked;
|
|
146
|
+
this.currentValue = checked;
|
|
147
|
+
const value = checked ? this.trueValue : this.falseValue;
|
|
148
|
+
this.$emit('input', value);
|
|
149
|
+
|
|
150
|
+
if (this.isGroup) {
|
|
151
|
+
// 如果在组内,通知组更新
|
|
152
|
+
this.parentGroup.change(this.name);
|
|
109
153
|
} else {
|
|
110
|
-
|
|
154
|
+
// 否则,触发自身的 change 事件
|
|
155
|
+
this.$emit('change', value);
|
|
111
156
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.$emit('input', value);
|
|
124
|
-
|
|
125
|
-
if (this.group) {
|
|
126
|
-
if (this.name !== undefined) {
|
|
127
|
-
this.parent.change({
|
|
128
|
-
value: this.name,
|
|
129
|
-
checked: this.value
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
} else {
|
|
133
|
-
this.$emit('change', value);
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
updateValue() {
|
|
137
|
-
this.currentValue = this.value === this.trueValue;
|
|
138
|
-
},
|
|
139
|
-
|
|
157
|
+
},
|
|
158
|
+
// 更新 currentValue
|
|
159
|
+
updateValue() {
|
|
160
|
+
if (this.isGroup) {
|
|
161
|
+
// 组内,通过比较组的值和自身的 name 来确定是否选中
|
|
162
|
+
this.currentValue = this.parentGroup.value === this.name;
|
|
163
|
+
} else {
|
|
164
|
+
// 组外,通过比较 value 和 trueValue
|
|
165
|
+
this.currentValue = this.value === this.trueValue;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
140
168
|
},
|
|
141
169
|
watch: {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
// 监听 value 的变化
|
|
171
|
+
value() {
|
|
172
|
+
this.updateValue();
|
|
173
|
+
},
|
|
174
|
+
// 如果在组内,监听组的 value 变化
|
|
175
|
+
'parentGroup.value'() {
|
|
176
|
+
this.updateValue();
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
|
|
153
182
|
<style lang="less">
|
|
154
|
-
@import
|
|
183
|
+
@import "./style.less";
|
|
155
184
|
</style>
|
|
@@ -9,62 +9,50 @@ import { findComponentsDownward } from '../assist';
|
|
|
9
9
|
const prefixCls = 'vd-radio-group';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: ''
|
|
21
|
-
}
|
|
12
|
+
name: 'vd-radio-group',
|
|
13
|
+
props: {
|
|
14
|
+
// 绑定的值,用于 v-model
|
|
15
|
+
value: {
|
|
16
|
+
type: [String, Number, Boolean],
|
|
17
|
+
default: '',
|
|
22
18
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
// 类型,用于样式
|
|
20
|
+
type: String,
|
|
21
|
+
// 是否禁用组内所有单选框
|
|
22
|
+
disabled: Boolean
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
// 组容器的类名
|
|
26
|
+
classes() {
|
|
27
|
+
return [
|
|
28
|
+
`${prefixCls}`,
|
|
29
|
+
{
|
|
30
|
+
[`${prefixCls}__${this.type}`]: this.type,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
28
33
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
// 更新子单选框的状态
|
|
37
|
+
updateValue() {
|
|
38
|
+
const children = findComponentsDownward(this, 'vd-radio');
|
|
39
|
+
if (children.length) {
|
|
40
|
+
children.forEach((child) => {
|
|
41
|
+
child.updateValue();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
38
44
|
},
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
// 处理子单选框的变化
|
|
46
|
+
change(name) {
|
|
47
|
+
this.$emit('input', name);
|
|
48
|
+
this.$emit('change', name);
|
|
41
49
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
child.currentValue = this.currentValue === child.name;
|
|
48
|
-
child.group = true;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
change(data) {
|
|
53
|
-
this.currentValue = data.value;
|
|
54
|
-
this.updateValue();
|
|
55
|
-
this.$emit('input', data.value);
|
|
56
|
-
this.$emit('change', data.value);
|
|
57
|
-
}
|
|
50
|
+
},
|
|
51
|
+
watch: {
|
|
52
|
+
// 监听 value 的变化,更新子组件
|
|
53
|
+
value() {
|
|
54
|
+
this.updateValue();
|
|
58
55
|
},
|
|
59
|
-
|
|
60
|
-
value() {
|
|
61
|
-
if (this.currentValue !== this.value) {
|
|
62
|
-
this.currentValue = this.value;
|
|
63
|
-
this.$nextTick(() => {
|
|
64
|
-
this.updateValue();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
56
|
+
},
|
|
69
57
|
};
|
|
70
58
|
</script>
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&__icon {
|
|
61
|
+
display: flex;
|
|
61
62
|
font-size: calc(var(--icon-selector-xl) * 1px);
|
|
62
63
|
margin-inline-end: calc(var(--spacing-selector-xl-margin_y) * 1px);
|
|
63
64
|
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
&__icon {
|
|
112
|
+
display: flex;
|
|
111
113
|
font-size: calc(var(--icon-selector-l) * 1px);
|
|
112
114
|
margin-inline-end: calc(var(--spacing-selector-l-margin_y) * 1px);
|
|
113
115
|
|
|
@@ -157,6 +159,7 @@
|
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
&__icon {
|
|
162
|
+
display: flex;
|
|
160
163
|
font-size: calc(var(--icon-selector-m) * 1px);
|
|
161
164
|
margin-inline-end: calc(var(--spacing-selector-m-margin_y) * 1px);
|
|
162
165
|
|
|
@@ -205,6 +208,7 @@
|
|
|
205
208
|
}
|
|
206
209
|
|
|
207
210
|
&__icon {
|
|
211
|
+
display: flex;
|
|
208
212
|
font-size: calc(var(--icon-selector-s) * 1px);
|
|
209
213
|
margin-inline-end: calc(var(--spacing-selector-s-margin_y) * 1px);
|
|
210
214
|
|
|
@@ -70,9 +70,9 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
iconName() {
|
|
72
72
|
if (this.state === 'afoot') {
|
|
73
|
-
return this.currentTheme === 'dark' ? '
|
|
73
|
+
return this.currentTheme === 'dark' ? 'icon_show_steping1_svg' : 'icon_show_steping_svg'
|
|
74
74
|
} else if (this.state === 'warning') {
|
|
75
|
-
return this.currentTheme === 'dark' ? '
|
|
75
|
+
return this.currentTheme === 'dark' ? 'icon_show_stepwrong1_svg' : 'icon_show_stepwrong_svg'
|
|
76
76
|
}
|
|
77
77
|
return ''
|
|
78
78
|
}
|