vdesign-ui 0.1.15 → 0.1.17

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="wrapClasses">
3
- <span class="vd-actions__text" v-if="text">{{ text }}</span>
3
+ <span class="vd-actions__text" :class="textClasses" v-if="text">{{ text }}</span>
4
4
  <vd-icon v-if="icon && type === 'list'" class="vd-actions__icon" :name="icon" :svg="iconSvg"></vd-icon>
5
5
  <span class="vd-actions__content" :class="contentBg" v-if="icon && type === 'card'">
6
6
  <vd-icon class="vd-actions__icon" :name="icon" :svg="iconSvg"></vd-icon>
@@ -15,30 +15,24 @@ export default {
15
15
  props: {
16
16
  type: {
17
17
  type: String,
18
- default: ""
19
18
  },
20
19
  colors: {
21
20
  type: String,
22
- default: ""
23
-
24
21
  },
25
22
  backgrounds: {
26
23
  type: String,
27
- default: ""
28
-
29
24
  },
30
25
  text: {
31
26
  type: String,
32
- default: ""
33
27
  },
34
28
  icon: {
35
29
  type: String,
36
- default: '',
37
30
  },
38
31
  iconSvg: {
39
32
  type: Boolean,
40
33
  default: false,
41
34
  },
35
+ disbaled:Boolean,
42
36
  },
43
37
  computed: {
44
38
  wrapClasses() {
@@ -46,6 +40,7 @@ export default {
46
40
  `${prefixCls}`,
47
41
  {
48
42
  [`${prefixCls}__${this.type}`]: this.type,
43
+ [`${prefixCls}__${this.type}--${this.disbaled}`]: this.disbaled,
49
44
  [`${prefixCls}__${this.colors}`]: this.colors,
50
45
  }
51
46
  ]
@@ -56,9 +51,15 @@ export default {
56
51
  [`${prefixCls}__content--${this.backgrounds}`]: this.backgrounds
57
52
  }
58
53
  ]
59
- }
54
+ },
55
+ textClasses(){
56
+ return [
57
+ {
58
+ [`${prefixCls}__text--${this.disbaled}`]: this.disbaled
59
+ }
60
+ ]
60
61
  },
61
-
62
+ }
62
63
  }
63
64
  </script>
64
65
 
@@ -26,19 +26,33 @@
26
26
 
27
27
  &--green{
28
28
  background-color: var(--color-actions-bg-green);
29
+ &--disabled{
30
+ background-color: var(--color-actions-bg-green-disable);
31
+ }
29
32
  }
30
33
 
31
34
  &--warning{
32
35
  background-color: var(--color-actions-bg-warning);
36
+ &--disabled{
37
+ background-color: var(--color-actions-bg-warning-disable);
38
+ }
33
39
  }
34
40
 
35
41
  &--blue{
36
42
  background-color: var(--color-actions-bg-blue);
43
+ &--disabled{
44
+ background-color: var(--color-actions-bg-blue-disable);
45
+ }
37
46
  }
38
47
 
39
48
  &--gray{
40
49
  background-color: var(--color-actions-bg-gray);
50
+ &--disabled{
51
+ background-color: var(--color-actions-bg-gray-disable);
52
+ }
41
53
  }
54
+
55
+
42
56
  }
43
57
 
44
58
  .@{actions-prefix-cls}__icon{
@@ -50,11 +64,15 @@
50
64
  color: var(--color-actions-text);
51
65
  font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
52
66
  font-weight: var(--en-single-f-d-s-fontWeight);
67
+ &--disabled{
68
+ color: var(--color-actions-text);
69
+
70
+ }
53
71
  }
54
72
 
55
73
  &__icon{
56
74
  font-size: calc(var(--icon-actions-size) * 1px);
57
- color: var(--color-actions-text);
75
+ color: var(--color-actions-text-disable);
58
76
  }
59
77
 
60
78
  &__green{
@@ -72,4 +90,5 @@
72
90
  &__gray{
73
91
  background-color: var(--color-actions-bg-gray);
74
92
  }
93
+
75
94
  }
@@ -77,7 +77,9 @@
77
77
  }
78
78
 
