@ledvance/base 1.1.40 → 1.1.42
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 +1 -1
- package/src/api/native.d.ts +2 -2
- package/src/components/Card.d.ts +1 -1
- package/src/components/Cell.d.ts +2 -2
- package/src/components/ColorAdjustView.d.ts +1 -1
- package/src/components/ColorExtractor.d.ts +1 -1
- package/src/components/ColorTempAdjustView.d.ts +1 -1
- package/src/components/ColorsLine.d.ts +1 -1
- package/src/components/CustomListDialog.d.ts +1 -1
- package/src/components/DeleteButton.d.ts +1 -1
- package/src/components/Dialog.d.ts +1 -1
- package/src/components/FanAdjustView.d.ts +1 -1
- package/src/components/InfoText.d.ts +1 -1
- package/src/components/LampAdjustView.d.ts +1 -1
- package/src/components/LinearGradientLine.d.ts +1 -1
- package/src/components/MoodColorsLine.d.ts +2 -2
- package/src/components/Page.d.ts +1 -1
- package/src/components/Segmented.d.ts +1 -1
- package/src/components/ShowSelect.d.ts +1 -0
- package/src/components/ShowSelect.tsx +159 -0
- package/src/components/Spacer.d.ts +1 -1
- package/src/components/Tag.d.ts +1 -1
- package/src/components/TextButton.d.ts +1 -1
- package/src/components/TextField.d.ts +1 -1
- package/src/components/TextFieldStyleButton.d.ts +1 -1
- package/src/components/connect.d.ts +1 -9
- package/src/components/ldvColorBrightness.d.ts +1 -1
- package/src/components/ldvColorSlider.d.ts +1 -1
- package/src/components/ldvPickerView.d.ts +1 -1
- package/src/components/ldvPresetView.d.ts +1 -1
- package/src/components/ldvSaturation.d.ts +1 -1
- package/src/components/ldvSlider.d.ts +1 -1
- package/src/components/ldvSwitch.d.ts +2 -1
- package/src/components/ldvTemperatureSlider.d.ts +1 -1
- package/src/components/ldvTopBar.d.ts +1 -1
- package/src/components/ldvTopName.d.ts +1 -1
- package/src/components/segmentControl.d.ts +1 -1
- package/src/components/weekSelect.d.ts +1 -1
- package/src/composeLayout.d.ts +30 -0
- package/src/i18n/index.d.ts +1 -1
- package/src/i18n/strings.ts +330 -50
- package/src/models/combine.d.ts +8 -21
- package/src/models/configureStore.d.ts +1 -8
- package/src/models/index.d.ts +8 -23
- package/src/models/modules/NativePropsSlice.d.ts +6 -6
- package/src/models/modules/common.d.ts +13 -21
- package/src/utils/ColorParser.d.ts +3 -3
- package/src/utils/ColorUtils.d.ts +1 -1
- package/src/utils/cctUtils.d.ts +1 -1
- package/src/utils/common.d.ts +2 -2
- package/src/utils/loopsCompare.d.ts +1 -0
package/package.json
CHANGED
package/src/api/native.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface DeviceInfo {
|
|
|
6
6
|
roomName: string;
|
|
7
7
|
status: number;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type GetFeatureResultType = (deviceId: string, featureId: string) => Promise<NativeResult<any>>;
|
|
10
|
+
type SetFeatureResultType = (deviceId: string, featureId: string, value: any) => Promise<NativeResult<any>>;
|
|
11
11
|
export declare const getFeature: GetFeatureResultType;
|
|
12
12
|
export declare const putFeature: SetFeatureResultType;
|
|
13
13
|
export declare class NativeApi {
|
package/src/components/Card.d.ts
CHANGED
package/src/components/Cell.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface CellProps {
|
|
|
5
5
|
onPress: () => void;
|
|
6
6
|
style?: StyleProp<ViewStyle>;
|
|
7
7
|
}
|
|
8
|
-
export default function Cell(props: CellProps):
|
|
8
|
+
export default function Cell(props: CellProps): any;
|
|
9
9
|
interface CellContentProps {
|
|
10
10
|
title: string;
|
|
11
11
|
value: string;
|
|
@@ -17,5 +17,5 @@ interface CellContentProps {
|
|
|
17
17
|
size?: number;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare function CellContent(props: CellContentProps):
|
|
20
|
+
export declare function CellContent(props: CellContentProps): any;
|
|
21
21
|
export {};
|
|
@@ -5,5 +5,5 @@ export interface ColorAdjustViewProps {
|
|
|
5
5
|
onHSVChange?: (h: number, s: number, v: number) => void;
|
|
6
6
|
onHSVChangeComplete: (h: number, s: number, v: number) => void;
|
|
7
7
|
}
|
|
8
|
-
declare const ColorAdjustView: (props: ColorAdjustViewProps) =>
|
|
8
|
+
declare const ColorAdjustView: (props: ColorAdjustViewProps) => any;
|
|
9
9
|
export default ColorAdjustView;
|
|
@@ -27,7 +27,7 @@ export default class ColorExtractor extends Component<any> {
|
|
|
27
27
|
y: number;
|
|
28
28
|
};
|
|
29
29
|
updateColor(x: any, y: any, moving: any, isFirst?: boolean): void;
|
|
30
|
-
render():
|
|
30
|
+
render(): any;
|
|
31
31
|
}
|
|
32
32
|
export declare const colorTemperature: {
|
|
33
33
|
2700: string;
|
|
@@ -8,5 +8,5 @@ export interface ColorTempAdjustViewProps {
|
|
|
8
8
|
onBrightnessChange?: (brightness: number) => void;
|
|
9
9
|
onBrightnessChangeComplete: (brightness: number) => void;
|
|
10
10
|
}
|
|
11
|
-
declare const ColorTempAdjustView: (props: ColorTempAdjustViewProps) =>
|
|
11
|
+
declare const ColorTempAdjustView: (props: ColorTempAdjustViewProps) => any;
|
|
12
12
|
export default ColorTempAdjustView;
|
|
@@ -10,5 +10,5 @@ interface CustomListDialogProps extends ViewProps {
|
|
|
10
10
|
data: ListData[];
|
|
11
11
|
onItemPress: (item: any | undefined, index: number) => void;
|
|
12
12
|
}
|
|
13
|
-
declare const CustomListDialog: (props: CustomListDialogProps) =>
|
|
13
|
+
declare const CustomListDialog: (props: CustomListDialogProps) => any;
|
|
14
14
|
export default CustomListDialog;
|
|
@@ -6,5 +6,5 @@ interface DialogProps extends PropsWithChildren<ViewProps> {
|
|
|
6
6
|
animationType?: 'none' | 'slide' | 'fade';
|
|
7
7
|
onRequestClose: () => void;
|
|
8
8
|
}
|
|
9
|
-
declare const Dialog: (props: DialogProps) =>
|
|
9
|
+
declare const Dialog: (props: DialogProps) => any;
|
|
10
10
|
export default Dialog;
|
|
@@ -18,5 +18,5 @@ interface FanAdjustViewProps extends ViewProps {
|
|
|
18
18
|
onFanSpeedChange?: (fanSpeed: number) => void;
|
|
19
19
|
onFanSpeedChangeComplete: (fanSpeed: number) => void;
|
|
20
20
|
}
|
|
21
|
-
declare const FanAdjustView: (props: FanAdjustViewProps) =>
|
|
21
|
+
declare const FanAdjustView: (props: FanAdjustViewProps) => any;
|
|
22
22
|
export default FanAdjustView;
|
|
@@ -9,5 +9,5 @@ interface LampConfigViewProps extends ColorAdjustViewProps, ColorTempAdjustViewP
|
|
|
9
9
|
isColorMode: boolean;
|
|
10
10
|
setIsColorMode: (isColorMode: boolean) => void;
|
|
11
11
|
}
|
|
12
|
-
declare const LampAdjustView: (props: LampConfigViewProps) =>
|
|
12
|
+
declare const LampAdjustView: (props: LampConfigViewProps) => any;
|
|
13
13
|
export default LampAdjustView;
|
|
@@ -5,5 +5,5 @@ interface LinearGradientLineProps extends StyleProp<any> {
|
|
|
5
5
|
colors: string[];
|
|
6
6
|
orientation?: 'vertical' | 'horizontal';
|
|
7
7
|
}
|
|
8
|
-
declare const LinearGradientLine: (props: LinearGradientLineProps) =>
|
|
8
|
+
declare const LinearGradientLine: (props: LinearGradientLineProps) => any;
|
|
9
9
|
export default LinearGradientLine;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type MoodColorsLineType = 'gradient' | 'separate';
|
|
2
2
|
interface MoodColorsLineProps {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
type: MoodColorsLineType;
|
|
6
6
|
colors: string[];
|
|
7
7
|
}
|
|
8
|
-
export default function MoodColorsLine(props: MoodColorsLineProps):
|
|
8
|
+
export default function MoodColorsLine(props: MoodColorsLineProps): any;
|
|
9
9
|
export {};
|
package/src/components/Page.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ShowSelectView: (title: any, data: any, defaultValue: any, callback: any) => void;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, Text, TouchableOpacity, Image } from 'react-native'
|
|
3
|
+
import { Utils, Popup } from 'tuya-panel-kit'
|
|
4
|
+
import Img from 'res'
|
|
5
|
+
import Strings from '@i18n'
|
|
6
|
+
|
|
7
|
+
const { convertX, height } = Utils.RatioUtils
|
|
8
|
+
|
|
9
|
+
export const ShowSelectView = (title, data, defaultValue, callback) => {
|
|
10
|
+
|
|
11
|
+
const renderSelectView = () => {
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
style={{
|
|
15
|
+
height: height - convertX(120),
|
|
16
|
+
backgroundColor: 'rgb(242, 242, 247)',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<View style={{ marginHorizontal: convertX(16), marginVertical: convertX(40),shadow: {
|
|
21
|
+
shadowColor: '#000000',
|
|
22
|
+
shadowOpacity: 0.2,
|
|
23
|
+
shadowRadius: 8,
|
|
24
|
+
elevation:8,
|
|
25
|
+
shadowOffset: {
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 4,
|
|
28
|
+
},
|
|
29
|
+
backgroundColor: '#fff',
|
|
30
|
+
borderRadius: 8,
|
|
31
|
+
}, }}>
|
|
32
|
+
{
|
|
33
|
+
data.map((item, index) => {
|
|
34
|
+
if (index === 0) {
|
|
35
|
+
return (
|
|
36
|
+
<View key={item?.id}>
|
|
37
|
+
{renderItemView(item, () => {
|
|
38
|
+
Popup.close()
|
|
39
|
+
callback(item)
|
|
40
|
+
})}
|
|
41
|
+
</View>
|
|
42
|
+
)
|
|
43
|
+
} else {
|
|
44
|
+
return (
|
|
45
|
+
<View key={item?.id}>
|
|
46
|
+
{renderLineView()}
|
|
47
|
+
{renderItemView(item, () => {
|
|
48
|
+
Popup.close()
|
|
49
|
+
callback(item)
|
|
50
|
+
})}
|
|
51
|
+
</View>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
</View>
|
|
57
|
+
</View>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const renderItemView = ({ title }, onPress) => {
|
|
62
|
+
return (<TouchableOpacity
|
|
63
|
+
style={{
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
// flex: 1,
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
height: convertX(44),
|
|
69
|
+
paddingHorizontal: convertX(12)
|
|
70
|
+
}}
|
|
71
|
+
onPress={() => { if (defaultValue !== title) onPress() }}
|
|
72
|
+
>
|
|
73
|
+
<View>
|
|
74
|
+
<Text
|
|
75
|
+
style={{
|
|
76
|
+
fontSize: convertX(17),
|
|
77
|
+
color: '#000',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{title}
|
|
81
|
+
</Text>
|
|
82
|
+
</View>
|
|
83
|
+
{defaultValue === title &&
|
|
84
|
+
<Image
|
|
85
|
+
style={{ width: convertX(16), height: convertX(16) }}
|
|
86
|
+
source={Img.app_music_check}
|
|
87
|
+
resizeMode="contain"
|
|
88
|
+
/>}
|
|
89
|
+
</TouchableOpacity>)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const renderLineView = () => {
|
|
93
|
+
return (<View
|
|
94
|
+
style={{
|
|
95
|
+
height: convertX(1),
|
|
96
|
+
backgroundColor: 'rgba(60, 60, 67, 0.36)',
|
|
97
|
+
marginLeft: convertX(12)
|
|
98
|
+
}}
|
|
99
|
+
></View>)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const titleNode = () => {
|
|
103
|
+
return (
|
|
104
|
+
<View style={{ flexDirection: 'row', position: 'relative', height: convertX(81) }}>
|
|
105
|
+
<TouchableOpacity
|
|
106
|
+
style={{
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
left: convertX(16),
|
|
109
|
+
bottom: convertX(12),
|
|
110
|
+
zIndex: 1
|
|
111
|
+
}}
|
|
112
|
+
onPress={() => Popup.close()}
|
|
113
|
+
>
|
|
114
|
+
<Text
|
|
115
|
+
style={{
|
|
116
|
+
fontSize: convertX(17),
|
|
117
|
+
color: '#FF6600',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{Strings.getLang('auto_scan_system_cancel')}
|
|
121
|
+
</Text>
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
<View style={{ flexDirection: 'column-reverse', flex: 1, alignItems: 'center' }}>
|
|
124
|
+
<Text style={{
|
|
125
|
+
fontSize: convertX(17),
|
|
126
|
+
fontWeight: 'bold',
|
|
127
|
+
color: '#000000',
|
|
128
|
+
paddingBottom: convertX(12)
|
|
129
|
+
}}>{title}</Text>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
Popup.custom({
|
|
136
|
+
content: renderSelectView(),
|
|
137
|
+
title: titleNode(),
|
|
138
|
+
titleTextStyle: {
|
|
139
|
+
color: '#f60',
|
|
140
|
+
fontWeight: 'bold',
|
|
141
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
142
|
+
height: convertX(91),
|
|
143
|
+
},
|
|
144
|
+
footer: null,
|
|
145
|
+
footerWrapperStyle: {
|
|
146
|
+
display: 'none'
|
|
147
|
+
},
|
|
148
|
+
cancelText: '',
|
|
149
|
+
confirmText: '',
|
|
150
|
+
onMaskPress: ({ close }) => {
|
|
151
|
+
close()
|
|
152
|
+
},
|
|
153
|
+
onConfirm: () => {
|
|
154
|
+
Popup.close()
|
|
155
|
+
},
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
}
|
package/src/components/Tag.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ interface TextFieldStyleButtonProps extends ViewProps {
|
|
|
4
4
|
text: string;
|
|
5
5
|
onPress: () => void;
|
|
6
6
|
}
|
|
7
|
-
declare const TextFieldStyleButton: (props: TextFieldStyleButtonProps) =>
|
|
7
|
+
declare const TextFieldStyleButton: (props: TextFieldStyleButtonProps) => any;
|
|
8
8
|
export default TextFieldStyleButton;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare type ChildrenType = (props: any) => React.ReactElement | null;
|
|
3
|
-
declare const _default: import("react-redux").ConnectedComponent<({ children, ...props }: {
|
|
4
|
-
children: ChildrenType;
|
|
5
|
-
}) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null, Pick<{
|
|
6
|
-
children: ChildrenType;
|
|
7
|
-
}, "children"> & {
|
|
8
|
-
mapStateToProps: any;
|
|
9
|
-
}>;
|
|
1
|
+
declare const _default: any;
|
|
10
2
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function LdvColorBrightness(props: any):
|
|
1
|
+
export default function LdvColorBrightness(props: any): any;
|
|
@@ -10,5 +10,5 @@ interface LdvColorSliderProps {
|
|
|
10
10
|
width?: number | undefined;
|
|
11
11
|
style?: StyleProp<ViewStyle> | undefined;
|
|
12
12
|
}
|
|
13
|
-
declare const LdvColorSlider: (props: LdvColorSliderProps) =>
|
|
13
|
+
declare const LdvColorSlider: (props: LdvColorSliderProps) => any;
|
|
14
14
|
export default LdvColorSlider;
|
|
@@ -7,5 +7,5 @@ interface LdvPickerViewProps {
|
|
|
7
7
|
style?: StyleProp<ViewStyle> | undefined;
|
|
8
8
|
unit?: string[];
|
|
9
9
|
}
|
|
10
|
-
declare const LdvPickerView: (props: LdvPickerViewProps) =>
|
|
10
|
+
declare const LdvPickerView: (props: LdvPickerViewProps) => any;
|
|
11
11
|
export default LdvPickerView;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const LdvPresetView: (props: any) =>
|
|
1
|
+
declare const LdvPresetView: (props: any) => any;
|
|
2
2
|
export default LdvPresetView;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const LdvSaturation: (props: any) =>
|
|
1
|
+
declare const LdvSaturation: (props: any) => any;
|
|
2
2
|
export default LdvSaturation;
|
|
@@ -9,5 +9,5 @@ interface LdvTemperatureSliderProps {
|
|
|
9
9
|
titleStyle?: StyleProp<TextProps> | undefined;
|
|
10
10
|
subTitleStr?: string | undefined;
|
|
11
11
|
}
|
|
12
|
-
declare const LdvTemperatureSlider: (props: LdvTemperatureSliderProps) =>
|
|
12
|
+
declare const LdvTemperatureSlider: (props: LdvTemperatureSliderProps) => any;
|
|
13
13
|
export default LdvTemperatureSlider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function SegmentControl(props: any):
|
|
1
|
+
export default function SegmentControl(props: any): any;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DevInfo } from 'tuya-panel-kit';
|
|
2
|
+
import { DeviceInfo, UAGroupInfo } from './models/modules/NativePropsSlice';
|
|
3
|
+
interface Props {
|
|
4
|
+
devInfo: DevInfo;
|
|
5
|
+
preload?: boolean;
|
|
6
|
+
ldvDevInfo: LdvDevInfo;
|
|
7
|
+
uaGroupInfo: UAGroupInfoProps;
|
|
8
|
+
}
|
|
9
|
+
interface LdvDevInfo extends DeviceInfo {
|
|
10
|
+
schema: any;
|
|
11
|
+
familyName: string;
|
|
12
|
+
}
|
|
13
|
+
interface UAGroupInfoProps extends UAGroupInfo {
|
|
14
|
+
schema: any;
|
|
15
|
+
familyName: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {} component - 需要连接到redux store的组件,通常为即为main
|
|
20
|
+
*/
|
|
21
|
+
declare const composeLayout: (component: React.ComponentType) => {
|
|
22
|
+
new (props: Props): {
|
|
23
|
+
initReduxDeviceNativeProps(ldvDevInfo: LdvDevInfo): void;
|
|
24
|
+
initReduxGroupNativeProps(uaGroupInfo: UAGroupInfoProps): void;
|
|
25
|
+
setDpSchemaMap(schema: string): any;
|
|
26
|
+
render(): any;
|
|
27
|
+
componentWillUnmount(): void;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default composeLayout;
|
package/src/i18n/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DpValue } from 'tuya-panel-kit';
|
|
2
2
|
import Strings from './strings';
|
|
3
|
-
|
|
3
|
+
type Key = keyof typeof Strings.en;
|
|
4
4
|
declare function getLang(key: Key, defaultString?: string): string;
|
|
5
5
|
declare function getDpLang(code: string, value?: DpValue): string;
|
|
6
6
|
declare function formatString(key: string, values: string[]): string;
|