@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.
- package/dist/components/AnimationModal/AnimationModal.js +15 -36
- package/dist/components/Badge/Badge.js +7 -16
- package/dist/components/DottedLine/DottedLine.js +14 -13
- package/dist/components/Echarts/EchartsView.js +30 -73
- package/dist/components/Echarts/demo.js +201 -0
- package/dist/components/Echarts/helper.js +1 -16
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +43 -60
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +23 -30
- package/dist/components/Hud/AlertView/AlertView.js +46 -62
- package/dist/components/Hud/Hud.js +8 -19
- package/dist/components/Hud/Loading/Loading.js +4 -16
- package/dist/components/Hud/PopoverView/PopoverView.js +2 -13
- package/dist/components/Hud/Scanner/Scanner.js +55 -86
- package/dist/components/Hud/Toast/Toast.js +5 -15
- package/dist/components/MenuView/MenuView.js +33 -61
- package/dist/components/Modal/Modal.js +0 -7
- package/dist/components/MutiPictureView/MutiPictureView.js +27 -47
- package/dist/components/PictureViewer/PictureViewer.js +8 -24
- package/dist/components/RefreshList/RefreshList.js +41 -52
- package/dist/components/RefreshList/demo.js +9 -0
- package/dist/components/RefreshList/demo1.js +27 -0
- package/dist/components/RefreshList/demo2.js +9 -0
- package/dist/components/RichText/RichText.js +21 -22
- package/dist/components/StickHeaderView/StickHeaderView.js +2 -12
- package/dist/components/StickHeaderView/demo.js +37 -0
- package/dist/components/TableCell/TableCell.js +37 -51
- package/dist/components/TextInputArea/TextInputArea.js +21 -28
- package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
- package/dist/index.js +0 -11
- package/dist/jsbridge/RNEasyui.js +0 -25
- package/dist/jsbridge/UpgradeModule.js +9 -19
- package/dist/jsbridge/index.js +0 -7
- package/dist/screen/index.js +0 -8
- package/dist/screen/px2dp.js +2 -25
- package/dist/screen/px2sp.js +5 -35
- package/dist/screen/text-fit.js +2 -13
- package/dist/utils/index.js +0 -7
- package/dist/utils/lazy.js +12 -67
- package/dist/utils/mode.js +0 -21
- package/package.json +9 -4
- package/types/components/AnimationModal/AnimationModal.d.ts +0 -8
- package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
- package/types/components/Echarts/demo.d.ts +4 -0
- package/types/components/Echarts/demo.d.ts.map +1 -0
- package/types/components/Echarts/helper.d.ts +0 -5
- package/types/components/Echarts/helper.d.ts.map +1 -1
- package/types/components/MutiPictureView/MutiPictureView.d.ts +0 -9
- package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
- package/types/components/RefreshList/demo.d.ts +2 -0
- package/types/components/RefreshList/demo.d.ts.map +1 -0
- package/types/components/RefreshList/demo1.d.ts +2 -0
- package/types/components/RefreshList/demo1.d.ts.map +1 -0
- package/types/components/RefreshList/demo2.d.ts +2 -0
- package/types/components/RefreshList/demo2.d.ts.map +1 -0
- package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
- package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
- package/types/components/StickHeaderView/demo.d.ts +4 -0
- package/types/components/StickHeaderView/demo.d.ts.map +1 -0
- package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
- package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
- package/types/jsbridge/RNEasyui.d.ts +0 -18
- package/types/jsbridge/RNEasyui.d.ts.map +1 -1
- package/types/jsbridge/UpgradeModule.d.ts +0 -15
- package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
- package/types/screen/px2dp.d.ts +0 -11
- package/types/screen/px2dp.d.ts.map +1 -1
- package/types/screen/text-fit.d.ts +0 -3
- package/types/screen/text-fit.d.ts.map +1 -1
- package/types/utils/lazy.d.ts +0 -33
- package/types/utils/lazy.d.ts.map +1 -1
- package/types/utils/mode.d.ts +0 -14
- package/types/utils/mode.d.ts.map +1 -1
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-19 10:23:01
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-10 14:05:17
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/jsbridge/RNEasyui.ts
|
|
7
|
-
*/
|
|
8
1
|
import { Dimensions, NativeModules, Platform } from "react-native";
|
|
9
2
|
const { RNEasyui } = NativeModules;
|
|
10
|
-
/**
|
|
11
|
-
* @description: 获取设备品牌
|
|
12
|
-
* @return {*}
|
|
13
|
-
*/
|
|
14
3
|
export const getDeviceBrand = () => RNEasyui.getDeviceBrand();
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated 测量不准确,已放弃
|
|
17
|
-
* @description: 获取status_bar_height
|
|
18
|
-
* @return {*}
|
|
19
|
-
*/
|
|
20
4
|
export const getStatusBarHeight = () => {
|
|
21
5
|
if (Platform.OS == "android")
|
|
22
6
|
return RNEasyui.getStatusBarHeight();
|
|
@@ -26,20 +10,11 @@ export const getStatusBarHeight = () => {
|
|
|
26
10
|
return Promise.resolve(44);
|
|
27
11
|
return Promise.resolve(20);
|
|
28
12
|
};
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated 测量不准确,已放弃
|
|
31
|
-
* @description: 获取navigation_bar_height
|
|
32
|
-
* @return {*}
|
|
33
|
-
*/
|
|
34
13
|
export const getNavigationBarHeight = () => {
|
|
35
14
|
if (Platform.OS == "android")
|
|
36
15
|
return RNEasyui.getNavigationBarHeight();
|
|
37
16
|
return Promise.resolve(44);
|
|
38
17
|
};
|
|
39
|
-
/**
|
|
40
|
-
* only android
|
|
41
|
-
* 返回桌面
|
|
42
|
-
*/
|
|
43
18
|
export const gotoDesktop = () => {
|
|
44
19
|
if (Platform.OS == "android")
|
|
45
20
|
RNEasyui === null || RNEasyui === void 0 ? void 0 : RNEasyui.gotoDesktop();
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 { NativeModules, PermissionsAndroid, Platform } from "react-native";
|
|
10
11
|
const { UpgradeModule } = NativeModules;
|
|
11
|
-
/**
|
|
12
|
-
* @description: 获取App版本号
|
|
13
|
-
* @param {*}
|
|
14
|
-
* @return {*}
|
|
15
|
-
*/
|
|
16
12
|
export const getAppVersion = () => UpgradeModule.getAppVersion();
|
|
17
|
-
/**
|
|
18
|
-
* @description: 获取操作系统版本
|
|
19
|
-
*
|
|
20
|
-
react-native-device-info
|
|
21
|
-
* @return {*}
|
|
22
|
-
*/
|
|
23
13
|
export const getOSVersion = () => UpgradeModule.getOSVersion();
|
|
24
14
|
export const upgrade = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
15
|
const { title = "提示" } = options;
|
package/dist/jsbridge/index.js
CHANGED
package/dist/screen/index.js
CHANGED
package/dist/screen/px2dp.js
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
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
1
|
import { Dimensions, Platform, StatusBar } from "react-native";
|
|
9
|
-
|
|
10
|
-
export const
|
|
11
|
-
export const deviceHeight = Dimensions.get("screen").height; //设备的高度
|
|
2
|
+
export const deviceWidth = Dimensions.get("screen").width;
|
|
3
|
+
export const deviceHeight = Dimensions.get("screen").height;
|
|
12
4
|
export const isAndroid = Platform.OS === "android";
|
|
13
5
|
export const isIos = Platform.OS === "ios";
|
|
14
6
|
export const isiPhoneX = isIos && deviceHeight > 736;
|
|
15
|
-
/**
|
|
16
|
-
* 375px/667px
|
|
17
|
-
* */
|
|
18
7
|
const uiWidthPx = 375;
|
|
19
|
-
// const pixelRatio = PixelRatio.get()
|
|
20
|
-
// const deviceWidthPx = PixelRatio.getPixelSizeForLayoutSize(deviceWidth);
|
|
21
8
|
export const px2dp = (uiElePx) => {
|
|
22
9
|
return Math.round((uiElePx * deviceWidth) / uiWidthPx);
|
|
23
10
|
};
|
|
24
|
-
/**
|
|
25
|
-
* @description: 状态栏的高度
|
|
26
|
-
* @param {*}
|
|
27
|
-
* @return {*}
|
|
28
|
-
*/
|
|
29
11
|
export const statusBarHeight = (() => {
|
|
30
12
|
if (isAndroid)
|
|
31
13
|
return StatusBar.currentHeight || 24;
|
|
@@ -33,11 +15,6 @@ export const statusBarHeight = (() => {
|
|
|
33
15
|
return 44;
|
|
34
16
|
return 20;
|
|
35
17
|
})();
|
|
36
|
-
/**
|
|
37
|
-
* @description: 顶部导航条的高度,高度不包含statusBarHeight
|
|
38
|
-
* @param {*}
|
|
39
|
-
* @return {*}
|
|
40
|
-
*/
|
|
41
18
|
export const navigationBarHeight = (() => {
|
|
42
19
|
if (isAndroid)
|
|
43
20
|
return 56;
|
package/dist/screen/px2sp.js
CHANGED
|
@@ -1,73 +1,43 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2021-04-27 10:40:36
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-10-28 17:14:14
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/screen/px2sp.ts
|
|
7
|
-
*/
|
|
8
1
|
import { Dimensions, PixelRatio } from 'react-native';
|
|
9
2
|
const pixelRatio = PixelRatio.get();
|
|
10
|
-
const width = Dimensions.get('window').width;
|
|
11
|
-
const height = Dimensions.get('window').height;
|
|
3
|
+
const width = Dimensions.get('window').width;
|
|
4
|
+
const height = Dimensions.get('window').height;
|
|
12
5
|
export const px2sp = (size) => {
|
|
13
|
-
// console.log({
|
|
14
|
-
// pixelRatio,
|
|
15
|
-
// width,
|
|
16
|
-
// height
|
|
17
|
-
// })
|
|
18
6
|
if (pixelRatio === 2) {
|
|
19
|
-
// iphone 5s and older Androids
|
|
20
7
|
if (width < 360) {
|
|
21
8
|
return size * 0.95;
|
|
22
9
|
}
|
|
23
|
-
// iphone 5
|
|
24
10
|
if (height < 667) {
|
|
25
11
|
return size;
|
|
26
|
-
// iphone 6-6s
|
|
27
12
|
}
|
|
28
13
|
else if (height >= 667 && height <= 735) {
|
|
29
14
|
return size * 1.15;
|
|
30
15
|
}
|
|
31
|
-
// older phablets
|
|
32
16
|
return size * 1.25;
|
|
33
17
|
}
|
|
34
18
|
if (pixelRatio === 3) {
|
|
35
|
-
// catch Android font scaling on small machines
|
|
36
|
-
// where pixel ratio / font scale ratio => 3:3
|
|
37
19
|
if (width <= 360) {
|
|
38
20
|
return size;
|
|
39
21
|
}
|
|
40
|
-
// Catch other weird android width sizings
|
|
41
22
|
if (height < 667) {
|
|
42
23
|
return size * 1.15;
|
|
43
|
-
// catch in-between size Androids and scale font up
|
|
44
|
-
// a tad but not too much
|
|
45
24
|
}
|
|
46
25
|
if (height >= 667 && height <= 735) {
|
|
47
26
|
return size * 1.2;
|
|
48
27
|
}
|
|
49
|
-
// catch larger devices
|
|
50
|
-
// ie iphone 6s plus / 7 plus / mi note 等等
|
|
51
28
|
return size * 1.27;
|
|
52
29
|
}
|
|
53
30
|
if (pixelRatio === 3.5) {
|
|
54
|
-
// catch Android font scaling on small machines
|
|
55
|
-
// where pixel ratio / font scale ratio => 3:3
|
|
56
31
|
if (width <= 360) {
|
|
57
32
|
return size;
|
|
58
|
-
// Catch other smaller android height sizings
|
|
59
33
|
}
|
|
60
34
|
if (height < 667) {
|
|
61
|
-
return size * 1.15;
|
|
62
|
-
// catch in-between size Androids and scale font up
|
|
63
|
-
// a tad but not too much
|
|
35
|
+
return size * 1.15;
|
|
64
36
|
}
|
|
65
37
|
if (height >= 667 && height <= 735) {
|
|
66
|
-
return size * 1.20;
|
|
38
|
+
return size * 1.20;
|
|
67
39
|
}
|
|
68
|
-
|
|
69
|
-
return size * 1.25; //older:1.30
|
|
40
|
+
return size * 1.25;
|
|
70
41
|
}
|
|
71
|
-
// if older device ie pixelRatio !== 2 || 3 || 3.5
|
|
72
42
|
return size;
|
|
73
43
|
};
|
package/dist/screen/text-fit.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-15 14:15:07
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-06-02 11:03:59
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/screen/text-fit.tsx
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* 全局配置Text
|
|
10
|
-
*/
|
|
11
1
|
import React from 'react';
|
|
12
2
|
import { Platform, Text as Text_spaceName, TextInput as TextInput_spaceName } from 'react-native';
|
|
13
3
|
const Text = Text_spaceName;
|
|
@@ -26,8 +16,8 @@ const textInputDefaultStyle = {
|
|
|
26
16
|
defaultProps: false,
|
|
27
17
|
paddingVertical: 0,
|
|
28
18
|
paddingHorizontal: 0,
|
|
29
|
-
autoCapitalize: "none",
|
|
30
|
-
autoCorrect: false,
|
|
19
|
+
autoCapitalize: "none",
|
|
20
|
+
autoCorrect: false,
|
|
31
21
|
};
|
|
32
22
|
const textInputRender = TextInput.render;
|
|
33
23
|
TextInput.render = function (...args) {
|
|
@@ -36,7 +26,6 @@ TextInput.render = function (...args) {
|
|
|
36
26
|
style: [textInputDefaultStyle, origin.props.style]
|
|
37
27
|
});
|
|
38
28
|
};
|
|
39
|
-
/**关闭字体缩放 */
|
|
40
29
|
if (!Text.defaultProps)
|
|
41
30
|
Text.defaultProps = {};
|
|
42
31
|
if (!TextInput.defaultProps)
|
package/dist/utils/index.js
CHANGED
package/dist/utils/lazy.js
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @description: 睡眠时间
|
|
11
|
-
* @param {*}毫秒值
|
|
12
|
-
* @return {*}
|
|
13
|
-
*/
|
|
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
|
+
};
|
|
14
10
|
export const sleep = (msec) => {
|
|
15
11
|
return new Promise((resolve) => {
|
|
16
12
|
setTimeout(resolve, msec || 350);
|
|
17
13
|
});
|
|
18
14
|
};
|
|
19
|
-
/**
|
|
20
|
-
* @description: 获取随机色
|
|
21
|
-
* @param {*}
|
|
22
|
-
* @return {*}
|
|
23
|
-
*/
|
|
24
15
|
export const randomcolor = () => {
|
|
25
16
|
return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${1})`;
|
|
26
17
|
};
|
|
27
|
-
/**
|
|
28
|
-
* @description: 同步循环
|
|
29
|
-
* @param {*} dataList:数据源
|
|
30
|
-
* @return {*}
|
|
31
|
-
*/
|
|
32
18
|
export const syncLoop = (dataList, callback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
19
|
const length = dataList.length;
|
|
34
20
|
const O = Object(dataList);
|
|
@@ -42,10 +28,6 @@ export const syncLoop = (dataList, callback) => __awaiter(void 0, void 0, void 0
|
|
|
42
28
|
}
|
|
43
29
|
return Promise.resolve("SyncForeach loop over");
|
|
44
30
|
});
|
|
45
|
-
/**
|
|
46
|
-
* @description: 对11位手机号码加*
|
|
47
|
-
* @return {*}
|
|
48
|
-
*/
|
|
49
31
|
export const encryptMobilePhoneNumber = (text) => {
|
|
50
32
|
if (text && text.length == 11) {
|
|
51
33
|
let y1 = text.slice(0, 3);
|
|
@@ -54,31 +36,21 @@ export const encryptMobilePhoneNumber = (text) => {
|
|
|
54
36
|
}
|
|
55
37
|
return text;
|
|
56
38
|
};
|
|
57
|
-
/**
|
|
58
|
-
* @description: 判断对象
|
|
59
|
-
* @return {*}
|
|
60
|
-
*/
|
|
61
|
-
//判断是否为对象(仅为对象,不是数组也不是null)
|
|
62
39
|
export const isObject = (exp) => {
|
|
63
40
|
return Object.prototype.toString.call(exp) == "[object Object]";
|
|
64
41
|
};
|
|
65
|
-
//判断是否为数组(仅为数组,不是对象也不是null)
|
|
66
42
|
export const isArray = (exp) => {
|
|
67
43
|
return Object.prototype.toString.call(exp) == "[object Array]";
|
|
68
44
|
};
|
|
69
|
-
//判断是否为字符串
|
|
70
45
|
export const isString = (exp) => {
|
|
71
46
|
return Object.prototype.toString.call(exp) == "[object String]";
|
|
72
47
|
};
|
|
73
|
-
//判断是否为数字(包括整数和实数)
|
|
74
48
|
export const isNumber = (exp) => {
|
|
75
49
|
return Object.prototype.toString.call(exp) == "[object Number]";
|
|
76
50
|
};
|
|
77
|
-
//判断是否为null
|
|
78
51
|
export const isNull = (exp) => {
|
|
79
52
|
return Object.prototype.toString.call(exp) == "[object Null]";
|
|
80
53
|
};
|
|
81
|
-
//判断是否为空对象
|
|
82
54
|
export const isNullObject = (obj) => {
|
|
83
55
|
if (obj == null || obj == undefined)
|
|
84
56
|
return true;
|
|
@@ -87,14 +59,10 @@ export const isNullObject = (obj) => {
|
|
|
87
59
|
}
|
|
88
60
|
return true;
|
|
89
61
|
};
|
|
90
|
-
//判断是否为undefined
|
|
91
62
|
export const isUndefined = (exp) => {
|
|
92
63
|
return Object.prototype.toString.call(exp) == "[object Undefined]";
|
|
93
64
|
};
|
|
94
|
-
/**判断两个对象是否相同 */
|
|
95
65
|
export const isObjectValueEqual = (a, b) => {
|
|
96
|
-
// Object.getOwnPropertyNames()方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组
|
|
97
|
-
// 换句话来说 Object.getOwnPropertyNames()方法返回的是对象所有 key 组成的数组 list
|
|
98
66
|
let aProps = Object.getOwnPropertyNames(a);
|
|
99
67
|
let bProps = Object.getOwnPropertyNames(b);
|
|
100
68
|
if (aProps.length != bProps.length) {
|
|
@@ -126,7 +94,6 @@ export const deepEqual = (x, y) => {
|
|
|
126
94
|
if (prototype_x != prototype_y) {
|
|
127
95
|
return false;
|
|
128
96
|
}
|
|
129
|
-
/**以下类型相同比较 */
|
|
130
97
|
if (prototype_x == "[object Object]") {
|
|
131
98
|
if (Object.keys(x).length != Object.keys(y).length) {
|
|
132
99
|
return false;
|
|
@@ -148,50 +115,38 @@ export const deepEqual = (x, y) => {
|
|
|
148
115
|
}
|
|
149
116
|
}
|
|
150
117
|
else if (prototype_x == "[object Function]") {
|
|
151
|
-
/**过滤对函数的深比较 */
|
|
152
118
|
return true;
|
|
153
119
|
}
|
|
154
120
|
else {
|
|
155
|
-
/**其它类型值比较 */
|
|
156
121
|
return x == y;
|
|
157
122
|
}
|
|
158
123
|
return true;
|
|
159
124
|
};
|
|
160
|
-
// 定义一个深拷贝函数 接收目标target参数
|
|
161
125
|
export function deepClone(target) {
|
|
162
|
-
// 定义一个变量
|
|
163
126
|
let result;
|
|
164
|
-
// 如果当前需要深拷贝的是一个对象的话
|
|
165
127
|
if (typeof target === "object") {
|
|
166
|
-
// 如果是一个数组的话
|
|
167
128
|
if (Array.isArray(target)) {
|
|
168
|
-
result = [];
|
|
129
|
+
result = [];
|
|
169
130
|
for (let i in target) {
|
|
170
|
-
// 递归克隆数组中的每一项
|
|
171
131
|
result.push(deepClone(target[i]));
|
|
172
132
|
}
|
|
173
|
-
// 判断如果当前的值是null的话;直接赋值为null
|
|
174
133
|
}
|
|
175
134
|
else if (target === null) {
|
|
176
135
|
result = null;
|
|
177
|
-
// 判断如果当前的值是一个RegExp对象的话,直接赋值
|
|
178
136
|
}
|
|
179
137
|
else if (target.constructor === RegExp) {
|
|
180
138
|
result = target;
|
|
181
139
|
}
|
|
182
140
|
else {
|
|
183
|
-
// 否则是普通对象,直接for in循环,递归赋值对象的所有值
|
|
184
141
|
result = {};
|
|
185
142
|
for (let i in target) {
|
|
186
143
|
result[i] = deepClone(target[i]);
|
|
187
144
|
}
|
|
188
145
|
}
|
|
189
|
-
// 如果不是对象的话,就是基本数据类型,那么直接赋值
|
|
190
146
|
}
|
|
191
147
|
else {
|
|
192
148
|
result = target;
|
|
193
149
|
}
|
|
194
|
-
// 返回最终结果
|
|
195
150
|
return result;
|
|
196
151
|
}
|
|
197
152
|
export const isPhoneNumber = (str) => {
|
|
@@ -201,13 +156,7 @@ export const isPhoneNumber = (str) => {
|
|
|
201
156
|
}
|
|
202
157
|
return true;
|
|
203
158
|
};
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
206
|
-
* @param dateStr yyyy-MM-dd HH:mm:ss
|
|
207
|
-
* @returns {string}
|
|
208
|
-
*/
|
|
209
159
|
export const toDateFriendly = (dateStr) => {
|
|
210
|
-
//af-测试可用
|
|
211
160
|
if (!dateStr) {
|
|
212
161
|
return "";
|
|
213
162
|
}
|
|
@@ -321,18 +270,14 @@ export const isHaveEmojiCharact = (substring) => {
|
|
|
321
270
|
}
|
|
322
271
|
return false;
|
|
323
272
|
};
|
|
324
|
-
/**
|
|
325
|
-
* @description: 获得32位随机字符
|
|
326
|
-
* @return {*}
|
|
327
|
-
*/
|
|
328
273
|
export const getUuid = () => {
|
|
329
274
|
let s = [];
|
|
330
275
|
let hexDigits = "0123456789abcdef";
|
|
331
276
|
for (var i = 0; i < 36; i++) {
|
|
332
277
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
333
278
|
}
|
|
334
|
-
s[14] = "4";
|
|
335
|
-
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
|
279
|
+
s[14] = "4";
|
|
280
|
+
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
|
336
281
|
s[8] = s[13] = s[18] = s[23] = "-";
|
|
337
282
|
` ][poi]`;
|
|
338
283
|
var uuid = s.join("");
|
package/dist/utils/mode.js
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-18 18:40:07
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-23 15:07:57
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/utils/mode.ts
|
|
7
|
-
*/
|
|
8
1
|
import { PanResponder, Keyboard, Linking } from "react-native";
|
|
9
|
-
/**
|
|
10
|
-
* @description: 通过手势关闭键盘
|
|
11
|
-
* @return {*}
|
|
12
|
-
*/
|
|
13
2
|
export const keyboardDismissHandlers = PanResponder.create({
|
|
14
3
|
onStartShouldSetPanResponder: () => true,
|
|
15
4
|
onPanResponderGrant: Keyboard.dismiss,
|
|
16
5
|
}).panHandlers;
|
|
17
|
-
/**
|
|
18
|
-
* @description: 手势动作回调
|
|
19
|
-
* @param {*}
|
|
20
|
-
* @return {*}
|
|
21
|
-
*/
|
|
22
6
|
export const panHandlersCallback = (props) => {
|
|
23
7
|
return PanResponder.create({
|
|
24
8
|
onStartShouldSetPanResponder: () => true,
|
|
@@ -28,11 +12,6 @@ export const panHandlersCallback = (props) => {
|
|
|
28
12
|
onPanResponderRelease: props.ReleaseCallback,
|
|
29
13
|
}).panHandlers;
|
|
30
14
|
};
|
|
31
|
-
/**
|
|
32
|
-
* @description: 拨打电话
|
|
33
|
-
* @param {number} phone
|
|
34
|
-
* @return {*}
|
|
35
|
-
*/
|
|
36
15
|
export const callTelephone = (phone) => {
|
|
37
16
|
let tel = "tel:" + phone;
|
|
38
17
|
Linking.canOpenURL(tel)
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.195",
|
|
4
4
|
"description": "工具箱",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"types": "./types/index.d.ts"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
7
11
|
"scripts": {
|
|
8
12
|
"test": "yarn run lint",
|
|
9
13
|
"release": "yarn semantic-release",
|
|
10
14
|
"cp": "cp -r -v src/assets dist/assets",
|
|
11
15
|
"rsync": "rsync -av --include='*/' --exclude='*.tsx' --exclude='demo.tsx' --exclude='*.ts' src/ dist/",
|
|
12
|
-
"build": "tsc
|
|
16
|
+
"build": "tsc && rsync -av --include='*/' --exclude='*.tsx' --exclude='demo.tsx' --exclude='*.ts' src/ dist/",
|
|
13
17
|
"types": "tsc --emitDeclarationOnly --declaration --declarationMap --declarationDir ./types",
|
|
14
18
|
"dev": "tsc --watch",
|
|
15
19
|
"test:ts": "tsc --noEmit"
|
|
@@ -59,6 +63,7 @@
|
|
|
59
63
|
"devDependencies": {
|
|
60
64
|
"@aks-dev/react-native-syan-image-picker": "^0.5.58",
|
|
61
65
|
"@tsconfig/react-native": "^3.0.9",
|
|
66
|
+
"@tsconfig/node22": "^22.0.5",
|
|
62
67
|
"@types/react": "^19.2.14",
|
|
63
68
|
"react": "^19.2.4",
|
|
64
69
|
"react-dom": "^19.2.4",
|
|
@@ -2,15 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { ColorValue } from "react-native";
|
|
3
3
|
export type AnimationModalProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
/**
|
|
6
|
-
* 动画方向,默认 'from-bottom'
|
|
7
|
-
* center-in 动画暂未实现
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
5
|
animationType?: "from-bottom" | "center-in";
|
|
11
|
-
/**
|
|
12
|
-
* 是否有遮罩,默认没有
|
|
13
|
-
*/
|
|
14
6
|
mask?: boolean;
|
|
15
7
|
style?: {
|
|
16
8
|
backgroundColor?: ColorValue | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationModal.d.ts","sourceRoot":"","sources":["../../../src/components/AnimationModal/AnimationModal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"AnimationModal.d.ts","sourceRoot":"","sources":["../../../src/components/AnimationModal/AnimationModal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAM1B,aAAa,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;IAI5C,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;KAC1C,CAAC;CACH,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,aAAa,CAAC;IACvC,OAAO,EAAE,MAAM,GAAG,CAAC;CACpB,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAC1D,KAAK,CAAC,eAAe,CAAC,mBAAmB,CAAC,GACxC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAkIpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../src/components/Echarts/demo.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;;AAM/B,wBAsME"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export declare const getHtml: (props: {
|
|
2
2
|
backgroundColor: any;
|
|
3
3
|
}) => string;
|
|
4
|
-
/**
|
|
5
|
-
* https://res.actiiot.com/echarts/5.0.2/echarts.min.js
|
|
6
|
-
*
|
|
7
|
-
* https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js
|
|
8
|
-
*/
|
|
9
4
|
export declare const toString: (obj: object) => string;
|
|
10
5
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/components/Echarts/helper.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,GAAI,OAAO;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,WAoCpD,CAAA;
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/components/Echarts/helper.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,GAAI,OAAO;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,WAoCpD,CAAA;AAQD,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,WAcnC,CAAA"}
|
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import { ImageSourcePropType, StyleProp, ViewStyle, ImageStyle, TextStyle } from "react-native";
|
|
3
3
|
type ViewModelProps = {
|
|
4
4
|
photos?: any[];
|
|
5
|
-
/**@deprecated disabled 图片点击状态,已弃用*/
|
|
6
5
|
disabled?: boolean;
|
|
7
6
|
imageViewer: {
|
|
8
7
|
imageUrls: any[];
|
|
@@ -15,12 +14,9 @@ type BindProps = {
|
|
|
15
14
|
setViewModel: (intent: Partial<ViewModelProps>) => void;
|
|
16
15
|
};
|
|
17
16
|
export type MutiPictureViewProps = {
|
|
18
|
-
/**@deprecated title 标题 ,已弃用*/
|
|
19
17
|
title?: string;
|
|
20
18
|
bind: BindProps;
|
|
21
|
-
/**default maxCount is 6 */
|
|
22
19
|
maxCount?: number;
|
|
23
|
-
/**default type is showImagePicker */
|
|
24
20
|
type?: "showImagePicker" | "openCamera";
|
|
25
21
|
style?: StyleProp<ViewStyle>;
|
|
26
22
|
addIcon?: ImageSourcePropType;
|
|
@@ -31,17 +27,12 @@ export type MutiPictureViewProps = {
|
|
|
31
27
|
itemContainerStyle?: StyleProp<ViewStyle>;
|
|
32
28
|
delIcon?: ImageSourcePropType;
|
|
33
29
|
delIconStyle?: StyleProp<ImageStyle>;
|
|
34
|
-
/**外边距 */
|
|
35
30
|
spacingHorizontal?: number;
|
|
36
|
-
/**内边距 */
|
|
37
31
|
spacingInner?: number;
|
|
38
|
-
/**仅仅看看,不增减图片 */
|
|
39
32
|
editable?: boolean;
|
|
40
|
-
/**这个属性会覆盖bind.viewModel.photos */
|
|
41
33
|
value?: (string | {
|
|
42
34
|
uri: string;
|
|
43
35
|
})[];
|
|
44
|
-
/**default false 空视图占位 */
|
|
45
36
|
showEmptyPlaceHolder?: boolean;
|
|
46
37
|
emptyPlaceHolderStyle?: StyleProp<ViewStyle>;
|
|
47
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutiPictureView.d.ts","sourceRoot":"","sources":["../../../src/components/MutiPictureView/MutiPictureView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,mBAAmB,EAInB,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACV,MAAM,cAAc,CAAC;AAMtB,KAAK,cAAc,GAAG;IACpB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"MutiPictureView.d.ts","sourceRoot":"","sources":["../../../src/components/MutiPictureView/MutiPictureView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,mBAAmB,EAInB,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACV,MAAM,cAAc,CAAC;AAMtB,KAAK,cAAc,GAAG;IACpB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE;QACX,SAAS,EAAE,GAAG,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,SAAS,EAAE,cAAc,CAAC;IAC1B,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CACzD,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG;IAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,IAAI,CAAC,EAAE,iBAAiB,GAAG,YAAY,CAAC;IACxC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7C,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAErC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAErC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9C,CAAC;;AAuVF,wBAA4E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../src/components/RefreshList/demo.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo1.d.ts","sourceRoot":"","sources":["../../../src/components/RefreshList/demo1.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo2.d.ts","sourceRoot":"","sources":["../../../src/components/RefreshList/demo2.tsx"],"names":[],"mappings":""}
|