@aks-dev/easyui 1.0.163 → 1.1.5

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 (176) hide show
  1. package/dist/components/AnimationModal/AnimationModal.d.ts +27 -0
  2. package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -0
  3. package/dist/components/AnimationModal/AnimationModal.js +151 -0
  4. package/dist/components/Badge/Badge.d.ts +8 -0
  5. package/dist/components/Badge/Badge.d.ts.map +1 -0
  6. package/dist/components/Badge/Badge.js +35 -0
  7. package/dist/components/DottedLine/DottedLine.d.ts +10 -0
  8. package/dist/components/DottedLine/DottedLine.d.ts.map +1 -0
  9. package/dist/components/DottedLine/DottedLine.js +50 -0
  10. package/dist/components/EchartsView/EchartsView.d.ts +10 -0
  11. package/dist/components/EchartsView/EchartsView.d.ts.map +1 -0
  12. package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
  13. package/dist/components/EchartsView/helper.d.ts +10 -0
  14. package/dist/components/EchartsView/helper.d.ts.map +1 -0
  15. package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
  16. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
  17. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
  18. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
  19. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
  20. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
  21. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
  22. package/dist/components/Hud/AlertView/AlertView.d.ts +25 -0
  23. package/dist/components/Hud/AlertView/AlertView.d.ts.map +1 -0
  24. package/dist/components/Hud/AlertView/AlertView.js +184 -0
  25. package/dist/components/Hud/Hud.d.ts +11 -0
  26. package/dist/components/Hud/Hud.d.ts.map +1 -0
  27. package/dist/components/Hud/Hud.js +29 -0
  28. package/dist/components/Hud/Loading/Loading.d.ts +11 -0
  29. package/dist/components/Hud/Loading/Loading.d.ts.map +1 -0
  30. package/dist/components/Hud/Loading/Loading.js +66 -0
  31. package/dist/components/Hud/PopoverView/PopoverView.d.ts +17 -0
  32. package/dist/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
  33. package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
  34. package/dist/components/Hud/Scanner/Scanner.d.ts +12 -0
  35. package/dist/components/Hud/Scanner/Scanner.d.ts.map +1 -0
  36. package/dist/components/Hud/Scanner/Scanner.js +301 -0
  37. package/dist/components/Hud/Toast/Toast.d.ts +9 -0
  38. package/dist/components/Hud/Toast/Toast.d.ts.map +1 -0
  39. package/dist/components/Hud/Toast/Toast.js +71 -0
  40. package/dist/components/MenuView/MenuView.d.ts +21 -0
  41. package/dist/components/MenuView/MenuView.d.ts.map +1 -0
  42. package/dist/components/MenuView/MenuView.js +184 -0
  43. package/dist/components/Modal/Modal.d.ts +2 -0
  44. package/dist/components/Modal/Modal.d.ts.map +1 -0
  45. package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
  46. package/{lib/MutiPictureView/index.ts → dist/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
  47. package/dist/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
  48. package/dist/components/MutiPictureView/MutiPictureView.js +243 -0
  49. package/dist/components/PictureViewer/PictureViewer.d.ts +17 -0
  50. package/dist/components/PictureViewer/PictureViewer.d.ts.map +1 -0
  51. package/dist/components/PictureViewer/PictureViewer.js +54 -0
  52. package/dist/components/RefreshList/RefreshList.d.ts +45 -0
  53. package/dist/components/RefreshList/RefreshList.d.ts.map +1 -0
  54. package/dist/components/RefreshList/RefreshList.js +155 -0
  55. package/dist/components/RichText/RichText.d.ts +12 -0
  56. package/dist/components/RichText/RichText.d.ts.map +1 -0
  57. package/dist/components/RichText/RichText.js +56 -0
  58. package/dist/components/StickHeaderView/StickHeaderView.d.ts +15 -0
  59. package/dist/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
  60. package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
  61. package/{lib/TableCell/index.ts → dist/components/TableCell/TableCell.d.ts} +8 -30
  62. package/dist/components/TableCell/TableCell.d.ts.map +1 -0
  63. package/dist/components/TableCell/TableCell.js +97 -0
  64. package/dist/components/TextInputArea/TextInputArea.d.ts +17 -0
  65. package/dist/components/TextInputArea/TextInputArea.d.ts.map +1 -0
  66. package/dist/components/TextInputArea/TextInputArea.js +65 -0
  67. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
  68. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
  69. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
  70. package/dist/index.d.ts +23 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +32 -0
  73. package/dist/jsbridge/RNEasyui.d.ts +23 -0
  74. package/dist/jsbridge/RNEasyui.d.ts.map +1 -0
  75. package/dist/jsbridge/RNEasyui.js +46 -0
  76. package/dist/jsbridge/UpgradeModule.d.ts +26 -0
  77. package/dist/jsbridge/UpgradeModule.d.ts.map +1 -0
  78. package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
  79. package/dist/jsbridge/index.d.ts +3 -0
  80. package/dist/jsbridge/index.d.ts.map +1 -0
  81. package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
  82. package/dist/screen/index.d.ts +3 -0
  83. package/dist/screen/index.d.ts.map +1 -0
  84. package/{screen/index.ts → dist/screen/index.js} +2 -2
  85. package/{screen/index.d.ts → dist/screen/px2dp.d.ts} +6 -12
  86. package/dist/screen/px2dp.d.ts.map +1 -0
  87. package/dist/screen/px2dp.js +45 -0
  88. package/dist/screen/px2sp.d.ts +2 -0
  89. package/dist/screen/px2sp.d.ts.map +1 -0
  90. package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
  91. package/dist/screen/text-fit.d.ts +5 -0
  92. package/dist/screen/text-fit.d.ts.map +1 -0
  93. package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
  94. package/dist/utils/index.d.ts +3 -0
  95. package/dist/utils/index.d.ts.map +1 -0
  96. package/{utils/index.ts → dist/utils/index.js} +2 -2
  97. package/{utils/index.d.ts → dist/utils/lazy.d.ts} +15 -53
  98. package/dist/utils/lazy.d.ts.map +1 -0
  99. package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
  100. package/dist/utils/mode.d.ts +24 -0
  101. package/dist/utils/mode.d.ts.map +1 -0
  102. package/dist/utils/mode.js +50 -0
  103. package/package.json +32 -22
  104. package/readme.md +3 -3
  105. package/android/.DS_Store +0 -0
  106. package/android/src/.DS_Store +0 -0
  107. package/android/src/main/.DS_Store +0 -0
  108. package/android/src/main/java/.DS_Store +0 -0
  109. package/android/src/main/java/com/.DS_Store +0 -0
  110. package/android/src/main/java/com/easyui/.DS_Store +0 -0
  111. package/i.sh +0 -23
  112. package/ios/.DS_Store +0 -0
  113. package/ios/assets/.DS_Store +0 -0
  114. package/ios/views/.DS_Store +0 -0
  115. package/jsbridge/RNEasyui.ts +0 -42
  116. package/jsbridge/index.d.ts +0 -67
  117. package/lib/.DS_Store +0 -0
  118. package/lib/AnimationModal/AnimationModal.tsx +0 -201
  119. package/lib/AnimationModal/index.d.ts +0 -41
  120. package/lib/Badge/Badge.tsx +0 -40
  121. package/lib/Badge/index.ts +0 -21
  122. package/lib/DottedLine/DottedLine.tsx +0 -66
  123. package/lib/DottedLine/index.ts +0 -18
  124. package/lib/Echarts/demo.tsx +0 -235
  125. package/lib/Echarts/index.ts +0 -29
  126. package/lib/Hud/.DS_Store +0 -0
  127. package/lib/Hud/AlertBottomView/AlertBottomView.tsx +0 -228
  128. package/lib/Hud/AlertBottomView/index.d.ts +0 -42
  129. package/lib/Hud/AlertSheetView/AlertSheetView.tsx +0 -179
  130. package/lib/Hud/AlertSheetView/index.d.ts +0 -35
  131. package/lib/Hud/AlertView/AlertView.tsx +0 -234
  132. package/lib/Hud/AlertView/index.d.ts +0 -46
  133. package/lib/Hud/Hud.tsx +0 -67
  134. package/lib/Hud/Loading/Loading.tsx +0 -87
  135. package/lib/Hud/Loading/index.d.ts +0 -38
  136. package/lib/Hud/PopoverView/PopoverView.tsx +0 -66
  137. package/lib/Hud/PopoverView/index.d.ts +0 -39
  138. package/lib/Hud/Scanner/Scanner.tsx +0 -250
  139. package/lib/Hud/Scanner/index.d.ts +0 -42
  140. package/lib/Hud/Toast/Toast.tsx +0 -86
  141. package/lib/Hud/Toast/index.d.ts +0 -22
  142. package/lib/Hud/index.ts +0 -20
  143. package/lib/MenuView/MenuView.tsx +0 -252
  144. package/lib/MenuView/index.ts +0 -31
  145. package/lib/Modal/index.ts +0 -10
  146. package/lib/MutiPictureView/MutiPictureView.tsx +0 -259
  147. package/lib/PictureViewer/PictureViewer.tsx +0 -80
  148. package/lib/PictureViewer/index.ts +0 -26
  149. package/lib/RefreshList/RefreshList.tsx +0 -235
  150. package/lib/RefreshList/demo.tsx +0 -30
  151. package/lib/RefreshList/demo1.tsx +0 -60
  152. package/lib/RefreshList/demo2.tsx +0 -46
  153. package/lib/RefreshList/index.ts +0 -84
  154. package/lib/RichText/RichText.tsx +0 -82
  155. package/lib/RichText/index.ts +0 -21
  156. package/lib/StickHeaderView/StickHeaderView.tsx +0 -65
  157. package/lib/StickHeaderView/demo.tsx +0 -104
  158. package/lib/StickHeaderView/index.ts +0 -26
  159. package/lib/TableCell/TableCell.tsx +0 -118
  160. package/lib/TextInputArea/TextInputArea.tsx +0 -89
  161. package/lib/TextInputArea/index.d.ts +0 -33
  162. package/lib/WithLoadingContainer/WithLoadingContainer.tsx +0 -93
  163. package/lib/WithLoadingContainer/index.ts +0 -36
  164. package/screen/px2dp.ts +0 -51
  165. package/src/index.d.ts +0 -42
  166. package/src/index.ts +0 -54
  167. package/utils/mode.ts +0 -48
  168. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-blue.png +0 -0
  169. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-white.png +0 -0
  170. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/icon_back_white.png +0 -0
  171. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_add_image.png +0 -0
  172. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_del_image.png +0 -0
  173. /package/{lib/TableCell → dist/components/TableCell/assets}/back.png +0 -0
  174. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading.gif +0 -0
  175. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading3.gif +0 -0
  176. /package/{lib → dist/components}/index.md +0 -0
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { ColorValue } from "react-native";
3
+ export type AnimationModalProps = {
4
+ children: React.ReactNode;
5
+ /**
6
+ * 动画方向,默认 'from-bottom'
7
+ * center-in 动画暂未实现
8
+ * @deprecated
9
+ */
10
+ animationType?: "from-bottom" | "center-in";
11
+ /**
12
+ * 是否有遮罩,默认没有
13
+ */
14
+ mask?: boolean;
15
+ style?: {
16
+ backgroundColor?: ColorValue | undefined;
17
+ };
18
+ };
19
+ type RefAttributes = {
20
+ show: () => RefAttributes;
21
+ hide: () => RefAttributes;
22
+ setData: (data?: any) => RefAttributes;
23
+ getData: () => any;
24
+ };
25
+ export declare const AnimationModal: React.ForwardRefExoticComponent<React.PropsWithoutRef<AnimationModalProps> & React.RefAttributes<RefAttributes>>;
26
+ export {};
27
+ //# sourceMappingURL=AnimationModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimationModal.d.ts","sourceRoot":"","sources":["../../../src/components/AnimationModal/AnimationModal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;KAC1C,CAAC;CACH,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,aAAa,CAAC;IACvC,OAAO,EAAE,MAAM,GAAG,CAAC;CACpB,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAC1D,KAAK,CAAC,eAAe,CAAC,mBAAmB,CAAC,GACxC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAkIpC,CAAC"}
@@ -0,0 +1,151 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-05-17 15:22:06
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2023-09-27 15:17:15
6
+ * @FilePath: /@aks-dev/easyui/lib/AnimationModal/AnimationModal.tsx
7
+ */
8
+ import * as React from "react";
9
+ import { View, Animated, Easing, PanResponder, StyleSheet, useWindowDimensions, BackHandler, } from "react-native";
10
+ import * as utils from "../../utils/lazy";
11
+ // type State = {
12
+ // display: 'flex' | 'none';
13
+ // }
14
+ // type StateReducerProps = (state: State, action: Partial<State>) => State
15
+ export const AnimationModal = React.forwardRef((props, ref) => {
16
+ const { animationType = "from-bottom", mask = false } = props || {};
17
+ const { height } = useWindowDimensions();
18
+ // const [state, dispatch] = React.useReducer<StateReducerProps>(
19
+ // (state, action) => ({ ...state, ...action }),
20
+ // {
21
+ // display: 'none'
22
+ // })
23
+ const [display, setDisplay] = useCallbackState("none");
24
+ const animatedValue = React.useRef(new Animated.Value(0)).current;
25
+ const timing = (value) => {
26
+ Animated.timing(animatedValue, {
27
+ toValue: value,
28
+ duration: 350,
29
+ useNativeDriver: true,
30
+ easing: Easing.ease,
31
+ }).start(({ finished }) => {
32
+ /* 动画完成的回调函数 */
33
+ });
34
+ };
35
+ const viewRef = React.useRef(null);
36
+ const layoutRef = React.useRef({ h0: 0, h1: 0 });
37
+ const getLayoutPromise = () => {
38
+ return new Promise((resovle, reject) => {
39
+ viewRef.current?.measure((...args) => {
40
+ if (args.length == 6) {
41
+ layoutRef.current.h1 = args[3];
42
+ }
43
+ resovle(args);
44
+ });
45
+ });
46
+ };
47
+ const init = React.useCallback(() => ({ show, hide, setData, getData }), []);
48
+ React.useImperativeHandle(ref, init, []);
49
+ const dataRef = React.useRef(null);
50
+ const setData = (data) => {
51
+ dataRef.current = data;
52
+ return init();
53
+ };
54
+ const getData = () => dataRef.current;
55
+ const show = () => {
56
+ setDisplay("flex", async () => {
57
+ await utils.sleep(50);
58
+ await getLayoutPromise();
59
+ timing(-layoutRef.current?.h1);
60
+ });
61
+ return init();
62
+ };
63
+ const hide = () => {
64
+ timing(0);
65
+ setTimeout(() => {
66
+ setDisplay("none");
67
+ }, 300);
68
+ return init();
69
+ };
70
+ React.useEffect(() => {
71
+ let addEventListener = BackHandler.addEventListener("hardwareBackPress", () => {
72
+ return display == "flex";
73
+ });
74
+ return () => {
75
+ addEventListener.remove();
76
+ };
77
+ }, [display]);
78
+ return (<View style={Object.assign({
79
+ display: display,
80
+ }, styles.container, props.style)} {...PanResponder.create({
81
+ onStartShouldSetPanResponder: (e, gestureState) => {
82
+ let pageY = e.nativeEvent.pageY;
83
+ let topY = height - layoutRef.current.h1;
84
+ if (pageY <= topY && !mask) {
85
+ return true;
86
+ }
87
+ return false;
88
+ },
89
+ onPanResponderGrant: (e, gestureState) => {
90
+ // console.log({e})
91
+ let pageY = e.nativeEvent.pageY;
92
+ let topY = height - layoutRef.current.h1;
93
+ if (pageY <= topY && !mask) {
94
+ e.stopPropagation();
95
+ hide();
96
+ }
97
+ },
98
+ }).panHandlers}>
99
+ <Animated.View style={Object.assign({}, styles.wrapper, {
100
+ transform: [{ translateY: animatedValue }],
101
+ })}
102
+ // onLayout={e => {
103
+ // let target: LayoutRectangle = e.nativeEvent.layout
104
+ // layoutRef.current.h1 = target.height
105
+ // }}
106
+ ref={viewRef}>
107
+ {props.children}
108
+ </Animated.View>
109
+ </View>);
110
+ });
111
+ const styles = StyleSheet.create({
112
+ container: {
113
+ position: "absolute",
114
+ left: 0,
115
+ right: 0,
116
+ top: 0,
117
+ bottom: 0,
118
+ zIndex: 999,
119
+ // display: 'flex',
120
+ flexDirection: "column",
121
+ backgroundColor: "#00000055",
122
+ overflow: "hidden",
123
+ },
124
+ wrapper: {
125
+ position: "absolute",
126
+ display: "flex",
127
+ flexDirection: "column",
128
+ // backgroundColor: 'pink',
129
+ width: "100%",
130
+ top: "100%",
131
+ },
132
+ empty: {
133
+ flex: 1,
134
+ position: "relative",
135
+ // backgroundColor: 'cyan'
136
+ },
137
+ });
138
+ const useCallbackState = (od) => {
139
+ const cbRef = React.useRef(undefined);
140
+ const [data, setData] = React.useState(od);
141
+ React.useEffect(() => {
142
+ cbRef.current && cbRef.current(data);
143
+ }, [data]);
144
+ return [
145
+ data,
146
+ (d, callback) => {
147
+ cbRef.current = callback;
148
+ setData(d);
149
+ },
150
+ ];
151
+ };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ export type BadgeProps = {
4
+ count: number | string;
5
+ style?: StyleProp<ViewStyle>;
6
+ };
7
+ export declare const Badge: React.FC<BadgeProps>;
8
+ //# sourceMappingURL=Badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIhE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA4BtC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-21 14:40:29
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-07-08 15:40:21
6
+ * @FilePath: /@aks-dev/easyui/lib/Badge/Badge.tsx
7
+ */
8
+ import React from "react";
9
+ import { View, Text } from "react-native";
10
+ import { px2dp } from "../../screen/px2dp";
11
+ import { px2sp } from "../../screen/px2sp";
12
+ export const Badge = (props) => {
13
+ if (isNaN(+props.count) || Number(props.count) == 0)
14
+ return <View />;
15
+ return (<View style={[
16
+ {
17
+ flexGrow: 0,
18
+ flexShrink: 1,
19
+ zIndex: 1,
20
+ // paddingHorizontal: px2dp(0),
21
+ height: px2dp(16),
22
+ minWidth: px2dp(16),
23
+ borderRadius: px2dp(8),
24
+ justifyContent: "center",
25
+ alignItems: "center",
26
+ backgroundColor: "red",
27
+ },
28
+ props.style,
29
+ ]}>
30
+ <Text style={{ fontSize: px2sp(12), color: "white", textAlign: "center" }}>
31
+ {" "}
32
+ {Number(props.count) > 99 ? "+99" : props.count}{" "}
33
+ </Text>
34
+ </View>);
35
+ };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ViewProps } from "react-native";
3
+ export type DottedLineProps = {
4
+ vertical?: boolean;
5
+ dottedColor?: string;
6
+ dottedCount?: number;
7
+ } & ViewProps;
8
+ declare const _default: (props: DottedLineProps) => React.JSX.Element;
9
+ export default _default;
10
+ //# sourceMappingURL=DottedLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/components/DottedLine/DottedLine.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC;yBACE,OAAO,eAAe;AAAtC,wBAwBE"}
@@ -0,0 +1,50 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-07-12 15:30:19
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-07-12 15:33:06
6
+ * @FilePath: /@aks-dev/easyui/lib/DottedLine/DottedLine.tsx
7
+ */
8
+ import React from "react";
9
+ import { StyleSheet, View } from "react-native";
10
+ export default (props) => {
11
+ const { vertical = false, dottedColor, dottedCount = 200, ...rest } = props;
12
+ const arrs = Array.from({ length: dottedCount }, (k, v) => v);
13
+ return (<View style={{
14
+ ...styles.container,
15
+ flexDirection: vertical ? "column" : "row",
16
+ ...rest.style,
17
+ }}>
18
+ {arrs.map((item, index) => {
19
+ return (<View key={`dotted-${index}`} style={{
20
+ ...(vertical ? styles.dotted_vertical : styles.dotted_horizontal),
21
+ ...(dottedColor && { backgroundColor: dottedColor }),
22
+ }}/>);
23
+ })}
24
+ </View>);
25
+ };
26
+ const styles = StyleSheet.create({
27
+ container: {
28
+ display: "flex",
29
+ flexGrow: 1,
30
+ overflow: "hidden",
31
+ flexDirection: "row",
32
+ flexWrap: "nowrap",
33
+ },
34
+ dotted_horizontal: {
35
+ flexGrow: 0,
36
+ flexShrink: 0,
37
+ width: 2,
38
+ height: 1,
39
+ marginRight: 2,
40
+ backgroundColor: "#cccccc",
41
+ },
42
+ dotted_vertical: {
43
+ flexGrow: 0,
44
+ flexShrink: 0,
45
+ width: 1,
46
+ height: 2,
47
+ marginBottom: 2,
48
+ backgroundColor: "#cccccc",
49
+ },
50
+ });
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { ViewStyle, StyleProp } from "react-native";
3
+ export type EchartsViewProps = {
4
+ option: any;
5
+ style?: StyleProp<ViewStyle>;
6
+ renderLoading?: () => React.ReactElement;
7
+ };
8
+ declare const EchartsView: React.FC<EchartsViewProps>;
9
+ export default EchartsView;
10
+ //# sourceMappingURL=EchartsView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EchartsView.d.ts","sourceRoot":"","sources":["../../../src/components/EchartsView/EchartsView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;CAC1C,CAAC;AASF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiK3C,CAAC;AAUF,eAAe,WAAW,CAAC"}
@@ -5,39 +5,20 @@
5
5
  * @LastEditTime: 2023-01-03 17:50:43
