@aks-dev/easyui 1.0.71 → 1.0.74

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,38 +2,39 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-21 14:40:29
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-04-26 14:05:59
6
- * @FilePath: /@aks/easy/lib/Badge/Badge.tsx
5
+ * @LastEditTime: 2022-07-08 15:40:21
6
+ * @FilePath: /@aks-dev/easyui/lib/Badge/Badge.tsx
7
7
  */
8
8
  import React from 'react'
9
9
  import { View, Text, } from 'react-native'
10
- import {px2dp} from '../../screen/px2dp'
11
- import {px2sp} from '../../screen/px2sp'
10
+ import { px2dp } from '../../screen/px2dp'
11
+ import { px2sp } from '../../screen/px2sp'
12
12
 
13
13
 
14
14
  import type { BadgeProps } from '.'
15
15
 
16
16
 
17
17
 
18
- export const Badge: React.FC<BadgeProps> = (props) => {
19
- return (
20
-
21
- <View style={
22
- [
23
- {
24
- flexGrow: 0, flexShrink: 1, zIndex: 1,
25
- paddingHorizontal: px2dp(4),
26
- height: px2dp(16), minWidth: px2dp(16), borderRadius: px2dp(8),
27
- justifyContent: 'center', alignItems: 'center', backgroundColor: 'red'
28
- },
29
- props.style
30
- ]
31
- } >
32
-
33
-
34
- <Text style={{ fontSize: px2sp(12), color: 'white', lineHeight: px2dp(16), textAlign: 'center' }}> {props.count > 99 ? '+99' : props.count} </Text>
35
-
36
- </View>
37
- )
38
- }
18
+ export const Badge: React.FC<BadgeProps>
19
+ = (props) => {
20
+ if (isNaN(+props.count) || Number(props.count) == 0) return <View />
21
+ return (
22
+
23
+ <View style={
24
+ [
25
+ {
26
+ flexGrow: 0, flexShrink: 1, zIndex: 1,
27
+ // paddingHorizontal: px2dp(0),
28
+ height: px2dp(16), minWidth: px2dp(16), borderRadius: px2dp(8),
29
+ justifyContent: 'center', alignItems: 'center',
30
+ backgroundColor: 'red'
31
+ },
32
+ props.style
33
+ ]
34
+ } >
35
+ <Text style={{ fontSize: px2sp(12), color: 'white', textAlign: 'center' }}> {props.count > 99 ? '+99' : props.count} </Text>
36
+
37
+ </View>
38
+ )
39
+ }
39
40
 
@@ -2,8 +2,8 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-21 14:43:14
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-04-26 10:49:39
6
- * @FilePath: /@aks/easy/lib/Badge/index.ts
5
+ * @LastEditTime: 2022-07-08 15:40:30
6
+ * @FilePath: /@aks-dev/easyui/lib/Badge/index.ts
7
7
  */
8
8
  import * as React from 'react'
9
9
  import { StyleProp, ViewStyle } from 'react-native'
@@ -13,9 +13,9 @@ import { StyleProp, ViewStyle } from 'react-native'
13
13
 
14
14
 
15
15
  export declare type BadgeProps = {
16
- count: number;
16
+ count: number | string;
17
17
  style?: StyleProp<ViewStyle>
18
18
  }
19
19
 
20
- export declare const Badge : React.FC<BadgeProps>
20
+ export declare const Badge: React.FC<BadgeProps>
21
21
 
@@ -2,8 +2,8 @@
2
2
  * @Author: OBKoro1
3
3
  * @Date: 2022-04-24 17:38:27
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-05-12 10:59:12
6
- * @FilePath: /@aks/easyui/lib/MutiPictureView/MutiPictureView.tsx
5
+ * @LastEditTime: 2022-07-08 16:52:06
6
+ * @FilePath: /@aks-dev/easyui/lib/MutiPictureView/MutiPictureView.tsx
7
7
  */
8
8
 
9
9
  import * as React from 'react'
@@ -139,8 +139,11 @@ const MutiPictureView: React.FC<MutiPictureViewProps> = (props) => {
139
139
  React.useEffect(() => {
140
140
  containerRef.current?.measure((...args) => {
141
141
  // console.log(args)
142
- let _sideLength = (args[2] - spacingHorizontal * 2 - spacingInner * 2) / 3
143
- setSideLength(_sideLength)
142
+ if(args.length > 3){
143
+ let _sideLength = (args[2] - spacingHorizontal * 2 - spacingInner * 2) / 3;
144
+ setSideLength(_sideLength)
145
+ }
146
+
144
147
  })
145
148
 
146
149
  }, [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.71",
3
+ "version": "1.0.74",
4
4
  "description": "移动端App开发工具包",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",