@aks-dev/easyui 1.0.72 → 1.0.75
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.
package/lib/Badge/Badge.tsx
CHANGED
|
@@ -2,39 +2,39 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-21 14:40:29
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-08
|
|
5
|
+
* @LastEditTime: 2022-07-08 15:40:21
|
|
6
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>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
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
|
+
}
|
|
40
40
|
|
package/lib/Badge/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-21 14:43:14
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-
|
|
6
|
-
* @FilePath: /@aks/
|
|
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
|
|
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-
|
|
6
|
-
* @FilePath: /@aks/easyui/lib/MutiPictureView/MutiPictureView.tsx
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:02:04
|
|
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
|
-
|
|
143
|
-
|
|
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
|
}, [])
|
|
@@ -181,7 +184,7 @@ const styles = StyleSheet.create({
|
|
|
181
184
|
container: {
|
|
182
185
|
flexGrow: 1,
|
|
183
186
|
minHeight: 1,
|
|
184
|
-
|
|
187
|
+
backgroundColor: 'transparent',
|
|
185
188
|
display: 'flex',
|
|
186
189
|
flexDirection: 'row',
|
|
187
190
|
flexWrap: 'wrap',
|