@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.
Files changed (51) hide show
  1. package/package.json +1 -1
  2. package/src/api/native.d.ts +2 -2
  3. package/src/components/Card.d.ts +1 -1
  4. package/src/components/Cell.d.ts +2 -2
  5. package/src/components/ColorAdjustView.d.ts +1 -1
  6. package/src/components/ColorExtractor.d.ts +1 -1
  7. package/src/components/ColorTempAdjustView.d.ts +1 -1
  8. package/src/components/ColorsLine.d.ts +1 -1
  9. package/src/components/CustomListDialog.d.ts +1 -1
  10. package/src/components/DeleteButton.d.ts +1 -1
  11. package/src/components/Dialog.d.ts +1 -1
  12. package/src/components/FanAdjustView.d.ts +1 -1
  13. package/src/components/InfoText.d.ts +1 -1
  14. package/src/components/LampAdjustView.d.ts +1 -1
  15. package/src/components/LinearGradientLine.d.ts +1 -1
  16. package/src/components/MoodColorsLine.d.ts +2 -2
  17. package/src/components/Page.d.ts +1 -1
  18. package/src/components/Segmented.d.ts +1 -1
  19. package/src/components/ShowSelect.d.ts +1 -0
  20. package/src/components/ShowSelect.tsx +159 -0
  21. package/src/components/Spacer.d.ts +1 -1
  22. package/src/components/Tag.d.ts +1 -1
  23. package/src/components/TextButton.d.ts +1 -1
  24. package/src/components/TextField.d.ts +1 -1
  25. package/src/components/TextFieldStyleButton.d.ts +1 -1
  26. package/src/components/connect.d.ts +1 -9
  27. package/src/components/ldvColorBrightness.d.ts +1 -1
  28. package/src/components/ldvColorSlider.d.ts +1 -1
  29. package/src/components/ldvPickerView.d.ts +1 -1
  30. package/src/components/ldvPresetView.d.ts +1 -1
  31. package/src/components/ldvSaturation.d.ts +1 -1
  32. package/src/components/ldvSlider.d.ts +1 -1
  33. package/src/components/ldvSwitch.d.ts +2 -1
  34. package/src/components/ldvTemperatureSlider.d.ts +1 -1
  35. package/src/components/ldvTopBar.d.ts +1 -1
  36. package/src/components/ldvTopName.d.ts +1 -1
  37. package/src/components/segmentControl.d.ts +1 -1
  38. package/src/components/weekSelect.d.ts +1 -1
  39. package/src/composeLayout.d.ts +30 -0
  40. package/src/i18n/index.d.ts +1 -1
  41. package/src/i18n/strings.ts +330 -50
  42. package/src/models/combine.d.ts +8 -21
  43. package/src/models/configureStore.d.ts +1 -8
  44. package/src/models/index.d.ts +8 -23
  45. package/src/models/modules/NativePropsSlice.d.ts +6 -6
  46. package/src/models/modules/common.d.ts +13 -21
  47. package/src/utils/ColorParser.d.ts +3 -3
  48. package/src/utils/ColorUtils.d.ts +1 -1
  49. package/src/utils/cctUtils.d.ts +1 -1
  50. package/src/utils/common.d.ts +2 -2
  51. package/src/utils/loopsCompare.d.ts +1 -0
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.40",
7
+ "version": "1.1.42",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -6,8 +6,8 @@ export interface DeviceInfo {
6
6
  roomName: string;
7
7
  status: number;
8
8
  }
9
- declare type GetFeatureResultType = (deviceId: string, featureId: string) => Promise<NativeResult<any>>;
10
- declare type SetFeatureResultType = (deviceId: string, featureId: string, value: any) => Promise<NativeResult<any>>;
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 {
@@ -6,5 +6,5 @@ interface CardProps extends PropsWithChildren<ViewProps> {
6
6
  onLongPress?: () => void;
7
7
  containerStyle?: StyleProp<ViewStyle>;
8
8
  }
9
- export default function Card(props: CardProps): JSX.Element;
9
+ export default function Card(props: CardProps): any;
10
10
  export {};
@@ -5,7 +5,7 @@ interface CellProps {
5
5
  onPress: () => void;
6
6
  style?: StyleProp<ViewStyle>;
7
7
  }
8
- export default function Cell(props: CellProps): JSX.Element;
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): JSX.Element;
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) => JSX.Element;
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(): JSX.Element;
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) => JSX.Element;
11
+ declare const ColorTempAdjustView: (props: ColorTempAdjustViewProps) => any;
12
12
  export default ColorTempAdjustView;
