@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,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
2
12
|
import * as React from "react";
|
|
3
13
|
import { View, Text, Animated, StyleSheet, ActivityIndicator, TouchableOpacity, } from "react-native";
|
|
4
14
|
import { SwipeListView } from "react-native-swipe-list-view";
|
|
@@ -55,42 +65,33 @@ export default React.forwardRef((props, ref) => {
|
|
|
55
65
|
switch (mode) {
|
|
56
66
|
case "FlatList": {
|
|
57
67
|
let flatListProps = props;
|
|
58
|
-
return (
|
|
68
|
+
return (React.createElement(Animated.FlatList, Object.assign({}, rest, { ref: ref, refreshing: refreshState == RefreshState.HeaderRefreshing, keyExtractor: (_, index) => {
|
|
59
69
|
return `sg-index-FlatList-${seed}-${index}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
{/* {flatListProps.ListHeaderComponent} */}
|
|
63
|
-
</View>)}
|
|
64
|
-
// ListHeaderComponent={flatListProps.ListHeaderComponent}
|
|
65
|
-
ListFooterComponent={(_) => (<ListFooterComponent {...flatListProps}/>)}/>);
|
|
70
|
+
}, contentContainerStyle: ((_a = flatListProps.data) === null || _a === void 0 ? void 0 : _a.length) ? {} : { height: "100%" }, onRefresh: onRefresh, onEndReachedThreshold: 0.1, onEndReached: onEndReached, showsVerticalScrollIndicator: false, ListHeaderComponent: (_) => (React.createElement(View, { style: { display: "flex", flexDirection: "column" } },
|
|
71
|
+
React.createElement(ListHeaderComponent, Object.assign({}, flatListProps)))), ListFooterComponent: (_) => (React.createElement(ListFooterComponent, Object.assign({}, flatListProps))) })));
|
|
66
72
|
}
|
|
67
73
|
case "SectionList": {
|
|
68
74
|
let sectionListProps = props;
|
|
69
|
-
const { ItemSeparatorComponent = (_) =>
|
|
70
|
-
return (
|
|
75
|
+
const { ItemSeparatorComponent = (_) => React.createElement(View, { style: { height: 1 } }), } = sectionListProps;
|
|
76
|
+
return (React.createElement(Animated.SectionList, Object.assign({}, rest, { ref: ref, refreshing: refreshState == RefreshState.HeaderRefreshing, onRefresh: onRefresh, keyExtractor: (_, index) => {
|
|
71
77
|
return `sg-index-SectionList-${seed}-${index}`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<ListHeaderComponent {...sectionListProps}/>
|
|
76
|
-
{sectionListProps.ListHeaderComponent}
|
|
77
|
-
</View>)} ListFooterComponent={(_) => (<ListFooterComponent {...sectionListProps}/>)} renderSectionHeader={sectionListProps.renderSectionHeader}/>);
|
|
78
|
+
}, contentContainerStyle: ((_b = sectionListProps.sections) === null || _b === void 0 ? void 0 : _b.length) > 0 ? {} : { height: "100%" }, ItemSeparatorComponent: ItemSeparatorComponent, onEndReachedThreshold: 0.1, onEndReached: onEndReached, showsVerticalScrollIndicator: false, ListHeaderComponent: (_) => (React.createElement(View, { style: { display: "flex", flexDirection: "column" } },
|
|
79
|
+
React.createElement(ListHeaderComponent, Object.assign({}, sectionListProps)),
|
|
80
|
+
sectionListProps.ListHeaderComponent)), ListFooterComponent: (_) => (React.createElement(ListFooterComponent, Object.assign({}, sectionListProps))), renderSectionHeader: sectionListProps.renderSectionHeader })));
|
|
78
81
|
}
|
|
79
82
|
case "SwipeList": {
|
|
80
83
|
let swipeListProps = props;
|
|
81
|
-
const { ItemSeparatorComponent = (_) =>
|
|
82
|
-
const { renderHiddenItem = (data, rowMap) => (
|
|
84
|
+
const { ItemSeparatorComponent = (_) => React.createElement(View, { style: { height: 1 } }), } = swipeListProps;
|
|
85
|
+
const { renderHiddenItem = (data, rowMap) => (React.createElement(View, { style: {
|
|
83
86
|
backgroundColor: "red",
|
|
84
87
|
height: "100%",
|
|
85
88
|
alignItems: "flex-end",
|
|
86
89
|
justifyContent: "center",
|
|
87
|
-
}}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{swipeListProps.ListHeaderComponent}
|
|
93
|
-
</View>)} ListFooterComponent={(args) => (<ListFooterComponent {...swipeListProps}/>)} renderHiddenItem={renderHiddenItem}/>);
|
|
90
|
+
} },
|
|
91
|
+
React.createElement(Text, null, "Right "))), } = swipeListProps;
|
|
92
|
+
return (React.createElement(SwipeListView, Object.assign({}, 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: (_) => (React.createElement(View, { style: { display: "flex", flexDirection: "column" } },
|
|
93
|
+
React.createElement(ListHeaderComponent, Object.assign({}, swipeListProps)),
|
|
94
|
+
swipeListProps.ListHeaderComponent)), ListFooterComponent: (args) => (React.createElement(ListFooterComponent, Object.assign({}, swipeListProps))), renderHiddenItem: renderHiddenItem })));
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
});
|
|
@@ -99,45 +100,34 @@ const ListFooterComponent = React.memo((props) => {
|
|
|
99
100
|
switch (refreshState) {
|
|
100
101
|
case RefreshState.Idle:
|
|
101
102
|
case RefreshState.FooterRefreshing:
|
|
102
|
-
return (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{RefreshText.FooterRefreshing}
|
|
106
|
-
</Text>
|
|
107
|
-
</View>);
|
|
103
|
+
return (React.createElement(View, { style: Object.assign(Object.assign({}, styles.container), { flexDirection: "row" }) },
|
|
104
|
+
React.createElement(ActivityIndicator, { color: "gray" }),
|
|
105
|
+
React.createElement(Text, { style: Object.assign(Object.assign({}, styles.text), { marginLeft: 5 }) }, RefreshText.FooterRefreshing)));
|
|
108
106
|
case RefreshState.NoMoreData:
|
|
109
|
-
return (
|
|
110
|
-
|
|
111
|
-
{RefreshText.NoMoreData}
|
|
112
|
-
</Text>
|
|
113
|
-
</View>);
|
|
107
|
+
return (React.createElement(View, { style: styles.container },
|
|
108
|
+
React.createElement(Text, { style: Object.assign(Object.assign({}, styles.text), { color: "#999999" }) }, RefreshText.NoMoreData)));
|
|
114
109
|
case RefreshState.Failure:
|
|
115
|
-
return (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</TouchableOpacity>
|
|
119
|
-
</View>);
|
|
110
|
+
return (React.createElement(View, { style: styles.container },
|
|
111
|
+
React.createElement(TouchableOpacity, { onPress: () => reload && reload() },
|
|
112
|
+
React.createElement(Text, { style: styles.text }, RefreshText.Failure))));
|
|
120
113
|
case RefreshState.EmptyData:
|
|
121
114
|
if (props.renderListEmptyComponent)
|
|
122
115
|
return props.renderListEmptyComponent();
|
|
123
|
-
return (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</TouchableOpacity>
|
|
127
|
-
</View>);
|
|
116
|
+
return (React.createElement(View, { style: styles.container },
|
|
117
|
+
React.createElement(TouchableOpacity, { onPress: () => reload && reload() },
|
|
118
|
+
React.createElement(Text, { style: styles.text }, RefreshText.EmptyData))));
|
|
128
119
|
default:
|
|
129
|
-
return
|
|
120
|
+
return React.createElement(View, null);
|
|
130
121
|
}
|
|
131
122
|
});
|
|
132
123
|
const ListHeaderComponent = React.memo((props) => {
|
|
133
124
|
const { refreshState } = props;
|
|
134
125
|
switch (refreshState) {
|
|
135
126
|
case RefreshState.HeaderRefreshing:
|
|
136
|
-
return (
|
|
137
|
-
|
|
138
|
-
</View>);
|
|
127
|
+
return (React.createElement(View, { style: Object.assign({}, styles.container) },
|
|
128
|
+
React.createElement(Text, { style: Object.assign({}, styles.text) }, RefreshText.HeaderRefreshing)));
|
|
139
129
|
default:
|
|
140
|
-
return
|
|
130
|
+
return React.createElement(View, null);
|
|
141
131
|
}
|
|
142
132
|
});
|
|
143
133
|
const styles = StyleSheet.create({
|
|
@@ -147,7 +137,6 @@ const styles = StyleSheet.create({
|
|
|
147
137
|
justifyContent: "center",
|
|
148
138
|
alignItems: "center",
|
|
149
139
|
height: 44,
|
|
150
|
-
// backgroundColor:'cyan'
|
|
151
140
|
},
|
|
152
141
|
text: {
|
|
153
142
|
color: "gray",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { default as RefreshList, RefreshState } from "./RefreshList";
|
|
4
|
+
const App = () => {
|
|
5
|
+
const [refreshState, setRefreshState] = React.useState(RefreshState.Idle);
|
|
6
|
+
return (React.createElement(RefreshList, { data: ["a", "b"], renderItem: ({ item, index }) => {
|
|
7
|
+
return React.createElement(View, null, item);
|
|
8
|
+
}, refreshState: refreshState, onHeaderRefresh: () => { }, onFooterRefresh: () => { } }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { default as RefreshList, RefreshState } from "./RefreshList";
|
|
4
|
+
const App = () => {
|
|
5
|
+
const [refreshState, setRefreshState] = React.useState(RefreshState.Idle);
|
|
6
|
+
const listRef = React.useRef(null);
|
|
7
|
+
return (React.createElement(RefreshList, { mode: "SectionList", sections: [
|
|
8
|
+
{
|
|
9
|
+
title: "Main dishes",
|
|
10
|
+
data: ["Pizza", "Burger", "Risotto"],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: "Sides",
|
|
14
|
+
data: ["French Fries", "Onion Rings", "Fried Shrimps"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: "Drinks",
|
|
18
|
+
data: ["Water", "Coke", "Beer"],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "Desserts",
|
|
22
|
+
data: ["Cheese Cake", "Ice Cream"],
|
|
23
|
+
},
|
|
24
|
+
], renderItem: ({ item, section }) => {
|
|
25
|
+
return React.createElement(View, null, item);
|
|
26
|
+
}, refreshState: refreshState, onHeaderRefresh: () => { }, onFooterRefresh: () => { }, renderSectionHeader: ({ section: { letter } }) => (React.createElement(View, { style: { backgroundColor: "red" } })) }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { RefreshState } from "./RefreshList";
|
|
3
|
+
const App = () => {
|
|
4
|
+
const [refreshState, setRefreshState] = React.useState(RefreshState.Idle);
|
|
5
|
+
const listRef = React.useRef(null);
|
|
6
|
+
const dataList = Array(20)
|
|
7
|
+
.fill("")
|
|
8
|
+
.map((_, i) => ({ key: `${i}`, text: `item #${i}` }));
|
|
9
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
9
12
|
import React from "react";
|
|
10
13
|
import { StyleSheet, Text } from "react-native";
|
|
11
14
|
import { px2sp } from "../../screen/px2sp";
|
|
@@ -27,22 +30,19 @@ export default (props) => {
|
|
|
27
30
|
positionEnd = positionStart + richStr.length;
|
|
28
31
|
}
|
|
29
32
|
if (prefix) {
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</Text>);
|
|
33
|
+
return (React.createElement(Text, Object.assign({ style: styles.container }, rest),
|
|
34
|
+
React.createElement(Text, { style: Object.assign(Object.assign({}, styles.defaultRich), richStyle) }, richStr),
|
|
35
|
+
textStr));
|
|
34
36
|
}
|
|
35
37
|
if (suffix) {
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</Text>);
|
|
38
|
+
return (React.createElement(Text, Object.assign({ style: styles.container }, rest),
|
|
39
|
+
textStr,
|
|
40
|
+
React.createElement(Text, { style: Object.assign(Object.assign({}, styles.defaultRich), richStyle) }, richStr)));
|
|
40
41
|
}
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</Text>);
|
|
42
|
+
return (React.createElement(Text, Object.assign({ style: styles.container }, rest),
|
|
43
|
+
textStr.substring(0, positionStart),
|
|
44
|
+
positionEnd > 0 && (React.createElement(Text, { style: Object.assign(Object.assign({}, styles.defaultRich), richStyle) }, richStr)),
|
|
45
|
+
textStr.substring(positionEnd, textStr.length)));
|
|
46
46
|
};
|
|
47
47
|
const styles = StyleSheet.create({
|
|
48
48
|
container: {
|
|
@@ -52,6 +52,5 @@ const styles = StyleSheet.create({
|
|
|
52
52
|
defaultRich: {
|
|
53
53
|
color: "red",
|
|
54
54
|
fontSize: px2sp(14),
|
|
55
|
-
// fontWeight: 'bold'
|
|
56
55
|
},
|
|
57
56
|
});
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-29 10:22:16
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-04-29 10:27:44
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/StickHeaderView/StickHeaderView.tsx
|
|
7
|
-
*/
|
|
8
1
|
import * as React from "react";
|
|
9
2
|
import { StyleSheet, Animated, } from "react-native";
|
|
10
3
|
const App = (props) => {
|
|
11
4
|
const { style, children, stickyHeaderY = -1, stickyScrollY = new Animated.Value(0), } = props;
|
|
12
5
|
const [stickyLayoutY, setStickyLayoutY] = React.useState(0);
|
|
13
|
-
// 兼容代码,防止没有传头部高度
|
|
14
6
|
const _onLayout = (event) => {
|
|
15
7
|
setStickyLayoutY(event.nativeEvent.layout.y);
|
|
16
8
|
};
|
|
@@ -21,13 +13,11 @@ const App = (props) => {
|
|
|
21
13
|
outputRange: [0, 0, 0, 1],
|
|
22
14
|
});
|
|
23
15
|
};
|
|
24
|
-
return (
|
|
16
|
+
return (React.createElement(Animated.View, { onLayout: _onLayout, style: [
|
|
25
17
|
style,
|
|
26
18
|
styles.container,
|
|
27
19
|
{ transform: [{ translateY: translateY() }] },
|
|
28
|
-
]}
|
|
29
|
-
{children}
|
|
30
|
-
</Animated.View>);
|
|
20
|
+
] }, children));
|
|
31
21
|
};
|
|
32
22
|
const styles = StyleSheet.create({
|
|
33
23
|
container: {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text, Animated, } from "react-native";
|
|
3
|
+
import { px2dp } from "../../screen/px2dp";
|
|
4
|
+
import { px2sp } from "../../screen/px2sp";
|
|
5
|
+
import StickHeaderView from "./StickHeaderView";
|
|
6
|
+
import WithLoadingContainer from "../WithLoadingContainer/WithLoadingContainer";
|
|
7
|
+
import { Status } from "../WithLoadingContainer/WithLoadingContainer";
|
|
8
|
+
export default ({}) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const scrollY = React.useRef(new Animated.Value(0)).current;
|
|
11
|
+
const headHeight = React.useRef(-1);
|
|
12
|
+
return (React.createElement(View, { style: styles.container },
|
|
13
|
+
React.createElement(Animated.ScrollView, { style: { flex: 1 }, onScroll: Animated.event([
|
|
14
|
+
{
|
|
15
|
+
nativeEvent: { contentOffset: { y: scrollY } },
|
|
16
|
+
},
|
|
17
|
+
]), scrollEventThrottle: 1 },
|
|
18
|
+
React.createElement(View, { onLayout: (e) => {
|
|
19
|
+
let { height } = e.nativeEvent.layout;
|
|
20
|
+
headHeight.current = height;
|
|
21
|
+
} }),
|
|
22
|
+
React.createElement(StickHeaderView, { stickyHeaderY: headHeight.current, stickyScrollY: scrollY },
|
|
23
|
+
React.createElement(View, null,
|
|
24
|
+
React.createElement(Text, { style: {
|
|
25
|
+
fontSize: px2sp(16),
|
|
26
|
+
color: "#333",
|
|
27
|
+
marginLeft: px2dp(30),
|
|
28
|
+
} }, "\u5F53\u65E5\u8BA1\u5212"))),
|
|
29
|
+
React.createElement(WithLoadingContainer, { status: Status.SUCCESS, emptyText: "今日无需巡检" }, (_a = Array(30)
|
|
30
|
+
.fill("")) === null || _a === void 0 ? void 0 : _a.map((i, index) => (React.createElement(Item, { key: `sg-item-${index}`, item: i, index: index })))))));
|
|
31
|
+
};
|
|
32
|
+
const Item = (props) => {
|
|
33
|
+
return React.createElement(TouchableOpacity, null);
|
|
34
|
+
};
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
container: {},
|
|
37
|
+
});
|
|
@@ -4,54 +4,43 @@ import { px2dp } from "../../screen/px2dp";
|
|
|
4
4
|
import { px2sp } from "../../screen/px2sp";
|
|
5
5
|
export default (props) => {
|
|
6
6
|
const { showNav = false, activeOpacity = 0.8 } = props;
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return undefined;
|
|
45
|
-
})()}
|
|
46
|
-
</View>
|
|
47
|
-
{showNav &&
|
|
48
|
-
(props.nav || (<Image style={{
|
|
49
|
-
width: px2dp(9),
|
|
50
|
-
height: px2dp(16),
|
|
51
|
-
marginLeft: px2dp(8),
|
|
52
|
-
}} source={require("./assets/back.png")}/>))}
|
|
53
|
-
</View>
|
|
54
|
-
</TouchableOpacity>);
|
|
7
|
+
return (React.createElement(TouchableOpacity, { activeOpacity: props.onPress == undefined ? activeOpacity : 1, style: [styles.container, props.style], disabled: props.onPress == undefined, onPress: () => props.onPress && props.onPress() },
|
|
8
|
+
React.createElement(View, { style: [
|
|
9
|
+
styles.warpper,
|
|
10
|
+
props.showUnderline
|
|
11
|
+
? Object.assign({ borderBottomColor: "#f2f2f2", borderBottomWidth: px2dp(1) }, props.underlineStyle) : {},
|
|
12
|
+
] },
|
|
13
|
+
props.icon && (React.createElement(Image, { style: [
|
|
14
|
+
{ width: px2dp(20), height: px2dp(20), marginRight: px2dp(8) },
|
|
15
|
+
props.iconStyle,
|
|
16
|
+
], resizeMode: "contain", source: props.icon })),
|
|
17
|
+
React.createElement(View, { style: [styles.middle, props.middleContaierStyle] },
|
|
18
|
+
(() => {
|
|
19
|
+
var _a;
|
|
20
|
+
if (typeof props.title === "string" ||
|
|
21
|
+
typeof props.title === "number") {
|
|
22
|
+
return (React.createElement(Text, Object.assign({ numberOfLines: 1 }, props.titleOptions, { style: [styles.title, (_a = props.titleOptions) === null || _a === void 0 ? void 0 : _a.style] }), props.title));
|
|
23
|
+
}
|
|
24
|
+
if (React.isValidElement(props.title))
|
|
25
|
+
return props.title;
|
|
26
|
+
return React.createElement(View, { style: styles.title });
|
|
27
|
+
})(),
|
|
28
|
+
(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
if (typeof props.content === "string" ||
|
|
31
|
+
typeof props.content === "number") {
|
|
32
|
+
return (React.createElement(Text, Object.assign({ numberOfLines: 1 }, props.contentOptions, { style: [styles.content, (_a = props.contentOptions) === null || _a === void 0 ? void 0 : _a.style] }), props.content));
|
|
33
|
+
}
|
|
34
|
+
if (React.isValidElement(props.content))
|
|
35
|
+
return props.content;
|
|
36
|
+
return undefined;
|
|
37
|
+
})()),
|
|
38
|
+
showNav &&
|
|
39
|
+
(props.nav || (React.createElement(Image, { style: {
|
|
40
|
+
width: px2dp(9),
|
|
41
|
+
height: px2dp(16),
|
|
42
|
+
marginLeft: px2dp(8),
|
|
43
|
+
}, source: require("./assets/back.png") }))))));
|
|
55
44
|
};
|
|
56
45
|
const styles = StyleSheet.create({
|
|
57
46
|
container: {
|
|
@@ -75,17 +64,14 @@ const styles = StyleSheet.create({
|
|
|
75
64
|
flexDirection: "row",
|
|
76
65
|
alignItems: "center",
|
|
77
66
|
justifyContent: "space-between",
|
|
78
|
-
// backgroundColor: 'cyan'
|
|
79
67
|
},
|
|
80
68
|
title: {
|
|
81
|
-
// backgroundColor: 'red',
|
|
82
69
|
flexGrow: 0,
|
|
83
70
|
flexShrink: 0,
|
|
84
71
|
fontSize: px2sp(14),
|
|
85
72
|
color: "#333333",
|
|
86
73
|
},
|
|
87
74
|
content: {
|
|
88
|
-
// backgroundColor: 'yellow',
|
|
89
75
|
flexGrow: 1,
|
|
90
76
|
flexShrink: 1,
|
|
91
77
|
fontSize: px2sp(14),
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
9
12
|
import React from "react";
|
|
10
13
|
import { View, Text, TextInput, StyleSheet, } from "react-native";
|
|
11
14
|
import { px2dp } from "../../screen/px2dp";
|
|
@@ -19,27 +22,20 @@ export default React.forwardRef((props, ref) => {
|
|
|
19
22
|
React.useImperativeHandle(ref, () => ({
|
|
20
23
|
value: value,
|
|
21
24
|
}), [value]);
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</Text>
|
|
33
|
-
/{maxLength}
|
|
34
|
-
</Text>
|
|
35
|
-
</View>
|
|
36
|
-
</View>);
|
|
25
|
+
return (React.createElement(View, { style: [styles.container, rest.style] },
|
|
26
|
+
React.createElement(TextInput, Object.assign({}, rest, { style: [styles.textInput, rest.textInputStyle], value: value, onChangeText: (txt) => {
|
|
27
|
+
setValue(txt);
|
|
28
|
+
on && on(txt);
|
|
29
|
+
}, multiline: true, textAlignVertical: "top", maxLength: maxLength, placeholder: placeholder })),
|
|
30
|
+
React.createElement(View, { style: styles.corner },
|
|
31
|
+
React.createElement(Text, { style: styles.limit },
|
|
32
|
+
React.createElement(Text, { style: Object.assign(Object.assign({}, styles.limit), { color: value && (value === null || value === void 0 ? void 0 : value.length) > maxLength - 5 ? "red" : "#AFAFAF" }) }, (value === null || value === void 0 ? void 0 : value.length) || 0),
|
|
33
|
+
"/",
|
|
34
|
+
maxLength))));
|
|
37
35
|
});
|
|
38
36
|
const styles = StyleSheet.create({
|
|
39
37
|
container: {
|
|
40
|
-
// backgroundColor: '#F5F5F5',
|
|
41
38
|
minHeight: px2dp(200),
|
|
42
|
-
// borderRadius: px2dp(10),
|
|
43
39
|
backgroundColor: "white",
|
|
44
40
|
},
|
|
45
41
|
textInput: {
|
|
@@ -47,11 +43,8 @@ const styles = StyleSheet.create({
|
|
|
47
43
|
margin: px2dp(15),
|
|
48
44
|
marginBottom: px2dp(8),
|
|
49
45
|
fontSize: px2sp(14),
|
|
50
|
-
// backgroundColor: 'red'
|
|
51
46
|
},
|
|
52
47
|
corner: {
|
|
53
|
-
// position: 'absolute',
|
|
54
|
-
// backgroundColor:'cyan',
|
|
55
48
|
marginHorizontal: px2dp(15),
|
|
56
49
|
marginBottom: px2dp(8),
|
|
57
50
|
},
|
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
import React from "react";
|
|
9
2
|
import { View, Image, Text, StyleSheet, TouchableOpacity, } from "react-native";
|
|
10
3
|
const loading = require("./assets/loading.gif");
|
|
@@ -20,52 +13,42 @@ export var Status;
|
|
|
20
13
|
})(Status || (Status = {}));
|
|
21
14
|
export default (props) => {
|
|
22
15
|
const { status = Status.NONE, renderFailComponent, renderEmptyComponent, renderNomoreComponent, reload, failText = "网络请求失败,点击重新加载~", emptyText = "暂无数据", nomoreText = "没有更多数据了~", } = props;
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
{(() => {
|
|
16
|
+
return (React.createElement(View, { style: props.style },
|
|
17
|
+
React.createElement(React.Fragment, null, (() => {
|
|
26
18
|
switch (status) {
|
|
27
19
|
case Status.NONE:
|
|
28
20
|
return undefined;
|
|
29
21
|
case Status.SUCCESS:
|
|
30
22
|
return props.children;
|
|
31
23
|
case Status.LOADING:
|
|
32
|
-
return
|
|
24
|
+
return React.createElement(Loading, null);
|
|
33
25
|
case Status.FAIL:
|
|
34
26
|
if (renderFailComponent)
|
|
35
27
|
return renderFailComponent();
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
</TouchableOpacity>);
|
|
28
|
+
return (React.createElement(TouchableOpacity, { disabled: !reload, onPress: reload, style: styles.container },
|
|
29
|
+
React.createElement(Text, { style: styles.text }, failText)));
|
|
39
30
|
case Status.EMPTY:
|
|
40
31
|
if (renderEmptyComponent)
|
|
41
32
|
return renderEmptyComponent();
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
</TouchableOpacity>);
|
|
33
|
+
return (React.createElement(TouchableOpacity, { disabled: !reload, onPress: reload, style: styles.container },
|
|
34
|
+
React.createElement(Text, { style: styles.text }, emptyText)));
|
|
45
35
|
case Status.NOMORE:
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</>);
|
|
36
|
+
return (React.createElement(React.Fragment, null,
|
|
37
|
+
props.children,
|
|
38
|
+
renderNomoreComponent ? (renderNomoreComponent()) : (React.createElement(Text, { style: styles.text }, nomoreText))));
|
|
50
39
|
default:
|
|
51
|
-
return (
|
|
52
|
-
(^_^)∠※ 送你一束小花
|
|
53
|
-
</Text>);
|
|
40
|
+
return (React.createElement(Text, { style: [styles.text, { lineHeight: 44 }] }, "(^_^)\u2220\u203B \u9001\u4F60\u4E00\u675F\u5C0F\u82B1"));
|
|
54
41
|
}
|
|
55
|
-
})()
|
|
56
|
-
</>
|
|
57
|
-
</View>);
|
|
42
|
+
})())));
|
|
58
43
|
};
|
|
59
44
|
const Loading = () => {
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
</View>);
|
|
45
|
+
return (React.createElement(View, { style: styles.container },
|
|
46
|
+
React.createElement(Image, { source: loading3, style: { width: 20, height: 20 }, resizeMode: "contain" })));
|
|
63
47
|
};
|
|
64
48
|
const styles = StyleSheet.create({
|
|
65
49
|
text: {
|
|
66
50
|
color: "#999999",
|
|
67
51
|
fontSize: 14,
|
|
68
|
-
// textAlign: 'center',
|
|
69
52
|
},
|
|
70
53
|
container: {
|
|
71
54
|
display: "flex",
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-13 12:47:34
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2023-03-23 15:26:14
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/src/index.ts
|
|
7
|
-
*/
|
|
8
|
-
/// 组件
|
|
9
1
|
export * from "./components/Badge/Badge";
|
|
10
2
|
export { Hud, showLoading, hideLoading, showToast, showAlertModal, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, } from "./components/Hud/Hud";
|
|
11
3
|
export * from "./components/Modal/Modal";
|
|
@@ -21,10 +13,7 @@ export { default as RichText } from "./components/RichText/RichText";
|
|
|
21
13
|
export { default as DottedLine } from "./components/DottedLine/DottedLine";
|
|
22
14
|
export { default as MenuView } from "./components/MenuView/MenuView";
|
|
23
15
|
export { AnimationModal } from "./components/AnimationModal/AnimationModal";
|
|
24
|
-
/// 全局适配
|
|
25
16
|
export * from "./screen";
|
|
26
|
-
/// 工具
|
|
27
17
|
import * as utils from "./utils";
|
|
28
|
-
/// 桥接
|
|
29
18
|
import * as jsbridge from "./jsbridge";
|
|
30
19
|
export { utils, jsbridge };
|