@ledvance/group-ui-biz-bundle 1.0.153 → 1.0.155

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.153",
7
+ "version": "1.0.155",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -1,6 +1,5 @@
1
- import { xLog } from '@ledvance/base/src/utils'
2
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
3
- import { FlatList, Image, Linking, ScrollView, Switch, Text, TouchableOpacity, View } from 'react-native'
2
+ import { FlatList, Image, Linking, ScrollView, Text, TouchableOpacity, View } from 'react-native'
4
3
  import { useNavigation } from '@react-navigation/native'
5
4
  import { useDebounceFn, useReactive, useUpdateEffect } from 'ahooks'
6
5
  import {
@@ -10,7 +9,7 @@ import {
10
9
  getDefBiorhythmUIState,
11
10
  Plan,
12
11
  } from './BiorhythmBean'
13
- import { Dialog, Modal, Utils } from 'tuya-panel-kit'
12
+ import { Dialog, Modal, SwitchButton, Utils } from 'tuya-panel-kit'
14
13
  import { sortBy, cloneDeep } from 'lodash'
15
14
  import iconList from './iconListData'
16
15
  import pIdList from './pIdList'
@@ -246,7 +245,7 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
246
245
  backText={uaGroupInfo.name}
247
246
  onBackClick={navigation.goBack}
248
247
  headlineTopContent={
249
- <View style={{flexDirection: 'row', justifyContent: 'flex-end'}}>
248
+ <View style={{flexDirection: 'row', justifyContent: 'flex-end', marginBottom: cx(10)}}>
250
249
  <TouchableOpacity
251
250
  style={{paddingLeft: cx(16)}}
252
251
  onPress={() => {
@@ -277,10 +276,8 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
277
276
  </TouchableOpacity>
278
277
  </View>}
279
278
  headlineText={I18n.getLang('add_new_trigger_time_system_back_text')}
280
- headlineIconContent={<Switch
279
+ headlineIconContent={<SwitchButton
281
280
  value={state.enable}
282
- thumbColor={props.theme?.icon.primary}
283
- trackColor={{ false: '#00000026', true: '#ff660036' }}
284
281
  onValueChange={async enable => {
285
282
  if (enable) return showDialog({
286
283
  method: 'confirm',
@@ -584,10 +581,8 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
584
581
  {convertMinutesTo12HourFormat(item.time, is24Hour)}
585
582
  </Text>
586
583
  </View>
587
- <Switch
584
+ <SwitchButton
588
585
  value={item.enable}
589
- thumbColor={props.theme?.icon.primary}
590
- trackColor={{ false: '#00000026', true: '#ff660036' }}
591
586
  onValueChange={e => {
592
587
  item.enable = e
593
588
  state.flag = Symbol()
@@ -415,61 +415,63 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
415
415
  <Spacer height={cx(30)} />
416
416
 
417
417
  {/* Apply for */}
418
- <View style={styles.cardContainer}>
419
- <Text style={styles.itemTitle}>
420
- {I18n.getLang('timeschedule_add_schedule_subheadline_text')}
421
- </Text>
422
- <Spacer height={cx(10)} />
423
- <View style={[styles.applyContent, { paddingTop: state.selectedSkill.length ? cx(10) : 0 }]}>
424
- {state.selectedSkill.length === 0 ? (
425
- <Text style={{ color: props.theme?.global.fontColor }}>
426
- {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
427
- </Text>
428
- ) : (
429
- state.selectedSkill.map(skill => (
430
- <View
431
- style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
432
- key={skill.dp}
418
+ {(!params.applyForDisabled && params.applyForList.length > 1) && (
419
+ <View style={styles.cardContainer}>
420
+ <Text style={styles.itemTitle}>
421
+ {I18n.getLang('timeschedule_add_schedule_subheadline_text')}
422
+ </Text>
423
+ <Spacer height={cx(10)} />
424
+ <View style={[styles.applyContent, { paddingTop: state.selectedSkill.length ? cx(10) : 0 }]}>
425
+ {state.selectedSkill.length === 0 ? (
426
+ <Text style={{ color: props.theme?.global.fontColor }}>
427
+ {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
428
+ </Text>
429
+ ) : (
430
+ state.selectedSkill.map(skill => (
431
+ <View
432
+ style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
433
+ key={skill.dp}
434
+ >
435
+ <Text style={{ color: props.theme?.global.fontColor }}>{skill.key}</Text>
436
+ {showSelectedIcon && (
437
+ <TouchableOpacity
438
+ onPress={() => {
439
+ state.selectedSkill = state.selectedSkill.filter(s => skill.dp !== s.dp);
440
+ state.unSelectedSkill = [...state.unSelectedSkill, skill];
441
+ }}
442
+ style={{ paddingHorizontal: cx(5) }}
443
+ >
444
+ <Image
445
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
446
+ source={{ uri: res.ic_arrows_nav_clear }}
447
+ />
448
+ </TouchableOpacity>
449
+ )}
450
+ </View>
451
+ ))
452
+ )}
453
+ </View>
454
+ {state.unSelectedSkill.map((item: ApplyForItem) => {
455
+ return (
456
+ <TouchableOpacity
457
+ style={styles.applyItem}
458
+ key={item.dp}
459
+ onPress={() => {
460
+ state.selectedSkill = [...state.selectedSkill, item];
461
+ state.unSelectedSkill = state.unSelectedSkill.filter(s => item.dp !== s.dp);
462
+ }}
433
463
  >
434
- <Text style={{ color: props.theme?.global.fontColor }}>{skill.key}</Text>
435
- {showSelectedIcon && (
436
- <TouchableOpacity
437
- onPress={() => {
438
- state.selectedSkill = state.selectedSkill.filter(s => skill.dp !== s.dp);
439
- state.unSelectedSkill = [...state.unSelectedSkill, skill];
440
- }}
441
- style={{ paddingHorizontal: cx(5) }}
442
- >
443
- <Image
444
- style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
445
- source={{ uri: res.ic_arrows_nav_clear }}
446
- />
447
- </TouchableOpacity>
448
- )}
449
- </View>
450
- ))
451
- )}
464
+ <Text style={{ color: props.theme?.global.fontColor }}>{item.key}</Text>
465
+ <Image
466
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
467
+ source={{ uri: res.device_panel_timer_add }}
468
+ />
469
+ </TouchableOpacity>
470
+ );
471
+ })}
472
+ <Spacer />
452
473
  </View>
453
- {state.unSelectedSkill.map((item: ApplyForItem) => {
454
- return (
455
- <TouchableOpacity
456
- style={styles.applyItem}
457
- key={item.dp}
458
- onPress={() => {
459
- state.selectedSkill = [...state.selectedSkill, item];
460
- state.unSelectedSkill = state.unSelectedSkill.filter(s => item.dp !== s.dp);
461
- }}
462
- >
463
- <Text style={{ color: props.theme?.global.fontColor }}>{item.key}</Text>
464
- <Image
465
- style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
466
- source={{ uri: res.device_panel_timer_add }}
467
- />
468
- </TouchableOpacity>
469
- );
470
- })}
471
- <Spacer />
472
- </View>
474
+ )}
473
475
 
474
476
  {/* device state */}
475
477
  <Text style={[styles.itemTitle, styles.cardContainer]}>
@@ -101,6 +101,8 @@ function ManualSettings(props: ManualSettingProps) {
101
101
  title={item.name || item.key}
102
102
  color={getBlockColor(item)}
103
103
  colorAlpha={1}
104
+ onText={I18n.getLang('routine_push_msg_on')}
105
+ offText={I18n.getLang('watchapp_entitystate_off')}
104
106
  enable={item.enable}
105
107
  setEnable={(enable: boolean) => {
106
108
  state.applyForList = state.applyForList.map((apply, index) => {
@@ -264,6 +266,8 @@ function ManualSettings(props: ManualSettingProps) {
264
266
  title={item.key}
265
267
  color={getBlockColor(item.type)}
266
268
  colorAlpha={1}
269
+ onText={I18n.getLang('routine_push_msg_on')}
270
+ offText={I18n.getLang('watchapp_entitystate_off')}
267
271
  enable={item.enable}
268
272
  setEnable={(enable: boolean) => {
269
273
  state.applyForList[idx].enable = enable;
@@ -338,6 +342,8 @@ function ManualSettings(props: ManualSettingProps) {
338
342
  title={state.applyForList[0]?.name || state.applyForList[0]?.key}
339
343
  color={getBlockColor()}
340
344
  colorAlpha={1}
345
+ onText={I18n.getLang('routine_push_msg_on')}
346
+ offText={I18n.getLang('watchapp_entitystate_off')}
341
347
  enable={state.applyForList[0]?.enable}
342
348
  setEnable={(enable: boolean) => {
343
349
  state.applyForList[0].enable = enable;
@@ -421,6 +427,8 @@ function ManualSettings(props: ManualSettingProps) {
421
427
  title={item.name || item.key}
422
428
  color={getBlockColor(item.type)}
423
429
  colorAlpha={1}
430
+ onText={I18n.getLang('routine_push_msg_on')}
431
+ offText={I18n.getLang('watchapp_entitystate_off')}
424
432
  enable={item.enable}
425
433
  setEnable={(enable: boolean) => {
426
434
  state.applyForList[idx].enable = enable;