vdesign-ui 0.1.24 → 0.2.0

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.
Files changed (76) hide show
  1. package/dist/components/activityviews/index.vue +14 -12
  2. package/dist/components/button/index.vue +1 -1
  3. package/dist/components/checkbox/checkbox-group/index.vue +2 -1
  4. package/dist/components/checkbox/index.vue +19 -20
  5. package/dist/components/dialog/index.vue +15 -11
  6. package/dist/components/dropdown/index.vue +43 -31
  7. package/dist/components/empty/404-dark.png +0 -0
  8. package/dist/components/empty/404.png +0 -0
  9. package/dist/components/empty/index.vue +30 -2
  10. package/dist/components/empty/network-dark.png +0 -0
  11. package/dist/components/empty/network.png +0 -0
  12. package/dist/components/empty/nocoupons-dark.png +0 -0
  13. package/dist/components/empty/nocoupons.png +0 -0
  14. package/dist/components/empty/nodata-dark.png +0 -0
  15. package/dist/components/empty/nodata.png +0 -0
  16. package/dist/components/empty/nomargin-dark.png +0 -0
  17. package/dist/components/empty/nomargin.png +0 -0
  18. package/dist/components/empty/nonotice-dark.png +0 -0
  19. package/dist/components/empty/nonotice.png +0 -0
  20. package/dist/components/empty/noocomments-dark.png +0 -0
  21. package/dist/components/empty/noocomments.png +0 -0
  22. package/dist/components/empty/noorders-dark.png +0 -0
  23. package/dist/components/empty/noorders.png +0 -0
  24. package/dist/components/empty/noposition-dark.png +0 -0
  25. package/dist/components/empty/noposition.png +0 -0
  26. package/dist/components/empty/nosearch-dark.png +0 -0
  27. package/dist/components/empty/nosearch.png +0 -0
  28. package/dist/components/empty/style.less +4 -0
  29. package/dist/components/footer/index.vue +5 -1
  30. package/dist/components/footnav/footnav-item/index.vue +11 -42
  31. package/dist/components/footnav/index.vue +29 -33
  32. package/dist/components/headnav/index.vue +55 -37
  33. package/dist/components/headnav/style.less +0 -9
  34. package/dist/components/icon/font/iconfont.css +62 -952
  35. package/dist/components/icon/font/iconfont.js +5 -1
  36. package/dist/components/icon/index.vue +26 -18
  37. package/dist/components/input/calcTextareaHeight.js +36 -140
  38. package/dist/components/input/index.vue +107 -109
  39. package/dist/components/input/search/index.vue +18 -22
  40. package/dist/components/input/stepper/index.vue +32 -26
  41. package/dist/components/input/style.less +20 -33
  42. package/dist/components/list/index.vue +57 -69
  43. package/dist/components/list/style.less +20 -92
  44. package/dist/components/loading/img_status_loading_white_ani.svg +155 -0
  45. package/dist/components/loading/img_status_refresh_ani.svg +158 -0
  46. package/dist/components/loading/index.vue +28 -11
  47. package/dist/components/loading/style.less +1 -1
  48. package/dist/components/mixins/clickoutside.js +81 -81
  49. package/dist/components/mixins/outlineConfigPlugin.js +11 -6
  50. package/dist/components/noticebar/index.vue +9 -4
  51. package/dist/components/pagebreak/index.vue +21 -14
  52. package/dist/components/radio/index.vue +164 -135
  53. package/dist/components/radio/radio-group/index.vue +40 -52
  54. package/dist/components/result/index.vue +1 -2
  55. package/dist/components/selector/index.vue +49 -31
  56. package/dist/components/selector/style.less +14 -0
  57. package/dist/components/step-item/index.vue +2 -2
  58. package/dist/components/tabs/index.vue +55 -32
  59. package/dist/components/tabs/tab/index.vue +13 -16
  60. package/dist/components/tag/index.vue +18 -4
  61. package/dist/components/tag/style.less +2 -2
  62. package/dist/components/title/index.vue +11 -8
  63. package/dist/components/title/style.less +6 -0
  64. package/dist/img/img_status_loading_white_ani.b56fcfae.svg +155 -0
  65. package/dist/img/img_status_refresh_ani.d0e59f12.svg +158 -0
  66. package/dist/token.css +8 -0
  67. package/dist/vdesign-ui.common.js +1481 -1354
  68. package/dist/vdesign-ui.css +1 -1
  69. package/dist/vdesign-ui.umd.js +1481 -1354
  70. package/dist/vdesign-ui.umd.min.js +3 -3
  71. package/package.json +1 -1
  72. package/dist/components/loading/loading.png +0 -0
  73. package/dist/components/loading/refresh.png +0 -0
  74. package/dist/img/404-dark.775df5bb.png +0 -0
  75. package/dist/img/network-dark.11a147bb.png +0 -0
  76. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
