@varlet/cli 2.15.1 → 2.16.0-alpha.1693852004525

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 (60) hide show
  1. package/lib/node/config/varlet.config.js +2 -1
  2. package/lib/node/config/varlet.default.config.js +264 -7
  3. package/package.json +8 -7
  4. package/site/mobile/App.vue +25 -22
  5. package/site/mobile/{components/AppHome.vue → AppHome.vue} +6 -6
  6. package/site/mobile/main.ts +6 -21
  7. package/site/pc/App.vue +0 -5
  8. package/site/pc/Layout.vue +24 -28
  9. package/site/pc/components/AppHeader.vue +123 -122
  10. package/site/pc/components/AppMobile.vue +9 -2
  11. package/site/pc/components/AppSidebar.vue +18 -17
  12. package/site/{components → pc/components}/code-example/CodeExample.vue +8 -15
  13. package/site/pc/main.ts +6 -23
  14. package/site/pc/pages/index/index.vue +316 -47
  15. package/site/types.ts +6 -0
  16. package/template/generators/base/package.json +1 -0
  17. package/site/components/button/Button.vue +0 -106
  18. package/site/components/button/button.less +0 -183
  19. package/site/components/button/index.ts +0 -10
  20. package/site/components/button/props.ts +0 -78
  21. package/site/components/cell/Cell.vue +0 -54
  22. package/site/components/cell/cell.less +0 -78
  23. package/site/components/cell/index.ts +0 -10
  24. package/site/components/cell/props.ts +0 -27
  25. package/site/components/context/index.ts +0 -21
  26. package/site/components/context/lock.ts +0 -92
  27. package/site/components/context/zIndex.ts +0 -20
  28. package/site/components/icon/Icon.vue +0 -75
  29. package/site/components/icon/icon.less +0 -38
  30. package/site/components/icon/index.ts +0 -10
  31. package/site/components/icon/props.ts +0 -24
  32. package/site/components/loading/Loading.vue +0 -84
  33. package/site/components/loading/index.ts +0 -10
  34. package/site/components/loading/loading.less +0 -505
  35. package/site/components/loading/props.ts +0 -42
  36. package/site/components/popup/Popup.tsx +0 -102
  37. package/site/components/popup/index.ts +0 -10
  38. package/site/components/popup/popup.less +0 -125
  39. package/site/components/popup/props.ts +0 -63
  40. package/site/components/ripple/index.ts +0 -188
  41. package/site/components/ripple/ripple.less +0 -20
  42. package/site/components/snackbar/Snackbar.vue +0 -41
  43. package/site/components/snackbar/core.vue +0 -132
  44. package/site/components/snackbar/index.tsx +0 -270
  45. package/site/components/snackbar/props.ts +0 -97
  46. package/site/components/snackbar/snackbar.less +0 -135
  47. package/site/components/styles/common.less +0 -64
  48. package/site/components/styles/elevation.less +0 -126
  49. package/site/components/styles/var.less +0 -27
  50. package/site/components/utils/components.ts +0 -114
  51. package/site/components/utils/elements.ts +0 -104
  52. package/site/mobile/components/app-bar/AppBar.vue +0 -65
  53. package/site/mobile/components/app-bar/appBar.less +0 -57
  54. package/site/mobile/components/app-bar/index.ts +0 -10
  55. package/site/mobile/components/app-bar/props.ts +0 -25
  56. package/site/pc/components/AnimationBox.vue +0 -62
  57. package/site/pc/components/LogoAnimation.vue +0 -119
  58. package/site/pc/pages/index/index.less +0 -204
  59. /package/site/{components → pc/components}/code-example/codeExample.less +0 -0
  60. /package/site/{components → pc/components}/code-example/index.ts +0 -0
