@ledvance/base 1.1.18 → 1.1.20

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.18",
7
+ "version": "1.1.20",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -1,4 +1,4 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
1
+ import { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
2
  interface CellProps {
3
3
  title: string;
4
4
  value: string;
@@ -6,4 +6,16 @@ interface CellProps {
6
6
  style?: StyleProp<ViewStyle>;
7
7
  }
8
8
  export default function Cell(props: CellProps): JSX.Element;
9
+ interface CellContentProps {
10
+ title: string;
11
+ value: string;
12
+ style?: StyleProp<ViewStyle>;
13
+ titleStyle?: StyleProp<TextStyle>;
14
+ valueStyle?: StyleProp<TextStyle>;
15
+ iconStyle?: {
16
+ color?: any;
17
+ size?: number;
18
+ };
19
+ }
20
+ export declare function CellContent(props: CellContentProps): JSX.Element;
9
21
  export {};
@@ -0,0 +1,73 @@
1
+ import { Component } from 'react';
2
+ import { PanResponderInstance } from 'react-native';
3
+ export default class ColorExtractor extends Component<any> {
4
+ state: any;
5
+ _panResponder: PanResponderInstance;
6
+ onColorChange: any;
7
+ lastX: any;
8
+ lastY: any;
9
+ self: any;
10
+ startTouchXY: any;
11
+ constructor(props: any);
12
+ onLayout(_: any): void;
13
+ componentDidMount(): void;
14
+ componentWillUnmount(): void;
15
+ handleTapData(evt: any): void;
16
+ handlerData(_evt: any, ges: any, moving: any): void;
17
+ getPointValues(locationX: any, locationY: any): {
18
+ angle: number;
19
+ maxX: number;
20
+ maxY: number;
21
+ length: number;
22
+ };
23
+ getPointAngle(x: any, y: any): number;
24
+ updateUIWithColor(color: any, isFirst: any): void;
25
+ hypotenuse(long: any, angle: any): {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ updateColor(x: any, y: any, moving: any, isFirst?: boolean): void;
30
+ render(): JSX.Element;
31
+ }
32
+ export declare const colorTemperature: {
33
+ 2700: string;
34
+ 2800: string;
35
+ 2900: string;
36
+ 3000: string;
37
+ 3100: string;
38
+ 3200: string;
39
+ 3300: string;
40
+ 3400: string;
41
+ 3500: string;
42
+ 3600: string;
43
+ 3700: string;
44
+ 3800: string;
45
+ 3900: string;
46
+ 4000: string;
47
+ 4100: string;
48
+ 4200: string;
49
+ 4300: string;
50
+ 4400: string;
51
+ 4500: string;
52
+ 4600: string;
53
+ 4700: string;
54
+ 4800: string;
55
+ 4900: string;
56
+ 5000: string;
57
+ 5100: string;
58
+ 5200: string;
59
+ 5300: string;
60
+ 5400: string;
61
+ 5500: string;
62
+ 5600: string;
63
+ 5700: string;
64
+ 5800: string;
65
+ 5900: string;
66
+ 6000: string;
67
+ 6100: string;
68
+ 6200: string;
69
+ 6300: string;
70
+ 6400: string;
71
+ 6500: string;
72
+ };
73
+ export declare const colorTemperatureToColor: (temperature: any) => any;
@@ -0,0 +1,14 @@
1
+ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
+ interface ListData {
3
+ text: string;
4
+ value?: any;
5
+ }
6
+ interface CustomListDialogProps extends ViewProps {
7
+ itemStyle?: StyleProp<ViewStyle>;
8
+ show: boolean;
9
+ onDismiss: () => void;
10
+ data: ListData[];
11
+ onItemPress: (item: any | undefined, index: number) => void;
12
+ }
13
+ declare const CustomListDialog: (props: CustomListDialogProps) => JSX.Element;
14
+ export default CustomListDialog;
@@ -1,8 +1,12 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { ViewProps } from 'react-native';
3
3
  interface PageProps extends PropsWithChildren<ViewProps> {
4
+ rightButtonDisabled?: boolean;
4
5
  backText: string;
5
6
  onBackClick?: () => void;
7
+ showBackDialog?: boolean;
8
+ backDialogTitle?: string;
9
+ backDialogContent?: string;
6
10
  rightButtonIcon?: string;
7
11
  rightButtonIconClick?: () => void;
8
12
  headlineText?: string;
@@ -10,6 +14,7 @@ interface PageProps extends PropsWithChildren<ViewProps> {
10
14
  onHeadlineIconClick?: () => void;
11
15
  showGreenery?: boolean;
12
16
  greeneryIcon?: string | undefined | number;
17
+ loading?: boolean;
13
18
  }
14
19
  declare const Page: (props: PageProps) => JSX.Element;
15
20
  export default Page;
@@ -1,5 +1,9 @@
1
- import { TextInputProps } from 'react-native';
1
+ import { TextInputProps, ImageSourcePropType } from 'react-native';
2
2
  interface TextFieldProps extends TextInputProps {
3
+ showError?: boolean;
4
+ errorText?: string;
5
+ tipIcon?: ImageSourcePropType;
6
+ tipColor?: string;
3
7
  }
4
8
  declare const TextField: (props: TextFieldProps) => JSX.Element;
5
9
  export default TextField;
@@ -0,0 +1,8 @@
1
+ import { ViewProps } from 'react-native';
2
+ interface TextFieldStyleButtonProps extends ViewProps {
3
+ placeholder: string;
4
+ text: string;
5
+ onPress: () => void;
6
+ }
7
+ declare const TextFieldStyleButton: (props: TextFieldStyleButtonProps) => JSX.Element;
8
+ export default TextFieldStyleButton;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { StyleProp, TextStyle, ViewStyle } from 'react-native';
3
+ interface Props {
4
+ style?: StyleProp<ViewStyle>;
5
+ textStyle?: StyleProp<TextStyle>;
6
+ title: string;
7
+ rightComponent?: any;
8
+ onPress?: any;
9
+ disabled?: boolean;
10
+ }
11
+ declare const LdvItemView: React.FC<Props>;
12
+ export default LdvItemView;
@@ -26,7 +26,8 @@ declare function simpleSetDps<T>(dispatch: Dispatch<any>): (deviceId: string, dp
26
26
  declare function simpleSetDp<T>(dispatch: Dispatch<any>): (deviceId: string, dp: string, value: any) => Promise<Result<T>>;
27
27
  declare const useDeviceId: () => string;
28
28
  declare const useFamilyName: () => string;
29
- declare function useDp<T, R>(dp: string): [T, (value: T) => Promise<Result<R>>];
29
+ declare function useDp<T, R extends any>(dp: string): [T, (value: T) => Promise<Result<R>>];
30
+ declare function useScaledDp<R extends any>(dp: string, scaled?: number): [number, (value: number) => Promise<Result<R>>];
30
31
  declare function useDps<R>(): [any, (dps: any) => Promise<Result<R>>];
31
32
  interface DpState {
32
33
  switch: boolean;
@@ -49,4 +50,4 @@ export declare function useGroupConfigFeature<GC, GCPT extends {
49
50
  }[keyof GC]>(key: keyof GC, extraDps?: any): [GCPT, (value: GCPT, dpValue: any) => Promise<Result<any>>];
50
51
  export declare const ldvModules: import("@reduxjs/toolkit").Reducer<NativeProps, import("@reduxjs/toolkit").AnyAction>;
51
52
  export declare const setNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setGroupNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setDps: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setTimeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setEnergieverbrauch: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
52
- export { asyncSetDps, simpleSetDps, simpleSetDp, useDeviceId, useDeviceInfo, useDp, useDps, useFamilyName, useTimeSchedule, useEnergieverbrauch, };
53
+ export { asyncSetDps, simpleSetDps, simpleSetDp, useDeviceId, useDeviceInfo, useDp, useScaledDp, useDps, useFamilyName, useTimeSchedule, useEnergieverbrauch, };
@@ -141,7 +141,7 @@ const useFamilyName: () => string = () => {
141
141
  return useSelector(store => store.ldvModules.familyName)
142
142
  }
143
143
 
144
- function useDp<T, R>(dp: string): [T, (value: T) => Promise<Result<R>>] {
144
+ function useDp<T, R extends any>(dp: string): [T, (value: T) => Promise<Result<R>>] {
145
145
  const deviceId = useDeviceId()
146
146
  const dispatch = useDispatch()
147
147
  const dpValue = useSelector(store => store.ldvModules.deviceInfo.dps[dp])
@@ -151,6 +151,14 @@ function useDp<T, R>(dp: string): [T, (value: T) => Promise<Result<R>>] {
151
151
  return [dpValue, setDp]
152
152
  }
153
153
 
154
+ function useScaledDp<R extends any>(dp: string, scaled: number = 10): [number, (value: number) => Promise<Result<R>>] {
155
+ const [sd, setSd] = useDp<number, R>(dp)
156
+ const setScaledDpValue = useCallback(async (value: number) => {
157
+ return await setSd(value * scaled)
158
+ }, [setSd])
159
+ return [sd / scaled, setScaledDpValue]
160
+ }
161
+
154
162
  function useDps<R>(): [any, (dps: any) => Promise<Result<R>>] {
155
163
  const deviceId = useDeviceId()
156
164
  const dispatch = useDispatch()
@@ -256,6 +264,7 @@ export {
256
264
  useDeviceId,
257
265
  useDeviceInfo,
258
266
  useDp,
267
+ useScaledDp,
259
268
  useDps,
260
269
  useFamilyName,
261
270
  useTimeSchedule,
@@ -34,5 +34,7 @@ declare const _default: {
34
34
  ic_info: string;
35
35
  ic_warning_amber: string;
36
36
  rn_ic_download: string;
37
+ light_on: any;
38
+ light_off: any;
37
39
  };
38
40
  export default _default;
package/src/res/index.ts CHANGED
@@ -34,4 +34,6 @@ export default {
34
34
  ic_info: 'ic_info',
35
35
  ic_warning_amber: 'ic_warning_amber',
36
36
  rn_ic_download: 'rn_ic_download',
37
+ light_on: require('./light_on.png'),
38
+ light_off: require('./light_off.png'),
37
39
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -22,3 +22,4 @@ export declare const getHSVByHex: (string: any) => {
22
22
  s: number;
23
23
  v: number;
24
24
  };
25
+ export declare function mapFloatToRange(value: number, min: number, max: number): number;