@nutui/nutui-react-taro 3.0.3 → 3.0.5
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/CHANGELOG.md +9 -0
- package/dist/cjs/packages/badge/style/badge.scss +3 -8
- package/dist/cjs/packages/badge/style/style.css +4 -9
- package/dist/cjs/packages/badge/style/style.harmony.css +4 -9
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +0 -1
- package/dist/cjs/packages/datepickerview/style/style.css +0 -1
- package/dist/cjs/packages/empty/style/index.js +1 -0
- package/dist/cjs/packages/empty/style/style.css +389 -0
- package/dist/cjs/packages/fixednav/fixednav.js +3 -3
- package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/cjs/packages/fixednav/style/style.css +47 -45
- package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/cjs/packages/imagepreview/style/style.css +2 -1
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
- package/dist/cjs/packages/nutui.react.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +0 -1
- package/dist/cjs/packages/pickerview/pickerroller.js +76 -11
- package/dist/cjs/packages/pickerview/style/pickerview.scss +0 -1
- package/dist/cjs/packages/pickerview/style/style.css +0 -1
- package/dist/cjs/packages/resultpage/style/index.js +1 -0
- package/dist/cjs/packages/resultpage/style/style.css +389 -0
- package/dist/cjs/packages/sidebar/sidebar.js +3 -4
- package/dist/cjs/packages/tabbar/style/style.css +4 -9
- package/dist/cjs/packages/tabbaritem/style/style.css +4 -9
- package/dist/es/packages/badge/style/badge.scss +3 -8
- package/dist/es/packages/badge/style/style.css +4 -9
- package/dist/es/packages/badge/style/style.harmony.css +4 -9
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +0 -1
- package/dist/es/packages/datepickerview/style/style.css +0 -1
- package/dist/es/packages/empty/style/index.js +1 -0
- package/dist/es/packages/empty/style/style.css +389 -0
- package/dist/es/packages/fixednav/fixednav.js +4 -4
- package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/es/packages/fixednav/style/style.css +47 -45
- package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/es/packages/imagepreview/imagepreview.js +58 -91
- package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/es/packages/imagepreview/style/style.css +2 -1
- package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/es/packages/inputnumber/inputnumber.js +2 -2
- package/dist/es/packages/picker/style/style.css +0 -1
- package/dist/es/packages/pickerview/pickerroller.js +75 -11
- package/dist/es/packages/pickerview/style/pickerview.scss +0 -1
- package/dist/es/packages/pickerview/style/style.css +0 -1
- package/dist/es/packages/resultpage/style/index.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +389 -0
- package/dist/es/packages/sidebar/sidebar.js +3 -4
- package/dist/es/packages/tabbar/style/style.css +4 -9
- package/dist/es/packages/tabbaritem/style/style.css +4 -9
- package/dist/nutui.react.umd.js +132 -104
- package/dist/style.css +1 -1
- package/dist/style.scss +50 -50
- package/dist/styles/theme-dark.scss +2 -0
- package/dist/styles/theme-default.scss +2 -0
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +1 -0
- package/dist/styles/variables-jrkf.scss +1 -0
- package/dist/styles/variables.scss +2 -1
- package/package.json +1 -1
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
.nut-badge {
|
|
61
61
|
position: relative;
|
|
62
62
|
display: inline-flex;
|
|
63
|
+
vertical-align: middle;
|
|
64
|
+
box-sizing: content-box;
|
|
63
65
|
width: auto;
|
|
64
66
|
}
|
|
65
67
|
.nut-badge-icon {
|
|
@@ -92,13 +94,12 @@
|
|
|
92
94
|
}
|
|
93
95
|
.nut-badge-sup {
|
|
94
96
|
display: inline-flex;
|
|
95
|
-
|
|
96
|
-
height: var(--nutui-badge-height, 14px);
|
|
97
|
+
text-align: center;
|
|
97
98
|
min-width: var(--nutui-badge-min-width, 6px);
|
|
98
99
|
padding: var(--nutui-badge-padding, 1px 4px);
|
|
99
100
|
box-sizing: border-box;
|
|
100
101
|
color: var(--nutui-badge-color, #ffffff);
|
|
101
|
-
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-
|
|
102
|
+
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxxs, 9px));
|
|
102
103
|
line-height: 12px;
|
|
103
104
|
white-space: nowrap;
|
|
104
105
|
font-weight: normal;
|
|
@@ -108,12 +109,6 @@
|
|
|
108
109
|
}
|
|
109
110
|
.nut-badge-number {
|
|
110
111
|
font-family: "JD";
|
|
111
|
-
/* #ifdef harmony */
|
|
112
|
-
line-height: 12px;
|
|
113
|
-
/* #endif */
|
|
114
|
-
/* #ifndef harmony */
|
|
115
|
-
line-height: 13px;
|
|
116
|
-
/* #endif */
|
|
117
112
|
}
|
|
118
113
|
.nut-badge-one {
|
|
119
114
|
height: var(--nutui-badge-height, 14px);
|
|
@@ -159,7 +154,6 @@
|
|
|
159
154
|
z-index: var(--nutui-fixednav-index, 900);
|
|
160
155
|
display: inline-block;
|
|
161
156
|
height: 50px;
|
|
162
|
-
right: 0;
|
|
163
157
|
}
|
|
164
158
|
.nut-fixednav.active .nut-fixednav-btn .nut-icon {
|
|
165
159
|
transform: rotate(180deg);
|
|
@@ -167,18 +161,16 @@
|
|
|
167
161
|
.nut-fixednav.active .nut-fixednav-list {
|
|
168
162
|
transform: translateX(0%) !important;
|
|
169
163
|
}
|
|
170
|
-
.nut-fixednav.active.left .nut-icon {
|
|
171
|
-
transform: rotate(0deg)
|
|
164
|
+
.nut-fixednav.active.nut-fixednav-left .nut-icon {
|
|
165
|
+
transform: rotate(0deg);
|
|
172
166
|
}
|
|
173
167
|
.nut-fixednav-btn {
|
|
174
168
|
box-sizing: border-box;
|
|
175
169
|
position: absolute;
|
|
176
|
-
right: 0;
|
|
177
170
|
z-index: var(--nutui-fixednav-index, 900);
|
|
178
171
|
width: 70px;
|
|
179
172
|
height: 100%;
|
|
180
173
|
background: var(--nutui-fixednav-button-background, var(--nutui-color-primary, #ff0f23));
|
|
181
|
-
border-radius: 45px 0px 0px 45px;
|
|
182
174
|
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
|
|
183
175
|
display: flex;
|
|
184
176
|
align-items: center;
|
|
@@ -192,15 +184,10 @@
|
|
|
192
184
|
flex-shrink: 0;
|
|
193
185
|
}
|
|
194
186
|
.nut-fixednav-btn .nut-icon {
|
|
195
|
-
margin-right: 5px;
|
|
196
|
-
transition: all 0.3s;
|
|
197
|
-
transform: rotate(0deg);
|
|
198
187
|
transition: all 0.3s;
|
|
199
188
|
}
|
|
200
189
|
.nut-fixednav-list {
|
|
201
190
|
position: absolute;
|
|
202
|
-
right: 0;
|
|
203
|
-
transform: translateX(100%);
|
|
204
191
|
transition: all 0.5s;
|
|
205
192
|
z-index: var(--nutui-fixednav-index, 900);
|
|
206
193
|
flex-shrink: 0;
|
|
@@ -208,10 +195,7 @@
|
|
|
208
195
|
background: var(--nutui-fixednav-background-color, #ffffff);
|
|
209
196
|
display: flex;
|
|
210
197
|
justify-content: space-between;
|
|
211
|
-
border-radius: 25px 0px 0px 25px;
|
|
212
198
|
box-shadow: 2px 2px 8px 0px rgba(0, 0, 0, 0.2);
|
|
213
|
-
padding-left: 20px;
|
|
214
|
-
padding-right: 80px;
|
|
215
199
|
}
|
|
216
200
|
.nut-fixednav-list-item {
|
|
217
201
|
position: relative;
|
|
@@ -225,45 +209,63 @@
|
|
|
225
209
|
flex-shrink: 0;
|
|
226
210
|
color: var(--nutui-fixednav-color, #1a1a1a);
|
|
227
211
|
}
|
|
228
|
-
.nut-fixednav-list-item
|
|
212
|
+
.nut-fixednav-list-item .nut-fixednav-list-text {
|
|
213
|
+
font-size: 10px;
|
|
214
|
+
}
|
|
215
|
+
.nut-fixednav-list-image {
|
|
229
216
|
width: 20px;
|
|
230
217
|
height: 20px;
|
|
231
218
|
margin-bottom: 2px;
|
|
232
219
|
}
|
|
233
|
-
.nut-fixednav-
|
|
234
|
-
|
|
220
|
+
.nut-fixednav-right {
|
|
221
|
+
right: 0;
|
|
235
222
|
}
|
|
236
|
-
.nut-fixednav.
|
|
237
|
-
right:
|
|
223
|
+
.nut-fixednav-right .nut-fixednav-btn {
|
|
224
|
+
right: 0;
|
|
225
|
+
border-radius: 45px 0px 0px 45px;
|
|
226
|
+
}
|
|
227
|
+
.nut-fixednav-right .nut-fixednav-btn .nut-icon {
|
|
228
|
+
margin-right: 5px;
|
|
229
|
+
transform: rotate(0deg);
|
|
230
|
+
}
|
|
231
|
+
.nut-fixednav-right .nut-fixednav-list {
|
|
232
|
+
right: 0;
|
|
233
|
+
transform: translateX(100%);
|
|
234
|
+
border-radius: 25px 0px 0px 25px;
|
|
235
|
+
padding-left: 20px;
|
|
236
|
+
padding-right: 80px;
|
|
237
|
+
}
|
|
238
|
+
.nut-fixednav-left {
|
|
238
239
|
left: 0;
|
|
239
240
|
}
|
|
240
|
-
.nut-fixednav
|
|
241
|
+
.nut-fixednav-left .nut-fixednav-btn {
|
|
241
242
|
flex-direction: row-reverse;
|
|
242
|
-
right: auto;
|
|
243
243
|
left: 0;
|
|
244
244
|
border-radius: 0 45px 45px 0;
|
|
245
245
|
}
|
|
246
|
-
.nut-fixednav
|
|
247
|
-
transform: rotate(180deg);
|
|
248
|
-
margin-right: 0px;
|
|
246
|
+
.nut-fixednav-left .nut-fixednav-btn .nut-icon {
|
|
249
247
|
margin-left: 5px;
|
|
248
|
+
transform: rotate(180deg);
|
|
250
249
|
}
|
|
251
|
-
.nut-fixednav
|
|
250
|
+
.nut-fixednav-left .nut-fixednav-list {
|
|
252
251
|
transform: translateX(-100%);
|
|
253
|
-
|
|
252
|
+
left: 0;
|
|
254
253
|
border-radius: 0px 25px 25px 0px;
|
|
255
254
|
padding-left: 80px;
|
|
256
255
|
padding-right: 20px;
|
|
257
|
-
margin: 0;
|
|
258
256
|
}
|
|
259
257
|
|
|
260
|
-
[dir=rtl] .nut-fixednav,
|
|
261
|
-
.nut-rtl .nut-fixednav {
|
|
258
|
+
[dir=rtl] .nut-fixednav-right,
|
|
259
|
+
.nut-rtl .nut-fixednav-right {
|
|
262
260
|
right: auto;
|
|
263
261
|
left: 0;
|
|
264
262
|
}
|
|
265
263
|
[dir=rtl] .nut-fixednav.active .nut-icon,
|
|
266
264
|
.nut-rtl .nut-fixednav.active .nut-icon {
|
|
265
|
+
transform: rotate(0deg);
|
|
266
|
+
}
|
|
267
|
+
[dir=rtl] .nut-fixednav.active.nut-fixednav-left .nut-icon,
|
|
268
|
+
.nut-rtl .nut-fixednav.active.nut-fixednav-left .nut-icon {
|
|
267
269
|
transform: rotate(-180deg);
|
|
268
270
|
}
|
|
269
271
|
[dir=rtl] .nut-fixednav-btn,
|
|
@@ -293,25 +295,25 @@
|
|
|
293
295
|
right: auto;
|
|
294
296
|
left: 0;
|
|
295
297
|
}
|
|
296
|
-
[dir=rtl] .nut-fixednav
|
|
297
|
-
.nut-rtl .nut-fixednav
|
|
298
|
+
[dir=rtl] .nut-fixednav-left,
|
|
299
|
+
.nut-rtl .nut-fixednav-left {
|
|
298
300
|
left: auto;
|
|
299
301
|
right: 0;
|
|
300
302
|
}
|
|
301
|
-
[dir=rtl] .nut-fixednav
|
|
302
|
-
.nut-rtl .nut-fixednav
|
|
303
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-btn,
|
|
304
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-btn {
|
|
303
305
|
left: auto;
|
|
304
306
|
right: 0;
|
|
305
307
|
border-radius: 45px 0 0 45px;
|
|
306
308
|
}
|
|
307
|
-
[dir=rtl] .nut-fixednav
|
|
308
|
-
.nut-rtl .nut-fixednav
|
|
309
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-btn .nut-icon,
|
|
310
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-btn .nut-icon {
|
|
309
311
|
transform: rotate(0deg);
|
|
310
312
|
margin-right: 5px;
|
|
311
313
|
margin-left: 0px;
|
|
312
314
|
}
|
|
313
|
-
[dir=rtl] .nut-fixednav
|
|
314
|
-
.nut-rtl .nut-fixednav
|
|
315
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-list,
|
|
316
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-list {
|
|
315
317
|
transform: translateX(100%);
|
|
316
318
|
right: auto;
|
|
317
319
|
left: auto;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
z-index: 900;
|
|
8
8
|
display: inline-block;
|
|
9
9
|
height: 50px;
|
|
10
|
-
right: 0;
|
|
11
10
|
}
|
|
12
11
|
.nut-fixednav.active .nut-fixednav-btn .nut-icon {
|
|
13
12
|
transform: rotate(180deg);
|
|
@@ -15,18 +14,16 @@
|
|
|
15
14
|
.nut-fixednav.active .nut-fixednav-list {
|
|
16
15
|
transform: translateX(0%) !important;
|
|
17
16
|
}
|
|
18
|
-
.nut-fixednav.active.left .nut-icon {
|
|
19
|
-
transform: rotate(0deg)
|
|
17
|
+
.nut-fixednav.active.nut-fixednav-left .nut-icon {
|
|
18
|
+
transform: rotate(0deg);
|
|
20
19
|
}
|
|
21
20
|
.nut-fixednav-btn {
|
|
22
21
|
box-sizing: border-box;
|
|
23
22
|
position: absolute;
|
|
24
|
-
right: 0;
|
|
25
23
|
z-index: 900;
|
|
26
24
|
width: 70px;
|
|
27
25
|
height: 100%;
|
|
28
26
|
background: #ff0f23;
|
|
29
|
-
border-radius: 45px 0px 0px 45px;
|
|
30
27
|
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
|
|
31
28
|
display: flex;
|
|
32
29
|
align-items: center;
|
|
@@ -40,15 +37,10 @@
|
|
|
40
37
|
flex-shrink: 0;
|
|
41
38
|
}
|
|
42
39
|
.nut-fixednav-btn .nut-icon {
|
|
43
|
-
margin-right: 5px;
|
|
44
|
-
transition: all 0.3s;
|
|
45
|
-
transform: rotate(0deg);
|
|
46
40
|
transition: all 0.3s;
|
|
47
41
|
}
|
|
48
42
|
.nut-fixednav-list {
|
|
49
43
|
position: absolute;
|
|
50
|
-
right: 0;
|
|
51
|
-
transform: translateX(100%);
|
|
52
44
|
transition: all 0.5s;
|
|
53
45
|
z-index: 900;
|
|
54
46
|
flex-shrink: 0;
|
|
@@ -56,10 +48,7 @@
|
|
|
56
48
|
background: #ffffff;
|
|
57
49
|
display: flex;
|
|
58
50
|
justify-content: space-between;
|
|
59
|
-
border-radius: 25px 0px 0px 25px;
|
|
60
51
|
box-shadow: 2px 2px 8px 0px rgba(0, 0, 0, 0.2);
|
|
61
|
-
padding-left: 20px;
|
|
62
|
-
padding-right: 80px;
|
|
63
52
|
}
|
|
64
53
|
.nut-fixednav-list-item {
|
|
65
54
|
position: relative;
|
|
@@ -73,45 +62,63 @@
|
|
|
73
62
|
flex-shrink: 0;
|
|
74
63
|
color: #1a1a1a;
|
|
75
64
|
}
|
|
76
|
-
.nut-fixednav-list-item
|
|
65
|
+
.nut-fixednav-list-item .nut-fixednav-list-text {
|
|
66
|
+
font-size: 10px;
|
|
67
|
+
}
|
|
68
|
+
.nut-fixednav-list-image {
|
|
77
69
|
width: 20px;
|
|
78
70
|
height: 20px;
|
|
79
71
|
margin-bottom: 2px;
|
|
80
72
|
}
|
|
81
|
-
.nut-fixednav-
|
|
82
|
-
|
|
73
|
+
.nut-fixednav-right {
|
|
74
|
+
right: 0;
|
|
83
75
|
}
|
|
84
|
-
.nut-fixednav.
|
|
85
|
-
right:
|
|
76
|
+
.nut-fixednav-right .nut-fixednav-btn {
|
|
77
|
+
right: 0;
|
|
78
|
+
border-radius: 45px 0px 0px 45px;
|
|
79
|
+
}
|
|
80
|
+
.nut-fixednav-right .nut-fixednav-btn .nut-icon {
|
|
81
|
+
margin-right: 5px;
|
|
82
|
+
transform: rotate(0deg);
|
|
83
|
+
}
|
|
84
|
+
.nut-fixednav-right .nut-fixednav-list {
|
|
85
|
+
right: 0;
|
|
86
|
+
transform: translateX(100%);
|
|
87
|
+
border-radius: 25px 0px 0px 25px;
|
|
88
|
+
padding-left: 20px;
|
|
89
|
+
padding-right: 80px;
|
|
90
|
+
}
|
|
91
|
+
.nut-fixednav-left {
|
|
86
92
|
left: 0;
|
|
87
93
|
}
|
|
88
|
-
.nut-fixednav
|
|
94
|
+
.nut-fixednav-left .nut-fixednav-btn {
|
|
89
95
|
flex-direction: row-reverse;
|
|
90
|
-
right: auto;
|
|
91
96
|
left: 0;
|
|
92
97
|
border-radius: 0 45px 45px 0;
|
|
93
98
|
}
|
|
94
|
-
.nut-fixednav
|
|
95
|
-
transform: rotate(180deg);
|
|
96
|
-
margin-right: 0px;
|
|
99
|
+
.nut-fixednav-left .nut-fixednav-btn .nut-icon {
|
|
97
100
|
margin-left: 5px;
|
|
101
|
+
transform: rotate(180deg);
|
|
98
102
|
}
|
|
99
|
-
.nut-fixednav
|
|
103
|
+
.nut-fixednav-left .nut-fixednav-list {
|
|
100
104
|
transform: translateX(-100%);
|
|
101
|
-
|
|
105
|
+
left: 0;
|
|
102
106
|
border-radius: 0px 25px 25px 0px;
|
|
103
107
|
padding-left: 80px;
|
|
104
108
|
padding-right: 20px;
|
|
105
|
-
margin: 0;
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
[dir=rtl] .nut-fixednav,
|
|
109
|
-
.nut-rtl .nut-fixednav {
|
|
111
|
+
[dir=rtl] .nut-fixednav-right,
|
|
112
|
+
.nut-rtl .nut-fixednav-right {
|
|
110
113
|
right: auto;
|
|
111
114
|
left: 0;
|
|
112
115
|
}
|
|
113
116
|
[dir=rtl] .nut-fixednav.active .nut-icon,
|
|
114
117
|
.nut-rtl .nut-fixednav.active .nut-icon {
|
|
118
|
+
transform: rotate(0deg);
|
|
119
|
+
}
|
|
120
|
+
[dir=rtl] .nut-fixednav.active.nut-fixednav-left .nut-icon,
|
|
121
|
+
.nut-rtl .nut-fixednav.active.nut-fixednav-left .nut-icon {
|
|
115
122
|
transform: rotate(-180deg);
|
|
116
123
|
}
|
|
117
124
|
[dir=rtl] .nut-fixednav-btn,
|
|
@@ -141,25 +148,25 @@
|
|
|
141
148
|
right: auto;
|
|
142
149
|
left: 0;
|
|
143
150
|
}
|
|
144
|
-
[dir=rtl] .nut-fixednav
|
|
145
|
-
.nut-rtl .nut-fixednav
|
|
151
|
+
[dir=rtl] .nut-fixednav-left,
|
|
152
|
+
.nut-rtl .nut-fixednav-left {
|
|
146
153
|
left: auto;
|
|
147
154
|
right: 0;
|
|
148
155
|
}
|
|
149
|
-
[dir=rtl] .nut-fixednav
|
|
150
|
-
.nut-rtl .nut-fixednav
|
|
156
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-btn,
|
|
157
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-btn {
|
|
151
158
|
left: auto;
|
|
152
159
|
right: 0;
|
|
153
160
|
border-radius: 45px 0 0 45px;
|
|
154
161
|
}
|
|
155
|
-
[dir=rtl] .nut-fixednav
|
|
156
|
-
.nut-rtl .nut-fixednav
|
|
162
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-btn .nut-icon,
|
|
163
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-btn .nut-icon {
|
|
157
164
|
transform: rotate(0deg);
|
|
158
165
|
margin-right: 5px;
|
|
159
166
|
margin-left: 0px;
|
|
160
167
|
}
|
|
161
|
-
[dir=rtl] .nut-fixednav
|
|
162
|
-
.nut-rtl .nut-fixednav
|
|
168
|
+
[dir=rtl] .nut-fixednav-left .nut-fixednav-list,
|
|
169
|
+
.nut-rtl .nut-fixednav-left .nut-fixednav-list {
|
|
163
170
|
transform: translateX(100%);
|
|
164
171
|
right: auto;
|
|
165
172
|
left: auto;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
2
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
3
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
4
|
+
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
4
5
|
import React, { useEffect, useRef, useState } from "react";
|
|
5
6
|
import Taro from "@tarojs/taro";
|
|
6
7
|
import { Video as TaroVideo, View } from "@tarojs/components";
|
|
@@ -25,7 +26,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
25
26
|
closeIcon: false,
|
|
26
27
|
closeIconPosition: 'top-right',
|
|
27
28
|
showMenuByLongpress: false,
|
|
28
|
-
onChange: function(
|
|
29
|
+
onChange: function() {},
|
|
29
30
|
onClose: function() {}
|
|
30
31
|
});
|
|
31
32
|
export var ImagePreview = function(props) {
|
|
@@ -36,81 +37,59 @@ export var ImagePreview = function(props) {
|
|
|
36
37
|
value: value,
|
|
37
38
|
defaultValue: defaultValue,
|
|
38
39
|
finalValue: defaultValue,
|
|
39
|
-
onChange:
|
|
40
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
|
41
|
-
}
|
|
40
|
+
onChange: onChange
|
|
42
41
|
}), 2), innerNo = _usePropsValue[0], setInnerNo = _usePropsValue[1];
|
|
43
42
|
var _useState = _sliced_to_array(useState(visible), 2), showPop = _useState[0], setShowPop = _useState[1];
|
|
44
43
|
var _useState1 = _sliced_to_array(useState(0), 2), active = _useState1[0], setActive = _useState1[1];
|
|
45
|
-
var _useState2 = _sliced_to_array(useState(
|
|
44
|
+
var _useState2 = _sliced_to_array(useState(images.length + videos.length), 2), maxNo = _useState2[0], setMaxNo = _useState2[1];
|
|
46
45
|
var _useState3 = _sliced_to_array(useState({
|
|
47
46
|
scale: 1,
|
|
48
|
-
moveable: false
|
|
47
|
+
moveable: false,
|
|
48
|
+
oriDistance: 0,
|
|
49
|
+
originScale: 1
|
|
49
50
|
}), 2), store = _useState3[0], setStore = _useState3[1];
|
|
50
|
-
var
|
|
51
|
-
|
|
51
|
+
var lastTouchEndTime = useRef(0) // 用来辅助监听双击
|
|
52
|
+
;
|
|
52
53
|
var onTouchStart = function(event) {
|
|
53
54
|
var touches = event.touches;
|
|
54
55
|
var events = touches[0];
|
|
55
56
|
var events2 = touches[1];
|
|
56
57
|
// 如果已经放大,双击应变回原尺寸;如果是原尺寸,双击应放大
|
|
57
|
-
var curTouchTime =
|
|
58
|
-
if (curTouchTime - lastTouchEndTime <
|
|
58
|
+
var curTouchTime = Date.now();
|
|
59
|
+
if (curTouchTime - lastTouchEndTime.current < 100) {
|
|
59
60
|
var store1 = store;
|
|
60
|
-
|
|
61
|
-
store1.scale = 1;
|
|
62
|
-
} else if (store1.scale === 1) {
|
|
63
|
-
store1.scale = 2;
|
|
64
|
-
}
|
|
61
|
+
store1.scale = store1.scale === 1 ? 2 : 1;
|
|
65
62
|
scaleNow();
|
|
66
63
|
}
|
|
67
64
|
var store11 = store;
|
|
68
65
|
store11.moveable = true;
|
|
69
66
|
if (events2) {
|
|
70
67
|
// 如果开始两指操作,记录初始时刻两指间的距离
|
|
71
|
-
store11.oriDistance = getDistance(
|
|
72
|
-
x: events.pageX,
|
|
73
|
-
y: events.pageY
|
|
74
|
-
}, {
|
|
75
|
-
x: events2.pageX,
|
|
76
|
-
y: events2.pageY
|
|
77
|
-
});
|
|
68
|
+
store11.oriDistance = getDistance(events, events2);
|
|
78
69
|
}
|
|
79
70
|
// 取到开始两指操作时的放大(缩小比例),store.scale 存储的是当前的放缩比(相对于标准大小 scale 为 1 的情况的放大缩小比)
|
|
80
|
-
store11.originScale = store11.scale
|
|
71
|
+
store11.originScale = store11.scale;
|
|
81
72
|
};
|
|
82
73
|
var onTouchMove = function(event) {
|
|
74
|
+
if (!store.moveable) return;
|
|
83
75
|
var touches = event.touches;
|
|
84
76
|
var events = touches[0];
|
|
85
77
|
var events2 = touches[1];
|
|
86
|
-
if (!store.moveable) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
78
|
var store1 = store;
|
|
90
79
|
// 双指移动
|
|
91
80
|
if (events2) {
|
|
92
|
-
|
|
93
|
-
var curDistance = getDistance({
|
|
94
|
-
x: events.pageX,
|
|
95
|
-
y: events.pageY
|
|
96
|
-
}, {
|
|
97
|
-
x: events2.pageX,
|
|
98
|
-
y: events2.pageY
|
|
99
|
-
});
|
|
81
|
+
var curDistance = getDistance(events, events2);
|
|
100
82
|
/** 此处计算倍数,距离放大(缩小) k 倍则 scale 也 扩大(缩小) k 倍。距离放大(缩小)倍数 = 结束时两点距离 除以 开始时两点距离
|
|
101
83
|
* 注意此处的 scale 变化是基于 store.scale 的。
|
|
102
84
|
* store.scale 是一个暂存值,比如第一次放大 2 倍,则 store.scale 为 2。
|
|
103
85
|
* 再次两指触碰的时候,store.originScale 就为 store.scale 的值,基于此时的 store.scale 继续放大缩小。 * */ var curScale = curDistance / store1.oriDistance;
|
|
104
|
-
store1.scale = store1.originScale * curScale;
|
|
105
86
|
// 最大放大 3 倍,缩小后松手要弹回原比例
|
|
106
|
-
|
|
107
|
-
store1.scale = 3;
|
|
108
|
-
}
|
|
87
|
+
store1.scale = Math.min(store1.originScale * curScale, 3);
|
|
109
88
|
scaleNow();
|
|
110
89
|
}
|
|
111
90
|
};
|
|
112
91
|
var onTouchEnd = function() {
|
|
113
|
-
|
|
92
|
+
lastTouchEndTime.current = Date.now();
|
|
114
93
|
var store1 = store;
|
|
115
94
|
store1.moveable = false;
|
|
116
95
|
if (store1.scale < 1.1 && store1.scale > 1 || store1.scale < 1) {
|
|
@@ -125,6 +104,11 @@ export var ImagePreview = function(props) {
|
|
|
125
104
|
document.addEventListener('touchmove', onTouchMove);
|
|
126
105
|
document.addEventListener('touchend', onTouchEnd);
|
|
127
106
|
document.addEventListener('touchcancel', onTouchEnd);
|
|
107
|
+
return function() {
|
|
108
|
+
document.removeEventListener('touchcancel', onTouchEnd);
|
|
109
|
+
document.removeEventListener('touchmove', onTouchMove);
|
|
110
|
+
document.removeEventListener('touchend', onTouchEnd);
|
|
111
|
+
};
|
|
128
112
|
};
|
|
129
113
|
useEffect(function() {
|
|
130
114
|
setShowPop(visible);
|
|
@@ -142,22 +126,18 @@ export var ImagePreview = function(props) {
|
|
|
142
126
|
innerNo
|
|
143
127
|
]);
|
|
144
128
|
useEffect(function() {
|
|
145
|
-
setMaxNo(
|
|
129
|
+
setMaxNo(images.length + videos.length);
|
|
146
130
|
}, [
|
|
147
131
|
images,
|
|
148
132
|
videos
|
|
149
133
|
]);
|
|
150
134
|
var scaleNow = function() {
|
|
151
135
|
if (ref.current) {
|
|
152
|
-
;
|
|
153
136
|
ref.current.style.transform = "scale(".concat(store.scale, ")");
|
|
154
137
|
}
|
|
155
138
|
};
|
|
156
|
-
// 计算两个点的距离
|
|
157
139
|
var getDistance = function(first, second) {
|
|
158
|
-
|
|
159
|
-
// 放大 k 倍则 scale 也 扩大 k 倍
|
|
160
|
-
return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
|
|
140
|
+
return Math.hypot(Math.abs(second.pageX - first.pageX), Math.abs(second.pageY - first.pageY));
|
|
161
141
|
};
|
|
162
142
|
var slideChangeEnd = function(page) {
|
|
163
143
|
setActive(page + 1);
|
|
@@ -168,30 +148,28 @@ export var ImagePreview = function(props) {
|
|
|
168
148
|
setShowPop(false);
|
|
169
149
|
setActive(innerNo);
|
|
170
150
|
scaleNow();
|
|
171
|
-
onClose
|
|
151
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
172
152
|
setStore(_object_spread_props(_object_spread({}, store), {
|
|
173
153
|
scale: 1
|
|
174
154
|
}));
|
|
175
155
|
};
|
|
176
156
|
var closeOnImg = function(e) {
|
|
177
|
-
// 点击内容区域的图片是否可以关闭弹层(视频区域由于nut-video做了限制,无法关闭弹层)
|
|
178
157
|
e.stopPropagation();
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
158
|
+
// 点击内容区域的图片是否可以关闭弹层(视频区域由于nut-video做了限制,无法关闭弹层)
|
|
159
|
+
if (closeOnContentClick) onCloseInner(e);
|
|
182
160
|
};
|
|
183
161
|
return /*#__PURE__*/ React.createElement(Popup, {
|
|
184
162
|
visible: showPop,
|
|
185
163
|
className: "".concat(classPrefix, "-pop"),
|
|
186
|
-
style: {
|
|
187
|
-
width: '100%'
|
|
188
|
-
},
|
|
189
164
|
onClick: onCloseInner
|
|
190
165
|
}, /*#__PURE__*/ React.createElement(View, {
|
|
191
166
|
className: classNames(classPrefix, className),
|
|
192
167
|
style: style,
|
|
193
168
|
ref: ref,
|
|
194
|
-
onTouchStart: onTouchStart
|
|
169
|
+
onTouchStart: onTouchStart,
|
|
170
|
+
onTouchMove: onTouchMove,
|
|
171
|
+
onTouchEnd: onTouchEnd,
|
|
172
|
+
onTouchCancel: onTouchEnd
|
|
195
173
|
}, /*#__PURE__*/ React.createElement(Swiper, {
|
|
196
174
|
autoPlay: autoPlay,
|
|
197
175
|
className: "".concat(classPrefix, "-swiper"),
|
|
@@ -209,57 +187,46 @@ export var ImagePreview = function(props) {
|
|
|
209
187
|
},
|
|
210
188
|
defaultValue: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
|
|
211
189
|
indicator: indicator
|
|
212
|
-
}, (videos
|
|
190
|
+
}, _to_consumable_array(videos.map(function(item) {
|
|
213
191
|
return {
|
|
214
192
|
type: 'video',
|
|
215
193
|
data: item
|
|
216
194
|
};
|
|
217
|
-
}).concat((images
|
|
195
|
+
})).concat(_to_consumable_array(images.map(function(item) {
|
|
218
196
|
return {
|
|
219
197
|
type: 'image',
|
|
220
198
|
data: item
|
|
221
199
|
};
|
|
222
|
-
})).sort(function(a, b) {
|
|
200
|
+
}))).sort(function(a, b) {
|
|
223
201
|
var _a_data, _b_data;
|
|
224
202
|
var _a_data_index, _b_data_index;
|
|
225
203
|
return ((_a_data_index = (_a_data = a.data) === null || _a_data === void 0 ? void 0 : _a_data.index) !== null && _a_data_index !== void 0 ? _a_data_index : 0) - ((_b_data_index = (_b_data = b.data) === null || _b_data === void 0 ? void 0 : _b_data.index) !== null && _b_data_index !== void 0 ? _b_data_index : 0);
|
|
226
204
|
}).map(function(item, index) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
mode: "widthFix",
|
|
249
|
-
onClick: closeOnImg,
|
|
250
|
-
style: {
|
|
251
|
-
width: '100%'
|
|
252
|
-
}
|
|
253
|
-
}, Taro.getEnv() !== 'WEB' && {
|
|
254
|
-
showMenuByLongpress: showMenuByLongpress
|
|
255
|
-
})));
|
|
256
|
-
}
|
|
257
|
-
return null;
|
|
258
|
-
}))), pagination ? /*#__PURE__*/ React.createElement(View, {
|
|
205
|
+
return /*#__PURE__*/ React.createElement(SwiperItem, {
|
|
206
|
+
key: index,
|
|
207
|
+
className: "nut-imagepreview-swiper-item"
|
|
208
|
+
}, item.type === 'video' ? /*#__PURE__*/ React.createElement(TaroVideo, {
|
|
209
|
+
src: item.data.source.src,
|
|
210
|
+
onClick: closeOnImg,
|
|
211
|
+
controls: item.data.options.controls,
|
|
212
|
+
autoplay: false,
|
|
213
|
+
loop: false,
|
|
214
|
+
muted: item.data.options.muted
|
|
215
|
+
}) : /*#__PURE__*/ React.createElement(Image, _object_spread({
|
|
216
|
+
src: item.data.src,
|
|
217
|
+
mode: "widthFix",
|
|
218
|
+
onClick: closeOnImg,
|
|
219
|
+
style: {
|
|
220
|
+
width: '100%'
|
|
221
|
+
}
|
|
222
|
+
}, Taro.getEnv() !== 'WEB' && {
|
|
223
|
+
showMenuByLongpress: showMenuByLongpress
|
|
224
|
+
})));
|
|
225
|
+
}))), pagination && /*#__PURE__*/ React.createElement(View, {
|
|
259
226
|
className: "".concat(classPrefix, "-index")
|
|
260
|
-
}, active, "/",
|
|
227
|
+
}, active, "/", maxNo), closeIcon !== false && /*#__PURE__*/ React.createElement(View, {
|
|
261
228
|
className: "".concat(classPrefix, "-close ").concat(closeIconPosition),
|
|
262
229
|
onClick: onCloseInner
|
|
263
|
-
}, closeIcon === true ? /*#__PURE__*/ React.createElement(Close, null) : closeIcon)
|
|
230
|
+
}, closeIcon === true ? /*#__PURE__*/ React.createElement(Close, null) : closeIcon));
|
|
264
231
|
};
|
|
265
232
|
ImagePreview.displayName = 'NutImagePreview';
|
|
@@ -697,11 +697,12 @@
|
|
|
697
697
|
text-align: center;
|
|
698
698
|
}
|
|
699
699
|
.nut-imagepreview-pop {
|
|
700
|
+
width: 100%;
|
|
700
701
|
height: 100%;
|
|
702
|
+
max-width: 100% !important;
|
|
701
703
|
background: transparent !important;
|
|
702
704
|
display: flex;
|
|
703
705
|
align-items: center;
|
|
704
|
-
width: 100%;
|
|
705
706
|
}
|
|
706
707
|
.nut-imagepreview-swiper .nut-imagepreview-swiper-item,
|
|
707
708
|
.nut-imagepreview-swiper .nut-swiper-item {
|
|
@@ -53,11 +53,12 @@
|
|
|
53
53
|
text-align: center;
|
|
54
54
|
}
|
|
55
55
|
.nut-imagepreview-pop {
|
|
56
|
+
width: 100%;
|
|
56
57
|
height: 100%;
|
|
58
|
+
max-width: 100% !important;
|
|
57
59
|
background: transparent !important;
|
|
58
60
|
display: flex;
|
|
59
61
|
align-items: center;
|
|
60
|
-
width: 100%;
|
|
61
62
|
}
|
|
62
63
|
.nut-imagepreview-swiper .nut-imagepreview-swiper-item,
|
|
63
64
|
.nut-imagepreview-swiper .nut-swiper-item {
|