vdesign-ui 0.1.21 → 0.1.23

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 (185) hide show
  1. package/dist/components/actionbar/actionbar-cell/index.vue +34 -0
  2. package/dist/components/actionbar/index.js +8 -0
  3. package/dist/components/actionbar/index.vue +39 -0
  4. package/dist/components/actionbar/style.less +48 -0
  5. package/dist/components/actions-cell/actions/index.js +7 -0
  6. package/dist/components/actions-cell/actions/index.vue +76 -0
  7. package/dist/components/actions-cell/actions/style.less +112 -0
  8. package/dist/components/actions-cell/index.js +7 -0
  9. package/dist/components/actions-cell/index.vue +94 -0
  10. package/dist/components/actions-cell/style.less +39 -0
  11. package/dist/components/activityviews/index.js +8 -0
  12. package/dist/components/activityviews/index.vue +140 -0
  13. package/dist/components/activityviews/style.less +138 -0
  14. package/dist/components/badge/index.js +8 -0
  15. package/dist/components/badge/index.vue +49 -0
  16. package/dist/components/badge/style.less +66 -0
  17. package/dist/components/button/index.js +8 -0
  18. package/dist/components/button/index.vue +89 -0
  19. package/dist/components/button/style.less +563 -0
  20. package/dist/components/calendar/end.png +0 -0
  21. package/dist/components/calendar/index-element.vue +84 -0
  22. package/dist/components/calendar/index.js +8 -0
  23. package/dist/components/calendar/index.vue +52 -0
  24. package/dist/components/calendar/start.png +0 -0
  25. package/dist/components/calendar/style.less +167 -0
  26. package/dist/components/checkbox/assist.js +34 -0
  27. package/dist/components/checkbox/checkbox-group/index.js +8 -0
  28. package/dist/components/checkbox/checkbox-group/index.vue +69 -0
  29. package/dist/components/checkbox/index.js +8 -0
  30. package/dist/components/checkbox/index.vue +184 -0
  31. package/dist/components/checkbox/style.less +291 -0
  32. package/dist/components/common/state/index.vue +80 -0
  33. package/dist/components/data-list/index.js +10 -0
  34. package/dist/components/data-list/index.vue +19 -0
  35. package/dist/components/data-list/style.less +624 -0
  36. package/dist/components/datetime-picker/index.js +8 -0
  37. package/dist/components/datetime-picker/index.vue +37 -0
  38. package/dist/components/datetime-picker/style.less +24 -0
  39. package/dist/components/dialog/index.js +8 -0
  40. package/dist/components/dialog/index.vue +162 -0
  41. package/dist/components/dialog/overlay-manager.js +18 -0
  42. package/dist/components/dialog/style.less +132 -0
  43. package/dist/components/divider/index.js +8 -0
  44. package/dist/components/divider/index.vue +54 -0
  45. package/dist/components/divider/style.less +92 -0
  46. package/dist/components/dropdown/index.js +8 -0
  47. package/dist/components/dropdown/index.vue +210 -0
  48. package/dist/components/dropdown/style.less +418 -0
  49. package/dist/components/empty/404-dark.png +0 -0
  50. package/dist/components/empty/404.png +0 -0
  51. package/dist/components/empty/index.js +8 -0
  52. package/dist/components/empty/index.vue +95 -0
  53. package/dist/components/empty/network-dark.png +0 -0
  54. package/dist/components/empty/network.png +0 -0
  55. package/dist/components/empty/nodata-dark.png +0 -0
  56. package/dist/components/empty/nodata.png +0 -0
  57. package/dist/components/empty/style.less +60 -0
  58. package/dist/components/footer/index.js +7 -0
  59. package/dist/components/footer/index.vue +29 -0
  60. package/dist/components/footer/style.less +22 -0
  61. package/dist/components/footnav/footnav-item/index.js +7 -0
  62. package/dist/components/footnav/footnav-item/index.vue +75 -0
  63. package/dist/components/footnav/footnav-item/style.less +39 -0
  64. package/dist/components/footnav/index.js +7 -0
  65. package/dist/components/footnav/index.vue +97 -0
  66. package/dist/components/footnav/style.less +23 -0
  67. package/dist/components/form/index.js +7 -0
  68. package/dist/components/form/index.vue +12 -0
  69. package/dist/components/headnav/index.js +7 -0
  70. package/dist/components/headnav/index.vue +163 -0
  71. package/dist/components/headnav/style.less +245 -0
  72. package/dist/components/icon/font/iconfont.css +1049 -0
  73. package/dist/components/icon/font/iconfont.js +2 -0
  74. package/dist/components/icon/index.js +9 -0
  75. package/dist/components/icon/index.vue +46 -0
  76. package/dist/components/icon/style.less +44 -0
  77. package/dist/components/input/calcTextareaHeight.js +266 -0
  78. package/dist/components/input/index.js +8 -0
  79. package/dist/components/input/index.vue +343 -0
  80. package/dist/components/input/password/index.js +8 -0
  81. package/dist/components/input/password/index.vue +60 -0
  82. package/dist/components/input/search/index.js +8 -0
  83. package/dist/components/input/search/index.vue +66 -0
  84. package/dist/components/input/stepper/index.js +8 -0
  85. package/dist/components/input/stepper/index.vue +136 -0
  86. package/dist/components/input/style.less +497 -0
  87. package/dist/components/list/index.js +8 -0
  88. package/dist/components/list/index.vue +159 -0
  89. package/dist/components/list/style.less +292 -0
  90. package/dist/components/loading/index.js +7 -0
  91. package/dist/components/loading/index.vue +53 -0
  92. package/dist/components/loading/loading.png +0 -0
  93. package/dist/components/loading/refresh.png +0 -0
  94. package/dist/components/loading/style.less +48 -0
  95. package/dist/components/mixins/clickoutside.js +81 -0
  96. package/dist/components/mixins/dom.js +41 -0
  97. package/dist/components/mixins/languageMixin.js +38 -0
  98. package/dist/components/mixins/outlineConfigPlugin.js +40 -0
  99. package/dist/components/mixins/router-link.js +23 -0
  100. package/dist/components/mixins/themeMixin.js +29 -0
  101. package/dist/components/noticebar/index.js +8 -0
  102. package/dist/components/noticebar/index.vue +247 -0
  103. package/dist/components/noticebar/style.less +332 -0
  104. package/dist/components/overlay/index.js +8 -0
  105. package/dist/components/overlay/index.vue +161 -0
  106. package/dist/components/overlay/style.less +23 -0
  107. package/dist/components/pagebreak/index.js +7 -0
  108. package/dist/components/pagebreak/index.vue +60 -0
  109. package/dist/components/pagebreak/style.less +43 -0
  110. package/dist/components/popover/index.js +8 -0
  111. package/dist/components/popover/index.vue +99 -0
  112. package/dist/components/popover/style.less +346 -0
  113. package/dist/components/popover/vue-popover.vue +314 -0
  114. package/dist/components/radio/assist.js +34 -0
  115. package/dist/components/radio/index.js +8 -0
  116. package/dist/components/radio/index.vue +158 -0
  117. package/dist/components/radio/radio-group/index.vue +70 -0
  118. package/dist/components/radio/style.css +213 -0
  119. package/dist/components/radio/style.less +302 -0
  120. package/dist/components/result/completed-dark.png +0 -0
  121. package/dist/components/result/completed.png +0 -0
  122. package/dist/components/result/error-dark.png +0 -0
  123. package/dist/components/result/error.png +0 -0
  124. package/dist/components/result/index.js +8 -0
  125. package/dist/components/result/index.vue +75 -0
  126. package/dist/components/result/style.less +42 -0
  127. package/dist/components/result/wait-dark.png +0 -0
  128. package/dist/components/result/wait.png +0 -0
  129. package/dist/components/selector/index.js +8 -0
  130. package/dist/components/selector/index.vue +124 -0
  131. package/dist/components/selector/style.less +474 -0
  132. package/dist/components/skeleton/index.js +7 -0
  133. package/dist/components/skeleton/index.vue +142 -0
  134. package/dist/components/skeleton/style.less +192 -0
  135. package/dist/components/slider/draggable.js +49 -0
  136. package/dist/components/slider/index.js +7 -0
  137. package/dist/components/slider/index.vue +173 -0
  138. package/dist/components/slider/style.less +96 -0
  139. package/dist/components/slider/utils.js +60 -0
  140. package/dist/components/step/index.js +7 -0
  141. package/dist/components/step/index.vue +48 -0
  142. package/dist/components/step/style.less +59 -0
  143. package/dist/components/step-item/index.js +7 -0
  144. package/dist/components/step-item/index.vue +117 -0
  145. package/dist/components/step-item/style.less +361 -0
  146. package/dist/components/style/index.vue +42 -0
  147. package/dist/components/switch/index.js +8 -0
  148. package/dist/components/switch/index.vue +72 -0
  149. package/dist/components/switch/style.less +56 -0
  150. package/dist/components/tabs/index.js +8 -0
  151. package/dist/components/tabs/index.vue +145 -0
  152. package/dist/components/tabs/style.less +385 -0
  153. package/dist/components/tabs/tab/index.vue +56 -0
  154. package/dist/components/tag/index.js +7 -0
  155. package/dist/components/tag/index.vue +50 -0
  156. package/dist/components/tag/style.less +211 -0
  157. package/dist/components/title/index.js +8 -0
  158. package/dist/components/title/index.vue +92 -0
  159. package/dist/components/title/style.less +188 -0
  160. package/dist/components/toast/index.js +80 -0
  161. package/dist/components/toast/index.vue +44 -0
  162. package/dist/components/toast/style.less +55 -0
  163. package/dist/components/transition/index.js +8 -0
  164. package/dist/components/transition/index.vue +13 -0
  165. package/dist/components/transition/style.less +208 -0
  166. package/dist/components/upload/index.js +7 -0
  167. package/dist/components/upload/index.vue +103 -0
  168. package/dist/components/upload/index1.vue +225 -0
  169. package/dist/components/upload/style.less +156 -0
  170. package/dist/demo.html +10 -0
  171. package/dist/img/404-dark.775df5bb.png +0 -0
  172. package/dist/img/completed-dark.4183a8a8.png +0 -0
  173. package/dist/img/error-dark.b80857da.png +0 -0
  174. package/dist/img/network-dark.11a147bb.png +0 -0
  175. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
  176. package/dist/img/wait-dark.6aa28731.png +0 -0
  177. package/dist/locale/ar.js +98 -0
  178. package/dist/locale/en.js +98 -0
  179. package/dist/locale/zh.js +98 -0
  180. package/dist/token.css +2982 -0
  181. package/dist/vdesign-ui.common.js +27013 -0
  182. package/dist/vdesign-ui.css +1 -0
  183. package/dist/vdesign-ui.umd.js +27023 -0
  184. package/dist/vdesign-ui.umd.min.js +32 -0
  185. package/package.json +1 -1
