@mpxjs/webpack-plugin 2.9.67 → 2.9.69-beta.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.
Files changed (140) hide show
  1. package/lib/index.js +13 -8
  2. package/lib/platform/json/wx/index.js +21 -8
  3. package/lib/platform/style/wx/index.js +35 -38
  4. package/lib/platform/template/wx/component-config/canvas.js +8 -0
  5. package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
  6. package/lib/platform/template/wx/component-config/index.js +1 -1
  7. package/lib/platform/template/wx/component-config/input.js +1 -1
  8. package/lib/platform/template/wx/component-config/rich-text.js +8 -0
  9. package/lib/platform/template/wx/component-config/swiper.js +1 -1
  10. package/lib/platform/template/wx/component-config/textarea.js +1 -1
  11. package/lib/platform/template/wx/component-config/unsupported.js +1 -1
  12. package/lib/react/processStyles.js +14 -4
  13. package/lib/react/processTemplate.js +3 -0
  14. package/lib/resolver/AddModePlugin.js +8 -8
  15. package/lib/runtime/components/react/context.ts +6 -0
  16. package/lib/runtime/components/react/dist/context.js +2 -0
  17. package/lib/runtime/components/react/dist/event.config.js +24 -24
  18. package/lib/runtime/components/react/dist/getInnerListeners.js +183 -174
  19. package/lib/runtime/components/react/dist/mpx-button.jsx +77 -49
  20. package/lib/runtime/components/react/dist/mpx-canvas/Bus.js +60 -0
  21. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.js +15 -0
  22. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.js +84 -0
  23. package/lib/runtime/components/react/dist/mpx-canvas/Image.js +87 -0
  24. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.js +15 -0
  25. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.js +28 -0
  26. package/lib/runtime/components/react/dist/mpx-canvas/html.js +343 -0
  27. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +232 -0
  28. package/lib/runtime/components/react/dist/mpx-canvas/utils.jsx +89 -0
  29. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +13 -19
  30. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +29 -38
  31. package/lib/runtime/components/react/dist/mpx-form.jsx +16 -19
  32. package/lib/runtime/components/react/dist/mpx-icon.jsx +8 -16
  33. package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
  34. package/lib/runtime/components/react/dist/mpx-input.jsx +54 -27
  35. package/lib/runtime/components/react/dist/mpx-label.jsx +15 -22
  36. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +13 -16
  37. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +13 -13
  38. package/lib/runtime/components/react/dist/mpx-navigator.jsx +2 -4
  39. package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
  40. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
  41. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
  42. package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
  43. package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
  44. package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
  45. package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +39 -0
  46. package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +160 -88
  47. package/lib/runtime/components/react/dist/mpx-picker-view.jsx +80 -121
  48. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +11 -19
  49. package/lib/runtime/components/react/dist/mpx-radio.jsx +27 -42
  50. package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
  51. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
  52. package/lib/runtime/components/react/dist/mpx-root-portal.jsx +6 -4
  53. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +47 -41
  54. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
  55. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +4 -2
  56. package/lib/runtime/components/react/dist/mpx-swiper.jsx +606 -0
  57. package/lib/runtime/components/react/dist/mpx-switch.jsx +20 -10
  58. package/lib/runtime/components/react/dist/mpx-text.jsx +11 -10
  59. package/lib/runtime/components/react/dist/mpx-textarea.jsx +8 -3
  60. package/lib/runtime/components/react/dist/mpx-view.jsx +65 -61
  61. package/lib/runtime/components/react/dist/mpx-web-view.jsx +112 -35
  62. package/lib/runtime/components/react/dist/pickerFaces.js +81 -0
  63. package/lib/runtime/components/react/dist/pickerVIewContext.js +9 -0
  64. package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
  65. package/lib/runtime/components/react/dist/pickerViewOverlay.jsx +23 -0
  66. package/lib/runtime/components/react/dist/useAnimationHooks.js +35 -9
  67. package/lib/runtime/components/react/dist/utils.jsx +70 -23
  68. package/lib/runtime/components/react/event.config.ts +25 -26
  69. package/lib/runtime/components/react/getInnerListeners.ts +237 -199
  70. package/lib/runtime/components/react/mpx-button.tsx +104 -57
  71. package/lib/runtime/components/react/mpx-canvas/Bus.ts +70 -0
  72. package/lib/runtime/components/react/mpx-canvas/CanvasGradient.ts +18 -0
  73. package/lib/runtime/components/react/mpx-canvas/CanvasRenderingContext2D.ts +87 -0
  74. package/lib/runtime/components/react/mpx-canvas/Image.ts +102 -0
  75. package/lib/runtime/components/react/mpx-canvas/ImageData.ts +23 -0
  76. package/lib/runtime/components/react/mpx-canvas/constructorsRegistry.ts +38 -0
  77. package/lib/runtime/components/react/mpx-canvas/html.ts +343 -0
  78. package/lib/runtime/components/react/mpx-canvas/index.tsx +296 -0
  79. package/lib/runtime/components/react/mpx-canvas/utils.tsx +150 -0
  80. package/lib/runtime/components/react/mpx-checkbox-group.tsx +28 -25
  81. package/lib/runtime/components/react/mpx-checkbox.tsx +48 -49
  82. package/lib/runtime/components/react/mpx-form.tsx +25 -28
  83. package/lib/runtime/components/react/mpx-icon.tsx +12 -17
  84. package/lib/runtime/components/react/mpx-image.tsx +436 -0
  85. package/lib/runtime/components/react/mpx-input.tsx +77 -57
  86. package/lib/runtime/components/react/mpx-label.tsx +26 -27
  87. package/lib/runtime/components/react/mpx-movable-area.tsx +18 -23
  88. package/lib/runtime/components/react/mpx-movable-view.tsx +21 -25
  89. package/lib/runtime/components/react/mpx-navigator.tsx +2 -8
  90. package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
  91. package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
  92. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
  93. package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
  94. package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
  95. package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
  96. package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
  97. package/lib/runtime/components/react/mpx-picker-view-column.tsx +236 -104
  98. package/lib/runtime/components/react/mpx-picker-view.tsx +132 -122
  99. package/lib/runtime/components/react/mpx-radio-group.tsx +24 -27
  100. package/lib/runtime/components/react/mpx-radio.tsx +45 -54
  101. package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
  102. package/lib/runtime/components/react/mpx-rich-text/index.tsx +121 -0
  103. package/lib/runtime/components/react/mpx-root-portal.tsx +3 -5
  104. package/lib/runtime/components/react/mpx-scroll-view.tsx +72 -71
  105. package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
  106. package/lib/runtime/components/react/mpx-swiper/carouse.tsx +4 -2
  107. package/lib/runtime/components/react/mpx-swiper-item.tsx +3 -2
  108. package/lib/runtime/components/react/mpx-switch.tsx +29 -23
  109. package/lib/runtime/components/react/mpx-text.tsx +14 -18
  110. package/lib/runtime/components/react/mpx-textarea.tsx +11 -10
  111. package/lib/runtime/components/react/mpx-view.tsx +92 -76
  112. package/lib/runtime/components/react/mpx-web-view.tsx +116 -54
  113. package/lib/runtime/components/react/pickerFaces.ts +104 -0
  114. package/lib/runtime/components/react/pickerOverlay.tsx +32 -0
  115. package/lib/runtime/components/react/types/common.ts +2 -0
  116. package/lib/runtime/components/react/types/global.d.ts +5 -17
  117. package/lib/runtime/components/react/useAnimationHooks.ts +36 -11
  118. package/lib/runtime/components/react/utils.tsx +99 -28
  119. package/lib/runtime/components/web/getInnerListeners.js +6 -6
  120. package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
  121. package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
  122. package/lib/runtime/components/web/mpx-picker.vue +382 -385
  123. package/lib/runtime/components/web/mpx-web-view.vue +175 -161
  124. package/lib/runtime/optionProcessor.js +7 -38
  125. package/lib/runtime/utils.js +2 -0
  126. package/lib/style-compiler/plugins/scope-id.js +30 -2
  127. package/lib/template-compiler/bind-this.js +7 -2
  128. package/lib/template-compiler/compiler.js +79 -47
  129. package/lib/template-compiler/gen-node-react.js +3 -3
  130. package/lib/utils/pre-process-json.js +9 -5
  131. package/package.json +6 -4
  132. package/LICENSE +0 -433
  133. package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
  134. package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
  135. package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -478
  136. package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
  137. package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
  138. package/lib/runtime/components/react/mpx-image/index.tsx +0 -345
  139. package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
  140. package/lib/runtime/components/web/event.js +0 -105
