@ledvance/base 1.1.13 → 1.1.15
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/.prettierrc.js +0 -0
- package/package.json +1 -1
- package/src/api/native.d.ts +5 -0
- package/src/api/native.ts +193 -160
- package/src/api/nativeEventEmitter.ts +54 -54
- package/src/components/Card.tsx +25 -25
- package/src/components/Cell.tsx +32 -32
- package/src/components/ColorAdjustView.tsx +44 -44
- package/src/components/ColorTempAdjustView.tsx +37 -37
- package/src/components/ColorsLine.d.ts +7 -0
- package/src/components/ColorsLine.tsx +48 -0
- package/src/components/DeleteButton.d.ts +1 -1
- package/src/components/DeleteButton.tsx +27 -27
- package/src/components/Dialog.tsx +28 -28
- package/src/components/FanAdjustView.tsx +115 -105
- package/src/components/InfoText.tsx +29 -29
- package/src/components/LampAdjustView.tsx +52 -52
- package/src/components/LinearGradientLine.tsx +53 -53
- package/src/components/MoodColorsLine.d.ts +9 -0
- package/src/components/MoodColorsLine.tsx +38 -0
- package/src/components/Page.tsx +34 -34
- package/src/components/Popup.tsx +17 -17
- package/src/components/Segmented.d.ts +2 -2
- package/src/components/Segmented.tsx +66 -65
- package/src/components/Spacer.tsx +5 -5
- package/src/components/Tag.tsx +42 -42
- package/src/components/TextButton.d.ts +1 -1
- package/src/components/TextButton.tsx +23 -23
- package/src/components/TextField.tsx +58 -58
- package/src/components/connect.tsx +10 -10
- package/src/components/ldvColorBrightness.tsx +12 -12
- package/src/components/ldvColorSlider.tsx +109 -109
- package/src/components/ldvPickerView.tsx +70 -70
- package/src/components/ldvPresetView.tsx +68 -68
- package/src/components/ldvSaturation.tsx +14 -14
- package/src/components/ldvSlider.d.ts +3 -3
- package/src/components/ldvSlider.tsx +93 -93
- package/src/components/ldvSwitch.tsx +35 -35
- package/src/components/ldvTemperatureSlider.tsx +120 -120
- package/src/components/ldvTopBar.tsx +50 -50
- package/src/components/ldvTopName.tsx +44 -44
- package/src/components/segmentControl.tsx +59 -59
- package/src/components/weekSelect.tsx +76 -76
- package/src/composeLayout.tsx +165 -165
- package/src/i18n/index.ts +12 -12
- package/src/i18n/strings.ts +11004 -11004
- package/src/main.tsx +4 -4
- package/src/models/GlobalParams.ts +7 -7
- package/src/models/TuyaApi.d.ts +3 -3
- package/src/models/TuyaApi.ts +61 -61
- package/src/models/combine.ts +7 -7
- package/src/models/configureStore.ts +14 -14
- package/src/models/index.ts +4 -4
- package/src/models/modules/NativePropsSlice.tsx +170 -169
- package/src/models/modules/Result.ts +8 -8
- package/src/models/modules/common.ts +90 -90
- package/src/res/index.ts +35 -35
- package/src/utils/ColorParser.ts +150 -150
- package/src/utils/ColorUtils.tsx +414 -414
- package/src/utils/Support.d.ts +9 -0
- package/src/utils/Support.ts +85 -0
- package/src/utils/cctUtils.d.ts +1 -0
- package/src/utils/cctUtils.ts +111 -0
- package/src/utils/common.ts +186 -174
- package/src/utils/index.ts +123 -123
|
@@ -3,16 +3,16 @@ import LdvSlider from 'components/ldvSlider'
|
|
|
3
3
|
import I18n from '../i18n/index'
|
|
4
4
|
|
|
5
5
|
export default function LdvColorBrightness(props) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const {value, onSlidingComplete} = props
|
|
7
|
+
const renderBrightness = () => {
|
|
8
|
+
return (
|
|
9
|
+
<LdvSlider
|
|
10
|
+
style={props.style}
|
|
11
|
+
title={I18n.getLang('light_sources_tile_dim_lighting_brightness')}
|
|
12
|
+
value={value}
|
|
13
|
+
onSlidingComplete={onSlidingComplete}
|
|
14
|
+
onValueChange={props.onValueChange}/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
return renderBrightness()
|
|
18
18
|
}
|
|
@@ -1,132 +1,132 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'
|
|
3
|
+
import {LinearGradient, Slider, Utils} from 'tuya-panel-kit'
|
|
4
|
+
import {Rect} from 'react-native-svg'
|
|
5
5
|
|
|
6
6
|
const cx = Utils.RatioUtils.convertX
|
|
7
7
|
|
|
8
8
|
const temperatures = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
'0%': 'rgb(254, 172, 90)',
|
|
10
|
+
'22%': 'rgb(249, 209, 164)',
|
|
11
|
+
'41%': 'rgb(254, 244, 223)',
|
|
12
|
+
'60%': 'rgb(252, 250, 242)',
|
|
13
|
+
'80%': 'rgb(226, 235, 248)',
|
|
14
|
+
'100%': 'rgb(194, 217, 254)',
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const colors = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
'0%': 'rgb(255, 0, 0)',
|
|
19
|
+
'17%': 'rgb(249, 238, 0)',
|
|
20
|
+
'35%': 'rgb(96, 255, 66)',
|
|
21
|
+
'55%': 'rgb(0, 249, 255)',
|
|
22
|
+
'65%': 'rgb(43, 0, 255)',
|
|
23
|
+
'80%': 'rgb(180, 0, 255)',
|
|
24
|
+
'100%': 'rgb(255, 0, 0)',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const TEMP_KEY = 'temperature'
|
|
28
28
|
|
|
29
29
|
interface LdvColorSliderProps {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
title: string,
|
|
31
|
+
type: string,
|
|
32
|
+
onValueChange?: (number) => void | undefined,
|
|
33
|
+
onSlidingComplete: (number) => void,
|
|
34
|
+
thumbColor: string,
|
|
35
|
+
value: number,
|
|
36
|
+
width?: number | undefined,
|
|
37
|
+
style?: StyleProp<ViewStyle> | undefined
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const LdvColorSlider = (props: LdvColorSliderProps) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
41
|
+
const {title, type, onSlidingComplete, thumbColor, value} = props
|
|
42
|
+
let dataSource = type === TEMP_KEY ? temperatures : colors
|
|
43
|
+
let max = type === TEMP_KEY ? 100 : 359
|
|
44
|
+
let min = type === TEMP_KEY ? 0 : 0
|
|
45
|
+
const width = props.width || (Utils.RatioUtils.width - cx(80))
|
|
46
|
+
return (
|
|
47
|
+
<View style={[styles.container, props.style]}>
|
|
48
|
+
<Text style={styles.title}>
|
|
49
|
+
{title}
|
|
50
|
+
</Text>
|
|
51
|
+
<Slider.Horizontal
|
|
52
|
+
style={{...styles.shadeSlider, width}}
|
|
53
|
+
styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
|
|
54
|
+
maximumValue={max}
|
|
55
|
+
minimumValue={min}
|
|
56
|
+
value={value}
|
|
57
|
+
stepValue={1}
|
|
58
|
+
canTouchTrack={true}
|
|
59
|
+
theme={{
|
|
60
|
+
trackRadius: cx(15),
|
|
61
|
+
}}
|
|
62
|
+
onlyMaximumTrack={true}
|
|
63
|
+
renderMaximumTrack={() => {
|
|
64
|
+
return (
|
|
65
|
+
<View style={{flex: 1, borderRadius: cx(15)}}>
|
|
66
|
+
<LinearGradient
|
|
67
|
+
style={{...styles.sliderLinearGradient, width}}
|
|
68
|
+
x1="0%"
|
|
69
|
+
y1="0%"
|
|
70
|
+
x2="100%"
|
|
71
|
+
y2="0%"
|
|
72
|
+
stops={dataSource}>
|
|
73
|
+
<Rect {...styles.sliderLinearGradient} width={width}/>
|
|
74
|
+
</LinearGradient>
|
|
75
|
+
</View>
|
|
76
|
+
)
|
|
77
|
+
}}
|
|
78
|
+
onValueChange={props.onValueChange}
|
|
79
|
+
onSlidingComplete={onSlidingComplete}
|
|
80
|
+
/>
|
|
81
|
+
</View>
|
|
82
|
+
)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const styles = StyleSheet.create({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
sliderLinearGradient: {
|
|
125
|
-
height: cx(12),
|
|
126
|
-
},
|
|
127
|
-
presetView: {
|
|
128
|
-
height: cx(60),
|
|
86
|
+
container: {
|
|
87
|
+
height: cx(57),
|
|
88
|
+
flexDirection: 'column',
|
|
89
|
+
paddingStart: cx(16),
|
|
90
|
+
},
|
|
91
|
+
title: {
|
|
92
|
+
marginTop: cx(4),
|
|
93
|
+
fontSize: cx(14),
|
|
94
|
+
color: '#000',
|
|
95
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
96
|
+
},
|
|
97
|
+
shadeSlider: {
|
|
98
|
+
marginTop: cx(8),
|
|
99
|
+
height: cx(28),
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
},
|
|
102
|
+
sliderTrack: {
|
|
103
|
+
marginTop: cx(9),
|
|
104
|
+
marginBottom: cx(9),
|
|
105
|
+
flex: 1,
|
|
106
|
+
borderRadius: cx(15),
|
|
107
|
+
},
|
|
108
|
+
shadeThumb: {
|
|
109
|
+
backgroundColor: 'rgb(0, 249, 255)',
|
|
110
|
+
width: cx(28),
|
|
111
|
+
height: cx(28),
|
|
112
|
+
borderRadius: cx(14),
|
|
113
|
+
borderColor: 'white',
|
|
114
|
+
borderWidth: 1,
|
|
115
|
+
shadowColor: '#000000',
|
|
116
|
+
shadowOpacity: 0.2,
|
|
117
|
+
shadowRadius: cx(8),
|
|
118
|
+
elevation: cx(8),
|
|
119
|
+
shadowOffset: {
|
|
120
|
+
width: 0,
|
|
121
|
+
height: cx(4),
|
|
129
122
|
},
|
|
123
|
+
},
|
|
124
|
+
sliderLinearGradient: {
|
|
125
|
+
height: cx(12),
|
|
126
|
+
},
|
|
127
|
+
presetView: {
|
|
128
|
+
height: cx(60),
|
|
129
|
+
},
|
|
130
130
|
})
|
|
131
131
|
|
|
132
132
|
export default LdvColorSlider
|
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'
|
|
3
|
+
import {Picker, Utils} from 'tuya-panel-kit'
|
|
4
4
|
import _ from 'lodash'
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const {convertX} = Utils.RatioUtils
|
|
7
7
|
|
|
8
8
|
const hours = _.times(24, (n) => _.padStart(n.toString(), 2, '0'))
|
|
9
9
|
const minutes = _.times(60, (n) => _.padStart(n.toString(), 2, '0'))
|
|
10
10
|
const pickerTheme = {
|
|
11
|
-
|
|
11
|
+
fontSize: 20,
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface LdvPickerViewProps {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
hour: string,
|
|
16
|
+
minute: string,
|
|
17
|
+
setHour: (string) => void,
|
|
18
|
+
setMinute: (string) => void,
|
|
19
|
+
style?: StyleProp<ViewStyle> | undefined,
|
|
20
|
+
unit?: string[]
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const {hour, minute, unit, setHour, setMinute} = props
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
27
|
+
return (
|
|
28
|
+
<View style={[styles.pickerContainer, props.style]}>
|
|
29
|
+
<View style={styles.picContainer}>
|
|
30
|
+
<Picker
|
|
31
|
+
style={[styles.picker, styles.pickerLeft]}
|
|
32
|
+
theme={pickerTheme}
|
|
33
|
+
itemStyle={styles.pickerItem}
|
|
34
|
+
textSize={convertX(14)}
|
|
35
|
+
selectedValue={hour}
|
|
36
|
+
itemAlign={'center'}
|
|
37
|
+
onValueChange={value => setHour(value as string)}>
|
|
38
|
+
{hours.map((value) => (
|
|
39
|
+
<Picker.Item key={value} value={value} label={value}/>
|
|
40
|
+
))}
|
|
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}>
|
|
49
|
+
<Picker
|
|
50
|
+
style={[styles.picker, styles.pickerLeft]}
|
|
51
|
+
theme={pickerTheme}
|
|
52
|
+
itemStyle={styles.pickerItem}
|
|
53
|
+
textSize={convertX(14)}
|
|
54
|
+
selectedValue={minute}
|
|
55
|
+
onValueChange={value => setMinute(value as string)}>
|
|
56
|
+
{minutes.map((value) => (
|
|
57
|
+
<Picker.Item key={value} value={value} label={value}/>
|
|
58
|
+
))}
|
|
59
|
+
</Picker>
|
|
60
|
+
{unit ? <View style={styles.pickerUnit}>
|
|
61
|
+
<Text style={{color: '#000', fontSize: convertX(18)}}>
|
|
62
|
+
{unit[1]}
|
|
63
|
+
</Text>
|
|
64
|
+
</View> : null}
|
|
65
|
+
</View>
|
|
66
|
+
</View>
|
|
67
|
+
)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
const styles = StyleSheet.create({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
pickerContainer: {
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
},
|
|
75
|
+
picker: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
},
|
|
78
|
+
pickerLeft: {},
|
|
79
|
+
pickerItem: {},
|
|
80
|
+
picContainer: {
|
|
81
|
+
flex: 1,
|
|
82
|
+
position: 'relative',
|
|
83
|
+
},
|
|
84
|
+
pickerUnit: {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
right: convertX(20),
|
|
87
|
+
top: '44%',
|
|
88
|
+
},
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
export default LdvPickerView
|
|
@@ -5,83 +5,83 @@ import {Utils} from 'tuya-panel-kit'
|
|
|
5
5
|
const {convertX: cx} = Utils.RatioUtils
|
|
6
6
|
|
|
7
7
|
const temperatures = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
{
|
|
9
|
+
color: 'rgb(253, 176, 97)',
|
|
10
|
+
value: 0,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
color: 'rgb(249, 208, 162)',
|
|
14
|
+
value: 20,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
color: 'rgb(254, 243, 221)',
|
|
18
|
+
value: 40,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
color: 'rgb(246, 247, 244)',
|
|
22
|
+
value: 60,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
color: 'rgb(231, 238, 247)',
|
|
26
|
+
value: 80,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
color: 'rgb(194, 216, 251)',
|
|
30
|
+
value: 100,
|
|
31
|
+
},
|
|
32
32
|
]
|
|
33
33
|
|
|
34
34
|
const colors = [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
{
|
|
36
|
+
color: '#ff0000',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
color: '#ff8700',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
color: '#fff100',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
color: '#00c931',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
color: '#0025ff',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
color: '#bb00ff',
|
|
52
|
+
},
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
const LdvPresetView = (props) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
const {type, onPress} = props
|
|
57
|
+
let dataSource = type == 'temperature' ? temperatures : colors
|
|
58
|
+
return (
|
|
59
|
+
<View style={styles.container}>
|
|
60
|
+
{dataSource.map((item, index) =>
|
|
61
|
+
<TouchableOpacity
|
|
62
|
+
key={index}
|
|
63
|
+
style={[styles.item, {backgroundColor: item.color}]}
|
|
64
|
+
onPress={() => {
|
|
65
|
+
onPress(item)
|
|
66
|
+
}}/>)}
|
|
67
|
+
</View>
|
|
68
|
+
)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
const styles = StyleSheet.create({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
container: {
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
justifyContent: 'space-between',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
marginHorizontal: cx(16),
|
|
77
|
+
},
|
|
78
|
+
item: {
|
|
79
|
+
width: cx(28),
|
|
80
|
+
height: cx(28),
|
|
81
|
+
borderRadius: cx(14),
|
|
82
|
+
borderWidth: cx(1),
|
|
83
|
+
borderColor: 'rgb(230, 231, 232)',
|
|
84
|
+
},
|
|
85
85
|
})
|
|
86
86
|
|
|
87
87
|
export default LdvPresetView
|
|
@@ -3,21 +3,21 @@ import LdvSlider from 'components/ldvSlider'
|
|
|
3
3
|
import I18n from '../i18n/index'
|
|
4
4
|
|
|
5
5
|
const LdvSaturation = (props) => {
|
|
6
|
-
|
|
6
|
+
const {value, onSlidingComplete} = props
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const renderBrightness = () => {
|
|
9
|
+
return (
|
|
10
|
+
<LdvSlider
|
|
11
|
+
style={props.style}
|
|
12
|
+
title={I18n.getLang('light_sources_tile_rgb_lighting_saturation')}
|
|
13
|
+
value={value}
|
|
14
|
+
max={100}
|
|
15
|
+
min={0}
|
|
16
|
+
onSlidingComplete={onSlidingComplete}
|
|
17
|
+
onValueChange={props.onValueChange}/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
return renderBrightness()
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default LdvSaturation
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { StyleProp,
|
|
1
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
2
2
|
interface LdvSliderProps {
|
|
3
3
|
title: string;
|
|
4
4
|
value: number;
|
|
5
5
|
min?: number | undefined;
|
|
6
6
|
max?: number | undefined;
|
|
7
|
-
onValueChange?: (
|
|
8
|
-
onSlidingComplete: (
|
|
7
|
+
onValueChange?: (v: number) => void | undefined;
|
|
8
|
+
onSlidingComplete: (v: number) => void;
|
|
9
9
|
style?: StyleProp<ViewStyle> | undefined;
|
|
10
10
|
sliderStyle?: StyleProp<ViewStyle> | undefined;
|
|
11
11
|
subTitleStr?: string;
|