@ledvance/group-ui-biz-bundle 1.0.164 → 1.0.166

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.164",
7
+ "version": "1.0.166",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -3,7 +3,7 @@ import ThemeType from "@ledvance/base/src/config/themeType";
3
3
  import { parseMinutes, PriceSegment } from "./component/EnergyModal";
4
4
  import { Utils } from 'tuya-panel-kit'
5
5
  import { StyleSheet } from "react-native";
6
- import {exchangeNumber} from "@ledvance/base/src/utils/common";
6
+ import {exchangeNumber, sanitizeDecimalInput} from "@ledvance/base/src/utils/common";
7
7
 
8
8
  export const useEditPriceSegment = (segment: PriceSegment | undefined,
9
9
  onSegmentSet: (s: PriceSegment) => void, theme?: ThemeType,) => {
@@ -43,14 +43,15 @@ export const useEditPriceSegment = (segment: PriceSegment | undefined,
43
43
  };
44
44
 
45
45
  const handlePriceChange = (t: string) => {
46
- const cleaned = exchangeNumber(t)
46
+ const sanitized = sanitizeDecimalInput(t)
47
+ const cleaned = exchangeNumber(sanitized)
47
48
  const parsed = parseFloat(cleaned);
48
49
  let numericVal = isNaN(parsed) ? 0 : parsed;
49
50
  if (numericVal > 999999) {
50
51
  numericVal = 999999;
51
52
  setPriceStr('999999');
52
53
  } else {
53
- setPriceStr(t);
54
+ setPriceStr(sanitized);
54
55
  }
55
56
 
56
57
  onSegmentSet({
@@ -288,14 +288,6 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
288
288
  <Text style={{ color: props.theme?.global.secondFontColor }}>{I18n.getLang('consumption_data_field3_value_text2')}</Text>
289
289
  <Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{state.price ? `${localeNumber(Number(state.price) * Number(params.curMonth.value), 2)} ${state.unit}` : '-'}</Text>
290
290
  </View>
291
- <TouchableOpacity onPress={() => {
292
- state.showPopup = true
293
- state.popupType = 'money'
294
- }}>
295
- <View style={styles.priceButton}>
296
- <Text style={{ color: props.theme?.button.fontColor }}>{I18n.getLang('consumption_data_field3_button_text')}</Text>
297
- </View>
298
- </TouchableOpacity>
299
291
  </View>
300
292
  </View>
301
293
  </Card>
@@ -371,9 +371,6 @@ export const useSetSegmentPrice = (params: SetSegmentedPricesParams, theme?: The
371
371
  height: cx(14),
372
372
  tintColor: theme?.container.background
373
373
  },
374
- scrollContainer: {
375
- paddingHorizontal: cx(16),
376
- },
377
374
  currencyCardContainer: {
378
375
  flexDirection: 'row',
379
376
  paddingHorizontal: cx(16),
@@ -437,6 +434,7 @@ export const useSetSegmentPrice = (params: SetSegmentedPricesParams, theme?: The
437
434
  editSegmentIndicator: {
438
435
  width: cx(18),
439
436
  height: cx(18),
437
+ flexShrink: 0,
440
438
  marginHorizontal: cx(6),
441
439
  },
442
440
  deleteSegmentIndicator: {
@@ -40,14 +40,14 @@ const SetSegmentedPricesScreen = (props: { theme?: ThemeType }) => {
40
40
  backDialogTitle={I18n.getLang('manage_user_unsaved_changes_dialog_headline')}
41
41
  backDialogContent={I18n.getLang('motion_detection_change_activity_dialog_description_text')}
42
42
  >
43
- <ScrollView style={styles.scrollContainer}
44
- contentContainerStyle={{ flexGrow: 1, paddingBottom: cx(20) }}>
43
+ <ScrollView
44
+ contentContainerStyle={{ flexGrow: 1, paddingTop: cx(8), paddingBottom: cx(20), paddingHorizontal: cx(8) }}>
45
45
  <TouchableWithoutFeedback onPress={() => {
46
46
  uiState.selectedSegmentprice = undefined
47
47
  }}>
48
48
  <View style={{ flex: 1 }}>
49
49
  {/* currency field*/}
50
- <Card style={{ elevation: cx(2) }}
50
+ <Card style={{ elevation: cx(2), marginHorizontal: cx(8) }}
51
51
  containerStyle={styles.currencyCardContainer}>
52
52
  <Text
53
53
  style={styles.cardTitle}>{I18n.getLang('consumption_data_price_per_kwh_currency_headline_text')}</Text>
@@ -65,7 +65,7 @@ const SetSegmentedPricesScreen = (props: { theme?: ThemeType }) => {
65
65
  </TouchableOpacity>
66
66
  </Card>
67
67
  {/* segmented prices field*/}
68
- <View style={{ width: '100%', marginTop: cx(10) }}>
68
+ <View style={{ width: '100%', marginTop: cx(10), paddingHorizontal: cx(8) }}>
69
69
  <View style={{ flexDirection: 'row', width: '100%', position: 'relative', marginTop: cx(10) }}>
70
70
  {/*Vertical indicator*/}
71
71
  <View style={styles.verticalIndicator}>
@@ -120,10 +120,18 @@ const SetSegmentedPricesScreen = (props: { theme?: ThemeType }) => {
120
120
  console.log("outside set selectedItem ->", JSON.stringify(item))
121
121
  uiState.selectedSegmentprice = item
122
122
  }}>
123
- <View
124
- style={{ flexDirection: 'row', justifyContent: 'space-between', }}>
123
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
125
124
  <Text
126
- style={{ color: props.theme?.button.fontColor }}>{content}</Text>
125
+ numberOfLines={2}
126
+ ellipsizeMode="tail"
127
+ style={{
128
+ flex: 1,
129
+ minWidth: 0,
130
+ marginRight: cx(8),
131
+ color: props.theme?.button.fontColor
132
+ }}>
133
+ {content}
134
+ </Text>
127
135
  <TouchableOpacity
128
136
  style={styles.editSegmentIndicator}
129
137
  onPress={() => {
@@ -10,6 +10,7 @@ import { useReactive, useUpdateEffect } from "ahooks";
10
10
  import { cloneDeep } from "lodash";
11
11
  import ThemeType from '@ledvance/base/src/config/themeType'
12
12
  import EditPriceSegmentScreen from "../EditPriceSegmentScreen";
13
+ import { exchangeNumber, sanitizeDecimalInput } from "@ledvance/base/src/utils/common";
13
14
 
14
15
  const { convertX: cx, height, statusBarHeight } = Utils.RatioUtils
15
16
  const { withTheme } = Utils.ThemeUtils
@@ -211,8 +212,8 @@ const EnergyModal = (props: EnergyModalProps) => {
211
212
  <TextInput
212
213
  value={state.energyData?.price}
213
214
  onChangeText={(t: string) => {
214
- const value = t.replace(/[^0-9.,]/g, '')
215
- if (Number(value) > 999999) {
215
+ const value = sanitizeDecimalInput(t)
216
+ if (Number(exchangeNumber(value)) > 999999) {
216
217
  if (state.energyData) state.energyData.price = '999999'
217
218
  } else {
218
219
  if (state.energyData) state.energyData.price = value
@@ -242,7 +242,7 @@ const BarChartWithTouch = (props: BarChartProps) => {
242
242
 
243
243
  const option = useMemo(
244
244
  () => ({
245
- tooltip: { show: true, triggerOn: 'click', trigger: 'axis' },
245
+ tooltip: {show: true, triggerOn: 'click', trigger: 'axis', position: [50, 100]},
246
246
  legend: {
247
247
  show: true,
248
248
  data: legendData,
@@ -257,28 +257,28 @@ function getDIMDefSceneList(): RemoteMoodInfo[] {
257
257
  return [
258
258
  {
259
259
  n: I18n.getLang('mesh_device_detail_lighting_goodnight'),
260
- i: '000e0d0000000000000000c803e8',
260
+ i: '000e0d0000000000000000c80000',
261
261
  s: '',
262
262
  t: 0,
263
263
  e: false,
264
264
  },
265
265
  {
266
266
  n: I18n.getLang('mesh_device_detail_lighting_read'),
267
- i: '010e0d0000000000000003e803e8',
267
+ i: '010e0d0000000000000003e80000',
268
268
  s: '',
269
269
  t: 0,
270
270
  e: false,
271
271
  },
272
272
  {
273
273
  n: I18n.getLang('mesh_device_detail_lighting_work'),
274
- i: '020e0d0000000000000003e803e8',
274
+ i: '020e0d0000000000000003e80000',
275
275
  s: '',
276
276
  t: 0,
277
277
  e: false,
278
278
  },
279
279
  {
280
280
  n: I18n.getLang('mesh_device_detail_lighting_leisure'),
281
- i: '030e0d0000000000000001f403e8',
281
+ i: '030e0d0000000000000001f40000',
282
282
  s: '',
283
283
  t: 0,
284
284
  e: false,
@@ -1980,7 +1980,7 @@ export function getRecommendMoods(
1980
1980
  s: 100,
1981
1981
  v: 100,
1982
1982
  brightness: 60,
1983
- colorTemp: 100,
1983
+ colorTemp: 0,
1984
1984
  isColorNode: false,
1985
1985
  },
1986
1986
  ],
@@ -2001,7 +2001,7 @@ export function getRecommendMoods(
2001
2001
  s: 100,
2002
2002
  v: 100,
2003
2003
  brightness: 80,
2004
- colorTemp: 100,
2004
+ colorTemp: 0,
2005
2005
  isColorNode: false,
2006
2006
  },
2007
2007
  ],
@@ -2022,7 +2022,7 @@ export function getRecommendMoods(
2022
2022
  s: 100,
2023
2023
  v: 100,
2024
2024
  brightness: 100,
2025
- colorTemp: 100,
2025
+ colorTemp: 0,
2026
2026
  isColorNode: false,
2027
2027
  },
2028
2028
  ],
@@ -2295,7 +2295,7 @@ export function getRecommendMoods(
2295
2295
  s: 100,
2296
2296
  v: 100,
2297
2297
  brightness: 20,
2298
- colorTemp: 100,
2298
+ colorTemp: 0,
2299
2299
  isColorNode: false,
2300
2300
  },
2301
2301
  {
@@ -2303,7 +2303,7 @@ export function getRecommendMoods(
2303
2303
  s: 100,
2304
2304
  v: 100,
2305
2305
  brightness: 40,
2306
- colorTemp: 100,
2306
+ colorTemp: 0,
2307
2307
  isColorNode: false,
2308
2308
  },
2309
2309
  {
@@ -2311,7 +2311,7 @@ export function getRecommendMoods(
2311
2311
  s: 100,
2312
2312
  v: 100,
2313
2313
  brightness: 60,
2314
- colorTemp: 100,
2314
+ colorTemp: 0,
2315
2315
  isColorNode: false,
2316
2316
  },
2317
2317
  ],
@@ -2333,7 +2333,7 @@ export function getRecommendMoods(
2333
2333
  s: 100,
2334
2334
  v: 100,
2335
2335
  brightness: 40,
2336
- colorTemp: 100,
2336
+ colorTemp: 0,
2337
2337
  isColorNode: false,
2338
2338
  },
2339
2339
  {
@@ -2341,7 +2341,7 @@ export function getRecommendMoods(
2341
2341
  s: 100,
2342
2342
  v: 100,
2343
2343
  brightness: 60,
2344
- colorTemp: 100,
2344
+ colorTemp: 0,
2345
2345
  isColorNode: false,
2346
2346
  },
2347
2347
  {
@@ -2349,7 +2349,7 @@ export function getRecommendMoods(
2349
2349
  s: 100,
2350
2350
  v: 100,
2351
2351
  brightness: 80,
2352
- colorTemp: 100,
2352
+ colorTemp: 0,
2353
2353
  isColorNode: false,
2354
2354
  },
2355
2355
  ],
@@ -2371,7 +2371,7 @@ export function getRecommendMoods(
2371
2371
  s: 100,
2372
2372
  v: 100,
2373
2373
  brightness: 50,
2374
- colorTemp: 100,
2374
+ colorTemp: 0,
2375
2375
  isColorNode: false,
2376
2376
  },
2377
2377
  {
@@ -2379,7 +2379,7 @@ export function getRecommendMoods(
2379
2379
  s: 100,
2380
2380
  v: 100,
2381
2381
  brightness: 70,
2382
- colorTemp: 100,
2382
+ colorTemp: 0,
2383
2383
  isColorNode: false,
2384
2384
  },
2385
2385
  {
@@ -2387,7 +2387,7 @@ export function getRecommendMoods(
2387
2387
  s: 100,
2388
2388
  v: 100,
2389
2389
  brightness: 100,
2390
- colorTemp: 100,
2390
+ colorTemp: 0,
2391
2391
  isColorNode: false,
2392
2392
  },
2393
2393
  ],
@@ -165,7 +165,7 @@ const MoodPage = (props: {theme?: ThemeType}) => {
165
165
  node.s = 0;
166
166
  node.v = 0;
167
167
  if (!params.isSupportTemperature) {
168
- node.colorTemp = 100; // 适配dim灯
168
+ node.colorTemp = 0; // 适配dim灯
169
169
  }
170
170
  }
171
171
  return node;
@@ -186,7 +186,7 @@ const MoodPage = (props: {theme?: ThemeType}) => {
186
186
  node.s = 0;
187
187
  node.v = 0;
188
188
  if (!params.isSupportTemperature) {
189
- node.colorTemp = 100; // 适配dim灯
189
+ node.colorTemp = 0; // 适配dim灯
190
190
  }
191
191
  }
192
192
  return node;