@aks-dev/easyui 1.0.163 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +151 -0
  2. package/dist/components/DottedLine/DottedLine.js +50 -0
  3. package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
  4. package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
  5. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
  6. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
  7. package/dist/components/Hud/AlertView/AlertView.js +184 -0
  8. package/dist/components/Hud/Hud.js +29 -0
  9. package/dist/components/Hud/Loading/Loading.js +66 -0
  10. package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
  11. package/dist/components/Hud/Scanner/Scanner.js +301 -0
  12. package/dist/components/Hud/Toast/Toast.js +71 -0
  13. package/dist/components/MenuView/MenuView.js +184 -0
  14. package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
  15. package/dist/components/MutiPictureView/MutiPictureView.js +239 -0
  16. package/dist/components/PictureViewer/PictureViewer.js +54 -0
  17. package/dist/components/RefreshList/RefreshList.js +155 -0
  18. package/dist/components/RichText/RichText.js +56 -0
  19. package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
  20. package/dist/components/TableCell/TableCell.js +97 -0
  21. package/dist/components/TextInputArea/TextInputArea.js +65 -0
  22. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
  23. package/dist/index.js +31 -0
  24. package/dist/jsbridge/RNEasyui.js +46 -0
  25. package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
  26. package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
  27. package/{screen/index.ts → dist/screen/index.js} +2 -2
  28. package/dist/screen/px2dp.js +45 -0
  29. package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
  30. package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
  31. package/{utils/index.ts → dist/utils/index.js} +2 -2
  32. package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
  33. package/dist/utils/mode.js +50 -0
  34. package/package.json +31 -19
  35. package/readme.md +3 -3
  36. package/types/components/AnimationModal/AnimationModal.d.ts +27 -0
  37. package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -0
  38. package/types/components/DottedLine/DottedLine.d.ts +10 -0
  39. package/types/components/DottedLine/DottedLine.d.ts.map +1 -0
  40. package/types/components/EchartsView/EchartsView.d.ts +10 -0
  41. package/types/components/EchartsView/EchartsView.d.ts.map +1 -0
  42. package/types/components/EchartsView/helper.d.ts +10 -0
  43. package/types/components/EchartsView/helper.d.ts.map +1 -0
  44. package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
  45. package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
  46. package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
  47. package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
  48. package/types/components/Hud/AlertView/AlertView.d.ts +25 -0
  49. package/types/components/Hud/AlertView/AlertView.d.ts.map +1 -0
  50. package/types/components/Hud/Hud.d.ts +11 -0
  51. package/types/components/Hud/Hud.d.ts.map +1 -0
  52. package/types/components/Hud/Loading/Loading.d.ts +11 -0
  53. package/types/components/Hud/Loading/Loading.d.ts.map +1 -0
  54. package/types/components/Hud/PopoverView/PopoverView.d.ts +17 -0
  55. package/types/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
  56. package/types/components/Hud/Scanner/Scanner.d.ts +12 -0
  57. package/types/components/Hud/Scanner/Scanner.d.ts.map +1 -0
  58. package/types/components/Hud/Toast/Toast.d.ts +9 -0
  59. package/types/components/Hud/Toast/Toast.d.ts.map +1 -0
  60. package/types/components/MenuView/MenuView.d.ts +21 -0
  61. package/types/components/MenuView/MenuView.d.ts.map +1 -0
  62. package/types/components/Modal/Modal.d.ts +2 -0
  63. package/types/components/Modal/Modal.d.ts.map +1 -0
  64. package/{lib/MutiPictureView/index.ts → types/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
  65. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
  66. package/types/components/PictureViewer/PictureViewer.d.ts +17 -0
  67. package/types/components/PictureViewer/PictureViewer.d.ts.map +1 -0
  68. package/types/components/RefreshList/RefreshList.d.ts +45 -0
  69. package/types/components/RefreshList/RefreshList.d.ts.map +1 -0
  70. package/types/components/RichText/RichText.d.ts +12 -0
  71. package/types/components/RichText/RichText.d.ts.map +1 -0
  72. package/types/components/StickHeaderView/StickHeaderView.d.ts +15 -0
  73. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
  74. package/{lib/TableCell/index.ts → types/components/TableCell/TableCell.d.ts} +8 -30
  75. package/types/components/TableCell/TableCell.d.ts.map +1 -0
  76. package/types/components/TextInputArea/TextInputArea.d.ts +17 -0
  77. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -0
  78. package/types/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
  79. package/types/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
  80. package/types/index.d.ts +22 -0
  81. package/types/index.d.ts.map +1 -0
  82. package/types/jsbridge/RNEasyui.d.ts +23 -0
  83. package/types/jsbridge/RNEasyui.d.ts.map +1 -0
  84. package/types/jsbridge/UpgradeModule.d.ts +26 -0
  85. package/types/jsbridge/UpgradeModule.d.ts.map +1 -0
  86. package/types/jsbridge/index.d.ts +3 -0
  87. package/types/jsbridge/index.d.ts.map +1 -0
  88. package/types/screen/index.d.ts +3 -0
  89. package/types/screen/index.d.ts.map +1 -0
  90. package/{screen/index.d.ts → types/screen/px2dp.d.ts} +6 -12
  91. package/types/screen/px2dp.d.ts.map +1 -0
  92. package/types/screen/px2sp.d.ts +2 -0
  93. package/types/screen/px2sp.d.ts.map +1 -0
  94. package/types/screen/text-fit.d.ts +5 -0
  95. package/types/screen/text-fit.d.ts.map +1 -0
  96. package/types/utils/index.d.ts +3 -0
  97. package/types/utils/index.d.ts.map +1 -0
  98. package/{utils/index.d.ts → types/utils/lazy.d.ts} +15 -53
  99. package/types/utils/lazy.d.ts.map +1 -0
  100. package/types/utils/mode.d.ts +24 -0
  101. package/types/utils/mode.d.ts.map +1 -0
  102. package/android/.DS_Store +0 -0
  103. package/android/src/.DS_Store +0 -0
  104. package/android/src/main/.DS_Store +0 -0
  105. package/android/src/main/java/.DS_Store +0 -0
  106. package/android/src/main/java/com/.DS_Store +0 -0
  107. package/android/src/main/java/com/easyui/.DS_Store +0 -0
  108. package/i.sh +0 -23
  109. package/ios/.DS_Store +0 -0
  110. package/ios/assets/.DS_Store +0 -0
  111. package/ios/views/.DS_Store +0 -0
  112. package/jsbridge/RNEasyui.ts +0 -42
  113. package/jsbridge/index.d.ts +0 -67
  114. package/lib/.DS_Store +0 -0
  115. package/lib/AnimationModal/AnimationModal.tsx +0 -201
  116. package/lib/AnimationModal/index.d.ts +0 -41
  117. package/lib/Badge/Badge.tsx +0 -40
  118. package/lib/Badge/index.ts +0 -21
  119. package/lib/DottedLine/DottedLine.tsx +0 -66
  120. package/lib/DottedLine/index.ts +0 -18
  121. package/lib/Echarts/demo.tsx +0 -235
  122. package/lib/Echarts/index.ts +0 -29
  123. package/lib/Hud/.DS_Store +0 -0
  124. package/lib/Hud/AlertBottomView/AlertBottomView.tsx +0 -228
  125. package/lib/Hud/AlertBottomView/index.d.ts +0 -42
  126. package/lib/Hud/AlertSheetView/AlertSheetView.tsx +0 -179
  127. package/lib/Hud/AlertSheetView/index.d.ts +0 -35
  128. package/lib/Hud/AlertView/AlertView.tsx +0 -234
  129. package/lib/Hud/AlertView/index.d.ts +0 -46
  130. package/lib/Hud/Hud.tsx +0 -67
  131. package/lib/Hud/Loading/Loading.tsx +0 -87
  132. package/lib/Hud/Loading/index.d.ts +0 -38
  133. package/lib/Hud/PopoverView/PopoverView.tsx +0 -66
  134. package/lib/Hud/PopoverView/index.d.ts +0 -39
  135. package/lib/Hud/Scanner/Scanner.tsx +0 -250
  136. package/lib/Hud/Scanner/index.d.ts +0 -42
  137. package/lib/Hud/Toast/Toast.tsx +0 -86
  138. package/lib/Hud/Toast/index.d.ts +0 -22
  139. package/lib/Hud/index.ts +0 -20
  140. package/lib/MenuView/MenuView.tsx +0 -252
  141. package/lib/MenuView/index.ts +0 -31
  142. package/lib/Modal/index.ts +0 -10
  143. package/lib/MutiPictureView/MutiPictureView.tsx +0 -259
  144. package/lib/PictureViewer/PictureViewer.tsx +0 -80
  145. package/lib/PictureViewer/index.ts +0 -26
  146. package/lib/RefreshList/RefreshList.tsx +0 -235
  147. package/lib/RefreshList/demo.tsx +0 -30
  148. package/lib/RefreshList/demo1.tsx +0 -60
  149. package/lib/RefreshList/demo2.tsx +0 -46
  150. package/lib/RefreshList/index.ts +0 -84
  151. package/lib/RichText/RichText.tsx +0 -82
  152. package/lib/RichText/index.ts +0 -21
  153. package/lib/StickHeaderView/StickHeaderView.tsx +0 -65
  154. package/lib/StickHeaderView/demo.tsx +0 -104
  155. package/lib/StickHeaderView/index.ts +0 -26
  156. package/lib/TableCell/TableCell.tsx +0 -118
  157. package/lib/TextInputArea/TextInputArea.tsx +0 -89
  158. package/lib/TextInputArea/index.d.ts +0 -33
  159. package/lib/WithLoadingContainer/WithLoadingContainer.tsx +0 -93
  160. package/lib/WithLoadingContainer/index.ts +0 -36
  161. package/screen/px2dp.ts +0 -51
  162. package/src/index.d.ts +0 -42
  163. package/src/index.ts +0 -54
  164. package/utils/mode.ts +0 -48
  165. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-blue.png +0 -0
  166. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-white.png +0 -0
  167. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/icon_back_white.png +0 -0
  168. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_add_image.png +0 -0
  169. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_del_image.png +0 -0
  170. /package/{lib/TableCell → dist/components/TableCell/assets}/back.png +0 -0
  171. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading.gif +0 -0
  172. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading3.gif +0 -0
  173. /package/{lib → dist/components}/index.md +0 -0
@@ -1,179 +0,0 @@
1
- import * as React from 'react'
2
- import { Dimensions, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
3
- import Modal from 'react-native-modal'
4
- import { AlertSheetViewOptions } from '.'
5
- import { px2dp } from '../../../screen/px2dp'
6
- import { px2sp } from '../../../screen/px2sp'
7
-
8
-
9
-
10
-
11
-
12
- type State = {
13
- visible: boolean;
14
- } & AlertSheetViewOptions
15
-
16
-
17
-
18
-
19
-
20
- export default React.forwardRef<AlertSheetViewOptions.RefAttributes, {}>((_, ref) => {
21
-
22
-
23
- const defaultState: Partial<State> = {
24
- visible: false,
25
- actions: []
26
- }
27
- const [state, setState] = React.useState<Partial<State>>(defaultState)
28
-
29
- React.useImperativeHandle<unknown, AlertSheetViewOptions.RefAttributes>(ref, () => ({
30
- show: async (options: Partial<AlertSheetViewOptions>) => {
31
- setState(Object.assign({}, defaultState, { visible: true }, options))
32
- },
33
- hide
34
- }), [])
35
-
36
-
37
- const hide = async () => {
38
- setState(defaultState)
39
- }
40
-
41
-
42
- React.useEffect(() => {
43
- if (Platform.OS == 'android') {
44
- if (state.visible) {
45
- StatusBar.setBackgroundColor('black')
46
- StatusBar.setBarStyle('light-content')
47
- } else {
48
- StatusBar.setBackgroundColor('transparent')
49
- StatusBar.setBarStyle('dark-content')
50
- }
51
- }
52
-
53
- }, [state.visible])
54
- return (
55
- <Modal
56
- hideModalContentWhileAnimating={true}//通过隐藏模态内容直到动画完成来增强性能
57
- useNativeDriver={true}//定义动画是否应使用本机驱动程序
58
- animationIn='slideInUp'
59
- animationOut='slideOutDown'
60
- onBackButtonPress={() => {
61
- //按下Android后退按钮时调用
62
- hide()
63
- }}
64
- onBackdropPress={() => {
65
- //按下背景时调用
66
- hide()
67
- }}
68
- isVisible={state.visible}
69
- deviceHeight={Dimensions.get('screen').height}
70
- style={{ margin: 0}}
71
- >
72
- <View style={styles.container}>
73
- <View style={[styles.wrapper]}>
74
- <View style={styles.itemContainer}>
75
- {state.actions?.map((i, idx) =>
76
- <TouchableOpacity
77
-
78
- key={`sg-action-${idx}`}
79
- style={[styles.item]}
80
- activeOpacity={1}
81
- onPress={() => {
82
- hide()
83
- i.onClick && i.onClick()
84
- }}>
85
- <Text style={[styles.itemText,{color:i.color}]} numberOfLines={2}>{i.text}</Text>
86
- </TouchableOpacity>
87
- )}
88
- </View>
89
-
90
-
91
-
92
- <TouchableOpacity
93
- style={[styles.cancel]}
94
- activeOpacity={1}
95
- onPress={() => {
96
- hide()
97
- }}>
98
- <Text style={[styles.cancelText]}>取消</Text>
99
- </TouchableOpacity>
100
- </View>
101
-
102
- </View>
103
- </Modal>
104
- )
105
- })
106
-
107
-
108
-
109
- export const alertSheetViewRef = React.createRef<AlertSheetViewOptions.RefAttributes>();
110
-
111
-
112
-
113
- export const showAlertSheetModal = (props: Partial<AlertSheetViewOptions>) => {
114
- alertSheetViewRef.current?.show(props)
115
- }
116
-
117
-
118
-
119
-
120
-
121
-
122
- const styles = StyleSheet.create({
123
- container: {
124
- display: 'flex',
125
- flexGrow: 1,
126
- justifyContent: 'flex-end',
127
- alignItems: 'center',
128
-
129
- },
130
-
131
- wrapper: {
132
- flexGrow: 0,
133
- flexShrink: 0,
134
- width: '100%',
135
- // backgroundColor: 'pink',
136
- overflow: 'hidden',
137
- borderTopLeftRadius: px2dp(10),
138
- borderTopRightRadius: px2dp(10),
139
- display: 'flex',
140
- padding: px2dp(15),
141
- },
142
-
143
- cancel: {
144
- height: px2dp(50),
145
- display: 'flex',
146
- justifyContent: 'center',
147
- alignItems: 'center',
148
- borderRadius: px2dp(10),
149
- backgroundColor: 'white',
150
- marginTop: px2dp(15),
151
- },
152
- cancelText: {
153
- fontSize: px2sp(15),
154
- color: '#2763FF',
155
-
156
- },
157
-
158
- itemContainer: {
159
- display: 'flex',
160
- borderRadius: px2dp(10),
161
- overflow: 'hidden',
162
- backgroundColor:'#f1f1f1'
163
- },
164
- item: {
165
- height: px2dp(50),
166
- display: 'flex',
167
- justifyContent: 'center',
168
- alignItems: 'center',
169
-
170
- backgroundColor: 'white',
171
- marginTop: px2dp(0.75)
172
- },
173
- itemText: {
174
- fontSize: px2sp(12),
175
- color: '#666666',
176
-
177
- },
178
-
179
- })
@@ -1,35 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-22 17:30:32
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:51:19
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/AlertSheetView/index.d.ts
7
- */
8
- import * as React from 'react';
9
- import { ColorValue } from 'react-native';
10
-
11
-
12
-
13
- type ActionSheet = {
14
- text: string;
15
- color?: ColorValue | undefined;
16
- onClick?: () => void;
17
- }
18
- export declare type AlertSheetViewOptions = {
19
- actions:ActionSheet[];
20
- }
21
-
22
-
23
- export declare const showAlertSheetModal: (props: Partial<AlertSheetViewOptions>) => void;
24
-
25
-
26
- declare namespace AlertSheetViewOptions {
27
- type RefAttributes = {
28
- show: (options: Partial<AlertSheetViewOptions>) => void;
29
- hide: () => void;
30
- }
31
- }
32
-
33
- export declare const AlertSheetView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertSheetViewOptions.RefAttributes>>;
34
-
35
- export declare const AlertSheetViewRef: React.RefObject<AlertSheetViewOptions.RefAttributes>
@@ -1,234 +0,0 @@
1
- import * as React from 'react'
2
- import { View, Text, StyleSheet, Platform, Modal, StatusBar, TouchableOpacity, Animated, Easing } from 'react-native'
3
-
4
-
5
- import { px2dp, deviceWidth } from '../../../screen/px2dp'
6
- import { px2sp } from '../../../screen/px2sp'
7
-
8
- import { AlertViewOptions } from '.'
9
-
10
-
11
-
12
- type State = {
13
- visible: boolean;
14
-
15
- } & Omit<AlertViewOptions, 'cancel' | 'confirm'>
16
-
17
-
18
-
19
-
20
-
21
- export default React.forwardRef<AlertViewOptions.RefAttributes, {}>((_, ref) => {
22
-
23
-
24
- const defaultState: Partial<State> = {
25
- visible: false,
26
- cancelText: '取消',
27
- confirmText: '确定',
28
- }
29
- const [state, setState] = React.useState<Partial<State>>(defaultState)
30
- const cancelCallbackRef = React.useRef<Function>();
31
- const confirmCallbackRef = React.useRef<Function>();
32
-
33
-
34
-
35
- React.useImperativeHandle<unknown, AlertViewOptions.RefAttributes>(ref, () => ({
36
- show: async (options: Partial<AlertViewOptions>) => {
37
-
38
- setState(Object.assign({}, defaultState, { visible: true }, options))
39
- cancelCallbackRef.current = options.cancel;
40
- confirmCallbackRef.current = options.confirm;
41
- // await sleep(50)
42
- startAnimate(1)
43
- },
44
- hide
45
- }), [])
46
-
47
-
48
- const hide = async () => {
49
- startAnimate(0.3)
50
- // await sleep(50)
51
- setState(defaultState)
52
-
53
- }
54
-
55
- let scale_anim = React.useRef(new Animated.Value(0.3)).current
56
- const startAnimate = (x: number) => {
57
- Animated.timing(scale_anim, {
58
- toValue: x,
59
- useNativeDriver: true,
60
- duration: 150,
61
- easing: Easing.ease
62
- }).start()
63
- }
64
- React.useEffect(() => {
65
- if (Platform.OS == 'android') {
66
- if (state.visible) {
67
- StatusBar.setBackgroundColor('black')
68
- StatusBar.setBarStyle('light-content')
69
- } else {
70
- StatusBar.setBackgroundColor('transparent')
71
- StatusBar.setBarStyle('dark-content')
72
- }
73
- }
74
-
75
- }, [state.visible])
76
- return (
77
- <Modal
78
- visible={state.visible}
79
- transparent animationType="fade"
80
- onRequestClose={() => {
81
- // hide()
82
- }}
83
- // style={{
84
- // margin: 0,
85
- // }}
86
- >
87
- <View style={styles.container}>
88
- <Animated.View style={[styles.wrapper, state.wrapperStyle, { transform: [{ scale: scale_anim }] }]}>
89
- {state.title && <Text style={styles.titleText}>{state.title}</Text>}
90
- {(() => {
91
- if (typeof state.content == 'string') return <Text style={styles.contentText}>{state.content}</Text>
92
- if (React.isValidElement(state.content)) return state.content;
93
- return <View />
94
- })()}
95
-
96
- {
97
- (state.cancelText || state.confirmText) &&
98
- <View style={styles.action}>
99
- {state.cancelText &&
100
- <TouchableOpacity
101
- style={[styles.cancel, { marginRight: state.confirmText ? px2dp(15) : 0 }, state.cancelContainerStyle]}
102
- activeOpacity={0.8}
103
- disabled={state.cancelDisabled}
104
- onPress={() => {
105
- hide()
106
- cancelCallbackRef.current && cancelCallbackRef.current()
107
- cancelCallbackRef.current = undefined;
108
-
109
- }}>
110
- <Text style={[styles.cancelText, state.cancelTextStyle]}>{state.cancelText}</Text>
111
- </TouchableOpacity>
112
- }
113
-
114
- {state.confirmText &&
115
- <TouchableOpacity
116
- style={[styles.confirm, { marginLeft: state.cancelText ? px2dp(15) : 0 }, state.confirmContainerStyle]}
117
- activeOpacity={0.8}
118
- onPress={() => {
119
- hide()
120
- confirmCallbackRef.current && confirmCallbackRef.current()
121
- confirmCallbackRef.current = undefined;
122
- }}>
123
- <Text style={[styles.confirmText, state.confirmTextStyle]}>{state.confirmText}</Text>
124
- </TouchableOpacity>
125
- }
126
- </View>
127
- }
128
-
129
- </Animated.View>
130
-
131
- </View>
132
- </Modal>
133
- )
134
- })
135
-
136
-
137
-
138
- export const alertViewRef = React.createRef<AlertViewOptions.RefAttributes>();
139
-
140
-
141
-
142
- export const showAlertModal = (props: Partial<AlertViewOptions>) => {
143
- alertViewRef.current?.show(props)
144
- }
145
-
146
-
147
-
148
- // const sleep = (msec?: number) => {
149
- // return new Promise(resolve => {
150
- // setTimeout(resolve, msec || 350);
151
- // });
152
- // }
153
-
154
-
155
-
156
- const styles = StyleSheet.create({
157
- container: {
158
- display: 'flex',
159
- flexGrow: 1,
160
- backgroundColor: '#00000088',
161
- justifyContent: 'center',
162
- alignItems: 'center',
163
-
164
- },
165
-
166
- wrapper: {
167
- flexGrow: 0,
168
- flexShrink: 0,
169
- // minWidth: '70%',
170
- minWidth: deviceWidth - px2dp(60),
171
- backgroundColor: 'white',
172
- overflow: 'hidden',
173
- borderRadius: px2dp(10),
174
- display: 'flex',
175
- padding: px2dp(15),
176
- },
177
- titleText: {
178
- maxWidth: deviceWidth - px2dp(90),
179
- fontSize: px2sp(18),
180
- marginBottom: px2dp(20),
181
- // backgroundColor: 'red',
182
- textAlign: 'center',
183
- fontWeight: 'bold',
184
- color: '#1A1A1A'
185
- },
186
- contentText: {
187
- maxWidth: deviceWidth - px2dp(90),
188
- marginBottom: px2dp(20),
189
- minHeight: px2dp(40),
190
- flexGrow: 0,
191
- flexShrink: 1,
192
- width: undefined,
193
- fontSize: px2sp(15),
194
- // backgroundColor: 'red',
195
- color: '#1A1A1A',
196
- textAlign: 'center'
197
- },
198
- action: {
199
- display: 'flex',
200
- flexDirection: 'row',
201
- justifyContent: 'space-between',
202
- alignItems: 'center',
203
- // backgroundColor:"red"
204
- },
205
- cancel: {
206
- width: '40%',
207
- height: px2dp(44),
208
- display: 'flex',
209
- justifyContent: 'center',
210
- alignItems: 'center',
211
- borderRadius: px2dp(10),
212
- borderWidth: px2dp(1),
213
- borderColor: '#A3A9CC'
214
- },
215
-
216
- confirm: {
217
- width: '40%',
218
- height: px2dp(44),
219
- display: 'flex',
220
- justifyContent: 'center',
221
- alignItems: 'center',
222
- backgroundColor: '#2763FF',
223
- borderRadius: px2dp(10)
224
- },
225
- cancelText: {
226
- fontSize: px2sp(15),
227
- color: '#A3A9CC',
228
-
229
- },
230
- confirmText: {
231
- fontSize: px2sp(15),
232
- color: 'white'
233
- },
234
- })
@@ -1,46 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-22 17:30:32
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-10 12:21:30
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/AlertView/index.d.ts
7
- */
8
- import * as React from 'react'
9
-
10
-
11
- import { StyleProp, ViewStyle, TextStyle } from 'react-native'
12
-
13
-
14
- export declare type AlertViewOptions = {
15
- title: string;
16
- content: string | React.ReactElement;
17
- wrapperStyle: StyleProp<ViewStyle>;
18
- cancelText: string;
19
- cancelContainerStyle: StyleProp<ViewStyle>;
20
- cancelTextStyle: StyleProp<TextStyle>;
21
- cancel: () => void;
22
- cancelDisabled:boolean;
23
- confirmText: string;
24
- confirmContainerStyle: StyleProp<ViewStyle>;
25
- confirmTextStyle: StyleProp<TextStyle>;
26
- confirm: () => void;
27
- }
28
-
29
-
30
- export declare const showAlertModal: (props: Partial<AlertViewOptions>) => void;
31
-
32
-
33
-
34
- declare namespace AlertViewOptions {
35
- type RefAttributes = {
36
- show: (options: Partial<AlertViewOptions>) => void;
37
- hide: () => void;
38
- }
39
- }
40
-
41
-
42
-
43
-
44
- export declare const AlertView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertViewOptions.RefAttributes>>;
45
-
46
- export declare const alertViewRef: React.RefObject<AlertViewOptions.RefAttributes>
package/lib/Hud/Hud.tsx DELETED
@@ -1,67 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 14:10:04
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 11:13:55
6
- * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/Hud.tsx
7
- */
8
- import * as React from 'react'
9
- // import { StyleSheet } from 'react-native'
10
- import {
11
- alertViewRef, default as AlertView, showAlertModal
12
- } from './AlertView/AlertView'
13
-
14
- import {
15
- alertBottomViewRef, default as AlertBottomView, showAlertBottomModal
16
- } from './AlertBottomView/AlertBottomView'
17
- import {
18
- alertSheetViewRef, default as AlertSheetView, showAlertSheetModal
19
- } from './AlertSheetView/AlertSheetView'
20
-
21
- import {
22
- hideLoading, Loading, loadingRef, showLoading
23
- } from './Loading/Loading'
24
-
25
-
26
- import {
27
- showToast, Toast, toastRef
28
- } from './Toast/Toast'
29
-
30
-
31
- import { showPopoverView, hidePopoverView, popoverViewRef, PopoverView } from './PopoverView/PopoverView'
32
-
33
-
34
- import {
35
- showScanner, hideScanner, scannerRef, Scanner
36
- } from './Scanner/Scanner'
37
-
38
-
39
-
40
-
41
- export const Hud: React.FC<{}> = () => React.cloneElement(
42
- <></>,
43
- {
44
- // ...StyleSheet.absoluteFillObject,
45
- // display: 'flex',
46
- },
47
- [
48
- <Loading key="hud-0" ref={loadingRef} />,
49
- <Toast key="hud-1" ref={toastRef} />,
50
- <AlertView key="hud-2" ref={alertViewRef} />,
51
- <AlertBottomView key="hud-3-0" ref={alertBottomViewRef} />,
52
- <AlertSheetView key="hud-3-1" ref={alertSheetViewRef} />,
53
- <PopoverView key="hud-4" ref={popoverViewRef} />,
54
- <Scanner key="hud-5" ref={scannerRef} />,
55
- ]
56
- )
57
-
58
-
59
- export {
60
- showAlertModal,
61
- showToast,
62
- showLoading, hideLoading,
63
- showAlertBottomModal,
64
- showAlertSheetModal,
65
- showPopoverView, hidePopoverView,
66
- showScanner,hideScanner,
67
- }
@@ -1,87 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 14:27:02
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:55:48
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/Loading.tsx
7
- */
8
- import React, { useImperativeHandle, useState } from 'react';
9
- import { View, ActivityIndicator, StyleSheet, Text, Dimensions, TouchableOpacity, BackHandler } from 'react-native';
10
-
11
- import { LoadingOptions } from '.'
12
-
13
-
14
-
15
-
16
-
17
- export const Loading = React.forwardRef<LoadingOptions.RefAttributes, {}>((_, ref) => {
18
- const [show, setShow] = useState(false);
19
- const [tipText, setTipText] = useState('加载中');
20
-
21
-
22
- React.useEffect(() => {
23
- const onBackPress = () => show;
24
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
25
- return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
26
- }, [show])
27
-
28
-
29
- useImperativeHandle<unknown, LoadingOptions.RefAttributes>(ref, () => ({
30
- showLoading: (content?: string) => {
31
- setShow(true);
32
- setTipText(content || '加载中')
33
- },
34
- hideLoading: () => {
35
- setShow(false);
36
- }
37
- }), [show])
38
-
39
- if (!show)
40
- return null;
41
-
42
- return (
43
- <TouchableOpacity disabled style={styles.container}>
44
- <View style={styles.warpper}>
45
- <ActivityIndicator color="white" size='large' />
46
- <Text numberOfLines={5} style={styles.title}>{tipText}
47
- </Text>
48
- </View>
49
- </TouchableOpacity>
50
- )
51
- })
52
-
53
- export const loadingRef = React.createRef<LoadingOptions.RefAttributes>();
54
- export const showLoading = (content?: string) => loadingRef.current?.showLoading(content)
55
- export const hideLoading = () => loadingRef.current?.hideLoading()
56
-
57
-
58
-
59
- const SCREEN_WIDTH = Dimensions.get('window').width;
60
- const styles = StyleSheet.create({
61
- container: {
62
- ...StyleSheet.absoluteFillObject,
63
- display: 'flex',
64
- justifyContent: 'center',
65
- alignItems: 'center',
66
- // backgroundColor:'red'
67
- },
68
-
69
- warpper: {
70
- backgroundColor: '#00000088',
71
- padding: 40,
72
- paddingVertical: 20,
73
- borderRadius: 10,
74
- justifyContent: 'center',
75
- alignItems: 'center',
76
- minWidth: 90
77
- },
78
- title: {
79
- marginTop: 5,
80
- fontSize: 13,
81
- lineHeight: 16,
82
- color: 'white',
83
- maxWidth: SCREEN_WIDTH * 0.5,
84
-
85
- }
86
-
87
- })
@@ -1,38 +0,0 @@
1
-
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-04-24 14:27:02
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2022-09-09 10:55:28
7
- * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/index.ts
8
- */
9
- import * as React from 'react'
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
- declare namespace LoadingOptions {
21
- type RefAttributes = {
22
- showLoading: (content?: string) => void;
23
- hideLoading: () => void;
24
- }
25
- }
26
-
27
-
28
-
29
- export declare const showLoading: (content?: string) => void;
30
-
31
-
32
- export declare const hideLoading: () => void;
33
-
34
-
35
- export declare const loadingRef: React.RefObject<LoadingOptions.RefAttributes>;
36
-
37
- export declare const Loading: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<LoadingOptions.RefAttributes>>
38
-