cbvirtua 1.0.10 → 1.0.12

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 (62) hide show
  1. package/package.json +1 -1
  2. package/smoothscroll.js +431 -0
  3. package/vant/style/README.md +79 -0
  4. package/vant/style/README.zh-CN.md +79 -0
  5. package/vant/style/animation.less +139 -0
  6. package/vant/style/base.less +10 -0
  7. package/vant/style/clearfix.less +5 -0
  8. package/vant/style/demo/index.vue +110 -0
  9. package/vant/style/ellipsis.less +13 -0
  10. package/vant/style/hairline.less +47 -0
  11. package/vant/style/mixins/clearfix.less +7 -0
  12. package/vant/style/mixins/ellipsis.less +15 -0
  13. package/vant/style/mixins/hairline.less +39 -0
  14. package/vant/style/normalize.less +38 -0
  15. package/vant/style/reset.less +171 -0
  16. package/vant/style/var.less +901 -0
  17. package/vant/tab/README.md +307 -0
  18. package/vant/tab/README.zh-CN.md +342 -0
  19. package/vant/tab/demo/index.vue +193 -0
  20. package/vant/tab/index.js +95 -0
  21. package/vant/tab/index.less +17 -0
  22. package/vant/tab/test/__snapshots__/demo.spec.js.snap +349 -0
  23. package/vant/tab/test/__snapshots__/index.spec.js.snap +352 -0
  24. package/vant/tab/test/__snapshots__/insert.spec.js.snap +63 -0
  25. package/vant/tab/test/demo.spec.js +4 -0
  26. package/vant/tab/test/index.spec.js +435 -0
  27. package/vant/tab/test/insert.spec.js +75 -0
  28. package/vant/tabs/Content.js +79 -0
  29. package/vant/tabs/Title.js +91 -0
  30. package/vant/tabs/index.js +453 -0
  31. package/vant/tabs/index.less +153 -0
  32. package/vant/tabs/utils.ts +53 -0
  33. package/vant/utils/constant.ts +11 -0
  34. package/vant/utils/create/bem.ts +45 -0
  35. package/vant/utils/create/component.ts +86 -0
  36. package/vant/utils/create/i18n.ts +16 -0
  37. package/vant/utils/create/index.ts +14 -0
  38. package/vant/utils/deep-assign.ts +27 -0
  39. package/vant/utils/deep-clone.ts +23 -0
  40. package/vant/utils/dom/event.ts +56 -0
  41. package/vant/utils/dom/node.ts +7 -0
  42. package/vant/utils/dom/raf.ts +40 -0
  43. package/vant/utils/dom/reset-scroll.ts +16 -0
  44. package/vant/utils/dom/scroll.ts +81 -0
  45. package/vant/utils/dom/style.ts +11 -0
  46. package/vant/utils/format/number.ts +52 -0
  47. package/vant/utils/format/string.ts +15 -0
  48. package/vant/utils/format/unit.ts +61 -0
  49. package/vant/utils/functional.ts +73 -0
  50. package/vant/utils/index.ts +79 -0
  51. package/vant/utils/interceptor.ts +27 -0
  52. package/vant/utils/router.ts +54 -0
  53. package/vant/utils/test/bem.spec.js +39 -0
  54. package/vant/utils/test/index.spec.js +152 -0
  55. package/vant/utils/test/interceptor.spec.js +50 -0
  56. package/vant/utils/types.ts +40 -0
  57. package/vant/utils/validate/date.ts +8 -0
  58. package/vant/utils/validate/email.ts +5 -0
  59. package/vant/utils/validate/mobile.ts +6 -0
  60. package/vant/utils/validate/number.ts +12 -0
  61. package/vant/utils/validate/system.ts +13 -0
  62. package/vant/utils/vnodes.ts +33 -0
