@aks-dev/easyui 1.0.151 → 1.0.154
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.
- package/jsbridge/UpgradeModule.ts +2 -2
- package/jsbridge/index.d.ts +67 -0
- package/jsbridge/index.ts +3 -61
- package/lib/Hud/Scanner/Scanner.tsx +9 -15
- package/package.json +5 -3
- package/screen/index.d.ts +26 -0
- package/screen/index.ts +4 -20
- package/src/index.d.ts +6 -28
- package/src/index.ts +9 -31
- package/utils/index.d.ts +96 -0
- package/utils/index.ts +3 -90
- package/utils/lazy.ts +2 -2
- package/utils/mode.ts +2 -2
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-05-05 14:19:39
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime:
|
|
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:
|
|
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'
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-24 14:27:02
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-23
|
|
5
|
+
* @LastEditTime: 2023-03-23 15:04:18
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/Scanner.tsx
|
|
7
7
|
*/
|
|
8
8
|
import React, { useImperativeHandle, useState } from 'react';
|
|
9
9
|
import {
|
|
10
10
|
Animated, BackHandler, Easing, Image, StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle
|
|
11
11
|
} from 'react-native';
|
|
12
|
-
import { RNCamera } from 'react-native-camera';
|
|
12
|
+
import { RNCamera, BarCodeReadEvent } from 'react-native-camera';
|
|
13
13
|
import { PERMISSIONS, requestMultiple } from 'react-native-permissions';
|
|
14
14
|
import { navigationBarHeight, px2dp, statusBarHeight } from '../../../screen/px2dp';
|
|
15
15
|
import { px2sp } from '../../../screen/px2sp';
|
|
@@ -29,12 +29,12 @@ import { ScannerOptions } from './index';
|
|
|
29
29
|
// }
|
|
30
30
|
|
|
31
31
|
export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, ref) => {
|
|
32
|
-
const [show, setShow] = useState(false);
|
|
33
|
-
const [torchOn, setTorchOn] = React.useState(false)
|
|
32
|
+
const [show, setShow] = useState<boolean>(false);
|
|
33
|
+
const [torchOn, setTorchOn] = React.useState<boolean>(false)
|
|
34
34
|
const moveAnim = React.useRef(new Animated.Value(0)).current
|
|
35
35
|
const [pointStyle, setPointStyle] = React.useState<StyleProp<ViewStyle>>()
|
|
36
|
-
const cameraRef = React.useRef
|
|
37
|
-
const _cbRef
|
|
36
|
+
const cameraRef: React.MutableRefObject<RNCamera> = React.useRef() as any
|
|
37
|
+
const _cbRef: React.MutableRefObject<ScannerOptions.CallBack> = React.useRef() as any
|
|
38
38
|
const _scanerResultRef = React.useRef<any>()
|
|
39
39
|
React.useEffect(() => {
|
|
40
40
|
const onBackPress = () => {
|
|
@@ -145,7 +145,7 @@ export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, re
|
|
|
145
145
|
// }
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
const onBarCodeRead = (e) => {
|
|
148
|
+
const onBarCodeRead = (e: BarCodeReadEvent) => {
|
|
149
149
|
// console.log('ss onBarCodeRead: ', JSON.stringify(e))
|
|
150
150
|
if (e?.data?.length > 0 && _scanerResultRef.current == undefined) {
|
|
151
151
|
_scanerResultRef.current = e?.data
|
|
@@ -162,8 +162,7 @@ export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, re
|
|
|
162
162
|
|
|
163
163
|
if (!show) return null;
|
|
164
164
|
return (
|
|
165
|
-
<TouchableOpacity disabled style={
|
|
166
|
-
|
|
165
|
+
<TouchableOpacity disabled style={StyleSheet.absoluteFillObject}>
|
|
167
166
|
<RNCamera
|
|
168
167
|
ref={cameraRef}
|
|
169
168
|
captureAudio={false}
|
|
@@ -201,9 +200,7 @@ export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, re
|
|
|
201
200
|
<View style={styles.rectangleRight} />
|
|
202
201
|
</View>
|
|
203
202
|
|
|
204
|
-
<TouchableOpacity onPress={() =>
|
|
205
|
-
setTorchOn(!torchOn)
|
|
206
|
-
}}>
|
|
203
|
+
<TouchableOpacity onPress={() => setTorchOn(!torchOn)}>
|
|
207
204
|
<Image
|
|
208
205
|
source={torchOn ? require('./flashlight-blue.png') : require('./flashlight-white.png')}
|
|
209
206
|
style={styles.flashlight} />
|
|
@@ -225,9 +222,6 @@ const scanW = 225
|
|
|
225
222
|
const scanCornerLineLength = 15;
|
|
226
223
|
const scanCornerLineHeight = 3
|
|
227
224
|
const styles = StyleSheet.create({
|
|
228
|
-
container: {
|
|
229
|
-
...StyleSheet.absoluteFillObject,
|
|
230
|
-
},
|
|
231
225
|
camera: { display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: "red" },
|
|
232
226
|
cameraBackground: { width: px2dp(scanW), height: px2dp(scanW), backgroundColor: transparent },
|
|
233
227
|
scanContainer: { display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.154",
|
|
4
4
|
"description": "工具箱",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@aks-dev/react-native-syan-image-picker": "*",
|
|
40
40
|
"react": "*",
|
|
41
41
|
"react-native": "*",
|
|
42
|
-
"react-native-
|
|
42
|
+
"react-native-camera": "*",
|
|
43
43
|
"react-native-permissions": "*",
|
|
44
|
-
"react-native-
|
|
44
|
+
"react-native-webview": "*"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"echarts": "^5.3.2",
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"@aks-dev/react-native-syan-image-picker": "^0.5.58",
|
|
55
55
|
"@types/react": "^17.0.39",
|
|
56
56
|
"@types/react-native": "^0.67.4",
|
|
57
|
+
"react-native-camera": "^4.2.1",
|
|
58
|
+
"react-native-permissions": "^3.8.0",
|
|
57
59
|
"react-native-webview": "^11.18.2",
|
|
58
60
|
"tslib": "^2.4.0",
|
|
59
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:
|
|
5
|
+
* @LastEditTime: 2023-03-23 15:09:24
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/screen/index.ts
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
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: 2023-03-23
|
|
5
|
+
* @LastEditTime: 2023-03-23 15:24:35
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/src/index.d.ts
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -11,46 +11,28 @@
|
|
|
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
|
-
|
|
51
|
-
export
|
|
52
|
-
utils
|
|
53
|
-
}
|
|
34
|
+
export * as utils from '../utils/index.d'
|
|
35
|
+
export * as jsbridge from '../jsbridge/index.d'
|
|
54
36
|
|
|
55
37
|
//通用类型
|
|
56
38
|
export type ItemProps = {
|
|
@@ -58,7 +40,3 @@ export type ItemProps = {
|
|
|
58
40
|
index: number
|
|
59
41
|
}
|
|
60
42
|
|
|
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: 2023-03-23
|
|
6
|
+
* @LastEditTime: 2023-03-23 15:24:12
|
|
7
7
|
* @FilePath: /@aks-dev/easyui/src/index.ts
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -22,55 +22,33 @@ export {
|
|
|
22
22
|
showAlertBottomModal,
|
|
23
23
|
showAlertSheetModal,
|
|
24
24
|
showPopoverView, hidePopoverView,
|
|
25
|
-
showScanner,hideScanner
|
|
25
|
+
showScanner, hideScanner
|
|
26
26
|
} from '../lib/Hud/Hud'
|
|
27
|
-
|
|
28
27
|
export * from '../lib/Modal/Modal'
|
|
29
|
-
|
|
30
28
|
export { default as MutiPictureView } from '../lib/MutiPictureView/MutiPictureView'
|
|
31
|
-
|
|
32
29
|
export { PictureViewer } from '../lib/PictureViewer/PictureViewer'
|
|
33
|
-
|
|
34
30
|
export { default as RefreshList } from '../lib/RefreshList/RefreshList'
|
|
35
31
|
export { RefreshState } from '../lib/RefreshList'
|
|
36
|
-
|
|
37
|
-
|
|
38
32
|
export { default as TableCell } from '../lib/TableCell/TableCell'
|
|
39
|
-
|
|
40
|
-
|
|
41
33
|
export { default as TextInputArea } from '../lib/TextInputArea/TextInputArea'
|
|
42
|
-
|
|
43
|
-
|
|
44
34
|
export { default as WithLoadingContainer } from '../lib/WithLoadingContainer/WithLoadingContainer'
|
|
45
35
|
export { WithLoadingContainerProps, Status } from '../lib/WithLoadingContainer'
|
|
46
|
-
|
|
47
|
-
|
|
48
36
|
export { default as StickHeaderView } from '../lib/StickHeaderView/StickHeaderView'
|
|
49
|
-
|
|
50
37
|
export { default as EchartsView } from '../lib/Echarts/EchartsView'
|
|
51
38
|
export { echarts } from '../lib/Echarts'
|
|
52
|
-
|
|
53
39
|
export { default as RichText } from '../lib/RichText/RichText'
|
|
54
40
|
export { default as DottedLine } from '../lib/DottedLine/DottedLine'
|
|
55
|
-
|
|
56
41
|
export { default as MenuView } from '../lib/MenuView/MenuView'
|
|
57
|
-
|
|
58
|
-
|
|
59
42
|
export { AnimationModal } from '../lib/AnimationModal/AnimationModal'
|
|
60
43
|
|
|
61
44
|
|
|
62
45
|
/// 全局适配
|
|
63
|
-
export * from '../screen
|
|
64
|
-
export * from '../screen/px2sp'
|
|
65
|
-
|
|
46
|
+
export * from '../screen'
|
|
66
47
|
/// 工具
|
|
67
|
-
import * as
|
|
68
|
-
import * as lazy from '../utils/lazy'
|
|
69
|
-
export const utils = Object.assign({}, mode, lazy)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
import * as utils from '../utils'
|
|
73
49
|
/// 桥接
|
|
74
|
-
import * as
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
import * as jsbridge from '../jsbridge'
|
|
51
|
+
export {
|
|
52
|
+
utils,
|
|
53
|
+
jsbridge
|
|
54
|
+
}
|
package/utils/index.d.ts
ADDED
|
@@ -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-
|
|
5
|
+
* @LastEditTime: 2023-03-23 15:08:21
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/utils/index.ts
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
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-
|
|
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:
|
|
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
|
|