@@ -3,5 +3,5 @@ interface ColorsLineProps extends ViewProps {
3
3
  colors: string[];
4
4
  nodeStyle?: StyleProp<ViewStyle>;
5
5
  }
6
- declare const ColorsLine: (props: ColorsLineProps) => JSX.Element;
6
+ declare const ColorsLine: (props: ColorsLineProps) => any;
7
7
  export default ColorsLine;
@@ -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) => JSX.Element;
13
+ declare const CustomListDialog: (props: CustomListDialogProps) => any;
14
14
  export default CustomListDialog;
@@ -5,5 +5,5 @@ interface DeleteButtonProps {
5
5
  style?: StyleProp<ViewStyle>;
6
6
  textStyle?: StyleProp<TextStyle>;
7
7
  }
8
- declare const DeleteButton: (props: DeleteButtonProps) => JSX.Element;
8
+ declare const DeleteButton: (props: DeleteButtonProps) => any;
9
9
  export default DeleteButton;
@@ -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) => JSX.Element;
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) => JSX.Element;
21
+ declare const FanAdjustView: (props: FanAdjustViewProps) => any;
22
22
  export default FanAdjustView;
@@ -6,5 +6,5 @@ interface InfoTextProps extends ViewProps {
6
6
  iconStyle?: StyleProp<ImageStyle>;
7
7
  textStyle?: StyleProp<TextStyle>;
8
8
  }
9
- declare const InfoText: (props: InfoTextProps) => JSX.Element;
9
+ declare const InfoText: (props: InfoTextProps) => any;
10
10
  export default InfoText;
@@ -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) => JSX.Element;
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) => JSX.Element;
8
+ declare const LinearGradientLine: (props: LinearGradientLineProps) => any;
9
9
  export default LinearGradientLine;
@@ -1,9 +1,9 @@
1
- export declare type MoodColorsLineType = 'gradient' | 'separate';
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): JSX.Element;
8
+ export default function MoodColorsLine(props: MoodColorsLineProps): any;
9
9
  export {};
@@ -17,5 +17,5 @@ interface PageProps extends PropsWithChildren<ViewProps> {
17
17
  greeneryIcon?: string | undefined | number;
18
18
  loading?: boolean;
19
19
  }
20
- declare const Page: (props: PageProps) => JSX.Element;
20
+ declare const Page: (props: PageProps) => any;
21
21
  export default Page;
@@ -10,5 +10,5 @@ interface SegmentedProps {
10
10
  onChange?: (v: string) => void;
11
11
  style?: ViewStyle;
12
12
  }
13
- declare const Segmented: (props: SegmentedProps) => JSX.Element;
13
+ declare const Segmented: (props: SegmentedProps) => any;
14
14
  export default Segmented;
@@ -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
+ }
@@ -3,5 +3,5 @@ interface SpacerProps extends ViewProps {
3
3
  width?: number;
4
4
  height?: number;
5
5
  }
6
- export default function Spacer(props: SpacerProps): JSX.Element;
6
+ export default function Spacer(props: SpacerProps): any;
7
7
  export {};
@@ -4,5 +4,5 @@ interface TagProps extends ViewProps {
4
4
  text: string;
5
5
  onCheckedChange: (boolean: any) => void;
6
6
  }
7
- declare const Tag: (props: TagProps) => JSX.Element;
7
+ declare const Tag: (props: TagProps) => any;
8
8
  export default Tag;
@@ -5,5 +5,5 @@ interface TextButtonProps {
5
5
  style?: StyleProp<ViewStyle>;
6
6
  textStyle?: StyleProp<TextStyle>;
7
7
  }