79
79
  &__body{
80
- background-color: #fff;
80
+ // background-color: #fff;
81
+ background-color: var(--color-activityviews-bg);
82
+
81
83
  height: 80%;
82
84
  overflow-y: auto;
83
85
 
@@ -110,6 +112,10 @@
110
112
  flex: 1;
111
113
  overflow: auto;
112
114
  -webkit-overflow-scrolling: touch;
115
+
116
+ .vd-btn{
117
+ border-radius: 0;
118
+ }
113
119
  }
114
120
 
115
121
  &__gap{
@@ -17,6 +17,6 @@
17
17
  &__text{
18
18
  font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
19
19
  font-weight: var(--en-single-f-b-r-fontWeight);
20
- color: var(--text-color-h3);
20
+ color: var(--text-color-h2);
21
21
  }
22
22
  }
@@ -13,6 +13,7 @@
13
13
  .vd-iconfont {
14
14
  margin-bottom: 2px;
15
15
  font-size: calc(var(--icon-footnav-size) * 1px);
16
+ color: var(--text-color-h2);
16
17
  }
17
18
 
18
19
  &:active {
@@ -39,7 +39,7 @@
39
39
 
40
40
  .vd-iconfont {
41
41
  font-size: calc(var(--icon-small) * 1px);
42
- color: rgba(0, 0, 0, 0.3);
42
+ color: var(--text-color-h2);
43
43
  }
44
44
  }
45
45
 
@@ -59,7 +59,7 @@
59
59
 
60
60
  &__icon--right {
61
61
  font-size: 16px;
62
- color: rgba(0, 0, 0, 0.5);
62
+ color: var(--text-color-h2);
63
63
  }
64
64
 
