@ledvance/ui-biz-bundle 1.1.166 → 1.1.167

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/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.166",
7
+ "version": "1.1.167",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -88,6 +88,7 @@ export const defFlagList: FlagUiInfo[] = [
88
88
  {
89
89
  id: 249,
90
90
  name: I18n.getLang('country_TR'),
91
+ groupKey: 'latam_2026_d',
91
92
  ...defFlagConfig,
92
93
  colors: [{ h: 360, s: 100, v: 100 }, { h: 360, s: 100, v: 100 }, { h: 0, s: 0, v: 100 }]
93
94
  },
@@ -164,6 +165,7 @@ export const defFlagList: FlagUiInfo[] = [
164
165
  {
165
166
  id: 237,
166
167
  name: I18n.getLang('country_CZ'),
168
+ groupKey: 'latam_2026_a',
167
169
  ...defFlagConfig,
168
170
  colors: [{ h: 360, s: 100, v: 100 }, { h: 0, s: 0, v: 100 }, { h: 211, s: 100, v: 100 }]
169
171
  },
@@ -183,6 +185,7 @@ export const defFlagList: FlagUiInfo[] = [
183
185
  {
184
186
  id: 234,
185
187
  name: I18n.getLang('country_SE'),
188
+ groupKey: 'latam_2026_f',
186
189
  ...defFlagConfig,
187
190
  colors: [{ h: 201, s: 100, v: 100 }, { h: 48, s: 99, v: 100 }, { h: 201, s: 100, v: 100 }]
188
191
  },
@@ -630,6 +633,7 @@ export const defFlagList: FlagUiInfo[] = [
630
633
  {
631
634
  id: 163,
632
635
  name: I18n.getLang('country_BA'),
636
+ groupKey: 'latam_2026_b',
633
637
  ...defFlagConfig,
634
638
  colors: [{"h":0,"s":0,"v":100}, {"h":214,"s":100,"v":42}, {"h":48,"s":100,"v":100}],
635
639
  },
@@ -687,4 +691,18 @@ export const defFlagList: FlagUiInfo[] = [
687
691
  ...defFlagConfig,
688
692
  colors: [{"h":207,"s":100,"v":81}, {"h":0,"s":0,"v":100}, {"h":109,"s":76,"v":69}],
689
693
  },
694
+ {
695
+ id: 154,
696
+ name: I18n.getLang('country_IQ'),
697
+ groupKey: 'latam_2026_i',
698
+ ...defFlagConfig,
699
+ colors: [{"h":353,"s":92,"v":81}, {"h":0,"s":0,"v":100}, {"h":0,"s":0,"v":0}, {"h":150,"s":100,"v":48}],
700
+ },
701
+ {
702
+ id: 153,
703
+ name: I18n.getLang('country_CD'),
704
+ groupKey: 'latam_2026_k',
705
+ ...defFlagConfig,
706
+ colors: [{ h: 200, s: 100, v: 79 }, { h: 49, s: 100, v: 100 }, { h: 356, s: 79, v: 94 },],
707
+ },
690
708
  ]
@@ -87,7 +87,7 @@ const PowerLineChart = (props: PowerLineChartProps) => {
87
87
  }
88
88
  var time = pad(date.getMonth() + 1) + '/' + pad(date.getDate()) + '/' + date.getFullYear() + ' ' +
89
89
  pad(date.getHours()) + ':' + pad(date.getMinutes()) + ':' + pad(date.getSeconds())
90
- return (time + '<br/>' + item.marker + item.seriesName + ': ' + '<b>' + item.value[1] + '</b>')
90
+ return (time + '<br/>' + item.marker + item.seriesName + ': ' + item.value[1])
91
91
  }
92
92
  },
93
93
  grid: {
@@ -346,7 +346,7 @@ const newFixedTime = (isPlug: boolean) => {
346
346
  enable: true,
347
347
  weeks: [0, 0, 0, 0, 0, 0, 0],
348
348
  startTime: startTime,
349
- endTime: startTime + 60,
349
+ endTime: startTime + 30, //Fix https://ledvance.atlassian.net/browse/SUH-12973
350
350
  closeTime: 1,
351
351
  openTime: 1,
352
352
  channel: isPlug ? 0 : 1,
@@ -347,7 +347,7 @@ const newRandomTime = (isPlug: boolean) => {
347
347
  enable: true,
348
348
  weeks: [0, 0, 0, 0, 0, 0, 0],
349
349
  startTime: startTime,
350
- endTime: startTime + 60,
350
+ endTime: startTime + 30, //Fix https://ledvance.atlassian.net/browse/SUH-12973
351
351
  channel: isPlug ? 0 : 1,
352
352
  color: {
353
353
  h: 0,
@@ -1,3 +1,4 @@
1
+ import { xLog } from '@ledvance/base/src/utils'
1
2
  import React, { useCallback, useEffect, useMemo } from 'react';
2
3
  import { ScrollView, Text, StyleSheet, FlatList, View, Image } from 'react-native';
3
4
  import { useNavigation } from '@react-navigation/core';
@@ -14,7 +15,7 @@ import Spacer from '@ledvance/base/src/components/Spacer';
14
15
  import InfoText from '@ledvance/base/src/components/InfoText';
15
16
  import DeleteButton from '@ledvance/base/src/components/DeleteButton';
16
17
  import { useReactive, useUpdateEffect } from 'ahooks';
17
- import {DeviceStateType, SuggestItem, Timer, TimerActions} from './Interface';
18
+ import {DeviceStateType, SuggestItem, Timer, TimerActions, DeviceType, SirenData} from './Interface';
18
19
  import { getTimeSchedule, manageTimeSchedule } from './TimeScheduleActions';
19
20
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
20
21
  import ScheduleCard from './components/ScheduleCard';
@@ -23,7 +24,7 @@ import Tag from '@ledvance/base/src/components/Tag';
23
24
  import { cloneDeep } from 'lodash';
24
25
  import ThemeType from '@ledvance/base/src/config/themeType'
25
26
  import { showDialog } from '@ledvance/base/src/utils/common';
26
- import { ApplyForItem } from '@ledvance/base/src/utils/interface';
27
+ import { AlarmState, ApplyForItem } from '@ledvance/base/src/utils/interface'
27
28
  import FeatureInfo from "@ledvance/base/src/components/FeatureInfo"
28
29
 
29
30
  const { convertX: cx } = Utils.RatioUtils;
@@ -74,6 +75,14 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
74
75
  state.originList,
75
76
  ]);
76
77
 
78
+ const alarmStateValueMap = useMemo(() => {
79
+ return {
80
+ [AlarmState.AlarmSound]: I18n.getLang('siren_alarm_type_sound'),
81
+ [AlarmState.AlarmLight]: I18n.getLang('siren_alarm_type_light'),
82
+ [AlarmState.AlarmSoundAndLight]: I18n.getLang('siren_alarm_type_sound_light'),
83
+ }
84
+ }, [])
85
+
77
86
  useUpdateEffect(() => {
78
87
  const status = state.originList.some(item => item.enable);
79
88
  if (status !== timeScheduleStatus) {
@@ -148,6 +157,51 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
148
157
  });
149
158
  }, []);
150
159
 
160
+ const calculateTagStatus: (item: Timer) => ApplyForItem[] = useCallback((item: Timer) => {
161
+ return params.applyForList.map(tag => {
162
+ const deviceData = params.manualDataDp2Obj(item.dps).deviceData
163
+ if (params.isMixLight && deviceData.type === DeviceType.MixLight) {
164
+ return {
165
+ ...tag,
166
+ enable:
167
+ tag.type === 'mainLight'
168
+ ? deviceData.deviceData.whiteLightSwitch
169
+ : deviceData.deviceData.colorLightSwitch,
170
+ };
171
+ }
172
+ if (item.dps.hasOwnProperty(tag.dp)) {
173
+ return {
174
+ ...tag,
175
+ enable: item.dps[tag.dp],
176
+ };
177
+ }
178
+ return tag;
179
+ }).filter(tag => params.applyForDisabled || item.dps.hasOwnProperty(tag.dp))
180
+ .map(tag => {
181
+ const {isManual, deviceData} = params.manualDataDp2Obj(item.dps)
182
+ let tagName: string;
183
+ if (params.isSiren) {
184
+ tagName = `${tag.key} : ${alarmStateValueMap[(deviceData.deviceData as SirenData).alarmState]}`
185
+ tagName = alarmStateValueMap[(deviceData.deviceData as SirenData).alarmState]
186
+ } else {
187
+ if (isManual) {
188
+ if (tag.enable) {
189
+ tagName = `${tag.key} : ${I18n.getLang(params.isShutter ? 'curtain_summary_action_txt_1' : 'routine_push_msg_on')}`
190
+ } else {
191
+ tagName = `${tag.key} : ${I18n.getLang(params.isShutter ? 'curtain_summary_action_txt_2' : 'watchapp_entitystate_off')}`
192
+ }
193
+ } else {
194
+ tagName = `${tag.key} : ${I18n.getLang('mood_overview_headline_text')}`
195
+ }
196
+
197
+ }
198
+ return {
199
+ ...tag,
200
+ key: tagName,
201
+ };
202
+ });
203
+ }, [])
204
+
151
205
  const styles = StyleSheet.create({
152
206
  overviewDescription: {
153
207
  color: props.theme?.global.fontColor,
@@ -226,8 +280,7 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
226
280
  renderItem={({ item }) => (
227
281
  <ScheduleCard
228
282
  item={item}
229
- tags={params.applyForList}
230
- showTag={params.applyForList.length > 1}
283
+ calculateTagStatus={() => calculateTagStatus(item)}
231
284
  onEnableChange={async enable => {
232
285
  state.loading = true;
233
286
  await modDeleteTimeSchedule('update', {
@@ -1,32 +1,30 @@
1
- import React, { useMemo } from "react";
2
- import { ViewStyle, View, Text, StyleSheet } from "react-native";
3
- import Card from "@ledvance/base/src/components/Card";
4
- import { SwitchButton, Utils } from 'tuya-panel-kit';
5
- import { convertTo12HourFormat, loopText } from '@ledvance/base/src/utils/common';
6
- import { ApplyForItem, Timer } from "../Interface";
7
- import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
1
+ import React, { useMemo } from 'react'
2
+ import { ViewStyle, View, Text, StyleSheet } from 'react-native'
3
+ import Card from '@ledvance/base/src/components/Card'
4
+ import { SwitchButton, Utils } from 'tuya-panel-kit'
5
+ import { convertTo12HourFormat, loopText } from '@ledvance/base/src/utils/common'
6
+ import { ApplyForItem } from '@ledvance/base/src/utils/interface'
7
+ import { useSystemTimeFormate } from '@ledvance/base/src/models/modules/NativePropsSlice'
8
8
  import ThemeType from '@ledvance/base/src/config/themeType'
9
- import Spacer from "@ledvance/base/src/components/Spacer";
10
- const { convertX: cx } = Utils.RatioUtils;
9
+ import { Timer } from '../Interface'
10
+
11
+ const { convertX: cx } = Utils.RatioUtils
11
12
  const { withTheme } = Utils.ThemeUtils
12
13
 
13
14
  interface ScheduleCardProps {
14
15
  theme?: ThemeType
15
16
  item: Timer
16
17
  style?: ViewStyle
17
- showTag?: boolean
18
- tags: ApplyForItem[]
18
+ calculateTagStatus: () => ApplyForItem[]
19
19
  onEnableChange: (enable: boolean) => void
20
20
  onPress: (item: any) => void
21
21
  onLongPress?: (item: any) => void
22
22
  }
23
23
 
24
24
  const ScheduleCard = (props: ScheduleCardProps) => {
25
- const { item, style, showTag, tags, onEnableChange, onPress, onLongPress } = props;
25
+ const { item, style, calculateTagStatus, onEnableChange, onPress, onLongPress } = props
26
26
  const is24HourClock = useSystemTimeFormate()
27
- const showTags = useMemo(() => {
28
- return tags.filter(tag => item.dps.hasOwnProperty(tag.dp))
29
- }, [tags, item.dps])
27
+ const tags = useMemo(() => calculateTagStatus(), [item.dps])
30
28
 
31
29
  const styles = StyleSheet.create({
32
30
  card: {
@@ -87,15 +85,15 @@ const ScheduleCard = (props: ScheduleCardProps) => {
87
85
  // fontFamily: 'PingFangSC-Medium',
88
86
  color: '#000'
89
87
  },
90
- });
88
+ })
91
89
  return (
92
90
  <Card
93
91
  style={styles.card}
94
92
  containerStyle={[style]}
95
93
  onPress={() => {
96
- onPress(item);
94
+ onPress(item)
97
95
  }}
98
- onLongPress={() =>{
96
+ onLongPress={() => {
99
97
  onLongPress && onLongPress(item)
100
98
  }}
101
99
  >
@@ -112,20 +110,20 @@ const ScheduleCard = (props: ScheduleCardProps) => {
112
110
  value={item.enable}
113
111
  thumbStyle={{ elevation: 0 }}
114
112
  onValueChange={() => {
115
- onEnableChange(!item.enable);
113
+ onEnableChange(!item.enable)
116
114
  }}
117
115
  />
118
116
  </View>
119
117
  </View>
120
- {showTag ? <View style={styles.typeContainer}>
121
- {showTags.map(tag => (
118
+ <View style={styles.typeContainer}>
119
+ {tags.map(tag => (
122
120
  <View style={styles.tag} key={tag.dp}>
123
121
  <Text style={styles.tagTitle}>
124
122
  {tag.key}
125
123
  </Text>
126
124
  </View>
127
125
  ))}
128
- </View> : <Spacer height={cx(16)} />}
126
+ </View>
129
127
  </Card>
130
128
  )
131
129