@ledvance/ui-biz-bundle 1.1.84 → 1.1.86

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.84",
7
+ "version": "1.1.86",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Platform, View, StyleSheet, Image, Text } from "react-native";
2
+ import { Platform, View, StyleSheet, Image } from "react-native";
3
3
  import { useRoute } from '@react-navigation/core'
4
4
  import Page from "@ledvance/base/src/components/Page";
5
5
  import res from "@ledvance/base/src/res";
@@ -9,6 +9,7 @@ import BarChart from "./component/BarChart";
9
9
  import { exportFile } from "@ledvance/base/src/utils/common";
10
10
  import { OverviewItem } from "./EnergyConsumptionPage";
11
11
  import Spacer from "@ledvance/base/src/components/Spacer";
12
+ import InfoText from "@ledvance/base/src/components/InfoText";
12
13
 
13
14
  const { convertX: cx, height, width } = Utils.RatioUtils
14
15
 
@@ -23,12 +24,11 @@ export interface EnergyConsumptionChartProps {
23
24
  const EnergyConsumptionChart = () => {
24
25
  const props = useRoute().params as EnergyConsumptionChartProps
25
26
  const computeNum = Platform.OS === 'ios' && 180 || 130
26
-
27
27
  return (
28
28
  <Page
29
29
  backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
30
30
  headlineText={props.headlineText}
31
- headlineIcon={props.chartData?.length && res.download_icon}
31
+ headlineIcon={props.chartData?.length ? res.download_icon : undefined}
32
32
  onHeadlineIconClick={() => {
33
33
  exportFile(props.chartData)
34
34
  }}
@@ -44,13 +44,11 @@ const EnergyConsumptionChart = () => {
44
44
  style={styles.listEmptyImage}
45
45
  source={{ uri: res.ldv_timer_empty }} />
46
46
  <Spacer height={cx(14)} />
47
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
48
- <Image style={styles.listEmptyTextIcon} source={{ uri: res.ic_info }} />
49
- <Spacer width={cx(4)} height={0} />
50
- <Text style={styles.listEmptyText}>
51
- {I18n.getLang('energyconsumption_hourlylimit')}
52
- </Text>
53
- </View>
47
+ <InfoText
48
+ text={I18n.getLang('energyconsumption_hourlylimit')}
49
+ icon={res.ic_info}
50
+ contentColor='#000'
51
+ />
54
52
  </View>
55
53
  ) : (
56
54
  <BarChart height={height - cx(computeNum)} data={props.chartData} width={width - cx(80)} />
@@ -13,7 +13,7 @@ import {getDataWithSpecified, getDpResultByHour} from "@ledvance/base/src/models
13
13
  import {useDeviceId, useEngergyGeneration, useTimeZoneCity} from "@ledvance/base/src/models/modules/NativePropsSlice";
14
14
  import {cloneDeep, isEmpty} from "lodash";
15
15
  import {OverviewItem, PopupType} from "./EnergyConsumptionPage";
16
- import {exchangeNumber, localeNumber, loopsText} from '@ledvance/base/src/utils/common'
16
+ import {exchangeNumber, exportFile, localeNumber, loopsText} from '@ledvance/base/src/utils/common'
17
17
  import dayjs from "dayjs";
18
18
  import {ui_biz_routerKey} from "../../navigation/Routers";
19
19
  import {EnergyConsumptionChartProps} from "./EnergyConsumptionChart";
@@ -188,8 +188,10 @@ const EnergyConsumptionDetail = (props: {theme?: any}) => {
188
188
  <Page
189
189
  backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
190
190
  headlineText={params.curMonth.key}
191
- headlineIcon={res.download_icon}
192
- onHeadlineIconClick={() => { }}
191
+ headlineIcon={state.overviewList.length ? res.download_icon : undefined}
192
+ onHeadlineIconClick={() => {
193
+ exportFile(state.overviewList)
194
+ }}
193
195
  showGreenery={false}
194
196
  greeneryIcon={res.energy_consumption_greenery}
195
197
  loading={state.loading}
@@ -9,7 +9,7 @@ import {
9
9
  View,
10
10
  } from 'react-native';
11
11
  import { Utils } from 'tuya-panel-kit';
12
- import { useReactive } from 'ahooks';
12
+ import { useReactive, useUpdateEffect } from 'ahooks';
13
13
  import { cloneDeep, isEqual } from 'lodash';
14
14
  import Page from '@ledvance/base/src/components/Page';
15
15
  import Strings from '@ledvance/base/src/i18n';
@@ -122,6 +122,18 @@ const MixDynamicMoodEditorPage = () => {
122
122
  return currentOther.label;
123
123
  }, []);
124
124
 
125
+ useUpdateEffect(() =>{
126
+ if (state.mainNodeIdx < state.mood.mainLamp.nodes?.length){
127
+ state.mainNode = state.mood.mainLamp.nodes[state.mainNodeIdx]
128
+ }
129
+ }, [JSON.stringify(state.mood.mainLamp.nodes), state.mainNodeIdx])
130
+
131
+ useUpdateEffect(() =>{
132
+ if (state.secondaryIdx < state.mood.secondaryLamp.nodes?.length ){
133
+ state.secondaryNode = state.mood.secondaryLamp.nodes[state.secondaryIdx]
134
+ }
135
+ }, [JSON.stringify(state.mood.secondaryLamp.nodes), state.secondaryIdx])
136
+
125
137
  const nameRepeat = useMemo(() => {
126
138
  return params.nameRepeat(state.mood)
127
139
  }, [state.mood.name]);
@@ -61,16 +61,16 @@ const MoodPage = () => {
61
61
  const secondaryIds = map(state.originMoods.map(m => m.secondaryLamp) || [], 'id')
62
62
  return filter([...mainIds, ...secondaryIds], v => v !== undefined) as number[]
63
63
  }, [JSON.stringify(state.originMoods)])
64
-
64
+
65
65
  useEffect(() => {
66
- state.loading = true
66
+ state.loading = true
67
67
  state.timerId = setTimeout(() => {
68
68
  getRemoteMoodList(
69
69
  devId,
70
70
  params,
71
71
  params.featureId
72
72
  ).then(res => {
73
- state.loading = false
73
+ state.loading = false
74
74
  if (res.success && Array.isArray(res.data)) {
75
75
  state.originMoods = cloneDeep(res.data);
76
76
  }
@@ -403,6 +403,7 @@ const styles = StyleSheet.create({
403
403
  popoverItem: {
404
404
  padding: cx(5),
405
405
  alignItems: 'flex-start',
406
+ alignSelf: 'flex-start'
406
407
  },
407
408
  });
408
409
 
@@ -398,7 +398,6 @@ function ManualSettings(props: ManualSettingProps) {
398
398
  <Spacer />
399
399
  </View>
400
400
  ))}
401
- <Spacer height={cx(16)} />
402
401
  </Card>
403
402
  <Spacer />
404
403
  </View>