@iobroker/adapter-react-v5 3.1.24 → 3.1.27

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.
Files changed (132) hide show
  1. package/Components/404.d.ts +3 -0
  2. package/Components/ColorPicker.d.ts +138 -0
  3. package/Components/ComplexCron.d.ts +8 -0
  4. package/Components/CustomModal.d.ts +3 -0
  5. package/Components/FileBrowser.d.ts +125 -0
  6. package/Components/FileViewer.d.ts +80 -0
  7. package/Components/FileViewer.js +10 -9
  8. package/Components/FileViewer.js.map +1 -1
  9. package/Components/Icon.d.ts +21 -0
  10. package/Components/IconPicker.d.ts +64 -0
  11. package/Components/IconSelector.d.ts +25 -0
  12. package/Components/Image.d.ts +64 -0
  13. package/Components/JsonConfigComponent/ChipInput.d.ts +13 -0
  14. package/Components/JsonConfigComponent/ConfigAlive.d.ts +10 -0
  15. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +14 -0
  16. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +14 -0
  17. package/Components/JsonConfigComponent/ConfigCRON.d.ts +15 -0
  18. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
  19. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +14 -0
  20. package/Components/JsonConfigComponent/ConfigChip.d.ts +14 -0
  21. package/Components/JsonConfigComponent/ConfigColor.d.ts +14 -0
  22. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
  23. package/Components/JsonConfigComponent/ConfigCustom.d.ts +26 -0
  24. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
  25. package/Components/JsonConfigComponent/ConfigFile.d.ts +15 -0
  26. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
  27. package/Components/JsonConfigComponent/ConfigFunc.d.ts +14 -0
  28. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +71 -0
  29. package/Components/JsonConfigComponent/ConfigIP.d.ts +14 -0
  30. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
  31. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
  32. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +14 -0
  33. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +14 -0
  34. package/Components/JsonConfigComponent/ConfigNumber.d.ts +3 -0
  35. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
  36. package/Components/JsonConfigComponent/ConfigPanel.d.ts +3 -0
  37. package/Components/JsonConfigComponent/ConfigPassword.d.ts +14 -0
  38. package/Components/JsonConfigComponent/ConfigPattern.d.ts +14 -0
  39. package/Components/JsonConfigComponent/ConfigRoom.d.ts +14 -0
  40. package/Components/JsonConfigComponent/ConfigSelect.d.ts +14 -0
  41. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
  42. package/Components/JsonConfigComponent/ConfigSendto.d.ts +18 -0
  43. package/Components/JsonConfigComponent/ConfigSendto.js +171 -9
  44. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  45. package/Components/JsonConfigComponent/ConfigSetState.d.ts +18 -0
  46. package/Components/JsonConfigComponent/ConfigSlider.d.ts +14 -0
  47. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
  48. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
  49. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
  50. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
  51. package/Components/JsonConfigComponent/ConfigTable.d.ts +3 -0
  52. package/Components/JsonConfigComponent/ConfigTabs.d.ts +33 -0
  53. package/Components/JsonConfigComponent/ConfigText.d.ts +14 -0
  54. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
  55. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
  56. package/Components/JsonConfigComponent/ConfigTopic.d.ts +17 -0
  57. package/Components/JsonConfigComponent/ConfigUser.d.ts +14 -0
  58. package/Components/JsonConfigComponent/index.d.ts +27 -0
  59. package/Components/JsonConfigComponent/index.js +21 -17
  60. package/Components/JsonConfigComponent/index.js.map +1 -1
  61. package/Components/Loader.d.ts +37 -0
  62. package/Components/Loaders/PT.d.ts +41 -0
  63. package/Components/Loaders/Vendor.d.ts +41 -0
  64. package/Components/Logo.d.ts +59 -0
  65. package/Components/MDUtils.d.ts +12 -0
  66. package/Components/ObjectBrowser.d.ts +632 -0
  67. package/Components/Router.d.ts +35 -0
  68. package/Components/SaveCloseButtons.d.ts +64 -0
  69. package/Components/Schedule.d.ts +7 -0
  70. package/Components/SelectWithIcon.d.ts +21 -0
  71. package/Components/SimpleCron/cron2text.d.ts +8 -0
  72. package/Components/SimpleCron/cronText.d.ts +2 -0
  73. package/Components/SimpleCron/index.d.ts +8 -0
  74. package/Components/SimpleCron/jquery.cron.locale.d.ts +2 -0
  75. package/Components/TabContainer.d.ts +42 -0
  76. package/Components/TabContent.d.ts +32 -0
  77. package/Components/TabHeader.d.ts +13 -0
  78. package/Components/TableResize.d.ts +14 -0
  79. package/Components/TextWithIcon.d.ts +3 -0
  80. package/Components/ToggleThemeMenu.d.ts +8 -0
  81. package/Components/TreeTable.d.ts +3 -0
  82. package/Components/UploadImage.d.ts +2 -0
  83. package/Components/Utils.d.ts +334 -0
  84. package/Components/copy-to-clipboard.d.ts +2 -0
  85. package/Components/withWidth.d.ts +2 -0
  86. package/Connection.d.ts +761 -0
  87. package/Connection.js +9 -1
  88. package/Connection.js.map +1 -1
  89. package/Dialogs/ComplexCron.d.ts +15 -0
  90. package/Dialogs/Confirm.d.ts +48 -0
  91. package/Dialogs/Cron.d.ts +15 -0
  92. package/Dialogs/Error.d.ts +49 -0
  93. package/Dialogs/FileSelect.d.ts +148 -0
  94. package/Dialogs/Message.d.ts +39 -0
  95. package/Dialogs/SelectID.d.ts +161 -0
  96. package/Dialogs/SimpleCron.d.ts +14 -0
  97. package/Dialogs/TextInput.d.ts +87 -0
  98. package/GenericApp.d.ts +213 -0
  99. package/Prompt.d.ts +5 -0
  100. package/README.md +7 -0
  101. package/Theme.d.ts +7 -0
  102. package/assets/devices/parseNames.d.ts +1 -0
  103. package/assets/rooms/parseNames.d.ts +1 -0
  104. package/i18n/de.json +4 -1
  105. package/i18n/en.json +4 -1
  106. package/i18n/es.json +4 -1
  107. package/i18n/fr.json +4 -1
  108. package/i18n/it.json +4 -1
  109. package/i18n/nl.json +4 -1
  110. package/i18n/pl.json +4 -1
  111. package/i18n/pt.json +4 -1
  112. package/i18n/ru.json +4 -1
  113. package/i18n/zh-cn.json +4 -1
  114. package/i18n.d.ts +92 -0
  115. package/icons/IconAdapter.d.ts +11 -0
  116. package/icons/IconAlias.d.ts +11 -0
  117. package/icons/IconChannel.d.ts +11 -0
  118. package/icons/IconClearFilter.d.ts +11 -0
  119. package/icons/IconClosed.d.ts +11 -0
  120. package/icons/IconCopy.d.ts +38 -0
  121. package/icons/IconDevice.d.ts +11 -0
  122. package/icons/IconDocument.d.ts +11 -0
  123. package/icons/IconDocumentReadOnly.d.ts +11 -0
  124. package/icons/IconExpert.d.ts +38 -0
  125. package/icons/IconFx.d.ts +11 -0
  126. package/icons/IconInstance.d.ts +11 -0
  127. package/icons/IconLogout.d.ts +38 -0
  128. package/icons/IconNoIcon.d.ts +38 -0
  129. package/icons/IconOpen.d.ts +11 -0
  130. package/icons/IconState.d.ts +11 -0
  131. package/index.d.ts +113 -0
  132. package/package.json +8 -8
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
10
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
13
 
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
16
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
17
+
12
18
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
19
 