@@ -1,31 +1,51 @@
1
1
 
2
2
  import { View, Animated, SafeAreaView, NativeScrollEvent, NativeSyntheticEvent, LayoutChangeEvent, ScrollView } from 'react-native'
3
- import React, { forwardRef, useRef, useState, useEffect, ReactElement, ReactNode } from 'react'
4
- import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout } from './utils'
5
- import useNodesRef, { HandlerRef } from './useNodesRef' // 引入辅助函数
3
+ import React, { forwardRef, useRef, useState, useMemo, useCallback, useEffect } from 'react'
4
+ import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout, usePrevious } from './utils'
5
+ import useNodesRef, { HandlerRef } from './useNodesRef'
6
+ import { createFaces } from './pickerFaces'
7
+ import PickerOverlay from './pickerOverlay'
8
+
6
9
  interface ColumnProps {
7
- children: React.ReactNode,
8
- selectedIndex: number,
9
- onColumnLayoutChange: Function,
10
- getInnerLayout: Function,
11
- onSelectChange: Function,
10
+ children?: React.ReactNode
11
+ columnData: React.ReactNode[]
12
+ initialIndex: number
13
+ onColumnItemRawHChange: Function
14
+ getInnerLayout: Function
15
+ onSelectChange: Function
12
16
  style: {
13
17
  [key: string]: any
14
- },
18
+ }
15
19
  'enable-var': boolean