@@ -9,6 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
+ import { inBrowser } from '@p/utils/env'
12
13
  export default {
13
14
  name: 'vd-foot-nav',
14
15
  props: {
@@ -21,20 +22,23 @@ export default {
21
22
  type: Boolean,
22
23
  default: true
23
24
  },
24
- zIndex: [Number, String],
25
+ zIndex: {
26
+ type: [Number, String],
27
+ default: 1,
28
+ },
25
29
  safeAreaInsetBottom: {
26
30
  type: Boolean,
27
31
  default: null,
28
32
  },
29
33
  placeholder: Boolean,
34
+ beforeChange: {
35
+ type: Function,
36
+ default: null,
37
+ },
30
38
  },
31
39
  computed: {
32
40
  fit() {
33
- if (this.safeAreaInsetBottom !== null) {
34
- return this.safeAreaInsetBottom;
35
- }
36
- // enable safe-area-inset-bottom by default when fixed
37
- return this.fixed;
41
+ return this.safeAreaInsetBottom !== null ? this.safeAreaInsetBottom : this.fixed;
38
42
  },
39
43
  style() {
40
44
  return {
@@ -44,48 +48,40 @@ export default {
44
48
  },
45
49
  data() {
46
50
  return {
47
- // active: 0,
48
- items: [],
49
- height: null,
51
+ height: 0,
50
52
  }
51
53
  },
52
54
  watch: {
53
- items() {
54
- this.setActiveItem();
55
- },
56
-
57
- value() {
58
- this.setActiveItem();
59
- }
60
55
  },
61
56
  methods: {
62
- setActiveItem() {
63
- this.items.forEach((item, index) => {
64
- item.active = index === this.value;
65
- });
66
- },
57
+ async onChange(active) {
58
+ // 处理 before-change 回调,允许用户决定是否切换
59
+ if (this.beforeChange) {
60
+ const canChange = await this.beforeChange(active);
61
+ if (!canChange) return;
62
+ }
67
63
 
68
- onChange(active) {
69
64
  if (active !== this.value) {
70
65
  this.$emit('input', active);
71
66
  this.$emit('change', active);
72
67
  }
73
68
  },
74
- // updateActive(index) {
75
- // this.active = index;
76
- // },
77
- // handleClick() {
78
- // this.$emit('click',this.active)
79
- // }
69
+ setHeight() {
70
+ if (this.$refs.footNav) {
71
+ this.height = this.$refs.footNav.getBoundingClientRect().height;
72
+ }
73
+ },
80
74
  },
81
75
  mounted() {
82
- if (this.placeholder && this.fixed) {
83
- const setHeight = () => {
84
- this.height = this.$refs.footNav.getBoundingClientRect().height;
76
+ if (inBrowser && this.placeholder && this.fixed) {
77
+ this.setHeight();
78
+ const resizeHandler = () => {
79
+ requestAnimationFrame(this.setHeight); // 使用 requestAnimationFrame 优化性能
85
80
  };
86
81
 
87
- setHeight();
88
- setTimeout(setHeight, 100);
82
+ // setHeight();
83
+ window.addEventListener('resize', resizeHandler);
84
+ this.$once('hook:beforeDestroy', () => window.removeEventListener('resize', resizeHandler));
89
85
  }
90
86
  }
91
87
 
@@ -1,62 +1,73 @@
1
1
  <template>
2
2
  <div class="vd-head-nav--placeholder" :style="{height:height + 'px'}">
3
3
  <div class="vd-head-nav" :class="wrapClasses" :style="{zIndex:zIndex}" ref="headNav">
4
-
5
4
  <div v-if="showLeftSection" class="vd-head-nav--left">
6
-
5
+ <!-- 左一icon -->
7
6
  <span v-if="showSidebar" class="vd-head-nav__icon">
8
7
  <slot name="left-primary">
9
8
  <vd-icon name="icon_nav_sidebar"></vd-icon>
10
9
  </slot>
11
10
  </span>
12
-
11
+ <!-- 左二icon -->
13
12
  <span v-if="$slots['left-secondary']" class="vd-head-nav__icon">
14
13
  <slot name="left-secondary"></slot>
15
14
  </span>
15
+
16
+ <!-- hno类型下的 左对齐文本-->
16
17
  <span v-if="leftTitle" class="vd-head-nav__left-title">{{ leftTitle }}</span>
18
+ <!-- hno类型下的 编辑文本 -->
17
19
  <span v-if="editLeftText" class="vd-head-nav__edit-left-text">{{ editLeftText }}</span>
18
20
  </div>
19
21
 
20
22
  <div v-if="showContentSection" class="vd-head-nav__content" :class="contentClasses">
23
+ <!-- 标题选择器 -->
21
24
  <div v-if="$slots.selector" class="vd-head-nav__content--selector">
22
25
  <slot name="selector"></slot>
23
26
  </div>
24
-
27
+ <!-- 标题 -->
25
28
  <span v-if="title" class="vd-head-nav__title vd-ellipsis" :class="titleClasses">{{ title }}</span>
29
+ <!-- hno 副标题 -->
26
30
  <span v-if="description" class="vd-head-nav__description">{{ description }}</span>
27
31
 
32
+ <!-- hno 股票价格 -->
28
33
  <span class="vd-head-nav__stock" :class="stockColor" v-if="colors">
34
+ <!-- 股票开市状态 -->
29
35
  <slot name="state"></slot>
30
36
  <span class="vd-head-nav__price--price">{{ price }}</span>
31
37
  <span class="vd-head-nav__price--chgp">{{ chgp }}</span>
32
38
  <span class="vd-head-nav__price--chg">{{ chg }}</span>
33
39
  </span>
34
40
 
41
+ <!-- hno title 账户类型选择器 -->
35
42
  <slot name="selector-bottom"></slot>
36
-
43
+ <!-- hno 账户类型选择器结果 -->
37
44
  <span v-if="accountIcon || accountType" class="vd-head-nav__icontype">
38
- <vd-icon svg :name="accountIcon" class="vd-head-nav__account-type--icon"></vd-icon>
45
+ <vd-icon :name="accountIcon" class="vd-head-nav__account-type--icon"></vd-icon>
39
46
  <span class="vd-head-nav__account-type">{{ accountType }}</span>
40
47
  </span>
41
48
  </div>
42
49
 
43
50
  <div class="vd-head-nav--right" v-if="showRightSection">
51
+ <!-- 右二icon -->
44
52
  <span v-if="rightSecondary || $slots['right-secondary']" class="vd-head-nav__icon">
45
53
  <slot name="right-secondary">
46
54
  <vd-icon name="icon_nav_search" style="transform: scale(1);"></vd-icon>
47
55
  </slot>
48
56
  </span>
49
-
57
+ <!-- 右一icon -->
50
58
  <span v-if="rightPrimary || $slots['right-primary']" class="vd-head-nav__icon">
51
59
  <slot name="right-primary">
52
60
  <vd-icon name="icon_nav_trade" style="transform: scale(1);"></vd-icon>
53
61
  </slot>
54
62
  </span>
55
63
 
64
+ <!-- hno-编辑右侧文字 -->
56
65
  <span class="vd-head-nav__edit-right-text" v-if="editRightText">{{ editRightText }}</span>
66
+ <!-- hno-账户类型右侧文字 -->
57
67
  <span class="vd-head-nav__account-text" v-if="accountText">{{ accountText }}</span>
58
68
  </div>
59
69
 
70
+ <!-- 股票开市状态 -->
60
71
  <div class="vd-head-nav__info" v-if="$slots['stock-time'] || time">
61
72
  <slot name="stock-time"></slot>
62
73
  <span v-if="time" class="vd-head-nav__time">{{ time }}</span>
@@ -66,33 +77,33 @@
66
77
  </template>
67
78
 
68
79
  <script>
69
-
80
+ import { inBrowser } from '@p/utils/env'
70
81
  const prefixCls = 'vd-head-nav';
71
82
  export default {
72
83
  name: 'vd-head-nav',
73
84
  props: {
74
- title: String,
75
- time: String,
76
- type: String,
77
- leftPrimary: Boolean,
78
- rightPrimary: Boolean,
79
- rightSecondary: Boolean,
80
- start: Boolean,
81
- description: String,
82
- price: String,
83
- chg: String,
84
- chgp: String,
85
- colors: String,
86
- leftTitle: String,
87
- editLeftText: String,
88
- editRightText: String,
89
- accountText: String,
90
- accountType: String,
91
- accountIcon: String,
92
- fixed: Boolean,
93
- zIndex: [Number, String],
94
- safeAreaInsetTop: Boolean,
95
- placeholder: Boolean,
85
+ title: String, // 标题
86
+ time: String, // 标题下面的股票开市时间
87
+ type: String, // 默认hnp 设置normal为hno
88
+ leftPrimary: Boolean, // 左侧边栏图标,左一,有默认图标icon_nav_sidebar,也可以是同名slot
89
+ rightPrimary: Boolean, // 右侧边栏图标,右一,有默认图标icon_nav_search,也可以是同名slot
90
+ rightSecondary: Boolean, // 右侧边栏图标,右二,有默认图标icon_nav_trade,也可以是同名slot
91
+ start: Boolean, // hno类型下的,居左对齐
92
+ description: String, // 标题下面的描述文字
93
+ price: String, // 股票价格
94
+ chgp: String, // 股票涨跌百分比 如:+0.01%
95
+ chg: String, // 股票涨跌,如:+0.01
96
+ colors: String, // 股票涨跌颜色,默认rise,可选值fall,rise为涨,fall为跌
97
+ leftTitle: String, // hno类型下的,左侧边栏文字,字号大一些
98
+ editLeftText: String, // hno类型下的,编辑左边栏文字
99
+ editRightText: String, // hno类型下的,编辑右边栏文字
100
+ accountText: String, // 账户类型右侧边栏文字
101
+ accountType: String, // 账户类型文本
102
+ accountIcon: String, // 账户类型图标
103
+ fixed: Boolean, // 固定在顶部
104
+ zIndex: [Number, String], // 固定在顶部时,设置z-index
105
+ safeAreaInsetTop: Boolean, // 固定在顶部时,是否使用安全区域
106
+ placeholder: Boolean, // 是否使用占位,用于固定在顶部时,占位高度
96
107
  },
97
108
  data() {
98
109
  return {
@@ -139,20 +150,27 @@ export default {
139
150
  return this.showSidebar || this.$slots['left-secondary'] || this.leftTitle || this.editLeftText;
140
151
  },
141
152
  showContentSection() {
142
- return this.title || this.$slots.selector || this.$slots['selector-bottom'] || this.account || this.colors;
153
+ return this.title || this.description || this.$slots.selector || this.$slots['selector-bottom'] || this.accountIcon || this.accountType || this.colors;
143
154
  },
144
155
  showRightSection() {
145
156
  return this.rightPrimary || this.$slots['right-primary'] || this.rightSecondary || this.$slots['right-secondary'] || this.editRightText || this.accountText;
146
157
  }
147
158
  },
148
- mounted() {
149
- if (this.placeholder && this.fixed) {
150
- const setHeight = () => {
159
+ methods: {
160
+ setHeight() {
161
+ if (this.$refs.headNav) {
151
162
  this.height = this.$refs.headNav.getBoundingClientRect().height;
163
+ }
164
+ },
165
+ },
166
+ mounted() {
167
+ if (inBrowser && this.placeholder && this.fixed) {
168
+ this.setHeight();
169
+ const resizeHandler = () => {
170
+ requestAnimationFrame(this.setHeight); // 使用 requestAnimationFrame 优化性能
152
171
  };
153
-
154
- setHeight();
155
- setTimeout(setHeight, 100);
172
+ window.addEventListener('resize', resizeHandler);
173
+ this.$once('hook:beforeDestroy', () => window.removeEventListener('resize', resizeHandler));
156
174
  }
157
175
  },
158
176
  }
@@ -164,15 +164,6 @@
164
164
  color: var(--color-headnav-icon);
165
165
  }
166
166
  }
167
-
168
- // &__space--end {
169
- // margin-inline-end: calc(var(--spacing-headnav-icon-margin_left) * 1px);
170
- // }
171
-
172
- // &__space--start {
173
- // margin-inline-start: calc(var(--spacing-headnav-icon-margin_left) * 1px);
174
- // }
175
-
176
167
  &__time {
177
168
  margin-inline-start: calc(var(--spacing-headnav-primary-text-margin_right) * 1px);
178
169
  font-size: calc(var(--en-single-f-a-r-fontSize) * 1px);