14
20
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -47,6 +53,10 @@ var _Error2 = _interopRequireDefault(require("@mui/icons-material/Error"));
47
53
 
48
54
  var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
49
55
 
56
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
57
+
58
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
59
+
50
60
  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); }; }
51
61
 
52
62
  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; } }
@@ -64,6 +74,82 @@ var styles = function styles(theme) {
64
74
  };
65
75
  };
66
76
 
77
+ function ip2int(ip) {
78
+ return ip.split('.').reduce(function (ipInt, octet) {
79
+ return (ipInt << 8) + parseInt(octet, 10);
80
+ }, 0) >>> 0;
81
+ } // copied from iobroker.admin/src-rx/src/Utils.js
82
+
83
+
84
+ function findNetworkAddressOfHost(obj, localIp) {
85
+ var _obj$native, _obj$native$hardware;
86
+
87
+ var networkInterfaces = obj === null || obj === void 0 ? void 0 : (_obj$native = obj["native"]) === null || _obj$native === void 0 ? void 0 : (_obj$native$hardware = _obj$native.hardware) === null || _obj$native$hardware === void 0 ? void 0 : _obj$native$hardware.networkInterfaces;
88
+
89
+ if (!networkInterfaces) {
90
+ return null;
91
+ }
92
+
93
+ var hostIp;
94
+ Object.keys(networkInterfaces).forEach(function (inter) {
95
+ return networkInterfaces[inter].forEach(function (ip) {
96
+ if (ip.internal) {
97
+ return;
98
+ } else if (localIp.includes(':') && ip.family !== 'IPv6') {
99
+ return;
100
+ } else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
101
+ return;
102
+ }
103
+
104
+ if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
105
+ // if DNS name
106
+ hostIp = ip.address;
107
+ } else {
108
+ if (ip.family === 'IPv4' && localIp.includes('.') && (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))) {
109
+ hostIp = ip.address;
110
+ } else {
111
+ hostIp = ip.address;
112
+ }
113
+ }
114
+ });
115
+ });
116
+
117
+ if (!hostIp) {
118
+ Object.keys(networkInterfaces).forEach(function (inter) {
119
+ networkInterfaces[inter].forEach(function (ip) {
120
+ if (ip.internal) {
121
+ return;
122
+ } else if (localIp.includes(':') && ip.family !== 'IPv6') {
123
+ return;
124
+ } else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
125
+ return;
126
+ }
127
+
128
+ if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
129
+ // if DNS name
130
+ hostIp = ip.address;
131
+ } else {
132
+ hostIp = ip.address;
133
+ }
134
+ });
135
+ });
136
+ }
137
+
138
+ if (!hostIp) {
139
+ Object.keys(networkInterfaces).forEach(function (inter) {
140
+ networkInterfaces[inter].forEach(function (ip) {
141
+ if (ip.internal) {
142
+ return;
143
+ }
144
+
145
+ hostIp = ip.address;
146
+ });
147
+ });
148
+ }
149
+
150
+ return hostIp;
151
+ }
152
+
67
153
  var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
