@iobroker/adapter-react-v5 4.7.14 → 4.8.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/ConfigAccordion.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigAccordion.js +4 -6
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +36 -13
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +66 -164
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +16 -13
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +119 -251
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +14 -13
- package/Components/JsonConfigComponent/ConfigCheckbox.js +37 -79
- package/Components/JsonConfigComponent/ConfigChip.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigColor.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +6 -0
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +18 -0
- package/Components/JsonConfigComponent/ConfigFile.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigFile.js +2 -2
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +8 -5
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +12 -4
- package/Components/JsonConfigComponent/ConfigGeneric.js +11 -2
- package/Components/JsonConfigComponent/ConfigIP.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigImageUpload.js +38 -44
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigInterface.js +1 -1
- package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +6 -13
- package/Components/JsonConfigComponent/ConfigLanguage.js +105 -154
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigPanel.js +8 -1
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +23 -17
- package/Components/JsonConfigComponent/ConfigSendto.js +259 -399
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigText.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigText.js +18 -0
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigUser.d.ts +2 -2
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +63 -0
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +268 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +15 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +53 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +340 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +45 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +146 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +69 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +51 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +216 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +13 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +111 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +7 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +16 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +94 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +10 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +22 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +158 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +26 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +2 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js +10 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +1 -0
- package/Components/JsonConfigComponent/index.js +2 -7
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/TextWithIcon.d.ts +1 -1
- package/Components/Utils.js +1 -1
- package/Components/Utils.js.map +1 -1
- package/Dialogs/ComplexCron.js +15 -17
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.d.ts +20 -44
- package/Dialogs/Confirm.js +102 -158
- package/Dialogs/Error.d.ts +20 -39
- package/Dialogs/Error.js +50 -76
- package/Dialogs/Message.d.ts +22 -32
- package/Dialogs/Message.js +51 -83
- package/LegacyConnection.d.ts +3 -3
- package/README.md +9 -6
- package/i18n.d.ts +6 -6
- package/package.json +6 -5
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.js.map +0 -1
- package/Dialogs/Confirm.js.map +0 -1
- package/Dialogs/Error.js.map +0 -1
- package/Dialogs/Message.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -12,7 +12,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
12
12
|
instance: PropTypes.Requireable<number>;
|
|
13
13
|
commandRunning: PropTypes.Requireable<boolean>;
|
|
14
14
|
onCommandRunning: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
15
|
+
}>, "style" | "className" | "commandRunning" | "themeName" | "onCommandRunning"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "common">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "icon"> & object>;
|
|
16
16
|
export default _default;
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "slider"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "slider"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "primary" | "secondary"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "primary" | "secondary"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"header"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"header"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "link"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "link"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"label" | "error" | "indeterminate" | "helper"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -17,6 +17,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
18
|
var _styles = require("@mui/styles");
|
|
19
19
|
var _material = require("@mui/material");
|
|
20
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
20
21
|
var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
|
|
21
22
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
22
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
@@ -161,6 +162,23 @@ var ConfigText = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
161
162
|
inputProps: {
|
|
162
163
|
maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,
|
|
163
164
|
readOnly: this.props.schema.readOnly || false
|
|
165
|
+
}
|
|
166
|
+
// eslint-disable-next-line react/jsx-no-duplicate-props
|
|
167
|
+
,
|
|
168
|
+
InputProps: {
|
|
169
|
+
endAdornment: this.state.value ? /*#__PURE__*/_react["default"].createElement(_material.InputAdornment, {
|
|
170
|
+
position: "end"
|
|
171
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
|
|
172
|
+
size: "small",
|
|
173
|
+
onClick: function onClick() {
|
|
174
|
+
return _this.setState({
|
|
175
|
+
value: '',
|
|
176
|
+
oldValue: _this.state.value
|
|
177
|
+
}, function () {
|
|
178
|
+
return _this.onChange(_this.props.attr, '');
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Close, null))) : null
|
|
164
182
|
},
|
|
165
183
|
onChange: function onChange(e) {
|
|
166
184
|
var value = e.target.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigText.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_i18n","_ConfigGeneric2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","indeterminate","opacity","label","width","fontSize","helper","error","color","ConfigText","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","componentDidMount","_get2","ConfigGeneric","getValue","props","data","attr","setState","oldValue","renderItem","disabled","_this","isIndeterminate","Array","isArray","state","DIFFERENT_VALUE","undefined","updateTimeout","clearTimeout","setTimeout","arr","_toConsumableArray2","map","item","toString","unshift","I18n","t","DIFFERENT_LABEL","createElement","Autocomplete","className","classes","fullWidth","getOptionSelected","option","onChange","_","options","getOptionLabel","renderInput","params","TextField","_extends2","variant","placeholder","getText","schema","inputProps","maxLength","max","readOnly","helperText","renderHelp","help","helpLink","noTranslation","minRows","style","TextareaAutosize","resize","backgroundColor","themeType","maxRows","target","getDerivedStateFromProps","propTypes","socket","PropTypes","object","isRequired","string","themeName","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigText.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n Autocomplete,\n TextField,\n TextareaAutosize,\n} from '@mui/material';\n\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n indeterminate: {\n opacity: 0.5,\n },\n label: {\n width: '100%',\n fontSize: 16,\n },\n helper: {\n width: '100%',\n fontSize: 12,\n },\n error: {\n width: '100%',\n fontSize: 12,\n color: '#FF0000',\n },\n});\n\nclass ConfigText extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n this.setState({ value, oldValue: value });\n }\n\n static getDerivedStateFromProps(props, state) {\n let value = ConfigGeneric.getValue(props.data, props.attr);\n if (value !== null && value !== undefined) {\n value = value.toString();\n }\n\n if (value === null || value === undefined || (value !== state.value && value !== state.oldValue)) {\n return { value };\n }\n return null;\n }\n\n renderItem(error, disabled /* , defaultValue */) {\n const isIndeterminate = Array.isArray(this.state.value) || this.state.value === ConfigGeneric.DIFFERENT_VALUE;\n\n if (this.state.oldValue !== null && this.state.oldValue !== undefined) {\n this.updateTimeout && clearTimeout(this.updateTimeout);\n this.updateTimeout = setTimeout(() => {\n this.updateTimeout = null;\n this.setState({ oldValue: null });\n }, 30);\n } else if (this.updateTimeout) {\n clearTimeout(this.updateTimeout);\n this.updateTimeout = null;\n }\n\n if (isIndeterminate) {\n const arr = [...this.state.value].map(item => ({ label: item.toString(), value: item }));\n arr.unshift({ label: I18n.t(ConfigGeneric.DIFFERENT_LABEL), value: ConfigGeneric.DIFFERENT_VALUE });\n\n return <Autocomplete\n className={this.props.classes.indeterminate}\n fullWidth\n value={arr[0]}\n getOptionSelected={(option, value) => option.label === value.label}\n onChange={(_, value) =>\n this.onChange(this.props.attr, value ? value.value : '')}\n options={arr}\n getOptionLabel={option => option.label}\n renderInput={params => <TextField\n variant=\"standard\"\n {...params}\n error={!!error}\n placeholder={this.getText(this.props.schema.placeholder)}\n inputProps={{\n maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,\n readOnly: this.props.schema.readOnly || false,\n }}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n disabled={!!disabled}\n />}\n />;\n }\n if (this.props.schema.minRows > 1) {\n const helper = this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation);\n return <div style={{ width: '100%' }}>\n {this.props.schema.label ? <div className={this.props.classes.label}>{this.getText(this.props.schema.label)}</div> : null}\n <TextareaAutosize\n variant=\"standard\"\n style={{\n width: '100%',\n resize: 'vertical',\n backgroundColor: this.props.themeType === 'dark' ? '#363636' : '#cccccc',\n color: this.props.themeType === 'dark' ? '#fff' : '#111',\n }}\n minRows={this.props.schema.minRows}\n maxRows={this.props.schema.maxRows}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n disabled={!!disabled}\n readOnly={this.props.schema.readOnly || false}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value, oldValue: this.state.value }, () =>\n this.onChange(this.props.attr, value || ''));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n />\n {helper || error ? <div className={error ? this.props.classes.error : this.props.classes.helper}>{error || helper}</div> : null}\n </div>;\n }\n return <TextField\n variant=\"standard\"\n fullWidth\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{\n maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,\n readOnly: this.props.schema.readOnly || false,\n }}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value, oldValue: this.state.value }, () =>\n this.onChange(this.props.attr, value));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />;\n }\n}\n\nConfigText.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigText);\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAMA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA4C,SAAAM,aAAAC,OAAA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AAU;EACjCvB,MAAM,EAAEqB,qBAAS,CAACC,MAAM;EACxBI,OAAO,EAAEL,qBAAS,CAACM,IAAI;EACvBtC,QAAQ,EAAEgC,qBAAS,CAACM;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAAC/F,MAAM,CAAC,CAACS,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"ConfigText.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_iconsMaterial","_i18n","_ConfigGeneric2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","indeterminate","opacity","label","width","fontSize","helper","error","color","ConfigText","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","componentDidMount","_get2","ConfigGeneric","getValue","props","data","attr","setState","oldValue","renderItem","disabled","_this","isIndeterminate","Array","isArray","state","DIFFERENT_VALUE","undefined","updateTimeout","clearTimeout","setTimeout","arr","_toConsumableArray2","map","item","toString","unshift","I18n","t","DIFFERENT_LABEL","createElement","Autocomplete","className","classes","fullWidth","getOptionSelected","option","onChange","_","options","getOptionLabel","renderInput","params","TextField","_extends2","variant","placeholder","getText","schema","inputProps","maxLength","max","readOnly","helperText","renderHelp","help","helpLink","noTranslation","minRows","style","TextareaAutosize","resize","backgroundColor","themeType","maxRows","target","InputProps","endAdornment","InputAdornment","position","IconButton","size","onClick","Close","getDerivedStateFromProps","propTypes","socket","PropTypes","object","isRequired","string","themeName","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigText.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n Autocomplete,\n TextField,\n TextareaAutosize, InputAdornment, IconButton,\n} from '@mui/material';\n\nimport {\n Close as CloseIcon,\n} from '@mui/icons-material';\n\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n indeterminate: {\n opacity: 0.5,\n },\n label: {\n width: '100%',\n fontSize: 16,\n },\n helper: {\n width: '100%',\n fontSize: 12,\n },\n error: {\n width: '100%',\n fontSize: 12,\n color: '#FF0000',\n },\n});\n\nclass ConfigText extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n this.setState({ value, oldValue: value });\n }\n\n static getDerivedStateFromProps(props, state) {\n let value = ConfigGeneric.getValue(props.data, props.attr);\n if (value !== null && value !== undefined) {\n value = value.toString();\n }\n\n if (value === null || value === undefined || (value !== state.value && value !== state.oldValue)) {\n return { value };\n }\n return null;\n }\n\n renderItem(error, disabled /* , defaultValue */) {\n const isIndeterminate = Array.isArray(this.state.value) || this.state.value === ConfigGeneric.DIFFERENT_VALUE;\n\n if (this.state.oldValue !== null && this.state.oldValue !== undefined) {\n this.updateTimeout && clearTimeout(this.updateTimeout);\n this.updateTimeout = setTimeout(() => {\n this.updateTimeout = null;\n this.setState({ oldValue: null });\n }, 30);\n } else if (this.updateTimeout) {\n clearTimeout(this.updateTimeout);\n this.updateTimeout = null;\n }\n\n if (isIndeterminate) {\n const arr = [...this.state.value].map(item => ({ label: item.toString(), value: item }));\n arr.unshift({ label: I18n.t(ConfigGeneric.DIFFERENT_LABEL), value: ConfigGeneric.DIFFERENT_VALUE });\n\n return <Autocomplete\n className={this.props.classes.indeterminate}\n fullWidth\n value={arr[0]}\n getOptionSelected={(option, value) => option.label === value.label}\n onChange={(_, value) =>\n this.onChange(this.props.attr, value ? value.value : '')}\n options={arr}\n getOptionLabel={option => option.label}\n renderInput={params => <TextField\n variant=\"standard\"\n {...params}\n error={!!error}\n placeholder={this.getText(this.props.schema.placeholder)}\n inputProps={{\n maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,\n readOnly: this.props.schema.readOnly || false,\n }}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n disabled={!!disabled}\n />}\n />;\n }\n if (this.props.schema.minRows > 1) {\n const helper = this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation);\n return <div style={{ width: '100%' }}>\n {this.props.schema.label ? <div className={this.props.classes.label}>{this.getText(this.props.schema.label)}</div> : null}\n <TextareaAutosize\n variant=\"standard\"\n style={{\n width: '100%',\n resize: 'vertical',\n backgroundColor: this.props.themeType === 'dark' ? '#363636' : '#cccccc',\n color: this.props.themeType === 'dark' ? '#fff' : '#111',\n }}\n minRows={this.props.schema.minRows}\n maxRows={this.props.schema.maxRows}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n disabled={!!disabled}\n readOnly={this.props.schema.readOnly || false}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value, oldValue: this.state.value }, () =>\n this.onChange(this.props.attr, value || ''));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n />\n {helper || error ? <div className={error ? this.props.classes.error : this.props.classes.helper}>{error || helper}</div> : null}\n </div>;\n }\n return <TextField\n variant=\"standard\"\n fullWidth\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{\n maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,\n readOnly: this.props.schema.readOnly || false,\n }}\n // eslint-disable-next-line react/jsx-no-duplicate-props\n InputProps={{\n endAdornment: this.state.value ? <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n onClick={() => this.setState({ value: '', oldValue: this.state.value }, () =>\n this.onChange(this.props.attr, ''))}\n >\n <CloseIcon />\n </IconButton>\n </InputAdornment> : null,\n }}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value, oldValue: this.state.value }, () =>\n this.onChange(this.props.attr, value));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />;\n }\n}\n\nConfigText.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigText);\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAMA,IAAAI,cAAA,GAAAJ,OAAA;AAIA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA4C,SAAAO,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAE5C,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAU;IAClBC,aAAa,EAAE;MACXC,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B,MAAM,EAAE6B,qBAAS,CAACC,MAAM;EACxBI,OAAO,EAAEL,qBAAS,CAACM,IAAI;EACvB9C,QAAQ,EAAEwC,qBAAS,CAACM;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAACvG,MAAM,CAAC,CAACS,UAAU,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
data: PropTypes.Validator<object>;
|
|
4
4
|
schema: PropTypes.Requireable<object>;
|
|
5
5
|
adapterName: PropTypes.Requireable<string>;
|
|
6
6
|
instance: PropTypes.Requireable<number>;
|
|
7
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
7
|
+
}>, never> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "common" | "themeType" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
8
8
|
export default _default;
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"indeterminate"> & object>;
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"indeterminate"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -11,7 +11,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
11
11
|
adapterName: PropTypes.Requireable<string>;
|
|
12
12
|
instance: PropTypes.Requireable<number>;
|
|
13
13
|
customObj: PropTypes.Requireable<object>;
|
|
14
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
14
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "icon"> & object>;
|
|
15
15
|
export default _default;
|
|
16
16
|
import PropTypes from 'prop-types';
|
|
17
17
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default ConfigUUID;
|
|
2
|
-
declare class ConfigUUID extends ConfigGeneric<
|
|
3
|
-
constructor(props:
|
|
2
|
+
declare class ConfigUUID extends ConfigGeneric<import("./ConfigGeneric").ConfigGenericProps, import("./ConfigGeneric").ConfigGenericState> {
|
|
3
|
+
constructor(props: import("./ConfigGeneric").ConfigGenericProps);
|
|
4
4
|
componentDidMount(): Promise<void>;
|
|
5
5
|
renderItem(error: any, disabled: any): React.JSX.Element;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
2
|
socket: PropTypes.Validator<object>;
|
|
3
3
|
themeType: PropTypes.Requireable<string>;
|
|
4
4
|
themeName: PropTypes.Requireable<string>;
|
|
@@ -8,7 +8,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
8
8
|
schema: PropTypes.Requireable<object>;
|
|
9
9
|
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
11
|
+
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "icon"> & object>;
|
|
12
12
|
export default _default;
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React from 'react';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Connection } from '@iobroker/socket-client';
|
|
3
|
+
import { ActionBase, ControlBase, ControlState } from '@iobroker/dm-utils/build/types/base';
|
|
4
|
+
export type CommunicationProps = {
|
|
5
|
+
socket: Connection;
|
|
6
|
+
selectedInstance: string;
|
|
7
|
+
registerHandler?: (handler: null | ((command: string) => void)) => void;
|
|
8
|
+
};
|
|
9
|
+
interface CommunicationForm {
|
|
10
|
+
title?: string | null | undefined;
|
|
11
|
+
schema?: Record<string, any>;
|
|
12
|
+
data?: Record<string, any>;
|
|
13
|
+
handleClose?: (data?: Record<string, any>) => void;
|
|
14
|
+
}
|
|
15
|
+
export type CommunicationState = {
|
|
16
|
+
showSpinner: boolean;
|
|
17
|
+
showToast: string | null;
|
|
18
|
+
message: {
|
|
19
|
+
message: string;
|
|
20
|
+
handleClose: () => void;
|
|
21
|
+
} | null;
|
|
22
|
+
confirm: {
|
|
23
|
+
message: string;
|
|
24
|
+
handleClose: (confirmation?: boolean) => void;
|
|
25
|
+
} | null;
|
|
26
|
+
form: CommunicationForm | null;
|
|
27
|
+
progress: {
|
|
28
|
+
open: boolean;
|
|
29
|
+
progress: number;
|
|
30
|
+
} | null;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Device List Component
|
|
34
|
+
* @param {object} params - Component parameters
|
|
35
|
+
* @param {object} params.socket - socket object
|
|
36
|
+
* @param {string} params.selectedInstance - Selected instance
|
|
37
|
+
* @returns {*[]} - Array of device cards
|
|
38
|
+
*/
|
|
39
|
+
declare class Communication<P extends CommunicationProps, S extends CommunicationState> extends Component<P, S> {
|
|
40
|
+
instanceHandler: (action: ActionBase<'api'>) => () => void;
|
|
41
|
+
deviceHandler: (deviceId: string, action: ActionBase<'api'>, refresh: () => void) => () => void;
|
|
42
|
+
controlHandler: (deviceId: string, control: ControlBase, state: ControlState) => () => Promise<ioBroker.State | null>;
|
|
43
|
+
controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;
|
|
44
|
+
constructor(props: P);
|
|
45
|
+
loadData(): Promise<void>;
|
|
46
|
+
sendActionToInstance: (command: string, messageToSend: any, refresh?: () => void) => void;
|
|
47
|
+
sendControlToInstance: (command: string, messageToSend: {
|
|
48
|
+
deviceId: string;
|
|
49
|
+
controlId: string;
|
|
50
|
+
state?: ControlState;
|
|
51
|
+
}) => Promise<ioBroker.State>;
|
|
52
|
+
loadDevices(): Promise<any>;
|
|
53
|
+
loadInstanceInfos(): Promise<any>;
|
|
54
|
+
renderMessageDialog(): React.JSX.Element | null;
|
|
55
|
+
renderConfirmDialog(): React.JSX.Element;
|
|
56
|
+
renderSnackbar(): React.JSX.Element;
|
|
57
|
+
renderFormDialog(): React.JSX.Element;
|
|
58
|
+
renderProgressDialog(): React.JSX.Element;
|
|
59
|
+
renderContent(): React.JSX.Element | React.JSX.Element[] | null;
|
|
60
|
+
renderSpinner(): React.JSX.Element;
|
|
61
|
+
render(): React.JSX.Element;
|
|
62
|
+
}
|
|
63
|
+
export default Communication;
|