@ledvance/base 1.2.5 → 1.2.7
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
|
@@ -39,6 +39,7 @@ interface DrawToolViewProps extends PropsWithChildren<ViewProps> {
|
|
|
39
39
|
isSupportBrightness?: boolean
|
|
40
40
|
isColorMode?: boolean
|
|
41
41
|
setIsColorMode: (isColorMode: boolean) => void
|
|
42
|
+
blockColor?: string
|
|
42
43
|
h: number
|
|
43
44
|
s: number
|
|
44
45
|
v: number
|
|
@@ -163,7 +164,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
|
|
|
163
164
|
</View>
|
|
164
165
|
<LdvSwitch
|
|
165
166
|
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
166
|
-
color={getBlockColor()}
|
|
167
|
+
color={props.blockColor || getBlockColor()}
|
|
167
168
|
colorAlpha={1}
|
|
168
169
|
enable={false}
|
|
169
170
|
showSwitch={false}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HSV {
|
|
3
|
+
h: number;
|
|
4
|
+
s: number;
|
|
5
|
+
v: number;
|
|
6
|
+
}
|
|
7
|
+
interface LampConfigViewProps {
|
|
8
|
+
isSupportColor: boolean;
|
|
9
|
+
isSupportCCT: boolean;
|
|
10
|
+
isSupportBrightness: boolean;
|
|
11
|
+
isColorMode: boolean;
|
|
12
|
+
setIsColorMode: (isColorMode: boolean) => void;
|
|
13
|
+
minBrightness?: number;
|
|
14
|
+
minSaturation?: number;
|
|
15
|
+
reserveSV?: boolean;
|
|
16
|
+
hsv: HSV;
|
|
17
|
+
onHSVChange: (hsv: HSV, isComplete: boolean) => void;
|
|
18
|
+
cct: number;
|
|
19
|
+
onCCTChange: (cct: number, isComplete: boolean) => void;
|
|
20
|
+
brightness: number;
|
|
21
|
+
onBrightnessChange: (brightness: number, isComplete: boolean) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: React.MemoExoticComponent<(props: LampConfigViewProps) => JSX.Element>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native'
|
|
2
|
+
import React, { memo } from 'react'
|
|
3
|
+
import { Utils } from 'tuya-panel-kit'
|
|
4
|
+
import { useReactive } from 'ahooks'
|
|
5
|
+
import Spacer from './Spacer'
|
|
6
|
+
import ColorAdjustView from './ColorAdjustView'
|
|
7
|
+
import ColorTempAdjustView from './ColorTempAdjustView'
|
|
8
|
+
import SegmentControl from './segmentControl'
|
|
9
|
+
import I18n from '../i18n/index'
|
|
10
|
+
|
|
11
|
+
const { convertX: cx } = Utils.RatioUtils
|
|
12
|
+
|
|
13
|
+
export interface HSV {
|
|
14
|
+
h: number
|
|
15
|
+
s: number
|
|
16
|
+
v: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface LampConfigViewProps {
|
|
20
|
+
isSupportColor: boolean
|
|
21
|
+
isSupportCCT: boolean
|
|
22
|
+
isSupportBrightness: boolean
|
|
23
|
+
isColorMode: boolean
|
|
24
|
+
setIsColorMode: (isColorMode: boolean) => void
|
|
25
|
+
minBrightness?: number // 最小亮度
|
|
26
|
+
minSaturation?: number // 最小Saturation
|
|
27
|
+
reserveSV?: boolean // 保留 s v
|
|
28
|
+
hsv: HSV
|
|
29
|
+
onHSVChange: (hsv: HSV, isComplete: boolean) => void
|
|
30
|
+
cct: number
|
|
31
|
+
onCCTChange: (cct: number, isComplete: boolean) => void
|
|
32
|
+
brightness: number
|
|
33
|
+
onBrightnessChange: (brightness: number, isComplete: boolean) => void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const LampAdjustView2 = (props: LampConfigViewProps) => {
|
|
37
|
+
|
|
38
|
+
const state = useReactive({
|
|
39
|
+
hasSegmentControl: props.isSupportColor && (props.isSupportBrightness || props.isSupportCCT),
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View>
|
|
44
|
+
{state.hasSegmentControl &&
|
|
45
|
+
<SegmentControl
|
|
46
|
+
style={styles.segmentControl}
|
|
47
|
+
title1={I18n.getLang('light_sources_tile_rgb_lighting_tab_color')}
|
|
48
|
+
title2={I18n.getLang('light_sources_tile_rgb_lighting_tab_white')}
|
|
49
|
+
isFirst={props.isColorMode}
|
|
50
|
+
setIsFirst={props.setIsColorMode}/>
|
|
51
|
+
}
|
|
52
|
+
{((state.hasSegmentControl && props.isColorMode) || (!state.hasSegmentControl && props.isSupportColor)) &&
|
|
53
|
+
<>
|
|
54
|
+
{state.hasSegmentControl && <Spacer height={cx(10)}/>}
|
|
55
|
+
<ColorAdjustView
|
|
56
|
+
h={props.hsv.h}
|
|
57
|
+
s={props.hsv.s}
|
|
58
|
+
v={props.hsv.v}
|
|
59
|
+
minBrightness={props.minBrightness}
|
|
60
|
+
minSaturation={props.minSaturation}
|
|
61
|
+
reserveSV={props.reserveSV}
|
|
62
|
+
onHSVChange={(h, s, v) => {
|
|
63
|
+
props.onHSVChange({ h, s, v }, false)
|
|
64
|
+
}}
|
|
65
|
+
onHSVChangeComplete={(h, s, v) => {
|
|
66
|
+
props.onHSVChange({ h, s, v }, true)
|
|
67
|
+
}}/>
|
|
68
|
+
<Spacer/>
|
|
69
|
+
</>
|
|
70
|
+
}
|
|
71
|
+
{((state.hasSegmentControl && !props.isColorMode) || (!state.hasSegmentControl && (props.isSupportBrightness || props.isSupportCCT))) &&
|
|
72
|
+
<>
|
|
73
|
+
{state.hasSegmentControl && <Spacer height={cx(10)}/>}
|
|
74
|
+
<ColorTempAdjustView
|
|
75
|
+
minBrightness={props.minBrightness}
|
|
76
|
+
isSupportTemperature={props.isSupportCCT}
|
|
77
|
+
isSupportBrightness={props.isSupportBrightness}
|
|
78
|
+
colorTemp={props.cct}
|
|
79
|
+
brightness={props.brightness}
|
|
80
|
+
onCCTChange={cct => {
|
|
81
|
+
props.onCCTChange(cct, false)
|
|
82
|
+
}}
|
|
83
|
+
onCCTChangeComplete={cct => {
|
|
84
|
+
props.onCCTChange(cct, true)
|
|
85
|
+
}}
|
|
86
|
+
onBrightnessChange={brightness => {
|
|
87
|
+
props.onBrightnessChange(brightness, false)
|
|
88
|
+
}}
|
|
89
|
+
onBrightnessChangeComplete={brightness => {
|
|
90
|
+
props.onBrightnessChange(brightness, true)
|
|
91
|
+
}}/>
|
|
92
|
+
<Spacer/>
|
|
93
|
+
</>
|
|
94
|
+
}
|
|
95
|
+
</View>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
segmentControl: {
|
|
101
|
+
marginHorizontal: cx(16),
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
export default memo(LampAdjustView2)
|
package/.temp/uaDevInfo.txt
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|