vdesign-ui 0.1.21 → 0.1.22

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 (183) 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 +159 -0
  117. package/dist/components/radio/radio-group/index.vue +70 -0
  118. package/dist/components/radio/style.less +297 -0
  119. package/dist/components/result/completed-dark.png +0 -0
  120. package/dist/components/result/completed.png +0 -0
  121. package/dist/components/result/error-dark.png +0 -0
  122. package/dist/components/result/error.png +0 -0
  123. package/dist/components/result/index.js +8 -0
  124. package/dist/components/result/index.vue +75 -0
  125. package/dist/components/result/style.less +42 -0
  126. package/dist/components/result/wait-dark.png +0 -0
  127. package/dist/components/result/wait.png +0 -0
  128. package/dist/components/selector/index.js +8 -0
  129. package/dist/components/selector/index.vue +124 -0
  130. package/dist/components/selector/style.less +474 -0
  131. package/dist/components/skeleton/index.js +7 -0
  132. package/dist/components/skeleton/index.vue +142 -0
  133. package/dist/components/skeleton/style.less +192 -0
  134. package/dist/components/slider/draggable.js +49 -0
  135. package/dist/components/slider/index.js +7 -0
  136. package/dist/components/slider/index.vue +173 -0
  137. package/dist/components/slider/style.less +96 -0
  138. package/dist/components/slider/utils.js +60 -0
  139. package/dist/components/step/index.js +7 -0
  140. package/dist/components/step/index.vue +48 -0
  141. package/dist/components/step/style.less +59 -0
  142. package/dist/components/step-item/index.js +7 -0
  143. package/dist/components/step-item/index.vue +117 -0
  144. package/dist/components/step-item/style.less +361 -0
  145. package/dist/components/style/index.vue +42 -0
  146. package/dist/components/switch/index.js +8 -0
  147. package/dist/components/switch/index.vue +72 -0
  148. package/dist/components/switch/style.less +56 -0
  149. package/dist/components/tabs/index.js +8 -0
  150. package/dist/components/tabs/index.vue +145 -0
  151. package/dist/components/tabs/style.less +385 -0
  152. package/dist/components/tabs/tab/index.vue +56 -0
  153. package/dist/components/tag/index.js +7 -0
  154. package/dist/components/tag/index.vue +50 -0
  155. package/dist/components/tag/style.less +211 -0
  156. package/dist/components/title/index.js +8 -0
  157. package/dist/components/title/index.vue +92 -0
  158. package/dist/components/title/style.less +188 -0
  159. package/dist/components/toast/index.js +80 -0
  160. package/dist/components/toast/index.vue +44 -0
  161. package/dist/components/toast/style.less +55 -0
  162. package/dist/components/transition/index.js +8 -0
  163. package/dist/components/transition/index.vue +13 -0
  164. package/dist/components/transition/style.less +208 -0
  165. package/dist/components/upload/index.js +7 -0
  166. package/dist/components/upload/index.vue +224 -0
  167. package/dist/components/upload/style.less +156 -0
  168. package/dist/demo.html +10 -0
  169. package/dist/img/404-dark.775df5bb.png +0 -0
  170. package/dist/img/completed-dark.4183a8a8.png +0 -0
  171. package/dist/img/error-dark.b80857da.png +0 -0
  172. package/dist/img/network-dark.11a147bb.png +0 -0
  173. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
  174. package/dist/img/wait-dark.6aa28731.png +0 -0
  175. package/dist/locale/ar.js +98 -0
  176. package/dist/locale/en.js +98 -0
  177. package/dist/locale/zh.js +98 -0
  178. package/dist/token.css +2982 -0
  179. package/dist/vdesign-ui.common.js +27204 -0
  180. package/dist/vdesign-ui.css +1 -0
  181. package/dist/vdesign-ui.umd.js +27214 -0
  182. package/dist/vdesign-ui.umd.min.js +32 -0
  183. package/package.json +1 -1
