zartui 0.1.21 → 0.1.25
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/README.md +20 -20
- package/changelog.generated.md +15 -0
- package/es/area/style/index.js +4 -0
- package/es/area/style/less.js +4 -0
- package/es/avatar/index.css +1 -1
- package/es/avatar/index.js +54 -36
- package/es/avatar/index.less +39 -11
- package/es/avatar/local.less +1 -1
- package/es/button/index.js +4 -1
- package/es/button/index.less +206 -206
- package/es/calendar/index.less +250 -250
- package/es/calendar/style/index.js +1 -1
- package/es/calendar/style/less.js +1 -1
- package/es/cell/index.less +103 -103
- package/es/cell-group/index.less +22 -22
- package/es/checkbox/index.less +89 -89
- package/es/checkbox-group/index.less +8 -8
- package/es/col/index.less +20 -20
- package/es/datetime-picker/style/index.js +4 -0
- package/es/datetime-picker/style/less.js +4 -0
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.less +125 -125
- package/es/dialog/style/index.js +1 -1
- package/es/dialog/style/less.js +1 -1
- package/es/empty/Developing.js +1643 -0
- package/es/empty/Error.js +484 -0
- package/es/empty/NotFound.js +645 -0
- package/es/empty/NotRight.js +395 -0
- package/es/empty/Search.js +336 -0
- package/es/empty/index.css +1 -0
- package/es/empty/index.js +105 -0
- package/es/empty/index.less +33 -0
- package/es/empty/style/index.js +2 -0
- package/es/empty/style/less.js +2 -0
- package/es/field/index.less +172 -172
- package/es/icon/index.less +10 -10
- package/es/icon/local.less +1 -1
- package/es/image/index.less +47 -47
- package/es/image-preview/index.less +103 -103
- package/es/image-preview/style/index.js +1 -1
- package/es/image-preview/style/less.js +1 -1
- package/es/index.js +6 -3
- package/es/info/index.less +29 -29
- package/es/loading/index.less +103 -103
- package/es/locale/lang/zh-CN.js +22 -0
- package/es/mixins/bind-event.js +2 -2
- package/es/mixins/checkbox.js +2 -2
- package/es/mixins/click-outside.js +2 -2
- package/es/mixins/slots.js +3 -3
- package/es/mixins/telemetry.js +11 -0
- package/es/nav-bar/index.less +74 -74
- package/es/number-keyboard/index.css +1 -1
- package/es/number-keyboard/index.less +144 -142
- package/es/overlay/index.less +11 -11
- package/es/password-input/index.css +1 -0
- package/es/password-input/index.js +80 -0
- package/es/password-input/index.less +83 -0
- package/es/password-input/style/index.js +2 -0
- package/es/password-input/style/less.js +2 -0
- package/es/pdf-viewer/style/index.js +1 -1
- package/es/pdf-viewer/style/less.js +1 -1
- package/es/picker/PickerColumn.js +5 -6
- package/es/picker/index.js +34 -5
- package/es/picker/index.less +151 -151
- package/es/picker/shared.js +4 -0
- package/es/picker/style/index.js +4 -0
- package/es/picker/style/less.js +4 -0
- package/es/popup/index.less +137 -137
- package/es/popup/style/index.js +1 -1
- package/es/popup/style/less.js +1 -1
- package/es/radio/index.less +86 -86
- package/es/radio-group/index.less +8 -8
- package/es/rate/index.css +1 -1
- package/es/rate/index.js +1 -1
- package/es/rate/index.less +47 -47
- package/es/row/index.less +42 -42
- package/es/signature/index.css +1 -0
- package/es/signature/index.js +230 -0
- package/es/signature/index.less +50 -0
- package/es/signature/style/index.js +9 -0
- package/es/signature/style/less.js +9 -0
- package/es/slider/index.less +94 -94
- package/es/step/index.less +139 -139
- package/es/stepper/index.less +130 -130
- package/es/steps/index.less +21 -21
- package/es/sticky/index.less +11 -11
- package/es/style/animation.less +139 -139
- package/es/style/base.less +11 -11
- package/es/style/clearfix.less +5 -5
- package/es/style/ellipsis.less +13 -13
- package/es/style/hairline.less +47 -47
- package/es/style/halfPxBorder.less +15 -15
- package/es/style/mixins/clearfix.less +7 -7
- package/es/style/mixins/ellipsis.less +15 -15
- package/es/style/mixins/hairline.less +39 -39
- package/es/style/normalize.less +38 -38
- package/es/style/reset.less +171 -171
- package/es/style/var.less +941 -919
- package/es/swipe/index.less +56 -56
- package/es/swipe-cell/index.less +29 -29
- package/es/swipe-item/index.less +8 -8
- package/es/switch/index.less +56 -56
- package/es/switch/shared.js +2 -2
- package/es/switch-cell/index.less +15 -15
- package/es/tab/index.less +17 -17
- package/es/tabs/index.less +153 -153
- package/es/tag/index.less +99 -99
- package/es/telemetry/index.js +72 -0
- package/es/toast/index.js +1 -1
- package/es/toast/index.less +75 -75
- package/es/toast/style/index.js +1 -1
- package/es/toast/style/less.js +1 -1
- package/es/uploader/index.less +163 -163
- package/es/uploader/style/index.js +1 -1
- package/es/uploader/style/less.js +1 -1
- package/es/utils/create/bem.js +7 -7
- package/es/utils/create/component.js +37 -7
- package/es/utils/dom/raf.js +2 -2
- package/es/utils/dom/reset-scroll.js +3 -3
- package/es/utils/index.js +29 -29
- package/es/utils/media/image-util.js +138 -0
- package/es/utils/router.js +2 -2
- package/lib/7893e51cf0a4877dac80.worker.js +10 -0
- package/lib/area/style/index.js +4 -0
- package/lib/area/style/less.js +4 -0
- package/lib/avatar/index.css +1 -1
- package/lib/avatar/index.js +55 -37
- package/lib/avatar/index.less +39 -11
- package/lib/avatar/local.less +1 -1
- package/lib/be09b519a460e229fd8d.worker.js +2527 -0
- package/lib/button/index.js +5 -0
- package/lib/button/index.less +206 -206
- package/lib/calendar/index.less +250 -250
- package/lib/calendar/style/index.js +1 -1
- package/lib/calendar/style/less.js +1 -1
- package/lib/cell/index.less +103 -103
- package/lib/cell-group/index.less +22 -22
- package/lib/checkbox/index.less +89 -89
- package/lib/checkbox-group/index.less +8 -8
- package/lib/col/index.less +20 -20
- package/lib/datetime-picker/style/index.js +4 -0
- package/lib/datetime-picker/style/less.js +4 -0
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.less +125 -125
- package/lib/dialog/style/index.js +1 -1
- package/lib/dialog/style/less.js +1 -1
- package/lib/empty/Developing.js +1648 -0
- package/lib/empty/Error.js +489 -0
- package/lib/empty/NotFound.js +650 -0
- package/lib/empty/NotRight.js +400 -0
- package/lib/empty/Search.js +341 -0
- package/lib/empty/index.css +1 -0
- package/lib/empty/index.js +119 -0
- package/lib/empty/index.less +33 -0
- package/lib/empty/style/index.js +2 -0
- package/lib/empty/style/less.js +2 -0
- package/lib/field/index.less +172 -172
- package/lib/icon/index.less +10 -10
- package/lib/icon/local.less +1 -1
- package/lib/image/index.less +47 -47
- package/lib/image-preview/index.less +103 -103
- package/lib/image-preview/style/index.js +1 -1
- package/lib/image-preview/style/less.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.js +14 -2
- package/lib/index.less +6 -3
- package/lib/info/index.less +29 -29
- package/lib/loading/index.less +103 -103
- package/lib/locale/lang/zh-CN.js +22 -0
- package/lib/mixins/bind-event.js +2 -2
- package/lib/mixins/checkbox.js +2 -2
- package/lib/mixins/click-outside.js +2 -2
- package/lib/mixins/slots.js +3 -3
- package/lib/mixins/telemetry.js +20 -0
- package/lib/nav-bar/index.less +74 -74
- package/lib/number-keyboard/index.css +1 -1
- package/lib/number-keyboard/index.less +144 -142
- package/lib/overlay/index.less +11 -11
- package/lib/password-input/index.css +1 -0
- package/lib/password-input/index.js +93 -0
- package/lib/password-input/index.less +83 -0
- package/lib/password-input/style/index.js +2 -0
- package/lib/password-input/style/less.js +2 -0
- package/lib/pdf-viewer/style/index.js +1 -1
- package/lib/pdf-viewer/style/less.js +1 -1
- package/lib/picker/PickerColumn.js +5 -6
- package/lib/picker/index.js +36 -6
- package/lib/picker/index.less +151 -151
- package/lib/picker/shared.js +4 -0
- package/lib/picker/style/index.js +4 -0
- package/lib/picker/style/less.js +4 -0
- package/lib/popup/index.less +137 -137
- package/lib/popup/style/index.js +1 -1
- package/lib/popup/style/less.js +1 -1
- package/lib/radio/index.less +86 -86
- package/lib/radio-group/index.less +8 -8
- package/lib/rate/index.css +1 -1
- package/lib/rate/index.js +1 -1
- package/lib/rate/index.less +47 -47
- package/lib/row/index.less +42 -42
- package/lib/signature/index.css +1 -0
- package/lib/signature/index.js +242 -0
- package/lib/signature/index.less +50 -0
- package/lib/signature/style/index.js +9 -0
- package/lib/signature/style/less.js +9 -0
- package/lib/slider/index.less +94 -94
- package/lib/step/index.less +139 -139
- package/lib/stepper/index.less +130 -130
- package/lib/steps/index.less +21 -21
- package/lib/sticky/index.less +11 -11
- package/lib/style/animation.less +139 -139
- package/lib/style/base.less +11 -11
- package/lib/style/clearfix.less +5 -5
- package/lib/style/ellipsis.less +13 -13
- package/lib/style/hairline.less +47 -47
- package/lib/style/halfPxBorder.less +15 -15
- package/lib/style/mixins/clearfix.less +7 -7
- package/lib/style/mixins/ellipsis.less +15 -15
- package/lib/style/mixins/hairline.less +39 -39
- package/lib/style/normalize.less +38 -38
- package/lib/style/reset.less +171 -171
- package/lib/style/var.less +941 -919
- package/lib/swipe/index.less +56 -56
- package/lib/swipe-cell/index.less +29 -29
- package/lib/swipe-item/index.less +8 -8
- package/lib/switch/index.less +56 -56
- package/lib/switch/shared.js +2 -2
- package/lib/switch-cell/index.less +15 -15
- package/lib/tab/index.less +17 -17
- package/lib/tabs/index.less +153 -153
- package/lib/tag/index.less +99 -99
- package/lib/telemetry/index.js +82 -0
- package/lib/toast/index.js +1 -1
- package/lib/toast/index.less +75 -75
- package/lib/toast/style/index.js +1 -1
- package/lib/toast/style/less.js +1 -1
- package/lib/uploader/index.less +163 -163
- package/lib/uploader/style/index.js +1 -1
- package/lib/uploader/style/less.js +1 -1
- package/lib/utils/create/bem.js +7 -7
- package/lib/utils/create/component.js +41 -7
- package/lib/utils/dom/raf.js +2 -2
- package/lib/utils/dom/reset-scroll.js +3 -3
- package/lib/utils/index.js +29 -29
- package/lib/utils/media/image-util.js +153 -0
- package/lib/utils/router.js +2 -2
- package/lib/zart.js +27476 -55536
- package/lib/zart.min.js +5 -5
- package/package.json +74 -74
- package/lib/a037f57fc4d92a8a1f1e.worker.js +0 -60600
- package/lib/b7cf90b4775181215df7.worker.js +0 -10
package/lib/uploader/index.less
CHANGED
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
@import '../style/var';
|
|
2
|
-
|
|
3
|
-
.zt-uploader {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: inline-block;
|
|
6
|
-
|
|
7
|
-
&__wrapper {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
|
|
11
|
-
&--disabled {
|
|
12
|
-
opacity: @uploader-disabled-opacity;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&__input {
|
|
17
|
-
position: absolute;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
overflow: hidden; // to clip file-upload-button
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
opacity: 0;
|
|
25
|
-
|
|
26
|
-
&-wrapper {
|
|
27
|
-
position: relative;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:disabled {
|
|
31
|
-
cursor: not-allowed;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__upload {
|
|
36
|
-
position: relative;
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
width: @uploader-size;
|
|
43
|
-
height: @uploader-size;
|
|
44
|
-
margin: 0 @padding-xs @padding-xs 0;
|
|
45
|
-
background-color: @uploader-upload-background-color;
|
|
46
|
-
|
|
47
|
-
&:active {
|
|
48
|
-
background-color: @uploader-upload-active-color;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&--readonly:active {
|
|
52
|
-
background-color: @uploader-upload-background-color;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&-icon {
|
|
56
|
-
color: @uploader-icon-color;
|
|
57
|
-
font-size: @uploader-icon-size;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&-text {
|
|
61
|
-
margin-top: @padding-xs;
|
|
62
|
-
color: @uploader-text-color;
|
|
63
|
-
font-size: @uploader-text-font-size;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&__preview {
|
|
68
|
-
position: relative;
|
|
69
|
-
margin: 0 @padding-xs @padding-xs 0;
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
|
|
72
|
-
&-image {
|
|
73
|
-
display: block;
|
|
74
|
-
width: @uploader-size;
|
|
75
|
-
height: @uploader-size;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&-delete {
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: 0;
|
|
82
|
-
right: 0;
|
|
83
|
-
width: @uploader-delete-icon-size;
|
|
84
|
-
height: @uploader-delete-icon-size;
|
|
85
|
-
background-color: @uploader-delete-background-color;
|
|
86
|
-
border-radius: 0 0 0 12px;
|
|
87
|
-
|
|
88
|
-
&-icon {
|
|
89
|
-
position: absolute;
|
|
90
|
-
top: -2px;
|
|
91
|
-
right: -2px;
|
|
92
|
-
color: #fff;
|
|
93
|
-
color: @uploader-delete-color;
|
|
94
|
-
font-size: 16px;
|
|
95
|
-
transform: scale(0.5);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&-cover {
|
|
100
|
-
position: absolute;
|
|
101
|
-
top: 0;
|
|
102
|
-
right: 0;
|
|
103
|
-
bottom: 0;
|
|
104
|
-
left: 0;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&__mask {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: 0;
|
|
111
|
-
right: 0;
|
|
112
|
-
bottom: 0;
|
|
113
|
-
left: 0;
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
align-items: center;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
color: @white;
|
|
119
|
-
background-color: @uploader-mask-background-color;
|
|
120
|
-
|
|
121
|
-
&-icon {
|
|
122
|
-
font-size: @uploader-mask-icon-size;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&-message {
|
|
126
|
-
margin-top: 6px;
|
|
127
|
-
padding: 0 @padding-base;
|
|
128
|
-
font-size: @uploader-mask-message-font-size;
|
|
129
|
-
line-height: @uploader-mask-message-line-height;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&__loading {
|
|
134
|
-
width: @uploader-loading-icon-size;
|
|
135
|
-
height: @uploader-loading-icon-size;
|
|
136
|
-
color: @uploader-loading-icon-color;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&__file {
|
|
140
|
-
display: flex;
|
|
141
|
-
flex-direction: column;
|
|
142
|
-
align-items: center;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
width: @uploader-size;
|
|
145
|
-
height: @uploader-size;
|
|
146
|
-
background-color: @uploader-file-background-color;
|
|
147
|
-
|
|
148
|
-
&-icon {
|
|
149
|
-
color: @uploader-file-icon-color;
|
|
150
|
-
font-size: @uploader-file-icon-size;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&-name {
|
|
154
|
-
box-sizing: border-box;
|
|
155
|
-
width: 100%;
|
|
156
|
-
margin-top: @uploader-file-name-margin-top;
|
|
157
|
-
padding: @uploader-file-name-padding;
|
|
158
|
-
color: @uploader-file-name-text-color;
|
|
159
|
-
font-size: @uploader-file-name-font-size;
|
|
160
|
-
text-align: center;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
1
|
+
@import '../style/var';
|
|
2
|
+
|
|
3
|
+
.zt-uploader {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
|
|
7
|
+
&__wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
|
|
11
|
+
&--disabled {
|
|
12
|
+
opacity: @uploader-disabled-opacity;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__input {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
overflow: hidden; // to clip file-upload-button
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
opacity: 0;
|
|
25
|
+
|
|
26
|
+
&-wrapper {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:disabled {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__upload {
|
|
36
|
+
position: relative;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
width: @uploader-size;
|
|
43
|
+
height: @uploader-size;
|
|
44
|
+
margin: 0 @padding-xs @padding-xs 0;
|
|
45
|
+
background-color: @uploader-upload-background-color;
|
|
46
|
+
|
|
47
|
+
&:active {
|
|
48
|
+
background-color: @uploader-upload-active-color;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--readonly:active {
|
|
52
|
+
background-color: @uploader-upload-background-color;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-icon {
|
|
56
|
+
color: @uploader-icon-color;
|
|
57
|
+
font-size: @uploader-icon-size;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-text {
|
|
61
|
+
margin-top: @padding-xs;
|
|
62
|
+
color: @uploader-text-color;
|
|
63
|
+
font-size: @uploader-text-font-size;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__preview {
|
|
68
|
+
position: relative;
|
|
69
|
+
margin: 0 @padding-xs @padding-xs 0;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
|
|
72
|
+
&-image {
|
|
73
|
+
display: block;
|
|
74
|
+
width: @uploader-size;
|
|
75
|
+
height: @uploader-size;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&-delete {
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 0;
|
|
82
|
+
right: 0;
|
|
83
|
+
width: @uploader-delete-icon-size;
|
|
84
|
+
height: @uploader-delete-icon-size;
|
|
85
|
+
background-color: @uploader-delete-background-color;
|
|
86
|
+
border-radius: 0 0 0 12px;
|
|
87
|
+
|
|
88
|
+
&-icon {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: -2px;
|
|
91
|
+
right: -2px;
|
|
92
|
+
color: #fff;
|
|
93
|
+
color: @uploader-delete-color;
|
|
94
|
+
font-size: 16px;
|
|
95
|
+
transform: scale(0.5);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&-cover {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: 0;
|
|
102
|
+
right: 0;
|
|
103
|
+
bottom: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__mask {
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 0;
|
|
111
|
+
right: 0;
|
|
112
|
+
bottom: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
color: @white;
|
|
119
|
+
background-color: @uploader-mask-background-color;
|
|
120
|
+
|
|
121
|
+
&-icon {
|
|
122
|
+
font-size: @uploader-mask-icon-size;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&-message {
|
|
126
|
+
margin-top: 6px;
|
|
127
|
+
padding: 0 @padding-base;
|
|
128
|
+
font-size: @uploader-mask-message-font-size;
|
|
129
|
+
line-height: @uploader-mask-message-line-height;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__loading {
|
|
134
|
+
width: @uploader-loading-icon-size;
|
|
135
|
+
height: @uploader-loading-icon-size;
|
|
136
|
+
color: @uploader-loading-icon-color;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__file {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
width: @uploader-size;
|
|
145
|
+
height: @uploader-size;
|
|
146
|
+
background-color: @uploader-file-background-color;
|
|
147
|
+
|
|
148
|
+
&-icon {
|
|
149
|
+
color: @uploader-file-icon-color;
|
|
150
|
+
font-size: @uploader-file-icon-size;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&-name {
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
width: 100%;
|
|
156
|
+
margin-top: @uploader-file-name-margin-top;
|
|
157
|
+
padding: @uploader-file-name-padding;
|
|
158
|
+
color: @uploader-file-name-text-color;
|
|
159
|
+
font-size: @uploader-file-name-font-size;
|
|
160
|
+
text-align: center;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require('../../style/base.css');
|
|
2
2
|
require('../../loading/index.css');
|
|
3
|
+
require('../../overlay/index.css');
|
|
3
4
|
require('../../info/index.css');
|
|
4
5
|
require('../../icon/index.css');
|
|
5
6
|
require('../../image/index.css');
|
|
6
|
-
require('../../overlay/index.css');
|
|
7
7
|
require('../../popup/index.css');
|
|
8
8
|
require('../../swipe/index.css');
|
|
9
9
|
require('../../swipe-item/index.css');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require('../../style/base.less');
|
|
2
2
|
require('../../loading/index.less');
|
|
3
|
+
require('../../overlay/index.less');
|
|
3
4
|
require('../../info/index.less');
|
|
4
5
|
require('../../icon/index.less');
|
|
5
6
|
require('../../image/index.less');
|
|
6
|
-
require('../../overlay/index.less');
|
|
7
7
|
require('../../popup/index.less');
|
|
8
8
|
require('../../swipe/index.less');
|
|
9
9
|
require('../../swipe-item/index.less');
|
package/lib/utils/create/bem.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.createBEM = createBEM;
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* bem helper
|
|
8
|
-
* b() // 'button'
|
|
9
|
-
* b('text') // 'button__text'
|
|
10
|
-
* b({ disabled }) // 'button button--disabled'
|
|
11
|
-
* b('text', { disabled }) // 'button__text button__text--disabled'
|
|
12
|
-
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
|
6
|
+
/**
|
|
7
|
+
* bem helper
|
|
8
|
+
* b() // 'button'
|
|
9
|
+
* b('text') // 'button__text'
|
|
10
|
+
* b({ disabled }) // 'button button--disabled'
|
|
11
|
+
* b('text', { disabled }) // 'button__text button__text--disabled'
|
|
12
|
+
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
|
13
13
|
*/
|
|
14
14
|
function gen(name, mods) {
|
|
15
15
|
if (!mods) {
|
|
@@ -14,10 +14,14 @@ var _string = require("../format/string");
|
|
|
14
14
|
|
|
15
15
|
var _slots = require("../../mixins/slots");
|
|
16
16
|
|
|
17
|
+
var _telemetry = require("../../mixins/telemetry");
|
|
18
|
+
|
|
17
19
|
var _vue = _interopRequireDefault(require("vue"));
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
var _telemetry2 = require("../../telemetry");
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Create a basic component with common options
|
|
21
25
|
*/
|
|
22
26
|
function install(Vue) {
|
|
23
27
|
var name = this.name;
|
|
@@ -41,26 +45,56 @@ function unifySlots(context) {
|
|
|
41
45
|
} // should be removed after Vue 3
|
|
42
46
|
|
|
43
47
|
|
|
44
|
-
function transformFunctionComponent(pure) {
|
|
48
|
+
function transformFunctionComponent(pure, name) {
|
|
49
|
+
var onAfterEnter = function onAfterEnter() {
|
|
50
|
+
var event = new _telemetry2.TelemetryEvent(name);
|
|
51
|
+
|
|
52
|
+
_telemetry2.Telemetry.sharedInstance.trackAppear(event);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var onBeforeLeave = function onBeforeLeave() {
|
|
56
|
+
var event = new _telemetry2.TelemetryEvent(name);
|
|
57
|
+
|
|
58
|
+
_telemetry2.Telemetry.sharedInstance.trackDisappear(event);
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 使用transition 模拟 functional template的 mounted 和 unmounted
|
|
62
|
+
* @param h
|
|
63
|
+
* @param context
|
|
64
|
+
* @see {@link https://dev.to/denisinvader/mounted-and-beforedestroy-hooks-in-vuejs-functional-components-7bi|Mounted and BeforeDestroy Hooks in Vue.js functional components.}
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var render = function render(h, context) {
|
|
69
|
+
return h("transition", {
|
|
70
|
+
"attrs": {
|
|
71
|
+
"appear": true
|
|
72
|
+
},
|
|
73
|
+
"on": {
|
|
74
|
+
"afterEnter": onAfterEnter,
|
|
75
|
+
"beforeLeave": onBeforeLeave
|
|
76
|
+
}
|
|
77
|
+
}, [pure(h, context.props, unifySlots(context), context)]);
|
|
78
|
+
};
|
|
79
|
+
|
|
45
80
|
return {
|
|
46
81
|
functional: true,
|
|
47
82
|
props: pure.props,
|
|
48
83
|
model: pure.model,
|
|
49
|
-
render:
|
|
50
|
-
return pure(h, context.props, unifySlots(context), context);
|
|
51
|
-
}
|
|
84
|
+
render: render
|
|
52
85
|
};
|
|
53
86
|
}
|
|
54
87
|
|
|
55
88
|
function createComponent(name) {
|
|
56
89
|
return function (sfc) {
|
|
57
90
|
if ((0, _.isFunction)(sfc)) {
|
|
58
|
-
sfc = transformFunctionComponent(sfc);
|
|
91
|
+
sfc = transformFunctionComponent(sfc, name);
|
|
59
92
|
}
|
|
60
93
|
|
|
61
94
|
if (!sfc.functional) {
|
|
62
95
|
sfc.mixins = sfc.mixins || [];
|
|
63
96
|
sfc.mixins.push(_slots.SlotsMixin);
|
|
97
|
+
sfc.mixins.push(_telemetry.TelemetryMixin);
|
|
64
98
|
}
|
|
65
99
|
|
|
66
100
|
sfc.name = name;
|
package/lib/utils/dom/raf.js
CHANGED
|
@@ -7,9 +7,9 @@ var _system = require("../validate/system");
|
|
|
7
7
|
|
|
8
8
|
var _scroll = require("./scroll");
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Hack for iOS12 page scroll
|
|
12
|
-
* https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
|
|
10
|
+
/**
|
|
11
|
+
* Hack for iOS12 page scroll
|
|
12
|
+
* https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
|
|
13
13
|
*/
|
|
14
14
|
var isIOS = (0, _system.isIOS)();
|
|
15
15
|
/* istanbul ignore next */
|
package/lib/utils/index.js
CHANGED
|
@@ -55,35 +55,35 @@ function get(object, path) {
|
|
|
55
55
|
});
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Checks if `value` is an empty object, collection, map, or set.
|
|
60
|
-
*
|
|
61
|
-
* Objects are considered empty if they have no own enumerable string keyed
|
|
62
|
-
* properties.
|
|
63
|
-
*
|
|
64
|
-
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
65
|
-
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
66
|
-
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
67
|
-
*
|
|
68
|
-
* @function isEmpty
|
|
69
|
-
* @param {*} value The value to check.
|
|
70
|
-
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
71
|
-
* @example
|
|
72
|
-
*
|
|
73
|
-
* _.isEmpty(null);
|
|
74
|
-
* // => true
|
|
75
|
-
*
|
|
76
|
-
* _.isEmpty(true);
|
|
77
|
-
* // => true
|
|
78
|
-
*
|
|
79
|
-
* _.isEmpty(1);
|
|
80
|
-
* // => true
|
|
81
|
-
*
|
|
82
|
-
* _.isEmpty([1, 2, 3]);
|
|
83
|
-
* // => false
|
|
84
|
-
*
|
|
85
|
-
* _.isEmpty({ 'a': 1 });
|
|
86
|
-
* // => false
|
|
58
|
+
/**
|
|
59
|
+
* Checks if `value` is an empty object, collection, map, or set.
|
|
60
|
+
*
|
|
61
|
+
* Objects are considered empty if they have no own enumerable string keyed
|
|
62
|
+
* properties.
|
|
63
|
+
*
|
|
64
|
+
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
65
|
+
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
66
|
+
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
67
|
+
*
|
|
68
|
+
* @function isEmpty
|
|
69
|
+
* @param {*} value The value to check.
|
|
70
|
+
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
71
|
+
* @example
|
|
72
|
+
*
|
|
73
|
+
* _.isEmpty(null);
|
|
74
|
+
* // => true
|
|
75
|
+
*
|
|
76
|
+
* _.isEmpty(true);
|
|
77
|
+
* // => true
|
|
78
|
+
*
|
|
79
|
+
* _.isEmpty(1);
|
|
80
|
+
* // => true
|
|
81
|
+
*
|
|
82
|
+
* _.isEmpty([1, 2, 3]);
|
|
83
|
+
* // => false
|
|
84
|
+
*
|
|
85
|
+
* _.isEmpty({ 'a': 1 });
|
|
86
|
+
* // => false
|
|
87
87
|
*/
|
|
88
88
|
|
|
89
89
|
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.file2DataURL = file2DataURL;
|
|
5
|
+
exports.file2Image = file2Image;
|
|
6
|
+
exports.image2file = image2file;
|
|
7
|
+
exports.image2Canvas = image2Canvas;
|
|
8
|
+
exports.canvas2Image = canvas2Image;
|
|
9
|
+
exports.canvas2File = canvas2File;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Convert File to data schema url
|
|
13
|
+
* @param file
|
|
14
|
+
*/
|
|
15
|
+
function file2DataURL(file) {
|
|
16
|
+
return new Promise(function (resolve, reject) {
|
|
17
|
+
var a = new FileReader();
|
|
18
|
+
|
|
19
|
+
a.onload = function (res) {
|
|
20
|
+
if (res && res.target) {
|
|
21
|
+
resolve(res.target.result);
|
|
22
|
+
} else {
|
|
23
|
+
reject(new Error('读取文件url失败'));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
a.readAsDataURL(file);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Convert file to image
|
|
32
|
+
* @param file
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
function file2Image(file) {
|
|
37
|
+
return new Promise(function (resolve, reject) {
|
|
38
|
+
file2DataURL(file).then(function (url) {
|
|
39
|
+
var img = new Image();
|
|
40
|
+
img.src = url;
|
|
41
|
+
|
|
42
|
+
img.onload = function (e) {
|
|
43
|
+
if (img.complete) {
|
|
44
|
+
resolve(img);
|
|
45
|
+
} else {
|
|
46
|
+
reject(new Error('文件加载失败'));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}).catch(reject);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function image2file(img, fileName, lastModified, type, quality) {
|
|
54
|
+
if (type === void 0) {
|
|
55
|
+
type = "image/jpeg";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (quality === void 0) {
|
|
59
|
+
quality = 0.8;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return image2Canvas(img).then(function (canvas) {
|
|
63
|
+
return canvas2File(canvas, fileName, lastModified, type, quality);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Draw image on canvas
|
|
68
|
+
* @param img
|
|
69
|
+
* @param width
|
|
70
|
+
* @param height
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
function image2Canvas(img, width, height) {
|
|
75
|
+
var canvas = document.createElement('canvas');
|
|
76
|
+
|
|
77
|
+
if (!width) {
|
|
78
|
+
width = img.width;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!height) {
|
|
82
|
+
height = img.height;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
canvas.width = width;
|
|
86
|
+
canvas.height = height;
|
|
87
|
+
var ctx = canvas.getContext('2d');
|
|
88
|
+
|
|
89
|
+
if (ctx) {
|
|
90
|
+
ctx.drawImage(img, 0, 0, width, height);
|
|
91
|
+
return Promise.resolve(canvas);
|
|
92
|
+
} else {
|
|
93
|
+
return Promise.reject(null);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Export Image from canvas
|
|
98
|
+
* @param canvas
|
|
99
|
+
* @param type
|
|
100
|
+
* @param quality
|
|
101
|
+
* @see {@link https://meshworld.in/convert-canvas-to-an-image-using-javascript/}
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
function canvas2Image(canvas, type, quality) {
|
|
106
|
+
if (type === void 0) {
|
|
107
|
+
type = "image/jpeg";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (quality === void 0) {
|
|
111
|
+
quality = 0.8;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var image = new Image();
|
|
115
|
+
image.src = canvas.toDataURL(type, quality);
|
|
116
|
+
return Promise.resolve(image);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Export File from canvas
|
|
120
|
+
* @param canvas
|
|
121
|
+
* @param fileName
|
|
122
|
+
* @param lastModified
|
|
123
|
+
* @param type
|
|
124
|
+
* @param quality
|
|
125
|
+
* @see {@link https://meshworld.in/convert-canvas-to-an-image-using-javascript/}
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
function canvas2File(canvas, fileName, lastModified, type, quality) {
|
|
130
|
+
if (type === void 0) {
|
|
131
|
+
type = "image/jpeg";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (quality === void 0) {
|
|
135
|
+
quality = 0.8;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return new Promise(function (resolve, reject) {
|
|
139
|
+
canvas.toBlob(function (blob) {
|
|
140
|
+
if (!blob) {
|
|
141
|
+
reject(new Error('canvas文件导出失败'));
|
|
142
|
+
} else {
|
|
143
|
+
var file = new File([blob], fileName, {
|
|
144
|
+
lastModified: lastModified,
|
|
145
|
+
type: type
|
|
146
|
+
}); // console.log("file size " + file.size / 1024 + "kb");
|
|
147
|
+
// console.log(file)
|
|
148
|
+
|
|
149
|
+
resolve(file);
|
|
150
|
+
}
|
|
151
|
+
}, type, quality);
|
|
152
|
+
});
|
|
153
|
+
}
|