@gm-mobile/c-react 3.12.7-beta.4 → 3.12.7-beta.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-mobile/c-react",
|
|
3
|
-
"version": "3.12.7-beta.
|
|
3
|
+
"version": "3.12.7-beta.6",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-mobile#readme",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"url": "https://github.com/gmfe/gm-mobile/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@gm-mobile/c-font": "^3.12.7-beta.
|
|
25
|
-
"@gm-mobile/c-tool": "^3.12.7-beta.
|
|
26
|
-
"@gm-mobile/locales": "^3.12.7-beta.
|
|
24
|
+
"@gm-mobile/c-font": "^3.12.7-beta.6",
|
|
25
|
+
"@gm-mobile/c-tool": "^3.12.7-beta.6",
|
|
26
|
+
"@gm-mobile/locales": "^3.12.7-beta.6",
|
|
27
27
|
"dayjs": "^1.11.6"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"prop-types": "^15.7.2",
|
|
35
35
|
"react": "^16.13.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7dafd80614346aa8042857377dd30d2a90e60e72"
|
|
38
38
|
}
|
|
@@ -80,6 +80,9 @@ const MonthsList: FC<MonthListProps> = ({
|
|
|
80
80
|
const monthsList = computedMonthList()
|
|
81
81
|
|
|
82
82
|
const scrollToTarget = (flag: boolean) => {
|
|
83
|
+
if (timeoutRef.current) {
|
|
84
|
+
clearTimeout(timeoutRef.current)
|
|
85
|
+
}
|
|
83
86
|
if (selected.length) {
|
|
84
87
|
const date = type === CALENDAR_TYPE.RANGE ? selected[1] : selected[0]
|
|
85
88
|
const targetId = _.findIndex(
|
|
@@ -89,13 +92,9 @@ const MonthsList: FC<MonthListProps> = ({
|
|
|
89
92
|
moment(item).month() === moment(date).month()
|
|
90
93
|
)
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
refList.current && refList.current.apiDoScrollToKey(targetId)
|
|
95
|
-
}, 200)
|
|
96
|
-
} else {
|
|
95
|
+
timeoutRef.current = setTimeout(() => {
|
|
97
96
|
refList.current && refList.current.apiDoScrollToKey(targetId)
|
|
98
|
-
}
|
|
97
|
+
}, 200)
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
|
|
@@ -111,8 +110,8 @@ const MonthsList: FC<MonthListProps> = ({
|
|
|
111
110
|
clearTimeout(timeoutRef.current)
|
|
112
111
|
}
|
|
113
112
|
if (max || min) {
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
const date = selected[0]
|
|
114
|
+
|
|
116
115
|
const targetId = _.findIndex(
|
|
117
116
|
monthsList,
|
|
118
117
|
(item) =>
|
|
@@ -120,12 +119,12 @@ const MonthsList: FC<MonthListProps> = ({
|
|
|
120
119
|
moment(item).month() === moment(date).month()
|
|
121
120
|
)
|
|
122
121
|
if (targetId !== -1) {
|
|
123
|
-
|
|
122
|
+
setTimeout(() => {
|
|
124
123
|
refList.current && refList.current.apiDoScrollToKey(targetId)
|
|
125
124
|
}, 200)
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
|
-
}, [max, min])
|
|
127
|
+
}, [max, min, monthsList])
|
|
129
128
|
|
|
130
129
|
return (
|
|
131
130
|
<VList
|