@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.
- package/dist/components/AnimationModal/AnimationModal.d.ts +27 -0
- package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -0
- package/dist/components/AnimationModal/AnimationModal.js +151 -0
- package/dist/components/Badge/Badge.d.ts +8 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +35 -0
- package/dist/components/DottedLine/DottedLine.d.ts +10 -0
- package/dist/components/DottedLine/DottedLine.d.ts.map +1 -0
- package/dist/components/DottedLine/DottedLine.js +50 -0
- package/dist/components/EchartsView/EchartsView.d.ts +10 -0
- package/dist/components/EchartsView/EchartsView.d.ts.map +1 -0
- package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
- package/dist/components/EchartsView/helper.d.ts +10 -0
- package/dist/components/EchartsView/helper.d.ts.map +1 -0
- package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
- package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
- package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
- package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
- package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
- package/dist/components/Hud/AlertView/AlertView.d.ts +25 -0
- package/dist/components/Hud/AlertView/AlertView.d.ts.map +1 -0
- package/dist/components/Hud/AlertView/AlertView.js +184 -0
- package/dist/components/Hud/Hud.d.ts +11 -0
- package/dist/components/Hud/Hud.d.ts.map +1 -0
- package/dist/components/Hud/Hud.js +29 -0
- package/dist/components/Hud/Loading/Loading.d.ts +11 -0
- package/dist/components/Hud/Loading/Loading.d.ts.map +1 -0
- package/dist/components/Hud/Loading/Loading.js +66 -0
- package/dist/components/Hud/PopoverView/PopoverView.d.ts +17 -0
- package/dist/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
- package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
- package/dist/components/Hud/Scanner/Scanner.d.ts +12 -0
- package/dist/components/Hud/Scanner/Scanner.d.ts.map +1 -0
- package/dist/components/Hud/Scanner/Scanner.js +301 -0
- package/dist/components/Hud/Toast/Toast.d.ts +9 -0
- package/dist/components/Hud/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Hud/Toast/Toast.js +71 -0
- package/dist/components/MenuView/MenuView.d.ts +21 -0
- package/dist/components/MenuView/MenuView.d.ts.map +1 -0
- package/dist/components/MenuView/MenuView.js +184 -0
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
- package/{lib/MutiPictureView/index.ts → dist/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
- package/dist/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
- package/dist/components/MutiPictureView/MutiPictureView.js +243 -0
- package/dist/components/PictureViewer/PictureViewer.d.ts +17 -0
- package/dist/components/PictureViewer/PictureViewer.d.ts.map +1 -0
- package/dist/components/PictureViewer/PictureViewer.js +54 -0
- package/dist/components/RefreshList/RefreshList.d.ts +45 -0
- package/dist/components/RefreshList/RefreshList.d.ts.map +1 -0
- package/dist/components/RefreshList/RefreshList.js +155 -0
- package/dist/components/RichText/RichText.d.ts +12 -0
- package/dist/components/RichText/RichText.d.ts.map +1 -0
- package/dist/components/RichText/RichText.js +56 -0
- package/dist/components/StickHeaderView/StickHeaderView.d.ts +15 -0
- package/dist/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
- package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
- package/{lib/TableCell/index.ts → dist/components/TableCell/TableCell.d.ts} +8 -30
- package/dist/components/TableCell/TableCell.d.ts.map +1 -0
- package/dist/components/TableCell/TableCell.js +97 -0
- package/dist/components/TextInputArea/TextInputArea.d.ts +17 -0
- package/dist/components/TextInputArea/TextInputArea.d.ts.map +1 -0
- package/dist/components/TextInputArea/TextInputArea.js +65 -0
- package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
- package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
- package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/jsbridge/RNEasyui.d.ts +23 -0
- package/dist/jsbridge/RNEasyui.d.ts.map +1 -0
- package/dist/jsbridge/RNEasyui.js +46 -0
- package/dist/jsbridge/UpgradeModule.d.ts +26 -0
- package/dist/jsbridge/UpgradeModule.d.ts.map +1 -0
- package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
- package/dist/jsbridge/index.d.ts +3 -0
- package/dist/jsbridge/index.d.ts.map +1 -0
- package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
- package/dist/screen/index.d.ts +3 -0
- package/dist/screen/index.d.ts.map +1 -0
- package/{screen/index.ts → dist/screen/index.js} +2 -2
- package/{screen/index.d.ts → dist/screen/px2dp.d.ts} +6 -12
- package/dist/screen/px2dp.d.ts.map +1 -0
- package/dist/screen/px2dp.js +45 -0
- package/dist/screen/px2sp.d.ts +2 -0
- package/dist/screen/px2sp.d.ts.map +1 -0
- package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
- package/dist/screen/text-fit.d.ts +5 -0
- package/dist/screen/text-fit.d.ts.map +1 -0
- package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/{utils/index.ts → dist/utils/index.js} +2 -2
- package/{utils/index.d.ts → dist/utils/lazy.d.ts} +15 -53
- package/dist/utils/lazy.d.ts.map +1 -0
- package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
- package/dist/utils/mode.d.ts +24 -0
- package/dist/utils/mode.d.ts.map +1 -0
- package/dist/utils/mode.js +50 -0
- package/package.json +32 -22
- package/readme.md +3 -3
- package/android/.DS_Store +0 -0
- package/android/src/.DS_Store +0 -0
- package/android/src/main/.DS_Store +0 -0
- package/android/src/main/java/.DS_Store +0 -0
- package/android/src/main/java/com/.DS_Store +0 -0
- package/android/src/main/java/com/easyui/.DS_Store +0 -0
- package/i.sh +0 -23
- package/ios/.DS_Store +0 -0
- package/ios/assets/.DS_Store +0 -0
- package/ios/views/.DS_Store +0 -0
- package/jsbridge/RNEasyui.ts +0 -42
- package/jsbridge/index.d.ts +0 -67
- package/lib/.DS_Store +0 -0
- package/lib/AnimationModal/AnimationModal.tsx +0 -201
- package/lib/AnimationModal/index.d.ts +0 -41
- package/lib/Badge/Badge.tsx +0 -40
- package/lib/Badge/index.ts +0 -21
- package/lib/DottedLine/DottedLine.tsx +0 -66
- package/lib/DottedLine/index.ts +0 -18
- package/lib/Echarts/demo.tsx +0 -235
- package/lib/Echarts/index.ts +0 -29
- package/lib/Hud/.DS_Store +0 -0
- package/lib/Hud/AlertBottomView/AlertBottomView.tsx +0 -228
- package/lib/Hud/AlertBottomView/index.d.ts +0 -42
- package/lib/Hud/AlertSheetView/AlertSheetView.tsx +0 -179
- package/lib/Hud/AlertSheetView/index.d.ts +0 -35
- package/lib/Hud/AlertView/AlertView.tsx +0 -234
- package/lib/Hud/AlertView/index.d.ts +0 -46
- package/lib/Hud/Hud.tsx +0 -67
- package/lib/Hud/Loading/Loading.tsx +0 -87
- package/lib/Hud/Loading/index.d.ts +0 -38
- package/lib/Hud/PopoverView/PopoverView.tsx +0 -66
- package/lib/Hud/PopoverView/index.d.ts +0 -39
- package/lib/Hud/Scanner/Scanner.tsx +0 -250
- package/lib/Hud/Scanner/index.d.ts +0 -42
- package/lib/Hud/Toast/Toast.tsx +0 -86
- package/lib/Hud/Toast/index.d.ts +0 -22
- package/lib/Hud/index.ts +0 -20
- package/lib/MenuView/MenuView.tsx +0 -252
- package/lib/MenuView/index.ts +0 -31
- package/lib/Modal/index.ts +0 -10
- package/lib/MutiPictureView/MutiPictureView.tsx +0 -259
- package/lib/PictureViewer/PictureViewer.tsx +0 -80
- package/lib/PictureViewer/index.ts +0 -26
- package/lib/RefreshList/RefreshList.tsx +0 -235
- package/lib/RefreshList/demo.tsx +0 -30
- package/lib/RefreshList/demo1.tsx +0 -60
- package/lib/RefreshList/demo2.tsx +0 -46
- package/lib/RefreshList/index.ts +0 -84
- package/lib/RichText/RichText.tsx +0 -82
- package/lib/RichText/index.ts +0 -21
- package/lib/StickHeaderView/StickHeaderView.tsx +0 -65
- package/lib/StickHeaderView/demo.tsx +0 -104
- package/lib/StickHeaderView/index.ts +0 -26
- package/lib/TableCell/TableCell.tsx +0 -118
- package/lib/TextInputArea/TextInputArea.tsx +0 -89
- package/lib/TextInputArea/index.d.ts +0 -33
- package/lib/WithLoadingContainer/WithLoadingContainer.tsx +0 -93
- package/lib/WithLoadingContainer/index.ts +0 -36
- package/screen/px2dp.ts +0 -51
- package/src/index.d.ts +0 -42
- package/src/index.ts +0 -54
- package/utils/mode.ts +0 -48
- /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-blue.png +0 -0
- /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-white.png +0 -0
- /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/icon_back_white.png +0 -0
- /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_add_image.png +0 -0
- /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_del_image.png +0 -0
- /package/{lib/TableCell → dist/components/TableCell/assets}/back.png +0 -0
- /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading.gif +0 -0
- /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading3.gif +0 -0
- /package/{lib → dist/components}/index.md +0 -0
|
@@ -5,38 +5,40 @@
|
|
|
5
5
|
* @LastEditTime: 2023-03-23 15:15:06
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/jsbridge/UpgradeModule.ts
|
|
7
7
|
*/
|
|
8
|
-
import { NativeModules, PermissionsAndroid, Platform } from
|
|
9
|
-
|
|
8
|
+
import { NativeModules, PermissionsAndroid, Platform } from "react-native";
|
|
10
9
|
const { UpgradeModule } = NativeModules;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @description: 获取App版本号
|
|
12
|
+
* @param {*}
|
|
13
|
+
* @return {*}
|
|
14
|
+
*/
|
|
14
15
|
export const getAppVersion = () => UpgradeModule.getAppVersion();
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @description: 获取操作系统版本
|
|
18
|
+
*
|
|
19
|
+
react-native-device-info
|
|
20
|
+
* @return {*}
|
|
21
|
+
*/
|
|
16
22
|
export const getOSVersion = () => UpgradeModule.getOSVersion();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (Platform.OS == 'android') {
|
|
23
|
+
export const upgrade = async (options) => {
|
|
24
|
+
const { title = "提示" } = options;
|
|
25
|
+
if (Platform.OS == "android") {
|
|
22
26
|
try {
|
|
23
27
|
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, {
|
|
24
|
-
title:
|
|
28
|
+
title: "提示",
|
|
25
29
|
message: "应用升级需要获取APP的写入权限",
|
|
26
30
|
buttonNeutral: "稍后再询问",
|
|
27
31
|
buttonNegative: "取消",
|
|
28
|
-
buttonPositive: "确定"
|
|
29
|
-
})
|
|
32
|
+
buttonPositive: "确定",
|
|
33
|
+
});
|
|
30
34
|
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
31
|
-
return UpgradeModule.upgrade(options)
|
|
35
|
+
return UpgradeModule.upgrade(options);
|
|
32
36
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return Promise.reject("请求权限异常!")
|
|
37
|
+
return Promise.reject("没有应用升级权限!");
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return Promise.reject("请求权限异常!");
|
|
37
41
|
}
|
|
38
|
-
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
+
return UpgradeModule.upgrade(options);
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jsbridge/index.ts"],"names":[],"mappings":"AAOA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screen/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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; //设备的高度
|
|
1
|
+
/**设备宽度,单位 dp */
|
|
2
|
+
export declare const deviceWidth: number;
|
|
3
|
+
export declare const deviceHeight: number;
|
|
10
4
|
export declare const isAndroid: boolean;
|
|
11
5
|
export declare const isIos: boolean;
|
|
12
|
-
export declare const px2dp: (uiElePx: number) => number;
|
|
13
|
-
export declare const px2sp: (fontSize: number) => number;
|
|
14
6
|
export declare const isiPhoneX: boolean;
|
|
7
|
+
export declare const px2dp: (uiElePx: number) => number;
|
|
15
8
|
/**
|
|
16
9
|
* @description: 状态栏的高度
|
|
17
10
|
* @param {*}
|
|
@@ -23,4 +16,5 @@ export declare const statusBarHeight: number;
|
|
|
23
16
|
* @param {*}
|
|
24
17
|
* @return {*}
|
|
25
18
|
*/
|
|
26
|
-
export declare const navigationBarHeight: number;
|
|
19
|
+
export declare const navigationBarHeight: number;
|
|
20
|
+
//# sourceMappingURL=px2dp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"px2dp.d.ts","sourceRoot":"","sources":["../../src/screen/px2dp.ts"],"names":[],"mappings":"AASA,gBAAgB;AAChB,eAAO,MAAM,WAAW,QAAiC,CAAC;AAC1D,eAAO,MAAM,YAAY,QAAkC,CAAC;AAC5D,eAAO,MAAM,SAAS,SAA4B,CAAC;AACnD,eAAO,MAAM,KAAK,SAAwB,CAAC;AAC3C,eAAO,MAAM,SAAS,SAA8B,CAAC;AAUrD,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,WAEpC,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAIxB,CAAC;AACL;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAG5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: shiguo
|
|
3
|
+
* @Date: 2022-04-18 14:32:25
|
|
4
|
+
* @LastEditors: shiguo
|
|
5
|
+
* @LastEditTime: 2022-09-09 10:35:02
|
|
6
|
+
* @FilePath: /@aks-dev/easyui/screen/px2dp.ts
|
|
7
|
+
*/
|
|
8
|
+
import { Dimensions, Platform, StatusBar } from "react-native";
|
|
9
|
+
/**设备宽度,单位 dp */
|
|
10
|
+
export const deviceWidth = Dimensions.get("screen").width; //设备的宽度
|
|
11
|
+
export const deviceHeight = Dimensions.get("screen").height; //设备的高度
|
|
12
|
+
export const isAndroid = Platform.OS === "android";
|
|
13
|
+
export const isIos = Platform.OS === "ios";
|
|
14
|
+
export const isiPhoneX = isIos && deviceHeight > 736;
|
|
15
|
+
/**
|
|
16
|
+
* 375px/667px
|
|
17
|
+
* */
|
|
18
|
+
const uiWidthPx = 375;
|
|
19
|
+
// const pixelRatio = PixelRatio.get()
|
|
20
|
+
// const deviceWidthPx = PixelRatio.getPixelSizeForLayoutSize(deviceWidth);
|
|
21
|
+
export const px2dp = (uiElePx) => {
|
|
22
|
+
return Math.round((uiElePx * deviceWidth) / uiWidthPx);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @description: 状态栏的高度
|
|
26
|
+
* @param {*}
|
|
27
|
+
* @return {*}
|
|
28
|
+
*/
|
|
29
|
+
export const statusBarHeight = (() => {
|
|
30
|
+
if (isAndroid)
|
|
31
|
+
return StatusBar.currentHeight || 24;
|
|
32
|
+
if (isiPhoneX)
|
|
33
|
+
return 44;
|
|
34
|
+
return 20;
|
|
35
|
+
})();
|
|
36
|
+
/**
|
|
37
|
+
* @description: 顶部导航条的高度,高度不包含statusBarHeight
|
|
38
|
+
* @param {*}
|
|
39
|
+
* @return {*}
|
|
40
|
+
*/
|
|
41
|
+
export const navigationBarHeight = (() => {
|
|
42
|
+
if (isAndroid)
|
|
43
|
+
return 56;
|
|
44
|
+
return 44;
|
|
45
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"px2sp.d.ts","sourceRoot":"","sources":["../../src/screen/px2sp.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,WA+DjC,CAAC"}
|
|
@@ -7,17 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Dimensions, PixelRatio } from 'react-native';
|
|
9
9
|
const pixelRatio = PixelRatio.get();
|
|
10
|
-
const width = Dimensions.get('window').width;
|
|
11
|
-
const height = Dimensions.get('window').height;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// height
|
|
19
|
-
// })
|
|
20
|
-
|
|
10
|
+
const width = Dimensions.get('window').width; //设备的宽度
|
|
11
|
+
const height = Dimensions.get('window').height; //设备的高度
|
|
12
|
+
export const px2sp = (size) => {
|
|
13
|
+
// console.log({
|
|
14
|
+
// pixelRatio,
|
|
15
|
+
// width,
|
|
16
|
+
// height
|
|
17
|
+
// })
|
|
21
18
|
if (pixelRatio === 2) {
|
|
22
19
|
// iphone 5s and older Androids
|
|
23
20
|
if (width < 360) {
|
|
@@ -27,7 +24,8 @@ export const px2sp = (size: number) => {
|
|
|
27
24
|
if (height < 667) {
|
|
28
25
|
return size;
|
|
29
26
|
// iphone 6-6s
|
|
30
|
-
}
|
|
27
|
+
}
|
|
28
|
+
else if (height >= 667 && height <= 735) {
|
|
31
29
|
return size * 1.15;
|
|
32
30
|
}
|
|
33
31
|
// older phablets
|
|
@@ -60,21 +58,16 @@ export const px2sp = (size: number) => {
|
|
|
60
58
|
// Catch other smaller android height sizings
|
|
61
59
|
}
|
|
62
60
|
if (height < 667) {
|
|
63
|
-
return size * 1.15
|
|
61
|
+
return size * 1.15; //older:1.20
|
|
64
62
|
// catch in-between size Androids and scale font up
|
|
65
63
|
// a tad but not too much
|
|
66
64
|
}
|
|
67
65
|
if (height >= 667 && height <= 735) {
|
|
68
|
-
return size * 1.20
|
|
66
|
+
return size * 1.20; //older:1.25
|
|
69
67
|
}
|
|
70
68
|
// catch larger phablet devices
|
|
71
|
-
|
|
72
|
-
return size * 1.25;//older:1.30
|
|
69
|
+
return size * 1.25; //older:1.30
|
|
73
70
|
}
|
|
74
71
|
// if older device ie pixelRatio !== 2 || 3 || 3.5
|
|
75
72
|
return size;
|
|
76
73
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-fit.d.ts","sourceRoot":"","sources":["../../src/screen/text-fit.ts"],"names":[],"mappings":"AAOA;;GAEG"}
|
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* 全局配置Text
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import { Platform, Text as Text_spaceName, TextInput as TextInput_spaceName } from 'react-native';
|
|
14
|
-
const Text
|
|
15
|
-
const TextInput
|
|
13
|
+
const Text = Text_spaceName;
|
|
14
|
+
const TextInput = TextInput_spaceName;
|
|
16
15
|
const textDefaultStyle = {
|
|
17
16
|
...Platform.select({
|
|
18
17
|
android: { fontFamily: 'DroidSansFallback' }
|
|
@@ -21,18 +20,13 @@ const textDefaultStyle = {
|
|
|
21
20
|
paddingVertical: 0,
|
|
22
21
|
paddingHorizontal: 0,
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
23
|
const textRender = Text.render;
|
|
28
|
-
Text.render = function (...args
|
|
24
|
+
Text.render = function (...args) {
|
|
29
25
|
const origin = textRender.call(this, ...args);
|
|
30
26
|
return React.cloneElement(origin, {
|
|
31
27
|
style: [textDefaultStyle, origin.props.style]
|
|
32
28
|
});
|
|
33
29
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
30
|
const textInputDefaultStyle = {
|
|
37
31
|
defaultProps: false,
|
|
38
32
|
paddingVertical: 0,
|
|
@@ -40,21 +34,17 @@ const textInputDefaultStyle = {
|
|
|
40
34
|
autoCapitalize: "none", //不自动大写
|
|
41
35
|
autoCorrect: false, //不自动纠正拼写
|
|
42
36
|
};
|
|
43
|
-
|
|
44
37
|
const textInputRender = TextInput.render;
|
|
45
|
-
TextInput.render = function (...args
|
|
38
|
+
TextInput.render = function (...args) {
|
|
46
39
|
const origin = textInputRender.call(this, ...args);
|
|
47
40
|
return React.cloneElement(origin, {
|
|
48
41
|
style: [textInputDefaultStyle, origin.props.style]
|
|
49
42
|
});
|
|
50
43
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
44
|
/**关闭字体缩放 */
|
|
55
|
-
if (!Text.defaultProps)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
TextInput.defaultProps
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
if (!Text.defaultProps)
|
|
46
|
+
Text.defaultProps = {};
|
|
47
|
+
if (!TextInput.defaultProps)
|
|
48
|
+
TextInput.defaultProps = {};
|
|
49
|
+
Text.defaultProps.allowFontScaling = false;
|
|
50
|
+
TextInput.defaultProps.allowFontScaling = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA"}
|
|
@@ -1,65 +1,22 @@
|
|
|
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
1
|
/**
|
|
12
2
|
* @description: 睡眠时间
|
|
13
3
|
* @param {*}毫秒值
|
|
14
4
|
* @return {*}
|
|
15
5
|
*/
|
|
16
|
-
|
|
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
|
-
|
|
6
|
+
export declare const sleep: (msec?: number) => Promise<unknown>;
|
|
45
7
|
/**
|
|
46
8
|
* @description: 获取随机色
|
|
47
9
|
* @param {*}
|
|
48
10
|
* @return {*}
|
|
49
11
|
*/
|
|
50
12
|
export declare const randomcolor: () => string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export type SyncLoopCallBack = (item: any, index: number) => void;
|
|
13
|
+
type SyncLoopCallBack = (item: any, index: number) => void;
|
|
55
14
|
/**
|
|
56
15
|
* @description: 同步循环
|
|
57
16
|
* @param {*} dataList:数据源
|
|
58
17
|
* @return {*}
|
|
59
18
|
*/
|
|
60
19
|
export declare const syncLoop: (dataList: any[], callback: SyncLoopCallBack) => Promise<string>;
|
|
61
|
-
|
|
62
|
-
|
|
63
20
|
/**
|
|
64
21
|
* @description: 对11位手机号码加*
|
|
65
22
|
* @return {*}
|
|
@@ -76,21 +33,26 @@ export declare const isNumber: (exp: any) => boolean;
|
|
|
76
33
|
export declare const isNull: (exp: any) => boolean;
|
|
77
34
|
export declare const isNullObject: (obj: any) => boolean;
|
|
78
35
|
export declare const isUndefined: (exp: any) => boolean;
|
|
36
|
+
/**判断两个对象是否相同 */
|
|
79
37
|
export declare const isObjectValueEqual: (a: any, b: any) => boolean;
|
|
80
38
|
export declare const deepEqual: (x: any, y: any) => boolean;
|
|
81
39
|
export declare function deepClone(target: any): any;
|
|
82
40
|
export declare const isPhoneNumber: (str: string) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param dateStr yyyy-MM-dd HH:mm:ss
|
|
44
|
+
* @returns {string}
|
|
45
|
+
*/
|
|
83
46
|
export declare const toDateFriendly: (dateStr: string) => string;
|
|
84
47
|
export declare const isChainChar: (str: string) => boolean;
|
|
85
|
-
export declare const isHaveChartCount: (str: string) => number;
|
|
86
|
-
export declare const isHaveNumberCount: (str: string) => number;
|
|
48
|
+
export declare const isHaveChartCount: (str: string) => number | undefined;
|
|
49
|
+
export declare const isHaveNumberCount: (str: string) => number | undefined;
|
|
87
50
|
export declare const isHaveChinese: (text: string) => boolean;
|
|
88
51
|
export declare const isHaveEmojiCharact: (substring: string) => boolean;
|
|
89
|
-
|
|
90
|
-
|
|
91
52
|
/**
|
|
92
|
-
* @description: 获得32位随机字符
|
|
93
|
-
* @return {*}
|
|
94
|
-
*/
|
|
53
|
+
* @description: 获得32位随机字符
|
|
54
|
+
* @return {*}
|
|
55
|
+
*/
|
|
95
56
|
export declare const getUuid: () => string;
|
|
96
|
-
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=lazy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/utils/lazy.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,qBAIlC,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,WAAW,cAEvB,CAAC;AAEF,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAC3D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAU,UAAU,GAAG,EAAE,EAAE,UAAU,gBAAgB,oBAazE,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,WAOpD,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,YAEhC,CAAC;AAGF,eAAO,MAAM,OAAO,GAAI,KAAK,GAAG,YAE/B,CAAC;AAGF,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,YAEhC,CAAC;AAGF,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,YAEhC,CAAC;AAGF,eAAO,MAAM,MAAM,GAAI,KAAK,GAAG,YAE9B,CAAC;AAGF,eAAO,MAAM,YAAY,GAAI,KAAK,GAAG,YAOpC,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,KAAK,GAAG,YAEnC,CAAC;AACF,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,GAAI,GAAG,GAAG,EAAE,GAAG,GAAG,YAqBhD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,GAAG,GAAG,EAAE,GAAG,GAAG,YA4CvC,CAAC;AAGF,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CA+B1C;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,YAMxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,WAmC7C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,uBAK3C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,uBAK5C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,YAOzC,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,YAyCnD,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,OAAO,cAYnB,CAAC"}
|