vdesign-ui 0.1.24 → 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.
Files changed (71) 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/footer/index.vue +5 -1
  29. package/dist/components/footnav/footnav-item/index.vue +11 -42
  30. package/dist/components/footnav/index.vue +13 -27
  31. package/dist/components/headnav/index.vue +52 -35
  32. package/dist/components/icon/font/iconfont.css +62 -952
  33. package/dist/components/icon/font/iconfont.js +1 -1
  34. package/dist/components/icon/index.vue +26 -18
  35. package/dist/components/input/index.vue +107 -109
  36. package/dist/components/input/search/index.vue +18 -22
  37. package/dist/components/input/stepper/index.vue +32 -26
  38. package/dist/components/input/style.less +20 -33
  39. package/dist/components/list/index.vue +57 -69
  40. package/dist/components/list/style.less +20 -92
  41. package/dist/components/loading/img_status_loading_white_ani.svg +155 -0
  42. package/dist/components/loading/img_status_refresh_ani.svg +158 -0
  43. package/dist/components/loading/index.vue +21 -11
  44. package/dist/components/loading/style.less +1 -1
  45. package/dist/components/mixins/clickoutside.js +81 -81
  46. package/dist/components/pagebreak/index.vue +21 -14
  47. package/dist/components/radio/index.vue +164 -135
  48. package/dist/components/radio/radio-group/index.vue +40 -52
  49. package/dist/components/result/index.vue +1 -2
  50. package/dist/components/selector/index.vue +49 -31
  51. package/dist/components/selector/style.less +14 -0
  52. package/dist/components/step-item/index.vue +2 -2
  53. package/dist/components/tabs/index.vue +55 -32
  54. package/dist/components/tabs/tab/index.vue +13 -16
  55. package/dist/components/tag/index.vue +18 -4
  56. package/dist/components/tag/style.less +2 -2
  57. package/dist/components/title/index.vue +11 -8
  58. package/dist/components/title/style.less +6 -0
  59. package/dist/img/img_status_loading_white_ani.b56fcfae.svg +155 -0
  60. package/dist/img/img_status_refresh_ani.d0e59f12.svg +158 -0
  61. package/dist/token.css +8 -0
  62. package/dist/vdesign-ui.common.js +1362 -1170
  63. package/dist/vdesign-ui.css +1 -1
  64. package/dist/vdesign-ui.umd.js +1362 -1170
  65. package/dist/vdesign-ui.umd.min.js +3 -3
  66. package/package.json +1 -1
  67. package/dist/components/loading/loading.png +0 -0
  68. package/dist/components/loading/refresh.png +0 -0
  69. package/dist/img/404-dark.775df5bb.png +0 -0
  70. package/dist/img/network-dark.11a147bb.png +0 -0
  71. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
