@aks-dev/easyui 1.0.190 → 1.0.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +23 -41
  2. package/dist/components/Badge/Badge.js +7 -16
  3. package/dist/components/DottedLine/DottedLine.js +15 -20
  4. package/dist/components/Echarts/EchartsView.js +40 -77
  5. package/dist/components/Echarts/demo.js +201 -0
  6. package/dist/components/Echarts/helper.js +1 -16
  7. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +49 -64
  8. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +30 -34
  9. package/dist/components/Hud/AlertView/AlertView.js +52 -66
  10. package/dist/components/Hud/Hud.js +8 -19
  11. package/dist/components/Hud/Loading/Loading.js +7 -25
  12. package/dist/components/Hud/PopoverView/PopoverView.js +5 -20
  13. package/dist/components/Hud/Scanner/Scanner.js +71 -99
  14. package/dist/components/Hud/Toast/Toast.js +6 -16
  15. package/dist/components/MenuView/MenuView.js +32 -73
  16. package/dist/components/Modal/Modal.js +0 -7
  17. package/dist/components/MutiPictureView/MutiPictureView.js +78 -88
  18. package/dist/components/PictureViewer/PictureViewer.js +11 -32
  19. package/dist/components/RefreshList/RefreshList.js +43 -52
  20. package/dist/components/RefreshList/demo.js +9 -0
  21. package/dist/components/RefreshList/demo1.js +27 -0
  22. package/dist/components/RefreshList/demo2.js +9 -0
  23. package/dist/components/RichText/RichText.js +23 -23
  24. package/dist/components/StickHeaderView/StickHeaderView.js +2 -12
  25. package/dist/components/StickHeaderView/demo.js +37 -0
  26. package/dist/components/TableCell/TableCell.js +37 -53
  27. package/dist/components/TextInputArea/TextInputArea.js +22 -31
  28. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
  29. package/dist/index.js +0 -11
  30. package/dist/jsbridge/RNEasyui.js +1 -26
  31. package/dist/jsbridge/UpgradeModule.js +12 -21
  32. package/dist/jsbridge/index.js +0 -7
  33. package/dist/screen/index.js +0 -8
  34. package/dist/screen/px2dp.js +2 -25
  35. package/dist/screen/px2sp.js +5 -35
  36. package/dist/screen/text-fit.js +5 -21
  37. package/dist/utils/index.js +0 -7
  38. package/dist/utils/lazy.js +19 -71
  39. package/dist/utils/mode.js +0 -21
  40. package/package.json +3 -7
  41. package/types/components/AnimationModal/AnimationModal.d.ts +0 -8
  42. package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  43. package/types/components/Echarts/demo.d.ts +4 -0
  44. package/types/components/Echarts/demo.d.ts.map +1 -0
  45. package/types/components/Echarts/helper.d.ts +0 -5
  46. package/types/components/Echarts/helper.d.ts.map +1 -1
  47. package/types/components/MutiPictureView/MutiPictureView.d.ts +0 -9
  48. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
  49. package/types/components/RefreshList/demo.d.ts +2 -0
  50. package/types/components/RefreshList/demo.d.ts.map +1 -0
  51. package/types/components/RefreshList/demo1.d.ts +2 -0
  52. package/types/components/RefreshList/demo1.d.ts.map +1 -0
  53. package/types/components/RefreshList/demo2.d.ts +2 -0
  54. package/types/components/RefreshList/demo2.d.ts.map +1 -0
  55. package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
  56. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
  57. package/types/components/StickHeaderView/demo.d.ts +4 -0
  58. package/types/components/StickHeaderView/demo.d.ts.map +1 -0
  59. package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
  60. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
  61. package/types/jsbridge/RNEasyui.d.ts +0 -18
  62. package/types/jsbridge/RNEasyui.d.ts.map +1 -1
  63. package/types/jsbridge/UpgradeModule.d.ts +0 -15
  64. package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
  65. package/types/screen/px2dp.d.ts +0 -11
  66. package/types/screen/px2dp.d.ts.map +1 -1
  67. package/types/screen/text-fit.d.ts +0 -3
  68. package/types/screen/text-fit.d.ts.map +1 -1
  69. package/types/utils/lazy.d.ts +0 -33
  70. package/types/utils/lazy.d.ts.map +1 -1
  71. package/types/utils/mode.d.ts +0 -14
  72. package/types/utils/mode.d.ts.map +1 -1
@@ -1,3 +1,12 @@
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
+ };
1
10
  import * as React from "react";
