@ledvance/group-ui-biz-bundle 1.0.11 → 1.0.13

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.11",
7
+ "version": "1.0.13",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -1,4 +1,5 @@
1
1
  import I18n from "@ledvance/base/src/i18n";
2
+ import res from "@ledvance/base/src/res";
2
3
  import { SceneNodeTransitionMode } from "../mood/SceneInfo";
3
4
 
4
5
  type HSV = {
@@ -19,8 +20,7 @@ export interface FlagItemInfo {
19
20
  speed: number
20
21
  colors: HSV[]
21
22
  whiteColors: BT []
22
- fanEnable?: boolean
23
- fanSpeed?: number
23
+ icon?: number | string
24
24
  }
25
25
 
26
26
  export interface FlagUiInfo extends FlagItemInfo{
@@ -301,6 +301,7 @@ export const defFlagList: FlagUiInfo[] = [
301
301
  mode: SceneNodeTransitionMode.Jump,
302
302
  speed: 70,
303
303
  name: I18n.getLang('flag_leverkusen'),
304
+ icon: res.leverkusen_icon,
304
305
  whiteColors: [
305
306
  { brightness: 100, colorTemp: 0},
306
307
  ],
@@ -1,4 +1,4 @@
1
- import { StyleSheet, View, Text, ViewStyle } from 'react-native'
1
+ import { StyleSheet, View, Text, ViewStyle, Image } from 'react-native'
2
2
  import React from 'react'
3
3
  import Card from '@ledvance/base/src/components/Card'
4
4
  import { SwitchButton, Utils } from 'tuya-panel-kit'
@@ -11,12 +11,15 @@ interface RecommendMoodItemProps {
11
11
  enable: boolean
12
12
  title: string
13
13
  colors: string[]
14
+ icon?: number | string
14
15
  style?: ViewStyle
15
16
  onPress?: () => void
16
17
  onSwitch: (enable: boolean) => void
17
18
  }
18
19
 
19
20
  export default function FlagItem(props: RecommendMoodItemProps) {
21
+ const icon = typeof props.icon === 'number' ? props.icon : { uri: props.icon }
22
+
20
23
  return (
21
24
  <Card
22
25
  style={[styles.card, props.style]}
@@ -24,7 +27,10 @@ export default function FlagItem(props: RecommendMoodItemProps) {
24
27
  <View>
25
28
  <Spacer height={cx(16)} />
26
29
  <View style={styles.headline}>
27
- <Text style={styles.headText}>{props.title}</Text>
30
+ <View style={{ flexDirection: 'row', flex: 1, paddingRight: cx(5), justifyContent: 'flex-start' }}>
31
+ <Text style={styles.headText}>{props.title}</Text>
32
+ {props.icon && <Image source={icon} style={{ width: cx(60), aspectRatio: 2.14, marginRight: cx(10) }} />}
33
+ </View>
28
34
  <SwitchButton
29
35
  thumbStyle={{ elevation: 0 }}
30
36
  value={props.enable}
@@ -50,13 +56,14 @@ const styles = StyleSheet.create({
50
56
  headline: {
51
57
  flexDirection: 'row',
52
58
  marginHorizontal: cx(16),
59
+ justifyContent: 'space-between',
53
60
  },
54
61
  headText: {
55
- flex: 1,
56
62
  color: '#000',
57
63
  fontSize: cx(16),
58
64
  fontFamily: 'helvetica_neue_lt_std_bd',
59
65
  lineHeight: cx(20),
66
+ flex: 1
60
67
  },
61
68
  gradientItem: {
62
69
  alignItems: 'center',
@@ -193,6 +193,7 @@ const FlagPage = () => {
193
193
  renderItem={({ item }) => <FlagItem
194
194
  enable={flagState?.workMode === (params.isStripLight ? WorkMode.Colour : WorkMode.Scene) && flagId === item.id}
195
195
  title={item.name}
196
+ icon={item.icon}
196
197
  colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v))}
197
198
  onSwitch={async (enable) => {
198
199
  if (enable) {
@@ -2,9 +2,10 @@ import React from "react";
2
2
  import { ViewStyle, View, Text, StyleSheet } from "react-native";
3
3
  import Card from "@ledvance/base/src/components/Card";
4
4
  import { SwitchButton, Utils } from 'tuya-panel-kit';
5
- import { convertTo12HourFormat, loopText } from '@ledvance/base/src/utils/common';
5
+ import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common';
6
6
  import { Timer } from "./Interface";
7
7
  import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
8
+ import I18n from "@ledvance/base/src/i18n";
8
9
  const { convertX: cx } = Utils.RatioUtils;
9
10
 
10
11
  interface ScheduleCardProps {
@@ -44,7 +45,21 @@ const ScheduleCard = (props: ScheduleCardProps) => {
44
45
  value={!!item.status}
45
46
  thumbStyle={{ elevation: 0 }}
46
47
  onValueChange={() => {
47
- onEnableChange(!item.status);
48
+ if (!item.status) {
49
+ showDialog({
50
+ method: 'confirm',
51
+ title: I18n.getLang('conflict_dialog_active_item_timeschedule_titel'),
52
+ subTitle: I18n.getLang('group_conflict_feature'),
53
+ confirmText: I18n.getLang('registration_dialog_button_yes'),
54
+ cancelText: I18n.getLang('registration_dialog_button_no'),
55
+ onConfirm: (_, {close}) => {
56
+ onEnableChange(!item.status);
57
+ close()
58
+ }
59
+ });
60
+ } else {
61
+ onEnableChange(!item.status);
62
+ }
48
63
  }}
49
64
  />
50
65
  </View>
@@ -110,4 +125,4 @@ const styles = StyleSheet.create({
110
125
  }
111
126
  });
112
127
 
113
- export default ScheduleCard
128
+ export default ScheduleCard
@@ -420,18 +420,28 @@ const TimeScheduleDetailPage = () => {
420
420
  rightButtonIcon={allowSubmit ? res.ic_check : res.ic_uncheck}
421
421
  rightButtonIconClick={async () => {
422
422
  if (!allowSubmit || state.loading) return
423
- state.loading = true
424
- const res = await props.modDeleteTimeSchedule(props.mode, {
425
- ...state.timeSchedule,
426
- status: 1,
427
- dps: getActions()
428
- }, '')
429
- console.log(res, '< ---- resss')
430
- state.loading = false
431
- if (res.success) {
432
- props.refreshFn()
433
- navigation.goBack()
434
- }
423
+ showDialog({
424
+ method: 'confirm',
425
+ title: I18n.getLang('conflict_dialog_active_item_timeschedule_titel'),
426
+ subTitle: I18n.getLang('group_conflict_feature'),
427
+ confirmText: I18n.getLang('registration_dialog_button_yes'),
428
+ cancelText: I18n.getLang('registration_dialog_button_no'),
429
+ onConfirm: async (_, { close }) => {
430
+ state.loading = true
431
+ const res = await props.modDeleteTimeSchedule(props.mode, {
432
+ ...state.timeSchedule,
433
+ status: 1,
434
+ dps: getActions()
435
+ }, '')
436
+ console.log(res, '< ---- resss')
437
+ state.loading = false
438
+ if (res.success) {
439
+ close()
440
+ props.refreshFn()
441
+ navigation.goBack()
442
+ }
443
+ }
444
+ })
435
445
  }}
436
446
  backDialogTitle={I18n.getLang('cancel_dialog_leave_unsaved_titel')}
437
447
  backDialogContent={I18n.getLang('cancel_dialog_leave_unsaved_timeschedule_note')}