@@ -0,0 +1,158 @@
1
+ <svg
2
+ fill="none"
3
+ width='100%'
4
+ height='100%'
5
+ viewBox="0 0 32 32"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ xmlns:xlink="http://www.w3.org/1999/xlink"
8
+ >
9
+ <defs>
10
+ <style type="text/css">
11
+ <![CDATA[
12
+ @keyframes refresh-animate1 {
13
+ 0% {
14
+ fill-opacity: 1;
15
+ }
16
+ 16.67% {
17
+ fill-opacity: 0.16;
18
+ }
19
+ 50% {
20
+ fill-opacity: 0.16;
21
+ }
22
+ 83.33% {
23
+ fill-opacity: 0.16;
24
+ }
25
+ 100% {
26
+ fill-opacity: 1;
27
+ }
28
+ }
29
+
30
+ @keyframes refresh-animate2 {
31
+ 0% {
32
+ fill-opacity: 0.16;
33
+ }
34
+ 16.67% {
35
+ fill-opacity: 1;
36
+ }
37
+ 33.33% {
38
+ fill-opacity: 0.16;
39
+ }
40
+ 50% {
41
+ fill-opacity: 0.16;
42
+ }
43
+ 66.67% {
44
+ fill-opacity: 0.16;
45
+ }
46
+ 83.33% {
47
+ fill-opacity: 1;
48
+ }
49
+ 100% {
50
+ fill-opacity: 0.16;
51
+ }
52
+ }
53
+
54
+ @keyframes refresh-animate3 {
55
+ 0% {
56
+ fill-opacity: 0.16;
57
+ }
58
+ 16.67% {
59
+ fill-opacity: 0.16;
60
+ }
61
+ 33.33% {
62
+ fill-opacity: 1;
63
+ }
64
+ 50% {
65
+ fill-opacity: 0.16;
66
+ }
67
+ 66.67% {
68
+ fill-opacity: 1;
69
+ }
70
+ 83.33% {
71
+ fill-opacity: 0.16;
72
+ }
73
+ 100% {
74
+ fill-opacity: 0.16;
75
+ }
76
+ }
77
+
78
+ @keyframes refresh-animate4 {
79
+ 0% {
80
+ fill-opacity: 0.16;
81
+ }
82
+ 33.33% {
83
+ fill-opacity: 0.16;
84
+ }
85
+ 50% {
86
+ fill-opacity: 1;
87
+ }
88
+ 66.67% {
89
+ fill-opacity: 0.16;
90
+ }
91
+ 100% {
92
+ fill-opacity: 0.16;
93
+ }
94
+ }
95
+
96
+ .loading-part-1,
97
+ .loading-part-2,
98
+ .loading-part-3,
99
+ .loading-part-4 {
100
+ animation-duration: 1000ms;
101
+ animation-delay: 0s;
102
+ animation-timing-function: ease-out;
103
+ animation-iteration-count: infinite;
104
+ }
105
+
106
+ .loading-part-1 {
107
+ animation-name: refresh-animate1;
108
+ }
109
+
110
+ .loading-part-2 {
111
+ animation-name: refresh-animate2;
112
+ }
113
+
114
+ .loading-part-3 {
115
+ animation-name: refresh-animate3;
116
+ }
117
+
118
+ .loading-part-4 {
119
+ animation-name: refresh-animate4;
120
+ }
121
+ ]]>
122
+ </style>
123
+ </defs>
124
+ <g>
125
+ <path
126
+ class="loading-part-1"
127
+ fill-rule="evenodd"
128
+ clip-rule="evenodd"
129
+ d="M6 32.0001L9.72003 28.209C9.95076 27.9739 10.0803 27.655 10.0803 27.3225V16.2236L6.36035 20.0147C6.12963 20.2498 6 20.5687 6 20.9012V32.0001Z"
130
+ fill-opacity="0.16"
131
+ fill="#1BC47D"
132
+ />
133
+ <path
134
+ class="loading-part-2"
135
+ fill-rule="evenodd"
136
+ clip-rule="evenodd"
137
+ d="M11.3068 26.559L15.0269 22.768C15.2576 22.5329 15.3872 22.214 15.3872 21.8815V2.71126L11.6672 6.50233C11.4364 6.73746 11.3068 7.05636 11.3068 7.38889V26.559Z"
138
+ fill-opacity="0.16"
139
+ fill="#1BC47D"
140
+ />
141
+ <path
142
+ class="loading-part-3"
143
+ fill-rule="evenodd"
144
+ clip-rule="evenodd"
145
+ d="M16.6255 29.2742L20.3455 25.4832C20.5762 25.248 20.7059 24.9292 20.7059 24.5966V5.42644L16.9858 9.21751C16.7552 9.4526 16.6255 9.77154 16.6255 10.104V29.2742Z"
146
+ fill="#1BC47D"
147
+ fill-opacity="0.16"
148
+ />
149
+ <path
150
+ class="loading-part-4"
151
+ fill-rule="evenodd"
152
+ clip-rule="evenodd"
153
+ d="M21.9196 15.7765L25.6396 11.9854C25.8703 11.7503 26 11.4314 26 11.0989V0L22.2799 3.79107C22.0492 4.02617 21.9196 4.3451 21.9196 4.67759V15.7765Z"
154
+ fill="#1BC47D"
155
+ fill-opacity="0.16"
156
+ />
157
+ </g>
158
+ </svg>
@@ -1,14 +1,15 @@
1
1
  <template>
2
2
  <div class="vd-loading-wrapper">
3
-
4
- <div class="vd-loading" v-if="loading">
3
+ <div v-if="isLoading" class="vd-loading">
5
4
  <slot>
6
- <img src="./loading.png" alt="">
5
+ <img src="./img_status_loading_white_ani.svg" alt="">
7
6
  </slot>
8
7
  <span class="vd-loading__text" v-if="text">{{ text }}</span>
9
8
  </div>
10
9
  <div class="vd-refresh" :class="refreshClasses" v-else>
11
- <img src="./refresh.png" alt="">
10
+ <slot>
11
+ <img src="./img_status_refresh_ani.svg" alt="">
12
+ </slot>
12
13
  </div>
13
14
  </div>
14
15
  </template>
