@ledvance/group-ui-biz-bundle 1.0.73 → 1.0.76
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/biorhythm/BiorhythmDetailPage.tsx +1 -1
- package/src/modules/biorhythm/circular/Progress.tsx +2 -2
- package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
- package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +2 -2
- package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +1 -1
- package/src/modules/energyConsumption/component/Overview.tsx +1 -1
- package/src/modules/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +68 -87
- package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +44 -58
- package/src/modules/fixedTimeForPlug/ItemCard.tsx +29 -26
- package/src/modules/fixedTimeForPlug/Summary.tsx +62 -58
- package/src/modules/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +2 -2
- package/src/modules/lightMode/LightModePage.tsx +2 -2
- package/src/modules/mood_new/MoodInfo.ts +170 -18
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +8 -0
- package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +5 -2
- package/src/modules/randomTimeForPlug/ItemCard.tsx +29 -26
- package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +47 -82
- package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +58 -67
- package/src/modules/randomTimeForPlug/Summary.tsx +62 -58
- package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +2 -2
- package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +35 -28
- package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +1 -1
- package/src/modules/swithInching/SwithInching.tsx +3 -2
- package/src/modules/timeSchedule/Interface.ts +3 -1
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +175 -190
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +55 -54
- package/src/modules/timeSchedule/components/ManuaSettings.tsx +11 -10
- package/src/modules/timeSchedule/components/ScheduleCard.tsx +47 -63
- package/src/modules/timeSchedule/components/Summary.tsx +63 -59
- package/src/modules/timer/TimerAction.ts +22 -3
- package/src/modules/timer/TimerPage.tsx +120 -117
- package/src/modules/swithInching/pickerView.tsx +0 -91
|
@@ -18,12 +18,12 @@ import TextButton from '@ledvance/base/src/components/TextButton'
|
|
|
18
18
|
import { CircularProgress } from '@ledvance/base/src/components/CircularProgress'
|
|
19
19
|
|
|
20
20
|
const { convertX: cx } = Utils.RatioUtils
|
|
21
|
+
const { withTheme } = Utils.ThemeUtils
|
|
21
22
|
|
|
22
|
-
const TimerPage = () => {
|
|
23
|
+
const TimerPage = (props: { theme?: any }) => {
|
|
23
24
|
const devInfo = useDeviceInfo()
|
|
24
|
-
|
|
25
25
|
const params = useParams<TimerPageParams>()
|
|
26
|
-
const [timerTasks, setTimerTasks, changeTimerTasks] = useTimerTasks(params.timerSettableDps)
|
|
26
|
+
const [timerTasks, setTimerTasks, changeTimerTasks] = useTimerTasks(params.timerSettableDps, params.devIdGroup)
|
|
27
27
|
|
|
28
28
|
const state = useReactive({
|
|
29
29
|
hour: '00',
|
|
@@ -48,6 +48,119 @@ const TimerPage = () => {
|
|
|
48
48
|
const startedTasks = tasksByStatus[TaskStatus.Started] || []
|
|
49
49
|
const startEnable = selectedTasks.length > 0
|
|
50
50
|
|
|
51
|
+
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
root: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
},
|
|
56
|
+
content: {
|
|
57
|
+
marginHorizontal: cx(24),
|
|
58
|
+
},
|
|
59
|
+
applyFor: {
|
|
60
|
+
color: props.theme.global.fontColor,
|
|
61
|
+
fontSize: cx(16),
|
|
62
|
+
fontWeight: 'bold',
|
|
63
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
64
|
+
},
|
|
65
|
+
taskList: {
|
|
66
|
+
backgroundColor: props.theme.container.background,
|
|
67
|
+
paddingTop: cx(8),
|
|
68
|
+
borderRadius: cx(4),
|
|
69
|
+
},
|
|
70
|
+
taskItem: {
|
|
71
|
+
marginHorizontal: cx(8),
|
|
72
|
+
marginBottom: cx(8),
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
justifyContent: 'space-between',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
backgroundColor: props.theme.global.background,
|
|
77
|
+
},
|
|
78
|
+
taskItemText: {
|
|
79
|
+
color: props.theme.global.fontColor,
|
|
80
|
+
fontSize: 14,
|
|
81
|
+
marginHorizontal: cx(8),
|
|
82
|
+
marginVertical: cx(9),
|
|
83
|
+
},
|
|
84
|
+
taskItemIcon: {
|
|
85
|
+
tintColor: props.theme.global.fontColor,
|
|
86
|
+
width: cx(16),
|
|
87
|
+
height: cx(16),
|
|
88
|
+
marginRight: cx(8),
|
|
89
|
+
},
|
|
90
|
+
listEmptyView: {
|
|
91
|
+
marginHorizontal: cx(8),
|
|
92
|
+
marginTop: cx(6),
|
|
93
|
+
marginBottom: cx(14),
|
|
94
|
+
},
|
|
95
|
+
listEmptyText: {
|
|
96
|
+
color: props.theme.global.secondFontColor,
|
|
97
|
+
fontSize: cx(14),
|
|
98
|
+
},
|
|
99
|
+
noSelectTaskList: {},
|
|
100
|
+
noSelectTaskItem: {
|
|
101
|
+
height: cx(30),
|
|
102
|
+
flexDirection: 'row',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
},
|
|
105
|
+
noSelectTaskText: {
|
|
106
|
+
flex: 1,
|
|
107
|
+
color: props.theme.global.fontColor,
|
|
108
|
+
fontSize: cx(14),
|
|
109
|
+
},
|
|
110
|
+
activeTaskHeadLine: {
|
|
111
|
+
flexDirection: 'row',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
},
|
|
114
|
+
activeTaskHeadLineText: {
|
|
115
|
+
flex: 1,
|
|
116
|
+
color: props.theme.global.fontColor,
|
|
117
|
+
fontSize: cx(14),
|
|
118
|
+
},
|
|
119
|
+
activeTaskHeadLineBtn: {
|
|
120
|
+
minWidth: cx(50),
|
|
121
|
+
height: cx(24),
|
|
122
|
+
padding: 0,
|
|
123
|
+
backgroundColor: props.theme.button.cancel,
|
|
124
|
+
borderRadius: cx(4),
|
|
125
|
+
},
|
|
126
|
+
activeTaskHeadLineBtnText: {
|
|
127
|
+
color: props.theme.button.fontColor,
|
|
128
|
+
fontSize: cx(8.2),
|
|
129
|
+
},
|
|
130
|
+
activeTaskTimeText: {
|
|
131
|
+
flex: 1,
|
|
132
|
+
color: props.theme.global.secondFontColor,
|
|
133
|
+
fontSize: cx(24),
|
|
134
|
+
fontWeight: 'bold',
|
|
135
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
136
|
+
},
|
|
137
|
+
activeTaskDesc: {
|
|
138
|
+
flex: 1,
|
|
139
|
+
color: props.theme.global.secondFontColor,
|
|
140
|
+
fontSize: cx(14),
|
|
141
|
+
},
|
|
142
|
+
activeTasBtn: {
|
|
143
|
+
width: 'auto',
|
|
144
|
+
height: cx(36),
|
|
145
|
+
padding: 0,
|
|
146
|
+
backgroundColor: props.theme.button.cancel,
|
|
147
|
+
borderRadius: cx(4),
|
|
148
|
+
},
|
|
149
|
+
activeTaskBtnText: {
|
|
150
|
+
color: props.theme.button.fontColor,
|
|
151
|
+
fontSize: cx(12.2),
|
|
152
|
+
},
|
|
153
|
+
activeTaskTimeText2: {
|
|
154
|
+
flex: 1,
|
|
155
|
+
marginHorizontal: cx(20),
|
|
156
|
+
color: props.theme.global.secondFontColor,
|
|
157
|
+
fontSize: cx(22),
|
|
158
|
+
textAlign: 'center',
|
|
159
|
+
fontWeight: 'bold',
|
|
160
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
|
|
51
164
|
return (
|
|
52
165
|
<Page
|
|
53
166
|
backText={devInfo.name}
|
|
@@ -136,7 +249,7 @@ const TimerPage = () => {
|
|
|
136
249
|
state.loading = false
|
|
137
250
|
}}
|
|
138
251
|
textStyle={{ fontSize: cx(14) }}
|
|
139
|
-
style={{ backgroundColor: !startEnable ?
|
|
252
|
+
style={{ backgroundColor: !startEnable ? props.theme.button.disabled : props.theme.button.primary }}/>
|
|
140
253
|
</View>
|
|
141
254
|
}
|
|
142
255
|
{startedTasks.length > 0 && params.timerSettableDps.length > 1 &&
|
|
@@ -150,7 +263,7 @@ const TimerPage = () => {
|
|
|
150
263
|
<FlatList
|
|
151
264
|
data={startedTasks}
|
|
152
265
|
renderItem={({ item }) => {
|
|
153
|
-
return ActiveTimerItem(item, async () => {
|
|
266
|
+
return ActiveTimerItem(item, styles,async () => {
|
|
154
267
|
state.loading = true
|
|
155
268
|
const tasks = cloneDeep(startedTasks)
|
|
156
269
|
tasks.forEach(task => {
|
|
@@ -213,7 +326,7 @@ const TimerPage = () => {
|
|
|
213
326
|
)
|
|
214
327
|
}
|
|
215
328
|
|
|
216
|
-
function ActiveTimerItem(task: TimerTask, onCancel: () => void) {
|
|
329
|
+
function ActiveTimerItem(task: TimerTask, styles: StyleSheet.NamedStyles<any>, onCancel: () => void) {
|
|
217
330
|
return (
|
|
218
331
|
<Card style={{ marginHorizontal: cx(24) }}>
|
|
219
332
|
<Spacer/>
|
|
@@ -249,115 +362,5 @@ function ActiveTimerItem(task: TimerTask, onCancel: () => void) {
|
|
|
249
362
|
)
|
|
250
363
|
}
|
|
251
364
|
|
|
252
|
-
const styles = StyleSheet.create({
|
|
253
|
-
root: {
|
|
254
|
-
flex: 1,
|
|
255
|
-
},
|
|
256
|
-
content: {
|
|
257
|
-
marginHorizontal: cx(24),
|
|
258
|
-
},
|
|
259
|
-
applyFor: {
|
|
260
|
-
color: '#000',
|
|
261
|
-
fontSize: cx(16),
|
|
262
|
-
fontWeight: 'bold',
|
|
263
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
264
|
-
},
|
|
265
|
-
taskList: {
|
|
266
|
-
backgroundColor: '#f6f6f6',
|
|
267
|
-
paddingTop: cx(8),
|
|
268
|
-
borderRadius: cx(4),
|
|
269
|
-
},
|
|
270
|
-
taskItem: {
|
|
271
|
-
marginHorizontal: cx(8),
|
|
272
|
-
marginBottom: cx(8),
|
|
273
|
-
flexDirection: 'row',
|
|
274
|
-
justifyContent: 'space-between',
|
|
275
|
-
alignItems: 'center',
|
|
276
|
-
backgroundColor: '#fff',
|
|
277
|
-
},
|
|
278
|
-
taskItemText: {
|
|
279
|
-
color: '#000',
|
|
280
|
-
fontSize: 14,
|
|
281
|
-
marginHorizontal: cx(8),
|
|
282
|
-
marginVertical: cx(9),
|
|
283
|
-
},
|
|
284
|
-
taskItemIcon: {
|
|
285
|
-
width: cx(16),
|
|
286
|
-
height: cx(16),
|
|
287
|
-
marginRight: cx(8),
|
|
288
|
-
},
|
|
289
|
-
listEmptyView: {
|
|
290
|
-
marginHorizontal: cx(8),
|
|
291
|
-
marginTop: cx(6),
|
|
292
|
-
marginBottom: cx(14),
|
|
293
|
-
},
|
|
294
|
-
listEmptyText: {
|
|
295
|
-
color: '#666',
|
|
296
|
-
fontSize: cx(14),
|
|
297
|
-
},
|
|
298
|
-
noSelectTaskList: {},
|
|
299
|
-
noSelectTaskItem: {
|
|
300
|
-
height: cx(30),
|
|
301
|
-
flexDirection: 'row',
|
|
302
|
-
alignItems: 'center',
|
|
303
|
-
},
|
|
304
|
-
noSelectTaskText: {
|
|
305
|
-
flex: 1,
|
|
306
|
-
color: '#000',
|
|
307
|
-
fontSize: cx(14),
|
|
308
|
-
},
|
|
309
|
-
activeTaskHeadLine: {
|
|
310
|
-
flexDirection: 'row',
|
|
311
|
-
alignItems: 'center',
|
|
312
|
-
},
|
|
313
|
-
activeTaskHeadLineText: {
|
|
314
|
-
flex: 1,
|
|
315
|
-
color: '#000',
|
|
316
|
-
fontSize: cx(14),
|
|
317
|
-
},
|
|
318
|
-
activeTaskHeadLineBtn: {
|
|
319
|
-
minWidth: cx(50),
|
|
320
|
-
height: cx(24),
|
|
321
|
-
padding: 0,
|
|
322
|
-
backgroundColor: '#666',
|
|
323
|
-
borderRadius: cx(4),
|
|
324
|
-
},
|
|
325
|
-
activeTaskHeadLineBtnText: {
|
|
326
|
-
color: '#fff',
|
|
327
|
-
fontSize: cx(8.2),
|
|
328
|
-
},
|
|
329
|
-
activeTaskTimeText: {
|
|
330
|
-
flex: 1,
|
|
331
|
-
color: '#666',
|
|
332
|
-
fontSize: cx(24),
|
|
333
|
-
fontWeight: 'bold',
|
|
334
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
335
|
-
},
|
|
336
|
-
activeTaskDesc: {
|
|
337
|
-
flex: 1,
|
|
338
|
-
color: '#666',
|
|
339
|
-
fontSize: cx(14),
|
|
340
|
-
},
|
|
341
|
-
activeTasBtn: {
|
|
342
|
-
width: 'auto',
|
|
343
|
-
height: cx(36),
|
|
344
|
-
padding: 0,
|
|
345
|
-
backgroundColor: '#666',
|
|
346
|
-
borderRadius: cx(4),
|
|
347
|
-
},
|
|
348
|
-
activeTaskBtnText: {
|
|
349
|
-
color: '#fff',
|
|
350
|
-
fontSize: cx(12.2),
|
|
351
|
-
},
|
|
352
|
-
activeTaskTimeText2: {
|
|
353
|
-
flex: 1,
|
|
354
|
-
marginHorizontal: cx(20),
|
|
355
|
-
color: '#666',
|
|
356
|
-
fontSize: cx(22),
|
|
357
|
-
textAlign: 'center',
|
|
358
|
-
fontWeight: 'bold',
|
|
359
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
360
|
-
},
|
|
361
|
-
})
|
|
362
365
|
|
|
363
|
-
export default TimerPage
|
|
366
|
+
export default withTheme(TimerPage)
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { StyleProp, StyleSheet, View, ViewStyle, Text } from 'react-native'
|
|
3
|
-
import { Picker, Utils } from 'tuya-panel-kit'
|
|
4
|
-
import _ from 'lodash'
|
|
5
|
-
|
|
6
|
-
const { convertX } = Utils.RatioUtils
|
|
7
|
-
|
|
8
|
-
const hours = _.times(61, (n) => _.padStart(n.toString(), 2, '0'))
|
|
9
|
-
const minutes = _.times(61, (n) => _.padStart(n.toString(), 2, '0'))
|
|
10
|
-
const pickerTheme = {
|
|
11
|
-
fontSize: 20,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface LdvPickerViewProps {
|
|
15
|
-
hour: string,
|
|
16
|
-
minute: string,
|
|
17
|
-
setHour: (string) => void,
|
|
18
|
-
setMinute: (string) => void,
|
|
19
|
-
style?: StyleProp<ViewStyle> | undefined,
|
|
20
|
-
unit?:string[]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
24
|
-
|
|
25
|
-
const { hour, minute, unit, setHour, setMinute } = props
|
|
26
|
-
|
|
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
|
-
}
|
|
69
|
-
|
|
70
|
-
const styles = StyleSheet.create({
|
|
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
|
-
alignItems: 'center',
|
|
83
|
-
flexDirection: 'row',
|
|
84
|
-
},
|
|
85
|
-
pickerUnit: {
|
|
86
|
-
position: 'absolute',
|
|
87
|
-
right: convertX(20),
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export default LdvPickerView
|