68
154
  (0, _inherits2["default"])(ConfigSendto, _ConfigGeneric);
69
155
 
@@ -76,13 +162,72 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
76
162
 
77
163
  (0, _createClass2["default"])(ConfigSendto, [{
78
164
  key: "componentDidMount",
79
- value: function componentDidMount() {
80
- (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSendto.prototype), "componentDidMount", this).call(this);
81
- this.setState({
82
- _error: '',
83
- _message: ''
84
- });
85
- }
165
+ value: function () {
166
+ var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
167
+ var hostname, adminInstance, instanceObj, hostObj, ip;
168
+ return _regenerator["default"].wrap(function _callee$(_context) {
169
+ while (1) {
170
+ switch (_context.prev = _context.next) {
171
+ case 0:
172
+ (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSendto.prototype), "componentDidMount", this).call(this);
173
+ hostname = window.location.hostname;
174
+
175
+ if (!this.props.schema.openUrl) {
176
+ _context.next = 19;
177
+ break;
178
+ }
179
+
180
+ _context.next = 5;
181
+ return this.props.socket.getCurrentInstance();
182
+
183
+ case 5:
184
+ adminInstance = _context.sent;
185
+ _context.next = 8;
186
+ return this.props.socket.getObject("system.adapter.".concat(adminInstance));
187
+
188
+ case 8:
189
+ instanceObj = _context.sent;
190
+ _context.next = 11;
191
+ return this.props.socket.getObject("system.host.".concat(instanceObj.common.host));
192
+
193
+ case 11:
194
+ hostObj = _context.sent;
195
+ ip = findNetworkAddressOfHost(hostObj, window.location.hostname);
196
+
197
+ if (!ip) {
198
+ _context.next = 17;
199
+ break;
200
+ }
201
+
202
+ hostname = ip + ':' + window.location.port;
203
+ _context.next = 19;
204
+ break;
205
+
206
+ case 17:
207
+ console.warn("Cannot find suitable IP in host ".concat(instanceObj.common.host, " for ").concat(instanceObj._id));
208
+ return _context.abrupt("return", null);
209
+
210
+ case 19:
211
+ this.setState({
212
+ _error: '',
213
+ _message: '',
214
+ hostname: hostname
215
+ });
216
+
217
+ case 20:
218
+ case "end":
219
+ return _context.stop();
220
+ }
221
+ }
222
+ }, _callee, this);
223
+ }));
224
+
225
+ function componentDidMount() {
226
+ return _componentDidMount.apply(this, arguments);
227
+ }
228
+
229
+ return componentDidMount;
230
+ }()
86
231
  }, {
87
232
  key: "renderErrorDialog",
88
233
  value: function renderErrorDialog() {
@@ -127,10 +272,15 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
127
272
  var _this3 = this;
128
273
 
129
274
  this.props.onCommandRunning(true);
275
+
276
+ var _origin = "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''));
277
+
130
278
  var data = this.props.schema.data;
131
279
 
132
280
  if (data === undefined && this.props.schema.jsonData) {
133
- data = this.getPattern(this.props.schema.jsonData, {}, this.props.data);
281
+ data = this.getPattern(this.props.schema.jsonData, {}, _objectSpread({
282
+ _origin: _origin
283
+ }, this.props.data));
134
284
 
135
285
  try {
136
286
  data = JSON.parse(data);
@@ -143,6 +293,12 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
143
293
  data = null;
144
294
  }
145
295
 
296
+ if (this.props.schema.openUrl && !data) {
297
+ data = {
298
+ _origin: "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''))
299
+ };
300
+ }
301
+
146
302
  this.props.socket.sendTo("".concat(this.props.adapterName, ".").concat(this.props.instance), this.props.schema.command || 'send', data).then(function (response) {
147
303
  if (response !== null && response !== void 0 && response.error) {
148
304
  if (_this3.props.schema.error && _this3.props.schema.error[response.error]) {
@@ -163,7 +319,9 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
163
319
  });
164
320
  }
165
321
  } else {
166
- if (response !== null && response !== void 0 && response.result && _this3.props.schema.result && _this3.props.schema.result[response.result]) {
322
+ if (response !== null && response !== void 0 && response.openUrl && _this3.props.schema.openUrl) {
323
+ window.open(response.openUrl, response.window || _this3.props.schema.window || '_blank');
324
+ } else if (response !== null && response !== void 0 && response.result && _this3.props.schema.result && _this3.props.schema.result[response.result]) {
167
325
  var text = _this3.getText(_this3.props.schema.result[response.result]);
168
326
 
169
327
  if (response.args) {
@@ -180,6 +338,10 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
180
338
  window.alert(_i18n["default"].t('ra_Ok'));
181
339
  }
182
340
  }
341
+
342
+ if (response !== null && response !== void 0 && response.saveConfig) {
343
+ _this3.props.onChange(null, null, null, true);
344
+ }
183
345
  }
184
346
  })["catch"](function (e) {
185
347
  if (_this3.props.schema.error && _this3.props.schema.error[e.toString()]) {
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigSendto.js","names":["styles","theme","fullWidth","width","icon","height","marginRight","ConfigSendto","setState","_error","_message","state","undefined","props","onCommandRunning","data","schema","jsonData","getPattern","JSON","parse","e","console","error","socket","sendTo","adapterName","instance","command","then","response","getText","args","forEach","arg","replace","I18n","t","result","text","window","alert","stringify","toString","confirmDialog","confirm","confirmData","type","title","ok","cancel","isOk","_onClick","disabled","defaultValue","classes","variant","color","label","noTranslation","renderErrorDialog","renderMessageDialog","ConfigGeneric","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","onChange","number","commandRunning","bool","withStyles"],"sources":["JsonConfigComponent/ConfigSendto.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Button from '@mui/material/Button';\n\nimport I18n from '../../i18n';\nimport Icon from '../Icon';\nimport DialogError from '../../Dialogs/Error';\nimport DialogMessage from '../../Dialogs/Message';\nimport ConfirmDialog from '../../Dialogs/Confirm';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\nimport IconInfo from '@mui/icons-material/Info';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n icon: {\n width: 24,\n height: 24,\n marginRight: 4\n }\n});\n\nclass ConfigSendto extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n\n this.setState( {_error: '', _message: ''});\n }\n\n renderErrorDialog() {\n if (this.state._error) {\n return <DialogError text={this.state._error} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n renderMessageDialog() {\n if (this.state._message) {\n return <DialogMessage text={this.state._message} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n _onClick() {\n this.props.onCommandRunning(true);\n\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData, {}, this.props.data);\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n }\n if (data === undefined) {\n data = null;\n }\n\n this.props.socket.sendTo(\n `${this.props.adapterName}.${this.props.instance}`,\n this.props.schema.command || 'send',\n data\n )\n .then(response => {\n if (response?.error) {\n if (this.props.schema.error && this.props.schema.error[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n if (response.args) {\n response.args.forEach(arg => error = error.replace('%s', arg));\n }\n this.setState({_error: error});\n } else {\n this.setState({_error: response.error ? I18n.t(response.error) : I18n.t('ra_Error')});\n }\n } else {\n if (response?.result && this.props.schema.result && this.props.schema.result[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n if (response.args) {\n response.args.forEach(arg => text = text.replace('%s', arg));\n }\n window.alert(text);\n } else {\n if (response?.result) {\n window.alert(typeof response.result === 'object' ? JSON.stringify(response.result) : response.result);\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n }\n }\n })\n .catch(e => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({_error: this.getText(this.props.schema.error[e.toString()])});\n } else {\n this.setState({_error: I18n.t(e.toString()) || I18n.t('ra_Error')});\n }\n })\n .then(() => this.props.onCommandRunning(false))\n }\n\n renderConfirmDialog() {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return <ConfirmDialog\n title={ this.getText(confirm.title) || I18n.t('ra_Please confirm') }\n text={ this.getText(confirm.text) }\n ok={ this.getText(confirm.ok) || I18n.t('ra_Ok') }\n cancel={ this.getText(confirm.cancel) || I18n.t('ra_Cancel') }\n icon={icon}\n onClose={isOk =>\n this.setState({ confirmDialog: false}, () =>\n isOk && this._onClick())\n }\n />;\n }\n\n renderItem(error, disabled, defaultValue) {\n return <div className={this.props.classes.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n className={this.props.classes.fullWidth}\n disabled={disabled}\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({confirmDialog: true});\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.icon ? <Icon src={this.props.schema.icon} className={this.props.classes.icon}/> : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n </div>;\n }\n}\n\nConfigSendto.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 adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: Prop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AAK,kBAAA,EAAW9E,MAAX,EAAmBO,YAAnB,C"}
1
+ {"version":3,"file":"ConfigSendto.js","names":["styles","theme","fullWidth","width","icon","height","marginRight","ip2int","ip","split","reduce","ipInt","octet","parseInt","findNetworkAddressOfHost","obj","localIp","networkInterfaces","hardware","hostIp","Object","keys","forEach","inter","internal","includes","family","match","address","netmask","ConfigSendto","hostname","window","location","props","schema","openUrl","socket","getCurrentInstance","adminInstance","getObject","instanceObj","common","host","hostObj","port","console","warn","_id","setState","_error","_message","state","undefined","onCommandRunning","_origin","protocol","pathname","replace","data","jsonData","getPattern","JSON","parse","e","error","sendTo","adapterName","instance","command","then","response","getText","args","arg","I18n","t","open","result","text","alert","stringify","saveConfig","onChange","toString","confirmDialog","confirm","confirmData","type","title","ok","cancel","isOk","_onClick","disabled","defaultValue","classes","variant","color","label","noTranslation","renderErrorDialog","renderMessageDialog","ConfigGeneric","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","number","commandRunning","bool","withStyles"],"sources":["JsonConfigComponent/ConfigSendto.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Button from '@mui/material/Button';\n\nimport I18n from '../../i18n';\nimport Icon from '../Icon';\nimport DialogError from '../../Dialogs/Error';\nimport DialogMessage from '../../Dialogs/Message';\nimport ConfirmDialog from '../../Dialogs/Confirm';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\nimport IconInfo from '@mui/icons-material/Info';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n icon: {\n width: 24,\n height: 24,\n marginRight: 4\n }\n});\n\nfunction ip2int(ip) {\n return ip.split('.').reduce((ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0) >>> 0;\n}\n\n// copied from iobroker.admin/src-rx/src/Utils.js\nfunction findNetworkAddressOfHost(obj, localIp) {\n const networkInterfaces = obj?.native?.hardware?.networkInterfaces;\n if (!networkInterfaces) {\n return null;\n }\n\n let hostIp;\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n } else if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n } else if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) { // if DNS name\n hostIp = ip.address;\n } else {\n if (ip.family === 'IPv4' && localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }));\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n } else if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n } else if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) { // if DNS name\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n });\n });\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n }\n hostIp = ip.address;\n });\n });\n }\n\n return hostIp;\n}\n\n\nclass ConfigSendto extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n\n let hostname = window.location.hostname;\n if (this.props.schema.openUrl) {\n // read admin host\n const adminInstance = await this.props.socket.getCurrentInstance();\n const instanceObj = await this.props.socket.getObject(`system.adapter.${adminInstance}`);\n const hostObj = await this.props.socket.getObject(`system.host.${instanceObj.common.host}`);\n\n const ip = findNetworkAddressOfHost(hostObj, window.location.hostname);\n if (ip) {\n hostname = ip + ':' + window.location.port;\n } else {\n console.warn(`Cannot find suitable IP in host ${instanceObj.common.host} for ${instanceObj._id}`);\n return null;\n }\n }\n this.setState( { _error: '', _message: '', hostname });\n }\n\n renderErrorDialog() {\n if (this.state._error) {\n return <DialogError text={this.state._error} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n renderMessageDialog() {\n if (this.state._message) {\n return <DialogMessage text={this.state._message} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n _onClick() {\n this.props.onCommandRunning(true);\n\n const _origin = `${window.location.protocol}//${this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}`\n\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData, {}, {\n _origin,\n ...this.props.data\n });\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n }\n if (data === undefined) {\n data = null;\n }\n if (this.props.schema.openUrl && !data) {\n data = { _origin: `${window.location.protocol}//${this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}` };\n }\n\n this.props.socket.sendTo(\n `${this.props.adapterName}.${this.props.instance}`,\n this.props.schema.command || 'send',\n data\n )\n .then(response => {\n if (response?.error) {\n if (this.props.schema.error && this.props.schema.error[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n if (response.args) {\n response.args.forEach(arg => error = error.replace('%s', arg));\n }\n this.setState({_error: error});\n } else {\n this.setState({_error: response.error ? I18n.t(response.error) : I18n.t('ra_Error')});\n }\n } else {\n if (response?.openUrl && this.props.schema.openUrl) {\n window.open(response.openUrl, response.window || this.props.schema.window || '_blank');\n } else\n if (response?.result && this.props.schema.result && this.props.schema.result[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n if (response.args) {\n response.args.forEach(arg => text = text.replace('%s', arg));\n }\n window.alert(text);\n } else {\n if (response?.result) {\n window.alert(typeof response.result === 'object' ? JSON.stringify(response.result) : response.result);\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n }\n\n if (response?.saveConfig) {\n this.props.onChange(null, null, null, true);\n }\n }\n })\n .catch(e => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({_error: this.getText(this.props.schema.error[e.toString()])});\n } else {\n this.setState({_error: I18n.t(e.toString()) || I18n.t('ra_Error')});\n }\n })\n .then(() => this.props.onCommandRunning(false))\n }\n\n renderConfirmDialog() {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return <ConfirmDialog\n title={ this.getText(confirm.title) || I18n.t('ra_Please confirm') }\n text={ this.getText(confirm.text) }\n ok={ this.getText(confirm.ok) || I18n.t('ra_Ok') }\n cancel={ this.getText(confirm.cancel) || I18n.t('ra_Cancel') }\n icon={icon}\n onClose={isOk =>\n this.setState({ confirmDialog: false}, () =>\n isOk && this._onClick())\n }\n />;\n }\n\n renderItem(error, disabled, defaultValue) {\n return <div className={this.props.classes.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n className={this.props.classes.fullWidth}\n disabled={disabled}\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({confirmDialog: true});\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.icon ? <Icon src={this.props.schema.icon} className={this.props.classes.icon}/> : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n </div>;\n }\n}\n\nConfigSendto.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 adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSendto);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CADU;IAIrBC,IAAI,EAAE;MACFD,KAAK,EAAE,EADL;MAEFE,MAAM,EAAE,EAFN;MAGFC,WAAW,EAAE;IAHX;EAJe,CAAL;AAAA,CAApB;;AAWA,SAASC,MAAT,CAAgBC,EAAhB,EAAoB;EAChB,OAAOA,EAAE,CAACC,KAAH,CAAS,GAAT,EAAcC,MAAd,CAAqB,UAACC,KAAD,EAAQC,KAAR;IAAA,OAAkB,CAACD,KAAK,IAAI,CAAV,IAAeE,QAAQ,CAACD,KAAD,EAAQ,EAAR,CAAzC;EAAA,CAArB,EAA2E,CAA3E,MAAkF,CAAzF;AACH,C,CAED;;;AACA,SAASE,wBAAT,CAAkCC,GAAlC,EAAuCC,OAAvC,EAAgD;EAAA;;EAC5C,IAAMC,iBAAiB,GAAGF,GAAH,aAAGA,GAAH,sCAAGA,GAAG,UAAN,wEAAG,YAAaG,QAAhB,yDAAG,qBAAuBD,iBAAjD;;EACA,IAAI,CAACA,iBAAL,EAAwB;IACpB,OAAO,IAAP;EACH;;EAED,IAAIE,MAAJ;EACAC,MAAM,CAACC,IAAP,CAAYJ,iBAAZ,EAA+BK,OAA/B,CAAuC,UAAAC,KAAK;IAAA,OACxCN,iBAAiB,CAACM,KAAD,CAAjB,CAAyBD,OAAzB,CAAiC,UAAAd,EAAE,EAAI;MACnC,IAAIA,EAAE,CAACgB,QAAP,EAAiB;QACb;MACH,CAFD,MAEO,IAAIR,OAAO,CAACS,QAAR,CAAiB,GAAj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<{
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
+ adapterName: PropTypes.Requireable<string>;
12
+ instance: PropTypes.Requireable<number>;
13
+ commandRunning: PropTypes.Requireable<boolean>;
14
+ onCommandRunning: PropTypes.Requireable<(...args: any[]) => any>;
15
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"icon" | "fullWidth"> & object>;
16
+ export default _default;
17
+ import PropTypes from "prop-types";
18
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"slider" | "fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"primary" | "secondary" | "fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"header"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,3 @@
1
+ declare const _default: React.JSXElementConstructor<any>;
2
+ export default _default;
3
+ import React from "react";
@@ -0,0 +1,33 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ originalData: PropTypes.Requireable<object>;
9
+ schema: PropTypes.Requireable<object>;
10
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
11
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
12
+ customs: PropTypes.Requireable<object>;
13
+ adapterName: PropTypes.Requireable<string>;
14
+ instance: PropTypes.Requireable<number>;
15
+ commandRunning: PropTypes.Requireable<boolean>;
16
+ onCommandRunning: PropTypes.Requireable<(...args: any[]) => any>;
17
+ dateFormat: PropTypes.Requireable<string>;
18
+ isFloatComma: PropTypes.Requireable<boolean>;
19
+ multiEdit: PropTypes.Requireable<boolean>;
20
+ imagePrefix: PropTypes.Requireable<string>;
21
+ customObj: PropTypes.Requireable<object>;
22
+ instanceObj: PropTypes.Requireable<object>;
23
+ custom: PropTypes.Requireable<boolean>;
24
+ registerOnForceUpdate: PropTypes.Validator<(...args: any[]) => any>;
25
+ forceUpdate: PropTypes.Validator<(...args: any[]) => any>;
26
+ changeLanguage: PropTypes.Requireable<(...args: any[]) => any>;
27
+ systemConfig: PropTypes.Requireable<object>;
28
+ alive: PropTypes.Requireable<boolean>;
29
+ common: PropTypes.Requireable<object>;
30
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"panel" | "tabs"> & object>;
31
+ export default _default;
32
+ import PropTypes from "prop-types";
33
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"indeterminate"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,10 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ data: PropTypes.Validator<object>;
4
+ schema: PropTypes.Requireable<object>;
5
+ adapterName: PropTypes.Requireable<string>;
6
+ instance: PropTypes.Requireable<number>;
7
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
8
+ export default _default;
9
+ import PropTypes from "prop-types";
10
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"indeterminate"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,17 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ adapterName: PropTypes.Requireable<string>;
12
+ instance: PropTypes.Requireable<number>;
13
+ customObj: PropTypes.Requireable<object>;
14
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"icon" | "fullWidth"> & object>;
15
+ export default _default;
16
+ import PropTypes from "prop-types";
17
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<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
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"icon" | "fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,27 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ adapterName: PropTypes.Requireable<string>;
4
+ instance: PropTypes.Requireable<number>;
5
+ common: PropTypes.Requireable<object>;
6
+ customs: PropTypes.Requireable<object>;
7
+ custom: PropTypes.Requireable<boolean>;
8
+ customObj: PropTypes.Requireable<object>;
9
+ multiEdit: PropTypes.Requireable<boolean>;
10
+ instanceObj: PropTypes.Requireable<object>;
11
+ dateFormat: PropTypes.Requireable<string>;
12
+ isFloatComma: PropTypes.Requireable<boolean>;
13
+ imagePrefix: PropTypes.Requireable<string>;
14
+ themeType: PropTypes.Requireable<string>;
15
+ themeName: PropTypes.Requireable<string>;
16
+ style: PropTypes.Requireable<object>;
17
+ className: PropTypes.Requireable<string>;
18
+ data: PropTypes.Validator<object>;
19
+ updateData: PropTypes.Requireable<number>;
20
+ schema: PropTypes.Requireable<object>;
21
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
22
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
23
+ onValueChange: PropTypes.Requireable<(...args: any[]) => any>;
24
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"root"> & object>;
25
+ export default _default;
26
+ import PropTypes from "prop-types";
27
+ import React from "react";
@@ -82,29 +82,33 @@ var JsonConfigComponent = /*#__PURE__*/function (_Component) {
82
82
  });
83
83
  }
84
84
  });
85
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (data, value, cb) {
85
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (data, value, cb, saveConfig) {
86
86
  if (_this.props.onValueChange) {
87
- _this.props.onValueChange(data, value);
87
+ _this.props.onValueChange(data, value, saveConfig);
88
88
 
89
89
  cb && cb();
90
90
  } else {
91
- var state = {
92
- data: data
93
- };
94
- var _data = {}; // remove all attributes starting with "_"
91
+ if (data) {
92
+ var state = {
93
+ data: data
94
+ };
95
+ var _data = {}; // remove all attributes starting with "_"
96
+
97
+ Object.keys(data).forEach(function (attr) {
98
+ return !attr.startsWith('_') && (_data[attr] = data[attr]);
99
+ });
100
+ state.changed = JSON.stringify(_data) !== _this.state.originalData;
95
101
 
96
- Object.keys(data).forEach(function (attr) {
97
- return !attr.startsWith('_') && (_data[attr] = data[attr]);
98
- });
99
- state.changed = JSON.stringify(_data) !== _this.state.originalData;
102
+ _this.setState({
103
+ state: state
104
+ }, function () {
105
+ _this.props.onChange(_data, state.changed, saveConfig);
100
106
 
101
- _this.setState({
102
- state: state
103
- }, function () {
104
- _this.props.onChange(_data, state.changed);
105
-
106
- cb && cb();
107
- });
107
+ cb && cb();
108
+ });
109
+ } else if (saveConfig) {
110
+ _this.props.onChange(null, null, saveConfig);
111
+ }
108
112
  }
109
113
  });
110
114
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onError", function (attr, error) {