@@ -17,6 +18,10 @@
17
18
  export default {
18
19
  name:'vd-loading',
19
20
  props:{
21
+ type:{
22
+ type: String,
23
+ default:'null',
24
+ },
20
25
  text:{
21
26
  type: String,
22
27
  default:''
@@ -27,17 +32,22 @@ export default {
27
32
  },
28
33
  size:{
29
34
  type: String,
30
- default:'large'
35
+ default:'large',
36
+ validator: value => ['large', 'small'].includes(value)
31
37
  }
32
38
  },
33
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
+ },
34
49
  refreshClasses() {
35
- return [
36
- 'vd-refresh',
37
- {
38
- [`vd-refresh--${this.size}`]:this.size
39
- }
40
- ]
50
+ return ['vd-refresh', `vd-refresh--${this.size}`];
41
51
  }
42
52
  },
43
53
  methods:{
@@ -1,6 +1,6 @@
1
1
 
2
2
  .vd-loading{
3
- position: absolute;
3
+ position: fixed;
4
4
  left: 50%;
5
5
  top: 50%;
6
6
  transform: translate(-50%, -50%);
@@ -1,81 +1,81 @@
1
- import Vue from 'vue';
2
- import { on } from './dom';
3
- // 定义一个空数组 nodeList,用于存储绑定了该指令的元素。
4
- const nodeList = [];
5
- //定义一个常量 ctx,用于标识特殊属性名。
6
- const ctx = '@@clickoutsideContext';
7
- // 定义一个变量 startClick,用于存储点击开始时的事件对象。
8
- let startClick;
9
- // 定义一个变量 seed,用作节点标识的种子。
10
- let seed = 0;
11
- // 在文档上添加一个 mousedown 事件监听器,用于记录点击开始时的事件对象。
12
- !Vue.prototype.$isServer && on(document, 'mousedown', e => (startClick = e));
13
- // 添加一个 mouseup 事件监听器。当鼠标放开时,
14
- !Vue.prototype.$isServer && on(document, 'mouseup', e => {
15
- // 遍历 nodeList 数组中的每个元素,并执行它们的 documentHandler 函数。
16
- nodeList.forEach(node => node[ctx].documentHandler(e, startClick));
17
- });
18
- // 创建一个处理文档点击事件的函数。
19
- // 该函数返回一个闭包函数,用于检查点击事件是否发生在绑定的元素外部,并执行相应的回调函数。
20
- function createDocumentHandler(el, binding, vnode) {
21
- return function (mouseup = {}, mousedown = {}) {
22
- if (!vnode ||
23
- !vnode.context ||
24
- !mouseup.target ||
25
- !mousedown.target ||
26
- el.contains(mouseup.target) ||
27
- el.contains(mousedown.target) ||
28
- el === mouseup.target ||
29
- (vnode.context.popperElm &&
30
- (vnode.context.popperElm.contains(mouseup.target) ||
31
- vnode.context.popperElm.contains(mousedown.target)))) return;
32
-
33
- if (binding.expression &&
34
- el[ctx].methodName &&
35
- vnode.context[el[ctx].methodName]) {
36
- vnode.context[el[ctx].methodName]();
37
- } else {
38
- el[ctx].bindingFn && el[ctx].bindingFn();
39
- }
40
- };
41
- }
42
-
43
- /**
44
- * v-clickoutside
45
- * @desc 点击元素外面才会触发的事件
46
- * @example
47
- * ```vue
48
- * <div v-element-clickoutside="handleClose">
49
- * ```
50
- */
51
- export default {
52
- // 将元素添加到 nodeList 数组中,并为该元素添加一个包含事件处理函数的特殊属性。
53
- bind(el, binding, vnode) {
54
- nodeList.push(el);
55
- const id = seed++;
56
- el[ctx] = {
57
- id,
58
- documentHandler: createDocumentHandler(el, binding, vnode),
59
- methodName: binding.expression,
60
- bindingFn: binding.value
61
- };
62
- },
63
- // 当指令所在组件的 VNode 更新时调用,更新元素的事件处理函数和绑定方法。
64
- update(el, binding, vnode) {
65
- el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
66
- el[ctx].methodName = binding.expression;
67
- el[ctx].bindingFn = binding.value;
68
- },
69
- // 从 nodeList 中移除对应的元素,并删除特殊属性。
70
- unbind(el) {
71
- let len = nodeList.length;
72
-
73
- for (let i = 0; i < len; i++) {
74
- if (nodeList[i][ctx].id === el[ctx].id) {
75
- nodeList.splice(i, 1);
76
- break;
77
- }
78
- }
79
- delete el[ctx];
80
- }
81
- };
1
+ import Vue from 'vue';
2
+ import { on } from './dom';
3
+ // 定义一个空数组 nodeList,用于存储绑定了该指令的元素。
4
+ const nodeList = [];
5
+ //定义一个常量 ctx,用于标识特殊属性名。
6
+ const ctx = '@@clickoutsideContext';
7
+ // 定义一个变量 startClick,用于存储点击开始时的事件对象。
8
+ let startClick;
9
+ // 定义一个变量 seed,用作节点标识的种子。
10
+ let seed = 0;
11
+ // 在文档上添加一个 mousedown 事件监听器,用于记录点击开始时的事件对象。
12
+ !Vue.prototype.$isServer && on(document, 'mousedown', e => (startClick = e));
13
+ // 添加一个 mouseup 事件监听器。当鼠标放开时,
14
+ !Vue.prototype.$isServer && on(document, 'mouseup', e => {
15
+ // 遍历 nodeList 数组中的每个元素,并执行它们的 documentHandler 函数。
16
+ nodeList.forEach(node => node[ctx].documentHandler(e, startClick));
17
+ });
18
+ // 创建一个处理文档点击事件的函数。
19
+ // 该函数返回一个闭包函数,用于检查点击事件是否发生在绑定的元素外部,并执行相应的回调函数。
20
+ function createDocumentHandler(el, binding, vnode) {
21
+ return function (mouseup = {}, mousedown = {}) {
22
+ if (!vnode ||
23
+ !vnode.context ||
24
+ !mouseup.target ||
25
+ !mousedown.target ||
26
+ el.contains(mouseup.target) ||
27
+ el.contains(mousedown.target) ||
28
+ el === mouseup.target ||
29
+ (vnode.context.popperElm &&
30
+ (vnode.context.popperElm.contains(mouseup.target) ||
31
+ vnode.context.popperElm.contains(mousedown.target)))) return;
32
+
33
+ if (binding.expression &&
34
+ el[ctx].methodName &&
35
+ vnode.context[el[ctx].methodName]) {
36
+ vnode.context[el[ctx].methodName](mouseup.target);
37
+ } else {
38
+ el[ctx].bindingFn && el[ctx].bindingFn();
39
+ }
40
+ };
41
+ }
42
+
43
+ /**
44
+ * v-clickoutside
45
+ * @desc 点击元素外面才会触发的事件
46
+ * @example
47
+ * ```vue
48
+ * <div v-element-clickoutside="handleClose">
49
+ * ```
50
+ */
51
+ export default {
52
+ // 将元素添加到 nodeList 数组中,并为该元素添加一个包含事件处理函数的特殊属性。
53
+ bind(el, binding, vnode) {
54
+ nodeList.push(el);
55
+ const id = seed++;
56
+ el[ctx] = {
57
+ id,
58
+ documentHandler: createDocumentHandler(el, binding, vnode),
59
+ methodName: binding.expression,
60
+ bindingFn: binding.value
61
+ };
62
+ },
63
+ // 当指令所在组件的 VNode 更新时调用,更新元素的事件处理函数和绑定方法。
64
+ update(el, binding, vnode) {
65
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
66
+ el[ctx].methodName = binding.expression;
67
+ el[ctx].bindingFn = binding.value;
68
+ },
69
+ // 从 nodeList 中移除对应的元素,并删除特殊属性。
70
+ unbind(el) {
71
+ let len = nodeList.length;
72
+
73
+ for (let i = 0; i < len; i++) {
74
+ if (nodeList[i][ctx].id === el[ctx].id) {
75
+ nodeList.splice(i, 1);
76
+ break;
77
+ }
78
+ }
79
+ delete el[ctx];
80
+ }
81
+ };
@@ -1,14 +1,14 @@
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" v-else>
11
- <span class="vd-page-break__number--active" v-html="number"></span>
10
+ <div class="vd-page-break__number" v-else-if="drop === 'dropnum'">
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>
14
14
  </div>
@@ -19,36 +19,43 @@
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
- drop: {
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
+ number: {
39
+ type: Number,
40
+ default: 1
41
+ },
42
+
38
43
  },
39
44
  data() {
40
45
  return {
41
- currentPage: 1,
46
+ currentPage: this.activePage // 从外部传入的值初始化,
42
47
  }
43
48
  },
44
- computed: {
45
-
49
+ watch: {
50
+ activePage(newVal) {
51
+ this.currentPage = newVal; // 外部传入值变化时更新当前页
52
+ }
46
53
  },
47
54
  methods: {
48
55
  changePage(pageNumber) {
49
56
  if (pageNumber >= 1 && pageNumber <= this.totalPages) {
50
57
  this.currentPage = pageNumber;
51
- this.$emit('page-changed', pageNumber);
58
+ this.$emit('change', pageNumber);
52
59
  }
53
60
  },
54
61
  },