@iobroker/adapter-react-v5 4.6.13 → 4.7.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.
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +88 -0
- package/Components/JsonConfigComponent/ConfigGeneric.js +637 -0
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigNumber.js +117 -0
- package/Components/JsonConfigComponent/ConfigPort.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigPort.js +176 -0
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +7 -0
- package/Components/MDUtils.js +3 -3
- package/Components/MDUtils.js.map +1 -1
- package/Components/SimpleCron/cron2text.js +31 -36
- package/Components/SimpleCron/cron2text.js.map +1 -1
- package/Components/SimpleCron/index.js +10 -10
- package/Components/SimpleCron/index.js.map +1 -1
- package/LegacyConnection.js.map +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/// <reference types="iobroker" />
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import type AdminConnection from './wrapper/AdminConnection';
|
|
4
|
+
export declare function isObject(it: any): it is Record<string, any>;
|
|
5
|
+
export interface ConfigGenericProps {
|
|
6
|
+
/** Provided props by the specific component */
|
|
7
|
+
schema: Record<string, any>;
|
|
8
|
+
registerOnForceUpdate: any;
|
|
9
|
+
attr: string;
|
|
10
|
+
data: Record<string, any>;
|
|
11
|
+
onChange: (attrOrData: string | Record<string, any>, val?: any, cb?: () => void) => void;
|
|
12
|
+
custom: boolean;
|
|
13
|
+
forceUpdate: (attrs: string[], data: Record<string, any>) => void;
|
|
14
|
+
alive: boolean;
|
|
15
|
+
originalData: Record<string, any>;
|
|
16
|
+
arrayIndex: any;
|
|
17
|
+
globalData: any;
|
|
18
|
+
systemConfig?: Record<string, any>;
|
|
19
|
+
instanceObj: ioBroker.InstanceObject;
|
|
20
|
+
customObj: Record<string, any>;
|
|
21
|
+
socket: AdminConnection;
|
|
22
|
+
changed: boolean;
|
|
23
|
+
adapterName: string;
|
|
24
|
+
instance: number;
|
|
25
|
+
common: Record<string, any>;
|
|
26
|
+
onError: (attr: string, error?: unknown) => void;
|
|
27
|
+
themeType: string;
|
|
28
|
+
commandRunning: any;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ConfigGenericState {
|
|
32
|
+
confirmDialog: boolean;
|
|
33
|
+
confirmNewValue: any;
|
|
34
|
+
confirmAttr: any;
|
|
35
|
+
confirmData: any;
|
|
36
|
+
value?: any;
|
|
37
|
+
confirmDepAttr?: any;
|
|
38
|
+
confirmDepNewValue?: any;
|
|
39
|
+
}
|
|
40
|
+
export default class ConfigGeneric<Props extends ConfigGenericProps, State extends ConfigGenericState> extends Component<Props, State> {
|
|
41
|
+
static DIFFERENT_VALUE: string;
|
|
42
|
+
static DIFFERENT_LABEL: string;
|
|
43
|
+
static NONE_VALUE: string;
|
|
44
|
+
static NONE_LABEL: string;
|
|
45
|
+
private readonly defaultValue;
|
|
46
|
+
private isError;
|
|
47
|
+
private readonly lang;
|
|
48
|
+
private defaultSendToDone?;
|
|
49
|
+
private sendToTimeout?;
|
|
50
|
+
private noPlaceRequired;
|
|
51
|
+
constructor(props: Props);
|
|
52
|
+
componentDidMount(): void;
|
|
53
|
+
sendTo(): void;
|
|
54
|
+
componentWillUnmount(): void;
|
|
55
|
+
onUpdate: (data: Record<string, any>) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Extract attribute out of data
|
|
58
|
+
*
|
|
59
|
+
* @param data
|
|
60
|
+
* @param attr
|
|
61
|
+
*/
|
|
62
|
+
static getValue(data: Record<string, any>, attr: string | string[]): any;
|
|
63
|
+
static setValue(data: Record<string, any>, attr: string | string[], value: any): void;
|
|
64
|
+
getText(text: unknown, noTranslation?: boolean): string;
|
|
65
|
+
renderConfirmDialog(): React.JSX.Element;
|
|
66
|
+
getIcon(iconSettings: string | undefined | null): React.JSX.Element | null;
|
|
67
|
+
/**
|
|
68
|
+
* Trigger onChange, to activate save button on change
|
|
69
|
+
*
|
|
70
|
+
* @param attr the changed attribute
|
|
71
|
+
* @param newValue new value of the attribute
|
|
72
|
+
* @param cb optional callback function, else returns a Promise
|
|
73
|
+
*/
|
|
74
|
+
onChange(attr: string, newValue: any, cb?: () => void): Promise<void>;
|
|
75
|
+
execute(func: string | Record<string, string>, defaultValue: any, data: Record<string, any>, arrayIndex: number, globalData: Record<string, any>): any;
|
|
76
|
+
executeCustom(func: string | Record<string, string>, data: Record<string, any>, customObj: Record<string, any>, instanceObj: ioBroker.InstanceObject, arrayIndex: number, globalData: Record<string, any>): any;
|
|
77
|
+
calculate(schema: Record<string, any>): {
|
|
78
|
+
error: any;
|
|
79
|
+
disabled: any;
|
|
80
|
+
hidden: any;
|
|
81
|
+
defaultValue: any;
|
|
82
|
+
};
|
|
83
|
+
onError(attr: string, error?: unknown): void;
|
|
84
|
+
renderItem(_error: unknown, _disabled: boolean, _defaultValue?: unknown): React.JSX.Element | string;
|
|
85
|
+
renderHelp(text: string, link: string, noTranslation: boolean): string | React.JSX.Element | JSX.Element[];
|
|
86
|
+
getPattern(pattern: any, data?: any): any;
|
|
87
|
+
render(): string | React.JSX.Element | null;
|
|
88
|
+
}
|