@ledvance/base 1.3.34 → 1.3.35

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
@@ -1017,7 +1017,8 @@
1017
1017
  "MATCH:legend_humidity",
1018
1018
  "MATCH:battery_status_normal",
1019
1019
  "MATCH:battery_status_low",
1020
- "MATCH:battery_status_empty"
1020
+ "MATCH:battery_status_empty",
1021
+ "MATCH:push_notifications_contact_sensor_door_closing_title"
1021
1022
  ],
1022
1023
  "replacements": {
1023
1024
  "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.34",
7
+ "version": "1.3.35",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -55,6 +55,7 @@ function AdvanceList(props: AdvanceListProps) {
55
55
 
56
56
  return (
57
57
  <FlatList
58
+ scrollEnabled={false}
58
59
  numColumns={2}
59
60
  style={styles.container}
60
61
  data={advanceData}
@@ -27,7 +27,7 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
27
27
  const styles = StyleSheet.create({
28
28
  root: {
29
29
  marginHorizontal: cx(8),
30
- backgroundColor: props.theme?.global.background,
30
+ backgroundColor: props.theme?.card.background,
31
31
  flexDirection: 'row',
32
32
  alignItems: 'center'
33
33
  },
@@ -41,6 +41,7 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
41
41
  width: cx(24),
42
42
  height: cx(24),
43
43
  marginStart: cx(6),
44
+ borderRadius: cx(4),
44
45
  },
45
46
  deviceName: {
46
47
  flex: 1,
@@ -15,7 +15,8 @@ interface CardProps extends PropsWithChildren<ViewProps> {
15
15
  }
16
16
 
17
17
  const Card = (props: CardProps) => {
18
- const shadowHeight = props.shadowHeight || cx(3)
18
+ const initHeight = (Platform.OS === 'ios' && props.theme?.type === 'dark') ? 0 : 7
19
+ const shadowHeight = props.shadowHeight || cx(initHeight)
19
20
  return (
20
21
  <View
21
22
  style={[{
@@ -23,7 +24,7 @@ const Card = (props: CardProps) => {
23
24
  backgroundColor: props.theme?.card.background,
24
25
  elevation: shadowHeight,
25
26
  shadowColor: props.theme?.card.shadowColor,
26
- shadowOpacity: 0.5,
27
+ shadowOpacity: 0.2,
27
28
  shadowRadius: shadowHeight,
28
29
  shadowOffset: {
29
30
  width: 0,
@@ -71,6 +71,7 @@ function SocketItem(props: SocketItemProps) {
71
71
  value: props.name,
72
72
  cancelText: I18n.getLang('auto_scan_system_cancel'),
73
73
  confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
74
+ inputWrapperStyle: {backgroundColor: props.theme?.textInput.background, borderRadius: cx(10)},
74
75
  onChangeText: text => {
75
76
  return text.length <= 32 ? text : text.slice(0, 32)
76
77
  },
@@ -23,12 +23,12 @@ const Tag = (props: TagProps) => {
23
23
  justifyContent: 'center',
24
24
  alignItems: 'center',
25
25
  borderWidth: cx(1),
26
- borderColor: props.theme?.global.brand,
26
+ borderColor: props.theme?.filter.border,
27
27
  borderRadius: cx(12),
28
28
  },
29
29
  text: {
30
30
  marginStart: cx(12),
31
- color: props.theme?.global.brand,
31
+ color: props.theme?.filter.fontColor,
32
32
  fontSize: cx(14),
33
33
  fontFamily: 'helvetica_neue_lt_std_roman',
34
34
  },
@@ -36,8 +36,12 @@ const Tag = (props: TagProps) => {
36
36
  width: cx(12),
37
37
  height: cx(12),
38
38
  marginEnd: cx(6),
39
- tintColor: props.theme?.global.brand,
39
+ tintColor: props.theme?.filter.fontColor,
40
40
  },
41
+ checked: {
42
+ backgroundColor: props.theme?.filter.background
43
+ },
44
+ uncheck: {}
41
45
  })
42
46
 
43
47
  return (
@@ -45,7 +49,7 @@ const Tag = (props: TagProps) => {
45
49
  onPress={() => {
46
50
  props.onCheckedChange(!props.checked)
47
51
  }}>
48
- <View style={[styles.root, props.checked ? {backgroundColor: props.theme?.global.thirdBrand} : {}, props.style]}>
52
+ <View style={[styles.root, props.checked ? styles.checked : styles.uncheck, props.style]}>
49
53
  <Text style={[styles.text, {marginEnd: cx(props.checked ? 4 : 12)}]}>{props.text}</Text>
50
54
  {
51
55
  props.checked &&
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react'
1
+ import React, {useMemo} from 'react'
2
2
  import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'
3
3
  import {Picker, Utils} from 'tuya-panel-kit'
4
4
  import _ from 'lodash'
@@ -52,9 +52,10 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
52
52
  },
53
53
  })
54
54
  return (
55
- <View style={[styles.pickerContainer, props.style]}>
55
+ <View key={props.theme?.type} style={[styles.pickerContainer, props.style]}>
56
56
  <View style={styles.picContainer}>
57
57
  <Picker
58
+ itemTextColor='#aeadb5'
58
59
  style={[styles.picker, styles.pickerLeft]}
59
60
  loop={true}
60
61
  theme={pickerTheme}
@@ -75,6 +76,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
75
76
  </View>
76
77
  <View style={styles.picContainer}>
77
78
  <Picker
79
+ itemTextColor='#aeadb5'
78
80
  style={[styles.picker, styles.pickerLeft]}
79
81
  loop={true}
80
82
  theme={pickerTheme}
@@ -44,6 +44,11 @@ const darkTheme = {
44
44
  normal: '#a6a6a6', /* 中性灰,适合在深色背景上 */
45
45
  disable: '#555555', /* 更深的灰色,表示禁用状态 */
46
46
  },
47
+ filter: {
48
+ fontColor: '#ff6600',
49
+ border: '#ff6600',
50
+ background: '#FFE0D4'
51
+ },
47
52
  tag: {
48
53
  background: '#737373',
49
54
  fontColor: '#ffffff'
@@ -44,6 +44,11 @@ const lightTheme = {
44
44
  normal: '#666666',
45
45
  disable: '#cccccc',
46
46
  },
47
+ filter: {
48
+ fontColor: '#ff6600',
49
+ border: '#ff6600',
50
+ background: '#FFE0D4'
51
+ },
47
52
  tag: {
48
53
  background: '#E6E7E8',
49
54
  fontColor: '#000000'
package/src/i18n/index.ts CHANGED
@@ -1,28 +1,28 @@
1
- import {DpValue, I18N} from 'tuya-panel-kit'
1
+ import {DpValue, I18N, TYSdk} from 'tuya-panel-kit'
2
2
  import Strings from './strings'
3
3
 
4
4
  type Key = keyof typeof Strings.en
5
+ // @ts-ignore
6
+ const I18NInstance = new I18N(Strings)
5
7
 
6
8
  function getLang(key: Key, defaultString?: string): string {
7
- // @ts-ignore
8
- return new I18N(Strings).getLang(key, defaultString)
9
+ return I18NInstance.getLang(key, defaultString)
9
10
  }
10
11
 
11
12
  function getDpLang(code: string, value?: DpValue): string {
12
- return new I18N(Strings).getDpLang(code, value)
13
+ return I18NInstance.getDpLang(code, value)
13
14
  }
14
15
 
15
16
  function formatString(key: string, values: string[]): string {
16
- return new I18N(Strings).formatString(key, ...values)
17
+ return I18NInstance.formatString(key, ...values)
17
18
  }
18
19
 
19
20
  function formatValue(key: Key, ...values: string[]): string {
20
- // @ts-ignore
21
- return new I18N(Strings).formatValue(key, ...values)
21
+ return I18NInstance.formatValue(key, ...values)
22
22
  }
23
23
 
24
24
  function getDpName(code: string, defaultName?: string): string {
25
- return new I18N(Strings).getDpName(code, defaultName)
25
+ return I18NInstance.getDpName(code, defaultName)
26
26
  }
27
27
 
28
28
  const I18n = {
@@ -33,5 +33,7 @@ const I18n = {
33
33
  getDpName,
34
34
  }
35
35
 
36
+ const lang = TYSdk.mobile.mobileInfo.lang
37
+
36
38
  export default I18n
37
- export { Key as I18nKey }
39
+ export { Key as I18nKey, lang }