@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.
Files changed (176) hide show
  1. package/dist/components/AnimationModal/AnimationModal.d.ts +27 -0
  2. package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -0
  3. package/dist/components/AnimationModal/AnimationModal.js +151 -0
  4. package/dist/components/Badge/Badge.d.ts +8 -0
  5. package/dist/components/Badge/Badge.d.ts.map +1 -0
  6. package/dist/components/Badge/Badge.js +35 -0
  7. package/dist/components/DottedLine/DottedLine.d.ts +10 -0
  8. package/dist/components/DottedLine/DottedLine.d.ts.map +1 -0
  9. package/dist/components/DottedLine/DottedLine.js +50 -0
  10. package/dist/components/EchartsView/EchartsView.d.ts +10 -0
  11. package/dist/components/EchartsView/EchartsView.d.ts.map +1 -0
  12. package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
  13. package/dist/components/EchartsView/helper.d.ts +10 -0
  14. package/dist/components/EchartsView/helper.d.ts.map +1 -0
  15. package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
  16. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
  17. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
  18. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
  19. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
  20. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
  21. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
  22. package/dist/components/Hud/AlertView/AlertView.d.ts +25 -0
  23. package/dist/components/Hud/AlertView/AlertView.d.ts.map +1 -0
  24. package/dist/components/Hud/AlertView/AlertView.js +184 -0
  25. package/dist/components/Hud/Hud.d.ts +11 -0
  26. package/dist/components/Hud/Hud.d.ts.map +1 -0
  27. package/dist/components/Hud/Hud.js +29 -0
  28. package/dist/components/Hud/Loading/Loading.d.ts +11 -0
  29. package/dist/components/Hud/Loading/Loading.d.ts.map +1 -0
  30. package/dist/components/Hud/Loading/Loading.js +66 -0
  31. package/dist/components/Hud/PopoverView/PopoverView.d.ts +17 -0
  32. package/dist/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
  33. package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
  34. package/dist/components/Hud/Scanner/Scanner.d.ts +12 -0
  35. package/dist/components/Hud/Scanner/Scanner.d.ts.map +1 -0
  36. package/dist/components/Hud/Scanner/Scanner.js +301 -0
  37. package/dist/components/Hud/Toast/Toast.d.ts +9 -0
  38. package/dist/components/Hud/Toast/Toast.d.ts.map +1 -0
  39. package/dist/components/Hud/Toast/Toast.js +71 -0
  40. package/dist/components/MenuView/MenuView.d.ts +21 -0
  41. package/dist/components/MenuView/MenuView.d.ts.map +1 -0
  42. package/dist/components/MenuView/MenuView.js +184 -0
  43. package/dist/components/Modal/Modal.d.ts +2 -0
  44. package/dist/components/Modal/Modal.d.ts.map +1 -0
  45. package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
  46. package/{lib/MutiPictureView/index.ts → dist/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
  47. package/dist/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
  48. package/dist/components/MutiPictureView/MutiPictureView.js +243 -0
  49. package/dist/components/PictureViewer/PictureViewer.d.ts +17 -0
  50. package/dist/components/PictureViewer/PictureViewer.d.ts.map +1 -0
  51. package/dist/components/PictureViewer/PictureViewer.js +54 -0
  52. package/dist/components/RefreshList/RefreshList.d.ts +45 -0
  53. package/dist/components/RefreshList/RefreshList.d.ts.map +1 -0
  54. package/dist/components/RefreshList/RefreshList.js +155 -0
  55. package/dist/components/RichText/RichText.d.ts +12 -0
  56. package/dist/components/RichText/RichText.d.ts.map +1 -0
  57. package/dist/components/RichText/RichText.js +56 -0
  58. package/dist/components/StickHeaderView/StickHeaderView.d.ts +15 -0
  59. package/dist/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
  60. package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
  61. package/{lib/TableCell/index.ts → dist/components/TableCell/TableCell.d.ts} +8 -30
  62. package/dist/components/TableCell/TableCell.d.ts.map +1 -0
  63. package/dist/components/TableCell/TableCell.js +97 -0
  64. package/dist/components/TextInputArea/TextInputArea.d.ts +17 -0
  65. package/dist/components/TextInputArea/TextInputArea.d.ts.map +1 -0
  66. package/dist/components/TextInputArea/TextInputArea.js +65 -0
  67. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
  68. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
  69. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
  70. package/dist/index.d.ts +23 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +32 -0
  73. package/dist/jsbridge/RNEasyui.d.ts +23 -0
  74. package/dist/jsbridge/RNEasyui.d.ts.map +1 -0
  75. package/dist/jsbridge/RNEasyui.js +46 -0
  76. package/dist/jsbridge/UpgradeModule.d.ts +26 -0
  77. package/dist/jsbridge/UpgradeModule.d.ts.map +1 -0
  78. package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
  79. package/dist/jsbridge/index.d.ts +3 -0
  80. package/dist/jsbridge/index.d.ts.map +1 -0
  81. package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
  82. package/dist/screen/index.d.ts +3 -0
  83. package/dist/screen/index.d.ts.map +1 -0
  84. package/{screen/index.ts → dist/screen/index.js} +2 -2
  85. package/{screen/index.d.ts → dist/screen/px2dp.d.ts} +6 -12
  86. package/dist/screen/px2dp.d.ts.map +1 -0
  87. package/dist/screen/px2dp.js +45 -0
  88. package/dist/screen/px2sp.d.ts +2 -0
  89. package/dist/screen/px2sp.d.ts.map +1 -0
  90. package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
  91. package/dist/screen/text-fit.d.ts +5 -0
  92. package/dist/screen/text-fit.d.ts.map +1 -0
  93. package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
  94. package/dist/utils/index.d.ts +3 -0
  95. package/dist/utils/index.d.ts.map +1 -0
  96. package/{utils/index.ts → dist/utils/index.js} +2 -2
  97. package/{utils/index.d.ts → dist/utils/lazy.d.ts} +15 -53
  98. package/dist/utils/lazy.d.ts.map +1 -0
  99. package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
  100. package/dist/utils/mode.d.ts +24 -0
  101. package/dist/utils/mode.d.ts.map +1 -0
  102. package/dist/utils/mode.js +50 -0
  103. package/package.json +32 -22
  104. package/readme.md +3 -3
  105. package/android/.DS_Store +0 -0
  106. package/android/src/.DS_Store +0 -0
  107. package/android/src/main/.DS_Store +0 -0
  108. package/android/src/main/java/.DS_Store +0 -0
  109. package/android/src/main/java/com/.DS_Store +0 -0
  110. package/android/src/main/java/com/easyui/.DS_Store +0 -0
  111. package/i.sh +0 -23
  112. package/ios/.DS_Store +0 -0
  113. package/ios/assets/.DS_Store +0 -0
  114. package/ios/views/.DS_Store +0 -0
  115. package/jsbridge/RNEasyui.ts +0 -42
  116. package/jsbridge/index.d.ts +0 -67
  117. package/lib/.DS_Store +0 -0
  118. package/lib/AnimationModal/AnimationModal.tsx +0 -201
  119. package/lib/AnimationModal/index.d.ts +0 -41
  120. package/lib/Badge/Badge.tsx +0 -40
  121. package/lib/Badge/index.ts +0 -21
  122. package/lib/DottedLine/DottedLine.tsx +0 -66
  123. package/lib/DottedLine/index.ts +0 -18
  124. package/lib/Echarts/demo.tsx +0 -235
  125. package/lib/Echarts/index.ts +0 -29
  126. package/lib/Hud/.DS_Store +0 -0
  127. package/lib/Hud/AlertBottomView/AlertBottomView.tsx +0 -228
  128. package/lib/Hud/AlertBottomView/index.d.ts +0 -42
  129. package/lib/Hud/AlertSheetView/AlertSheetView.tsx +0 -179
  130. package/lib/Hud/AlertSheetView/index.d.ts +0 -35
  131. package/lib/Hud/AlertView/AlertView.tsx +0 -234
  132. package/lib/Hud/AlertView/index.d.ts +0 -46
  133. package/lib/Hud/Hud.tsx +0 -67
  134. package/lib/Hud/Loading/Loading.tsx +0 -87
  135. package/lib/Hud/Loading/index.d.ts +0 -38
  136. package/lib/Hud/PopoverView/PopoverView.tsx +0 -66
  137. package/lib/Hud/PopoverView/index.d.ts +0 -39
  138. package/lib/Hud/Scanner/Scanner.tsx +0 -250
  139. package/lib/Hud/Scanner/index.d.ts +0 -42
  140. package/lib/Hud/Toast/Toast.tsx +0 -86
  141. package/lib/Hud/Toast/index.d.ts +0 -22
  142. package/lib/Hud/index.ts +0 -20
  143. package/lib/MenuView/MenuView.tsx +0 -252
  144. package/lib/MenuView/index.ts +0 -31
  145. package/lib/Modal/index.ts +0 -10
  146. package/lib/MutiPictureView/MutiPictureView.tsx +0 -259
  147. package/lib/PictureViewer/PictureViewer.tsx +0 -80
  148. package/lib/PictureViewer/index.ts +0 -26
  149. package/lib/RefreshList/RefreshList.tsx +0 -235
  150. package/lib/RefreshList/demo.tsx +0 -30
  151. package/lib/RefreshList/demo1.tsx +0 -60
  152. package/lib/RefreshList/demo2.tsx +0 -46
  153. package/lib/RefreshList/index.ts +0 -84
  154. package/lib/RichText/RichText.tsx +0 -82
  155. package/lib/RichText/index.ts +0 -21
  156. package/lib/StickHeaderView/StickHeaderView.tsx +0 -65
  157. package/lib/StickHeaderView/demo.tsx +0 -104
  158. package/lib/StickHeaderView/index.ts +0 -26
  159. package/lib/TableCell/TableCell.tsx +0 -118
  160. package/lib/TextInputArea/TextInputArea.tsx +0 -89
  161. package/lib/TextInputArea/index.d.ts +0 -33
  162. package/lib/WithLoadingContainer/WithLoadingContainer.tsx +0 -93
  163. package/lib/WithLoadingContainer/index.ts +0 -36
  164. package/screen/px2dp.ts +0 -51
  165. package/src/index.d.ts +0 -42
  166. package/src/index.ts +0 -54
  167. package/utils/mode.ts +0 -48
  168. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-blue.png +0 -0
  169. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-white.png +0 -0
  170. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/icon_back_white.png +0 -0
  171. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_add_image.png +0 -0
  172. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_del_image.png +0 -0
  173. /package/{lib/TableCell → dist/components/TableCell/assets}/back.png +0 -0
  174. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading.gif +0 -0
  175. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading3.gif +0 -0
  176. /package/{lib → dist/components}/index.md +0 -0
@@ -0,0 +1,56 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-07-11 15:42:16
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-07-11 16:15:02
6
+ * @FilePath: /@aks-dev/easyui/lib/RichText/RichText.tsx
7
+ */
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) => {
13
+ const { rich, richStyle, text, suffix, prefix, ...rest } = props;
14
+ let textStr = "";
15
+ let richStr = "";
16
+ if (utils.isString(text) || utils.isNumber(text)) {
17
+ textStr = String(text);
18
+ }
19
+ if (utils.isString(rich) || utils.isNumber(rich)) {
20
+ richStr = String(rich);
21
+ }
22
+ let positionStart = 0;
23
+ let positionEnd = 0;
24
+ if (textStr?.indexOf(richStr) >= 0) {
25
+ positionStart = textStr.indexOf(richStr);
26
+ positionEnd = positionStart + richStr.length;
27
+ }
28
+ if (prefix) {
29
+ return (<Text style={styles.container} {...rest}>
30
+ <Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
31
+ {textStr}
32
+ </Text>);
33
+ }
34
+ if (suffix) {
35
+ return (<Text style={styles.container} {...rest}>
36
+ {textStr}
37
+ <Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
38
+ </Text>);
39
+ }
40
+ return (<Text style={styles.container} {...rest}>
41
+ {textStr.substring(0, positionStart)}
42
+ {positionEnd > 0 && (<Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>)}
43
+ {textStr.substring(positionEnd, textStr.length)}
44
+ </Text>);
45
+ };
46
+ const styles = StyleSheet.create({
47
+ container: {
48
+ color: "#333333",
49
+ fontSize: px2sp(14),
50
+ },
51
+ defaultRich: {
52
+ color: "red",
53
+ fontSize: px2sp(14),
54
+ // fontWeight: 'bold'
55
+ },
56
+ });
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { Animated, ViewProps } from "react-native";
3
+ export type StickHeaderViewProps = {
4
+ /**
5
+ * 头部高度
6
+ */
7
+ stickyHeaderY: number;
8
+ /**
9
+ * 滑动距离
10
+ */
11
+ stickyScrollY: Animated.Value;
12
+ } & ViewProps;
13
+ declare const _default: React.NamedExoticComponent<StickHeaderViewProps>;
14
+ export default _default;
15
+ //# sourceMappingURL=StickHeaderView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StickHeaderView.d.ts","sourceRoot":"","sources":["../../../src/components/StickHeaderView/StickHeaderView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,QAAQ,EAER,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC;CAC/B,GAAG,SAAS,CAAC;;AA4Cd,wBAA+B"}
@@ -0,0 +1,37 @@
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
+ import * as React from "react";
9
+ import { StyleSheet, Animated, } from "react-native";
10
+ const App = (props) => {
11
+ const { style, children, stickyHeaderY = -1, stickyScrollY = new Animated.Value(0), } = props;
12
+ const [stickyLayoutY, setStickyLayoutY] = React.useState(0);
13
+ // 兼容代码,防止没有传头部高度
14
+ const _onLayout = (event) => {
15
+ setStickyLayoutY(event.nativeEvent.layout.y);
16
+ };
17
+ const translateY = () => {
18
+ let y = stickyHeaderY !== -1 ? stickyHeaderY : stickyLayoutY;
19
+ return stickyScrollY.interpolate({
20
+ inputRange: [-1, 0, y, y + 1],
21
+ outputRange: [0, 0, 0, 1],
22
+ });
23
+ };
24
+ return (<Animated.View onLayout={_onLayout} style={[
25
+ style,
26
+ styles.container,
27
+ { transform: [{ translateY: translateY() }] },
28
+ ]}>
29
+ {children}
30
+ </Animated.View>);
31
+ };
32
+ const styles = StyleSheet.create({
33
+ container: {
34
+ zIndex: 100,
35
+ },
36
+ });
37
+ export default React.memo(App);
@@ -1,46 +1,24 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-21 15:30:07
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-07 16:06:57
6
- * @FilePath: /@aks-dev/easyui/lib/TableCell/index.ts
7
- */
8
-
9
- import * as React from 'react'
10
-
11
- import {
12
- StyleProp, ViewStyle,
13
- ImageSourcePropType, ImageStyle, TextProps, ColorValue
14
- } from 'react-native'
15
-
16
-
17
-
18
-
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle, ImageSourcePropType, ImageStyle, TextProps, ColorValue } from "react-native";
19
3
  export type TableCellProps = {
20
4
  icon: ImageSourcePropType;
21
5
  iconStyle: StyleProp<ImageStyle>;
22
-
23
6
  title: string | number | React.ReactElement | undefined;
24
7
  titleOptions: TextProps;
25
-
26
-
27
8
  style: StyleProp<ViewStyle> | undefined;
28
9
  activeOpacity: number;
29
10
  middleContaierStyle: StyleProp<ViewStyle> | undefined;
30
-
31
-
32
11
  content: string | number | React.ReactElement | undefined;
33
12
  contentOptions: TextProps;
34
-
35
13
  onPress: () => void;
36
14
  showUnderline: boolean;
37
15
  underlineStyle?: {
38
16
  borderBottomColor?: ColorValue | undefined;
39
17
  borderBottomWidth?: number | undefined;
40
- }
18
+ };
41
19
  showNav: boolean;
