@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,66 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 14:27:02
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-12-21 15:36:06
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
7
- */
8
- import React, { useImperativeHandle, useState } from 'react';
9
- import { StyleSheet, TouchableOpacity, BackHandler } from 'react-native';
10
- import type {PopoverViewOptions } from '.';
11
-
12
-
13
-
14
-
15
-
16
-
17
- export const PopoverView = React.forwardRef<PopoverViewOptions.RefAttributes, {}>((_, ref) => {
18
- const [visible, setVisible] = useState<boolean>(false);
19
- const [options, setOptions] = useState<Partial<PopoverViewOptions> | undefined>()
20
-
21
- React.useEffect(() => {
22
- const onBackPress = () => visible;
23
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
24
- return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
25
- }, [visible])
26
-
27
-
28
- useImperativeHandle<unknown, PopoverViewOptions.RefAttributes>(ref, () => ({
29
- showPopoverView: (options: Partial<PopoverViewOptions>) => {
30
- setVisible(true);
31
- setOptions(options)
32
-
33
- },
34
- hidePopoverView: () => {
35
- setVisible(false);
36
- setOptions(undefined)
37
- }
38
- }), [visible])
39
-
40
- if (!visible)
41
- return null;
42
-
43
- return (
44
- <TouchableOpacity activeOpacity={1} style={[styles.container, options?.style]} disabled={options?.disabled} onPress={e => {
45
- setVisible(false);
46
- setOptions(undefined)
47
- // e.stopPropagation()
48
- }}>
49
- {React.isValidElement(options?.content) && options?.content}
50
- </TouchableOpacity>
51
- )
52
- })
53
-
54
- export const popoverViewRef = React.createRef<PopoverViewOptions.RefAttributes>();
55
- export const showPopoverView = (options: Partial<PopoverViewOptions>) => popoverViewRef.current?.showPopoverView(options)
56
- export const hidePopoverView = () => popoverViewRef.current?.hidePopoverView()
57
-
58
-
59
- const styles = StyleSheet.create({
60
- container: {
61
- ...StyleSheet.absoluteFillObject,
62
- display: 'flex',
63
-
64
- // backgroundColor:'red'
65
- },
66
- })
@@ -1,39 +0,0 @@
1
-
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-04-24 14:27:02
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2022-10-28 12:09:52
7
- * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/index.d.ts
8
- */
9
- import * as React from 'react'
10
-
11
- import {StyleProp,ViewStyle} from 'react-native'
12
-
13
-
14
- export type PopoverViewOptions = {
15
- content: React.ReactNode;
16
- style: StyleProp<ViewStyle>;
17
- disabled:boolean;
18
- }
19
-
20
-
21
-
22
- declare namespace PopoverViewOptions {
23
- type RefAttributes = {
24
- showPopoverView: (options:Partial<PopoverViewOptions>) => void;
25
- hidePopoverView: () => void;
26
- }
27
- }
28
-
29
-
30
- export declare const showPopoverView: (options:Partial<PopoverViewOptions>) => void;
31
-
32
-
33
- export declare const hidePopoverView: () => void;
34
-
35
-
36
- export declare const popoverViewRef: React.RefObject<PopoverViewOptions.RefAttributes>;
37
-
38
- export declare const PopoverView: React.ForwardRefExoticComponent<React.PropsWithoutRef<PopoverViewOptions> & React.RefAttributes<PopoverViewOptions.RefAttributes>>
39
-
@@ -1,250 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 14:27:02
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 15:04:18
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/Scanner.tsx
7
- */
8
- import React, { useImperativeHandle, useState } from 'react';
9
- import {
10
- Animated, BackHandler, Easing, Image, StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle
11
- } from 'react-native';
12
- import { RNCamera, BarCodeReadEvent } from 'react-native-camera';
13
- import { PERMISSIONS, requestMultiple } from 'react-native-permissions';
14
- import { navigationBarHeight, px2dp, statusBarHeight } from '../../../screen/px2dp';
15
- import { px2sp } from '../../../screen/px2sp';
16
- import * as utils from '../../../utils/lazy';
17
- import { showToast } from '../Toast/Toast';
18
- import { ScannerOptions } from './index';
19
-
20
-
21
-
22
-
23
-
24
-
25
- // enum SCANNER_TYPE {
26
- // DENIED = -1,//没有开始权限
27
- // START = 0,//没有扫描结果,继续扫描
28
- // SUCCESS = 1,//已有扫描结果,停止扫描
29
- // }
30
-
31
- export const Scanner = React.forwardRef<ScannerOptions.RefAttributes, {}>((_, ref) => {
32
- const [show, setShow] = useState<boolean>(false);
33
- const [torchOn, setTorchOn] = React.useState<boolean>(false)
34
- const moveAnim = React.useRef(new Animated.Value(0)).current
35
- const [pointStyle, setPointStyle] = React.useState<StyleProp<ViewStyle>>()
36
- const cameraRef: React.MutableRefObject<RNCamera> = React.useRef() as any
37
- const _cbRef: React.MutableRefObject<ScannerOptions.CallBack> = React.useRef() as any
38
- const _scanerResultRef = React.useRef<any>()
39
- React.useEffect(() => {
40
- const onBackPress = () => {
41
- if (show) {
42
- _hideScanner()
43
- }
44
- return true
45
- }
46
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
47
- return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
48
- }, [show])
49
-
50
-
51
-
52
-
53
- useImperativeHandle<unknown, ScannerOptions.RefAttributes>(ref, () => ({
54
- showScanner: _showScanner,
55
- hideScanner: _hideScanner
56
- }), [show])
57
-
58
-
59
-
60
- const _showScanner = async (cb: ScannerOptions.CallBack) => {
61
- let res = await requestMultiple([PERMISSIONS.IOS.CAMERA, PERMISSIONS.ANDROID.CAMERA])
62
- if (res[PERMISSIONS.ANDROID.CAMERA] == "granted" || res[PERMISSIONS.IOS.CAMERA] == "granted") {
63
- _scanerResultRef.current = undefined;
64
- setShow(true);
65
- setPointStyle({})
66
- await utils.sleep()
67
- animationStart()
68
- _cbRef.current = cb;
69
- } else {
70
- _hideScanner()
71
- showToast('您未开启相机权限,暂不能使用此功能')
72
- }
73
-
74
-
75
- }
76
-
77
- const _hideScanner = async () => {
78
- animationStop()
79
- await utils.sleep()
80
- setShow(false);
81
- }
82
-
83
-
84
-
85
- const animation = Animated.loop(Animated.sequence([
86
- Animated.timing(
87
- moveAnim,
88
- {
89
- toValue: px2dp(222),
90
- duration: 3000,
91
- easing: Easing.linear,
92
- useNativeDriver: true,
93
- }
94
- ),
95
- Animated.timing(
96
- moveAnim,
97
- {
98
- toValue: 0,
99
- duration: 3000,
100
- easing: Easing.linear,
101
- useNativeDriver: true,
102
- }
103
- )
104
- ]))
105
-
106
-
107
-
108
- const animationStart = async () => {
109
-
110
- cameraRef.current?.resumePreview()
111
- animation.start(({ finished }) => {
112
- // console.log('animationStart finished', finished)
113
- if (finished) {
114
- animation.reset()
115
- animation.start()
116
- }
117
- })
118
- }
119
- const animationStop = (result?: any) => {
120
- cameraRef.current?.pausePreview()
121
- animation.stop()
122
- }
123
-
124
-
125
- // const getPointFromBounds = (bounds) => {
126
- // let x = 0
127
- // let y = 0
128
-
129
- // if (Platform.OS == 'android') {
130
- // bounds.origin.forEach(i => {
131
- // x = Math.max(x, parseFloat(i.x))
132
- // y = Math.max(y, parseFloat(i.y))
133
- // })
134
-
135
- // y = y * DeviceHeight / bounds.width
136
- // x = x * DeviceWidth / bounds.height
137
- // }
138
-
139
- // if(Platform.OS == 'ios'){
140
- // x=parseFloat(bounds.origin.x)
141
- // y=parseFloat(bounds.origin.y)
142
- // }
143
-
144
- // return { x, y }
145
- // }
146
-
147
-
148
- const onBarCodeRead = (e: BarCodeReadEvent) => {
149
- // console.log('ss onBarCodeRead: ', JSON.stringify(e))
150
- if (e?.data?.length > 0 && _scanerResultRef.current == undefined) {
151
- _scanerResultRef.current = e?.data
152
- _cbRef.current(e?.data)
153
- _hideScanner()
154
- }
155
- }
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
- if (!show) return null;
164
- return (
165
- <TouchableOpacity disabled style={StyleSheet.absoluteFillObject}>
166
- <RNCamera
167
- ref={cameraRef}
168
- captureAudio={false}
169
- autoFocus={RNCamera.Constants.AutoFocus.on}/*自动对焦*/
170
- style={styles.camera}
171
- type={RNCamera.Constants.Type.back}/*切换前后摄像头 front前back后*/
172
- flashMode={torchOn ? RNCamera.Constants.FlashMode.torch : RNCamera.Constants.FlashMode.off}/*相机闪光模式*/
173
- onBarCodeRead={onBarCodeRead}
174
-
175
-
176
- >
177
- {/* 导航栏 */}
178
- <View style={{ display: 'flex', justifyContent: "center", alignItems: "center", height: navigationBarHeight, marginTop: statusBarHeight, position: 'relative' }}>
179
- <TouchableOpacity onPress={() => _hideScanner()} style={{ height: navigationBarHeight, width: px2dp(50), paddingLeft: px2dp(15), position: 'absolute', left: 0, display: 'flex', justifyContent: 'center' }} >
180
- <Image source={require('./icon_back_white.png')} style={{ width: px2dp(20), height: px2dp(20) }} resizeMode='contain' />
181
- </TouchableOpacity>
182
- <Text style={{ fontSize: px2sp(16), color: 'white', fontWeight: 'bold' }}>扫一扫</Text>
183
- </View>
184
-
185
- {/* 动画框 */}
186
- <View style={styles.scanContainer}>
187
- <View style={styles.rectangle}>
188
- <View style={styles.rectangleLeft} />
189
- <View style={styles.cameraBackground}>
190
- <Animated.View style={[styles.scanLine, { transform: [{ translateY: moveAnim }] }]} />
191
- <View style={styles.reactLineTopLeftX} />
192
- <View style={styles.reactLineTopLeftY} />
193
- <View style={styles.reactLineTopRightX} />
194
- <View style={styles.reactLineTopRightY} />
195
- <View style={styles.reactLineBottomLeftX} />
196
- <View style={styles.reactLineBottomLeftY} />
197
- <View style={styles.reactLineBottomRightX} />
198
- <View style={styles.reactLineBottomRightY} />
199
- </View>
200
- <View style={styles.rectangleRight} />
201
- </View>
202
-
203
- <TouchableOpacity onPress={() => setTorchOn(!torchOn)}>
204
- <Image
205
- source={torchOn ? require('./flashlight-blue.png') : require('./flashlight-white.png')}
206
- style={styles.flashlight} />
207
- </TouchableOpacity>
208
- <Text style={styles.rectangleText}>将二维码/条码放入框内,即可自动扫描</Text>
209
- </View>
210
- <View style={pointStyle} />
211
- </RNCamera>
212
-
213
- </TouchableOpacity>
214
- )
215
- })
216
-
217
-
218
-
219
- const transparent = '#00000000'
220
- const lineColor = '#6ab3ff'
221
- const scanW = 225
222
- const scanCornerLineLength = 15;
223
- const scanCornerLineHeight = 3
224
- const styles = StyleSheet.create({
225
- camera: { display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: "red" },
226
- cameraBackground: { width: px2dp(scanW), height: px2dp(scanW), backgroundColor: transparent },
227
- scanContainer: { display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center' },
228
- rectangle: { flexDirection: 'row', overflow: 'hidden', },
229
- rectangleLeft: { backgroundColor: transparent, height: px2dp(scanW), width: px2dp(scanW) },
230
- rectangleRight: { backgroundColor: transparent, height: px2dp(scanW), width: px2dp(scanW) },
231
- rectangleText: { color: '#fff', lineHeight: px2dp(15), },
232
- scanLine: { width: px2dp(scanW), height: px2dp(scanCornerLineHeight), borderRadius: px2dp(25), backgroundColor: lineColor, },
233
- reactLineTopLeftX: { position: 'absolute', top: 0, left: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
234
- reactLineTopLeftY: { position: 'absolute', top: 0, left: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
235
- reactLineTopRightX: { position: 'absolute', top: 0, right: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
236
- reactLineTopRightY: { position: 'absolute', top: 0, right: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
237
- reactLineBottomLeftX: { position: 'absolute', bottom: 0, left: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
238
- reactLineBottomLeftY: { position: 'absolute', bottom: 0, left: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
239
- reactLineBottomRightX: { position: 'absolute', bottom: 0, right: 0, width: px2dp(scanCornerLineLength), height: px2dp(scanCornerLineHeight), backgroundColor: lineColor },
240
- reactLineBottomRightY: { position: 'absolute', bottom: 0, right: 0, width: px2dp(scanCornerLineHeight), height: px2dp(scanCornerLineLength), backgroundColor: lineColor },
241
- flashlight: { width: px2dp(30), height: px2dp(30), resizeMode: 'contain', marginTop: px2dp(50), marginBottom: px2dp(15), marginHorizontal: px2dp(15) },
242
- grantedText: { lineHeight: px2dp(30), color: lineColor, fontWeight: 'bold' }
243
- })
244
-
245
-
246
-
247
-
248
- export const scannerRef = React.createRef<ScannerOptions.RefAttributes>();
249
- export const showScanner = (cb: ScannerOptions.CallBack) => scannerRef.current?.showScanner(cb)
250
- export const hideScanner = () => scannerRef.current?.hideScanner()
@@ -1,42 +0,0 @@
1
-
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-04-24 14:27:02
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2023-03-23 12:36:02
7
- * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/index.d.ts
8
- */
9
- import * as React from 'react'
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
- declare namespace ScannerOptions {
21
-
22
- type CallBack = (e: string) => void;
23
-
24
-
25
- type RefAttributes = {
26
- showScanner: (cb: CallBack) => void;
27
- hideScanner: () => void;
28
- }
29
- }
30
-
31
-
32
-
33
- export declare const showScanner: (cb: ScannerOptions.CallBack) => void;
34
-
35
-
36
- export declare const hideScanner: () => void;
37
-
38
-
39
- export declare const scannerRef: React.RefObject<ScannerOptions.RefAttributes>;
40
-
41
- export declare const Scanner: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<ScannerOptions.RefAttributes>>
42
-
@@ -1,86 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2021-04-27 10:38:04
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:58:34
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/Toast.tsx
7
- */
8
- import React, { useImperativeHandle, useState, useRef } from 'react';
9
- import { View, StyleSheet, Text, Dimensions, Animated, Easing } from 'react-native';
10
-
11
-
12
- import type { ToastOptions } from '.'
13
-
14
- const errorMsg = '(^_^)∠※ 送你一束小花'
15
-
16
- export const Toast = React.forwardRef<ToastOptions.RefAttributes, {}>((_, ref) => {
17
- const [tipText, setTipText] = useState(errorMsg);
18
- const fade = useRef(new Animated.Value(0)).current;
19
-
20
- const fadeAnimation = Animated.sequence([
21
- Animated.timing(fade, {
22
- toValue: 1,
23
- duration: 750,
24
- useNativeDriver: true,
25
- easing: Easing.linear,
26
- }),
27
- Animated.delay(3000),
28
- Animated.timing(fade, {
29
- toValue: 0,
30
- duration: 750,
31
- useNativeDriver: true,
32
- easing: Easing.linear,
33
- })
34
- ])
35
-
36
- useImperativeHandle<unknown, ToastOptions.RefAttributes>(ref, () => ({
37
- showToast: (content: string) => {
38
- setTipText(content || errorMsg)
39
- fadeAnimation.reset()
40
- fadeAnimation.start()
41
- },
42
- }))
43
-
44
- return (
45
- <Animated.View style={{ ...styles.toastContainer, opacity: fade }}>
46
- <View style={styles.toastTipsContainer}>
47
- <Text numberOfLines={5} style={{ ...styles.toastTitle, }}>{tipText} </Text>
48
- </View>
49
- </Animated.View>
50
-
51
- )
52
- })
53
-
54
- export const toastRef = React.createRef<ToastOptions.RefAttributes>();
55
-
56
- export const showToast = (content: string) => toastRef.current?.showToast(content)
57
-
58
-
59
-
60
- const SCREEN_WIDTH = Dimensions.get('window').width;
61
- const styles = StyleSheet.create({
62
- toastContainer: {
63
- position: 'absolute',
64
- bottom: 100,
65
- width: '100%',
66
- justifyContent: 'center',
67
- alignItems: 'center'
68
- },
69
-
70
- toastTipsContainer: {
71
- position: 'absolute',
72
- backgroundColor: '#00000088',
73
- padding: 10,
74
- // paddingVertical: 4,
75
- borderRadius: 2,
76
- justifyContent: 'center',
77
- alignItems: 'center',
78
- minWidth: 120
79
- },
80
- toastTitle: {
81
- fontSize: 13,
82
- lineHeight: 20,
83
- color: 'white',
84
- maxWidth: SCREEN_WIDTH * 0.8
85
- }
86
- })
@@ -1,22 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-18 19:18:03
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:58:11
6
- * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/index.ts
7
- */
8
- import * as React from 'react'
9
-
10
-
11
- declare namespace ToastOptions {
12
- type RefAttributes = {
13
- showToast: (content: string) => void;
14
- }
15
- }
16
-
17
- export declare const showToast: (content: string) => void;
18
-
19
-
20
- export declare const toastRef: React.RefObject<ToastOptions.RefAttributes>;
21
-
22
- export declare const Toast: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<ToastOptions.RefAttributes>>;
package/lib/Hud/index.ts DELETED
@@ -1,20 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 14:14:42
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 11:05:22
6
- * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/index.ts
7
- */
8
-
9
-
10
- import * as React from 'react'
11
-
12
-
13
- export * from './AlertView'
14
- export * from './Loading'
15
- export * from './Toast'
16
- export * from './AlertBottomView'
17
- export * from './AlertSheetView'
18
- export * from './PopoverView'
19
- export * from './Scanner'
20
- export declare const Hud: React.FC<{}>