@iobroker/adapter-react-v5 3.1.34 → 3.2.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/404.js +0 -23
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +6 -37
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +10 -84
- package/Components/ComplexCron.js.map +1 -1
- package/Components/CustomModal.js +29 -54
- package/Components/CustomModal.js.map +1 -1
- package/Components/FileBrowser.js +15 -265
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +7 -68
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.d.ts +1 -1
- package/Components/Icon.js +2 -42
- package/Components/Icon.js.map +1 -1
- package/Components/IconPicker.js +6 -28
- package/Components/IconPicker.js.map +1 -1
- package/Components/IconSelector.js +3 -55
- package/Components/IconSelector.js.map +1 -1
- package/Components/Image.js +1 -38
- package/Components/Image.js.map +1 -1
- package/Components/JsonConfigComponent/ChipInput.js +66 -197
- package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -31
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +6 -39
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +6 -52
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +5 -39
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +4 -42
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -28
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigChip.js +4 -33
- package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigColor.js +0 -34
- package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -33
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +14 -73
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +0 -46
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +7 -126
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -34
- package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +15 -110
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +2 -35
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.js +4 -44
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +1 -59
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +7 -40
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +2 -42
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +2 -45
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +6 -40
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +7 -91
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -42
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -25
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -34
- package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -34
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +11 -67
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +8 -91
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -55
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -28
- package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -21
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -24
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -23
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -31
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +13 -105
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +2 -35
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +0 -34
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -37
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -29
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +2 -40
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +5 -81
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/Loader.js +2 -20
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +2 -20
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +2 -21
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +6 -39
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +3 -27
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.d.ts +1 -1
- package/Components/ObjectBrowser.js +181 -788
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +7 -31
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +2 -32
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/Schedule.js +29 -251
- package/Components/Schedule.js.map +1 -1
- package/Components/SelectWithIcon.d.ts +1 -1
- package/Components/SelectWithIcon.js +0 -48
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/cron2text.js +45 -91
- package/Components/SimpleCron/cron2text.js.map +1 -1
- package/Components/SimpleCron/cronText.js +0 -6
- package/Components/SimpleCron/cronText.js.map +1 -1
- package/Components/SimpleCron/index.js +19 -102
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/SimpleCron/jquery.cron.locale.js +44 -24
- package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
- package/Components/TabContainer.js +2 -23
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +2 -22
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +1 -17
- package/Components/TabHeader.js.map +1 -1
- package/Components/TableResize.js +6 -51
- package/Components/TableResize.js.map +1 -1
- package/Components/TextWithIcon.js +0 -20
- package/Components/TextWithIcon.js.map +1 -1
- package/Components/ToggleThemeMenu.js +5 -13
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/TreeTable.js +4 -121
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +17 -60
- package/Components/UploadImage.js.map +1 -1
- package/Components/Utils.js +87 -263
- package/Components/Utils.js.map +1 -1
- package/Components/copy-to-clipboard.js +16 -38
- package/Components/copy-to-clipboard.js.map +1 -1
- package/Components/withWidth.js +2 -10
- package/Components/withWidth.js.map +1 -1
- package/Connection.d.ts +1 -0
- package/Connection.js +156 -527
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js +0 -34
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.js +1 -39
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Cron.js +1 -37
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/Error.d.ts +1 -1
- package/Dialogs/Error.js +2 -29
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/FileSelect.js +2 -36
- package/Dialogs/FileSelect.js.map +1 -1
- package/Dialogs/Message.js +2 -27
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectID.d.ts +1 -1
- package/Dialogs/SelectID.js +3 -40
- package/Dialogs/SelectID.js.map +1 -1
- package/Dialogs/SimpleCron.js +1 -33
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +2 -34
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +55 -150
- package/GenericApp.js.map +1 -1
- package/Prompt.js +0 -2
- package/Prompt.js.map +1 -1
- package/README.md +11 -4
- package/Theme.js +7 -22
- package/Theme.js.map +1 -1
- package/i18n/uk.json +326 -0
- package/i18n.d.ts +2 -0
- package/i18n.js +9 -29
- package/i18n.js.map +1 -1
- package/icons/IconAdapter.d.ts +2 -2
- package/icons/IconAdapter.js +2 -6
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.d.ts +2 -2
- package/icons/IconAlias.js +2 -6
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.d.ts +2 -2
- package/icons/IconChannel.js +2 -6
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.d.ts +2 -2
- package/icons/IconClearFilter.js +0 -5
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.d.ts +2 -2
- package/icons/IconClosed.js +0 -5
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.d.ts +2 -2
- package/icons/IconCopy.js +0 -5
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.d.ts +2 -2
- package/icons/IconDevice.js +0 -5
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.d.ts +2 -2
- package/icons/IconDocument.js +0 -5
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconDocumentReadOnly.d.ts +2 -2
- package/icons/IconDocumentReadOnly.js +0 -5
- package/icons/IconDocumentReadOnly.js.map +1 -1
- package/icons/IconExpert.d.ts +2 -2
- package/icons/IconExpert.js +0 -5
- package/icons/IconExpert.js.map +1 -1
- package/icons/IconFx.d.ts +2 -2
- package/icons/IconFx.js +0 -5
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.d.ts +2 -2
- package/icons/IconInstance.js +0 -5
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.d.ts +2 -2
- package/icons/IconLogout.js +0 -5
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconNoIcon.d.ts +2 -2
- package/icons/IconNoIcon.js +0 -5
- package/icons/IconNoIcon.js.map +1 -1
- package/icons/IconOpen.d.ts +2 -2
- package/icons/IconOpen.js +0 -5
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.d.ts +2 -2
- package/icons/IconState.js +0 -6
- package/icons/IconState.js.map +1 -1
- package/package.json +15 -15
|
@@ -1,52 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
19
|
-
|
|
20
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
16
|
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
18
|
var _styles = require("@mui/styles");
|
|
31
|
-
|
|
32
19
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
33
|
-
|
|
34
20
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
35
|
-
|
|
36
21
|
var _FormHelperText = _interopRequireDefault(require("@mui/material/FormHelperText"));
|
|
37
|
-
|
|
38
22
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
39
|
-
|
|
40
23
|
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
41
|
-
|
|
42
24
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
43
|
-
|
|
44
25
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
45
|
-
|
|
46
26
|
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); }; }
|
|
47
|
-
|
|
48
27
|
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; } }
|
|
49
|
-
|
|
50
28
|
var styles = function styles(theme) {
|
|
51
29
|
return {
|
|
52
30
|
fullWidth: {
|
|
@@ -54,23 +32,18 @@ var styles = function styles(theme) {
|
|
|
54
32
|
}
|
|
55
33
|
};
|
|
56
34
|
};
|
|
57
|
-
|
|
58
35
|
var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
59
36
|
(0, _inherits2["default"])(ConfigCertificateSelect, _ConfigGeneric);
|
|
60
|
-
|
|
61
37
|
var _super = _createSuper(ConfigCertificateSelect);
|
|
62
|
-
|
|
63
38
|
function ConfigCertificateSelect() {
|
|
64
39
|
(0, _classCallCheck2["default"])(this, ConfigCertificateSelect);
|
|
65
40
|
return _super.apply(this, arguments);
|
|
66
41
|
}
|
|
67
|
-
|
|
68
42
|
(0, _createClass2["default"])(ConfigCertificateSelect, [{
|
|
69
43
|
key: "componentDidMount",
|
|
70
44
|
value: function () {
|
|
71
45
|
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
72
46
|
var _this = this;
|
|
73
|
-
|
|
74
47
|
var value, selectOptions;
|
|
75
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
76
49
|
while (1) {
|
|
@@ -80,12 +53,10 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
80
53
|
value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
81
54
|
_context.next = 4;
|
|
82
55
|
return this.props.socket.getCertificates();
|
|
83
|
-
|
|
84
56
|
case 4:
|
|
85
57
|
selectOptions = _context.sent;
|
|
86
58
|
selectOptions = selectOptions.filter(function (el) {
|
|
87
59
|
var name = _this.props.attr.toLowerCase();
|
|
88
|
-
|
|
89
60
|
if (name.includes(el.type)) {
|
|
90
61
|
return true;
|
|
91
62
|
} else if (el.type === 'public' && name.includes('cert')) {
|
|
@@ -95,7 +66,6 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
95
66
|
} else if (el.type === 'chained' && (name.includes('chain') || name.includes('ca'))) {
|
|
96
67
|
return true;
|
|
97
68
|
}
|
|
98
|
-
|
|
99
69
|
return false;
|
|
100
70
|
}).map(function (el) {
|
|
101
71
|
return {
|
|
@@ -111,7 +81,6 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
111
81
|
value: value,
|
|
112
82
|
selectOptions: selectOptions
|
|
113
83
|
});
|
|
114
|
-
|
|
115
84
|
case 8:
|
|
116
85
|
case "end":
|
|
117
86
|
return _context.stop();
|
|
@@ -119,25 +88,21 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
119
88
|
}
|
|
120
89
|
}, _callee, this);
|
|
121
90
|
}));
|
|
122
|
-
|
|
123
91
|
function componentDidMount() {
|
|
124
92
|
return _componentDidMount.apply(this, arguments);
|
|
125
93
|
}
|
|
126
|
-
|
|
127
94
|
return componentDidMount;
|
|
128
95
|
}()
|
|
129
96
|
}, {
|
|
130
97
|
key: "renderItem",
|
|
131
98
|
value: function renderItem(error, disabled, defaultValue) {
|
|
132
99
|
var _this$state$selectOpt,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
100
|
+
_this2 = this,
|
|
101
|
+
_this$state$selectOpt2;
|
|
136
102
|
if (!this.state.selectOptions) {
|
|
137
103
|
return null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
104
|
+
}
|
|
105
|
+
// eslint-disable-next-line
|
|
141
106
|
var item = (_this$state$selectOpt = this.state.selectOptions) === null || _this$state$selectOpt === void 0 ? void 0 : _this$state$selectOpt.find(function (item) {
|
|
142
107
|
return item.value === _this2.state.value;
|
|
143
108
|
});
|
|
@@ -175,7 +140,6 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
175
140
|
}]);
|
|
176
141
|
return ConfigCertificateSelect;
|
|
177
142
|
}(_ConfigGeneric2["default"]);
|
|
178
|
-
|
|
179
143
|
ConfigCertificateSelect.propTypes = {
|
|
180
144
|
socket: _propTypes["default"].object.isRequired,
|
|
181
145
|
themeType: _propTypes["default"].string,
|
|
@@ -187,8 +151,6 @@ ConfigCertificateSelect.propTypes = {
|
|
|
187
151
|
onError: _propTypes["default"].func,
|
|
188
152
|
onChange: _propTypes["default"].func
|
|
189
153
|
};
|
|
190
|
-
|
|
191
154
|
var _default = (0, _styles.withStyles)(styles)(ConfigCertificateSelect);
|
|
192
|
-
|
|
193
155
|
exports["default"] = _default;
|
|
194
156
|
//# sourceMappingURL=ConfigCertificateSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCertificateSelect.js","names":["styles","theme","fullWidth","width","ConfigCertificateSelect","value","ConfigGeneric","getValue","props","data","attr","socket","getCertificates","selectOptions","filter","el","name","toLowerCase","includes","type","map","label","unshift","I18n","t","NONE_LABEL","NONE_VALUE","setState","error","disabled","defaultValue","state","item","find","classes","getText","schema","val","noTranslation","e","target","onChange","opacity","help","renderHelp","helpLink","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCertificateSelect.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport Select from '@mui/material/Select';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigCertificateSelect extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let selectOptions = await this.props.socket.getCertificates();\n\n selectOptions = selectOptions\n .filter(el => {\n const name = this.props.attr.toLowerCase();\n\n if (name.includes(el.type)) {\n return true;\n } else if (el.type === 'public' && name.includes('cert')) {\n return true;\n } else if (el.type === 'private' && (name.includes('priv') || name.includes('key'))) {\n return true;\n } else if (el.type === 'chained' && (name.includes('chain') || name.includes('ca'))) {\n return true;\n }\n\n return false;\n })\n .map(el => ({label: el.name, value: el.name}));\n\n selectOptions.unshift({label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE});\n\n this.setState({value, selectOptions});\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n // eslint-disable-next-line\n const item = this.state.selectOptions?.find(item => item.value === this.state.value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () =>\n this.onChange(this.props.attr, this.state.value))}\n >\n {this.state.selectOptions?.map(item =>\n <MenuItem\n key={item.value}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}>{\n this.getText(item.label, this.props.schema.noTranslation !== false)\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\nConfigCertificateSelect.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)(ConfigCertificateSelect);"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigCertificateSelect.js","names":["styles","theme","fullWidth","width","ConfigCertificateSelect","value","ConfigGeneric","getValue","props","data","attr","socket","getCertificates","selectOptions","filter","el","name","toLowerCase","includes","type","map","label","unshift","I18n","t","NONE_LABEL","NONE_VALUE","setState","error","disabled","defaultValue","state","item","find","classes","getText","schema","val","noTranslation","e","target","onChange","opacity","help","renderHelp","helpLink","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCertificateSelect.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport Select from '@mui/material/Select';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigCertificateSelect extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let selectOptions = await this.props.socket.getCertificates();\n\n selectOptions = selectOptions\n .filter(el => {\n const name = this.props.attr.toLowerCase();\n\n if (name.includes(el.type)) {\n return true;\n } else if (el.type === 'public' && name.includes('cert')) {\n return true;\n } else if (el.type === 'private' && (name.includes('priv') || name.includes('key'))) {\n return true;\n } else if (el.type === 'chained' && (name.includes('chain') || name.includes('ca'))) {\n return true;\n }\n\n return false;\n })\n .map(el => ({label: el.name, value: el.name}));\n\n selectOptions.unshift({label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE});\n\n this.setState({value, selectOptions});\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n // eslint-disable-next-line\n const item = this.state.selectOptions?.find(item => item.value === this.state.value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () =>\n this.onChange(this.props.attr, this.state.value))}\n >\n {this.state.selectOptions?.map(item =>\n <MenuItem\n key={item.value}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}>{\n this.getText(item.label, this.props.schema.noTranslation !== false)\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\nConfigCertificateSelect.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)(ConfigCertificateSelect);"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAA8B;AAAA;AAE9B,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,uBAAuB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;MAAA,uGACzB;QAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACI;gBACMC,KAAK,GAAGC,0BAAa,CAACC,QAAQ,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI,EAAE,IAAI,CAACD,KAAK,CAACE,IAAI,CAAC;gBAAA;gBAAA,OAC5C,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,eAAe,EAAE;cAAA;gBAAzDC,aAAa;gBAEjBA,aAAa,GAAGA,aAAa,CACxBC,MAAM,CAAC,UAAAC,EAAE,EAAI;kBACV,IAAMC,IAAI,GAAG,KAAI,CAACR,KAAK,CAACE,IAAI,CAACO,WAAW,EAAE;kBAE1C,IAAID,IAAI,CAACE,QAAQ,CAACH,EAAE,CAACI,IAAI,CAAC,EAAE;oBACxB,OAAO,IAAI;kBACf,CAAC,MAAM,IAAIJ,EAAE,CAACI,IAAI,KAAK,QAAQ,IAAIH,IAAI,CAACE,QAAQ,CAAC,MAAM,CAAC,EAAE;oBACtD,OAAO,IAAI;kBACf,CAAC,MAAM,IAAIH,EAAE,CAACI,IAAI,KAAK,SAAS,KAAKH,IAAI,CAACE,QAAQ,CAAC,MAAM,CAAC,IAAIF,IAAI,CAACE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;oBACjF,OAAO,IAAI;kBACf,CAAC,MAAM,IAAIH,EAAE,C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gCAAC,0BAAc,QAAE,IAAI,CAACC,UAAU,CAAC,IAAI,CAACpC,KAAK,CAAC4B,MAAM,CAACO,IAAI,EAAE,IAAI,CAACnC,KAAK,CAAC4B,MAAM,CAACS,QAAQ,EAAE,IAAI,CAACrC,KAAK,CAAC4B,MAAM,CAACE,aAAa,CAAC,CAAkB,GAAG,IAAI,CAC9J;IAClB;EAAC;EAAA;AAAA,EA3DiChC,0BAAa;AA8DnDF,uBAAuB,CAAC0C,SAAS,GAAG;EAChCnC,MAAM,EAAEoC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC3BC,SAAS,EAAEL,qBAAS,CAACI,MAAM;EAC3BE,KAAK,EAAEN,qBAAS,CAACC,MAAM;EACvBM,SAAS,EAAEP,qBAAS,CAACI,MAAM;EAC3B1C,IAAI,EAAEsC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCb,MAAM,EAAEW,qBAAS,CAACC,MAAM;EACxBO,OAAO,EAAER,qBAAS,CAACS,IAAI;EACvBf,QAAQ,EAAEM,qBAAS,CAACS;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACzD,MAAM,CAAC,CAACI,uBAAuB,CAAC;AAAA"}
|
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
15
|
var _styles = require("@mui/styles");
|
|
25
|
-
|
|
26
16
|
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
27
|
-
|
|
28
17
|
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
29
|
-
|
|
30
18
|
var _FormHelperText = _interopRequireDefault(require("@mui/material/FormHelperText"));
|
|
31
|
-
|
|
32
19
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
33
|
-
|
|
34
20
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
35
|
-
|
|
36
21
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
37
|
-
|
|
38
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); }; }
|
|
39
|
-
|
|
40
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; } }
|
|
41
|
-
|
|
42
24
|
var styles = function styles(theme) {
|
|
43
25
|
return {
|
|
44
26
|
error: {
|
|
@@ -46,24 +28,18 @@ var styles = function styles(theme) {
|
|
|
46
28
|
}
|
|
47
29
|
};
|
|
48
30
|
};
|
|
49
|
-
|
|
50
31
|
var ConfigCheckbox = /*#__PURE__*/function (_ConfigGeneric) {
|
|
51
32
|
(0, _inherits2["default"])(ConfigCheckbox, _ConfigGeneric);
|
|
52
|
-
|
|
53
33
|
var _super = _createSuper(ConfigCheckbox);
|
|
54
|
-
|
|
55
34
|
function ConfigCheckbox() {
|
|
56
35
|
(0, _classCallCheck2["default"])(this, ConfigCheckbox);
|
|
57
36
|
return _super.apply(this, arguments);
|
|
58
37
|
}
|
|
59
|
-
|
|
60
38
|
(0, _createClass2["default"])(ConfigCheckbox, [{
|
|
61
39
|
key: "renderItem",
|
|
62
40
|
value: function renderItem(error, disabled) {
|
|
63
41
|
var _this = this;
|
|
64
|
-
|
|
65
42
|
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
66
|
-
|
|
67
43
|
var isIndeterminate = Array.isArray(value);
|
|
68
44
|
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
69
45
|
className: this.props.classes.fullWidth,
|
|
@@ -72,7 +48,6 @@ var ConfigCheckbox = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
72
48
|
onClick: function onClick(e) {
|
|
73
49
|
e.preventDefault();
|
|
74
50
|
e.stopPropagation();
|
|
75
|
-
|
|
76
51
|
_this.onChange(_this.props.attr, !value);
|
|
77
52
|
},
|
|
78
53
|
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
@@ -95,7 +70,6 @@ var ConfigCheckbox = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
95
70
|
}]);
|
|
96
71
|
return ConfigCheckbox;
|
|
97
72
|
}(_ConfigGeneric2["default"]);
|
|
98
|
-
|
|
99
73
|
ConfigCheckbox.propTypes = {
|
|
100
74
|
socket: _propTypes["default"].object.isRequired,
|
|
101
75
|
themeType: _propTypes["default"].string,
|
|
@@ -107,8 +81,6 @@ ConfigCheckbox.propTypes = {
|
|
|
107
81
|
onError: _propTypes["default"].func,
|
|
108
82
|
onChange: _propTypes["default"].func
|
|
109
83
|
};
|
|
110
|
-
|
|
111
84
|
var _default = (0, _styles.withStyles)(styles)(ConfigCheckbox);
|
|
112
|
-
|
|
113
85
|
exports["default"] = _default;
|
|
114
86
|
//# sourceMappingURL=ConfigCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCheckbox.js","names":["styles","theme","error","color","ConfigCheckbox","disabled","value","ConfigGeneric","getValue","props","data","attr","isIndeterminate","Array","isArray","classes","fullWidth","e","preventDefault","stopPropagation","onChange","target","checked","getText","schema","label","validatorErrorText","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCheckbox.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n error: {\n color: 'red'\n }\n});\n\nclass ConfigCheckbox extends ConfigGeneric {\n renderItem(error, disabled) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let isIndeterminate = Array.isArray(value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <FormControlLabel\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n this.onChange(this.props.attr, !value);\n }}\n control={<Checkbox\n indeterminate={isIndeterminate}\n checked={!!value}\n onChange={e => {\n if (isIndeterminate) {\n this.onChange(this.props.attr, true);\n } else {\n this.onChange(this.props.attr, e.target.checked);\n }\n }}\n disabled={!!disabled}\n />}\n label={this.getText(this.props.schema.label)}\n />\n <FormHelperText className={this.props.classes.error}>{\n error ? (this.props.schema.validatorErrorText ? I18n.t(this.props.schema.validatorErrorText) : I18n.t('ra_Error')) :\n null}</FormHelperText>\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\nConfigCheckbox.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)(ConfigCheckbox);"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigCheckbox.js","names":["styles","theme","error","color","ConfigCheckbox","disabled","value","ConfigGeneric","getValue","props","data","attr","isIndeterminate","Array","isArray","classes","fullWidth","e","preventDefault","stopPropagation","onChange","target","checked","getText","schema","label","validatorErrorText","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCheckbox.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n error: {\n color: 'red'\n }\n});\n\nclass ConfigCheckbox extends ConfigGeneric {\n renderItem(error, disabled) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let isIndeterminate = Array.isArray(value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <FormControlLabel\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n this.onChange(this.props.attr, !value);\n }}\n control={<Checkbox\n indeterminate={isIndeterminate}\n checked={!!value}\n onChange={e => {\n if (isIndeterminate) {\n this.onChange(this.props.attr, true);\n } else {\n this.onChange(this.props.attr, e.target.checked);\n }\n }}\n disabled={!!disabled}\n />}\n label={this.getText(this.props.schema.label)}\n />\n <FormHelperText className={this.props.classes.error}>{\n error ? (this.props.schema.validatorErrorText ? I18n.t(this.props.schema.validatorErrorText) : I18n.t('ra_Error')) :\n null}</FormHelperText>\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\nConfigCheckbox.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)(ConfigCheckbox);"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAA8B;AAAA;AAE9B,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,KAAK,EAAE;MACHC,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,cAAc;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAChB,oBAAWF,KAAK,EAAEG,QAAQ,EAAE;MAAA;MACxB,IAAMC,KAAK,GAAGC,0BAAa,CAACC,QAAQ,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI,EAAE,IAAI,CAACD,KAAK,CAACE,IAAI,CAAC;MACtE,IAAIC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACR,KAAK,CAAC;MAE1C,oBAAO,gCAAC,uBAAW;QAAC,SAAS,EAAE,IAAI,CAACG,KAAK,CAACM,OAAO,CAACC,SAAU;QAAC,OAAO,EAAC;MAAU,gBAC3E,gCAAC,4BAAgB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K,CAACe,MAAM,CAACQ,aAAa,CAAC,CAAkB,GAAG,IAAI,CAC1J;IAClB;EAAC;EAAA;AAAA,EA/BwBzB,0BAAa;AAkC1CH,cAAc,CAAC6B,SAAS,GAAG;EACvBC,MAAM,EAAEC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC3BC,SAAS,EAAEL,qBAAS,CAACI,MAAM;EAC3BE,KAAK,EAAEN,qBAAS,CAACC,MAAM;EACvBM,SAAS,EAAEP,qBAAS,CAACI,MAAM;EAC3B7B,IAAI,EAAEyB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCb,MAAM,EAAEW,qBAAS,CAACC,MAAM;EACxBO,OAAO,EAAER,qBAAS,CAACS,IAAI;EACvBxB,QAAQ,EAAEe,qBAAS,CAACS;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAAC7C,MAAM,CAAC,CAACI,cAAc,CAAC;AAAA"}
|
|
@@ -1,42 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
-
|
|
16
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
14
|
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
16
|
var _styles = require("@mui/styles");
|
|
27
|
-
|
|
28
17
|
var _FormHelperText = _interopRequireDefault(require("@mui/material/FormHelperText"));
|
|
29
|
-
|
|
30
18
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
31
|
-
|
|
32
19
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
33
|
-
|
|
34
20
|
var _ChipInput = _interopRequireDefault(require("./ChipInput"));
|
|
35
|
-
|
|
36
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); }; }
|
|
37
|
-
|
|
38
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; } }
|
|
39
|
-
|
|
40
23
|
var styles = function styles(theme) {
|
|
41
24
|
return {
|
|
42
25
|
fullWidth: {
|
|
@@ -44,27 +27,21 @@ var styles = function styles(theme) {
|
|
|
44
27
|
}
|
|
45
28
|
};
|
|
46
29
|
};
|
|
47
|
-
|
|
48
30
|
var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
49
31
|
(0, _inherits2["default"])(ConfigLanguage, _ConfigGeneric);
|
|
50
|
-
|
|
51
32
|
var _super = _createSuper(ConfigLanguage);
|
|
52
|
-
|
|
53
33
|
function ConfigLanguage() {
|
|
54
34
|
(0, _classCallCheck2["default"])(this, ConfigLanguage);
|
|
55
35
|
return _super.apply(this, arguments);
|
|
56
36
|
}
|
|
57
|
-
|
|
58
37
|
(0, _createClass2["default"])(ConfigLanguage, [{
|
|
59
38
|
key: "componentDidMount",
|
|
60
39
|
value: function componentDidMount() {
|
|
61
40
|
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigLanguage.prototype), "componentDidMount", this).call(this);
|
|
62
41
|
var _this$props = this.props,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
data = _this$props.data,
|
|
43
|
+
attr = _this$props.attr;
|
|
66
44
|
var value = _ConfigGeneric2["default"].getValue(data, attr);
|
|
67
|
-
|
|
68
45
|
if (this.props.schema.delimiter && typeof value === 'string') {
|
|
69
46
|
var parts = value.split(this.props.schema.delimiter).map(function (a) {
|
|
70
47
|
return a.trim();
|
|
@@ -84,10 +61,9 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
84
61
|
key: "renderItem",
|
|
85
62
|
value: function renderItem(error, disabled, defaultValue) {
|
|
86
63
|
var _this = this;
|
|
87
|
-
|
|
88
64
|
var _this$props2 = this.props,
|
|
89
|
-
|
|
90
|
-
|
|
65
|
+
attr = _this$props2.attr,
|
|
66
|
+
schema = _this$props2.schema;
|
|
91
67
|
var value = this.state.value;
|
|
92
68
|
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
93
69
|
className: this.props.classes.fullWidth,
|
|
@@ -100,7 +76,6 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
100
76
|
onAdd: function onAdd(chip) {
|
|
101
77
|
var newValue = JSON.parse(JSON.stringify(value));
|
|
102
78
|
newValue.push(chip);
|
|
103
|
-
|
|
104
79
|
_this.setState({
|
|
105
80
|
value: newValue,
|
|
106
81
|
prevValue: ''
|
|
@@ -115,7 +90,6 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
115
90
|
onDelete: function onDelete(chip, index) {
|
|
116
91
|
var newValue = JSON.parse(JSON.stringify(value));
|
|
117
92
|
newValue.splice(index, 1);
|
|
118
|
-
|
|
119
93
|
_this.setState({
|
|
120
94
|
value: newValue,
|
|
121
95
|
prevValue: ''
|
|
@@ -132,7 +106,6 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
132
106
|
}]);
|
|
133
107
|
return ConfigLanguage;
|
|
134
108
|
}(_ConfigGeneric2["default"]);
|
|
135
|
-
|
|
136
109
|
ConfigLanguage.propTypes = {
|
|
137
110
|
socket: _propTypes["default"].object.isRequired,
|
|
138
111
|
themeType: _propTypes["default"].string,
|
|
@@ -144,8 +117,6 @@ ConfigLanguage.propTypes = {
|
|
|
144
117
|
onError: _propTypes["default"].func,
|
|
145
118
|
onChange: _propTypes["default"].func
|
|
146
119
|
};
|
|
147
|
-
|
|
148
120
|
var _default = (0, _styles.withStyles)(styles)(ConfigLanguage);
|
|
149
|
-
|
|
150
121
|
exports["default"] = _default;
|
|
151
122
|
//# sourceMappingURL=ConfigChip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigChip.js","names":["styles","theme","fullWidth","width","ConfigLanguage","props","data","attr","value","ConfigGeneric","getValue","schema","delimiter","parts","split","map","a","trim","filter","setState","error","disabled","defaultValue","state","classes","getText","label","chip","newValue","JSON","parse","stringify","push","prevValue","onChange","join","index","splice","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigChip.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ChipInput from './ChipInput';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigLanguage extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr);\n if (this.props.schema.delimiter && typeof value === 'string') {\n const parts = value.split(this.props.schema.delimiter).map(a => a.trim()).filter(a => a);\n this.setState({ value: parts });\n } else {\n this.setState({ value: value || [] });\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n const { attr,schema } = this.props;\n const { value } = this.state;\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <ChipInput\n value={value}\n disabled={!!disabled}\n label={this.getText(schema.label)}\n error={!!error}\n onAdd={chip => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.push(chip);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n onDelete={(chip, index) => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.splice(index, 1);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n />\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\nConfigLanguage.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)(ConfigLanguage);"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigChip.js","names":["styles","theme","fullWidth","width","ConfigLanguage","props","data","attr","value","ConfigGeneric","getValue","schema","delimiter","parts","split","map","a","trim","filter","setState","error","disabled","defaultValue","state","classes","getText","label","chip","newValue","JSON","parse","stringify","push","prevValue","onChange","join","index","splice","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigChip.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ChipInput from './ChipInput';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigLanguage extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr);\n if (this.props.schema.delimiter && typeof value === 'string') {\n const parts = value.split(this.props.schema.delimiter).map(a => a.trim()).filter(a => a);\n this.setState({ value: parts });\n } else {\n this.setState({ value: value || [] });\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n const { attr,schema } = this.props;\n const { value } = this.state;\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <ChipInput\n value={value}\n disabled={!!disabled}\n label={this.getText(schema.label)}\n error={!!error}\n onAdd={chip => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.push(chip);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n onDelete={(chip, index) => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.splice(index, 1);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n />\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\nConfigLanguage.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)(ConfigLanguage);"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAAoC;AAAA;AAEpC,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,cAAc;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAChB,6BAAoB;MAChB;MACA,kBAAuB,IAAI,CAACC,KAAK;QAAzBC,IAAI,eAAJA,IAAI;QAAEC,IAAI,eAAJA,IAAI;MAClB,IAAMC,KAAK,GAAGC,0BAAa,CAACC,QAAQ,CAACJ,IAAI,EAAEC,IAAI,CAAC;MAChD,IAAI,IAAI,CAACF,KAAK,CAACM,MAAM,CAACC,SAAS,IAAI,OAAOJ,KAAK,KAAK,QAAQ,EAAE;QAC1D,IAAMK,KAAK,GAAGL,KAAK,CAACM,KAAK,CAAC,IAAI,CAACT,KAAK,CAACM,MAAM,CAACC,SAAS,CAAC,CAACG,GAAG,CAAC,UAAAC,CAAC;UAAA,OAAIA,CAAC,CAACC,IAAI,EAAE;QAAA,EAAC,CAACC,MAAM,CAAC,UAAAF,CAAC;UAAA,OAAIA,CAAC;QAAA,EAAC;QACxF,IAAI,CAACG,QAAQ,CAAC;UAAEX,KAAK,EAAEK;QAAM,CAAC,CAAC;MACnC,CAAC,MAAM;QACH,IAAI,CAACM,QAAQ,CAAC;UAAEX,KAAK,EAAEA,KAAK,IAAI;QAAG,CAAC,CAAC;MACzC;IACJ;EAAC;IAAA;IAAA,OA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EU,qBAAS,CAACS;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACtD,MAAM,CAAC,CAACI,cAAc,CAAC;AAAA"}
|
|
@@ -1,67 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
15
|
var _styles = require("@mui/styles");
|
|
25
|
-
|
|
26
16
|
var _reactColor = require("react-color");
|
|
27
|
-
|
|
28
17
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
29
|
-
|
|
30
18
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
31
|
-
|
|
32
19
|
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
33
|
-
|
|
34
20
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
35
|
-
|
|
36
21
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
37
|
-
|
|
38
22
|
var _ColorPicker = _interopRequireDefault(require("../ColorPicker"));
|
|
39
|
-
|
|
40
23
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
41
|
-
|
|
42
24
|
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); }; }
|
|
43
|
-
|
|
44
25
|
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; } }
|
|
45
|
-
|
|
46
26
|
var styles = function styles(theme) {
|
|
47
27
|
return {};
|
|
48
28
|
};
|
|
49
|
-
|
|
50
29
|
var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
51
30
|
(0, _inherits2["default"])(ConfigColor, _ConfigGeneric);
|
|
52
|
-
|
|
53
31
|
var _super = _createSuper(ConfigColor);
|
|
54
|
-
|
|
55
32
|
function ConfigColor() {
|
|
56
33
|
(0, _classCallCheck2["default"])(this, ConfigColor);
|
|
57
34
|
return _super.apply(this, arguments);
|
|
58
35
|
}
|
|
59
|
-
|
|
60
36
|
(0, _createClass2["default"])(ConfigColor, [{
|
|
61
37
|
key: "renderColorDialog",
|
|
62
38
|
value: function renderColorDialog() {
|
|
63
39
|
var _this = this;
|
|
64
|
-
|
|
65
40
|
return !!this.state.showColorDialog && /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
66
41
|
onClose: function onClose() {
|
|
67
42
|
return _this.setState({
|
|
@@ -84,15 +59,11 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
84
59
|
key: "renderItem",
|
|
85
60
|
value: function renderItem(error, disabled, defaultValue) {
|
|
86
61
|
var _this2 = this;
|
|
87
|
-
|
|
88
62
|
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
89
|
-
|
|
90
63
|
var textColor = _Utils["default"].isUseBright(value, null);
|
|
91
|
-
|
|
92
64
|
if (textColor === null) {
|
|
93
65
|
textColor = undefined;
|
|
94
66
|
}
|
|
95
|
-
|
|
96
67
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderColorDialog(), /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
97
68
|
variant: "standard",
|
|
98
69
|
disabled: !!disabled,
|
|
@@ -110,7 +81,6 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
110
81
|
},
|
|
111
82
|
onChange: function onChange(e) {
|
|
112
83
|
var color = e.target.value;
|
|
113
|
-
|
|
114
84
|
_this2.onChange(_this2.props.attr, color);
|
|
115
85
|
},
|
|
116
86
|
inputProps: {
|
|
@@ -126,7 +96,6 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
126
96
|
size: "small",
|
|
127
97
|
onClick: function onClick(e) {
|
|
128
98
|
e.stopPropagation();
|
|
129
|
-
|
|
130
99
|
_this2.onChange(_this2.props.attr, '');
|
|
131
100
|
}
|
|
132
101
|
}, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)) : undefined
|
|
@@ -139,7 +108,6 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
139
108
|
}]);
|
|
140
109
|
return ConfigColor;
|
|
141
110
|
}(_ConfigGeneric2["default"]);
|
|
142
|
-
|
|
143
111
|
ConfigColor.propTypes = {
|
|
144
112
|
socket: _propTypes["default"].object.isRequired,
|
|
145
113
|
themeType: _propTypes["default"].string,
|
|
@@ -151,8 +119,6 @@ ConfigColor.propTypes = {
|
|
|
151
119
|
onError: _propTypes["default"].func,
|
|
152
120
|
onChange: _propTypes["default"].func
|
|
153
121
|
};
|
|
154
|
-
|
|
155
122
|
var _default = (0, _styles.withStyles)(styles)(ConfigColor);
|
|
156
|
-
|
|
157
123
|
exports["default"] = _default;
|
|
158
124
|
//# sourceMappingURL=ConfigColor.js.map
|