@iobroker/adapter-react-v5 4.6.12 → 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/FileViewer.js +1 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +2 -1
- package/Components/JsonConfigComponent/ConfigFile.js +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +4 -4
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +68 -67
- package/Components/JsonConfigComponent/ConfigGeneric.js +600 -665
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigInterface.js +146 -0
- package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +6 -11
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +2 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +16 -2
- package/Components/JsonConfigComponent/ConfigNumber.js +105 -201
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +2 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigPort.js +159 -210
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +2 -1
- 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
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.js.map +0 -1
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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> {
|
|
3
41
|
static DIFFERENT_VALUE: string;
|
|
4
42
|
static DIFFERENT_LABEL: string;
|
|
5
43
|
static NONE_VALUE: string;
|
|
6
44
|
static NONE_LABEL: string;
|
|
7
|
-
|
|
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;
|
|
8
56
|
/**
|
|
9
57
|
* Extract attribute out of data
|
|
10
58
|
*
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @return {*|null}
|
|
59
|
+
* @param data
|
|
60
|
+
* @param attr
|
|
14
61
|
*/
|
|
15
|
-
static getValue(data: Record<string, any>, attr: string | string[]): any
|
|
16
|
-
static setValue(data:
|
|
17
|
-
|
|
18
|
-
state: {
|
|
19
|
-
confirmDialog: boolean;
|
|
20
|
-
confirmNewValue: any;
|
|
21
|
-
confirmAttr: any;
|
|
22
|
-
confirmData: any;
|
|
23
|
-
};
|
|
24
|
-
isError: {};
|
|
25
|
-
defaultValue: any;
|
|
26
|
-
lang: ioBroker.Languages;
|
|
27
|
-
componentDidMount(): void;
|
|
28
|
-
sendTo(): void;
|
|
29
|
-
defaultSendToDone: boolean;
|
|
30
|
-
componentWillUnmount(): void;
|
|
31
|
-
sendToTimeout: any;
|
|
32
|
-
onUpdate: (data: any) => void;
|
|
33
|
-
getText(text: any, noTranslation: any): any;
|
|
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;
|
|
34
65
|
renderConfirmDialog(): React.JSX.Element;
|
|
66
|
+
getIcon(iconSettings: string | undefined | null): React.JSX.Element | null;
|
|
35
67
|
/**
|
|
36
68
|
* Trigger onChange, to activate save button on change
|
|
37
69
|
*
|
|
38
70
|
* @param attr the changed attribute
|
|
39
71
|
* @param newValue new value of the attribute
|
|
40
|
-
* @param
|
|
41
|
-
* @return {Promise<void>}
|
|
72
|
+
* @param cb optional callback function, else returns a Promise
|
|
42
73
|
*/
|
|
43
|
-
onChange(attr:
|
|
44
|
-
execute(func:
|
|
45
|
-
executeCustom(func:
|
|
46
|
-
calculate(schema: any): {
|
|
47
|
-
error:
|
|
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;
|
|
48
79
|
disabled: any;
|
|
49
80
|
hidden: any;
|
|
50
81
|
defaultValue: any;
|
|
51
82
|
};
|
|
52
|
-
onError(attr:
|
|
53
|
-
renderItem():
|
|
54
|
-
renderHelp(text:
|
|
55
|
-
getPattern(pattern: any, data
|
|
56
|
-
render():
|
|
57
|
-
}
|
|
58
|
-
declare namespace ConfigGeneric {
|
|
59
|
-
namespace propTypes {
|
|
60
|
-
let socket: PropTypes.Validator<object>;
|
|
61
|
-
let data: PropTypes.Requireable<object>;
|
|
62
|
-
let originalData: PropTypes.Requireable<object>;
|
|
63
|
-
let schema: PropTypes.Requireable<object>;
|
|
64
|
-
let attr: PropTypes.Requireable<string>;
|
|
65
|
-
let value: PropTypes.Requireable<any>;
|
|
66
|
-
let themeName: PropTypes.Requireable<string>;
|
|
67
|
-
let style: PropTypes.Requireable<object>;
|
|
68
|
-
let onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
69
|
-
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
|
-
let customs: PropTypes.Requireable<object>;
|
|
71
|
-
let forceUpdate: PropTypes.Validator<(...args: any[]) => any>;
|
|
72
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
73
|
-
let systemConfig: PropTypes.Requireable<object>;
|
|
74
|
-
let alive: PropTypes.Requireable<boolean>;
|
|
75
|
-
let changed: PropTypes.Requireable<boolean>;
|
|
76
|
-
let common: PropTypes.Requireable<object>;
|
|
77
|
-
let adapterName: PropTypes.Requireable<string>;
|
|
78
|
-
let instance: PropTypes.Requireable<number>;
|
|
79
|
-
let dateFormat: PropTypes.Requireable<string>;
|
|
80
|
-
let isFloatComma: PropTypes.Requireable<boolean>;
|
|
81
|
-
let customObj: PropTypes.Requireable<object>;
|
|
82
|
-
let instanceObj: PropTypes.Requireable<object>;
|
|
83
|
-
let custom: PropTypes.Requireable<boolean>;
|
|
84
|
-
}
|
|
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;
|
|
85
88
|
}
|
|
86
|
-
import React from 'react';
|
|
87
|
-
import PropTypes from 'prop-types';
|