@@ -0,0 +1,302 @@
1
+ @radio-prefix-cls: vd-radio;
2
+ @radio-button-prefix-cls: vd-radio-button;
3
+ @radio-inner-prefix-cls: ~"@{radio-prefix-cls}__icon";
4
+
5
+ .@{radio-prefix-cls} {
6
+ position: relative;
7
+ cursor: pointer;
8
+ display: flex;
9
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
10
+
11
+ }
12
+
13
+ // 普通状态
14
+ .@{radio-prefix-cls} {
15
+
16
+ &__input{
17
+ position: relative;
18
+ margin-inline-end: calc(var(--spacing-check_radio-icon-margin_right) * 1px);
19
+ width: calc(var(--icon-check_radio-sizing) * 1px);
20
+ height: calc(var(--icon-check_radio-sizing) * 1px);
21
+ }
22
+
23
+ &__label{
24
+ flex: 1;
25
+ }
26
+
27
+ &__text {
28
+ color: var(--color-check_radio-text-default);
29
+ font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
30
+ font-weight: var(--en-single-f-d-r-fontWeight);
31
+ }
32
+
33
+ &__description {
34
+ line-height: 1;
35
+ margin-top: calc(var(--spacing-check_radio-text-margin_top) * 1px);
36
+ color: var(--color-check_radio-text_describe-default);
37
+ font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
38
+ font-weight: var(--en-single-f-b-r-fontWeight);
39
+ }
40
+
41
+ .@{radio-inner-prefix-cls} {
42
+ display: block;
43
+ width: calc(var(--icon-check_radio-sizing) * 1px);
44
+ height: calc(var(--icon-check_radio-sizing) * 1px);
45
+ position: relative;
46
+
47
+ &::before{
48
+ position: absolute;
49
+ box-sizing: border-box;
50
+ content: ' ';
51
+ pointer-events: none;
52
+ top: -50%;
53
+ right: -50%;
54
+ bottom: -50%;
55
+ left: -50%;
56
+ border: 0 solid var(--color-check_radio-default);
57
+ -webkit-transform: scale(0.5);
58
+ transform: scale(0.5);
59
+ border-width: 3px;
60
+ border-radius: 50%;
61
+ }
62
+
63
+ }
64
+
65
+ &__original {
66
+ width: 100%;
67
+ height: 100%;
68
+ position: absolute;
69
+ top: 0;
70
+ bottom: 0;
71
+ left: 0;
72
+ right: 0;
73
+ z-index: 1;
74
+ cursor: pointer;
75
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
76
+ opacity: 0;
77
+
78
+ }
79
+ }
80
+
81
+ // 选中状态
82
+ .@{radio-prefix-cls}--checked {
83
+ .@{radio-prefix-cls} {
84
+ &__text {
85
+ font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
86
+ font-weight: var(--en-single-f-d-s-fontWeight);
87
+ }
88
+ }
89
+
90
+ .@{radio-inner-prefix-cls} {
91
+
92
+ &::before{
93
+ border: 0 solid var(--color-check_radio-active);
94
+ border-width: 3px;
95
+ }
96
+
97
+ &::after{
98
+ position: absolute;
99
+ width: 8px;
100
+ height: 8px;
101
+ left: 50%;
102
+ top: 50%;
103
+ transform: translate(-50%, -50%);
104
+ border-radius: 50%;
105
+ display: table;
106
+ border-top: 0;
107
+ border-left: 0;
108
+ content: " ";
109
+ background-color: var(--color-check_radio-active);
110
+ // transition: all .2s ease-in-out;
111
+ }
112
+ }
113
+ }
114
+
115
+ // 禁用状态
116
+ .@{radio-prefix-cls}--disabled {
117
+ cursor: not-allowed;
118
+ // opacity: var(--opacity-30);
119
+
120
+ .@{radio-prefix-cls}__text{
121
+ color: var(--color-check_radio-text-disable);
122
+ }
123
+
124
+ .@{radio-prefix-cls}__description{
125
+ color: var(--color-check_radio-text_describe-disable);
126
+ }
127
+
128
+ .@{radio-prefix-cls}__icon {
129
+
130
+ &::before{
131
+ border-color:var(--color-check_radio-disable);
132
+ }
133
+
134
+ }
135
+ }
136
+
137
+ .@{radio-prefix-cls}--checked.@{radio-prefix-cls}--disabled{
138
+ .@{radio-prefix-cls}__icon {
139
+
140
+ &::before{
141
+ border-color:var(--color-check_radio-active-disable);
142
+ }
143
+
144
+ &::after{
145
+ background-color: var(--color-check_radio-active-disable);
146
+ }
147
+
148
+ }
149
+ }
150
+
151
+ .@{radio-prefix-cls}-group {
152
+
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: calc(var(--spacing-check_radio-group-margin_x)*1px);
156
+ // .vd-radio-wrapper {
157
+ // margin-block-end: calc(var(--spacing-check_radio-group-margin_x)*1px);
158
+ // }
159
+
160
+
161
+ &-card{
162
+ display: flex;
163
+ flex-wrap: wrap;
164
+ flex-direction: row;
165
+ gap: 12px;
166
+
167
+ .vd-radio-button-cell{
168
+ flex: 1;
169
+ }
170
+ }
171
+ }
172
+
173
+
174
+
175
+ .@{radio-button-prefix-cls}{
176
+ position: relative;
177
+ display: inline-flex;
178
+ align-items: center;
179
+ flex-direction: column;
180
+ justify-content: center;
181
+ line-height: 1;
182
+ width: 100%;
183
+
184
+ &::after{
185
+ position: absolute;
186
+ box-sizing: border-box;
187
+ content: ' ';
188
+ pointer-events: none;
189
+ top: -50%;
190
+ right: -50%;
191
+ bottom: -50%;
192
+ left: -50%;
193
+ border: 0 solid var(--color-check_radio-radio_border-default);
194
+ -webkit-transform: scale(0.5);
195
+ transform: scale(0.5);
196
+ border-width: 1px;
197
+ }
198
+
199
+
200
+ &--large {
201
+ height: calc(var(--height-check_radio-radio_button_l) * 1px);
202
+
203
+ .@{radio-button-prefix-cls}-text{
204
+ color: var(--color-check_radio-radio_button_text-default);
205
+ font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
206
+ font-weight:var(--en-single-f-d-r-fontWeight);
207
+ }
208
+
209
+ &::after{
210
+ border-radius: calc(var(--radius-check_radio-radio_l) * 2px);
211
+ }
212
+ }
213
+
214
+ &--medium {
215
+ height: calc(var(--height-check_radio-radio_button_m) * 1px);
216
+ .@{radio-button-prefix-cls}-text{
217
+ color: var(--color-check_radio-radio_button_text-default);
218
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
219
+ font-weight:var(--en-single-f-c-r-fontWeight);
220
+ }
221
+ &::after{
222
+ border-radius: calc(var(--radius-check_radio-m) * 2px);
223
+ }
224
+ }
225
+
226
+ &--small {
227
+ height: calc(var(--height-check_radio-radio_button_s) * 1px);
228
+
229
+ .@{radio-button-prefix-cls}-text{
230
+ color: var(--color-check_radio-radio_button_text-default);
231
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
232
+ font-weight:var(--en-single-f-c-r-fontWeight);
233
+ }
234
+ &::after{
235
+ border-radius: calc(var(--radius-check_radio-s) * 2px);
236
+ }
237
+ }
238
+
239
+
240
+ &--checked {
241
+ background-color: var(--color-check_radio-radio_button_bg-active);
242
+
243
+ &::after{
244
+ border-color: var(--color-check_radio-radio_border-active);
245
+ border-width: 2px;
246
+ }
247
+
248
+ .@{radio-button-prefix-cls}-text {
249
+ color: var(--color-check_radio-radio_button_text-active);
250
+ }
251
+
252
+ &.@{radio-button-prefix-cls}--large {
253
+ .@{radio-button-prefix-cls}-text {
254
+ font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
255
+ font-weight:var(--en-single-f-d-s-fontWeight);
256
+ }
257
+ }
258
+
259
+ &.@{radio-button-prefix-cls}--medium {
260
+ .@{radio-button-prefix-cls}-text {
261
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
262
+ font-weight:var(--en-single-f-c-s-fontWeight);
263
+ }
264
+ }
265
+
266
+ &.@{radio-button-prefix-cls}--small {
267
+ .@{radio-button-prefix-cls}-text {
268
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
269
+ font-weight:var(--en-single-f-c-s-fontWeight);
270
+ }
271
+ }
272
+
273
+ }
274
+
275
+
276
+ &--disabled{
277
+ cursor: not-allowed;
278
+
279
+ .@{radio-button-prefix-cls}-text{
280
+ color: var(--color-check_radio-radio_button_text-disable);
281
+ }
282
+ }
283
+
284
+ }
285
+
286
+ .@{radio-prefix-cls}-group {
287
+ display: flex;
288
+ flex-direction: column;
289
+ gap: calc(var(--spacing-check_radio-group-margin_x)*1px);
290
+
291
+ &__card{
292
+ display: flex;
293
+ flex-direction: row;
294
+ flex-wrap: wrap;
295
+ gap: 12px;
296
+
297
+ }
298
+
299
+ .@{radio-button-prefix-cls}{
300
+ flex: 1;
301
+ }
302
+ }
Binary file
@@ -0,0 +1,8 @@
1
+ import Result from './index.vue';
2
+ import './style.less';
3
+
4
+ Result.install = function (Vue) {
5
+ Vue.component(Result.name, Result);
6
+ };
7
+
8
+ export default Result;
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div class="vd-result">
3
+ <div class="vd-result-img" v-if="currentImg"><img :src="currentImg" alt="img"></div>
4
+ <div class="vd-result-title" v-if="title">{{ title }}</div>
5
+ <p class="vd-result-txt" v-if="text">{{ text }}</p>
6
+ <div class="vd-result-footer">
7
+ <slot name="btnp"></slot>
8
+
9
+ <div class="vd-result-footer-btnx" v-if="$slots.btnt">
10
+ <slot name="btnt"></slot>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+
18
+ import { themeMixin } from '@p/components/mixins/themeMixin';
19
+
20
+
21
+ export default {
22
+ name: 'vd-result',
23
+ mixins: [themeMixin], // 引入混入
24
+ props: {
25
+ imgs: String,
26
+ text: String,
27
+ title: String,
28
+ state: {
29
+ type: String,
30
+ default: '' // 默认类型
31
+ },
32
+ },
33
+ data() {
34
+ return {
35
+ defaultImgs: {
36
+ completed: {
37
+ light: require('./completed.png'),
38
+ dark: require('./completed-dark.png')
39
+ },
40
+ waiting: {
41
+ light: require('./wait.png'),
42
+ dark: require('./wait-dark.png')
43
+ },
44
+ error: {
45
+ light: require('./error.png'),
46
+ dark: require('./error-dark.png')
47
+ }
48
+ }
49
+ }
50
+ },
51
+ computed:{
52
+ currentImg() {
53
+ if (this.imgs) return this.imgs;
54
+ return this.defaultImgs[this.state][this.theme];
55
+ },
56
+ },
57
+ methods: {
58
+ preloadImages() {
59
+ Object.values(this.defaultImgs).forEach((modes) => {
60
+ Object.values(modes).forEach((src) => {
61
+ const img = new Image();
62
+ img.src = src;
63
+ });
64
+ });
65
+ }
66
+ },
67
+ mounted() {
68
+ this.preloadImages();
69
+ },
70
+ }
71
+ </script>
72
+
73
+ <style lang="less">
74
+ @import './style.less';
75
+ </style>
@@ -0,0 +1,42 @@
1
+ .vd-result{
2
+ height: 100%;
3
+ margin: 0 auto;
4
+ text-align: center;
5
+ padding: 0 20px 40px;
6
+ display: flex;
7
+ flex-direction: column;
8
+ justify-content: center;
9
+
10
+ &-img{
11
+ margin: 0 auto;
12
+ width: 160px;
13
+ img{
14
+ max-width: 100%;
15
+ }
16
+ }
17
+
18
+ &-title{
19
+ margin-block-start: calc(var(--spacing-result-title-margin_top) * 1px);
20
+ font-size: calc(var(--en-single-f-f-b-fontSize) * 1px);
21
+ font-weight: var(--en-single-f-f-b-fontWeight);
22
+ color:var(--color-result-title)
23
+ }
24
+ &-txt{
25
+ margin-block-start: calc(var(--spacing-result-text-margin_top) * 1px);
26
+ font-size: calc(var(--en-multi-f-d-r-fontSize) * 1px);
27
+ font-weight: var(--en-multi-f-d-r-fontWeight);
28
+ color:var(--color-result-text);
29
+ line-height: calc(var(--en-multi-f-d-r-lineHeight) * 1px);
30
+ }
31
+ &-footer{
32
+ margin-block-start: calc(var(--spacing-result-text-margin_bottom) * 1px);
33
+ padding-inline-start: calc(var(--spacing-result-button-margin_y) * 1px - 20px);
34
+ padding-inline-end: calc(var(--spacing-result-button-margin_y) * 1px - 20px);
35
+
36
+ &-btnx{
37
+ display: flex;
38
+ justify-content: center;
39
+ margin-block-start: calc(var(--spacing-result-text_button-margin_top) * 1px);
40
+ }
41
+ }
42
+ }
Binary file
@@ -0,0 +1,8 @@
1
+ import VSelector from "./index.vue";
2
+ import './style.less';
3
+
4
+ VSelector.install = function (Vue) {
5
+ Vue.component(VSelector.name, VSelector);
6
+ };
7
+
8
+ export default VSelector;
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <div class="vd-selector" :class="wrapClasses" :tabindex="disabled ? -1 : 0" @keyup.enter="handlerClick"
3
+ @click.stop="handlerClick">
4
+ <div class="vd-selector__inner">
5
+ <div :contenteditable="contenteditable" class="vd-selector__left">
6
+ <vd-icon v-if="icon" :name="icon" svg :class="iconClasses"></vd-icon>
7
+ <div :class="titleClasses">
8
+ <slot v-if="!isSlotEmpty" name="content"></slot>
9
+ <template v-else>{{ content }} </template>
10
+ </div>
11
+ </div>
12
+ <vd-icon v-if="arrow" :name="arrow" :class="arrowClasses"></vd-icon>
13
+ </div>
14
+ <slot v-if="showMenu"></slot>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ const prefixCls = 'vd-selector';
20
+ export default {
21
+ name: "vd-selector",
22
+ componentName: "vd-selector",
23
+ props: {
24
+ icon: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ arrow: {
29
+ type: [String, Boolean],
30
+ default: 'icon_btn_moredown'
31
+ },
32
+ type: {
33
+ type: String,
34
+ default: ''// form
35
+ },
36
+ size: {
37
+ type: String,
38
+ default: 'm',
39
+ validator: value => ['s', 'm', 'l', 'xl'].includes(value)
40
+ },
41
+ content: {
42
+ type: [String, Array],
43
+ default: ''
44
+ },
45
+ disabled: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ active: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ contenteditable: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ value: {
58
+ type: Boolean,
59
+ default: false
60
+ }
61
+ },
62
+ data() {
63
+ return {
64
+ showMenu: this.value,
65
+ };
66
+ },
67
+ computed: {
68
+ isSlotEmpty() {
69
+ return !this.$slots.content;
70
+ },
71
+ wrapClasses() {
72
+ return {
73
+ [`${prefixCls}-${this.type}`]: this.type,
74
+ [`${prefixCls}-${this.size}`]: this.size,
75
+ [`${prefixCls}--disabled`]: this.disabled,
76
+ [`${prefixCls}--active`]: this.showMenu || this.active,
77
+ }
78
+ },
79
+ titleClasses() {
80
+ return {
81
+ [`${prefixCls}-${this.type}__title`]: this.type,
82
+ [`${prefixCls}-${this.size}__title`]: this.size,
83
+ }
84
+ },
85
+ iconClasses() {
86
+ return {
87
+ [`${prefixCls}-iconfont`]: true,
88
+ [`${prefixCls}-${this.type}__icon`]: this.type,
89
+ [`${prefixCls}-${this.size}__icon`]: this.size,
90
+ }
91
+ },
92
+ arrowClasses() {
93
+ return {
94
+ [`${prefixCls}-iconfont`]: true,
95
+ [`${prefixCls}-${this.type}__arrow`]: this.type,
96
+ [`${prefixCls}-${this.size}__arrow`]: this.size,
97
+ [`${prefixCls}__arrow--active`]: this.showMenu && this.arrow === 'icon_btn_moredown',
98
+ }
99
+ },
100
+ },
101
+ watch: {
102
+ value(val) {
103
+ this.showMenu = val;
104
+ }
105
+ },
106
+ methods: {
107
+ close() {
108
+ this.showMenu = false
109
+ this.$emit('close', false)
110
+ this.$emit('input', false)
111
+ },
112
+ handlerClick() {
113
+ if (this.disabled) return;
114
+ this.showMenu = !this.showMenu
115
+ this.$emit('click', this.showMenu)
116
+ this.$emit('input', this.showMenu)
117
+ }
118
+ }
119
+ };
120
+ </script>
121
+
122
+ <style lang="less">
123
+ @import './style.less';
124
+ </style>