16
20
  'external-var-context'?: Record<string, any>
17
21
  wrapperStyle: {
18
- height?: number,
19
- itemHeight: string
20
- },
21
- prefix: number
22
+ height: number
23
+ itemHeight: number
24
+ }
25
+ pickerOverlayStyle: Record<string, any>
26
+ columnIndex: number
22
27
  }
23
- const defaultItemHeight = 36
24
- // 每个Column 都有个外层的高度, 内部的元素高度
25
- // 默认的高度
28
+
29
+ // 默认的单个选项高度
30
+ const DefaultPickerItemH = 36
31
+ // 默认一屏可见选项个数
32
+ const visibleCount = 5
33
+
26
34
  const _PickerViewColumn = forwardRef<HandlerRef<ScrollView & View, ColumnProps>, ColumnProps>((props: ColumnProps, ref) => {
27
- const { children, selectedIndex, onColumnLayoutChange, onSelectChange, getInnerLayout, style, wrapperStyle, 'enable-var': enableVar, 'external-var-context': externalVarContext } = props
28
- // PickerViewColumn
35
+ const {
36
+ columnData,
37
+ columnIndex,
38
+ initialIndex,
39
+ onSelectChange,
40
+ onColumnItemRawHChange,
41
+ getInnerLayout,
42
+ style,
43
+ wrapperStyle,
44
+ pickerOverlayStyle,
45
+ 'enable-var': enableVar,
46
+ 'external-var-context': externalVarContext
47
+ } = props
48
+
29
49
  const {
30
50
  normalStyle,
31
51
  hasVarDec,
@@ -36,122 +56,234 @@ const _PickerViewColumn = forwardRef<HandlerRef<ScrollView & View, ColumnProps>,
36
56
  } = useTransformStyle(style, { enableVar, externalVarContext })
37
57
  const { textStyle } = splitStyle(normalStyle)
38
58
  const { textProps } = splitProps(props)
39
- // const { innerStyle } = splitStyle(normalStyle)
40
- // scrollView的ref
41
59
  const scrollViewRef = useRef<ScrollView>(null)
42
- useNodesRef(props, ref, scrollViewRef, {})
43
- // 每个元素的高度
44
- let [itemH, setItemH] = useState(0)
60
+
61
+ useNodesRef(props, ref, scrollViewRef, {
62
+ style: normalStyle
63
+ })
64
+
65
+ const { height: pickerH, itemHeight = DefaultPickerItemH } = wrapperStyle
66
+ const [itemRawH, setItemRawH] = useState(0) // 单个选项真实渲染高度
67
+ const maxIndex = useMemo(() => columnData.length - 1, [columnData])
68
+ const touching = useRef(false)
69
+ const scrolling = useRef(false)
70
+ const activeIndex = useRef(initialIndex)
71
+ const prevIndex = usePrevious(initialIndex)
72
+ const prevMaxIndex = usePrevious(maxIndex)
73
+
74
+ const initialOffset = useMemo(() => ({
75
+ x: 0,
76
+ y: itemRawH * initialIndex
77
+ }), [itemRawH])
78
+
79
+ const snapToOffsets = useMemo(
80
+ () => columnData.map((_, i) => i * itemRawH),
81
+ [columnData, itemRawH]
82
+ )
83
+
84
+ const contentContainerStyle = useMemo(() => {
85
+ return [
86
+ {
87
+ paddingVertical: Math.round(pickerH - itemRawH) / 2
88
+ }
89
+ ]
90
+ }, [pickerH, itemRawH])
45
91
 
46
92
  useEffect(() => {
47
- if (selectedIndex && itemH) {
48
- const offsetY = selectedIndex * itemH
49
- scrollViewRef.current?.scrollTo({ x: 0, y: offsetY, animated: true })
93
+ if (
94
+ !scrollViewRef.current ||
95
+ !itemRawH ||
96
+ touching.current ||
97
+ scrolling.current ||
98
+ prevIndex == null ||
99
+ initialIndex === prevIndex ||
100
+ initialIndex === activeIndex.current ||
101
+ maxIndex !== prevMaxIndex
102
+ ) {
103
+ return
50
104
  }
51
- }, [selectedIndex, itemH])
105
+
106
+ activeIndex.current = initialIndex
107
+ scrollViewRef.current.scrollTo({
108
+ x: 0,
109
+ y: itemRawH * initialIndex,
110
+ animated: false
111
+ })
112
+ }, [itemRawH, initialIndex])
52
113
 
53
114
  const onScrollViewLayout = () => {
54
115
  getInnerLayout && getInnerLayout(layoutRef)
55
116
  }
56
117
 
57
118
  const {
58
- // 存储layout布局信息
59
119
  layoutRef,
60
120
  layoutProps
61
- } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: scrollViewRef, onLayout: onScrollViewLayout })
121
+ } = useLayout({
122
+ props,
123
+ hasSelfPercent,
124
+ setWidth,
125
+ setHeight,
126
+ nodeRef: scrollViewRef,
127
+ onLayout: onScrollViewLayout
128
+ })
129
+
130
+ const onContentSizeChange = (w: number, h: number) => {
131
+ scrollViewRef.current?.scrollTo({
132
+ x: 0,
133
+ y: itemRawH * initialIndex,
134
+ animated: false
135
+ })
136
+ }
62
137
 