@@ -0,0 +1,139 @@
1
+ @import './var';
2
+
3
+ @keyframes van-slide-up-enter {
4
+ from {
5
+ transform: translate3d(0, 100%, 0);
6
+ }
7
+ }
8
+
9
+ @keyframes van-slide-up-leave {
10
+ to {
11
+ transform: translate3d(0, 100%, 0);
12
+ }
13
+ }
14
+
15
+ @keyframes van-slide-down-enter {
16
+ from {
17
+ transform: translate3d(0, -100%, 0);
18
+ }
19
+ }
20
+
21
+ @keyframes van-slide-down-leave {
22
+ to {
23
+ transform: translate3d(0, -100%, 0);
24
+ }
25
+ }
26
+
27
+ @keyframes van-slide-left-enter {
28
+ from {
29
+ transform: translate3d(-100%, 0, 0);
30
+ }
31
+ }
32
+
33
+ @keyframes van-slide-left-leave {
34
+ to {
35
+ transform: translate3d(-100%, 0, 0);
36
+ }
37
+ }
38
+
39
+ @keyframes van-slide-right-enter {
40
+ from {
41
+ transform: translate3d(100%, 0, 0);
42
+ }
43
+ }
44
+
45
+ @keyframes van-slide-right-leave {
46
+ to {
47
+ transform: translate3d(100%, 0, 0);
48
+ }
49
+ }
50
+
51
+ @keyframes van-fade-in {
52
+ from {
53
+ opacity: 0;
54
+ }
55
+
56
+ to {
57
+ opacity: 1;
58
+ }
59
+ }
60
+
61
+ @keyframes van-fade-out {
62
+ from {
63
+ opacity: 1;
64
+ }
65
+
66
+ to {
67
+ opacity: 0;
68
+ }
69
+ }
70
+
71
+ @keyframes van-rotate {
72
+ from {
73
+ transform: rotate(0deg);
74
+ }
75
+
76
+ to {
77
+ transform: rotate(360deg);
78
+ }
79
+ }
80
+
81
+ .van-fade {
82
+ &-enter-active {
83
+ animation: @animation-duration-base van-fade-in both
84
+ @animation-timing-function-enter;
85
+ }
86
+
87
+ &-leave-active {
88
+ animation: @animation-duration-base van-fade-out both
89
+ @animation-timing-function-leave;
90
+ }
91
+ }
92
+
93
+ .van-slide-up {
94
+ &-enter-active {
95
+ animation: van-slide-up-enter @animation-duration-base both
96
+ @animation-timing-function-enter;
97
+ }
98
+
99
+ &-leave-active {
100
+ animation: van-slide-up-leave @animation-duration-base both
101
+ @animation-timing-function-leave;
102
+ }
103
+ }
104
+
105
+ .van-slide-down {
106
+ &-enter-active {
107
+ animation: van-slide-down-enter @animation-duration-base both
108
+ @animation-timing-function-enter;
109
+ }
110
+
111
+ &-leave-active {
112
+ animation: van-slide-down-leave @animation-duration-base both
113
+ @animation-timing-function-leave;
114
+ }
115
+ }
116
+
117
+ .van-slide-left {
118
+ &-enter-active {
119
+ animation: van-slide-left-enter @animation-duration-base both
120
+ @animation-timing-function-enter;
121
+ }
122
+
123
+ &-leave-active {
124
+ animation: van-slide-left-leave @animation-duration-base both
125
+ @animation-timing-function-leave;
126
+ }
127
+ }
128
+
129
+ .van-slide-right {
130
+ &-enter-active {
131
+ animation: van-slide-right-enter @animation-duration-base both
132
+ @animation-timing-function-enter;
133
+ }
134
+
135
+ &-leave-active {
136
+ animation: van-slide-right-leave @animation-duration-base both
137
+ @animation-timing-function-leave;
138
+ }
139
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Entry of basic styles
3
+ */
4
+
5
+ @import './var';
6
+ @import './normalize';
7
+ @import './ellipsis';
8
+ @import './clearfix';
9
+ @import './hairline';
10
+ @import './animation';
@@ -0,0 +1,5 @@
1
+ @import './mixins/clearfix';
2
+
3
+ .van-clearfix {
4
+ .clearfix();
5
+ }
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <demo-section>
3
+ <demo-block :title="t('ellipsis')">
4
+ <div class="van-ellipsis">{{ t('text1') }}</div>
5
+ <div class="van-multi-ellipsis--l2">{{ t('text2') }}</div>
6
+ </demo-block>
7
+
8
+ <demo-block card :title="t('hairline')">
9
+ <div class="van-hairline--top" />
10
+ </demo-block>
11
+
12
+ <demo-block card :title="t('animation')">
13
+ <van-cell is-link title="Fade" @click="animate('van-fade')" />
14
+ <van-cell is-link title="Slide Up" @click="animate('van-slide-up')" />
15
+ <van-cell is-link title="Slide Down" @click="animate('van-slide-down')" />
16
+ <van-cell is-link title="Slide Left" @click="animate('van-slide-left')" />
17
+ <van-cell
18
+ is-link
19
+ title="Slide Right"
20
+ @click="animate('van-slide-right')"
21
+ />
22
+ </demo-block>
23
+
24
+ <transition :name="transitionName">
25
+ <div v-show="show" class="demo-animate-block" />
26
+ </transition>
27
+ </demo-section>
28
+ </template>
29
+
30
+ <script>
31
+ export default {
32
+ i18n: {
33
+ 'zh-CN': {
34
+ hairline: '1px 边框',
35
+ ellipsis: '文字省略',
36
+ animation: '动画',
37
+ toggle: '切换动画',
38
+ text1: '这是一段最多显示一行的文字,后面的内容会省略',
39
+ text2:
40
+ '这是一段最多显示两行的文字,后面的内容会省略。这是一段最多显示两行的文字,后面的内容会省略',
41
+ },
42
+ 'en-US': {
43
+ hairline: 'Hairline',
44
+ ellipsis: 'Text Ellipsis',
45
+ animation: 'Animation',
46
+ toggle: 'Switch animation',
47
+ text1:
48
+ 'This is a paragraph that displays up to one line of text, and the rest of the text will be omitted.',
49
+ text2:
50
+ 'This is a paragraph that displays up to two lines of text, and the rest of the text will be omitted.',
51
+ },
52
+ },
53
+
54
+ data() {
55
+ return {
56
+ show: false,
57
+ transitionName: '',
58
+ };
59
+ },
60
+
61
+ methods: {
62
+ animate(transitionName) {
63
+ this.show = true;
64
+ this.transitionName = transitionName;
65
+
66
+ setTimeout(() => {
67
+ this.show = false;
68
+ }, 500);
69
+ },
70
+ },
71
+ };
72
+ </script>
73
+
74
+ <style lang="less">
75
+ @import '../../style/var';
76
+
77
+ .demo-style {
78
+ .van-ellipsis,
79
+ .van-multi-ellipsis--l2 {
80
+ max-width: 300px;
81
+ margin-left: @padding-md;
82
+ font-size: 14px;
83
+ line-height: 18px;
84
+ }
85
+
86
+ .van-ellipsis {
87
+ margin-bottom: @padding-md;
88
+ }
89
+
90
+ .van-hairline--top {
91
+ height: 30px;
92
+ background-color: @white;
93
+
94
+ &::after {
95
+ top: 5px;
96
+ }
97
+ }
98
+
99
+ .demo-animate-block {
100
+ position: fixed;
101
+ top: 50%;
102
+ left: 50%;
103
+ width: 100px;
104
+ height: 100px;
105
+ margin: -50px 0 0 -50px;
106
+ background-color: @blue;
107
+ border-radius: 8px;
108
+ }
109
+ }
110
+ </style>
@@ -0,0 +1,13 @@
1
+ @import './mixins/ellipsis';
2
+
3
+ .van-ellipsis {
4
+ .ellipsis();
5
+ }
6
+
7
+ .van-multi-ellipsis--l2 {
8
+ .multi-ellipsis(2);
9
+ }
10
+
11
+ .van-multi-ellipsis--l3 {
12
+ .multi-ellipsis(3);
13
+ }
@@ -0,0 +1,47 @@
1
+ @import './var';
2
+ @import './mixins/hairline';
3
+
4
+ [class*='van-hairline'] {
5
+ &::after {
6
+ .hairline();
7
+ }
8
+ }
9
+
10
+ .van-hairline {
11
+ &,
12
+ &--top,
13
+ &--left,
14
+ &--right,
15
+ &--bottom,
16
+ &--surround,
17
+ &--top-bottom {
18
+ position: relative;
19
+ }
20
+
21
+ &--top::after {
22
+ border-top-width: @border-width-base;
23
+ }
24
+
25
+ &--left::after {
26
+ border-left-width: @border-width-base;
27
+ }
28
+
29
+ &--right::after {
30
+ border-right-width: @border-width-base;
31
+ }
32
+
33
+ &--bottom::after {
34
+ border-bottom-width: @border-width-base;
35
+ }
36
+
37
+ &,
38
+ &-unset {
39
+ &--top-bottom::after {
40
+ border-width: @border-width-base 0;
41
+ }
42
+ }
43
+
44
+ &--surround::after {
45
+ border-width: @border-width-base;
46
+ }
47
+ }
@@ -0,0 +1,7 @@
1
+ .clearfix() {
2
+ &::after {
3
+ display: table;
4
+ clear: both;
5
+ content: '';
6
+ }
7
+ }
@@ -0,0 +1,15 @@
1
+ .multi-ellipsis(@lines) {
2
+ display: -webkit-box;
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ -webkit-line-clamp: @lines;
6
+
7
+ /* autoprefixer: ignore next */
8
+ -webkit-box-orient: vertical;
9
+ }
10
+
11
+ .ellipsis() {
12
+ overflow: hidden;
13
+ white-space: nowrap;
14
+ text-overflow: ellipsis;
15
+ }
@@ -0,0 +1,39 @@
1
+ @import '../var';
2
+
3
+ .hairline-common() {
4
+ position: absolute;
5
+ box-sizing: border-box;
6
+ content: ' ';
7
+ pointer-events: none;
8
+ }
9
+
10
+ .hairline(@color: @border-color) {
11
+ .hairline-common();
12
+
13
+ top: -50%;
14
+ right: -50%;
15
+ bottom: -50%;
16
+ left: -50%;
17
+ border: 0 solid @color;
18
+ transform: scale(0.5);
19
+ }
20
+
21
+ .hairline-top(@color: @border-color, @left: 0, @right: 0) {
22
+ .hairline-common();
23
+
24
+ top: 0;
25
+ right: @right;
26
+ left: @left;
27
+ border-top: 1px solid @color;
28
+ transform: scaleY(0.5);
29
+ }
30
+
31
+ .hairline-bottom(@color: @border-color, @left: 0, @right: 0) {
32
+ .hairline-common();
33
+
34
+ right: @right;
35
+ bottom: 0;
36
+ left: @left;
37
+ border-bottom: 1px solid @color;
38
+ transform: scaleY(0.5);
39
+ }
@@ -0,0 +1,38 @@
1
+ @import './var';
2
+
3
+ html {
4
+ -webkit-tap-highlight-color: transparent;
5
+ }
6
+
7
+ body {
8
+ margin: 0;
9
+ font-family: @base-font-family;
10
+ }
11
+
12
+ a {
13
+ text-decoration: none;
14
+ }
15
+
16
+ input,
17
+ button,
18
+ textarea {
19
+ color: inherit;
20
+ font: inherit;
21
+ }
22
+
23
+ a,
24
+ input,
25
+ button,
26
+ textarea,
27
+ [class*='van-'] {
28
+ &:focus {
29
+ outline: none;
30
+ }
31
+ }
32
+
33
+ ol,
34
+ ul {
35
+ margin: 0;
36
+ padding: 0;
37
+ list-style: none;
38
+ }
@@ -0,0 +1,171 @@
1
+ @import './var';
2
+
3
+ html,
4
+ body,
5
+ div,
6
+ span,
7
+ applet,
8
+ object,
9
+ iframe,
10
+ h1,
11
+ h2,
12
+ h3,
13
+ h4,
14
+ h5,
15
+ h6,
16
+ p,
17
+ blockquote,
18
+ pre,
19
+ a,
20
+ abbr,
21
+ acronym,
22
+ address,
23
+ big,
24
+ cite,
25
+ code,
26
+ del,
27
+ dfn,
28
+ em,
29
+ img,
30
+ ins,
31
+ kbd,
32
+ q,
33
+ s,
34
+ samp,
35
+ small,
36
+ strike,
37
+ strong,
38
+ sub,
39
+ sup,
40
+ tt,
41
+ var,
42
+ b,
43
+ u,
44
+ i,
45
+ center,
46
+ dl,
47
+ dt,
48
+ dd,
49
+ ol,
50
+ ul,
51
+ li,
52
+ fieldset,
53
+ form,
54
+ label,
55
+ legend,
56
+ table,
57
+ caption,
58
+ tbody,
59
+ tfoot,
60
+ thead,
61
+ tr,
62
+ th,
63
+ td,
64
+ article,
65
+ aside,
66
+ canvas,
67
+ details,
68
+ embed,
69
+ figure,
70
+ figcaption,
71
+ footer,
72
+ header,
73
+ hgroup,
74
+ menu,
75
+ nav,
76
+ output,
77
+ ruby,
78
+ section,
79
+ summary,
80
+ time,
81
+ mark,
82
+ audio,
83
+ video {
84
+ margin: 0;
85
+ padding: 0;
86
+ font: inherit;
87
+ font-size: 100%;
88
+ vertical-align: baseline;
89
+ border: 0;
90
+ }
91
+
92
+ html {
93
+ line-height: 1;
94
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
95
+ }
96
+
97
+ ol,
98
+ ul {
99
+ list-style: none;
100
+ }
101
+
102
+ table {
103
+ border-collapse: collapse;
104
+ border-spacing: 0;
105
+ }
106
+
107
+ caption,
108
+ th,
109
+ td {
110
+ font-weight: normal;
111
+ vertical-align: middle;
112
+ }
113
+
114
+ q,
115
+ blockquote {
116
+ quotes: none;
117
+ }
118
+
119
+ q::before,
120
+ q::after,
121
+ blockquote::before,
122
+ blockquote::after {
123
+ content: '';
124
+ content: none;
125
+ }
126
+
127
+ a img {
128
+ border: none;
129
+ }
130
+
131
+ article,
132
+ aside,
133
+ details,
134
+ figcaption,
135
+ figure,
136
+ footer,
137
+ header,
138
+ hgroup,
139
+ menu,
140
+ nav,
141
+ section,
142
+ summary {
143
+ display: block;
144
+ }
145
+
146
+ * {
147
+ box-sizing: content-box;
148
+ }
149
+
150
+ body {
151
+ color: @text-color;
152
+ background-color: @background-color;
153
+ }
154
+
155
+ a {
156
+ text-decoration: none;
157
+ background: transparent;
158
+ }
159
+
160
+ button,
161
+ input[type='number'],
162
+ input[type='text'],
163
+ input[type='password'],
164
+ input[type='email'],
165
+ input[type='search'],
166
+ select,
167
+ textarea {
168
+ margin: 0;
169
+ font-family: inherit;
170
+ -webkit-appearance: none;
171
+ }