@iobroker/json-config 7.1.1 → 7.1.3
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/build/JsonConfig.d.ts +6 -10
- package/build/JsonConfig.js +30 -26
- package/build/JsonConfig.js.map +1 -1
- package/build/JsonConfigComponent/ChipInput.d.ts +13 -14
- package/build/JsonConfigComponent/ChipInput.js +26 -21
- package/build/JsonConfigComponent/ChipInput.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAccordion.d.ts +4 -4
- package/build/JsonConfigComponent/ConfigAccordion.js +44 -38
- package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAlive.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigAlive.js +17 -8
- package/build/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocomplete.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigAutocomplete.js +13 -10
- package/build/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +31 -22
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCRON.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigCRON.js +5 -5
- package/build/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCertCollection.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCertCollection.js +9 -9
- package/build/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCertificateSelect.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCertificateSelect.js +6 -6
- package/build/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCertificates.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCertificates.js +17 -14
- package/build/JsonConfigComponent/ConfigCertificates.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCheckLicense.d.ts +19 -7
- package/build/JsonConfigComponent/ConfigCheckLicense.js +34 -24
- package/build/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCheckbox.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCheckbox.js +19 -9
- package/build/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/build/JsonConfigComponent/ConfigChip.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigChip.js +20 -10
- package/build/JsonConfigComponent/ConfigChip.js.map +1 -1
- package/build/JsonConfigComponent/ConfigColor.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigColor.js +18 -11
- package/build/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCoordinates.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCoordinates.js +49 -41
- package/build/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCustom.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigCustom.js +13 -13
- package/build/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/build/JsonConfigComponent/ConfigDatePicker.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigDatePicker.js +3 -3
- package/build/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/build/JsonConfigComponent/ConfigDeviceManager.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigDeviceManager.js +2 -2
- package/build/JsonConfigComponent/ConfigDeviceManager.js.map +1 -1
- package/build/JsonConfigComponent/ConfigFile.d.ts +8 -5
- package/build/JsonConfigComponent/ConfigFile.js +16 -15
- package/build/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/build/JsonConfigComponent/ConfigFileSelector.d.ts +4 -4
- package/build/JsonConfigComponent/ConfigFileSelector.js +66 -47
- package/build/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/build/JsonConfigComponent/ConfigFunc.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigFunc.js +8 -10
- package/build/JsonConfigComponent/ConfigFunc.js.map +1 -1
- package/build/JsonConfigComponent/ConfigGeneric.d.ts +7 -7
- package/build/JsonConfigComponent/ConfigGeneric.js +35 -38
- package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/build/JsonConfigComponent/ConfigIP.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigIP.js +10 -11
- package/build/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/build/JsonConfigComponent/ConfigImageSendTo.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigImageSendTo.js +6 -5
- package/build/JsonConfigComponent/ConfigImageSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigImageUpload.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigImageUpload.js +23 -12
- package/build/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/build/JsonConfigComponent/ConfigInstanceSelect.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigInstanceSelect.js +37 -23
- package/build/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/build/JsonConfigComponent/ConfigInterface.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigInterface.js +20 -20
- package/build/JsonConfigComponent/ConfigInterface.js.map +1 -1
- package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigJsonEditor.js +10 -8
- package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/build/JsonConfigComponent/ConfigLanguage.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigLanguage.js +17 -9
- package/build/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/build/JsonConfigComponent/ConfigLicense.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigLicense.js +29 -14
- package/build/JsonConfigComponent/ConfigLicense.js.map +1 -1
- package/build/JsonConfigComponent/ConfigNumber.d.ts +3 -5
- package/build/JsonConfigComponent/ConfigNumber.js +12 -9
- package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/build/JsonConfigComponent/ConfigObjectId.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigObjectId.js +6 -6
- package/build/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPanel.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigPanel.js +48 -44
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPassword.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigPassword.js +24 -13
- package/build/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPattern.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigPattern.js +8 -8
- package/build/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPort.d.ts +3 -5
- package/build/JsonConfigComponent/ConfigPort.js +20 -16
- package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
- package/build/JsonConfigComponent/ConfigQrCode.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigQrCode.js +2 -2
- package/build/JsonConfigComponent/ConfigQrCode.js.map +1 -1
- package/build/JsonConfigComponent/ConfigRoom.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigRoom.js +11 -10
- package/build/JsonConfigComponent/ConfigRoom.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSelect.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigSelect.js +16 -10
- package/build/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSelectSendTo.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigSelectSendTo.js +34 -28
- package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSendto.d.ts +5 -5
- package/build/JsonConfigComponent/ConfigSendto.js +34 -22
- package/build/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSetState.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigSetState.js +7 -6
- package/build/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSlider.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigSlider.js +7 -5
- package/build/JsonConfigComponent/ConfigSlider.js.map +1 -1
- package/build/JsonConfigComponent/ConfigState.d.ts +3 -3
- package/build/JsonConfigComponent/ConfigState.js +64 -55
- package/build/JsonConfigComponent/ConfigState.js.map +1 -1
- package/build/JsonConfigComponent/ConfigStaticDivider.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigStaticDivider.js +10 -8
- package/build/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
- package/build/JsonConfigComponent/ConfigStaticHeader.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigStaticHeader.js +6 -6
- package/build/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/build/JsonConfigComponent/ConfigStaticImage.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigStaticImage.js +6 -4
- package/build/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/build/JsonConfigComponent/ConfigStaticText.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigStaticText.js +33 -26
- package/build/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTable.d.ts +6 -6
- package/build/JsonConfigComponent/ConfigTable.js +122 -100
- package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTabs.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigTabs.js +6 -5
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/build/JsonConfigComponent/ConfigText.d.ts +3 -5
- package/build/JsonConfigComponent/ConfigText.js +24 -19
- package/build/JsonConfigComponent/ConfigText.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTextSendTo.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigTextSendTo.js +18 -15
- package/build/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTimePicker.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigTimePicker.js +7 -4
- package/build/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTopic.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigTopic.js +3 -3
- package/build/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/build/JsonConfigComponent/ConfigUUID.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigUUID.js +6 -6
- package/build/JsonConfigComponent/ConfigUUID.js.map +1 -1
- package/build/JsonConfigComponent/ConfigUser.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigUser.js +25 -19
- package/build/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/build/JsonConfigComponent/Icons.d.ts +2 -2
- package/build/JsonConfigComponent/Icons.js +1 -1
- package/build/JsonConfigComponent/Icons.js.map +1 -1
- package/build/JsonConfigComponent/index.d.ts +7 -10
- package/build/JsonConfigComponent/index.js +14 -11
- package/build/JsonConfigComponent/index.js.map +1 -1
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.d.ts +3 -3
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js +10 -10
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -1
- package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +2 -2
- package/build/JsonConfigComponent/wrapper/Components/Editor.js +3 -3
- package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -1
- package/build/Utils.js +74 -60
- package/build/Utils.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/types.d.ts +173 -43
- package/package.json +26 -25
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconButton, TextField
|
|
1
|
+
import React, {} from 'react';
|
|
2
|
+
import { IconButton, TextField } from '@mui/material';
|
|
3
3
|
import { IconCopy, Utils } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
5
5
|
class ConfigPattern extends ConfigGeneric {
|
|
6
6
|
renderItem(_error, disabled) {
|
|
7
|
-
return React.createElement(TextField, { variant: "standard", fullWidth: true, disabled: !!disabled,
|
|
8
|
-
|
|
9
|
-
React.createElement(IconButton, { size: "small", onClick: () => {
|
|
7
|
+
return (React.createElement(TextField, { variant: "standard", fullWidth: true, disabled: !!disabled, slotProps: {
|
|
8
|
+
input: {
|
|
9
|
+
endAdornment: this.props.schema.copyToClipboard ? (React.createElement(IconButton, { size: "small", onClick: () => {
|
|
10
10
|
Utils.copyToClipboard(this.getPattern(this.props.schema.pattern));
|
|
11
11
|
window.alert('Copied');
|
|
12
12
|
} },
|
|
13
|
-
React.createElement(IconCopy, null))
|
|
14
|
-
|
|
15
|
-
}, value: this.getPattern(this.props.schema.pattern), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation) });
|
|
13
|
+
React.createElement(IconCopy, null))) : undefined,
|
|
14
|
+
},
|
|
15
|
+
}, value: this.getPattern(this.props.schema.pattern), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation) }));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
export default ConfigPattern;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPattern.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPattern.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigPattern.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPattern.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eA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from 'react';
|
|
2
2
|
import type { ConfigItemPort } from '#JC/types';
|
|
3
3
|
import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
|
|
4
4
|
interface Port {
|
|
@@ -19,10 +19,8 @@ interface ConfigPortState extends ConfigGenericState {
|
|
|
19
19
|
declare class ConfigPort extends ConfigGeneric<ConfigPortProps, ConfigPortState> {
|
|
20
20
|
private updateTimeout?;
|
|
21
21
|
componentDidMount(): Promise<void>;
|
|
22
|
-
static getDerivedStateFromProps(props: ConfigPortProps, state: ConfigPortState):
|
|
23
|
-
_value: any;
|
|
24
|
-
};
|
|
22
|
+
static getDerivedStateFromProps(props: ConfigPortProps, state: ConfigPortState): Partial<ConfigPortState> | null;
|
|
25
23
|
checkValue(value: string): string | null;
|
|
26
|
-
renderItem(error: unknown, disabled: boolean):
|
|
24
|
+
renderItem(error: unknown, disabled: boolean): JSX.Element;
|
|
27
25
|
}
|
|
28
26
|
export default ConfigPort;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, {} from 'react';
|
|
2
2
|
import { TextField } from '@mui/material';
|
|
3
3
|
import { I18n } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
@@ -21,11 +21,10 @@ class ConfigPort extends ConfigGeneric {
|
|
|
21
21
|
// read all instances
|
|
22
22
|
const instances = await this.props.socket.getAdapterInstances();
|
|
23
23
|
const ownId = `system.adapter.${this.props.adapterName}.${this.props.instance}`;
|
|
24
|
-
const instanceObj = await this.props.socket.getObject(ownId);
|
|
24
|
+
const instanceObj = (await this.props.socket.getObject(ownId));
|
|
25
25
|
const ownHostname = instanceObj?.common.host;
|
|
26
26
|
const ports = [];
|
|
27
|
-
instances
|
|
28
|
-
.forEach(instance => {
|
|
27
|
+
instances.forEach(instance => {
|
|
29
28
|
// ignore own instance and instances on another host
|
|
30
29
|
if (!instance || instance._id === ownId || instance.common.host !== ownHostname) {
|
|
31
30
|
return;
|
|
@@ -35,10 +34,7 @@ class ConfigPort extends ConfigGeneric {
|
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
37
36
|
// if let's encrypt is enabled and update is enabled, then add port to check
|
|
38
|
-
if (instance?.native &&
|
|
39
|
-
instance.native.secure &&
|
|
40
|
-
instance.native.leEnabled &&
|
|
41
|
-
instance.native.leUpdate) {
|
|
37
|
+
if (instance?.native && instance.native.secure && instance.native.leEnabled && instance.native.leUpdate) {
|
|
42
38
|
const port = parseInt(instance.native.leCheckPort || instance.native.lePort, 10);
|
|
43
39
|
if (port) {
|
|
44
40
|
ports.push({
|
|
@@ -65,8 +61,10 @@ class ConfigPort extends ConfigGeneric {
|
|
|
65
61
|
}
|
|
66
62
|
static getDerivedStateFromProps(props, state) {
|
|
67
63
|
const _value = ConfigGeneric.getValue(props.data, props.attr);
|
|
68
|
-
if (_value === null ||
|
|
69
|
-
|
|
64
|
+
if (_value === null ||
|
|
65
|
+
_value === undefined ||
|
|
66
|
+
state.oldValue === null ||
|
|
67
|
+
state.oldValue === undefined ||
|
|
70
68
|
(_value.toString() !== parseInt(state._value, 10).toString() &&
|
|
71
69
|
_value.toString() !== state.oldValue.toString())) {
|
|
72
70
|
return { _value };
|
|
@@ -78,13 +76,12 @@ class ConfigPort extends ConfigGeneric {
|
|
|
78
76
|
return null;
|
|
79
77
|
}
|
|
80
78
|
const min = this.props.schema.min === undefined ? 20 : this.props.schema.min;
|
|
81
|
-
const max = this.props.schema.max ||
|
|
79
|
+
const max = this.props.schema.max || 0xffff;
|
|
82
80
|
value = value.toString().trim();
|
|
83
81
|
const f = value === '' ? 0 : parseInt(value, 10);
|
|
84
82
|
if (value !== '' && Number.isNaN(f)) {
|
|
85
83
|
return 'ra_Not a number';
|
|
86
84
|
}
|
|
87
|
-
// eslint-disable-next-line no-restricted-properties
|
|
88
85
|
if (value !== '' && window.isFinite(Number(value))) {
|
|
89
86
|
if (f < min) {
|
|
90
87
|
return 'ra_Too small';
|
|
@@ -114,7 +111,7 @@ class ConfigPort extends ConfigGeneric {
|
|
|
114
111
|
this.updateTimeout = undefined;
|
|
115
112
|
}
|
|
116
113
|
const min = this.props.schema.min === undefined ? 20 : this.props.schema.min;
|
|
117
|
-
const max = this.props.schema.max ||
|
|
114
|
+
const max = this.props.schema.max || 0xffff;
|
|
118
115
|
let warning;
|
|
119
116
|
if (this.state.ports) {
|
|
120
117
|
const num = parseInt(this.state._value, 10);
|
|
@@ -144,7 +141,7 @@ class ConfigPort extends ConfigGeneric {
|
|
|
144
141
|
error = I18n.t(error);
|
|
145
142
|
}
|
|
146
143
|
}
|
|
147
|
-
return React.createElement(TextField, { variant: "standard", type: "number", fullWidth: true, slotProps: {
|
|
144
|
+
return (React.createElement(TextField, { variant: "standard", type: "number", fullWidth: true, slotProps: {
|
|
148
145
|
htmlInput: {
|
|
149
146
|
min,
|
|
150
147
|
max,
|
|
@@ -161,10 +158,17 @@ class ConfigPort extends ConfigGeneric {
|
|
|
161
158
|
}
|
|
162
159
|
this.setState({ _value, oldValue: this.state._value }, () => {
|
|
163
160
|
if (_value.trim() === parseInt(_value, 10).toString()) {
|
|
164
|
-
this.onChange(this.props.attr, parseInt(_value, 10) || 0);
|
|
161
|
+
const maybePromise = this.onChange(this.props.attr, parseInt(_value, 10) || 0);
|
|
162
|
+
if (maybePromise instanceof Promise) {
|
|
163
|
+
maybePromise.catch(err => {
|
|
164
|
+
console.error(`Cannot set value for ${this.props.attr}: ${err}`);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
165
167
|
}
|
|
166
168
|
});
|
|
167
|
-
}, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: error && typeof error === 'string'
|
|
169
|
+
}, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: error && typeof error === 'string'
|
|
170
|
+
? error
|
|
171
|
+
: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation) }));
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
export default ConfigPort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPort.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPort.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigPort.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPort.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGlD,OAAO,aAAa,EAAE,EAAoD,MAAM,iBAAiB,CAAC;AAElG,MAAM,MAAM,GAAwB;IAChC,OAAO,EAAE;QACL,cAAc,EAAE;YACZ,KAAK,EAAE,QAAQ;SAClB;KACJ;CACJ,CAAC;AAoBF,MAAM,UAAW,SAAQ,aAA+C;IAC5D,aAAa,CAAiC;IAEtD,KAAK,CAAC,iBAAiB;QACnB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1C,MAAM,GAAG,EAAE,CAAC;QAChB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE1E,qBAAqB;QACrB,MAAM,SAAS,GAA8B,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAE3F,MAAM,KAAK,GAAG,kBAAkB,IAAI,CAA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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
import type QRCode from 'react-qr-code';
|
|
3
3
|
import type { ConfigItemQrCode } from '#JC/types';
|
|
4
4
|
import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
|
|
@@ -10,6 +10,6 @@ interface ConfigQrCodeState extends ConfigGenericState {
|
|
|
10
10
|
}
|
|
11
11
|
declare class ConfigQrCode extends ConfigGeneric<ConfigQrCodeProps, ConfigQrCodeState> {
|
|
12
12
|
componentDidMount(): Promise<void>;
|
|
13
|
-
renderItem():
|
|
13
|
+
renderItem(): JSX.Element | null;
|
|
14
14
|
}
|
|
15
15
|
export default ConfigQrCode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, {} from 'react';
|
|
2
2
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
3
3
|
class ConfigQrCode extends ConfigGeneric {
|
|
4
4
|
async componentDidMount() {
|
|
@@ -12,7 +12,7 @@ class ConfigQrCode extends ConfigGeneric {
|
|
|
12
12
|
if (!QRCodeComponent) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return React.createElement(QRCodeComponent, { value: this.props.schema.data, size: this.props.schema.size, fgColor: this.props.schema.fgColor, bgColor: this.props.schema.bgColor, level: this.props.schema.level });
|
|
15
|
+
return (React.createElement(QRCodeComponent, { value: this.props.schema.data, size: this.props.schema.size, fgColor: this.props.schema.fgColor, bgColor: this.props.schema.bgColor, level: this.props.schema.level }));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
export default ConfigQrCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigQrCode.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigQrCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigQrCode.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigQrCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAIxC,OAAO,aAAa,EAAE,EAAoD,MAAM,iBAAiB,CAAC;AAUlG,MAAM,YAAa,SAAQ,aAAmD;IAC1E,KAAK,CAAC,iBAAiB;QACnB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,sBAAsB;QACtB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,UAAU;QACN,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,CACH,oBAAC,eAAe,IACZ,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAC7B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAClC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAClC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,GAChC,CACL,CAAC;IACN,CAAC;CACJ;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
import type { ConfigItemRoom } from '#JC/types';
|
|
3
3
|
import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
|
|
4
4
|
interface ConfigRoomProps extends ConfigGenericProps {
|
|
@@ -13,6 +13,6 @@ interface ConfigRoomState extends ConfigGenericState {
|
|
|
13
13
|
}
|
|
14
14
|
declare class ConfigRoom extends ConfigGeneric<ConfigRoomProps, ConfigRoomState> {
|
|
15
15
|
componentDidMount(): void;
|
|
16
|
-
renderItem(error: string, disabled: boolean):
|
|
16
|
+
renderItem(error: string, disabled: boolean): JSX.Element;
|
|
17
17
|
}
|
|
18
18
|
export default ConfigRoom;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InputLabel, MenuItem, FormHelperText, FormControl, Select
|
|
1
|
+
import React, {} from 'react';
|
|
2
|
+
import { InputLabel, MenuItem, FormHelperText, FormControl, Select } from '@mui/material';
|
|
3
3
|
import { TextWithIcon, I18n } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
5
5
|
class ConfigRoom extends ConfigGeneric {
|
|
6
6
|
componentDidMount() {
|
|
7
7
|
super.componentDidMount();
|
|
8
8
|
const value = ConfigGeneric.getValue(this.props.data, this.props.attr);
|
|
9
|
-
this.props.socket
|
|
9
|
+
void this.props.socket
|
|
10
|
+
.getEnums('rooms')
|
|
10
11
|
.then(enums => {
|
|
11
|
-
const selectOptions = Object.keys(enums)
|
|
12
|
-
.map(id => ({
|
|
12
|
+
const selectOptions = Object.keys(enums).map(id => ({
|
|
13
13
|
value: this.props.schema.short ? id.replace('enum.rooms.', '') : id,
|
|
14
14
|
label: this.getText(enums[id].common.name),
|
|
15
15
|
obj: enums[id],
|
|
@@ -18,19 +18,20 @@ class ConfigRoom extends ConfigGeneric {
|
|
|
18
18
|
selectOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });
|
|
19
19
|
}
|
|
20
20
|
this.setState({ value, selectOptions });
|
|
21
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.catch(e => console.error(`Cannot get enums: ${e}`));
|
|
22
23
|
}
|
|
23
24
|
renderItem(error, disabled /* , defaultValue */) {
|
|
24
25
|
if (!this.state.selectOptions) {
|
|
25
26
|
return null;
|
|
26
27
|
}
|
|
27
28
|
const item = this.state.selectOptions.find(it => it.value === this.state.value);
|
|
28
|
-
return React.createElement(FormControl, { variant: "standard", fullWidth: true },
|
|
29
|
+
return (React.createElement(FormControl, { variant: "standard", fullWidth: true },
|
|
29
30
|
this.props.schema.label ? React.createElement(InputLabel, null, this.getText(this.props.schema.label)) : null,
|
|
30
|
-
React.createElement(Select, { variant: "standard", error: !!error, disabled: !!disabled, value: this.state.value || '_', renderValue: () =>
|
|
31
|
+
React.createElement(Select, { variant: "standard", error: !!error, disabled: !!disabled, value: this.state.value || '_', renderValue: () => item ? (item.obj ? (React.createElement(TextWithIcon, { value: item.obj, themeType: this.props.themeType, lang: I18n.getLanguage() })) : (item.label)) : (''), onChange: e => {
|
|
31
32
|
this.setState({ value: e.target.value === '_' ? '' : e.target.value }, () => this.onChange(this.props.attr, this.state.value));
|
|
32
|
-
} }, this.state.selectOptions.map(it => React.createElement(MenuItem, { key: it.value, value: it.value, style: it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {} }, it.obj ? React.createElement(TextWithIcon, { value: it.obj, themeType: this.props.themeType, lang: I18n.getLanguage() }) : it.label))),
|
|
33
|
-
this.props.schema.help ? React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
33
|
+
} }, this.state.selectOptions.map(it => (React.createElement(MenuItem, { key: it.value, value: it.value, style: it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {} }, it.obj ? (React.createElement(TextWithIcon, { value: it.obj, themeType: this.props.themeType, lang: I18n.getLanguage() })) : (it.label))))),
|
|
34
|
+
this.props.schema.help ? (React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation))) : null));
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
export default ConfigRoom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigRoom.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigRoom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigRoom.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigRoom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,aAAa,EAAE,EAAoD,MAAM,iBAAiB,CAAC;AAUlG,MAAM,UAAW,SAAQ,aAA+C;IACpE,iBAAiB;QACb,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvE,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM;aACjB,QAAQ,CAAC,OAAO,CAAC;aACjB,IAAI,CAAC,KAAK,CAAC,EAAE;YACV,MAAM,aAAa,GAAkE,MAAM,CAAC,IAAI,CAC5F,KAAK,CACR,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACT,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;gBACnE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC1C,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;aACjB,CAAC,CAAC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I,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACtB,oBAAC,cAAc,QACV,IAAI,CAAC,UAAU,CACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAClC,CACY,CACpB,CAAC,CAAC,CAAC,IAAI,CACE,CACjB,CAAC;IACN,CAAC;CACJ;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
import type { ConfigItemSelect } from '#JC/types';
|
|
3
3
|
import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
|
|
4
4
|
interface ConfigInstanceSelectProps extends ConfigGenericProps {
|
|
@@ -15,6 +15,6 @@ interface ConfigInstanceSelectState extends ConfigGenericState {
|
|
|
15
15
|
declare class ConfigSelect extends ConfigGeneric<ConfigInstanceSelectProps, ConfigInstanceSelectState> {
|
|
16
16
|
private initialValue;
|
|
17
17
|
componentDidMount(): void;
|
|
18
|
-
renderItem(error: string, disabled: boolean):
|
|
18
|
+
renderItem(error: string, disabled: boolean): JSX.Element;
|
|
19
19
|
}
|
|
20
20
|
export default ConfigSelect;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InputLabel, FormHelperText, FormControl, Select, MenuItem, ListSubheader
|
|
1
|
+
import React, {} from 'react';
|
|
2
|
+
import { InputLabel, FormHelperText, FormControl, Select, MenuItem, ListSubheader } from '@mui/material';
|
|
3
3
|
import { I18n } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
5
5
|
const styles = {
|
|
@@ -40,7 +40,10 @@ class ConfigSelect extends ConfigGeneric {
|
|
|
40
40
|
// if __different
|
|
41
41
|
if (Array.isArray(value)) {
|
|
42
42
|
this.initialValue = [...value];
|
|
43
|
-
selectOptions.unshift({
|
|
43
|
+
selectOptions.unshift({
|
|
44
|
+
label: I18n.t(ConfigGeneric.DIFFERENT_LABEL),
|
|
45
|
+
value: ConfigGeneric.DIFFERENT_VALUE,
|
|
46
|
+
});
|
|
44
47
|
this.setState({ value: ConfigGeneric.DIFFERENT_VALUE, selectOptions });
|
|
45
48
|
}
|
|
46
49
|
else {
|
|
@@ -61,26 +64,29 @@ class ConfigSelect extends ConfigGeneric {
|
|
|
61
64
|
}
|
|
62
65
|
return !this.execute(item.hidden, this.props.schema.default, this.props.data, this.props.arrayIndex, this.props.globalData);
|
|
63
66
|
});
|
|
64
|
-
// eslint-disable-next-line
|
|
65
67
|
const item = selectOptions.find(it => it.value == this.state.value); // let "==" be and not ===
|
|
66
|
-
return React.createElement(FormControl, { variant: "standard", fullWidth: true, sx: this.props.table !== undefined && styles.noMargin, id: `jsonSelect_${this.props.attr}_${this.props.index || this.props.index === 0 ? this.props.index : ''}` },
|
|
68
|
+
return (React.createElement(FormControl, { variant: "standard", fullWidth: true, sx: this.props.table !== undefined && styles.noMargin, id: `jsonSelect_${this.props.attr}_${this.props.index || this.props.index === 0 ? this.props.index : ''}` },
|
|
67
69
|
this.props.schema.label ? React.createElement(InputLabel, null, this.getText(this.props.schema.label)) : null,
|
|
68
70
|
React.createElement(Select, { variant: "standard", error: !!error, disabled: !!disabled, value: this.state.value || '_', renderValue: () => this.getText(item?.label, this.props.schema.noTranslation), onChange: e => {
|
|
69
71
|
this.setState({ value: e.target.value === '_' ? '' : e.target.value }, () => {
|
|
72
|
+
let mayBePromise;
|
|
70
73
|
if (this.state.value === ConfigGeneric.DIFFERENT_VALUE) {
|
|
71
|
-
this.onChange(this.props.attr, this.initialValue);
|
|
74
|
+
mayBePromise = this.onChange(this.props.attr, this.initialValue);
|
|
72
75
|
}
|
|
73
76
|
else {
|
|
74
|
-
this.onChange(this.props.attr, this.state.value);
|
|
77
|
+
mayBePromise = this.onChange(this.props.attr, this.state.value);
|
|
78
|
+
}
|
|
79
|
+
if (mayBePromise instanceof Promise) {
|
|
80
|
+
mayBePromise.catch(e => console.error(e));
|
|
75
81
|
}
|
|
76
82
|
});
|
|
77
83
|
} }, selectOptions.map((it, i) => {
|
|
78
84
|
if (it.group) {
|
|
79
|
-
return React.createElement(ListSubheader, { key: i }, this.getText(it.label, this.props.schema.noTranslation));
|
|
85
|
+
return (React.createElement(ListSubheader, { key: i }, this.getText(it.label, this.props.schema.noTranslation)));
|
|
80
86
|
}
|
|
81
|
-
return React.createElement(MenuItem, { key: i, value: it.value, style: it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {} }, this.getText(it.label, this.props.schema.noTranslation));
|
|
87
|
+
return (React.createElement(MenuItem, { key: i, value: it.value, style: it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {} }, this.getText(it.label, this.props.schema.noTranslation)));
|
|
82
88
|
})),
|
|
83
|
-
this.props.schema.help ? React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
89
|
+
this.props.schema.help ? (React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation))) : null));
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
export default ConfigSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigSelect.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigSelect.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,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O,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAC5C,CACnB,CAAC;gBACN,CAAC;gBACD,OAAO,CACH,oBAAC,QAAQ,IACL,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,EAAE,CAAC,KAAK,EACf,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAExE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CACjD,CACd,CAAC;YACN,CAAC,CAAC,CACG;YACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACtB,oBAAC,cAAc,QACV,IAAI,CAAC,UAAU,CACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAClC,CACY,CACpB,CAAC,CAAC,CAAC,IAAI,CACE,CACjB,CAAC;IACN,CAAC;CACJ;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
import type { ConfigItemSelectSendTo } from '#JC/types';
|
|
3
3
|
import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
|
|
4
4
|
interface ConfigSelectSendToProps extends ConfigGenericProps {
|
|
@@ -17,7 +17,7 @@ declare class ConfigSelectSendTo extends ConfigGeneric<ConfigSelectSendToProps,
|
|
|
17
17
|
private _context;
|
|
18
18
|
askInstance(): void;
|
|
19
19
|
getContext(): string;
|
|
20
|
-
_getValue():
|
|
21
|
-
renderItem(error: unknown, disabled: boolean):
|
|
20
|
+
_getValue(): string | string[];
|
|
21
|
+
renderItem(error: unknown, disabled: boolean): JSX.Element | string;
|
|
22
22
|
}
|
|
23
23
|
export default ConfigSelectSendTo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, {} from 'react';
|
|
2
2
|
import { InputLabel, MenuItem, FormHelperText, FormControl, Select, TextField, CircularProgress, ListItemText, Checkbox, Chip, Box, InputAdornment, IconButton, } from '@mui/material';
|
|
3
|
-
import { Close as CloseIcon
|
|
3
|
+
import { Close as CloseIcon } from '@mui/icons-material';
|
|
4
4
|
import { I18n } from '@iobroker/adapter-react-v5';
|
|
5
5
|
import ConfigGeneric, {} from './ConfigGeneric';
|
|
6
6
|
const styles = {
|
|
@@ -27,8 +27,12 @@ class ConfigSelectSendTo extends ConfigGeneric {
|
|
|
27
27
|
data = null;
|
|
28
28
|
}
|
|
29
29
|
this.setState({ running: true }, () => {
|
|
30
|
-
this.props.socket
|
|
31
|
-
.
|
|
30
|
+
void this.props.socket
|
|
31
|
+
.sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.command || 'send', data)
|
|
32
|
+
.then(list => this.setState({ list, running: false }))
|
|
33
|
+
.catch(e => {
|
|
34
|
+
console.error(`Cannot send command: ${e}`);
|
|
35
|
+
});
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
else {
|
|
@@ -39,12 +43,14 @@ class ConfigSelectSendTo extends ConfigGeneric {
|
|
|
39
43
|
getContext() {
|
|
40
44
|
const context = {};
|
|
41
45
|
if (Array.isArray(this.props.schema.alsoDependsOn)) {
|
|
42
|
-
this.props.schema.alsoDependsOn.forEach(attr => context[attr] = ConfigGeneric.getValue(this.props.data, attr));
|
|
46
|
+
this.props.schema.alsoDependsOn.forEach(attr => (context[attr] = ConfigGeneric.getValue(this.props.data, attr)));
|
|
43
47
|
}
|
|
44
48
|
return JSON.stringify(context);
|
|
45
49
|
}
|
|
46
50
|
_getValue() {
|
|
47
|
-
let value = this.state.value === null || this.state.value === undefined
|
|
51
|
+
let value = this.state.value === null || this.state.value === undefined
|
|
52
|
+
? ConfigGeneric.getValue(this.props.data, this.props.attr)
|
|
53
|
+
: this.state.value;
|
|
48
54
|
if (this.props.schema.multiple) {
|
|
49
55
|
if (typeof value === 'string') {
|
|
50
56
|
value = [value];
|
|
@@ -69,16 +75,16 @@ class ConfigSelectSendTo extends ConfigGeneric {
|
|
|
69
75
|
if (this.props.schema.multiple || this.props.schema.manual === false) {
|
|
70
76
|
return I18n.t('ra_Cannot retrieve options, as instance is offline');
|
|
71
77
|
}
|
|
72
|
-
return React.createElement(TextField, { variant: "standard", fullWidth: true, value: value, error: !!error, disabled: !!disabled, onChange: e => {
|
|
78
|
+
return (React.createElement(TextField, { variant: "standard", fullWidth: true, value: value, error: !!error, disabled: !!disabled, onChange: e => {
|
|
73
79
|
const value_ = e.target.value;
|
|
74
80
|
this.setState({ value: value_ }, () => this.onChange(this.props.attr, (value_ || '').trim()));
|
|
75
81
|
}, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation), slotProps: {
|
|
76
82
|
input: {
|
|
77
|
-
endAdornment: this.state.value && !this.props.schema.noClearButton ? React.createElement(InputAdornment, { position: "end" },
|
|
83
|
+
endAdornment: this.state.value && !this.props.schema.noClearButton ? (React.createElement(InputAdornment, { position: "end" },
|
|
78
84
|
React.createElement(IconButton, { size: "small", onClick: () => this.setState({ value: '' }, () => this.onChange(this.props.attr, '')) },
|
|
79
|
-
React.createElement(CloseIcon, null))) : null,
|
|
85
|
+
React.createElement(CloseIcon, null)))) : null,
|
|
80
86
|
},
|
|
81
|
-
} });
|
|
87
|
+
} }));
|
|
82
88
|
}
|
|
83
89
|
if (this.state.running) {
|
|
84
90
|
return React.createElement(CircularProgress, { size: "24" });
|
|
@@ -93,26 +99,26 @@ class ConfigSelectSendTo extends ConfigGeneric {
|
|
|
93
99
|
return !this.execute(item.hidden, this.props.schema.default, this.props.data, this.props.arrayIndex, this.props.globalData);
|
|
94
100
|
});
|
|
95
101
|
const item = selectOptions.find(it => it.value === value);
|
|
96
|
-
return React.createElement(FormControl, { variant: "standard", fullWidth: true },
|
|
102
|
+
return (React.createElement(FormControl, { variant: "standard", fullWidth: true },
|
|
97
103
|
this.props.schema.label ? React.createElement(InputLabel, null, this.getText(this.props.schema.label)) : null,
|
|
98
104
|
React.createElement(Select, { variant: "standard", error: !!error, multiple: this.props.schema.multiple, disabled: !!disabled,
|
|
99
105
|
// MenuProps={this.props.schema.multiple ? { classes: { paper: this.props.classes.menuPaper } } : undefined}
|
|
100
106
|
sx: {
|
|
101
107
|
'&.MuiSelect-paper': this.props.schema.multiple ? styles.menuPaper : undefined,
|
|
102
|
-
}, value: value, renderValue: val =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
(
|
|
113
|
-
|
|
114
|
-
} }, selectOptions.map((it, i) => React.createElement(MenuItem, { key: i, value: it.value },
|
|
115
|
-
this.props.schema.multiple ? React.createElement(Checkbox, { checked: value.includes(it.value), onClick: () => {
|
|
108
|
+
}, value: value, renderValue: (val) => this.props.schema.multiple ? (React.createElement(Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, val.map((v) => {
|
|
109
|
+
const it = selectOptions.find(_item => _item.value === v);
|
|
110
|
+
if (it || this.props.schema.showAllValues !== false) {
|
|
111
|
+
const label = it?.label || v;
|
|
112
|
+
return (React.createElement(Chip, { key: v, label: label }));
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}))) : (item?.label || val), onChange: e => {
|
|
116
|
+
const mayBePromise = this.onChange(this.props.attr, e.target.value);
|
|
117
|
+
if (mayBePromise instanceof Promise) {
|
|
118
|
+
mayBePromise.catch(e => console.error(`Cannot set value: ${e}`));
|
|
119
|
+
}
|
|
120
|
+
} }, selectOptions.map((it, i) => (React.createElement(MenuItem, { key: i, value: it.value },
|
|
121
|
+
this.props.schema.multiple ? (React.createElement(Checkbox, { checked: value.includes(it.value), onClick: () => {
|
|
116
122
|
const _value = JSON.parse(JSON.stringify(this._getValue()));
|
|
117
123
|
const pos = value.indexOf(it.value);
|
|
118
124
|
if (pos !== -1) {
|
|
@@ -123,9 +129,9 @@ class ConfigSelectSendTo extends ConfigGeneric {
|
|
|
123
129
|
_value.sort();
|
|
124
130
|
}
|
|
125
131
|
this.setState({ value: _value }, () => this.onChange(this.props.attr, _value));
|
|
126
|
-
} }) : null,
|
|
127
|
-
React.createElement(ListItemText, { primary: it.label })))),
|
|
128
|
-
this.props.schema.help ? React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
132
|
+
} })) : null,
|
|
133
|
+
React.createElement(ListItemText, { primary: it.label }))))),
|
|
134
|
+
this.props.schema.help ? (React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation))) : null));
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
export default ConfigSelectSendTo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigSelectSendTo.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSelectSendTo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigSelectSendTo.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSelectSendTo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAExC,OAAO,EACH,UAAU,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,GAAG,EACH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