2
11
  import { View, Text, StyleSheet, Platform, StatusBar, TouchableOpacity, Dimensions, } from "react-native";
3
12
  import Modal from "react-native-modal";
@@ -13,16 +22,16 @@ export default React.forwardRef((_, ref) => {
13
22
  const cancelCallbackRef = React.useRef(undefined);
14
23
  const confirmCallbackRef = React.useRef(undefined);
15
24
  React.useImperativeHandle(ref, () => ({
16
- show: async (options) => {
25
+ show: (options) => __awaiter(void 0, void 0, void 0, function* () {
17
26
  setState(Object.assign({}, defaultState, { visible: true }, options));
18
27
  cancelCallbackRef.current = options.cancel;
19
28
  confirmCallbackRef.current = options.confirm;
20
- },
29
+ }),
21
30
  hide,
22
31
  }), []);
23
- const hide = async () => {
32
+ const hide = () => __awaiter(void 0, void 0, void 0, function* () {
24
33
  setState(defaultState);
25
- };
34
+ });
26
35
  React.useEffect(() => {
27
36
  if (Platform.OS == "android") {
28
37
  if (state.visible) {
@@ -35,69 +44,48 @@ export default React.forwardRef((_, ref) => {
35
44
  }
36
45
  }
37
46
  }, [state.visible]);
38
- return (<Modal hideModalContentWhileAnimating={true} //通过隐藏模态内容直到动画完成来增强性能
39
- useNativeDriver={true} //定义动画是否应使用本机驱动程序
40
- animationIn="slideInUp" animationOut="slideOutDown" onBackButtonPress={() => {
41
- //按下Android后退按钮时调用
47
+ return (React.createElement(Modal, { hideModalContentWhileAnimating: true, useNativeDriver: true, animationIn: "slideInUp", animationOut: "slideOutDown", onBackButtonPress: () => {
42
48
  hide();
43
- }} onBackdropPress={() => {
44
- //按下背景时调用
49
+ }, onBackdropPress: () => {
45
50
  hide();
46
- }} isVisible={state.visible} style={{ margin: 0 }} deviceHeight={Dimensions.get("screen").height}>
47
- <View style={styles.container}>
48
- <View style={[styles.wrapper, state.wrapperStyle]}>
49
- {state.title && <Text style={styles.titleText}>{state.title}</Text>}
50
- <View style={[state.contentContainerStyle]}>
51
- {(() => {
52
- if (typeof state.content == "string")
53
- return <Text style={styles.contentText}>{state.content}</Text>;
54
- if (React.isValidElement(state.content))
55
- return state.content;
56
- return <View />;
57
- })()}
58
- </View>
59
- {(state.cancelText || state.confirmText) && (<View style={styles.action}>
60
- {state.cancelText && (<TouchableOpacity style={[
61
- styles.cancel,
62
- { marginRight: state.confirmText ? px2dp(15) : 0 },
63
- state.cancelContainerStyle,
64
- ]} activeOpacity={0.8} onPress={() => {
65
- hide();
66
- cancelCallbackRef.current && cancelCallbackRef.current();
67
- cancelCallbackRef.current = undefined;
68
- }}>
69
- <Text style={[styles.cancelText, state.cancelTextStyle]}>
70
- {state.cancelText}
71
- </Text>
72
- </TouchableOpacity>)}
73
-
74
- {state.confirmText && (<TouchableOpacity style={[
75
- styles.confirm,
76
- { marginLeft: state.cancelText ? px2dp(15) : 0 },
77
- state.confirmContainerStyle,
78
- ]} activeOpacity={0.8} onPress={() => {
79
- hide();
80
- confirmCallbackRef.current && confirmCallbackRef.current();
81
- confirmCallbackRef.current = undefined;
82
- }}>
83
- <Text style={[styles.confirmText, state.confirmTextStyle]}>
84
- {state.confirmText}
85
- </Text>
86
- </TouchableOpacity>)}
87
- </View>)}
88
- </View>
89
- </View>
90
- </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)))))))));
91
83
  });
92
84
  export const alertBottomViewRef = React.createRef();
