@ledvance/base 1.3.4 → 1.3.5
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/Stepper.tsx +40 -32
- package/src/i18n/strings.ts +22006 -22006
package/package.json
CHANGED
|
@@ -8,8 +8,10 @@ import { Utils } from "tuya-panel-kit";
|
|
|
8
8
|
const { add, subtract, inMaxMin } = Utils.NumberUtils
|
|
9
9
|
|
|
10
10
|
const { convertX: cx } = Utils.RatioUtils
|
|
11
|
+
const { withTheme } = Utils.ThemeUtils
|
|
11
12
|
|
|
12
13
|
export interface StepperProps {
|
|
14
|
+
theme?: any
|
|
13
15
|
value: number | string
|
|
14
16
|
stepValue?: number // 1
|
|
15
17
|
min?: number // 0
|
|
@@ -70,13 +72,48 @@ const Stepper = (props: StepperProps) => {
|
|
|
70
72
|
|
|
71
73
|
}, [])
|
|
72
74
|
|
|
75
|
+
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
stepperContainer: {
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
backgroundColor: props.theme.container.background,
|
|
81
|
+
padding: cx(2),
|
|
82
|
+
borderRadius: cx(12),
|
|
83
|
+
width: cx(150),
|
|
84
|
+
},
|
|
85
|
+
stepperButton: {
|
|
86
|
+
width: cx(52),
|
|
87
|
+
height: cx(28),
|
|
88
|
+
backgroundColor: props.theme.global.background,
|
|
89
|
+
borderRadius: cx(10),
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
},
|
|
93
|
+
stepperIcon: {
|
|
94
|
+
width: cx(20),
|
|
95
|
+
height: cx(20),
|
|
96
|
+
tintColor: props.theme.global.fontColor
|
|
97
|
+
},
|
|
98
|
+
stepperInput: {
|
|
99
|
+
width: cx(42),
|
|
100
|
+
height: cx(22),
|
|
101
|
+
color: props.theme.global.secondFontColor,
|
|
102
|
+
fontSize: cx(16),
|
|
103
|
+
padding: 0,
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
73
110
|
return (
|
|
74
111
|
<View style={[styles.stepperContainer, props.style]}>
|
|
75
112
|
<TouchableOpacity
|
|
76
113
|
style={[styles.stepperButton, props.buttonStyle]}
|
|
77
114
|
onPress={() => handlePress(false)}
|
|
78
115
|
>
|
|
79
|
-
<Image
|
|
116
|
+
<Image style={styles.stepperIcon} source={res.ic_minus} />
|
|
80
117
|
</TouchableOpacity>
|
|
81
118
|
<TextInput
|
|
82
119
|
style={[styles.stepperInput, props.inputStyle]}
|
|
@@ -92,39 +129,10 @@ const Stepper = (props: StepperProps) => {
|
|
|
92
129
|
style={[styles.stepperButton, props.buttonStyle]}
|
|
93
130
|
onPress={() => handlePress(true)}
|
|
94
131
|
>
|
|
95
|
-
<Image style={
|
|
132
|
+
<Image style={styles.stepperIcon} source={res.ic_plus} />
|
|
96
133
|
</TouchableOpacity>
|
|
97
134
|
</View>
|
|
98
135
|
)
|
|
99
136
|
}
|
|
100
137
|
|
|
101
|
-
|
|
102
|
-
stepperContainer: {
|
|
103
|
-
flexDirection: 'row',
|
|
104
|
-
alignItems: 'center',
|
|
105
|
-
backgroundColor: '#f5f5f5',
|
|
106
|
-
padding: cx(2),
|
|
107
|
-
borderRadius: cx(12),
|
|
108
|
-
width: cx(150),
|
|
109
|
-
},
|
|
110
|
-
stepperButton: {
|
|
111
|
-
width: cx(52),
|
|
112
|
-
height: cx(28),
|
|
113
|
-
backgroundColor: '#fff',
|
|
114
|
-
borderRadius: cx(10),
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
justifyContent: 'center',
|
|
117
|
-
},
|
|
118
|
-
stepperInput: {
|
|
119
|
-
width: cx(42),
|
|
120
|
-
height: cx(22),
|
|
121
|
-
color: '#333',
|
|
122
|
-
fontSize: cx(16),
|
|
123
|
-
padding: 0,
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
justifyContent: 'center',
|
|
126
|
-
textAlign: 'center',
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
export default memo(Stepper)
|
|
138
|
+
export default memo(withTheme(Stepper))
|