vdesign-ui 0.2.4 → 0.2.6

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 (195) hide show
  1. package/package.json +1 -1
  2. package/dist/components/actionbar/index.js +0 -8
  3. package/dist/components/actionbar/index.vue +0 -39
  4. package/dist/components/actionbar/style.less +0 -44
  5. package/dist/components/actionbar-cell/index.js +0 -7
  6. package/dist/components/actionbar-cell/index.vue +0 -38
  7. package/dist/components/actions/index.js +0 -7
  8. package/dist/components/actions/index.vue +0 -76
  9. package/dist/components/actions/style.less +0 -109
  10. package/dist/components/actions-cell/index.js +0 -7
  11. package/dist/components/actions-cell/index.vue +0 -94
  12. package/dist/components/actions-cell/style.less +0 -39
  13. package/dist/components/activityviews/index.js +0 -8
  14. package/dist/components/activityviews/index.vue +0 -192
  15. package/dist/components/activityviews/style.less +0 -152
  16. package/dist/components/badge/index.js +0 -8
  17. package/dist/components/badge/index.vue +0 -49
  18. package/dist/components/badge/style.less +0 -54
  19. package/dist/components/button/index.js +0 -8
  20. package/dist/components/button/index.vue +0 -93
  21. package/dist/components/button/style.less +0 -558
  22. package/dist/components/calendar/end.png +0 -0
  23. package/dist/components/calendar/index-element.vue +0 -84
  24. package/dist/components/calendar/index.js +0 -8
  25. package/dist/components/calendar/index.vue +0 -52
  26. package/dist/components/calendar/start.png +0 -0
  27. package/dist/components/calendar/style.less +0 -138
  28. package/dist/components/checkbox/index.js +0 -8
  29. package/dist/components/checkbox/index.vue +0 -161
  30. package/dist/components/checkbox/style.less +0 -289
  31. package/dist/components/checkbox-group/index.js +0 -7
  32. package/dist/components/checkbox-group/index.vue +0 -69
  33. package/dist/components/common/state/index.vue +0 -33
  34. package/dist/components/common/state/style.less +0 -48
  35. package/dist/components/data-list/index.js +0 -10
  36. package/dist/components/data-list/index.vue +0 -19
  37. package/dist/components/data-list/style.less +0 -623
  38. package/dist/components/datetime-picker/index.js +0 -8
  39. package/dist/components/datetime-picker/index.vue +0 -37
  40. package/dist/components/datetime-picker/style.less +0 -24
  41. package/dist/components/dialog/index.js +0 -8
  42. package/dist/components/dialog/index.vue +0 -174
  43. package/dist/components/dialog/overlay-manager.js +0 -18
  44. package/dist/components/dialog/style.less +0 -128
  45. package/dist/components/divider/index.js +0 -8
  46. package/dist/components/divider/index.vue +0 -54
  47. package/dist/components/divider/style.less +0 -92
  48. package/dist/components/dropdown/index.js +0 -8
  49. package/dist/components/dropdown/index.vue +0 -218
  50. package/dist/components/dropdown/style.less +0 -432
  51. package/dist/components/empty/404-dark.png +0 -0
  52. package/dist/components/empty/404.png +0 -0
  53. package/dist/components/empty/index.js +0 -8
  54. package/dist/components/empty/index.vue +0 -138
  55. package/dist/components/empty/network-dark.png +0 -0
  56. package/dist/components/empty/network.png +0 -0
  57. package/dist/components/empty/nocoupons-dark.png +0 -0
  58. package/dist/components/empty/nocoupons.png +0 -0
  59. package/dist/components/empty/nodata-dark.png +0 -0
  60. package/dist/components/empty/nodata.png +0 -0
  61. package/dist/components/empty/nomargin-dark.png +0 -0
  62. package/dist/components/empty/nomargin.png +0 -0
  63. package/dist/components/empty/nonotice-dark.png +0 -0
  64. package/dist/components/empty/nonotice.png +0 -0
  65. package/dist/components/empty/noocomments-dark.png +0 -0
  66. package/dist/components/empty/noocomments.png +0 -0
  67. package/dist/components/empty/noorders-dark.png +0 -0
  68. package/dist/components/empty/noorders.png +0 -0
  69. package/dist/components/empty/noposition-dark.png +0 -0
  70. package/dist/components/empty/noposition.png +0 -0
  71. package/dist/components/empty/nosearch-dark.png +0 -0
  72. package/dist/components/empty/nosearch.png +0 -0
  73. package/dist/components/empty/style.less +0 -61
  74. package/dist/components/footer/index.js +0 -7
  75. package/dist/components/footer/index.vue +0 -33
  76. package/dist/components/footer/style.less +0 -21
  77. package/dist/components/footnav/index.js +0 -7
  78. package/dist/components/footnav/index.vue +0 -93
  79. package/dist/components/footnav/style.less +0 -23
  80. package/dist/components/footnav-item/index.js +0 -7
  81. package/dist/components/footnav-item/index.vue +0 -50
  82. package/dist/components/footnav-item/style.less +0 -39
  83. package/dist/components/form/index.js +0 -7
  84. package/dist/components/form/index.vue +0 -12
  85. package/dist/components/headnav/index.js +0 -7
  86. package/dist/components/headnav/index.vue +0 -185
  87. package/dist/components/headnav/style.less +0 -232
  88. package/dist/components/icon/font/iconfont.css +0 -159
  89. package/dist/components/icon/font/iconfont.js +0 -6
  90. package/dist/components/icon/index.js +0 -9
  91. package/dist/components/icon/index.vue +0 -54
  92. package/dist/components/icon/style.less +0 -44
  93. package/dist/components/input/calcTextareaHeight.js +0 -162
  94. package/dist/components/input/index.js +0 -8
  95. package/dist/components/input/index.vue +0 -345
  96. package/dist/components/input/style.less +0 -471
  97. package/dist/components/list/index.js +0 -8
  98. package/dist/components/list/index.vue +0 -152
  99. package/dist/components/list/style.less +0 -213
  100. package/dist/components/loading/index.js +0 -7
  101. package/dist/components/loading/index.vue +0 -68
  102. package/dist/components/loading/style.less +0 -54
  103. package/dist/components/mixins/clickoutside.js +0 -81
  104. package/dist/components/mixins/dom.js +0 -41
  105. package/dist/components/mixins/languageMixin.js +0 -41
  106. package/dist/components/mixins/outlineConfigPlugin.js +0 -45
  107. package/dist/components/mixins/router-link.js +0 -23
  108. package/dist/components/mixins/themeMixin.js +0 -43
  109. package/dist/components/noticebar/index.js +0 -8
  110. package/dist/components/noticebar/index.vue +0 -258
  111. package/dist/components/noticebar/style.less +0 -328
  112. package/dist/components/overlay/index.js +0 -8
  113. package/dist/components/overlay/index.vue +0 -184
  114. package/dist/components/overlay/style.less +0 -23
  115. package/dist/components/pagebreak/index.js +0 -7
  116. package/dist/components/pagebreak/index.vue +0 -67
  117. package/dist/components/pagebreak/style.less +0 -42
  118. package/dist/components/password/index.js +0 -8
  119. package/dist/components/password/index.vue +0 -60
  120. package/dist/components/popover/index.js +0 -8
  121. package/dist/components/popover/index.vue +0 -100
  122. package/dist/components/popover/style.less +0 -346
  123. package/dist/components/popover/vue-popover.vue +0 -314
  124. package/dist/components/popup/index.js +0 -7
  125. package/dist/components/popup/index.vue +0 -243
  126. package/dist/components/radio/index.js +0 -8
  127. package/dist/components/radio/index.vue +0 -184
  128. package/dist/components/radio/style.less +0 -294
  129. package/dist/components/radio-group/index.js +0 -6
  130. package/dist/components/radio-group/index.vue +0 -58
  131. package/dist/components/result/completed-dark.png +0 -0
  132. package/dist/components/result/completed.png +0 -0
  133. package/dist/components/result/error-dark.png +0 -0
  134. package/dist/components/result/error.png +0 -0
  135. package/dist/components/result/index.js +0 -8
  136. package/dist/components/result/index.vue +0 -73
  137. package/dist/components/result/style.less +0 -44
  138. package/dist/components/result/wait-dark.png +0 -0
  139. package/dist/components/result/wait.png +0 -0
  140. package/dist/components/search/index.js +0 -8
  141. package/dist/components/search/index.vue +0 -66
  142. package/dist/components/selector/index.js +0 -8
  143. package/dist/components/selector/index.vue +0 -161
  144. package/dist/components/selector/style.less +0 -484
  145. package/dist/components/skeleton/index.js +0 -7
  146. package/dist/components/skeleton/index.vue +0 -206
  147. package/dist/components/skeleton/style.less +0 -197
  148. package/dist/components/slider/draggable.js +0 -49
  149. package/dist/components/slider/index.js +0 -7
  150. package/dist/components/slider/index.vue +0 -167
  151. package/dist/components/slider/style.less +0 -100
  152. package/dist/components/slider/utils.js +0 -60
  153. package/dist/components/step/index.js +0 -7
  154. package/dist/components/step/index.vue +0 -48
  155. package/dist/components/step/style.less +0 -58
  156. package/dist/components/step-item/index.js +0 -7
  157. package/dist/components/step-item/index.vue +0 -126
  158. package/dist/components/step-item/style.less +0 -362
  159. package/dist/components/stepper/index.js +0 -8
  160. package/dist/components/stepper/index.vue +0 -146
  161. package/dist/components/style/index.vue +0 -42
  162. package/dist/components/switch/index.js +0 -8
  163. package/dist/components/switch/index.vue +0 -72
  164. package/dist/components/switch/style.less +0 -56
  165. package/dist/components/tab/index.js +0 -7
  166. package/dist/components/tab/index.vue +0 -53
  167. package/dist/components/tabs/index.js +0 -8
  168. package/dist/components/tabs/index.vue +0 -172
  169. package/dist/components/tabs/style.less +0 -377
  170. package/dist/components/tag/index.js +0 -7
  171. package/dist/components/tag/index.vue +0 -64
  172. package/dist/components/tag/style.less +0 -211
  173. package/dist/components/title/index.js +0 -8
  174. package/dist/components/title/index.vue +0 -99
  175. package/dist/components/title/style.less +0 -188
  176. package/dist/components/toast/index.js +0 -86
  177. package/dist/components/toast/index.vue +0 -44
  178. package/dist/components/toast/style.less +0 -55
  179. package/dist/components/transition/index.js +0 -8
  180. package/dist/components/transition/index.vue +0 -13
  181. package/dist/components/transition/style.less +0 -208
  182. package/dist/components/upload/index.js +0 -7
  183. package/dist/components/upload/index.vue +0 -106
  184. package/dist/components/upload/style.less +0 -147
  185. package/dist/components/utils/assist.js +0 -34
  186. package/dist/components/utils/env.js +0 -2
  187. package/dist/demo.html +0 -10
  188. package/dist/locale/ar.js +0 -98
  189. package/dist/locale/en.js +0 -98
  190. package/dist/locale/zh.js +0 -98
  191. package/dist/token.css +0 -2990
  192. package/dist/vdesign-ui.common.js +0 -27471
  193. package/dist/vdesign-ui.css +0 -1
  194. package/dist/vdesign-ui.umd.js +0 -27481
  195. package/dist/vdesign-ui.umd.min.js +0 -32
