@ledvance/base 1.2.83 → 1.2.85
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/.babelrc +31 -31
- package/.eslintignore +5 -5
- package/.eslintrc.js +27 -27
- package/.prettierrc.js +1 -1
- package/.versionrc +5 -5
- package/localazy.json +851 -848
- package/localazy.keys.json +4 -4
- package/package.json +74 -74
- package/rn-cli.config.js +8 -8
- package/src/api/native.d.ts +71 -71
- package/src/api/native.ts +423 -423
- package/src/api/nativeEventEmitter.d.ts +3 -3
- package/src/api/nativeEventEmitter.ts +125 -125
- package/src/components/AdvanceCard.d.ts +25 -25
- package/src/components/AdvanceCard.tsx +117 -117
- package/src/components/AdvanceList.d.ts +9 -9
- package/src/components/AdvanceList.tsx +69 -69
- package/src/components/ApplyForDeviceItem.d.ts +6 -6
- package/src/components/ApplyForDeviceItem.tsx +83 -83
- package/src/components/ApplyForDeviceList.d.ts +7 -7
- package/src/components/ApplyForDeviceList.tsx +61 -61
- package/src/components/ApplyForText.d.ts +6 -6
- package/src/components/ApplyForText.tsx +52 -52
- package/src/components/Card.d.ts +10 -10
- package/src/components/Card.tsx +40 -40
- package/src/components/Cell.d.ts +21 -21
- package/src/components/Cell.tsx +69 -69
- package/src/components/CircularProgress.d.ts +8 -8
- package/src/components/CircularProgress.tsx +42 -42
- package/src/components/ColorAdjustView.d.ts +12 -12
- package/src/components/ColorAdjustView.tsx +64 -64
- package/src/components/ColorExtractor.d.ts +73 -73
- package/src/components/ColorExtractor.tsx +374 -374
- package/src/components/ColorTempAdjustView.d.ts +13 -13
- package/src/components/ColorTempAdjustView.tsx +57 -57
- package/src/components/ColorsLine.d.ts +7 -7
- package/src/components/ColorsLine.tsx +47 -47
- package/src/components/CustomListDialog.d.ts +15 -15
- package/src/components/CustomListDialog.tsx +66 -66
- package/src/components/DeleteButton.d.ts +10 -10
- package/src/components/DeleteButton.tsx +40 -40
- package/src/components/Dialog.d.ts +10 -10
- package/src/components/Dialog.tsx +38 -38
- package/src/components/DrawToolView.d.ts +46 -46
- package/src/components/DrawToolView.tsx +262 -262
- package/src/components/FanAdjustView.d.ts +23 -23
- package/src/components/FanAdjustView.tsx +141 -141
- package/src/components/InfoText.d.ts +11 -11
- package/src/components/InfoText.tsx +45 -45
- package/src/components/LampAdjustView.d.ts +10 -10
- package/src/components/LampAdjustView.tsx +75 -75
- package/src/components/LampAdjustView2.d.ts +24 -24
- package/src/components/LampAdjustView2.tsx +104 -104
- package/src/components/LinearGradientLine.d.ts +9 -9
- package/src/components/LinearGradientLine.tsx +63 -63
- package/src/components/LoadingView.tsx +39 -39
- package/src/components/MoodColorsLine.d.ts +9 -9
- package/src/components/MoodColorsLine.tsx +38 -38
- package/src/components/Page.d.ts +21 -21
- package/src/components/Page.tsx +104 -104
- package/src/components/Popup.d.ts +7 -7
- package/src/components/Popup.tsx +71 -71
- package/src/components/Segmented.d.ts +14 -14
- package/src/components/Segmented.tsx +76 -76
- package/src/components/ShowSelect.d.ts +1 -1
- package/src/components/ShowSelect.tsx +158 -158
- package/src/components/SocketItem.d.ts +13 -13
- package/src/components/SocketItem.tsx +87 -87
- package/src/components/Spacer.d.ts +7 -7
- package/src/components/Spacer.tsx +13 -13
- package/src/components/Stepper.d.ts +19 -19
- package/src/components/Stepper.tsx +130 -130
- package/src/components/StripAdjustView.d.ts +16 -16
- package/src/components/StripAdjustView.tsx +129 -129
- package/src/components/StripLightView.d.ts +14 -14
- package/src/components/StripLightView.tsx +24 -24
- package/src/components/Summary.tsx +116 -116
- package/src/components/Tag.d.ts +8 -8
- package/src/components/Tag.tsx +56 -56
- package/src/components/TextButton.d.ts +9 -9
- package/src/components/TextButton.tsx +31 -31
- package/src/components/TextField.d.ts +9 -9
- package/src/components/TextField.tsx +92 -92
- package/src/components/TextFieldStyleButton.d.ts +8 -8
- package/src/components/TextFieldStyleButton.tsx +85 -85
- package/src/components/UATabTitle.d.ts +6 -6
- package/src/components/UATabTitle.tsx +31 -31
- package/src/components/UATabs.d.ts +12 -12
- package/src/components/UATabs.tsx +77 -77
- package/src/components/connect.d.ts +10 -10
- package/src/components/connect.tsx +20 -20
- package/src/components/ldvColorBrightness.d.ts +1 -1
- package/src/components/ldvColorBrightness.tsx +18 -18
- package/src/components/ldvColorSlider.d.ts +14 -14
- package/src/components/ldvColorSlider.tsx +131 -131
- package/src/components/ldvItemView.d.ts +12 -12
- package/src/components/ldvItemView.tsx +43 -43
- package/src/components/ldvPickerView.d.ts +13 -13
- package/src/components/ldvPickerView.tsx +97 -97
- package/src/components/ldvPresetView.d.ts +2 -2
- package/src/components/ldvPresetView.tsx +86 -86
- package/src/components/ldvSaturation.d.ts +2 -2
- package/src/components/ldvSaturation.tsx +22 -22
- package/src/components/ldvSlider.d.ts +15 -15
- package/src/components/ldvSlider.tsx +103 -103
- package/src/components/ldvSwitch.d.ts +10 -10
- package/src/components/ldvSwitch.tsx +52 -52
- package/src/components/ldvTemperatureSlider.d.ts +13 -13
- package/src/components/ldvTemperatureSlider.tsx +139 -139
- package/src/components/ldvTopBar.d.ts +10 -10
- package/src/components/ldvTopBar.tsx +76 -76
- package/src/components/ldvTopName.d.ts +9 -9
- package/src/components/ldvTopName.tsx +63 -63
- package/src/components/segmentControl.d.ts +1 -1
- package/src/components/segmentControl.tsx +65 -65
- package/src/components/weekSelect.d.ts +7 -7
- package/src/components/weekSelect.tsx +98 -98
- package/src/composeLayout.d.ts +30 -30
- package/src/composeLayout.tsx +261 -261
- package/src/config/dark-theme.ts +61 -61
- package/src/config/light-theme.ts +61 -61
- package/src/hooks/Hooks.d.ts +2 -2
- package/src/hooks/Hooks.ts +8 -8
- package/src/i18n/index.d.ts +16 -16
- package/src/i18n/index.ts +37 -37
- package/src/i18n/strings.d.ts +15953 -15953
- package/src/i18n/strings.ts +23781 -23723
- package/src/main.tsx +9 -9
- package/src/models/GlobalParams.d.ts +14 -14
- package/src/models/GlobalParams.ts +14 -14
- package/src/models/TuyaApi.d.ts +29 -29
- package/src/models/TuyaApi.ts +92 -92
- package/src/models/combine.d.ts +26 -26
- package/src/models/combine.ts +17 -17
- package/src/models/configureStore.d.ts +9 -9
- package/src/models/configureStore.ts +33 -33
- package/src/models/index.d.ts +31 -31
- package/src/models/index.ts +22 -22
- package/src/models/modules/NativePropsSlice.d.ts +61 -61
- package/src/models/modules/NativePropsSlice.tsx +467 -467
- package/src/models/modules/Result.d.ts +14 -14
- package/src/models/modules/Result.ts +15 -15
- package/src/models/modules/common.d.ts +44 -44
- package/src/models/modules/common.ts +161 -161
- package/src/res/index.d.ts +70 -70
- package/src/res/index.ts +73 -73
- package/src/utils/ColorParser.d.ts +66 -66
- package/src/utils/ColorParser.ts +189 -189
- package/src/utils/ColorUtils.d.ts +71 -71
- package/src/utils/ColorUtils.tsx +448 -448
- package/src/utils/Support.d.ts +13 -13
- package/src/utils/Support.ts +108 -108
- package/src/utils/TypeUtils.d.ts +3 -3
- package/src/utils/cctUtils.d.ts +1 -1
- package/src/utils/cctUtils.ts +110 -110
- package/src/utils/common.d.ts +35 -35
- package/src/utils/common.ts +379 -379
- package/src/utils/index.d.ts +26 -26
- package/src/utils/index.ts +191 -191
- package/src/utils/interface.d.ts +6 -6
- package/src/utils/interface.ts +50 -50
- package/src/utils/loopsCompare.d.ts +1 -1
- package/src/utils/loopsCompare.ts +62 -62
- package/tsconfig.json +50 -50
- package/update-localazy.py +52 -52
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Text, TouchableOpacity, Image } from 'react-native'
|
|
3
|
-
import { Utils, Popup } from 'tuya-panel-kit'
|
|
4
|
-
import Img from 'res'
|
|
5
|
-
import Strings from '@i18n'
|
|
6
|
-
|
|
7
|
-
const { convertX, height } = Utils.RatioUtils
|
|
8
|
-
|
|
9
|
-
export const ShowSelectView = (title, data, defaultValue, callback) => {
|
|
10
|
-
|
|
11
|
-
const renderSelectView = () => {
|
|
12
|
-
return (
|
|
13
|
-
<View
|
|
14
|
-
style={{
|
|
15
|
-
height: height - convertX(120),
|
|
16
|
-
backgroundColor: 'rgb(242, 242, 247)',
|
|
17
|
-
flexDirection: 'column',
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
<View style={{ marginHorizontal: convertX(16), marginVertical: convertX(40),shadow: {
|
|
21
|
-
shadowColor: '#000000',
|
|
22
|
-
shadowOpacity: 0.2,
|
|
23
|
-
shadowRadius: 8,
|
|
24
|
-
elevation:8,
|
|
25
|
-
shadowOffset: {
|
|
26
|
-
width: 0,
|
|
27
|
-
height: 4,
|
|
28
|
-
},
|
|
29
|
-
backgroundColor: '#fff',
|
|
30
|
-
borderRadius: 8,
|
|
31
|
-
}, }}>
|
|
32
|
-
{
|
|
33
|
-
data.map((item, index) => {
|
|
34
|
-
if (index === 0) {
|
|
35
|
-
return (
|
|
36
|
-
<View key={item?.id}>
|
|
37
|
-
{renderItemView(item, () => {
|
|
38
|
-
Popup.close()
|
|
39
|
-
callback(item)
|
|
40
|
-
})}
|
|
41
|
-
</View>
|
|
42
|
-
)
|
|
43
|
-
} else {
|
|
44
|
-
return (
|
|
45
|
-
<View key={item?.id}>
|
|
46
|
-
{renderLineView()}
|
|
47
|
-
{renderItemView(item, () => {
|
|
48
|
-
Popup.close()
|
|
49
|
-
callback(item)
|
|
50
|
-
})}
|
|
51
|
-
</View>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
</View>
|
|
57
|
-
</View>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const renderItemView = ({ title }, onPress) => {
|
|
62
|
-
return (<TouchableOpacity
|
|
63
|
-
style={{
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
justifyContent: 'space-between',
|
|
66
|
-
// flex: 1,
|
|
67
|
-
flexDirection: 'row',
|
|
68
|
-
height: convertX(44),
|
|
69
|
-
paddingHorizontal: convertX(12)
|
|
70
|
-
}}
|
|
71
|
-
onPress={() => { if (defaultValue !== title) onPress() }}
|
|
72
|
-
>
|
|
73
|
-
<View>
|
|
74
|
-
<Text
|
|
75
|
-
style={{
|
|
76
|
-
fontSize: convertX(17),
|
|
77
|
-
color: '#000',
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
{title}
|
|
81
|
-
</Text>
|
|
82
|
-
</View>
|
|
83
|
-
{defaultValue === title &&
|
|
84
|
-
<Image
|
|
85
|
-
style={{ width: convertX(16), height: convertX(16) }}
|
|
86
|
-
source={Img.app_music_check}
|
|
87
|
-
resizeMode="contain"
|
|
88
|
-
/>}
|
|
89
|
-
</TouchableOpacity>)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const renderLineView = () => {
|
|
93
|
-
return (<View
|
|
94
|
-
style={{
|
|
95
|
-
height: convertX(1),
|
|
96
|
-
backgroundColor: 'rgba(60, 60, 67, 0.36)',
|
|
97
|
-
marginLeft: convertX(12)
|
|
98
|
-
}}
|
|
99
|
-
></View>)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const titleNode = () => {
|
|
103
|
-
return (
|
|
104
|
-
<View style={{ flexDirection: 'row', position: 'relative', height: convertX(81) }}>
|
|
105
|
-
<TouchableOpacity
|
|
106
|
-
style={{
|
|
107
|
-
position: 'absolute',
|
|
108
|
-
left: convertX(16),
|
|
109
|
-
bottom: convertX(12),
|
|
110
|
-
zIndex: 1
|
|
111
|
-
}}
|
|
112
|
-
onPress={() => Popup.close()}
|
|
113
|
-
>
|
|
114
|
-
<Text
|
|
115
|
-
style={{
|
|
116
|
-
fontSize: convertX(17),
|
|
117
|
-
color: '#FF6600',
|
|
118
|
-
}}
|
|
119
|
-
>
|
|
120
|
-
{Strings.getLang('auto_scan_system_cancel')}
|
|
121
|
-
</Text>
|
|
122
|
-
</TouchableOpacity>
|
|
123
|
-
<View style={{ flexDirection: 'column-reverse', flex: 1, alignItems: 'center' }}>
|
|
124
|
-
<Text style={{
|
|
125
|
-
fontSize: convertX(17),
|
|
126
|
-
fontWeight: 'bold',
|
|
127
|
-
color: '#000000',
|
|
128
|
-
paddingBottom: convertX(12)
|
|
129
|
-
}}>{title}</Text>
|
|
130
|
-
</View>
|
|
131
|
-
</View>
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
Popup.custom({
|
|
136
|
-
content: renderSelectView(),
|
|
137
|
-
title: titleNode(),
|
|
138
|
-
titleTextStyle: {
|
|
139
|
-
color: '#f60',
|
|
140
|
-
fontWeight: 'bold',
|
|
141
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
142
|
-
height: convertX(91),
|
|
143
|
-
},
|
|
144
|
-
footer: null,
|
|
145
|
-
footerWrapperStyle: {
|
|
146
|
-
display: 'none'
|
|
147
|
-
},
|
|
148
|
-
cancelText: '',
|
|
149
|
-
confirmText: '',
|
|
150
|
-
onMaskPress: ({ close }) => {
|
|
151
|
-
close()
|
|
152
|
-
},
|
|
153
|
-
onConfirm: () => {
|
|
154
|
-
Popup.close()
|
|
155
|
-
},
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, Text, TouchableOpacity, Image } from 'react-native'
|
|
3
|
+
import { Utils, Popup } from 'tuya-panel-kit'
|
|
4
|
+
import Img from 'res'
|
|
5
|
+
import Strings from '@i18n'
|
|
6
|
+
|
|
7
|
+
const { convertX, height } = Utils.RatioUtils
|
|
8
|
+
|
|
9
|
+
export const ShowSelectView = (title, data, defaultValue, callback) => {
|
|
10
|
+
|
|
11
|
+
const renderSelectView = () => {
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
style={{
|
|
15
|
+
height: height - convertX(120),
|
|
16
|
+
backgroundColor: 'rgb(242, 242, 247)',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<View style={{ marginHorizontal: convertX(16), marginVertical: convertX(40),shadow: {
|
|
21
|
+
shadowColor: '#000000',
|
|
22
|
+
shadowOpacity: 0.2,
|
|
23
|
+
shadowRadius: 8,
|
|
24
|
+
elevation:8,
|
|
25
|
+
shadowOffset: {
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 4,
|
|
28
|
+
},
|
|
29
|
+
backgroundColor: '#fff',
|
|
30
|
+
borderRadius: 8,
|
|
31
|
+
}, }}>
|
|
32
|
+
{
|
|
33
|
+
data.map((item, index) => {
|
|
34
|
+
if (index === 0) {
|
|
35
|
+
return (
|
|
36
|
+
<View key={item?.id}>
|
|
37
|
+
{renderItemView(item, () => {
|
|
38
|
+
Popup.close()
|
|
39
|
+
callback(item)
|
|
40
|
+
})}
|
|
41
|
+
</View>
|
|
42
|
+
)
|
|
43
|
+
} else {
|
|
44
|
+
return (
|
|
45
|
+
<View key={item?.id}>
|
|
46
|
+
{renderLineView()}
|
|
47
|
+
{renderItemView(item, () => {
|
|
48
|
+
Popup.close()
|
|
49
|
+
callback(item)
|
|
50
|
+
})}
|
|
51
|
+
</View>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
</View>
|
|
57
|
+
</View>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const renderItemView = ({ title }, onPress) => {
|
|
62
|
+
return (<TouchableOpacity
|
|
63
|
+
style={{
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
// flex: 1,
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
height: convertX(44),
|
|
69
|
+
paddingHorizontal: convertX(12)
|
|
70
|
+
}}
|
|
71
|
+
onPress={() => { if (defaultValue !== title) onPress() }}
|
|
72
|
+
>
|
|
73
|
+
<View>
|
|
74
|
+
<Text
|
|
75
|
+
style={{
|
|
76
|
+
fontSize: convertX(17),
|
|
77
|
+
color: '#000',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{title}
|
|
81
|
+
</Text>
|
|
82
|
+
</View>
|
|
83
|
+
{defaultValue === title &&
|
|
84
|
+
<Image
|
|
85
|
+
style={{ width: convertX(16), height: convertX(16) }}
|
|
86
|
+
source={Img.app_music_check}
|
|
87
|
+
resizeMode="contain"
|
|
88
|
+
/>}
|
|
89
|
+
</TouchableOpacity>)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const renderLineView = () => {
|
|
93
|
+
return (<View
|
|
94
|
+
style={{
|
|
95
|
+
height: convertX(1),
|
|
96
|
+
backgroundColor: 'rgba(60, 60, 67, 0.36)',
|
|
97
|
+
marginLeft: convertX(12)
|
|
98
|
+
}}
|
|
99
|
+
></View>)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const titleNode = () => {
|
|
103
|
+
return (
|
|
104
|
+
<View style={{ flexDirection: 'row', position: 'relative', height: convertX(81) }}>
|
|
105
|
+
<TouchableOpacity
|
|
106
|
+
style={{
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
left: convertX(16),
|
|
109
|
+
bottom: convertX(12),
|
|
110
|
+
zIndex: 1
|
|
111
|
+
}}
|
|
112
|
+
onPress={() => Popup.close()}
|
|
113
|
+
>
|
|
114
|
+
<Text
|
|
115
|
+
style={{
|
|
116
|
+
fontSize: convertX(17),
|
|
117
|
+
color: '#FF6600',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{Strings.getLang('auto_scan_system_cancel')}
|
|
121
|
+
</Text>
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
<View style={{ flexDirection: 'column-reverse', flex: 1, alignItems: 'center' }}>
|
|
124
|
+
<Text style={{
|
|
125
|
+
fontSize: convertX(17),
|
|
126
|
+
fontWeight: 'bold',
|
|
127
|
+
color: '#000000',
|
|
128
|
+
paddingBottom: convertX(12)
|
|
129
|
+
}}>{title}</Text>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
Popup.custom({
|
|
136
|
+
content: renderSelectView(),
|
|
137
|
+
title: titleNode(),
|
|
138
|
+
titleTextStyle: {
|
|
139
|
+
color: '#f60',
|
|
140
|
+
fontWeight: 'bold',
|
|
141
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
142
|
+
height: convertX(91),
|
|
143
|
+
},
|
|
144
|
+
footer: null,
|
|
145
|
+
footerWrapperStyle: {
|
|
146
|
+
display: 'none'
|
|
147
|
+
},
|
|
148
|
+
cancelText: '',
|
|
149
|
+
confirmText: '',
|
|
150
|
+
onMaskPress: ({ close }) => {
|
|
151
|
+
close()
|
|
152
|
+
},
|
|
153
|
+
onConfirm: () => {
|
|
154
|
+
Popup.close()
|
|
155
|
+
},
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
|
|
159
159
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { ViewProps } from "react-native";
|
|
3
|
-
interface SocketItemProps extends PropsWithChildren<ViewProps> {
|
|
4
|
-
title: string;
|
|
5
|
-
name: string;
|
|
6
|
-
icon: any;
|
|
7
|
-
disabledEdit?: boolean;
|
|
8
|
-
onNameChange: (value: string) => void;
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
onSwitchChange: (value: boolean) => void;
|
|
11
|
-
}
|
|
12
|
-
declare function SocketItem(props: SocketItemProps): JSX.Element;
|
|
13
|
-
export default SocketItem;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { ViewProps } from "react-native";
|
|
3
|
+
interface SocketItemProps extends PropsWithChildren<ViewProps> {
|
|
4
|
+
title: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: any;
|
|
7
|
+
disabledEdit?: boolean;
|
|
8
|
+
onNameChange: (value: string) => void;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
onSwitchChange: (value: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function SocketItem(props: SocketItemProps): JSX.Element;
|
|
13
|
+
export default SocketItem;
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { View, Image, StyleSheet, Text, TouchableOpacity, ViewProps } from "react-native";
|
|
3
|
-
import Card from "@ledvance/base/src/components/Card";
|
|
4
|
-
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
5
|
-
import { Dialog, SwitchButton, Utils } from "tuya-panel-kit";
|
|
6
|
-
import I18n from "@ledvance/base/src/i18n";
|
|
7
|
-
|
|
8
|
-
const cx = Utils.RatioUtils.convertX
|
|
9
|
-
|
|
10
|
-
interface SocketItemProps extends PropsWithChildren<ViewProps>{
|
|
11
|
-
title: string
|
|
12
|
-
name: string
|
|
13
|
-
icon: any
|
|
14
|
-
disabledEdit?: boolean
|
|
15
|
-
onNameChange: (value: string) => void
|
|
16
|
-
enabled: boolean
|
|
17
|
-
onSwitchChange: (value: boolean) => void
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function SocketItem(props: SocketItemProps) {
|
|
21
|
-
return (
|
|
22
|
-
<Card style={{ marginHorizontal: cx(24) }}>
|
|
23
|
-
<View>
|
|
24
|
-
<Spacer />
|
|
25
|
-
<View style={styles.switchLine}>
|
|
26
|
-
<Text style={styles.title}>{props.title}</Text>
|
|
27
|
-
<Spacer height={0} width={cx(12)} />
|
|
28
|
-
<Image style={styles.icon} source={props.icon} />
|
|
29
|
-
<Spacer style={{ flex: 1 }} />
|
|
30
|
-
<SwitchButton
|
|
31
|
-
value={props.enabled}
|
|
32
|
-
onValueChange={props.onSwitchChange} />
|
|
33
|
-
</View>
|
|
34
|
-
<TouchableOpacity
|
|
35
|
-
style={styles.nameLine}
|
|
36
|
-
onPress={() => {
|
|
37
|
-
if(props.disabledEdit) return
|
|
38
|
-
Dialog.prompt({
|
|
39
|
-
title: I18n.getLang('routines_add_edit_name'),
|
|
40
|
-
value: props.name,
|
|
41
|
-
cancelText: I18n.getLang('auto_scan_system_cancel'),
|
|
42
|
-
confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
|
|
43
|
-
onChangeText: text => {
|
|
44
|
-
return text.length <= 32 ? text : text.slice(0, 32)
|
|
45
|
-
},
|
|
46
|
-
onConfirm: (text, { close }) => {
|
|
47
|
-
props.onNameChange(text)
|
|
48
|
-
close()
|
|
49
|
-
},
|
|
50
|
-
})
|
|
51
|
-
}}>
|
|
52
|
-
<Text style={styles.name}>{props.name}</Text>
|
|
53
|
-
</TouchableOpacity>
|
|
54
|
-
<Spacer height={cx(16)} />
|
|
55
|
-
{props.children}
|
|
56
|
-
</View>
|
|
57
|
-
</Card>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const styles = StyleSheet.create({
|
|
62
|
-
switchLine: {
|
|
63
|
-
flexDirection: 'row',
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
marginHorizontal: cx(16),
|
|
66
|
-
},
|
|
67
|
-
title: {
|
|
68
|
-
fontSize: cx(16),
|
|
69
|
-
color: '#000',
|
|
70
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
71
|
-
fontWeight: 'bold',
|
|
72
|
-
},
|
|
73
|
-
icon: {
|
|
74
|
-
width: cx(60),
|
|
75
|
-
height: cx(20),
|
|
76
|
-
},
|
|
77
|
-
nameLine: {
|
|
78
|
-
flex: 1,
|
|
79
|
-
marginHorizontal: cx(16),
|
|
80
|
-
},
|
|
81
|
-
name: {
|
|
82
|
-
fontSize: cx(14),
|
|
83
|
-
color: '#000',
|
|
84
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
85
|
-
},
|
|
86
|
-
})
|
|
87
|
-
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { View, Image, StyleSheet, Text, TouchableOpacity, ViewProps } from "react-native";
|
|
3
|
+
import Card from "@ledvance/base/src/components/Card";
|
|
4
|
+
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
5
|
+
import { Dialog, SwitchButton, Utils } from "tuya-panel-kit";
|
|
6
|
+
import I18n from "@ledvance/base/src/i18n";
|
|
7
|
+
|
|
8
|
+
const cx = Utils.RatioUtils.convertX
|
|
9
|
+
|
|
10
|
+
interface SocketItemProps extends PropsWithChildren<ViewProps>{
|
|
11
|
+
title: string
|
|
12
|
+
name: string
|
|
13
|
+
icon: any
|
|
14
|
+
disabledEdit?: boolean
|
|
15
|
+
onNameChange: (value: string) => void
|
|
16
|
+
enabled: boolean
|
|
17
|
+
onSwitchChange: (value: boolean) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SocketItem(props: SocketItemProps) {
|
|
21
|
+
return (
|
|
22
|
+
<Card style={{ marginHorizontal: cx(24) }}>
|
|
23
|
+
<View>
|
|
24
|
+
<Spacer />
|
|
25
|
+
<View style={styles.switchLine}>
|
|
26
|
+
<Text style={styles.title}>{props.title}</Text>
|
|
27
|
+
<Spacer height={0} width={cx(12)} />
|
|
28
|
+
<Image style={styles.icon} source={props.icon} />
|
|
29
|
+
<Spacer style={{ flex: 1 }} />
|
|
30
|
+
<SwitchButton
|
|
31
|
+
value={props.enabled}
|
|
32
|
+
onValueChange={props.onSwitchChange} />
|
|
33
|
+
</View>
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
style={styles.nameLine}
|
|
36
|
+
onPress={() => {
|
|
37
|
+
if(props.disabledEdit) return
|
|
38
|
+
Dialog.prompt({
|
|
39
|
+
title: I18n.getLang('routines_add_edit_name'),
|
|
40
|
+
value: props.name,
|
|
41
|
+
cancelText: I18n.getLang('auto_scan_system_cancel'),
|
|
42
|
+
confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
|
|
43
|
+
onChangeText: text => {
|
|
44
|
+
return text.length <= 32 ? text : text.slice(0, 32)
|
|
45
|
+
},
|
|
46
|
+
onConfirm: (text, { close }) => {
|
|
47
|
+
props.onNameChange(text)
|
|
48
|
+
close()
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
}}>
|
|
52
|
+
<Text style={styles.name}>{props.name}</Text>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
<Spacer height={cx(16)} />
|
|
55
|
+
{props.children}
|
|
56
|
+
</View>
|
|
57
|
+
</Card>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
switchLine: {
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
marginHorizontal: cx(16),
|
|
66
|
+
},
|
|
67
|
+
title: {
|
|
68
|
+
fontSize: cx(16),
|
|
69
|
+
color: '#000',
|
|
70
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
71
|
+
fontWeight: 'bold',
|
|
72
|
+
},
|
|
73
|
+
icon: {
|
|
74
|
+
width: cx(60),
|
|
75
|
+
height: cx(20),
|
|
76
|
+
},
|
|
77
|
+
nameLine: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
marginHorizontal: cx(16),
|
|
80
|
+
},
|
|
81
|
+
name: {
|
|
82
|
+
fontSize: cx(14),
|
|
83
|
+
color: '#000',
|
|
84
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
88
88
|
export default SocketItem
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ViewProps } from 'react-native';
|
|
2
|
-
interface SpacerProps extends ViewProps {
|
|
3
|
-
width?: number;
|
|
4
|
-
height?: number;
|
|
5
|
-
}
|
|
6
|
-
export default function Spacer(props: SpacerProps): JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
interface SpacerProps extends ViewProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
}
|
|
6
|
+
export default function Spacer(props: SpacerProps): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {View, ViewProps} from 'react-native'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import {Utils} from 'tuya-panel-kit'
|
|
4
|
-
|
|
5
|
-
const cx = Utils.RatioUtils.convertX
|
|
6
|
-
|
|
7
|
-
interface SpacerProps extends ViewProps {
|
|
8
|
-
width?: number
|
|
9
|
-
height?: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function Spacer(props: SpacerProps) {
|
|
13
|
-
return <View style={[{width: props.width, height: props.height || cx(20)}, props.style]}/>
|
|
1
|
+
import {View, ViewProps} from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {Utils} from 'tuya-panel-kit'
|
|
4
|
+
|
|
5
|
+
const cx = Utils.RatioUtils.convertX
|
|
6
|
+
|
|
7
|
+
interface SpacerProps extends ViewProps {
|
|
8
|
+
width?: number
|
|
9
|
+
height?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function Spacer(props: SpacerProps) {
|
|
13
|
+
return <View style={[{width: props.width, height: props.height || cx(20)}, props.style]}/>
|
|
14
14
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
export interface StepperProps {
|
|
4
|
-
value: number | string;
|
|
5
|
-
stepValue?: number;
|
|
6
|
-
min?: number;
|
|
7
|
-
max?: number;
|
|
8
|
-
editable?: boolean;
|
|
9
|
-
selectionColor?: string;
|
|
10
|
-
isRealTime?: boolean;
|
|
11
|
-
isBeyond?: boolean;
|
|
12
|
-
onValueChange?: ((value: number) => void);
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
style?: StyleProp<ViewStyle>;
|
|
15
|
-
buttonStyle?: StyleProp<ViewStyle>;
|
|
16
|
-
inputStyle?: StyleProp<ViewStyle>;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: React.MemoExoticComponent<(props: StepperProps) => JSX.Element>;
|
|
19
|
-
export default _default;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
export interface StepperProps {
|
|
4
|
+
value: number | string;
|
|
5
|
+
stepValue?: number;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
selectionColor?: string;
|
|
10
|
+
isRealTime?: boolean;
|
|
11
|
+
isBeyond?: boolean;
|
|
12
|
+
onValueChange?: ((value: number) => void);
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
buttonStyle?: StyleProp<ViewStyle>;
|
|
16
|
+
inputStyle?: StyleProp<ViewStyle>;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: React.MemoExoticComponent<(props: StepperProps) => JSX.Element>;
|
|
19
|
+
export default _default;
|