@iobroker/adapter-react-v5 3.0.16 → 3.1.1
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 +76 -57
- package/Components/FileBrowser.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.js +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +3 -3
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js +2 -2
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +25 -25
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +2 -2
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +94 -22
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +4 -0
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js +4 -4
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +2 -2
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +7 -7
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +6 -6
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +4 -4
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +26 -13
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/ObjectBrowser.js +39 -16
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/Utils.js +14 -3
- package/Components/Utils.js.map +1 -1
- package/Connection.js +12 -4
- package/Connection.js.map +1 -1
- package/README.md +7 -1
- package/i18n/de.json +24 -3
- package/i18n/en.json +23 -2
- package/i18n/es.json +23 -2
- package/i18n/fr.json +23 -2
- package/i18n/it.json +23 -2
- package/i18n/nl.json +23 -2
- package/i18n/pl.json +23 -2
- package/i18n/pt.json +23 -2
- package/i18n/ru.json +23 -2
- package/i18n/zh-cn.json +24 -3
- package/package.json +1 -1
|
@@ -117,7 +117,7 @@ var ConfigAlive = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
117
117
|
var instance = this.state.instance.replace(/^system.adapter./, '');
|
|
118
118
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
119
119
|
className: _Utils["default"].clsx(this.props.classes.root, !this.state.alive && this.props.classes.notAlive)
|
|
120
|
-
}, this.state.alive ? this.props.schema.textAlive !== undefined ? this.props.schema.textAlive ? _i18n["default"].t(this.props.schema.textAlive, instance) : '' : _i18n["default"].t('
|
|
120
|
+
}, this.state.alive ? this.props.schema.textAlive !== undefined ? this.props.schema.textAlive ? _i18n["default"].t(this.props.schema.textAlive, instance) : '' : _i18n["default"].t('ra_Instance %s is alive', instance) : this.props.schema.textNotAlive !== undefined ? this.props.schema.textNotAlive ? _i18n["default"].t(this.props.schema.textNotAlive, instance) : '' : _i18n["default"].t('ra_Instance %s is not alive', instance));
|
|
121
121
|
}
|
|
122
122
|
}]);
|
|
123
123
|
return ConfigAlive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigAlive.js","names":["styles","theme","root","width","notAlive","color","ConfigAlive","instance","getInstance","props","socket","getState","then","state","setState","alive","val","schema","adapterName","includes","getPattern","startsWith","setTimeout","replace","Utils","clsx","classes","textAlive","undefined","I18n","t","textNotAlive","ConfigGeneric","propTypes","PropTypes","object","isRequired","data","string","number","withStyles"],"sources":["JsonConfigComponent/ConfigAlive.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nimport I18n from '../../i18n';\nimport Utils from '../Utils';\n\nconst styles = theme => ({\n root: {\n width: '100%',\n },\n notAlive: {\n color: '#a30000'\n },\n});\n\nclass ConfigAlive extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n\n const instance = this.getInstance();\n\n this.props.socket.getState(instance + '.alive')\n .then(state => this.setState({alive: !!(state && state.val), instance}));\n }\n\n getInstance() {\n let instance = this.props.schema.instance || (this.props.adapterName + '.' + this.props.instance);\n if (instance.includes('${')) {\n instance = this.getPattern(instance);\n }\n if (instance && !instance.startsWith('system.adapter.')) {\n instance = 'system.adapter.' + instance;\n }\n return instance;\n }\n\n renderItem() {\n if (this.getInstance() !== this.state.instance) {\n setTimeout(() => {\n const instance = this.getInstance();\n if (instance) {\n this.props.socket.getState(instance + '.alive')\n .then(state => this.setState({alive: !!(state && state.val), instance}));\n } else {\n this.setState({alive: null, instance})\n }\n }, 200);\n }\n\n if (this.state.alive !== false && this.state.alive !== true) {\n return null;\n }\n\n const instance = this.state.instance.replace(/^system.adapter./, '');\n return <div className={Utils.clsx(this.props.classes.root, !this.state.alive && this.props.classes.notAlive)}>\n {this.state.alive ?\n this.props.schema.textAlive !== undefined ? (this.props.schema.textAlive ? I18n.t(this.props.schema.textAlive, instance) : '') : I18n.t('
|
|
1
|
+
{"version":3,"file":"ConfigAlive.js","names":["styles","theme","root","width","notAlive","color","ConfigAlive","instance","getInstance","props","socket","getState","then","state","setState","alive","val","schema","adapterName","includes","getPattern","startsWith","setTimeout","replace","Utils","clsx","classes","textAlive","undefined","I18n","t","textNotAlive","ConfigGeneric","propTypes","PropTypes","object","isRequired","data","string","number","withStyles"],"sources":["JsonConfigComponent/ConfigAlive.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nimport I18n from '../../i18n';\nimport Utils from '../Utils';\n\nconst styles = theme => ({\n root: {\n width: '100%',\n },\n notAlive: {\n color: '#a30000'\n },\n});\n\nclass ConfigAlive extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n\n const instance = this.getInstance();\n\n this.props.socket.getState(instance + '.alive')\n .then(state => this.setState({alive: !!(state && state.val), instance}));\n }\n\n getInstance() {\n let instance = this.props.schema.instance || (this.props.adapterName + '.' + this.props.instance);\n if (instance.includes('${')) {\n instance = this.getPattern(instance);\n }\n if (instance && !instance.startsWith('system.adapter.')) {\n instance = 'system.adapter.' + instance;\n }\n return instance;\n }\n\n renderItem() {\n if (this.getInstance() !== this.state.instance) {\n setTimeout(() => {\n const instance = this.getInstance();\n if (instance) {\n this.props.socket.getState(instance + '.alive')\n .then(state => this.setState({alive: !!(state && state.val), instance}));\n } else {\n this.setState({alive: null, instance})\n }\n }, 200);\n }\n\n if (this.state.alive !== false && this.state.alive !== true) {\n return null;\n }\n\n const instance = this.state.instance.replace(/^system.adapter./, '');\n return <div className={Utils.clsx(this.props.classes.root, !this.state.alive && this.props.classes.notAlive)}>\n {this.state.alive ?\n this.props.schema.textAlive !== undefined ? (this.props.schema.textAlive ? I18n.t(this.props.schema.textAlive, instance) : '') : I18n.t('ra_Instance %s is alive', instance)\n :\n this.props.schema.textNotAlive !== undefined ? (this.props.schema.textNotAlive ? I18n.t(this.props.schema.textNotAlive, instance) : '') : I18n.t('ra_Instance %s is not alive', instance)\n }\n </div>;\n }\n}\n\nConfigAlive.propTypes = {\n socket: PropTypes.object.isRequired,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n};\n\nexport default withStyles(styles)(ConfigAlive);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,IAAI,EAAE;MACFC,KAAK,EAAE;IADL,CADe;IAIrBC,QAAQ,EAAE;MACNC,KAAK,EAAE;IADD;EAJW,CAAL;AAAA,CAApB;;IASMC,W;;;;;;;;;;;;WACF,6BAAoB;MAAA;;MAChB;MAEA,IAAMC,QAAQ,GAAG,KAAKC,WAAL,EAAjB;MAEA,KAAKC,KAAL,CAAWC,MAAX,CAAkBC,QAAlB,CAA2BJ,QAAQ,GAAG,QAAtC,EACKK,IADL,CACU,UAAAC,KAAK;QAAA,OAAI,KAAI,CAACC,QAAL,CAAc;UAACC,KAAK,EAAE,CAAC,EAAEF,KAAK,IAAIA,KAAK,CAACG,GAAjB,CAAT;UAAgCT,QAAQ,EAARA;QAAhC,CAAd,CAAJ;MAAA,CADf;IAEH;;;WAED,uBAAc;MACV,IAAIA,QAAQ,GAAG,KAAKE,KAAL,CAAWQ,MAAX,CAAkBV,QAAlB,IAA+B,KAAKE,KAAL,CAAWS,WAAX,GAAyB,GAAzB,GAA+B,KAAKT,KAAL,CAAWF,QAAxF;;MACA,IAAIA,QAAQ,CAACY,QAAT,CAAkB,IAAlB,CAAJ,EAA6B;QACzBZ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A5E;MAAhB,GACF,KAAKS,KAAL,CAAWE,KAAX,GACG,KAAKN,KAAL,CAAWQ,MAAX,CAAkBU,SAAlB,KAAgCC,SAAhC,GAA6C,KAAKnB,KAAL,CAAWQ,MAAX,CAAkBU,SAAlB,GAA8BE,gBAAA,CAAKC,CAAL,CAAO,KAAKrB,KAAL,CAAWQ,MAAX,CAAkBU,SAAzB,EAAoCpB,QAApC,CAA9B,GAA8E,EAA3H,GAAiIsB,gBAAA,CAAKC,CAAL,CAAO,yBAAP,EAAkCvB,QAAlC,CADpI,GAGG,KAAKE,KAAL,CAAWQ,MAAX,CAAkBc,YAAlB,KAAmCH,SAAnC,GAAgD,KAAKnB,KAAL,CAAWQ,MAAX,CAAkBc,YAAlB,GAAiCF,gBAAA,CAAKC,CAAL,CAAO,KAAKrB,KAAL,CAAWQ,MAAX,CAAkBc,YAAzB,EAAuCxB,QAAvC,CAAjC,GAAoF,EAApI,GAA0IsB,gBAAA,CAAKC,CAAL,CAAO,6BAAP,EAAsCvB,QAAtC,CAJ3I,CAAP;IAOH;;;EA9CqByB,0B;;AAiD1B1B,WAAW,CAAC2B,SAAZ,GAAwB;EACpBvB,MAAM,EAAEwB,qBAAA,CAAUC,MAAV,CAAiBC,UADL;EAEpBC,IAAI,EAAEH,qBAAA,CAAUC,MAAV,CAAiBC,UAFH;EAGpBnB,MAAM,EAAEiB,qBAAA,CAAUC,MAHE;EAIpBjB,WAAW,EAAEgB,qBAAA,CAAUI,MAJH;EAKpB/B,QAAQ,EAAE2B,qBAAA,CAAUK;AALA,CAAxB;;eAQe,IAAAC,kBAAA,EAAWxC,MAAX,EAAmBM,WAAnB,C"}
|
|
@@ -137,7 +137,6 @@ var ConfigAutocomplete = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
137
137
|
fullWidth: true,
|
|
138
138
|
freeSolo: !!this.props.schema.freeSolo,
|
|
139
139
|
value: item // autoComplete
|
|
140
|
-
//getOptionSelected={(option, value) => option.value === value.value}
|
|
141
140
|
,
|
|
142
141
|
onInputChange: function onInputChange(e) {
|
|
143
142
|
if (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigAutocomplete.js","names":["styles","theme","fullWidth","width","ConfigAutocomplete","value","ConfigGeneric","getValue","props","data","attr","selectOptions","schema","options","map","item","label","JSON","parse","stringify","Array","isArray","unshift","DIFFERENT_LABEL","DIFFERENT_VALUE","setState","error","disabled","defaultValue","state","isIndeterminate","filter","val","find","it","forEach","push","toString","undefined","classes","indeterminate","freeSolo","e","target","onChange","_","option","params","getText","placeholder","renderHelp","help","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigAutocomplete.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport { Autocomplete, TextField } from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigAutocomplete extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n const selectOptions = this.props.schema.options.map(item => typeof item === 'string' ? {label: item, value: item} : JSON.parse(JSON.stringify(item)));\n\n // if __different\n if (Array.isArray(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 let item;\n let options = JSON.parse(JSON.stringify(this.state.selectOptions));\n let isIndeterminate = Array.isArray(this.state.value) || this.state.value === ConfigGeneric.DIFFERENT_LABEL;\n\n if (isIndeterminate) {\n [...this.state.value]\n .filter(val => !options.find(it => it.value === val))\n .forEach(item => options.push({label: item.toString(), value: item}));\n\n item = {label: ConfigGeneric.DIFFERENT_LABEL, value: ConfigGeneric.DIFFERENT_VALUE};\n options.unshift(item);\n } else {\n // eslint-disable-next-line\n item = this.state.value !== null && this.state.value !== undefined && options.find(item => item.value == this.state.value); // let \"==\" be and not ===\n if (this.state.value !== null && this.state.value !== undefined && !item) {\n item = {value: this.state.value, label: this.state.value};\n options.push(item);\n }\n }\n\n return <Autocomplete\n className={this.props.classes.indeterminate}\n fullWidth\n freeSolo={!!this.props.schema.freeSolo}\n value={item}\n // autoComplete\n
|
|
1
|
+
{"version":3,"file":"ConfigAutocomplete.js","names":["styles","theme","fullWidth","width","ConfigAutocomplete","value","ConfigGeneric","getValue","props","data","attr","selectOptions","schema","options","map","item","label","JSON","parse","stringify","Array","isArray","unshift","DIFFERENT_LABEL","DIFFERENT_VALUE","setState","error","disabled","defaultValue","state","isIndeterminate","filter","val","find","it","forEach","push","toString","undefined","classes","indeterminate","freeSolo","e","target","onChange","_","option","params","getText","placeholder","renderHelp","help","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigAutocomplete.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport { Autocomplete, TextField } from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigAutocomplete extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n\n const selectOptions = this.props.schema.options.map(item => typeof item === 'string' ? {label: item, value: item} : JSON.parse(JSON.stringify(item)));\n\n // if __different\n if (Array.isArray(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 let item;\n let options = JSON.parse(JSON.stringify(this.state.selectOptions));\n let isIndeterminate = Array.isArray(this.state.value) || this.state.value === ConfigGeneric.DIFFERENT_LABEL;\n\n if (isIndeterminate) {\n [...this.state.value]\n .filter(val => !options.find(it => it.value === val))\n .forEach(item => options.push({label: item.toString(), value: item}));\n\n item = {label: ConfigGeneric.DIFFERENT_LABEL, value: ConfigGeneric.DIFFERENT_VALUE};\n options.unshift(item);\n } else {\n // eslint-disable-next-line\n item = this.state.value !== null && this.state.value !== undefined && options.find(item => item.value == this.state.value); // let \"==\" be and not ===\n if (this.state.value !== null && this.state.value !== undefined && !item) {\n item = {value: this.state.value, label: this.state.value};\n options.push(item);\n }\n }\n\n return <Autocomplete\n className={this.props.classes.indeterminate}\n fullWidth\n freeSolo={!!this.props.schema.freeSolo}\n value={item}\n // autoComplete\n onInputChange={e => {\n if (e) {\n const val = e.target.value;\n if (val !== this.state.value) {\n this.setState({value: val}, () => this.onChange(this.props.attr, val));\n }\n }\n }}\n onChange={(_, value) => {\n const val = typeof value === 'object' ? (value ? value.value : '') : value;\n if (val !== this.state.value) {\n this.setState({value: val}, () => this.onChange(this.props.attr, val));\n }\n }}\n options={options}\n getOptionLabel={option => (option && option.label) || ''}\n renderInput={params => <TextField\n variant=\"standard\"\n {...params}\n error={!!error}\n // inputProps are important and will be given in params\n // inputProps={{maxLength: this.props.schema.maxLength || this.props.schema.max || undefined}}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n disabled={!!disabled}\n />}\n />;\n }\n}\n\nConfigAutocomplete.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: P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EAAE4C,qBAAA,CAAUC,MAPS;EAQ3BO,OAAO,EAAER,qBAAA,CAAUS,IARQ;EAS3BrB,QAAQ,EAAEY,qBAAA,CAAUS;AATO,CAA/B;;eAYe,IAAAC,kBAAA,EAAWlE,MAAX,EAAmBI,kBAAnB,C"}
|
|
@@ -150,7 +150,7 @@ var ConfigCRON = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}, "...")), showDialog ? /*#__PURE__*/_react["default"].createElement(_Cron["default"], {
|
|
153
|
-
title: _i18n["default"].t('
|
|
153
|
+
title: _i18n["default"].t('ra_Define schedule'),
|
|
154
154
|
simple: schema.simple,
|
|
155
155
|
complex: schema.complex,
|
|
156
156
|
cron: value,
|
|
@@ -160,8 +160,8 @@ var ConfigCRON = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
160
160
|
showDialog: false
|
|
161
161
|
});
|
|
162
162
|
},
|
|
163
|
-
cancel: _i18n["default"].t('
|
|
164
|
-
ok: _i18n["default"].t('
|
|
163
|
+
cancel: _i18n["default"].t('ra_Cancel'),
|
|
164
|
+
ok: _i18n["default"].t('ra_Ok'),
|
|
165
165
|
onOk: function onOk(value) {
|
|
166
166
|
return _this.setState({
|
|
167
167
|
showDialog: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCRON.js","names":["styles","theme","fullWidth","width","flex","display","button","height","marginLeft","minWidth","ConfigCRON","props","data","attr","value","ConfigGeneric","getValue","setState","error","disabled","defaultValue","classes","schema","state","showDialog","getText","label","placeholder","renderHelp","help","helpLink","noTranslation","e","target","onChange","I18n","t","simple","complex","getLanguage","propTypes","themeType","PropTypes","string","themeName","style","object","className","isRequired","onError","func","dateFormat","isFloatComma","bool","withStyles"],"sources":["JsonConfigComponent/ConfigCRON.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport FormControl from '@mui/material/FormControl';\nimport { Button, TextField } from '@mui/material';\n\nimport DialogCron from '../..//Dialogs/Cron';\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n flex: {\n display: 'flex'\n },\n button: {\n height: 48,\n marginLeft: 4,\n minWidth: 48,\n }\n});\n\nclass ConfigCRON extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr) || '';\n this.setState({ value});\n }\n\n renderItem(error, disabled, defaultValue) {\n const { classes, schema, attr } = this.props;\n const { value, showDialog } = this.state;\n\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(schema.label)}</InputLabel>\n <div className={classes.flex}>\n <TextField\n variant=\"standard\"\n fullWidth\n value={value}\n error={!!error}\n disabled={disabled}\n placeholder={this.getText(schema.placeholder)}\n label={this.getText(schema.label)}\n helperText={this.renderHelp(schema.help, schema.helpLink, schema.noTranslation)}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value }, () =>\n this.onChange(attr, value))\n }}\n />\n <Button\n color=\"grey\"\n className={this.props.classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showDialog: true })}\n >...</Button>\n </div>\n {showDialog ? <DialogCron\n title={I18n.t('
|
|
1
|
+
{"version":3,"file":"ConfigCRON.js","names":["styles","theme","fullWidth","width","flex","display","button","height","marginLeft","minWidth","ConfigCRON","props","data","attr","value","ConfigGeneric","getValue","setState","error","disabled","defaultValue","classes","schema","state","showDialog","getText","label","placeholder","renderHelp","help","helpLink","noTranslation","e","target","onChange","I18n","t","simple","complex","getLanguage","propTypes","themeType","PropTypes","string","themeName","style","object","className","isRequired","onError","func","dateFormat","isFloatComma","bool","withStyles"],"sources":["JsonConfigComponent/ConfigCRON.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport FormControl from '@mui/material/FormControl';\nimport { Button, TextField } from '@mui/material';\n\nimport DialogCron from '../..//Dialogs/Cron';\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n flex: {\n display: 'flex'\n },\n button: {\n height: 48,\n marginLeft: 4,\n minWidth: 48,\n }\n});\n\nclass ConfigCRON extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr) || '';\n this.setState({ value});\n }\n\n renderItem(error, disabled, defaultValue) {\n const { classes, schema, attr } = this.props;\n const { value, showDialog } = this.state;\n\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(schema.label)}</InputLabel>\n <div className={classes.flex}>\n <TextField\n variant=\"standard\"\n fullWidth\n value={value}\n error={!!error}\n disabled={disabled}\n placeholder={this.getText(schema.placeholder)}\n label={this.getText(schema.label)}\n helperText={this.renderHelp(schema.help, schema.helpLink, schema.noTranslation)}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value }, () =>\n this.onChange(attr, value))\n }}\n />\n <Button\n color=\"grey\"\n className={this.props.classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showDialog: true })}\n >...</Button>\n </div>\n {showDialog ? <DialogCron\n title={I18n.t('ra_Define schedule')}\n simple={schema.simple}\n complex={schema.complex}\n cron={value}\n language={I18n.getLanguage()}\n onClose={() => this.setState({ showDialog: false })}\n cancel={I18n.t('ra_Cancel')}\n ok={I18n.t('ra_Ok')}\n onOk={value =>\n this.setState({ showDialog: false, value }, () =>\n this.onChange(attr, value))}\n /> : null}\n </FormControl>;\n }\n}\n\nConfigCRON.propTypes = {\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 dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n};\n\nexport default withStyles(styles)(ConfigCRON);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CADU;IAIrBC,IAAI,EAAE;MACFC,OAAO,EAAE;IADP,CAJe;IAOrBC,MAAM,EAAE;MACJC,MAAM,EAAE,EADJ;MAEJC,UAAU,EAAE,CAFR;MAGJC,QAAQ,EAAE;IAHN;EAPa,CAAL;AAAA,CAApB;;IAcMC,U;;;;;;;;;;;;;6GACF;QAAA;;QAAA;UAAA;YAAA;cAAA;gBACI;gBADJ,cAE2B,KAAKC,KAFhC,EAEYC,IAFZ,eAEYA,IAFZ,EAEkBC,IAFlB,eAEkBA,IAFlB;gBAGUC,KAHV,GAGkBC,0BAAA,CAAcC,QAAd,CAAuBJ,IAAvB,EAA6BC,IAA7B,KAAsC,EAHxD;gBAII,KAAKI,QAAL,CAAc;kBAAEH,KAAK,EAALA;gBAAF,CAAd;;cAJJ;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAOA,oBAAWI,KAAX,EAAkBC,QAAlB,EAA4BC,YAA5B,EAA0C;MAAA;;MACtC,mBAAkC,KAAKT,KAAvC;MAAA,IAAQU,OAAR,gBAAQA,OAAR;MAAA,IAAiBC,MAAjB,gBAAiBA,MAAjB;MAAA,IAAyBT,IAAzB,gBAAyBA,IAAzB;MACA,kBAA8B,KAAKU,KAAnC;MAAA,IAAQT,KAAR,eAAQA,KAAR;MAAA,IAAeU,UAAf,eAAeA,UAAf;MAEA,oBAAO,gCAAC,uBAAD;QAAa,SAAS,EAAEH,OAAO,CAACnB,SAAhC;QAA2C,OAAO,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/*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], {
|
|
92
92
|
className: this.props.classes.error
|
|
93
|
-
}, error ? this.props.schema.validatorErrorText ? _i18n["default"].t(this.props.schema.validatorErrorText) : _i18n["default"].t('
|
|
93
|
+
}, error ? this.props.schema.validatorErrorText ? _i18n["default"].t(this.props.schema.validatorErrorText) : _i18n["default"].t('ra_Error') : null), this.props.schema.help ? /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
|
|
94
94
|
}
|
|
95
95
|
}]);
|
|
96
96
|
return ConfigCheckbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCheckbox.js","names":["styles","theme","error","color","ConfigCheckbox","disabled","value","ConfigGeneric","getValue","props","data","attr","isIndeterminate","Array","isArray","classes","fullWidth","e","preventDefault","stopPropagation","onChange","target","checked","getText","schema","label","validatorErrorText","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCheckbox.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n error: {\n color: 'red'\n }\n});\n\nclass ConfigCheckbox extends ConfigGeneric {\n renderItem(error, disabled) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let isIndeterminate = Array.isArray(value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <FormControlLabel\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n this.onChange(this.props.attr, !value);\n }}\n control={<Checkbox\n indeterminate={isIndeterminate}\n checked={!!value}\n onChange={e => {\n if (isIndeterminate) {\n this.onChange(this.props.attr, true);\n } else {\n this.onChange(this.props.attr, e.target.checked);\n }\n }}\n disabled={!!disabled}\n />}\n label={this.getText(this.props.schema.label)}\n />\n <FormHelperText className={this.props.classes.error}>{\n error ? (this.props.schema.validatorErrorText ? I18n.t(this.props.schema.validatorErrorText) : I18n.t('
|
|
1
|
+
{"version":3,"file":"ConfigCheckbox.js","names":["styles","theme","error","color","ConfigCheckbox","disabled","value","ConfigGeneric","getValue","props","data","attr","isIndeterminate","Array","isArray","classes","fullWidth","e","preventDefault","stopPropagation","onChange","target","checked","getText","schema","label","validatorErrorText","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCheckbox.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\n\nconst styles = theme => ({\n error: {\n color: 'red'\n }\n});\n\nclass ConfigCheckbox extends ConfigGeneric {\n renderItem(error, disabled) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let isIndeterminate = Array.isArray(value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <FormControlLabel\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n this.onChange(this.props.attr, !value);\n }}\n control={<Checkbox\n indeterminate={isIndeterminate}\n checked={!!value}\n onChange={e => {\n if (isIndeterminate) {\n this.onChange(this.props.attr, true);\n } else {\n this.onChange(this.props.attr, e.target.checked);\n }\n }}\n disabled={!!disabled}\n />}\n label={this.getText(this.props.schema.label)}\n />\n <FormHelperText className={this.props.classes.error}>{\n error ? (this.props.schema.validatorErrorText ? I18n.t(this.props.schema.validatorErrorText) : I18n.t('ra_Error')) :\n null}</FormHelperText>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>\n }\n}\n\nConfigCheckbox.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigCheckbox);"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,KAAK,EAAE;MACHC,KAAK,EAAE;IADJ;EADc,CAAL;AAAA,CAApB;;IAMMC,c;;;;;;;;;;;;WACF,oBAAWF,KAAX,EAAkBG,QAAlB,EAA4B;MAAA;;MACxB,IAAMC,KAAK,GAAGC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,CAAWC,IAAlC,EAAwC,KAAKD,KAAL,CAAWE,IAAnD,CAAd;;MACA,IAAIC,eAAe,GAAGC,KAAK,CAACC,OAAN,CAAcR,KAAd,CAAtB;MAEA,oBAAO,gCAAC,uBAAD;QAAa,SAAS,EAAE,KAAKG,KAAL,CAAWM,OAAX,CAAmBC,SAA3C;QAAsD,OAAO,EAAC;MAA9D,gBACH,gCAAC,4BAAD;QACA,OAAO,EAAE,iBAAAC,CAAC,EAAI;UACVA,CAAC,CAACC,cAAF;UACAD,CAAC,CAACE,eAAF;;UACA,KAAI,CAACC,QAAL,CAAc,KAAI,CAACX,KAAL,CAAWE,IAAzB,EAA+B,CAACL,KAAhC;QACH,CALD;QAMA,OAAO,eAAE,gCAAC,o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,EAAEL,qBAAA,CAAUI,MAHE;EAIvBE,KAAK,EAAEN,qBAAA,CAAUC,MAJM;EAKvBM,SAAS,EAAEP,qBAAA,CAAUI,MALE;EAMvB7B,IAAI,EAAEyB,qBAAA,CAAUC,MAAV,CAAiBC,UANA;EAOvBb,MAAM,EAAEW,qBAAA,CAAUC,MAPK;EAQvBO,OAAO,EAAER,qBAAA,CAAUS,IARI;EASvBxB,QAAQ,EAAEe,qBAAA,CAAUS;AATG,CAA3B;;eAYe,IAAAC,kBAAA,EAAW7C,MAAX,EAAmBI,cAAnB,C"}
|
|
@@ -79,13 +79,13 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
79
79
|
|
|
80
80
|
return this.props.socket.getSystemConfig().then(function (obj) {
|
|
81
81
|
if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {
|
|
82
|
-
window.alert(_i18n["default"].t('
|
|
82
|
+
window.alert(_i18n["default"].t('ra_Used system settings'));
|
|
83
83
|
|
|
84
84
|
_this2.setState({
|
|
85
85
|
value: obj.common.latitude + (_this2.props.schema.divider || ',') + obj.common.longitude
|
|
86
86
|
});
|
|
87
87
|
} else {
|
|
88
|
-
window.alert(_i18n["default"].t('
|
|
88
|
+
window.alert(_i18n["default"].t('ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser'));
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCoordinates.js","names":["styles","theme","width","ConfigCoordinates","value","ConfigGeneric","getValue","props","data","attr","schema","autoInit","setTimeout","getCoordinates","socket","getSystemConfig","then","obj","common","longitude","latitude","window","alert","I18n","t","setState","divider","navigator","geolocation","getCurrentPosition","position","coords","getSystemCoordinates","error","disabled","defaultValue","classes","state","undefined","maxLength","max","e","target","onChange","trim","getText","placeholder","label","renderHelp","help","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCoordinates.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\nimport Fab from '@mui/material/Fab';\n\nimport IconGpsFixed from '@mui/icons-material/GpsFixed';\n\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n width: {\n width: 'calc(100% - 40px)',\n }\n});\n\nclass ConfigCoordinates extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (!value && this.props.schema.autoInit) {\n setTimeout(() => this.getCoordinates(), 300);\n }\n }\n\n getSystemCoordinates() {\n return this.props.socket.getSystemConfig()\n .then(obj => {\n if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {\n window.alert(I18n.t('
|
|
1
|
+
{"version":3,"file":"ConfigCoordinates.js","names":["styles","theme","width","ConfigCoordinates","value","ConfigGeneric","getValue","props","data","attr","schema","autoInit","setTimeout","getCoordinates","socket","getSystemConfig","then","obj","common","longitude","latitude","window","alert","I18n","t","setState","divider","navigator","geolocation","getCurrentPosition","position","coords","getSystemCoordinates","error","disabled","defaultValue","classes","state","undefined","maxLength","max","e","target","onChange","trim","getText","placeholder","label","renderHelp","help","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCoordinates.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\nimport Fab from '@mui/material/Fab';\n\nimport IconGpsFixed from '@mui/icons-material/GpsFixed';\n\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n width: {\n width: 'calc(100% - 40px)',\n }\n});\n\nclass ConfigCoordinates extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (!value && this.props.schema.autoInit) {\n setTimeout(() => this.getCoordinates(), 300);\n }\n }\n\n getSystemCoordinates() {\n return this.props.socket.getSystemConfig()\n .then(obj => {\n if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {\n window.alert(I18n.t('ra_Used system settings'));\n this.setState({ value: obj.common.latitude + (this.props.schema.divider || ',') + obj.common.longitude });\n } else {\n window.alert(I18n.t('ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser'));\n }\n });\n }\n\n getCoordinates() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n if (position && position.coords) {\n this.setState({value: position.coords.latitude + (this.props.schema.divider || ',') + position.coords.longitude});\n } else {\n this.getSystemCoordinates();\n }\n },\n error => {\n this.getSystemCoordinates();\n }\n );\n } else {\n this.getSystemCoordinates();\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n return <>\n <TextField\n variant=\"standard\"\n className={this.props.classes.width}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{maxLength: this.props.schema.maxLength || this.props.schema.max || undefined}}\n onChange={e => {\n const value = e.target.value;\n this.setState({value}, () =>\n this.onChange(this.props.attr, (value || '').trim()));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />\n <Fab size=\"small\" onClick={() => this.getCoordinates()}><IconGpsFixed /></Fab>\n </>;\n }\n}\n\nConfigCoordinates.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)(ConfigCoordinates);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA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iBAAnB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCustom.js","names":["ConfigCustom","props","state","Component","error","schema","url","console","setState","startsWith","window","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","importFederation","format","from","component","keys","Object","item","xs","undefined","lg","md","sm","assign","marginBottom","textAlign","width","type","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\nimport i18n from '../../i18n';\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = i18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => i18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n i18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return ;\n } else {\n const schema = this.props.schema || {};\n\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 marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\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 }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings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,CAAP;UAIH,CALD,MAKO;YACH,OAAOA,IAAP;UACH;QACJ;MACJ;;MAED,oBAAO,gCAAC,SAAD,EAAe,KAAKzC,KAApB,CAAP;IACH;;;EA5GsBE,gB;;AA+G3BH,YAAY,CAAC2D,SAAb,GAAyB;EACrBC,MAAM,EAAEC,qBAAA,CAAUC,MADG;EAErBR,SAAS,EAAEO,qBAAA,CAAUE,MAFA;EAGrBC,SAAS,EAAEH,qBAAA,CAAUE,MAHA;EAIrBV,KAAK,EAAEQ,qBAAA,CAAUC,MAJI;EAKrBG,SAAS,EAAEJ,qBAAA,CAAUE,MALA;EAMrBG,IAAI,EAAEL,qBAAA,CAAUE,MANK;EAOrBrC,IAAI,EAAEmC,qBAAA,CAAUC,MAAV,CAAiBK,UAPF;EAQrB9D,MAAM,EAAEwD,qBAAA,CAAUC,MAAV,CAAiBK,UARJ;EASrBC,OAAO,EAAEP,qBAAA,CAAUQ,IATE;EAUrBC,QAAQ,EAAET,qBAAA,CAAUQ;AAVC,CAAzB;eAaerE,Y"}
|
|
1
|
+
{"version":3,"file":"ConfigCustom.js","names":["ConfigCustom","props","state","Component","error","schema","url","console","setState","startsWith","window","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","importFederation","format","from","component","keys","Object","item","xs","undefined","lg","md","sm","assign","marginBottom","textAlign","width","type","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\nimport i18n from '../../i18n';\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = i18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => i18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n i18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return;\n } else {\n const schema = this.props.schema || {};\n\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 marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\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 }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;IAEMA,Y;;;;;EACF,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN,EADe,CAEf;IACA;IACA;;IAEA,MAAKC,KAAL,GAAa;MACTC,SAAS,EAAE,IADF;MAETC,KAAK,EAAE;IAFE,CAAb;IANe;EAUlB,C,CAED;;;;;;6GACA;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA,IACS,KAAKH,KAAL,CAAWI,MAAX,CAAkBC,GAD3B;kBAAA;kBAAA;gBAAA;;gBAEQC,OAAO,CAACH,KAAR,CAAc,6CAAd;gBACA,KAAKI,QAAL,CAAc;kBAAEJ,KAAK,EAAE;gBAAT,CAAd;gBAHR;;cAAA;gBAQI,IAAI,KAAKH,KAAL,CAAWI,MAAX,CAAkBC,GAAlB,CAAsBG,UAAtB,CAAiC,OAAjC,KAA6C,KAAKR,KAAL,CAAWI,MAAX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zB;eAaerE,Y"}
|
|
@@ -86,9 +86,9 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
86
86
|
|
|
87
87
|
if (_this.props.schema) {
|
|
88
88
|
if (_this.props.custom) {
|
|
89
|
-
_this.defaultValue = _this.props.schema.defaultFunc ? _this.executeCustom(_this.props.schema.defaultFunc, _this.props.schema["default"], _this.props.data, _this.props.instanceObj) : _this.props.schema["default"];
|
|
89
|
+
_this.defaultValue = _this.props.schema.defaultFunc ? _this.executeCustom(_this.props.schema.defaultFunc, _this.props.schema["default"], _this.props.data, _this.props.instanceObj, _this.props.arrayIndex, _this.props.globalData) : _this.props.schema["default"];
|
|
90
90
|
} else {
|
|
91
|
-
_this.defaultValue = _this.props.schema.defaultFunc ? _this.execute(_this.props.schema.defaultFunc, _this.props.schema["default"], _this.props.data) : _this.props.schema["default"];
|
|
91
|
+
_this.defaultValue = _this.props.schema.defaultFunc ? _this.execute(_this.props.schema.defaultFunc, _this.props.schema["default"], _this.props.data, _this.props.arrayIndex, _this.props.globalData) : _this.props.schema["default"];
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -179,10 +179,10 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
return /*#__PURE__*/_react["default"].createElement(_Confirm["default"], {
|
|
182
|
-
title: this.getText(confirm.title) || _i18n["default"].t('
|
|
182
|
+
title: this.getText(confirm.title) || _i18n["default"].t('ra_Please confirm'),
|
|
183
183
|
text: this.getText(confirm.text),
|
|
184
|
-
ok: this.getText(confirm.ok) || _i18n["default"].t('
|
|
185
|
-
cancel: this.getText(confirm.cancel) || _i18n["default"].t('
|
|
184
|
+
ok: this.getText(confirm.ok) || _i18n["default"].t('ra_Ok'),
|
|
185
|
+
cancel: this.getText(confirm.cancel) || _i18n["default"].t('ra_Cancel'),
|
|
186
186
|
icon: icon,
|
|
187
187
|
onClose: function onClose(isOk) {
|
|
188
188
|
return _this3.setState({
|
|
@@ -231,7 +231,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
231
231
|
var data = JSON.parse(JSON.stringify(this.props.data));
|
|
232
232
|
ConfigGeneric.setValue(data, attr, newValue);
|
|
233
233
|
|
|
234
|
-
if (this.props.schema.confirm && this.execute(this.props.schema.confirm.condition, false, data)) {
|
|
234
|
+
if (this.props.schema.confirm && this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
|
|
235
235
|
return this.setState({
|
|
236
236
|
confirmDialog: true,
|
|
237
237
|
confirmNewValue: newValue,
|
|
@@ -247,7 +247,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
247
247
|
if (dep.confirm) {
|
|
248
248
|
var val = ConfigGeneric.getValue(data, dep.attr);
|
|
249
249
|
|
|
250
|
-
if (this.execute(dep.confirm.condition, false, data)) {
|
|
250
|
+
if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
|
|
251
251
|
return this.setState({
|
|
252
252
|
confirmDialog: true,
|
|
253
253
|
confirmNewValue: newValue,
|
|
@@ -270,7 +270,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
270
270
|
if (_dep.onChange) {
|
|
271
271
|
var _val = ConfigGeneric.getValue(data, _dep.attr);
|
|
272
272
|
|
|
273
|
-
var _newValue = this.props.custom ? this.executeCustom(_dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj) : this.execute(_dep.onChange.calculateFunc, _val, data);
|
|
273
|
+
var _newValue = this.props.custom ? this.executeCustom(_dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : this.execute(_dep.onChange.calculateFunc, _val, data, this.props.arrayIndex, this.props.globalData);
|
|
274
274
|
|
|
275
275
|
if (_newValue !== _val) {
|
|
276
276
|
ConfigGeneric.setValue(data, _dep.attr, _newValue);
|
|
@@ -304,7 +304,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
304
304
|
if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {
|
|
305
305
|
var _val2 = ConfigGeneric.getValue(data, this.props.attr);
|
|
306
306
|
|
|
307
|
-
var _newValue2 = this.props.custom ? this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj) : this.execute(this.props.schema.onChange.calculateFunc, _val2, data);
|
|
307
|
+
var _newValue2 = this.props.custom ? this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : this.execute(this.props.schema.onChange.calculateFunc, _val2, data, this.props.arrayIndex, this.props.globalData);
|
|
308
308
|
|
|
309
309
|
if (_newValue2 !== _val2) {
|
|
310
310
|
ConfigGeneric.setValue(data, this.props.attr, _newValue2);
|
|
@@ -327,7 +327,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
327
327
|
}
|
|
328
328
|
}, {
|
|
329
329
|
key: "execute",
|
|
330
|
-
value: function execute(func, defaultValue, data) {
|
|
330
|
+
value: function execute(func, defaultValue, data, arrayIndex, globalData) {
|
|
331
331
|
if (func && (0, _typeof2["default"])(func) === 'object') {
|
|
332
332
|
func = func.func;
|
|
333
333
|
}
|
|
@@ -337,8 +337,8 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
337
337
|
} else {
|
|
338
338
|
try {
|
|
339
339
|
// eslint-disable-next-line no-new-func
|
|
340
|
-
var f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', func.includes('return') ? func : 'return ' + func);
|
|
341
|
-
var result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance); // console.log(result);
|
|
340
|
+
var f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);
|
|
341
|
+
var result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData); // console.log(result);
|
|
342
342
|
|
|
343
343
|
return result;
|
|
344
344
|
} catch (e) {
|
|
@@ -349,7 +349,7 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
349
349
|
}
|
|
350
350
|
}, {
|
|
351
351
|
key: "executeCustom",
|
|
352
|
-
value: function executeCustom(func, data, customObj, instanceObj) {
|
|
352
|
+
value: function executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {
|
|
353
353
|
if (func && (0, _typeof2["default"])(func) === 'object') {
|
|
354
354
|
func = func.func;
|
|
355
355
|
}
|
|
@@ -359,8 +359,8 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
359
359
|
} else {
|
|
360
360
|
try {
|
|
361
361
|
// eslint-disable-next-line no-new-func
|
|
362
|
-
var f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', func.includes('return') ? func : 'return ' + func);
|
|
363
|
-
var result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket);
|
|
362
|
+
var f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);
|
|
363
|
+
var result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData);
|
|
364
364
|
console.log(result);
|
|
365
365
|
return result;
|
|
366
366
|
} catch (e) {
|
|
@@ -378,15 +378,15 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
378
378
|
var defaultValue;
|
|
379
379
|
|
|
380
380
|
if (this.props.custom) {
|
|
381
|
-
error = schema.validator ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj) : false;
|
|
382
|
-
disabled = schema.disabled ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj) : false;
|
|
383
|
-
hidden = schema.hidden ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj) : false;
|
|
384
|
-
defaultValue = schema.defaultFunc ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj) : schema["default"];
|
|
381
|
+
error = schema.validator ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;
|
|
382
|
+
disabled = schema.disabled ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;
|
|
383
|
+
hidden = schema.hidden ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;
|
|
384
|
+
defaultValue = schema.defaultFunc ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : schema["default"];
|
|
385
385
|
} else {
|
|
386
|
-
error = schema.validator ? !this.execute(schema.validator, false) : false;
|
|
387
|
-
disabled = schema.disabled ? this.execute(schema.disabled, false) : false;
|
|
388
|
-
hidden = schema.hidden ? this.execute(schema.hidden, false) : false;
|
|
389
|
-
defaultValue = schema.defaultFunc ? this.execute(schema.defaultFunc, schema["default"], this.props.data) : schema["default"];
|
|
386
|
+
error = schema.validator ? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;
|
|
387
|
+
disabled = schema.disabled ? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;
|
|
388
|
+
hidden = schema.hidden ? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;
|
|
389
|
+
defaultValue = schema.defaultFunc ? this.execute(schema.defaultFunc, schema["default"], this.props.data, this.props.arrayIndex, this.props.globalData) : schema["default"];
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
return {
|
|
@@ -616,9 +616,9 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
616
616
|
}(_react.Component);
|
|
617
617
|
|
|
618
618
|
(0, _defineProperty2["default"])(ConfigGeneric, "DIFFERENT_VALUE", '__different__');
|
|
619
|
-
(0, _defineProperty2["default"])(ConfigGeneric, "DIFFERENT_LABEL", _i18n["default"].t('
|
|
619
|
+
(0, _defineProperty2["default"])(ConfigGeneric, "DIFFERENT_LABEL", _i18n["default"].t('ra___different__'));
|
|
620
620
|
(0, _defineProperty2["default"])(ConfigGeneric, "NONE_VALUE", '');
|
|
621
|
-
(0, _defineProperty2["default"])(ConfigGeneric, "NONE_LABEL", _i18n["default"].t('
|
|
621
|
+
(0, _defineProperty2["default"])(ConfigGeneric, "NONE_LABEL", _i18n["default"].t('ra_none'));
|
|
622
622
|
(0, _defineProperty2["default"])(ConfigGeneric, "AsyncFunction", Object.getPrototypeOf( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
623
623
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
624
624
|
while (1) {
|