@aks-dev/easyui 1.0.163 → 1.1.2
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.js +151 -0
- package/dist/components/DottedLine/DottedLine.js +50 -0
- package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
- package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
- package/dist/components/Hud/AlertView/AlertView.js +184 -0
- package/dist/components/Hud/Hud.js +29 -0
- package/dist/components/Hud/Loading/Loading.js +66 -0
- package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
- package/dist/components/Hud/Scanner/Scanner.js +301 -0
- package/dist/components/Hud/Toast/Toast.js +71 -0
- package/dist/components/MenuView/MenuView.js +184 -0
- package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
- package/dist/components/MutiPictureView/MutiPictureView.js +239 -0
- package/dist/components/PictureViewer/PictureViewer.js +54 -0
- package/dist/components/RefreshList/RefreshList.js +155 -0
- package/dist/components/RichText/RichText.js +56 -0
- package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
- package/dist/components/TableCell/TableCell.js +97 -0
- package/dist/components/TextInputArea/TextInputArea.js +65 -0
- package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
- package/dist/index.js +31 -0
- package/dist/jsbridge/RNEasyui.js +46 -0
- package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
- package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
- package/{screen/index.ts → dist/screen/index.js} +2 -2
- package/dist/screen/px2dp.js +45 -0
- package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
- package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
- package/{utils/index.ts → dist/utils/index.js} +2 -2
- package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
- package/dist/utils/mode.js +50 -0
- package/package.json +31 -19
- package/readme.md +3 -3
- package/types/components/AnimationModal/AnimationModal.d.ts +27 -0
- package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -0
- package/types/components/DottedLine/DottedLine.d.ts +10 -0
- package/types/components/DottedLine/DottedLine.d.ts.map +1 -0
- package/types/components/EchartsView/EchartsView.d.ts +10 -0
- package/types/components/EchartsView/EchartsView.d.ts.map +1 -0
- package/types/components/EchartsView/helper.d.ts +10 -0
- package/types/components/EchartsView/helper.d.ts.map +1 -0
- package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
- package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
- package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
- package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
- package/types/components/Hud/AlertView/AlertView.d.ts +25 -0
- package/types/components/Hud/AlertView/AlertView.d.ts.map +1 -0
- package/types/components/Hud/Hud.d.ts +11 -0
- package/types/components/Hud/Hud.d.ts.map +1 -0
- package/types/components/Hud/Loading/Loading.d.ts +11 -0
- package/types/components/Hud/Loading/Loading.d.ts.map +1 -0
- package/types/components/Hud/PopoverView/PopoverView.d.ts +17 -0
- package/types/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
- package/types/components/Hud/Scanner/Scanner.d.ts +12 -0
- package/types/components/Hud/Scanner/Scanner.d.ts.map +1 -0
- package/types/components/Hud/Toast/Toast.d.ts +9 -0
- package/types/components/Hud/Toast/Toast.d.ts.map +1 -0
- package/types/components/MenuView/MenuView.d.ts +21 -0
- package/types/components/MenuView/MenuView.d.ts.map +1 -0
- package/types/components/Modal/Modal.d.ts +2 -0
- package/types/components/Modal/Modal.d.ts.map +1 -0
- package/{lib/MutiPictureView/index.ts → types/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
- package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
- package/types/components/PictureViewer/PictureViewer.d.ts +17 -0
- package/types/components/PictureViewer/PictureViewer.d.ts.map +1 -0
- package/types/components/RefreshList/RefreshList.d.ts +45 -0
- package/types/components/RefreshList/RefreshList.d.ts.map +1 -0
- package/types/components/RichText/RichText.d.ts +12 -0
- package/types/components/RichText/RichText.d.ts.map +1 -0
- package/types/components/StickHeaderView/StickHeaderView.d.ts +15 -0
- package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
- package/{lib/TableCell/index.ts → types/components/TableCell/TableCell.d.ts} +8 -30
- package/types/components/TableCell/TableCell.d.ts.map +1 -0
- package/types/components/TextInputArea/TextInputArea.d.ts +17 -0
- package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -0
- package/types/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
- package/types/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
- package/types/index.d.ts +22 -0
- package/types/index.d.ts.map +1 -0
- package/types/jsbridge/RNEasyui.d.ts +23 -0
- package/types/jsbridge/RNEasyui.d.ts.map +1 -0
- package/types/jsbridge/UpgradeModule.d.ts +26 -0
- package/types/jsbridge/UpgradeModule.d.ts.map +1 -0
- package/types/jsbridge/index.d.ts +3 -0
- package/types/jsbridge/index.d.ts.map +1 -0
- package/types/screen/index.d.ts +3 -0
- package/types/screen/index.d.ts.map +1 -0
- package/{screen/index.d.ts → types/screen/px2dp.d.ts} +6 -12
- package/types/screen/px2dp.d.ts.map +1 -0
- package/types/screen/px2sp.d.ts +2 -0
- package/types/screen/px2sp.d.ts.map +1 -0
- package/types/screen/text-fit.d.ts +5 -0
- package/types/screen/text-fit.d.ts.map +1 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/{utils/index.d.ts → types/utils/lazy.d.ts} +15 -53
- package/types/utils/lazy.d.ts.map +1 -0
- package/types/utils/mode.d.ts +24 -0
- package/types/utils/mode.d.ts.map +1 -0
- 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
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-29 17:48:20
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-04-29 17:57:17
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/StickHeaderView/demo.tsx
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react'
|
|
9
|
-
import { View, StyleSheet, TouchableOpacity, Text, Animated } from 'react-native'
|
|
10
|
-
import { px2dp } from '../../screen/px2dp'
|
|
11
|
-
import { px2sp } from '../../screen/px2sp'
|
|
12
|
-
|
|
13
|
-
import StickHeaderView from './StickHeaderView'
|
|
14
|
-
import WithLoadingContainer from '../WithLoadingContainer/WithLoadingContainer'
|
|
15
|
-
import { Status } from '../WithLoadingContainer'
|
|
16
|
-
export default ({ }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const scrollY = React.useRef(new Animated.Value(0)).current;
|
|
20
|
-
const headHeight = React.useRef(-1);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<View style={styles.container}>
|
|
27
|
-
<Animated.ScrollView
|
|
28
|
-
style={{ flex: 1 }}
|
|
29
|
-
onScroll={
|
|
30
|
-
Animated.event(
|
|
31
|
-
[{
|
|
32
|
-
nativeEvent: { contentOffset: { y: scrollY } } // 记录滑动距离
|
|
33
|
-
}],
|
|
34
|
-
// {
|
|
35
|
-
// useNativeDriver: true,
|
|
36
|
-
// listener: (event) => {
|
|
37
|
-
// let ey = (event.nativeEvent as any)?.contentOffset?.y as number;
|
|
38
|
-
|
|
39
|
-
// }
|
|
40
|
-
// }
|
|
41
|
-
) // 使用原生动画驱动
|
|
42
|
-
}
|
|
43
|
-
scrollEventThrottle={1}
|
|
44
|
-
>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<View onLayout={(e) => {
|
|
50
|
-
let { height } = e.nativeEvent.layout;
|
|
51
|
-
// setViewModel({ headHeight: height }); // 给头部高度赋值
|
|
52
|
-
headHeight.current = height
|
|
53
|
-
}}>
|
|
54
|
-
{/* <Calendar/> */}
|
|
55
|
-
|
|
56
|
-
</View>
|
|
57
|
-
|
|
58
|
-
<StickHeaderView
|
|
59
|
-
// stickyHeaderY={viewModel.headHeight} // 把头部高度传入
|
|
60
|
-
// stickyScrollY={viewModel.scrollY} // 把滑动距离传入
|
|
61
|
-
stickyHeaderY={headHeight.current} // 把头部高度传入
|
|
62
|
-
stickyScrollY={scrollY} //
|
|
63
|
-
>
|
|
64
|
-
<View >
|
|
65
|
-
|
|
66
|
-
<Text style={{ fontSize: px2sp(16), color: '#333', marginLeft: px2dp(30) }}>当日计划</Text>
|
|
67
|
-
|
|
68
|
-
</View>
|
|
69
|
-
|
|
70
|
-
</StickHeaderView>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<WithLoadingContainer
|
|
74
|
-
status={Status.SUCCESS}
|
|
75
|
-
emptyText={'今日无需巡检'}
|
|
76
|
-
>
|
|
77
|
-
|
|
78
|
-
{Array(30).fill('')?.map((i, index) => <Item key={`sg-item-${index}`} item={i} index={index} />)}
|
|
79
|
-
</WithLoadingContainer>
|
|
80
|
-
</Animated.ScrollView>
|
|
81
|
-
</View>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const Item = (props: { item: any, index: number }) => {
|
|
88
|
-
return (
|
|
89
|
-
<TouchableOpacity >
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</TouchableOpacity>
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const styles = StyleSheet.create({
|
|
99
|
-
container: {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
})
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-29 10:22:02
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-04-29 10:30:47
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/StickHeaderView/index.ts
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import { Animated, ViewProps } from "react-native";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export type StickHeaderViewProps = {
|
|
13
|
-
/**
|
|
14
|
-
* 头部高度
|
|
15
|
-
*/
|
|
16
|
-
stickyHeaderY: number;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 滑动距离
|
|
20
|
-
*/
|
|
21
|
-
stickyScrollY: Animated.Value;
|
|
22
|
-
|
|
23
|
-
} & ViewProps
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const StickHeaderView: React.FC<StickHeaderViewProps>;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
View, Text, StyleSheet, TouchableOpacity, Image,
|
|
4
|
-
} from 'react-native'
|
|
5
|
-
import { px2dp } from '../../screen/px2dp'
|
|
6
|
-
import { px2sp } from '../../screen/px2sp'
|
|
7
|
-
|
|
8
|
-
import { TableCellProps } from './index'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export default (props: Partial<TableCellProps>) => {
|
|
14
|
-
const { showNav = false, activeOpacity = .8 } = props
|
|
15
|
-
return (
|
|
16
|
-
<TouchableOpacity activeOpacity={props.onPress == undefined ? activeOpacity : 1}
|
|
17
|
-
style={[styles.container, props.style]}
|
|
18
|
-
disabled={props.onPress == undefined}
|
|
19
|
-
onPress={() => props.onPress && props.onPress()}
|
|
20
|
-
>
|
|
21
|
-
<View style={[styles.warpper, props.showUnderline ? {
|
|
22
|
-
borderBottomColor: '#f2f2f2',
|
|
23
|
-
// borderBottomWidth: StyleSheet.hairlineWidth,
|
|
24
|
-
borderBottomWidth: px2dp(1),
|
|
25
|
-
...props.underlineStyle
|
|
26
|
-
} : {}]}>
|
|
27
|
-
{props.icon && <Image
|
|
28
|
-
style={[{ width: px2dp(20), height: px2dp(20), marginRight: px2dp(8) }, props.iconStyle]}
|
|
29
|
-
resizeMode='contain'
|
|
30
|
-
source={props.icon}
|
|
31
|
-
/>}
|
|
32
|
-
<View style={[styles.middle, props.middleContaierStyle]}>
|
|
33
|
-
{/* 标题 */}
|
|
34
|
-
{(() => {
|
|
35
|
-
if (typeof props.title === 'string' || typeof props.title === 'number') {
|
|
36
|
-
return (
|
|
37
|
-
<Text
|
|
38
|
-
numberOfLines={1}
|
|
39
|
-
{...props.titleOptions}
|
|
40
|
-
style={[styles.title, props.titleOptions?.style]}
|
|
41
|
-
>{props.title}</Text>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
if (React.isValidElement(props.title)) return props.title
|
|
45
|
-
return <View style={styles.title} />
|
|
46
|
-
})()}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{(() => {
|
|
50
|
-
if (typeof props.content === 'string' || typeof props.content === 'number') {
|
|
51
|
-
return (
|
|
52
|
-
<Text
|
|
53
|
-
numberOfLines={1}
|
|
54
|
-
{...props.contentOptions}
|
|
55
|
-
style={[styles.content, props.contentOptions?.style]}
|
|
56
|
-
>{props.content}</Text>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
if (React.isValidElement(props.content)) return props.content
|
|
60
|
-
|
|
61
|
-
return undefined
|
|
62
|
-
})()}
|
|
63
|
-
</View>
|
|
64
|
-
{showNav && (
|
|
65
|
-
props.nav || <Image
|
|
66
|
-
style={{ width: px2dp(9), height: px2dp(16), marginLeft: px2dp(8) }}
|
|
67
|
-
source={require('./back.png')}
|
|
68
|
-
/>
|
|
69
|
-
)}
|
|
70
|
-
</View>
|
|
71
|
-
|
|
72
|
-
</TouchableOpacity>
|
|
73
|
-
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const styles = StyleSheet.create({
|
|
80
|
-
container: {
|
|
81
|
-
display: 'flex',
|
|
82
|
-
minHeight: px2dp(44),
|
|
83
|
-
paddingLeft: px2dp(15),
|
|
84
|
-
paddingRight: px2dp(10),
|
|
85
|
-
backgroundColor: 'white',
|
|
86
|
-
},
|
|
87
|
-
warpper: {
|
|
88
|
-
flexGrow: 1,
|
|
89
|
-
display: 'flex',
|
|
90
|
-
flexDirection: 'row',
|
|
91
|
-
alignItems: 'center',
|
|
92
|
-
position: 'relative',
|
|
93
|
-
},
|
|
94
|
-
middle: {
|
|
95
|
-
flexGrow: 1,
|
|
96
|
-
flexShrink: 1,
|
|
97
|
-
display: 'flex',
|
|
98
|
-
flexDirection: 'row',
|
|
99
|
-
alignItems: 'center',
|
|
100
|
-
justifyContent: 'space-between',
|
|
101
|
-
// backgroundColor: 'cyan'
|
|
102
|
-
},
|
|
103
|
-
title: {
|
|
104
|
-
// backgroundColor: 'red',
|
|
105
|
-
flexGrow: 0,
|
|
106
|
-
flexShrink: 0,
|
|
107
|
-
fontSize: px2sp(14),
|
|
108
|
-
color: '#333333'
|
|
109
|
-
},
|
|
110
|
-
content: {
|
|
111
|
-
// backgroundColor: 'yellow',
|
|
112
|
-
flexGrow: 1,
|
|
113
|
-
flexShrink: 1,
|
|
114
|
-
fontSize: px2sp(14),
|
|
115
|
-
color: '#666666',
|
|
116
|
-
textAlign: 'right'
|
|
117
|
-
},
|
|
118
|
-
})
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-24 13:56:47
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-09-09 10:59:38
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/TextInputArea/TextInputArea.tsx
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react'
|
|
9
|
-
import { View, Text, TextInput, StyleSheet } from 'react-native'
|
|
10
|
-
import {px2dp} from '../../screen/px2dp'
|
|
11
|
-
import {px2sp} from '../../screen/px2sp'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import type { TextInputAreaProps } from '.'
|
|
15
|
-
|
|
16
|
-
export default React.forwardRef<TextInputAreaProps.RefAttributes, Partial<TextInputAreaProps>>((props, ref) => {
|
|
17
|
-
const { defaultValue, placeholder, maxLength = 200, on, ...rest } = props
|
|
18
|
-
|
|
19
|
-
const [value, setValue] = React.useState<string | undefined>(defaultValue)
|
|
20
|
-
|
|
21
|
-
React.useLayoutEffect(() => {
|
|
22
|
-
setValue(defaultValue)
|
|
23
|
-
}, [defaultValue])
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
React.useImperativeHandle<unknown,TextInputAreaProps.RefAttributes>(ref, () => ({
|
|
27
|
-
value: value,
|
|
28
|
-
}), [value])
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View style={[styles.container, rest.style]}>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<TextInput
|
|
35
|
-
{...rest}
|
|
36
|
-
style={[styles.textInput,rest.textInputStyle]}
|
|
37
|
-
value={value}
|
|
38
|
-
onChangeText={txt => {
|
|
39
|
-
setValue(txt);
|
|
40
|
-
on && on(txt);
|
|
41
|
-
}}
|
|
42
|
-
multiline={true}
|
|
43
|
-
textAlignVertical={'top'}
|
|
44
|
-
maxLength={maxLength}
|
|
45
|
-
placeholder={placeholder}
|
|
46
|
-
|
|
47
|
-
/>
|
|
48
|
-
|
|
49
|
-
<View style={styles.corner}>
|
|
50
|
-
<Text style={styles.limit}>
|
|
51
|
-
<Text style={{ ...styles.limit, color: value && value?.length > (maxLength - 5) ? 'red' : '#AFAFAF' }}>{value?.length || 0}</Text>
|
|
52
|
-
/
|
|
53
|
-
{maxLength}
|
|
54
|
-
</Text>
|
|
55
|
-
</View>
|
|
56
|
-
</View>
|
|
57
|
-
)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const styles = StyleSheet.create({
|
|
63
|
-
container: {
|
|
64
|
-
// backgroundColor: '#F5F5F5',
|
|
65
|
-
minHeight: px2dp(200),
|
|
66
|
-
// borderRadius: px2dp(10),
|
|
67
|
-
backgroundColor:'white'
|
|
68
|
-
},
|
|
69
|
-
textInput: {
|
|
70
|
-
flex: 1,
|
|
71
|
-
margin: px2dp(15),
|
|
72
|
-
marginBottom: px2dp(8),
|
|
73
|
-
fontSize:px2sp(14)
|
|
74
|
-
// backgroundColor: 'red'
|
|
75
|
-
},
|
|
76
|
-
corner: {
|
|
77
|
-
// position: 'absolute',
|
|
78
|
-
// backgroundColor:'cyan',
|
|
79
|
-
marginHorizontal: px2dp(15),
|
|
80
|
-
marginBottom: px2dp(8)
|
|
81
|
-
},
|
|
82
|
-
limit: {
|
|
83
|
-
textAlign: 'right',
|
|
84
|
-
fontSize: px2sp(10),
|
|
85
|
-
color: '#AFAFAF'
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-24 13:59:32
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-09-09 10:59:23
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/lib/TextInputArea/index.d.ts
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react'
|
|
9
|
-
import { ViewStyle, StyleProp, TextInputProps, TextStyle } from 'react-native'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export type TextInputAreaProps = {
|
|
13
|
-
placeholder: string;
|
|
14
|
-
maxLength: number;
|
|
15
|
-
style: StyleProp<ViewStyle>;
|
|
16
|
-
textInputStyle: StyleProp<TextStyle>;
|
|
17
|
-
/**设置默认值 */
|
|
18
|
-
defaultValue: string;
|
|
19
|
-
/*监听content的变化*/
|
|
20
|
-
on: (content: string) => void;
|
|
21
|
-
} & TextInputProps
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare namespace TextInputAreaProps {
|
|
25
|
-
type RefAttributes = {
|
|
26
|
-
value: string | undefined;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export declare const TextInputArea: React.ForwardRefExoticComponent<React.PropsWithoutRef<Partial<TextInputAreaProps>> & React.RefAttributes<TextInputAreaProps.RefAttributes>>;
|
|
32
|
-
|
|
33
|
-
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-20 14:56:47
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-09 14:35:04
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/WithLoadingContainer/WithLoadingContainer.tsx
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { View, Image, Text, StyleSheet, TouchableOpacity } from 'react-native'
|
|
10
|
-
const loading = require('./loading.gif')
|
|
11
|
-
const loading3 = require('./loading3.gif')
|
|
12
|
-
import { WithLoadingContainerProps, Status } from '.'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export default (props: Partial<WithLoadingContainerProps>) => {
|
|
17
|
-
const {
|
|
18
|
-
status = Status.NONE,
|
|
19
|
-
renderFailComponent,
|
|
20
|
-
renderEmptyComponent,
|
|
21
|
-
renderNomoreComponent,
|
|
22
|
-
reload,
|
|
23
|
-
failText = '网络请求失败,点击重新加载~',
|
|
24
|
-
emptyText = '暂无数据',
|
|
25
|
-
nomoreText = '没有更多数据了~',
|
|
26
|
-
} = props
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View style={props.style}>
|
|
32
|
-
<>
|
|
33
|
-
{(() => {
|
|
34
|
-
|
|
35
|
-
switch (status) {
|
|
36
|
-
case Status.NONE: return undefined;
|
|
37
|
-
case Status.SUCCESS: return props.children;
|
|
38
|
-
case Status.LOADING: return <Loading />;
|
|
39
|
-
case Status.FAIL:
|
|
40
|
-
if (renderFailComponent) return renderFailComponent();
|
|
41
|
-
return (
|
|
42
|
-
<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
|
|
43
|
-
<Text style={styles.text}>{failText}</Text>
|
|
44
|
-
</TouchableOpacity>
|
|
45
|
-
);
|
|
46
|
-
case Status.EMPTY:
|
|
47
|
-
if (renderEmptyComponent) return renderEmptyComponent();
|
|
48
|
-
return (
|
|
49
|
-
<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
|
|
50
|
-
<Text style={styles.text}>{emptyText}</Text>
|
|
51
|
-
</TouchableOpacity>
|
|
52
|
-
);
|
|
53
|
-
case Status.NOMORE:
|
|
54
|
-
return (
|
|
55
|
-
<>
|
|
56
|
-
{props.children}
|
|
57
|
-
{renderNomoreComponent ? renderNomoreComponent() : <Text style={styles.text}>{nomoreText}</Text>}
|
|
58
|
-
</>
|
|
59
|
-
);
|
|
60
|
-
default: return <Text style={[styles.text, { lineHeight: 44, }]}>(^_^)∠※ 送你一束小花</Text>;
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
})()}
|
|
64
|
-
</>
|
|
65
|
-
</View>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const Loading = () => {
|
|
72
|
-
return (
|
|
73
|
-
<View style={styles.container}>
|
|
74
|
-
<Image source={loading3} style={{ width: 20, height: 20 }} resizeMode='contain' />
|
|
75
|
-
</View>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const styles = StyleSheet.create({
|
|
81
|
-
text: {
|
|
82
|
-
color: '#999999',
|
|
83
|
-
fontSize: 14,
|
|
84
|
-
// textAlign: 'center',
|
|
85
|
-
},
|
|
86
|
-
container: {
|
|
87
|
-
display: 'flex',
|
|
88
|
-
minHeight: 44,
|
|
89
|
-
justifyContent: 'center',
|
|
90
|
-
alignItems: 'center',
|
|
91
|
-
paddingHorizontal:15
|
|
92
|
-
}
|
|
93
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-20 15:33:30
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-04-29 10:54:37
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/WithLoadingContainer/index.ts
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import React from 'react'
|
|
12
|
-
import { ViewProps, GestureResponderEvent } from 'react-native'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export enum Status {
|
|
16
|
-
NONE = 'NONE',
|
|
17
|
-
LOADING = 'LOADING',
|
|
18
|
-
FAIL = 'FAIL',
|
|
19
|
-
SUCCESS = 'SUCCESS',
|
|
20
|
-
EMPTY = 'EMPTY',
|
|
21
|
-
NOMORE = 'NOMORE',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type WithLoadingContainerProps = {
|
|
25
|
-
status: Status;
|
|
26
|
-
reload: (event: GestureResponderEvent) => void;
|
|
27
|
-
failText: string;
|
|
28
|
-
emptyText: string;
|
|
29
|
-
nomoreText: string;
|
|
30
|
-
renderEmptyComponent: () => React.ReactNode;
|
|
31
|
-
renderFailComponent: () => React.ReactNode;
|
|
32
|
-
renderNomoreComponent: () => React.ReactNode;
|
|
33
|
-
} & ViewProps
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export declare const WithLoadingContainer: React.FC<Partial<WithLoadingContainerProps>>
|
package/screen/px2dp.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
// 设备宽度,单位 dp
|
|
12
|
-
export const deviceWidth = Dimensions.get('screen').width; //设备的宽度
|
|
13
|
-
export const deviceHeight = Dimensions.get('screen').height; //设备的高度
|
|
14
|
-
export const isAndroid = Platform.OS === "android"
|
|
15
|
-
export const isIos = Platform.OS === 'ios'
|
|
16
|
-
export const isiPhoneX = isIos && (deviceHeight > 736)
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 375px/667px
|
|
20
|
-
* */
|
|
21
|
-
const uiWidthPx = 375;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// const pixelRatio = PixelRatio.get()
|
|
26
|
-
// const deviceWidthPx = PixelRatio.getPixelSizeForLayoutSize(deviceWidth);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export const px2dp = (uiElePx: number) => {
|
|
31
|
-
return Math.round(uiElePx * deviceWidth / uiWidthPx);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export const statusBarHeight = (() => {
|
|
39
|
-
if (isAndroid) return StatusBar.currentHeight || 24
|
|
40
|
-
if (isiPhoneX) return 44
|
|
41
|
-
return 20
|
|
42
|
-
})()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export const navigationBarHeight = ( () => {
|
|
47
|
-
if (isAndroid) return 56
|
|
48
|
-
return 44
|
|
49
|
-
})()
|
|
50
|
-
|
|
51
|
-
|
package/src/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-26 11:44:22
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-23 15:24:35
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/src/index.d.ts
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/// 组件 easy-ui
|
|
12
|
-
|
|
13
|
-
export * from '../lib/Badge'
|
|
14
|
-
export * from '../lib/Hud'
|
|
15
|
-
export * from '../lib/Modal'
|
|
16
|
-
export * from '../lib/MutiPictureView'
|
|
17
|
-
export * from '../lib/PictureViewer'
|
|
18
|
-
export * from '../lib/RefreshList'
|
|
19
|
-
export * from '../lib/TableCell'
|
|
20
|
-
export * from '../lib/TextInputArea'
|
|
21
|
-
export * from '../lib/WithLoadingContainer'
|
|
22
|
-
export * from '../lib/StickHeaderView'
|
|
23
|
-
export * from '../lib/Echarts'
|
|
24
|
-
export * from '../lib/RichText'
|
|
25
|
-
export * from '../lib/DottedLine'
|
|
26
|
-
export * from '../lib/MenuView'
|
|
27
|
-
export * from '../lib/AnimationModal'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/// 全局适配
|
|
32
|
-
export * from '../screen/index.d'
|
|
33
|
-
/// 工具
|
|
34
|
-
export * as utils from '../utils/index.d'
|
|
35
|
-
export * as jsbridge from '../jsbridge/index.d'
|
|
36
|
-
|
|
37
|
-
//通用类型
|
|
38
|
-
export type ItemProps = {
|
|
39
|
-
item: any;
|
|
40
|
-
index: number
|
|
41
|
-
}
|
|
42
|
-
|
package/src/index.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* @Author: shiguo
|
|
4
|
-
* @Date: 2022-04-13 12:47:34
|
|
5
|
-
* @LastEditors: shiguo
|
|
6
|
-
* @LastEditTime: 2023-03-23 15:26:14
|
|
7
|
-
* @FilePath: /@aks-dev/easyui/src/index.ts
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/// 组件
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export * from '../lib/Badge/Badge'
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
Hud,
|
|
19
|
-
showLoading, hideLoading,
|
|
20
|
-
showToast,
|
|
21
|
-
showAlertModal,
|
|
22
|
-
showAlertBottomModal,
|
|
23
|
-
showAlertSheetModal,
|
|
24
|
-
showPopoverView, hidePopoverView,
|
|
25
|
-
showScanner, hideScanner
|
|
26
|
-
} from '../lib/Hud/Hud'
|
|
27
|
-
export * from '../lib/Modal/Modal'
|
|
28
|
-
export { default as MutiPictureView } from '../lib/MutiPictureView/MutiPictureView'
|
|
29
|
-
export { PictureViewer } from '../lib/PictureViewer/PictureViewer'
|
|
30
|
-
export { default as RefreshList } from '../lib/RefreshList/RefreshList'
|
|
31
|
-
export { RefreshState } from '../lib/RefreshList'
|
|
32
|
-
export { default as TableCell } from '../lib/TableCell/TableCell'
|
|
33
|
-
export { default as TextInputArea } from '../lib/TextInputArea/TextInputArea'
|
|
34
|
-
export { default as WithLoadingContainer } from '../lib/WithLoadingContainer/WithLoadingContainer'
|
|
35
|
-
export { WithLoadingContainerProps, Status } from '../lib/WithLoadingContainer'
|
|
36
|
-
export { default as StickHeaderView } from '../lib/StickHeaderView/StickHeaderView'
|
|
37
|
-
export { default as EchartsView } from '../lib/Echarts/EchartsView'
|
|
38
|
-
export { echarts } from '../lib/Echarts'
|
|
39
|
-
export { default as RichText } from '../lib/RichText/RichText'
|
|
40
|
-
export { default as DottedLine } from '../lib/DottedLine/DottedLine'
|
|
41
|
-
export { default as MenuView } from '../lib/MenuView/MenuView'
|
|
42
|
-
export { AnimationModal } from '../lib/AnimationModal/AnimationModal'
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/// 全局适配
|
|
46
|
-
export * from '../screen'
|
|
47
|
-
/// 工具
|
|
48
|
-
import * as utils from '../utils'
|
|
49
|
-
/// 桥接
|
|
50
|
-
import * as jsbridge from '../jsbridge'
|
|
51
|
-
export {
|
|
52
|
-
utils,
|
|
53
|
-
jsbridge
|
|
54
|
-
}
|