@mpxjs/webpack-plugin 2.9.66 → 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.
- package/lib/dependencies/RecordGlobalComponentsDependency.js +11 -12
- package/lib/dependencies/RecordRuntimeInfoDependency.js +1 -1
- package/lib/index.js +29 -8
- package/lib/json-compiler/index.js +2 -11
- package/lib/loader.js +24 -45
- package/lib/native-loader.js +49 -64
- package/lib/platform/json/wx/index.js +24 -18
- package/lib/platform/style/wx/index.js +49 -47
- package/lib/platform/template/wx/component-config/canvas.js +8 -0
- package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
- package/lib/platform/template/wx/component-config/index.js +1 -1
- package/lib/platform/template/wx/component-config/input.js +1 -1
- package/lib/platform/template/wx/component-config/rich-text.js +8 -0
- package/lib/platform/template/wx/component-config/swiper.js +1 -1
- package/lib/platform/template/wx/component-config/textarea.js +1 -1
- package/lib/platform/template/wx/component-config/unsupported.js +1 -1
- package/lib/react/index.js +4 -3
- package/lib/react/processJSON.js +5 -13
- package/lib/react/processMainScript.js +7 -3
- package/lib/react/processScript.js +3 -4
- package/lib/react/processStyles.js +14 -4
- package/lib/react/processTemplate.js +5 -2
- package/lib/resolver/AddModePlugin.js +20 -7
- package/lib/runtime/components/react/context.ts +6 -0
- package/lib/runtime/components/react/dist/context.js +2 -0
- package/lib/runtime/components/react/dist/event.config.js +24 -24
- package/lib/runtime/components/react/dist/getInnerListeners.js +183 -174
- package/lib/runtime/components/react/dist/mpx-button.jsx +78 -50
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.js +60 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.js +15 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.js +84 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.js +87 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.js +15 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.js +28 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.js +343 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +232 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.jsx +89 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +41 -34
- package/lib/runtime/components/react/dist/mpx-checkbox.jsx +30 -39
- package/lib/runtime/components/react/dist/mpx-form.jsx +47 -41
- package/lib/runtime/components/react/dist/mpx-icon.jsx +9 -17
- package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +95 -62
- package/lib/runtime/components/react/dist/mpx-label.jsx +24 -28
- package/lib/runtime/components/react/dist/mpx-movable-area.jsx +20 -30
- package/lib/runtime/components/react/dist/mpx-movable-view.jsx +377 -293
- package/lib/runtime/components/react/dist/mpx-navigator.jsx +3 -5
- package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
- package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +39 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +160 -88
- package/lib/runtime/components/react/dist/mpx-picker-view.jsx +80 -121
- package/lib/runtime/components/react/dist/mpx-radio-group.jsx +39 -34
- package/lib/runtime/components/react/dist/mpx-radio.jsx +28 -43
- package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.jsx +7 -5
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +77 -51
- package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +606 -0
- package/lib/runtime/components/react/dist/mpx-switch.jsx +28 -11
- package/lib/runtime/components/react/dist/mpx-text.jsx +12 -11
- package/lib/runtime/components/react/dist/mpx-textarea.jsx +9 -4
- package/lib/runtime/components/react/dist/mpx-view.jsx +66 -62
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +113 -36
- package/lib/runtime/components/react/dist/pickerFaces.js +81 -0
- package/lib/runtime/components/react/dist/pickerVIewContext.js +9 -0
- package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
- package/lib/runtime/components/react/dist/pickerViewOverlay.jsx +23 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.js +126 -12
- package/lib/runtime/components/react/dist/utils.jsx +80 -24
- package/lib/runtime/components/react/event.config.ts +25 -26
- package/lib/runtime/components/react/getInnerListeners.ts +237 -198
- package/lib/runtime/components/react/mpx-button.tsx +105 -58
- package/lib/runtime/components/react/mpx-canvas/Bus.ts +70 -0
- package/lib/runtime/components/react/mpx-canvas/CanvasGradient.ts +18 -0
- package/lib/runtime/components/react/mpx-canvas/CanvasRenderingContext2D.ts +87 -0
- package/lib/runtime/components/react/mpx-canvas/Image.ts +102 -0
- package/lib/runtime/components/react/mpx-canvas/ImageData.ts +23 -0
- package/lib/runtime/components/react/mpx-canvas/constructorsRegistry.ts +38 -0
- package/lib/runtime/components/react/mpx-canvas/html.ts +343 -0
- package/lib/runtime/components/react/mpx-canvas/index.tsx +296 -0
- package/lib/runtime/components/react/mpx-canvas/utils.tsx +150 -0
- package/lib/runtime/components/react/mpx-checkbox-group.tsx +77 -51
- package/lib/runtime/components/react/mpx-checkbox.tsx +49 -50
- package/lib/runtime/components/react/mpx-form.tsx +62 -57
- package/lib/runtime/components/react/mpx-icon.tsx +13 -18
- package/lib/runtime/components/react/mpx-image.tsx +436 -0
- package/lib/runtime/components/react/mpx-input.tsx +139 -117
- package/lib/runtime/components/react/mpx-label.tsx +36 -34
- package/lib/runtime/components/react/mpx-movable-area.tsx +26 -39
- package/lib/runtime/components/react/mpx-movable-view.tsx +455 -337
- package/lib/runtime/components/react/mpx-navigator.tsx +3 -9
- package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
- package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
- package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
- package/lib/runtime/components/react/mpx-picker-view-column.tsx +236 -104
- package/lib/runtime/components/react/mpx-picker-view.tsx +132 -122
- package/lib/runtime/components/react/mpx-radio-group.tsx +77 -54
- package/lib/runtime/components/react/mpx-radio.tsx +46 -55
- package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +121 -0
- package/lib/runtime/components/react/mpx-root-portal.tsx +4 -6
- package/lib/runtime/components/react/mpx-scroll-view.tsx +122 -76
- package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
- package/lib/runtime/components/react/mpx-swiper/carouse.tsx +6 -4
- package/lib/runtime/components/react/mpx-swiper/index.tsx +2 -1
- package/lib/runtime/components/react/mpx-swiper-item.tsx +4 -3
- package/lib/runtime/components/react/mpx-switch.tsx +39 -25
- package/lib/runtime/components/react/mpx-text.tsx +15 -19
- package/lib/runtime/components/react/mpx-textarea.tsx +12 -11
- package/lib/runtime/components/react/mpx-view.tsx +93 -77
- package/lib/runtime/components/react/mpx-web-view.tsx +117 -55
- package/lib/runtime/components/react/pickerFaces.ts +104 -0
- package/lib/runtime/components/react/pickerOverlay.tsx +32 -0
- package/lib/runtime/components/react/types/common.ts +2 -0
- package/lib/runtime/components/react/types/global.d.ts +5 -17
- package/lib/runtime/components/react/useAnimationHooks.ts +127 -18
- package/lib/runtime/components/react/useNodesRef.ts +1 -0
- package/lib/runtime/components/react/utils.tsx +113 -27
- package/lib/runtime/components/web/getInnerListeners.js +6 -6
- package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
- package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
- package/lib/runtime/components/web/mpx-picker.vue +382 -385
- package/lib/runtime/components/web/mpx-web-view.vue +175 -161
- package/lib/runtime/optionProcessor.js +7 -38
- package/lib/runtime/optionProcessorReact.js +0 -15
- package/lib/runtime/swanHelper.wxs +1 -1
- package/lib/runtime/utils.js +2 -0
- package/lib/style-compiler/index.js +1 -1
- package/lib/style-compiler/plugins/scope-id.js +31 -2
- package/lib/template-compiler/bind-this.js +7 -2
- package/lib/template-compiler/compiler.js +118 -56
- package/lib/template-compiler/gen-node-react.js +3 -3
- package/lib/template-compiler/index.js +4 -4
- package/lib/utils/pre-process-json.js +117 -0
- package/lib/web/index.js +5 -4
- package/lib/web/processJSON.js +5 -13
- package/lib/web/processTemplate.js +2 -2
- package/package.json +6 -4
- package/LICENSE +0 -433
- package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
- package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
- package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -478
- package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
- package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
- package/lib/runtime/components/react/mpx-image/index.tsx +0 -346
- package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
- package/lib/runtime/components/web/event.js +0 -105
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* ✔ delta
|
|
9
9
|
*/
|
|
10
10
|
import { View } from 'react-native'
|
|
11
|
-
import { useCallback, forwardRef, JSX } from 'react'
|
|
11
|
+
import { useCallback, forwardRef, JSX, createElement } from 'react'
|
|
12
12
|
import useInnerProps from './getInnerListeners'
|
|
13
13
|
import { redirectTo, navigateTo, navigateBack, reLaunch, switchTab } from '@mpxjs/api-proxy'
|
|
14
14
|
|
|
@@ -53,15 +53,9 @@ const _Navigator = forwardRef<View, _NavigatorProps>((props, ref): JSX.Element =
|
|
|
53
53
|
bindtap: handleClick
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
return (
|
|
57
|
-
<MpxView
|
|
58
|
-
{...innerProps}
|
|
59
|
-
>
|
|
60
|
-
{children}
|
|
61
|
-
</MpxView>
|
|
62
|
-
)
|
|
56
|
+
return createElement(MpxView, innerProps, children)
|
|
63
57
|
})
|
|
64
58
|
|
|
65
|
-
_Navigator.displayName = '
|
|
59
|
+
_Navigator.displayName = 'MpxNavigator'
|
|
66
60
|
|
|
67
61
|
export default _Navigator
|
|
@@ -27,12 +27,14 @@ function dateToString (date: Date, fields: 'day' | 'month' | 'year' = 'day'): st
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const _DatePicker = forwardRef<HandlerRef<View, DateProps>, DateProps>((props: DateProps, ref): React.JSX.Element => {
|
|
30
|
-
const { children, start = '1970-01-01', end = '2999-01-01', value, bindchange, bindcancel, disabled, fields } = props
|
|
30
|
+
const { children, start = '1970-01-01', end = '2999-01-01', value, bindchange, bindcancel, disabled, fields, style } = props
|
|
31
31
|
const [datevalue, setDateValue] = useState(value)
|
|
32
32
|
// 存储layout布局信息
|
|
33
33
|
const layoutRef = useRef({})
|
|
34
34
|
const viewRef = useRef<View>(null)
|
|
35
|
-
|
|
35
|
+
const nodeRef = useRef<View>(null)
|
|
36
|
+
useNodesRef<View, DateProps>(props, ref, nodeRef, {
|
|
37
|
+
style
|
|
36
38
|
})
|
|
37
39
|
|
|
38
40
|
useEffect(() => {
|
|
@@ -58,6 +60,7 @@ const _DatePicker = forwardRef<HandlerRef<View, DateProps>, DateProps>((props: D
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
const dateProps = {
|
|
63
|
+
ref: nodeRef,
|
|
61
64
|
precision: fields,
|
|
62
65
|
value: formatTimeStr(datevalue),
|
|
63
66
|
minDate: formatTimeStr(start),
|
|
@@ -32,10 +32,11 @@ import { FormContext, FormFieldValue } from '../context'
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
const _Picker = forwardRef<HandlerRef<View, PickerProps>, PickerProps>((props: PickerProps, ref): React.JSX.Element => {
|
|
35
|
-
const { mode = 'selector', value, bindcancel, bindchange, children, bindcolumnchange } = props
|
|
35
|
+
const { mode = 'selector', value, bindcancel, bindchange, children, bindcolumnchange, style } = props
|
|
36
36
|
const innerLayout = useRef({})
|
|
37
37
|
const nodeRef = useRef(null)
|
|
38
38
|
useNodesRef<View, PickerProps>(props, ref, nodeRef, {
|
|
39
|
+
style
|
|
39
40
|
})
|
|
40
41
|
const innerProps = useInnerProps(props, {
|
|
41
42
|
ref: nodeRef
|
|
@@ -92,7 +93,7 @@ const _Picker = forwardRef<HandlerRef<View, PickerProps>, PickerProps>((props: P
|
|
|
92
93
|
bindcolumnchange && bindcolumnchange(eventData)
|
|
93
94
|
}
|
|
94
95
|
const commonProps = {
|
|
95
|
-
...
|
|
96
|
+
...innerProps,
|
|
96
97
|
mode,
|
|
97
98
|
children,
|
|
98
99
|
bindchange: onChange,
|
|
@@ -80,7 +80,7 @@ function getColumnIndexByValue (range: any[] = [], column: number, value: any[]
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const _MultiSelectorPicker = forwardRef<HandlerRef<View, MultiSelectorProps>, MultiSelectorProps>((props: MultiSelectorProps, ref): React.JSX.Element => {
|
|
83
|
-
const { range, value, disabled, bindchange, bindcancel, children, bindcolumnchange } = props
|
|
83
|
+
const { range, value, disabled, bindchange, bindcancel, children, bindcolumnchange, style } = props
|
|
84
84
|
const formatRange = formatRangeFun(range, props['range-key'])
|
|
85
85
|
const initValue = getInnerValueByIndex(formatRange, value)
|
|
86
86
|
// 选中的索引值
|
|
@@ -90,7 +90,9 @@ const _MultiSelectorPicker = forwardRef<HandlerRef<View, MultiSelectorProps>, Mu
|
|
|
90
90
|
// 存储layout布局信息
|
|
91
91
|
const layoutRef = useRef({})
|
|
92
92
|
const viewRef = useRef<View>(null)
|
|
93
|
-
|
|
93
|
+
const nodeRef = useRef<View>(null)
|
|
94
|
+
useNodesRef<View, MultiSelectorProps>(props, ref, nodeRef, {
|
|
95
|
+
style
|
|
94
96
|
})
|
|
95
97
|
|
|
96
98
|
useEffect(() => {
|
|
@@ -126,6 +128,7 @@ const _MultiSelectorPicker = forwardRef<HandlerRef<View, MultiSelectorProps>, Mu
|
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
const antPickerProps = {
|
|
131
|
+
ref: nodeRef,
|
|
129
132
|
data,
|
|
130
133
|
value: selected,
|
|
131
134
|
cols: range.length,
|
|
@@ -38,14 +38,16 @@ function formateRegionData (clObj: RegionObj[] = [], customItem?: string, depth
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const _RegionPicker = forwardRef<HandlerRef<View, RegionProps>, RegionProps>((props: RegionProps, ref): React.JSX.Element => {
|
|
41
|
-
const { children, value, bindchange, bindcancel, disabled } = props
|
|
41
|
+
const { children, value, bindchange, bindcancel, disabled, style } = props
|
|
42
42
|
const formatRegionData = formateRegionData(regionData, props['custom-item'])
|
|
43
43
|
|
|
44
44
|
const [regionvalue, setRegionValue] = useState(value)
|
|
45
45
|
// 存储layout布局信息
|
|
46
46
|
const layoutRef = useRef({})
|
|
47
47
|
const viewRef = useRef<View>(null)
|
|
48
|
-
|
|
48
|
+
const nodeRef = useRef(null)
|
|
49
|
+
useNodesRef<View, RegionProps>(props, ref, nodeRef, {
|
|
50
|
+
style
|
|
49
51
|
})
|
|
50
52
|
|
|
51
53
|
const onChange = (value: string[]): void => {
|
|
@@ -83,6 +85,7 @@ const _RegionPicker = forwardRef<HandlerRef<View, RegionProps>, RegionProps>((pr
|
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
const regionProps = {
|
|
88
|
+
ref: nodeRef,
|
|
86
89
|
data: formatRegionData,
|
|
87
90
|
value: regionvalue,
|
|
88
91
|
onChange,
|
|
@@ -22,7 +22,7 @@ const formatRangeFun = (range: Array<RangeItemType>, rangeKey = ''): any => {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const _SelectorPicker = forwardRef<HandlerRef<View, SelectorProps>, SelectorProps>((props: SelectorProps, ref): React.JSX.Element => {
|
|
25
|
-
const { range, children, value, disabled, bindchange, bindcancel } = props
|
|
25
|
+
const { range, children, value, disabled, bindchange, bindcancel, style } = props
|
|
26
26
|
// 格式化数据为Array<*>
|
|
27
27
|
const formatRange: PickerColumn = formatRangeFun(range, props['range-key'])
|
|
28
28
|
// 选中的索引值
|
|
@@ -32,7 +32,9 @@ const _SelectorPicker = forwardRef<HandlerRef<View, SelectorProps>, SelectorProp
|
|
|
32
32
|
// 存储layout布局信息
|
|
33
33
|
const layoutRef = useRef({})
|
|
34
34
|
const viewRef = useRef<View>(null)
|
|
35
|
-
|
|
35
|
+
const nodeRef = useRef(null)
|
|
36
|
+
useNodesRef<View, SelectorProps>(props, ref, nodeRef, {
|
|
37
|
+
style
|
|
36
38
|
})
|
|
37
39
|
|
|
38
40
|
useEffect(() => {
|
|
@@ -62,6 +64,7 @@ const _SelectorPicker = forwardRef<HandlerRef<View, SelectorProps>, SelectorProp
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
const antPickerProps = {
|
|
67
|
+
ref: nodeRef,
|
|
65
68
|
data,
|
|
66
69
|
value: [selected],
|
|
67
70
|
cols: 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { View, Text, Modal, TouchableWithoutFeedback } from 'react-native'
|
|
2
|
-
import { PickerView } from '@ant-design/react-native'
|
|
2
|
+
import { PickerView, Portal } from '@ant-design/react-native'
|
|
3
3
|
import React, { forwardRef, useState, useRef, useEffect } from 'react'
|
|
4
4
|
import useNodesRef, { HandlerRef } from '../useNodesRef' // 引入辅助函数
|
|
5
5
|
import { TimeProps } from './type'
|
|
@@ -13,8 +13,8 @@ const styles: { [key: string]: Object } = {
|
|
|
13
13
|
showModal: {
|
|
14
14
|
backgroundColor: 'black',
|
|
15
15
|
opacity: 0.5,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%'
|
|
18
18
|
},
|
|
19
19
|
hideModal: {
|
|
20
20
|
opacity: 1,
|
|
@@ -125,7 +125,7 @@ function checkSelectedIsValid (strStart: string, strEnd: string, selected: numbe
|
|
|
125
125
|
// start="02:10" end = 23:01
|
|
126
126
|
|
|
127
127
|
const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: TimeProps, ref): React.JSX.Element => {
|
|
128
|
-
const { children, start, end, value, bindchange, bindcancel,
|
|
128
|
+
const { children, start, end, value, bindchange, bindcancel, style } = props
|
|
129
129
|
const defaultProps = {
|
|
130
130
|
start: '00:10',
|
|
131
131
|
end: '23:59'
|
|
@@ -135,11 +135,11 @@ const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: T
|
|
|
135
135
|
// 存储layout布局信息
|
|
136
136
|
const layoutRef = useRef({})
|
|
137
137
|
const viewRef = useRef<View>(null)
|
|
138
|
-
|
|
138
|
+
const nodeRef = useRef<View>(null)
|
|
139
|
+
useNodesRef<View, TimeProps>(props, ref, nodeRef, { style })
|
|
139
140
|
// 存储modal的布局信息
|
|
140
141
|
const modalLayoutRef = useRef({})
|
|
141
142
|
const modalRef = useRef<View>(null)
|
|
142
|
-
useNodesRef<View, TimeProps>(props, ref, modalRef, {})
|
|
143
143
|
const [visible, setVisible] = useState(false)
|
|
144
144
|
const columnData = generateColumns()
|
|
145
145
|
const [data, setData] = useState(columnData)
|
|
@@ -188,12 +188,6 @@ const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: T
|
|
|
188
188
|
} else {
|
|
189
189
|
// [9, 13]
|
|
190
190
|
setTimeValue(date)
|
|
191
|
-
const strDate = formatStr(date)
|
|
192
|
-
bindchange && bindchange({
|
|
193
|
-
detail: {
|
|
194
|
-
value: strDate
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
191
|
}
|
|
198
192
|
}
|
|
199
193
|
|
|
@@ -213,6 +207,7 @@ const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: T
|
|
|
213
207
|
|
|
214
208
|
const renderModalChildren = () => {
|
|
215
209
|
const pickerProps = {
|
|
210
|
+
ref: nodeRef,
|
|
216
211
|
data,
|
|
217
212
|
value: timevalue,
|
|
218
213
|
defaultValue: timevalue,
|
|
@@ -249,12 +244,11 @@ const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: T
|
|
|
249
244
|
</TouchableWithoutFeedback>
|
|
250
245
|
</View>
|
|
251
246
|
}
|
|
252
|
-
const strStyle = visible ? styles.showModal : styles.hideModal
|
|
253
|
-
const mheight = Math.floor(offsetTop)
|
|
254
247
|
|
|
255
248
|
// Animated.View
|
|
256
249
|
return (<>
|
|
257
|
-
<
|
|
250
|
+
<Portal>
|
|
251
|
+
<View style={visible ? styles.showModal : styles.hideModal}>
|
|
258
252
|
<Modal
|
|
259
253
|
animationType="slide"
|
|
260
254
|
transparent={true}
|
|
@@ -263,6 +257,7 @@ const _TimePicker = forwardRef<HandlerRef<View, TimeProps>, TimeProps>((props: T
|
|
|
263
257
|
{renderModalChildren()}
|
|
264
258
|
</Modal>
|
|
265
259
|
</View>
|
|
260
|
+
</Portal>
|
|
266
261
|
{renderChildren()}
|
|
267
262
|
</>)
|
|
268
263
|
})
|
|
@@ -3,87 +3,92 @@ import { PickerValue } from '@ant-design/react-native'
|
|
|
3
3
|
|
|
4
4
|
export type Obj = Record<string, any>
|
|
5
5
|
export type SelectorProps = {
|
|
6
|
-
mode: string
|
|
6
|
+
mode: string
|
|
7
7
|
// 表示选择了 range 中的第几个(下标从 0 开始)
|
|
8
8
|
value: PickerValue
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
children: ReactNode
|
|
11
|
-
bindcancel?: Function
|
|
12
|
-
bindchange: Function
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
children: ReactNode
|
|
11
|
+
bindcancel?: Function
|
|
12
|
+
bindchange: Function
|
|
13
13
|
// mode 为 selector 或 multiSelector 时,range 有效
|
|
14
|
-
range: Array<number|string|Obj
|
|
14
|
+
range: Array<number|string|Obj>
|
|
15
15
|
// 当 range 是一个 Object Array 时,通过 range-key 来指定 Object 中 key 的值作为选择器《显示内容》 对象中的属性
|
|
16
|
-
'range-key': string
|
|
16
|
+
'range-key': string
|
|
17
17
|
getInnerLayout: Function
|
|
18
|
+
style?: Record<string, any>
|
|
18
19
|
// bindcolumnchange?: Function
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export type MultiSelectorProps = {
|
|
22
|
-
mode: string
|
|
23
|
+
mode: string
|
|
23
24
|
// 表示选择了 range 中的第几个(下标从 0 开始)
|
|
24
|
-
value: Array<number
|
|
25
|
-
disabled?: boolean
|
|
26
|
-
children: ReactNode
|
|
27
|
-
bindcancel?: Function
|
|
28
|
-
bindchange: Function
|
|
29
|
-
bindcolumnchange?: Function
|
|
25
|
+
value: Array<number>
|
|
26
|
+
disabled?: boolean
|
|
27
|
+
children: ReactNode
|
|
28
|
+
bindcancel?: Function
|
|
29
|
+
bindchange: Function
|
|
30
|
+
bindcolumnchange?: Function
|
|
30
31
|
// mode 为 selector 或 multiSelector 时,range 有效
|
|
31
|
-
range: Array<Array<any
|
|
32
|
+
range: Array<Array<any>>
|
|
32
33
|
// 当 range 是一个 Object Array 时,通过 range-key 来指定 Object 中 key 的值作为选择器《显示内容》 对象中的属性
|
|
33
|
-
'range-key': string
|
|
34
|
+
'range-key': string
|
|
34
35
|
getInnerLayout: Function
|
|
36
|
+
style?: Record<string, any>
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export type TimeProps = {
|
|
38
|
-
mode: string
|
|
40
|
+
mode: string
|
|
39
41
|
// 表示选择了 range 中的第几个(下标从 0 开始)
|
|
40
|
-
value: string
|
|
41
|
-
disabled?: boolean
|
|
42
|
-
children: ReactNode
|
|
43
|
-
bindcancel?: Function
|
|
44
|
-
bindchange: Function
|
|
45
|
-
start: string
|
|
46
|
-
end: string
|
|
42
|
+
value: string
|
|
43
|
+
disabled?: boolean
|
|
44
|
+
children: ReactNode
|
|
45
|
+
bindcancel?: Function
|
|
46
|
+
bindchange: Function
|
|
47
|
+
start: string
|
|
48
|
+
end: string
|
|
47
49
|
getInnerLayout: Function
|
|
50
|
+
style?: Record<string, any>
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export type DateProps = {
|
|
51
|
-
mode: string
|
|
54
|
+
mode: string
|
|
52
55
|
// 表示选择了 range 中的第几个(下标从 0 开始)
|
|
53
|
-
value: string
|
|
54
|
-
fields?: 'day' | 'month' | 'year'
|
|
55
|
-
disabled?: boolean
|
|
56
|
-
children: ReactNode
|
|
57
|
-
bindcancel?: Function
|
|
58
|
-
bindchange: Function
|
|
59
|
-
start: string
|
|
60
|
-
end: string
|
|
56
|
+
value: string
|
|
57
|
+
fields?: 'day' | 'month' | 'year'
|
|
58
|
+
disabled?: boolean
|
|
59
|
+
children: ReactNode
|
|
60
|
+
bindcancel?: Function
|
|
61
|
+
bindchange: Function
|
|
62
|
+
start: string
|
|
63
|
+
end: string
|
|
61
64
|
getInnerLayout: Function
|
|
65
|
+
style?: Record<string, any>
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
export type RegionProps = {
|
|
65
|
-
mode: string
|
|
69
|
+
mode: string
|
|
66
70
|
// 表示选择了 range 中的第几个(下标从 0 开始)
|
|
67
|
-
value: Array<string
|
|
71
|
+
value: Array<string>
|
|
68
72
|
level: 'province' | 'city' | 'region' | 'sub-district'
|
|
69
|
-
'custom-item'?: string
|
|
70
|
-
disabled?: boolean
|
|
71
|
-
children: ReactNode
|
|
72
|
-
bindcancel?: Function
|
|
73
|
-
bindchange: Function
|
|
73
|
+
'custom-item'?: string
|
|
74
|
+
disabled?: boolean
|
|
75
|
+
children: ReactNode
|
|
76
|
+
bindcancel?: Function
|
|
77
|
+
bindchange: Function
|
|
74
78
|
getInnerLayout: Function
|
|
79
|
+
style?: Record<string, any>
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
export type RegionObj = {
|
|
78
|
-
value: string
|
|
83
|
+
value: string
|
|
79
84
|
code: string
|
|
80
85
|
postcode?: string
|
|
81
86
|
children?: RegionObj[]
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
export type PickerData = {
|
|
85
|
-
value: string
|
|
86
|
-
label: string
|
|
90
|
+
value: string
|
|
91
|
+
label: string
|
|
87
92
|
children?: Array<Object>
|
|
88
93
|
}
|
|
89
94
|
|