@ledvance/ui-biz-bundle 1.1.90 → 1.1.92
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/modules/flags/FlagEditPage.tsx +180 -179
- package/src/modules/flags/FlagItem.tsx +26 -42
- package/src/modules/flags/FlagPage.tsx +27 -26
- package/src/modules/history/HistoryPage.tsx +111 -103
- package/src/modules/music/MusicPage.tsx +90 -88
- package/src/modules/timer/TimerPage.tsx +13 -9
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +54 -54
- package/src/newModules/biorhythm/BiorhythmPage.tsx +163 -162
- package/src/newModules/biorhythm/IconSelect.tsx +5 -4
- package/src/newModules/childLock/ChildLockPage.tsx +49 -47
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +127 -124
- package/src/newModules/fixedTime/FixedTimePage.tsx +108 -104
- package/src/newModules/lightMode/LightModePage.tsx +74 -67
- package/src/newModules/mood/AddMoodPage.tsx +18 -15
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +103 -100
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +107 -104
- package/src/newModules/mood/MoodItem.tsx +59 -55
- package/src/newModules/mood/MoodPage.tsx +58 -57
- package/src/newModules/mood/RecommendMoodItem.tsx +27 -24
- package/src/newModules/mood/StaticMoodEditorPage.tsx +77 -85
- package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +36 -48
- package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +137 -135
- package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +67 -61
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +114 -151
- package/src/newModules/randomTime/RandomTimePage.tsx +110 -105
- package/src/newModules/randomTime/Summary.tsx +61 -57
- package/src/newModules/remoteControl/RemoteControlPage.tsx +4 -3
- package/src/newModules/select/SelectPage.tsx +65 -62
- package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +16 -8
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +131 -123
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +144 -140
- package/src/newModules/switchGradient/SwitchGradientPage.tsx +24 -25
- package/src/newModules/swithInching/SwithInching.tsx +154 -152
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +83 -83
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +3 -2
- package/src/newModules/swithInching/pickerView.tsx +0 -91
|
@@ -7,8 +7,10 @@ import Spacer from "@ledvance/base/src/components/Spacer";
|
|
|
7
7
|
import InfoText from "@ledvance/base/src/components/InfoText";
|
|
8
8
|
|
|
9
9
|
const { convertX: cx } = Utils.RatioUtils;
|
|
10
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
11
|
|
|
11
12
|
interface SummaryProps {
|
|
13
|
+
theme?: any
|
|
12
14
|
style?: ViewStyle
|
|
13
15
|
frequency?: string | ReactElement
|
|
14
16
|
time?: string | ReactElement
|
|
@@ -17,6 +19,54 @@ interface SummaryProps {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
const Summary = (props: SummaryProps) => {
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
cardContainer: {
|
|
25
|
+
marginHorizontal: cx(24),
|
|
26
|
+
},
|
|
27
|
+
itemTitle: {
|
|
28
|
+
color: props.theme.global.fontColor,
|
|
29
|
+
fontSize: cx(16),
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
32
|
+
},
|
|
33
|
+
summaryContainer: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
marginBottom: cx(10),
|
|
37
|
+
},
|
|
38
|
+
summaryLeft: {
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
minWidth: cx(100)
|
|
42
|
+
},
|
|
43
|
+
summaryImg: {
|
|
44
|
+
tintColor: props.theme.global.fontColor,
|
|
45
|
+
width: cx(12),
|
|
46
|
+
height: cx(12),
|
|
47
|
+
marginRight: cx(6)
|
|
48
|
+
},
|
|
49
|
+
leftTitle: {
|
|
50
|
+
fontSize: cx(14),
|
|
51
|
+
color: props.theme.global.fontColor,
|
|
52
|
+
},
|
|
53
|
+
summaryRight: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
marginLeft: cx(15),
|
|
57
|
+
marginTop: cx(5)
|
|
58
|
+
},
|
|
59
|
+
rightWrap: {
|
|
60
|
+
borderRadius: cx(16),
|
|
61
|
+
paddingHorizontal: cx(12),
|
|
62
|
+
alignSelf: 'flex-start',
|
|
63
|
+
backgroundColor: props.theme.tag.background,
|
|
64
|
+
},
|
|
65
|
+
rightItem: {
|
|
66
|
+
color: props.theme.tag.fontColor,
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
20
70
|
return (
|
|
21
71
|
<View style={styles.cardContainer}>
|
|
22
72
|
<Text style={styles.itemTitle}>{I18n.getLang('add_sleepschedule_one_source_subheadline4_text')}</Text>
|
|
@@ -51,66 +101,20 @@ const Summary = (props: SummaryProps) => {
|
|
|
51
101
|
</View>
|
|
52
102
|
</View>
|
|
53
103
|
{!props.hideActions && <View style={[styles.summaryContainer, { alignItems: 'flex-start' }]}>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
104
|
+
<InfoText
|
|
105
|
+
icon={res.summary_icon3}
|
|
106
|
+
text={I18n.getLang('motion_detection_add_time_schedule_actions_text1')}
|
|
107
|
+
iconStyle={styles.summaryImg}
|
|
108
|
+
textStyle={styles.leftTitle}
|
|
109
|
+
style={styles.summaryLeft}
|
|
110
|
+
/>
|
|
111
|
+
<View style={styles.summaryRight}>
|
|
112
|
+
{props.actions}
|
|
113
|
+
</View>
|
|
64
114
|
</View>}
|
|
65
115
|
</View>
|
|
66
116
|
</View>
|
|
67
117
|
)
|
|
68
118
|
}
|
|
69
119
|
|
|
70
|
-
|
|
71
|
-
cardContainer: {
|
|
72
|
-
marginHorizontal: cx(24),
|
|
73
|
-
},
|
|
74
|
-
itemTitle: {
|
|
75
|
-
color: '#000',
|
|
76
|
-
fontSize: cx(16),
|
|
77
|
-
fontWeight: 'bold',
|
|
78
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
79
|
-
},
|
|
80
|
-
summaryContainer: {
|
|
81
|
-
flex: 1,
|
|
82
|
-
flexDirection: 'row',
|
|
83
|
-
marginBottom: cx(10),
|
|
84
|
-
},
|
|
85
|
-
summaryLeft: {
|
|
86
|
-
flexDirection: 'row',
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
minWidth: cx(100)
|
|
89
|
-
},
|
|
90
|
-
summaryImg: {
|
|
91
|
-
width: cx(12),
|
|
92
|
-
height: cx(12),
|
|
93
|
-
marginRight: cx(6)
|
|
94
|
-
},
|
|
95
|
-
leftTitle: {
|
|
96
|
-
fontSize: cx(14),
|
|
97
|
-
color: '#000'
|
|
98
|
-
},
|
|
99
|
-
summaryRight: {
|
|
100
|
-
flex: 1,
|
|
101
|
-
flexDirection: 'column',
|
|
102
|
-
marginLeft: cx(15),
|
|
103
|
-
marginTop: cx(5)
|
|
104
|
-
},
|
|
105
|
-
rightWrap: {
|
|
106
|
-
borderRadius: cx(16),
|
|
107
|
-
paddingHorizontal: cx(12),
|
|
108
|
-
alignSelf: 'flex-start',
|
|
109
|
-
backgroundColor: '#cbcbcb',
|
|
110
|
-
},
|
|
111
|
-
rightItem: {
|
|
112
|
-
color: '#000',
|
|
113
|
-
},
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
export default memo(Summary)
|
|
120
|
+
export default memo(withTheme(Summary))
|
|
@@ -12,11 +12,12 @@ import { Utils } from 'tuya-panel-kit'
|
|
|
12
12
|
import {showDialog} from "@ledvance/base/src/utils/common";
|
|
13
13
|
|
|
14
14
|
const { convertX: cx } = Utils.RatioUtils
|
|
15
|
+
const { withTheme } = Utils.ThemeUtils
|
|
15
16
|
|
|
16
17
|
export interface RemoteControlPageParams {
|
|
17
18
|
remoteControlDpCode: string;
|
|
18
19
|
}
|
|
19
|
-
const RemoteControlPage = () => {
|
|
20
|
+
const RemoteControlPage = (props: { theme?: any }) => {
|
|
20
21
|
const deviceInfo = useDeviceInfo();
|
|
21
22
|
const params = useParams<RemoteControlPageParams>();
|
|
22
23
|
const [remoteControl, setRemoteControl] = useRemoteControl(params.remoteControlDpCode);
|
|
@@ -35,7 +36,7 @@ const RemoteControlPage = () => {
|
|
|
35
36
|
<Card style={{marginHorizontal: cx(24)}}>
|
|
36
37
|
<LdvSwitch
|
|
37
38
|
title={I18n.getLang('light_sources_specific_settings_remote_control')}
|
|
38
|
-
color=
|
|
39
|
+
color={props.theme.card.background}
|
|
39
40
|
colorAlpha={1}
|
|
40
41
|
enable={remoteControl}
|
|
41
42
|
setEnable={async v => {
|
|
@@ -66,4 +67,4 @@ const RemoteControlPage = () => {
|
|
|
66
67
|
);
|
|
67
68
|
};
|
|
68
69
|
|
|
69
|
-
export default RemoteControlPage
|
|
70
|
+
export default withTheme(RemoteControlPage)
|
|
@@ -8,6 +8,7 @@ import Card from '@ledvance/base/src/components/Card'
|
|
|
8
8
|
import res from '@ledvance/base/src/res'
|
|
9
9
|
|
|
10
10
|
const cx = Utils.RatioUtils.convertX
|
|
11
|
+
const { withTheme } = Utils.ThemeUtils
|
|
11
12
|
|
|
12
13
|
export interface SelectPageData<T> {
|
|
13
14
|
text: string
|
|
@@ -21,9 +22,71 @@ export interface SelectPageParams<T> {
|
|
|
21
22
|
onSelect: (selectPageData: SelectPageData<T>) => void
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const SelectPage = () => {
|
|
25
|
+
const SelectPage = (props: { theme?: any }) => {
|
|
25
26
|
const params = useRoute().params as SelectPageParams<any>
|
|
26
27
|
const navigation = useNavigation()
|
|
28
|
+
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
root: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
topBar: {
|
|
34
|
+
backgroundColor: props.theme.card.head,
|
|
35
|
+
},
|
|
36
|
+
line: {
|
|
37
|
+
height: cx(1),
|
|
38
|
+
backgroundColor: props.theme.container.divider,
|
|
39
|
+
},
|
|
40
|
+
topContent: {
|
|
41
|
+
paddingVertical: cx(30),
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
},
|
|
45
|
+
cancel: {
|
|
46
|
+
marginStart: cx(16),
|
|
47
|
+
color: props.theme.button.cancel,
|
|
48
|
+
fontSize: cx(17),
|
|
49
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
50
|
+
},
|
|
51
|
+
title: {
|
|
52
|
+
width: '100%',
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
start: 0,
|
|
55
|
+
textAlign: 'center',
|
|
56
|
+
color: props.theme.global.fontColor,
|
|
57
|
+
fontSize: cx(17),
|
|
58
|
+
paddingHorizontal: cx(110),
|
|
59
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
60
|
+
},
|
|
61
|
+
card: {
|
|
62
|
+
backgroundColor: props.theme.card.background,
|
|
63
|
+
marginHorizontal: cx(16),
|
|
64
|
+
},
|
|
65
|
+
item: {
|
|
66
|
+
height: cx(44),
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
},
|
|
70
|
+
itemText: {
|
|
71
|
+
flex: 1,
|
|
72
|
+
marginStart: cx(13),
|
|
73
|
+
color: props.theme.global.fontColor,
|
|
74
|
+
fontSize: cx(17),
|
|
75
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
76
|
+
},
|
|
77
|
+
itemLine: {
|
|
78
|
+
height: cx(1),
|
|
79
|
+
marginStart: cx(13),
|
|
80
|
+
backgroundColor: props.theme.container.divider,
|
|
81
|
+
},
|
|
82
|
+
itemIcon: {
|
|
83
|
+
width: cx(30),
|
|
84
|
+
height: cx(30),
|
|
85
|
+
marginEnd: cx(13),
|
|
86
|
+
tintColor: props.theme.icon.primary,
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
|
|
27
90
|
return (
|
|
28
91
|
<View style={styles.root}>
|
|
29
92
|
<View style={styles.topBar}>
|
|
@@ -75,64 +138,4 @@ const SelectPage = () => {
|
|
|
75
138
|
)
|
|
76
139
|
}
|
|
77
140
|
|
|
78
|
-
|
|
79
|
-
root: {
|
|
80
|
-
flex: 1,
|
|
81
|
-
},
|
|
82
|
-
topBar: {
|
|
83
|
-
backgroundColor: '#eaeaea',
|
|
84
|
-
},
|
|
85
|
-
line: {
|
|
86
|
-
height: cx(1),
|
|
87
|
-
backgroundColor: '#d9d9d9',
|
|
88
|
-
},
|
|
89
|
-
topContent: {
|
|
90
|
-
paddingVertical: cx(30),
|
|
91
|
-
flexDirection: 'row',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
},
|
|
94
|
-
cancel: {
|
|
95
|
-
marginStart: cx(16),
|
|
96
|
-
color: '#f60',
|
|
97
|
-
fontSize: cx(17),
|
|
98
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
99
|
-
},
|
|
100
|
-
title: {
|
|
101
|
-
width: '100%',
|
|
102
|
-
position: 'absolute',
|
|
103
|
-
start: 0,
|
|
104
|
-
textAlign: 'center',
|
|
105
|
-
color: '#000',
|
|
106
|
-
fontSize: cx(17),
|
|
107
|
-
paddingHorizontal: cx(110),
|
|
108
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
109
|
-
},
|
|
110
|
-
card: {
|
|
111
|
-
marginHorizontal: cx(16),
|
|
112
|
-
},
|
|
113
|
-
item: {
|
|
114
|
-
height: cx(44),
|
|
115
|
-
flexDirection: 'row',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
},
|
|
118
|
-
itemText: {
|
|
119
|
-
flex: 1,
|
|
120
|
-
marginStart: cx(13),
|
|
121
|
-
color: '#000',
|
|
122
|
-
fontSize: cx(17),
|
|
123
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
124
|
-
},
|
|
125
|
-
itemLine: {
|
|
126
|
-
height: cx(1),
|
|
127
|
-
marginStart: cx(13),
|
|
128
|
-
backgroundColor: '#ccc',
|
|
129
|
-
},
|
|
130
|
-
itemIcon: {
|
|
131
|
-
width: cx(30),
|
|
132
|
-
height: cx(30),
|
|
133
|
-
marginEnd: cx(13),
|
|
134
|
-
tintColor: '#f60',
|
|
135
|
-
},
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
export default SelectPage
|
|
141
|
+
export default withTheme(SelectPage)
|
|
@@ -154,8 +154,10 @@ const wakeUpObj2Dp = (wakeUp: WakeUpData) => {
|
|
|
154
154
|
const weeksValue = padStart([...node.weeks].reverse().join(''), 8, '0')
|
|
155
155
|
const weeksHex = to16(parseInt(weeksValue, 2), 2)
|
|
156
156
|
const delayHex = to16(node.delay)
|
|
157
|
-
const
|
|
158
|
-
const
|
|
157
|
+
const hour = Math.trunc(node.time / 60)
|
|
158
|
+
const min = node.time % 60
|
|
159
|
+
const hourHex = to16(hour)
|
|
160
|
+
const minuteHex = to16(min)
|
|
159
161
|
const hString = node.h.toString().padStart(4, '0')
|
|
160
162
|
const h = to16(Number(hString.slice(0, 2))) + to16(Number(hString.slice(2, 4)))
|
|
161
163
|
const s = to16(node.s)
|
|
@@ -175,8 +177,10 @@ export const wakeUpNode2Dp = (node: WakeUpItem) =>{
|
|
|
175
177
|
const weeksValue = padStart([...cloneWeek].join(''), 8, '0')
|
|
176
178
|
const weeksHex = to16(parseInt(weeksValue, 2), 2)
|
|
177
179
|
const delayHex = to16(node.delay)
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
+
const hour = Math.trunc(node.time / 60)
|
|
181
|
+
const min = node.time % 60
|
|
182
|
+
const hourHex = to16(hour)
|
|
183
|
+
const minuteHex = to16(min)
|
|
180
184
|
const hString = node.h.toString().padStart(4, '0')
|
|
181
185
|
const h = to16(Number(hString.slice(0, 2))) + to16(Number(hString.slice(2, 4)))
|
|
182
186
|
const s = to16(node.s)
|
|
@@ -300,8 +304,10 @@ export const sleepObj2Dp = (sleep: SleepData) => {
|
|
|
300
304
|
const weeksValue = padStart([...node.weeks].reverse().join(''), 8, '0')
|
|
301
305
|
const weeksHex = to16(parseInt(weeksValue, 2), 2)
|
|
302
306
|
const delayHex = to16(node.delay)
|
|
303
|
-
const
|
|
304
|
-
const
|
|
307
|
+
const hour = Math.trunc(node.time / 60)
|
|
308
|
+
const min = node.time % 60
|
|
309
|
+
const hourHex = to16(hour)
|
|
310
|
+
const minuteHex = to16(min)
|
|
305
311
|
const hString = node.h.toString().padStart(4, '0')
|
|
306
312
|
const h = to16(Number(hString.slice(0, 2))) + to16(Number(hString.slice(2, 4)))
|
|
307
313
|
const s = to16(node.s)
|
|
@@ -320,8 +326,10 @@ export const sleepNode2Dp = (node: SleepItem) => {
|
|
|
320
326
|
const weeksValue = padStart([...cloneWeek].join(''), 8, '0')
|
|
321
327
|
const weeksHex = to16(parseInt(weeksValue, 2), 2)
|
|
322
328
|
const delayHex = to16(node.delay)
|
|
323
|
-
const
|
|
324
|
-
const
|
|
329
|
+
const hour = Math.trunc(node.time / 60)
|
|
330
|
+
const min = node.time % 60
|
|
331
|
+
const hourHex = to16(hour)
|
|
332
|
+
const minuteHex = to16(min)
|
|
325
333
|
const hString = node.h.toString().padStart(4, '0')
|
|
326
334
|
const h = to16(Number(hString.slice(0, 2))) + to16(Number(hString.slice(2, 4)))
|
|
327
335
|
const s = to16(node.s)
|