@ledvance/group-ui-biz-bundle 1.0.1 → 1.0.2

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.1",
7
+ "version": "1.0.2",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -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 = [] as string[]
232
- const on = [] as string[]
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(I18n.getLang('light_sources_tile_tw_lighting_headline'))
236
+ on.push(s)
236
237
  } else {
237
- off.push(I18n.getLang('light_sources_tile_tw_lighting_headline'))
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(I18n.getLang('feature_summary_action_component_5'))
244
+ on.push(s)
243
245
  } else {
244
- off.push(I18n.getLang('feature_summary_action_component_5'))
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(I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline'))
276
+ on.push(s)
250
277
  } else {
251
- off.push(I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline'))
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}>