8
- export default function TextButton(props: TextButtonProps): JSX.Element;
8
+ export default function TextButton(props: TextButtonProps): any;
9
9
  export {};
@@ -5,5 +5,5 @@ interface TextFieldProps extends TextInputProps {
5
5
  tipIcon?: ImageSourcePropType;
6
6
  tipColor?: string;
7
7
  }
8
- declare const TextField: (props: TextFieldProps) => JSX.Element;
8
+ declare const TextField: (props: TextFieldProps) => any;
9
9
  export default TextField;
@@ -4,5 +4,5 @@ interface TextFieldStyleButtonProps extends ViewProps {
4
4
  text: string;
5
5
  onPress: () => void;
6
6
  }
7
- declare const TextFieldStyleButton: (props: TextFieldStyleButtonProps) => JSX.Element;
7
+ declare const TextFieldStyleButton: (props: TextFieldStyleButtonProps) => any;
8
8
  export default TextFieldStyleButton;
@@ -1,10 +1,2 @@
1
- import React from 'react';
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): JSX.Element;
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) => JSX.Element;
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) => JSX.Element;
10
+ declare const LdvPickerView: (props: LdvPickerViewProps) => any;
11
11
  export default LdvPickerView;
@@ -1,2 +1,2 @@
1
- declare const LdvPresetView: (props: any) => JSX.Element;
1
+ declare const LdvPresetView: (props: any) => any;
2
2
  export default LdvPresetView;
@@ -1,2 +1,2 @@
1
- declare const LdvSaturation: (props: any) => JSX.Element;
1
+ declare const LdvSaturation: (props: any) => any;
2
2
  export default LdvSaturation;
@@ -11,5 +11,5 @@ interface LdvSliderProps {
11
11
  subTitleStr?: string;
12
12
  titleStyle?: StyleProp<TextStyle> | undefined;
13
13
  }
14
- declare const LdvSlider: (props: LdvSliderProps) => JSX.Element;
14
+ declare const LdvSlider: (props: LdvSliderProps) => any;
15
15
  export default LdvSlider;
@@ -4,6 +4,7 @@ interface Prop {
4
4
  colorAlpha: number;
5
5
  enable: boolean;
6
6
  setEnable: any;
7
+ showSwitch?: boolean;
7
8
  }
8
- declare const LdvSwitch: (props: Prop) => JSX.Element;
9
+ declare const LdvSwitch: (props: Prop) => any;
9
10
  export default LdvSwitch;
@@ -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) => JSX.Element;
12
+ declare const LdvTemperatureSlider: (props: LdvTemperatureSliderProps) => any;
13
13
  export default LdvTemperatureSlider;
@@ -6,5 +6,5 @@ interface TopBarProps {
6
6
  rightButtonDisabled?: boolean;
7
7
  onRightButtonPress?: (() => void) | undefined;
8
8
  }
9
- declare const LDVTopBar: (props: TopBarProps) => JSX.Element;
9
+ declare const LDVTopBar: (props: TopBarProps) => any;
10
10
  export default LDVTopBar;
@@ -5,5 +5,5 @@ interface LdvTopNameProps {
5
5
  showGreenery?: boolean;
6
6
  greeneryIcon?: string | undefined | number;
7
7
  }
8
- declare const LdvTopName: (props: LdvTopNameProps) => JSX.Element;
8
+ declare const LdvTopName: (props: LdvTopNameProps) => any;
9
9
  export default LdvTopName;
@@ -1 +1 @@
1
- export default function SegmentControl(props: any): JSX.Element;
1
+ export default function SegmentControl(props: any): any;
@@ -3,5 +3,5 @@ export declare const setDataSource: (loop: any) => {
3
3
  index: number;
4
4
  title: string;
5
5
  }[];
6
- declare const _default: (props: any) => JSX.Element;
6
+ declare const _default: (props: any) => any;
7
7
  export default _default;
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import { DpValue } from 'tuya-panel-kit';
2
2
  import Strings from './strings';
3
- declare type Key = keyof typeof Strings.en;
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;