@aks-dev/easyui 1.0.194 → 1.0.195
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.
Potentially problematic release.
This version of @aks-dev/easyui might be problematic. Click here for more details.
- package/dist/components/AnimationModal/AnimationModal.js +15 -36
- package/dist/components/Badge/Badge.js +7 -16
- package/dist/components/DottedLine/DottedLine.js +14 -13
- package/dist/components/Echarts/EchartsView.js +30 -73
- package/dist/components/Echarts/demo.js +201 -0
- package/dist/components/Echarts/helper.js +1 -16
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +43 -60
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +23 -30
- package/dist/components/Hud/AlertView/AlertView.js +46 -62
- package/dist/components/Hud/Hud.js +8 -19
- package/dist/components/Hud/Loading/Loading.js +4 -16
- package/dist/components/Hud/PopoverView/PopoverView.js +2 -13
- package/dist/components/Hud/Scanner/Scanner.js +55 -86
- package/dist/components/Hud/Toast/Toast.js +5 -15
- package/dist/components/MenuView/MenuView.js +33 -61
- package/dist/components/Modal/Modal.js +0 -7
- package/dist/components/MutiPictureView/MutiPictureView.js +27 -47
- package/dist/components/PictureViewer/PictureViewer.js +8 -24
- package/dist/components/RefreshList/RefreshList.js +41 -52
- package/dist/components/RefreshList/demo.js +9 -0
- package/dist/components/RefreshList/demo1.js +27 -0
- package/dist/components/RefreshList/demo2.js +9 -0
- package/dist/components/RichText/RichText.js +21 -22
- package/dist/components/StickHeaderView/StickHeaderView.js +2 -12
- package/dist/components/StickHeaderView/demo.js +37 -0
- package/dist/components/TableCell/TableCell.js +37 -51
- package/dist/components/TextInputArea/TextInputArea.js +21 -28
- package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
- package/dist/index.js +0 -11
- package/dist/jsbridge/RNEasyui.js +0 -25
- package/dist/jsbridge/UpgradeModule.js +9 -19
- package/dist/jsbridge/index.js +0 -7
- package/dist/screen/index.js +0 -8
- package/dist/screen/px2dp.js +2 -25
- package/dist/screen/px2sp.js +5 -35
- package/dist/screen/text-fit.js +2 -13
- package/dist/utils/index.js +0 -7
- package/dist/utils/lazy.js +12 -67
- package/dist/utils/mode.js +0 -21
- package/package.json +2 -1
- package/types/components/AnimationModal/AnimationModal.d.ts +0 -8
- package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
- package/types/components/Echarts/demo.d.ts +4 -0
- package/types/components/Echarts/demo.d.ts.map +1 -0
- package/types/components/Echarts/helper.d.ts +0 -5
- package/types/components/Echarts/helper.d.ts.map +1 -1
- package/types/components/MutiPictureView/MutiPictureView.d.ts +0 -9
- package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
- package/types/components/RefreshList/demo.d.ts +2 -0
- package/types/components/RefreshList/demo.d.ts.map +1 -0
- package/types/components/RefreshList/demo1.d.ts +2 -0
- package/types/components/RefreshList/demo1.d.ts.map +1 -0
- package/types/components/RefreshList/demo2.d.ts +2 -0
- package/types/components/RefreshList/demo2.d.ts.map +1 -0
- package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
- package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
- package/types/components/StickHeaderView/demo.d.ts +4 -0
- package/types/components/StickHeaderView/demo.d.ts.map +1 -0
- package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
- package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
- package/types/jsbridge/RNEasyui.d.ts +0 -18
- package/types/jsbridge/RNEasyui.d.ts.map +1 -1
- package/types/jsbridge/UpgradeModule.d.ts +0 -15
- package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
- package/types/screen/px2dp.d.ts +0 -11
- package/types/screen/px2dp.d.ts.map +1 -1
- package/types/screen/text-fit.d.ts +0 -3
- package/types/screen/text-fit.d.ts.map +1 -1
- package/types/utils/lazy.d.ts +0 -33
- package/types/utils/lazy.d.ts.map +1 -1
- package/types/utils/mode.d.ts +0 -14
- package/types/utils/mode.d.ts.map +1 -1
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
2
10
|
import * as React from "react";
|
|
3
11
|
import { View, Text, StyleSheet, Platform, StatusBar, TouchableOpacity, Dimensions, } from "react-native";
|
|
4
12
|
import Modal from "react-native-modal";
|
|
@@ -36,70 +44,48 @@ export default React.forwardRef((_, ref) => {
|
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
46
|
}, [state.visible]);
|
|
39
|
-
return (
|
|
40
|
-
useNativeDriver={true} //定义动画是否应使用本机驱动程序
|
|
41
|
-
animationIn="slideInUp" animationOut="slideOutDown" onBackButtonPress={() => {
|
|
42
|
-
//按下Android后退按钮时调用
|
|
47
|
+
return (React.createElement(Modal, { hideModalContentWhileAnimating: true, useNativeDriver: true, animationIn: "slideInUp", animationOut: "slideOutDown", onBackButtonPress: () => {
|
|
43
48
|
hide();
|
|
44
|
-
}
|
|
45
|
-
//按下背景时调用
|
|
49
|
+
}, onBackdropPress: () => {
|
|
46
50
|
hide();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
]} activeOpacity={0.8} onPress={() => {
|
|
80
|
-
hide();
|
|
81
|
-
confirmCallbackRef.current && confirmCallbackRef.current();
|
|
82
|
-
confirmCallbackRef.current = undefined;
|
|
83
|
-
}}>
|
|
84
|
-
<Text style={[styles.confirmText, state.confirmTextStyle]}>
|
|
85
|
-
{state.confirmText}
|
|
86
|
-
</Text>
|
|
87
|
-
</TouchableOpacity>)}
|
|
88
|
-
</View>)}
|
|
89
|
-
</View>
|
|
90
|
-
</View>
|
|
91
|
-
</Modal>);
|
|
51
|
+
}, isVisible: state.visible, style: { margin: 0 }, deviceHeight: Dimensions.get("screen").height },
|
|
52
|
+
React.createElement(View, { style: styles.container },
|
|
53
|
+
React.createElement(View, { style: [styles.wrapper, state.wrapperStyle] },
|
|
54
|
+
state.title && React.createElement(Text, { style: styles.titleText }, state.title),
|
|
55
|
+
React.createElement(View, { style: [state.contentContainerStyle] }, (() => {
|
|
56
|
+
if (typeof state.content == "string")
|
|
57
|
+
return React.createElement(Text, { style: styles.contentText }, state.content);
|
|
58
|
+
if (React.isValidElement(state.content))
|
|
59
|
+
return state.content;
|
|
60
|
+
return React.createElement(View, null);
|
|
61
|
+
})()),
|
|
62
|
+
(state.cancelText || state.confirmText) && (React.createElement(View, { style: styles.action },
|
|
63
|
+
state.cancelText && (React.createElement(TouchableOpacity, { style: [
|
|
64
|
+
styles.cancel,
|
|
65
|
+
{ marginRight: state.confirmText ? px2dp(15) : 0 },
|
|
66
|
+
state.cancelContainerStyle,
|
|
67
|
+
], activeOpacity: 0.8, onPress: () => {
|
|
68
|
+
hide();
|
|
69
|
+
cancelCallbackRef.current && cancelCallbackRef.current();
|
|
70
|
+
cancelCallbackRef.current = undefined;
|
|
71
|
+
} },
|
|
72
|
+
React.createElement(Text, { style: [styles.cancelText, state.cancelTextStyle] }, state.cancelText))),
|
|
73
|
+
state.confirmText && (React.createElement(TouchableOpacity, { style: [
|
|
74
|
+
styles.confirm,
|
|
75
|
+
{ marginLeft: state.cancelText ? px2dp(15) : 0 },
|
|
76
|
+
state.confirmContainerStyle,
|
|
77
|
+
], activeOpacity: 0.8, onPress: () => {
|
|
78
|
+
hide();
|
|
79
|
+
confirmCallbackRef.current && confirmCallbackRef.current();
|
|
80
|
+
confirmCallbackRef.current = undefined;
|
|
81
|
+
} },
|
|
82
|
+
React.createElement(Text, { style: [styles.confirmText, state.confirmTextStyle] }, state.confirmText)))))))));
|
|
92
83
|
});
|
|
93
84
|
export const alertBottomViewRef = React.createRef();
|
|
94
85
|
export const showAlertBottomModal = (props) => {
|
|
95
86
|
var _a;
|
|
96
87
|
(_a = alertBottomViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
|
|
97
88
|
};
|
|
98
|
-
// const sleep = (msec?: number) => {
|
|
99
|
-
// return new Promise(resolve => {
|
|
100
|
-
// setTimeout(resolve, msec || 350);
|
|
101
|
-
// });
|
|
102
|
-
// }
|
|
103
89
|
const styles = StyleSheet.create({
|
|
104
90
|
container: {
|
|
105
91
|
display: "flex",
|
|
@@ -122,7 +108,6 @@ const styles = StyleSheet.create({
|
|
|
122
108
|
maxWidth: deviceWidth - px2dp(30),
|
|
123
109
|
fontSize: px2sp(18),
|
|
124
110
|
marginBottom: px2dp(20),
|
|
125
|
-
// backgroundColor: 'red',
|
|
126
111
|
textAlign: "center",
|
|
127
112
|
fontWeight: "bold",
|
|
128
113
|
color: "#1A1A1A",
|
|
@@ -135,7 +120,6 @@ const styles = StyleSheet.create({
|
|
|
135
120
|
flexShrink: 1,
|
|
136
121
|
width: undefined,
|
|
137
122
|
fontSize: px2sp(15),
|
|
138
|
-
// backgroundColor: 'red',
|
|
139
123
|
color: "#1A1A1A",
|
|
140
124
|
textAlign: "center",
|
|
141
125
|
},
|
|
@@ -144,7 +128,6 @@ const styles = StyleSheet.create({
|
|
|
144
128
|
flexDirection: "row",
|
|
145
129
|
justifyContent: "space-between",
|
|
146
130
|
alignItems: "center",
|
|
147
|
-
// backgroundColor:"red"
|
|
148
131
|
},
|
|
149
132
|
cancel: {
|
|
150
133
|
width: "40%",
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
2
10
|
import * as React from "react";
|
|
3
11
|
import { Dimensions, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View, } from "react-native";
|
|
4
12
|
import Modal from "react-native-modal";
|
|
@@ -32,36 +40,22 @@ export default React.forwardRef((_, ref) => {
|
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
}, [state.visible]);
|
|
35
|
-
return (
|
|
36
|
-
useNativeDriver={true} //定义动画是否应使用本机驱动程序
|
|
37
|
-
animationIn="slideInUp" animationOut="slideOutDown" onBackButtonPress={() => {
|
|
38
|
-
//按下Android后退按钮时调用
|
|
39
|
-
hide();
|
|
40
|
-
}} onBackdropPress={() => {
|
|
41
|
-
//按下背景时调用
|
|
43
|
+
return (React.createElement(Modal, { hideModalContentWhileAnimating: true, useNativeDriver: true, animationIn: "slideInUp", animationOut: "slideOutDown", onBackButtonPress: () => {
|
|
42
44
|
hide();
|
|
43
|
-
}
|
|
44
|
-
<View style={styles.container}>
|
|
45
|
-
<View style={[styles.wrapper]}>
|
|
46
|
-
<View style={styles.itemContainer}>
|
|
47
|
-
{(_a = state.actions) === null || _a === void 0 ? void 0 : _a.map((i, idx) => (<TouchableOpacity key={`sg-action-${idx}`} style={[styles.item]} activeOpacity={1} onPress={() => {
|
|
48
|
-
hide();
|
|
49
|
-
i.onClick && i.onClick();
|
|
50
|
-
}}>
|
|
51
|
-
<Text style={[styles.itemText, { color: i.color }]} numberOfLines={2}>
|
|
52
|
-
{i.text}
|
|
53
|
-
</Text>
|
|
54
|
-
</TouchableOpacity>))}
|
|
55
|
-
</View>
|
|
56
|
-
|
|
57
|
-
<TouchableOpacity style={[styles.cancel]} activeOpacity={1} onPress={() => {
|
|
45
|
+
}, onBackdropPress: () => {
|
|
58
46
|
hide();
|
|
59
|
-
}}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
}, isVisible: state.visible, deviceHeight: Dimensions.get("screen").height, style: { margin: 0 } },
|
|
48
|
+
React.createElement(View, { style: styles.container },
|
|
49
|
+
React.createElement(View, { style: [styles.wrapper] },
|
|
50
|
+
React.createElement(View, { style: styles.itemContainer }, (_a = state.actions) === null || _a === void 0 ? void 0 : _a.map((i, idx) => (React.createElement(TouchableOpacity, { key: `sg-action-${idx}`, style: [styles.item], activeOpacity: 1, onPress: () => {
|
|
51
|
+
hide();
|
|
52
|
+
i.onClick && i.onClick();
|
|
53
|
+
} },
|
|
54
|
+
React.createElement(Text, { style: [styles.itemText, { color: i.color }], numberOfLines: 2 }, i.text))))),
|
|
55
|
+
React.createElement(TouchableOpacity, { style: [styles.cancel], activeOpacity: 1, onPress: () => {
|
|
56
|
+
hide();
|
|
57
|
+
} },
|
|
58
|
+
React.createElement(Text, { style: [styles.cancelText] }, "\u53D6\u6D88"))))));
|
|
65
59
|
});
|
|
66
60
|
export const alertSheetViewRef = React.createRef();
|
|
67
61
|
export const showAlertSheetModal = (props) => {
|
|
@@ -79,7 +73,6 @@ const styles = StyleSheet.create({
|
|
|
79
73
|
flexGrow: 0,
|
|
80
74
|
flexShrink: 0,
|
|
81
75
|
width: "100%",
|
|
82
|
-
// backgroundColor: 'pink',
|
|
83
76
|
overflow: "hidden",
|
|
84
77
|
borderTopLeftRadius: px2dp(10),
|
|
85
78
|
borderTopRightRadius: px2dp(10),
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
2
10
|
import * as React from "react";
|
|
3
11
|
import { View, Text, StyleSheet, Platform, Modal, StatusBar, TouchableOpacity, Animated, Easing, } from "react-native";
|
|
4
12
|
import { px2dp, deviceWidth } from "../../../screen/px2dp";
|
|
@@ -17,14 +25,12 @@ export default React.forwardRef((_, ref) => {
|
|
|
17
25
|
setState(Object.assign({}, defaultState, { visible: true }, options));
|
|
18
26
|
cancelCallbackRef.current = options.cancel;
|
|
19
27
|
confirmCallbackRef.current = options.confirm;
|
|
20
|
-
// await sleep(50)
|
|
21
28
|
startAnimate(1);
|
|
22
29
|
}),
|
|
23
30
|
hide,
|
|
24
31
|
}), []);
|
|
25
32
|
const hide = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
33
|
startAnimate(0.3);
|
|
27
|
-
// await sleep(50)
|
|
28
34
|
setState(defaultState);
|
|
29
35
|
});
|
|
30
36
|
let scale_anim = React.useRef(new Animated.Value(0.3)).current;
|
|
@@ -48,67 +54,49 @@ export default React.forwardRef((_, ref) => {
|
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
}, [state.visible]);
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
]} activeOpacity={0.8} onPress={() => {
|
|
89
|
-
hide();
|
|
90
|
-
confirmCallbackRef.current && confirmCallbackRef.current();
|
|
91
|
-
confirmCallbackRef.current = undefined;
|
|
92
|
-
}}>
|
|
93
|
-
<Text style={[styles.confirmText, state.confirmTextStyle]}>
|
|
94
|
-
{state.confirmText}
|
|
95
|
-
</Text>
|
|
96
|
-
</TouchableOpacity>)}
|
|
97
|
-
</View>)}
|
|
98
|
-
</Animated.View>
|
|
99
|
-
</View>
|
|
100
|
-
</Modal>);
|
|
57
|
+
return (React.createElement(Modal, { visible: state.visible, transparent: true, animationType: "fade", onRequestClose: () => {
|
|
58
|
+
} },
|
|
59
|
+
React.createElement(View, { style: styles.container },
|
|
60
|
+
React.createElement(Animated.View, { style: [
|
|
61
|
+
styles.wrapper,
|
|
62
|
+
state.wrapperStyle,
|
|
63
|
+
{ transform: [{ scale: scale_anim }] },
|
|
64
|
+
] },
|
|
65
|
+
state.title && React.createElement(Text, { style: styles.titleText }, state.title),
|
|
66
|
+
(() => {
|
|
67
|
+
if (typeof state.content == "string")
|
|
68
|
+
return React.createElement(Text, { style: styles.contentText }, state.content);
|
|
69
|
+
if (React.isValidElement(state.content))
|
|
70
|
+
return state.content;
|
|
71
|
+
return React.createElement(View, null);
|
|
72
|
+
})(),
|
|
73
|
+
(state.cancelText || state.confirmText) && (React.createElement(View, { style: styles.action },
|
|
74
|
+
state.cancelText && (React.createElement(TouchableOpacity, { style: [
|
|
75
|
+
styles.cancel,
|
|
76
|
+
{ marginRight: state.confirmText ? px2dp(15) : 0 },
|
|
77
|
+
state.cancelContainerStyle,
|
|
78
|
+
], activeOpacity: 0.8, disabled: state.cancelDisabled, onPress: () => {
|
|
79
|
+
hide();
|
|
80
|
+
cancelCallbackRef.current && cancelCallbackRef.current();
|
|
81
|
+
cancelCallbackRef.current = undefined;
|
|
82
|
+
} },
|
|
83
|
+
React.createElement(Text, { style: [styles.cancelText, state.cancelTextStyle] }, state.cancelText))),
|
|
84
|
+
state.confirmText && (React.createElement(TouchableOpacity, { style: [
|
|
85
|
+
styles.confirm,
|
|
86
|
+
{ marginLeft: state.cancelText ? px2dp(15) : 0 },
|
|
87
|
+
state.confirmContainerStyle,
|
|
88
|
+
], activeOpacity: 0.8, onPress: () => {
|
|
89
|
+
hide();
|
|
90
|
+
confirmCallbackRef.current && confirmCallbackRef.current();
|
|
91
|
+
confirmCallbackRef.current = undefined;
|
|
92
|
+
} },
|
|
93
|
+
React.createElement(Text, { style: [styles.confirmText, state.confirmTextStyle] }, state.confirmText)))))))));
|
|
101
94
|
});
|
|
102
95
|
export const alertViewRef = React.createRef();
|
|
103
96
|
export const showAlertModal = (props) => {
|
|
104
97
|
var _a;
|
|
105
98
|
(_a = alertViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
|
|
106
99
|
};
|
|
107
|
-
// const sleep = (msec?: number) => {
|
|
108
|
-
// return new Promise(resolve => {
|
|
109
|
-
// setTimeout(resolve, msec || 350);
|
|
110
|
-
// });
|
|
111
|
-
// }
|
|
112
100
|
const styles = StyleSheet.create({
|
|
113
101
|
container: {
|
|
114
102
|
display: "flex",
|
|
@@ -120,7 +108,6 @@ const styles = StyleSheet.create({
|
|
|
120
108
|
wrapper: {
|
|
121
109
|
flexGrow: 0,
|
|
122
110
|
flexShrink: 0,
|
|
123
|
-
// minWidth: '70%',
|
|
124
111
|
minWidth: deviceWidth - px2dp(60),
|
|
125
112
|
backgroundColor: "white",
|
|
126
113
|
overflow: "hidden",
|
|
@@ -132,7 +119,6 @@ const styles = StyleSheet.create({
|
|
|
132
119
|
maxWidth: deviceWidth - px2dp(90),
|
|
133
120
|
fontSize: px2sp(18),
|
|
134
121
|
marginBottom: px2dp(20),
|
|
135
|
-
// backgroundColor: 'red',
|
|
136
122
|
textAlign: "center",
|
|
137
123
|
fontWeight: "bold",
|
|
138
124
|
color: "#1A1A1A",
|
|
@@ -145,7 +131,6 @@ const styles = StyleSheet.create({
|
|
|
145
131
|
flexShrink: 1,
|
|
146
132
|
width: undefined,
|
|
147
133
|
fontSize: px2sp(15),
|
|
148
|
-
// backgroundColor: 'red',
|
|
149
134
|
color: "#1A1A1A",
|
|
150
135
|
textAlign: "center",
|
|
151
136
|
},
|
|
@@ -154,7 +139,6 @@ const styles = StyleSheet.create({
|
|
|
154
139
|
flexDirection: "row",
|
|
155
140
|
justifyContent: "space-between",
|
|
156
141
|
alignItems: "center",
|
|
157
|
-
// backgroundColor:"red"
|
|
158
142
|
},
|
|
159
143
|
cancel: {
|
|
160
144
|
width: "40%",
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-24 14:10:04
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-23 11:13:55
|
|
6
|
-
* @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/Hud.tsx
|
|
7
|
-
*/
|
|
8
1
|
import * as React from 'react';
|
|
9
|
-
// import { StyleSheet } from 'react-native'
|
|
10
2
|
import { alertViewRef, default as AlertView, showAlertModal } from './AlertView/AlertView';
|
|
11
3
|
import { alertBottomViewRef, default as AlertBottomView, showAlertBottomModal } from './AlertBottomView/AlertBottomView';
|
|
12
4
|
import { alertSheetViewRef, default as AlertSheetView, showAlertSheetModal } from './AlertSheetView/AlertSheetView';
|
|
@@ -14,16 +6,13 @@ import { hideLoading, Loading, loadingRef, showLoading } from './Loading/Loading
|
|
|
14
6
|
import { showToast, Toast, toastRef } from './Toast/Toast';
|
|
15
7
|
import { showPopoverView, hidePopoverView, popoverViewRef, PopoverView } from './PopoverView/PopoverView';
|
|
16
8
|
import { showScanner, hideScanner, scannerRef, Scanner } from './Scanner/Scanner';
|
|
17
|
-
export const Hud = () => React.cloneElement(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<AlertSheetView key="hud-3-1" ref={alertSheetViewRef}/>,
|
|
26
|
-
<PopoverView key="hud-4" ref={popoverViewRef}/>,
|
|
27
|
-
<Scanner key="hud-5" ref={scannerRef}/>,
|
|
9
|
+
export const Hud = () => React.cloneElement(React.createElement(React.Fragment, null), {}, [
|
|
10
|
+
React.createElement(Loading, { key: "hud-0", ref: loadingRef }),
|
|
11
|
+
React.createElement(Toast, { key: "hud-1", ref: toastRef }),
|
|
12
|
+
React.createElement(AlertView, { key: "hud-2", ref: alertViewRef }),
|
|
13
|
+
React.createElement(AlertBottomView, { key: "hud-3-0", ref: alertBottomViewRef }),
|
|
14
|
+
React.createElement(AlertSheetView, { key: "hud-3-1", ref: alertSheetViewRef }),
|
|
15
|
+
React.createElement(PopoverView, { key: "hud-4", ref: popoverViewRef }),
|
|
16
|
+
React.createElement(Scanner, { key: "hud-5", ref: scannerRef }),
|
|
28
17
|
]);
|
|
29
18
|
export { showAlertModal, showToast, showLoading, hideLoading, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, };
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-24 14:27:02
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-09-09 10:55:48
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/Hud/Loading/Loading.tsx
|
|
7
|
-
*/
|
|
8
1
|
import React, { useImperativeHandle, useState } from "react";
|
|
9
2
|
import { View, ActivityIndicator, StyleSheet, Text, Dimensions, TouchableOpacity, BackHandler, } from "react-native";
|
|
10
3
|
export const Loading = React.forwardRef((_, ref) => {
|
|
@@ -13,7 +6,6 @@ export const Loading = React.forwardRef((_, ref) => {
|
|
|
13
6
|
React.useEffect(() => {
|
|
14
7
|
const onBackPress = () => show;
|
|
15
8
|
BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
|
16
|
-
// return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
|
|
17
9
|
}, [show]);
|
|
18
10
|
useImperativeHandle(ref, () => ({
|
|
19
11
|
showLoading: (content) => {
|
|
@@ -26,14 +18,10 @@ export const Loading = React.forwardRef((_, ref) => {
|
|
|
26
18
|
}), [show]);
|
|
27
19
|
if (!show)
|
|
28
20
|
return null;
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{tipText}
|
|
34
|
-
</Text>
|
|
35
|
-
</View>
|
|
36
|
-
</TouchableOpacity>);
|
|
21
|
+
return (React.createElement(TouchableOpacity, { disabled: true, style: styles.container },
|
|
22
|
+
React.createElement(View, { style: styles.warpper },
|
|
23
|
+
React.createElement(ActivityIndicator, { color: "white", size: "large" }),
|
|
24
|
+
React.createElement(Text, { numberOfLines: 5, style: styles.title }, tipText))));
|
|
37
25
|
});
|
|
38
26
|
export const loadingRef = React.createRef();
|
|
39
27
|
export const showLoading = (content) => { var _a; return (_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.showLoading(content); };
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-24 14:27:02
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-12-21 15:36:06
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
|
|
7
|
-
*/
|
|
8
1
|
import React, { useImperativeHandle, useState } from "react";
|
|
9
2
|
import { StyleSheet, TouchableOpacity, BackHandler, } from "react-native";
|
|
10
3
|
export const PopoverView = React.forwardRef((_, ref) => {
|
|
@@ -13,7 +6,6 @@ export const PopoverView = React.forwardRef((_, ref) => {
|
|
|
13
6
|
React.useEffect(() => {
|
|
14
7
|
const onBackPress = () => visible;
|
|
15
8
|
BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
|
16
|
-
// return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
|
|
17
9
|
}, [visible]);
|
|
18
10
|
useImperativeHandle(ref, () => ({
|
|
19
11
|
showPopoverView: (options) => {
|
|
@@ -27,13 +19,10 @@ export const PopoverView = React.forwardRef((_, ref) => {
|
|
|
27
19
|
}), [visible]);
|
|
28
20
|
if (!visible)
|
|
29
21
|
return null;
|
|
30
|
-
return (
|
|
22
|
+
return (React.createElement(TouchableOpacity, { activeOpacity: 1, style: [styles.container, options === null || options === void 0 ? void 0 : options.style], disabled: options === null || options === void 0 ? void 0 : options.disabled, onPress: (e) => {
|
|
31
23
|
setVisible(false);
|
|
32
24
|
setOptions(undefined);
|
|
33
|
-
|
|
34
|
-
}}>
|
|
35
|
-
{React.isValidElement(options === null || options === void 0 ? void 0 : options.content) && (options === null || options === void 0 ? void 0 : options.content)}
|
|
36
|
-
</TouchableOpacity>);
|
|
25
|
+
} }, React.isValidElement(options === null || options === void 0 ? void 0 : options.content) && (options === null || options === void 0 ? void 0 : options.content)));
|
|
37
26
|
});
|
|
38
27
|
export const popoverViewRef = React.createRef();
|
|
39
28
|
export const showPopoverView = (options) => { var _a; return (_a = popoverViewRef.current) === null || _a === void 0 ? void 0 : _a.showPopoverView(options); };
|