@ledvance/group-ui-biz-bundle 1.0.1 → 1.0.3
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
CHANGED
|
@@ -8,7 +8,7 @@ import { useDeviceInfo, useMoods, useUAGroupInfo } from '@ledvance/base/src/mode
|
|
|
8
8
|
import { useReactive } 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'
|
|
@@ -306,15 +306,14 @@ const styles = StyleSheet.create({
|
|
|
306
306
|
marginHorizontal: cx(24),
|
|
307
307
|
},
|
|
308
308
|
addMoodPopover: {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
position: 'absolute',
|
|
310
|
+
right: cx(60),
|
|
311
|
+
top: Platform.OS === 'android' ? cx(90) : cx(130),
|
|
312
|
+
maxWidth: cx(200),
|
|
313
313
|
backgroundColor: '#fff',
|
|
314
314
|
},
|
|
315
315
|
popoverItem: {
|
|
316
|
-
|
|
317
|
-
height: cx(45),
|
|
316
|
+
padding: cx(5),
|
|
318
317
|
alignItems: 'flex-start',
|
|
319
318
|
},
|
|
320
319
|
})
|
|
@@ -89,4 +89,14 @@ export const fanModeOption = [
|
|
|
89
89
|
label: I18n.getLang('ceiling_fan_mode_info_option_2_headline'),
|
|
90
90
|
value: UVCFanMode.Nature,
|
|
91
91
|
},
|
|
92
|
-
]
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
export const actionOption = {
|
|
95
|
+
switchLed: I18n.getLang('light_sources_tile_tw_lighting_headline'),
|
|
96
|
+
switchSocket: I18n.getLang('feature_summary_action_component_5'),
|
|
97
|
+
switchSocket1: I18n.getLang('feature_summary_action_component_6'),
|
|
98
|
+
switchSocket2: I18n.getLang('feature_summary_action_component_7'),
|
|
99
|
+
switchSocket3: I18n.getLang('feature_summary_action_component_8'),
|
|
100
|
+
switchSocket4: I18n.getLang('feature_summary_action_component_9'),
|
|
101
|
+
switchFan: I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline'),
|
|
102
|
+
}
|
|
@@ -31,7 +31,7 @@ import StripAdjustView, { ColorList } from "@ledvance/base/src/components/StripA
|
|
|
31
31
|
import SocketItem from '@ledvance/base/src/components/SocketItem'
|
|
32
32
|
import { WorkMode } from "@ledvance/base/src/utils/interface";
|
|
33
33
|
import { Buffer } from 'buffer'
|
|
34
|
-
import { fanModeOption } from "./TimeScheduleActions";
|
|
34
|
+
import { fanModeOption, actionOption } from "./TimeScheduleActions";
|
|
35
35
|
|
|
36
36
|
const { convertX: cx } = Utils.RatioUtils;
|
|
37
37
|
const { toFixedString } = Utils.NumberUtils;
|
|
@@ -175,7 +175,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
175
175
|
if (props.colorDataDp2Obj) {
|
|
176
176
|
const color = props.colorDataDp2Obj(dps[props.colorDataCode])
|
|
177
177
|
state.hsv = cloneDeep(color)
|
|
178
|
-
if(props.isMatterLight && props.brightValueCode && dps.hasOwnProperty(props.brightValueCode) && props.brightValueParser){
|
|
178
|
+
if (props.isMatterLight && props.brightValueCode && dps.hasOwnProperty(props.brightValueCode) && props.brightValueParser) {
|
|
179
179
|
state.hsv.v = props.brightValueParser(dps[props.brightValueCode])
|
|
180
180
|
}
|
|
181
181
|
} else {
|
|
@@ -228,33 +228,60 @@ const TimeScheduleDetailPage = () => {
|
|
|
228
228
|
}, [])
|
|
229
229
|
|
|
230
230
|
const getActionOnOff = useMemo(() => {
|
|
231
|
-
const off
|
|
232
|
-
const on
|
|
231
|
+
const off: string[] = []
|
|
232
|
+
const on: string[] = []
|
|
233
233
|
if (props.switchLedCode) {
|
|
234
|
+
const s = actionOption['switchLed']
|
|
234
235
|
if (state.switchLed) {
|
|
235
|
-
on.push(
|
|
236
|
+
on.push(s)
|
|
236
237
|
} else {
|
|
237
|
-
off.push(
|
|
238
|
+
off.push(s)
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
241
|
if (props.switchSocket1) {
|
|
242
|
+
const s = isPowerStrip ? actionOption['switchSocket1'] : actionOption['switchSocket']
|
|
241
243
|
if (state.switchSocket1) {
|
|
242
|
-
on.push(
|
|
244
|
+
on.push(s)
|
|
243
245
|
} else {
|
|
244
|
-
off.push(
|
|
246
|
+
off.push(s)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (props.switchSocket2) {
|
|
250
|
+
const s = actionOption['switchSocket2']
|
|
251
|
+
if (state.switchSocket2) {
|
|
252
|
+
on.push(s)
|
|
253
|
+
} else {
|
|
254
|
+
off.push(s)
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (props.switchSocket3) {
|
|
258
|
+
const s = actionOption['switchSocket3']
|
|
259
|
+
if (state.switchSocket3) {
|
|
260
|
+
on.push(s)
|
|
261
|
+
} else {
|
|
262
|
+
off.push(s)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (props.switchSocketUSB) {
|
|
266
|
+
const s = actionOption['switchSocket4']
|
|
267
|
+
if (state.switchSocketUSB) {
|
|
268
|
+
on.push(s)
|
|
269
|
+
} else {
|
|
270
|
+
off.push(s)
|
|
245
271
|
}
|
|
246
272
|
}
|
|
247
273
|
if (props.switchFan) {
|
|
274
|
+
const s = actionOption['switchFan']
|
|
248
275
|
if (state.switchFan) {
|
|
249
|
-
on.push(
|
|
276
|
+
on.push(s)
|
|
250
277
|
} else {
|
|
251
|
-
off.push(
|
|
278
|
+
off.push(s)
|
|
252
279
|
}
|
|
253
280
|
}
|
|
254
281
|
return {
|
|
255
282
|
on, off
|
|
256
283
|
}
|
|
257
|
-
}, [state.switchLed, state.switchSocket1, state.switchFan])
|
|
284
|
+
}, [state.switchLed, state.switchSocket1, state.switchSocket2, state.switchSocket3, state.switchSocketUSB, state.switchFan])
|
|
258
285
|
|
|
259
286
|
const getActions = useCallback(() => {
|
|
260
287
|
const actions = {
|
|
@@ -283,7 +310,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
283
310
|
}
|
|
284
311
|
if (props.colorDataObj2Dp) {
|
|
285
312
|
actions.dps[props.colorDataCode] = props.colorDataObj2Dp(hsv)
|
|
286
|
-
if(props.isMatterLight && props.brightValueCode && props.brightValueFormatter) {
|
|
313
|
+
if (props.isMatterLight && props.brightValueCode && props.brightValueFormatter) {
|
|
287
314
|
actions.dps[props.brightValueCode] = props.brightValueFormatter(state.hsv.v)
|
|
288
315
|
}
|
|
289
316
|
} else {
|
|
@@ -713,10 +740,10 @@ const TimeScheduleDetailPage = () => {
|
|
|
713
740
|
textStyle={styles.leftTitle}
|
|
714
741
|
style={styles.summaryLeft}
|
|
715
742
|
/>
|
|
716
|
-
<View style={{ marginLeft: cx(16) }}>
|
|
743
|
+
<View style={{ marginLeft: cx(16), flex: 1 }}>
|
|
717
744
|
{!!getActionOnOff.on.length && <View>
|
|
718
745
|
<Text style={{ marginLeft: cx(5) }}>{I18n.getLang('feature_summary_action_txt_1')}</Text>
|
|
719
|
-
<View style={{ flexDirection: 'row' }}>{
|
|
746
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>{
|
|
720
747
|
getActionOnOff.on.map(item => (
|
|
721
748
|
<View style={[styles.summaryRight, { marginLeft: cx(5), marginBottom: cx(5) }]}
|
|
722
749
|
key={item}>
|
|
@@ -728,7 +755,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
728
755
|
</View>}
|
|
729
756
|
{!!getActionOnOff.off.length && <View>
|
|
730
757
|
<Text style={{ marginLeft: cx(5) }}>{I18n.getLang('feature_summary_action_txt_2')}</Text>
|
|
731
|
-
<View style={{ flexDirection: 'row' }}>{
|
|
758
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>{
|
|
732
759
|
getActionOnOff.off.map(item => (
|
|
733
760
|
<View style={[styles.summaryRight, { marginLeft: cx(5), marginBottom: cx(5) }]}
|
|
734
761
|
key={item}>
|
|
@@ -235,7 +235,7 @@ function ActiveTimerItem(task: TimerTask, onCancel: () => void) {
|
|
|
235
235
|
size={cx(24)}
|
|
236
236
|
strokeWidth={cx(2)}/>
|
|
237
237
|
<Spacer width={cx(16)}/>
|
|
238
|
-
<Text style={styles.activeTaskTimeText}>{
|
|
238
|
+
<Text style={styles.activeTaskTimeText}>{timeFormat(task.timeLeft)}</Text>
|
|
239
239
|
<Spacer width={cx(20)}/>
|
|
240
240
|
</View>
|
|
241
241
|
<Spacer/>
|
|
@@ -316,7 +316,7 @@ const styles = StyleSheet.create({
|
|
|
316
316
|
fontSize: cx(14),
|
|
317
317
|
},
|
|
318
318
|
activeTaskHeadLineBtn: {
|
|
319
|
-
|
|
319
|
+
minWidth: cx(50),
|
|
320
320
|
height: cx(24),
|
|
321
321
|
padding: 0,
|
|
322
322
|
backgroundColor: '#666',
|