@aks-dev/easyui 1.0.182 → 1.0.183
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 -19
- package/dist/components/Badge/Badge.js +13 -18
- package/dist/components/DottedLine/DottedLine.js +7 -10
- package/dist/components/Echarts/EchartsView.js +14 -18
- package/dist/components/Echarts/helper.js +2 -7
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +56 -61
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +42 -47
- package/dist/components/Hud/AlertView/AlertView.js +55 -60
- package/dist/components/Hud/Hud.js +17 -31
- package/dist/components/Hud/Loading/Loading.js +21 -27
- package/dist/components/Hud/PopoverView/PopoverView.js +16 -22
- package/dist/components/Hud/Scanner/Scanner.js +108 -114
- package/dist/components/Hud/Toast/Toast.js +22 -27
- package/dist/components/MenuView/MenuView.js +31 -34
- package/dist/components/Modal/Modal.js +1 -6
- package/dist/components/MutiPictureView/MutiPictureView.js +35 -38
- package/dist/components/PictureViewer/PictureViewer.js +12 -17
- package/dist/components/RefreshList/RefreshList.js +47 -51
- package/dist/components/RichText/RichText.js +17 -20
- package/dist/components/StickHeaderView/StickHeaderView.js +7 -10
- package/dist/components/TableCell/TableCell.js +29 -32
- package/dist/components/TextInputArea/TextInputArea.js +25 -28
- package/dist/components/WithLoadingContainer/WithLoadingContainer.js +20 -24
- package/dist/index.js +19 -51
- package/dist/jsbridge/RNEasyui.js +11 -18
- package/dist/jsbridge/UpgradeModule.js +8 -14
- package/dist/jsbridge/index.js +2 -5
- package/dist/screen/index.js +2 -5
- package/dist/screen/px2dp.js +14 -18
- package/dist/screen/px2sp.js +5 -9
- package/dist/screen/text-fit.js +7 -10
- package/dist/utils/index.js +2 -5
- package/dist/utils/lazy.js +25 -50
- package/dist/utils/mode.js +8 -13
- package/package.json +2 -2
- package/readme.md +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Author: OBKoro1
|
|
4
3
|
* @Date: 2022-04-24 17:38:27
|
|
@@ -6,18 +5,16 @@
|
|
|
6
5
|
* @LastEditTime: 2022-11-14 11:33:33
|
|
7
6
|
* @FilePath: /@aks-dev/easyui/lib/MutiPictureView/MutiPictureView.tsx
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const px2sp_1 = require("../../screen/px2sp");
|
|
15
|
-
const react_native_syan_image_picker_1 = tslib_1.__importDefault(require("@aks-dev/react-native-syan-image-picker"));
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Image, View, StyleSheet, Keyboard, TouchableOpacity, Text, } from "react-native";
|
|
10
|
+
import { px2dp } from "../../screen/px2dp";
|
|
11
|
+
import { px2sp } from "../../screen/px2sp";
|
|
12
|
+
import SYImagePicker from "@aks-dev/react-native-syan-image-picker";
|
|
16
13
|
let icon_add_image = require("./assets/icon_add_image.png");
|
|
17
14
|
let icon_del_image = require("./assets/icon_del_image.png");
|
|
18
15
|
const MutiPictureView = (props) => {
|
|
19
16
|
const { bind, maxCount = 6, type = "showImagePicker", addIcon, addIconStyle, addIconContainerStyle, //borderWidth: 1, borderStyle: 'dashed', borderColor: assets.color_A3A9CC 虚线框
|
|
20
|
-
itemContainerStyle, emptyPlaceHolderStyle, delIcon, delIconStyle, spacingHorizontal =
|
|
17
|
+
itemContainerStyle, emptyPlaceHolderStyle, delIcon, delIconStyle, spacingHorizontal = px2dp(15), spacingInner = px2dp(8), editable = true, showEmptyPlaceHolder = false, } = props;
|
|
21
18
|
const { viewModel, setViewModel } = bind;
|
|
22
19
|
React.useEffect(() => { }, []);
|
|
23
20
|
const [sideLength, setSideLength] = React.useState(0);
|
|
@@ -27,7 +24,7 @@ const MutiPictureView = (props) => {
|
|
|
27
24
|
throw new Error("viewModel没有定义photos字段");
|
|
28
25
|
}
|
|
29
26
|
if (type == "showImagePicker") {
|
|
30
|
-
|
|
27
|
+
SYImagePicker.showImagePicker({
|
|
31
28
|
imageCount: maxCount - (viewModel.photos?.length || 0),
|
|
32
29
|
isCrop: false,
|
|
33
30
|
isRecordSelected: false,
|
|
@@ -43,7 +40,7 @@ const MutiPictureView = (props) => {
|
|
|
43
40
|
});
|
|
44
41
|
}
|
|
45
42
|
if (type == "openCamera") {
|
|
46
|
-
|
|
43
|
+
SYImagePicker.openCamera({
|
|
47
44
|
imageCount: maxCount - (viewModel.photos?.length || 0),
|
|
48
45
|
isCrop: false,
|
|
49
46
|
isRecordSelected: false,
|
|
@@ -63,13 +60,13 @@ const MutiPictureView = (props) => {
|
|
|
63
60
|
}
|
|
64
61
|
};
|
|
65
62
|
const deletePhoto = (index) => {
|
|
66
|
-
|
|
63
|
+
Keyboard.dismiss();
|
|
67
64
|
let photos = [...(viewModel.photos || [])];
|
|
68
65
|
photos.splice(index, 1);
|
|
69
66
|
setViewModel({ photos: photos });
|
|
70
67
|
};
|
|
71
68
|
const showPhoto = (index) => {
|
|
72
|
-
|
|
69
|
+
Keyboard.dismiss();
|
|
73
70
|
let imgs = (props.value || viewModel.photos)?.filter((it) => {
|
|
74
71
|
return ((typeof it === "string" && it.indexOf("http") >= 0) ||
|
|
75
72
|
typeof it == "object");
|
|
@@ -95,7 +92,7 @@ const MutiPictureView = (props) => {
|
|
|
95
92
|
});
|
|
96
93
|
};
|
|
97
94
|
const ItemView = ({ source, index, }) => {
|
|
98
|
-
return (<
|
|
95
|
+
return (<TouchableOpacity style={[
|
|
99
96
|
styles.item_container,
|
|
100
97
|
itemContainerStyle,
|
|
101
98
|
{
|
|
@@ -105,11 +102,11 @@ const MutiPictureView = (props) => {
|
|
|
105
102
|
height: sideLength,
|
|
106
103
|
},
|
|
107
104
|
]} activeOpacity={0.8} onPress={() => showPhoto(index)}>
|
|
108
|
-
<
|
|
109
|
-
{editable && !props.value && (<
|
|
110
|
-
<
|
|
111
|
-
</
|
|
112
|
-
</
|
|
105
|
+
<Image source={source} style={{ width: "100%", height: "100%" }} resizeMode="cover"/>
|
|
106
|
+
{editable && !props.value && (<TouchableOpacity onPress={() => deletePhoto(index)} style={[styles.del_img_container, delIconStyle]}>
|
|
107
|
+
<Image source={delIcon ? delIcon : icon_del_image} resizeMode="contain" style={{ width: "100%", height: "100%" }}/>
|
|
108
|
+
</TouchableOpacity>)}
|
|
109
|
+
</TouchableOpacity>);
|
|
113
110
|
};
|
|
114
111
|
const containerRef = React.useRef(null);
|
|
115
112
|
React.useEffect(() => {
|
|
@@ -123,7 +120,7 @@ const MutiPictureView = (props) => {
|
|
|
123
120
|
});
|
|
124
121
|
});
|
|
125
122
|
if (props.value && props.value?.length > 0) {
|
|
126
|
-
return (<
|
|
123
|
+
return (<View style={[styles.container, props.style]} ref={containerRef}>
|
|
127
124
|
{props.value instanceof Array &&
|
|
128
125
|
props.value?.map((item, index) => {
|
|
129
126
|
return (<ItemView key={index} source={typeof item === "string" ? { uri: item } : item} index={index}/>);
|
|
@@ -133,7 +130,7 @@ const MutiPictureView = (props) => {
|
|
|
133
130
|
maxCount - (props.value?.length || 0) - 1 > 0 &&
|
|
134
131
|
Array.from({
|
|
135
132
|
length: maxCount - (props.value?.length || 0) - (editable ? 1 : 0),
|
|
136
|
-
}, (_, k) => (<
|
|
133
|
+
}, (_, k) => (<View key={`sg-showEmptyPlaceHolder-${k}`} style={[
|
|
137
134
|
styles.empty_place_container,
|
|
138
135
|
emptyPlaceHolderStyle,
|
|
139
136
|
itemContainerStyle,
|
|
@@ -150,15 +147,15 @@ const MutiPictureView = (props) => {
|
|
|
150
147
|
height: sideLength,
|
|
151
148
|
},
|
|
152
149
|
]}/>))}
|
|
153
|
-
</
|
|
150
|
+
</View>);
|
|
154
151
|
}
|
|
155
|
-
return (<
|
|
152
|
+
return (<View style={[styles.container, props.style]} ref={containerRef}>
|
|
156
153
|
{viewModel?.photos instanceof Array &&
|
|
157
154
|
viewModel.photos.map((item, index) => {
|
|
158
155
|
return (<ItemView key={index} source={typeof item === "string" ? { uri: item } : item} index={index}/>);
|
|
159
156
|
})}
|
|
160
157
|
|
|
161
|
-
{!(viewModel?.photos?.length == maxCount) && editable && (<
|
|
158
|
+
{!(viewModel?.photos?.length == maxCount) && editable && (<TouchableOpacity style={[
|
|
162
159
|
styles.item_container,
|
|
163
160
|
itemContainerStyle,
|
|
164
161
|
{
|
|
@@ -171,23 +168,23 @@ const MutiPictureView = (props) => {
|
|
|
171
168
|
},
|
|
172
169
|
addIconContainerStyle,
|
|
173
170
|
]} activeOpacity={0.8} onPress={() => addPhoto()}>
|
|
174
|
-
<
|
|
175
|
-
{props.addText && (<
|
|
171
|
+
<Image source={addIcon ? addIcon : icon_add_image} style={[{ width: "25%", height: "25%" }, addIconStyle]} resizeMode="contain"/>
|
|
172
|
+
{props.addText && (<Text style={[
|
|
176
173
|
{
|
|
177
|
-
fontSize:
|
|
174
|
+
fontSize: px2sp(12),
|
|
178
175
|
color: "lightgrey",
|
|
179
|
-
marginTop:
|
|
176
|
+
marginTop: px2dp(2),
|
|
180
177
|
},
|
|
181
178
|
props.addTextStyle,
|
|
182
179
|
]}>
|
|
183
180
|
{props.addText}
|
|
184
|
-
</
|
|
185
|
-
</
|
|
181
|
+
</Text>)}
|
|
182
|
+
</TouchableOpacity>)}
|
|
186
183
|
{showEmptyPlaceHolder &&
|
|
187
184
|
maxCount - (viewModel.photos?.length || 0) - 1 > 0 &&
|
|
188
185
|
Array.from({
|
|
189
186
|
length: maxCount - (viewModel.photos?.length || 0) - (editable ? 1 : 0),
|
|
190
|
-
}, (_, k) => (<
|
|
187
|
+
}, (_, k) => (<View key={`sg-showEmptyPlaceHolder-${k}`} style={[
|
|
191
188
|
styles.empty_place_container,
|
|
192
189
|
emptyPlaceHolderStyle,
|
|
193
190
|
itemContainerStyle,
|
|
@@ -204,9 +201,9 @@ const MutiPictureView = (props) => {
|
|
|
204
201
|
height: sideLength,
|
|
205
202
|
},
|
|
206
203
|
]}/>))}
|
|
207
|
-
</
|
|
204
|
+
</View>);
|
|
208
205
|
};
|
|
209
|
-
const styles =
|
|
206
|
+
const styles = StyleSheet.create({
|
|
210
207
|
container: {
|
|
211
208
|
flex: 1,
|
|
212
209
|
minHeight: 1,
|
|
@@ -218,7 +215,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
218
215
|
},
|
|
219
216
|
item_container: {
|
|
220
217
|
overflow: "hidden",
|
|
221
|
-
borderRadius:
|
|
218
|
+
borderRadius: px2dp(10),
|
|
222
219
|
display: "flex",
|
|
223
220
|
position: "relative",
|
|
224
221
|
justifyContent: "center",
|
|
@@ -229,14 +226,14 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
229
226
|
position: "absolute",
|
|
230
227
|
right: 2,
|
|
231
228
|
top: 2,
|
|
232
|
-
width:
|
|
233
|
-
height:
|
|
229
|
+
width: px2dp(24),
|
|
230
|
+
height: px2dp(24),
|
|
234
231
|
},
|
|
235
232
|
empty_place_container: {
|
|
236
|
-
borderRadius:
|
|
233
|
+
borderRadius: px2dp(10),
|
|
237
234
|
backgroundColor: "#ededed",
|
|
238
235
|
borderColor: "#cccccc",
|
|
239
236
|
borderWidth: 0.75,
|
|
240
237
|
},
|
|
241
238
|
});
|
|
242
|
-
|
|
239
|
+
export default React.memo(MutiPictureView, (prevProps, nextProps) => false);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Author: shiguo
|
|
4
3
|
* @Date: 2022-04-24 15:58:39
|
|
@@ -6,30 +5,27 @@
|
|
|
6
5
|
* @LastEditTime: 2022-04-26 12:38:13
|
|
7
6
|
* @FilePath: /@aks/easy/lib/PictureViewer/PictureViewer.tsx
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const react_native_1 = require("react-native");
|
|
14
|
-
const react_native_image_zoom_viewer_1 = tslib_1.__importDefault(require("react-native-image-zoom-viewer"));
|
|
15
|
-
const PictureViewer = ({ bind, }) => {
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Modal, StatusBar, Platform } from "react-native";
|
|
10
|
+
import ImageViewer from "react-native-image-zoom-viewer";
|
|
11
|
+
export const PictureViewer = ({ bind, }) => {
|
|
16
12
|
const { viewModel, setViewModel } = bind;
|
|
17
13
|
const visible = viewModel.imageViewer.visible;
|
|
18
14
|
const imgs = viewModel.imageViewer.imageUrls?.map((item) => ({ url: item }));
|
|
19
15
|
const index = viewModel.imageViewer.index;
|
|
20
16
|
React.useEffect(() => {
|
|
21
|
-
if (
|
|
17
|
+
if (Platform.OS == "android") {
|
|
22
18
|
if (visible) {
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
StatusBar.setBackgroundColor("black");
|
|
20
|
+
StatusBar.setBarStyle("light-content");
|
|
25
21
|
}
|
|
26
22
|
else {
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
StatusBar.setBackgroundColor("transparent");
|
|
24
|
+
StatusBar.setBarStyle("dark-content");
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
27
|
}, [visible]);
|
|
32
|
-
return (<
|
|
28
|
+
return (<Modal presentationStyle="overFullScreen" visible={visible} transparent={false} onRequestClose={() => {
|
|
33
29
|
/**
|
|
34
30
|
* 【官方文档】
|
|
35
31
|
* onRequestClose回调会在用户按下 Android 设备上的后退按键或是 Apple TV 上的菜单键时触发。
|
|
@@ -42,7 +38,7 @@ const PictureViewer = ({ bind, }) => {
|
|
|
42
38
|
},
|
|
43
39
|
});
|
|
44
40
|
}} style={{ margin: 0, backgroundColor: "red" }}>
|
|
45
|
-
<
|
|
41
|
+
<ImageViewer imageUrls={imgs} index={index} onSwipeDown={() => {
|
|
46
42
|
// console.log('onSwipeDown');
|
|
47
43
|
}} saveToLocalByLongPress={false}
|
|
48
44
|
// onMove={data => console.log(data)}
|
|
@@ -54,6 +50,5 @@ const PictureViewer = ({ bind, }) => {
|
|
|
54
50
|
},
|
|
55
51
|
});
|
|
56
52
|
}}/>
|
|
57
|
-
</
|
|
53
|
+
</Modal>);
|
|
58
54
|
};
|
|
59
|
-
exports.PictureViewer = PictureViewer;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const react_native_1 = require("react-native");
|
|
7
|
-
const react_native_swipe_list_view_1 = require("react-native-swipe-list-view");
|
|
8
|
-
exports.RefreshText = {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Animated, StyleSheet, ActivityIndicator, TouchableOpacity, } from "react-native";
|
|
3
|
+
import { SwipeListView } from "react-native-swipe-list-view";
|
|
4
|
+
export const RefreshText = {
|
|
9
5
|
HeaderRefreshing: "上拉可以刷新",
|
|
10
6
|
FooterRefreshing: "下拉可以加载更多",
|
|
11
7
|
Failure: "服务器正在出小差,点击重新加载",
|
|
@@ -13,7 +9,7 @@ exports.RefreshText = {
|
|
|
13
9
|
EmptyData: "没有数据",
|
|
14
10
|
Idle: "正在加载更多的数据..",
|
|
15
11
|
};
|
|
16
|
-
var RefreshState;
|
|
12
|
+
export var RefreshState;
|
|
17
13
|
(function (RefreshState) {
|
|
18
14
|
RefreshState["Idle"] = "Idle";
|
|
19
15
|
RefreshState["HeaderRefreshing"] = "HeaderRefreshing";
|
|
@@ -22,8 +18,8 @@ var RefreshState;
|
|
|
22
18
|
RefreshState["Failure"] = "Failure";
|
|
23
19
|
RefreshState["EmptyData"] = "EmptyData";
|
|
24
20
|
RefreshState["None"] = "None";
|
|
25
|
-
})(RefreshState || (
|
|
26
|
-
|
|
21
|
+
})(RefreshState || (RefreshState = {}));
|
|
22
|
+
export default React.forwardRef((props, ref) => {
|
|
27
23
|
const { mode = "FlatList", refreshState, onHeaderRefresh, onFooterRefresh, reload, ...rest } = props;
|
|
28
24
|
const seed = React.useRef(Math.random()).current;
|
|
29
25
|
let onRefresh = () => {
|
|
@@ -57,42 +53,42 @@ exports.default = React.forwardRef((props, ref) => {
|
|
|
57
53
|
switch (mode) {
|
|
58
54
|
case "FlatList": {
|
|
59
55
|
let flatListProps = props;
|
|
60
|
-
return (<
|
|
56
|
+
return (<Animated.FlatList {...rest} ref={ref} refreshing={refreshState == RefreshState.HeaderRefreshing} keyExtractor={(_, index) => {
|
|
61
57
|
return `sg-index-FlatList-${seed}-${index}`;
|
|
62
|
-
}} contentContainerStyle={flatListProps.data?.length ? {} : { height: "100%" }} onRefresh={onRefresh} onEndReachedThreshold={0.1} onEndReached={onEndReached} showsVerticalScrollIndicator={false} ListHeaderComponent={(_) => (<
|
|
58
|
+
}} contentContainerStyle={flatListProps.data?.length ? {} : { height: "100%" }} onRefresh={onRefresh} onEndReachedThreshold={0.1} onEndReached={onEndReached} showsVerticalScrollIndicator={false} ListHeaderComponent={(_) => (<View style={{ display: "flex", flexDirection: "column" }}>
|
|
63
59
|
<ListHeaderComponent {...flatListProps}/>
|
|
64
60
|
{/* {flatListProps.ListHeaderComponent} */}
|
|
65
|
-
</
|
|
61
|
+
</View>)}
|
|
66
62
|
// ListHeaderComponent={flatListProps.ListHeaderComponent}
|
|
67
63
|
ListFooterComponent={(_) => (<ListFooterComponent {...flatListProps}/>)}/>);
|
|
68
64
|
}
|
|
69
65
|
case "SectionList": {
|
|
70
66
|
let sectionListProps = props;
|
|
71
|
-
const { ItemSeparatorComponent = (_) => <
|
|
72
|
-
return (<
|
|
67
|
+
const { ItemSeparatorComponent = (_) => <View style={{ height: 1 }}/>, } = sectionListProps;
|
|
68
|
+
return (<Animated.SectionList {...rest} ref={ref} refreshing={refreshState == RefreshState.HeaderRefreshing} onRefresh={onRefresh} keyExtractor={(_, index) => {
|
|
73
69
|
return `sg-index-SectionList-${seed}-${index}`;
|
|
74
70
|
}} contentContainerStyle={sectionListProps.sections?.length > 0 ? {} : { height: "100%" }} ItemSeparatorComponent={ItemSeparatorComponent} onEndReachedThreshold={0.1} onEndReached={onEndReached} showsVerticalScrollIndicator={false}
|
|
75
71
|
// ListHeaderComponent={(_) => <ListHeaderComponent {...sectionListProps} />}
|
|
76
|
-
ListHeaderComponent={(_) => (<
|
|
72
|
+
ListHeaderComponent={(_) => (<View style={{ display: "flex", flexDirection: "column" }}>
|
|
77
73
|
<ListHeaderComponent {...sectionListProps}/>
|
|
78
74
|
{sectionListProps.ListHeaderComponent}
|
|
79
|
-
</
|
|
75
|
+
</View>)} ListFooterComponent={(_) => (<ListFooterComponent {...sectionListProps}/>)} renderSectionHeader={sectionListProps.renderSectionHeader}/>);
|
|
80
76
|
}
|
|
81
77
|
case "SwipeList": {
|
|
82
78
|
let swipeListProps = props;
|
|
83
|
-
const { ItemSeparatorComponent = (_) => <
|
|
84
|
-
const { renderHiddenItem = (data, rowMap) => (<
|
|
79
|
+
const { ItemSeparatorComponent = (_) => <View style={{ height: 1 }}/>, } = swipeListProps;
|
|
80
|
+
const { renderHiddenItem = (data, rowMap) => (<View style={{
|
|
85
81
|
backgroundColor: "red",
|
|
86
82
|
height: "100%",
|
|
87
83
|
alignItems: "flex-end",
|
|
88
84
|
justifyContent: "center",
|
|
89
85
|
}}>
|
|
90
|
-
<
|
|
91
|
-
</
|
|
92
|
-
return (<
|
|
86
|
+
<Text>Right </Text>
|
|
87
|
+
</View>), } = swipeListProps;
|
|
88
|
+
return (<SwipeListView {...rest} rightOpenValue={-100} leftOpenValue={0} ref={ref} disableLeftSwipe={false} disableRightSwipe={true} onRefresh={onRefresh} refreshing={refreshState == RefreshState.HeaderRefreshing} ItemSeparatorComponent={ItemSeparatorComponent} onEndReachedThreshold={0.1} onEndReached={onEndReached} showsVerticalScrollIndicator={false} ListHeaderComponent={(_) => (<View style={{ display: "flex", flexDirection: "column" }}>
|
|
93
89
|
<ListHeaderComponent {...swipeListProps}/>
|
|
94
90
|
{swipeListProps.ListHeaderComponent}
|
|
95
|
-
</
|
|
91
|
+
</View>)} ListFooterComponent={(args) => (<ListFooterComponent {...swipeListProps}/>)} renderHiddenItem={renderHiddenItem}/>);
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
});
|
|
@@ -101,48 +97,48 @@ const ListFooterComponent = React.memo((props) => {
|
|
|
101
97
|
switch (refreshState) {
|
|
102
98
|
case RefreshState.Idle:
|
|
103
99
|
case RefreshState.FooterRefreshing:
|
|
104
|
-
return (<
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
{
|
|
108
|
-
</
|
|
109
|
-
</
|
|
100
|
+
return (<View style={{ ...styles.container, flexDirection: "row" }}>
|
|
101
|
+
<ActivityIndicator color={"gray"}/>
|
|
102
|
+
<Text style={{ ...styles.text, marginLeft: 5 }}>
|
|
103
|
+
{RefreshText.FooterRefreshing}
|
|
104
|
+
</Text>
|
|
105
|
+
</View>);
|
|
110
106
|
case RefreshState.NoMoreData:
|
|
111
|
-
return (<
|
|
112
|
-
<
|
|
113
|
-
{
|
|
114
|
-
</
|
|
115
|
-
</
|
|
107
|
+
return (<View style={styles.container}>
|
|
108
|
+
<Text style={{ ...styles.text, color: "#999999" }}>
|
|
109
|
+
{RefreshText.NoMoreData}
|
|
110
|
+
</Text>
|
|
111
|
+
</View>);
|
|
116
112
|
case RefreshState.Failure:
|
|
117
|
-
return (<
|
|
118
|
-
<
|
|
119
|
-
<
|
|
120
|
-
</
|
|
121
|
-
</
|
|
113
|
+
return (<View style={styles.container}>
|
|
114
|
+
<TouchableOpacity onPress={() => reload && reload()}>
|
|
115
|
+
<Text style={styles.text}>{RefreshText.Failure}</Text>
|
|
116
|
+
</TouchableOpacity>
|
|
117
|
+
</View>);
|
|
122
118
|
case RefreshState.EmptyData:
|
|
123
119
|
if (props.renderListEmptyComponent)
|
|
124
120
|
return props.renderListEmptyComponent();
|
|
125
|
-
return (<
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
</
|
|
129
|
-
</
|
|
121
|
+
return (<View style={styles.container}>
|
|
122
|
+
<TouchableOpacity onPress={() => reload && reload()}>
|
|
123
|
+
<Text style={styles.text}>{RefreshText.EmptyData}</Text>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
</View>);
|
|
130
126
|
default:
|
|
131
|
-
return <
|
|
127
|
+
return <View />;
|
|
132
128
|
}
|
|
133
129
|
});
|
|
134
130
|
const ListHeaderComponent = React.memo((props) => {
|
|
135
131
|
const { refreshState } = props;
|
|
136
132
|
switch (refreshState) {
|
|
137
133
|
case RefreshState.HeaderRefreshing:
|
|
138
|
-
return (<
|
|
139
|
-
<
|
|
140
|
-
</
|
|
134
|
+
return (<View style={{ ...styles.container }}>
|
|
135
|
+
<Text style={{ ...styles.text }}>{RefreshText.HeaderRefreshing}</Text>
|
|
136
|
+
</View>);
|
|
141
137
|
default:
|
|
142
|
-
return <
|
|
138
|
+
return <View />;
|
|
143
139
|
}
|
|
144
140
|
});
|
|
145
|
-
const styles =
|
|
141
|
+
const styles = StyleSheet.create({
|
|
146
142
|
container: {
|
|
147
143
|
display: "flex",
|
|
148
144
|
flexDirection: "column",
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
1
|
/*
|
|
5
2
|
* @Author: shiguo
|
|
6
3
|
* @Date: 2022-07-11 15:42:16
|
|
@@ -8,11 +5,11 @@ const tslib_1 = require("tslib");
|
|
|
8
5
|
* @LastEditTime: 2022-07-11 16:15:02
|
|
9
6
|
* @FilePath: /@aks-dev/easyui/lib/RichText/RichText.tsx
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { StyleSheet, Text } from "react-native";
|
|
10
|
+
import { px2sp } from "../../screen/px2sp";
|
|
11
|
+
import * as utils from "../../utils/lazy";
|
|
12
|
+
export default (props) => {
|
|
16
13
|
const { rich, richStyle, text, suffix, prefix, ...rest } = props;
|
|
17
14
|
let textStr = "";
|
|
18
15
|
let richStr = "";
|
|
@@ -29,31 +26,31 @@ exports.default = (props) => {
|
|
|
29
26
|
positionEnd = positionStart + richStr.length;
|
|
30
27
|
}
|
|
31
28
|
if (prefix) {
|
|
32
|
-
return (<
|
|
33
|
-
<
|
|
29
|
+
return (<Text style={styles.container} {...rest}>
|
|
30
|
+
<Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
|
|
34
31
|
{textStr}
|
|
35
|
-
</
|
|
32
|
+
</Text>);
|
|
36
33
|
}
|
|
37
34
|
if (suffix) {
|
|
38
|
-
return (<
|
|
35
|
+
return (<Text style={styles.container} {...rest}>
|
|
39
36
|
{textStr}
|
|
40
|
-
<
|
|
41
|
-
</
|
|
37
|
+
<Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
|
|
38
|
+
</Text>);
|
|
42
39
|
}
|
|
43
|
-
return (<
|
|
40
|
+
return (<Text style={styles.container} {...rest}>
|
|
44
41
|
{textStr.substring(0, positionStart)}
|
|
45
|
-
{positionEnd > 0 && (<
|
|
42
|
+
{positionEnd > 0 && (<Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>)}
|
|
46
43
|
{textStr.substring(positionEnd, textStr.length)}
|
|
47
|
-
</
|
|
44
|
+
</Text>);
|
|
48
45
|
};
|
|
49
|
-
const styles =
|
|
46
|
+
const styles = StyleSheet.create({
|
|
50
47
|
container: {
|
|
51
48
|
color: "#333333",
|
|
52
|
-
fontSize:
|
|
49
|
+
fontSize: px2sp(14),
|
|
53
50
|
},
|
|
54
51
|
defaultRich: {
|
|
55
52
|
color: "red",
|
|
56
|
-
fontSize:
|
|
53
|
+
fontSize: px2sp(14),
|
|
57
54
|
// fontWeight: 'bold'
|
|
58
55
|
},
|
|
59
56
|
});
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
1
|
/*
|
|
5
2
|
* @Author: shiguo
|
|
6
3
|
* @Date: 2022-04-29 10:22:16
|
|
@@ -8,10 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
8
5
|
* @LastEditTime: 2022-04-29 10:27:44
|
|
9
6
|
* @FilePath: /@aks/easyui/lib/StickHeaderView/StickHeaderView.tsx
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { StyleSheet, Animated, } from "react-native";
|
|
13
10
|
const App = (props) => {
|
|
14
|
-
const { style, children, stickyHeaderY = -1, stickyScrollY = new
|
|
11
|
+
const { style, children, stickyHeaderY = -1, stickyScrollY = new Animated.Value(0), } = props;
|
|
15
12
|
const [stickyLayoutY, setStickyLayoutY] = React.useState(0);
|
|
16
13
|
// 兼容代码,防止没有传头部高度
|
|
17
14
|
const _onLayout = (event) => {
|
|
@@ -24,17 +21,17 @@ const App = (props) => {
|
|
|
24
21
|
outputRange: [0, 0, 0, 1],
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
|
-
return (<
|
|
24
|
+
return (<Animated.View onLayout={_onLayout} style={[
|
|
28
25
|
style,
|
|
29
26
|
styles.container,
|
|
30
27
|
{ transform: [{ translateY: translateY() }] },
|
|
31
28
|
]}>
|
|
32
29
|
{children}
|
|
33
|
-
</
|
|
30
|
+
</Animated.View>);
|
|
34
31
|
};
|
|
35
|
-
const styles =
|
|
32
|
+
const styles = StyleSheet.create({
|
|
36
33
|
container: {
|
|
37
34
|
zIndex: 100,
|
|
38
35
|
},
|
|
39
36
|
});
|
|
40
|
-
|
|
37
|
+
export default React.memo(App);
|