@aks-dev/easyui 1.0.150 → 1.0.153

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.
@@ -2,14 +2,14 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-05-05 14:19:39
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-10-24 16:13:01
5
+ * @LastEditTime: 2023-03-23 15:15:06
6
6
  * @FilePath: /@aks-dev/easyui/jsbridge/UpgradeModule.ts
7
7
  */
8
8
  import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
9
9
 
10
10
  const { UpgradeModule } = NativeModules;
11
11
 
12
- import type { UpgradeOptions } from '.'
12
+ import type { UpgradeOptions } from './index.d'
13
13
 
14
14
  export const getAppVersion = () => UpgradeModule.getAppVersion();
15
15
 
@@ -0,0 +1,67 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-19 10:23:01
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-10-24 16:38:59
6
+ * @FilePath: /@aks-dev/easyui/jsbridge/index.ts
7
+ */
8
+
9
+
10
+ /**
11
+ * @description: 获取App版本号
12
+ * @param {*}
13
+ * @return {*}
14
+ */
15
+ export declare const getAppVersion: () => Promise<string>;
16
+
17
+ /**
18
+ * @description: 获取操作系统版本
19
+ *
20
+ react-native-device-info
21
+ * @return {*}
22
+ */
23
+ export declare const getOSVersion: () => Promise<string>;
24
+
25
+ /**
26
+ * @description: 获取设备品牌
27
+ * @return {*}
28
+ */
29
+ export declare const getDeviceBrand: () => Promise<string>;
30
+
31
+
32
+ export declare type UpgradeOptions = {
33
+ title?: string;
34
+ version: string;
35
+ downloadUrl: string;
36
+ note: string;
37
+ force: boolean;
38
+ };
39
+
40
+ /**
41
+ * @description: app升级
42
+ * @return {*}
43
+ */
44
+ export declare const upgrade: (options: UpgradeOptions) => Promise<string>;
45
+
46
+
47
+
48
+ /**
49
+ * @deprecated 测量不准确,已放弃
50
+ * @description: 获取status_bar_height
51
+ * @return {*}
52
+ */
53
+ export declare const getStatusBarHeight: () => Promise<number>;
54
+
55
+ /**
56
+ * @deprecated 测量不准确,已放弃
57
+ * @description: 获取navigation_bar_height
58
+ * @return {*}
59
+ */
60
+ export declare const getNavigationBarHeight: () => Promise<number>;
61
+
62
+
63
+ /**
64
+ * only android
65
+ * 返回桌面
66
+ */
67
+ export declare const gotoDesktop: ()=>void;
package/jsbridge/index.ts CHANGED
@@ -2,66 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-19 10:23:01
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-10-24 16:38:59
5
+ * @LastEditTime: 2023-03-23 15:14:55
6
6
  * @FilePath: /@aks-dev/easyui/jsbridge/index.ts
7
7
  */
8
-
9
-
10
- /**
11
- * @description: 获取App版本号
12
- * @param {*}
13
- * @return {*}
14
- */
15
- export declare const getAppVersion: () => Promise<string>;
16
-
17
- /**
18
- * @description: 获取操作系统版本
19
- *
20
- react-native-device-info
21
- * @return {*}
22
- */
23
- export declare const getOSVersion: () => Promise<string>;
24
-
25
- /**
26
- * @description: 获取设备品牌
27
- * @return {*}
28
- */
29
- export declare const getDeviceBrand: () => Promise<string>;
30
-
31
-
32
- export declare type UpgradeOptions = {
33
- title?: string;
34
- version: string;
35
- downloadUrl: string;
36
- note: string;
37
- force: boolean;
38
- };
39
-
40
- /**
41
- * @description: app升级
42
- * @return {*}
43
- */
44
- export declare const upgrade: (options: UpgradeOptions) => Promise<string>;
45
-
46
-
47
-
48
- /**
49
- * @deprecated 测量不准确,已放弃
50
- * @description: 获取status_bar_height
51
- * @return {*}
52
- */
53
- export declare const getStatusBarHeight: () => Promise<number>;
54
-
55
- /**
56
- * @deprecated 测量不准确,已放弃
57
- * @description: 获取navigation_bar_height
58
- * @return {*}
59
- */
60
- export declare const getNavigationBarHeight: () => Promise<number>;
61
-
62
-
63
- /**
64
- * only android
65
- * 返回桌面
66
- */
67
- export declare const gotoDesktop: ()=>void;
8
+ export * from './RNEasyui'
9
+ export * from './UpgradeModule'
package/lib/Hud/Hud.tsx CHANGED
@@ -2,8 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:10:04
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 09:55:01
6
- * @FilePath: /cmwy-device-app/node_modules/@aks-dev/easyui/lib/Hud/Hud.tsx
5
+ * @LastEditTime: 2023-03-23 11:13:55
6
+ * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/Hud.tsx
7
7
  */
