@aks-dev/easyui 1.0.193 → 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.

Files changed (72) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +15 -36
  2. package/dist/components/Badge/Badge.js +7 -16
  3. package/dist/components/DottedLine/DottedLine.js +14 -13
  4. package/dist/components/Echarts/EchartsView.js +30 -73
  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 +43 -60
  8. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +23 -30
  9. package/dist/components/Hud/AlertView/AlertView.js +46 -62
  10. package/dist/components/Hud/Hud.js +8 -19
  11. package/dist/components/Hud/Loading/Loading.js +4 -16
  12. package/dist/components/Hud/PopoverView/PopoverView.js +2 -13
  13. package/dist/components/Hud/Scanner/Scanner.js +55 -86
  14. package/dist/components/Hud/Toast/Toast.js +5 -15
  15. package/dist/components/MenuView/MenuView.js +33 -61
  16. package/dist/components/Modal/Modal.js +0 -7
  17. package/dist/components/MutiPictureView/MutiPictureView.js +27 -47
  18. package/dist/components/PictureViewer/PictureViewer.js +8 -24
  19. package/dist/components/RefreshList/RefreshList.js +41 -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 +21 -22
  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 -51
  27. package/dist/components/TextInputArea/TextInputArea.js +21 -28
  28. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
  29. package/dist/index.js +0 -11
  30. package/dist/jsbridge/RNEasyui.js +0 -25
  31. package/dist/jsbridge/UpgradeModule.js +9 -19
  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 +2 -13
  37. package/dist/utils/index.js +0 -7
  38. package/dist/utils/lazy.js +12 -67
  39. package/dist/utils/mode.js +0 -21
  40. package/package.json +9 -4
  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,11 +1,12 @@
1
- import { __awaiter } from "tslib";
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-04-24 14:27:02
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2023-03-23 15:04:18
7
- * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/Scanner.tsx
8
- */
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
+ };
9
10
  import React, { useImperativeHandle, useState } from "react";
10
11
  import { Animated, BackHandler, Easing, Image, StyleSheet, Text, TouchableOpacity, View, } from "react-native";
11
12
  import { Camera, useCameraDevice, useCameraPermission, useCodeScanner, } from "react-native-vision-camera";
@@ -14,11 +15,6 @@ import { navigationBarHeight, px2dp, statusBarHeight, } from "../../../screen/px
14
15
  import { px2sp } from "../../../screen/px2sp";
15
16
  import * as utils from "../../../utils/lazy";
16
17
  import { showToast } from "../Toast/Toast";