42
- nav:React.ReactElement;
43
- }
44
-
45
-
46
- export declare const TableCell: React.FC<Partial<TableCellProps>>;
20
+ nav: React.ReactElement;
21
+ };
22
+ declare const _default: (props: Partial<TableCellProps>) => React.JSX.Element;
23
+ export default _default;
24
+ //# sourceMappingURL=TableCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/components/TableCell/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEjC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;IACxD,YAAY,EAAE,SAAS,CAAC;IAExB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAEtD,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;IAC1D,cAAc,EAAE,SAAS,CAAC;IAE1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE;QACf,iBAAiB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;QAC3C,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC;CACzB,CAAC;yBAEc,OAAO,OAAO,CAAC,cAAc,CAAC;AAA9C,wBAuFE"}
@@ -0,0 +1,97 @@
1
+ import * as React from "react";
2
+ import { View, Text, StyleSheet, TouchableOpacity, Image, } from "react-native";
3
+ import { px2dp } from "../../screen/px2dp";
4
+ import { px2sp } from "../../screen/px2sp";
5
+ export default (props) => {
6
+ const { showNav = false, activeOpacity = 0.8 } = props;
7
+ return (<TouchableOpacity activeOpacity={props.onPress == undefined ? activeOpacity : 1} style={[styles.container, props.style]} disabled={props.onPress == undefined} onPress={() => props.onPress && props.onPress()}>
8
+ <View style={[
9
+ styles.warpper,
10
+ props.showUnderline
11
+ ? {
12
+ borderBottomColor: "#f2f2f2",
13
+ // borderBottomWidth: StyleSheet.hairlineWidth,
14
+ borderBottomWidth: px2dp(1),
15
+ ...props.underlineStyle,
16
+ }
17
+ : {},
18
+ ]}>
19
+ {props.icon && (<Image style={[
20
+ { width: px2dp(20), height: px2dp(20), marginRight: px2dp(8) },
21
+ props.iconStyle,
22
+ ]} resizeMode="contain" source={props.icon}/>)}
23
+ <View style={[styles.middle, props.middleContaierStyle]}>
24
+ {/* 标题 */}
25
+ {(() => {
26
+ if (typeof props.title === "string" ||
27
+ typeof props.title === "number") {
28
+ return (<Text numberOfLines={1} {...props.titleOptions} style={[styles.title, props.titleOptions?.style]}>
29
+ {props.title}
30
+ </Text>);
31
+ }
32
+ if (React.isValidElement(props.title))
33
+ return props.title;
34
+ return <View style={styles.title}/>;
35
+ })()}
36
+
37
+ {(() => {
38
+ if (typeof props.content === "string" ||
39
+ typeof props.content === "number") {
40
+ return (<Text numberOfLines={1} {...props.contentOptions} style={[styles.content, props.contentOptions?.style]}>
41
+ {props.content}
42
+ </Text>);
43
+ }
44
+ if (React.isValidElement(props.content))
45
+ return props.content;
46
+ return undefined;
47
+ })()}
48
+ </View>
49
+ {showNav &&
50
+ (props.nav || (<Image style={{
51
+ width: px2dp(9),
52
+ height: px2dp(16),
53
+ marginLeft: px2dp(8),
54
+ }} source={require("./assets/back.png")}/>))}
55
+ </View>
56
+ </TouchableOpacity>);
57
+ };
58
+ const styles = StyleSheet.create({
59
+ container: {
60
+ display: "flex",
61
+ minHeight: px2dp(44),
62
+ paddingLeft: px2dp(15),
63
+ paddingRight: px2dp(10),
64
+ backgroundColor: "white",
65
+ },
66
+ warpper: {
67
+ flexGrow: 1,
68
+ display: "flex",
69
+ flexDirection: "row",
70
+ alignItems: "center",
71
+ position: "relative",
72
+ },
73
+ middle: {
74
+ flexGrow: 1,
75
+ flexShrink: 1,
76
+ display: "flex",
77
+ flexDirection: "row",
78
+ alignItems: "center",
79
+ justifyContent: "space-between",
80
+ // backgroundColor: 'cyan'
81
+ },
82
+ title: {
83
+ // backgroundColor: 'red',
84
+ flexGrow: 0,
85
+ flexShrink: 0,
86
+ fontSize: px2sp(14),
87
+ color: "#333333",
88
+ },
89
+ content: {
90
+ // backgroundColor: 'yellow',
91
+ flexGrow: 1,
92
+ flexShrink: 1,
93
+ fontSize: px2sp(14),
94
+ color: "#666666",
95
+ textAlign: "right",
96
+ },
97
+ });
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { ViewStyle, StyleProp, TextInputProps, TextStyle } from "react-native";
3
+ type RefAttributes = {
4
+ value: string | undefined;
5
+ };
6
+ export type TextInputAreaProps = {
7
+ placeholder: string;
8
+ maxLength: number;
9
+ style: StyleProp<ViewStyle>;
10
+ textInputStyle: StyleProp<TextStyle>;
11
+ /**设置默认值 */
12
+ defaultValue: string;
13
+ on: (content: string) => void;
14
+ } & TextInputProps;
15
+ declare const _default: React.ForwardRefExoticComponent<Partial<TextInputAreaProps> & React.RefAttributes<RefAttributes>>;
16
+ export default _default;
17
+ //# sourceMappingURL=TextInputArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInputArea.d.ts","sourceRoot":"","sources":["../../../src/components/TextInputArea/TextInputArea.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,SAAS,EACT,SAAS,EACT,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,WAAW;IACX,YAAY,EAAE,MAAM,CAAC;IAErB,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,GAAG,cAAc,CAAC;;AAEnB,wBAmDE"}
@@ -0,0 +1,65 @@
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
+ export default React.forwardRef((props, ref) => {
13
+ const { defaultValue, placeholder, maxLength = 200, on, ...rest } = props;
14
+ const [value, setValue] = React.useState(defaultValue);
15
+ React.useLayoutEffect(() => {
16
+ setValue(defaultValue);
17
+ }, [defaultValue]);
18
+ React.useImperativeHandle(ref, () => ({
19
+ value: value,
20
+ }), [value]);
21
+ return (<View style={[styles.container, rest.style]}>
22
+ <TextInput {...rest} style={[styles.textInput, rest.textInputStyle]} value={value} onChangeText={(txt) => {
23
+ setValue(txt);
24
+ on && on(txt);
25
+ }} multiline={true} textAlignVertical={"top"} maxLength={maxLength} placeholder={placeholder}/>
26
+
27
+ <View style={styles.corner}>
28
+ <Text style={styles.limit}>
29
+ <Text style={{
30
+ ...styles.limit,
31
+ color: value && value?.length > maxLength - 5 ? "red" : "#AFAFAF",
32
+ }}>
33
+ {value?.length || 0}
34
+ </Text>
35
+ /{maxLength}
36
+ </Text>
37
+ </View>
38
+ </View>);
39
+ });
40
+ const styles = StyleSheet.create({
41
+ container: {
42
+ // backgroundColor: '#F5F5F5',
43
+ minHeight: px2dp(200),
44
+ // borderRadius: px2dp(10),
45
+ backgroundColor: "white",
46
+ },
47
+ textInput: {
48
+ flex: 1,
49
+ margin: px2dp(15),
50
+ marginBottom: px2dp(8),
51
+ fontSize: px2sp(14),
52
+ // backgroundColor: 'red'
53
+ },
54
+ corner: {
55
+ // position: 'absolute',
56
+ // backgroundColor:'cyan',
57
+ marginHorizontal: px2dp(15),
58
+ marginBottom: px2dp(8),
59
+ },
60
+ limit: {
61
+ textAlign: "right",
62
+ fontSize: px2sp(10),
63
+ color: "#AFAFAF",
64
+ },
65
+ });
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { GestureResponderEvent, ViewProps } from "react-native";
3
+ export declare enum Status {
4
+ NONE = "NONE",
5
+ LOADING = "LOADING",
6
+ FAIL = "FAIL",
7
+ SUCCESS = "SUCCESS",
8
+ EMPTY = "EMPTY",
9
+ NOMORE = "NOMORE"
10
+ }
11
+ export type WithLoadingContainerProps = {
12
+ status: Status;
13
+ reload: (event: GestureResponderEvent) => void;
14
+ failText: string;
15
+ emptyText: string;
16
+ nomoreText: string;
17
+ renderEmptyComponent: () => React.ReactNode;
18
+ renderFailComponent: () => React.ReactNode;
19
+ renderNomoreComponent: () => React.ReactNode;
20
+ } & ViewProps;
21
+ declare const _default: (props: Partial<WithLoadingContainerProps>) => React.JSX.Element;
22
+ export default _default;
23
+ //# sourceMappingURL=WithLoadingContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithLoadingContainer.d.ts","sourceRoot":"","sources":["../../../src/components/WithLoadingContainer/WithLoadingContainer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAML,qBAAqB,EACrB,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,oBAAY,MAAM;IAChB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC5C,mBAAmB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC3C,qBAAqB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC9C,GAAG,SAAS,CAAC;yBAEE,OAAO,OAAO,CAAC,yBAAyB,CAAC;AAAzD,wBAmEE"}
@@ -0,0 +1,77 @@
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("./assets/loading.gif");
11
+ const loading3 = require("./assets/loading3.gif");
12
+ export var Status;
13
+ (function (Status) {
14
+ Status["NONE"] = "NONE";
15
+ Status["LOADING"] = "LOADING";
16
+ Status["FAIL"] = "FAIL";
17
+ Status["SUCCESS"] = "SUCCESS";
18
+ Status["EMPTY"] = "EMPTY";
19
+ Status["NOMORE"] = "NOMORE";
20
+ })(Status || (Status = {}));
21
+ export default (props) => {
22
+ const { status = Status.NONE, renderFailComponent, renderEmptyComponent, renderNomoreComponent, reload, failText = "网络请求失败,点击重新加载~", emptyText = "暂无数据", nomoreText = "没有更多数据了~", } = props;
23
+ return (<View style={props.style}>
24
+ <>
25
+ {(() => {
26
+ switch (status) {
27
+ case Status.NONE:
28
+ return undefined;
29
+ case Status.SUCCESS:
30
+ return props.children;
31
+ case Status.LOADING:
32
+ return <Loading />;
33
+ case Status.FAIL:
34
+ if (renderFailComponent)
35
+ return renderFailComponent();
36
+ return (<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
37
+ <Text style={styles.text}>{failText}</Text>
38
+ </TouchableOpacity>);
39
+ case Status.EMPTY:
40
+ if (renderEmptyComponent)
41
+ return renderEmptyComponent();
42
+ return (<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
43
+ <Text style={styles.text}>{emptyText}</Text>
44
+ </TouchableOpacity>);
45
+ case Status.NOMORE:
46
+ return (<>
47
+ {props.children}
48
+ {renderNomoreComponent ? (renderNomoreComponent()) : (<Text style={styles.text}>{nomoreText}</Text>)}
49
+ </>);
50
+ default:
51
+ return (<Text style={[styles.text, { lineHeight: 44 }]}>
52
+ (^_^)∠※ 送你一束小花
53
+ </Text>);
54
+ }
55
+ })()}
56
+ </>
57
+ </View>);
58
+ };
59
+ const Loading = () => {
60
+ return (<View style={styles.container}>
61
+ <Image source={loading3} style={{ width: 20, height: 20 }} resizeMode="contain"/>
62
+ </View>);
63
+ };
64
+ const styles = StyleSheet.create({
65
+ text: {
66
+ color: "#999999",
67
+ fontSize: 14,
68
+ // textAlign: 'center',
69
+ },
70
+ container: {
71
+ display: "flex",
72
+ minHeight: 44,
73
+ justifyContent: "center",
74
+ alignItems: "center",
75
+ paddingHorizontal: 15,
76
+ },
77
+ });
@@ -0,0 +1,23 @@
1
+ export { Hud, showLoading, hideLoading, showToast, showAlertModal, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, } from "./components/Hud/Hud";
2
+ export { Modal, ModalProps } from "./components/Modal/Modal";
3
+ export { default as MutiPictureView } from "./components/MutiPictureView/MutiPictureView";
4
+ export { PictureViewer } from "./components/PictureViewer/PictureViewer";
5
+ export { default as RefreshList, RefreshState, RefreshText, } from "./components/RefreshList/RefreshList";
6
+ export { default as TableCell } from "./components/TableCell/TableCell";
7
+ export { default as TextInputArea } from "./components/TextInputArea/TextInputArea";
8
+ export { default as WithLoadingContainer, Status, } from "./components/WithLoadingContainer/WithLoadingContainer";
9
+ export { default as StickHeaderView } from "./components/StickHeaderView/StickHeaderView";
10
+ export { default as EchartsView } from "./components/EchartsView/EchartsView";
11
+ export { default as RichText } from "./components/RichText/RichText";
12
+ export { default as DottedLine } from "./components/DottedLine/DottedLine";
13
+ export { default as MenuView } from "./components/MenuView/MenuView";
14
+ export { AnimationModal } from "./components/AnimationModal/AnimationModal";
15
+ export { Badge } from "./components/Badge/Badge";
16
+ /**全局适配 */
17
+ export * from "./screen";
18
+ /**工具 */
19
+ import * as utils from "./utils";
20
+ /**桥接 */
21
+ import * as jsbridge from "./jsbridge";
22
+ export { utils, jsbridge };
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,GAAG,EACH,WAAW,EACX,WAAW,EACX,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,YAAY,EACZ,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,MAAM,GACP,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,UAAU;AACV,cAAc,UAAU,CAAC;AACzB,QAAQ;AACR,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,QAAQ;AACR,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,32 @@
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
+ // export { Badge } from "./components/Badge/Badge";
10
+ // export type { BadgeProps } from "./components/Badge/Badge";
11
+ export { Hud, showLoading, hideLoading, showToast, showAlertModal, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, } from "./components/Hud/Hud";
12
+ export { Modal } from "./components/Modal/Modal";
13
+ export { default as MutiPictureView } from "./components/MutiPictureView/MutiPictureView";
14
+ export { PictureViewer } from "./components/PictureViewer/PictureViewer";
15
+ export { default as RefreshList, RefreshState, RefreshText, } from "./components/RefreshList/RefreshList";
16
+ export { default as TableCell } from "./components/TableCell/TableCell";
17
+ export { default as TextInputArea } from "./components/TextInputArea/TextInputArea";
18
+ export { default as WithLoadingContainer, Status, } from "./components/WithLoadingContainer/WithLoadingContainer";
19
+ export { default as StickHeaderView } from "./components/StickHeaderView/StickHeaderView";
20
+ export { default as EchartsView } from "./components/EchartsView/EchartsView";
21
+ export { default as RichText } from "./components/RichText/RichText";
22
+ export { default as DottedLine } from "./components/DottedLine/DottedLine";
23
+ export { default as MenuView } from "./components/MenuView/MenuView";
24
+ export { AnimationModal } from "./components/AnimationModal/AnimationModal";
25
+ export { Badge } from "./components/Badge/Badge";
26
+ /**全局适配 */
27
+ export * from "./screen";
28
+ /**工具 */
29
+ import * as utils from "./utils";
30
+ /**桥接 */
31
+ import * as jsbridge from "./jsbridge";
32
+ export { utils, jsbridge };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @description: 获取设备品牌
3
+ * @return {*}
4
+ */
5
+ export declare const getDeviceBrand: () => any;
6
+ /**
7
+ * @deprecated 测量不准确,已放弃
8
+ * @description: 获取status_bar_height
9
+ * @return {*}
10
+ */
11
+ export declare const getStatusBarHeight: () => any;
12
+ /**
13
+ * @deprecated 测量不准确,已放弃
14
+ * @description: 获取navigation_bar_height
15
+ * @return {*}
16
+ */
17
+ export declare const getNavigationBarHeight: () => any;
18
+ /**
19
+ * only android
20
+ * 返回桌面
21
+ */
22
+ export declare const gotoDesktop: () => void;
23
+ //# sourceMappingURL=RNEasyui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNEasyui.d.ts","sourceRoot":"","sources":["../../src/jsbridge/RNEasyui.ts"],"names":[],"mappings":"AAYA;;;GAGG;AACH,eAAO,MAAM,cAAc,WAAkC,CAAC;AAC9D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAO9B,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,WAIlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,YAEvB,CAAC"}
@@ -0,0 +1,46 @@
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
+ import { Dimensions, NativeModules, Platform } from "react-native";
9
+ const { RNEasyui } = NativeModules;
10
+ /**
11
+ * @description: 获取设备品牌
12
+ * @return {*}
13
+ */
14
+ export const getDeviceBrand = () => RNEasyui.getDeviceBrand();
15
+ /**
16
+ * @deprecated 测量不准确,已放弃
17
+ * @description: 获取status_bar_height
18
+ * @return {*}
19
+ */
20
+ export const getStatusBarHeight = () => {
21
+ if (Platform.OS == "android")
22
+ return RNEasyui.getStatusBarHeight();
23
+ const deviceHeight = Dimensions.get("window").height;
24
+ const isiPhoneX = Platform.OS == "ios" && deviceHeight > 736;
25
+ if (isiPhoneX)
26
+ return Promise.resolve(44);
27
+ return Promise.resolve(20);
28
+ };
29
+ /**
30
+ * @deprecated 测量不准确,已放弃
31
+ * @description: 获取navigation_bar_height
32
+ * @return {*}
33
+ */
34
+ export const getNavigationBarHeight = () => {
35
+ if (Platform.OS == "android")
36
+ return RNEasyui.getNavigationBarHeight();
37
+ return Promise.resolve(44);
38
+ };
39
+ /**
40
+ * only android
41
+ * 返回桌面
42
+ */
43
+ export const gotoDesktop = () => {
44
+ if (Platform.OS == "android")
45
+ RNEasyui?.gotoDesktop();
46
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @description: 获取App版本号
3
+ * @param {*}
4
+ * @return {*}
5
+ */
6
+ export declare const getAppVersion: () => any;
7
+ /**
8
+ * @description: 获取操作系统版本
9
+ *
10
+ react-native-device-info
11
+ * @return {*}
12
+ */
13
+ export declare const getOSVersion: () => any;
14
+ /**
15
+ * @description: app升级
16
+ * @return {*}
17
+ */
18
+ export type UpgradeOptions = {
19
+ title?: string;
20
+ version: string;
21
+ downloadUrl: string;
22
+ note: string;
23
+ force: boolean;
24
+ };
25
+ export declare const upgrade: (options: UpgradeOptions) => Promise<any>;
26
+ //# sourceMappingURL=UpgradeModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpgradeModule.d.ts","sourceRoot":"","sources":["../../src/jsbridge/UpgradeModule.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,eAAO,MAAM,aAAa,WAAsC,CAAC;AACjE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WAAqC,CAAC;AAC/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,SAAS,cAAc,iBA0BpD,CAAC"}