@iobroker/adapter-react-v5 4.8.1 → 4.9.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/Logo.d.ts +9 -50
- package/Components/Logo.js +106 -173
- package/Components/ObjectBrowser.d.ts +9 -0
- package/Components/ObjectBrowser.js +370 -165
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/SaveCloseButtons.d.ts +17 -61
- package/Components/SaveCloseButtons.js +64 -124
- package/Components/Schedule.d.ts +31 -6
- package/Components/Schedule.js +1144 -1562
- package/Components/TabContainer.d.ts +9 -37
- package/Components/TabContainer.js +49 -74
- package/Components/TabContent.d.ts +6 -27
- package/Components/TabContent.js +24 -67
- package/Components/TabHeader.d.ts +6 -11
- package/Components/TabHeader.js +11 -40
- package/Components/ToggleThemeMenu.d.ts +10 -8
- package/Components/ToggleThemeMenu.js +16 -36
- package/Components/types.d.ts +10 -2
- package/Dialogs/SelectID.d.ts +39 -114
- package/Dialogs/SelectID.js +141 -246
- package/LegacyConnection.d.ts +1 -1
- package/README.md +6 -2
- package/i18n.d.ts +2 -2
- package/index.d.ts +127 -126
- package/index.js +213 -192
- package/package.json +6 -7
- package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
- package/Components/JsonConfigComponent/ChipInput.js +0 -763
- package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
- package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
- package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
- package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigChip.js +0 -120
- package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
- package/Components/JsonConfigComponent/ConfigColor.js +0 -120
- package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
- package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
- package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
- package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigFile.js +0 -228
- package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
- package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
- package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
- package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigIP.js +0 -130
- package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
- package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
- package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
- package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
- package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
- package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
- package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPort.js +0 -176
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
- package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
- package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
- package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
- package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
- package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
- package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
- package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigText.js +0 -226
- package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
- package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
- package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigUser.js +0 -142
- package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
- package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
- package/Components/JsonConfigComponent/index.d.ts +0 -26
- package/Components/JsonConfigComponent/index.js +0 -520
- package/Components/JsonConfigComponent/index.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
- package/Components/Logo.js.map +0 -1
- package/Components/SaveCloseButtons.js.map +0 -1
- package/Components/Schedule.js.map +0 -1
- package/Components/TabContainer.js.map +0 -1
- package/Components/TabContent.js.map +0 -1
- package/Components/TabHeader.js.map +0 -1
- package/Components/ToggleThemeMenu.js.map +0 -1
- package/Dialogs/SelectID.js.map +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _styles = require("@mui/styles");
|
|
17
|
-
var _material = require("@mui/material");
|
|
18
|
-
var _TextWithIcon = _interopRequireDefault(require("./wrapper/Components/TextWithIcon"));
|
|
19
|
-
var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
|
|
20
|
-
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
21
|
-
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); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
|
-
var styles = function styles() {
|
|
24
|
-
return {
|
|
25
|
-
fullWidth: {
|
|
26
|
-
width: '100%'
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
var ConfigFunc = /*#__PURE__*/function (_ConfigGeneric) {
|
|
31
|
-
(0, _inherits2["default"])(ConfigFunc, _ConfigGeneric);
|
|
32
|
-
var _super = _createSuper(ConfigFunc);
|
|
33
|
-
function ConfigFunc() {
|
|
34
|
-
(0, _classCallCheck2["default"])(this, ConfigFunc);
|
|
35
|
-
return _super.apply(this, arguments);
|
|
36
|
-
}
|
|
37
|
-
(0, _createClass2["default"])(ConfigFunc, [{
|
|
38
|
-
key: "componentDidMount",
|
|
39
|
-
value: function componentDidMount() {
|
|
40
|
-
var _this = this;
|
|
41
|
-
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigFunc.prototype), "componentDidMount", this).call(this);
|
|
42
|
-
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
43
|
-
this.props.socket.getEnums('rooms').then(function (enums) {
|
|
44
|
-
var selectOptions = Object.keys(enums).map(function (id) {
|
|
45
|
-
return {
|
|
46
|
-
value: _this.props.schema["short"] ? id.replace('enum.rooms.', '') : id,
|
|
47
|
-
label: _this.getText(enums[id].common.name),
|
|
48
|
-
obj: enums[id]
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
if (_this.props.schema.allowDeactivate !== false) {
|
|
52
|
-
selectOptions.unshift({
|
|
53
|
-
label: _i18n["default"].t(_ConfigGeneric2["default"].NONE_LABEL),
|
|
54
|
-
value: _ConfigGeneric2["default"].NONE_VALUE
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
_this.setState({
|
|
58
|
-
value: value,
|
|
59
|
-
selectOptions: selectOptions
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
key: "renderItem",
|
|
65
|
-
value: function renderItem(error, disabled /* , defaultValue */) {
|
|
66
|
-
var _this2 = this;
|
|
67
|
-
if (!this.state.selectOptions) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
var item = this.state.selectOptions.find(function (it) {
|
|
71
|
-
return it.value === _this2.state.value;
|
|
72
|
-
});
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement(_material.FormControl, {
|
|
74
|
-
variant: "standard",
|
|
75
|
-
className: this.props.classes.fullWidth
|
|
76
|
-
}, this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_material.InputLabel, null, this.getText(this.props.schema.label)) : null, /*#__PURE__*/_react["default"].createElement(_material.Select, {
|
|
77
|
-
variant: "standard",
|
|
78
|
-
error: !!error,
|
|
79
|
-
disabled: !!disabled,
|
|
80
|
-
value: this.state.value || '_',
|
|
81
|
-
renderValue: function renderValue() {
|
|
82
|
-
return item ? item.obj ? /*#__PURE__*/_react["default"].createElement(_TextWithIcon["default"], {
|
|
83
|
-
value: item.obj,
|
|
84
|
-
themeType: _this2.props.themeType,
|
|
85
|
-
lang: _i18n["default"].getLanguage()
|
|
86
|
-
}) : item.label : '';
|
|
87
|
-
},
|
|
88
|
-
onChange: function onChange(e) {
|
|
89
|
-
_this2.setState({
|
|
90
|
-
value: e.target.value === '_' ? '' : e.target.value
|
|
91
|
-
}, function () {
|
|
92
|
-
return _this2.onChange(_this2.props.attr, _this2.state.value);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}, this.state.selectOptions.map(function (it) {
|
|
96
|
-
return /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
97
|
-
key: it.value,
|
|
98
|
-
value: it.value,
|
|
99
|
-
style: it.value === _ConfigGeneric2["default"].DIFFERENT_VALUE ? {
|
|
100
|
-
opacity: 0.5
|
|
101
|
-
} : {}
|
|
102
|
-
}, it.obj ? /*#__PURE__*/_react["default"].createElement(_TextWithIcon["default"], {
|
|
103
|
-
value: it.obj,
|
|
104
|
-
themeType: _this2.props.themeType,
|
|
105
|
-
lang: _i18n["default"].getLanguage()
|
|
106
|
-
}) : it.label);
|
|
107
|
-
})), this.props.schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
108
|
-
}
|
|
109
|
-
}]);
|
|
110
|
-
return ConfigFunc;
|
|
111
|
-
}(_ConfigGeneric2["default"]);
|
|
112
|
-
ConfigFunc.propTypes = {
|
|
113
|
-
socket: _propTypes["default"].object.isRequired,
|
|
114
|
-
themeType: _propTypes["default"].string,
|
|
115
|
-
themeName: _propTypes["default"].string,
|
|
116
|
-
style: _propTypes["default"].object,
|
|
117
|
-
className: _propTypes["default"].string,
|
|
118
|
-
data: _propTypes["default"].object.isRequired,
|
|
119
|
-
schema: _propTypes["default"].object,
|
|
120
|
-
onError: _propTypes["default"].func,
|
|
121
|
-
onChange: _propTypes["default"].func
|
|
122
|
-
};
|
|
123
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigFunc);
|
|
124
|
-
//# sourceMappingURL=ConfigRoom.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigRoom.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_TextWithIcon","_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","fullWidth","width","ConfigFunc","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","componentDidMount","_this","_get2","ConfigGeneric","getValue","props","data","attr","socket","getEnums","then","enums","selectOptions","Object","keys","map","id","schema","replace","label","getText","common","name","obj","allowDeactivate","unshift","I18n","t","NONE_LABEL","NONE_VALUE","setState","renderItem","error","disabled","_this2","state","item","find","it","createElement","FormControl","variant","className","classes","InputLabel","Select","renderValue","themeType","lang","getLanguage","onChange","target","MenuItem","style","DIFFERENT_VALUE","opacity","help","FormHelperText","renderHelp","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","string","themeName","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigRoom.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n InputLabel,\n MenuItem,\n FormHelperText,\n FormControl,\n Select,\n} from '@mui/material';\n\nimport TextWithIcon from './wrapper/Components/TextWithIcon';\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%',\n },\n});\n\nclass ConfigFunc extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n this.props.socket.getEnums('rooms')\n .then(enums => {\n const selectOptions = Object.keys(enums)\n .map(id => ({\n value: this.props.schema.short ? id.replace('enum.rooms.', '') : id,\n label: this.getText(enums[id].common.name),\n obj: enums[id],\n }));\n\n if (this.props.schema.allowDeactivate !== false) {\n selectOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n }\n\n this.setState({ value, selectOptions });\n });\n }\n\n renderItem(error, disabled /* , defaultValue */) {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const item = this.state.selectOptions.find(it => it.value === this.state.value);\n\n return <FormControl\n variant=\"standard\"\n className={this.props.classes.fullWidth}\n >\n {this.props.schema.label ? <InputLabel>{this.getText(this.props.schema.label)}</InputLabel> : null}\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={this.state.value || '_'}\n renderValue={() => (item ? (item.obj ? <TextWithIcon value={item.obj} themeType={this.props.themeType} lang={I18n.getLanguage()} /> : item.label) : '')}\n onChange={e => {\n this.setState({ value: e.target.value === '_' ? '' : e.target.value }, () =>\n this.onChange(this.props.attr, this.state.value));\n }}\n >\n {this.state.selectOptions.map(it =>\n <MenuItem key={it.value} value={it.value} style={it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {}}>\n {it.obj ? <TextWithIcon value={it.obj} themeType={this.props.themeType} lang={I18n.getLanguage()} /> : it.label}\n </MenuItem>)}\n </Select>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigFunc.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)(ConfigFunc);\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;AAQA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,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,SAAS,EAAE;MACPC,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,UA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,KAAK,CAACY,MAAM,CAACuC,IAAI,gBAAGlG,MAAA,YAAAiF,aAAA,CAAC5E,SAAA,CAAA8F,cAAc,QAAE,IAAI,CAACC,UAAU,CAAC,IAAI,CAACrD,KAAK,CAACY,MAAM,CAACuC,IAAI,EAAE,IAAI,CAACnD,KAAK,CAACY,MAAM,CAAC0C,QAAQ,EAAE,IAAI,CAACtD,KAAK,CAACY,MAAM,CAAC2C,aAAa,CAAkB,CAAC,GAAG,IAC3J,CAAC;IAClB;EAAC;EAAA,OAAApE,UAAA;AAAA,EApDoBW,0BAAa;AAuDtCX,UAAU,CAACqE,SAAS,GAAG;EACnBrD,MAAM,EAAEsD,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCjB,SAAS,EAAEe,qBAAS,CAACG,MAAM;EAC3BC,SAAS,EAAEJ,qBAAS,CAACG,MAAM;EAC3BZ,KAAK,EAAES,qBAAS,CAACC,MAAM;EACvBrB,SAAS,EAAEoB,qBAAS,CAACG,MAAM;EAC3B3D,IAAI,EAAEwD,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjC/C,MAAM,EAAE6C,qBAAS,CAACC,MAAM;EACxBI,OAAO,EAAEL,qBAAS,CAACM,IAAI;EACvBlB,QAAQ,EAAEY,qBAAS,CAACM;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAAClF,MAAM,CAAC,CAACG,UAAU,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
socket: PropTypes.Validator<object>;
|
|
3
|
-
themeType: PropTypes.Requireable<string>;
|
|
4
|
-
themeName: PropTypes.Requireable<string>;
|
|
5
|
-
style: PropTypes.Requireable<object>;
|
|
6
|
-
className: PropTypes.Requireable<string>;
|
|
7
|
-
data: PropTypes.Validator<object>;
|
|
8
|
-
schema: PropTypes.Requireable<object>;
|
|
9
|
-
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
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" | "noMargin"> & object>;
|
|
12
|
-
export default _default;
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
|
-
import React from 'react';
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
var _styles = require("@mui/styles");
|
|
18
|
-
var _material = require("@mui/material");
|
|
19
|
-
var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
|
|
20
|
-
var _Utils = _interopRequireDefault(require("./wrapper/Components/Utils"));
|
|
21
|
-
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
22
|
-
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); }; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
var styles = function styles() {
|
|
25
|
-
return {
|
|
26
|
-
fullWidth: {
|
|
27
|
-
width: '100%'
|
|
28
|
-
},
|
|
29
|
-
noMargin: {
|
|
30
|
-
'&>div': {
|
|
31
|
-
marginTop: 0
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
var ConfigSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
37
|
-
(0, _inherits2["default"])(ConfigSelect, _ConfigGeneric);
|
|
38
|
-
var _super = _createSuper(ConfigSelect);
|
|
39
|
-
function ConfigSelect() {
|
|
40
|
-
(0, _classCallCheck2["default"])(this, ConfigSelect);
|
|
41
|
-
return _super.apply(this, arguments);
|
|
42
|
-
}
|
|
43
|
-
(0, _createClass2["default"])(ConfigSelect, [{
|
|
44
|
-
key: "componentDidMount",
|
|
45
|
-
value: function componentDidMount() {
|
|
46
|
-
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSelect.prototype), "componentDidMount", this).call(this);
|
|
47
|
-
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
48
|
-
var selectOptions = [];
|
|
49
|
-
(this.props.schema.options || []).forEach(function (item) {
|
|
50
|
-
// if optgroup
|
|
51
|
-
if (Array.isArray(item.items)) {
|
|
52
|
-
selectOptions.push({
|
|
53
|
-
label: item.label,
|
|
54
|
-
value: item.value,
|
|
55
|
-
group: true
|
|
56
|
-
});
|
|
57
|
-
item.items = item.items.forEach(function (it) {
|
|
58
|
-
return selectOptions.push(it);
|
|
59
|
-
});
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
selectOptions.push(item);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// if __different
|
|
66
|
-
if (Array.isArray(value)) {
|
|
67
|
-
this.initialValue = (0, _toConsumableArray2["default"])(value);
|
|
68
|
-
selectOptions.unshift({
|
|
69
|
-
label: _i18n["default"].t(_ConfigGeneric2["default"].DIFFERENT_LABEL),
|
|
70
|
-
value: _ConfigGeneric2["default"].DIFFERENT_VALUE
|
|
71
|
-
});
|
|
72
|
-
this.setState({
|
|
73
|
-
value: _ConfigGeneric2["default"].DIFFERENT_VALUE,
|
|
74
|
-
selectOptions: selectOptions
|
|
75
|
-
});
|
|
76
|
-
} else {
|
|
77
|
-
this.setState({
|
|
78
|
-
value: value,
|
|
79
|
-
selectOptions: selectOptions
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "renderItem",
|
|
85
|
-
value: function renderItem(error, disabled /* , defaultValue */) {
|
|
86
|
-
var _this = this;
|
|
87
|
-
if (!this.state.selectOptions) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
var selectOptions = (this.state.selectOptions || []).filter(function (item) {
|
|
91
|
-
// if optgroup or no hidden function
|
|
92
|
-
if (!item.hidden) {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
if (_this.props.custom) {
|
|
96
|
-
return !_this.executeCustom(item.hidden, _this.props.data, _this.props.customObj, _this.props.instanceObj, _this.props.arrayIndex, _this.props.globalData);
|
|
97
|
-
}
|
|
98
|
-
return !_this.execute(item.hidden, _this.props.schema["default"], _this.props.data, _this.props.arrayIndex, _this.props.globalData);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// eslint-disable-next-line
|
|
102
|
-
var item = selectOptions.find(function (it) {
|
|
103
|
-
return it.value == _this.state.value;
|
|
104
|
-
}); // let "==" be and not ===
|
|
105
|
-
|
|
106
|
-
return /*#__PURE__*/_react["default"].createElement(_material.FormControl, {
|
|
107
|
-
variant: "standard",
|
|
108
|
-
className: _Utils["default"].clsx(this.props.classes.fullWidth, this.props.arrayIndex !== undefined && this.props.classes.noMargin),
|
|
109
|
-
id: "jsonSelect_".concat(this.props.schema.attr, "_").concat(this.props.index || this.props.index === 0 ? this.props.index : '')
|
|
110
|
-
}, this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_material.InputLabel, null, this.getText(this.props.schema.label)) : null, /*#__PURE__*/_react["default"].createElement(_material.Select, {
|
|
111
|
-
variant: "standard",
|
|
112
|
-
error: !!error,
|
|
113
|
-
disabled: !!disabled,
|
|
114
|
-
value: this.state.value || '_',
|
|
115
|
-
renderValue: function renderValue() {
|
|
116
|
-
return _this.getText(item === null || item === void 0 ? void 0 : item.label, _this.props.schema.noTranslation);
|
|
117
|
-
},
|
|
118
|
-
onChange: function onChange(e) {
|
|
119
|
-
_this.setState({
|
|
120
|
-
value: e.target.value === '_' ? '' : e.target.value
|
|
121
|
-
}, function () {
|
|
122
|
-
if (_this.state.value === _ConfigGeneric2["default"].DIFFERENT_VALUE) {
|
|
123
|
-
_this.onChange(_this.props.attr, _this.initialValue);
|
|
124
|
-
} else {
|
|
125
|
-
_this.onChange(_this.props.attr, _this.state.value);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}, selectOptions.map(function (it, i) {
|
|
130
|
-
if (it.group) {
|
|
131
|
-
return /*#__PURE__*/_react["default"].createElement(_material.ListSubheader, {
|
|
132
|
-
key: i
|
|
133
|
-
}, _this.getText(it.label, _this.props.schema.noTranslation));
|
|
134
|
-
}
|
|
135
|
-
return /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
136
|
-
key: i,
|
|
137
|
-
value: it.value,
|
|
138
|
-
style: it.value === _ConfigGeneric2["default"].DIFFERENT_VALUE ? {
|
|
139
|
-
opacity: 0.5
|
|
140
|
-
} : {}
|
|
141
|
-
}, _this.getText(it.label, _this.props.schema.noTranslation));
|
|
142
|
-
})), this.props.schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
143
|
-
}
|
|
144
|
-
}]);
|
|
145
|
-
return ConfigSelect;
|
|
146
|
-
}(_ConfigGeneric2["default"]);
|
|
147
|
-
ConfigSelect.propTypes = {
|
|
148
|
-
socket: _propTypes["default"].object.isRequired,
|
|
149
|
-
themeType: _propTypes["default"].string,
|
|
150
|
-
themeName: _propTypes["default"].string,
|
|
151
|
-
style: _propTypes["default"].object,
|
|
152
|
-
className: _propTypes["default"].string,
|
|
153
|
-
data: _propTypes["default"].object.isRequired,
|
|
154
|
-
schema: _propTypes["default"].object,
|
|
155
|
-
onError: _propTypes["default"].func,
|
|
156
|
-
onChange: _propTypes["default"].func
|
|
157
|
-
};
|
|
158
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigSelect);
|
|
159
|
-
//# sourceMappingURL=ConfigSelect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigSelect.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_i18n","_Utils","_ConfigGeneric2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","fullWidth","width","noMargin","marginTop","ConfigSelect","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","componentDidMount","_get2","ConfigGeneric","getValue","props","data","attr","selectOptions","schema","options","forEach","item","Array","isArray","items","push","label","group","it","initialValue","_toConsumableArray2","unshift","I18n","t","DIFFERENT_LABEL","DIFFERENT_VALUE","setState","renderItem","error","disabled","_this","state","filter","hidden","custom","executeCustom","customObj","instanceObj","arrayIndex","globalData","execute","find","createElement","FormControl","variant","className","Utils","clsx","classes","undefined","id","concat","index","InputLabel","getText","Select","renderValue","noTranslation","onChange","target","map","i","ListSubheader","MenuItem","style","opacity","help","FormHelperText","renderHelp","helpLink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigSelect.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n InputLabel,\n FormHelperText,\n FormControl,\n Select,\n MenuItem,\n ListSubheader,\n} from '@mui/material';\n\nimport I18n from './wrapper/i18n';\nimport Utils from './wrapper/Components/Utils';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%',\n },\n noMargin: {\n '&>div': {\n marginTop: 0,\n },\n },\n});\n\nclass ConfigSelect extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n const selectOptions = [];\n\n (this.props.schema.options || []).forEach(item => {\n // if optgroup\n if (Array.isArray(item.items)) {\n selectOptions.push({ label: item.label, value: item.value, group: true });\n item.items = item.items.forEach(it => selectOptions.push(it));\n return;\n }\n\n selectOptions.push(item);\n });\n\n // if __different\n if (Array.isArray(value)) {\n this.initialValue = [...value];\n selectOptions.unshift({ label: I18n.t(ConfigGeneric.DIFFERENT_LABEL), value: ConfigGeneric.DIFFERENT_VALUE });\n this.setState({ value: ConfigGeneric.DIFFERENT_VALUE, selectOptions });\n } else {\n this.setState({ value, selectOptions });\n }\n }\n\n renderItem(error, disabled /* , defaultValue */) {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const selectOptions = (this.state.selectOptions || []).filter(item => {\n // if optgroup or no hidden function\n if (!item.hidden) {\n return true;\n }\n if (this.props.custom) {\n return !this.executeCustom(item.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);\n }\n return !this.execute(item.hidden, this.props.schema.default, this.props.data, this.props.arrayIndex, this.props.globalData);\n });\n\n // eslint-disable-next-line\n const item = selectOptions.find(it => it.value == this.state.value); // let \"==\" be and not ===\n\n return <FormControl\n variant=\"standard\"\n className={Utils.clsx(this.props.classes.fullWidth, this.props.arrayIndex !== undefined && this.props.classes.noMargin)}\n id={`jsonSelect_${this.props.schema.attr}_${this.props.index || this.props.index === 0 ? this.props.index : ''}`}\n >\n {this.props.schema.label ? <InputLabel>{this.getText(this.props.schema.label)}</InputLabel> : null}\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={this.state.value || '_'}\n renderValue={() => this.getText(item?.label, this.props.schema.noTranslation)}\n onChange={e => {\n this.setState({ value: e.target.value === '_' ? '' : e.target.value }, () => {\n if (this.state.value === ConfigGeneric.DIFFERENT_VALUE) {\n this.onChange(this.props.attr, this.initialValue);\n } else {\n this.onChange(this.props.attr, this.state.value);\n }\n });\n }}\n >\n {selectOptions.map((it, i) => {\n if (it.group) {\n return <ListSubheader key={i}>{this.getText(it.label, this.props.schema.noTranslation)}</ListSubheader>;\n }\n return <MenuItem key={i} value={it.value} style={it.value === ConfigGeneric.DIFFERENT_VALUE ? { opacity: 0.5 } : {}}>\n {this.getText(it.label, this.props.schema.noTranslation)}\n </MenuItem>;\n })}\n </Select>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigSelect.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)(ConfigSelect);\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;AASA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,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,S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IAAI;EACvBrB,QAAQ,EAAEc,qBAAS,CAACO;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAAC/F,MAAM,CAAC,CAACK,YAAY,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
socket: PropTypes.Validator<object>;
|
|
3
|
-
themeType: PropTypes.Requireable<string>;
|
|
4
|
-
themeName: PropTypes.Requireable<string>;
|
|
5
|
-
style: PropTypes.Requireable<object>;
|
|
6
|
-
adapterName: PropTypes.Requireable<string>;
|
|
7
|
-
alive: PropTypes.Requireable<boolean>;
|
|
8
|
-
instance: PropTypes.Requireable<number>;
|
|
9
|
-
className: PropTypes.Requireable<string>;
|
|
10
|
-
data: PropTypes.Validator<object>;
|
|
11
|
-
schema: PropTypes.Requireable<object>;
|
|
12
|
-
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
-
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "systemConfig" | "changed" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "menuPaper"> & object>;
|
|
15
|
-
export default _default;
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
17
|
-
import React from 'react';
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _styles = require("@mui/styles");
|
|
17
|
-
var _material = require("@mui/material");
|
|
18
|
-
var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
|
|
19
|
-
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
20
|
-
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); }; }
|
|
21
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
-
var styles = function styles() {
|
|
23
|
-
return {
|
|
24
|
-
fullWidth: {
|
|
25
|
-
width: '100%'
|
|
26
|
-
},
|
|
27
|
-
menuPaper: {
|
|
28
|
-
maxHeight: 800
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
to use this option, your adapter must implement listUart message
|
|
35
|
-
|
|
36
|
-
adapter.on('message', obj => {
|
|
37
|
-
if (obj) {
|
|
38
|
-
switch (obj.command) {
|
|
39
|
-
case 'command':
|
|
40
|
-
if (obj.callback) {
|
|
41
|
-
try {
|
|
42
|
-
const serialport = require('serialport');
|
|
43
|
-
if (serialport) {
|
|
44
|
-
// read all found serial ports
|
|
45
|
-
serialport.list()
|
|
46
|
-
.then(ports => {
|
|
47
|
-
adapter.log.info('List of port: ' + JSON.stringify(ports));
|
|
48
|
-
adapter.sendTo(obj.from, obj.command, ports.map(item =>
|
|
49
|
-
({label: item.path, value: item.path})), obj.callback);
|
|
50
|
-
})
|
|
51
|
-
.catch(e => {
|
|
52
|
-
adapter.sendTo(obj.from, obj.command, [], obj.callback);
|
|
53
|
-
adapter.log.error(e)
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
adapter.log.warn('Module serialport is not available');
|
|
57
|
-
adapter.sendTo(obj.from, obj.command, [{label: 'Not available', value: ''}], obj.callback);
|
|
58
|
-
}
|
|
59
|
-
} catch (e) {
|
|
60
|
-
adapter.sendTo(obj.from, obj.command, [{label: 'Not available', value: ''}], obj.callback);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
*/
|
|
69
|
-
var ConfigSelectSendTo = /*#__PURE__*/function (_ConfigGeneric) {
|
|
70
|
-
(0, _inherits2["default"])(ConfigSelectSendTo, _ConfigGeneric);
|
|
71
|
-
var _super = _createSuper(ConfigSelectSendTo);
|
|
72
|
-
function ConfigSelectSendTo() {
|
|
73
|
-
(0, _classCallCheck2["default"])(this, ConfigSelectSendTo);
|
|
74
|
-
return _super.apply(this, arguments);
|
|
75
|
-
}
|
|
76
|
-
(0, _createClass2["default"])(ConfigSelectSendTo, [{
|
|
77
|
-
key: "componentDidMount",
|
|
78
|
-
value: function componentDidMount() {
|
|
79
|
-
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSelectSendTo.prototype), "componentDidMount", this).call(this);
|
|
80
|
-
this.askInstance();
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
key: "askInstance",
|
|
84
|
-
value: function askInstance() {
|
|
85
|
-
var _this = this;
|
|
86
|
-
if (this.props.alive) {
|
|
87
|
-
var data = this.props.schema.data;
|
|
88
|
-
if (data === undefined && this.props.schema.jsonData) {
|
|
89
|
-
data = this.getPattern(this.props.schema.jsonData);
|
|
90
|
-
try {
|
|
91
|
-
data = JSON.parse(data);
|
|
92
|
-
} catch (e) {
|
|
93
|
-
console.error("Cannot parse json data: ".concat(data));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (data === undefined) {
|
|
97
|
-
data = null;
|
|
98
|
-
}
|
|
99
|
-
this.props.socket.sendTo("".concat(this.props.adapterName, ".").concat(this.props.instance), this.props.schema.command || 'send', data).then(function (list) {
|
|
100
|
-
return _this.setState({
|
|
101
|
-
list: list,
|
|
102
|
-
context: _this.getContext()
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
} else {
|
|
106
|
-
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
107
|
-
this.setState({
|
|
108
|
-
value: value
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
key: "getContext",
|
|
114
|
-
value: function getContext() {
|
|
115
|
-
var _this2 = this;
|
|
116
|
-
var context = {};
|
|
117
|
-
if (Array.isArray(this.props.schema.alsoDependsOn)) {
|
|
118
|
-
this.props.schema.alsoDependsOn.forEach(function (attr) {
|
|
119
|
-
return context[attr] = _ConfigGeneric2["default"].getValue(_this2.props.data, attr);
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return JSON.stringify(context);
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
|
-
key: "_getValue",
|
|
126
|
-
value: function _getValue() {
|
|
127
|
-
var value = this.state.value === null || this.state.value === undefined ? _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr) : this.state.value;
|
|
128
|
-
if (this.props.schema.multiple) {
|
|
129
|
-
if (typeof value === 'string') {
|
|
130
|
-
value = [value];
|
|
131
|
-
} else if (value === null || value === undefined) {
|
|
132
|
-
value = [];
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return value;
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "renderItem",
|
|
139
|
-
value: function renderItem(error, disabled /* , defaultValue */) {
|
|
140
|
-
var _this3 = this;
|
|
141
|
-
if (this.props.alive) {
|
|
142
|
-
var context = this.getContext();
|
|
143
|
-
if (context !== this.state.context) {
|
|
144
|
-
setTimeout(function () {
|
|
145
|
-
return _this3.askInstance();
|
|
146
|
-
}, 300);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
var value = this._getValue();
|
|
150
|
-
if (!this.props.alive) {
|
|
151
|
-
if (this.props.schema.multiple || this.props.schema.manual === false) {
|
|
152
|
-
return _i18n["default"].t('ra_Cannot retrieve options, as instance is offline');
|
|
153
|
-
}
|
|
154
|
-
return /*#__PURE__*/_react["default"].createElement(_material.TextField, {
|
|
155
|
-
variant: "standard",
|
|
156
|
-
fullWidth: true,
|
|
157
|
-
value: value,
|
|
158
|
-
error: !!error,
|
|
159
|
-
disabled: !!disabled,
|
|
160
|
-
onChange: function onChange(e) {
|
|
161
|
-
var value_ = e.target.value;
|
|
162
|
-
_this3.setState({
|
|
163
|
-
value: value_
|
|
164
|
-
}, function () {
|
|
165
|
-
return _this3.onChange(_this3.props.attr, (value_ || '').trim());
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
placeholder: this.getText(this.props.schema.placeholder),
|
|
169
|
-
label: this.getText(this.props.schema.label),
|
|
170
|
-
helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
if (!this.state.list) {
|
|
174
|
-
return /*#__PURE__*/_react["default"].createElement(_material.CircularProgress, {
|
|
175
|
-
size: "small"
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
var selectOptions = this.state.list.filter(function (item) {
|
|
179
|
-
if (!item.hidden) {
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
if (_this3.props.custom) {
|
|
183
|
-
return !_this3.executeCustom(item.hidden, _this3.props.schema["default"], _this3.props.data, _this3.props.instanceObj, _this3.props.arrayIndex, _this3.props.globalData);
|
|
184
|
-
}
|
|
185
|
-
return !_this3.execute(item.hidden, _this3.props.schema["default"], _this3.props.data, _this3.props.arrayIndex, _this3.props.globalData);
|
|
186
|
-
});
|
|
187
|
-
var item = selectOptions.find(function (it) {
|
|
188
|
-
return it.value === value;
|
|
189
|
-
});
|
|
190
|
-
return /*#__PURE__*/_react["default"].createElement(_material.FormControl, {
|
|
191
|
-
variant: "standard",
|
|
192
|
-
className: this.props.classes.fullWidth
|
|
193
|
-
}, this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_material.InputLabel, null, this.getText(this.props.schema.label)) : null, /*#__PURE__*/_react["default"].createElement(_material.Select, {
|
|
194
|
-
variant: "standard",
|
|
195
|
-
error: !!error,
|
|
196
|
-
multiple: this.props.schema.multiple,
|
|
197
|
-
disabled: !!disabled,
|
|
198
|
-
value: value,
|
|
199
|
-
MenuProps: this.props.schema.multiple ? {
|
|
200
|
-
classes: {
|
|
201
|
-
paper: this.props.classes.menuPaper
|
|
202
|
-
}
|
|
203
|
-
} : undefined,
|
|
204
|
-
renderValue: function renderValue(val) {
|
|
205
|
-
return _this3.props.schema.multiple ? /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
206
|
-
sx: {
|
|
207
|
-
display: 'flex',
|
|
208
|
-
flexWrap: 'wrap',
|
|
209
|
-
gap: 0.5
|
|
210
|
-
}
|
|
211
|
-
}, val.map(function (v) {
|
|
212
|
-
var it = selectOptions.find(function (_item) {
|
|
213
|
-
return _item.value === v;
|
|
214
|
-
});
|
|
215
|
-
if (it || _this3.props.schema.showAllValues !== false) {
|
|
216
|
-
var label = (it === null || it === void 0 ? void 0 : it.label) || v;
|
|
217
|
-
return /*#__PURE__*/_react["default"].createElement(_material.Chip, {
|
|
218
|
-
key: v,
|
|
219
|
-
label: label
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
return null;
|
|
223
|
-
})) : (item === null || item === void 0 ? void 0 : item.label) || val;
|
|
224
|
-
},
|
|
225
|
-
onChange: function onChange(e) {
|
|
226
|
-
_this3.onChange(_this3.props.attr, e.target.value);
|
|
227
|
-
}
|
|
228
|
-
}, selectOptions.map(function (it, i) {
|
|
229
|
-
return /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
230
|
-
key: i,
|
|
231
|
-
value: it.value
|
|
232
|
-
}, _this3.props.schema.multiple ? /*#__PURE__*/_react["default"].createElement(_material.Checkbox, {
|
|
233
|
-
checked: value.includes(it.value),
|
|
234
|
-
onClick: function onClick() {
|
|
235
|
-
var _value = JSON.parse(JSON.stringify(_this3._getValue()));
|
|
236
|
-
var pos = value.indexOf(it.value);
|
|
237
|
-
if (pos !== -1) {
|
|
238
|
-
_value.splice(pos, 1);
|
|
239
|
-
} else {
|
|
240
|
-
_value.push(it.value);
|
|
241
|
-
_value.sort();
|
|
242
|
-
}
|
|
243
|
-
_this3.setState({
|
|
244
|
-
value: _value
|
|
245
|
-
}, function () {
|
|
246
|
-
return _this3.onChange(_this3.props.attr, _value);
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
}) : null, /*#__PURE__*/_react["default"].createElement(_material.ListItemText, {
|
|
250
|
-
primary: it.label
|
|
251
|
-
}));
|
|
252
|
-
})), this.props.schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
253
|
-
}
|
|
254
|
-
}]);
|
|
255
|
-
return ConfigSelectSendTo;
|
|
256
|
-
}(_ConfigGeneric2["default"]);
|
|
257
|
-
ConfigSelectSendTo.propTypes = {
|
|
258
|
-
socket: _propTypes["default"].object.isRequired,
|
|
259
|
-
themeType: _propTypes["default"].string,
|
|
260
|
-
themeName: _propTypes["default"].string,
|
|
261
|
-
style: _propTypes["default"].object,
|
|
262
|
-
adapterName: _propTypes["default"].string,
|
|
263
|
-
alive: _propTypes["default"].bool,
|
|
264
|
-
instance: _propTypes["default"].number,
|
|
265
|
-
className: _propTypes["default"].string,
|
|
266
|
-
data: _propTypes["default"].object.isRequired,
|
|
267
|
-
schema: _propTypes["default"].object,
|
|
268
|
-
onError: _propTypes["default"].func,
|
|
269
|
-
onChange: _propTypes["default"].func
|
|
270
|
-
};
|
|
271
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigSelectSendTo);
|
|
272
|
-
//# sourceMappingURL=ConfigSelectSendTo.js.map
|