@@ -0,0 +1,292 @@
1
+ @title-prefix-cls: vd-list;
2
+
3
+ .@{title-prefix-cls} {
4
+
5
+ position: relative;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ background-color: var(--bg-color-1);
10
+
11
+ &--right {
12
+ display: flex;
13
+ align-items: center;
14
+ }
15
+
16
+ &-content {
17
+ display: flex;
18
+ align-items: center;
19
+ }
20
+
21
+ &-content-common {
22
+ flex-direction: column;
23
+ align-items: flex-start;
24
+ }
25
+
26
+ // &-inner__title{
27
+ // color: var(--color-title-head);
28
+ // }
29
+
30
+ &__subtext {
31
+ margin-block-start: calc(var(--spacing-title-subtitle-margin_top) * 1px);
32
+ color: var(--color-title-text);
33
+ }
34
+
35
+ &-arrow {
36
+ // color:var(--color-title-icon_arrow);
37
+ display: flex;
38
+ margin-inline-start: calc(var(--spacing-list-info_icon-margin_y) * 1px);
39
+
40
+ .vd-iconfont {
41
+ font-size: calc(var(--icon-small) * 1px);
42
+ color: var(--text-color-h2);
43
+ }
44
+ }
45
+
46
+ &__multext {
47
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
48
+ font-weight: var(--en-single-f-c-s-fontWeight);
49
+ color: var(--text-color-h1);
50
+ }
51
+
52
+ &-xs {
53
+ padding-block-start: calc(var(--spacing-list-info_s-padding_top) * 1px);
54
+ padding-block-end: calc(var(--spacing-list-info_s-padding_bottom) * 1px);
55
+ // &__icon--left{
56
+ // margin-inline-end: calc(var(--spacing-title-primary_icon-margin_y) * 1px);
57
+ // font-size: calc(var(--icon-title-primary) * 1px);
58
+ // }
59
+
60
+ &__icon--right {
61
+ font-size: 16px;
62
+ color: var(--text-color-h2);
63
+ }
64
+
65
+ &__title {
66
+ margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
67
+ color: var(--text-color-h2);
68
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
69
+ font-weight: var(--en-single-f-c-r-fontWeight);
70
+ }
71
+
72
+ &__text--right {
73
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
74
+ font-weight: var(--en-single-f-c-r-fontWeight);
75
+ color: var(--text-color-h1);
76
+ }
77
+
78
+ // &__subtext{
79
+ // font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
80
+ // font-weight: var(--en-single-f-c-r-fontWeight);
81
+ // }
82
+ }
83
+
84
+ &-s {
85
+ padding-block-start: calc(var(--spacing-list-info_m-padding_top) * 1px);
86
+ padding-block-end: calc(var(--spacing-list-info_m-padding_bottom) * 1px);
87
+
88
+ // &__icon--left{
89
+ // margin-inline-end: calc(var(--spacing-title-secondary_icon-margin_y) * 1px);
90
+ // font-size: calc(var(--icon-title-secondary) * 1px);
91
+ // }
92
+
93
+ &__icon--right {
94
+ font-size: 16px;
95
+ color: var(--text-color-h2);
96
+ }
97
+
98
+ &__title {
99
+ margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
100
+ color: var(--text-color-h1);
101
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
102
+ font-weight: var(--en-single-f-c-r-fontWeight);
103
+ }
104
+
105
+ &__text--right {
106
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
107
+ font-weight: var(--en-single-f-c-s-fontWeight);
108
+ color: var(--text-color-h1);
109
+ }
110
+
111
+ // &__subtext{
112
+ // font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
113
+ // font-weight: var(--en-single-f-b-r-fontWeight);
114
+ // }
115
+ }
116
+
117
+ &-m {
118
+ padding-block-start: calc(var(--spacing-list-info_l-padding_top) * 1px);
119
+ padding-block-end: calc(var(--spacing-list-info_l-padding_bottom) * 1px);
120
+
121
+ // &__icon--left{
122
+ // margin-inline-end: calc(var(--spacing-title-tertiary_icon-margin_y) * 1px);
123
+ // font-size: calc(var(--icon-title-tertiary) * 1px);
124
+ // }
125
+
126
+ &__icon--right {
127
+ // margin-inline-start: calc(var(--spacing-title-tertiary_icon-margin_y) * 1px);
128
+ font-size: 16px;
129
+ color: var(--text-color-h2);
130
+ }
131
+
132
+ &__title {
133
+ margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
134
+ color: var(--text-color-h2);
135
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
136
+ font-weight: var(--en-single-f-c-r-fontWeight);
137
+ }
138
+
139
+ &__text--right {
140
+ font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
141
+ font-weight: var(--en-single-f-d-r-fontWeight);
142
+ color: var(--text-color-h1);
143
+ }
144
+
145
+ // &__subtext{
146
+ // font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
147
+ // font-weight: var(--en-single-f-b-r-fontSize);
148
+ // }
149
+ }
150
+
151
+ &-l {
152
+ height: calc(var(--height-super-large) * 1px);
153
+
154
+ // &__icon--left{
155
+ // margin-inline-end: calc(var(--spacing-title-quaternary_icon-margin_y) * 1px);
156
+ // font-size: calc(var(--icon-title-quaternary) * 1px);
157
+ // }
158
+
159
+ &__icon--right {
160
+ font-size: 16px;
161
+ color: var(--text-color-h2);
162
+ }
163
+
164
+ &__title {
165
+ margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
166
+ color: var(--text-color-h1);
167
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
168
+ font-weight: var(--en-single-f-c-r-fontWeight);
169
+ }
170
+
171
+ &__text--right {
172
+ text-align: end;
173
+ font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
174
+ font-weight: var(--en-single-f-d-s-fontWeight);
175
+ color: var(--text-color-h1);
176
+ }
177
+
178
+ // &__subtext{
179
+ // font-size: calc(var(--en-single-f-a-r-fontSize) * 1px);
180
+ // font-weight: var(--en-single-f-a-r-fontSize);
181
+ // }
182
+ }
183
+
184
+ &-common {
185
+ padding-block-start: calc(var(--spacing-list-common-padding_x) * 1px);
186
+ padding-block-end: calc(var(--spacing-list-common-padding_x) * 1px);
187
+ padding-inline-start: calc(var(--spacing-list-common-padding_y) * 1px);
188
+ padding-inline-end: calc(var(--spacing-list-common-padding_y) * 1px);
189
+
190
+
191
+ &--left {
192
+ display: flex;
193
+ align-items: center;
194
+ }
195
+
196
+
197
+ &__icon--leftcus {
198
+ margin-inline-end: calc(var(--spacing-list-common_icon-margin_right) * 1px);
199
+ font-size: calc(var(--icon-large) * 1px);
200
+ color: var(--text-color-h2);
201
+ }
202
+
203
+ // &__icon--left{
204
+ // margin-inline-end: calc(var(--spacing-title-quaternary_icon-margin_y) * 1px);
205
+ // font-size: calc(var(--icon-title-quaternary) * 1px);
206
+ // }
207
+
208
+ // &__icon--right{
209
+ // margin-inline-start: calc(var(--spacing-title-quaternary_icon-margin_y) * 1px);
210
+ // font-size: calc(var(--icon-title-quaternary) * 1px);
211
+ // }
212
+
213
+ &__title {
214
+ // word-break: break-all;
215
+ // text-overflow: ellipsis;
216
+ // display: -webkit-box;
217
+ // -webkit-box-orient: vertical;
218
+ // -webkit-line-clamp: 2; /* 超出几行省略 */
219
+ // overflow: hidden;
220
+ color: var(--color-list-title);
221
+ font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
222
+ font-weight: var(--en-single-f-d-s-fontWeight);
223
+ }
224
+
225
+ &__text--right {
226
+ text-align: end;
227
+ margin-inline-start: calc(var(--spacing-list-common_describe-margin_xy) * 1px);
228
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
229
+ font-weight: var(--en-single-f-c-r-fontWeight);
230
+ color: var(--color-list-text);
231
+
232
+ }
233
+
234
+ &__subtext {
235
+ line-height: 21px;
236
+ color: var(--color-list-text);
237
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
238
+ font-weight: var(--en-single-f-c-r-fontWeight);
239
+ }
240
+
241
+ &__badge {
242
+ margin-inline-start: calc(var(--spacing-list-common_badge-margin_left) * 1px);
243
+ }
244
+ }
245
+
246
+
247
+ &-check {
248
+ padding-block-start: calc(var(--spacing-list-common-padding_x) * 1px);
249
+ padding-block-end: calc(var(--spacing-list-common-padding_x) * 1px);
250
+
251
+ &--active {
252
+
253
+ .@{title-prefix-cls}-check__select {
254
+ margin-inline-start: calc(var(--spacing-list-check-margin_left) * 1px);
255
+
256
+ .vd-iconfont {
257
+ transform: scaleX(1) !important;
258
+ direction: ltr;
259
+ font-size: calc(var(--icon-list-check) * 1px);
260
+ }
261
+ }
262
+
263
+ .@{title-prefix-cls}-check__title {
264
+ font-size: calc(var(--en-multi-f-d-s-fontSize) * 1px);
265
+ font-weight: var(--en-multi-f-d-s-fontWeight);
266
+ }
267
+ }
268
+
269
+ &__title {
270
+ color: var(--color-list-title);
271
+ font-size: calc(var(--en-multi-f-d-r-fontSize) * 1px);
272
+ font-weight: var(--en-multi-f-d-r-fontWeight);
273
+ }
274
+
275
+ &__icon--leftcus {
276
+ margin-inline-end: calc(var(--spacing-list-check_icon-margin_right) * 1px);
277
+ font-size: calc(var(--icon-large) * 1px);
278
+ color: var(--text-color-h2);
279
+ }
280
+ }
281
+
282
+ &__icon--extra {
283
+ font-size: 16px;
284
+ margin-inline-end: calc(var(--spacing-list-info_icon-margin_y) * 1px);
285
+ color: var(--text-color-h2);
286
+ }
287
+
288
+ &__switch {
289
+ display: flex;
290
+ margin-inline-start: calc(var(--spacing-list-common_switch-margin_left) * 1px);
291
+ }
292
+ }
@@ -0,0 +1,7 @@
1
+ import Loading from './index.vue';
2
+ import './style.less';
3
+ Loading.install = function(Vue) {
4
+ Vue.component(Loading.name, Loading)
5
+ }
6
+
7
+ export default Loading;
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div class="vd-loading-wrapper">
3
+
4
+ <div class="vd-loading" v-if="loading">
5
+ <slot>
6
+ <img src="./loading.png" alt="">
7
+ </slot>
8
+ <span class="vd-loading__text" v-if="text">{{ text }}</span>
9
+ </div>
10
+ <div class="vd-refresh" :class="refreshClasses" v-else>
11
+ <img src="./refresh.png" alt="">
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name:'vd-loading',
19
+ props:{
20
+ text:{
21
+ type: String,
22
+ default:''
23
+ },
24
+ loading:{
25
+ type: Boolean,
26
+ default:true
27
+ },
28
+ size:{
29
+ type: String,
30
+ default:'large'
31
+ }
32
+ },
33
+ computed:{
34
+ refreshClasses() {
35
+ return [
36
+ 'vd-refresh',
37
+ {
38
+ [`vd-refresh--${this.size}`]:this.size
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ methods:{
44
+ },
45
+ mounted(){
46
+
47
+ }
48
+ }
49
+ </script>
50
+
51
+ <style lang="less">
52
+ @import './style.less';
53
+ </style>
@@ -0,0 +1,48 @@
1
+
2
+ .vd-loading{
3
+ position: absolute;
4
+ left: 50%;
5
+ top: 50%;
6
+ transform: translate(-50%, -50%);
7
+ margin-block-start: -16px;
8
+ display: flex;
9
+ align-items: center;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ width: fit-content;
13
+ min-height: calc(var(--height-loading-small) * 1px);
14
+ min-width: calc(var(--width-loading-small) * 1px);
15
+ max-width: calc(var(--width-loading-large) * 1px);
16
+ background-color: var(--color-loading-bg);
17
+ border-radius: calc(var(--radius-loading-size) * 1px);
18
+ padding: calc(var(--spacing-loading-padding_x) * 1px) calc(var(--spacing-loading-padding_y) * 1px);
19
+ &__text{
20
+ margin-block-start: calc(var(--spacing-loading-icon-margin_bottom) * 1px);
21
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
22
+ font-weight: var(--en-single-f-c-r-fontWeight);
23
+ color: var(--color-loading-text);
24
+ }
25
+
26
+ img{
27
+ margin: 0 auto;
28
+ width: calc(var(--icon-loading-size) * 1px);
29
+ }
30
+ }
31
+
32
+
33
+ .vd-refresh{
34
+
35
+ position: absolute;
36
+ left: 50%;
37
+ transform: translateX(-50%);
38
+
39
+ &--large{
40
+ width: calc(var(--icon-loading-refres_large) * 1px);
41
+ }
42
+
43
+ &--small{
44
+ width: calc(var(--icon-loading-refres_small ) * 1px);
45
+ }
46
+
47
+ }
48
+
@@ -0,0 +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
+ };
@@ -0,0 +1,41 @@
1
+ /* istanbul ignore next */
2
+
3
+ import Vue from 'vue';
4
+
5
+ const isServer = Vue.prototype.$isServer;
6
+ /* istanbul ignore next */
7
+ export const on = (function () {
8
+ // 添加事件监听器
9
+ if (!isServer && document.addEventListener) {
10
+ return function (element, event, handler) {
11
+ if (element && event && handler) {
12
+ element.addEventListener(event, handler, false);
13
+ }
14
+ };
15
+ } else {
16
+ // IE8 及其以下版本没有 addEventListener 方法
17
+ return function (element, event, handler) {
18
+ if (element && event && handler) {
19
+ element.attachEvent('on' + event, handler);
20
+ }
21
+ };
22
+ }
23
+ })();
24
+
25
+ /* istanbul ignore next */
26
+ export const off = (function () {
27
+ // 移除事件监听器
28
+ if (!isServer && document.removeEventListener) {
29
+ return function (element, event, handler) {
30
+ if (element && event) {
31
+ element.removeEventListener(event, handler, false);
32
+ }
33
+ };
34
+ } else {
35
+ return function (element, event, handler) {
36
+ if (element && event) {
37
+ element.detachEvent('on' + event, handler);
38
+ }
39
+ };
40
+ }
41
+ })();
@@ -0,0 +1,38 @@
1
+ // src/mixins/languageMixin.js
2
+ export default {
3
+ data() {
4
+ return {
5
+ language: document.documentElement.lang || 'en' // 初始语言
6
+ }
7
+ },
8
+ mounted() {
9
+ this.updateLanguage();
10
+ this.setupLanguageObserver();
11
+ },
12
+ methods: {
13
+ updateLanguage() {
14
+ this.language = document.documentElement.lang || 'en';
15
+ },
16
+ setupLanguageObserver() {
17
+ const observer = new MutationObserver(() => {
18
+ this.updateLanguage();
19
+ });
20
+
21
+ observer.observe(document.documentElement, {
22
+ attributes: true,
23
+ attributeFilter: ['lang']
24
+ });
25
+
26
+ // 在组件销毁时断开观察者
27
+ this.$once('hook:beforeDestroy', () => {
28
+ observer.disconnect();
29
+ });
30
+ }
31
+ },
32
+ watch: {
33
+ // language(newLang) {
34
+ // // 当 language 变化时执行的操作
35
+ // console.log('Language changed to:', newLang);
36
+ // }
37
+ }
38
+ }
@@ -0,0 +1,40 @@
1
+ // outlineConfigPlugin.js
2
+
3
+ // __debug=1&__debug_vdesign_token=1
4
+ const OutlineConfig = {
5
+ install(Vue, options = {}) {
6
+ const outlineConfig = Vue.observable({
7
+ outlineEnabled: options.outlineEnabled ||false,
8
+ });
9
+
10
+ Vue.prototype.$outlineConfig = outlineConfig;
11
+
12
+ Vue.mixin({
13
+ created() {
14
+ this.$outlineConfig.outlineEnabled = this.shouldEnableOutline()
15
+
16
+ this.$watch('$outlineConfig.outlineEnabled', (newValue) => {
17
+ document.documentElement.style.setProperty('--outline-visible', newValue ? '1px' : '0');
18
+ }, { immediate: true });
19
+ },
20
+ methods:{
21
+ shouldEnableOutline() {
22
+ // 获取URL的查询参数部分
23
+ const searchParams = new URLSearchParams(window.location.search);
24
+ // 对于哈希模式,也解析哈希中的查询字符串
25
+ const hashParams = window.location.hash.split('?')[1] ? new URLSearchParams(window.location.hash.split('?')[1]) : null;
26
+
27
+ // 检查查询参数或哈希中的参数
28
+ const debug = searchParams.has('__debug') || (hashParams && hashParams.has('__debug')) ? searchParams.get('__debug') === '1' || (hashParams && hashParams.get('__debug') === '1') : false;
29
+ const vdesignToken = searchParams.has('__debug_vdesign_token') || (hashParams && hashParams.has('__debug_vdesign_token')) ? searchParams.get('__debug_vdesign_token') === '1' || (hashParams && hashParams.get('__debug_vdesign_token') === '1') : false;
30
+
31
+ return debug && vdesignToken;
32
+ }
33
+ }
34
+ });
35
+ }
36
+ };
37
+
38
+
39
+
40
+ export default OutlineConfig;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * add Vue-Router support
3
+ */
4
+
5
+ export default {
6
+ props: {
7
+ url: String,
8
+ replace: Boolean,
9
+ to: [String, Object]
10
+ },
11
+
12
+ methods: {
13
+ routerLink() {
14
+ const { to, url, $router, replace } = this;
15
+ if (to && $router) {
16
+ $router[replace ? 'replace' : 'push'](to);
17
+ } else if (url) {
18
+ replace ? location.replace(url) : location.href = url;
19
+ }
20
+ }
21
+ }
22
+ };
23
+
@@ -0,0 +1,29 @@
1
+ export const themeMixin = {
2
+ data() {
3
+ return {
4
+ theme: document.documentElement.getAttribute('theme') || 'light' // 初始化主题
5
+ };
6
+ },
7
+ mounted() {
8
+ this.observeThemeChanges(); // 组件挂载时开始监视主题变化
9
+ },
10
+ methods: {
11
+ observeThemeChanges() {
12
+ // 创建一个 MutationObserver 实例
13
+ const observer = new MutationObserver((mutations) => {
14
+ mutations.forEach((mutation) => {
15
+ // 检查变化的属性是否为 'theme'
16
+ if (mutation.attributeName === 'theme') {
17
+ // 更新组件的主题
18
+ this.theme = document.documentElement.getAttribute('theme') || 'light';
19
+ }
20
+ });
21
+ });
22
+
23
+ // 配置观察器,监视 html 元素的属性变化
24
+ observer.observe(document.documentElement, {
25
+ attributes: true // 仅监视属性变化
26
+ });
27
+ }
28
+ }
29
+ };
@@ -0,0 +1,8 @@
1
+ import Noticebar from './index.vue';
2
+ import './style.less';
3
+
4
+ Noticebar.install = function (Vue) {
5
+ Vue.component(Noticebar.name, Noticebar);
6
+ };
7
+
8
+ export default Noticebar;