8
8
  import * as React from 'react'
9
9
  // import { StyleSheet } from 'react-native'
@@ -31,6 +31,9 @@ import {
31
31
  import { showPopoverView, hidePopoverView, popoverViewRef, PopoverView } from './PopoverView/PopoverView'
32
32
 
33
33
 
34
+ import {
35
+ showScanner, hideScanner, scannerRef, Scanner
36
+ } from './Scanner/Scanner'
34
37
 
35
38
 
36
39
 
@@ -48,6 +51,7 @@ export const Hud: React.FC<{}> = () => React.cloneElement(
48
51
  <AlertBottomView key="hud-3-0" ref={alertBottomViewRef} />,
49
52
  <AlertSheetView key="hud-3-1" ref={alertSheetViewRef} />,
50
53
  <PopoverView key="hud-4" ref={popoverViewRef} />,
54
+ <Scanner key="hud-5" ref={scannerRef} />,
51
55
  ]
52
56
  )
53
57
 
@@ -58,6 +62,6 @@ export {
58
62
  showLoading, hideLoading,
59
63
  showAlertBottomModal,
60
64
  showAlertSheetModal,
61
- showPopoverView, hidePopoverView
62
-
65
+ showPopoverView, hidePopoverView,
66
+ showScanner,hideScanner,
63
67
  }
