vdesign-ui 0.1.11 → 0.1.13

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.
@@ -5,7 +5,7 @@
5
5
  <div class="vd-activityviews">
6
6
  <div class="vd-activityviews__header" v-if="withHeader">
7
7
  <div class="vd-activityviews__wrapper">
8
- <vd-icon v-if="backDefault" :name="backDefault"></vd-icon>
8
+ <vd-icon v-if="backDefault" name="icon_nav_back"></vd-icon>
9
9
  <div v-if="title" class="vd-activityviews__title">{{ title }}</div>
10
10
  <slot name="close">
11
11
  <vd-icon v-if="closeIcon" class="vd-activityviews__close" name="icon_btn_dialogclose" svg
@@ -45,10 +45,7 @@ export default {
45
45
  props: {
46
46
  value: Boolean,
47
47
  title: String,
48
- backDefault: {
49
- type: String,
50
- default: "icon_nav_back"
51
- },
48
+ backDefault:Boolean,
52
49
  closeIcon: Boolean,
53
50
  closeBtn: String,
54
51
  description: String,
@@ -9,10 +9,11 @@
9
9
  <div class="vd-dialog__title">{{ title }}</div>
10
10
  </header>
11
11
  <div class="vd-dialog__content">
12
- <div class="vd-dialog__message" :class="{ 'vd-dialog__message--head': !title }" v-if="message">{{
12
+ <div class="vd-dialog__message" :class="{ 'vd-dialog__message--head': !title }" v-if="message || $slots.content">
13
+ <slot name="content">{{
13
14
  message
14
- }}</div>
15
- <slot name="content"></slot>
15
+ }}</slot>
16
+ </div>
16
17
  </div>
17
18
  <footer class="vd-dialog__footer">
18
19
  <div class="vd-dialog__btns" v-if="btns">
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="vd-empty" :class="wrapClasses">
3
3
  <div class="vd-empty-img"><img :src="currentImg" alt="img"></div>
4
- <p class="vd-empty-txt" :class="textClasses" v-if="text">{{ text }}</p>
4
+ <p class="vd-empty-txt" :class="textClasses" v-if="description">{{ description }}</p>
5
5
  <div class="vd-empty-footer" :class="footerClasses" v-if="$slots.btn">
6
6
  <slot name="btn"></slot>
7
7
  </div>
@@ -15,7 +15,7 @@ export default {
15
15
  name: 'vd-empty',
16
16
  props: {
17
17
  imgs: String,
18
- text: String,
18
+ description: String,
19
19
  size: String,
20
20
  type: {
21
21
  type: String,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :class="wrapClasses" class="vd-input">
3
3
  <template v-if="inputTextArea || type !== 'textarea'">
4
- <span v-if="prefix || $slots.prefix" class="vd-input-form__prefix vd-hairline--right">
4
+ <span v-if="prefix || $slots.prefix" class="vd-input-form__prefix" :class="borderRightClasses">
5
5
  <slot name="prefix">{{ prefix }}</slot>
6
6
  </span>
7
7
  <input
@@ -116,17 +116,18 @@ export default {
116
116
  default: "text",
117
117
  },
118
118
  prefix: {
119
- type: [Boolean, String],
120
- default: false,
119
+ type: Boolean,
120
+ },
121
+ borderRight: {
122
+ type: Boolean,
123
+ default: true
121
124
  },
122
125
  suffix: {
123
- type: [Boolean, String],
124
- default: false,
126
+ type: Boolean,
125
127
  },
126
128
  // 设计如此,单独的文字
127
129
  append: {
128
- type: [Boolean, String],
129
- default: false,
130
+ type: Boolean,
130
131
  },
131
132
  placeholder: {
132
133
  type: String,
@@ -218,6 +219,14 @@ export default {
218
219
  },
219
220
  ];
220
221
  },
222
+ borderRightClasses(){
223
+ return [
224
+ "vd-hairline--right",
225
+ {
226
+ [`${prefixCls}--border`]: this.borderRight,
227
+ }
228
+ ]
229
+ },
221
230
  inputClasses() {
222
231
  return [
223
232
  `${prefixCls}__control`,
@@ -6,13 +6,13 @@
6
6
  <vd-icon name="icon_nav_search"></vd-icon>
7
7
  </slot>
8
8
  </span>
9
- <input :type="type" :class="inputClasses" :placeholder="placeholder">
10
- <!-- <vd-input
11
- type="text"
12
- form="form"
13
- placeholder="请输出文字"
14
- v-model="input"
15
- ></vd-input> -->
9
+ <!-- <input :type="type" :class="inputClasses" :placeholder="placeholder"> -->
10
+ <vd-input
11
+ v-bind="$attrs"
12
+ v-on="listeners"
13
+ form="search"
14
+ :hairline = "false"
15
+ ></vd-input>
16
16
  <span v-if="suffix || $slots.suffix" class="vd-search__suffix">
17
17
  <slot name="suffix">
18
18
  <vd-icon v-if="suffix" name="icon_btn_clean"></vd-icon>
@@ -30,6 +30,7 @@
30
30
  const prefixCls = 'vd-search';
31
31
  export default {
32
32
  name: 'vd-search',
33
+ inheritAttrs: false,
33
34
  props: {
34
35
  type: {
35
36
  type: String,
@@ -41,10 +42,6 @@ export default {
41
42
  suffix: {
42
43
  type: Boolean,
43
44
  },
44
- placeholder: {
45
- type: String,
46
- default: ''
47
- },
48
45
  },
49
46
  data() {
50
47
  return {
@@ -56,6 +53,11 @@ export default {
56
53
  `${prefixCls}__control`
57
54
  ]
58
55
  },
56
+ listeners() {
57
+ return {
58
+ ...this.$listeners,
59
+ };
60
+ }
59
61
  },
60
62
  methods: {
61
63
 
@@ -11,6 +11,10 @@
11
11
  border: 0;
12
12
  text-decoration: none;
13
13
  }
14
+
15
+ &--border{
16
+ margin-inline-end: calc(var(--spacing-input-form_divider-margin_y)* 1px);
17
+ }
14
18
  &__control {
15
19
  flex: 1;
16
20
  width: 100%;
@@ -18,10 +22,11 @@
18
22
  margin: 0;
19
23
  padding: 0;
20
24
  background-color: transparent;
21
- caret-color: var(--color-input-cursor);
22
25
  color: var(--color-input-text-active);
23
26
  font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
24
27
  font-weight: var(--en-single-f-d-s-fontWeight);
28
+ caret-color: var(--color-input-cursor);
29
+
25
30
  }
26
31
 
27
32
  &--active {
@@ -126,7 +131,7 @@
126
131
  color: var(--color-input-text-active);
127
132
  font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
128
133
  font-weight: var(--en-single-f-d-s-fontWeight);
129
- margin-inline-end: calc(var(--spacing-input-form_divider-margin_y) * 1px);
134
+ // margin-inline-end: calc(var(--spacing-input-form_divider-margin_y) * 1px);
130
135
  padding-inline-end: calc(var(--spacing-input-form_divider-margin_y) * 1px);
131
136
  }
132
137
 
@@ -224,13 +229,22 @@
224
229
  border: 0;
225
230
  text-decoration: none;
226
231
  }
227
- height: calc(var(--height-input-search_content) * 1px);
232
+ flex: 1;
228
233
  display: flex;
229
234
  align-items: center;
235
+ height: calc(var(--height-input-search_content) * 1px);
230
236
  padding-inline-start: calc(var(--spacing-input-search_textarea-padding_y) * 1px);
231
237
  padding-inline-end: calc(var(--spacing-input-search_textarea-padding_y) * 1px);
232
238
 
233
239
 
240
+ .@{input-prefix-cls} {
241
+ &-search{
242
+ padding-inline-end: 0;
243
+ flex: 1;
244
+ }
245
+ }
246
+
247
+
234
248
  &-content {
235
249
  flex: 1;
236
250
  display: flex;
@@ -244,12 +258,12 @@
244
258
 
245
259
  &__control {
246
260
  width: 100%;
247
- caret-color: var(--color-input-cursor);
248
261
  background-color: transparent;
249
262
  height: calc(var(--height-input-search_bg) * 1px);
250
263
  color: var(--color-input-text-active);
251
264
  font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
252
265
  font-weight: var(--en-single-f-d-s-fontWeight);
266
+ caret-color: var(--color-input-cursor);
253
267
 
254
268
 
255
269
  &::-webkit-input-placeholder {
@@ -311,13 +325,13 @@
311
325
  &-input {
312
326
  width: 100%;
313
327
  padding: 0;
314
- caret-color: var(--color-input-cursor);
315
328
  background-color: transparent;
316
329
  color: var(--color-input-text-active);
317
330
  font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
318
331
  font-weight: var(--en-single-f-d-s-fontWeight);
319
332
  // margin-inline-start: calc(var(--spacing-input-trade_number_input-margin_left) * 1px);
320
333
  margin-inline-end: calc(var(--spacing-input-trade_number_input-margin_left) * 1px);
334
+ caret-color: var(--color-input-cursor);
321
335
 
322
336
  &::-webkit-input-placeholder {
323
337
  color: var(--color-input-text-default);
@@ -1,55 +1,60 @@
1
1
  <template>
2
2
  <div class="vd-skeleton" :class="{ 'vd-skeleton--animate': animate }">
3
- <div class="vd-skeleton__img" v-if="img"></div>
4
- <div class="vd-skeleton__title" :class="titleClasses" v-if="title"></div>
5
- <div class="vd-skeleton__button" v-if="button"></div>
6
- <div class="vd-skeleton__img--s" v-if="sImg"></div>
7
- <div class="vd-skeleton__avatar" :class="avatarClasses" v-if="avatar"></div>
8
- <div v-if="paragraph || text" class="vd-skeleton__content">
9
- <div class="vd-skeleton__text" v-if="text"></div>
10
- <template v-if="paragraph">
11
- <div class="vd-skeleton__paragraph" v-for="item in rows" :key="item" :class="{
12
- 'is-last': item === rows && rows > 1,
13
- }">
14
- </div>
15
- </template>
16
- </div>
17
- <div class="vd-skeleton__stock" v-if="stock">
18
- <div class="vd-skeleton__stock--left">
19
- <span class="vd-skeleton__stock--data"></span>
20
- <span class="vd-skeleton__stock--subdatax"></span>
3
+ <template v-if="loading">
4
+ <div class="vd-skeleton__img" v-if="img"></div>
5
+ <div class="vd-skeleton__title" :class="titleClasses" v-if="title"></div>
6
+ <div class="vd-skeleton__button" v-if="button"></div>
7
+ <div class="vd-skeleton__img--s" v-if="sImg"></div>
8
+ <div class="vd-skeleton__avatar" :class="avatarClasses" v-if="avatar"></div>
9
+ <div v-if="paragraph || text" class="vd-skeleton__content">
10
+ <div class="vd-skeleton__text" v-if="text"></div>
11
+ <template v-if="paragraph">
12
+ <div class="vd-skeleton__paragraph" v-for="item in rows" :key="item" :class="{
13
+ 'is-last': item === rows && rows > 1,
14
+ }">
15
+ </div>
16
+ </template>
21
17
  </div>
22
- <div class="vd-skeleton--space">
23
- <div class="vd-skeleton__stock--center"></div>
24
- <div class="vd-skeleton__stock--right spacing">
25
- <span class="vd-skeleton__stock--title"></span>
26
- <span class="vd-skeleton__stock--text"></span>
18
+ <div class="vd-skeleton__stock" v-if="stock">
19
+ <div class="vd-skeleton__stock--left">
20
+ <span class="vd-skeleton__stock--data"></span>
21
+ <span class="vd-skeleton__stock--subdatax"></span>
27
22
  </div>
28
- </div>
29
- </div>
30
- <div class="vd-skeleton__stock" v-if="data">
31
- <div class="vd-skeleton__stock--left">
32
- <span class="vd-skeleton__stock--data"></span>
33
- <span class="vd-skeleton__stock--subdatal"></span>
34
- </div>
35
- <div class="vd-skeleton--space">
36
- <div class="vd-skeleton__stock--right">
37
- <span class="vd-skeleton__stock--title"></span>
38
- <span class="vd-skeleton__stock--text"></span>
23
+ <div class="vd-skeleton--space">
24
+ <div class="vd-skeleton__stock--center"></div>
25
+ <div class="vd-skeleton__stock--right spacing">
26
+ <span class="vd-skeleton__stock--title"></span>
27
+ <span class="vd-skeleton__stock--text"></span>
28
+ </div>
39
29
  </div>
40
- <div class="vd-skeleton__stock--right">
41
- <span class="vd-skeleton__stock--title"></span>
42
- <span class="vd-skeleton__stock--text"></span>
30
+ </div>
31
+ <div class="vd-skeleton__stock" v-if="data">
32
+ <div class="vd-skeleton__stock--left">
33
+ <span class="vd-skeleton__stock--data"></span>
34
+ <span class="vd-skeleton__stock--subdatal"></span>
43
35
  </div>
44
- <div class="vd-skeleton__stock--right">
45
- <span class="vd-skeleton__stock--title"></span>
46
- <span class="vd-skeleton__stock--text"></span>
36
+ <div class="vd-skeleton--space">
37
+ <div class="vd-skeleton__stock--right">
38
+ <span class="vd-skeleton__stock--title"></span>
39
+ <span class="vd-skeleton__stock--text"></span>
40
+ </div>
41
+ <div class="vd-skeleton__stock--right">
42
+ <span class="vd-skeleton__stock--title"></span>
43
+ <span class="vd-skeleton__stock--text"></span>
44
+ </div>
45
+ <div class="vd-skeleton__stock--right">
46
+ <span class="vd-skeleton__stock--title"></span>
47
+ <span class="vd-skeleton__stock--text"></span>
48
+ </div>
47
49
  </div>
48
50
  </div>
49
- </div>
50
- <div class="vd-skeleton__equally" v-if="equally">
51
- <div class="vd-skeleton__img" v-for="item in equallys" :key="item" :style="{ height: height + 'px' }"></div>
52
- </div>
51
+ <div class="vd-skeleton__equally" v-if="equally">
52
+ <div class="vd-skeleton__img" v-for="item in equallys" :key="item" :style="{ height: height + 'px' }"></div>
53
+ </div>
54
+ </template>
55
+ <template v-else>
56
+ <slot></slot>
57
+ </template>
53
58
  </div>
54
59
  </template>
55
60
 
@@ -110,8 +115,11 @@ export default {
110
115
  avatarSize: {
111
116
  type: String,
112
117
  default: 's'
113
-
114
- }
118
+ },
119
+ loading: {
120
+ type: Boolean,
121
+ default: true
122
+ },
115
123
  },
116
124
  computed: {
117
125
  titleClasses() {
@@ -24,7 +24,7 @@ const prefixCls = "vd-tabs";
24
24
  export default {
25
25
  name: "vd-tabs",
26
26
  props: {
27
- value: [String, Number, Boolean],
27
+ value: [String, Number],
28
28
  tabsType: {
29
29
  type: String,
30
30
  default: "primary",
@@ -102,36 +102,24 @@ export default {
102
102
  this.$emit('menu-click');
103
103
  },
104
104
  tabClasses(item) {
105
- let active = "";
106
- const tabsType = this.tabsType;
107
- const tabsBaseClass = `${prefixCls}-${tabsType}`;
108
-
109
- if (item.name === this.currentValue) {
110
- active = `${prefixCls}-${tabsType}-active`;
111
- }
112
-
113
- return [tabsBaseClass, active];
105
+ return {
106
+ [`${prefixCls}-${this.tabsType}`]: true,
107
+ [`${prefixCls}-${this.tabsType}-active`]: item.name === this.currentValue
108
+ };
114
109
  },
115
110
  getTabs() {
116
111
  return this.$children.filter((item) => item.$options.name === "vd-tab");
117
112
  },
113
+
118
114
  updateNav() {
119
- this.navList = [];
120
- this.getTabs().forEach((pane, index) => {
121
- this.navList.push({
122
- title: pane.title,
123
- name: pane.name || index,
124
- arrow: pane.arrow,
125
- });
126
- if (!pane.name) {
127
- pane.name = index;
128
- }
129
- if (index == 0) {
130
- if (!this.currentValue) {
131
- this.currentValue = pane.name || index;
132
- }
133
- }
134
- });
115
+ this.navList = this.getTabs().map((pane, index) => ({
116
+ title: pane.title,
117
+ name: pane.name || index,
118
+ arrow: pane.arrow
119
+ }));
120
+ if (!this.currentValue) {
121
+ this.currentValue = this.navList[0].name;
122
+ }
135
123
  this.updateStatus();
136
124
  },
137
125
  updateStatus() {
@@ -152,19 +140,7 @@ export default {
152
140
  name: name
153
141
  };
154
142
  this.$emit('change', eventData);
155
-
156
- const container = this.$refs.tabsContainer;
157
- const selectedTab = container.children[index];
158
- if (selectedTab) {
159
- const containerWidth = container.offsetWidth;
160
- const tabWidth = selectedTab.offsetWidth;
161
- const tabOffsetLeft = selectedTab.offsetLeft;
162
- const scrollLeft = tabOffsetLeft - (containerWidth - tabWidth) / 2;
163
- container.scrollTo({
164
- left: scrollLeft,
165
- behavior: "smooth",
166
- });
167
- }
143
+ this.adjustTabPosition(index);
168
144
  }
169
145
  const eventData = {
170
146
  index: index,
@@ -173,6 +149,17 @@ export default {
173
149
  };
174
150
  this.$emit("click", eventData);
175
151
  },
152
+ adjustTabPosition(index) {
153
+ const container = this.$refs.tabsContainer;
154
+ const selectedTab = container.children[index];
155
+ if (selectedTab) {
156
+ const containerWidth = container.offsetWidth;
157
+ const tabWidth = selectedTab.offsetWidth;
158
+ const tabOffsetLeft = selectedTab.offsetLeft;
159
+ const scrollLeft = tabOffsetLeft - (containerWidth - tabWidth) / 2;
160
+ container.scrollTo({ left: scrollLeft, behavior: "smooth" });
161
+ }
162
+ },
176
163
  },
177
164
  mounted() {
178
165
  // 在组件挂载后更新标签
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="getCls()">
2
+ <div :class="getCls">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -29,21 +29,21 @@
29
29
  this.updateNav()
30
30
  }
31
31
  },
32
+ computed: {
33
+ getCls() {
34
+ return [
35
+ 'vd-tab',
36
+ {'vd-tab-active': this.show}
37
+ ];
38
+ }
39
+ },
32
40
  mounted () {
33
41
  this.updateNav()
34
42
  },
35
43
  methods: {
36
- updateNav () {
37
- this.$parent.updateNav()
38
- },
39
- getCls () {
40
- return [
41
- 'vd-tab',
42
- {
43
- 'vd-tab-active': this.show
44
- }
45
- ]
46
- }
44
+ updateNav () {
45
+ this.$parent.updateNav()
46
+ },
47
47
  }
48
48
  }
49
49
  </script>
package/dist/locale/ar.js CHANGED
@@ -56,7 +56,7 @@ export default {
56
56
  text: "فاتورة غير مدفوعة"
57
57
  },
58
58
  empty: {
59
- text: "لايوجد بيانات"
59
+ description: "لايوجد بيانات"
60
60
  },
61
61
  result: {
62
62
  text: "يستخدم هذا النوع بشكل أساسي في النوافذ المنبثقة الأساسية للتنبيه",
package/dist/locale/en.js CHANGED
@@ -56,7 +56,7 @@ export default {
56
56
  text: "tab"
57
57
  },
58
58
  empty: {
59
- text: "no data"
59
+ description: "no data"
60
60
  },
61
61
  result: {
62
62
  text: "This is a type mainly used for basic alert pop-ups.",
package/dist/locale/zh.js CHANGED
@@ -56,7 +56,7 @@ export default {
56
56
  text: "选项卡"
57
57
  },
58
58
  empty: {
59
- text: "无数据"
59
+ description: "无数据"
60
60
  },
61
61
  result: {
62
62
  text: "这是一种主要用于基本警报弹出窗口的类型",