6
6
  * @FilePath: /@aks-dev/easyui/lib/Echarts/EchartsView.tsx
7
7
  */
8
- import * as React from 'react'
9
- import { MeasureOnSuccessCallback, StyleSheet, View, ViewStyle } from 'react-native'
10
- import { WebView } from 'react-native-webview'
11
- import { EchartsViewProps } from '.'
12
- import { getHtml, toString } from './helper'
13
-
14
- type State = {
15
- width: number;
16
- height: number;
17
- isLoaded: boolean;
18
- }
19
-
20
-
21
- type Reducer = (prevState: State, action: Partial<State>) => State
22
-
23
-
24
- const EchartsView: React.FC<EchartsViewProps> = (props) => {
25
- const [state, dispatch] = React.useReducer<Reducer>(
26
- (prevState, action) => Object.assign({}, prevState, action),
27
- {
28
- width: 0,
29
- height: 0,
30
- isLoaded: false
31
- }
32
- )
33
- const WebViewRef: React.MutableRefObject<{ injectJavaScript: Function }> = React.useRef() as any
34
- const containerRef = React.useRef<{ measure: (callback: MeasureOnSuccessCallback) => void }>()
35
- const rootView = React.useRef<{
36
- pageX: number;
37
- pageY: number;
38
- height: number;
39
- width: number;
40
- }>({ pageX: 0, pageY: 0, width: 0, height: 0 })
8
+ import * as React from "react";
9
+ import { StyleSheet, View, } from "react-native";
10
+ import { WebView } from "react-native-webview";
11
+ import { getHtml, toString } from "./helper";
12
+ // type Reducer = (prevState: State, action: Partial<State>) => State;
13
+ const EchartsView = (props) => {
14
+ const [state, dispatch] = React.useReducer((prevState, ...args) => Object.assign({}, prevState, ...args), {
15
+ width: 0,
16
+ height: 0,
17
+ isLoaded: false,
18
+ });
19
+ const WebViewRef = React.useRef(null);
20
+ const containerRef = React.useRef(null);
21
+ const rootView = React.useRef({ pageX: 0, pageY: 0, width: 0, height: 0 });
41
22
  const getRootViewlayoutPromise = () => {
42
23
  return new Promise((resovle, reject) => {
43
24
  containerRef.current?.measure((...args) => {
@@ -47,21 +28,23 @@ const EchartsView: React.FC<EchartsViewProps> = (props) => {
47
28
  height: args[3],
48
29
  pageX: args[4],
49
30
  pageY: args[5],
50
- }
31
+ };
51
32
  }
52
33
  // console.log('RootView', rootView.current)
53
- resovle(args)
54
- })
55
- })
56
- }
57
-
58
-
34
+ resovle(args);
35
+ });
36
+ });
37
+ };
59
38
  React.useLayoutEffect(() => {
60
- ; (async () => {
39
+ (async () => {
61
40
  if (state.isLoaded) {
62
- await getRootViewlayoutPromise()
63
- let height = rootView.current.height ? `${rootView.current.height}px` : 'auto'
64
- let width = rootView.current.width ? `${rootView.current.width}px` : 'auto'
41
+ await getRootViewlayoutPromise();
42
+ let height = rootView.current.height
43
+ ? `${rootView.current.height}px`
44
+ : "auto";
45
+ let width = rootView.current.width
46
+ ? `${rootView.current.width}px`
47
+ : "auto";
65
48
  const run = `
66
49
  ;(function() {
67
50
  var instance = echarts.getInstanceByDom(document.getElementById('main'));
@@ -73,9 +56,8 @@ const EchartsView: React.FC<EchartsViewProps> = (props) => {
73
56
  instance.clear();
74
57
  instance.setOption(${toString(props.option)});
75
58
  })();
76
- `
59
+ `;
77
60
  WebViewRef.current?.injectJavaScript(run);
78
-
79
61
  return () => {
80
62
  const run = `
81
63
  ;(function() {
@@ -85,21 +67,15 @@ const EchartsView: React.FC<EchartsViewProps> = (props) => {
85
67
  instance.dispose();
86
68
  }
87
69
  })();
88
- `
89
-
70
+ `;
90
71
  WebViewRef.current?.injectJavaScript(run);
91
- }
72
+ };
92
73
  }
93
- return undefined
94
- })().catch(err => {
95
- console.log(err)
96
- })
97
-
98
-
99
- }, [props.option, state.isLoaded])
100
-
101
-
102
-
74
+ return undefined;
75
+ })().catch((err) => {
76
+ console.log(err);
77
+ });
78
+ }, [props.option, state.isLoaded]);
103
79
  // const injectedJavaScript = (): string => {