@@ -1,24 +0,0 @@
1
- import type { PropType } from 'vue'
2
-
3
- export const props = {
4
- name: {
5
- type: String,
6
- },
7
- size: {
8
- type: [Number, String],
9
- },
10
- color: {
11
- type: String,
12
- },
13
- namespace: {
14
- type: String,
15
- default: 'var-icon',
16
- },
17
- transition: {
18
- type: [Number, String],
19
- default: 0,
20
- },
21
- onClick: {
22
- type: Function as PropType<(event: Event) => void>,
23
- },
24
- }
@@ -1,84 +0,0 @@
1
- <template>
2
- <div :class="n()">
3
- <div :class="classes(n('content'), [loading, n('content--active')])" v-if="$slots.default">
4
- <slot />
5
- <div :class="n('content-mask')" v-if="loading"></div>
6
- </div>
7
- <div :class="classes('var-site--box', n('body'), [$slots.default, n('inside')])" v-if="isShow">
8
- <div :class="n('circle')" v-if="type === 'circle'">
9
- <span
10
- :class="classes(n('circle-block'), n(`circle-block--${size}`))"
11
- :style="{
12
- width: multiplySizeUnit(radius, 2),
13
- height: multiplySizeUnit(radius, 2),
14
- color,
15
- }"
16
- >
17
- <svg viewBox="25 25 50 50">
18
- <circle cx="50" cy="50" r="20" fill="none"></circle>
19
- </svg>
20
- </span>
21
- </div>
22
-
23
- <template v-for="(nums, key) in loadingTypeDict" :key="key">
24
- <div :class="classes(n(key), n(`${key}--${size}`))" v-if="type === key">
25
- <div
26
- v-for="num in nums"
27
- :key="num + key"
28
- :style="{ backgroundColor: color }"
29
- :class="classes(n(`${key}-item`), n(`${key}-item--${size}`))"
30
- ></div>
31
- </div>
32
- </template>
33
- <div
34
- :class="classes(n('description'), n(`description--${size}`))"
35
- :style="{ color }"
36
- v-if="$slots.description || description"
37
- >
38
- <slot name="description">{{ description }}</slot>
39
- </div>
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script lang="ts">
45
- import { computed, defineComponent } from 'vue'
46
- import { props } from './props'
47
- import { createNamespace, call } from '../utils/components'
48
- import { multiplySizeUnit } from '../utils/elements'
49
- import type { ComputedRef } from 'vue'
50
-
51
- const { n, classes } = createNamespace('loading')
52
-
53
- export default defineComponent({
54
- name: 'VarLoading',
55
- props,
56
- setup(props, { slots }) {
57
- const loadingTypeDict = {
58
- wave: 5,
59
- cube: 4,
60
- rect: 8,
61
- disappear: 3,
62
- }
63
-
64
- const isShow: ComputedRef<boolean> = computed(() => {
65
- if (!call(slots.default)) return true
66
-
67
- return props.loading
68
- })
69
-
70
- return {
71
- n,
72
- classes,
73
- multiplySizeUnit,
74
- loadingTypeDict,
75
- isShow,
76
- }
77
- },
78
- })
79
- </script>
80
-
81
- <style lang="less">
82
- @import '../styles/common';
83
- @import './loading';
84
- </style>
@@ -1,10 +0,0 @@
1
- import type { App } from 'vue'
2
- import Loading from './Loading.vue'
3
-
4
- Loading.install = function (app: App) {
5
- app.component(Loading.name, Loading)
6
- }
7
-
8
- export const _LoadingComponent = Loading
9
-
10
- export default Loading
@@ -1,505 +0,0 @@
1
- @import '../styles/var';
2
-
3
- @site-loading-opacity: 0.38;
4
- @site-loading-desc-margin: 8px 0 0;
5
- @site-loading-normal-width: 50px;
6
- @site-loading-normal-height: @site-font-size-md + 2;
7
-
8
- @site-loading-large-width: 64px;
9
- @site-loading-large-height: @site-font-size-lg + 2;
10
-
11
- @site-loading-small-width: 36px;
12
- @site-loading-small-height: @site-font-size-sm + 2;
13
-
14
- @site-loading-mini-width: 22px;
15
- @site-loading-mini-height: @site-font-size-xs + 2;
16
-
17
- :root {
18
- --site-loading-opacity: @site-loading-opacity;
19
- --site-loading-desc-margin: @site-loading-desc-margin;
20
- }
21
-
22
- .var-site-loading {
23
- position: relative;
24
-
25
- &__content {
26
- position: relative;
27
- transition: opacity 0.3s;
28
- opacity: 1;
29
-
30
- &--active {
31
- opacity: var(--site-loading-opacity);
32
- }
33
-
34
- &-mask {
35
- position: absolute;
36
- left: 0;
37
- right: 0;
38
- top: 0;
39
- bottom: 0;
40
- }
41
- }
42
-
43
- &__body {
44
- display: flex;
45
- justify-content: center;
46
- align-items: center;
47
- height: 100%;
48
- flex-direction: column;
49
- }
50
-
51
- &__inside {
52
- position: absolute;
53
- left: 50%;
54
- top: 50%;
55
- transform: translate(-50%, -50%);
56
- z-index: 1;
57
- }
58
-
59
- &__description {
60
- color: @site-color-primary;
61
- margin: var(--site-loading-desc-margin);
62
-
63
- &--large {
64
- font-size: @site-font-size-lg;
65
- }
66
-
67
- &--normal {
68
- font-size: @site-font-size-md;
69
- }
70
-
71
- &--small {
72
- font-size: @site-font-size-sm;
73
- }
74
-
75
- &--mini {
76
- font-size: @site-font-size-xs;
77
- }
78
- }
79
-
80
- &__circle {
81
- display: flex;
82
-
83
- &-block {
84
- display: inline-block;
85
- color: @site-color-primary;
86
- animation: circle 1.8s linear infinite;
87
-
88
- &--large {
89
- width: 36px;
90
- height: 36px;
91
- }
92
-
93
- &--normal {
94
- width: 30px;
95
- height: 30px;
96
- }
97
-
98
- &--small {
99
- width: 24px;
100
- height: 24px;
101
- }
102
-
103
- &--mini {
104
- width: 18px;
105
- height: 18px;
106
- }
107
-
108
- svg {
109
- display: block;
110
- width: 100%;
111
- height: 100%;
112
-
113
- circle {
114
- animation: circular 1.5s ease-in-out infinite;
115
- stroke: currentColor;
116
- stroke-width: 3;
117
- stroke-linecap: round;
118
- }
119
- }
120
- }
121
-
122
- @keyframes circle {
123
- from {
124
- transform: rotate(0deg);
125
- }
126
- to {
127
- transform: rotate(360deg);
128
- }
129
- }
130
- @keyframes circular {
131
- 0% {
132
- stroke-dasharray: 1, 200;
133
- stroke-dashoffset: 0;
134
- }
135
-
136
- 50% {
137
- stroke-dasharray: 90, 150;
138
- stroke-dashoffset: -40;
139
- }
140
-
141
- 100% {
142
- stroke-dasharray: 90, 150;
143
- stroke-dashoffset: -120;
144
- }
145
- }
146
- }
147
-
148
- &__wave {
149
- @site-loading-wave-size-item-width: 5px;
150
- @site-loading-wave-size-item-margin: 5px;
151
-
152
- display: flex;
153
- align-items: center;
154
- justify-content: center;
155
-
156
- &--large {
157
- width: @site-loading-large-width;
158
- height: @site-loading-large-height;
159
- }
160
-
161
- &--normal {
162
- width: @site-loading-normal-width;
163
- height: @site-loading-normal-height;
164
- }
165
-
166
- &--small {
167
- width: @site-loading-small-width;
168
- height: @site-loading-small-height;
169
- }
170
-
171
- &--mini {
172
- width: @site-loading-mini-width;
173
- height: @site-loading-mini-height;
174
- }
175
-
176
- &-item {
177
- height: 100%;
178
- display: inline-block;
179
- animation: 1.2s ease-in-out infinite wave;
180
- background-color: @site-color-primary;
181
-
182
- &:nth-child(1) {
183
- animation-delay: -1.2s;
184
- margin-left: 0;
185
- }
186
-
187
- &:nth-child(2) {
188
- animation-delay: -1.1s;
189
- }
190
-
191
- &:nth-child(3) {
192
- animation-delay: -1s;
193
- }
194
-
195
- &:nth-child(4) {
196
- animation-delay: -0.9s;
197
- }
198
-
199
- &:nth-child(5) {
200
- animation-delay: -0.8s;
201
- }
202
- }
203
-
204
- &-item--large {
205
- width: @site-loading-wave-size-item-width;
206
- margin-left: @site-loading-wave-size-item-margin;
207
- }
208
-
209
- &-item--normal {
210
- width: @site-loading-wave-size-item-width - 1;
211
- margin-left: @site-loading-wave-size-item-margin - 1;
212
- }
213
-
214
- &-item--small {
215
- width: @site-loading-wave-size-item-width - 2;
216
- margin-left: @site-loading-wave-size-item-margin - 2;
217
- }
218
-
219
- &-item--mini {
220
- width: @site-loading-wave-size-item-width - 3;
221
- margin-left: @site-loading-wave-size-item-margin - 3;
222
- }
223
-
224
- @keyframes wave {
225
- 0%,
226
- 40%,
227
- 100% {
228
- transform: scaleY(0.4);
229
- }
230
- 20% {
231
- transform: scaleY(1);
232
- }
233
- }
234
- }
235
-
236
- &__cube {
237
- @site-loading-cube-size-item-width: 10px;
238
- @site-loading-cube-size-item-height: 10px;
239
- @site-loading-cube-size-item-margin: 5px;
240
-
241
- display: flex;
242
- align-items: center;
243
-
244
- &--large {
245
- width: @site-loading-large-width;
246
- height: @site-loading-large-height;
247
- }
248
-
249
- &--normal {
250
- width: @site-loading-normal-width;
251
- height: @site-loading-normal-height;
252
- }
253
-
254
- &--small {
255
- width: @site-loading-small-width;
256
- height: @site-loading-small-height;
257
- }
258
-
259
- &--mini {
260
- width: @site-loading-mini-width;
261
- height: @site-loading-mini-height;
262
- }
263
-
264
- &-item {
265
- display: inline-block;
266
- transform-origin: right bottom;
267
- animation: 1.5s ease infinite cube;
268
- background-color: @site-color-primary;
269
-
270
- &:nth-child(1) {
271
- animation-delay: 0.2s;
272
- margin-left: 0;
273
- }
274
-
275
- &:nth-child(2) {
276
- animation-delay: 0.4s;
277
- }
278
-
279
- &:nth-child(3) {
280
- animation-delay: 0.6s;
281
- }
282
-
283
- &:nth-child(4) {
284
- animation-delay: 0.8s;
285
- }
286
- }
287
-
288
- &-item--large {
289
- height: @site-loading-cube-size-item-height;
290
- width: @site-loading-cube-size-item-width;
291
- margin-left: @site-loading-cube-size-item-margin;
292
- }
293
-
294
- &-item--normal {
295
- height: @site-loading-cube-size-item-height - 2;
296
- width: @site-loading-cube-size-item-width - 2;
297
- margin-left: @site-loading-cube-size-item-margin - 1;
298
- }
299
-
300
- &-item--small {
301
- height: @site-loading-cube-size-item-height - 4;
302
- width: @site-loading-cube-size-item-width - 4;
303
- margin-left: @site-loading-cube-size-item-margin - 2;
304
- }
305
-
306
- &-item--mini {
307
- height: @site-loading-cube-size-item-height - 6;
308
- width: @site-loading-cube-size-item-width - 6;
309
- margin-left: @site-loading-cube-size-item-margin - 3;
310
- }
311
-
312
- @keyframes cube {
313
- 0% {
314
- opacity: 1;
315
- transform: scale(1);
316
- }
317
- 100% {
318
- opacity: 0;
319
- transform: rotate(90deg) scale(0.3);
320
- }
321
- }
322
- }
323
-
324
- &__rect {
325
- @site-loading-rect-size-item-width: 8px;
326
- @site-loading-rect-size-item-height: 100%;
327
-
328
- display: flex;
329
- flex-wrap: nowrap;
330
- justify-content: center;
331
- align-items: center;
332
-
333
- &--large {
334
- width: @site-loading-large-width;
335
- height: @site-loading-large-height;
336
- }
337
-
338
- &--normal {
339
- width: @site-loading-normal-width;
340
- height: @site-loading-normal-height;
341
- }
342
-
343
- &--small {
344
- width: @site-loading-small-width;
345
- height: @site-loading-small-height;
346
- }
347
-
348
- &--mini {
349
- width: @site-loading-mini-width;
350
- height: @site-loading-mini-height;
351
- }
352
-
353
- &-item {
354
- animation: 2s ease-in-out infinite rect;
355
- background-color: @site-color-primary;
356
-
357
- &:nth-child(1) {
358
- animation-delay: 1.75s;
359
- }
360
-
361
- &:nth-child(2) {
362
- animation-delay: 1.5s;
363
- }
364
-
365
- &:nth-child(3) {
366
- animation-delay: 1.25s;
367
- }
368
-
369
- &:nth-child(4) {
370
- animation-delay: 1s;
371
- }
372
-
373
- &:nth-child(5) {
374
- animation-delay: 0.75s;
375
- }
376
-
377
- &:nth-child(6) {
378
- animation-delay: 0.5s;
379
- }
380
-
381
- &:nth-child(7) {
382
- animation-delay: 0.25s;
383
- }
384
-
385
- &:nth-child(8) {
386
- animation-delay: 0s;
387
- }
388
- }
389
-
390
- &-item--large {
391
- height: @site-loading-rect-size-item-height;
392
- width: @site-loading-rect-size-item-width;
393
- }
394
-
395
- &-item--normal {
396
- height: @site-loading-rect-size-item-height * 0.9;
397
- width: @site-loading-rect-size-item-width * 0.8;
398
- }
399
-
400
- &-item--small {
401
- height: @site-loading-rect-size-item-height * 0.8;
402
- width: @site-loading-rect-size-item-width * 0.6;
403
- }
404
-
405
- &-item--mini {
406
- height: @site-loading-rect-size-item-height * 0.7;
407
- width: @site-loading-rect-size-item-width * 0.4;
408
- }
409
-
410
- @keyframes rect {
411
- 0% {
412
- opacity: 0.3;
413
- }
414
- 25% {
415
- opacity: 1;
416
- }
417
- 50% {
418
- opacity: 0.3;
419
- }
420
- 65% {
421
- opacity: 1;
422
- }
423
- 100% {
424
- opacity: 0.3;
425
- }
426
- }
427
- }
428
-
429
- &__disappear {
430
- @site-loading-disappear-size-item-width: 15px;
431
- @site-loading-disappear-size-item-height: 15px;
432
-
433
- display: flex;
434
- justify-content: space-around;
435
- align-items: center;
436
- flex-flow: nowrap;
437
-
438
- &--large {
439
- width: @site-loading-large-width;
440
- height: @site-loading-large-height;
441
- }
442
-
443
- &--normal {
444
- width: @site-loading-normal-width;
445
- height: @site-loading-normal-height;
446
- }
447
-
448
- &--small {
449
- width: @site-loading-small-width;
450
- height: @site-loading-small-height;
451
- }
452
-
453
- &--mini {
454
- width: @site-loading-mini-width;
455
- height: @site-loading-mini-height;
456
- }
457
-
458
- &-item {
459
- border-radius: 50%;
460
- animation: 0.5s ease-in-out infinite alternate disappear;
461
- background-color: @site-color-primary;
462
-
463
- &:nth-child(1) {
464
- animation-delay: -0.4s;
465
- }
466
-
467
- &:nth-child(2) {
468
- animation-delay: -0.2s;
469
- }
470
-
471
- &:nth-child(3) {
472
- animation-delay: 0s;
473
- }
474
- }
475
-
476
- &-item--large {
477
- height: @site-loading-disappear-size-item-height;
478
- width: @site-loading-disappear-size-item-width;
479
- }
480
-
481
- &-item--normal {
482
- height: @site-loading-disappear-size-item-height * 0.8;
483
- width: @site-loading-disappear-size-item-width * 0.8;
484
- }
485
-
486
- &-item--small {
487
- height: @site-loading-disappear-size-item-height * 0.6;
488
- width: @site-loading-disappear-size-item-width * 0.6;
489
- }
490
-
491
- &-item--mini {
492
- height: @site-loading-disappear-size-item-height * 0.4;
493
- width: @site-loading-disappear-size-item-width * 0.4;
494
- }
495
-
496
- @keyframes disappear {
497
- 0% {
498
- opacity: 1;
499
- }
500
- 100% {
501
- opacity: 0;
502
- }
503
- }
504
- }
505
- }
@@ -1,42 +0,0 @@
1
- import type { PropType } from 'vue'
2
-
3
- export type LoadingType = 'circle' | 'wave' | 'cube' | 'rect' | 'disappear'
4
-
5
- export type LoadingSize = 'normal' | 'mini' | 'small' | 'large'
6
-
7
- export function typeValidator(type: string): boolean {
8
- return ['circle', 'wave', 'cube', 'rect', 'disappear'].includes(type)
9
- }
10
-
11
- export function sizeValidator(size: string): boolean {
12
- return ['normal', 'mini', 'small', 'large'].includes(size)
13
- }
14
-
15
- export const props = {
16
- // loading类型
17
- type: {
18
- type: String as PropType<LoadingType>,
19
- default: 'circle',
20
- validator: typeValidator,
21
- },
22
- radius: {
23
- type: [String, Number],
24
- },
25
- // loading尺寸
26
- size: {
27
- type: String as PropType<LoadingSize>,
28
- default: 'normal',
29
- validator: sizeValidator,
30
- },
31
- // loading颜色
32
- color: {
33
- type: String,
34
- },
35
- description: {
36
- type: String,
37
- },
38
- loading: {
39
- type: Boolean,
40
- default: false,
41
- },
42
- }