@ledvance/base 1.0.4 → 1.0.6
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/package.json +1 -1
- package/src/components/Card.d.ts +1 -0
- package/src/components/Card.tsx +2 -1
- package/src/components/Page.d.ts +2 -0
- package/src/components/ldvPickerView.d.ts +1 -0
- package/src/components/ldvPickerView.tsx +28 -5
- package/src/i18n/strings.d.ts +1231 -20
- package/src/i18n/strings.ts +5217 -4151
package/package.json
CHANGED
package/src/components/Card.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PropsWithChildren } from 'react';
|
|
|
3
3
|
interface CardProps extends PropsWithChildren<ViewProps> {
|
|
4
4
|
shadowHeight?: number | undefined;
|
|
5
5
|
onPress?: () => void;
|
|
6
|
+
onLongPress?: () => void;
|
|
6
7
|
containerStyle?: StyleProp<ViewStyle>;
|
|
7
8
|
}
|
|
8
9
|
export default function Card(props: CardProps): JSX.Element;
|
package/src/components/Card.tsx
CHANGED
|
@@ -7,6 +7,7 @@ const cx = Utils.RatioUtils.convertX
|
|
|
7
7
|
interface CardProps extends PropsWithChildren<ViewProps> {
|
|
8
8
|
shadowHeight?: number | undefined
|
|
9
9
|
onPress?: () => void
|
|
10
|
+
onLongPress?: () => void
|
|
10
11
|
containerStyle?: StyleProp<ViewStyle>
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -27,7 +28,7 @@ export default function Card(props: CardProps) {
|
|
|
27
28
|
},
|
|
28
29
|
borderRadius: cx(10),
|
|
29
30
|
}, props.style]}>
|
|
30
|
-
<TouchableOpacity disabled={!(!!props.onPress)} onPress={props.onPress}>
|
|
31
|
+
<TouchableOpacity disabled={!(!!props.onPress)} onPress={props.onPress} onLongPress={props.onLongPress}>
|
|
31
32
|
<View style={props.containerStyle}>{props.children}</View>
|
|
32
33
|
</TouchableOpacity>
|
|
33
34
|
</View>
|
package/src/components/Page.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { ViewProps } from 'react-native';
|
|
|
3
3
|
interface PageProps extends PropsWithChildren<ViewProps> {
|
|
4
4
|
backText: string;
|
|
5
5
|
onBackClick?: () => void;
|
|
6
|
+
rightButtonIcon?: string;
|
|
7
|
+
rightButtonIconClick?: () => void;
|
|
6
8
|
headlineText?: string;
|
|
7
9
|
headlineIcon?: string;
|
|
8
10
|
onHeadlineIconClick?: () => void;
|
|
@@ -5,6 +5,7 @@ interface LdvPickerViewProps {
|
|
|
5
5
|
setHour: (string: any) => void;
|
|
6
6
|
setMinute: (string: any) => void;
|
|
7
7
|
style?: StyleProp<ViewStyle> | undefined;
|
|
8
|
+
unit?: string[];
|
|
8
9
|
}
|
|
9
10
|
declare const LdvPickerView: (props: LdvPickerViewProps) => JSX.Element;
|
|
10
11
|
export default LdvPickerView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
|
|
2
|
+
import { StyleProp, StyleSheet, View, ViewStyle, Text } from 'react-native'
|
|
3
3
|
import { Picker, Utils } from 'tuya-panel-kit'
|
|
4
4
|
import _ from 'lodash'
|
|
5
5
|
|
|
@@ -16,15 +16,17 @@ interface LdvPickerViewProps {
|
|
|
16
16
|
minute: string,
|
|
17
17
|
setHour: (string) => void,
|
|
18
18
|
setMinute: (string) => void,
|
|
19
|
-
style?: StyleProp<ViewStyle> | undefined
|
|
19
|
+
style?: StyleProp<ViewStyle> | undefined,
|
|
20
|
+
unit?:string[]
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
23
24
|
|
|
24
|
-
const { hour, minute, setHour, setMinute } = props
|
|
25
|
+
const { hour, minute, unit, setHour, setMinute } = props
|
|
25
26
|
|
|
26
27
|
return (
|
|
27
28
|
<View style={[styles.pickerContainer, props.style]}>
|
|
29
|
+
<View style={styles.picContainer}>
|
|
28
30
|
<Picker
|
|
29
31
|
style={[styles.picker, styles.pickerLeft]}
|
|
30
32
|
theme={pickerTheme}
|
|
@@ -37,6 +39,13 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
37
39
|
<Picker.Item key={value} value={value} label={value} />
|
|
38
40
|
))}
|
|
39
41
|
</Picker>
|
|
42
|
+
{unit ? <View style={styles.pickerUnit}>
|
|
43
|
+
<Text style={{ color: '#000', fontSize: convertX(18) }}>
|
|
44
|
+
{unit[0]}
|
|
45
|
+
</Text>
|
|
46
|
+
</View> : null}
|
|
47
|
+
</View>
|
|
48
|
+
<View style={styles.picContainer}>
|
|
40
49
|
<Picker
|
|
41
50
|
style={[styles.picker, styles.pickerLeft]}
|
|
42
51
|
theme={pickerTheme}
|
|
@@ -46,9 +55,14 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
46
55
|
onValueChange={value => setMinute(value as string)}>
|
|
47
56
|
{minutes.map((value) => (
|
|
48
57
|
<Picker.Item key={value} value={value} label={value} />
|
|
49
|
-
))}
|
|
58
|
+
))}
|
|
50
59
|
</Picker>
|
|
51
|
-
|
|
60
|
+
{unit ? <View style={styles.pickerUnit}>
|
|
61
|
+
<Text style={{ color: '#000', fontSize: convertX(18) }}>
|
|
62
|
+
{unit[1]}
|
|
63
|
+
</Text>
|
|
64
|
+
</View> : null}
|
|
65
|
+
</View>
|
|
52
66
|
</View>
|
|
53
67
|
)
|
|
54
68
|
}
|
|
@@ -63,6 +77,15 @@ const styles = StyleSheet.create({
|
|
|
63
77
|
},
|
|
64
78
|
pickerLeft: {},
|
|
65
79
|
pickerItem: {},
|
|
80
|
+
picContainer:{
|
|
81
|
+
flex: 1,
|
|
82
|
+
position: 'relative'
|
|
83
|
+
},
|
|
84
|
+
pickerUnit: {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
right: convertX(20),
|
|
87
|
+
top: '44%'
|
|
88
|
+
},
|
|
66
89
|
})
|
|
67
90
|
|
|
68
91
|
export default LdvPickerView
|