taro-react-uilib 1.3.0-2 → 1.3.0-3
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/components/Picker/PickerSlot.js +1 -1
- package/dist/components/Picker/PickerSlot.js.map +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/Popup/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/picker.scss +16 -12
- package/lib/components/Picker/PickerSlot.js +2 -2
- package/lib/components/Popup/index.js +7 -8
- package/lib/components/Popup/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,32 +5,36 @@
|
|
|
5
5
|
|
|
6
6
|
#{$xh-prefix}-picker {
|
|
7
7
|
background-color: #FFF;
|
|
8
|
-
|
|
8
|
+
border-radius: 45px 45px 0 0;
|
|
9
9
|
&-header {
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
align-items: center;
|
|
13
13
|
background-color: #fff;
|
|
14
|
-
border-radius: 20px 20px 0 0;
|
|
15
14
|
overflow: hidden;
|
|
16
15
|
border-bottom: 2px solid $border-color;
|
|
16
|
+
border-radius: 10px 10px 0 0;
|
|
17
17
|
min-height: 80px;
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
padding:
|
|
19
|
+
padding: 32px;
|
|
20
|
+
|
|
20
21
|
&-button {
|
|
21
22
|
display: inline-block;
|
|
22
23
|
font-size: 30px;
|
|
23
24
|
border: 0;
|
|
24
25
|
border-radius: 0;
|
|
25
26
|
&.picker-confirm {
|
|
26
|
-
color: $color
|
|
27
|
+
color: $font-color;
|
|
27
28
|
}
|
|
28
29
|
&.picker-cancel {
|
|
29
30
|
color: $font-color-tertiary;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
&-title {
|
|
33
|
-
font-size:
|
|
34
|
+
font-size: 38px;
|
|
35
|
+
font-family: PingFang SC;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
color: #333333;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
&-panel {
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
.xh-picker-indicator {
|
|
68
72
|
position: absolute;
|
|
69
73
|
top: 108PX;
|
|
70
|
-
height:
|
|
74
|
+
height: 48PX;
|
|
71
75
|
width: 100%;
|
|
72
76
|
border: #d8d8d8;
|
|
73
77
|
border-left: 0;
|
|
@@ -84,7 +88,7 @@
|
|
|
84
88
|
position: absolute;
|
|
85
89
|
top: 108PX;
|
|
86
90
|
width: 100%;
|
|
87
|
-
height:
|
|
91
|
+
height: 48PX;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
.xh-picker-content {
|
|
@@ -98,10 +102,10 @@
|
|
|
98
102
|
white-space: nowrap;
|
|
99
103
|
overflow: hidden;
|
|
100
104
|
text-overflow: ellipsis;
|
|
101
|
-
height:
|
|
102
|
-
line-height:
|
|
105
|
+
height: 48PX;
|
|
106
|
+
line-height: 48PX;
|
|
103
107
|
color: #d8d8d8;
|
|
104
|
-
font-size:
|
|
108
|
+
font-size: 18PX;
|
|
105
109
|
text-align: center;
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -125,8 +129,8 @@
|
|
|
125
129
|
.xh-picker-roller-item-title {
|
|
126
130
|
display: block;
|
|
127
131
|
width: 100%;
|
|
128
|
-
height:
|
|
129
|
-
line-height:
|
|
132
|
+
height: 48PX;
|
|
133
|
+
line-height: 48PX;
|
|
130
134
|
color: #1a1a1a;
|
|
131
135
|
font-size: 16PX;
|
|
132
136
|
}
|
|
@@ -12,10 +12,10 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
12
12
|
const INERTIA_TIME = 300;
|
|
13
13
|
const INERTIA_DISTANCE = 15;
|
|
14
14
|
const [currIndex, setCurrIndex] = useState(1);
|
|
15
|
-
const lineSpacing = useRef(
|
|
15
|
+
const lineSpacing = useRef(48);
|
|
16
16
|
const [touchTime, setTouchTime] = useState(0);
|
|
17
17
|
const [touchDeg, setTouchDeg] = useState("0deg");
|
|
18
|
-
const rotation =
|
|
18
|
+
const rotation = 22;
|
|
19
19
|
const moving = useRef(false);
|
|
20
20
|
let timer;
|
|
21
21
|
const listbox = useRef(null);
|
|
@@ -20,26 +20,25 @@ const Popup = props => {
|
|
|
20
20
|
"xh-popup-content-top": position === "top",
|
|
21
21
|
"xh-popup-content-bottom": position === "bottom",
|
|
22
22
|
});
|
|
23
|
+
const preventSTH = (e) => {
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
};
|
|
23
27
|
useEffect(() => {
|
|
24
28
|
if (visible) {
|
|
25
29
|
document.body.style.touchAction = "none";
|
|
26
|
-
document.body.addEventListener("touchmove",
|
|
27
|
-
e.stopPropagation();
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
});
|
|
30
|
+
document.body.addEventListener("touchmove", preventSTH);
|
|
30
31
|
document.body.style.overflowY = "hidden";
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
34
|
document.body.style.touchAction = "";
|
|
34
|
-
document.body.removeEventListener("touchmove",
|
|
35
|
-
e.stopPropagation();
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
});
|
|
35
|
+
document.body.removeEventListener("touchmove", preventSTH);
|
|
38
36
|
document.body.style.overflowY = "auto";
|
|
39
37
|
}
|
|
40
38
|
return () => {
|
|
41
39
|
document.body.style.touchAction = "";
|
|
42
40
|
document.body.style.overflowY = "auto";
|
|
41
|
+
document.body.removeEventListener("touchmove", preventSTH);
|
|
43
42
|
};
|
|
44
43
|
}, [visible]);
|
|
45
44
|
function handleClickOnMask() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Popup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyB,SAAS,EAAE,MAAM,OAAO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