@@ -1,362 +0,0 @@
1
- @prefix: ~"vd-step-item";
2
-
3
- .@{prefix} {
4
- position: relative;
5
-
6
- &.vd-step-horizontal {
7
- flex: 1;
8
- width: 100%;
9
- display: flex;
10
- justify-content: center;
11
- padding-block-start: calc(var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size) + var(--spacing-steps-horizontal_icon-margin_bottom));
12
-
13
- .vd-step-u-dot {
14
- position: absolute;
15
- inset-inline-end: 50%;
16
- transform: translateX(50%);
17
- z-index: 2;
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
- color: inherit;
22
- width: var(--icon-steps-size);
23
- height: var(--icon-steps-size);
24
- inset-block-start: var(--spacing-steps-horizontal-padding_x);
25
-
26
- .vd-iconfont {
27
- color: inherit;
28
- font-size: var(--icon-steps-size);
29
- }
30
-
31
- &::before {
32
- content: "";
33
- width: calc(var(--icon-steps-size) * 0.5);
34
- height: calc(var(--icon-steps-size) * 0.5);
35
- border-radius: 999em;
36
- overflow: hidden;
37
- background-color: var(--bg-color-1);
38
- border: 2px solid var(--text-color-h3);
39
- box-sizing: border-box;
40
- }
41
- }
42
-
43
- .vd-step-u-line {
44
- position: absolute;
45
- inset-block-start: calc(var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size)/2);
46
- inset-inline-end: 0;
47
- z-index: 1;
48
- width: 100%;
49
- height: var(--height-steps-border-default);
50
- background: linear-gradient(to left,
51
- transparent 0%,
52
- transparent 50%,
53
- var(--color-steps-border-default) 50%,
54
- var(--color-steps-border-default) 100%);
55
- background-size: 5px var(--height-steps-border-default);
56
- background-repeat: repeat-x;
57
- }
58
-
59
- .vd-step-u-text {
60
- min-width: 0;
61
- word-break: break-word;
62
- text-align: center;
63
- // not_started
64
- color: var(--color-steps-text-not_started);
65
- font-size: var(--en-multi-f-c-r-fontSize);
66
- font-weight: var(--en-multi-f-c-r-fontWeight);
67
- line-height: var(--en-multi-f-c-r-lineHeight);
68
-
69
- &__title {
70
- overflow: hidden;
71
- display: -webkit-box;
72
- -webkit-box-orient: vertical;
73
- -webkit-line-clamp: 2;
74
- }
75
-
76
- &__description {
77
- overflow: hidden;
78
- display: -webkit-box;
79
- -webkit-box-orient: vertical;
80
- -webkit-line-clamp: 3;
81
- // description_text
82
- color: var(--color-steps-description_text);
83
- font-size: var(--en-multi-f-b-r-fontSize);
84
- font-weight: var(--en-multi-f-b-r-fontWeight);
85
- line-height: var(--en-multi-f-b-r-lineHeight);
86
- }
87
- }
88
-
89
- &.vd-step-active {
90
-
91
- .vd-step-u-text {
92
- color: var(--color-steps-text-complete);
93
- font-size: var(--en-multi-f-c-r-fontSize);
94
- font-weight: var(--en-multi-f-c-r-fontWeight);
95
- line-height: var(--en-multi-f-c-r-lineHeight);
96
- }
97
-
98
- .vd-step-u-dot {
99
- &::before {
100
- border: 2px solid var(--primary-color);
101
- }
102
- }
103
-
104
- .vd-step-u-line {
105
- height: var(--height-steps-border-hover);
106
- background: var(--color-steps-border-hover);
107
- }
108
- }
109
-
110
- &.vd-step-afoot {
111
-
112
- .vd-step-u-dot::before {
113
- content: none;
114
- }
115
-
116
- .vd-step-u-text {
117
- color: var(--color-steps-text-afoot);
118
- font-size: var(--en-multi-f-c-s-fontSize);
119
- font-weight: var(--en-multi-f-c-s-fontWeight);
120
- line-height: var(--en-multi-f-c-s-lineHeight);
121
- }
122
-
123
- .vd-step-u-line::after {
124
- content: "";
125
- position: absolute;
126
- inset-block-start: 0;
127
- inset-inline-start: 0;
128
- width: 50%;
129
- height: var(--height-steps-border-hover);
130
- background: var(--color-steps-border-hover);
131
- }
132
- }
133
-
134
- &.vd-step-warning {
135
-
136
- .vd-step-u-dot::before {
137
- content: none;
138
- }
139
-
140
- .vd-step-u-text {
141
- color: var(--color-steps-text-warning);
142
- font-size: var(--en-multi-f-c-s-fontSize);
143
- font-weight: var(--en-multi-f-c-s-fontWeight);
144
- line-height: var(--en-multi-f-c-s-lineHeight);
145
- }
146
-
147
- .vd-step-u-line::after {
148
- content: "";
149
- position: absolute;
150
- inset-block-start: 0;
151
- inset-inline-start: 0;
152
- width: 50%;
153
- height: var(--height-steps-border-hover);
154
- background: var(--color-steps-border-hover);
155
- }
156
- }
157
- }
158
-
159
- // vertical
160
- &.vd-step-vertical {
161
- width: 100%;
162
- padding-inline-start: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size) + var(--spacing-steps-vertical_icon-margin_right));
163
-
164
- &:not(:last-child) {
165
- padding-block-end: var(--spacing-steps-vertical_description_text-margin_bottom);
166
- }
167
-
168
- .vd-step-u-dot {
169
- position: absolute;
170
- inset-block-start: 0;
171
- inset-inline-start: var(--spacing-steps-vertical-padding_y);
172
- z-index: 2;
173
- display: flex;
174
- justify-content: center;
175
- align-items: center;
176
- color: inherit;
177
- width: var(--icon-steps-size);
178
- height: var(--icon-steps-size);
179
-
180
- .vd-iconfont {
181
- color: inherit;
182
- font-size: var(--icon-steps-size);
183
- }
184
-
185
- &::before {
186
- content: "";
187
- width: calc(var(--icon-steps-size) * 0.5);
188
- height: calc(var(--icon-steps-size) * 0.5);
189
- border-radius: 999em;
190
- overflow: hidden;
191
- background-color: var(--bg-color-1);
192
- border: 2px solid var(--text-color-h3);
193
- box-sizing: border-box;
194
- }
195
- }
196
-
197
- .vd-step-u-line {
198
- position: absolute;
199
- z-index: 1;
200
- inset-block-start: calc(var(--icon-steps-size)/2);
201
- inset-inline-start: calc(var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size)/2);
202
- width: var(--height-steps-border-default);
203
- height: 100%;
204
- background: linear-gradient(to bottom,
205
- transparent 0%,
206
- transparent 50%,
207
- var(--color-steps-border-default) 50%,
208
- var(--color-steps-border-default) 100%);
209
- background-size: 1px 5px;
210
- background-repeat: repeat-y;
211
- }
212
-
213
- .vd-step-u-text {
214
- min-width: 0;
215
- word-break: break-word;
216
- text-align: start;
217
- // not_started
218
- color: var(--color-steps-text-not_started);
219
- font-size: var(--en-multi-f-c-r-fontSize);
220
- font-weight: var(--en-multi-f-c-r-fontWeight);
221
- line-height: var(--en-multi-f-c-r-lineHeight);
222
-
223
- &__title {
224
- overflow: hidden;
225
- display: -webkit-box;
226
- -webkit-box-orient: vertical;
227
- -webkit-line-clamp: 2;
228
- }
229
-
230
- &__description {
231
- overflow: hidden;
232
- display: -webkit-box;
233
- -webkit-box-orient: vertical;
234
- -webkit-line-clamp: 3;
235
- // description_text
236
- color: var(--color-steps-description_text);
237
- font-size: var(--en-multi-f-b-r-fontSize);
238
- font-weight: var(--en-multi-f-b-r-fontWeight);
239
- line-height: var(--en-multi-f-b-r-lineHeight);
240
- }
241
- }
242
-
243
-
244
- &.vd-step-active {
245
-
246
- .vd-step-u-text {
247
- color: var(--color-steps-text-complete);
248
- font-size: var(--en-multi-f-c-r-fontSize);
249
- font-weight: var(--en-multi-f-c-r-fontWeight);
250
- line-height: var(--en-multi-f-c-r-lineHeight);
251
- }
252
-
253
- .vd-step-u-dot {
254
- &::before {
255
- border: 2px solid var(--primary-color);
256
- }
257
- }
258
-
259
- .vd-step-u-line::after {
260
- content: "";
261
- position: absolute;
262
- z-index: 1;
263
- inset-block-start: 0;
264
- inset-inline-start: 0;
265
- height: 100%;
266
- width: var(--height-steps-border-default);
267
- background: var(--color-steps-border-hover);
268
- }
269
-
270
- // 复杂 css 条件,但:has兼容性不够
271
- &:not(:has(+ :is(.vd-step-active, .vd-step-afoot, .vd-step-warning))) {
272
- .vd-step-u-line::after {
273
- height: 50% !important;
274
- }
275
- }
276
- }
277
-
278
-
279
- &.vd-step-warning {
280
- .vd-step-u-line::after {
281
- height: 100%;
282
- }
283
-
284
- .vd-step-u-text {
285
- color: var(--color-steps-text-warning);
286
- font-size: var(--en-multi-f-c-s-fontSize);
287
- font-weight: var(--en-multi-f-c-s-fontWeight);
288
- line-height: var(--en-multi-f-c-s-lineHeight);
289
- }
290
-
291
- .vd-step-u-dot::before {
292
- content: none;
293
- }
294
-
295
- &+.vd-step-active {
296
- .vd-step-u-line::after {
297
- height: 100%;
298
- }
299
- }
300
- }
301
-
302
-
303
- &.vd-step-afoot {
304
- .u-line::after {
305
- height: 100%;
306
- }
307
-
308
- .vd-step-u-text {
309
- color: var(--color-steps-text-afoot);
310
- font-size: var(--en-multi-f-c-s-fontSize);
311
- font-weight: var(--en-multi-f-c-s-fontWeight);
312
- line-height: var(--en-multi-f-c-s-lineHeight);
313
- }
314
-
315
- .vd-step-u-dot::before {
316
- content: none;
317
- }
318
-
319
- &+.vd-step-active {
320
- .vd-step-u-line::after {
321
- height: 100%;
322
- }
323
- }
324
- }
325
- }
326
-
327
- // basic
328
- &.vd-step-basic {
329
- flex: 1;
330
- width: 100%;
331
- display: flex;
332
- justify-content: center;
333
- padding-top: var(--spacing-steps-basic-padding_top);
334
- padding-bottom: var(--spacing-steps-basic-padding_bottom);
335
- margin-inline-start: var(--spacing-steps-basic-padding_y);
336
-
337
- &:last-child {
338
- margin-inline-end: var(--spacing-steps-basic-padding_y);
339
- }
340
-
341
- .vd-step-u-line {
342
- width: 100%;
343
- height: var(--height-steps-basic-default);
344
- border-radius: var(--radius-steps-basic);
345
- background: var(--color-steps-basic-default);
346
- }
347
-
348
- &.vd-step-active {
349
- .vd-step-u-line {
350
- height: var(--height-steps-basic-hover);
351
- background: var(--color-steps-basic-hover);
352
- }
353
- }
354
- }
355
- }
356
-
357
-
358
- [lang='ar'] {
359
- .vd-step-horizontal .vd-step-u-dot {
360
- transform: translateX(-50%);
361
- }
362
- }
@@ -1,8 +0,0 @@
1
- import Stepper from './index.vue';
2
- import './style.less';
3
-
4
- Stepper.install = function (Vue) {
5
- Vue.component(Stepper.name, Stepper);
6
- };
7
-
8
- export default Stepper;
@@ -1,146 +0,0 @@
1
- <template>
2
- <div class="vd-stepper" :class="wrapClasses">
3
- <vd-button v-if="!position" :class="minusButtonClass" icon="icon_btn_reduce" size="small"
4
- @click="onChange('minus')"></vd-button>
5
- <input
6
- type="number"
7
- :class="inputClasses"
8
- :disabled="disabled"
9
- :value="currentValue"
10
- :placeholder="placeholder"
11
- @input="onInput"
12
- @blur="onBlur"
13
- >
14
- <vd-button v-if="position === 'right'" class="vd-stepper__minus" icon="icon_btn_reduce" size="small"
15
- @click="onChange('minus')"></vd-button>
16
- <vd-button :class="plusButtonClass" icon="icon_btn_add" size="small"
17
- @click="onChange('plus')"></vd-button>
18
- </div>
19
- </template>
20
-
21
- <script>
22
- import VdButton from '../button';
23
- import languageMixin from '../mixins/languageMixin.js';
24
-
25
- const prefixCls = 'vd-stepper';
26
- export default {
27
- mixins: [languageMixin],
28
- components: {
29
- VdButton,
30
- },
31
- name: 'vd-stepper',
32
- props: {
33
- value: null,
34
- integer: Boolean,
35
- position: String,
36
- inputCenter: Boolean,
37
- disabled: Boolean,
38
- theme: String,
39
- min: {
40
- type: [String, Number],
41
- default: 1
42
- },
43
- max: {
44
- type: [String, Number],
45
- default: Infinity
46
- },
47
- step: {
48
- type: [String, Number],
49
- default: 1
50
- },
51
- placeholder: String
52
- },
53
- data() {
54
- let value;
55
- if (this.isDef(this.value)) {
56
- value = this.range(this.value);
57
- if (value !== this.value) {
58
- this.$emit('input', value);
59
- }
60
- } else {
61
- value = '';
62
- }
63
- return {
64
- currentValue: value,
65
- };
66
- },
67
- computed: {
68
- inputClasses() {
69
- return [
70
- `${prefixCls}-input`,
71
- ]
72
- },
73
- wrapClasses() {
74
- return [
75
- {
76
- [`${prefixCls}--disabled`]: this.disabled,
77
- [`${prefixCls}--${this.theme}`]: this.theme,
78
- [`${prefixCls}--center`]: this.inputCenter
79
- }
80
- ]
81
- },
82
- minusButtonClass() {
83
- const hairlineClass = this.language === 'ar' ? 'vd-hairline--left' : 'vd-hairline--right';
84
- return `vd-stepper__minus ${hairlineClass}`;
85
- },
86
- plusButtonClass() {
87
- const hairlineClass = this.language === 'ar' ? 'vd-hairline--right' : 'vd-hairline--left';
88
- return `vd-stepper__plus ${hairlineClass}`;
89
- }
90
- },
91
- watch: {
92
- value(val) {
93
- if (val !== this.currentValue) {
94
- this.currentValue = this.format(val);
95
- }
96
- },
97
- currentValue(val) {
98
- this.$emit('input', val);
99
- this.$emit('change', val);
100
- }
101
- },
102
- methods: {
103
- format(value) {
104
- if (value === '' || value === null || value === undefined) {
105
- return '';
106
- }
107
- value = String(value).replace(/[^0-9.-]/g, '');
108
- return this.integer ? Math.floor(value) : +value;
109
- },
110
- // limit value range
111
- range(value) {
112
- value = this.format(value);
113
- if (value === '') {
114
- return value;
115
- }
116
- return Math.max(Math.min(this.max, value), this.min);
117
- },
118
- onInput(event) {
119
- const { value } = event.target;
120
- const formatted = this.format(value);
121
- if (value !== String(formatted)) {
122
- event.target.value = formatted;
123
- }
124
- this.currentValue = formatted;
125
- },
126
- onChange(type) {
127
- if (this[`${type}Disabled`]) {
128
- this.$emit('overlimit', type);
129
- return;
130
- }
131
- const diff = type === 'minus' ? -this.step : +this.step;
132
- let value = this.currentValue === '' ? 0 : this.currentValue;
133
- value = Math.round((value + diff) * 100) / 100;
134
- this.currentValue = this.range(value);
135
- this.$emit(type);
136
- },
137
- onBlur(event) {
138
- this.currentValue = this.range(this.currentValue);
139
- this.$emit('blur', event);
140
- },
141
- isDef(value) {
142
- return value !== undefined && value !== null;
143
- }
144
- }
145
- }
146
- </script>
@@ -1,42 +0,0 @@
1
- <template>
2
- <div>
3
- <h2>默认包含了一些常用样式,可以直接通过 className 的方式使用,样式文件在packages/tokens/style.less里面</h2>
4
-
5
-
6
- <h3>文字省略</h3>
7
-
8
- <!-- 最多显示一行 -->
9
- <div class="vd-ellipsis">这是一段最多显示一行的文字,多余的内容会被省略</div>
10
-
11
- <!-- 最多显示两行 -->
12
- <div class="vd-multi-ellipsis--l2">
13
- 这是一段最多显示两行的文字,多余的内容会被省略
14
- </div>
15
-
16
- <!-- 最多显示三行 -->
17
- <div class="vd-multi-ellipsis--l3">
18
- 这是一段最多显示三行的文字,多余的内容会被省略
19
- </div>
20
-
21
- <h3>1px 边框</h3>
22
-
23
- <!-- 上边框 -->
24
- <div class="vd-hairline--top"></div>
25
-
26
- <!-- 下边框 -->
27
- <div class="vd-hairline--bottom"></div>
28
-
29
- <!-- 左边框 -->
30
- <div class="vd-hairline--left"></div>
31
-
32
- <!-- 右边框 -->
33
- <div class="vd-hairline--right"></div>
34
-
35
- <!-- 上下边框 -->
36
- <div class="vd-hairline--top-bottom"></div>
37
-
38
- <!-- 全边框 -->
39
- <div class="vd-hairline--surround"></div>
40
- </div>
41
- </template>
42
-
@@ -1,8 +0,0 @@
1
- import Switch from './index.vue';
2
- import './style.less';
3
-
4
- Switch.install = function (Vue) {
5
- Vue.component(Switch.name, Switch);
6
- };
7
-
8
- export default Switch;
@@ -1,72 +0,0 @@
1
- <template>
2
- <!-- 开关 -->
3
- <div class="vd-switch" :class="{ 'vd-switch-on': isActived }" :disabled="disabled" @click="handleClick">
4
- <span class="vd-switch-round"></span>
5
- </div>
6
- </template>
7
- <script>
8
- export default {
9
- name: 'vd-switch',
10
- props: {
11
- /**
12
- * v-model 绑定值
13
- */
14
- value: {
15
- type: Boolean,
16
- default: false
17
- },
18
- /**
19
- * 异步状态
20
- */
21
- async: {
22
- type: Boolean,
23
- default: false
24
- },
25
- /**
26
- * 禁用状态
27
- */
28
- disabled: {
29
- type: Boolean,
30
- default: false
31
- }
32
- },
33
- data() {
34
- return {
35
- /**
36
- * 激活状态
37
- */
38
- isActived: this.value
39
- }
40
- },
41
- methods: {
42
- /**
43
- * 点击 Switch 开关
44
- */
45
- handleClick() {
46
- const { disabled, async, isActived } = this
47
- /**
48
- * 判断是否被禁用
49
- */
50
- if (!disabled) {
51
- /**
52
- * 判断是否异步
53
- */
54
- !async && this.$emit('input', !isActived)
55
- this.$emit('on-click')
56
- // element.style.setProperty('--primary-color', 'blue');
57
- }
58
- },
59
- },
60
- watch: {
61
- /**
62
- * 监听 value 的值
63
- */
64
- value(value) {
65
- this.isActived = value
66
- }
67
- }
68
- }
69
- </script>
70
- <style lang="less">
71
- @import './style.less';
72
- </style>
@@ -1,56 +0,0 @@
1
- @prefix: ~"vd-switch";
2
-
3
- .@{prefix} {
4
- display: inline-block;
5
- position: relative;
6
- box-sizing: border-box;
7
- width: var(--width-switch-bg);
8
- height: var(--height-switch-bg);
9
- border-radius: var(--radius-switch-bg);
10
- background: var(--color-switch-off_bg-default);
11
- cursor: pointer;
12
-
13
- &-round {
14
- box-sizing: border-box;
15
- position: absolute;
16
- top: calc(var(--height-switch-bg) * -0.5);
17
- left: 0;
18
- transition: transform .3s;
19
- width: var(--height-switch-button);
20
- height: var(--height-switch-button);
21
- border-radius: var(--radius-switch-button);
22
- border: 1px solid var(--color-switch-off_button_border-default);
23
- background: var(--color-switch-off_button_bg-default);
24
- }
25
-
26
- &-on {
27
- border-color: var(--color-switch-on_button_border-default);
28
- background: var(--color-switch-on_bg-default);
29
-
30
- .@{prefix}-round {
31
- transform: translateX(var(--height-switch-button));
32
- background: var(--color-switch-on_button_bg-default);
33
- }
34
- }
35
-
36
- &[disabled] {
37
- border-color: var(--color-switch-off_button_border-disable);
38
- background: var(--color-switch-off_bg-disable);
39
-
40
- .@{prefix}-round {
41
- background: var(--color-switch-off_button_bg-disable);
42
- border-color: var(--color-switch-off_button_border-disable);
43
- }
44
- }
45
-
46
- // 选中&&禁用
47
- &-on[disabled] {
48
- border-color: var(--color-switch-on_button_border-disable);
49
- background: var(--color-switch-on_bg-disable);
50
-
51
- .@{prefix}-round {
52
- background: var(--color-switch-on_button_bg-disable);
53
- border-color: var(--color-switch-on_button_border-disable);
54
- }
55
- }
56
- }
@@ -1,7 +0,0 @@
1
- import Tab from './index.vue';
2
-
3
- Tab.install = function (Vue) {
4
- Vue.component(Tab.name, Tab);
5
- };
6
-
7
- export default Tab;