104
80
  // console.log('injectedJavaScript', props.option.xAxis.data)
105
81
  // let height = state.height ? `${state.height}px` : 'auto'
@@ -130,61 +106,46 @@ const EchartsView: React.FC<EchartsViewProps> = (props) => {
130
106
  // })();
131
107
  // `
132
108
  // }
133
-
134
-
135
-
136
- return (
137
- <View style={[styles.container, props.style]} ref={containerRef as any}>
138
- <WebView
139
- ref={WebViewRef as any}
140
- originWhitelist={['*']}
141
- useWebKit={true} // ios使用最新webkit内核渲染
142
- allowUniversalAccessFromFileURLs={true}
143
- geolocationEnabled={true}
144
- mixedContentMode={'always'}
145
- renderLoading={() => {
146
- if (props.renderLoading) return props.renderLoading()
147
- return <View style={{ backgroundColor: (props.style as ViewStyle)?.backgroundColor || 'transparent' }} />
148
- }} // 设置空View,修复ioswebview闪白
149
- style={{
150
- backgroundColor: (props.style as ViewStyle)?.backgroundColor || 'transparent',
151
- opacity: 0.99,//解决闪退的办法
152
- }} // 设置背景色透明,修复android闪白
153
- scrollEnabled={false}
154
- // onMessage={e=>{
155
- // console.log(e)
156
- // }}
157
- javaScriptEnabled={true}
158
- // injectedJavaScript={injectedJavaScript()}
159
- startInLoadingState={false}
160
- onLoadEnd={(_) => {
161
- dispatch({ isLoaded: true })
162
- // console.log('onLoadEnd')
163
- }}
164
- onError={e => {
165
- console.log('onError', e)
166
- }}
167
- source={{
168
- baseUrl: '',
169
- html: getHtml({ backgroundColor: (props.style as ViewStyle)?.backgroundColor || 'transparent' })
170
- }}
171
- />
172
- </View>
173
- )
174
-
175
- }
176
-
109
+ return (<View style={[styles.container, props.style]} ref={containerRef}>
110
+ <WebView ref={WebViewRef} originWhitelist={["*"]} useWebKit={true} // ios使用最新webkit内核渲染
111
+ allowUniversalAccessFromFileURLs={true} geolocationEnabled={true} mixedContentMode={"always"} renderLoading={() => {
112
+ if (props.renderLoading)
113
+ return props.renderLoading();
114
+ return (<View style={{
115
+ backgroundColor: props.style?.backgroundColor || "transparent",
116
+ }}/>);
117
+ }} // 设置空View,修复ioswebview闪白
118
+ style={{
119
+ backgroundColor: props.style?.backgroundColor || "transparent",
120
+ opacity: 0.99, //解决闪退的办法
121
+ }} // 设置背景色透明,修复android闪白
122
+ scrollEnabled={false}
123
+ // onMessage={e=>{
124
+ // console.log(e)
125
+ // }}
126
+ javaScriptEnabled={true}
127
+ // injectedJavaScript={injectedJavaScript()}
128
+ startInLoadingState={false} onLoadEnd={(_) => {
129
+ dispatch({ isLoaded: true });
130
+ // console.log('onLoadEnd')
131
+ }} onError={(e) => {
132
+ console.log("onError", e);
133
+ }} source={{
134
+ baseUrl: "",
135
+ html: getHtml({
136
+ backgroundColor: props.style?.backgroundColor || "transparent",
137
+ }),
138
+ }}/>
139
+ </View>);
140
+ };
177
141
  const styles = StyleSheet.create({
178
142
  container: {
179
- display: 'flex',
143
+ display: "flex",
180
144
  flexGrow: 0,
181
- backgroundColor: 'white'
182
- }
183
- })
184
-
185
-
186
-
187
-
188
-
189
- export default EchartsView
145
+ backgroundColor: "white",
146
+ },
147
+ });
148
+ export default EchartsView;
190
149
  // React.memo(EchartsView)