63
138
  const onItemLayout = (e: LayoutChangeEvent) => {
64
- const layout = e.nativeEvent.layout
65
- if (layout.height && itemH !== layout.height) {
66
- itemH = layout.height
67
- setItemH(layout.height)
68
- onColumnLayoutChange && onColumnLayoutChange({ height: layout.height * 5 })
139
+ const { height: rawH } = e.nativeEvent.layout
140
+ if (rawH && itemRawH !== rawH) {
141
+ setItemRawH(rawH)
142
+ onColumnItemRawHChange(rawH)
69
143
  }
70
144
  }
71
145
 
146
+ const onTouchStart = () => {
147
+ touching.current = true
148
+ }
149
+
150
+ const onTouchEnd = () => {
151
+ touching.current = false
152
+ }
153
+
154
+ const onTouchCancel = () => {
155
+ touching.current = false
156
+ }
157
+
158
+ const onMomentumScrollBegin = () => {
159
+ scrolling.current = true
160
+ }
161
+
72
162
  const onMomentumScrollEnd = (e: NativeSyntheticEvent<NativeScrollEvent>) => {
73
- if (scrollViewRef && itemH) {
74
- const { y: scrollY } = e.nativeEvent.contentOffset
75
- const selIndex = Math.floor(scrollY / itemH)
76
- onSelectChange(selIndex)
163
+ scrolling.current = false
164
+ if (!itemRawH) {
165
+ return
166
+ }
167
+ const { y: scrollY } = e.nativeEvent.contentOffset
168
+ let calcIndex = Math.round(scrollY / itemRawH)
169
+ activeIndex.current = calcIndex
170
+ if (calcIndex !== initialIndex) {
171
+ calcIndex = Math.max(0, Math.min(calcIndex, maxIndex)) || 0
172
+ onSelectChange(calcIndex)
77
173
  }
78
174
  }
79
175
 
80
- const renderInnerchild = () => {
81
- // Fragment 节点
82
- let realElement: Array<ReactNode> = []
83
- const getRealChilds = () => {
84
- if (Array.isArray(children)) {
85
- realElement = children
86
- } else {
87
- const tempChild = children as ReactElement
88
- if (tempChild.props.children && tempChild.props.children) {
89
- realElement = tempChild.props.children
90
- } else {
91
- realElement = [children]
92
- }
176
+ const offsetY = useRef(new Animated.Value(0)).current
177
+
178
+ const onScroll = useMemo(
179
+ () =>
180
+ Animated.event([{ nativeEvent: { contentOffset: { y: offsetY } } }], {
181
+ useNativeDriver: true
182
+ }),
183
+ [offsetY]
184
+ )
185
+
186
+ const faces = useMemo(() => createFaces(itemRawH, visibleCount), [itemRawH])
187
+
188
+ const getTransform = useCallback(
189
+ (index: number) => {
190
+ const inputRange = faces.map((f) => itemRawH * (index + f.index))
191
+ return {
192
+ opacity: offsetY.interpolate({
193
+ inputRange: inputRange,
194
+ outputRange: faces.map((x) => x.opacity),
195
+ extrapolate: 'clamp'
196
+ }),
197
+ rotateX: offsetY.interpolate({
198
+ inputRange: inputRange,
199
+ outputRange: faces.map((x) => `${x.deg}deg`),
200
+ extrapolate: 'extend'
201
+ }),
202
+ translateY: offsetY.interpolate({
203
+ inputRange: inputRange,
204
+ outputRange: faces.map((x) => x.offsetY),
205
+ extrapolate: 'extend'
206
+ })
93
207
  }
94
- return realElement
95
- }
208
+ },
209
+ [offsetY, faces, itemRawH]
210
+ )
96
211
 
97
- const realChilds = getRealChilds()
98
- const arrChild = realChilds.map((item: React.ReactNode, index: number) => {
212
+ const renderInnerchild = () =>
213
+ columnData.map((item: React.ReactNode, index: number) => {
99
214
  const InnerProps = index === 0 ? { onLayout: onItemLayout } : {}
100
- const strKey = 'picker' + props.prefix + '-column' + index
101
- const arrHeight = (wrapperStyle.itemHeight + '').match(/\d+/g) || []
102
- const iHeight = (arrHeight[0] || defaultItemHeight) as number
103
- return <View key={strKey} {...InnerProps} style={[{ height: iHeight, width: '100%' }]}>
104
- {wrapChildren(
105
- {
106
- children: item
107
- },
108
- {
109
- hasVarDec,
110
- varContext: varContextRef.current,
111
- textStyle,
112
- textProps
113
- }
114
- )}
115
- </View>
215
+ const strKey = `picker-column-${columnIndex}-${index}`
216
+ const { opacity, rotateX, translateY } = getTransform(index)
217
+ return (
218
+ <Animated.View
219
+ key={strKey}
220
+ {...InnerProps}
221
+ style={[
222
+ {
223
+ height: itemHeight || DefaultPickerItemH,
224
+ width: '100%',
225
+ opacity,
226
+ transform: [
227
+ { translateY },
228
+ { rotateX },
229
+ { perspective: 1000 } // 适配 Android
230
+ ]
231
+ }
232
+ ]}
233
+ >
234
+ {wrapChildren(
235
+ { children: item },
236
+ {
237
+ hasVarDec,
238
+ varContext: varContextRef.current,
239
+ textStyle,
240
+ textProps
241
+ }
242
+ )}
243
+ </Animated.View>
244
+ )
116
245
  })
117
- const totalHeight = itemH * 5
118
- if (wrapperStyle.height && totalHeight !== wrapperStyle.height) {
119
- const fix = Math.ceil((totalHeight - wrapperStyle.height) / 2)
120
- arrChild.unshift(<View key="picker-column-0" style={[{ height: itemH - fix }]}></View>)
121
- arrChild.unshift(<View key="picker-column-1" style={[{ height: itemH }]}></View>)
122
- arrChild.push(<View key="picker-column-2" style={[{ height: itemH }]}></View>)
123
- arrChild.push(<View key="picker-column-3" style={[{ height: itemH - fix }]}></View>)
124
- } else {
125
- arrChild.unshift(<View key="picker-column-0" style={[{ height: itemH }]}></View>)
126
- arrChild.unshift(<View key="picker-column-1" style={[{ height: itemH }]}></View>)
127
- arrChild.push(<View key="picker-column-2" style={[{ height: itemH }]}></View>)
128
- arrChild.push(<View key="picker-column-3" style={[{ height: itemH }]}></View>)
129
- }
130
- return arrChild
131
- }
132
246
 
133
247
  const renderScollView = () => {
134
- return (<Animated.ScrollView
135
- horizontal={false}
136
- ref={scrollViewRef}
137
- bounces={false}
138
- scrollsToTop={false}
139
- removeClippedSubviews={true}
140
- showsHorizontalScrollIndicator={false}
141
- showsVerticalScrollIndicator={false}
142
- pagingEnabled={false}
143
- snapToInterval={itemH}
144
- automaticallyAdjustContentInsets={false}
145
- {...layoutProps}
146
- onMomentumScrollEnd={onMomentumScrollEnd}>
248
+ return (
249
+ <Animated.ScrollView
250
+ ref={scrollViewRef}
251
+ bounces={true}
252
+ horizontal={false}
253
+ pagingEnabled={false}
254
+ nestedScrollEnabled={true}
255
+ removeClippedSubviews={true}
256
+ showsVerticalScrollIndicator={false}
257
+ showsHorizontalScrollIndicator={false}
258
+ {...layoutProps}
259
+ scrollEventThrottle={16}
260
+ contentContainerStyle={contentContainerStyle}
261
+ contentOffset={initialOffset}
262
+ snapToOffsets={snapToOffsets}
263
+ onContentSizeChange={onContentSizeChange}
264
+ onScroll={onScroll}
265
+ onTouchStart={onTouchStart}
266
+ onTouchEnd={onTouchEnd}
267
+ onTouchCancel={onTouchCancel}
268
+ onMomentumScrollBegin={onMomentumScrollBegin}
269
+ onMomentumScrollEnd={onMomentumScrollEnd}
270
+ >
147
271
  {renderInnerchild()}
148
- </Animated.ScrollView>)
272
+ </Animated.ScrollView>
273
+ )
149
274
  }
150
275
 
151
- return (<SafeAreaView style={[{ display: 'flex', flex: 1 }]}>
152
- { renderScollView() }
153
- </SafeAreaView>)
276
+ const renderOverlay = () => (
277
+ <PickerOverlay itemHeight={itemHeight} overlayItemStyle={pickerOverlayStyle} />
278
+ )
279
+
280
+ return (
281
+ <SafeAreaView style={[{ display: 'flex', flex: 1 }]}>
282
+ {renderScollView()}
283
+ {renderOverlay()}
284
+ </SafeAreaView>
285
+ )
154
286
  })
155
287
 
156
- _PickerViewColumn.displayName = 'mpx-picker-view-column'
288
+ _PickerViewColumn.displayName = 'MpxPickerViewColumn'
157
289
  export default _PickerViewColumn