@htyf-mp/taro-components-rn 0.5.8 → 0.7.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/dist/assets/weui.d.ts +26 -0
- package/dist/assets/weui.js.map +1 -1
- package/dist/components/Block/index.d.ts +5 -0
- package/dist/components/Block/index.js +2 -2
- package/dist/components/Block/index.js.map +1 -1
- package/dist/components/Button/PropsType.d.ts +18 -0
- package/dist/components/Button/PropsType.js.map +1 -1
- package/dist/components/Button/index.d.ts +59 -0
- package/dist/components/Button/index.js +4 -7
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.d.ts +29 -0
- package/dist/components/Button/styles.js.map +1 -1
- package/dist/components/Camera/PropsType.d.ts +11 -0
- package/dist/components/Camera/PropsType.js.map +1 -1
- package/dist/components/Camera/index.d.ts +13 -0
- package/dist/components/Camera/index.js +4 -3
- package/dist/components/Camera/index.js.map +1 -1
- package/dist/components/Camera/styles.d.ts +7 -0
- package/dist/components/Camera/styles.js.map +1 -1
- package/dist/components/Checkbox/PropsType.d.ts +17 -0
- package/dist/components/Checkbox/PropsType.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +26 -0
- package/dist/components/Checkbox/index.js +2 -4
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +24 -0
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/CheckboxGroup/PropsType.d.ts +22 -0
- package/dist/components/CheckboxGroup/PropsType.js.map +1 -1
- package/dist/components/CheckboxGroup/index.d.ts +17 -0
- package/dist/components/CheckboxGroup/index.js +2 -1
- package/dist/components/CheckboxGroup/index.js.map +1 -1
- package/dist/components/ClickableSimplified/PropsType.d.ts +31 -0
- package/dist/components/ClickableSimplified/PropsType.js.map +1 -1
- package/dist/components/ClickableSimplified/index.d.ts +143 -0
- package/dist/components/ClickableSimplified/index.js +3 -2
- package/dist/components/ClickableSimplified/index.js.map +1 -1
- package/dist/components/CoverImage/index.d.ts +1 -0
- package/dist/components/CoverImage/index.js.map +1 -1
- package/dist/components/CoverView/index.d.ts +1 -0
- package/dist/components/CoverView/index.js.map +1 -1
- package/dist/components/CustomWrapper/index.d.ts +1 -0
- package/dist/components/CustomWrapper/index.js.map +1 -1
- package/dist/components/Form/PropsType.d.ts +32 -0
- package/dist/components/Form/PropsType.js.map +1 -1
- package/dist/components/Form/index.d.ts +16 -0
- package/dist/components/Form/index.js +2 -1
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Icon/PropsType.d.ts +7 -0
- package/dist/components/Icon/PropsType.js.map +1 -1
- package/dist/components/Icon/index.d.ts +9 -0
- package/dist/components/Icon/index.js +4 -10
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Image/PropsType.d.ts +27 -0
- package/dist/components/Image/PropsType.js.map +1 -1
- package/dist/components/Image/index.d.ts +21 -0
- package/dist/components/Image/index.js +4 -19
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Input/PropsType.d.ts +51 -0
- package/dist/components/Input/PropsType.js.map +1 -1
- package/dist/components/Input/index.d.ts +31 -0
- package/dist/components/Input/index.js +6 -9
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/PropsType.d.ts +5 -0
- package/dist/components/Label/PropsType.js.map +1 -1
- package/dist/components/Label/index.d.ts +13 -0
- package/dist/components/Label/index.js +2 -1
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Map/index.d.ts +154 -0
- package/dist/components/Map/index.js +12 -17
- package/dist/components/Map/index.js.map +1 -1
- package/dist/components/MovableArea/PropsType.d.ts +18 -0
- package/dist/components/MovableArea/PropsType.js.map +1 -1
- package/dist/components/MovableArea/index.d.ts +10 -0
- package/dist/components/MovableArea/index.js +2 -1
- package/dist/components/MovableArea/index.js.map +1 -1
- package/dist/components/MovableView/PropsType.d.ts +30 -0
- package/dist/components/MovableView/PropsType.js.map +1 -1
- package/dist/components/MovableView/index.d.ts +21 -0
- package/dist/components/MovableView/index.js +3 -3
- package/dist/components/MovableView/index.js.map +1 -1
- package/dist/components/Navigator/index.d.ts +2 -0
- package/dist/components/Navigator/index.js +3 -2
- package/dist/components/Navigator/index.js.map +1 -1
- package/dist/components/PageContainer/PropsType.d.ts +19 -0
- package/dist/components/PageContainer/PropsType.js.map +1 -1
- package/dist/components/PageContainer/container.d.ts +13 -0
- package/dist/components/PageContainer/container.js +4 -4
- package/dist/components/PageContainer/container.js.map +1 -1
- package/dist/components/PageContainer/index.d.ts +17 -0
- package/dist/components/PageContainer/index.js +2 -2
- package/dist/components/PageContainer/index.js.map +1 -1
- package/dist/components/Picker/PropsType.d.ts +42 -0
- package/dist/components/Picker/PropsType.js.map +1 -1
- package/dist/components/Picker/date.d.ts +13 -0
- package/dist/components/Picker/date.js +3 -2
- package/dist/components/Picker/date.js.map +1 -1
- package/dist/components/Picker/index.d.ts +37 -0
- package/dist/components/Picker/index.js +6 -5
- package/dist/components/Picker/index.js.map +1 -1
- package/dist/components/Picker/multiSelector.d.ts +16 -0
- package/dist/components/Picker/multiSelector.js +2 -1
- package/dist/components/Picker/multiSelector.js.map +1 -1
- package/dist/components/Picker/region.d.ts +16 -0
- package/dist/components/Picker/region.js +3 -2
- package/dist/components/Picker/region.js.map +1 -1
- package/dist/components/Picker/regionData.d.ts +2 -0
- package/dist/components/Picker/regionData.js.map +1 -1
- package/dist/components/Picker/selector.d.ts +19 -0
- package/dist/components/Picker/selector.js +2 -1
- package/dist/components/Picker/selector.js.map +1 -1
- package/dist/components/Picker/time.d.ts +17 -0
- package/dist/components/Picker/time.js +3 -2
- package/dist/components/Picker/time.js.map +1 -1
- package/dist/components/PickerView/PropsType.d.ts +10 -0
- package/dist/components/PickerView/PropsType.js.map +1 -1
- package/dist/components/PickerView/index.d.ts +14 -0
- package/dist/components/PickerView/index.js +2 -1
- package/dist/components/PickerView/index.js.map +1 -1
- package/dist/components/PickerViewColumn/index.d.ts +7 -0
- package/dist/components/PickerViewColumn/index.js +2 -1
- package/dist/components/PickerViewColumn/index.js.map +1 -1
- package/dist/components/Progress/PropsType.d.ts +11 -0
- package/dist/components/Progress/PropsType.js.map +1 -1
- package/dist/components/Progress/index.d.ts +42 -0
- package/dist/components/Progress/index.js +14 -18
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Progress/styles.d.ts +14 -0
- package/dist/components/Progress/styles.js.map +1 -1
- package/dist/components/Provider/index.d.ts +2 -0
- package/dist/components/Provider/index.js.map +1 -1
- package/dist/components/Radio/PropsType.d.ts +12 -0
- package/dist/components/Radio/PropsType.js.map +1 -1
- package/dist/components/Radio/index.d.ts +24 -0
- package/dist/components/Radio/index.js +2 -4
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/Radio/styles.d.ts +25 -0
- package/dist/components/Radio/styles.js.map +1 -1
- package/dist/components/RadioGroup/PropsType.d.ts +21 -0
- package/dist/components/RadioGroup/PropsType.js.map +1 -1
- package/dist/components/RadioGroup/index.d.ts +16 -0
- package/dist/components/RadioGroup/index.js +2 -1
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/RichText/PropsType.d.ts +15 -0
- package/dist/components/RichText/PropsType.js.map +1 -1
- package/dist/components/RichText/index.d.ts +18 -0
- package/dist/components/RichText/index.js +4 -4
- package/dist/components/RichText/index.js.map +1 -1
- package/dist/components/ScrollView/PropsType.d.ts +51 -0
- package/dist/components/ScrollView/PropsType.js.map +1 -1
- package/dist/components/ScrollView/index.d.ts +62 -0
- package/dist/components/ScrollView/index.js +2 -1
- package/dist/components/ScrollView/index.js.map +1 -1
- package/dist/components/Slider/PropsType.d.ts +25 -0
- package/dist/components/Slider/PropsType.js.map +1 -1
- package/dist/components/Slider/index.d.ts +40 -0
- package/dist/components/Slider/index.js +2 -3
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +13 -0
- package/dist/components/Slider/styles.js.map +1 -1
- package/dist/components/Swiper/PropsType.d.ts +48 -0
- package/dist/components/Swiper/PropsType.js.map +1 -1
- package/dist/components/Swiper/carousel.d.ts +32 -0
- package/dist/components/Swiper/carousel.js +24 -29
- package/dist/components/Swiper/carousel.js.map +1 -1
- package/dist/components/Swiper/index.d.ts +61 -0
- package/dist/components/Swiper/index.js +2 -1
- package/dist/components/Swiper/index.js.map +1 -1
- package/dist/components/Swiper/pagination.d.ts +2 -0
- package/dist/components/Swiper/pagination.js +4 -5
- package/dist/components/Swiper/pagination.js.map +1 -1
- package/dist/components/SwiperItem/PropsType.d.ts +6 -0
- package/dist/components/SwiperItem/PropsType.js.map +1 -1
- package/dist/components/SwiperItem/index.d.ts +7 -0
- package/dist/components/SwiperItem/index.js +2 -5
- package/dist/components/SwiperItem/index.js.map +1 -1
- package/dist/components/SwiperItem/styles.d.ts +8 -0
- package/dist/components/SwiperItem/styles.js.map +1 -1
- package/dist/components/Switch/PropsType.d.ts +20 -0
- package/dist/components/Switch/PropsType.js.map +1 -1
- package/dist/components/Switch/index.d.ts +37 -0
- package/dist/components/Switch/index.js +3 -2
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Text/PropsType.d.ts +8 -0
- package/dist/components/Text/PropsType.js.map +1 -1
- package/dist/components/Text/index.d.ts +9 -0
- package/dist/components/Text/index.js +2 -7
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Textarea/PropsType.d.ts +7 -0
- package/dist/components/Textarea/PropsType.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +14 -0
- package/dist/components/Textarea/index.js +2 -12
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Video/PropsType.d.ts +21 -0
- package/dist/components/Video/PropsType.js.map +1 -1
- package/dist/components/Video/controls.d.ts +0 -0
- package/dist/components/Video/controls.js.map +1 -1
- package/dist/components/Video/danmu.d.ts +0 -0
- package/dist/components/Video/danmu.js.map +1 -1
- package/dist/components/Video/index.d.ts +92 -0
- package/dist/components/Video/index.js +13 -21
- package/dist/components/Video/index.js.map +1 -1
- package/dist/components/Video/style.d.ts +252 -0
- package/dist/components/Video/style.js.map +1 -1
- package/dist/components/Video/utils.d.ts +3 -0
- package/dist/components/Video/utils.js.map +1 -1
- package/dist/components/View/PropsType.d.ts +7 -0
- package/dist/components/View/PropsType.js.map +1 -1
- package/dist/components/View/index.d.ts +12 -0
- package/dist/components/View/index.js +3 -2
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/VirtualList/PropsType.d.ts +58 -0
- package/dist/components/VirtualList/PropsType.js.map +1 -1
- package/dist/components/VirtualList/index.d.ts +33 -0
- package/dist/components/VirtualList/index.js +2 -1
- package/dist/components/VirtualList/index.js.map +1 -1
- package/dist/components/WebView/PropsType.d.ts +18 -0
- package/dist/components/WebView/PropsType.js.map +1 -1
- package/dist/components/WebView/index.d.ts +12 -0
- package/dist/components/WebView/index.js +2 -10
- package/dist/components/WebView/index.js.map +1 -1
- package/dist/components/hooks/PropsType.d.ts +31 -0
- package/dist/components/hooks/PropsType.js.map +1 -1
- package/dist/components/hooks/useClickable.d.ts +4 -0
- package/dist/components/hooks/useClickable.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +20 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +22 -18
- package/dist/setup.js +0 -12
- package/dist/setup.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FormItemProps } from '@tarojs/components';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type Event = {
|
|
4
|
+
target: {
|
|
5
|
+
value?: string;
|
|
6
|
+
};
|
|
7
|
+
detail: {
|
|
8
|
+
value?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type EventOnLineChange = {
|
|
12
|
+
detail: {
|
|
13
|
+
height: number;
|
|
14
|
+
lineCount: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export interface InputState {
|
|
18
|
+
returnValue?: string;
|
|
19
|
+
height: number;
|
|
20
|
+
value?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface InputProps extends FormItemProps {
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
value?: string;
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
type?: 'text' | 'number' | 'idcard' | 'digit';
|
|
27
|
+
password?: boolean;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
maxlength?: number;
|
|
31
|
+
autoFocus?: boolean;
|
|
32
|
+
focus?: boolean;
|
|
33
|
+
confirmType: 'done' | 'send' | 'search' | 'next' | 'go';
|
|
34
|
+
confirmHold?: boolean;
|
|
35
|
+
cursor?: number;
|
|
36
|
+
selectionStart?: number;
|
|
37
|
+
selectionEnd?: number;
|
|
38
|
+
placeholderStyle?: string;
|
|
39
|
+
placeholderTextColor?: string;
|
|
40
|
+
onInput?: (evt: Event) => void;
|
|
41
|
+
onChange?: (evt: Event) => void;
|
|
42
|
+
onFocus?: (evt: Event) => void;
|
|
43
|
+
onBlur?: (evt: Event) => void;
|
|
44
|
+
onKeyDown?: (evt: Partial<Event> & {
|
|
45
|
+
which?: number;
|
|
46
|
+
}) => void;
|
|
47
|
+
onConfirm?: (evt: Event) => void;
|
|
48
|
+
_multiline?: boolean;
|
|
49
|
+
_autoHeight?: boolean;
|
|
50
|
+
_onLineChange?: (evt: EventOnLineChange) => void;
|
|
51
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/Input/PropsType.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/Input/PropsType.tsx"],"names":[],"mappings":"","sourcesContent":["import { FormItemProps } from '@tarojs/components'\nimport { StyleProp, ViewStyle } from 'react-native'\n\nexport type Event = {\n target: { value?: string }\n detail: { value?: string }\n}\n\nexport type EventOnLineChange = {\n detail: {\n height: number\n lineCount: number\n }\n}\n\nexport interface InputState {\n returnValue?: string\n height: number\n value?: string\n}\n\nexport interface InputProps extends FormItemProps{\n style?: StyleProp<ViewStyle>\n value?: string\n defaultValue?: string\n type?: 'text' | 'number' | 'idcard' | 'digit'\n password?: boolean\n placeholder?: string\n disabled?: boolean\n maxlength?: number\n autoFocus?: boolean\n focus?: boolean\n confirmType: 'done' | 'send' | 'search' | 'next' | 'go'\n confirmHold?: boolean\n cursor?: number\n selectionStart?: number\n selectionEnd?: number\n placeholderStyle?: string\n placeholderTextColor?: string\n onInput?: (evt: Event) => void\n onChange?: (evt: Event) => void\n onFocus?: (evt: Event) => void\n onBlur?: (evt: Event) => void\n onKeyDown?: (evt: Partial<Event> & { which?: number }) => void\n onConfirm?: (evt: Event) => void\n // Private\n _multiline?: boolean\n _autoHeight?: boolean\n _onLineChange?: (evt: EventOnLineChange) => void\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✔ value
|
|
3
|
+
* ✘ type: Partially.
|
|
4
|
+
* ✔ password
|
|
5
|
+
* ✔ placeholder
|
|
6
|
+
* ✘ placeholder-style: Only placeholderTextColor(RN).
|
|
7
|
+
* - placeholder-class
|
|
8
|
+
* ✔ disabled
|
|
9
|
+
* ✔ maxlength
|
|
10
|
+
* ✘ cursor-spacing
|
|
11
|
+
* - auto-focus
|
|
12
|
+
* ✔ focus
|
|
13
|
+
* ✔ confirmType(confirm-type)
|
|
14
|
+
* ✔ confirmHold(confirm-hold)
|
|
15
|
+
* ✔ cursor
|
|
16
|
+
* ✔ selectionStart(selection-start)
|
|
17
|
+
* ✔ selectionEnd(selection-end)
|
|
18
|
+
* ✘ adjust-position
|
|
19
|
+
* ✔ onInput(bindinput): No CURSOR info.
|
|
20
|
+
* ✔ onFocus(bindfocus): No HEIGHT info.
|
|
21
|
+
* ✔ onBlur(bindblur): No CURSOR info.
|
|
22
|
+
* ✔ onConfirm(bindconfirm)
|
|
23
|
+
*
|
|
24
|
+
* @todo KeyboardAvoidingView
|
|
25
|
+
*/
|
|
26
|
+
import { InputProps } from './PropsType';
|
|
27
|
+
declare const _Input: {
|
|
28
|
+
(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export default _Input;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* ✔ value
|
|
3
4
|
* ✘ type: Partially.
|
|
@@ -38,21 +39,18 @@ const keyboardTypeMap = {
|
|
|
38
39
|
const defaultProps = {
|
|
39
40
|
type: 'text',
|
|
40
41
|
maxlength: 140,
|
|
41
|
-
confirmType: 'done',
|
|
42
42
|
selectionStart: -1,
|
|
43
43
|
selectionEnd: -1
|
|
44
44
|
};
|
|
45
45
|
const _Input = (props) => {
|
|
46
46
|
var _a, _b;
|
|
47
|
-
const { style, value, type = defaultProps.type, password, placeholder, disabled, maxlength = defaultProps.maxlength, confirmType, confirmHold, cursor, selectionStart = defaultProps.selectionStart, selectionEnd = defaultProps.selectionEnd, _multiline, _autoHeight, autoFocus, focus, placeholderStyle } = props;
|
|
47
|
+
const { style, value, type = defaultProps.type, password, placeholder, disabled, maxlength = defaultProps.maxlength, confirmType = 'done', confirmHold, cursor, selectionStart = defaultProps.selectionStart, selectionEnd = defaultProps.selectionEnd, _multiline, _autoHeight, autoFocus, focus, placeholderStyle } = props;
|
|
48
48
|
const [returnValue, setReturnValue] = React.useState();
|
|
49
49
|
/** 用于保存输入框值 */
|
|
50
|
-
|
|
51
|
-
const tmpValue = React.useRef();
|
|
50
|
+
const tmpValue = React.useRef(undefined);
|
|
52
51
|
const [_height, setHeight] = React.useState(0);
|
|
53
52
|
const lineCount = React.useRef(0);
|
|
54
|
-
|
|
55
|
-
const inputRef = React.useRef();
|
|
53
|
+
const inputRef = React.useRef(null);
|
|
56
54
|
React.useEffect(() => {
|
|
57
55
|
// @ts-ignore
|
|
58
56
|
tmpValue.current = value;
|
|
@@ -102,7 +100,7 @@ const _Input = (props) => {
|
|
|
102
100
|
target: { value: tmpValue.current || '' },
|
|
103
101
|
detail: { value: tmpValue.current || '' }
|
|
104
102
|
});
|
|
105
|
-
}, [
|
|
103
|
+
}, [props.onFocus]);
|
|
106
104
|
const onBlur = React.useCallback(() => {
|
|
107
105
|
const { onBlur = noop } = props;
|
|
108
106
|
onBlur({
|
|
@@ -198,7 +196,7 @@ const _Input = (props) => {
|
|
|
198
196
|
'placeholderStyle',
|
|
199
197
|
'placeholderTextColor',
|
|
200
198
|
]);
|
|
201
|
-
return (
|
|
199
|
+
return (_jsx(TextInput, Object.assign({}, inputProps, { ref: inputRef, defaultValue: defaultValue, keyboardType: keyboardType, secureTextEntry: !!password, placeholder: placeholder, editable: !disabled, maxLength: maxlength === -1 ? undefined : maxlength,
|
|
202
200
|
// returnKeyLabel={confirmType}
|
|
203
201
|
returnKeyType: confirmType, blurOnSubmit: !_multiline && !confirmHold, autoFocus: !!autoFocus || !!focus, selection: selection, onChangeText: onChangeText, value: returnValue, onFocus: onFocus, onBlur: onBlur, onKeyPress: onKeyPress, onSubmitEditing: onSubmitEditing, multiline: !!_multiline, textAlignVertical: textAlignVertical, onContentSizeChange: onContentSizeChange, underlineColorAndroid: "rgba(0,0,0,0)", placeholderTextColor: placeholderTextColor, style: [
|
|
204
202
|
{
|
|
@@ -209,7 +207,6 @@ const _Input = (props) => {
|
|
|
209
207
|
_multiline && _autoHeight && { height: Math.max((style === null || style === void 0 ? void 0 : style.minHeight) || 35, _height) }
|
|
210
208
|
] })));
|
|
211
209
|
};
|
|
212
|
-
_Input.defaultProps = defaultProps;
|
|
213
210
|
_Input.displayName = '_Input';
|
|
214
211
|
export default _Input;
|
|
215
212
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,KAAK,MAAM,OA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AO,CAAC,EAAE;SACnF,IACD,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,eAAe,MAAM,CAAA","sourcesContent":["/**\n * ✔ value\n * ✘ type: Partially.\n * ✔ password\n * ✔ placeholder\n * ✘ placeholder-style: Only placeholderTextColor(RN).\n * - placeholder-class\n * ✔ disabled\n * ✔ maxlength\n * ✘ cursor-spacing\n * - auto-focus\n * ✔ focus\n * ✔ confirmType(confirm-type)\n * ✔ confirmHold(confirm-hold)\n * ✔ cursor\n * ✔ selectionStart(selection-start)\n * ✔ selectionEnd(selection-end)\n * ✘ adjust-position\n * ✔ onInput(bindinput): No CURSOR info.\n * ✔ onFocus(bindfocus): No HEIGHT info.\n * ✔ onBlur(bindblur): No CURSOR info.\n * ✔ onConfirm(bindconfirm)\n *\n * @todo KeyboardAvoidingView\n */\n\nimport * as React from 'react'\nimport {\n KeyboardTypeOptions,\n NativeSyntheticEvent,\n Platform,\n TextInput,\n TextInputContentSizeChangeEventData,\n TextInputKeyPressEventData\n} from 'react-native'\n\nimport { noop, omit, parseStyles, useUpdateEffect } from '../../utils'\nimport { InputProps } from './PropsType'\n\nconst keyboardTypeMap: { [key: string]: string } = {\n text: 'default',\n number: 'numeric',\n idcard: 'default',\n digit:\n Platform.select({\n ios: 'decimal-pad',\n android: 'numeric'\n }) || ''\n}\n\nconst defaultProps = {\n type: 'text',\n maxlength: 140,\n selectionStart: -1,\n selectionEnd: -1\n}\n\nconst _Input = (props: InputProps) => {\n const {\n style,\n value,\n type = defaultProps.type,\n password,\n placeholder,\n disabled,\n maxlength = defaultProps.maxlength,\n confirmType = 'done',\n confirmHold,\n cursor,\n selectionStart = defaultProps.selectionStart,\n selectionEnd = defaultProps.selectionEnd,\n _multiline,\n _autoHeight,\n autoFocus,\n focus,\n placeholderStyle\n } = props\n\n const [returnValue, setReturnValue] = React.useState<string>()\n /** 用于保存输入框值 */\n const tmpValue = React.useRef<string | undefined>(undefined)\n const [_height, setHeight] = React.useState(0)\n const lineCount = React.useRef(0)\n const inputRef = React.useRef<TextInput | null>(null)\n\n React.useEffect(() => {\n // @ts-ignore\n tmpValue.current = value\n setReturnValue(val => {\n if (val !== value) {\n return value\n }\n return val\n })\n }, [returnValue, value])\n\n // fix: https://github.com/NervJS/taro/issues/11350\n useUpdateEffect(() => {\n if (!inputRef.current) {\n return\n }\n if (focus) {\n inputRef.current.focus()\n } else {\n inputRef.current.blur()\n }\n }, [focus])\n\n const onChangeText = React.useCallback((text: string): void => {\n const { onInput, onChange } = props\n const onEvent = onInput || onChange\n tmpValue.current = text || ''\n\n if (onEvent) {\n const result: unknown = onEvent({\n target: { value: text },\n detail: { value: text }\n })\n // Be care of flickering\n // @see https://facebook.github.io/react-native/docs/textinput.html#value\n if (typeof result === 'string') {\n tmpValue.current = result\n setReturnValue(result)\n } else if (returnValue !== undefined) {\n // 为了处理输入不合法,setState 相同值时,状态不更新,UI 也得不到更新,重置状态进而更新\n setReturnValue(undefined)\n }\n }\n }, [returnValue, props.onInput, props.onChange])\n\n const onFocus = React.useCallback((): void => {\n const { onFocus = noop } = props\n\n onFocus({\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n }, [props.onFocus])\n\n const onBlur = React.useCallback((): void => {\n const { onBlur = noop } = props\n\n onBlur({\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n }, [props.onBlur])\n\n /**\n * Callback that is called when a key is pressed.\n * This will be called with `{ nativeEvent: { key: keyValue } }`\n * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and\n * the typed-in character otherwise including `' '` for space.\n * Fires before `onChange` callbacks.\n */\n const onKeyPress = React.useCallback((event: NativeSyntheticEvent<TextInputKeyPressEventData>): void => {\n const { onKeyDown = noop, onConfirm = noop } = props\n const keyValue = event.nativeEvent.key\n let which\n keyValue === 'Enter' && (which = 13)\n keyValue === 'Backspace' && (which = 8)\n onKeyDown({\n which,\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n if (keyValue !== 'Enter') return\n onConfirm({\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n }, [props.onKeyDown, props.onConfirm])\n\n const onSubmitEditing = React.useCallback((): void => {\n const { onKeyDown = noop, onConfirm = noop } = props\n if (_multiline) return\n onKeyDown({\n which: 13,\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n onConfirm({\n target: { value: tmpValue.current || '' },\n detail: { value: tmpValue.current || '' }\n })\n }, [_multiline, props.onKeyDown, props.onConfirm])\n\n const onContentSizeChange = React.useCallback((event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>): void => {\n const { width, height } = event.nativeEvent.contentSize\n // One of width and height may be 0.\n if (width && height) {\n const { _onLineChange = noop } = props\n if (!_multiline || !_autoHeight || height === _height) return\n lineCount.current += height > _height ? 1 : -1\n _onLineChange({ detail: { height, lineCount: lineCount.current } })\n setHeight(height)\n }\n }, [_height, _multiline, _autoHeight])\n\n const keyboardType: KeyboardTypeOptions = keyboardTypeMap[type] as KeyboardTypeOptions\n const selection = (() => {\n if (selectionStart >= 0 && selectionEnd >= 0) {\n return { start: selectionStart, end: selectionEnd }\n } else if (typeof cursor === 'number') {\n return { start: cursor, end: cursor }\n }\n })()\n\n const defaultValue = props.defaultValue ?? (type === 'number' && value ? value + '' : value)\n\n // fix: https://reactnative.dev/docs/textinput#multiline\n const textAlignVertical = _multiline ? 'top' : 'auto'\n const placeholderTextColor = props.placeholderTextColor || parseStyles(placeholderStyle)?.color\n\n const inputProps = omit(props, [\n 'style',\n 'value',\n 'type',\n 'password',\n 'placeholder',\n 'disabled',\n 'maxlength',\n 'confirmType',\n 'confirmHold',\n 'cursor',\n 'selectionStart',\n 'selectionEnd',\n 'onInput',\n 'onFocus',\n 'onBlur',\n 'onKeyDown',\n 'onConfirm',\n '_multiline',\n '_autoHeight',\n '_onLineChange',\n 'placeholderStyle',\n 'placeholderTextColor',\n ])\n\n return (\n <TextInput\n {...inputProps}\n ref={inputRef}\n defaultValue={defaultValue}\n keyboardType={keyboardType}\n secureTextEntry={!!password}\n placeholder={placeholder}\n editable={!disabled}\n maxLength={maxlength === -1 ? undefined : maxlength}\n // returnKeyLabel={confirmType}\n returnKeyType={confirmType}\n blurOnSubmit={!_multiline && !confirmHold}\n autoFocus={!!autoFocus || !!focus}\n selection={selection}\n onChangeText={onChangeText}\n value={returnValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={onKeyPress}\n onSubmitEditing={onSubmitEditing}\n multiline={!!_multiline}\n textAlignVertical={textAlignVertical}\n onContentSizeChange={onContentSizeChange}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n placeholderTextColor={placeholderTextColor}\n style={[\n {\n padding: 0\n },\n style,\n // @ts-ignore\n _multiline && _autoHeight && { height: Math.max(style?.minHeight || 35, _height) }\n ]}\n />\n )\n}\n\n_Input.displayName = '_Input'\n\nexport default _Input\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/Label/PropsType.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/Label/PropsType.tsx"],"names":[],"mappings":"","sourcesContent":["import { StyleProp, ViewStyle } from 'react-native'\n\nexport interface LabelProps {\n children?: React.ReactNode\n style?: StyleProp<ViewStyle>\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✘ for
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { LabelProps } from './PropsType';
|
|
6
|
+
declare class _Label extends React.Component<LabelProps> {
|
|
7
|
+
hadFoundValidWidget: boolean;
|
|
8
|
+
$validWidget: any;
|
|
9
|
+
findValidWidget: (children: React.ReactNode) => React.ReactNode;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
render(): React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export default _Label;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* ✘ for
|
|
3
4
|
*/
|
|
@@ -38,7 +39,7 @@ class _Label extends React.Component {
|
|
|
38
39
|
const mapChildren = this.findValidWidget(children);
|
|
39
40
|
// Prepare for next rerender
|
|
40
41
|
this.hadFoundValidWidget = false;
|
|
41
|
-
return (
|
|
42
|
+
return (_jsx(View, { onClick: this.onPress, style: style, children: mapChildren }));
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
export default _Label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Label/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,IAAI,MAAM,SAAS,CAAA;AAG1B,MAAM,MAAO,SAAQ,KAAK,CAAC,SAAqB;IAAhD;;QACE,wBAAmB,GAAG,KAAK,CAAA;QAC3B,iBAAY,GAAQ,IAAI,CAAA;QAExB,oBAAe,GAAG,CAAC,QAAyB,EAAmB,EAAE;YAC/D,IAAI,IAAI,CAAC,mBAAmB;gBAAE,OAAO,QAAQ,CAAA;YAE7C,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;gBACzD,IAAI,CAAC,KAAK,CAAC,IAAI;oBAAE,OAAO,KAAK,CAAA;gBAE7B,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAA;gBAC5C,IACE,CAAC,IAAI,CAAC,mBAAmB;oBACzB,CAAC,aAAa,KAAK,WAAW;wBAC5B,aAAa,KAAK,SAAS;wBAC3B,aAAa,KAAK,QAAQ;wBAC1B,aAAa,KAAK,SAAS,CAAC,EAC9B,CAAC;oBACD,IAAI,C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AK,CAAA;QAEhC,OAAO,CACL,KAAC,IAAI,IACH,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,KAAK,YAEX,WAAW,GACP,CACR,CAAA;IACH,CAAC;CACF;AAED,eAAe,MAAM,CAAA","sourcesContent":["/**\n * ✘ for\n */\n\nimport * as React from 'react'\n\nimport View from '../View'\nimport { LabelProps } from './PropsType'\n\nclass _Label extends React.Component<LabelProps> {\n hadFoundValidWidget = false\n $validWidget: any = null\n\n findValidWidget = (children: React.ReactNode): React.ReactNode => {\n if (this.hadFoundValidWidget) return children\n\n return React.Children.toArray(children).map((child: any) => {\n if (!child.type) return child\n\n const childTypeName = child.type.displayName\n if (\n !this.hadFoundValidWidget &&\n (childTypeName === '_Checkbox' ||\n childTypeName === '_Button' ||\n childTypeName === '_Radio' ||\n childTypeName === '_Switch')\n ) {\n this.hadFoundValidWidget = true\n return React.cloneElement(\n child,\n {\n ...child.props,\n ref: (vw: React.ReactNode) => {\n this.$validWidget = vw\n }\n },\n child.props.children\n )\n }\n return React.cloneElement(child, { ...child.props }, this.findValidWidget(child.props.children))\n })\n }\n\n onPress = (): void => {\n this.$validWidget && this.$validWidget._simulateNativePress?.()\n }\n\n render (): React.ReactNode {\n const { children, style } = this.props\n\n const mapChildren = this.findValidWidget(children)\n // Prepare for next rerender\n this.hadFoundValidWidget = false\n\n return (\n <View\n onClick={this.onPress}\n style={style}\n >\n {mapChildren}\n </View>\n )\n }\n}\n\nexport default _Label\n"]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 地图组件【EXPERIMENTAL】
|
|
3
|
+
*
|
|
4
|
+
* 安卓和 iOS 统一用谷歌地图
|
|
5
|
+
*
|
|
6
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/component/map.html
|
|
7
|
+
* @see https://docs.expo.io/versions/v27.0.0/sdk/map-view
|
|
8
|
+
* @see https://github.com/react-community/react-native-maps
|
|
9
|
+
*
|
|
10
|
+
* 颜色并不支持8位十六进制
|
|
11
|
+
*
|
|
12
|
+
* ✔ longitude
|
|
13
|
+
* ✔ latitude
|
|
14
|
+
* ✘ scale
|
|
15
|
+
* ✔ markers (部分支持)
|
|
16
|
+
* ✔ polyline (部分属性支持)
|
|
17
|
+
* ✔ polygons (不支持 zIndex)
|
|
18
|
+
* ✔ circles
|
|
19
|
+
* ✘ includePoints
|
|
20
|
+
* ✔ showLocation
|
|
21
|
+
* ✘ subkey
|
|
22
|
+
* ✘ enable3D
|
|
23
|
+
* ✔ showCompass
|
|
24
|
+
* ✘ enableOverlooking
|
|
25
|
+
* ✔ enableZoom
|
|
26
|
+
* ✔ enableScroll
|
|
27
|
+
* ✔ enableRotate
|
|
28
|
+
* ✔ onMarkerClick (onMarkerTap)
|
|
29
|
+
* ✔ onCalloutClick (onCalloutTap)
|
|
30
|
+
* ✘ onControlClick (onControlTap)
|
|
31
|
+
* ✔ onRegionChange (不支持 causedBy)
|
|
32
|
+
* ✔ onClick (onTap)
|
|
33
|
+
* ✔ onUpdated
|
|
34
|
+
* ✔ onPoiClick (onPoiTap)
|
|
35
|
+
*/
|
|
36
|
+
import * as React from 'react';
|
|
37
|
+
import { Circle, MapEvent, Marker, Polygon, Polyline } from 'react-native-maps';
|
|
38
|
+
/**
|
|
39
|
+
* 标记点气泡 callout
|
|
40
|
+
*/
|
|
41
|
+
type Callouts = {
|
|
42
|
+
content?: string;
|
|
43
|
+
color?: string;
|
|
44
|
+
fontSize?: number;
|
|
45
|
+
borderRadius?: number;
|
|
46
|
+
borderWidth?: number;
|
|
47
|
+
borderColor?: string;
|
|
48
|
+
bgColor?: string;
|
|
49
|
+
padding?: number;
|
|
50
|
+
display?: 'BYCLICK' | 'ALWAYS';
|
|
51
|
+
textAlign?: 'left' | 'right' | 'center';
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 标记点
|
|
55
|
+
*/
|
|
56
|
+
type Marker = {
|
|
57
|
+
id?: number;
|
|
58
|
+
latitude: number;
|
|
59
|
+
longitude: number;
|
|
60
|
+
title?: string;
|
|
61
|
+
iconPath: string;
|
|
62
|
+
rotate?: number;
|
|
63
|
+
alpha?: number;
|
|
64
|
+
callout?: Callouts;
|
|
65
|
+
anchor?: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 多段线
|
|
72
|
+
*/
|
|
73
|
+
type Polyline = {
|
|
74
|
+
points: Array<{
|
|
75
|
+
latitude: number;
|
|
76
|
+
longitude: number;
|
|
77
|
+
}>;
|
|
78
|
+
color?: string;
|
|
79
|
+
width?: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* 多边形
|
|
83
|
+
*/
|
|
84
|
+
type Polygon = {
|
|
85
|
+
points: Array<{
|
|
86
|
+
latitude: number;
|
|
87
|
+
longitude: number;
|
|
88
|
+
}>;
|
|
89
|
+
strokeWidth?: number;
|
|
90
|
+
strokeColor?: string;
|
|
91
|
+
fillColor?: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* 圆形
|
|
95
|
+
*/
|
|
96
|
+
type Circle = {
|
|
97
|
+
latitude: number;
|
|
98
|
+
longitude: number;
|
|
99
|
+
color?: string;
|
|
100
|
+
fillColor?: string;
|
|
101
|
+
radius: number;
|
|
102
|
+
strokeWidth?: number;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 坐标
|
|
106
|
+
*/
|
|
107
|
+
type Coordinate = {
|
|
108
|
+
latitude: number;
|
|
109
|
+
longitude: number;
|
|
110
|
+
};
|
|
111
|
+
export interface Props {
|
|
112
|
+
longitude: number;
|
|
113
|
+
latitude: number;
|
|
114
|
+
scale?: number;
|
|
115
|
+
markers?: Array<Marker>;
|
|
116
|
+
polyline?: Array<Polyline>;
|
|
117
|
+
polygons?: Array<Polygon>;
|
|
118
|
+
circles?: Array<Circle>;
|
|
119
|
+
includePoints?: Array<Coordinate>;
|
|
120
|
+
showLocation?: boolean;
|
|
121
|
+
subkey?: string;
|
|
122
|
+
enable3D?: boolean;
|
|
123
|
+
showCompass?: boolean;
|
|
124
|
+
enableOverlooking?: boolean;
|
|
125
|
+
enableZoom?: boolean;
|
|
126
|
+
enableScroll?: boolean;
|
|
127
|
+
enableRotate?: boolean;
|
|
128
|
+
onMarkerClick?(markerId?: number): void;
|
|
129
|
+
onCalloutClick?(markerId?: number): void;
|
|
130
|
+
onControlClick?(controlId?: number): void;
|
|
131
|
+
onRegionChange?(event: {
|
|
132
|
+
type: 'begin' | 'end';
|
|
133
|
+
timeStamp: number;
|
|
134
|
+
causedBy?: 'scale' | 'drag' | 'update';
|
|
135
|
+
}): void;
|
|
136
|
+
onClick?(coordinate: Coordinate): void;
|
|
137
|
+
onUpdated?(): void;
|
|
138
|
+
onPoiClick?(): void;
|
|
139
|
+
}
|
|
140
|
+
export interface State {
|
|
141
|
+
networkState: string;
|
|
142
|
+
}
|
|
143
|
+
declare class _Map extends React.Component<Props, State> {
|
|
144
|
+
static defaultProps: Props;
|
|
145
|
+
state: State;
|
|
146
|
+
_onRegionChange: () => void;
|
|
147
|
+
_onRegionChangeComplete: () => void;
|
|
148
|
+
_onClick: (e: MapEvent) => void;
|
|
149
|
+
_onMapReady: () => void;
|
|
150
|
+
_onPoiClick: () => void;
|
|
151
|
+
getCallout: (marker: Marker) => React.ReactNode | null;
|
|
152
|
+
render(): React.ReactNode;
|
|
153
|
+
}
|
|
154
|
+
export default _Map;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* 地图组件【EXPERIMENTAL】
|
|
3
4
|
*
|
|
@@ -79,26 +80,24 @@ class _Map extends React.Component {
|
|
|
79
80
|
const { id, callout } = marker;
|
|
80
81
|
if (!callout)
|
|
81
82
|
return null;
|
|
82
|
-
return (
|
|
83
|
+
return (_jsx(Callout, { onPress: () => {
|
|
83
84
|
onCalloutClick && onCalloutClick(id);
|
|
84
|
-
}
|
|
85
|
-
React.createElement(View, { style: {
|
|
85
|
+
}, children: _jsx(View, { style: {
|
|
86
86
|
borderRadius: callout.borderRadius,
|
|
87
87
|
borderWidth: callout.borderWidth,
|
|
88
88
|
borderColor: callout.borderColor,
|
|
89
89
|
backgroundColor: callout.bgColor,
|
|
90
90
|
padding: callout.padding
|
|
91
|
-
}
|
|
92
|
-
React.createElement(Text, { style: {
|
|
91
|
+
}, children: _jsx(Text, { style: {
|
|
93
92
|
fontSize: callout.fontSize,
|
|
94
93
|
color: callout.color,
|
|
95
94
|
textAlign: callout.textAlign
|
|
96
|
-
}
|
|
95
|
+
}, children: callout.content }) }) }));
|
|
97
96
|
};
|
|
98
97
|
}
|
|
99
98
|
render() {
|
|
100
99
|
const { latitude, longitude, markers, polyline, polygons, circles, showLocation, showCompass, enableZoom, enableScroll, enableRotate, onMarkerClick } = this.props;
|
|
101
|
-
return (
|
|
100
|
+
return (_jsxs(MapView, { style: { flex: 1 },
|
|
102
101
|
// provider={MapView.PROVIDER_GOOGLE}
|
|
103
102
|
initialRegion: {
|
|
104
103
|
latitude,
|
|
@@ -110,16 +109,12 @@ class _Map extends React.Component {
|
|
|
110
109
|
longitude,
|
|
111
110
|
latitudeDelta: LATITUDE_DELTA,
|
|
112
111
|
longitudeDelta: LONGITUDE_DELTA
|
|
113
|
-
}, minZoomLevel: 5, maxZoomLevel: 18, showsUserLocation: showLocation, showsCompass: showCompass, zoomEnabled: enableZoom, scrollEnabled: enableScroll, rotateEnabled: enableRotate, onRegionChange: this._onRegionChange, onRegionChangeComplete: this._onRegionChangeComplete, onPress: this._onClick, onMapReady: this._onMapReady, onPoiClick: this._onPoiClick
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} }, this.getCallout(marker)))),
|
|
120
|
-
(polyline || []).map((p, index) => (React.createElement(Polyline, { key: `polyline_${index}`, coordinates: p.points, strokeColor: p.color, strokeWidth: p.width }))),
|
|
121
|
-
(polygons || []).map((p, index) => (React.createElement(Polygon, { key: `polygon_${index}`, coordinates: p.points, strokeColor: p.strokeColor, strokeWidth: p.strokeWidth, fillColor: p.fillColor }))),
|
|
122
|
-
(circles || []).map((c, index) => (React.createElement(Circle, { key: `circle_${index}`, center: { latitude: c.latitude, longitude: c.longitude }, strokeColor: c.color, fillColor: c.fillColor, radius: c.radius, strokeWidth: c.strokeWidth })))));
|
|
112
|
+
}, minZoomLevel: 5, maxZoomLevel: 18, showsUserLocation: showLocation, showsCompass: showCompass, zoomEnabled: enableZoom, scrollEnabled: enableScroll, rotateEnabled: enableRotate, onRegionChange: this._onRegionChange, onRegionChangeComplete: this._onRegionChangeComplete, onPress: this._onClick, onMapReady: this._onMapReady, onPoiClick: this._onPoiClick, children: [(markers || []).map((marker) => (_jsx(Marker, { coordinate: {
|
|
113
|
+
latitude: marker.latitude,
|
|
114
|
+
longitude: marker.longitude
|
|
115
|
+
}, title: marker.title, image: { uri: marker.iconPath }, rotation: marker.rotate, opacity: marker.alpha, anchor: marker.anchor, onPress: () => {
|
|
116
|
+
onMarkerClick && onMarkerClick(marker.id);
|
|
117
|
+
}, children: this.getCallout(marker) }, marker.id))), (polyline || []).map((p, index) => (_jsx(Polyline, { coordinates: p.points, strokeColor: p.color, strokeWidth: p.width }, `polyline_${index}`))), (polygons || []).map((p, index) => (_jsx(Polygon, { coordinates: p.points, strokeColor: p.strokeColor, strokeWidth: p.strokeWidth, fillColor: p.fillColor }, `polygon_${index}`))), (circles || []).map((c, index) => (_jsx(Circle, { center: { latitude: c.latitude, longitude: c.longitude }, strokeColor: c.color, fillColor: c.fillColor, radius: c.radius, strokeWidth: c.strokeWidth }, `circle_${index}`)))] }));
|
|
123
118
|
}
|
|
124
119
|
}
|
|
125
120
|
_Map.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Map/index.tsx"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1B,SAAS,EAAE,CAAC,CAAC,SAAS,IAJjB,WAAW,KAAK,EAAE,CAKvB,CACH,CAAC,EACD,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,MAAM,IAEL,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EACxD,WAAW,EAAE,CAAC,CAAC,KAAK,EACpB,SAAS,EAAE,CAAC,CAAC,SAAS,EACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAChB,WAAW,EAAE,CAAC,CAAC,WAAW,IALrB,UAAU,KAAK,EAAE,CAMtB,CACH,CAAC,IACM,CACX,CAAA;IACH,CAAC;;AAtLM,iBAAY,GAAU;IAC3B,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,EAAE;IACV,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;CACjB,AAnBkB,CAmBlB;AAsKH,eAAe,IAAI,CAAA","sourcesContent":["/**\n * 地图组件【EXPERIMENTAL】\n *\n * 安卓和 iOS 统一用谷歌地图\n *\n * @see https://developers.weixin.qq.com/miniprogram/dev/component/map.html\n * @see https://docs.expo.io/versions/v27.0.0/sdk/map-view\n * @see https://github.com/react-community/react-native-maps\n *\n * 颜色并不支持8位十六进制\n *\n * ✔ longitude\n * ✔ latitude\n * ✘ scale\n * ✔ markers (部分支持)\n * ✔ polyline (部分属性支持)\n * ✔ polygons (不支持 zIndex)\n * ✔ circles\n * ✘ includePoints\n * ✔ showLocation\n * ✘ subkey\n * ✘ enable3D\n * ✔ showCompass\n * ✘ enableOverlooking\n * ✔ enableZoom\n * ✔ enableScroll\n * ✔ enableRotate\n * ✔ onMarkerClick (onMarkerTap)\n * ✔ onCalloutClick (onCalloutTap)\n * ✘ onControlClick (onControlTap)\n * ✔ onRegionChange (不支持 causedBy)\n * ✔ onClick (onTap)\n * ✔ onUpdated\n * ✔ onPoiClick (onPoiTap)\n */\n\nimport * as React from 'react'\nimport {\n Dimensions,\n Text,\n View\n} from 'react-native'\n// @ts-ignore // The type definitions for MapView have not been created.\nimport MapView, { Callout, Circle, MapEvent, Marker, Polygon, Polyline } from 'react-native-maps'\n\nimport { noop } from '../../utils'\n\nconst { width, height } = Dimensions.get('window')\nconst ASPECT_RATIO = width / height\nconst LATITUDE_DELTA = 0.0922\nconst LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO\n\n/**\n * 标记点气泡 callout\n */\ntype Callouts = {\n content?: string\n color?: string\n fontSize?: number\n borderRadius?: number\n borderWidth?: number\n borderColor?: string\n bgColor?: string\n padding?: number\n display?: 'BYCLICK' | 'ALWAYS'\n textAlign?: 'left' | 'right' | 'center'\n}\n\n/**\n * 标记点\n */\ntype Marker = {\n id?: number\n latitude: number\n longitude: number\n title?: string\n // zIndex?: number;\n iconPath: string\n rotate?: number\n alpha?: number\n // width?: number;\n // height?: number;\n callout?: Callouts\n // label?: Label;\n anchor?: { x: number, y: number }\n}\n\n/**\n * 多段线\n */\ntype Polyline = {\n points: Array<{ latitude: number, longitude: number }>\n color?: string\n width?: number\n // dottedLine?: boolean;\n // arrowLine?: boolean;\n // arrowIconPath?: string;\n // borderColor?: string;\n // borderWidth?: number;\n}\n\n/**\n * 多边形\n */\ntype Polygon = {\n points: Array<{ latitude: number, longitude: number }>\n strokeWidth?: number\n strokeColor?: string\n fillColor?: string\n // zIndex?: number;\n}\n\n/**\n * 圆形\n */\ntype Circle = {\n latitude: number\n longitude: number\n color?: string\n fillColor?: string\n radius: number\n strokeWidth?: number\n}\n\n/**\n * 坐标\n */\ntype Coordinate = {\n latitude: number\n longitude: number\n}\n\nexport interface Props {\n longitude: number\n latitude: number\n scale?: number\n markers?: Array<Marker>\n polyline?: Array<Polyline>\n polygons?: Array<Polygon>\n circles?: Array<Circle>\n includePoints?: Array<Coordinate>\n showLocation?: boolean\n subkey?: string\n enable3D?: boolean\n showCompass?: boolean\n enableOverlooking?: boolean\n enableZoom?: boolean\n enableScroll?: boolean\n enableRotate?: boolean\n\n onMarkerClick? (markerId?: number): void\n\n onCalloutClick? (markerId?: number): void\n\n onControlClick? (controlId?: number): void\n\n onRegionChange? (event: { type: 'begin' | 'end', timeStamp: number, causedBy?: 'scale' | 'drag' | 'update' }): void\n\n onClick? (coordinate: Coordinate): void\n\n onUpdated? (): void\n\n onPoiClick? (): void\n}\n\nexport interface State {\n networkState: string\n}\n\nclass _Map extends React.Component<Props, State> {\n static defaultProps: Props = {\n longitude: 0,\n latitude: 0,\n scale: 16,\n markers: [],\n polyline: [],\n polygons: [],\n circles: [],\n includePoints: [],\n subkey: '',\n enableZoom: true,\n enableScroll: true,\n onMarkerClick: noop,\n onCalloutClick: noop,\n onControlClick: noop,\n onRegionChange: noop,\n onClick: noop,\n onUpdated: noop,\n onPoiClick: noop\n }\n\n state: State = {\n networkState: ''\n }\n\n _onRegionChange = (): void => {\n const { onRegionChange } = this.props\n onRegionChange && onRegionChange({\n type: 'begin',\n timeStamp: Date.now()\n })\n }\n\n _onRegionChangeComplete = (): void => {\n const { onRegionChange } = this.props\n onRegionChange && onRegionChange({\n type: 'end',\n timeStamp: Date.now()\n })\n }\n\n _onClick = (e: MapEvent): void => {\n const { onClick } = this.props\n onClick && onClick(e.nativeEvent.coordinate)\n }\n\n _onMapReady = (): void => {\n const { onUpdated } = this.props\n onUpdated && onUpdated()\n }\n\n _onPoiClick = (): void => {\n const { onPoiClick } = this.props\n onPoiClick && onPoiClick()\n }\n\n getCallout = (marker: Marker): React.ReactNode | null => {\n const { onCalloutClick } = this.props\n const { id, callout } = marker\n if (!callout) return null\n return (\n <Callout\n onPress={() => {\n onCalloutClick && onCalloutClick(id)\n }}\n >\n <View\n style={{\n borderRadius: callout.borderRadius,\n borderWidth: callout.borderWidth,\n borderColor: callout.borderColor,\n backgroundColor: callout.bgColor,\n padding: callout.padding\n }}\n >\n <Text\n style={{\n fontSize: callout.fontSize,\n color: callout.color,\n textAlign: callout.textAlign\n }}\n >\n {callout.content}\n </Text>\n </View>\n </Callout>\n )\n }\n\n render (): React.ReactNode {\n const {\n latitude,\n longitude,\n markers,\n polyline,\n polygons,\n circles,\n showLocation,\n showCompass,\n enableZoom,\n enableScroll,\n enableRotate,\n onMarkerClick\n } = this.props\n\n return (\n <MapView\n style={{ flex: 1 }}\n // provider={MapView.PROVIDER_GOOGLE}\n initialRegion={{\n latitude,\n longitude,\n latitudeDelta: LATITUDE_DELTA,\n longitudeDelta: LONGITUDE_DELTA\n }}\n region={{\n latitude,\n longitude,\n latitudeDelta: LATITUDE_DELTA,\n longitudeDelta: LONGITUDE_DELTA\n }}\n minZoomLevel={5}\n maxZoomLevel={18}\n showsUserLocation={showLocation}\n showsCompass={showCompass}\n zoomEnabled={enableZoom}\n scrollEnabled={enableScroll}\n rotateEnabled={enableRotate}\n onRegionChange={this._onRegionChange}\n onRegionChangeComplete={this._onRegionChangeComplete}\n onPress={this._onClick}\n onMapReady={this._onMapReady}\n onPoiClick={this._onPoiClick}\n >\n {(markers || []).map((marker) => (\n <Marker\n key={marker.id}\n coordinate={{\n latitude: marker.latitude,\n longitude: marker.longitude\n }}\n title={marker.title}\n image={{ uri: marker.iconPath }}\n rotation={marker.rotate}\n opacity={marker.alpha}\n anchor={marker.anchor}\n onPress={() => {\n onMarkerClick && onMarkerClick(marker.id)\n }}\n >\n {this.getCallout(marker)}\n </Marker>\n ))}\n {(polyline || []).map((p, index) => (\n <Polyline\n key={`polyline_${index}`}\n coordinates={p.points}\n strokeColor={p.color}\n strokeWidth={p.width}\n />\n ))}\n {(polygons || []).map((p, index) => (\n <Polygon\n key={`polygon_${index}`}\n coordinates={p.points}\n strokeColor={p.strokeColor}\n strokeWidth={p.strokeWidth}\n fillColor={p.fillColor}\n />\n ))}\n {(circles || []).map((c, index) => (\n <Circle\n key={`circle_${index}`}\n center={{ latitude: c.latitude, longitude: c.longitude }}\n strokeColor={c.color}\n fillColor={c.fillColor}\n radius={c.radius}\n strokeWidth={c.strokeWidth}\n />\n ))}\n </MapView>\n )\n }\n}\n\nexport default _Map\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AnimatedValueProps {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export interface MovableAreaProps {
|
|
6
|
+
direction: 'all' | 'vertical' | 'horizontal' | 'none';
|
|
7
|
+
x?: string | number;
|
|
8
|
+
y?: string | number;
|
|
9
|
+
onDragStart: () => void;
|
|
10
|
+
onDragEnd: () => void;
|
|
11
|
+
animation: boolean;
|
|
12
|
+
onMove: (value: AnimatedValueProps) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
style?: Record<string, any>;
|
|
15
|
+
children: any;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/MovableArea/PropsType.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/MovableArea/PropsType.tsx"],"names":[],"mappings":"","sourcesContent":["export interface AnimatedValueProps {\n x: number\n y: number\n}\n\nexport interface MovableAreaProps {\n // movable-view 的移动方向,属性值有all、vertical、horizontal、none\n direction: 'all' | 'vertical' | 'horizontal' | 'none'\n // 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画\n x?: string | number\n // 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画\n y?: string | number\n onDragStart: () => void\n onDragEnd: () => void\n animation: boolean\n onMove: (value: AnimatedValueProps) => void\n disabled?: boolean\n style?: Record<string, any>\n children: any\n width?: number\n height?: number\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
3
|
+
import { MovableAreaProps } from './PropsType';
|
|
4
|
+
declare class _MovableArea extends React.Component<MovableAreaProps, any> {
|
|
5
|
+
static defaultProps: {};
|
|
6
|
+
constructor(props: MovableAreaProps);
|
|
7
|
+
_onLayout: (event: LayoutChangeEvent) => void;
|
|
8
|
+
render(): React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export default _MovableArea;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
class _MovableArea extends React.Component {
|
|
@@ -18,7 +19,7 @@ class _MovableArea extends React.Component {
|
|
|
18
19
|
render() {
|
|
19
20
|
const { style } = this.props;
|
|
20
21
|
const { width, height } = this.state;
|
|
21
|
-
return
|
|
22
|
+
return _jsx(View, { style: [{ height, width, overflow: 'hidden' }, style], testID: 'moveableArea', onLayout: this._onLayout, children: React.cloneElement(this.props.children, { layout: { width, height } }) });
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
_MovableArea.defaultProps = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MovableArea/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAqB,IAAI,EAAE,MAAM,cAAc,CAAA;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I,GAAG;YAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG;SACjC,CAAA;IACH,CAAC;IAUD,MAAM;QACJ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC5B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QACpC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,YAC/G,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,GAClE,CAAA;IACT,CAAC;;AAvBM,yBAAY,GAAG,EAAE,AAAL,CAAK;AA0B1B,eAAe,YAAY,CAAA","sourcesContent":["import * as React from 'react'\nimport { LayoutChangeEvent, View } from 'react-native'\n\nimport { MovableAreaProps } from './PropsType'\n\nclass _MovableArea extends React.Component<MovableAreaProps, any> {\n static defaultProps = {}\n constructor(props: MovableAreaProps) {\n super(props)\n this.state = {\n width: this.props.width || 100,\n height: this.props.height || 100,\n }\n }\n\n _onLayout = (event: LayoutChangeEvent): void => {\n const { width, height } = event.nativeEvent.layout\n this.setState({\n width,\n height,\n })\n }\n\n render(): React.ReactNode {\n const { style } = this.props\n const { width, height } = this.state\n return <View style={[{ height, width, overflow: 'hidden' }, style]} testID='moveableArea' onLayout={this._onLayout}>\n {React.cloneElement(this.props.children, { layout: { width, height } })}\n </View>\n }\n}\n\nexport default _MovableArea\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface AnimatedValueProps {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
interface onChangeEventDetail {
|
|
6
|
+
/** X 坐标 */
|
|
7
|
+
x: number;
|
|
8
|
+
/** Y 坐标 */
|
|
9
|
+
y: number;
|
|
10
|
+
/** 事件 */
|
|
11
|
+
source: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MovableViewProps {
|
|
14
|
+
direction: 'all' | 'vertical' | 'horizontal' | 'none';
|
|
15
|
+
x?: string | number;
|
|
16
|
+
y?: string | number;
|
|
17
|
+
onDragStart?: () => void;
|
|
18
|
+
onDragEnd?: () => void;
|
|
19
|
+
onChange?: (e: onChangeEventDetail) => void;
|
|
20
|
+
animation: boolean;
|
|
21
|
+
onMove: (value: AnimatedValueProps) => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
style?: Record<string, any>;
|
|
24
|
+
layout: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/MovableView/PropsType.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PropsType.js","sourceRoot":"","sources":["../../../src/components/MovableView/PropsType.tsx"],"names":[],"mappings":"","sourcesContent":["\nexport interface AnimatedValueProps {\n x: number\n y: number\n}\n\ninterface onChangeEventDetail {\n /** X 坐标 */\n x: number\n\n /** Y 坐标 */\n y: number\n\n /** 事件 */\n source: string\n}\nexport interface MovableViewProps {\n // movable-view 的移动方向,属性值有all、vertical、horizontal、none\n direction: 'all' | 'vertical' | 'horizontal' | 'none'\n // 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画\n x?: string | number\n // 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画\n y?: string | number\n onDragStart?: () => void\n onDragEnd?: () => void\n onChange?: (e: onChangeEventDetail) => void\n animation: boolean\n onMove: (value: AnimatedValueProps) => void\n disabled?: boolean\n style?: Record<string, any>\n layout: {\n width: number\n height: number\n }\n children?: React.ReactNode\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
3
|
+
import { MovableViewProps } from './PropsType';
|
|
4
|
+
declare class _MovableView extends React.Component<MovableViewProps, any> {
|
|
5
|
+
static defaultProps: {
|
|
6
|
+
direction: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
animation: boolean;
|
|
9
|
+
};
|
|
10
|
+
panResponder: any;
|
|
11
|
+
$ref: any;
|
|
12
|
+
W: any;
|
|
13
|
+
H: any;
|
|
14
|
+
constructor(props: MovableViewProps);
|
|
15
|
+
createPanResponder: () => void;
|
|
16
|
+
componentDidMount(): void;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
_onLayout: (event: LayoutChangeEvent) => void;
|
|
19
|
+
render(): React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export default _MovableView;
|