@iobroker/adapter-react-v5 3.0.2 → 3.0.3
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/JsonConfigComponent/ConfigAlive.js +5 -3
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +2 -2
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +7 -5
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js +8 -6
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigChip.js +5 -3
- package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigColor.js +9 -7
- package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustomEasyAccess.js +12 -10
- package/Components/JsonConfigComponent/ConfigCustomEasyAccess.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +3 -3
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +7 -5
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +8 -6
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +10 -8
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +7 -5
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +7 -5
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +6 -4
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +5 -5
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +5 -5
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +3 -3
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +4 -2
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +3 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +3 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +2 -2
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +2 -2
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +1 -1
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
|
@@ -19,15 +19,17 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
19
19
|
|
|
20
20
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
21
|
|
|
22
|
+
var _react = _interopRequireDefault(require("react"));
|
|
23
|
+
|
|
22
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
25
|
|
|
24
26
|
var _styles = require("@mui/styles");
|
|
25
27
|
|
|
26
28
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
27
29
|
|
|
28
|
-
var _i18n = _interopRequireDefault(require("
|
|
30
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
29
31
|
|
|
30
|
-
var _Utils = _interopRequireDefault(require("
|
|
32
|
+
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
31
33
|
|
|
32
34
|
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); }; }
|
|
33
35
|
|
|
@@ -113,7 +115,7 @@ var ConfigAlive = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
var instance = this.state.instance.replace(/^system.adapter./, '');
|
|
116
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
117
119
|
className: _Utils["default"].clsx(this.props.classes.root, !this.state.alive && this.props.classes.notAlive)
|
|
118
120
|
}, this.state.alive ? this.props.schema.textAlive !== undefined ? this.props.schema.textAlive ? _i18n["default"].t(this.props.schema.textAlive, instance) : '' : _i18n["default"].t('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('Instance %s is not alive', instance));
|
|
119
121
|
}
|
|
@@ -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 PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nimport I18n from '
|
|
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('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('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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,CAAUK;AALA,CAAxB;;eAQe,IAAAC,kBAAA,EAAWxC,MAAX,EAAmBM,WAAnB,C"}
|
|
@@ -35,9 +35,9 @@ var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
|
35
35
|
|
|
36
36
|
var _material = require("@mui/material");
|
|
37
37
|
|
|
38
|
-
var _Cron = _interopRequireDefault(require("
|
|
38
|
+
var _Cron = _interopRequireDefault(require("../..//Dialogs/Cron"));
|
|
39
39
|
|
|
40
|
-
var _i18n = _interopRequireDefault(require("
|
|
40
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
41
41
|
|
|
42
42
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
43
43
|
|
|
@@ -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 '
|
|
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('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('Cancel')}\n ok={I18n.t('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,U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ConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
23
23
|
|
|
24
24
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
25
|
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
|
+
|
|
26
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
29
|
|
|
28
30
|
var _styles = require("@mui/styles");
|
|
@@ -125,12 +127,12 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
125
127
|
var item = (_this$state$selectOpt = this.state.selectOptions) === null || _this$state$selectOpt === void 0 ? void 0 : _this$state$selectOpt.find(function (item) {
|
|
126
128
|
return item.value === _this2.state.value;
|
|
127
129
|
});
|
|
128
|
-
return /*#__PURE__*/
|
|
130
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
129
131
|
className: this.props.classes.fullWidth,
|
|
130
132
|
variant: "standard"
|
|
131
|
-
}, /*#__PURE__*/
|
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
132
134
|
shrink: true
|
|
133
|
-
}, this.getText(this.props.schema.label)), /*#__PURE__*/
|
|
135
|
+
}, this.getText(this.props.schema.label)), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
134
136
|
variant: "standard",
|
|
135
137
|
error: !!error,
|
|
136
138
|
displayEmpty: true,
|
|
@@ -147,14 +149,14 @@ var ConfigCertificateSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
147
149
|
});
|
|
148
150
|
}
|
|
149
151
|
}, (_this$state$selectOpt2 = this.state.selectOptions) === null || _this$state$selectOpt2 === void 0 ? void 0 : _this$state$selectOpt2.map(function (item) {
|
|
150
|
-
return /*#__PURE__*/
|
|
152
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
151
153
|
key: item.value,
|
|
152
154
|
value: item.value,
|
|
153
155
|
style: item.value === _ConfigGeneric2["default"].NONE_VALUE ? {
|
|
154
156
|
opacity: 0.5
|
|
155
157
|
} : {}
|
|
156
158
|
}, _this2.getText(item.label, _this2.props.schema.noTranslation !== false));
|
|
157
|
-
})), this.props.schema.help ? /*#__PURE__*/
|
|
159
|
+
})), 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);
|
|
158
160
|
}
|
|
159
161
|
}]);
|
|
160
162
|
return ConfigCertificateSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCertificateSelect.js","names":["styles","theme","fullWidth","width","ConfigCertificateSelect","value","ConfigGeneric","getValue","props","data","attr","socket","getCertificates","selectOptions","filter","el","toLowerCase","endsWith","type","map","label","name","unshift","NONE_LABEL","NONE_VALUE","setState","error","disabled","defaultValue","state","item","find","classes","getText","schema","val","noTranslation","e","target","onChange","opacity","help","renderHelp","helpLink","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCertificateSelect.jsx"],"sourcesContent":["import 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 ConfigCertificateSelect extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let selectOptions = await this.props.socket.getCertificates();\n\n selectOptions = selectOptions\n .filter(el => this.props.attr.toLowerCase().endsWith(el.type))\n .map(el => ({label: el.name, value: el.name}));\n\n selectOptions.unshift({label: ConfigGeneric.NONE_LABEL, value: ConfigGeneric.NONE_VALUE});\n\n this.setState({value, selectOptions});\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n // eslint-disable-next-line\n const item = this.state.selectOptions?.find(item => item.value === this.state.value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () =>\n this.onChange(this.props.attr, this.state.value))}\n >\n {this.state.selectOptions?.map(item =>\n <MenuItem\n key={item.value}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}>{\n this.getText(item.label, this.props.schema.noTranslation !== false)\n }</MenuItem>)}\n </Select>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigCertificateSelect.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigCertificateSelect);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;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,uB;;;;;;;;;;;;;6GACF;QAAA;;QAAA;QAAA;UAAA;YAAA;cAAA;gBACI;gBACMC,KAFV,GAEkBC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,C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Value","props","data","attr","socket","getCertificates","selectOptions","filter","el","toLowerCase","endsWith","type","map","label","name","unshift","NONE_LABEL","NONE_VALUE","setState","error","disabled","defaultValue","state","item","find","classes","getText","schema","val","noTranslation","e","target","onChange","opacity","help","renderHelp","helpLink","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCertificateSelect.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport Select from '@mui/material/Select';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigCertificateSelect extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let selectOptions = await this.props.socket.getCertificates();\n\n selectOptions = selectOptions\n .filter(el => this.props.attr.toLowerCase().endsWith(el.type))\n .map(el => ({label: el.name, value: el.name}));\n\n selectOptions.unshift({label: ConfigGeneric.NONE_LABEL, value: ConfigGeneric.NONE_VALUE});\n\n this.setState({value, selectOptions});\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.selectOptions) {\n return null;\n }\n // eslint-disable-next-line\n const item = this.state.selectOptions?.find(item => item.value === this.state.value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={val => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () =>\n this.onChange(this.props.attr, this.state.value))}\n >\n {this.state.selectOptions?.map(item =>\n <MenuItem\n key={item.value}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}>{\n this.getText(item.label, this.props.schema.noTranslation !== false)\n }</MenuItem>)}\n </Select>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigCertificateSelect.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigCertificateSelect);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA;EADU,CAAL;AAAA,CAApB;;IAMMC,uB;;;;;;;;;;;;;6GACF;QAAA;;QAAA;QAAA;UAAA;YAAA;cAAA;gBACI;gBACMC,KAFV,GAEkBC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,CAAWC,IAAlC,EAAwC,KAAKD,KAAL,CAAWE,IAAnD,CAFlB;gBAAA;gBAAA,OAG8B,KAAKF,KAAL,CAAWG,MAAX,CAAkBC,eAAlB,EAH9B;;cAAA;gBAGQC,aAHR;gBAKIA,aAAa,GAAGA,aAAa,CACxBC,MADW,CACJ,UAAAC,EAAE;kBAAA,OAAI,KAAI,CAACP,KAAL,CAAWE,IAAX,CAAgBM,WAAhB,GAA8BC,QAA9B,CAAuCF,EAAE,CAACG,IAA1C,CAAJ;gBAAA,CADE,EAEXC,GAFW,CAEP,UAAAJ,EAAE;kBAAA,OAAK;oBAACK,KAAK,EAAEL,EAAE,CAACM,IAAX;oBAAiBhB,KAA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BAAA,CAAUC,MAAV,CAAiBC,UADO;EAEhCC,SAAS,EAAEH,qBAAA,CAAUI,MAFW;EAGhCC,SAAS,EAAEL,qBAAA,CAAUI,MAHW;EAIhCE,KAAK,EAAEN,qBAAA,CAAUC,MAJe;EAKhCM,SAAS,EAAEP,qBAAA,CAAUI,MALW;EAMhCxC,IAAI,EAAEoC,qBAAA,CAAUC,MAAV,CAAiBC,UANS;EAOhCb,MAAM,EAAEW,qBAAA,CAAUC,MAPc;EAQhCO,OAAO,EAAER,qBAAA,CAAUS,IARa;EAShCf,QAAQ,EAAEM,qBAAA,CAAUS;AATY,CAApC;;eAYe,IAAAC,kBAAA,EAAWvD,MAAX,EAAmBI,uBAAnB,C"}
|
|
@@ -17,6 +17,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
17
17
|
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
20
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
23
|
|
|
22
24
|
var _styles = require("@mui/styles");
|
|
@@ -31,7 +33,7 @@ var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
|
31
33
|
|
|
32
34
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
33
35
|
|
|
34
|
-
var _i18n = _interopRequireDefault(require("
|
|
36
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
35
37
|
|
|
36
38
|
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
39
|
|
|
@@ -63,17 +65,17 @@ var ConfigCheckbox = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
63
65
|
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
64
66
|
|
|
65
67
|
var isIndeterminate = Array.isArray(value);
|
|
66
|
-
return /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
67
69
|
className: this.props.classes.fullWidth,
|
|
68
70
|
variant: "standard"
|
|
69
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
70
72
|
onClick: function onClick(e) {
|
|
71
73
|
e.preventDefault();
|
|
72
74
|
e.stopPropagation();
|
|
73
75
|
|
|
74
76
|
_this.onChange(_this.props.attr, !value);
|
|
75
77
|
},
|
|
76
|
-
control: /*#__PURE__*/
|
|
78
|
+
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
77
79
|
indeterminate: isIndeterminate,
|
|
78
80
|
checked: !!value,
|
|
79
81
|
onChange: function onChange(e) {
|
|
@@ -86,9 +88,9 @@ var ConfigCheckbox = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
86
88
|
disabled: !!disabled
|
|
87
89
|
}),
|
|
88
90
|
label: this.getText(this.props.schema.label)
|
|
89
|
-
}), /*#__PURE__*/
|
|
91
|
+
}), /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], {
|
|
90
92
|
className: this.props.classes.error
|
|
91
|
-
}, error ? this.props.schema.validatorErrorText ? _i18n["default"].t(this.props.schema.validatorErrorText) : _i18n["default"].t('Error') : null), this.props.schema.help ? /*#__PURE__*/
|
|
93
|
+
}, error ? this.props.schema.validatorErrorText ? _i18n["default"].t(this.props.schema.validatorErrorText) : _i18n["default"].t('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);
|
|
92
94
|
}
|
|
93
95
|
}]);
|
|
94
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 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 '
|
|
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('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,CA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AAL,CAAWe,MAAX,CAAkBK,IAAlC,EAAwC,KAAKpB,KAAL,CAAWe,MAAX,CAAkBO,QAA1D,EAAoE,KAAKtB,KAAL,CAAWe,MAAX,CAAkBQ,aAAtF,CAAjB,CAAzB,GAAmK,IAxB7J,CAAP;IA0BH;;;EA/BwBzB,0B;;AAkC7BH,cAAc,CAAC6B,SAAf,GAA2B;EACvBC,MAAM,EAAEC,qBAAA,CAAUC,MAAV,CAAiBC,UADF;EAEvBC,SAAS,EAAEH,qBAAA,CAAUI,MAFE;EAGvBC,SAAS,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"}
|
|
@@ -19,6 +19,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
19
19
|
|
|
20
20
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
21
|
|
|
22
|
+
var _react = _interopRequireDefault(require("react"));
|
|
23
|
+
|
|
22
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
25
|
|
|
24
26
|
var _styles = require("@mui/styles");
|
|
@@ -87,10 +89,10 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
87
89
|
attr = _this$props2.attr,
|
|
88
90
|
schema = _this$props2.schema;
|
|
89
91
|
var value = this.state.value;
|
|
90
|
-
return /*#__PURE__*/
|
|
92
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
91
93
|
className: this.props.classes.fullWidth,
|
|
92
94
|
variant: "standard"
|
|
93
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/_react["default"].createElement(_ChipInput["default"], {
|
|
94
96
|
value: value,
|
|
95
97
|
disabled: !!disabled,
|
|
96
98
|
label: this.getText(schema.label),
|
|
@@ -125,7 +127,7 @@ var ConfigLanguage = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
125
127
|
}
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
|
-
}), this.props.schema.help ? /*#__PURE__*/
|
|
130
|
+
}), 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);
|
|
129
131
|
}
|
|
130
132
|
}]);
|
|
131
133
|
return ConfigLanguage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigChip.js","names":["styles","theme","fullWidth","width","ConfigLanguage","props","data","attr","value","ConfigGeneric","getValue","schema","delimiter","parts","split","map","a","trim","filter","setState","error","disabled","defaultValue","state","classes","getText","label","chip","newValue","JSON","parse","stringify","push","prevValue","onChange","join","index","splice","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigChip.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ChipInput from './ChipInput';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigLanguage extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr);\n if (this.props.schema.delimiter && typeof value === 'string') {\n const parts = value.split(this.props.schema.delimiter).map(a => a.trim()).filter(a => a);\n this.setState({ value: parts });\n } else {\n this.setState({ value: value || [] });\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n const { attr,schema } = this.props;\n const { value } = this.state;\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <ChipInput\n value={value}\n disabled={!!disabled}\n label={this.getText(schema.label)}\n error={!!error}\n onAdd={chip => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.push(chip);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n onDelete={(chip, index) => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.splice(index, 1);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n />\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigLanguage.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigLanguage);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;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,c;;;;;;;;;;;;WACF,6BAAoB;MAChB;MACA,kBAAuB,KAAKC,KAA5B;MAAA,IAAQC,IAAR,eAAQA,IAAR;MAAA,IAAcC,IAAd,eAAcA,IAAd;;MACA,IAAMC,KAAK,GAAGC,0BAAA,CAAcC,QAAd,CAAuBJ,IAAvB,EAA6BC,IAA7B,CAAd;;MACA,IAAI,KAAKF,KAAL,CAAWM,MAAX,CAAkBC,SAAlB,IAA+B,OAAOJ,KAAP,KAAiB,QAApD,EAA8D;QAC1D,IAAMK,KAAK,GAAGL,KAAK,CAACM,KAAN,CAAY,KAAKT,KAAL,CAAWM,MAAX,CAAkBC,SAA9B,EAAyCG,GAAzC,CAA6C,UAAAC,CAAC;UAAA,OAAIA,CAAC,CAACC,IAAF,EAAJ;QAAA,CAA9C,EAA4DC,MAA5D,CAAmE,UAAAF,CAAC;UAAA,OAAIA,CAAJ;QAAA,CAApE,CAAd;QACA,KAAKG,QAAL,CAAc;UAAEX,KAAK,EAAEK;QAAT,CAAd;MACH,CAHD,MAGO;QACH,KAAKM,QAAL,CAAc;UAAEX,KAAK,EAAEA,KAAK,IAAI;QAAlB,CAAd;MACH;IACJ;;;WAED,oBAAWY,KAAX,EAAkBC,QAAlB,EAA4BC,YAA5B,EAA0C;MAAA;;MACtC,mBAAwB,KAAKjB,KAA7B;MAAA,IAAQE,IAAR,gBAAQA,IAAR;MAAA,IAAaI,MAAb,gBAAaA,MAAb;MACA,IAAQH,KAAR,GAAkB,KAAKe,KAAvB,CAAQf,KAAR;MACA,oBAAO,
|
|
1
|
+
{"version":3,"file":"ConfigChip.js","names":["styles","theme","fullWidth","width","ConfigLanguage","props","data","attr","value","ConfigGeneric","getValue","schema","delimiter","parts","split","map","a","trim","filter","setState","error","disabled","defaultValue","state","classes","getText","label","chip","newValue","JSON","parse","stringify","push","prevValue","onChange","join","index","splice","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigChip.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport ChipInput from './ChipInput';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigLanguage extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr);\n if (this.props.schema.delimiter && typeof value === 'string') {\n const parts = value.split(this.props.schema.delimiter).map(a => a.trim()).filter(a => a);\n this.setState({ value: parts });\n } else {\n this.setState({ value: value || [] });\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n const { attr,schema } = this.props;\n const { value } = this.state;\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <ChipInput\n value={value}\n disabled={!!disabled}\n label={this.getText(schema.label)}\n error={!!error}\n onAdd={chip => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.push(chip);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n onDelete={(chip, index) => {\n const newValue = JSON.parse(JSON.stringify(value));\n newValue.splice(index, 1);\n this.setState({ value: newValue, prevValue: '' }, () => {\n if (this.props.schema.delimiter) {\n this.onChange(attr, newValue.join(this.props.schema.delimiter + ' '));\n } else {\n this.onChange(attr, newValue);\n }\n });\n }}\n />\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigLanguage.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigLanguage);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;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I,CAAC9B,KAAL,CAAWM,MAAX,CAAkBC,SAAlB,GAA8B,GAA5C,CAApB;YACH,CAFD,MAEO;cACH,KAAI,CAACsB,QAAL,CAAc3B,IAAd,EAAoBqB,QAApB;YACH;UACJ,CAND;QAOH;MA1BL,EADG,EA6BF,KAAKvB,KAAL,CAAWM,MAAX,CAAkB2B,IAAlB,gBAAyB,gCAAC,0BAAD,QAAiB,KAAKC,UAAL,CAAgB,KAAKlC,KAAL,CAAWM,MAAX,CAAkB2B,IAAlC,EAAwC,KAAKjC,KAAL,CAAWM,MAAX,CAAkB6B,QAA1D,EAAoE,KAAKnC,KAAL,CAAWM,MAAX,CAAkB8B,aAAtF,CAAjB,CAAzB,GAAmK,IA7BjK,CAAP;IA+BH;;;EA/CwBhC,0B;;AAkD7BL,cAAc,CAACsC,SAAf,GAA2B;EACvBC,MAAM,EAAEC,qBAAA,CAAUC,MAAV,CAAiBC,UADF;EAEvBC,SAAS,EAAEH,qBAAA,CAAUI,MAFE;EAGvBC,SAAS,EAAEL,qBAAA,CAAUI,MAHE;EAIvBE,KAAK,EAAEN,qBAAA,CAAUC,MAJM;EAKvBM,SAAS,EAAEP,qBAAA,CAAUI,MALE;EAMvB1C,IAAI,EAAEsC,qBAAA,CAAUC,MAAV,CAAiBC,UANA;EAOvBnC,MAAM,EAAEiC,qBAAA,CAAUC,MAPK;EAQvBO,OAAO,EAAER,qBAAA,CAAUS,IARI;EASvBnB,QAAQ,EAAEU,qBAAA,CAAUS;AATG,CAA3B;;eAYe,IAAAC,kBAAA,EAAWtD,MAAX,EAAmBI,cAAnB,C"}
|
|
@@ -17,6 +17,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
17
17
|
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
20
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
23
|
|
|
22
24
|
var _styles = require("@mui/styles");
|
|
@@ -31,9 +33,9 @@ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
|
31
33
|
|
|
32
34
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
33
35
|
|
|
34
|
-
var _Utils = _interopRequireDefault(require("
|
|
36
|
+
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
35
37
|
|
|
36
|
-
var _ColorPicker = _interopRequireDefault(require("
|
|
38
|
+
var _ColorPicker = _interopRequireDefault(require("../ColorPicker"));
|
|
37
39
|
|
|
38
40
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
39
41
|
|
|
@@ -60,14 +62,14 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
60
62
|
value: function renderColorDialog() {
|
|
61
63
|
var _this = this;
|
|
62
64
|
|
|
63
|
-
return !!this.state.showColorDialog && /*#__PURE__*/
|
|
65
|
+
return !!this.state.showColorDialog && /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
64
66
|
onClose: function onClose() {
|
|
65
67
|
return _this.setState({
|
|
66
68
|
showColorDialog: false
|
|
67
69
|
});
|
|
68
70
|
},
|
|
69
71
|
open: this.state.showColorDialog
|
|
70
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactColor.ChromePicker, {
|
|
71
73
|
color: this.state.colorDialogValue,
|
|
72
74
|
onChange: function onChange(value) {
|
|
73
75
|
_this.setState({
|
|
@@ -91,7 +93,7 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
91
93
|
textColor = undefined;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderColorDialog(), /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
95
97
|
variant: "standard",
|
|
96
98
|
disabled: !!disabled,
|
|
97
99
|
style: {
|
|
@@ -119,7 +121,7 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
119
121
|
}
|
|
120
122
|
},
|
|
121
123
|
InputProps: {
|
|
122
|
-
endAdornment: value ? /*#__PURE__*/
|
|
124
|
+
endAdornment: value ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
123
125
|
disabled: !!this.props.onPaste,
|
|
124
126
|
size: "small",
|
|
125
127
|
onClick: function onClick(e) {
|
|
@@ -127,7 +129,7 @@ var ConfigColor = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
127
129
|
|
|
128
130
|
_this2.onChange(_this2.props.attr, '');
|
|
129
131
|
}
|
|
130
|
-
}, /*#__PURE__*/
|
|
132
|
+
}, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)) : undefined
|
|
131
133
|
},
|
|
132
134
|
InputLabelProps: {
|
|
133
135
|
shrink: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigColor.js","names":["styles","theme","ConfigColor","state","showColorDialog","setState","colorDialogValue","value","onChange","props","attr","ColorPicker","getColor","error","disabled","defaultValue","ConfigGeneric","getValue","data","textColor","Utils","isUseBright","undefined","renderColorDialog","minWidth","width","getText","schema","label","e","color","target","style","backgroundColor","endAdornment","onPaste","stopPropagation","shrink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigColor.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {withStyles} from '@mui/styles';\nimport { ChromePicker } from 'react-color';\n\nimport IconButton from '@mui/material/IconButton';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\n\nimport ClearIcon from '@mui/icons-material/Close';\n\nimport Utils from '
|
|
1
|
+
{"version":3,"file":"ConfigColor.js","names":["styles","theme","ConfigColor","state","showColorDialog","setState","colorDialogValue","value","onChange","props","attr","ColorPicker","getColor","error","disabled","defaultValue","ConfigGeneric","getValue","data","textColor","Utils","isUseBright","undefined","renderColorDialog","minWidth","width","getText","schema","label","e","color","target","style","backgroundColor","endAdornment","onPaste","stopPropagation","shrink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigColor.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@mui/styles';\nimport { ChromePicker } from 'react-color';\n\nimport IconButton from '@mui/material/IconButton';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\n\nimport ClearIcon from '@mui/icons-material/Close';\n\nimport Utils from '../Utils';\nimport ColorPicker from '../ColorPicker';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({});\n\nclass ConfigColor extends ConfigGeneric {\n renderColorDialog() {\n return !!this.state.showColorDialog && <Dialog\n onClose={() => this.setState({showColorDialog: false})}\n open={this.state.showColorDialog}>\n <ChromePicker\n color={this.state.colorDialogValue}\n onChange={value => {\n this.setState({colorDialogValue: value}, () =>\n this.onChange(this.props.attr, ColorPicker.getColor(this.state.colorDialogValue, true)));\n }}\n />\n </Dialog>;\n }\n\n renderItem(error, disabled, defaultValue) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let textColor = Utils.isUseBright(value, null);\n if (textColor === null) {\n textColor = undefined;\n }\n return <>\n { this.renderColorDialog() }\n <TextField\n variant=\"standard\"\n disabled={!!disabled}\n style={{minWidth: 100, width: 'calc(100% - 8px)'}}\n label={this.getText(this.props.schema.label)}\n value={value || ''}\n onClick={() => this.setState({showColorDialog: true, colorDialogValue: value})}\n onChange={e => {\n const color = e.target.value;\n this.onChange(this.props.attr, color);\n }}\n inputProps={{\n style: {\n //paddingLeft: noPadding ? 0 : 8,\n backgroundColor: value,\n color: textColor ? '#FFF' : '#000'\n }\n }}\n InputProps={{\n endAdornment: value ?\n <IconButton\n disabled={!!this.props.onPaste}\n size=\"small\"\n onClick={e => {\n e.stopPropagation();\n this.onChange(this.props.attr, '');\n }}>\n <ClearIcon/>\n </IconButton>\n : undefined,\n }}\n InputLabelProps={{shrink: true}}\n />\n </>;\n }\n}\n\nConfigColor.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)(ConfigColor);"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK,EAAL;AAAA,CAApB;;IAEMC,W;;;;;;;;;;;;WACF,6BAAoB;MAAA;;MAChB,OAAO,CAAC,CAAC,KAAKC,KAAL,CAAWC,eAAb,iBAAgC,gCAAC,kBAAD;QACnC,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,CAAc;YAACD,eAAe,EAAE;UAAlB,CAAd,CAAN;QAAA,CAD0B;QAEnC,IAAI,EAAE,KAAKD,KAAL,CAAWC;MAFkB,gBAGnC,gCAAC,wBAAD;QACI,KAAK,EAAE,KAAKD,KAAL,CAAWG,gBADtB;QAEI,QAAQ,EAAE,kBAAAC,KAAK,EAAI;UACf,KAAI,CAACF,QAAL,CAAc;YAACC,gBAAgB,EAAEC;UAAnB,CAAd,EAAyC;YAAA,OACrC,KAAI,CAACC,QAAL,CAAc,KAAI,CAACC,KAAL,CAAWC,IAAzB,EAA+BC,uBAAA,CAAYC,QAAZ,CAAqB,KAAI,CAACT,KAAL,CAAWG,gBAAhC,EAAkD,IAAlD,CAA/B,CADqC;UAAA,CAAzC;QAEH;MALL,EAHmC,CAAvC;IAWH;;;WAED,oBAAWO,KAAX,EAAkBC,QAAlB,EAA4BC,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OAAO,EAAE,iBAAAN,CAAC,EAAI;cACVA,CAAC,CAACO,eAAF;;cACA,MAAI,CAAC5B,QAAL,CAAc,MAAI,CAACC,KAAL,CAAWC,IAAzB,EAA+B,EAA/B;YACH;UANL,gBAOI,gCAAC,iBAAD,OAPJ,CADe,GAUbY;QAXE,CAlBhB;QA+BI,eAAe,EAAE;UAACe,MAAM,EAAE;QAAT;MA/BrB,EAFG,CAAP;IAoCH;;;EAzDqBrB,0B;;AA4D1Bd,WAAW,CAACoC,SAAZ,GAAwB;EACpBC,MAAM,EAAEC,qBAAA,CAAUC,MAAV,CAAiBC,UADL;EAEpBC,SAAS,EAAEH,qBAAA,CAAUI,MAFD;EAGpBC,SAAS,EAAEL,qBAAA,CAAUI,MAHD;EAIpBZ,KAAK,EAAEQ,qBAAA,CAAUC,MAJG;EAKpBK,SAAS,EAAEN,qBAAA,CAAUI,MALD;EAMpB1B,IAAI,EAAEsB,qBAAA,CAAUC,MAAV,CAAiBC,UANH;EAOpBf,MAAM,EAAEa,qBAAA,CAAUC,MAPE;EAQpBM,OAAO,EAAEP,qBAAA,CAAUQ,IARC;EASpBxC,QAAQ,EAAEgC,qBAAA,CAAUQ;AATA,CAAxB;;eAYe,IAAAC,kBAAA,EAAWjD,MAAX,EAAmBE,WAAnB,C"}
|
|
@@ -31,7 +31,7 @@ var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
|
|
|
31
31
|
|
|
32
32
|
var _GpsFixed = _interopRequireDefault(require("@mui/icons-material/GpsFixed"));
|
|
33
33
|
|
|
34
|
-
var _i18n = _interopRequireDefault(require("
|
|
34
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
35
35
|
|
|
36
36
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
37
37
|
|
|
@@ -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 '
|
|
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('Used system settings'));\n this.setState({value: obj.common.latitude + (this.props.schema.divider || ',') + obj.common.longitude});\n } else {\n window.alert(I18n.t('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":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;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 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
23
|
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
24
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
27
|
|
|
26
28
|
var _styles = require("@mui/styles");
|
|
@@ -39,7 +41,7 @@ var _TableRow = _interopRequireDefault(require("@mui/material/TableRow"));
|
|
|
39
41
|
|
|
40
42
|
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
41
43
|
|
|
42
|
-
var _i18n = _interopRequireDefault(require("
|
|
44
|
+
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
43
45
|
|
|
44
46
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
45
47
|
|
|
@@ -105,22 +107,22 @@ var ConfigCustomEasyAccess = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
105
107
|
} else {
|
|
106
108
|
var accessAllowedConfigs = _ConfigGeneric2["default"].getValue(this.props.data, 'accessAllowedConfigs') || [];
|
|
107
109
|
var accessAllowedTabs = _ConfigGeneric2["default"].getValue(this.props.data, 'accessAllowedTabs') || [];
|
|
108
|
-
return /*#__PURE__*/
|
|
110
|
+
return /*#__PURE__*/_react["default"].createElement(_TableContainer["default"], null, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
|
|
109
111
|
className: this.props.classes.table,
|
|
110
112
|
size: "small"
|
|
111
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/_react["default"].createElement(_TableHead["default"], null, /*#__PURE__*/_react["default"].createElement(_TableRow["default"], null, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
112
114
|
className: this.props.classes.header
|
|
113
|
-
}, _i18n["default"].t('Instance')), /*#__PURE__*/
|
|
115
|
+
}, _i18n["default"].t('Instance')), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
114
116
|
className: this.props.classes.header
|
|
115
|
-
}, _i18n["default"].t('Config')), /*#__PURE__*/
|
|
117
|
+
}, _i18n["default"].t('Config')), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
116
118
|
className: this.props.classes.header
|
|
117
|
-
}, _i18n["default"].t('Tab')))), /*#__PURE__*/
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
+
}, _i18n["default"].t('Tab')))), /*#__PURE__*/_react["default"].createElement(_TableBody["default"], null, this.state.instances.map(function (row) {
|
|
120
|
+
return /*#__PURE__*/_react["default"].createElement(_TableRow["default"], {
|
|
119
121
|
key: row.id
|
|
120
|
-
}, /*#__PURE__*/
|
|
122
|
+
}, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
121
123
|
component: "th",
|
|
122
124
|
scope: "row"
|
|
123
|
-
}, row.id), /*#__PURE__*/
|
|
125
|
+
}, row.id), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, row.config ? /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
124
126
|
checked: accessAllowedConfigs.includes(row.id),
|
|
125
127
|
onClick: function onClick() {
|
|
126
128
|
var _accessAllowedConfigs = (0, _toConsumableArray2["default"])(accessAllowedConfigs);
|
|
@@ -137,7 +139,7 @@ var ConfigCustomEasyAccess = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
137
139
|
|
|
138
140
|
_this2.onChange('accessAllowedConfigs', _accessAllowedConfigs);
|
|
139
141
|
}
|
|
140
|
-
}) : null), /*#__PURE__*/
|
|
142
|
+
}) : null), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, row.adminTab ? /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
141
143
|
checked: accessAllowedTabs.includes(row.id),
|
|
142
144
|
onClick: function onClick() {
|
|
143
145
|
var _accessAllowedTabs = (0, _toConsumableArray2["default"])(accessAllowedTabs);
|