@aks-dev/easyui 1.0.51 → 1.0.52
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/RNEasyui.ts +5 -8
- package/package.json +1 -1
- package/screen/index.ts +1 -3
- package/screen/{text-set.tsx → init-fit.tsx} +12 -3
- package/screen/px2dp.tsx +18 -16
- package/src/index.ts +3 -2
package/jsbridge/RNEasyui.ts
CHANGED
|
@@ -2,21 +2,18 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-19 10:23:01
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-31 17:
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/jsbridge/RNEasyui.
|
|
5
|
+
* @LastEditTime: 2022-05-31 17:26:16
|
|
6
|
+
* @FilePath: /@aks-dev/easyui/jsbridge/RNEasyui.ts
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { NativeModules, Platform
|
|
9
|
+
import { Dimensions, NativeModules, Platform } from 'react-native';
|
|
10
10
|
|
|
11
11
|
const { RNEasyui } = NativeModules;
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const getStatusBarHeight = () => {
|
|
16
|
+
export const getStatusBarHeight = () => {
|
|
20
17
|
if (Platform.OS == 'android') return RNEasyui.getStatusBarHeight();
|
|
21
18
|
|
|
22
19
|
const deviceHeight = Dimensions.get('window').height;
|
|
@@ -24,7 +21,7 @@ const getStatusBarHeight = () => {
|
|
|
24
21
|
if (isiPhoneX) return Promise.resolve(44)
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
const getNavigationBarHeight = () => {
|
|
24
|
+
export const getNavigationBarHeight = () => {
|
|
28
25
|
if (Platform.OS == 'android') return RNEasyui.getNavigationBarHeight();
|
|
29
26
|
const deviceHeight = Dimensions.get('window').height;
|
|
30
27
|
const isiPhoneX = Platform.OS == 'ios' && (deviceHeight > 736)
|
package/package.json
CHANGED
package/screen/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-19 10:25:14
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-31 17:
|
|
5
|
+
* @LastEditTime: 2022-05-31 17:19:03
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/screen/index.ts
|
|
7
7
|
*/
|
|
8
8
|
export declare const deviceWidth: number; //设备的宽度
|
|
@@ -13,14 +13,12 @@ export declare const px2dp: (uiElePx: number) => number;
|
|
|
13
13
|
export declare const px2sp: (fontSize: number) => number;
|
|
14
14
|
export declare const isiPhoneX: boolean;
|
|
15
15
|
/**
|
|
16
|
-
* @deprecated 已废弃,请从jsbridge.getStatusBarHeight()获取
|
|
17
16
|
* @description: 状态栏的高度
|
|
18
17
|
* @param {*}
|
|
19
18
|
* @return {*}
|
|
20
19
|
*/
|
|
21
20
|
export declare const statusBarHeight: number;
|
|
22
21
|
/**
|
|
23
|
-
* @deprecated 已废弃,请从jsbridge.getNavigationBarHeight()获取
|
|
24
22
|
* @description: 顶部导航条的高度
|
|
25
23
|
* @param {*}
|
|
26
24
|
* @return {*}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-15 14:15:07
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-
|
|
6
|
-
* @FilePath: /@aks/
|
|
5
|
+
* @LastEditTime: 2022-05-31 17:25:13
|
|
6
|
+
* @FilePath: /@aks-dev/easyui/screen/init-fit.tsx
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* 全局配置Text
|
|
@@ -55,4 +55,13 @@ TextInput.render = function (...args: any[]) {
|
|
|
55
55
|
if (!Text.defaultProps) Text.defaultProps = {};
|
|
56
56
|
if (!TextInput.defaultProps) TextInput.defaultProps = {};
|
|
57
57
|
Text.defaultProps.allowFontScaling = false
|
|
58
|
-
TextInput.defaultProps.allowFontScaling = false
|
|
58
|
+
TextInput.defaultProps.allowFontScaling = false
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
import * as RNEasyui from '../jsbridge/RNEasyui';
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export const statusBarHeight = await RNEasyui.getStatusBarHeight()
|
|
66
|
+
|
|
67
|
+
export const navigationBarHeight = await RNEasyui.getNavigationBarHeight()
|
package/screen/px2dp.tsx
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-18 14:32:25
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-
|
|
6
|
-
* @FilePath: /@aks/easyui/screen/px2dp.tsx
|
|
5
|
+
* @LastEditTime: 2022-05-31 17:22:42
|
|
6
|
+
* @FilePath: /@aks-dev/easyui/screen/px2dp.tsx
|
|
7
7
|
*/
|
|
8
|
-
import { Dimensions,
|
|
8
|
+
import { Dimensions, Platform } from 'react-native';
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
// 设备宽度,单位 dp
|
|
@@ -13,6 +13,7 @@ export const deviceWidth = Dimensions.get('window').width; //设备的宽
|
|
|
13
13
|
export const deviceHeight = Dimensions.get('window').height; //设备的高度
|
|
14
14
|
export const isAndroid = Platform.OS === "android"
|
|
15
15
|
export const isIos = Platform.OS === 'ios'
|
|
16
|
+
export const isiPhoneX = isIos && (deviceHeight > 736)
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* 375px/667px
|
|
@@ -32,20 +33,21 @@ export const px2dp = (uiElePx: number) => {
|
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
export const isiPhoneX = isIos && (deviceHeight > 736)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
// export const statusBarHeight = (() => {
|
|
39
|
+
// if (isAndroid) {
|
|
40
|
+
// if ((StatusBar.currentHeight || 0) > 20) return 40
|
|
41
|
+
// }
|
|
42
|
+
// if (isiPhoneX) return 44
|
|
43
|
+
// return 20
|
|
44
|
+
// })()
|
|
45
|
+
|
|
46
|
+
// export const navigationBarHeight = (() => {
|
|
47
|
+
// if (isAndroid) return statusBarHeight + 44
|
|
48
|
+
// if (isiPhoneX) return 88
|
|
49
|
+
// return 64
|
|
50
|
+
// })()
|
|
51
|
+
|
|
38
52
|
|
|
39
|
-
export const statusBarHeight = (() => {
|
|
40
|
-
if (isAndroid) {
|
|
41
|
-
if ((StatusBar.currentHeight || 0) > 20) return 40
|
|
42
|
-
}
|
|
43
|
-
if (isiPhoneX) return 44
|
|
44
|
-
return 20
|
|
45
|
-
})()
|
|
46
53
|
|
|
47
|
-
export const navigationBarHeight = (() => {
|
|
48
|
-
if (isAndroid) return statusBarHeight + 44
|
|
49
|
-
if (isiPhoneX) return 88
|
|
50
|
-
return 64
|
|
51
|
-
})()
|
package/src/index.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @Author: shiguo
|
|
4
4
|
* @Date: 2022-04-13 12:47:34
|
|
5
5
|
* @LastEditors: shiguo
|
|
6
|
-
* @LastEditTime: 2022-05-
|
|
7
|
-
* @FilePath: /@aks/easyui/src/index.ts
|
|
6
|
+
* @LastEditTime: 2022-05-31 17:24:37
|
|
7
|
+
* @FilePath: /@aks-dev/easyui/src/index.ts
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
|
@@ -53,6 +53,7 @@ export type { EchartsViewProps } from '../lib/Echarts'
|
|
|
53
53
|
/// 全局适配
|
|
54
54
|
export * from '../screen/px2dp'
|
|
55
55
|
export * from '../screen/px2sp'
|
|
56
|
+
export * from '../screen/init-fit'
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
/// 工具
|