17
- // enum SCANNER_TYPE {
18
- // DENIED = -1,//没有开始权限
19
- // START = 0,//没有扫描结果,继续扫描
20
- // SUCCESS = 1,//已有扫描结果,停止扫描
21
- // }
22
18
  export const Scanner = React.forwardRef((_, ref) => {
23
19
  const [show, setShow] = useState(false);
24
20
  const moveAnim = React.useRef(new Animated.Value(0)).current;
@@ -36,7 +32,6 @@ export const Scanner = React.forwardRef((_, ref) => {
36
32
  return true;
37
33
  };
38
34
  BackHandler.addEventListener("hardwareBackPress", onBackPress);
39
- // return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
40
35
  }, [show]);
41
36
  useImperativeHandle(ref, () => ({
42
37
  showScanner: _showScanner,
@@ -84,7 +79,6 @@ export const Scanner = React.forwardRef((_, ref) => {
84
79
  var _a;
85
80
  (_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.resumePreview();
86
81
  animation.start(({ finished }) => {
87
- // console.log('animationStart finished', finished)
88
82
  if (finished) {
89
83
  animation.reset();
90
84
  animation.start();
@@ -111,78 +105,53 @@ export const Scanner = React.forwardRef((_, ref) => {
111
105
  if (!show)
112
106
  return null;
113
107
  if (!hasPermission)
114
- return <Text>PermissionsPage</Text>;
108
+ return React.createElement(Text, null, "PermissionsPage");
115
109
  if (device == null)
116
- return <Text>NoCameraDeviceError</Text>;
117
- return (<TouchableOpacity disabled style={StyleSheet.absoluteFillObject}>
118
- <Camera ref={cameraRef} style={styles.camera} device={device} codeScanner={codeScanner} isActive={true}>
119
- {/* 导航栏 */}
120
- <View style={{
121
- display: "flex",
122
- justifyContent: "center",
123
- alignItems: "center",
124
- height: navigationBarHeight,
125
- marginTop: statusBarHeight,
126
- position: "relative",
127
- }}>
128
- <TouchableOpacity onPress={() => _hideScanner()} style={{
129
- height: navigationBarHeight,
130
- width: px2dp(50),
131
- paddingLeft: px2dp(15),
132
- position: "absolute",
133
- left: 0,
134
- display: "flex",
135
- justifyContent: "center",
136
- }}>
137
- <Image source={require("./assets/icon_back_white.png")} style={{ width: px2dp(20), height: px2dp(20) }} resizeMode="contain"/>
138
- </TouchableOpacity>
139
- <Text style={{
140
- fontSize: px2sp(16),
141
- color: "white",
142
- fontWeight: "bold",
143
- }}>
144
- 扫一扫
145
- </Text>
146
- </View>
147
-
148
- {/* 动画框 */}
149
- <View style={styles.scanContainer}>
150
- <View style={styles.rectangle}>
151
- <View style={styles.rectangleLeft}/>
152
- <View style={styles.cameraBackground}>
153
- <Animated.View style={[
154
- styles.scanLine,
155
- { transform: [{ translateY: moveAnim }] },
156
- ]}/>
157
- <View style={styles.reactLineTopLeftX}/>
158
- <View style={styles.reactLineTopLeftY}/>
159
- <View style={styles.reactLineTopRightX}/>
160
- <View style={styles.reactLineTopRightY}/>
161
- <View style={styles.reactLineBottomLeftX}/>
162
- <View style={styles.reactLineBottomLeftY}/>
163
- <View style={styles.reactLineBottomRightX}/>
164
- <View style={styles.reactLineBottomRightY}/>
165
- </View>
166
- <View style={styles.rectangleRight}/>
167
- </View>
168
-
169
- {/* <TouchableOpacity onPress={() => setTorchOn(!torchOn)}>
170
- <Image
171
- source={
172
- torchOn
173
- ? require("./assets/flashlight-blue.png")
174
- : require("./assets/flashlight-white.png")
175
- }
176
- style={styles.flashlight}
177
- />
178
- </TouchableOpacity> */}
179
- <Text style={styles.rectangleText}>
180
- 将二维码/条码放入框内,即可自动扫描
181
- </Text>
182
- </View>
183
- <View style={pointStyle}/>
184
- </Camera>
185
- </TouchableOpacity>);
110
+ return React.createElement(Text, null, "NoCameraDeviceError");
111
+ return (React.createElement(TouchableOpacity, { disabled: true, style: StyleSheet.absoluteFillObject },
112
+ React.createElement(Camera, { ref: cameraRef, style: styles.camera, device: device, codeScanner: codeScanner, isActive: true },
113
+ React.createElement(View, { style: {
114
+ display: "flex",
115
+ justifyContent: "center",
116
+ alignItems: "center",
117
+ height: navigationBarHeight,
118
+ marginTop: statusBarHeight,
119
+ position: "relative",
120
+ } },
121
+ React.createElement(TouchableOpacity, { onPress: () => _hideScanner(), style: {
122
+ height: navigationBarHeight,
123
+ width: px2dp(50),
124
+ paddingLeft: px2dp(15),
125
+ position: "absolute",
126
+ left: 0,
127
+ display: "flex",
128
+ justifyContent: "center",
129
+ } },
130
+ React.createElement(Image, { source: require("./assets/icon_back_white.png"), style: { width: px2dp(20), height: px2dp(20) }, resizeMode: "contain" })),
131
+ React.createElement(Text, { style: {
132
+ fontSize: px2sp(16),
133
+ color: "white",
134
+ fontWeight: "bold",
135
+ } }, "\u626B\u4E00\u626B")),
136
+ React.createElement(View, { style: styles.scanContainer },
137
+ React.createElement(View, { style: styles.rectangle },
138
+ React.createElement(View, { style: styles.rectangleLeft }),
139
+ React.createElement(View, { style: styles.cameraBackground },
140
+ React.createElement(Animated.View, { style: [
141
+ styles.scanLine,
142
+ { transform: [{ translateY: moveAnim }] },
143
+ ] }),
144
+ React.createElement(View, { style: styles.reactLineTopLeftX }),
145
+ React.createElement(View, { style: styles.reactLineTopLeftY }),
146
+ React.createElement(View, { style: styles.reactLineTopRightX }),
147
+ React.createElement(View, { style: styles.reactLineTopRightY }),
148
+ React.createElement(View, { style: styles.reactLineBottomLeftX }),
149
+ React.createElement(View, { style: styles.reactLineBottomLeftY }),
150
+ React.createElement(View, { style: styles.reactLineBottomRightX }),
151
+ React.createElement(View, { style: styles.reactLineBottomRightY })),
152
+ React.createElement(View, { style: styles.rectangleRight })),
153
+ React.createElement(Text, { style: styles.rectangleText }, "\u5C06\u4E8C\u7EF4\u7801/\u6761\u7801\u653E\u5165\u6846\u5185\uFF0C\u5373\u53EF\u81EA\u52A8\u626B\u63CF")),
154
+ React.createElement(View, { style: pointStyle }))));
186
155
  });
187
156
  const transparent = "#00000000";
188
157
  const lineColor = "#6ab3ff";
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2021-04-27 10:38:04
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:58:34
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/Toast.tsx
7
- */
8
1
  import React, { useImperativeHandle, useState, useRef } from "react";
9
2
  import { View, StyleSheet, Text, Dimensions, Animated, Easing, } from "react-native";
10
3
  const errorMsg = "(^_^)∠※ 送你一束小花";
@@ -33,13 +26,11 @@ export const Toast = React.forwardRef((_, ref) => {
33
26
  fadeAnimation.start();
34
27
  },
35
28
  }));
36
- return (<Animated.View style={Object.assign(Object.assign({}, styles.toastContainer), { opacity: fade })}>
37
- <View style={styles.toastTipsContainer}>
38
- <Text numberOfLines={5} style={Object.assign({}, styles.toastTitle)}>
39
- {tipText}{" "}
40
- </Text>
41
- </View>
42
- </Animated.View>);
29
+ return (React.createElement(Animated.View, { style: Object.assign(Object.assign({}, styles.toastContainer), { opacity: fade }) },
30
+ React.createElement(View, { style: styles.toastTipsContainer },
31
+ React.createElement(Text, { numberOfLines: 5, style: Object.assign({}, styles.toastTitle) },
32
+ tipText,
33
+ " "))));
43
34
  });
44
35
  export const toastRef = React.createRef();
45
36
  export const showToast = (content) => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.showToast(content); };
@@ -56,7 +47,6 @@ const styles = StyleSheet.create({
56
47
  position: "absolute",
57
48
  backgroundColor: "#00000088",
58
49
  padding: 10,
59
- // paddingVertical: 4,
60
50
  borderRadius: 2,
61
51
  justifyContent: "center",
62
52
  alignItems: "center",
@@ -1,33 +1,22 @@
1
- import { __awaiter } from "tslib";
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 React from "react";
3
11
  import { Image, ScrollView, Text, TouchableOpacity, View, } from "react-native";
4
12
  import { deviceHeight, deviceWidth } from "../../screen/px2dp";
5
- // import * as utils from '../../utils/lazy';
6
13
  import { hidePopoverView, showPopoverView } from "../Hud/Hud";
7
- // type Reducer = (prevState: State, action: Partial<State>) => State
8
14
  export default (props) => {
9
15
  const { defaultAlignHorizontal = "left", defaultAlignVertical = "bottom" } = props;
10
16
  const [state, dispatch] = React.useReducer((prevState, action) => Object.assign({}, prevState, action), {});
11
- // const containerRef = React.useRef<{ measureInWindow: (callback: MeasureInWindowOnSuccessCallback) => void }>()
12
17
  const containerRef = React.useRef(null);
13
18
  const rootView = React.useRef({ pageX: 0, pageY: 0, width: 0, height: 0 });
14
19
  const sc = React.useRef({ x: 0, y: 0, width: 0, height: 0 });
15
- // React.useEffect(() => {
16
- // ; (async () => {
17
- // await utils.sleep()
18
- // containerRef.current?.measure((...args) => {
19
- // console.log('containerRef', args)
20
- // if (args.length == 6) {
21
- // _container.current = {
22
- // x: args[4],
23
- // y: args[5],
24
- // width: args[2],
25
- // height: args[3],
26
- // }
27
- // }
28
- // })
29
- // })()
30
- // })
31
20
  const getRootViewlayoutPromise = () => {
32
21
  return new Promise((resovle, reject) => {
33
22
  var _a;
@@ -40,7 +29,6 @@ export default (props) => {
40
29
  pageY: args[5],
41
30
  };
42
31
  }
43
- // console.log('RootView', rootView.current)
44
32
  resovle(args);
45
33
  });
46
34
  });
@@ -52,7 +40,6 @@ export default (props) => {
52
40
  let width = rootView.current.width;
53
41
  let height = rootView.current.height;
54
42
  let x = rootView.current.pageX;
55
- // let y = (StatusBar.currentHeight || 0) + _container.current.y + height
56
43
  let y = rootView.current.pageY + height;
57
44
  if (x > Math.abs(deviceWidth - width - x)) {
58
45
  alignHorizontal = "right";
@@ -60,7 +47,6 @@ export default (props) => {
60
47
  if (y > deviceHeight * 0.5) {
61
48
  alignVertical = "top";
62
49
  }
63
- /**todo: target_width的获取是延迟的,所以这里又问题 */
64
50
  const target_width = sc.current.width;
65
51
  const target_height = CELL_HEIGHT * (Math.min(((_a = props.data) === null || _a === void 0 ? void 0 : _a.length) || 0, 5) || 0);
66
52
  return {
@@ -76,7 +62,6 @@ export default (props) => {
76
62
  };
77
63
  const reLayout = () => {
78
64
  let { alignVertical, alignHorizontal, width, height, x, y, target_width, target_height, } = getLayoutInfos();
79
- // console.log({ getLayoutInfos: getLayoutInfos() })
80
65
  const layout = () => {
81
66
  if (alignHorizontal == "left") {
82
67
  if (target_width + x > deviceWidth) {
@@ -121,51 +106,38 @@ export default (props) => {
121
106
  props.onContainerClick && props.onContainerClick();
122
107
  if (props.data == undefined || ((_a = props.data) === null || _a === void 0 ? void 0 : _a.length) == 0)
123
108
  return;
124
- /**重新获取rootview的定位 */
125
109
  yield getRootViewlayoutPromise();
126
- /**重新获取rootview的定位 */
127
110
  showPopoverView({
128
- content: (<TouchableOpacity activeOpacity={1} style={Object.assign({ position: "absolute", minWidth: deviceWidth * 0.36, maxWidth: deviceWidth * 0.8, minHeight: CELL_HEIGHT + PADDING * 2, maxHeight: CELL_HEIGHT * 5 + PADDING * 2, borderRadius: 6, backgroundColor: "#000000ee",
129
- // overflow: 'hidden' ,
130
- padding: PADDING }, reLayout())}>
131
- <View style={Object.assign({ width: ARROW_HEIGHT, height: ARROW_HEIGHT, backgroundColor: "#000000ee", position: "absolute", zIndex: 1, transform: [{ rotateZ: "45deg" }] }, (() => {
132
- const { alignVertical, alignHorizontal } = getLayoutInfos();
133
- if (alignVertical == "bottom" && alignHorizontal == "left")
134
- return { left: "20%", top: -5 };
135
- if (alignVertical == "bottom" && alignHorizontal == "right")
136
- return { right: "20%", top: -5 };
137
- if (alignVertical == "top" && alignHorizontal == "left")
138
- return { left: "20%", bottom: -5 };
139
- if (alignVertical == "top" && alignHorizontal == "right")
140
- return { right: "20%", bottom: -5 };
141
- return {};
142
- })())}/>
143
-
144
- <ScrollView onLayout={(e) => {
145
- // console.log('target onLayout', e.nativeEvent.layout)
146
- let _sc = e.nativeEvent.layout;
147
- sc.current = _sc;
148
- }}>
149
- {(_b = props.data) === null || _b === void 0 ? void 0 : _b.map((i, idx) => {
150
- return (<TouchableOpacity activeOpacity={0.7} key={`sg-memnu-${idx}`} style={{
111
+ content: (React.createElement(TouchableOpacity, { activeOpacity: 1, style: Object.assign({ position: "absolute", minWidth: deviceWidth * 0.36, maxWidth: deviceWidth * 0.8, minHeight: CELL_HEIGHT + PADDING * 2, maxHeight: CELL_HEIGHT * 5 + PADDING * 2, borderRadius: 6, backgroundColor: "#000000ee", padding: PADDING }, reLayout()) },
112
+ React.createElement(View, { style: Object.assign({ width: ARROW_HEIGHT, height: ARROW_HEIGHT, backgroundColor: "#000000ee", position: "absolute", zIndex: 1, transform: [{ rotateZ: "45deg" }] }, (() => {
113
+ const { alignVertical, alignHorizontal } = getLayoutInfos();
114
+ if (alignVertical == "bottom" && alignHorizontal == "left")
115
+ return { left: "20%", top: -5 };
116
+ if (alignVertical == "bottom" && alignHorizontal == "right")
117
+ return { right: "20%", top: -5 };
118
+ if (alignVertical == "top" && alignHorizontal == "left")
119
+ return { left: "20%", bottom: -5 };
120
+ if (alignVertical == "top" && alignHorizontal == "right")
121
+ return { right: "20%", bottom: -5 };
122
+ return {};
123
+ })()) }),
124
+ React.createElement(ScrollView, { onLayout: (e) => {
125
+ let _sc = e.nativeEvent.layout;
126
+ sc.current = _sc;
127
+ } }, (_b = props.data) === null || _b === void 0 ? void 0 : _b.map((i, idx) => {
128
+ return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, key: `sg-memnu-${idx}`, style: {
151
129
  height: CELL_HEIGHT,
152
130
  display: "flex",
153
131
  flexDirection: "row",
154
132
  alignItems: "center",
155
- // ,backgroundColor:utils.randomcolor()
156
- }} onPress={(e) => {
133
+ }, onPress: (e) => {
157
134
  props.onItemClick && props.onItemClick(idx, i.extra);
158
135
  hidePopoverView();
159
- }}>
160
- {i.icon && (<Image style={{ width: 18, height: 18, marginRight: 4 }} source={i.icon}/>)}
161
- <Text style={{ flexShrink: 1, fontSize: 14, color: "white" }}>
162
- {i.text}
163
- </Text>
164
- </TouchableOpacity>);
165
- })}
166
- </ScrollView>
167
- </TouchableOpacity>),
136
+ } },
137
+ i.icon && (React.createElement(Image, { style: { width: 18, height: 18, marginRight: 4 }, source: i.icon })),
138
+ React.createElement(Text, { style: { flexShrink: 1, fontSize: 14, color: "white" } }, i.text)));
139
+ })))),
168
140
  });
169
141
  });
170
- return (<TouchableOpacity ref={containerRef} onPress={(e) => show()} {...props}/>);
142
+ return (React.createElement(TouchableOpacity, Object.assign({ ref: containerRef, onPress: (e) => show() }, props)));
171
143
  };
@@ -1,8 +1 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-26 11:30:34
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-10-27 16:37:32
6
- * @FilePath: /@aks-dev/easyui/lib/Modal/Modal.tsx
7
- */
8
1
  export { default as Modal } from 'react-native-modal';
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: OBKoro1
3
- * @Date: 2022-04-24 17:38:27
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-11-14 11:33:33
6
- * @FilePath: /@aks-dev/easyui/lib/MutiPictureView/MutiPictureView.tsx
7
- */
8
1
  import * as React from "react";
9
2
  import { Image, View, StyleSheet, Keyboard, TouchableOpacity, Text, } from "react-native";
10
3
  import { px2dp } from "../../screen/px2dp";
@@ -14,8 +7,7 @@ let icon_add_image = require("./assets/icon_add_image.png");
14
7
  let icon_del_image = require("./assets/icon_del_image.png");
15
8
  const MutiPictureView = (props) => {
16
9
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
17
- const { bind, maxCount = 6, type = "showImagePicker", addIcon, addIconStyle, addIconContainerStyle, //borderWidth: 1, borderStyle: 'dashed', borderColor: assets.color_A3A9CC 虚线框
18
- itemContainerStyle, emptyPlaceHolderStyle, delIcon, delIconStyle, spacingHorizontal = px2dp(15), spacingInner = px2dp(8), editable = true, showEmptyPlaceHolder = false, } = props;
10
+ const { bind, maxCount = 6, type = "showImagePicker", addIcon, addIconStyle, addIconContainerStyle, itemContainerStyle, emptyPlaceHolderStyle, delIcon, delIconStyle, spacingHorizontal = px2dp(15), spacingInner = px2dp(8), editable = true, showEmptyPlaceHolder = false, } = props;
19
11
  const { viewModel, setViewModel } = bind;
20
12
  React.useEffect(() => { }, []);
21
13
  const [sideLength, setSideLength] = React.useState(0);
@@ -75,7 +67,6 @@ const MutiPictureView = (props) => {
75
67
  typeof it == "object");
76
68
  })) || [];
77
69
  let images = [];
78
- // console.log('viewModel', viewModel, imgs)
79
70
  imgs.forEach((it) => {
80
71
  if (typeof it === "string") {
81
72
  images.push({ uri: it });
@@ -95,7 +86,7 @@ const MutiPictureView = (props) => {
95
86
  });
96
87
  };
97
88
  const ItemView = ({ source, index, }) => {
98
- return (<TouchableOpacity style={[
89
+ return (React.createElement(TouchableOpacity, { style: [
99
90
  styles.item_container,
100
91
  itemContainerStyle,
101
92
  {
@@ -104,18 +95,15 @@ const MutiPictureView = (props) => {
104
95
  width: sideLength,
105
96
  height: sideLength,
106
97
  },
107
- ]} activeOpacity={0.8} onPress={() => showPhoto(index)}>
108
- <Image source={source} style={{ width: "100%", height: "100%" }} resizeMode="cover"/>
109
- {editable && !props.value && (<TouchableOpacity onPress={() => deletePhoto(index)} style={[styles.del_img_container, delIconStyle]}>
110
- <Image source={delIcon ? delIcon : icon_del_image} resizeMode="contain" style={{ width: "100%", height: "100%" }}/>
111
- </TouchableOpacity>)}
112
- </TouchableOpacity>);
98
+ ], activeOpacity: 0.8, onPress: () => showPhoto(index) },
99
+ React.createElement(Image, { source: source, style: { width: "100%", height: "100%" }, resizeMode: "cover" }),
100
+ editable && !props.value && (React.createElement(TouchableOpacity, { onPress: () => deletePhoto(index), style: [styles.del_img_container, delIconStyle] },
101
+ React.createElement(Image, { source: delIcon ? delIcon : icon_del_image, resizeMode: "contain", style: { width: "100%", height: "100%" } })))));
113
102
  };
114
103
  const containerRef = React.useRef(null);
115
104
  React.useEffect(() => {
116
105
  var _a;
117
106
  (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.measure((...args) => {
118
- // console.log('measure', args[2])
119
107
  if (args.length > 3) {
120
108
  let _sideLength = +((args[2] - spacingHorizontal * 2 - spacingInner * 2) /
121
109
  3).toFixed(1);
@@ -124,19 +112,18 @@ const MutiPictureView = (props) => {
124
112
  });
125
113
  });
126
114
  if (props.value && ((_a = props.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
127
- return (<View style={[styles.container, props.style]} ref={containerRef}>
128
- {props.value instanceof Array &&
115
+ return (React.createElement(View, { style: [styles.container, props.style], ref: containerRef },
116
+ props.value instanceof Array &&
129
117
  ((_b = props.value) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
130
- return (<ItemView key={index} source={typeof item === "string" ? { uri: item } : item} index={index}/>);
131
- }))}
132
-
133
- {showEmptyPlaceHolder &&
118
+ return (React.createElement(ItemView, { key: index, source: typeof item === "string" ? { uri: item } : item, index: index }));
119
+ })),
120
+ showEmptyPlaceHolder &&
134
121
  maxCount - (((_c = props.value) === null || _c === void 0 ? void 0 : _c.length) || 0) - 1 > 0 &&
135
122
  Array.from({
136
123
  length: maxCount - (((_d = props.value) === null || _d === void 0 ? void 0 : _d.length) || 0) - (editable ? 1 : 0),
137
124
  }, (_, k) => {
138
125
  var _a, _b;
139
- return (<View key={`sg-showEmptyPlaceHolder-${k}`} style={[
126
+ return (React.createElement(View, { key: `sg-showEmptyPlaceHolder-${k}`, style: [
140
127
  styles.empty_place_container,
141
128
  emptyPlaceHolderStyle,
142
129
  itemContainerStyle,
@@ -152,17 +139,15 @@ const MutiPictureView = (props) => {
152
139
  width: sideLength,
153
140
  height: sideLength,
154
141
  },
155
- ]}/>);
156
- })}
157
- </View>);
142
+ ] }));
143
+ })));
158
144
  }
159
- return (<View style={[styles.container, props.style]} ref={containerRef}>
160
- {(viewModel === null || viewModel === void 0 ? void 0 : viewModel.photos) instanceof Array &&
145
+ return (React.createElement(View, { style: [styles.container, props.style], ref: containerRef },
146
+ (viewModel === null || viewModel === void 0 ? void 0 : viewModel.photos) instanceof Array &&
161
147
  viewModel.photos.map((item, index) => {
162
- return (<ItemView key={index} source={typeof item === "string" ? { uri: item } : item} index={index}/>);
163
- })}
164
-
165
- {!(((_e = viewModel === null || viewModel === void 0 ? void 0 : viewModel.photos) === null || _e === void 0 ? void 0 : _e.length) == maxCount) && editable && (<TouchableOpacity style={[
148
+ return (React.createElement(ItemView, { key: index, source: typeof item === "string" ? { uri: item } : item, index: index }));
149
+ }),
150
+ !(((_e = viewModel === null || viewModel === void 0 ? void 0 : viewModel.photos) === null || _e === void 0 ? void 0 : _e.length) == maxCount) && editable && (React.createElement(TouchableOpacity, { style: [
166
151
  styles.item_container,
167
152
  itemContainerStyle,
168
153
  {
@@ -174,26 +159,23 @@ const MutiPictureView = (props) => {
174
159
  height: sideLength,
175
160
  },
176
161
  addIconContainerStyle,
177
- ]} activeOpacity={0.8} onPress={() => addPhoto()}>
178
- <Image source={addIcon ? addIcon : icon_add_image} style={[{ width: "25%", height: "25%" }, addIconStyle]} resizeMode="contain"/>
179
- {props.addText && (<Text style={[
162
+ ], activeOpacity: 0.8, onPress: () => addPhoto() },
163
+ React.createElement(Image, { source: addIcon ? addIcon : icon_add_image, style: [{ width: "25%", height: "25%" }, addIconStyle], resizeMode: "contain" }),
164
+ props.addText && (React.createElement(Text, { style: [
180
165
  {
181
166
  fontSize: px2sp(12),
182
167
  color: "lightgrey",
183
168
  marginTop: px2dp(2),
184
169
  },
185
170
  props.addTextStyle,
186
- ]}>
187
- {props.addText}
188
- </Text>)}
189
- </TouchableOpacity>)}
190
- {showEmptyPlaceHolder &&
171
+ ] }, props.addText)))),
172
+ showEmptyPlaceHolder &&
191
173
  maxCount - (((_h = viewModel.photos) === null || _h === void 0 ? void 0 : _h.length) || 0) - 1 > 0 &&
192
174
  Array.from({
193
175
  length: maxCount - (((_j = viewModel.photos) === null || _j === void 0 ? void 0 : _j.length) || 0) - (editable ? 1 : 0),
194
176
  }, (_, k) => {
195
177
  var _a, _b;
196
- return (<View key={`sg-showEmptyPlaceHolder-${k}`} style={[
178
+ return (React.createElement(View, { key: `sg-showEmptyPlaceHolder-${k}`, style: [
197
179
  styles.empty_place_container,
198
180
  emptyPlaceHolderStyle,
199
181
  itemContainerStyle,
@@ -209,9 +191,8 @@ const MutiPictureView = (props) => {
209
191
  width: sideLength,
210
192
  height: sideLength,
211
193
  },
212
- ]}/>);
213
- })}
214
- </View>);
194
+ ] }));
195
+ })));
215
196
  };
216
197
  const styles = StyleSheet.create({
217
198
  container: {
@@ -221,7 +202,6 @@ const styles = StyleSheet.create({
221
202
  display: "flex",
222
203
  flexDirection: "row",
223
204
  flexWrap: "wrap",
224
- // borderRadius: px2dp(10),
225
205
  },
226
206
  item_container: {
227
207
  overflow: "hidden",
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 15:58:39
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-04-26 12:38:13
6
- * @FilePath: /@aks/easy/lib/PictureViewer/PictureViewer.tsx
7
- */
8
1
  import * as React from "react";
9
2
  import { Modal, StatusBar, Platform } from "react-native";
10
3
  import ImageViewer from "react-native-image-zoom-viewer";
@@ -26,24 +19,15 @@ export const PictureViewer = ({ bind, }) => {
26
19
  }
27
20
  }
28
21
  }, [visible]);
29
- return (<Modal presentationStyle="overFullScreen" visible={visible} transparent={false} onRequestClose={() => {
30
- /**
31
- * 【官方文档】
32
- * onRequestClose回调会在用户按下 Android 设备上的后退按键或是 Apple TV 上的菜单键时触发。
33
- * 请务必注意本属性在 Android 平台上为必填,且会在 modal 处于开启状态时阻止BackHandler事件。
34
- */
22
+ return (React.createElement(Modal, { presentationStyle: "overFullScreen", visible: visible, transparent: false, onRequestClose: () => {
35
23
  setViewModel({
36
24
  imageViewer: Object.assign(Object.assign({}, viewModel.imageViewer), { visible: false }),
37
25
  });
38
- }} style={{ margin: 0, backgroundColor: "red" }}>
39
- <ImageViewer imageUrls={imgs} index={index} onSwipeDown={() => {
40
- // console.log('onSwipeDown');
41
- }} saveToLocalByLongPress={false}
42
- // onMove={data => console.log(data)}
43
- useNativeDriver={true} enableSwipeDown={true} onClick={() => {
44
- setViewModel({
45
- imageViewer: Object.assign(Object.assign({}, viewModel.imageViewer), { visible: false }),
46
- });
47
- }}/>
48
- </Modal>);
26
+ }, style: { margin: 0, backgroundColor: "red" } },
27
+ React.createElement(ImageViewer, { imageUrls: imgs, index: index, onSwipeDown: () => {
28
+ }, saveToLocalByLongPress: false, useNativeDriver: true, enableSwipeDown: true, onClick: () => {
29
+ setViewModel({
30
+ imageViewer: Object.assign(Object.assign({}, viewModel.imageViewer), { visible: false }),
31
+ });
32
+ } })));
49
33
  };