@@ -0,0 +1,250 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-24 14:27:02
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2023-03-23 15:04:18
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/Scanner.tsx
7
+ */
8
+ import React, { useImperativeHandle, useState } from 'react';
9
+ import {
10
+ Animated, BackHandler, Easing, Image, StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle
11
+ } from 'react-native';
12
+ import { RNCamera, BarCodeReadEvent } from 'react-native-camera';
13
+ import { PERMISSIONS, requestMultiple } from 'react-native-permissions';
14
+ import { navigationBarHeight, px2dp, statusBarHeight } from '../../../screen/px2dp';
15
+ import { px2sp } from '../../../screen/px2sp';
16
+ import * as utils from '../../../utils/lazy';
17
+ import { showToast } from '../Toast/Toast';
18
+ import { ScannerOptions } from './index';
19
+
20
+
21
+
22
+
23
+
24
+
25
+ // enum SCANNER_TYPE {
26
+ // DENIED = -1,//没有开始权限
27
+ // START = 0,//没有扫描结果,继续扫描
28
+ // SUCCESS = 1,//已有扫描结果,停止扫描
29
+ // }
30
+
31
+ export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, ref) => {
32
+ const [show, setShow] = useState<boolean>(false);
33
+ const [torchOn, setTorchOn] = React.useState<boolean>(false)
34
+ const moveAnim = React.useRef(new Animated.Value(0)).current
35
+ const [pointStyle, setPointStyle] = React.useState<StyleProp<ViewStyle>>()
36
+ const cameraRef: React.MutableRefObject<RNCamera> = React.useRef() as any
37
+ const _cbRef: React.MutableRefObject<ScannerOptions.CallBack> = React.useRef() as any
38
+ const _scanerResultRef = React.useRef<any>()
39
+ React.useEffect(() => {
40
+ const onBackPress = () => {
41
+ if (show) {
42
+ _hideScanner()
43
+ }
44
+ return true
45
+ }
46
+ BackHandler.addEventListener('hardwareBackPress', onBackPress);
47
+ return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
48
+ }, [show])
49
+
50
+
51
+
52
+
53
+ useImperativeHandle<unknown, ScannerOptions.RefAttributes>(ref, () => ({
54
+ showScanner: _showScanner,
55
+ hideScanner: _hideScanner
56
+ }), [show])
57
+
58
+
59
+
60
+ const _showScanner = async (cb: ScannerOptions.CallBack) => {
61
+ let res = await requestMultiple([PERMISSIONS.IOS.CAMERA, PERMISSIONS.ANDROID.CAMERA])
62
+ if (res[PERMISSIONS.ANDROID.CAMERA] == "granted" || res[PERMISSIONS.IOS.CAMERA] == "granted") {
63
+ _scanerResultRef.current = undefined;
64
+ setShow(true);
65
+ setPointStyle({})
66
+ await utils.sleep()
67
+ animationStart()
68
+ _cbRef.current = cb;
69
+ } else {
70
+ _hideScanner()
71
+ showToast('您未开启相机权限,暂不能使用此功能')
72
+ }
73
+
74
+
75
+ }
76
+
77
+ const _hideScanner = async () => {
78
+ animationStop()
79
+ await utils.sleep()
80
+ setShow(false);
81
+ }
82
+
83
+
84
+
85
+ const animation = Animated.loop(Animated.sequence([
86
+ Animated.timing(
87
+ moveAnim,
88
+ {
89
+ toValue: px2dp(222),
90
+ duration: 3000,
91
+ easing: Easing.linear,
92
+ useNativeDriver: true,
93
+ }
94
+ ),
95
+ Animated.timing(
96
+ moveAnim,
97
+ {
98
+ toValue: 0,
99
+ duration: 3000,
100
+ easing: Easing.linear,
101
+ useNativeDriver: true,
102
+ }
103
+ )
104
+ ]))
105
+
106
+
107
+
108
+ const animationStart = async () => {
109
+
110
+ cameraRef.current?.resumePreview()
111
+ animation.start(({ finished }) => {
112
+ // console.log('animationStart finished', finished)
113
+ if (finished) {
114
+ animation.reset()
115
+ animation.start()
116
+ }
117
+ })
118
+ }
119
+ const animationStop = (result?: any) => {
120
+ cameraRef.current?.pausePreview()
121
+ animation.stop()
122
+ }
123
+
124
+
125
+ // const getPointFromBounds = (bounds) => {
126
+ // let x = 0
127
+ // let y = 0
128
+
129
+ // if (Platform.OS == 'android') {
130
+ // bounds.origin.forEach(i => {
131
+ // x = Math.max(x, parseFloat(i.x))
132
+ // y = Math.max(y, parseFloat(i.y))
133
+ // })
134
+
135
+ // y = y * DeviceHeight / bounds.width
136
+ // x = x * DeviceWidth / bounds.height
137
+ // }
138
+
139
+ // if(Platform.OS == 'ios'){
140
+ // x=parseFloat(bounds.origin.x)
141
+ // y=parseFloat(bounds.origin.y)
142
+ // }
143
+
144
+ // return { x, y }
145
+ // }
146
+
147
+
148
+ const onBarCodeRead = (e: BarCodeReadEvent) => {
149
+ // console.log('ss onBarCodeRead: ', JSON.stringify(e))
150
+ if (e?.data?.length > 0 && _scanerResultRef.current == undefined) {
151
+ _scanerResultRef.current = e?.data
152
+ _cbRef.current(e?.data)
153
+ _hideScanner()
154
+ }
155
+ }
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ if (!show) return null;
164
+ return (
165
+ <TouchableOpacity disabled style={StyleSheet.absoluteFillObject}>
166
+ <RNCamera
167
+ ref={cameraRef}
168
+ captureAudio={false}
169
+ autoFocus={RNCamera.Constants.AutoFocus.on}/*自动对焦*/
170
+ style={styles.camera}
171
+ type={RNCamera.Constants.Type.back}/*切换前后摄像头 front前back后*/
172
+ flashMode={torchOn ? RNCamera.Constants.FlashMode.torch : RNCamera.Constants.FlashMode.off}/*相机闪光模式*/
173
+ onBarCodeRead={onBarCodeRead}
174
+
175
+
176
+ >
177
+ {/* 导航栏 */}
178
+ <View style={{ display: 'flex', justifyContent: "center", alignItems: "center", height: navigationBarHeight, marginTop: statusBarHeight, position: 'relative' }}>
179
+ <TouchableOpacity onPress={() => _hideScanner()} style={{ height: navigationBarHeight, width: px2dp(50), paddingLeft: px2dp(15), position: 'absolute', left: 0, display: 'flex', justifyContent: 'center' }} >
180
+ <Image source={require('./icon_back_white.png')} style={{ width: px2dp(20), height: px2dp(20) }} resizeMode='contain' />
181
+ </TouchableOpacity>
182
+ <Text style={{ fontSize: px2sp(16), color: 'white', fontWeight: 'bold' }}>扫一扫</Text>
183
+ </View>
184
+
185
+ {/* 动画框 */}
186
+ <View style={styles.scanContainer}>
187
+ <View style={styles.rectangle}>
188
+ <View style={styles.rectangleLeft} />
189
+ <View style={styles.cameraBackground}>
190
+ <Animated.View style={[styles.scanLine, { transform: [{ translateY: moveAnim }] }]} />
191
+ <View style={styles.reactLineTopLeftX} />
192
+ <View style={styles.reactLineTopLeftY} />
193
+ <View style={styles.reactLineTopRightX} />
194
+ <View style={styles.reactLineTopRightY} />
195
+ <View style={styles.reactLineBottomLeftX} />
196
+ <View style={styles.reactLineBottomLeftY} />
197
+ <View style={styles.reactLineBottomRightX} />
198
+ <View style={styles.reactLineBottomRightY} />
199
+ </View>
200
+ <View style={styles.rectangleRight} />
201
+ </View>
202
+
203
+ <TouchableOpacity onPress={() => setTorchOn(!torchOn)}>
204
+ <Image
205
+ source={torchOn ? require('./flashlight-blue.png') : require('./flashlight-white.png')}
206
+ style={styles.flashlight} />
207
+ </TouchableOpacity>
208
+ <Text style={styles.rectangleText}>将二维码/条码放入框内,即可自动扫描</Text>
209
+ </View>
210
+ <View style={pointStyle} />
211
+ </RNCamera>
212
+
213
+ </TouchableOpacity>
214
+ )
215
+ })
216
+
217
+
218
+
219
+ const transparent = '#00000000'
220
+ const lineColor = '#6ab3ff'
221
+ const scanW = 225
222
+ const scanCornerLineLength = 15;
223
+ const scanCornerLineHeight = 3
224
+ const styles = StyleSheet.create({
225
+ camera: { display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: "red" },
226
+ cameraBackground: { width: px2dp(scanW), height: px2dp(scanW), backgroundColor: transparent },
227
+ scanContainer: { display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center' },
228
+ rectangle: { flexDirection: 'row', overflow: 'hidden', },
229
+ rectangleLeft: { backgroundColor: transparent, height: px2dp(scanW), width: px2dp(scanW) },
230
+ rectangleRight: { backgroundColor: transparent, height: px2dp(scanW), width: px2dp(scanW) },
231
+ rectangleText: { color: '#fff', lineHeight: px2dp(15), },
232
+ scanLine: { width: px2dp(scanW), height: px2dp(scanCornerLineHeight), borderRadius: px2dp(25), backgroundColor: lineColor, },
233
+ reactLineTopLeftX: { position: 'absolute', top: 0, left: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
234
+ reactLineTopLeftY: { position: 'absolute', top: 0, left: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
235
+ reactLineTopRightX: { position: 'absolute', top: 0, right: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
236
+ reactLineTopRightY: { position: 'absolute', top: 0, right: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
237
+ reactLineBottomLeftX: { position: 'absolute', bottom: 0, left: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
238
+ reactLineBottomLeftY: { position: 'absolute', bottom: 0, left: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
239
+ reactLineBottomRightX: { position: 'absolute', bottom: 0, right: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
240
+ reactLineBottomRightY: { position: 'absolute', bottom: 0, right: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
241
+ flashlight: { width: px2dp(30), height: px2dp(30), resizeMode: 'contain', marginTop: px2dp(50), marginBottom: px2dp(15), marginHorizontal: px2dp(15) },
242
+ grantedText: { lineHeight: px2dp(30), color: lineColor, fontWeight: 'bold' }
243
+ })
244
+
245
+
246
+
247
+
248
+ export const scannerRef = React.createRef<ScannerOptions.RefAttributes>();
249
+ export const showScanner = (cb: ScannerOptions.CallBack) => scannerRef.current?.showScanner(cb)
250
+ export const hideScanner = () => scannerRef.current?.hideScanner()
@@ -0,0 +1,42 @@
1
+
2
+ /*
3
+ * @Author: shiguo
4
+ * @Date: 2022-04-24 14:27:02
5
+ * @LastEditors: shiguo
6
+ * @LastEditTime: 2023-03-23 12:36:02
7
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/index.d.ts
8
+ */
9
+ import * as React from 'react'
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+ declare namespace ScannerOptions {
21
+
22
+ type CallBack = (e: string) => void;
23
+
24
+
25
+ type RefAttributes = {
26
+ showScanner: (cb: CallBack) => void;
27
+ hideScanner: () => void;
28
+ }
29
+ }
30
+
31
+
32
+
33
+ export declare const showScanner: (cb: ScannerOptions.CallBack) => void;
34
+
35
+
36
+ export declare const hideScanner: () => void;
37
+
38
+
39
+ export declare const scannerRef: React.RefObject<ScannerOptions.RefAttributes>;
40
+
41
+ export declare const Scanner: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<ScannerOptions.RefAttributes>>
42
+
package/lib/Hud/index.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:14:42
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 09:55:43
6
- * @FilePath: /cmwy-device-app/node_modules/@aks-dev/easyui/lib/Hud/index.ts
5
+ * @LastEditTime: 2023-03-23 11:05:22
6
+ * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/index.ts
7
7
  */
8
8
 
9
9
 
@@ -16,4 +16,5 @@ export * from './Toast'
16
16
  export * from './AlertBottomView'
17
17
  export * from './AlertSheetView'
18
18
  export * from './PopoverView'
19
+ export * from './Scanner'
19
20
  export declare const Hud: React.FC<{}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.150",
3
+ "version": "1.0.153",
4
4
  "description": "工具箱",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",
@@ -39,6 +39,8 @@
39
39
  "@aks-dev/react-native-syan-image-picker": "*",
40
40
  "react": "*",
41
41
  "react-native": "*",
42
+ "react-native-camera": "*",
43
+ "react-native-permissions": "*",
42
44
  "react-native-webview": "*"
43
45
  },
44
46
  "dependencies": {
@@ -52,6 +54,8 @@
52
54
  "@aks-dev/react-native-syan-image-picker": "^0.5.58",
53
55
  "@types/react": "^17.0.39",
54
56
  "@types/react-native": "^0.67.4",
57
+ "react-native-camera": "^4.2.1",
58
+ "react-native-permissions": "^3.8.0",
55
59
  "react-native-webview": "^11.18.2",
56
60
  "tslib": "^2.4.0",
57
61
  "typescript": "^4.6.3"
@@ -0,0 +1,26 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-19 10:25:14
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-05-31 18:34:57
6
+ * @FilePath: /@aks-dev/easyui/screen/index.ts
7
+ */
8
+ export declare const deviceWidth: number; //设备的宽度
9
+ export declare const deviceHeight: number; //设备的高度
10
+ export declare const isAndroid: boolean;
11
+ export declare const isIos: boolean;
12
+ export declare const px2dp: (uiElePx: number) => number;
13
+ export declare const px2sp: (fontSize: number) => number;
14
+ export declare const isiPhoneX: boolean;
15
+ /**
16
+ * @description: 状态栏的高度
17
+ * @param {*}
18
+ * @return {*}
19
+ */
20
+ export declare const statusBarHeight: number;
21
+ /**
22
+ * @description: 顶部导航条的高度,高度不包含statusBarHeight
23
+ * @param {*}
24
+ * @return {*}
25
+ */
26
+ export declare const navigationBarHeight: number;
package/screen/index.ts CHANGED
@@ -2,25 +2,9 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-19 10:25:14
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-05-31 18:34:57
5
+ * @LastEditTime: 2023-03-23 15:09:24
6
6
  * @FilePath: /@aks-dev/easyui/screen/index.ts
7
7
  */
8
- export declare const deviceWidth: number; //设备的宽度
9
- export declare const deviceHeight: number; //设备的高度
10
- export declare const isAndroid: boolean;
11
- export declare const isIos: boolean;
12
- export declare const px2dp: (uiElePx: number) => number;
13
- export declare const px2sp: (fontSize: number) => number;
14
- export declare const isiPhoneX: boolean;
15
- /**
16
- * @description: 状态栏的高度
17
- * @param {*}
18
- * @return {*}
19
- */
20
- export declare const statusBarHeight: number;
21
- /**
22
- * @description: 顶部导航条的高度,高度不包含statusBarHeight
23
- * @param {*}
24
- * @return {*}
25
- */
26
- export declare const navigationBarHeight: number;
8
+ /// 全局适配
9
+ export * from '../screen/px2dp'
10
+ export * from '../screen/px2sp'
package/src/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-26 11:44:22
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-12-21 18:15:26
5
+ * @LastEditTime: 2023-03-23 15:18:29
6
6
  * @FilePath: /@aks-dev/easyui/src/index.d.ts
7
7
  */
8
8
 
@@ -11,46 +11,32 @@
11
11
  /// 组件 easy-ui
12
12
 
13
13
  export * from '../lib/Badge'
14
-
15
14
  export * from '../lib/Hud'
16
-
17
15
  export * from '../lib/Modal'
18
-
19
16
  export * from '../lib/MutiPictureView'
20
-
21
17
  export * from '../lib/PictureViewer'
22
-
23
18
  export * from '../lib/RefreshList'
24
-
25
19
  export * from '../lib/TableCell'
26
-
27
20
  export * from '../lib/TextInputArea'
28
-
29
21
  export * from '../lib/WithLoadingContainer'
30
-
31
-
32
22
  export * from '../lib/StickHeaderView'
33
-
34
23
  export * from '../lib/Echarts'
35
-
36
- /// 全局适配
37
- export * from '../screen'
38
-
39
-
40
24
  export * from '../lib/RichText'
41
-
42
-
43
25
  export * from '../lib/DottedLine'
44
-
45
26
  export * from '../lib/MenuView'
46
27
  export * from '../lib/AnimationModal'
47
28
 
48
29
 
30
+
31
+ /// 全局适配
32
+ export * from '../screen/index.d'
49
33
  /// 工具
50
- import * as utils from '../utils'
51
- export {
52
- utils
53
- }
34
+ export * as utils from '../utils/index.d'
35
+ // export {
36
+ // utils
37
+ // }
38
+ ///
39
+ export * as jsbridge from '../jsbridge/index.d'
54
40
 
55
41
  //通用类型
56
42
  export type ItemProps = {
@@ -58,7 +44,3 @@ export type ItemProps = {
58
44
  index: number
59
45
  }
60
46
 
61
-
62
-
63
- ///
64
- export * as jsbridge from '../jsbridge'
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * @Author: shiguo
4
4
  * @Date: 2022-04-13 12:47:34
5
5
  * @LastEditors: shiguo
6
- * @LastEditTime: 2022-12-21 18:15:37
6
+ * @LastEditTime: 2023-03-23 15:17:22
7
7
  * @FilePath: /@aks-dev/easyui/src/index.ts
8
8
  */
9
9
 
@@ -21,55 +21,35 @@ export {
21
21
  showAlertModal,
22
22
  showAlertBottomModal,
23
23
  showAlertSheetModal,
24
- showPopoverView, hidePopoverView
24
+ showPopoverView, hidePopoverView,
25
+ showScanner, hideScanner
25
26
  } from '../lib/Hud/Hud'
26
-
27
27
  export * from '../lib/Modal/Modal'
28
-
29
28
  export { default as MutiPictureView } from '../lib/MutiPictureView/MutiPictureView'
30
-
31
29
  export { PictureViewer } from '../lib/PictureViewer/PictureViewer'
32
-
33
30
  export { default as RefreshList } from '../lib/RefreshList/RefreshList'
34
31
  export { RefreshState } from '../lib/RefreshList'
35
-
36
-
37
32
  export { default as TableCell } from '../lib/TableCell/TableCell'
38
-
39
-
40
33
  export { default as TextInputArea } from '../lib/TextInputArea/TextInputArea'
41
-
42
-
43
34
  export { default as WithLoadingContainer } from '../lib/WithLoadingContainer/WithLoadingContainer'
44
35
  export { WithLoadingContainerProps, Status } from '../lib/WithLoadingContainer'
45
-
46
-
47
36
  export { default as StickHeaderView } from '../lib/StickHeaderView/StickHeaderView'
48
-
49
37
  export { default as EchartsView } from '../lib/Echarts/EchartsView'
50
38
  export { echarts } from '../lib/Echarts'
51
-
52
39
  export { default as RichText } from '../lib/RichText/RichText'
53
40
  export { default as DottedLine } from '../lib/DottedLine/DottedLine'
54
-
55
41
  export { default as MenuView } from '../lib/MenuView/MenuView'
56
-
57
-
58
42
  export { AnimationModal } from '../lib/AnimationModal/AnimationModal'
59
43
 
60
44
 
61
45
  /// 全局适配
62
- export * from '../screen/px2dp'
63
- export * from '../screen/px2sp'
64
-
46
+ export * from '../screen'
65
47
  /// 工具
66
- import * as mode from '../utils/mode'
67
- import * as lazy from '../utils/lazy'
68
- export const utils = Object.assign({}, mode, lazy)
69
-
70
-
48
+ export * as utils from '../utils'
71
49
 
72
50
  ///  桥接
73
- import * as UpgradeModule from '../jsbridge/UpgradeModule'
74
- import * as RNEasyui from '../jsbridge/RNEasyui'
75
- export const jsbridge = Object.assign({}, UpgradeModule,RNEasyui)
51
+ export * as jsbridge from '../jsbridge'
52
+ // export {
53
+ // utils,
54
+ // jsbridge
55
+ // }
@@ -0,0 +1,96 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-19 10:25:43
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2023-02-28 12:07:51
6
+ * @FilePath: /@aks-dev/easyui/utils/index.ts
7
+ */
8
+
9
+ import * as rn from 'react-native';
10
+
11
+ /**
12
+ * @description: 睡眠时间
13
+ * @param {*}毫秒值
14
+ * @return {*}
15
+ */
16
+ type TArgs = (args: void) => void;
17
+ export declare const sleep: (msec?: number) => Promise<TArgs>;
18
+
19
+
20
+ /**
21
+ * @description: 通过手势关闭键盘
22
+ * @return {*}
23
+ */
24
+ export declare const keyboardDismissHandlers: rn.GestureResponderHandlers;
25
+
26
+ export type CallBack = (...args: any[]) => void;
27
+
28
+
29
+
30
+
31
+ /**
32
+ * @description: 手势动作回调
33
+ * @param {*}
34
+ * @return {*}
35
+ */
36
+ export declare const panHandlersCallback: (props: { GrantCallback: CallBack, MoveCallback: CallBack, ReleaseCallback: CallBack }) => void;
37
+
38
+ /**
39
+ * @description: 拨打电话
40
+ * @param {number} phone
41
+ * @return {*}
42
+ */
43
+ export declare const callTelephone: (phone: number | string) => void;
44
+
45
+ /**
46
+ * @description: 获取随机色
47
+ * @param {*}
48
+ * @return {*}
49
+ */
50
+ export declare const randomcolor: () => string;
51
+
52
+
53
+
54
+ export type SyncLoopCallBack = (item: any, index: number) => void;
55
+ /**
56
+ * @description: 同步循环
57
+ * @param {*} dataList:数据源
58
+ * @return {*}
59
+ */
60
+ export declare const syncLoop: (dataList: any[], callback: SyncLoopCallBack) => Promise<string>;
61
+
62
+
63
+ /**
64
+ * @description: 对11位手机号码加*
65
+ * @return {*}
66
+ */
67
+ export declare const encryptMobilePhoneNumber: (text: string) => string;
68
+ /**
69
+ * @description: 判断对象
70
+ * @return {*}
71
+ */
72
+ export declare const isObject: (exp: any) => boolean;
73
+ export declare const isArray: (exp: any) => boolean;
74
+ export declare const isString: (exp: any) => boolean;
75
+ export declare const isNumber: (exp: any) => boolean;
76
+ export declare const isNull: (exp: any) => boolean;
77
+ export declare const isNullObject: (obj: any) => boolean;
78
+ export declare const isUndefined: (exp: any) => boolean;
79
+ export declare const isObjectValueEqual: (a: any, b: any) => boolean;
80
+ export declare const deepEqual: (x: any, y: any) => boolean;
81
+ export declare function deepClone(target: any): any;
82
+ export declare const isPhoneNumber: (str: string) => boolean;
83
+ export declare const toDateFriendly: (dateStr: string) => string;
84
+ export declare const isChainChar: (str: string) => boolean;
85
+ export declare const isHaveChartCount: (str: string) => number;
86
+ export declare const isHaveNumberCount: (str: string) => number;
87
+ export declare const isHaveChinese: (text: string) => boolean;
88
+ export declare const isHaveEmojiCharact: (substring: string) => boolean;
89
+
90
+
91
+ /**
92
+ * @description: 获得32位随机字符
93
+ * @return {*}
94
+ */
95
+ export declare const getUuid: () => string;
96
+
package/utils/index.ts CHANGED
@@ -2,95 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-19 10:25:43
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2023-02-28 12:07:51
5
+ * @LastEditTime: 2023-03-23 15:08:21
6
6
  * @FilePath: /@aks-dev/easyui/utils/index.ts
7
7
  */
8
-
9
- import * as rn from 'react-native';
10
-
11
- /**
12
- * @description: 睡眠时间
13
- * @param {*}毫秒值
14
- * @return {*}
15
- */
16
- type TArgs = (args: void) => void;
17
- export declare const sleep: (msec?: number) => Promise<TArgs>;
18
-
19
-
20
- /**
21
- * @description: 通过手势关闭键盘
22
- * @return {*}
23
- */
24
- export declare const keyboardDismissHandlers: rn.GestureResponderHandlers;
25
-
26
- export type CallBack = (...args: any[]) => void;
27
-
28
-
29
-
30
-
31
- /**
32
- * @description: 手势动作回调
33
- * @param {*}
34
- * @return {*}
35
- */
36
- export declare const panHandlersCallback: (props: { GrantCallback: CallBack, MoveCallback: CallBack, ReleaseCallback: CallBack }) => void;
37
-
38
- /**
39
- * @description: 拨打电话
40
- * @param {number} phone
41
- * @return {*}
42
- */
43
- export declare const callTelephone: (phone: number | string) => void;
44
-
45
- /**
46
- * @description: 获取随机色
47
- * @param {*}
48
- * @return {*}
49
- */
50
- export declare const randomcolor: () => string;
51
-
52
-
53
-
54
- export type SyncLoopCallBack = (item: any, index: number) => void;
55
- /**
56
- * @description: 同步循环
57
- * @param {*} dataList:数据源
58
- * @return {*}
59
- */
60
- export declare const syncLoop: (dataList: any[], callback: SyncLoopCallBack) => Promise<string>;
61
-
62
-
63
- /**
64
- * @description: 对11位手机号码加*
65
- * @return {*}
66
- */
67
- export declare const encryptMobilePhoneNumber: (text: string) => string;
68
- /**
69
- * @description: 判断对象
70
- * @return {*}
71
- */
72
- export declare const isObject: (exp: any) => boolean;
73
- export declare const isArray: (exp: any) => boolean;
74
- export declare const isString: (exp: any) => boolean;
75
- export declare const isNumber: (exp: any) => boolean;
76
- export declare const isNull: (exp: any) => boolean;
77
- export declare const isNullObject: (obj: any) => boolean;
78
- export declare const isUndefined: (exp: any) => boolean;
79
- export declare const isObjectValueEqual: (a: any, b: any) => boolean;
80
- export declare const deepEqual: (x: any, y: any) => boolean;
81
- export declare function deepClone(target: any): any;
82
- export declare const isPhoneNumber: (str: string) => boolean;
83
- export declare const toDateFriendly: (dateStr: string) => string;
84
- export declare const isChainChar: (str: string) => boolean;
85
- export declare const isHaveChartCount: (str: string) => number;
86
- export declare const isHaveNumberCount: (str: string) => number;
87
- export declare const isHaveChinese: (text: string) => boolean;
88
- export declare const isHaveEmojiCharact: (substring: string) => boolean;
89
-
90
-
91
- /**
92
- * @description: 获得32位随机字符
93
- * @return {*}
94
- */
95
- export declare const getUuid: () => string;
96
-
8
+ export * from '../utils/mode'
9
+ export * from '../utils/lazy'
package/utils/lazy.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-27 18:17:54
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-10 14:04:08
5
+ * @LastEditTime: 2023-03-23 15:07:44
6
6
  * @FilePath: /@aks-dev/easyui/utils/lazy.ts
7
7
  */
8
- import type { SyncLoopCallBack } from '.'
8
+ import type { SyncLoopCallBack } from './index.d'
9
9
 
10
10
  export const sleep = (msec?: number) => {
11
11
  return new Promise(resolve => {
package/utils/mode.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-18 18:40:07
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-20 10:17:07
5
+ * @LastEditTime: 2023-03-23 15:07:57
6
6
  * @FilePath: /@aks-dev/easyui/utils/mode.ts
7
7
  */
8
- import type { CallBack } from '.'
8
+ import type { CallBack } from './index.d'
9
9
 
10
10
 
11
11