@ledvance/group-ui-biz-bundle 1.0.120 → 1.0.122
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/BiorhythmPage.tsx +118 -78
- package/src/modules/biorhythm/circular/RhythmsCircle.tsx +483 -0
- package/src/modules/biorhythm/circular/conical-gradient/Android.tsx +63 -0
- package/src/modules/biorhythm/circular/conical-gradient/Ios.tsx +26 -0
- package/src/modules/biorhythm/circular/conical-gradient/Normal.tsx +187 -0
- package/src/modules/biorhythm/circular/conical-gradient/index.android.tsx +164 -0
- package/src/modules/biorhythm/circular/conical-gradient/index.ios.tsx +124 -0
- package/src/modules/biorhythm/circular/conical-gradient/index.tsx +3 -0
- package/src/modules/biorhythm/circular/conical-gradient/index.web.tsx +94 -0
- package/src/modules/biorhythm/circular/conical-gradient/interface.ts +19 -0
- package/src/modules/biorhythm/circular/conical-gradient/utils.ts +25 -0
- package/src/modules/biorhythm/circular/interface.ts +114 -0
- package/src/modules/diyScene/DiySceneEditorPage.tsx +4 -3
- package/src/modules/energyConsumption/component/EnergyModal.tsx +3 -0
- package/src/modules/lightMode/LightModePage.tsx +50 -144
- package/src/modules/mood/DynamicMoodEditorPage.tsx +1 -1
- package/src/modules/mood/StaticMoodEditorPage.tsx +1 -1
- package/src/modules/mood_new/DynamicMoodEditorPage.tsx +1 -1
- package/src/modules/mood_new/MixDynamicMoodEditor.tsx +1 -1
- package/src/modules/mood_new/MoodInfo.ts +1 -1
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +1 -1
- package/src/modules/powerOnBehavior/LightBehaviorPage.tsx +208 -0
- package/src/modules/powerOnBehavior/PlugBehaviorPage.tsx +99 -0
- package/src/modules/powerOnBehavior/PowerOnBehaviorActions.ts +131 -0
- package/src/modules/powerOnBehavior/Router.ts +27 -0
- package/src/navigation/Routers.ts +3 -1
- package/src/modules/biorhythm/circular/ItemIcon.d.ts +0 -22
- package/src/modules/biorhythm/circular/ItemIcon.tsx +0 -173
- package/src/modules/biorhythm/circular/Progress.d.ts +0 -24
- package/src/modules/biorhythm/circular/Progress.tsx +0 -372
- package/src/modules/biorhythm/circular/TimeCircular.d.ts +0 -11
- package/src/modules/biorhythm/circular/TimeCircular.tsx +0 -64
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo } from 'react'
|
|
2
2
|
import { FlatList, Image, Linking, ScrollView, Switch, Text, TouchableOpacity, View } from 'react-native'
|
|
3
3
|
import { useNavigation } from '@react-navigation/native'
|
|
4
|
-
import TimeCircular from './circular/TimeCircular'
|
|
5
4
|
import { useDebounceFn, useReactive, useUpdateEffect } from 'ahooks'
|
|
6
5
|
import {
|
|
7
6
|
BiorhythmBean,
|
|
@@ -34,6 +33,7 @@ import ApplyForDeviceList from '@ledvance/base/src/components/ApplyForDeviceList
|
|
|
34
33
|
import DeleteButton from '@ledvance/base/src/components/DeleteButton'
|
|
35
34
|
import InfoText from '@ledvance/base/src/components/InfoText'
|
|
36
35
|
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
36
|
+
import RhythmsCircle from './circular/RhythmsCircle'
|
|
37
37
|
|
|
38
38
|
const cx = Utils.RatioUtils.convertX
|
|
39
39
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -73,6 +73,14 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
73
73
|
loading: false
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
+
const timeImg = useMemo(() => {
|
|
77
|
+
if (is24Hour) {
|
|
78
|
+
return devicesJudge ? res.ic_warning_amber_sun : res.ic_warning_amber_new
|
|
79
|
+
} else {
|
|
80
|
+
return devicesJudge ? res.ic_warning_amber_sun_12 : res.ic_warning_amber_new_12
|
|
81
|
+
}
|
|
82
|
+
}, [is24Hour, devicesJudge])
|
|
83
|
+
|
|
76
84
|
const showGradientTypeSelectModal = useCallback((show: boolean) => {
|
|
77
85
|
state.showGradientTypeSelectModal = show
|
|
78
86
|
}, [])
|
|
@@ -211,20 +219,20 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
211
219
|
const sunHomeText = string => {
|
|
212
220
|
const text = string.split('SUN@HOME')
|
|
213
221
|
return text?.length === 1 && <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{text[0]}</Text> ||
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
<Text style={{
|
|
223
|
+
fontSize: cx(14),
|
|
224
|
+
flexDirection: 'row',
|
|
225
|
+
}}>
|
|
226
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[0]}</Text>
|
|
227
|
+
<Text onPress={openLink}
|
|
228
|
+
style={{
|
|
229
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
230
|
+
color: props.theme?.button.primary,
|
|
231
|
+
textDecorationLine: 'underline',
|
|
232
|
+
flexWrap: 'wrap',
|
|
233
|
+
}}>SUN@HOME</Text>
|
|
234
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[1]}</Text>
|
|
235
|
+
</Text>
|
|
228
236
|
}
|
|
229
237
|
|
|
230
238
|
const randomIcon = () => {
|
|
@@ -243,6 +251,18 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
243
251
|
return !!state.planList.filter(p => p.id !== plan.id).find(p => p.name === plan.name)
|
|
244
252
|
}, [state.planList])
|
|
245
253
|
|
|
254
|
+
const convertPlandata = useCallback(() => {
|
|
255
|
+
return state.planList.map(item => {
|
|
256
|
+
return {
|
|
257
|
+
...item,
|
|
258
|
+
index: item.id,
|
|
259
|
+
noActiveColor: '#474e5d',
|
|
260
|
+
activeColor: '#F7EB2A',
|
|
261
|
+
color: item?.brightness === 0 ? '#000' : !params.isSupportTemperature && cctToColor(1) || cctToColor(item.colorTemperature.toFixed(), item?.brightness)
|
|
262
|
+
}
|
|
263
|
+
}).filter(plan => plan.enable)
|
|
264
|
+
}, [JSON.stringify(state.planList), params.isSupportTemperature])
|
|
265
|
+
|
|
246
266
|
return (
|
|
247
267
|
<Page
|
|
248
268
|
backText={uaGroupInfo.name}
|
|
@@ -327,10 +347,10 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
327
347
|
})}
|
|
328
348
|
</View>
|
|
329
349
|
<View style={{ marginHorizontal: cx(24), marginTop: cx(20) }}>
|
|
330
|
-
<Text style={{color: props.theme?.global.fontColor}}>{state.weekString}</Text>
|
|
350
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{state.weekString}</Text>
|
|
331
351
|
</View>
|
|
332
352
|
<View style={{ marginHorizontal: cx(24), marginTop: cx(16) }}>
|
|
333
|
-
<Text style={{color: props.theme?.global.fontColor}}>
|
|
353
|
+
<Text style={{ color: props.theme?.global.fontColor }}>
|
|
334
354
|
{I18n.getLang('bio_ryhthm_default_selectionfield_topic_text')}
|
|
335
355
|
</Text>
|
|
336
356
|
<TouchableOpacity
|
|
@@ -369,7 +389,7 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
369
389
|
</TouchableOpacity>
|
|
370
390
|
</View>
|
|
371
391
|
<View style={{ height: cx(20) }} />
|
|
372
|
-
<TimeCircular
|
|
392
|
+
{/* <TimeCircular
|
|
373
393
|
planEdit={true}
|
|
374
394
|
planList={state.planList}
|
|
375
395
|
onPanMoved={(id, time) => {
|
|
@@ -383,7 +403,27 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
383
403
|
}}
|
|
384
404
|
replaceStatus={devicesJudge}
|
|
385
405
|
gradient={state.gradient === BiorhythmGradientType.DirectGradient}
|
|
386
|
-
isSupportTemperature={!params.isSupportTemperature} />
|
|
406
|
+
isSupportTemperature={!params.isSupportTemperature} /> */}
|
|
407
|
+
|
|
408
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
409
|
+
<RhythmsCircle
|
|
410
|
+
size={250}
|
|
411
|
+
ringWidth={40}
|
|
412
|
+
thumbSize={36}
|
|
413
|
+
timeImg={timeImg}
|
|
414
|
+
gradientMode={state.gradient === BiorhythmGradientType.EntireGradient}
|
|
415
|
+
data={convertPlandata()}
|
|
416
|
+
onRelease={(planList) => {
|
|
417
|
+
state.planList = state.planList.map(item => {
|
|
418
|
+
return {
|
|
419
|
+
...item,
|
|
420
|
+
time: planList.find(p => p.index === item.id)?.time
|
|
421
|
+
}
|
|
422
|
+
})
|
|
423
|
+
state.flag = Symbol()
|
|
424
|
+
}}
|
|
425
|
+
/>
|
|
426
|
+
</View>
|
|
387
427
|
<View
|
|
388
428
|
style={{
|
|
389
429
|
flexDirection: 'row',
|
|
@@ -393,66 +433,66 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
393
433
|
marginTop: cx(26),
|
|
394
434
|
}}>
|
|
395
435
|
{state.planList.length === 8 && <View
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
436
|
+
style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
|
|
437
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={{ uri: res.ic_warning_amber }} />
|
|
438
|
+
<Text
|
|
439
|
+
style={{
|
|
440
|
+
flexWrap: 'wrap',
|
|
441
|
+
fontSize: cx(12),
|
|
442
|
+
color: props.theme?.global.fontColor
|
|
443
|
+
}}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
|
|
404
444
|
</View>}
|
|
405
445
|
{state.planList.length < 8 &&
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
446
|
+
<>
|
|
447
|
+
<Text
|
|
448
|
+
style={{
|
|
449
|
+
fontSize: cx(16),
|
|
450
|
+
fontWeight: 'bold',
|
|
451
|
+
color: props.theme?.global.fontColor,
|
|
452
|
+
}}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
|
|
453
|
+
<TouchableOpacity
|
|
454
|
+
onPress={() => {
|
|
455
|
+
const ids: number[] = state.planList.map(p => p.id)
|
|
456
|
+
const newPlan: Plan = {
|
|
457
|
+
id: Math.max(...ids) + 1,
|
|
458
|
+
icon: res.rhythm_icon1,
|
|
459
|
+
time: 0,
|
|
460
|
+
name: '',
|
|
461
|
+
colorTemperature: 0,
|
|
462
|
+
brightness: 100,
|
|
463
|
+
action: [
|
|
464
|
+
{
|
|
465
|
+
uri: 'model/attribute/set/LightCtrl/ColorTemperature',
|
|
466
|
+
startValue: `${colorTemperatureValue(0)}`,
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
uri: 'model/attribute/set/LightCtrl/Brightness',
|
|
470
|
+
startValue: '100',
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
enable: true,
|
|
474
|
+
iconId: randomIcon(),
|
|
475
|
+
}
|
|
476
|
+
const editPageParams: BiorhythmEditPageParams = {
|
|
477
|
+
planData: newPlan,
|
|
478
|
+
isAdd: true,
|
|
479
|
+
onPlanEdited,
|
|
480
|
+
onPlanDelete,
|
|
481
|
+
nameRepeat,
|
|
482
|
+
minimumEnable,
|
|
483
|
+
iconIdList: state.planList?.map(item => {
|
|
484
|
+
return item.iconId
|
|
485
|
+
}),
|
|
486
|
+
isMixLight: params.isMixLight,
|
|
487
|
+
isSupportTemperature: params.isSupportTemperature,
|
|
488
|
+
isSupportBrightness: params.isSupportBrightness,
|
|
489
|
+
showDeleteBtn
|
|
490
|
+
}
|
|
491
|
+
navigation.navigate(ui_biz_routerKey.group_ui_biz_biological_detail, editPageParams)
|
|
492
|
+
}}>
|
|
493
|
+
<Image source={{ uri: res.biorhythom_add }} style={{ height: cx(24), width: cx(24), tintColor: props.theme?.icon.primary }} />
|
|
494
|
+
</TouchableOpacity>
|
|
495
|
+
</>
|
|
456
496
|
}
|
|
457
497
|
</View>
|
|
458
498
|
<FlatList
|
|
@@ -516,7 +556,7 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
516
556
|
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: cx(16) }}>
|
|
517
557
|
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
|
|
518
558
|
<Image
|
|
519
|
-
source={{uri: setImg(item?.iconId)} || type && { uri: item?.icon } || item?.icon}
|
|
559
|
+
source={{ uri: setImg(item?.iconId) } || type && { uri: item?.icon } || item?.icon}
|
|
520
560
|
style={{
|
|
521
561
|
width: cx(24),
|
|
522
562
|
height: cx(24),
|