@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
package/readme.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-25 17:57:29
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-18 16:28:
|
|
5
|
+
* @LastEditTime: 2022-07-18 16:28:371
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/README.md
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### install
|
|
10
10
|
|
|
11
11
|
`$ npm install @aks-dev/easyui --save`
|
|
12
12
|
|
|
@@ -47,7 +47,7 @@ import '@aks-dev/easyui/screen/text-fit'
|
|
|
47
47
|
|
|
48
48
|
### utils
|
|
49
49
|
---
|
|
50
|
-
|
|
50
|
+
|函数|功能|
|
|
51
51
|
|:----|:----|
|
|
52
52
|
|sleep|睡眠|
|
|
53
53
|
|keyboardDismissHandlers|通过手势关闭键盘|
|
package/android/.DS_Store
DELETED
|
Binary file
|
package/android/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/i.sh
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
###
|
|
3
|
-
# @Author: shiguo
|
|
4
|
-
# @Date: 2022-09-26 17:09:38
|
|
5
|
-
# @LastEditors: shiguo
|
|
6
|
-
# @LastEditTime: 2023-09-15 17:15:13
|
|
7
|
-
# @FilePath: /@aks-dev/easyui/i.sh
|
|
8
|
-
###
|
|
9
|
-
# echo "Shell 传递参数实例!";
|
|
10
|
-
# echo "执行的文件名:$0";
|
|
11
|
-
# echo "第一个参数为:$1";
|
|
12
|
-
# echo "第二个参数为:$2";
|
|
13
|
-
# echo "第三个参数为:$3";
|
|
14
|
-
# ./i.sh 测试更新注视
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#chmod u+x *.sh
|
|
18
|
-
git add .
|
|
19
|
-
git commit -m $1
|
|
20
|
-
# git push origin master
|
|
21
|
-
git push --force origin master
|
|
22
|
-
npm version patch
|
|
23
|
-
npm publish
|
package/ios/.DS_Store
DELETED
|
Binary file
|
package/ios/assets/.DS_Store
DELETED
|
Binary file
|
package/ios/views/.DS_Store
DELETED
|
Binary file
|
package/jsbridge/RNEasyui.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
import { Dimensions, NativeModules, Platform } from 'react-native';
|
|
10
|
-
|
|
11
|
-
const { RNEasyui } = NativeModules;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const getDeviceBrand = () => RNEasyui.getDeviceBrand();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export const getStatusBarHeight = () => {
|
|
20
|
-
if (Platform.OS == 'android') return RNEasyui.getStatusBarHeight();
|
|
21
|
-
|
|
22
|
-
const deviceHeight = Dimensions.get('window').height;
|
|
23
|
-
const isiPhoneX = Platform.OS == 'ios' && (deviceHeight > 736)
|
|
24
|
-
if (isiPhoneX) return Promise.resolve(44)
|
|
25
|
-
return Promise.resolve(20)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const getNavigationBarHeight = () => {
|
|
29
|
-
if (Platform.OS == 'android') return RNEasyui.getNavigationBarHeight();
|
|
30
|
-
|
|
31
|
-
return Promise.resolve(44)
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export const gotoDesktop = () => {
|
|
37
|
-
if (Platform.OS == 'android') RNEasyui?.gotoDesktop();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
package/jsbridge/index.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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/lib/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-05-17 15:22:06
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-09-27 15:17:15
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/AnimationModal/AnimationModal.tsx
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import * as React from "react";
|
|
10
|
-
import { View, Animated, Easing, LayoutRectangle, PanResponder, StyleSheet, useWindowDimensions, BackHandler, MeasureOnSuccessCallback } from 'react-native';
|
|
11
|
-
import type { AnimationModalProps } from '.';
|
|
12
|
-
import * as utils from '../../utils/lazy';
|
|
13
|
-
// type State = {
|
|
14
|
-
// display: 'flex' | 'none';
|
|
15
|
-
// }
|
|
16
|
-
// type StateReducerProps = (state: State, action: Partial<State>) => State
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const AnimationModal: React.ForwardRefExoticComponent<
|
|
22
|
-
React.PropsWithoutRef<AnimationModalProps>
|
|
23
|
-
& React.RefAttributes<AnimationModalProps.RefAttributes>
|
|
24
|
-
>
|
|
25
|
-
= React.forwardRef((props, ref) => {
|
|
26
|
-
const {
|
|
27
|
-
animationType = 'from-bottom',
|
|
28
|
-
mask = false
|
|
29
|
-
} = props || {}
|
|
30
|
-
|
|
31
|
-
const { height } = useWindowDimensions()
|
|
32
|
-
|
|
33
|
-
// const [state, dispatch] = React.useReducer<StateReducerProps>(
|
|
34
|
-
// (state, action) => ({ ...state, ...action }),
|
|
35
|
-
// {
|
|
36
|
-
// display: 'none'
|
|
37
|
-
// })
|
|
38
|
-
|
|
39
|
-
const [display, setDisplay] = useCallbackState<'flex' | 'none'>('none')
|
|
40
|
-
|
|
41
|
-
const animatedValue = React.useRef(new Animated.Value(0)).current;
|
|
42
|
-
const timing = (value: number) => {
|
|
43
|
-
Animated.timing(animatedValue, {
|
|
44
|
-
toValue: value,
|
|
45
|
-
duration: 350,
|
|
46
|
-
useNativeDriver: true,
|
|
47
|
-
easing: Easing.ease,
|
|
48
|
-
}).start(({ finished }) => {
|
|
49
|
-
/* 动画完成的回调函数 */
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const viewRef = React.useRef<{ measure: (callback: MeasureOnSuccessCallback) => void }>() as any
|
|
55
|
-
const layoutRef = React.useRef<{
|
|
56
|
-
/**:父容器的高度 */
|
|
57
|
-
h0: number;
|
|
58
|
-
/**:子容器的高度 */
|
|
59
|
-
h1: number;
|
|
60
|
-
}>({ h0: 0, h1: 0 })
|
|
61
|
-
const getLayoutPromise = () => {
|
|
62
|
-
return new Promise((resovle, reject) => {
|
|
63
|
-
viewRef.current?.measure((...args: any[]) => {
|
|
64
|
-
if (args.length == 6) {
|
|
65
|
-
layoutRef.current.h1 = args[3]
|
|
66
|
-
}
|
|
67
|
-
resovle(args)
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const init = React.useCallback(() => ({ show, hide, setData, getData }), [])
|
|
75
|
-
React.useImperativeHandle<unknown, AnimationModalProps.RefAttributes>(ref, init, [])
|
|
76
|
-
const dataRef = React.useRef<any>()
|
|
77
|
-
const setData = (data?: any) => {
|
|
78
|
-
dataRef.current = data
|
|
79
|
-
return init()
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const getData = () => dataRef.current
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const show = () => {
|
|
86
|
-
setDisplay('flex', async () => {
|
|
87
|
-
await utils.sleep(50)
|
|
88
|
-
await getLayoutPromise()
|
|
89
|
-
timing(-layoutRef.current?.h1)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
return init()
|
|
93
|
-
}
|
|
94
|
-
const hide = () => {
|
|
95
|
-
timing(0)
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
setDisplay('none')
|
|
98
|
-
}, 300)
|
|
99
|
-
|
|
100
|
-
return init()
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
React.useEffect(() => {
|
|
105
|
-
let addEventListener = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
106
|
-
return display == 'flex'
|
|
107
|
-
})
|
|
108
|
-
return () => {
|
|
109
|
-
addEventListener.remove()
|
|
110
|
-
}
|
|
111
|
-
}, [display])
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<View
|
|
117
|
-
style={Object.assign({
|
|
118
|
-
display: display
|
|
119
|
-
}, styles.container, props.style)}
|
|
120
|
-
{...PanResponder.create({
|
|
121
|
-
onStartShouldSetPanResponder: (e, gestureState) => {
|
|
122
|
-
let pageY = e.nativeEvent.pageY
|
|
123
|
-
let topY = height - layoutRef.current.h1
|
|
124
|
-
if (pageY <= topY && !mask) {
|
|
125
|
-
return true
|
|
126
|
-
}
|
|
127
|
-
return false
|
|
128
|
-
},
|
|
129
|
-
onPanResponderGrant: (e, gestureState) => {
|
|
130
|
-
// console.log({e})
|
|
131
|
-
let pageY = e.nativeEvent.pageY
|
|
132
|
-
let topY = height - layoutRef.current.h1
|
|
133
|
-
if (pageY <= topY && !mask) {
|
|
134
|
-
e.stopPropagation()
|
|
135
|
-
hide()
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}).panHandlers}
|
|
139
|
-
>
|
|
140
|
-
<Animated.View
|
|
141
|
-
style={Object.assign({}, styles.wrapper, { transform: [{ translateY: animatedValue }] })}
|
|
142
|
-
// onLayout={e => {
|
|
143
|
-
// let target: LayoutRectangle = e.nativeEvent.layout
|
|
144
|
-
// layoutRef.current.h1 = target.height
|
|
145
|
-
// }}
|
|
146
|
-
|
|
147
|
-
ref={viewRef}
|
|
148
|
-
>
|
|
149
|
-
{props.children}
|
|
150
|
-
</Animated.View>
|
|
151
|
-
</View>
|
|
152
|
-
)
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const styles = StyleSheet.create({
|
|
158
|
-
container: {
|
|
159
|
-
position: 'absolute',
|
|
160
|
-
left: 0,
|
|
161
|
-
right: 0,
|
|
162
|
-
top: 0,
|
|
163
|
-
bottom: 0,
|
|
164
|
-
zIndex: 999,
|
|
165
|
-
// display: 'flex',
|
|
166
|
-
flexDirection: 'column',
|
|
167
|
-
backgroundColor: '#00000055',
|
|
168
|
-
overflow: 'hidden',
|
|
169
|
-
},
|
|
170
|
-
wrapper: {
|
|
171
|
-
position: 'absolute',
|
|
172
|
-
display: 'flex',
|
|
173
|
-
flexDirection: 'column',
|
|
174
|
-
// backgroundColor: 'pink',
|
|
175
|
-
width: '100%',
|
|
176
|
-
top: '100%'
|
|
177
|
-
},
|
|
178
|
-
empty: {
|
|
179
|
-
flex: 1, position: 'relative',
|
|
180
|
-
// backgroundColor: 'cyan'
|
|
181
|
-
}
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const useCallbackState = <T,>(od: T): [T, (d: T, callback?: Function) => void] => {
|
|
188
|
-
const cbRef = React.useRef<Function>()
|
|
189
|
-
const [data, setData] = React.useState<T>(od)
|
|
190
|
-
React.useEffect(() => {
|
|
191
|
-
cbRef.current && cbRef.current(data)
|
|
192
|
-
}, [data])
|
|
193
|
-
|
|
194
|
-
return [
|
|
195
|
-
data,
|
|
196
|
-
(d: T, callback?: Function) => {
|
|
197
|
-
cbRef.current = callback;
|
|
198
|
-
setData(d)
|
|
199
|
-
}
|
|
200
|
-
]
|
|
201
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-05-18 17:26:41
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-09-27 15:12:59
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/AnimationModal/index.d.ts
|
|
7
|
-
*/
|
|
8
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type AnimationModalProps = {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* 动画方向,默认 'from-bottom'
|
|
15
|
-
* center-in 动画暂未实现
|
|
16
|
-
* @deprecated
|
|
17
|
-
*/
|
|
18
|
-
animationType?: 'from-bottom' | 'center-in';
|
|
19
|
-
/**
|
|
20
|
-
* 是否有遮罩,默认没有
|
|
21
|
-
*/
|
|
22
|
-
mask?: boolean;
|
|
23
|
-
style?:Pick<StyleProp<ViewStyle>,'backgroundColor'>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
declare namespace AnimationModalProps {
|
|
28
|
-
type RefAttributes = {
|
|
29
|
-
show: () => RefAttributes;
|
|
30
|
-
hide: () => RefAttributes;
|
|
31
|
-
setData: (data?: any) => RefAttributes;
|
|
32
|
-
getData: () => any;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export declare const AnimationModal: React.ForwardRefExoticComponent<
|
|
39
|
-
React.PropsWithoutRef<AnimationModalProps>
|
|
40
|
-
& React.RefAttributes<AnimationModalProps.RefAttributes>
|
|
41
|
-
>;
|
package/lib/Badge/Badge.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-21 14:40:29
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-08 15:40:21
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/Badge/Badge.tsx
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react'
|
|
9
|
-
import { View, Text, } from 'react-native'
|
|
10
|
-
import { px2dp } from '../../screen/px2dp'
|
|
11
|
-
import { px2sp } from '../../screen/px2sp'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import type { BadgeProps } from '.'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export const Badge: React.FC<BadgeProps>
|
|
19
|
-
= (props) => {
|
|
20
|
-
if (isNaN(+props.count) || Number(props.count) == 0) return <View />
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
<View style={
|
|
24
|
-
[
|
|
25
|
-
{
|
|
26
|
-
flexGrow: 0, flexShrink: 1, zIndex: 1,
|
|
27
|
-
// paddingHorizontal: px2dp(0),
|
|
28
|
-
height: px2dp(16), minWidth: px2dp(16), borderRadius: px2dp(8),
|
|
29
|
-
justifyContent: 'center', alignItems: 'center',
|
|
30
|
-
backgroundColor: 'red'
|
|
31
|
-
},
|
|
32
|
-
props.style
|
|
33
|
-
]
|
|
34
|
-
} >
|
|
35
|
-
<Text style={{ fontSize: px2sp(12), color: 'white', textAlign: 'center' }}> {props.count > 99 ? '+99' : props.count} </Text>
|
|
36
|
-
|
|
37
|
-
</View>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
package/lib/Badge/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-21 14:43:14
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-08 15:40:30
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/Badge/index.ts
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react'
|
|
9
|
-
import { StyleProp, ViewStyle } from 'react-native'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare type BadgeProps = {
|
|
16
|
-
count: number | string;
|
|
17
|
-
style?: StyleProp<ViewStyle>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export declare const Badge: React.FC<BadgeProps>
|
|
21
|
-
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-07-12 15:30:19
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-12 15:33:06
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/DottedLine/DottedLine.tsx
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react'
|
|
9
|
-
import { StyleSheet, View } from 'react-native'
|
|
10
|
-
import type { DottedLineProps } from '.'
|
|
11
|
-
export default (props: DottedLineProps) => {
|
|
12
|
-
const {
|
|
13
|
-
vertical = false,
|
|
14
|
-
dottedColor,
|
|
15
|
-
dottedCount = 200,
|
|
16
|
-
...rest
|
|
17
|
-
} = props
|
|
18
|
-
const arrs = Array.from({ length: dottedCount }, (k, v) => v)
|
|
19
|
-
return (
|
|
20
|
-
<View style={{ ...styles.container, flexDirection: vertical ? 'column' : 'row', ...rest.style as any }}>
|
|
21
|
-
{
|
|
22
|
-
arrs.map((item, index) => {
|
|
23
|
-
return <View
|
|
24
|
-
key={`dotted-${index}`}
|
|
25
|
-
style={{
|
|
26
|
-
...(vertical ? styles.dotted_vertical : styles.dotted_horizontal),
|
|
27
|
-
...(dottedColor && { backgroundColor: dottedColor })
|
|
28
|
-
}} />
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
</View>
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const styles = StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flexGrow: 1,
|
|
44
|
-
overflow: 'hidden',
|
|
45
|
-
flexDirection: 'row',
|
|
46
|
-
flexWrap: 'nowrap',
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
dotted_horizontal: {
|
|
50
|
-
flexGrow: 0,
|
|
51
|
-
flexShrink: 0,
|
|
52
|
-
width: 2,
|
|
53
|
-
height: 1,
|
|
54
|
-
marginRight: 2,
|
|
55
|
-
backgroundColor: '#cccccc',
|
|
56
|
-
},
|
|
57
|
-
dotted_vertical: {
|
|
58
|
-
flexGrow: 0,
|
|
59
|
-
flexShrink: 0,
|
|
60
|
-
width: 1,
|
|
61
|
-
height: 2,
|
|
62
|
-
marginBottom: 2,
|
|
63
|
-
backgroundColor: '#cccccc',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
})
|
package/lib/DottedLine/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-07-12 15:30:28
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-12 15:31:31
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/DottedLine/index.ts
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react'
|
|
9
|
-
import { ViewProps } from 'react-native'
|
|
10
|
-
|
|
11
|
-
export type DottedLineProps = {
|
|
12
|
-
vertical?: boolean,
|
|
13
|
-
dottedColor?: string,
|
|
14
|
-
dottedCount?: number
|
|
15
|
-
} & ViewProps
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare const DottedLine: React.FC<DottedLineProps>
|