@ledvance/ui-biz-bundle 1.1.59 → 1.1.61
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 +22 -14
- package/src/modules/flags/FlagPage.tsx +7 -18
- package/src/modules/mood/DynamicMoodEditorPage.tsx +12 -14
- package/src/modules/mood/FantasyMoodEditPage.tsx +12 -14
- package/src/modules/mood/StaticMoodEditorPage.tsx +12 -13
- package/src/modules/timer/TimerPage.tsx +58 -56
- package/src/newModules/biorhythm/BiorhythmActions.ts +374 -0
- package/src/newModules/biorhythm/BiorhythmBean.ts +230 -0
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +267 -0
- package/src/newModules/biorhythm/BiorhythmPage.tsx +638 -0
- package/src/newModules/biorhythm/IconSelect.tsx +85 -0
- package/src/newModules/biorhythm/Router.ts +34 -0
- package/src/newModules/biorhythm/circular/ItemIcon.d.ts +22 -0
- package/src/newModules/biorhythm/circular/ItemIcon.tsx +173 -0
- package/src/newModules/biorhythm/circular/Progress.d.ts +24 -0
- package/src/newModules/biorhythm/circular/Progress.tsx +372 -0
- package/src/newModules/biorhythm/circular/TimeCircular.d.ts +11 -0
- package/src/newModules/biorhythm/circular/TimeCircular.tsx +64 -0
- package/src/newModules/biorhythm/circular/biorhythm_plantimer.png +0 -0
- package/src/newModules/biorhythm/circular/rhythm_icon.png +0 -0
- package/src/newModules/biorhythm/iconListData.ts +30 -0
- package/src/newModules/biorhythm/pIdList.ts +36 -0
- package/src/newModules/biorhythm/res/BiologicalRes.d.ts +43 -0
- package/src/newModules/biorhythm/res/BiologicalRes.ts +42 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_12.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +84 -83
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +133 -132
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +119 -117
- package/src/newModules/energyConsumption/component/Overview.tsx +38 -36
- package/src/newModules/mood/AddMoodPage.tsx +37 -21
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +7 -2
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +8 -2
- package/src/newModules/mood/StaticMoodEditorPage.tsx +9 -2
- package/src/newModules/timeSchedule/Interface.ts +1 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +203 -202
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +35 -34
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +11 -10
- package/src/newModules/timeSchedule/components/ScheduleCard.tsx +63 -60
|
@@ -10,8 +10,10 @@ import { EnergyConsumptionChartProps } from "../EnergyConsumptionChart";
|
|
|
10
10
|
import { useRoute } from '@react-navigation/core'
|
|
11
11
|
|
|
12
12
|
const { convertX: cx } = Utils.RatioUtils
|
|
13
|
+
const { withTheme } = Utils.ThemeUtils
|
|
13
14
|
|
|
14
15
|
interface OverViewProps {
|
|
16
|
+
theme?: any
|
|
15
17
|
style?: StyleProp<ViewStyle>
|
|
16
18
|
headlineText?: string
|
|
17
19
|
headlineClick?: () => void
|
|
@@ -20,19 +22,43 @@ interface OverViewProps {
|
|
|
20
22
|
}
|
|
21
23
|
const OverView = (props: OverViewProps) => {
|
|
22
24
|
const { over365Days} = useRoute().params as EnergyConsumptionChartProps
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
listEmptyContainer: {
|
|
28
|
+
alignItems: 'center'
|
|
29
|
+
},
|
|
30
|
+
listEmptyImage: {
|
|
31
|
+
width: cx(200),
|
|
32
|
+
height: cx(200),
|
|
33
|
+
},
|
|
34
|
+
listEmptyTextIcon: {
|
|
35
|
+
width: cx(16),
|
|
36
|
+
height: cx(16),
|
|
37
|
+
tintColor: props.theme.global.fontColor,
|
|
38
|
+
},
|
|
39
|
+
listEmptyText: {
|
|
40
|
+
color: props.theme.global.fontColor,
|
|
41
|
+
fontSize: cx(12),
|
|
42
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
43
|
+
},
|
|
44
|
+
overviewItemText: {
|
|
45
|
+
color: props.theme.global.fontColor,
|
|
46
|
+
fontSize: cx(14)
|
|
47
|
+
},
|
|
48
|
+
})
|
|
23
49
|
return (
|
|
24
50
|
<View style={[props.style]}>
|
|
25
51
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
26
|
-
<Text style={{ color:
|
|
52
|
+
<Text style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}>{props.headlineText}</Text>
|
|
27
53
|
{!isEmpty(props.overViewList) && <TouchableOpacity
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
54
|
+
onPress={() => {
|
|
55
|
+
props.headlineClick && props.headlineClick()
|
|
56
|
+
}}
|
|
31
57
|
>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
<Image
|
|
59
|
+
source={res.energy_consumption_chart}
|
|
60
|
+
style={{ width: cx(16), height: cx(16), marginLeft: cx(8) }}
|
|
61
|
+
/>
|
|
36
62
|
</TouchableOpacity>}
|
|
37
63
|
</View>
|
|
38
64
|
<Spacer />
|
|
@@ -45,12 +71,12 @@ const OverView = (props: OverViewProps) => {
|
|
|
45
71
|
props.overviewItemClick && props.overviewItemClick(item)
|
|
46
72
|
}}
|
|
47
73
|
>
|
|
48
|
-
<View style={{ backgroundColor:
|
|
74
|
+
<View style={{ backgroundColor: props.theme.card.background, alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', }}>
|
|
49
75
|
<Text style={styles.overviewItemText}>{item.key}</Text>
|
|
50
76
|
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
|
|
51
77
|
<View style={{ flexDirection: 'row' }}>
|
|
52
|
-
<Text style={[styles.overviewItemText, { color:
|
|
53
|
-
<Text style={[styles.overviewItemText, { color:
|
|
78
|
+
<Text style={[styles.overviewItemText, { color: props.theme.global.secondFontColor }]}>{item.value}</Text>
|
|
79
|
+
<Text style={[styles.overviewItemText, { color: props.theme.global.secondFontColor }]}> kWh</Text>
|
|
54
80
|
</View>
|
|
55
81
|
<Image
|
|
56
82
|
source={res.energy_consumption_right}
|
|
@@ -89,28 +115,4 @@ const OverView = (props: OverViewProps) => {
|
|
|
89
115
|
)
|
|
90
116
|
}
|
|
91
117
|
|
|
92
|
-
|
|
93
|
-
listEmptyContainer: {
|
|
94
|
-
alignItems: 'center'
|
|
95
|
-
},
|
|
96
|
-
listEmptyImage: {
|
|
97
|
-
width: cx(200),
|
|
98
|
-
height: cx(200),
|
|
99
|
-
},
|
|
100
|
-
listEmptyTextIcon: {
|
|
101
|
-
width: cx(16),
|
|
102
|
-
height: cx(16),
|
|
103
|
-
tintColor: '#000',
|
|
104
|
-
},
|
|
105
|
-
listEmptyText: {
|
|
106
|
-
color: '#000',
|
|
107
|
-
fontSize: cx(12),
|
|
108
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
109
|
-
},
|
|
110
|
-
overviewItemText: {
|
|
111
|
-
color: '#000',
|
|
112
|
-
fontSize: cx(14)
|
|
113
|
-
},
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
export default OverView
|
|
118
|
+
export default withTheme(OverView)
|
|
@@ -14,16 +14,17 @@ import {
|
|
|
14
14
|
MoodJumpGradientMode,
|
|
15
15
|
} from './Interface';
|
|
16
16
|
import { Result } from '@ledvance/base/src/models/modules/Result';
|
|
17
|
-
import {
|
|
18
|
-
import { difference, head,
|
|
17
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
18
|
+
import { difference, head, range } from 'lodash';
|
|
19
19
|
import { RecommendMood, getRecommendMixMoods, getRecommendMoods } from './MoodInfo';
|
|
20
20
|
|
|
21
21
|
const cx = Utils.RatioUtils.convertX;
|
|
22
22
|
|
|
23
23
|
export interface AddMoodPageParams {
|
|
24
24
|
isStatic: boolean;
|
|
25
|
-
|
|
25
|
+
moodIds: number[];
|
|
26
26
|
moduleParams: MoodPageParams;
|
|
27
|
+
nameRepeat: (mood: MoodUIInfo) => boolean
|
|
27
28
|
modDeleteMood: (mode: 'add' | 'edit' | 'del', currentMood: MoodUIInfo) => Promise<Result<any>>;
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -56,24 +57,21 @@ const AddMoodPage = () => {
|
|
|
56
57
|
|
|
57
58
|
const onMoodItemClick = useCallback(
|
|
58
59
|
(moodItem: RecommendMood) => {
|
|
59
|
-
const useIds = map(routeParams.moods, 'id');
|
|
60
60
|
const idRange = range(0, 256);
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const mainId: number = head(difference(idRange, routeParams.moodIds)) || 0;
|
|
62
|
+
const secondaryId: number = moduleParams.isCeilingLight ? head(difference(idRange, [...routeParams.moodIds, mainId])) || 0 : 0
|
|
63
63
|
const url = routeParams.isStatic
|
|
64
|
-
?
|
|
64
|
+
? ui_biz_routerKey.ui_biz_static_mood_edit
|
|
65
65
|
: !!(moduleParams.isCeilingLight || moduleParams.isMixLight)
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
? ui_biz_routerKey.ui_biz_dynamic_mix_mood_edit
|
|
67
|
+
: ui_biz_routerKey.ui_biz_dynamic_mood_edit;
|
|
68
68
|
const currentMood = moodItem.mainLamp
|
|
69
|
-
? { ...moodItem, id }
|
|
70
|
-
: newMood(
|
|
69
|
+
? { ...moodItem, id: mainId, mainLamp: { ...moodItem.mainLamp, id: mainId }, secondaryLamp: { ...moodItem.secondaryLamp, id: secondaryId } }
|
|
70
|
+
: newMood(mainId, secondaryId, moduleParams.isSupportColor, routeParams.isStatic, moduleParams);
|
|
71
71
|
navigation.navigate(url, {
|
|
72
|
+
...routeParams,
|
|
72
73
|
mode: 'add',
|
|
73
74
|
currentMood,
|
|
74
|
-
moods: routeParams.moods,
|
|
75
|
-
moduleParams,
|
|
76
|
-
modDeleteMood: routeParams.modDeleteMood,
|
|
77
75
|
});
|
|
78
76
|
},
|
|
79
77
|
[routeParams]
|
|
@@ -105,6 +103,7 @@ const AddMoodPage = () => {
|
|
|
105
103
|
title={item.name}
|
|
106
104
|
isMix={isMix}
|
|
107
105
|
mood={getFormateItem(item)}
|
|
106
|
+
deviceTypeOption={moduleParams}
|
|
108
107
|
onPress={() => {
|
|
109
108
|
onMoodItemClick(item);
|
|
110
109
|
}}
|
|
@@ -136,8 +135,20 @@ const styles = StyleSheet.create({
|
|
|
136
135
|
|
|
137
136
|
export default AddMoodPage;
|
|
138
137
|
|
|
138
|
+
const defStripConfig = {
|
|
139
|
+
version: 0,
|
|
140
|
+
expand: 0,
|
|
141
|
+
reserved1: 0,
|
|
142
|
+
reserved2: 0,
|
|
143
|
+
segmented: 0,
|
|
144
|
+
loop: 0,
|
|
145
|
+
excessive: 0,
|
|
146
|
+
direction: 0,
|
|
147
|
+
}
|
|
148
|
+
|
|
139
149
|
function newMood(
|
|
140
|
-
|
|
150
|
+
mainId: number,
|
|
151
|
+
secondaryId: number,
|
|
141
152
|
isColorMode: boolean,
|
|
142
153
|
isStatic: boolean,
|
|
143
154
|
moduleParams: MoodPageParams
|
|
@@ -145,8 +156,8 @@ function newMood(
|
|
|
145
156
|
const jump = moduleParams.isStringLight
|
|
146
157
|
? MoodJumpGradientMode.StringJump
|
|
147
158
|
: moduleParams.isStripLight
|
|
148
|
-
|
|
149
|
-
|
|
159
|
+
? MoodJumpGradientMode.StripJump
|
|
160
|
+
: MoodJumpGradientMode.SourceJump;
|
|
150
161
|
const node = {
|
|
151
162
|
brightness: 100,
|
|
152
163
|
colorTemp: 100,
|
|
@@ -159,20 +170,25 @@ function newMood(
|
|
|
159
170
|
version: 0,
|
|
160
171
|
name: '',
|
|
161
172
|
image: '',
|
|
162
|
-
id,
|
|
173
|
+
id: mainId,
|
|
163
174
|
mainLamp: {
|
|
175
|
+
id: mainId,
|
|
164
176
|
speed: 75,
|
|
165
177
|
enable: true,
|
|
166
178
|
fanEnable: true,
|
|
167
179
|
fanSpeed: 1,
|
|
180
|
+
...defStripConfig,
|
|
168
181
|
mode: isStatic ? MoodNodeTransitionMode.Static : jump,
|
|
169
182
|
nodes: isStatic ? [node] : [node, { ...node }],
|
|
170
183
|
},
|
|
171
184
|
secondaryLamp: {
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
id: secondaryId,
|
|
186
|
+
enable: true,
|
|
187
|
+
mode: MoodJumpGradientMode.StripJump,
|
|
174
188
|
speed: 75,
|
|
175
|
-
|
|
189
|
+
...defStripConfig,
|
|
190
|
+
version: 1,
|
|
191
|
+
nodes: isStatic ? [] : [{ ...node, isColorNode: true }, { ...node, isColorNode: true }],
|
|
176
192
|
},
|
|
177
193
|
};
|
|
178
194
|
}
|
|
@@ -135,11 +135,14 @@ const DynamicMoodEditorPage = () => {
|
|
|
135
135
|
return !!find(params.moods, m => m.id !== state.mood.id && m.name === state.mood.name);
|
|
136
136
|
}, [state.mood.name]);
|
|
137
137
|
|
|
138
|
+
const showBackDialog = (): boolean => {
|
|
139
|
+
return !isEqual(state.mood, routeParams.currentMood);
|
|
140
|
+
}
|
|
138
141
|
|
|
139
142
|
return (
|
|
140
143
|
<Page
|
|
141
144
|
backText={Strings.getLang('mesh_device_detail_mode')}
|
|
142
|
-
showBackDialog={
|
|
145
|
+
showBackDialog={showBackDialog()}
|
|
143
146
|
backDialogTitle={Strings.getLang(
|
|
144
147
|
params.mode === 'add'
|
|
145
148
|
? 'string_light_pp_dialog_sm_add_headline_c'
|
|
@@ -152,8 +155,10 @@ const DynamicMoodEditorPage = () => {
|
|
|
152
155
|
)}
|
|
153
156
|
headlineText={state.headline}
|
|
154
157
|
rightButtonIcon={getButtonStatus() ? res.ic_uncheck : res.ic_check}
|
|
155
|
-
rightButtonDisabled={getButtonStatus()}
|
|
156
158
|
rightButtonIconClick={async () => {
|
|
159
|
+
if (getButtonStatus()) {
|
|
160
|
+
return
|
|
161
|
+
}
|
|
157
162
|
if (state.loading) return;
|
|
158
163
|
state.loading = true;
|
|
159
164
|
const res = await params.modDeleteMood(params.mode, cloneDeep(state.mood));
|
|
@@ -132,10 +132,14 @@ const MixDynamicMoodEditorPage = () => {
|
|
|
132
132
|
return !!find(params.moods, m => m.id !== state.mood.id && m.name === state.mood.name);
|
|
133
133
|
}, [state.mood.name]);
|
|
134
134
|
|
|
135
|
+
const showBackDialog = (): boolean => {
|
|
136
|
+
return !isEqual(state.mood, routeParams.currentMood);
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
return (
|
|
136
140
|
<Page
|
|
137
141
|
backText={Strings.getLang('mesh_device_detail_mode')}
|
|
138
|
-
showBackDialog={
|
|
142
|
+
showBackDialog={showBackDialog()}
|
|
139
143
|
backDialogTitle={Strings.getLang(
|
|
140
144
|
params.mode === 'add'
|
|
141
145
|
? 'string_light_pp_dialog_sm_add_headline_c'
|
|
@@ -148,8 +152,10 @@ const MixDynamicMoodEditorPage = () => {
|
|
|
148
152
|
)}
|
|
149
153
|
headlineText={state.headline}
|
|
150
154
|
rightButtonIcon={getButtonStatus() ? res.ic_uncheck : res.ic_check}
|
|
151
|
-
rightButtonDisabled={getButtonStatus()}
|
|
152
155
|
rightButtonIconClick={async () => {
|
|
156
|
+
if (getButtonStatus()) {
|
|
157
|
+
return
|
|
158
|
+
}
|
|
153
159
|
if (state.loading) return;
|
|
154
160
|
state.loading = true;
|
|
155
161
|
const newMood = cloneDeep(state.mood)
|
|
@@ -73,6 +73,9 @@ const StaticMoodEditorPage = () => {
|
|
|
73
73
|
}, []);
|
|
74
74
|
|
|
75
75
|
const onRightClick = async () => {
|
|
76
|
+
if (getButtonStatus()) {
|
|
77
|
+
return
|
|
78
|
+
}
|
|
76
79
|
if (state.loading) return;
|
|
77
80
|
state.loading = true;
|
|
78
81
|
const newMood: MoodUIInfo = {
|
|
@@ -120,10 +123,15 @@ const StaticMoodEditorPage = () => {
|
|
|
120
123
|
console.log(params.currentMood, '< --- currentMood --- >')
|
|
121
124
|
}, [JSON.stringify(state.mood)])
|
|
122
125
|
|
|
126
|
+
|
|
127
|
+
const showBackDialog = (): boolean => {
|
|
128
|
+
return !isEqual(state.mood, routeParams.currentMood);
|
|
129
|
+
}
|
|
130
|
+
|
|
123
131
|
return (
|
|
124
132
|
<Page
|
|
125
133
|
backText={I18n.getLang('mesh_device_detail_mode')}
|
|
126
|
-
showBackDialog={
|
|
134
|
+
showBackDialog={showBackDialog()}
|
|
127
135
|
backDialogTitle={I18n.getLang(
|
|
128
136
|
params.mode === 'add'
|
|
129
137
|
? 'string_light_pp_dialog_sm_add_headline_c'
|
|
@@ -136,7 +144,6 @@ const StaticMoodEditorPage = () => {
|
|
|
136
144
|
)}
|
|
137
145
|
headlineText={state.headline}
|
|
138
146
|
rightButtonIcon={getButtonStatus() ? res.ic_uncheck : res.ic_check}
|
|
139
|
-
rightButtonDisabled={getButtonStatus()}
|
|
140
147
|
rightButtonIconClick={onRightClick}
|
|
141
148
|
loading={state.loading}
|
|
142
149
|
>
|