@ledvance/ui-biz-bundle 1.1.89 → 1.1.91
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
|
@@ -23,6 +23,7 @@ import InfoText from "@ledvance/base/src/components/InfoText";
|
|
|
23
23
|
|
|
24
24
|
const cx = Utils.RatioUtils.convertX
|
|
25
25
|
const { parseTimer } = Utils.TimeUtils
|
|
26
|
+
const { withTheme } = Utils.ThemeUtils
|
|
26
27
|
|
|
27
28
|
export interface SleepWakeUpPageRouteParams {
|
|
28
29
|
isSupportColor?: boolean
|
|
@@ -40,7 +41,7 @@ export interface SleepWakeUpPageRouteParams {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const MAX_SCHEDULE = 4
|
|
43
|
-
const SleepWakeUpPage = () => {
|
|
44
|
+
const SleepWakeUpPage = (props: { theme?: any }) => {
|
|
44
45
|
const deviceInfo = useDeviceInfo()
|
|
45
46
|
const navigation = useNavigation()
|
|
46
47
|
const is24HourClock = useSystemTimeFormate()
|
|
@@ -174,6 +175,101 @@ const SleepWakeUpPage = () => {
|
|
|
174
175
|
return ''
|
|
175
176
|
}, [getTipText()])
|
|
176
177
|
|
|
178
|
+
const styles = StyleSheet.create({
|
|
179
|
+
tagLine: {
|
|
180
|
+
flexDirection: 'row',
|
|
181
|
+
marginHorizontal: cx(24),
|
|
182
|
+
},
|
|
183
|
+
infoLine: {
|
|
184
|
+
marginHorizontal: cx(24),
|
|
185
|
+
},
|
|
186
|
+
addMoodPopover: {
|
|
187
|
+
width: cx(210),
|
|
188
|
+
height: cx(90.5),
|
|
189
|
+
marginStart: cx(115),
|
|
190
|
+
marginTop: cx(100),
|
|
191
|
+
backgroundColor: props.theme.card.background,
|
|
192
|
+
},
|
|
193
|
+
popoverItem: {
|
|
194
|
+
width: cx(210),
|
|
195
|
+
height: cx(45),
|
|
196
|
+
alignItems: 'flex-start',
|
|
197
|
+
},
|
|
198
|
+
emptyListCon: {
|
|
199
|
+
flex: 1,
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
},
|
|
202
|
+
emptyImage: {
|
|
203
|
+
width: cx(225),
|
|
204
|
+
height: cx(198),
|
|
205
|
+
},
|
|
206
|
+
emptyText: {
|
|
207
|
+
flexDirection: 'row',
|
|
208
|
+
alignItems: 'center'
|
|
209
|
+
},
|
|
210
|
+
emptyNoTime: {
|
|
211
|
+
fontSize: cx(12),
|
|
212
|
+
lineHeight: cx(20),
|
|
213
|
+
textAlign: 'center',
|
|
214
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
215
|
+
color: props.theme.global.fontColor
|
|
216
|
+
},
|
|
217
|
+
emptyBtnView: {
|
|
218
|
+
alignItems: 'center'
|
|
219
|
+
},
|
|
220
|
+
emptyBtn: {
|
|
221
|
+
backgroundColor: props.theme.button.primary,
|
|
222
|
+
borderRadius: cx(5),
|
|
223
|
+
paddingHorizontal: cx(15),
|
|
224
|
+
paddingVertical: cx(10)
|
|
225
|
+
},
|
|
226
|
+
addTimer: {
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
alignItems: 'center',
|
|
229
|
+
// width,
|
|
230
|
+
marginVertical: cx(20),
|
|
231
|
+
},
|
|
232
|
+
disableItemText: {
|
|
233
|
+
color: '#CBCBCB',
|
|
234
|
+
fontSize: cx(16),
|
|
235
|
+
},
|
|
236
|
+
randomTimingCard: {
|
|
237
|
+
marginHorizontal: cx(24),
|
|
238
|
+
paddingHorizontal: cx(16),
|
|
239
|
+
},
|
|
240
|
+
switchLine: {
|
|
241
|
+
flexDirection: 'row',
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
},
|
|
244
|
+
time: {
|
|
245
|
+
flex: 1,
|
|
246
|
+
color: props.theme.global.fontColor,
|
|
247
|
+
fontSize: cx(16),
|
|
248
|
+
fontWeight: 'bold',
|
|
249
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
250
|
+
},
|
|
251
|
+
switchBtn: {},
|
|
252
|
+
loopText: {
|
|
253
|
+
color: props.theme.global.fontColor,
|
|
254
|
+
fontSize: cx(14),
|
|
255
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
256
|
+
height: cx(20)
|
|
257
|
+
},
|
|
258
|
+
tag: {
|
|
259
|
+
alignSelf: 'flex-start',
|
|
260
|
+
borderRadius: cx(16),
|
|
261
|
+
height: cx(16),
|
|
262
|
+
backgroundColor: props.theme.tag.background,
|
|
263
|
+
paddingHorizontal: cx(10),
|
|
264
|
+
},
|
|
265
|
+
tagTitle: {
|
|
266
|
+
fontSize: cx(10),
|
|
267
|
+
textAlign: 'center',
|
|
268
|
+
fontFamily: 'PingFangSC-Medium',
|
|
269
|
+
color: props.theme.tag.fontColor
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
|
|
177
273
|
return (
|
|
178
274
|
<>
|
|
179
275
|
<Page
|
|
@@ -187,36 +283,36 @@ const SleepWakeUpPage = () => {
|
|
|
187
283
|
loading={state.loading}
|
|
188
284
|
>
|
|
189
285
|
<View style={{ marginHorizontal: cx(24) }}>
|
|
190
|
-
<Text style={{ color:
|
|
286
|
+
<Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>
|
|
191
287
|
{I18n.getLang('timeschedule_overview_description_text')}
|
|
192
288
|
</Text>
|
|
193
289
|
</View>
|
|
194
290
|
<Spacer height={cx(5)} />
|
|
195
291
|
{!!getTipText() && <InfoText
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
292
|
+
style={{ marginHorizontal: cx(24), marginBottom: cx(5) }}
|
|
293
|
+
icon={res.ic_warning_amber}
|
|
294
|
+
iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }}
|
|
295
|
+
contentColor={props.theme.global.secondFontColor}
|
|
296
|
+
text={tipText}
|
|
297
|
+
textStyle={{ fontSize: cx(12) }}
|
|
202
298
|
/>}
|
|
203
299
|
{hasScheduleList() && <>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
300
|
+
<View style={styles.tagLine}>
|
|
301
|
+
<Tag
|
|
302
|
+
checked={state.sleepTagChecked}
|
|
303
|
+
text={I18n.getLang('sleepwakeschedule_field_3_Times_chips2_text')}
|
|
304
|
+
onCheckedChange={checked => {
|
|
305
|
+
state.sleepTagChecked = checked
|
|
306
|
+
}} />
|
|
307
|
+
<Spacer width={cx(8)} height={0} />
|
|
308
|
+
<Tag
|
|
309
|
+
checked={state.wakeUpTagChecked}
|
|
310
|
+
text={I18n.getLang('sleepwakeschedule_field_3_Times_chips_text')}
|
|
311
|
+
onCheckedChange={checked => {
|
|
312
|
+
state.wakeUpTagChecked = checked
|
|
313
|
+
}} />
|
|
314
|
+
</View>
|
|
315
|
+
<Spacer height={cx(5)} />
|
|
220
316
|
</>}
|
|
221
317
|
{state.filteredScheduleList.length ?
|
|
222
318
|
<FlatList
|
|
@@ -224,6 +320,7 @@ const SleepWakeUpPage = () => {
|
|
|
224
320
|
renderItem={({ item }) => (
|
|
225
321
|
<SleepWakeUpCard
|
|
226
322
|
is24HourClock={is24HourClock}
|
|
323
|
+
styles={styles}
|
|
227
324
|
sleepWakeUp={item}
|
|
228
325
|
onPress={() => {
|
|
229
326
|
onAddScheduleDialogItemClick(item.isSleep, 'edit', item)
|
|
@@ -251,7 +348,7 @@ const SleepWakeUpPage = () => {
|
|
|
251
348
|
<View style={styles.emptyText}>
|
|
252
349
|
<Image
|
|
253
350
|
source={{ uri: res.device_panel_schedule_alert }}
|
|
254
|
-
style={{ width: cx(16), height: cx(16) }}
|
|
351
|
+
style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
|
|
255
352
|
/>
|
|
256
353
|
<Text style={styles.emptyNoTime}>
|
|
257
354
|
{
|
|
@@ -262,22 +359,22 @@ const SleepWakeUpPage = () => {
|
|
|
262
359
|
</Text>
|
|
263
360
|
</View>
|
|
264
361
|
{!hasScheduleList() &&
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
362
|
+
<View style={styles.emptyBtnView}>
|
|
363
|
+
<Spacer />
|
|
364
|
+
<TextButton
|
|
365
|
+
style={styles.emptyBtn}
|
|
366
|
+
textStyle={isSleepMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
|
|
367
|
+
text={I18n.getLang('sleepwakeschedule_add_button_text1')}
|
|
368
|
+
onPress={() => onAddScheduleDialogItemClick(true, 'add', getNewSleepWakeUp(true, params))}
|
|
369
|
+
/>
|
|
370
|
+
<Spacer />
|
|
371
|
+
<TextButton
|
|
372
|
+
style={styles.emptyBtn}
|
|
373
|
+
textStyle={isWakeUpMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
|
|
374
|
+
text={I18n.getLang('sleepwakeschedule_add_button_text2')}
|
|
375
|
+
onPress={() => onAddScheduleDialogItemClick(false, 'add', getNewSleepWakeUp(false, params))}
|
|
376
|
+
/>
|
|
377
|
+
</View>}
|
|
281
378
|
</View>
|
|
282
379
|
}
|
|
283
380
|
</Page>
|
|
@@ -311,8 +408,9 @@ const SleepWakeUpCard = (props: {
|
|
|
311
408
|
onSwitch: (enable: boolean) => void,
|
|
312
409
|
onPress: () => void
|
|
313
410
|
is24HourClock: boolean
|
|
411
|
+
styles: StyleSheet.NamedStyles<any>
|
|
314
412
|
}) => {
|
|
315
|
-
const { sleepWakeUp, is24HourClock, onSwitch, onPress } = props
|
|
413
|
+
const { sleepWakeUp, is24HourClock, onSwitch, onPress, styles } = props
|
|
316
414
|
return (
|
|
317
415
|
<Card style={styles.randomTimingCard} onPress={onPress}>
|
|
318
416
|
<Spacer height={cx(16)} />
|
|
@@ -353,105 +451,11 @@ const getNewSleepWakeUp = (isSleep: boolean, params: SleepWakeUpPageRouteParams)
|
|
|
353
451
|
last: 0,
|
|
354
452
|
startTime: isSleep ? 1380 : 390,
|
|
355
453
|
endTime: isSleep ? 1410 : 420,
|
|
356
|
-
isColorMode: params.isSupportColor
|
|
357
|
-
isSleep
|
|
454
|
+
isColorMode: !!params.isSupportColor,
|
|
455
|
+
isSleep,
|
|
456
|
+
time: isSleep ? 1380 : 420
|
|
358
457
|
}
|
|
359
458
|
return def
|
|
360
459
|
}
|
|
361
460
|
|
|
362
|
-
|
|
363
|
-
tagLine: {
|
|
364
|
-
flexDirection: 'row',
|
|
365
|
-
marginHorizontal: cx(24),
|
|
366
|
-
},
|
|
367
|
-
infoLine: {
|
|
368
|
-
marginHorizontal: cx(24),
|
|
369
|
-
},
|
|
370
|
-
addMoodPopover: {
|
|
371
|
-
width: cx(210),
|
|
372
|
-
height: cx(90.5),
|
|
373
|
-
marginStart: cx(115),
|
|
374
|
-
marginTop: cx(100),
|
|
375
|
-
backgroundColor: '#fff',
|
|
376
|
-
},
|
|
377
|
-
popoverItem: {
|
|
378
|
-
width: cx(210),
|
|
379
|
-
height: cx(45),
|
|
380
|
-
alignItems: 'flex-start',
|
|
381
|
-
},
|
|
382
|
-
emptyListCon: {
|
|
383
|
-
flex: 1,
|
|
384
|
-
alignItems: 'center',
|
|
385
|
-
},
|
|
386
|
-
emptyImage: {
|
|
387
|
-
width: cx(225),
|
|
388
|
-
height: cx(198),
|
|
389
|
-
},
|
|
390
|
-
emptyText: {
|
|
391
|
-
flexDirection: 'row',
|
|
392
|
-
alignItems: 'center'
|
|
393
|
-
},
|
|
394
|
-
emptyNoTime: {
|
|
395
|
-
fontSize: cx(12),
|
|
396
|
-
lineHeight: cx(20),
|
|
397
|
-
textAlign: 'center',
|
|
398
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
399
|
-
color: '#000'
|
|
400
|
-
},
|
|
401
|
-
emptyBtnView: {
|
|
402
|
-
alignItems: 'center'
|
|
403
|
-
},
|
|
404
|
-
emptyBtn: {
|
|
405
|
-
backgroundColor: '#f60',
|
|
406
|
-
borderRadius: cx(5),
|
|
407
|
-
paddingHorizontal: cx(15),
|
|
408
|
-
paddingVertical: cx(10)
|
|
409
|
-
},
|
|
410
|
-
addTimer: {
|
|
411
|
-
justifyContent: 'center',
|
|
412
|
-
alignItems: 'center',
|
|
413
|
-
// width,
|
|
414
|
-
marginVertical: cx(20),
|
|
415
|
-
},
|
|
416
|
-
disableItemText: {
|
|
417
|
-
color: '#CBCBCB',
|
|
418
|
-
fontSize: cx(16),
|
|
419
|
-
},
|
|
420
|
-
randomTimingCard: {
|
|
421
|
-
marginHorizontal: cx(24),
|
|
422
|
-
paddingHorizontal: cx(16),
|
|
423
|
-
},
|
|
424
|
-
switchLine: {
|
|
425
|
-
flexDirection: 'row',
|
|
426
|
-
alignItems: 'center',
|
|
427
|
-
},
|
|
428
|
-
time: {
|
|
429
|
-
flex: 1,
|
|
430
|
-
color: '#000',
|
|
431
|
-
fontSize: cx(16),
|
|
432
|
-
fontWeight: 'bold',
|
|
433
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
434
|
-
},
|
|
435
|
-
switchBtn: {},
|
|
436
|
-
loopText: {
|
|
437
|
-
color: '#000',
|
|
438
|
-
fontSize: cx(14),
|
|
439
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
440
|
-
height: cx(20)
|
|
441
|
-
},
|
|
442
|
-
tag: {
|
|
443
|
-
alignSelf: 'flex-start',
|
|
444
|
-
borderRadius: cx(16),
|
|
445
|
-
height: cx(16),
|
|
446
|
-
backgroundColor: 'rgb(230,231,232)',
|
|
447
|
-
paddingHorizontal: cx(10),
|
|
448
|
-
},
|
|
449
|
-
tagTitle: {
|
|
450
|
-
fontSize: cx(10),
|
|
451
|
-
textAlign: 'center',
|
|
452
|
-
fontFamily: 'PingFangSC-Medium',
|
|
453
|
-
color: '#000'
|
|
454
|
-
},
|
|
455
|
-
})
|
|
456
|
-
|
|
457
|
-
export default SleepWakeUpPage
|
|
461
|
+
export default withTheme(SleepWakeUpPage)
|
|
@@ -14,12 +14,13 @@ import Stepper from '@ledvance/base/src/components/Stepper'
|
|
|
14
14
|
import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
15
15
|
|
|
16
16
|
const {convertX: cx} = Utils.RatioUtils
|
|
17
|
+
const { withTheme } = Utils.ThemeUtils
|
|
17
18
|
|
|
18
19
|
export interface SwitchGradientPageParams {
|
|
19
|
-
switchGradientDpCode: string
|
|
20
|
+
switchGradientDpCode: string
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
const SwitchGradientPage = () => {
|
|
23
|
+
const SwitchGradientPage = (props: { theme?: any }) => {
|
|
23
24
|
const devInfo = useDeviceInfo()
|
|
24
25
|
const navigation = useNavigation()
|
|
25
26
|
const params = useParams<SwitchGradientPageParams>()
|
|
@@ -41,6 +42,26 @@ const SwitchGradientPage = () => {
|
|
|
41
42
|
|
|
42
43
|
}, [switchOnDuration, switchOffDuration])
|
|
43
44
|
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
stepCard: {
|
|
47
|
+
marginHorizontal: cx(24),
|
|
48
|
+
paddingHorizontal: cx(16),
|
|
49
|
+
},
|
|
50
|
+
stepTitle: {
|
|
51
|
+
color: props.theme.global.fontColor,
|
|
52
|
+
fontSize: cx(14),
|
|
53
|
+
},
|
|
54
|
+
stepGroup: {
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
},
|
|
58
|
+
stepText: {
|
|
59
|
+
flex: 1,
|
|
60
|
+
color: props.theme.global.fontColor,
|
|
61
|
+
fontSize: cx(16),
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
44
65
|
return (
|
|
45
66
|
<Page
|
|
46
67
|
backText={devInfo.name}
|
|
@@ -66,7 +87,6 @@ const SwitchGradientPage = () => {
|
|
|
66
87
|
min={0}
|
|
67
88
|
max={60}
|
|
68
89
|
stepValue={0.2}
|
|
69
|
-
precision={1}
|
|
70
90
|
editable={true}
|
|
71
91
|
isRealTime={true}
|
|
72
92
|
onValueChange={v => {
|
|
@@ -87,7 +107,6 @@ const SwitchGradientPage = () => {
|
|
|
87
107
|
min={0}
|
|
88
108
|
max={60}
|
|
89
109
|
stepValue={0.2}
|
|
90
|
-
precision={1}
|
|
91
110
|
editable={true}
|
|
92
111
|
isRealTime={true}
|
|
93
112
|
onValueChange={v => {
|
|
@@ -101,24 +120,4 @@ const SwitchGradientPage = () => {
|
|
|
101
120
|
)
|
|
102
121
|
}
|
|
103
122
|
|
|
104
|
-
|
|
105
|
-
stepCard: {
|
|
106
|
-
marginHorizontal: cx(24),
|
|
107
|
-
paddingHorizontal: cx(16),
|
|
108
|
-
},
|
|
109
|
-
stepTitle: {
|
|
110
|
-
color: '#000',
|
|
111
|
-
fontSize: cx(14),
|
|
112
|
-
},
|
|
113
|
-
stepGroup: {
|
|
114
|
-
flexDirection: 'row',
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
},
|
|
117
|
-
stepText: {
|
|
118
|
-
flex: 1,
|
|
119
|
-
color: '#000',
|
|
120
|
-
fontSize: cx(16),
|
|
121
|
-
},
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
export default SwitchGradientPage
|
|
123
|
+
export default withTheme(SwitchGradientPage)
|