93
85
  export const showAlertBottomModal = (props) => {
94
- alertBottomViewRef.current?.show(props);
86
+ var _a;
87
+ (_a = alertBottomViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
95
88
  };
96
- // const sleep = (msec?: number) => {
97
- // return new Promise(resolve => {
98
- // setTimeout(resolve, msec || 350);
99
- // });
100
- // }
101
89
  const styles = StyleSheet.create({
102
90
  container: {
103
91
  display: "flex",
@@ -120,7 +108,6 @@ const styles = StyleSheet.create({
120
108
  maxWidth: deviceWidth - px2dp(30),
121
109
  fontSize: px2sp(18),
122
110
  marginBottom: px2dp(20),
123
- // backgroundColor: 'red',
124
111
  textAlign: "center",
125
112
  fontWeight: "bold",
126
113
  color: "#1A1A1A",
@@ -133,7 +120,6 @@ const styles = StyleSheet.create({
133
120
  flexShrink: 1,
134
121
  width: undefined,
135
122
  fontSize: px2sp(15),
136
- // backgroundColor: 'red',
137
123
  color: "#1A1A1A",
138
124
  textAlign: "center",
139
125
  },
@@ -142,7 +128,6 @@ const styles = StyleSheet.create({
142
128
  flexDirection: "row",
143
129
  justifyContent: "space-between",
144
130
  alignItems: "center",
145
- // backgroundColor:"red"
146
131
  },
147
132
  cancel: {
148
133
  width: "40%",
@@ -1,23 +1,33 @@
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
+ };
1
10
  import * as React from "react";
2
11
  import { Dimensions, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View, } from "react-native";
3
12
  import Modal from "react-native-modal";
4
13
  import { px2dp } from "../../../screen/px2dp";
5
14
  import { px2sp } from "../../../screen/px2sp";
6
15
  export default React.forwardRef((_, ref) => {
16
+ var _a;
7
17
  const defaultState = {
8
18
  visible: false,
9
19
  actions: [],
10
20
  };
11
21
  const [state, setState] = React.useState(defaultState);
12
22
  React.useImperativeHandle(ref, () => ({
13
- show: async (options) => {
23
+ show: (options) => __awaiter(void 0, void 0, void 0, function* () {
14
24
  setState(Object.assign({}, defaultState, { visible: true }, options));
15
- },
25
+ }),
16
26
  hide,
17
27
  }), []);
18
- const hide = async () => {
28
+ const hide = () => __awaiter(void 0, void 0, void 0, function* () {
19
29
  setState(defaultState);
20
- };
30
+ });
21
31
  React.useEffect(() => {
22
32
  if (Platform.OS == "android") {
23
33
  if (state.visible) {
@@ -30,40 +40,27 @@ export default React.forwardRef((_, ref) => {
30
40
  }
31
41
  }
32
42
  }, [state.visible]);
33
- return (<Modal hideModalContentWhileAnimating={true} //通过隐藏模态内容直到动画完成来增强性能
34
- useNativeDriver={true} //定义动画是否应使用本机驱动程序
35
- animationIn="slideInUp" animationOut="slideOutDown" onBackButtonPress={() => {
36
- //按下Android后退按钮时调用
37
- hide();
38
- }} onBackdropPress={() => {
39
- //按下背景时调用
43
+ return (React.createElement(Modal, { hideModalContentWhileAnimating: true, useNativeDriver: true, animationIn: "slideInUp", animationOut: "slideOutDown", onBackButtonPress: () => {
40
44
  hide();
41
- }} isVisible={state.visible} deviceHeight={Dimensions.get("screen").height} style={{ margin: 0 }}>
42
- <View style={styles.container}>
43
- <View style={[styles.wrapper]}>
44
- <View style={styles.itemContainer}>
45
- {state.actions?.map((i, idx) => (<TouchableOpacity key={`sg-action-${idx}`} style={[styles.item]} activeOpacity={1} onPress={() => {
46
- hide();
47
- i.onClick && i.onClick();
48
- }}>
49
- <Text style={[styles.itemText, { color: i.color }]} numberOfLines={2}>
50
- {i.text}
51
- </Text>
52
- </TouchableOpacity>))}
53
- </View>
54
-
55
- <TouchableOpacity style={[styles.cancel]} activeOpacity={1} onPress={() => {
45
+ }, onBackdropPress: () => {
56
46
  hide();
57
- }}>
58
- <Text style={[styles.cancelText]}>取消</Text>
59
- </TouchableOpacity>
60
- </View>
61
- </View>
62
- </Modal>);
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"))))));
63
59
  });
64
60
  export const alertSheetViewRef = React.createRef();
65
61
  export const showAlertSheetModal = (props) => {
66
- alertSheetViewRef.current?.show(props);
62
+ var _a;
63
+ (_a = alertSheetViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
67
64
  };
68
65
  const styles = StyleSheet.create({
69
66
  container: {
@@ -76,7 +73,6 @@ const styles = StyleSheet.create({
76
73
  flexGrow: 0,
77
74
  flexShrink: 0,
78
75
  width: "100%",
79
- // backgroundColor: 'pink',
80
76
  overflow: "hidden",
81
77
  borderTopLeftRadius: px2dp(10),
82
78
  borderTopRightRadius: px2dp(10),
@@ -1,3 +1,12 @@
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
+ };
1
10
  import * as React from "react";
2
11
  import { View, Text, StyleSheet, Platform, Modal, StatusBar, TouchableOpacity, Animated, Easing, } from "react-native";
3
12
  import { px2dp, deviceWidth } from "../../../screen/px2dp";
@@ -12,20 +21,18 @@ export default React.forwardRef((_, ref) => {
12
21
  const cancelCallbackRef = React.useRef(undefined);
13
22
  const confirmCallbackRef = React.useRef(undefined);
14
23
  React.useImperativeHandle(ref, () => ({
15
- show: async (options) => {
24
+ show: (options) => __awaiter(void 0, void 0, void 0, function* () {
16
25
  setState(Object.assign({}, defaultState, { visible: true }, options));
17
26
  cancelCallbackRef.current = options.cancel;
18
27
  confirmCallbackRef.current = options.confirm;
19
- // await sleep(50)
20
28
  startAnimate(1);
21
- },
29
+ }),
22
30
  hide,
23
31
  }), []);
24
- const hide = async () => {
32
+ const hide = () => __awaiter(void 0, void 0, void 0, function* () {
25
33
  startAnimate(0.3);
26
- // await sleep(50)
27
34
  setState(defaultState);
28
- };
35
+ });
29
36
  let scale_anim = React.useRef(new Animated.Value(0.3)).current;
30
37
  const startAnimate = (x) => {
31
38
  Animated.timing(scale_anim, {
@@ -47,66 +54,49 @@ export default React.forwardRef((_, ref) => {
47
54
  }
48
55
  }
49
56
  }, [state.visible]);
50
- return (<Modal visible={state.visible} transparent animationType="fade" onRequestClose={() => {
51
- // hide()
52
- }}>
53
- <View style={styles.container}>
54
- <Animated.View style={[
55
- styles.wrapper,
56
- state.wrapperStyle,
57
- { transform: [{ scale: scale_anim }] },
58
- ]}>
59
- {state.title && <Text style={styles.titleText}>{state.title}</Text>}
60
- {(() => {
61
- if (typeof state.content == "string")
62
- return <Text style={styles.contentText}>{state.content}</Text>;
63
- if (React.isValidElement(state.content))
64
- return state.content;
65
- return <View />;
66
- })()}
67
-
68
- {(state.cancelText || state.confirmText) && (<View style={styles.action}>
69
- {state.cancelText && (<TouchableOpacity style={[
70
- styles.cancel,
71
- { marginRight: state.confirmText ? px2dp(15) : 0 },
72
- state.cancelContainerStyle,
73
- ]} activeOpacity={0.8} disabled={state.cancelDisabled} onPress={() => {
74
- hide();
75
- cancelCallbackRef.current && cancelCallbackRef.current();
76
- cancelCallbackRef.current = undefined;
77
- }}>
78
- <Text style={[styles.cancelText, state.cancelTextStyle]}>
79
- {state.cancelText}
80
- </Text>
81
- </TouchableOpacity>)}
82
-
83
- {state.confirmText && (<TouchableOpacity style={[
84
- styles.confirm,
85
- { marginLeft: state.cancelText ? px2dp(15) : 0 },
86
- state.confirmContainerStyle,
87
- ]} activeOpacity={0.8} onPress={() => {
88
- hide();
89
- confirmCallbackRef.current && confirmCallbackRef.current();
90
- confirmCallbackRef.current = undefined;
91
- }}>
92
- <Text style={[styles.confirmText, state.confirmTextStyle]}>
93
- {state.confirmText}
94
- </Text>
95
- </TouchableOpacity>)}
96
- </View>)}
97
- </Animated.View>
98
- </View>
99
- </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)))))))));
100
94
  });
101
95
  export const alertViewRef = React.createRef();
102
96
  export const showAlertModal = (props) => {
103
- alertViewRef.current?.show(props);
97
+ var _a;
98
+ (_a = alertViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
104
99
  };
105
- // const sleep = (msec?: number) => {
106
- // return new Promise(resolve => {
107
- // setTimeout(resolve, msec || 350);
108
- // });
109
- // }
110
100
  const styles = StyleSheet.create({
111
101
  container: {
112
102
  display: "flex",
@@ -118,7 +108,6 @@ const styles = StyleSheet.create({
118
108
  wrapper: {
119
109
  flexGrow: 0,
120
110
  flexShrink: 0,
121
- // minWidth: '70%',
122
111
  minWidth: deviceWidth - px2dp(60),
123
112
  backgroundColor: "white",
124
113
  overflow: "hidden",
@@ -130,7 +119,6 @@ const styles = StyleSheet.create({
130
119
  maxWidth: deviceWidth - px2dp(90),
131
120
  fontSize: px2sp(18),
132
121
  marginBottom: px2dp(20),
133
- // backgroundColor: 'red',
134
122
  textAlign: "center",
135
123
  fontWeight: "bold",
136
124
  color: "#1A1A1A",
@@ -143,7 +131,6 @@ const styles = StyleSheet.create({
143
131
  flexShrink: 1,
144
132
  width: undefined,
145
133
  fontSize: px2sp(15),
146
- // backgroundColor: 'red',
147
134
  color: "#1A1A1A",
148
135
  textAlign: "center",
149
136
  },
@@ -152,7 +139,6 @@ const styles = StyleSheet.create({
152
139
  flexDirection: "row",
153
140
  justifyContent: "space-between",
154
141
  alignItems: "center",
155
- // backgroundColor:"red"
156
142
  },
157
143
  cancel: {
158
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
- // ...StyleSheet.absoluteFillObject,
19
- // display: 'flex',
20
- }, [
21
- <Loading key="hud-0" ref={loadingRef}/>,
22
- <Toast key="hud-1" ref={toastRef}/>,
23
- <AlertView key="hud-2" ref={alertViewRef}/>,
24
- <AlertBottomView key="hud-3-0" ref={alertBottomViewRef}/>,
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,27 +18,17 @@ export const Loading = React.forwardRef((_, ref) => {
26
18
  }), [show]);
27
19
  if (!show)
28
20
  return null;
29
- return (<TouchableOpacity disabled style={styles.container}>
30
- <View style={styles.warpper}>
31
- <ActivityIndicator color="white" size="large"/>
32
- <Text numberOfLines={5} style={styles.title}>
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
- export const showLoading = (content) => loadingRef.current?.showLoading(content);
40
- export const hideLoading = () => loadingRef.current?.hideLoading();
27
+ export const showLoading = (content) => { var _a; return (_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.showLoading(content); };
28
+ export const hideLoading = () => { var _a; return (_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.hideLoading(); };
41
29
  const SCREEN_WIDTH = Dimensions.get("window").width;
42
30
  const styles = StyleSheet.create({
43
- container: {
44
- ...StyleSheet.absoluteFill,
45
- display: "flex",
46
- justifyContent: "center",
47
- alignItems: "center",
48
- // backgroundColor:'red'
49
- },
31
+ container: Object.assign(Object.assign({}, StyleSheet.absoluteFill), { display: "flex", justifyContent: "center", alignItems: "center" }),
50
32
  warpper: {
51
33
  backgroundColor: "#00000088",
52
34
  padding: 40,
@@ -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,21 +19,14 @@ export const PopoverView = React.forwardRef((_, ref) => {
27
19
  }), [visible]);
28
20
  if (!visible)
29
21
  return null;
30
- return (<TouchableOpacity activeOpacity={1} style={[styles.container, options?.style]} disabled={options?.disabled} onPress={(e) => {
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
- // e.stopPropagation()
34
- }}>
35
- {React.isValidElement(options?.content) && 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
- export const showPopoverView = (options) => popoverViewRef.current?.showPopoverView(options);
40
- export const hidePopoverView = () => popoverViewRef.current?.hidePopoverView();
28
+ export const showPopoverView = (options) => { var _a; return (_a = popoverViewRef.current) === null || _a === void 0 ? void 0 : _a.showPopoverView(options); };
29
+ export const hidePopoverView = () => { var _a; return (_a = popoverViewRef.current) === null || _a === void 0 ? void 0 : _a.hidePopoverView(); };
41
30
  const styles = StyleSheet.create({
42
- container: {
43
- ...StyleSheet.absoluteFill,
44
- display: "flex",
45
- // backgroundColor:'red'
46
- },
31
+ container: Object.assign(Object.assign({}, StyleSheet.absoluteFill), { display: "flex" }),
47
32
  });