@ledvance/base 1.3.57 → 1.3.58

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/localazy.json CHANGED
@@ -1183,7 +1183,12 @@
1183
1183
  "MATCH:camera_site_overview_warning_max_number_text",
1184
1184
  "MATCH:camera_site_overview_empty_button_add_text",
1185
1185
  "MATCH:camera_site_overview_empty_information_text",
1186
- "MATCH:camera_settings_onvif_ip_topic"
1186
+ "MATCH:camera_settings_onvif_ip_topic",
1187
+ "MATCH:camera_settings_power_management_settings_topic",
1188
+ "MATCH:motion_detection_alarm_interval",
1189
+ "MATCH:camera_operation_site_error",
1190
+ "MATCH:camera_calibration",
1191
+ "MATCH:camera_calibration_desc"
1187
1192
  ],
1188
1193
  "replacements": {
1189
1194
  "REGEX:% %1\\$s.*?\\)%": "{0}",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.57",
7
+ "version": "1.3.58",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -0,0 +1,128 @@
1
+ import ThemeType from "../config/themeType";
2
+ import {Utils} from "tuya-panel-kit";
3
+ import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
4
+ import Spacer from "./Spacer";
5
+ import res from "../res";
6
+ import React from "react";
7
+ import Card from "./Card";
8
+
9
+ const {convertX: cx} = Utils.RatioUtils
10
+ const {withTheme} = Utils.ThemeUtils
11
+
12
+ interface OptionGroupProps {
13
+ theme?: ThemeType
14
+ tips: string
15
+ selected: any
16
+ options: OptionItemProps[]
17
+ }
18
+
19
+ interface OptionItemProps {
20
+ title: string
21
+ value: any
22
+ content?: string
23
+ enable?: boolean
24
+ onPress?: (value: any) => void
25
+ }
26
+
27
+ const OptionGroup = (props: OptionGroupProps) => {
28
+ const styles = StyleSheet.create({
29
+ modeSelectGroup: {
30
+ marginHorizontal: cx(24),
31
+ backgroundColor: props.theme?.container.background,
32
+ borderRadius: cx(4),
33
+ },
34
+ modeTip: {
35
+ marginHorizontal: cx(8),
36
+ color: props.theme?.global.fontColor,
37
+ fontSize: cx(14),
38
+ fontWeight: 'bold',
39
+ fontFamily: 'helvetica_neue_lt_std_bd',
40
+ },
41
+ modeSelectCard: {
42
+ marginHorizontal: cx(8),
43
+ },
44
+ line: {
45
+ height: cx(1),
46
+ marginHorizontal: cx(12),
47
+ backgroundColor: props.theme?.container.divider,
48
+ },
49
+ itemRoot: {
50
+ flexDirection: 'row',
51
+ alignItems: 'center',
52
+ paddingHorizontal: cx(12),
53
+ paddingBottom: cx(8),
54
+ },
55
+ itemTextGroup: {
56
+ flex: 1,
57
+ marginEnd: cx(12),
58
+ justifyContent: 'center',
59
+ },
60
+ itemTitle: {
61
+ color: props.theme?.global.fontColor,
62
+ fontSize: cx(14),
63
+ fontFamily: 'helvetica_neue_lt_std_roman',
64
+ },
65
+ itemContent: {
66
+ color: props.theme?.global.secondFontColor,
67
+ fontSize: cx(14),
68
+ fontFamily: 'helvetica_neue_lt_std_roman',
69
+ },
70
+ })
71
+
72
+ const OptionItem = (props: OptionItemProps) => {
73
+ return (
74
+ <TouchableOpacity onPress={() => props.onPress && props.onPress(props.value)}>
75
+ <View style={styles.itemRoot}>
76
+ <View style={styles.itemTextGroup}>
77
+ <Text style={styles.itemTitle}>{props.title}</Text>
78
+ <Spacer height={cx(4)}/>
79
+ {
80
+ props.content ? <Text style={styles.itemContent}>{props.content}</Text>
81
+ : <></>
82
+ }
83
+ </View>
84
+ <Image
85
+ source={{uri: res.ic_check}}
86
+ style={{
87
+ width: cx(32),
88
+ height: cx(32),
89
+ marginEnd: cx(4),
90
+ display: props.enable ? 'flex' : 'none',
91
+ }}/>
92
+ </View>
93
+ </TouchableOpacity>
94
+ )
95
+ }
96
+
97
+ return (
98
+ <View style={styles.modeSelectGroup}>
99
+ <Spacer height={cx(8)}/>
100
+ <Text style={styles.modeTip}>
101
+ {props.tips}
102
+ </Text>
103
+ <Spacer height={cx(8)}/>
104
+ <Card style={styles.modeSelectCard}>
105
+ <Spacer height={cx(12)}/>
106
+ {
107
+ props.options.map((item, index) => {
108
+ return (
109
+ <React.Fragment key={`Fragment${index}`}>
110
+ <OptionItem
111
+ key={index}
112
+ {...item}
113
+ enable={item.value === props.selected}
114
+ />
115
+ {
116
+ index !== props.options.length - 1 ? <><View style={styles.line}/><Spacer height={cx(12)}/></> : <></>
117
+ }
118
+ </React.Fragment>
119
+ )
120
+ })
121
+ }
122
+ </Card>
123
+ <Spacer height={cx(12)}/>
124
+ </View>
125
+ )
126
+ }
127
+
128
+ export default withTheme(OptionGroup)
@@ -10,7 +10,7 @@ interface Prop {
10
10
  theme?: ThemeType
11
11
  title: string
12
12
  color?: string
13
- colorAlpha: number
13
+ colorAlpha?: number
14
14
  enable: boolean
15
15
  setEnable: (enable: boolean) => void
16
16
  showSwitch?:boolean
@@ -21,7 +21,7 @@ interface Prop {
21
21
  }
22
22
 
23
23
  const LdvSwitch = (props: Prop) => {
24
- const {title, color, colorAlpha, enable, description, titleStyle, setEnable, leftValue, rightValue, showSwitch = true} = props
24
+ const {title, color, colorAlpha = 0, enable, description, titleStyle, setEnable, leftValue, rightValue, showSwitch = true} = props
25
25
  return (
26
26
  <View style={styles.titleBGView}>
27
27
  <View style={{flexDirection: 'column', flex: 1}}>