@aks-dev/easyui 1.0.82 → 1.0.85

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.
@@ -2,11 +2,11 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:27:02
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-05-12 11:33:21
6
- * @FilePath: /@aks/easyui/lib/Easy-Hud/Loading/Loading.tsx
5
+ * @LastEditTime: 2022-07-15 14:21:00
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/Loading.tsx
7
7
  */
8
8
  import React, { useImperativeHandle, useState } from 'react';
9
- import { View, ActivityIndicator, StyleSheet, Text, Dimensions,TouchableOpacity } from 'react-native';
9
+ import { View, ActivityIndicator, StyleSheet, Text, Dimensions, TouchableOpacity, BackHandler } from 'react-native';
10
10
 
11
11
  import type { LoadingCurrent } from '.'
12
12
 
@@ -19,6 +19,13 @@ export const Loading = React.forwardRef<LoadingCurrent, {}>((_, ref) => {
19
19
  const [tipText, setTipText] = useState('加载中');
20
20
 
21
21
 
22
+ React.useEffect(() => {
23
+ const onBackPress = () => show;
24
+ BackHandler.addEventListener('hardwareBackPress', onBackPress);
25
+ return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
26
+ }, [show])
27
+
28
+
22
29
  useImperativeHandle<unknown, LoadingCurrent>(ref, () => ({
23
30
  showLoading: (content?: string) => {
24
31
  setShow(true);
@@ -2,11 +2,11 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:27:02
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-15 10:08:14
6
- * @FilePath: /cmwy-device-app/node_modules/@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
5
+ * @LastEditTime: 2022-07-15 14:20:40
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
7
7
  */
8
8
  import React, { useImperativeHandle, useState } from 'react';
9
- import { Dimensions, StyleSheet, TouchableOpacity } from 'react-native';
9
+ import { StyleSheet, TouchableOpacity, BackHandler } from 'react-native';
10
10
  import type { PopoverViewCurrent, PopoverViewOptions } from '.';
11
11
 
12
12
 
@@ -18,6 +18,12 @@ export const PopoverView = React.forwardRef<PopoverViewCurrent, {}>((_, ref) =>
18
18
  const [visible, setVisible] = useState<boolean>(false);
19
19
  const [options, setOptions] = useState<Partial<PopoverViewOptions> | undefined>()
20
20
 
21
+ React.useEffect(() => {
22
+ const onBackPress = () => visible;
23
+ BackHandler.addEventListener('hardwareBackPress', onBackPress);
24
+ return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
25
+ }, [visible])
26
+
21
27
 
22
28
  useImperativeHandle<unknown, PopoverViewCurrent>(ref, () => ({
23
29
  showPopoverView: (options: Partial<PopoverViewOptions>) => {
@@ -35,12 +41,12 @@ export const PopoverView = React.forwardRef<PopoverViewCurrent, {}>((_, ref) =>
35
41
  return null;
36
42
 
37
43
  return (
38
- <TouchableOpacity activeOpacity={1} style={[styles.container,options.style]} onPress={e=>{
44
+ <TouchableOpacity activeOpacity={1} style={[styles.container, options?.style]} onPress={e => {
39
45
  setVisible(false);
40
46
  setOptions(undefined)
41
47
  // e.stopPropagation()
42
48
  }}>
43
- {React.isValidElement(options.content) && options.content}
49
+ {React.isValidElement(options?.content) && options?.content}
44
50
  </TouchableOpacity>
45
51
  )
46
52
  })
@@ -142,6 +142,7 @@ export default (props: MenuProps) => {
142
142
 
143
143
  const show = () => {
144
144
  // console.log('_container', _container.current, StatusBar.currentHeight)
145
+ if(props.data == undefined || props.data?.length == 0) return
145
146
  showPopoverView({
146
147
  content: (
147
148
  <TouchableOpacity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.82",
3
+ "version": "1.0.85",
4
4
  "description": "移动端App开发工具包",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-25 17:57:29
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-06-14 13:56:32
5
+ * @LastEditTime: 2022-07-15 12:47:16
6
6
  * @FilePath: /@aks-dev/easyui/README.md
7
7
  -->
8
8
 
@@ -39,6 +39,10 @@ import '@aks-dev/easyui/screen/text-fit'
39
39
  + TableCell
40
40
  + TextInputArea
41
41
  + WithLoadingContainer
42
+ + DottedLine
43
+ + MenuView
44
+ + RichText
45
+ + ...
42
46
 
43
47
 
44
48
  ### utils