@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
@@ -1,60 +0,0 @@
1
- import * as React from 'react'
2
- import { View, TouchableOpacity, Text } from 'react-native'
3
-
4
- import { RefreshList, RefreshState } from './index'
5
-
6
-
7
-
8
- const App = () => {
9
-
10
- const [refreshState, setRefreshState] = React.useState(RefreshState.Idle)
11
-
12
- const listRef = React.useRef<any>()
13
-
14
- return (
15
-
16
- <RefreshList
17
- mode='SectionList'
18
- sections={
19
- [
20
- {
21
- title: "Main dishes",
22
- data: ["Pizza", "Burger", "Risotto"]
23
- },
24
- {
25
- title: "Sides",
26
- data: ["French Fries", "Onion Rings", "Fried Shrimps"]
27
- },
28
- {
29
- title: "Drinks",
30
- data: ["Water", "Coke", "Beer"]
31
- },
32
- {
33
- title: "Desserts",
34
- data: ["Cheese Cake", "Ice Cream"]
35
- }
36
- ]
37
- }
38
- renderItem={({ item, section }) => {
39
-
40
- return <View>{item}</View>
41
- }}
42
-
43
- refreshState={refreshState}
44
- onHeaderRefresh={() => {
45
-
46
- }}
47
- onFooterRefresh={() => {
48
-
49
- }}
50
-
51
- renderSectionHeader={({ section: { letter } }) => (
52
- <View style={{ backgroundColor: 'red' }}>
53
-
54
- </View>
55
- )}
56
- />
57
-
58
-
59
- )
60
- }
@@ -1,46 +0,0 @@
1
- import * as React from 'react'
2
- import { View, TouchableOpacity, Text } from 'react-native'
3
-
4
- import { RefreshList, RefreshState } from './index'
5
-
6
-
7
-
8
- const App = () => {
9
-
10
- const [refreshState, setRefreshState] = React.useState(RefreshState.Idle)
11
-
12
- const listRef = React.useRef<any>()
13
- const dataList = Array(20)
14
- .fill("")
15
- .map((_, i) => ({ key: `${i}`, text: `item #${i}` }))
16
- // return (
17
-
18
-
19
-
20
- // <RefreshList
21
- // mode='SwipeList'
22
- // ref={listRef}
23
- // data={dataList}
24
- // renderItem={(data, rowMap) => (
25
- // <View >
26
- // <Text>I am {data.item.text} in a SwipeListView</Text>
27
- // </View>
28
- // )}
29
- // refreshState={refreshState}
30
- // onHeaderRefresh={() => {
31
-
32
- // }}
33
- // onFooterRefresh={() => {
34
-
35
- // }}
36
- // renderHiddenItem={(data, rowMap) => (
37
- // <TouchableOpacity onPress={() => {
38
- // listRef.current?.safeCloseOpenRow()
39
- // }}>
40
-
41
- // </TouchableOpacity>
42
- // )}
43
- // />
44
-
45
- // )
46
- }
@@ -1,84 +0,0 @@
1
- /*
2
- * @Author: your name
3
- * @Date: 2022-04-20 14:56:05
4
- * @LastEditTime: 2022-12-29 10:46:57
5
- * @LastEditors: shiguo
6
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7
- * @FilePath: /@aks-dev/easyui/lib/RefreshList/index.ts
8
- */
9
-
10
- import * as React from 'react'
11
-
12
- import { FlatListProps, SectionListProps } from 'react-native'
13
- import { IPropsSwipeListView } from 'react-native-swipe-list-view/types'
14
-
15
-
16
- // declare namespace easyui {
17
- // type Mode = {
18
- // FlatList
19
- // SectionList
20
- // SwipeList
21
- // }
22
- // }
23
-
24
-
25
-
26
- type CommonProps = {
27
- // mode: keyof easyui.Mode;
28
- onHeaderRefresh: (info: any) => void;
29
- onFooterRefresh: (info: any) => void;
30
- reload: () => void;
31
- refreshState: RefreshState;
32
- renderListEmptyComponent: () => React.ReactElement;
33
- }
34
-
35
-
36
- type SectionT = {
37
- [key: string]: any;
38
- };
39
- type ItemT = any;
40
-
41
-
42
- export type FlatListRefreshProps = {
43
- mode?: 'FlatList';
44
- } & FlatListProps<ItemT> & Partial<CommonProps>;
45
-
46
-
47
- export type SectionListRefreshProps = {
48
- mode: 'SectionList';
49
-
50
- } & SectionListProps<ItemT, SectionT> & Partial<CommonProps>;
51
-
52
- export type SwipeListViewRefreshProps = {
53
- mode: 'SwipeList';
54
- data: ItemT[];
55
- } & IPropsSwipeListView<ItemT> & Partial<CommonProps> & FlatListProps<ItemT> ;
56
-
57
- export type RefreshListProps = FlatListRefreshProps | SwipeListViewRefreshProps | SectionListRefreshProps
58
-
59
-
60
- export enum RefreshState {
61
- Idle = 'Idle',
62
- HeaderRefreshing = 'HeaderRefreshing',
63
- FooterRefreshing = 'FooterRefreshing',
64
- NoMoreData = 'NoMoreData',
65
- Failure = 'Failure',
66
- EmptyData = 'EmptyData',
67
- None = 'None',
68
- }
69
-
70
-
71
- export const RefreshText = {
72
- HeaderRefreshing: '上拉可以刷新',
73
- FooterRefreshing: '下拉可以加载更多',
74
- Failure: '服务器正在出小差,点击重新加载',
75
- NoMoreData: '已经全部加载完毕',
76
- EmptyData: '没有数据',
77
- Idle: '正在加载更多的数据..',
78
- }
79
-
80
-
81
-
82
-
83
- export declare const RefreshList: React.FC<RefreshListProps>;
84
-
@@ -1,82 +0,0 @@
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 type { RichTextProps } from '.'
11
- import { px2sp } from '../../screen/px2sp'
12
- import * as utils from '../../utils/lazy'
13
-
14
-
15
-
16
-
17
- export default (props: RichTextProps) => {
18
- const { rich, richStyle, text, suffix, prefix, ...rest } = props
19
- let textStr = ''
20
- let richStr = ''
21
- if (utils.isString(text) || utils.isNumber(text)) {
22
- textStr = String(text)
23
- }
24
- if (utils.isString(rich) || utils.isNumber(rich)) {
25
- richStr = String(rich)
26
- }
27
-
28
- let positionStart = 0
29
- let positionEnd = 0
30
- if (textStr?.indexOf(richStr) >= 0) {
31
- positionStart = textStr.indexOf(richStr)
32
- positionEnd = positionStart + richStr.length
33
- }
34
-
35
- if (prefix) {
36
- return (
37
- <Text style={styles.container} {...rest}>
38
- <Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
39
- {textStr}
40
- </Text>
41
- )
42
- }
43
-
44
-
45
-
46
- if (suffix) {
47
- return (
48
- <Text style={styles.container} {...rest}>
49
- {textStr}
50
- <Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
51
- </Text>
52
- )
53
- }
54
-
55
-
56
- return (
57
- <Text style={styles.container} {...rest}>
58
- {textStr.substring(0, positionStart)}
59
- {
60
- positionEnd > 0 &&
61
- <Text style={{ ...styles.defaultRich, ...richStyle }}>{richStr}</Text>
62
- }
63
- {textStr.substring(positionEnd, textStr.length)}
64
- </Text>
65
- )
66
- }
67
-
68
-
69
-
70
-
71
-
72
- const styles = StyleSheet.create({
73
- container: {
74
- color: '#333333',
75
- fontSize: px2sp(14)
76
- },
77
- defaultRich: {
78
- color: 'red',
79
- fontSize: px2sp(14),
80
- // fontWeight: 'bold'
81
- }
82
- })
@@ -1,21 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-07-11 15:42:08
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-11 16:14:12
6
- * @FilePath: /@aks-dev/easyui/lib/RichText/index.ts
7
- */
8
- import react from 'react'
9
- import { TextStyle, TextProps } from 'react-native'
10
-
11
-
12
- export type RichTextProps = {
13
- rich?: string | number,
14
- richStyle?: TextStyle,
15
- text?: string | number,
16
- suffix?: boolean,
17
- prefix?: boolean,
18
- }
19
-
20
-
21
- export declare const RichText: react.FC<RichTextProps & TextProps>
@@ -1,65 +0,0 @@
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, LayoutChangeEvent } from "react-native";
10
-
11
- import { StickHeaderViewProps } from '.'
12
-
13
-
14
-
15
- const App: React.FC<StickHeaderViewProps> = (props) => {
16
-
17
- const {
18
- style,
19
- children,
20
- stickyHeaderY = -1,
21
- stickyScrollY = new Animated.Value(0)
22
- } = props
23
-
24
-
25
- const [stickyLayoutY, setStickyLayoutY] = React.useState(0)
26
-
27
- // 兼容代码,防止没有传头部高度
28
- const _onLayout = (event: LayoutChangeEvent) => {
29
- setStickyLayoutY(event.nativeEvent.layout.y)
30
- };
31
-
32
- const translateY = () => {
33
- let y = stickyHeaderY !== -1 ? stickyHeaderY : stickyLayoutY;
34
- return stickyScrollY.interpolate({
35
- inputRange: [-1, 0, y, y + 1],
36
- outputRange: [0, 0, 0, 1],
37
- })
38
- };
39
-
40
-
41
- return (
42
- <Animated.View
43
- onLayout={_onLayout}
44
- style={
45
- [
46
- style,
47
- styles.container,
48
- { transform: [{ translateY: translateY() }] }
49
- ]}
50
- >
51
-
52
- {children}
53
-
54
- </Animated.View>
55
- )
56
- }
57
-
58
- const styles = StyleSheet.create({
59
- container: {
60
- zIndex: 100
61
- },
62
- });
63
-
64
-
65
- export default React.memo(App)
@@ -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
- })