@ledvance/ui-biz-bundle 1.1.3 → 1.1.6
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/BiorhythmEditPage.tsx +1 -0
- package/src/modules/fixedTime/FixedTimeDetailPage.tsx +1 -0
- package/src/modules/mood/DynamicMoodEditorPage.tsx +5 -5
- package/src/modules/mood/FantasyMoodEditPage.tsx +6 -7
- package/src/modules/mood/MoodPage.tsx +38 -47
- package/src/modules/mood/StaticMoodEditorPage.tsx +6 -7
- package/src/modules/randomTime/RandomTimeDetailPage.tsx +1 -0
- package/src/modules/sleepWakeup/SleepWakeUpDetailPage.tsx +1 -0
- package/src/modules/timeSchedule/MoodSetting.tsx +2 -0
- package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +1 -0
package/package.json
CHANGED
|
@@ -181,6 +181,7 @@ const BiorhythmEditPage = () => {
|
|
|
181
181
|
<TextField
|
|
182
182
|
value={state.name}
|
|
183
183
|
showError={state.name?.length > 32}
|
|
184
|
+
maxLength={33}
|
|
184
185
|
errorText={I18n.getLang('add_new_dynamic_mood_alert_text')}
|
|
185
186
|
placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
|
|
186
187
|
onChangeText={text => {
|
|
@@ -138,6 +138,7 @@ const FixedTimeDetailPage = () => {
|
|
|
138
138
|
style={styles.cardContainer}
|
|
139
139
|
value={state.fixedTime.name}
|
|
140
140
|
showError={state.fixedTime.name?.length > 32}
|
|
141
|
+
maxLength={33}
|
|
141
142
|
errorText={I18n.getLang('add_new_dynamic_mood_alert_text')}
|
|
142
143
|
placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
|
|
143
144
|
onChangeText={(t: string) => {
|
|
@@ -5,7 +5,7 @@ import {useNavigation, useRoute} from '@react-navigation/native'
|
|
|
5
5
|
import {StackNavigationProp} from '@react-navigation/stack'
|
|
6
6
|
import React, {useCallback, useEffect, useMemo} from 'react'
|
|
7
7
|
import {useReactive} from 'ahooks'
|
|
8
|
-
import {COLOUR, useWorkMode, WHITE} from 'hooks/DeviceDpStateHooks'
|
|
8
|
+
import {COLOUR, SCENE, useWorkMode, WHITE} from 'hooks/DeviceDpStateHooks'
|
|
9
9
|
import {hsv2Hex, mapFloatToRange} from '@ledvance/base/src/utils'
|
|
10
10
|
import {cctToColor} from '@ledvance/base/src/utils/cctUtils'
|
|
11
11
|
import res from '@ledvance/base/src/res'
|
|
@@ -38,7 +38,7 @@ const DynamicMoodEditorPage = () => {
|
|
|
38
38
|
const moduleParams = params.moduleParams
|
|
39
39
|
const deviceId = useDeviceId()
|
|
40
40
|
const [moodId, setScene] = useScene(moduleParams.sceneDpCode)
|
|
41
|
-
const [, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
41
|
+
const [workMode, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
42
42
|
const isUVCFan = isUVCFanDevice()
|
|
43
43
|
const role = useRole()
|
|
44
44
|
const state = useReactive<DynamicMoodEditorPageState>({
|
|
@@ -47,7 +47,7 @@ const DynamicMoodEditorPage = () => {
|
|
|
47
47
|
currentNode: params.currentMood.nodes[params.currentMood.nodes.length - 1],
|
|
48
48
|
paintBucketSelected: false,
|
|
49
49
|
})
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
state.headline = Strings.getLang(params.mode ? 'add_new_dynamic_mood_headline_text' : 'edit_static_mood_headline_text')
|
|
53
53
|
}, [params.mode])
|
|
@@ -101,7 +101,7 @@ const DynamicMoodEditorPage = () => {
|
|
|
101
101
|
)
|
|
102
102
|
if (saveRes.success) {
|
|
103
103
|
if (list.length > 0) {
|
|
104
|
-
if (isDelete && currentMood.id === moodId) {
|
|
104
|
+
if (isDelete && currentMood.id === moodId && workMode === SCENE) {
|
|
105
105
|
const setSceneRes = await setScene(
|
|
106
106
|
deviceId,
|
|
107
107
|
list[0],
|
|
@@ -419,7 +419,7 @@ const DynamicMoodEditorPage = () => {
|
|
|
419
419
|
state.mood.fanSpeed = fanSpeed
|
|
420
420
|
}}
|
|
421
421
|
style={styles.fanAdjustCard}/>}
|
|
422
|
-
{params.mode === 'edit' &&
|
|
422
|
+
{params.mode === 'edit' &&
|
|
423
423
|
<View style={{marginTop: cx(20), marginHorizontal: cx(24)}}>
|
|
424
424
|
<TextButton
|
|
425
425
|
style={styles.deleteBtn}
|
|
@@ -4,7 +4,7 @@ import { useNavigation, useRoute } from '@react-navigation/native'
|
|
|
4
4
|
import { StackNavigationProp } from '@react-navigation/stack'
|
|
5
5
|
import React, { useCallback, useEffect, useMemo } from 'react'
|
|
6
6
|
import { useReactive } from 'ahooks'
|
|
7
|
-
import { useWorkMode, COLOUR } from 'hooks/DeviceDpStateHooks'
|
|
7
|
+
import { useWorkMode, COLOUR, SCENE } from 'hooks/DeviceDpStateHooks'
|
|
8
8
|
import { hsv2Hex, mapFloatToRange } from '@ledvance/base/src/utils'
|
|
9
9
|
import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
|
|
10
10
|
import res from '@ledvance/base/src/res'
|
|
@@ -16,7 +16,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
|
|
|
16
16
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView'
|
|
17
17
|
import { Utils } from 'tuya-panel-kit'
|
|
18
18
|
import LdvSlider from '@ledvance/base/src/components/ldvSlider'
|
|
19
|
-
import { useDeviceId
|
|
19
|
+
import { useDeviceId } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
20
20
|
import TextButton from '@ledvance/base/src/components/TextButton'
|
|
21
21
|
import { stringLightSceneMode, stripLightSceneMode, StripSceneUIState, StripNodeInfo, StripLightSceneMode } from '../scene/SceneInfo'
|
|
22
22
|
import TextFieldStyleButton from '@ledvance/base/src/components/TextFieldStyleButton'
|
|
@@ -49,9 +49,8 @@ const FantasyMoodEditPage = () => {
|
|
|
49
49
|
const params = cloneDeep(routeParams)
|
|
50
50
|
const moduleParams = params.moduleParams
|
|
51
51
|
const deviceId = useDeviceId()
|
|
52
|
-
const [, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
52
|
+
const [workMode, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
53
53
|
const [, setFantasyScene] = useFantasyScene(params.moduleParams.sceneDpCode, params.moduleParams.workModeDpCode, params.moduleParams.switchLedDpCode, moduleParams.isStringLight)
|
|
54
|
-
const role = useRole()
|
|
55
54
|
const state = useReactive<FantasyMoodEditPageState>({
|
|
56
55
|
headline: '',
|
|
57
56
|
mood: params.currentMood,
|
|
@@ -59,7 +58,6 @@ const FantasyMoodEditPage = () => {
|
|
|
59
58
|
paintBucketSelected: false,
|
|
60
59
|
sceneMode: params.moduleParams.isStringLight ? stringLightSceneMode : stripLightSceneMode
|
|
61
60
|
})
|
|
62
|
-
const canDelete = useMemo(() => (role === 0 || role === 2), [role])
|
|
63
61
|
|
|
64
62
|
useEffect(() => {
|
|
65
63
|
state.headline = I18n.getLang(params.mode === 'add' ? 'add_new_dynamic_mood_headline_text' : 'edit_static_mood_headline_text')
|
|
@@ -108,7 +106,7 @@ const FantasyMoodEditPage = () => {
|
|
|
108
106
|
const saveRes = await saveFantasyScene(deviceId, params.moduleParams.featureId, list, moduleParams.isStringLight)
|
|
109
107
|
if (saveRes.success) {
|
|
110
108
|
if (list.length > 0) {
|
|
111
|
-
if (isDelete) {
|
|
109
|
+
if (isDelete && workMode === SCENE) {
|
|
112
110
|
await setFantasyScene(list[0])
|
|
113
111
|
} else {
|
|
114
112
|
await setFantasyScene(currentMood)
|
|
@@ -189,6 +187,7 @@ const FantasyMoodEditPage = () => {
|
|
|
189
187
|
state.mood.name = text
|
|
190
188
|
}}
|
|
191
189
|
showError={state.mood.name.length > 32 || nameRepeat}
|
|
190
|
+
maxLength={33}
|
|
192
191
|
tipColor={nameRepeat ? '#f00' : undefined}
|
|
193
192
|
tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
|
|
194
193
|
errorText={I18n.getLang(nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text')} />
|
|
@@ -425,7 +424,7 @@ const FantasyMoodEditPage = () => {
|
|
|
425
424
|
}} />
|
|
426
425
|
</Card>
|
|
427
426
|
<Spacer />
|
|
428
|
-
{params.mode === 'edit' &&
|
|
427
|
+
{params.mode === 'edit' &&
|
|
429
428
|
<View style={{ marginTop: cx(20), marginHorizontal: cx(24) }}>
|
|
430
429
|
<TextButton
|
|
431
430
|
style={styles.deleteBtn}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, {useCallback, useEffect} from 'react'
|
|
1
|
+
import React, { useCallback, useEffect } from 'react'
|
|
2
2
|
import Page from '@ledvance/base/src/components/Page'
|
|
3
|
-
import {Utils} from 'tuya-panel-kit'
|
|
4
|
-
import {ScenePageUIState, SceneUIState} from '../scene/SceneInfo'
|
|
5
|
-
import {getRemoteSceneList, useScene} from '../scene/SceneAction'
|
|
6
|
-
import {SCENE, useWorkMode} from '../../hooks/DeviceDpStateHooks'
|
|
7
|
-
import {isUVCFanDevice, useDeviceInfo} from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
8
|
-
import {useReactive, useUpdateEffect} from 'ahooks'
|
|
3
|
+
import { Utils } from 'tuya-panel-kit'
|
|
4
|
+
import { ScenePageUIState, SceneUIState } from '../scene/SceneInfo'
|
|
5
|
+
import { getRemoteSceneList, useScene } from '../scene/SceneAction'
|
|
6
|
+
import { SCENE, useWorkMode } from '../../hooks/DeviceDpStateHooks'
|
|
7
|
+
import { isUVCFanDevice, useDeviceInfo } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
8
|
+
import { useReactive, useUpdateEffect } from 'ahooks'
|
|
9
9
|
import Strings from '@ledvance/base/src/i18n'
|
|
10
10
|
import res from '@ledvance/base/src/res'
|
|
11
|
-
import {FlatList, StyleSheet, View} from 'react-native'
|
|
11
|
+
import { FlatList, StyleSheet, View, Platform } from 'react-native'
|
|
12
12
|
import Tag from '@ledvance/base/src/components/Tag'
|
|
13
13
|
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
14
14
|
import InfoText from '@ledvance/base/src/components/InfoText'
|
|
15
15
|
import CustomListDialog from '@ledvance/base/src/components/CustomListDialog'
|
|
16
16
|
import MoodItem from './MoodItem'
|
|
17
|
-
import {toAddMoodPage, toDynamicMoodEditorPage, toStaticMoodEditorPage} from '../../navigation/tools'
|
|
18
|
-
import {useNavigation, useRoute} from '@react-navigation/core'
|
|
17
|
+
import { toAddMoodPage, toDynamicMoodEditorPage, toStaticMoodEditorPage } from '../../navigation/tools'
|
|
18
|
+
import { useNavigation, useRoute } from '@react-navigation/core'
|
|
19
19
|
|
|
20
20
|
const cx = Utils.RatioUtils.convertX
|
|
21
21
|
|
|
@@ -129,12 +129,12 @@ const MoodPage = () => {
|
|
|
129
129
|
}, [state.flag, sceneId])
|
|
130
130
|
|
|
131
131
|
// 修改之前版本错误mood数据
|
|
132
|
-
const checkMoodData = useCallback((mood: SceneUIState) =>{
|
|
133
|
-
mood.nodes.forEach(node =>{
|
|
134
|
-
if(node.isColorNode){
|
|
132
|
+
const checkMoodData = useCallback((mood: SceneUIState) => {
|
|
133
|
+
mood.nodes.forEach(node => {
|
|
134
|
+
if (node.isColorNode) {
|
|
135
135
|
node.brightness = 0
|
|
136
136
|
node.colorTemp = 0
|
|
137
|
-
}else{
|
|
137
|
+
} else {
|
|
138
138
|
node.h = 0
|
|
139
139
|
node.s = 0
|
|
140
140
|
node.v = 0
|
|
@@ -159,30 +159,30 @@ const MoodPage = () => {
|
|
|
159
159
|
text={Strings.getLang('mood_overview_filter_name_text1')}
|
|
160
160
|
onCheckedChange={checked => {
|
|
161
161
|
state.staticTagChecked = checked
|
|
162
|
-
}}/>
|
|
163
|
-
<Spacer width={cx(8)} height={0}/>
|
|
162
|
+
}} />
|
|
163
|
+
<Spacer width={cx(8)} height={0} />
|
|
164
164
|
<Tag
|
|
165
165
|
checked={state.dynamicTagChecked}
|
|
166
166
|
text={Strings.getLang('mood_overview_filter_name_text2')}
|
|
167
167
|
onCheckedChange={checked => {
|
|
168
168
|
state.dynamicTagChecked = checked
|
|
169
|
-
}}/>
|
|
169
|
+
}} />
|
|
170
170
|
</View>
|
|
171
|
-
<Spacer height={cx(10)}/>
|
|
171
|
+
<Spacer height={cx(10)} />
|
|
172
172
|
{
|
|
173
173
|
state.scenes.length >= MAX_MOOD_COUNT &&
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
<View style={styles.infoLine}>
|
|
175
|
+
<Spacer height={cx(10)} />
|
|
176
|
+
<InfoText
|
|
177
|
+
icon={res.ic_warning_amber}
|
|
178
|
+
text={Strings.getLang('mood_overview_warning_max_number_text')}
|
|
179
|
+
contentColor={'#ff9500'} />
|
|
180
|
+
<Spacer height={cx(6)} />
|
|
181
|
+
</View>
|
|
182
182
|
}
|
|
183
183
|
<FlatList
|
|
184
184
|
data={state.filteredMoods}
|
|
185
|
-
renderItem={({item}) => {
|
|
185
|
+
renderItem={({ item }) => {
|
|
186
186
|
return (
|
|
187
187
|
<MoodItem
|
|
188
188
|
enable={workMode === SCENE && state.currentScene?.id === item.id}
|
|
@@ -227,21 +227,13 @@ const MoodPage = () => {
|
|
|
227
227
|
)
|
|
228
228
|
state.currentScene = checkMoodData(item)
|
|
229
229
|
state.loading = false
|
|
230
|
-
}}/>
|
|
230
|
+
}} />
|
|
231
231
|
)
|
|
232
232
|
}}
|
|
233
|
-
ListHeaderComponent={() => (<Spacer height={cx(10)}/>)}
|
|
234
|
-
ItemSeparatorComponent={() => (<Spacer/>)}
|
|
235
|
-
ListFooterComponent={() => (
|
|
236
|
-
|
|
237
|
-
<Spacer/>
|
|
238
|
-
<InfoText
|
|
239
|
-
icon={res.ic_info}
|
|
240
|
-
text={Strings.getLang('mood_overview_information_text')}/>
|
|
241
|
-
<Spacer height={cx(40)}/>
|
|
242
|
-
</View>
|
|
243
|
-
)}
|
|
244
|
-
keyExtractor={item => `${item.id}`}/>
|
|
233
|
+
ListHeaderComponent={() => (<Spacer height={cx(10)} />)}
|
|
234
|
+
ItemSeparatorComponent={() => (<Spacer />)}
|
|
235
|
+
ListFooterComponent={() => (<Spacer />)}
|
|
236
|
+
keyExtractor={item => `${item.id}`} />
|
|
245
237
|
</Page>
|
|
246
238
|
<CustomListDialog
|
|
247
239
|
show={state.showAddMoodPopover}
|
|
@@ -260,7 +252,7 @@ const MoodPage = () => {
|
|
|
260
252
|
value: false,
|
|
261
253
|
},
|
|
262
254
|
]}
|
|
263
|
-
onItemPress={onAddMoodDialogItemClick}/>
|
|
255
|
+
onItemPress={onAddMoodDialogItemClick} />
|
|
264
256
|
</>
|
|
265
257
|
)
|
|
266
258
|
}
|
|
@@ -274,15 +266,14 @@ const styles = StyleSheet.create({
|
|
|
274
266
|
marginHorizontal: cx(24),
|
|
275
267
|
},
|
|
276
268
|
addMoodPopover: {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
269
|
+
position: 'absolute',
|
|
270
|
+
right: cx(60),
|
|
271
|
+
top: Platform.OS === 'android' ? cx(90) : cx(130),
|
|
272
|
+
maxWidth: cx(200),
|
|
281
273
|
backgroundColor: '#fff',
|
|
282
274
|
},
|
|
283
275
|
popoverItem: {
|
|
284
|
-
|
|
285
|
-
height: cx(45),
|
|
276
|
+
padding: cx(5),
|
|
286
277
|
alignItems: 'flex-start',
|
|
287
278
|
},
|
|
288
279
|
})
|
|
@@ -9,13 +9,13 @@ import {ScrollView, StyleSheet, Text, View} from 'react-native'
|
|
|
9
9
|
import Card from '@ledvance/base/src/components/Card'
|
|
10
10
|
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
11
11
|
import {hsv2Hex, mapFloatToRange} from '@ledvance/base/src/utils'
|
|
12
|
-
import {COLOUR, useWorkMode, WHITE} from '../../hooks/DeviceDpStateHooks'
|
|
12
|
+
import {COLOUR, SCENE, useWorkMode, WHITE} from '../../hooks/DeviceDpStateHooks'
|
|
13
13
|
import {cctToColor} from '@ledvance/base/src/utils/cctUtils'
|
|
14
14
|
import res from '@ledvance/base/src/res'
|
|
15
15
|
import {cloneDeep, find, isEqual} from 'lodash'
|
|
16
16
|
import TextButton from '@ledvance/base/src/components/TextButton'
|
|
17
17
|
import {saveScene, useScene} from '../scene/SceneAction'
|
|
18
|
-
import {useDeviceId, useFanMaxSpeed
|
|
18
|
+
import {useDeviceId, useFanMaxSpeed} from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
19
19
|
import {SceneNodeInfo, SceneUIState} from '../scene/SceneInfo'
|
|
20
20
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView'
|
|
21
21
|
import FanAdjustView from '@ledvance/base/src/components/FanAdjustView'
|
|
@@ -45,16 +45,15 @@ const StaticMoodEditorPage = () => {
|
|
|
45
45
|
const params = cloneDeep(routeParams)
|
|
46
46
|
const moduleParams = params.moduleParams
|
|
47
47
|
const deviceId = useDeviceId()
|
|
48
|
-
const role = useRole()
|
|
49
48
|
const [moodId, setScene] = useScene(moduleParams.sceneDpCode)
|
|
50
|
-
const [, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
49
|
+
const [workMode, setWorkMode] = useWorkMode(moduleParams.workModeDpCode)
|
|
51
50
|
|
|
52
51
|
const state = useReactive<StaticMoodEditorPageState>({
|
|
53
52
|
headline: '',
|
|
54
53
|
mood: params.currentMood,
|
|
55
54
|
currentNode: params.currentMood.nodes[0],
|
|
56
55
|
})
|
|
57
|
-
|
|
56
|
+
|
|
58
57
|
useEffect(() => {
|
|
59
58
|
state.headline = Strings.getLang(params.mode === 'add' ? 'add_new_static_mood_headline_text' : 'edit_static_mood_headline_text')
|
|
60
59
|
}, [params.mode])
|
|
@@ -103,7 +102,7 @@ const StaticMoodEditorPage = () => {
|
|
|
103
102
|
)
|
|
104
103
|
if (saveRes.success) {
|
|
105
104
|
if (list.length > 0) {
|
|
106
|
-
if (isDelete && currentMood.id === moodId) {
|
|
105
|
+
if (isDelete && currentMood.id === moodId && workMode === SCENE) {
|
|
107
106
|
const setSceneRes = await setScene(
|
|
108
107
|
deviceId,
|
|
109
108
|
list[0],
|
|
@@ -242,7 +241,7 @@ const StaticMoodEditorPage = () => {
|
|
|
242
241
|
state.mood.fanSpeed = fanSpeed
|
|
243
242
|
}}
|
|
244
243
|
style={styles.fanAdjustCard}/>}
|
|
245
|
-
{params.mode === 'edit' &&
|
|
244
|
+
{params.mode === 'edit' &&
|
|
246
245
|
<View style={{marginTop: cx(20), marginHorizontal: cx(24)}}>
|
|
247
246
|
<TextButton
|
|
248
247
|
style={styles.deleteBtn}
|
|
@@ -119,6 +119,7 @@ const RandomTimeDetailPage = () => {
|
|
|
119
119
|
style={styles.cardContainer}
|
|
120
120
|
value={state.randomTime.name}
|
|
121
121
|
showError={state.randomTime.name?.length > 32}
|
|
122
|
+
maxLength={33}
|
|
122
123
|
errorText={I18n.getLang('add_new_dynamic_mood_alert_text')}
|
|
123
124
|
placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
|
|
124
125
|
onChangeText={(t: string) => {
|
|
@@ -301,6 +301,7 @@ const SleepWakeUpDetailPage = () => {
|
|
|
301
301
|
style={styles.cardContainer}
|
|
302
302
|
value={state.name}
|
|
303
303
|
showError={state.name?.length > 32}
|
|
304
|
+
maxLength={33}
|
|
304
305
|
errorText={I18n.getLang('add_new_dynamic_mood_alert_text')}
|
|
305
306
|
placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
|
|
306
307
|
onChangeText={(t: string) => {
|