@aks-dev/easyui 1.0.97 → 1.0.100

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.
@@ -5,7 +5,7 @@ import Modal from 'react-native-modal'
5
5
  import { px2dp, deviceWidth } from '../../../screen/px2dp'
6
6
  import { px2sp } from '../../../screen/px2sp'
7
7
 
8
- import { AlertBottomViewOptions, AlertBottomViewCurrent } from '.'
8
+ import { AlertBottomViewOptions, AlertBottomViewRefAttributes } from '.'
9
9
 
10
10
 
11
11
 
@@ -18,7 +18,7 @@ type State = {
18
18
 
19
19
 
20
20
 
21
- export default React.forwardRef<AlertBottomViewCurrent, {}>((_, ref) => {
21
+ export default React.forwardRef<AlertBottomViewRefAttributes, {}>((_, ref) => {
22
22
 
23
23
 
24
24
  const defaultState: Partial<State> = {
@@ -32,7 +32,7 @@ export default React.forwardRef<AlertBottomViewCurrent, {}>((_, ref) => {
32
32
 
33
33
 
34
34
 
35
- React.useImperativeHandle<unknown, AlertBottomViewCurrent>(ref, () => ({
35
+ React.useImperativeHandle<unknown, AlertBottomViewRefAttributes>(ref, () => ({
36
36
  show: async (options: Partial<AlertBottomViewOptions>) => {
37
37
 
38
38
  setState(Object.assign({}, defaultState, { visible: true }, options))
@@ -129,7 +129,7 @@ export default React.forwardRef<AlertBottomViewCurrent, {}>((_, ref) => {
129
129
 
130
130
 
131
131
 
132
- export const alertBottomViewRef = React.createRef<AlertBottomViewCurrent>();
132
+ export const alertBottomViewRef = React.createRef<AlertBottomViewRefAttributes>();
133
133
 
134
134
 
135
135
 
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-22 17:30:32
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-12 19:39:48
5
+ * @LastEditTime: 2022-09-07 18:05:17
6
6
  * @FilePath: /@aks-dev/easyui/lib/Hud/AlertBottomView/index.ts
7
7
  */
8
8
  import * as React from 'react'
@@ -31,12 +31,12 @@ export declare const showAlertBottomModal: (props: Partial<AlertBottomViewOption
31
31
 
32
32
 
33
33
 
34
- export declare type AlertBottomViewCurrent = {
34
+ export declare type AlertBottomViewRefAttributes = {
35
35
  show: (options: Partial<AlertBottomViewOptions>) => void;
36
36
  hide: () => void;
37
37
  }
38
38
 
39
39
 
40
- export declare const AlertBottomView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertBottomViewCurrent>>;
40
+ export declare const AlertBottomView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertBottomViewRefAttributes>>;
41
41
 
42
- export declare const AlertBottomViewRef: React.RefObject<AlertBottomViewCurrent>
42
+ export declare const AlertBottomViewRef: React.RefObject<AlertBottomViewRefAttributes>
@@ -5,7 +5,7 @@ import { View, Text, StyleSheet, Platform, Modal, StatusBar, TouchableOpacity, A
5
5
  import { px2dp, deviceWidth } from '../../../screen/px2dp'
6
6
  import { px2sp } from '../../../screen/px2sp'
7
7
 
8
- import { AlertViewOptions, AlertViewCurrent } from '.'
8
+ import { AlertViewOptions, AlertViewRefAttributes } from '.'
9
9
 
10
10
 
11
11
 
@@ -18,7 +18,7 @@ type State = {
18
18
 
19
19
 
20
20
 
21
- export default React.forwardRef<AlertViewCurrent, {}>((_, ref) => {
21
+ export default React.forwardRef<AlertViewRefAttributes, {}>((_, ref) => {
22
22
 
23
23
 
24
24
  const defaultState: Partial<State> = {
@@ -32,7 +32,7 @@ export default React.forwardRef<AlertViewCurrent, {}>((_, ref) => {
32
32
 
33
33
 
34
34
 
35
- React.useImperativeHandle<unknown, AlertViewCurrent>(ref, () => ({
35
+ React.useImperativeHandle<unknown, AlertViewRefAttributes>(ref, () => ({
36
36
  show: async (options: Partial<AlertViewOptions>) => {
37
37
 
38
38
  setState(Object.assign({}, defaultState, { visible: true }, options))
@@ -134,7 +134,7 @@ export default React.forwardRef<AlertViewCurrent, {}>((_, ref) => {
134
134
 
135
135
 
136
136
 
137
- export const alertViewRef = React.createRef<AlertViewCurrent>();
137
+ export const alertViewRef = React.createRef<AlertViewRefAttributes>();
138
138
 
139
139
 
140
140
 
@@ -2,8 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-22 17:30:32
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-12 19:06:29
6
- * @FilePath: /cmwy-device-app/node_modules/@aks-dev/easyui/lib/Hud/AlertView/index.ts
5
+ * @LastEditTime: 2022-09-07 18:05:54
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/AlertView/index.ts
7
7
  */
8
8
  import * as React from 'react'
9
9
 
@@ -30,12 +30,12 @@ export declare const showAlertModal: (props: Partial<AlertViewOptions>) => void;
30
30
 
31
31
 
32
32
 
33
- export declare type AlertViewCurrent = {
33
+ export declare type AlertViewRefAttributes = {
34
34
  show: (options: Partial<AlertViewOptions>) => void;
35
35
  hide: () => void;
36
36
  }
37
37
 
38
38
 
39
- export declare const AlertView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertViewCurrent>>;
39
+ export declare const AlertView: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<AlertViewRefAttributes>>;
40
40
 
41
- export declare const alertViewRef: React.RefObject<AlertViewCurrent>
41
+ export declare const alertViewRef: React.RefObject<AlertViewRefAttributes>
@@ -2,19 +2,19 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:27:02
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-15 14:21:00
5
+ * @LastEditTime: 2022-09-07 18:06:45
6
6
  * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/Loading.tsx
7
7
  */
8
8
  import React, { useImperativeHandle, useState } from 'react';
9
9
  import { View, ActivityIndicator, StyleSheet, Text, Dimensions, TouchableOpacity, BackHandler } from 'react-native';
10
10
 
11
- import type { LoadingCurrent } from '.'
11
+ import type { LoadingRefAttributes } from '.'
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- export const Loading = React.forwardRef<LoadingCurrent, {}>((_, ref) => {
17
+ export const Loading = React.forwardRef<LoadingRefAttributes, {}>((_, ref) => {
18
18
  const [show, setShow] = useState(false);
19
19
  const [tipText, setTipText] = useState('加载中');
20
20
 
@@ -26,7 +26,7 @@ export const Loading = React.forwardRef<LoadingCurrent, {}>((_, ref) => {
26
26
  }, [show])
27
27
 
28
28
 
29
- useImperativeHandle<unknown, LoadingCurrent>(ref, () => ({
29
+ useImperativeHandle<unknown, LoadingRefAttributes>(ref, () => ({
30
30
  showLoading: (content?: string) => {
31
31
  setShow(true);
32
32
  setTipText(content || '加载中')
@@ -50,7 +50,7 @@ export const Loading = React.forwardRef<LoadingCurrent, {}>((_, ref) => {
50
50
  )
51
51
  })
52
52
 
53
- export const loadingRef = React.createRef<LoadingCurrent>();
53
+ export const loadingRef = React.createRef<LoadingRefAttributes>();
54
54
  export const showLoading = (content?: string) => loadingRef.current?.showLoading(content)
55
55
  export const hideLoading = () => loadingRef.current?.hideLoading()
56
56
 
@@ -3,8 +3,8 @@
3
3
  * @Author: shiguo
4
4
  * @Date: 2022-04-24 14:27:02
5
5
  * @LastEditors: shiguo
6
- * @LastEditTime: 2022-05-12 11:32:41
7
- * @FilePath: /@aks/easyui/lib/Easy-Hud/Loading/index.ts
6
+ * @LastEditTime: 2022-09-07 18:06:36
7
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/index.ts
8
8
  */
9
9
  import * as React from 'react'
10
10
 
@@ -15,7 +15,7 @@ import * as React from 'react'
15
15
 
16
16
 
17
17
 
18
- export declare type LoadingCurrent = {
18
+ export declare type LoadingRefAttributes = {
19
19
  showLoading: (content?: string) => void;
20
20
  hideLoading: () => void;
21
21
  }
@@ -29,7 +29,7 @@ export declare const showLoading: (content?: string) => void;
29
29
  export declare const hideLoading: () => void;
30
30
 
31
31
 
32
- export declare const loadingRef: React.RefObject<LoadingCurrent>;
32
+ export declare const loadingRef: React.RefObject<LoadingRefAttributes>;
33
33
 
34
- export declare const Loading: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<LoadingCurrent>>
34
+ export declare const Loading: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<LoadingRefAttributes>>
35
35
 
@@ -2,19 +2,19 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 14:27:02
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-15 14:20:40
5
+ * @LastEditTime: 2022-09-07 18:08:04
6
6
  * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
7
7
  */
8
8
  import React, { useImperativeHandle, useState } from 'react';
9
9
  import { StyleSheet, TouchableOpacity, BackHandler } from 'react-native';
10
- import type { PopoverViewCurrent, PopoverViewOptions } from '.';
10
+ import type { PopoverViewRefAttributes, PopoverViewOptions } from '.';
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- export const PopoverView = React.forwardRef<PopoverViewCurrent, {}>((_, ref) => {
17
+ export const PopoverView = React.forwardRef<PopoverViewRefAttributes, {}>((_, ref) => {
18
18
  const [visible, setVisible] = useState<boolean>(false);
19
19
  const [options, setOptions] = useState<Partial<PopoverViewOptions> | undefined>()
20
20
 
@@ -25,7 +25,7 @@ export const PopoverView = React.forwardRef<PopoverViewCurrent, {}>((_, ref) =>
25
25
  }, [visible])
26
26
 
27
27
 
28
- useImperativeHandle<unknown, PopoverViewCurrent>(ref, () => ({
28
+ useImperativeHandle<unknown, PopoverViewRefAttributes>(ref, () => ({
29
29
  showPopoverView: (options: Partial<PopoverViewOptions>) => {
30
30
  setVisible(true);
31
31
  setOptions(options)
@@ -51,7 +51,7 @@ export const PopoverView = React.forwardRef<PopoverViewCurrent, {}>((_, ref) =>
51
51
  )
52
52
  })
53
53
 
54
- export const popoverViewRef = React.createRef<PopoverViewCurrent>();
54
+ export const popoverViewRef = React.createRef<PopoverViewRefAttributes>();
55
55
  export const showPopoverView = (options: Partial<PopoverViewOptions>) => popoverViewRef.current?.showPopoverView(options)
56
56
  export const hidePopoverView = () => popoverViewRef.current?.hidePopoverView()
57
57
 
@@ -3,8 +3,8 @@
3
3
  * @Author: shiguo
4
4
  * @Date: 2022-04-24 14:27:02
5
5
  * @LastEditors: shiguo
6
- * @LastEditTime: 2022-07-15 10:07:56
7
- * @FilePath: /cmwy-device-app/node_modules/@aks-dev/easyui/lib/Hud/PopoverView/index.ts
6
+ * @LastEditTime: 2022-09-07 18:06:59
7
+ * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/index.ts
8
8
  */
9
9
  import * as React from 'react'
10
10
 
@@ -18,7 +18,7 @@ export type PopoverViewOptions = {
18
18
 
19
19
 
20
20
 
21
- export declare type PopoverViewCurrent = {
21
+ export declare type PopoverViewRefAttributes = {
22
22
  showPopoverView: (options:Partial<PopoverViewOptions>) => void;
23
23
  hidePopoverView: () => void;
24
24
  }
@@ -32,7 +32,7 @@ export declare const showPopoverView: (options:Partial<PopoverViewOptions>) => v
32
32
  export declare const hidePopoverView: () => void;
33
33
 
34
34
 
35
- export declare const popoverViewRef: React.RefObject<PopoverViewCurrent>;
35
+ export declare const popoverViewRef: React.RefObject<PopoverViewRefAttributes>;
36
36
 
37
- export declare const PopoverView: React.ForwardRefExoticComponent<React.PropsWithoutRef<PopoverViewOptions> & React.RefAttributes<PopoverViewCurrent>>
37
+ export declare const PopoverView: React.ForwardRefExoticComponent<React.PropsWithoutRef<PopoverViewOptions> & React.RefAttributes<PopoverViewRefAttributes>>
38
38
 
@@ -2,18 +2,18 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2021-04-27 10:38:04
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-08-04 10:20:21
5
+ * @LastEditTime: 2022-09-07 18:08:40
6
6
  * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/Toast.tsx
7
7
  */
8
8
  import React, { useImperativeHandle, useState, useRef } from 'react';
9
9
  import { View, StyleSheet, Text, Dimensions, Animated, Easing } from 'react-native';
10
10
 
11
11
 
12
- import type { ToastCurrent } from '.'
12
+ import type { ToastRefAttributes } from '.'
13
13
 
14
14
  const errorMsg = '(^_^)∠※ 送你一束小花'
15
15
 
16
- export const Toast = React.forwardRef<ToastCurrent, {}>((_, ref) => {
16
+ export const Toast = React.forwardRef<ToastRefAttributes, {}>((_, ref) => {
17
17
  const [tipText, setTipText] = useState(errorMsg);
18
18
  const fade = useRef(new Animated.Value(0)).current;
19
19
  const [tipTheme, setTipTheme] = useState<'black' | 'white'>('black')
@@ -34,7 +34,7 @@ export const Toast = React.forwardRef<ToastCurrent, {}>((_, ref) => {
34
34
  })
35
35
  ])
36
36
 
37
- useImperativeHandle<unknown, ToastCurrent>(ref, () => ({
37
+ useImperativeHandle<unknown, ToastRefAttributes>(ref, () => ({
38
38
  showToast: (content: string, theme?: 'black' | 'white') => {
39
39
  setTipText(content || errorMsg)
40
40
  setTipTheme(theme ? theme : 'black')
@@ -46,14 +46,14 @@ export const Toast = React.forwardRef<ToastCurrent, {}>((_, ref) => {
46
46
  return (
47
47
  <Animated.View style={{ ...styles.toastContainer, opacity: fade }}>
48
48
  <View style={[styles.toastTipsContainer, { backgroundColor: tipTheme == 'black' ? '#00000088' : '#ffffff88' }]}>
49
- <Text numberOfLines={5} style={[styles.toastTitle, { color: tipTheme }]}>{tipText} </Text>
49
+ <Text numberOfLines={5} style={[styles.toastTitle, { color: tipTheme == 'black' ? ' white' : 'black' }]}>{tipText} </Text>
50
50
  </View>
51
51
  </Animated.View>
52
52
 
53
53
  )
54
54
  })
55
55
 
56
- export const toastRef = React.createRef<ToastCurrent>();
56
+ export const toastRef = React.createRef<ToastRefAttributes>();
57
57
 
58
58
  export const showToast = (content: string, theme?: 'black' | 'white') => toastRef.current?.showToast(content, theme)
59
59
 
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-18 19:18:03
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-08-04 09:51:29
5
+ * @LastEditTime: 2022-09-07 18:08:36
6
6
  * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/index.ts
7
7
  */
8
8
  import * as React from 'react'
@@ -10,13 +10,13 @@ import * as React from 'react'
10
10
 
11
11
 
12
12
 
13
- export declare type ToastCurrent = {
13
+ export declare type ToastRefAttributes = {
14
14
  showToast: (content: string, theme?: 'black' | 'white') => void;
15
15
  }
16
16
 
17
17
  export declare const showToast: (content: string, theme?: 'black' | 'white') => void;
18
18
 
19
19
 
20
- export declare const toastRef: React.RefObject<ToastCurrent>;
20
+ export declare const toastRef: React.RefObject<ToastRefAttributes>;
21
21
 
22
- export declare const Toast: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<ToastCurrent>>;
22
+ export declare const Toast: React.ForwardRefExoticComponent<React.PropsWithoutRef<{}> & React.RefAttributes<ToastRefAttributes>>;
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 13:56:47
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-14 11:56:11
5
+ * @LastEditTime: 2022-09-07 18:04:52
6
6
  * @FilePath: /@aks-dev/easyui/lib/TextInputArea/TextInputArea.tsx
7
7
  */
8
8
  import React from 'react'
@@ -11,9 +11,9 @@ import {px2dp} from '../../screen/px2dp'
11
11
  import {px2sp} from '../../screen/px2sp'
12
12
 
13
13
 
14
- import type { TextInputAreaProps, TextInputAreaCurrent } from '.'
14
+ import type { TextInputAreaProps, TextInputAreaRefAttributes } from '.'
15
15
 
16
- export default React.forwardRef<TextInputAreaCurrent, Partial<TextInputAreaProps>>((props, ref) => {
16
+ export default React.forwardRef<TextInputAreaRefAttributes, Partial<TextInputAreaProps>>((props, ref) => {
17
17
  const { defaultValue, placeholder, maxLength = 200, on, ...rest } = props
18
18
 
19
19
  const [value, setValue] = React.useState<string | undefined>(defaultValue)
@@ -23,7 +23,7 @@ export default React.forwardRef<TextInputAreaCurrent, Partial<TextInputAreaProps
23
23
  }, [defaultValue])
24
24
 
25
25
 
26
- React.useImperativeHandle<unknown,TextInputAreaCurrent>(ref, () => ({
26
+ React.useImperativeHandle<unknown,TextInputAreaRefAttributes>(ref, () => ({
27
27
  value: value,
28
28
  }), [value])
29
29
 
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-24 13:59:32
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-14 11:56:00
5
+ * @LastEditTime: 2022-09-07 18:04:41
6
6
  * @FilePath: /@aks-dev/easyui/lib/TextInputArea/index.ts
7
7
  */
8
8
  import * as React from 'react'
@@ -23,11 +23,11 @@ export type TextInputAreaProps = {
23
23
 
24
24
 
25
25
 
26
- export type TextInputAreaCurrent = {
26
+ export type TextInputAreaRefAttributes = {
27
27
  value: string | undefined;
28
28
  }
29
29
 
30
30
 
31
- export declare const TextInputArea: React.ForwardRefExoticComponent<React.PropsWithoutRef<Partial<TextInputAreaProps>> & React.RefAttributes<TextInputAreaCurrent>>;
31
+ export declare const TextInputArea: React.ForwardRefExoticComponent<React.PropsWithoutRef<Partial<TextInputAreaProps>> & React.RefAttributes<TextInputAreaRefAttributes>>;
32
32
 
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.97",
3
+ "version": "1.0.100",
4
4
  "description": "移动端App开发工具包",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",
@@ -10,8 +10,7 @@
10
10
  "keywords": [
11
11
  "react",
12
12
  "react-native",
13
- "easyui",
14
- "爱科森开发"
13
+ "easyui"
15
14
  ],
16
15
  "files": [
17
16
  "/android",
package/utils/lazy.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-27 18:17:54
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-11 15:59:49
5
+ * @LastEditTime: 2022-08-25 17:02:22
6
6
  * @FilePath: /@aks-dev/easyui/utils/lazy.ts
7
7
  */
8
8
  import type { SyncLoopCallBack } from '.'
@@ -17,7 +17,7 @@ export const sleep = (msec?: number) => {
17
17
 
18
18
 
19
19
  export const randomcolor = () => {
20
- return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.random()})`
20
+ return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${1})`
21
21
  }
22
22
 
23
23