@iobroker/adapter-react-v5 3.1.3 → 3.1.6
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/FileBrowser.js +277 -237
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +3 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +16 -2
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +148 -25
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +183 -0
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js +747 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigGeneric.js +105 -20
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +132 -46
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +25 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +5 -4
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +3 -2
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +51 -40
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -2
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +31 -8
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +12 -3
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +4 -2
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +12 -4
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/ObjectBrowser.js +228 -222
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TableResize.js +34 -16
- package/Components/TableResize.js.map +1 -1
- package/Components/TreeTable.js +2 -2
- package/Components/TreeTable.js.map +1 -1
- package/Components/Utils.js +5 -5
- package/Components/Utils.js.map +1 -1
- package/Dialogs/Confirm.js +3 -3
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/FileSelect.js +259 -0
- package/Dialogs/FileSelect.js.map +1 -0
- package/Dialogs/SelectID.js +15 -16
- package/Dialogs/SelectID.js.map +1 -1
- package/GenericApp.js +3 -3
- package/GenericApp.js.map +1 -1
- package/README.md +3 -0
- package/package.json +1 -1
|
@@ -41,73 +41,77 @@ var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore
|
|
|
41
41
|
|
|
42
42
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _ConfigAlive = _interopRequireDefault(require("./ConfigAlive"));
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _ConfigAutocomplete = _interopRequireDefault(require("./ConfigAutocomplete"));
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _ConfigAutocompleteSendTo = _interopRequireDefault(require("./ConfigAutocompleteSendTo"));
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _ConfigCRON = _interopRequireDefault(require("./ConfigCRON"));
|
|
51
|
+
|
|
52
|
+
var _ConfigCertificateSelect = _interopRequireDefault(require("./ConfigCertificateSelect"));
|
|
53
|
+
|
|
54
|
+
var _ConfigCheckbox = _interopRequireDefault(require("./ConfigCheckbox"));
|
|
55
|
+
|
|
56
|
+
var _ConfigChip = _interopRequireDefault(require("./ConfigChip"));
|
|
51
57
|
|
|
52
58
|
var _ConfigColor = _interopRequireDefault(require("./ConfigColor"));
|
|
53
59
|
|
|
54
|
-
var
|
|
60
|
+
var _ConfigCoordinates = _interopRequireDefault(require("./ConfigCoordinates"));
|
|
55
61
|
|
|
56
|
-
var
|
|
62
|
+
var _ConfigCustom = _interopRequireDefault(require("./ConfigCustom"));
|
|
57
63
|
|
|
58
|
-
var
|
|
64
|
+
var _ConfigDatePicker = _interopRequireDefault(require("./ConfigDatePicker"));
|
|
59
65
|
|
|
60
|
-
var
|
|
66
|
+
var _ConfigFile = _interopRequireDefault(require("./ConfigFile"));
|
|
61
67
|
|
|
62
|
-
var
|
|
68
|
+
var _ConfigFileSelector = _interopRequireDefault(require("./ConfigFileSelector"));
|
|
63
69
|
|
|
64
|
-
var
|
|
70
|
+
var _ConfigIP = _interopRequireDefault(require("./ConfigIP"));
|
|
65
71
|
|
|
66
72
|
var _ConfigImageUpload = _interopRequireDefault(require("./ConfigImageUpload"));
|
|
67
73
|
|
|
68
74
|
var _ConfigInstanceSelect = _interopRequireDefault(require("./ConfigInstanceSelect"));
|
|
69
75
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
var _ConfigSendto = _interopRequireDefault(require("./ConfigSendto"));
|
|
73
|
-
|
|
74
|
-
var _ConfigObjectId = _interopRequireDefault(require("./ConfigObjectId"));
|
|
76
|
+
var _ConfigJsonEditor = _interopRequireDefault(require("./ConfigJsonEditor"));
|
|
75
77
|
|
|
76
78
|
var _ConfigLanguage = _interopRequireDefault(require("./ConfigLanguage"));
|
|
77
79
|
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
var _ConfigPassword = _interopRequireDefault(require("./ConfigPassword"));
|
|
80
|
+
var _ConfigNumber = _interopRequireDefault(require("./ConfigNumber"));
|
|
81
81
|
|
|
82
|
-
var
|
|
82
|
+
var _ConfigObjectId = _interopRequireDefault(require("./ConfigObjectId"));
|
|
83
83
|
|
|
84
|
-
var
|
|
84
|
+
var _ConfigPassword = _interopRequireDefault(require("./ConfigPassword"));
|
|
85
85
|
|
|
86
|
-
var
|
|
86
|
+
var _ConfigPattern = _interopRequireDefault(require("./ConfigPattern"));
|
|
87
87
|
|
|
88
|
-
var
|
|
88
|
+
var _ConfigSelect = _interopRequireDefault(require("./ConfigSelect"));
|
|
89
89
|
|
|
90
90
|
var _ConfigSelectSendTo = _interopRequireDefault(require("./ConfigSelectSendTo"));
|
|
91
91
|
|
|
92
|
-
var
|
|
92
|
+
var _ConfigSendto = _interopRequireDefault(require("./ConfigSendto"));
|
|
93
93
|
|
|
94
|
-
var
|
|
94
|
+
var _ConfigSetState = _interopRequireDefault(require("./ConfigSetState"));
|
|
95
95
|
|
|
96
|
-
var
|
|
96
|
+
var _ConfigStaticDivider = _interopRequireDefault(require("./ConfigStaticDivider"));
|
|
97
97
|
|
|
98
|
-
var
|
|
98
|
+
var _ConfigStaticHeader = _interopRequireDefault(require("./ConfigStaticHeader"));
|
|
99
99
|
|
|
100
|
-
var
|
|
100
|
+
var _ConfigStaticImage = _interopRequireDefault(require("./ConfigStaticImage"));
|
|
101
101
|
|
|
102
|
-
var
|
|
102
|
+
var _ConfigStaticText = _interopRequireDefault(require("./ConfigStaticText"));
|
|
103
103
|
|
|
104
|
-
var
|
|
104
|
+
var _ConfigTable = _interopRequireDefault(require("./ConfigTable"));
|
|
105
|
+
|
|
106
|
+
var _ConfigText = _interopRequireDefault(require("./ConfigText"));
|
|
105
107
|
|
|
106
108
|
var _ConfigTextSendTo = _interopRequireDefault(require("./ConfigTextSendTo"));
|
|
107
109
|
|
|
108
|
-
var
|
|
110
|
+
var _ConfigTimePicker = _interopRequireDefault(require("./ConfigTimePicker"));
|
|
109
111
|
|
|
110
|
-
var
|
|
112
|
+
var _ConfigTopic = _interopRequireDefault(require("./ConfigTopic"));
|
|
113
|
+
|
|
114
|
+
var _ConfigUser = _interopRequireDefault(require("./ConfigUser"));
|
|
111
115
|
|
|
112
116
|
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); }; }
|
|
113
117
|
|
|
@@ -119,15 +123,17 @@ var components = {
|
|
|
119
123
|
autocompleteSendTo: _ConfigAutocompleteSendTo["default"],
|
|
120
124
|
certificate: _ConfigCertificateSelect["default"],
|
|
121
125
|
checkbox: _ConfigCheckbox["default"],
|
|
122
|
-
chips: _ConfigChip["default"],
|
|
123
126
|
chip: _ConfigChip["default"],
|
|
124
127
|
// deprecated. Use "chips"
|
|
128
|
+
chips: _ConfigChip["default"],
|
|
125
129
|
color: _ConfigColor["default"],
|
|
126
130
|
coordinates: _ConfigCoordinates["default"],
|
|
127
131
|
cron: _ConfigCRON["default"],
|
|
128
132
|
custom: _ConfigCustom["default"],
|
|
129
133
|
datePicker: _ConfigDatePicker["default"],
|
|
130
134
|
divider: _ConfigStaticDivider["default"],
|
|
135
|
+
file: _ConfigFile["default"],
|
|
136
|
+
fileSelector: _ConfigFileSelector["default"],
|
|
131
137
|
header: _ConfigStaticHeader["default"],
|
|
132
138
|
image: _ConfigImageUpload["default"],
|
|
133
139
|
instance: _ConfigInstanceSelect["default"],
|
|
@@ -198,7 +204,7 @@ var ConfigPanel = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
198
204
|
|
|
199
205
|
if (this.props.schema && this.props.schema.collapsable) {
|
|
200
206
|
this.setState({
|
|
201
|
-
expanded: window.localStorage.getItem(this.props.adapterName + '.' + this.props.attr) === 'true'
|
|
207
|
+
expanded: (window._localStorage || window.localStorage).getItem(this.props.adapterName + '.' + this.props.attr) === 'true'
|
|
202
208
|
});
|
|
203
209
|
}
|
|
204
210
|
}
|
|
@@ -234,7 +240,7 @@ var ConfigPanel = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
return /*#__PURE__*/_react["default"].createElement(ItemComponent, {
|
|
237
|
-
key: attr + '_' + _this.props.index,
|
|
243
|
+
key: attr + '_' + (_this.props.index === undefined ? '' : _this.props.index),
|
|
238
244
|
index: _this.props.index,
|
|
239
245
|
arrayIndex: _this.props.arrayIndex,
|
|
240
246
|
globalData: _this.props.globalData,
|
|
@@ -245,6 +251,7 @@ var ConfigPanel = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
245
251
|
adapterName: _this.props.adapterName,
|
|
246
252
|
instance: _this.props.instance,
|
|
247
253
|
common: _this.props.common,
|
|
254
|
+
customs: _this.props.customs,
|
|
248
255
|
alive: _this.props.alive,
|
|
249
256
|
themeType: _this.props.themeType,
|
|
250
257
|
themeName: _this.props.themeName,
|
|
@@ -253,17 +260,19 @@ var ConfigPanel = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
253
260
|
systemConfig: _this.props.systemConfig,
|
|
254
261
|
onError: _this.props.onError,
|
|
255
262
|
onChange: _this.props.onChange,
|
|
256
|
-
|
|
263
|
+
multiEdit: _this.props.multiEdit,
|
|
257
264
|
dateFormat: _this.props.dateFormat,
|
|
258
265
|
isFloatComma: _this.props.isFloatComma,
|
|
259
266
|
disabled: disabled,
|
|
260
|
-
|
|
267
|
+
imagePrefix: _this.props.imagePrefix,
|
|
268
|
+
changeLanguage: _this.props.changeLanguage,
|
|
261
269
|
forceUpdate: _this.props.forceUpdate,
|
|
270
|
+
registerOnForceUpdate: _this.props.registerOnForceUpdate,
|
|
262
271
|
customObj: _this.props.customObj,
|
|
263
272
|
instanceObj: _this.props.instanceObj,
|
|
264
273
|
custom: _this.props.custom,
|
|
265
|
-
|
|
266
|
-
|
|
274
|
+
schema: items[attr],
|
|
275
|
+
attr: attr
|
|
267
276
|
});
|
|
268
277
|
}) : null;
|
|
269
278
|
}
|
|
@@ -332,7 +341,7 @@ var ConfigPanel = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
332
341
|
className: classes.fullWidth,
|
|
333
342
|
expanded: !!this.state.expanded,
|
|
334
343
|
onChange: function onChange() {
|
|
335
|
-
window.localStorage.setItem(_this2.props.adapterName + '.' + _this2.props.attr, _this2.state.expanded ? 'false' : 'true');
|
|
344
|
+
(window._localStorage || window.localStorage).setItem(_this2.props.adapterName + '.' + _this2.props.attr, _this2.state.expanded ? 'false' : 'true');
|
|
336
345
|
|
|
337
346
|
_this2.setState({
|
|
338
347
|
expanded: !_this2.state.expanded
|
|
@@ -416,14 +425,16 @@ ConfigPanel.propTypes = {
|
|
|
416
425
|
isFloatComma: _propTypes["default"].bool,
|
|
417
426
|
multiEdit: _propTypes["default"].bool,
|
|
418
427
|
isParentTab: _propTypes["default"].bool,
|
|
428
|
+
imagePrefix: _propTypes["default"].string,
|
|
429
|
+
changeLanguage: _propTypes["default"].func,
|
|
419
430
|
arrayIndex: _propTypes["default"].number,
|
|
420
431
|
globalData: _propTypes["default"].object,
|
|
421
432
|
customObj: _propTypes["default"].object,
|
|
422
433
|
instanceObj: _propTypes["default"].object,
|
|
423
434
|
custom: _propTypes["default"].bool,
|
|
435
|
+
forceUpdate: _propTypes["default"].func,
|
|
424
436
|
onError: _propTypes["default"].func,
|
|
425
437
|
onChange: _propTypes["default"].func,
|
|
426
|
-
onForceUpdate: _propTypes["default"].func,
|
|
427
438
|
registerOnForceUpdate: _propTypes["default"].func
|
|
428
439
|
};
|
|
429
440
|
var ConfigPanelStyled = (0, _styles.withStyles)(styles)(ConfigPanel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPanel.js","names":["components","alive","ConfigAlive","autocomplete","ConfigAutocomplete","autocompleteSendTo","ConfigAutocompleteSendTo","certificate","ConfigCertificateSelect","checkbox","ConfigCheckbox","chips","ConfigChip","chip","color","ConfigColor","coordinates","ConfigCoordinates","cron","ConfigCRON","custom","ConfigCustom","datePicker","ConfigDatePicker","divider","ConfigStaticDivider","header","ConfigStaticHeader","image","ConfigImageUpload","instance","ConfigInstanceSelect","ip","ConfigIP","jsonEditor","ConfigJsonEditor","language","ConfigLanguage","number","ConfigNumber","objectId","ConfigObjectId","password","ConfigPassword","pattern","ConfigPattern","select","ConfigSelect","selectSendTo","ConfigSelectSendTo","sendTo","ConfigSendto","sendto","setState","ConfigSetState","staticImage","ConfigStaticImage","staticLink","ConfigStaticText","staticText","table","ConfigTable","text","ConfigText","textSendTo","ConfigTextSendTo","timePicker","ConfigTimePicker","topic","ConfigTopic","user","ConfigUser","styles","theme","fullWidth","width","paper","margin","height","overflowY","paddingBottom","spacing","padding","heading","primary","backgroundColor","palette","main","mode","secondary","ConfigPanel","props","schema","collapsable","expanded","window","localStorage","getItem","adapterName","attr","items","disabled","classes","Object","keys","map","multiEdit","noMultiEdit","type","ItemComponent","url","customs","component","console","error","ConfigGeneric","ConfigPanelStyled","index","arrayIndex","globalData","onCommandRunning","commandRunning","panel","socket","common","themeType","themeName","data","originalData","systemConfig","onError","onChange","dateFormat","isFloatComma","registerOnForceUpdate","forceUpdate","customObj","instanceObj","calculate","hidden","hideOnlyControl","item","xs","undefined","lg","md","sm","assign","marginBottom","textAlign","style","themaType","darkStyle","newLine","flexBasis","renderItems","content","state","setItem","clsx","getText","label","className","isParentTab","tooltip","propTypes","PropTypes","object","isRequired","string","bool","func","onForceUpdate","withStyles"],"sources":["JsonConfigComponent/ConfigPanel.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\nimport clsx from 'clsx';\n\nimport Grid from '@mui/material/Grid';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport Typography from '@mui/material/Typography';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ConfigText from './ConfigText';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigColor from './ConfigColor';\nimport ConfigIP from './ConfigIP';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigUser from './ConfigUser';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigTable from './ConfigTable';\nimport ConfigSendto from './ConfigSendto';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigChip from './ConfigChip';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\n\nconst components = {\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certificate: ConfigCertificateSelect,\n checkbox: ConfigCheckbox,\n chips: ConfigChip,\n chip: ConfigChip, // deprecated. Use \"chips\"\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n divider: ConfigStaticDivider,\n header: ConfigStaticHeader,\n image: ConfigImageUpload,\n instance: ConfigInstanceSelect,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n number: ConfigNumber,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n sendTo: ConfigSendto,\n sendto: ConfigSendto,\n setState: ConfigSetState,\n staticImage: ConfigStaticImage,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n user: ConfigUser,\n};\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%',\n //height: '100%',\n },\n paper: {\n margin: 10,\n height: 'calc(100vh - 235px) !important',\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: theme.spacing(1)\n },\n padding: {\n padding: 10,\n },\n heading: {\n\n },\n primary: {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF'\n },\n secondary: {\n backgroundColor: theme.palette.secondary.main,\n }\n});\n\nclass ConfigPanel extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n if (this.props.schema && this.props.schema.collapsable) {\n this.setState({expanded: window.localStorage.getItem(this.props.adapterName + '.' + this.props.attr) === 'true'});\n }\n }\n\n renderItems(items, disabled) {\n const classes = this.props.classes || {};\n\n return items ? Object.keys(items).map(attr => {\n if (this.props.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent;\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else\n if (this.props.customs && this.props.customs[items[attr].component]) {\n ItemComponent = this.props.customs[items[attr].component];\n } else {\n console.error('Cannot find custom component: ' + items[attr].component);\n ItemComponent = ConfigGeneric;\n }\n } else if (type === 'panel') {\n ItemComponent = ConfigPanelStyled;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return <ItemComponent\n key={attr + '_' + this.props.index}\n index={this.props.index}\n arrayIndex={this.props.arrayIndex}\n globalData={this.props.globalData}\n onCommandRunning={this.props.onCommandRunning}\n commandRunning={this.props.commandRunning}\n className={classes.panel}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n alive={this.props.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n systemConfig={this.props.systemConfig}\n onError={this.props.onError}\n onChange={this.props.onChange}\n customs={this.props.customs}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n disabled={disabled}\n\n registerOnForceUpdate={this.props.registerOnForceUpdate}\n forceUpdate={this.props.forceUpdate}\n\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n custom={this.props.custom}\n\n attr={attr}\n schema={items[attr]}\n />;\n }) : null;\n }\n\n render() {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n const { disabled, hidden } = this.calculate(schema);\n\n const items = this.props.schema.items;\n const classes = this.props.classes || {};\n\n if (hidden) {\n if (schema.hideOnlyControl) {\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign(\n {},\n {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'},\n schema.style,\n this.props.themaType === 'dark' ? schema.darkStyle : {}\n )}\n />;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>\n } else {\n return item;\n }\n } else {\n return null;\n }\n } else\n if (this.props.table) {\n return this.renderItems(items, disabled);\n } else\n if (this.props.custom) {\n return <Grid\n key={this.props.attr + '_' + this.props.index}\n container\n className={classes.fullWidth}\n spacing={2}\n >\n {this.renderItems(items, disabled)}\n </Grid>;\n } else {\n let content;\n if (schema.collapsable) {\n content = <Accordion\n key={this.props.attr + '_' + this.props.index}\n className={classes.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n window.localStorage.setItem(this.props.adapterName + '.' + this.props.attr, this.state.expanded ? 'false' : 'true');\n this.setState({expanded: !this.state.expanded});\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n style={Object.assign({}, schema.style, this.props.themeType ? schema.darkStyle : {})}\n className={clsx(classes.fullWidth, schema.color === 'primary' && classes.primary, schema.color === 'secondary' && classes.secondary)}\n >\n <Typography className={classes.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid container className={classes.fullWidth + ' ' + classes.padding} spacing={2}>\n {this.renderItems(items, disabled)}\n </Grid>\n </AccordionDetails>\n </Accordion>\n } else {\n content = <div\n key={this.props.attr + '_' + this.props.index}\n className={clsx(this.props.className, this.props.isParentTab && classes.paper, classes.fullWidth)}\n >\n <Grid container className={clsx(classes.fullWidth, this.props.isParentTab && classes.padding)} spacing={2}>\n {this.renderItems(items, disabled)}\n </Grid>\n </div>;\n }\n\n if (!this.props.isParentTab) {\n const item = <Grid\n item\n title={this.getText(schema.tooltip)}\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'}, schema.style)}>\n {content}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>;\n } else {\n return item;\n }\n } else {\n return content;\n }\n }\n }\n}\n\nConfigPanel.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 originalData: PropTypes.object,\n schema: PropTypes.object,\n index: PropTypes.number,\n customs: PropTypes.object,\n alive: PropTypes.bool,\n systemConfig: PropTypes.object,\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: PropTypes.func,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n multiEdit: PropTypes.bool,\n isParentTab: PropTypes.bool,\n\n arrayIndex: PropTypes.number,\n globalData: PropTypes.object,\n\n customObj: PropTypes.object,\n instanceObj: PropTypes.object,\n custom: PropTypes.bool,\n\n onError: PropTypes.func,\n onChange: PropTypes.func,\n onForceUpdate: PropTypes.func,\n registerOnForceUpdate: PropTypes.func,\n};\n\nconst ConfigPanelStyled = withStyles(styles)(ConfigPanel);\n\nexport default ConfigPanelStyled;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA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plete","ConfigAutocomplete","autocompleteSendTo","ConfigAutocompleteSendTo","certificate","ConfigCertificateSelect","checkbox","ConfigCheckbox","chip","ConfigChip","chips","color","ConfigColor","coordinates","ConfigCoordinates","cron","ConfigCRON","custom","ConfigCustom","datePicker","ConfigDatePicker","divider","ConfigStaticDivider","file","ConfigFile","fileSelector","ConfigFileSelector","header","ConfigStaticHeader","image","ConfigImageUpload","instance","ConfigInstanceSelect","ip","ConfigIP","jsonEditor","ConfigJsonEditor","language","ConfigLanguage","number","ConfigNumber","objectId","ConfigObjectId","password","ConfigPassword","pattern","ConfigPattern","select","ConfigSelect","selectSendTo","ConfigSelectSendTo","sendTo","ConfigSendto","sendto","setState","ConfigSetState","staticImage","ConfigStaticImage","staticLink","ConfigStaticText","staticText","table","ConfigTable","text","ConfigText","textSendTo","ConfigTextSendTo","timePicker","ConfigTimePicker","topic","ConfigTopic","user","ConfigUser","styles","theme","fullWidth","width","paper","margin","height","overflowY","paddingBottom","spacing","padding","heading","primary","backgroundColor","palette","main","mode","secondary","ConfigPanel","props","schema","collapsable","expanded","window","_localStorage","localStorage","getItem","adapterName","attr","items","disabled","classes","Object","keys","map","multiEdit","noMultiEdit","type","ItemComponent","url","customs","component","console","error","ConfigGeneric","ConfigPanelStyled","index","undefined","arrayIndex","globalData","onCommandRunning","commandRunning","panel","socket","common","themeType","themeName","data","originalData","systemConfig","onError","onChange","dateFormat","isFloatComma","imagePrefix","changeLanguage","forceUpdate","registerOnForceUpdate","customObj","instanceObj","calculate","hidden","hideOnlyControl","item","xs","lg","md","sm","assign","marginBottom","textAlign","style","themaType","darkStyle","newLine","flexBasis","renderItems","content","state","setItem","clsx","getText","label","className","isParentTab","tooltip","propTypes","PropTypes","object","isRequired","string","bool","func","withStyles"],"sources":["JsonConfigComponent/ConfigPanel.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\nimport clsx from 'clsx';\n\nimport Grid from '@mui/material/Grid';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport Typography from '@mui/material/Typography';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigChip from './ConfigChip';\nimport ConfigColor from './ConfigColor';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigFile from './ConfigFile';\nimport ConfigFileSelector from './ConfigFileSelector';\nimport ConfigIP from './ConfigIP';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigSendto from './ConfigSendto';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigTable from './ConfigTable';\nimport ConfigText from './ConfigText';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigUser from './ConfigUser';\n\nconst components = {\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certificate: ConfigCertificateSelect,\n checkbox: ConfigCheckbox,\n chip: ConfigChip, // deprecated. Use \"chips\"\n chips: ConfigChip,\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n divider: ConfigStaticDivider,\n file: ConfigFile,\n fileSelector: ConfigFileSelector,\n header: ConfigStaticHeader,\n image: ConfigImageUpload,\n instance: ConfigInstanceSelect,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n number: ConfigNumber,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n sendTo: ConfigSendto,\n sendto: ConfigSendto,\n setState: ConfigSetState,\n staticImage: ConfigStaticImage,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n user: ConfigUser,\n};\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%',\n //height: '100%',\n },\n paper: {\n margin: 10,\n height: 'calc(100vh - 235px) !important',\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: theme.spacing(1)\n },\n padding: {\n padding: 10,\n },\n heading: {\n\n },\n primary: {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF'\n },\n secondary: {\n backgroundColor: theme.palette.secondary.main,\n }\n});\n\nclass ConfigPanel extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n if (this.props.schema && this.props.schema.collapsable) {\n this.setState({expanded: (window._localStorage || window.localStorage).getItem(this.props.adapterName + '.' + this.props.attr) === 'true'});\n }\n }\n\n renderItems(items, disabled) {\n const classes = this.props.classes || {};\n\n return items ? Object.keys(items).map(attr => {\n if (this.props.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent;\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else\n if (this.props.customs && this.props.customs[items[attr].component]) {\n ItemComponent = this.props.customs[items[attr].component];\n } else {\n console.error('Cannot find custom component: ' + items[attr].component);\n ItemComponent = ConfigGeneric;\n }\n } else if (type === 'panel') {\n ItemComponent = ConfigPanelStyled;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return <ItemComponent\n key={attr + '_' + (this.props.index === undefined ? '' : this.props.index)}\n index={this.props.index}\n arrayIndex={this.props.arrayIndex}\n globalData={this.props.globalData}\n onCommandRunning={this.props.onCommandRunning}\n commandRunning={this.props.commandRunning}\n className={classes.panel}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n customs={this.props.customs}\n alive={this.props.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n systemConfig={this.props.systemConfig}\n onError={this.props.onError}\n onChange={this.props.onChange}\n multiEdit={this.props.multiEdit}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n disabled={disabled}\n imagePrefix={this.props.imagePrefix}\n\n changeLanguage={this.props.changeLanguage}\n forceUpdate={this.props.forceUpdate}\n registerOnForceUpdate={this.props.registerOnForceUpdate}\n\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n custom={this.props.custom}\n\n schema={items[attr]}\n attr={attr}\n />;\n }) : null;\n }\n\n render() {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n const { disabled, hidden } = this.calculate(schema);\n\n const items = this.props.schema.items;\n const classes = this.props.classes || {};\n\n if (hidden) {\n if (schema.hideOnlyControl) {\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign(\n {},\n {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'},\n schema.style,\n this.props.themaType === 'dark' ? schema.darkStyle : {}\n )}\n />;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>\n } else {\n return item;\n }\n } else {\n return null;\n }\n } else\n if (this.props.table) {\n return this.renderItems(items, disabled);\n } else\n if (this.props.custom) {\n return <Grid\n key={this.props.attr + '_' + this.props.index}\n container\n className={classes.fullWidth}\n spacing={2}\n >\n {this.renderItems(items, disabled)}\n </Grid>;\n } else {\n let content;\n if (schema.collapsable) {\n content = <Accordion\n key={this.props.attr + '_' + this.props.index}\n className={classes.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n (window._localStorage || window.localStorage).setItem(this.props.adapterName + '.' + this.props.attr, this.state.expanded ? 'false' : 'true');\n this.setState({expanded: !this.state.expanded});\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n style={Object.assign({}, schema.style, this.props.themeType ? schema.darkStyle : {})}\n className={clsx(classes.fullWidth, schema.color === 'primary' && classes.primary, schema.color === 'secondary' && classes.secondary)}\n >\n <Typography className={classes.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid container className={classes.fullWidth + ' ' + classes.padding} spacing={2}>\n {this.renderItems(items, disabled)}\n </Grid>\n </AccordionDetails>\n </Accordion>\n } else {\n content = <div\n key={this.props.attr + '_' + this.props.index}\n className={clsx(this.props.className, this.props.isParentTab && classes.paper, classes.fullWidth)}\n >\n <Grid container className={clsx(classes.fullWidth, this.props.isParentTab && classes.padding)} spacing={2}>\n {this.renderItems(items, disabled)}\n </Grid>\n </div>;\n }\n\n if (!this.props.isParentTab) {\n const item = <Grid\n item\n title={this.getText(schema.tooltip)}\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'}, schema.style)}>\n {content}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>;\n } else {\n return item;\n }\n } else {\n return content;\n }\n }\n }\n}\n\nConfigPanel.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 originalData: PropTypes.object,\n schema: PropTypes.object,\n index: PropTypes.number,\n customs: PropTypes.object,\n alive: PropTypes.bool,\n systemConfig: PropTypes.object,\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: PropTypes.func,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n multiEdit: PropTypes.bool,\n isParentTab: PropTypes.bool,\n imagePrefix: PropTypes.string,\n changeLanguage: PropTypes.func,\n\n arrayIndex: PropTypes.number,\n globalData: PropTypes.object,\n\n customObj: PropTypes.object,\n instanceObj: PropTypes.object,\n custom: PropTypes.bool,\n\n forceUpdate: PropTypes.func,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n registerOnForceUpdate: PropTypes.func,\n};\n\nconst ConfigPanelStyled = withStyles(styles)(ConfigPanel);\n\nexport default ConfigPanelStyled;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,UAAU,GAAG;EACfC,KAAK,EAAEC,uBADQ;EAEfC,YAAY,EAAEC,8BAFC;EAGfC,kBAAkB,EAAEC,oCAHL;EAIfC,WAAW,EAAEC,m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,CAAUK,IA/BH;EAgCpB1C,OAAO,EAAEqC,qBAAA,CAAUK,IAhCC;EAiCpBzC,QAAQ,EAAEoC,qBAAA,CAAUK,IAjCA;EAkCpBnC,qBAAqB,EAAE8B,qBAAA,CAAUK;AAlCb,CAAxB;AAqCA,IAAMzD,iBAAiB,GAAG,IAAA0D,kBAAA,EAAWvG,MAAX,EAAmBkB,WAAnB,CAA1B;eAEe2B,iB"}
|
|
@@ -31,7 +31,7 @@ var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
|
31
31
|
|
|
32
32
|
var _copyToClipboard = _interopRequireDefault(require("../copy-to-clipboard"));
|
|
33
33
|
|
|
34
|
-
var _IconCopy = _interopRequireDefault(require("
|
|
34
|
+
var _IconCopy = _interopRequireDefault(require("../../icons/IconCopy"));
|
|
35
35
|
|
|
36
36
|
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
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPattern.js","names":["styles","theme","ConfigPattern","error","disabled","endAdornment","props","schema","copyToClipboard","e","copy","getPattern","pattern","window","alert","undefined","getText","label","renderHelp","help","helpLink","noTranslation","ConfigGeneric","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","data","onError","func","onChange","withStyles"],"sources":["JsonConfigComponent/ConfigPattern.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\n\nimport IconButton from '@mui/material/IconButton';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nimport copy from '../copy-to-clipboard';\nimport CopyIcon from '
|
|
1
|
+
{"version":3,"file":"ConfigPattern.js","names":["styles","theme","ConfigPattern","error","disabled","endAdornment","props","schema","copyToClipboard","e","copy","getPattern","pattern","window","alert","undefined","getText","label","renderHelp","help","helpLink","noTranslation","ConfigGeneric","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","data","onError","func","onChange","withStyles"],"sources":["JsonConfigComponent/ConfigPattern.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\n\nimport IconButton from '@mui/material/IconButton';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nimport copy from '../copy-to-clipboard';\nimport CopyIcon from '../../icons/IconCopy';\n\nconst styles = theme => ({\n});\n\nclass ConfigPattern extends ConfigGeneric {\n renderItem(error, disabled) {\n return <TextField\n variant=\"standard\"\n fullWidth\n disabled={!!disabled}\n InputProps={{\n endAdornment: this.props.schema.copyToClipboard ?\n <IconButton\n size=\"small\"\n onClick={e => {\n copy(this.getPattern(this.props.schema.pattern));\n window.alert('Copied');\n }}>\n <CopyIcon/>\n </IconButton>\n : undefined,\n }}\n value={this.getPattern(this.props.schema.pattern)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />;\n }\n}\n\nConfigPattern.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)(ConfigPattern);"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK,EAAL;AAAA,CAApB;;IAGMC,a;;;;;;;;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tBpB,MAAM,EAAEkB,qBAAA,CAAUC,MAPI;EAQtBQ,OAAO,EAAET,qBAAA,CAAUU,IARG;EAStBC,QAAQ,EAAEX,qBAAA,CAAUU;AATE,CAA1B;;eAYe,IAAAE,kBAAA,EAAWrC,MAAX,EAAmBE,aAAnB,C"}
|
|
@@ -37,6 +37,8 @@ var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
|
37
37
|
|
|
38
38
|
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
39
39
|
|
|
40
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
41
|
+
|
|
40
42
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
41
43
|
|
|
42
44
|
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); }; }
|
|
@@ -73,7 +75,7 @@ var ConfigSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
73
75
|
if (Array.isArray(value)) {
|
|
74
76
|
this.initialValue = (0, _toConsumableArray2["default"])(value);
|
|
75
77
|
selectOptions.unshift({
|
|
76
|
-
label: _ConfigGeneric2["default"].DIFFERENT_LABEL,
|
|
78
|
+
label: _i18n["default"].t(_ConfigGeneric2["default"].DIFFERENT_LABEL),
|
|
77
79
|
value: _ConfigGeneric2["default"].DIFFERENT_VALUE
|
|
78
80
|
});
|
|
79
81
|
this.setState({
|
|
@@ -113,7 +115,7 @@ var ConfigSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
113
115
|
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
114
116
|
variant: "standard",
|
|
115
117
|
className: this.props.classes.fullWidth,
|
|
116
|
-
id: "jsonSelect_".concat(this.props.schema.attr, "_").concat(this.props.index)
|
|
118
|
+
id: "jsonSelect_".concat(this.props.schema.attr, "_").concat(this.props.index || this.props.index === 0 ? this.props.index : '')
|
|
117
119
|
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, this.getText(this.props.schema.label)), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
118
120
|
variant: "standard",
|
|
119
121
|
error: !!error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigSelect.js","names":["styles","theme","fullWidth","width","ConfigSelect","value","ConfigGeneric","getValue","props","data","attr","selectOptions","JSON","parse","stringify","schema","options","Array","isArray","initialValue","unshift","label","DIFFERENT_LABEL","DIFFERENT_VALUE","setState","error","disabled","defaultValue","state","filter","item","hidden","custom","executeCustom","customObj","instanceObj","arrayIndex","globalData","execute","find","classes","index","getText","val","noTranslation","e","target","onChange","map","opacity","help","renderHelp","helpLink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigSelect.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';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigSelect extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n const selectOptions = JSON.parse(JSON.stringify(this.props.schema.options));\n\n // if __different\n if (Array.isArray(value)) {\n this.initialValue = [...value];\n selectOptions.unshift({label: ConfigGeneric.DIFFERENT_LABEL, value: ConfigGeneric.DIFFERENT_VALUE});\n this.setState({value: ConfigGeneric.DIFFERENT_VALUE, selectOptions});\n } else {\n this.setState({value, selectOptions});\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const selectOptions = (this.state.selectOptions || []).filter(item => {\n if (!item.hidden) {\n return true;\n } else if (this.props.custom) {\n return !this.executeCustom(item.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);\n } else {\n return !this.execute(item.hidden, this.props.schema.default, this.props.data, this.props.arrayIndex, this.props.globalData);\n }\n });\n\n // eslint-disable-next-line\n const item = selectOptions.find(item => item.value == this.state.value); // let \"==\" be and not ===\n\n return <FormControl variant=\"standard\" className={this.props.classes.fullWidth} id={`jsonSelect_${this.props.schema.attr}_${this.props.index}`}>\n <InputLabel>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={this.state.value || '_'}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation)}\n onChange={e => {\n this.setState({value: e.target.value === '_' ? '' : e.target.value}, () => {\n if (this.state.value === ConfigGeneric.DIFFERENT_VALUE) {\n this.onChange(this.props.attr, this.initialValue);\n } else {\n this.onChange(this.props.attr, this.state.value);\n }\n });\n }}\n >\n {selectOptions.map(item =>\n <MenuItem key={item.value} value={item.value} style={item.value === ConfigGeneric.DIFFERENT_VALUE ? {opacity: 0.5} : {}}>{this.getText(item.label, this.props.schema.noTranslation)}</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\nConfigSelect.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSelect);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA;EADU,CAAL;AAAA,CAApB;;IAMMC,Y;;;;;;;;;;;;WACF,6BAAoB;MAChB;;MACA,IAAMC,KAAK,GAAGC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,CAAWC,IAAlC,EAAwC,KAAKD,KAAL,CAAWE,IAAnD,CAAd;;MAEA,IAAMC,aAAa,GAAGC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,SAAL,CAAe,KAAKN,KAAL,CAAWO,MAAX,CAAkBC,OAAjC,CAAX,CAAtB,CAJgB,CAMhB;;MACA,IAAIC,KAAK,CAACC,OAAN,CAAcb,KAAd,CAAJ,EAA0B;QACtB,KAAKc,YAAL,uCAAwBd,KAAxB;QACAM,aAAa,CAACS,OAAd,CAAsB;UAACC,KAAK,
|
|
1
|
+
{"version":3,"file":"ConfigSelect.js","names":["styles","theme","fullWidth","width","ConfigSelect","value","ConfigGeneric","getValue","props","data","attr","selectOptions","JSON","parse","stringify","schema","options","Array","isArray","initialValue","unshift","label","I18n","t","DIFFERENT_LABEL","DIFFERENT_VALUE","setState","error","disabled","defaultValue","state","filter","item","hidden","custom","executeCustom","customObj","instanceObj","arrayIndex","globalData","execute","find","classes","index","getText","val","noTranslation","e","target","onChange","map","opacity","help","renderHelp","helpLink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigSelect.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 I18n from '../../i18n';\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigSelect extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n const selectOptions = JSON.parse(JSON.stringify(this.props.schema.options));\n\n // if __different\n if (Array.isArray(value)) {\n this.initialValue = [...value];\n selectOptions.unshift({label: I18n.t(ConfigGeneric.DIFFERENT_LABEL), value: ConfigGeneric.DIFFERENT_VALUE});\n this.setState({value: ConfigGeneric.DIFFERENT_VALUE, selectOptions});\n } else {\n this.setState({value, selectOptions});\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const selectOptions = (this.state.selectOptions || []).filter(item => {\n if (!item.hidden) {\n return true;\n } else if (this.props.custom) {\n return !this.executeCustom(item.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);\n } else {\n return !this.execute(item.hidden, this.props.schema.default, this.props.data, this.props.arrayIndex, this.props.globalData);\n }\n });\n\n // eslint-disable-next-line\n const item = selectOptions.find(item => item.value == this.state.value); // let \"==\" be and not ===\n\n return <FormControl variant=\"standard\" className={this.props.classes.fullWidth} id={`jsonSelect_${this.props.schema.attr}_${this.props.index || this.props.index === 0 ? this.props.index : ''}`}>\n <InputLabel>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={this.state.value || '_'}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation)}\n onChange={e => {\n this.setState({value: e.target.value === '_' ? '' : e.target.value}, () => {\n if (this.state.value === ConfigGeneric.DIFFERENT_VALUE) {\n this.onChange(this.props.attr, this.initialValue);\n } else {\n this.onChange(this.props.attr, this.state.value);\n }\n });\n }}\n >\n {selectOptions.map(item =>\n <MenuItem key={item.value} value={item.value} style={item.value === ConfigGeneric.DIFFERENT_VALUE ? {opacity: 0.5} : {}}>{this.getText(item.label, this.props.schema.noTranslation)}</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\nConfigSelect.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSelect);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA;EADU,CAAL;AAAA,CAApB;;IAMMC,Y;;;;;;;;;;;;WACF,6BAAoB;MAChB;;MACA,IAAMC,KAAK,GAAGC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,CAAWC,IAAlC,EAAwC,KAAKD,KAAL,CAAWE,IAAnD,CAAd;;MAEA,IAAMC,aAAa,GAAGC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,SAAL,CAAe,KAAKN,KAAL,CAAWO,MAAX,CAAkBC,OAAjC,CAAX,CAAtB,CAJgB,CAMhB;;MACA,IAAIC,KAAK,CAACC,OAAN,CAAcb,KAAd,CAAJ,EAA0B;QACtB,KAAKc,YAAL,uCAAwBd,KAAxB;QACAM,aAAa,CAACS,OAAd,CAAsB;UAACC,KAAK,EAAEC,gBAAA,CAAKC,CAAL,CAAOjB,0BAAA,CAAckB,eAArB,CAAR;UAA+CnB,KAAK,EAAEC,0BAAA,CAAcmB;QAApE,CAAtB;QACA,KAAKC,QAAL,CAA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D,qBAAA,CAAUC,MAAV,CAAiBC,UANF;EAOrB5C,MAAM,EAAE0C,qBAAA,CAAUC,MAPG;EAQrBO,OAAO,EAAER,qBAAA,CAAUS,IARE;EASrBjB,QAAQ,EAAEQ,qBAAA,CAAUS;AATC,CAAzB;;eAYe,IAAAC,kBAAA,EAAWnE,MAAX,EAAmBI,YAAnB,C"}
|
|
@@ -37,6 +37,8 @@ var _Error = _interopRequireDefault(require("../../Dialogs/Error"));
|
|
|
37
37
|
|
|
38
38
|
var _Message = _interopRequireDefault(require("../../Dialogs/Message"));
|
|
39
39
|
|
|
40
|
+
var _Confirm = _interopRequireDefault(require("../../Dialogs/Confirm"));
|
|
41
|
+
|
|
40
42
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
41
43
|
|
|
42
44
|
var _Warning = _interopRequireDefault(require("@mui/icons-material/Warning"));
|
|
@@ -45,8 +47,6 @@ var _Error2 = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
|
45
47
|
|
|
46
48
|
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
47
49
|
|
|
48
|
-
var _Confirm = _interopRequireDefault(require("../../Dialogs/Confirm"));
|
|
49
|
-
|
|
50
50
|
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
51
|
|
|
52
52
|
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; } }
|
|
@@ -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';\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';\nimport ConfirmDialog from '../../Dialogs/Confirm';\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: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSendto);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AACA;;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;;IAWMC,Y;;;;;;;;;;;;WACF,6BAAoB;MAChB;MAEA,KAAKC,QAAL,CAAe;QAACC,MAAM,EAAE,EAAT;QAAaC,QAAQ,EAAE;MAAvB,CAAf;IACH;;;WAED,6BAAoB;MAAA;;MAChB,IAAI,KAAKC,KAAL,CAAWF,MAAf,EAAuB;QACnB,oBAAO,gCAAC,iBAAD;UAAa,IAAI,EAAE,KAAKE,KAAL,CAAWF,MAA9B;UAAsC,OAAO,EAAEG,SA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AAiBC,UADJ;EAErBC,SAAS,EAAEH,qBAAA,CAAUI,MAFA;EAGrBC,SAAS,EAAEL,qBAAA,CAAUI,MAHA;EAIrBE,KAAK,EAAEN,qBAAA,CAAUC,MAJI;EAKrBM,SAAS,EAAEP,qBAAA,CAAUI,MALA;EAMrBrD,IAAI,EAAEiD,qBAAA,CAAUC,MAAV,CAAiBC,UANF;EAOrBlD,MAAM,EAAEgD,qBAAA,CAAUC,MAPG;EAQrBO,OAAO,EAAER,qBAAA,CAAUS,IARE;EASrBC,QAAQ,EAAEV,qBAAA,CAAUS,IATC;EAUrB/C,WAAW,EAAEsC,qBAAA,CAAUI,MAVF;EAWrBzC,QAAQ,EAAEqC,qBAAA,CAAUW,MAXC;EAYrBC,cAAc,EAAEZ,qBAAA,CAAUa,IAZL;EAarB/D,gBAAgB,EAAEkD,qBAAA,CAAUS;AAbP,CAAzB;;eAgBe,IAAAK,kBAAA,EAAW9E,MAAX,EAAmBO,YAAnB,C"}
|
|
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: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSendto);"],"mappings":";;;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AAnB,C"}
|
|
@@ -33,6 +33,8 @@ var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
|
33
33
|
|
|
34
34
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
35
35
|
|
|
36
|
+
var _Confirm = _interopRequireDefault(require("../../Dialogs/Confirm"));
|
|
37
|
+
|
|
36
38
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
37
39
|
|
|
38
40
|
var _Warning = _interopRequireDefault(require("@mui/icons-material/Warning"));
|
|
@@ -41,8 +43,6 @@ var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
|
41
43
|
|
|
42
44
|
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
43
45
|
|
|
44
|
-
var _Confirm = _interopRequireDefault(require("../../Dialogs/Confirm"));
|
|
45
|
-
|
|
46
46
|
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
47
|
|
|
48
48
|
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; } }
|