150
+ // import * as echarts from "echarts/core";
151
+ // export { echarts };
@@ -0,0 +1,10 @@
1
+ export declare const getHtml: (props: {
2
+ backgroundColor: any;
3
+ }) => string;
4
+ /**
5
+ * https://res.actiiot.com/echarts/5.0.2/echarts.min.js
6
+ *
7
+ * https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js
8
+ */
9
+ export declare const toString: (obj: object) => string;
10
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/components/EchartsView/helper.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,GAAI,OAAO;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,WAoCpD,CAAA;AAED;;;;GAIG;AAEH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,WAcnC,CAAA"}
@@ -5,9 +5,7 @@
5
5
  * @LastEditTime: 2023-01-03 17:02:57
6
6
  * @FilePath: /@aks-dev/easyui/lib/Echarts/helper.tsx
7
7
  */
8
-
9
-
10
- export const getHtml = (props: { backgroundColor: any }) => {
8
+ export const getHtml = (props) => {
11
9
  return `
12
10
  <!DOCTYPE html>
13
11
  <html>
@@ -42,30 +40,25 @@ export const getHtml = (props: { backgroundColor: any }) => {
42
40
  </body>
43
41
 
44
42
  </html>
45
- `
46
- }
47
-
48
- /**
49
- * https://res.actiiot.com/echarts/5.0.2/echarts.min.js
50
- *
51
- * https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js
52
- */
53
-
54
- export const toString = (obj: object) => {
43
+ `;
44
+ };
45
+ /**
46
+ * https://res.actiiot.com/echarts/5.0.2/echarts.min.js
47
+ *
48
+ * https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js
49
+ */
50
+ export const toString = (obj) => {
55
51
  let result = JSON.stringify(obj, function (key, val) {
56
- // 对function进行特殊处理
57
- if (typeof val === 'function') {
58
- return `~ha~${val}~ha~`;
59
- }
60
- return val;
52
+ // 对function进行特殊处理
53
+ if (typeof val === 'function') {
54
+ return `~ha~${val}~ha~`;
55
+ }
56
+ return val;
61
57
  });
62
58
  // 再进行还原
63
59
  do {
64
- result = result.replace('\"~ha~', '').replace('~ha~\"', '').replace(/\\\"/g, "\"");//最后一个replace将release模式中莫名生成的\"转换成"
60
+ result = result.replace('\"~ha~', '').replace('~ha~\"', '').replace(/\\\"/g, "\""); //最后一个replace将release模式中莫名生成的\"转换成"
65
61
  } while (result.indexOf('~ha~') >= 0);
66
-
67
62
  return result;
68
- }
69
-
70
-
71
- ///.replace(/\\n/g, '')
63
+ };
64
+ ///.replace(/\\n/g, '')
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ export type AlertBottomOptions = {
4
+ title: string;
5
+ wrapperStyle: StyleProp<ViewStyle>;
6
+ content: string | React.ReactElement;
7
+ contentContainerStyle: StyleProp<ViewStyle>;
8
+ cancelText: string;
9
+ cancelContainerStyle: StyleProp<ViewStyle>;
10
+ cancelTextStyle: StyleProp<TextStyle>;
11
+ cancel: () => void;
12
+ confirmText: string;
13
+ confirmContainerStyle: StyleProp<ViewStyle>;
14
+ confirmTextStyle: StyleProp<TextStyle>;
15
+ confirm: () => void;
16
+ };
17
+ type RefAttributes = {
18
+ show: (options: Partial<AlertBottomOptions>) => void;
19
+ hide: () => void;
20
+ };
21
+ declare const _default: React.ForwardRefExoticComponent<React.RefAttributes<RefAttributes>>;
22
+ export default _default;
23
+ export declare const alertBottomViewRef: React.RefObject<RefAttributes | null>;
24
+ export declare const showAlertBottomModal: (props: Partial<AlertBottomOptions>) => void;
25
+ //# sourceMappingURL=AlertBottomView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertBottomView.d.ts","sourceRoot":"","sources":["../../../../src/components/Hud/AlertBottomView/AlertBottomView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAMtB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACrC,qBAAqB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,gBAAgB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;;AAKF,wBAkHG;AAEH,eAAO,MAAM,kBAAkB,uCAAmC,CAAC;AAEnE,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,CAAC,kBAAkB,CAAC,SAEtE,CAAC"}