65
65
  &__title {
@@ -92,7 +92,7 @@
92
92
 
93
93
  &__icon--right {
94
94
  font-size: 16px;
95
- color: rgba(0, 0, 0, 0.5);
95
+ color: var(--text-color-h2);
96
96
  }
97
97
 
98
98
  &__title {
@@ -126,7 +126,7 @@
126
126
  &__icon--right {
127
127
  // margin-inline-start: calc(var(--spacing-title-tertiary_icon-margin_y) * 1px);
128
128
  font-size: 16px;
129
- color: rgba(0, 0, 0, 0.5);
129
+ color: var(--text-color-h2);
130
130
  }
131
131
 
132
132
  &__title {
@@ -158,7 +158,7 @@
158
158
 
159
159
  &__icon--right {
160
160
  font-size: 16px;
161
- color: rgba(0, 0, 0, 0.5);
161
+ color: var(--text-color-h2);
162
162
  }
163
163
 
164
164
  &__title {
@@ -197,6 +197,7 @@
197
197
  &__icon--leftcus {
198
198
  margin-inline-end: calc(var(--spacing-list-common_icon-margin_right) * 1px);
199
199
  font-size: calc(var(--icon-large) * 1px);
200
+ color: var(--text-color-h2);
200
201
  }
201
202
 
202
203
  // &__icon--left{
@@ -274,13 +275,14 @@
274
275
  &__icon--leftcus {
275
276
  margin-inline-end: calc(var(--spacing-list-check_icon-margin_right) * 1px);
276
277
  font-size: calc(var(--icon-large) * 1px);
278
+ color: var(--text-color-h2);
277
279
  }
278
280
  }
279
281
 
280
282
  &__icon--extra {
281
283
  font-size: 16px;
282
284
  margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
283
- color: rgba(0, 0, 0, 0.5);
285
+ color: var(--text-color-h2);
284
286
  }
285
287
 
286
288
  &__switch {
@@ -1,11 +1,10 @@
1
1
  <template>
2
2
  <div class="vd-tabs">
3
3
  <div class="vd-tabs__wrap" :class="menuClasses" ref="tabsWrap">
4
- <div :class="[barType, scrollspy]" ref="tabsContainer">
5
- <div v-for="(item, index) in navList" :key="index" :class="[tabClasses(item), lineClasses]"
6
- @click="handleChange(index)">
7
- <span class="vd-tabs-text-cell" :class="ellipsisClasses">{{ item.title
8
- }}<vd-icon class="vd-tabs-arrow" v-if="item.arrow" name="icon_btn_moredown"></vd-icon>
4
+ <div :class="[barType,scrollspy]" ref="tabsContainer">
5
+ <div v-for="(item, index) in navList" :key="index" :class="tabClasses(item)" @click="handleChange(index)">
6
+ <span class="vd-tabs-text-cell" :class="ellipsisClasses">{{ item.title }}
7
+ <vd-icon class="vd-tabs-arrow" v-if="item.arrow" name="icon_btn_moredown"></vd-icon>
9
8
  </span>
10
9
  </div>
11
10
  </div>
@@ -39,12 +38,11 @@ export default {
39
38
  divider: Boolean,
40
39
  menuIcon: {
41
40
  type: String,
42
- default: 'icon_tab_morelist', // 默认图标,如果没有传入自定义图标则使用此图标
41
+ default: 'icon_tab_morelist',
43
42
  },
44
43
  },
45
44
  data() {
46
45
  return {
47
- // defType: ['primary', 'card', 'secondary','capsule','selector-l','selector-m', 'filter', 'click-filter'],
48
46
  currentValue: this.value,
49
47
  navList: [],
50
48
  };
@@ -53,44 +51,32 @@ export default {
53
51
  value(val) {
54
52
  this.currentValue = val;
55
53
  },
56
- currentValue() {
57
- this.updateStatus();
58
- },
59
54
  },
60
55
  computed: {
56
+ scrollspy() {
57
+ return `${prefixCls}--complete`
58
+ },
61
59
  ellipsisClasses() {
62
- return [
63
- {
64
- [`${prefixCls}-text--ellipsis`]: this.ellipsis,
65
- },
66
- ];
60
+ return {
61
+ [`${prefixCls}-text--ellipsis`]: this.ellipsis,
62
+ };
67
63
  },
68
64
  menuClasses() {
69
- return [
70
- {
71
- [`${prefixCls}-menu`]: this.menu,
72
- [`${prefixCls}__wrap--bg`]: this.backgroundColor,
73
- // 二级tab才有线
74
- "vd-hairline--bottom": this.divider,
75
- },
76
- ];
77
- },
78
- scrollspy() {
79
- return `${prefixCls}--complete`
65
+ return {
66
+ [`${prefixCls}-menu`]: this.menu,
67
+ [`${prefixCls}__wrap--bg`]: this.backgroundColor,
68
+ "vd-hairline--bottom": this.divider,
69
+ };
80
70
  },
81
71
  lineClasses() {
82
- return [
83
- {
84
- [`${prefixCls}__line`]: !this.actBorder,
85
- },
86
- ];
72
+ return {
73
+ [`${prefixCls}__line`]: !this.actBorder,
74
+ };
87
75
  },
88
76
  barType() {
89
- return [
90
- {
91
- [`${prefixCls}-${this.tabsType}-bar`]: this.tabsType,
92
- },
93
- ];
77
+ return {
78
+ [`${prefixCls}-${this.tabsType}-bar`]: this.tabsType,
79
+ };
94
80
  },
95
81
  },
96
82
  methods: {
@@ -100,19 +86,17 @@ export default {
100
86
  tabClasses(item) {
101
87
  return {
102
88
  [`${prefixCls}-${this.tabsType}`]: true,
103
- [`${prefixCls}-${this.tabsType}-active`]: item.name === this.currentValue
89
+ [`${prefixCls}-${this.tabsType}-active`]: item.name === this.currentValue,
104
90
  };
105
91
  },
106
92
  getTabs() {
107
- const tabs = this.$children.filter((item) => item.$options.name === "vd-tab");
108
- return tabs;
93
+ return this.$children.filter((item) => item.$options.name === "vd-tab");
109
94
  },
110
-
111
95
  updateNav() {
112
96
  this.navList = this.getTabs().map((pane, index) => ({
113
97
  title: pane.title,
114
98
  name: pane.name || index,
115
- arrow: pane.arrow
99
+ arrow: pane.arrow,
116
100
  }));
117
101
  if (!this.currentValue) {
118
102
  this.currentValue = this.navList[0].name;
@@ -121,30 +105,20 @@ export default {
121
105
  },
122
106
  updateStatus() {
123
107
  this.getTabs().forEach((tab) => {
124
- tab.show = tab.computedName === this.currentValue;
108
+ tab.show = tab.computedName === this.currentValue;
125
109
  });
126
110
  },
127
111
  handleChange(index) {
128
112
  const nav = this.navList[index];
129
113
  const name = nav.name;
130
- const title = nav.title;
131
-
132
114
  if (this.currentValue !== name) {
133
115
  this.currentValue = name;
134
- const eventData = {
135
- index: index,
136
- title: title,
137
- name: name
138
- };
139
- this.$emit('change', eventData);
116
+ this.$emit('input', name); // 确保向父组件更新
117
+ this.$emit('change', { index, title: nav.title, name });
118
+ this.updateStatus(); // 确保更新状态
140
119
  this.adjustTabPosition(index);
141
120
  }
142
- const eventData = {
143
- index: index,
144
- title: title,
145
- name: name
146
- };
147
- this.$emit("click", eventData);
121
+ this.$emit("click", { index, title: nav.title, name });
148
122
  },
149
123
  adjustTabPosition(index) {
150
124
  const container = this.$refs.tabsContainer;
@@ -159,11 +133,13 @@ export default {
159
133
  },
160
134
  },
161
135
  mounted() {
162
- // 在组件挂载后更新标签
163
136
  this.updateNav();
164
137
  },
165
138
  };
166
139
  </script>
140
+
141
+ <style lang="less"></style>
142
+
167
143
  <style lang="less">
168
144
  @import "./style.less";
169
145
  </style>
@@ -1,63 +1,56 @@
1
1
  <template>
2
- <div :class="getCls">
3
- <slot />
2
+ <div :class="tabClasses">
3
+ <slot />
4
4
  </div>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- name: 'vd-tab',
10
- props: {
11
- name:[String, Number],
12
- title: {
13
- type: String,
14
- },
15
- arrow: {
16
- type: Boolean,
17
- default: false
18
- }
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'vd-tab',
10
+ props: {
11
+ name: [String, Number],
12
+ title: {
13
+ type: String,
14
+ required: true,
19
15
  },
20
- data () {
21
- return {
22
- show: false,
23
- localName: this.name // 初始化时使用 prop 的值
24
- }
16
+ arrow: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ },
21
+ data() {
22
+ return {
23
+ show: false,
24
+ };
25
+ },
26
+ watch: {
27
+ title() {
28
+ this.updateNav();
25
29
  },
26
- watch: {
27
- title () {
28
- this.updateNav()
29
- },
30
- // name(newName) {
31
- // // 响应 prop 的改变
32
- // this.localName = newName;
33
- // }
30
+ name() {
31
+ this.updateNav();
32
+ },
33
+ },
34
+ computed: {
35
+ tabClasses() {
36
+ return {
37
+ 'vd-tab': true,
38
+ 'vd-tab-active': this.show,
39
+ };
34
40
  },
35
- computed: {
36
- getCls() {
37
- return [
38
- 'vd-tab',
39
- {'vd-tab-active': this.show}
40
- ];
41
- },
42
- computedName() {
43
- return this.name ?? this.$parent.getTabs().indexOf(this);
44
- }
41
+ computedName() {
42
+ return this.name ?? this.$parent.getTabs().indexOf(this);
45
43
  },
46
- methods: {
47
- updateNav () {
48
- this.$parent.updateNav()
49
- },
44
+ },
45
+ methods: {
46
+ updateNav() {
47
+ this.$parent.updateNav();
50
48
  },
51
- mounted () {
52
- // if (this.name === undefined) {
53
- // let parent = this.$parent;
54
- // let index = parent.getTabs().indexOf(this);
55
- // this.localName = index; // 将索引设置为字符串作为 localName
56
- // }
57
- this.updateNav()
58
- }
59
- }
60
- </script>
61
-
62
- <style lang="less"></style>
63
-
49
+ },
50
+ mounted() {
51
+ this.updateNav();
52
+ },
53
+ };
54
+ </script>
55
+
56
+ <style lang="less"></style>
@@ -21,16 +21,16 @@
21
21
 
22
22
 
23
23
  &--white{
24
- color: var(--color-tag-white-text);
25
- background-color: var(--color-tag-white-bg);
24
+ color: var(--color-tag-default-text);
25
+ background-color: var(--color-tag-default-bg);
26
26
 
27
27
  &__border{
28
28
  background-color:transparent;
29
29
  font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
30
30
  font-weight: var(--en-single-f-b-r-fontWeight);
31
- color: var(--color-tag-white_border-text);
31
+ color: var(--color-tag-default_border-text);
32
32
  &::after{
33
- border-color: var(--color-tag-white-border);
33
+ border-color: var(--color-tag-default-border);
34
34
  border-radius: calc(var(--radius-tag-bg) * 2px);
35
35
  }
36
36
  }