@ledvance/base 1.1.98 → 1.2.0

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.
@@ -0,0 +1,51 @@
1
+ @ColumnInfo(name = "device_id")
2
+ val deviceId: String,
3
+ @ColumnInfo(name = "device_name")
4
+ val deviceName: String,
5
+ @ColumnInfo(name = "cat_id")
6
+ val catId: String,
7
+ @ColumnInfo(name = "channel_no")
8
+ val channelNo: Int,
9
+ @ColumnInfo(name = "device_category")
10
+ val deviceCategory: String,
11
+ @ColumnInfo(name = "device_image")
12
+ val deviceImage: String,
13
+ @ColumnInfo(name = "tuya_device_id")
14
+ val tuyaDeviceId: String,
15
+ // deviceType 对应 ProductInfo 的 productId
16
+ @ColumnInfo(name = "device_type")
17
+ val deviceType: String,
18
+ @ColumnInfo(name = "offline_time")
19
+ val offlineTime: String,
20
+ @ColumnInfo(name = "rn_package")
21
+ val rnPackage: String?,
22
+ @ColumnInfo(name = "status")
23
+ val status: Int,
24
+ @ColumnInfo(name = "create_time")
25
+ val createTime: String,
26
+ @ColumnInfo(name = "version")
27
+ val version: String,
28
+ @ColumnInfo(name = "user_id")
29
+ val userId: String,
30
+ @ColumnInfo(name = "family_id")
31
+ val familyId: Long,
32
+ @ColumnInfo(name = "room_id")
33
+ val roomId: Long,
34
+ @ColumnInfo(name = "room_name")
35
+ val roomName: String,
36
+ @ColumnInfo(name = "is_shared")
37
+ val isShared: Int,
38
+ @ColumnInfo(name = "local_index")
39
+ val localIndex: String,
40
+ @ColumnInfo(name = "resource_category")
41
+ val resourceCategory: String,
42
+ @ColumnInfo(name = "resource_id")
43
+ val resourceId: String,
44
+ @ColumnInfo(name = "resource_identifier")
45
+ val resourceIdentifier: String,
46
+ @ColumnInfo(name = "resource_type")
47
+ val resourceType: Int,
48
+ @ColumnInfo(name = "index")
49
+ val index: Int = 0,
50
+ @ColumnInfo(name = "switch_state")
51
+ val switchState: Boolean = true
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.98",
7
+ "version": "1.2.0",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -66,4 +66,5 @@ export declare const formatNumber: (num: number, fixed: number, shoGroup?: boole
66
66
  export declare const getTimeZone: () => string;
67
67
  export declare const getSystemTimeFormat: () => Promise<number>;
68
68
  export declare const getMicrophoneAccess: () => Promise<boolean>;
69
+ export declare const getTuyaCloudData: (devId: string) => Promise<Record<string, any>>;
69
70
  export {};
@@ -0,0 +1,6 @@
1
+ import { DeviceInfo } from '../api/native';
2
+ export interface ApplyForDeviceItemProps {
3
+ deviceInfo: DeviceInfo;
4
+ }
5
+ declare const ApplyForCeilingFanDeviceItem: (props: ApplyForDeviceItemProps) => JSX.Element;
6
+ export default ApplyForCeilingFanDeviceItem;
@@ -0,0 +1,72 @@
1
+ import { Image, StyleSheet, Text, View } from 'react-native'
2
+ import React from 'react'
3
+ import { Utils } from 'tuya-panel-kit'
4
+ import { DeviceInfo } from '../api/native'
5
+ import Spacer from './Spacer'
6
+
7
+ const cx = Utils.RatioUtils.convertX
8
+
9
+ export interface ApplyForDeviceItemProps {
10
+ deviceInfo: DeviceInfo
11
+ }
12
+
13
+ const ApplyForCeilingFanDeviceItem = (props: ApplyForDeviceItemProps) => {
14
+ return (
15
+ <View style={styles.root}>
16
+ <View style={styles.deviceInfo}>
17
+ <Image style={styles.deviceIcon} source={{ uri: props.deviceInfo.deviceIcon }}/>
18
+ <Text style={styles.deviceName}>{props.deviceInfo.deviceName}</Text>
19
+ </View>
20
+ <View style={styles.deviceRoomInfo}>
21
+ <View style={styles.roomNameTag}>
22
+ <Text style={styles.roomName}>{props.deviceInfo.roomName}</Text>
23
+ </View>
24
+ </View>
25
+ <Spacer height={cx(6)}/>
26
+ </View>
27
+ )
28
+ }
29
+
30
+ const styles = StyleSheet.create({
31
+ root: {
32
+ marginHorizontal: cx(8),
33
+ backgroundColor: '#fff',
34
+ },
35
+ deviceInfo: {
36
+ flex: 1,
37
+ flexDirection: 'row',
38
+ alignItems: 'center',
39
+ marginTop: cx(4),
40
+ },
41
+ deviceIcon: {
42
+ width: cx(24),
43
+ height: cx(24),
44
+ marginStart: cx(6),
45
+ },
46
+ deviceName: {
47
+ flex: 1,
48
+ marginStart: cx(8),
49
+ color: '#666',
50
+ fontSize: cx(16),
51
+ fontFamily: 'helvetica_neue_lt_std_roman',
52
+ },
53
+ deviceRoomInfo: {
54
+ marginStart: cx(38),
55
+ flexDirection: 'row',
56
+ },
57
+ roomNameTag: {
58
+ height: cx(16),
59
+ display: 'flex',
60
+ justifyContent: 'center',
61
+ backgroundColor: '#cbcbcb',
62
+ borderRadius: cx(8),
63
+ },
64
+ roomName: {
65
+ marginHorizontal: cx(12),
66
+ color: '#000',
67
+ fontSize: cx(10),
68
+ fontFamily: 'helvetica_neue_lt_std_roman',
69
+ },
70
+ })
71
+
72
+ export default ApplyForCeilingFanDeviceItem
@@ -0,0 +1,7 @@
1
+ import { DeviceInfo } from '../api/native';
2
+ export interface ApplyForDeviceListProps {
3
+ devices: DeviceInfo[];
4
+ expand: boolean;
5
+ onExpandChange: (expand: boolean) => void;
6
+ }
7
+ export default function ApplyForDeviceList(props: ApplyForDeviceListProps): JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { DeviceInfo } from '../api/native'
2
+ import React from 'react'
3
+ import ApplyForText from './ApplyForText'
4
+ import { FlatList, StyleSheet, View } from 'react-native'
5
+ import Spacer from './Spacer'
6
+ import ApplyForDeviceItem from './ApplyForDeviceItem'
7
+ import { Utils } from 'tuya-panel-kit'
8
+
9
+ const cx = Utils.RatioUtils.convertX
10
+
11
+ export interface ApplyForDeviceListProps {
12
+ devices: DeviceInfo[]
13
+ expand: boolean
14
+ onExpandChange: (expand: boolean) => void
15
+ }
16
+
17
+ export default function ApplyForDeviceList(props: ApplyForDeviceListProps) {
18
+ return <View>
19
+ <ApplyForText
20
+ expand={props.expand}
21
+ onExpandChange={props.onExpandChange}/>
22
+ <Spacer height={cx(2)}/>
23
+ {props.expand &&
24
+ <FlatList
25
+ style={styles.deviceList}
26
+ data={props.devices}
27
+ renderItem={({ item }) => <ApplyForDeviceItem deviceInfo={item}/>}
28
+ keyExtractor={item => item.deviceId}
29
+ ItemSeparatorComponent={() => {
30
+ return (
31
+ <Spacer
32
+ style={{
33
+ backgroundColor: 'rgb(241,241,241)',
34
+ }}
35
+ height={cx(8)}/>
36
+ )
37
+ }}/>}
38
+ </View>
39
+ }
40
+
41
+ const styles = StyleSheet.create({
42
+ deviceList: {
43
+ marginHorizontal: cx(16),
44
+ paddingVertical: cx(8),
45
+ backgroundColor: 'rgb(241,241,241)',
46
+ },
47
+ })
@@ -0,0 +1,6 @@
1
+ export interface ApplyForTextProps {
2
+ expand: boolean;
3
+ onExpandChange: (expand: boolean) => void;
4
+ }
5
+ declare const ApplyForText: (props: ApplyForTextProps) => JSX.Element;
6
+ export default ApplyForText;
@@ -0,0 +1,53 @@
1
+ import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
2
+ import React from 'react'
3
+ import { Utils } from 'tuya-panel-kit'
4
+ import res from '../res/index'
5
+ import I18n from '../i18n/index'
6
+
7
+ const cx = Utils.RatioUtils.convertX
8
+
9
+ export interface ApplyForTextProps {
10
+ expand: boolean
11
+ onExpandChange: (expand: boolean) => void
12
+ }
13
+
14
+ const ApplyForText = (props: ApplyForTextProps) => {
15
+ return (
16
+ <TouchableOpacity
17
+ onPress={() => {
18
+ props.onExpandChange(!props.expand)
19
+ }}>
20
+ <View style={styles.root}>
21
+ <Text style={styles.text}>{I18n.getLang('timeschedule_add_schedule_subheadline_text')}</Text>
22
+ <Image
23
+ style={
24
+ [styles.icon,
25
+ {
26
+ transform: [{ rotate: props.expand ? '0deg' : '180deg' }],
27
+ },
28
+ ]}
29
+ source={res.ic_top_arrow}/>
30
+ </View>
31
+ </TouchableOpacity>
32
+ )
33
+ }
34
+
35
+ const styles = StyleSheet.create({
36
+ root: {
37
+ flexDirection: 'row',
38
+ alignItems: 'center',
39
+ marginStart: cx(16),
40
+ },
41
+ text: {
42
+ color: '#666',
43
+ fontSize: cx(16),
44
+ letterSpacing: cx(0.12),
45
+ fontFamily: 'helvetica_neue_lt_std_bd',
46
+ },
47
+ icon: {
48
+ width: cx(24),
49
+ height: cx(24),
50
+ },
51
+ })
52
+
53
+ export default ApplyForText
@@ -3,6 +3,7 @@ export interface ColorAdjustViewProps {
3
3
  s: number;
4
4
  v: number;
5
5
  minBrightness?: number;
6
+ minSaturation?: number;
6
7
  reserveSV?: boolean;
7
8
  onHSVChange?: (h: number, s: number, v: number) => void;
8
9
  onHSVChangeComplete: (h: number, s: number, v: number) => void;
@@ -2,6 +2,7 @@ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
2
  interface ListData {
3
3
  text: string;
4
4
  value?: any;
5
+ isMax?: boolean;
5
6
  }
6
7
  interface CustomListDialogProps extends ViewProps {
7
8
  itemStyle?: StyleProp<ViewStyle>;
@@ -36,6 +36,10 @@ interface DrawToolViewProps extends PropsWithChildren<ViewProps> {
36
36
  hideLedNum?: boolean;
37
37
  ledNum?: number;
38
38
  setLedNum: (num: number) => void;
39
+ hidLampAdjustView?: boolean;
40
+ hideDisableLight?: boolean;
41
+ hideColorize?: boolean;
42
+ ledNumModalVisible?: boolean;
39
43
  }
40
44
  declare const DrawToolView: (props: DrawToolViewProps) => JSX.Element;
41
45
  export default DrawToolView;
@@ -76,6 +76,12 @@ const DrawToolView = (props: DrawToolViewProps) => {
76
76
  }
77
77
  }, [])
78
78
 
79
+ useUpdateEffect(() =>{
80
+ if(props.ledNum){
81
+ state.ledNum = props.ledNum
82
+ }
83
+ }, [props.ledNum])
84
+
79
85
  useUpdateEffect(() =>{
80
86
  state.visible = props.ledNumModalVisible
81
87
  }, [props.ledNumModalVisible])
@@ -7,6 +7,7 @@ export interface StepperProps {
7
7
  max?: number;
8
8
  editable?: boolean;
9
9
  selectionColor?: string;
10
+ isRealTime?: boolean;
10
11
  onValueChange?: ((value: number) => void);
11
12
  disabled?: boolean;
12
13
  style?: StyleProp<ViewStyle>;
@@ -0,0 +1,6 @@
1
+ import { ViewProps } from 'react-native';
2
+ export interface UATabTitleProps extends ViewProps {
3
+ text: string;
4
+ onIconClick: () => void;
5
+ }
6
+ export default function UATabTitle(props: UATabTitleProps): JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { Image, StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-native'
2
+ import Spacer from './Spacer'
3
+ import React from 'react'
4
+ import { Utils } from 'tuya-panel-kit'
5
+ import res from '../res/index'
6
+
7
+ const cx = Utils.RatioUtils.convertX
8
+
9
+ export interface UATabTitleProps extends ViewProps {
10
+ text: string
11
+ onIconClick: () => void
12
+ }
13
+
14
+ export default function UATabTitle(props: UATabTitleProps) {
15
+ return (
16
+ <View style={[{ flex: 1, flexDirection: 'row', alignItems: 'center' }, props.style]}>
17
+ <Text style={styles.tabsTitle}>{props.text}</Text>
18
+ <Spacer height={cx(0)} width={cx(4)}/>
19
+ <TouchableOpacity onPress={props.onIconClick}>
20
+ <Image style={{ width: cx(16), height: cx(16), tintColor: '#f60' }} source={{ uri: res.ic_info }}/>
21
+ </TouchableOpacity>
22
+ </View>
23
+ )
24
+ }
25
+
26
+ const styles = StyleSheet.create({
27
+ tabsTitle: {
28
+ color: '#000',
29
+ fontSize: cx(14),
30
+ fontFamily: 'helvetica_neue_lt_std_roman',
31
+ },
32
+ })
@@ -0,0 +1,12 @@
1
+ import { ViewProps } from 'react-native';
2
+ export interface UATabsProps extends ViewProps {
3
+ active: any;
4
+ data: UATabData[];
5
+ onSelectChange: (value: UATabData, index: number) => void;
6
+ }
7
+ export interface UATabData {
8
+ title: string;
9
+ value?: any;
10
+ }
11
+ declare const UATabs: (props: UATabsProps) => JSX.Element;
12
+ export default UATabs;
@@ -0,0 +1,78 @@
1
+ import React from 'react'
2
+ import { StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-native'
3
+ import { Utils } from 'tuya-panel-kit'
4
+
5
+ const cx = Utils.RatioUtils.convertX
6
+
7
+ export interface UATabsProps extends ViewProps {
8
+ active: any
9
+ data: UATabData[]
10
+ onSelectChange: (value: UATabData, index: number) => void
11
+ }
12
+
13
+ export interface UATabData {
14
+ title: string
15
+ value?: any
16
+ }
17
+
18
+ const UATabs = (props: UATabsProps) => {
19
+ return (
20
+ <View style={[styles.root, props.style]}>
21
+ <View style={styles.tabs}>
22
+ {props.data.map((item, index) => {
23
+
24
+ const active = props.active === item.value
25
+
26
+ return <TouchableOpacity
27
+ key={index}
28
+ style={{ flex: 1 }}
29
+ onPress={() => {
30
+ props.onSelectChange(item, index)
31
+ }}>
32
+ <View style={[
33
+ styles.tab,
34
+ {
35
+ backgroundColor: active ? '#f60' : '#f6f6f6',
36
+ },
37
+ ]}>
38
+ <Text style={[
39
+ styles.tabText,
40
+ {
41
+ color: active ? '#fff' : '#999',
42
+ },
43
+ ]}>{item.title}</Text>
44
+ </View>
45
+ </TouchableOpacity>
46
+ })}
47
+ </View>
48
+ </View>
49
+ )
50
+ }
51
+
52
+ const styles = StyleSheet.create({
53
+ root: {
54
+ flex: 1,
55
+ height: cx(32),
56
+ paddingVertical: cx(2),
57
+ paddingHorizontal: cx(3),
58
+ backgroundColor: '#f6f6f6',
59
+ borderRadius: cx(9),
60
+ },
61
+ tabs: {
62
+ flex: 1,
63
+ flexDirection: 'row',
64
+ overflow: 'hidden',
65
+ borderRadius: cx(7),
66
+ },
67
+ tab: {
68
+ flex: 1,
69
+ justifyContent: 'center',
70
+ alignItems: 'center',
71
+ },
72
+ tabText: {
73
+ fontSize: cx(14),
74
+ fontFamily: 'helvetica_neue_lt_std_roman',
75
+ },
76
+ })
77
+
78
+ export default UATabs
@@ -8,7 +8,7 @@ interface LdvSliderProps {
8
8
  onSlidingComplete: (v: number) => void;
9
9
  style?: StyleProp<ViewStyle> | undefined;
10
10
  sliderStyle?: StyleProp<ViewStyle> | undefined;
11
- subTitleStr?: string;
11
+ subTitleStr?: string | number;
12
12
  titleStyle?: StyleProp<TextStyle> | undefined;
13
13
  }
14
14
  declare const LdvSlider: (props: LdvSliderProps) => JSX.Element;