@mpxjs/webpack-plugin 2.10.16-beta.5 → 2.10.16-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/lib/loader.js +2 -2
- package/lib/runtime/components/react/context.ts +10 -6
- package/lib/runtime/components/react/dist/context.d.ts +75 -0
- package/lib/runtime/components/react/dist/context.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/event.config.d.ts +8 -0
- package/lib/runtime/components/react/dist/event.config.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +8 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts +69 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-camera.d.ts +28 -0
- package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +11 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts +28 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts +22 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts +50 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +35 -9
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +46 -53
- package/lib/runtime/components/react/dist/mpx-label.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-label.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +66 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.jsx +132 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +107 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +14 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +30 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +2 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +25 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +55 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts +31 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +18 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts +102 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts +35 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/parser.d.ts +40 -0
- package/lib/runtime/components/react/dist/parser.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +33 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts +12 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/utils.d.ts +123 -0
- package/lib/runtime/components/react/dist/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/mpx-camera.tsx +1 -1
- package/lib/runtime/components/react/mpx-input.tsx +41 -16
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +48 -58
- package/lib/runtime/components/react/mpx-nav.tsx +155 -0
- package/lib/runtime/components/react/types/common.d.ts +19 -0
- package/lib/style-compiler/strip-conditional-loader.js +27 -4
- package/package.json +4 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* eslint-disable space-before-function-paren */
|
|
2
|
+
import { useState, useMemo, memo } from 'react';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { StatusBar, processColor, TouchableWithoutFeedback, Image, View, StyleSheet, Text } from 'react-native';
|
|
5
|
+
function convertToHex(color) {
|
|
6
|
+
try {
|
|
7
|
+
const intColor = processColor(color);
|
|
8
|
+
if (intColor === null || intColor === undefined) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
// 将32位整数颜色值转换为RGBA
|
|
12
|
+
const r = (intColor >> 16) & 255;
|
|
13
|
+
const g = (intColor >> 8) & 255;
|
|
14
|
+
const b = intColor & 255;
|
|
15
|
+
// 转换为十六进制
|
|
16
|
+
const hexR = r.toString(16).padStart(2, '0');
|
|
17
|
+
const hexG = g.toString(16).padStart(2, '0');
|
|
18
|
+
const hexB = b.toString(16).padStart(2, '0');
|
|
19
|
+
return `#${hexR}${hexG}${hexB}`;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const titleHeight = 44;
|
|
26
|
+
export function useInnerHeaderHeight(pageConfig) {
|
|
27
|
+
const safeArea = useSafeAreaInsets();
|
|
28
|
+
if (pageConfig.navigationStyle === 'custom') {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const safeAreaTop = safeArea?.top || 0;
|
|
33
|
+
const headerHeight = safeAreaTop + titleHeight;
|
|
34
|
+
return headerHeight;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
header: {
|
|
39
|
+
elevation: 3
|
|
40
|
+
},
|
|
41
|
+
headerContent: {
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center'
|
|
45
|
+
},
|
|
46
|
+
backButton: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
height: '100%',
|
|
49
|
+
width: 40,
|
|
50
|
+
left: 0,
|
|
51
|
+
top: 0,
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center'
|
|
54
|
+
},
|
|
55
|
+
backButtonImage: {
|
|
56
|
+
width: 22,
|
|
57
|
+
height: 22
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
fontSize: 17,
|
|
61
|
+
fontWeight: 600,
|
|
62
|
+
width: '60%',
|
|
63
|
+
textAlign: 'center'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const NavColor = {
|
|
67
|
+
White: '#ffffff',
|
|
68
|
+
Black: '#000000'
|
|
69
|
+
};
|
|
70
|
+
// navigationBarTextStyle 只支持黑白 'white'/'black
|
|
71
|
+
const validBarTextStyle = (textStyle) => {
|
|
72
|
+
const textStyleColor = convertToHex(textStyle);
|
|
73
|
+
if (textStyle && textStyleColor && [NavColor.White, NavColor.Black].includes(textStyleColor)) {
|
|
74
|
+
return textStyleColor;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return NavColor.White;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const BACK_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAABICAYAAACqT5alAAAA2UlEQVR4nO3bMQrCUBRE0Yla6AYEN2nnBrTL+izcitW3MRDkEUWSvPzJvfCqgMwhZbAppWhNbbIHzB1g9wATERFRVyvpkj1irlpJ5X326D7WHh1hbdFD2CLpLmmftm7kfsEe09aNHFiBrT+wAlt/YAW2/sAKbP2BFdj6Ayuwy+ufz6XPL893krZ//O6iu2n4LT8kndLWTRTo4EC7BDo40C6BDg60S6CDA+0S6OBAuwQ6uNWiD2nrJmoIfU7cNWkR2hbb1UfbY7uuWhGWiIg+a/iHuHmA3QPs3gu4JW9Gan+OJAAAAABJRU5ErkJggg==';
|
|
81
|
+
const MpxNav = memo(({ pageConfig, navigation }) => {
|
|
82
|
+
const [innerPageConfig, setPageConfig] = useState(pageConfig || {});
|
|
83
|
+
const safeAreaTop = useSafeAreaInsets()?.top || 0;
|
|
84
|
+
navigation.setPageConfig = (config) => {
|
|
85
|
+
setPageConfig(Object.assign({}, innerPageConfig, config));
|
|
86
|
+
};
|
|
87
|
+
const isCustom = innerPageConfig.navigationStyle === 'custom';
|
|
88
|
+
const navigationBarTextStyle = useMemo(() => validBarTextStyle(innerPageConfig.navigationBarTextStyle), [innerPageConfig.navigationBarTextStyle]);
|
|
89
|
+
// 状态栏的颜色
|
|
90
|
+
const statusBarElement = (<StatusBar translucent backgroundColor='transparent' barStyle={navigationBarTextStyle === NavColor.White ? 'light-content' : 'dark-content'}></StatusBar>);
|
|
91
|
+
if (isCustom)
|
|
92
|
+
return statusBarElement;
|
|
93
|
+
// 假设是栈导航,获取栈的长度
|
|
94
|
+
const stackLength = navigation.getState()?.routes?.length;
|
|
95
|
+
const onStackTopBack = mpxGlobal?.__mpx?.config?.rnConfig?.onStackTopBack;
|
|
96
|
+
const isHandleStackTopBack = typeof onStackTopBack === 'function';
|
|
97
|
+
// 回退按钮与图标
|
|
98
|
+
// prettier-ignore
|
|
99
|
+
const backElement = stackLength > 1 || isHandleStackTopBack
|
|
100
|
+
? (<TouchableWithoutFeedback onPress={() => {
|
|
101
|
+
if (stackLength <= 1 && isHandleStackTopBack) {
|
|
102
|
+
onStackTopBack();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
navigation.goBack();
|
|
106
|
+
}}>
|
|
107
|
+
<View style={[styles.backButton]}>
|
|
108
|
+
<Image style={[styles.backButtonImage, { tintColor: navigationBarTextStyle }]} source={{ uri: BACK_ICON }}></Image>
|
|
109
|
+
</View>
|
|
110
|
+
</TouchableWithoutFeedback>)
|
|
111
|
+
: null;
|
|
112
|
+
return (<View style={[
|
|
113
|
+
styles.header,
|
|
114
|
+
{
|
|
115
|
+
paddingTop: safeAreaTop,
|
|
116
|
+
backgroundColor: innerPageConfig.navigationBarBackgroundColor || '#000000'
|
|
117
|
+
}
|
|
118
|
+
]}>
|
|
119
|
+
{statusBarElement}
|
|
120
|
+
{/* TODO: 确定 height 的有效性 */}
|
|
121
|
+
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
|
|
122
|
+
{/* @ts-expect-error */}
|
|
123
|
+
<View style={styles.headerContent} height={titleHeight}>
|
|
124
|
+
{backElement}
|
|
125
|
+
<Text style={[styles.title, { color: navigationBarTextStyle }]} numberOfLines={1}>
|
|
126
|
+
{innerPageConfig.navigationBarTitleText?.trim() || ''}
|
|
127
|
+
</Text>
|
|
128
|
+
</View>
|
|
129
|
+
</View>);
|
|
130
|
+
});
|
|
131
|
+
MpxNav.displayName = 'MpxNav';
|
|
132
|
+
export default MpxNav;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { _ViewProps } from './mpx-view';
|
|
3
|
+
interface _NavigatorProps extends _ViewProps {
|
|
4
|
+
['open-type']: 'navigate' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack';
|
|
5
|
+
url: string;
|
|
6
|
+
delta: number;
|
|
7
|
+
}
|
|
8
|
+
declare const _Navigator: import("react").ForwardRefExoticComponent<_NavigatorProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export default _Navigator;
|
|
10
|
+
//# sourceMappingURL=mpx-navigator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpx-navigator.d.ts","sourceRoot":"","sources":["../mpx-navigator.tsx"],"names":[],"mappings":";AAYA,OAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhD,UAAU,eAAgB,SAAQ,UAAU;IAC1C,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,cAAc,CAAA;IAClF,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,UAAU,iGAkCd,CAAA;AAIF,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { DateProps } from './type';
|
|
4
|
+
import { HandlerRef } from '../useNodesRef';
|
|
5
|
+
declare const PickerDate: React.ForwardRefExoticComponent<Omit<DateProps, "ref"> & React.RefAttributes<HandlerRef<View, DateProps>>>;
|
|
6
|
+
export default PickerDate;
|
|
7
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../mpx-picker/date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6F,MAAM,OAAO,CAAA;AACjH,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AA8J3C,QAAA,MAAM,UAAU,4GA4Ed,CAAA;AAGF,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const wrapDate: (union?: string) => (num: number) => string;
|
|
2
|
+
export declare const START_YEAR = 1900;
|
|
3
|
+
export declare const END_YEAR = 2099;
|
|
4
|
+
export declare const years: string[];
|
|
5
|
+
export declare const months: string[];
|
|
6
|
+
export declare const daysInMonthLength: (year: number, month: number) => 30 | 28 | 29 | 31;
|
|
7
|
+
export declare const daysInMonth: (year: number, month: number) => string[];
|
|
8
|
+
//# sourceMappingURL=dateData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateData.d.ts","sourceRoot":"","sources":["../../mpx-picker/dateData.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,4BAAyB,MAAM,WAAyC,CAAA;AAE7F,eAAO,MAAM,UAAU,OAAO,CAAA;AAC9B,eAAO,MAAM,QAAQ,OAAO,CAAA;AAE5B,eAAO,MAAM,KAAK,UAAsE,CAAA;AAExF,eAAO,MAAM,MAAM,UAAyE,CAAA;AAE5F,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAAS,MAAM,sBAQ5D,CAAA;AAED,eAAO,MAAM,WAAW,SAAU,MAAM,SAAS,MAAM,aAEtD,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { HandlerRef } from '../useNodesRef';
|
|
4
|
+
import { PickerProps } from './type';
|
|
5
|
+
declare const Picker: React.ForwardRefExoticComponent<(Omit<import("./type").DateProps, "ref"> | Omit<import("./type").SelectorProps, "ref"> | Omit<import("./type").MultiSelectorProps, "ref"> | Omit<import("./type").TimeProps, "ref"> | Omit<import("./type").RegionProps, "ref">) & React.RefAttributes<HandlerRef<View, PickerProps>>>;
|
|
6
|
+
export default Picker;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-picker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAA;AACvF,OAAO,EAA8C,IAAI,EAAE,MAAM,cAAc,CAAA;AAQ/E,OAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIxD,OAAO,EAAuC,WAAW,EAAE,MAAM,QAAQ,CAAA;AAmGzE,QAAA,MAAM,MAAM,wTAuKX,CAAA;AAGD,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { MultiSelectorProps } from './type';
|
|
4
|
+
import { HandlerRef } from '../useNodesRef';
|
|
5
|
+
declare const PickerMultiSelector: React.ForwardRefExoticComponent<Omit<MultiSelectorProps, "ref"> & React.RefAttributes<HandlerRef<View, MultiSelectorProps>>>;
|
|
6
|
+
export default PickerMultiSelector;
|
|
7
|
+
//# sourceMappingURL=multiSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiSelector.d.ts","sourceRoot":"","sources":["../../mpx-picker/multiSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyE,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAkB,MAAM,QAAQ,CAAA;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AA8B3C,QAAA,MAAM,mBAAmB,8HA8EvB,CAAA;AAGF,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { RegionProps } from './type';
|
|
4
|
+
import { HandlerRef } from '../useNodesRef';
|
|
5
|
+
declare const PickerRegion: React.ForwardRefExoticComponent<Omit<RegionProps, "ref"> & React.RefAttributes<HandlerRef<View, RegionProps>>>;
|
|
6
|
+
export default PickerRegion;
|
|
7
|
+
//# sourceMappingURL=region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../../mpx-picker/region.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkF,MAAM,OAAO,CAAA;AACtG,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAA;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AA+J3C,QAAA,MAAM,YAAY,gHAsEhB,CAAA;AAGF,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regionData.d.ts","sourceRoot":"","sources":["../../mpx-picker/regionData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,eAAO,MAAM,UAAU,EAAE,SAAS,EAk9LjC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { SelectorProps } from './type';
|
|
4
|
+
import { HandlerRef } from '../useNodesRef';
|
|
5
|
+
declare const PickerSelector: React.ForwardRefExoticComponent<Omit<SelectorProps, "ref"> & React.RefAttributes<HandlerRef<View, SelectorProps>>>;
|
|
6
|
+
export default PickerSelector;
|
|
7
|
+
//# sourceMappingURL=selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../mpx-picker/selector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,aAAa,EAAkB,MAAM,QAAQ,CAAA;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AA4B3C,QAAA,MAAM,cAAc,oHAqDlB,CAAA;AAGF,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { TimeProps } from './type';
|
|
4
|
+
import { HandlerRef } from '../useNodesRef';
|
|
5
|
+
declare const PickerTime: React.ForwardRefExoticComponent<Omit<TimeProps, "ref"> & React.RefAttributes<HandlerRef<View, TimeProps>>>;
|
|
6
|
+
export default PickerTime;
|
|
7
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../mpx-picker/time.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuE,MAAM,OAAO,CAAA;AAC3F,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAkE3C,QAAA,MAAM,UAAU,4GA2Ed,CAAA;AAGF,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const enum PickerMode {
|
|
3
|
+
SELECTOR = "selector",
|
|
4
|
+
MULTI_SELECTOR = "multiSelector",
|
|
5
|
+
TIME = "time",
|
|
6
|
+
DATE = "date",
|
|
7
|
+
REGION = "region"
|
|
8
|
+
}
|
|
9
|
+
export type PickerValue = number;
|
|
10
|
+
export type Obj = Record<string, any>;
|
|
11
|
+
export type RangeItem = Obj | number | string;
|
|
12
|
+
export type TimeValue = `${number}-${number}-${number}` | '';
|
|
13
|
+
/** 通用属性 */
|
|
14
|
+
export interface BasePickerProps {
|
|
15
|
+
/** --- 小程序属性 --- */
|
|
16
|
+
/** 选择器类型, 默认值 selector */
|
|
17
|
+
mode?: PickerMode;
|
|
18
|
+
/** 是否禁用, 默认值 false */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 点击取消按钮时触发 */
|
|
21
|
+
bindcancel?: Function;
|
|
22
|
+
/** 头部标题 */
|
|
23
|
+
'header-text'?: string;
|
|
24
|
+
/** --- 内部组件属性 --- */
|
|
25
|
+
/** 作为表单组件时的名称 */
|
|
26
|
+
name?: string;
|
|
27
|
+
style?: Record<string, any>;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
range?: RangeItem[];
|
|
30
|
+
ref?: any;
|
|
31
|
+
}
|
|
32
|
+
export interface SelectorProps extends BasePickerProps {
|
|
33
|
+
mode: PickerMode.SELECTOR;
|
|
34
|
+
/** 默认值 0 */
|
|
35
|
+
value?: number;
|
|
36
|
+
/** 默认值 [] */
|
|
37
|
+
range?: RangeItem[];
|
|
38
|
+
'range-key'?: string;
|
|
39
|
+
/** 点击确认按钮后触发 change 事件, event.detail = {value} */
|
|
40
|
+
bindchange?: Function;
|
|
41
|
+
}
|
|
42
|
+
export interface MultiSelectorProps extends BasePickerProps {
|
|
43
|
+
mode: PickerMode.MULTI_SELECTOR;
|
|
44
|
+
/** 默认值 [] */
|
|
45
|
+
value?: number[];
|
|
46
|
+
range?: RangeItem[];
|
|
47
|
+
'range-key'?: string;
|
|
48
|
+
bindchange?: Function;
|
|
49
|
+
bindcolumnchange?: Function;
|
|
50
|
+
}
|
|
51
|
+
export interface TimeProps extends BasePickerProps {
|
|
52
|
+
mode: PickerMode.TIME;
|
|
53
|
+
/** 表示选中的时间,格式为"hh:mm" */
|
|
54
|
+
value?: string;
|
|
55
|
+
start?: string;
|
|
56
|
+
end?: string;
|
|
57
|
+
bindchange?: Function;
|
|
58
|
+
}
|
|
59
|
+
export interface DateProps extends BasePickerProps {
|
|
60
|
+
mode: PickerMode.DATE;
|
|
61
|
+
/** 默认值 '' */
|
|
62
|
+
value?: TimeValue;
|
|
63
|
+
start?: TimeValue;
|
|
64
|
+
end?: TimeValue;
|
|
65
|
+
/** 有效值 year,month,day,表示选择器的粒度 */
|
|
66
|
+
fields?: 'day' | 'month' | 'year';
|
|
67
|
+
bindchange?: Function;
|
|
68
|
+
}
|
|
69
|
+
export interface RegionProps extends BasePickerProps {
|
|
70
|
+
mode: PickerMode.REGION;
|
|
71
|
+
/** 表示选中的省市区,默认选中每一列的第一个值, 默认值 [] */
|
|
72
|
+
value?: string[];
|
|
73
|
+
/** 默认值 region */
|
|
74
|
+
level?: 'province' | 'city' | 'region' | 'sub-district';
|
|
75
|
+
/** 可为每一列的顶部添加一个自定义的项 */
|
|
76
|
+
'custom-item'?: string;
|
|
77
|
+
/** value 改变时触发 change 事件, event.detail = {value, code, postcode},
|
|
78
|
+
* 其中字段 code 是统计用区划代码, postcode 是邮政编码 */
|
|
79
|
+
bindchange?: Function;
|
|
80
|
+
}
|
|
81
|
+
export interface RegionObj {
|
|
82
|
+
value: string;
|
|
83
|
+
code: string;
|
|
84
|
+
postcode?: string;
|
|
85
|
+
children?: RegionObj[];
|
|
86
|
+
}
|
|
87
|
+
export interface PickerData {
|
|
88
|
+
value: string;
|
|
89
|
+
label: string;
|
|
90
|
+
children?: Object[];
|
|
91
|
+
}
|
|
92
|
+
export interface EventType {
|
|
93
|
+
detail: {
|
|
94
|
+
value: PickerValue[];
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface LayoutType {
|
|
98
|
+
nativeEvent: {
|
|
99
|
+
layout: Obj;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface FormType {
|
|
103
|
+
name: string;
|
|
104
|
+
}
|
|
105
|
+
export type PickerProps = SelectorProps | MultiSelectorProps | TimeProps | DateProps | RegionProps;
|
|
106
|
+
export type LanguageCode = 'zh-CN' | 'en-US';
|
|
107
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../mpx-picker/type.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HandlerRef } from '../useNodesRef';
|
|
4
|
+
import type { AnyFunc } from '../types/common';
|
|
5
|
+
/**
|
|
6
|
+
* ✔ value
|
|
7
|
+
* ✔ bindchange
|
|
8
|
+
* ✘ bindpickstart
|
|
9
|
+
* ✘ bindpickend
|
|
10
|
+
* ✔ mask-class
|
|
11
|
+
* ✔ indicator-style: 优先级indicator-style.height > pick-view-column中的子元素设置的height
|
|
12
|
+
* WebView Only:
|
|
13
|
+
* ✔ indicator-class
|
|
14
|
+
* ✔ mask-style
|
|
15
|
+
* ✘ immediate-change
|
|
16
|
+
*/
|
|
17
|
+
interface PickerViewProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
value?: Array<number>;
|
|
20
|
+
bindchange?: AnyFunc;
|
|
21
|
+
style?: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
'enable-wheel-animation'?: boolean;
|
|
25
|
+
'indicator-style'?: Record<string, any>;
|
|
26
|
+
'mask-style'?: Record<string, any>;
|
|
27
|
+
'enable-var'?: boolean;
|
|
28
|
+
'external-var-context'?: Record<string, any>;
|
|
29
|
+
'enable-offset'?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare const _PickerView: React.ForwardRefExoticComponent<PickerViewProps & React.RefAttributes<HandlerRef<View, PickerViewProps>>>;
|
|
32
|
+
export default _PickerView;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-picker-view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAA4C,MAAM,OAAO,CAAA;AAEhE,OAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAWxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C;;;;;;;;;;;GAWG;AAEH,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,CAAA;IACD,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAyBD,QAAA,MAAM,WAAW,2GAsLf,CAAA;AAGF,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SharedValue } from 'react-native-reanimated';
|
|
3
|
+
type ContextValue = SharedValue<number>;
|
|
4
|
+
export declare const PickerViewColumnAnimationContext: import("react").Context<ContextValue | undefined>;
|
|
5
|
+
export declare const usePickerViewColumnAnimationContext: () => ContextValue;
|
|
6
|
+
export declare const PickerViewStyleContext: import("react").Context<Record<string, any> | undefined>;
|
|
7
|
+
export declare const usePickerViewStyleContext: () => Record<string, any> | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=pickerVIewContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerVIewContext.d.ts","sourceRoot":"","sources":["../../mpx-picker-view/pickerVIewContext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;AAEvC,eAAO,MAAM,gCAAgC,mDAEjC,CAAA;AAEZ,eAAO,MAAM,mCAAmC,oBAQ/C,CAAA;AAED,eAAO,MAAM,sBAAsB,0DAEvB,CAAA;AAEZ,eAAO,MAAM,yBAAyB,uCAGrC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
|
+
import { HandlerRef } from '../useNodesRef';
|
|
4
|
+
interface ColumnProps {
|
|
5
|
+
columnIndex: number;
|
|
6
|
+
columnData: React.ReactNode[];
|
|
7
|
+
initialIndex: number;
|
|
8
|
+
onSelectChange: Function;
|
|
9
|
+
style: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
'enable-var'?: boolean;
|
|
13
|
+
'external-var-context'?: Record<string, any>;
|
|
14
|
+
wrapperStyle: {
|
|
15
|
+
height: number;
|
|
16
|
+
itemHeight: number;
|
|
17
|
+
};
|
|
18
|
+
pickerMaskStyle: Record<string, any>;
|
|
19
|
+
pickerIndicatorStyle: Record<string, any>;
|
|
20
|
+
enableWheelAnimation?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const _PickerViewColumn: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<HandlerRef<ScrollView & View, ColumnProps>>>;
|
|
23
|
+
export default _PickerViewColumn;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAA;AAC3G,OAAO,EAAqF,UAAU,EAAc,IAAI,EAAE,MAAM,cAAc,CAAA;AAG9I,OAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAQxD,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,QAAQ,CAAA;IACxB,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,CAAA;IACD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAID,QAAA,MAAM,iBAAiB,gHA0UrB,CAAA;AAQF,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
3
|
+
interface PickerColumnItemProps {
|
|
4
|
+
item: React.ReactElement;
|
|
5
|
+
index: number;
|
|
6
|
+
itemHeight: number;
|
|
7
|
+
itemWidth?: number | '100%';
|
|
8
|
+
textStyle: Record<string, any>;
|
|
9
|
+
visibleCount: number;
|
|
10
|
+
textProps?: any;
|
|
11
|
+
onItemLayout?: (e: LayoutChangeEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const PickerViewColumnItem: React.FC<PickerColumnItemProps>;
|
|
14
|
+
export default PickerViewColumnItem;
|
|
15
|
+
//# sourceMappingURL=pickerViewColumnItem.d.ts.map
|
package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerViewColumnItem.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/pickerViewColumnItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAMhD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,KAAK,CAAC,YAAY,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAC9C;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAqDzD,CAAA;AAGD,eAAe,oBAAoB,CAAA"}
|
package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
3
|
+
interface PickerColumnItemProps {
|
|
4
|
+
item: React.ReactElement;
|
|
5
|
+
index: number;
|
|
6
|
+
itemHeight: number;
|
|
7
|
+
itemWidth?: number | '100%';
|
|
8
|
+
textStyle: Record<string, any>;
|
|
9
|
+
textProps?: any;
|
|
10
|
+
onItemLayout?: (e: LayoutChangeEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const PickerViewColumnItem: React.FC<PickerColumnItemProps>;
|
|
13
|
+
export default PickerViewColumnItem;
|
|
14
|
+
//# sourceMappingURL=pickerViewColumnItemLite.d.ts.map
|
package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerViewColumnItemLite.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/pickerViewColumnItemLite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAQ,MAAM,cAAc,CAAA;AAItD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,KAAK,CAAC,YAAY,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAC9C;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoCzD,CAAA;AAGD,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Borrowed from open-source code: https://github.com/quidone/react-native-wheel-picker
|
|
3
|
+
* Special thanks to the authors for their contribution to the open-source community.
|
|
4
|
+
*/
|
|
5
|
+
export type Faces = {
|
|
6
|
+
index: number;
|
|
7
|
+
deg: number;
|
|
8
|
+
offsetY: number;
|
|
9
|
+
opacity: number;
|
|
10
|
+
scale: number;
|
|
11
|
+
screenHeight: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const degToRad: (deg: number) => number;
|
|
14
|
+
export declare const calcPickerHeight: (faces: Faces[], itemHeight: number) => number;
|
|
15
|
+
export declare const calcHeightOffsets: (itemHeight: number) => number[];
|
|
16
|
+
export declare const createFaces: (itemHeight: number, visibleCount: number) => Faces[];
|
|
17
|
+
//# sourceMappingURL=pickerViewFaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerViewFaces.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/pickerViewFaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,QAAQ,QAAS,MAAM,WAA0B,CAAA;AAM9D,eAAO,MAAM,gBAAgB,UAAW,KAAK,EAAE,cAAc,MAAM,WAKlE,CAAA;AAED,eAAO,MAAM,iBAAiB,eAAgB,MAAM,aAKnD,CAAA;AAED,eAAO,MAAM,WAAW,eACV,MAAM,gBACJ,MAAM,KACnB,KAAK,EA4EP,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
type IndicatorProps = {
|
|
4
|
+
itemHeight: number;
|
|
5
|
+
indicatorItemStyle?: StyleProp<ViewStyle>;
|
|
6
|
+
indicatorContainerStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
};
|
|
8
|
+
declare const _PickerViewIndicator: {
|
|
9
|
+
({ itemHeight, indicatorItemStyle, indicatorContainerStyle }: IndicatorProps): React.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default _PickerViewIndicator;
|
|
13
|
+
//# sourceMappingURL=pickerViewIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerViewIndicator.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/pickerViewIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAErE,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACzC,uBAAuB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC/C,CAAA;AAED,QAAA,MAAM,oBAAoB;kEAAiE,cAAc;;CAMxG,CAAA;AAkBD,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
type MaskProps = {
|
|
4
|
+
itemHeight: number;
|
|
5
|
+
maskContainerStyle?: StyleProp<ViewStyle>;
|
|
6
|
+
};
|
|
7
|
+
declare const _PickerViewMask: {
|
|
8
|
+
({ itemHeight, maskContainerStyle }: MaskProps): React.JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default _PickerViewMask;
|
|
12
|
+
//# sourceMappingURL=pickerViewMask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerViewMask.d.ts","sourceRoot":"","sources":["../../mpx-picker-view-column/pickerViewMask.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC1C,CAAA;AAED,QAAA,MAAM,eAAe;yCAGlB,SAAS;;CAQX,CAAA;AASD,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { PopupBaseProps } from './popupBase';
|
|
3
|
+
export declare const enum PopupType {
|
|
4
|
+
PICKER = "picker"
|
|
5
|
+
}
|
|
6
|
+
export interface IUsePopupOptions {
|
|
7
|
+
modal?: React.ComponentType<PopupBaseProps>;
|
|
8
|
+
type?: PopupType;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 基于 Portal 封装的 Popup 弹窗组件管理 Hooks
|
|
12
|
+
*/
|
|
13
|
+
declare const createPopupManager: (options?: IUsePopupOptions) => {
|
|
14
|
+
open: (childComponent: React.ReactNode, pageId: number | undefined, options?: {
|
|
15
|
+
contentHeight?: number;
|
|
16
|
+
}) => void;
|
|
17
|
+
show: () => void;
|
|
18
|
+
hide: () => void;
|
|
19
|
+
update: (updatedChild: ReactElement | null) => void;
|
|
20
|
+
remove: () => void;
|
|
21
|
+
};
|
|
22
|
+
export { createPopupManager };
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-popup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;AAElD,OAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEvD,0BAAkB,SAAS;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;IAC3C,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAaD;;GAEG;AACH,QAAA,MAAM,kBAAkB,aAAa,gBAAgB;2BAiBjC,MAAM,SAAS,UACvB,MAAM,GAAG,SAAS,YAChB;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;;;2BAaR,YAAY,GAAG,IAAI;;CAwBlD,CAAA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PopupBaseProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
hide?: () => void;
|
|
5
|
+
contentHeight?: number;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 类似微信 picker 弹窗的动画效果都可以复用此类容器
|
|
10
|
+
* 其他特定类型的弹窗容器组件可以在此基础上封装,或者扩展实现
|
|
11
|
+
*/
|
|
12
|
+
declare const PopupBase: {
|
|
13
|
+
(props?: PopupBaseProps): import("react").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export default PopupBase;
|
|
17
|
+
//# sourceMappingURL=popupBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popupBase.d.ts","sourceRoot":"","sources":["../../mpx-popup/popupBase.tsx"],"names":[],"mappings":";AAUA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAmCD;;;GAGG;AACH,QAAA,MAAM,SAAS;aAAW,cAAc;;CAwEvC,CAAA;AAGD,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type PortalProps = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
declare const Portal: {
|
|
6
|
+
({ children }: PortalProps): null;
|
|
7
|
+
Host: ({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
pageId: number;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
add: (e: ReactNode, id: number | null) => number;
|
|
12
|
+
remove: (key: number) => void;
|
|
13
|
+
update: (key: number, e: ReactNode) => void;
|
|
14
|
+
};
|
|
15
|
+
export default Portal;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAA;AAIhE,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,MAAM;mBAAkB,WAAW,GAAG,IAAI;;;;;;;;CA6B/C,CAAA;AAOD,eAAe,MAAM,CAAA"}
|