dpzvc-ui 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +46 -0
- package/build-style.js +42 -0
- package/dist/dpzvc.js +17605 -0
- package/dist/styles/dpzvc.css +1 -0
- package/dist-prod/index.html +26 -0
- package/dist-prod/main.js +1 -0
- package/dist-prod/vendor.bundle.js +1 -0
- package/package.json +88 -0
- package/src/components/Indicator/Indicator.vue +77 -0
- package/src/components/Indicator/index.js +153 -0
- package/src/components/Text/Number.vue +201 -0
- package/src/components/Text/index.js +7 -0
- package/src/components/Text/textBar.vue +142 -0
- package/src/components/action-sheet/actionSheet.vue +91 -0
- package/src/components/action-sheet/index.js +5 -0
- package/src/components/app.vue +66 -0
- package/src/components/badge/badge.vue +77 -0
- package/src/components/badge/index.js +5 -0
- package/src/components/button/button.vue +122 -0
- package/src/components/button/index.js +5 -0
- package/src/components/card/card.vue +59 -0
- package/src/components/card/index.js +5 -0
- package/src/components/cell/cell.vue +103 -0
- package/src/components/cell/index.js +5 -0
- package/src/components/cell-swipe/cell-swipe.vue +148 -0
- package/src/components/cell-swipe/index.js +5 -0
- package/src/components/checkBox/checkbox-group.vue +76 -0
- package/src/components/checkBox/checkbox.vue +107 -0
- package/src/components/checkBox/index.js +8 -0
- package/src/components/header/header.vue +82 -0
- package/src/components/header/index.js +5 -0
- package/src/components/loadMore/index.js +5 -0
- package/src/components/loadMore/loadmore.vue +293 -0
- package/src/components/message/confirm.js +52 -0
- package/src/components/message/index.js +132 -0
- package/src/components/message/message.vue +135 -0
- package/src/components/message/messageGroup.vue +74 -0
- package/src/components/modal/confirm.js +161 -0
- package/src/components/modal/index.js +63 -0
- package/src/components/modal/modal.vue +144 -0
- package/src/components/picker/area-picker/area-picker.vue +223 -0
- package/src/components/picker/area-picker/props.js +17 -0
- package/src/components/picker/date-picker/date-picker.vue +291 -0
- package/src/components/picker/date-picker/props.js +24 -0
- package/src/components/picker/index.js +5 -0
- package/src/components/picker/normal-picker/normal-picker.vue +107 -0
- package/src/components/picker/normal-picker/props.js +20 -0
- package/src/components/picker/picker-slot.vue +206 -0
- package/src/components/picker/picker.vue +111 -0
- package/src/components/popup/index.js +5 -0
- package/src/components/popup/popup.vue +117 -0
- package/src/components/progress/index.js +5 -0
- package/src/components/progress/progress.vue +77 -0
- package/src/components/prompt/confirm.js +174 -0
- package/src/components/prompt/index.js +50 -0
- package/src/components/prompt/prompt.vue +166 -0
- package/src/components/radioBox/index.js +8 -0
- package/src/components/radioBox/radiobox-group.vue +74 -0
- package/src/components/radioBox/radiobox.vue +117 -0
- package/src/components/rater/index.js +5 -0
- package/src/components/rater/rater.vue +164 -0
- package/src/components/slideBar/index.js +6 -0
- package/src/components/slideBar/slideBar.vue +269 -0
- package/src/components/spinner/behavior/blade.vue +22 -0
- package/src/components/spinner/behavior/double-bounce.vue +22 -0
- package/src/components/spinner/behavior/fading-circle.vue +37 -0
- package/src/components/spinner/behavior/snake.vue +32 -0
- package/src/components/spinner/behavior/triple-bounce.vue +41 -0
- package/src/components/spinner/index.js +5 -0
- package/src/components/spinner/props.js +25 -0
- package/src/components/spinner/spinner.vue +74 -0
- package/src/components/swipe/index.js +5 -0
- package/src/components/swipe/swipe.vue +399 -0
- package/src/components/switchbar/index.js +5 -0
- package/src/components/switchbar/switchbar.vue +83 -0
- package/src/components/tab/index.js +6 -0
- package/src/components/tab/tab.vue +95 -0
- package/src/components/toTop/index.js +5 -0
- package/src/components/toTop/topTop.vue +76 -0
- package/src/components/upload/index.js +5 -0
- package/src/components/upload/upload.vue +200 -0
- package/src/config/config.js +17 -0
- package/src/directives/clickoutside.js +32 -0
- package/src/directives/tranferDom.js +65 -0
- package/src/index.js +83 -0
- package/src/lib/MegaPixImage.js +253 -0
- package/src/lib/exif.js +808 -0
- package/src/main.js +76 -0
- package/src/mixin/emitter.js +41 -0
- package/src/mixin/input.js +41 -0
- package/src/router.js +229 -0
- package/src/styles/base/font.less +99 -0
- package/src/styles/base/reset.less +69 -0
- package/src/styles/base/variable.less +108 -0
- package/src/styles/components/actionSheet.less +43 -0
- package/src/styles/components/badge.less +79 -0
- package/src/styles/components/button.less +123 -0
- package/src/styles/components/card.less +31 -0
- package/src/styles/components/cell-swipe.less +20 -0
- package/src/styles/components/cell.less +71 -0
- package/src/styles/components/checkBox.less +111 -0
- package/src/styles/components/editor.less +3 -0
- package/src/styles/components/header.less +70 -0
- package/src/styles/components/indicator.less +37 -0
- package/src/styles/components/loadmore.less +48 -0
- package/src/styles/components/message.less +57 -0
- package/src/styles/components/modal.less +82 -0
- package/src/styles/components/number.less +58 -0
- package/src/styles/components/picker.less +150 -0
- package/src/styles/components/popup.less +46 -0
- package/src/styles/components/progress.less +50 -0
- package/src/styles/components/prompt.less +37 -0
- package/src/styles/components/radioBox.less +136 -0
- package/src/styles/components/slide-Bar.less +147 -0
- package/src/styles/components/spinner.less +328 -0
- package/src/styles/components/swipe.less +125 -0
- package/src/styles/components/switchBar.less +88 -0
- package/src/styles/components/tab.less +69 -0
- package/src/styles/components/text.less +80 -0
- package/src/styles/components/toTop.less +26 -0
- package/src/styles/components/upload.less +23 -0
- package/src/styles/index.less +38 -0
- package/src/styles/utils/1px.less +204 -0
- package/src/styles/utils/animation.less +131 -0
- package/src/styles/utils/nowrap.less +19 -0
- package/src/template/index.ejs +26 -0
- package/src/utils/util.js +203 -0
- package/src/vconsole-resources.min.js +6 -0
- package/src/vconsole-sources.min.js +6 -0
- package/src/vconsole.min.js +7 -0
- package/src/views/ActionSheet.vue +33 -0
- package/src/views/Badge.vue +40 -0
- package/src/views/Button.vue +40 -0
- package/src/views/Card.vue +52 -0
- package/src/views/Cell.vue +21 -0
- package/src/views/CellSwipe.vue +85 -0
- package/src/views/CheckBox.vue +53 -0
- package/src/views/Header.vue +47 -0
- package/src/views/Indicator.vue +69 -0
- package/src/views/LoadMore.vue +54 -0
- package/src/views/Message.vue +42 -0
- package/src/views/Modal.vue +32 -0
- package/src/views/Picker.vue +50 -0
- package/src/views/Popup.vue +87 -0
- package/src/views/Progress.vue +32 -0
- package/src/views/Prompt.vue +31 -0
- package/src/views/RadioBox.vue +55 -0
- package/src/views/Rater.vue +39 -0
- package/src/views/SlideBar.vue +47 -0
- package/src/views/Spinner.vue +15 -0
- package/src/views/Swipe.vue +34 -0
- package/src/views/SwitchBar.vue +36 -0
- package/src/views/Tab.vue +41 -0
- package/src/views/Text.vue +64 -0
- package/src/views/ToTop.vue +17 -0
- package/src/views/Upload.vue +44 -0
- package/src/views/guide.vue +159 -0
- package/src/views/index.vue +435 -0
- package/webpack.base.config.js +74 -0
- package/webpack.dev.config.js +67 -0
- package/webpack.dist.dev.config.js +44 -0
- package/webpack.dist.prod.config.js +50 -0
- package/webpack.prod.config.js +72 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// base
|
|
2
|
+
@import "base/variable.less";
|
|
3
|
+
@import "base/reset.less";
|
|
4
|
+
|
|
5
|
+
// utils
|
|
6
|
+
@import "utils/animation.less";
|
|
7
|
+
@import "utils/nowrap.less";
|
|
8
|
+
@import "utils/1px.less";
|
|
9
|
+
|
|
10
|
+
// components
|
|
11
|
+
@import "components/header.less";
|
|
12
|
+
@import "components/actionsheet.less";
|
|
13
|
+
@import "components/message.less";
|
|
14
|
+
@import "components/picker.less";
|
|
15
|
+
@import "components/tab.less";
|
|
16
|
+
@import "components/modal.less";
|
|
17
|
+
@import "components/prompt.less";
|
|
18
|
+
@import "components/slide-Bar.less";
|
|
19
|
+
@import "components/button.less";
|
|
20
|
+
@import "components/checkBox.less";
|
|
21
|
+
@import "components/radioBox.less";
|
|
22
|
+
@import "components/editor.less";
|
|
23
|
+
@import "components/number.less";
|
|
24
|
+
@import "components/text.less";
|
|
25
|
+
@import "components/swipe.less";
|
|
26
|
+
@import "components/switchBar.less";
|
|
27
|
+
@import "components/upload.less";
|
|
28
|
+
@import "components/spinner.less";
|
|
29
|
+
@import "components/loadmore.less";
|
|
30
|
+
@import "components/popup.less";
|
|
31
|
+
@import "components/indicator.less";
|
|
32
|
+
@import "components/progress.less";
|
|
33
|
+
@import "components/toTop.less";
|
|
34
|
+
@import "components/cell.less";
|
|
35
|
+
@import "components/cell-swipe.less";
|
|
36
|
+
@import "components/badge.less";
|
|
37
|
+
@import "components/card.less";
|
|
38
|
+
@import "base/font.less";
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// 使用1px类时,需要注意 如果是absolute定位的,在引入mx-1px后,需要重新写入absolute定位
|
|
2
|
+
.dpzvc-1px {
|
|
3
|
+
&-all {
|
|
4
|
+
.dpzvc-1px(@BorderColor);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&-top {
|
|
8
|
+
.dpzvc-1px-side(@BorderColor, top, before);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&-bottom {
|
|
12
|
+
.dpzvc-1px-side(@BorderColor, bottom, after);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-left {
|
|
16
|
+
.dpzvc-1px-side(@BorderColor, left, before);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-right {
|
|
20
|
+
.dpzvc-1px-side(@BorderColor, right, after);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-left-right {
|
|
24
|
+
.dpzvc-1px-side(@BorderColor, left, before);
|
|
25
|
+
.dpzvc-1px-side(@BorderColor, right, after);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-top-bottom {
|
|
29
|
+
.dpzvc-1px-side(@BorderColor, top, before);
|
|
30
|
+
.dpzvc-1px-side(@BorderColor, bottom, after);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-left-top {
|
|
34
|
+
.dpzvc-1px-side(@BorderColor, left, before);
|
|
35
|
+
.dpzvc-1px-side(@BorderColor, top, after);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-left-bottom {
|
|
39
|
+
.dpzvc-1px-side(@BorderColor, left, before);
|
|
40
|
+
.dpzvc-1px-side(@BorderColor, bottom, after);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-right-top {
|
|
44
|
+
.dpzvc-1px-side(@BorderColor, right, before);
|
|
45
|
+
.dpzvc-1px-side(@BorderColor, top, after);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-right-bottom {
|
|
49
|
+
.dpzvc-1px-side(@BorderColor, right, before);
|
|
50
|
+
.dpzvc-1px-side(@BorderColor, bottom, after);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// @mixin
|
|
55
|
+
.dpzvc-1px(@color: #ccc) {
|
|
56
|
+
position: relative;
|
|
57
|
+
border-color: @color;
|
|
58
|
+
|
|
59
|
+
&:before {
|
|
60
|
+
position: absolute;
|
|
61
|
+
content: "";
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
top: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
transform-origin: 0 0;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
border: 1px solid;
|
|
70
|
+
border-color: inherit;
|
|
71
|
+
border-radius: inherit;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media screen and (-webkit-min-device-pixel-ratio:1.5) {
|
|
75
|
+
&:before {
|
|
76
|
+
width: 150%;
|
|
77
|
+
height: 150%;
|
|
78
|
+
transform: scale(0.6667);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media screen and (-webkit-min-device-pixel-ratio: 2) {
|
|
83
|
+
&:before {
|
|
84
|
+
width: 200%;
|
|
85
|
+
height: 200%;
|
|
86
|
+
transform: scale(0.5);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dpzvc-1px-side-base(@color, @pseudo) {
|
|
92
|
+
position: relative;
|
|
93
|
+
border-color: @color;
|
|
94
|
+
|
|
95
|
+
&:@{pseudo} {
|
|
96
|
+
position: absolute;
|
|
97
|
+
content: "";
|
|
98
|
+
transform-origin: 0 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dpzvc-1px-side(@color: #ccc, @direction: top, @pseudo: before) when (@direction =top) {
|
|
103
|
+
.dpzvc-1px-side-base(@color, @pseudo);
|
|
104
|
+
|
|
105
|
+
&:@{pseudo} {
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 1px;
|
|
108
|
+
top: 0;
|
|
109
|
+
left: 0;
|
|
110
|
+
border-top: 1px solid;
|
|
111
|
+
border-color: inherit;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dpzvc-1px-device-fix(@pseudo, "Y");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.dpzvc-1px-side(@color: #ccc, @direction: top, @pseudo: before) when (@direction =bottom) {
|
|
118
|
+
.dpzvc-1px-side-base(@color, @pseudo);
|
|
119
|
+
|
|
120
|
+
&:@{pseudo} {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 1px;
|
|
123
|
+
bottom: -1px;
|
|
124
|
+
left: 0;
|
|
125
|
+
border-bottom: 1px solid;
|
|
126
|
+
border-color: inherit;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dpzvc-1px-device-fix(@pseudo, "Y");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dpzvc-1px-side(@color: #ccc, @direction: top, @pseudo: before) when (@direction =left) {
|
|
133
|
+
.dpzvc-1px-side-base(@color, @pseudo);
|
|
134
|
+
|
|
135
|
+
&:@{pseudo} {
|
|
136
|
+
width: 1px;
|
|
137
|
+
height: 100%;
|
|
138
|
+
top: 0;
|
|
139
|
+
left: 0;
|
|
140
|
+
border-left: 1px solid;
|
|
141
|
+
border-color: inherit;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.dpzvc-1px-device-fix(@pseudo, "X");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.dpzvc-1px-side(@color: #ccc, @direction: top, @pseudo: before) when (@direction =right) {
|
|
148
|
+
.dpzvc-1px-side-base(@color, @pseudo);
|
|
149
|
+
|
|
150
|
+
&:@{pseudo} {
|
|
151
|
+
width: 1px;
|
|
152
|
+
height: 100%;
|
|
153
|
+
top: 0;
|
|
154
|
+
right: -1px;
|
|
155
|
+
border-right: 1px solid;
|
|
156
|
+
border-color: inherit;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.dpzvc-1px-device-fix(@pseudo, "X");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dpzvc-1px-device-fix(@pseudo, @transform) when (@transform ="X") {
|
|
163
|
+
@media screen and (-webkit-min-device-pixel-ratio: 1.5) {
|
|
164
|
+
&:@{pseudo} {
|
|
165
|
+
transform: scaleX(0.6667);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media screen and (-webkit-min-device-pixel-ratio: 2) {
|
|
170
|
+
&:@{pseudo} {
|
|
171
|
+
transform: scaleX(0.5);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media screen and (-webkit-min-device-pixel-ratio: 3) {
|
|
176
|
+
&:@{pseudo} {
|
|
177
|
+
transform: scaleX(0.333);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
;
|
|
183
|
+
|
|
184
|
+
.dpzvc-1px-device-fix(@pseudo, @transform) when (@transform ="Y") {
|
|
185
|
+
@media screen and (-webkit-min-device-pixel-ratio: 1.5) {
|
|
186
|
+
&:@{pseudo} {
|
|
187
|
+
transform: scaleY(0.6667);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@media screen and (-webkit-min-device-pixel-ratio: 2) {
|
|
192
|
+
&:@{pseudo} {
|
|
193
|
+
transform: scaleY(0.5);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media screen and (-webkit-min-device-pixel-ratio: 3) {
|
|
198
|
+
&:@{pseudo} {
|
|
199
|
+
transform: scaleY(0.333);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.dpzvc-ani {
|
|
2
|
+
&-fade {
|
|
3
|
+
|
|
4
|
+
&-enter-active,
|
|
5
|
+
&-leave-active {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
transition: opacity .3s ease;
|
|
8
|
+
will-change: opacity;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&-enter,
|
|
12
|
+
&-leave-active {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-bottom {
|
|
18
|
+
|
|
19
|
+
&-enter-active,
|
|
20
|
+
&-leave-active {
|
|
21
|
+
transition: transform .3s ease-out 100ms;
|
|
22
|
+
will-change: transform;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-enter,
|
|
26
|
+
&-leave-active {
|
|
27
|
+
transform: translate3d(0, 100%, 0);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&-scale {
|
|
32
|
+
|
|
33
|
+
&-enter-active,
|
|
34
|
+
&-leave-active {
|
|
35
|
+
will-change: transform, opcity;
|
|
36
|
+
transition: all .3s ease-in;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-enter,
|
|
40
|
+
&-leave-active {
|
|
41
|
+
transform: translate3d(-50%, -50%, 0) scale(.9);
|
|
42
|
+
opacity: .2;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-top {
|
|
47
|
+
|
|
48
|
+
&-enter-active,
|
|
49
|
+
&-leave-active {
|
|
50
|
+
transition: transform .3s ease-out 100ms;
|
|
51
|
+
will-change: transform;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-enter,
|
|
55
|
+
&-leave-active {
|
|
56
|
+
transform: translate3d(0, -100%, 0);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-left {
|
|
61
|
+
|
|
62
|
+
&-enter-active,
|
|
63
|
+
&-leave-active {
|
|
64
|
+
transition: all .3s ease;
|
|
65
|
+
will-change: transform;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-enter,
|
|
69
|
+
&-leave-active {
|
|
70
|
+
transform: translate3d(-100%, 0, 0);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&-right {
|
|
75
|
+
|
|
76
|
+
&-enter-active,
|
|
77
|
+
&-leave-active {
|
|
78
|
+
transition: all .3s ease;
|
|
79
|
+
will-change: transform;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&-enter,
|
|
83
|
+
&-leave-active {
|
|
84
|
+
transform: translate3d(100%, 0, 0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
&-slide-up {
|
|
91
|
+
|
|
92
|
+
&-enter-active,
|
|
93
|
+
&-leave-active {
|
|
94
|
+
transition: all .3s ease;
|
|
95
|
+
will-change: transform;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-enter,
|
|
99
|
+
&-leave-active {
|
|
100
|
+
transform: translate3d(0, 100%, 0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-slide-down {
|
|
107
|
+
|
|
108
|
+
&-enter-active,
|
|
109
|
+
&-leave-active {
|
|
110
|
+
transition: all .3s ease;
|
|
111
|
+
will-change: transform;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-enter,
|
|
115
|
+
&-leave-active {
|
|
116
|
+
transform: translate3d(0, -100%, 0);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes rotate {
|
|
123
|
+
|
|
124
|
+
0% {
|
|
125
|
+
transform: rotate(0deg) translateZ(0deg);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
100% {
|
|
129
|
+
transform: rotate(360deg) translateZ(0deg);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.dpzvc-nowrap {
|
|
2
|
+
max-width: 100%;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
white-space: nowrap;
|
|
5
|
+
text-overflow: ellipsis;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dpzvc-nowrap(@n, @i: 1) when (@i <=@n) {
|
|
9
|
+
.dpzvc-nowrap-@{i} {
|
|
10
|
+
.dpzvc-nowrap;
|
|
11
|
+
display: -webkit-box;
|
|
12
|
+
-webkit-box-orient: vertical;
|
|
13
|
+
-webkit-line-clamp: @i;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dpzvc-nowrap(@n, (@i+1));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dpzvc-nowrap(5);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<title>丁平中vue2.x组件库使用预览</title>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="app"></div>
|
|
10
|
+
<script>
|
|
11
|
+
(function (doc, win) {
|
|
12
|
+
var docEl = doc.documentElement,
|
|
13
|
+
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
|
|
14
|
+
recalc = function () {
|
|
15
|
+
var clientWidth = docEl.clientWidth;
|
|
16
|
+
if (!clientWidth) return;
|
|
17
|
+
docEl.style.fontSize = 100 * (clientWidth / 375) + 'px';
|
|
18
|
+
};
|
|
19
|
+
// Abort if browser does not support addEventListener
|
|
20
|
+
if (!doc.addEventListener) return;
|
|
21
|
+
win.addEventListener(resizeEvt, recalc, false);
|
|
22
|
+
doc.addEventListener('DOMContentLoaded', recalc, false);
|
|
23
|
+
})(document, window);
|
|
24
|
+
</script>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by lcfevr on 16/7/18.
|
|
3
|
+
*/
|
|
4
|
+
import Config from '../config/config'
|
|
5
|
+
//
|
|
6
|
+
// import * as Cache from './cache';
|
|
7
|
+
|
|
8
|
+
export function camelcaseToHyphen(str) {
|
|
9
|
+
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export function findComponentUpward (content, componentName, componentNames) {
|
|
14
|
+
if (typeof componentName === 'string') {
|
|
15
|
+
componentNames = [componentName];
|
|
16
|
+
} else {
|
|
17
|
+
componentNames = componentName;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let parent = content.$parent;
|
|
21
|
+
let name = parent.$options.name;
|
|
22
|
+
while (parent && (!name || componentNames.indexOf(name) < 0)) {
|
|
23
|
+
parent = parent.$parent;
|
|
24
|
+
if (parent) name = parent.$options.name;
|
|
25
|
+
}
|
|
26
|
+
return parent;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function findComponentDownward (content, componentName) {
|
|
30
|
+
const childrens = content.$children;
|
|
31
|
+
let children = null;
|
|
32
|
+
|
|
33
|
+
if (childrens.length) {
|
|
34
|
+
childrens.forEach(child => {
|
|
35
|
+
const name = child.$options.name;
|
|
36
|
+
if (name === componentName) {
|
|
37
|
+
children = child;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
for (let i = 0; i < childrens.length; i++) {
|
|
42
|
+
const child = childrens[i];
|
|
43
|
+
const name = child.$options.name;
|
|
44
|
+
if (name === componentName) {
|
|
45
|
+
children = child;
|
|
46
|
+
break;
|
|
47
|
+
} else {
|
|
48
|
+
children = findComponentDownward(child, componentName);
|
|
49
|
+
if (children) break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return children;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function findComponentsDownward (content, componentName, components = []) {
|
|
57
|
+
const childrens = content.$children;
|
|
58
|
+
|
|
59
|
+
if (childrens.length) {
|
|
60
|
+
childrens.forEach(child => {
|
|
61
|
+
const name = child.$options.name;
|
|
62
|
+
const childs = child.$children;
|
|
63
|
+
|
|
64
|
+
if (name === componentName) components.push(child);
|
|
65
|
+
if (childs.length) {
|
|
66
|
+
const findChilds = findComponentsDownward(child, componentName, components);
|
|
67
|
+
if (findChilds) components.concat(findChilds);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return components;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function random_str() {
|
|
75
|
+
let len = 32;
|
|
76
|
+
let chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
|
77
|
+
let max = chars.length;
|
|
78
|
+
|
|
79
|
+
let str = '';
|
|
80
|
+
for (let i = 0; i < len; i++) {
|
|
81
|
+
str += chars.charAt(Math.floor(Math.random() * max));
|
|
82
|
+
}
|
|
83
|
+
return str;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export let JPEG = {
|
|
87
|
+
JPEGEncoder:function(a){function I(a){var c,i,j,k,l,m,n,o,p,b=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99];for(c=0;64>c;c++)i=d((b[c]*a+50)/100),1>i?i=1:i>255&&(i=255),e[z[c]]=i;for(j=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],k=0;64>k;k++)l=d((j[k]*a+50)/100),1>l?l=1:l>255&&(l=255),f[z[k]]=l;for(m=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],n=0,o=0;8>o;o++)for(p=0;8>p;p++)g[n]=1/(8*e[z[n]]*m[o]*m[p]),h[n]=1/(8*f[z[n]]*m[o]*m[p]),n++}function J(a,b){var f,g,c=0,d=0,e=new Array;for(f=1;16>=f;f++){for(g=1;g<=a[f];g++)e[b[d]]=[],e[b[d]][0]=c,e[b[d]][1]=f,d++,c++;c*=2}return e}function K(){i=J(A,B),j=J(E,F),k=J(C,D),l=J(G,H)}function L(){var c,d,e,a=1,b=2;for(c=1;15>=c;c++){for(d=a;b>d;d++)n[32767+d]=c,m[32767+d]=[],m[32767+d][1]=c,m[32767+d][0]=d;for(e=-(b-1);-a>=e;e++)n[32767+e]=c,m[32767+e]=[],m[32767+e][1]=c,m[32767+e][0]=b-1+e;a<<=1,b<<=1}}function M(){for(var a=0;256>a;a++)x[a]=19595*a,x[a+256>>0]=38470*a,x[a+512>>0]=7471*a+32768,x[a+768>>0]=-11059*a,x[a+1024>>0]=-21709*a,x[a+1280>>0]=32768*a+8421375,x[a+1536>>0]=-27439*a,x[a+1792>>0]=-5329*a}function N(a){for(var b=a[0],c=a[1]-1;c>=0;)b&1<<c&&(r|=1<<s),c--,s--,0>s&&(255==r?(O(255),O(0)):O(r),s=7,r=0)}function O(a){q.push(w[a])}function P(a){O(255&a>>8),O(255&a)}function Q(a,b){var c,d,e,f,g,h,i,j,l,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,k=0;const m=8,n=64;for(l=0;m>l;++l)c=a[k],d=a[k+1],e=a[k+2],f=a[k+3],g=a[k+4],h=a[k+5],i=a[k+6],j=a[k+7],p=c+j,q=c-j,r=d+i,s=d-i,t=e+h,u=e-h,v=f+g,w=f-g,x=p+v,y=p-v,z=r+t,A=r-t,a[k]=x+z,a[k+4]=x-z,B=.707106781*(A+y),a[k+2]=y+B,a[k+6]=y-B,x=w+u,z=u+s,A=s+q,C=.382683433*(x-A),D=.5411961*x+C,E=1.306562965*A+C,F=.707106781*z,G=q+F,H=q-F,a[k+5]=H+D,a[k+3]=H-D,a[k+1]=G+E,a[k+7]=G-E,k+=8;for(k=0,l=0;m>l;++l)c=a[k],d=a[k+8],e=a[k+16],f=a[k+24],g=a[k+32],h=a[k+40],i=a[k+48],j=a[k+56],I=c+j,J=c-j,K=d+i,L=d-i,M=e+h,N=e-h,O=f+g,P=f-g,Q=I+O,R=I-O,S=K+M,T=K-M,a[k]=Q+S,a[k+32]=Q-S,U=.707106781*(T+R),a[k+16]=R+U,a[k+48]=R-U,Q=P+N,S=N+L,T=L+J,V=.382683433*(Q-T),W=.5411961*Q+V,X=1.306562965*T+V,Y=.707106781*S,Z=J+Y,$=J-Y,a[k+40]=$+W,a[k+24]=$-W,a[k+8]=Z+X,a[k+56]=Z-X,k++;for(l=0;n>l;++l)_=a[l]*b[l],o[l]=_>0?0|_+.5:0|_-.5;return o}function R(){P(65504),P(16),O(74),O(70),O(73),O(70),O(0),O(1),O(1),O(0),P(1),P(1),O(0),O(0)}function S(a,b){P(65472),P(17),O(8),P(b),P(a),O(3),O(1),O(17),O(0),O(2),O(17),O(1),O(3),O(17),O(1)}function T(){var a,b;for(P(65499),P(132),O(0),a=0;64>a;a++)O(e[a]);for(O(1),b=0;64>b;b++)O(f[b])}function U(){var a,b,c,d,e,f,g,h;for(P(65476),P(418),O(0),a=0;16>a;a++)O(A[a+1]);for(b=0;11>=b;b++)O(B[b]);for(O(16),c=0;16>c;c++)O(C[c+1]);for(d=0;161>=d;d++)O(D[d]);for(O(1),e=0;16>e;e++)O(E[e+1]);for(f=0;11>=f;f++)O(F[f]);for(O(17),g=0;16>g;g++)O(G[g+1]);for(h=0;161>=h;h++)O(H[h])}function V(){P(65498),P(12),O(3),O(1),O(0),O(2),O(17),O(3),O(17),O(0),O(63),O(0)}function W(a,b,c,d,e){var h,l,o,q,r,s,t,u,v,w,f=e[0],g=e[240];const i=16,j=63,k=64;for(l=Q(a,b),o=0;k>o;++o)p[z[o]]=l[o];for(q=p[0]-c,c=p[0],0==q?N(d[0]):(h=32767+q,N(d[n[h]]),N(m[h])),r=63;r>0&&0==p[r];r--);if(0==r)return N(f),c;for(s=1;r>=s;){for(u=s;0==p[s]&&r>=s;++s);if(v=s-u,v>=i){for(t=v>>4,w=1;t>=w;++w)N(g);v=15&v}h=32767+p[s],N(e[(v<<4)+n[h]]),N(m[h]),s++}return r!=j&&N(f),c}function X(){var b,a=String.fromCharCode;for(b=0;256>b;b++)w[b]=a(b)}function Y(a){if(0>=a&&(a=1),a>100&&(a=100),y!=a){var b=0;b=50>a?Math.floor(5e3/a):Math.floor(200-2*a),I(b),y=a,console.log("Quality set to: "+a+"%")}}function Z(){var c,b=(new Date).getTime();a||(a=50),X(),K(),L(),M(),Y(a),c=(new Date).getTime()-b,console.log("Initialization "+c+"ms")}var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;Math.round,d=Math.floor,e=new Array(64),f=new Array(64),g=new Array(64),h=new Array(64),m=new Array(65535),n=new Array(65535),o=new Array(64),p=new Array(64),q=[],r=0,s=7,t=new Array(64),u=new Array(64),v=new Array(64),w=new Array(256),x=new Array(2048),z=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],A=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],C=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],E=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],G=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],H=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250],this.encode=function(a,b){var d,e,f,m,n,o,p,y,z,A,B,C,D,E,F,G,H,I,J,K,c=(new Date).getTime();for(b&&Y(b),q=new Array,r=0,s=7,P(65496),R(),T(),S(a.width,a.height),U(),V(),d=0,e=0,f=0,r=0,s=7,this.encode.displayName="_encode_",m=a.data,n=a.width,o=a.height,p=4*n,z=0;o>z;){for(y=0;p>y;){for(D=p*z+y,E=D,F=-1,G=0,H=0;64>H;H++)G=H>>3,F=4*(7&H),E=D+G*p+F,z+G>=o&&(E-=p*(z+1+G-o)),y+F>=p&&(E-=y+F-p+4),A=m[E++],B=m[E++],C=m[E++],t[H]=(x[A]+x[B+256>>0]+x[C+512>>0]>>16)-128,u[H]=(x[A+768>>0]+x[B+1024>>0]+x[C+1280>>0]>>16)-128,v[H]=(x[A+1280>>0]+x[B+1536>>0]+x[C+1792>>0]>>16)-128;d=W(t,g,d,i,k),e=W(u,h,e,j,l),f=W(v,h,f,j,l),y+=32}z+=8}return s>=0&&(I=[],I[1]=s+1,I[0]=(1<<s+1)-1,N(I)),P(65497),J="data:image/jpeg;base64,"+btoa(q.join("")),q=[],K=(new Date).getTime()-c,console.log("Encoding time: "+K+"ms"),J},Z()}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function scrollTop(el, from = 0, to, duration = 500) {
|
|
91
|
+
|
|
92
|
+
if (!window.requestAnimationFrame) {
|
|
93
|
+
window.requestAnimationFrame = (
|
|
94
|
+
window.webkitRequestAnimationFrame ||
|
|
95
|
+
window.mozRequestAnimationFrame ||
|
|
96
|
+
window.msRequestAnimationFrame ||
|
|
97
|
+
function (callback) {
|
|
98
|
+
return window.setTimeout(callback, 1000/60);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const difference = Math.abs(from - to);
|
|
103
|
+
const step = Math.ceil(difference / duration * 50);
|
|
104
|
+
|
|
105
|
+
function scroll(start, end, step) {
|
|
106
|
+
if (start === end) return;
|
|
107
|
+
|
|
108
|
+
let d = (start + step > end) ? end : start + step;
|
|
109
|
+
if (start > end) {
|
|
110
|
+
d = (start - step < end) ? end : start - step;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (el === window) {
|
|
114
|
+
window.scrollTo(d, d);
|
|
115
|
+
} else {
|
|
116
|
+
el.scrollTop = d;
|
|
117
|
+
}
|
|
118
|
+
window.requestAnimationFrame(() => scroll(d, end, step));
|
|
119
|
+
}
|
|
120
|
+
scroll(from, to, step);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const cookieStorage = {
|
|
124
|
+
setItem: function (key, value, options) {
|
|
125
|
+
var data, opts;
|
|
126
|
+
if (options === undefined) {
|
|
127
|
+
data = JSON.parse(value);
|
|
128
|
+
opts = Object.assign({}, defaultConfigs, data.options);
|
|
129
|
+
delete data.options;
|
|
130
|
+
value = JSON.stringify(data);
|
|
131
|
+
} else {
|
|
132
|
+
data = Object.assign({}, options);
|
|
133
|
+
opts = Object.assign({}, defaultConfigs, options);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
key = encodeURIComponent(String(key))
|
|
137
|
+
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
|
|
138
|
+
.replace(/[()]/g, escape);
|
|
139
|
+
|
|
140
|
+
value = encodeURIComponent(String(value))
|
|
141
|
+
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
|
142
|
+
|
|
143
|
+
if (typeof data.expire === 'number') {
|
|
144
|
+
if (data.expire === 0) data.expire = Date.now() + timeMap.y * 10;
|
|
145
|
+
opts.expires = new Date(data.expire);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (opts.cross) {
|
|
149
|
+
var hostname = window.location.hostname;
|
|
150
|
+
if (!/^((25[0-5]|2[0-4]\d|[01]?\d\d?)($|(?!\.$)\.)){4}$/.test(hostname) && !!~hostname.indexOf('.')) {
|
|
151
|
+
opts.domain = '.' + window.location.hostname.split('.').slice(1).join('.');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return (document.cookie = [
|
|
156
|
+
key, '=', value,
|
|
157
|
+
opts.expires ? '; expires=' + opts.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
|
158
|
+
opts.path ? '; path=' + opts.path : '',
|
|
159
|
+
opts.domain ? '; domain=' + opts.domain : '',
|
|
160
|
+
opts.secure ? '; secure' : ''
|
|
161
|
+
].join(''));
|
|
162
|
+
},
|
|
163
|
+
getItem: function (key) {
|
|
164
|
+
var result = {};
|
|
165
|
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
|
166
|
+
var decodes = /(%[0-9A-Z]{2})+/g;
|
|
167
|
+
|
|
168
|
+
for (let cookie of cookies) {
|
|
169
|
+
var parts = cookie.split('=');
|
|
170
|
+
var name = parts.shift();
|
|
171
|
+
var value = parts.join('=');
|
|
172
|
+
|
|
173
|
+
name = name.replace(decodes, decodeURIComponent);
|
|
174
|
+
value = value.replace(decodes, decodeURIComponent);
|
|
175
|
+
|
|
176
|
+
if (name === key) {
|
|
177
|
+
result = value;
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (!key) {
|
|
182
|
+
result[name] = value;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return !key ? result : null;
|
|
187
|
+
},
|
|
188
|
+
removeItem: function (key, options) {
|
|
189
|
+
var opts = Object.assign({
|
|
190
|
+
path: '/',
|
|
191
|
+
expire: -1
|
|
192
|
+
}, options);
|
|
193
|
+
|
|
194
|
+
this.setItem(key, '', opts);
|
|
195
|
+
},
|
|
196
|
+
key: function (index) {
|
|
197
|
+
var cookies = document.cookie ? document.cookie.split(/;\s*/) : [];
|
|
198
|
+
if (index < 0 || index >= cookies.length) return '';
|
|
199
|
+
|
|
200
|
+
var kvPairs = cookies[index];
|
|
201
|
+
return kvPairs.split('=').shift();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* vconsole-resources v1.0.0 (https://github.com/WechatFE/vConsole-resources)
|
|
3
|
+
* Copyright 2016, WechatFE Team
|
|
4
|
+
* MIT license
|
|
5
|
+
*/
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["vConsole-resources"]=t():e["vConsole-resources"]=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}();o(1);var c=o(5),l=r(c),u=o(6),f=r(u),d=vConsole.$,p=vConsole.tool,v=function(e){function t(){var e;n(this,t);for(var o=arguments.length,r=Array(o),i=0;i<o;i++)r[i]=arguments[i];var s=a(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return s.$tabbox=d.render(l["default"],{}),s.currentType="",s.typeNameMap={cookies:"Cookies",localstorage:"LocalStorage"},s}return i(t,e),s(t,[{key:"onRenderTab",value:function(e){e(this.$tabbox)}},{key:"onAddTool",value:function(e){var t=this,o=[{name:"Refresh",global:!1,onClick:function(e){t.renderResources()}},{name:"Clear",global:!1,onClick:function(e){t.clearLog()}}];e(o)}},{key:"onReady",value:function(){var e=this;d.delegate(d.one(".vc-sub-tabbar",e.$tabbox),"click",".vc-subtab",function(t){d.removeClass(d.all(".vc-subtab",e.$tabbox),"vc-actived"),d.addClass(this,"vc-actived"),e.currentType=this.dataset.type,e.renderResources()})}},{key:"clearLog",value:function(){if(this.currentType&&window.confirm){var e=window.confirm("Remove all "+this.typeNameMap[this.currentType]+"?");if(!e)return!1}switch(this.currentType){case"cookies":this.clearCookieList();break;case"localstorage":this.clearLocalStorageList();break;default:return!1}this.renderResources()}},{key:"renderResources",value:function(){var e=[];switch(this.currentType){case"cookies":e=this.getCookieList();break;case"localstorage":e=this.getLocalStorageList();break;default:return!1}var t=d.one(".vc-log",this.$tabbox);if(0==e.length)t.innerHTML="";else{for(var o=0;o<e.length;o++)e[o].name=p.htmlEncode(e[o].name),e[o].value=p.htmlEncode(e[o].value);t.innerHTML=d.render(f["default"],{list:e},!0)}}},{key:"getCookieList",value:function(){if(!document.cookie)return[];for(var e=[],t=document.cookie.split(";"),o=0;o<t.length;o++){var r=t[o].split("="),n=r[0].replace(/^ /,""),a=r[1];e.push({name:decodeURIComponent(n),value:decodeURIComponent(a)})}return e}},{key:"getLocalStorageList",value:function(){if(!window.localStorage)return[];for(var e=[],t=0;t<localStorage.length;t++){var o=localStorage.key(t),r=localStorage.getItem(o);e.push({name:o,value:r})}return e}},{key:"clearCookieList",value:function(){if(document.cookie)for(var e=this.getCookieList(),t=0;t<e.length;t++)document.cookie=e[t].name+"=;"}},{key:"clearLocalStorageList",value:function(){window.localStorage&&localStorage.clear()}}]),t}(vConsole.VConsolePlugin),b=new v("resources","Resources");vConsole.addPlugin(b)},function(e,t,o){var r=o(2);"string"==typeof r&&(r=[[e.id,r,""]]);o(4)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,o){t=e.exports=o(3)(),t.push([e.id,".vc-sub-tabbar{background-color:#fbf9fe;display:flex;flex-direction:row;flex-wrap:wrap}.vc-sub-tabbar .vc-subtab{flex:1;line-height:30px;padding:0 15px;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;text-decoration:none;text-align:center;color:#000;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.vc-sub-tabbar .vc-subtab:active{background-color:rgba(0,0,0,.15)}.vc-sub-tabbar .vc-subtab.vc-actived{background-color:#fff}",""])},function(e,t){"use strict";e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var o=this[t];o[2]?e.push("@media "+o[2]+"{"+o[1]+"}"):e.push(o[1])}return e.join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(r[a]=!0)}for(n=0;n<t.length;n++){var i=t[n];"number"==typeof i[0]&&r[i[0]]||(o&&!i[2]?i[2]=o:o&&(i[2]="("+i[2]+") and ("+o+")"),e.push(i))}},e}},function(e,t,o){function r(e,t){for(var o=0;o<e.length;o++){var r=e[o],n=p[r.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](r.parts[a]);for(;a<r.parts.length;a++)n.parts.push(l(r.parts[a],t))}else{for(var i=[],a=0;a<r.parts.length;a++)i.push(l(r.parts[a],t));p[r.id]={id:r.id,refs:1,parts:i}}}}function n(e){for(var t=[],o={},r=0;r<e.length;r++){var n=e[r],a=n[0],i=n[1],s=n[2],c=n[3],l={css:i,media:s,sourceMap:c};o[a]?o[a].parts.push(l):t.push(o[a]={id:a,parts:[l]})}return t}function a(e,t){var o=h(),r=m[m.length-1];if("top"===e.insertAt)r?r.nextSibling?o.insertBefore(t,r.nextSibling):o.appendChild(t):o.insertBefore(t,o.firstChild),m.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");o.appendChild(t)}}function i(e){e.parentNode.removeChild(e);var t=m.indexOf(e);t>=0&&m.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function l(e,t){var o,r,n;if(t.singleton){var a=y++;o=g||(g=s(t)),r=u.bind(null,o,a,!1),n=u.bind(null,o,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=c(t),r=d.bind(null,o),n=function(){i(o),o.href&&URL.revokeObjectURL(o.href)}):(o=s(t),r=f.bind(null,o),n=function(){i(o)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else n()}}function u(e,t,o,r){var n=o?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,n);else{var a=document.createTextNode(n),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function f(e,t){var o=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}function d(e,t){var o=t.css,r=t.sourceMap;r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var n=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(n),a&&URL.revokeObjectURL(a)}var p={},v=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},b=v(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),h=v(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,y=0,m=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=b()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var o=n(e);return r(o,t),function(e){for(var a=[],i=0;i<o.length;i++){var s=o[i],c=p[s.id];c.refs--,a.push(c)}if(e){var l=n(e);r(l,t)}for(var i=0;i<a.length;i++){var c=a[i];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete p[c.id]}}}};var k=function(){var e=[];return function(t,o){return e[t]=o,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports="<div class=vc-table> <div class=vc-sub-tabbar> <a href=javascript:; class=vc-subtab data-type=cookies>Cookies</a> <a href=javascript:; class=vc-subtab data-type=localstorage>LocalStorage</a> </div> <div class=vc-log></div> </div>"},function(e,t){e.exports='<div> <dl class=vc-table-row> <dd class=vc-table-col>Name</dd> <dd class="vc-table-col vc-table-col-2">Value</dd> </dl> {{for (var i=0; i<list.length; i++)}} <dl class=vc-table-row> <dd class=vc-table-col>{{list[i].name}}</dd> <dd class="vc-table-col vc-table-col-2">{{list[i].value}}</dd> </dl> {{/for}} </div>'}])});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* vconsole-sources v1.0.1 (https://github.com/WechatFE/vConsole-sources)
|
|
3
|
+
* Copyright 2016, WechatFE Team
|
|
4
|
+
* MIT license
|
|
5
|
+
*/
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["vConsole-sources"]=t():e["vConsole-sources"]=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(1),l=r(c);n(2);var u=vConsole.$,f=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=s(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.resUrls=t.getAllResUrl(),a}return i(t,e),a(t,[{key:"onRenderTab",value:function(e){var t=this,n=this.resUrls,r=this.$dom=u.render(l["default"],{resUrls:n});e(r),u.bind(u.all(".vc-sources-file",r),"click",function(){u.removeClass(u.all(".vc-sources-file",r),"actived"),u.addClass(this,"actived");var e=1*this.dataset.idx,o=n[e];if(o)if(u.one(".vc-sources-url",r).innerText=o.url,o.content){var s=u.one(".vc-sources-content",r),i=u.one(".vc-sources-iframe-content",r);s.style.display="block",i.style.display="none",s.innerText=o.content}else t.fillContent(o.url,e)})}},{key:"getResContent",value:function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){if(3==n.readyState,4==n.readyState){n.onreadystatechange=null;var e=n.status;t(e>=200&&e<400?n.responseText:"[ERROR] Please Try Again.")}},n.send()}},{key:"fillContent",value:function(e,t){var n=location.protocol+"//"+location.host,r=this.$dom,o=u.one(".vc-sources-content",r),s=u.one(".vc-sources-iframe-content",r),i=this.resUrls;0==e.indexOf(n)?(o.innerText="loading...",o.style.display="block",s.style.display="none",this.getResContent(e,function(e){o.innerText=e,i[t]&&(i[t].content=e)})):(s.src=e,o.style.display="none",s.style.display="block")}}],[{key:"getAllResUrl",value:function(){var e=[];e.push({url:location.href,filename:t.getFileName(location.href),type:"html",content:document.getElementsByTagName("html")[0].innerHTML});for(var n=u.all('link[rel="stylesheet"],script[src]'),r=0;r<n.length;++r){var o=n[r],s="",i="",a="unknow",c=o.nodeName.toUpperCase();"LINK"==c?(s=o.href||"",a="css"):"SCRIPT"==c&&(s=o.src||"",a="script"),i=t.getFileName(s),i&&e.push({url:s,filename:i,type:a})}return e}},{key:"getFileName",value:function(e){var t=/\/([^\/\?]+)($|\?)/g,n=t.exec(e);return n&&n[1]}}]),t}(vConsole.VConsolePlugin);vConsole.addPlugin(new f("vconsole-source","Source"))},function(e,t){e.exports='<div> <div class=vc-sources-title> FILE: <span class=vc-sources-url></span> </div> <div class=vc-sources-left-panel> <ul> {{for(var i in resUrls)}} <li><a data-idx="{{i}}" class="vc-sources-file vc-sources-type-{{resUrls[i].type}}" href=javascript:void(0);>{{resUrls[i].filename}}</a></li> {{/for}} </ul> </div> <div class=vc-sources-right-panel> <div class=vc-sources-content-panel> <div class=vc-sources-content> </div> <iframe class=vc-sources-iframe-content style=display:none> </iframe> </div> </div> </div>'},function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.id,r,""]]);n(5)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(4)(),t.push([e.id,".vc-sources-left-panel{position:absolute;top:51px;bottom:0;left:0;width:80px;overflow:auto;border-right:5px solid #f4f4f4;background-color:#fefefe}.vc-sources-left-panel li{border-bottom:1px dashed #efefef}.vc-sources-left-panel a{color:#333;display:block;padding:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vc-sources-left-panel a.actived{background-color:#f4f4f4}.vc-sources-left-panel a.vc-sources-type-html{color:#333}.vc-sources-left-panel a.vc-sources-type-css{color:#6a5acd}.vc-sources-left-panel a.vc-sources-type-script{color:#daa520}.vc-sources-right-panel{padding:5px;overflow:auto;position:absolute;top:51px;left:85px;right:0;bottom:0}.vc-sources-right-panel .vc-sources-content-panel{width:100%;height:100%}.vc-sources-right-panel .vc-sources-iframe-content{border:none;width:100%;height:100%}.vc-sources-title{word-wrap:break-word;word-break:break-all;padding:5px;height:40px;overflow:auto;border-bottom:1px solid #eee;background-color:#f4f4f4}",""])},function(e,t){"use strict";e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var s=this[o][0];"number"==typeof s&&(r[s]=!0)}for(o=0;o<t.length;o++){var i=t[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),e.push(i))}},e}},function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=d[r.id];if(o){o.refs++;for(var s=0;s<o.parts.length;s++)o.parts[s](r.parts[s]);for(;s<r.parts.length;s++)o.parts.push(l(r.parts[s],t))}else{for(var i=[],s=0;s<r.parts.length;s++)i.push(l(r.parts[s],t));d[r.id]={id:r.id,refs:1,parts:i}}}}function o(e){for(var t=[],n={},r=0;r<e.length;r++){var o=e[r],s=o[0],i=o[1],a=o[2],c=o[3],l={css:i,media:a,sourceMap:c};n[s]?n[s].parts.push(l):t.push(n[s]={id:s,parts:[l]})}return t}function s(e,t){var n=y(),r=m[m.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),m.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function i(e){e.parentNode.removeChild(e);var t=m.indexOf(e);t>=0&&m.splice(t,1)}function a(e){var t=document.createElement("style");return t.type="text/css",s(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",s(e,t),t}function l(e,t){var n,r,o;if(t.singleton){var s=g++;n=b||(b=a(t)),r=u.bind(null,n,s,!1),o=u.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=p.bind(null,n),o=function(){i(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(t),r=f.bind(null,n),o=function(){i(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function u(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var s=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(s,i[t]):e.appendChild(s)}}function f(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var d={},v=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},h=v(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),y=v(function(){return document.head||document.getElementsByTagName("head")[0]}),b=null,g=0,m=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=h()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var s=[],i=0;i<n.length;i++){var a=n[i],c=d[a.id];c.refs--,s.push(c)}if(e){var l=o(e);r(l,t)}for(var i=0;i<s.length;i++){var c=s[i];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete d[c.id]}}}};var x=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()}])});
|