@iobroker/adapter-react-v5 3.1.16 → 3.1.17

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.
@@ -114,7 +114,6 @@ function bufferToBase64(buffer) {
114
114
  }
115
115
  /**
116
116
  * @typedef {object} FileViewerProps
117
- * @property {string} [key] The key to identify this component.
118
117
  * @property {import('../types').Translator} t Translation function
119
118
  * @property {ioBroker.Languages} [lang] The selected language.
120
119
  * @property {boolean} [expertMode] Is expert mode enabled? (default: false)
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewer.js","names":["styles","theme","dialog","height","paper","content","textAlign","textarea","width","img","objectFit","dialogTitle","justifyContent","display","EXTENSIONS","images","code","txt","audio","video","bufferToBase64","buffer","binary","bytes","Uint8Array","len","byteLength","i","String","fromCharCode","window","btoa","FileViewer","props","id","fileName","size","state","changed","timeout","clearTimeout","setTimeout","alert","text","readFile","setState","forceUpdate","Date","now","parts","href","split","data","editingValue","splice","adapter","name","join","socket","writeFile64","Buffer","from","toString","then","_","onClose","e","ext","Utils","getFileExtension","editing","formatEditFile","copyPossible","includes","imgError","file","undefined","newState","type","detectMimeType","supportSubscribes","subscribeFiles","onFileChanged","clsx","classes","getClassBackgroundImage","target","onerror","newValue","readOnly","scrollPaper","t","setStateBackgroundImage","getContent","copyToClipboard","Component","propTypes","PropTypes","func","lang","string","expertMode","bool","isRequired","_export","withWidth","withStyles"],"sources":["FileViewer.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { withStyles } from '@mui/styles';\nimport PropTypes from 'prop-types';\n\nimport TextField from '@mui/material/TextField';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport { IconButton } from '@mui/material';\n\nimport IconNoIcon from '../icons/IconNoIcon';\nimport withWidth from './withWidth';\nimport Utils from './Utils';\n\n// Icons\nimport { FaCopy as CopyIcon } from 'react-icons/fa';\nimport Brightness5Icon from '@mui/icons-material/Brightness6';\nimport CloseIcon from '@mui/icons-material/Close';\nimport SaveIcon from '@mui/icons-material/Save';\n\nconst styles = theme => ({\n dialog: {\n height: '100%',\n },\n paper: {\n height: 'calc(100% - 64px)',\n },\n content: {\n textAlign: 'center',\n },\n textarea: {\n width: '100%',\n height: '100%',\n },\n img: {\n width: 'auto',\n height: 'calc(100% - 5px)',\n objectFit: 'contain',\n },\n dialogTitle: {\n justifyContent: 'space-between',\n display: 'flex'\n }\n});\n\nexport const EXTENSIONS = {\n images: ['png', 'jpg', 'svg', 'jpeg', 'bmp'],\n code: ['js', 'json', 'md'],\n txt: ['log', 'txt', 'html', 'css', 'xml'],\n audio: ['mp3', 'wav', 'ogg', 'acc'],\n video: ['mp4', 'mov', 'avi'],\n};\n\nfunction bufferToBase64(buffer) {\n let binary = '';\n let bytes = new Uint8Array(buffer);\n let len = bytes.byteLength;\n for (let i = 0; i < len && i < 50; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\n/**\n * @typedef {object} FileViewerProps\n * @property {string} [key] The key to identify this component.\n * @property {import('../types').Translator} t Translation function\n * @property {ioBroker.Languages} [lang] The selected language.\n * @property {boolean} [expertMode] Is expert mode enabled? (default: false)\n * @property {() => void} onClose Callback when the viewer is closed.\n * @property {string} href The URL to the file to be displayed.\n *\n * @extends {React.Component<FileViewerProps>}\n */\nclass FileViewer extends Component {\n /**\n * @param {Readonly<FileViewerProps>} props\n */\n constructor(props) {\n super(props);\n const ext = Utils.getFileExtension(this.props.href);\n\n this.state = {\n text: null,\n code: null,\n ext,\n editing: !!this.props.formatEditFile || false,\n editingValue: null,\n copyPossible: EXTENSIONS.code.includes(ext) || EXTENSIONS.txt.includes(ext),\n forceUpdate: Date.now(),\n changed: false,\n imgError: false,\n };\n }\n\n readFile() {\n if (this.props.href) {\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n\n this.props.socket.readFile(adapter, name)\n .then(data => {\n if (data.file !== undefined) {\n data = data.file;\n }\n\n const newState = {copyPossible: this.state.copyPossible};\n // try to detect valid extension\n if (data.type === 'Buffer') {\n const ext = Utils.detectMimeType(bufferToBase64(data.data));\n if (ext) {\n newState.ext = ext;\n newState.copyPossible = EXTENSIONS.code.includes(ext) || EXTENSIONS.txt.includes(ext);\n }\n }\n\n if (newState.copyPossible) {\n if (EXTENSIONS.txt.includes(this.state.ext)) {\n newState.text = data;\n newState.editingValue = data;\n } else if (EXTENSIONS.code.includes(this.state.ext)) {\n newState.code = data;\n newState.editingValue = data;\n }\n }\n\n this.setState(newState);\n })\n .catch(e => window.alert('Cannot read file: ' + e));\n }\n }\n\n componentDidMount() {\n this.readFile();\n\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n\n this.props.supportSubscribes && this.props.socket.subscribeFiles(adapter, name, this.onFileChanged);\n }\n\n componentWillUnmount() {\n this.timeout && clearTimeout(this.timeout);\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n this.props.supportSubscribes && this.props.socket.subscribeFiles(adapter, name, this.onFileChanged);\n }\n\n onFileChanged = (id, fileName, size) => {\n if (!this.state.changed) {\n this.timeout && clearTimeout(this.timeout);\n this.timeout = setTimeout(() => {\n this.timeout = null;\n if (size === null) {\n window.alert('Show file was deleted!');\n } else if (this.state.text !== null || this.state.code !== null) {\n this.readFile();\n } else {\n this.setState({ forceUpdate: Date.now() });\n }\n }, 300);\n }\n };\n\n writeFile64 = () => {\n const parts = this.props.href.split('/');\n const data = this.state.editingValue;\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n this.props.socket.writeFile64(adapter, name, Buffer.from(data).toString('base64'))\n .then(_ => this.props.onClose())\n .catch(e => window.alert('Cannot write file: ' + e));\n }\n\n getEditFile(ext) {\n switch (ext) {\n case 'json':\n return 'json';\n case 'js':\n return 'javascript';\n case 'html':\n return 'html';\n case 'txt':\n return 'html';\n default:\n return 'json';\n }\n }\n\n getContent() {\n if (EXTENSIONS.images.includes(this.state.ext)) {\n if (this.state.imgError) {\n return <IconNoIcon className={Utils.clsx(this.props.classes.img, this.props.getClassBackgroundImage())} />;\n } else {\n return <img\n onError={e => {\n e.target.onerror = null;\n this.setState({ imgError: true });\n }}\n className={Utils.clsx(this.props.classes.img, this.props.getClassBackgroundImage())}\n src={this.props.href + '?ts=' + this.state.forceUpdate}\n alt={this.props.href}\n />;\n }\n } else if (this.state.code !== null || this.state.text !== null || this.state.editing) {\n return <TextField\n variant=\"standard\"\n className={ this.props.classes.textarea }\n multiline\n value={ this.state.editingValue || this.state.code || this.state.text }\n onChange={newValue => this.setState({ editingValue: newValue, changed: true })}\n InputProps={{ readOnly: !this.state.editing,}}\n />;\n }\n }\n\n render() {\n return <Dialog\n classes={{ scrollPaper: this.props.classes.dialog, paper: this.props.classes.paper }}\n scroll=\"paper\"\n open={!!this.props.href}\n onClose={() => this.props.onClose()}\n fullWidth={true}\n maxWidth=\"xl\"\n aria-labelledby=\"form-dialog-title\"\n >\n <div className={this.props.classes.dialogTitle}>\n <DialogTitle id=\"form-dialog-title\">{this.props.t(this.state.editing ? 'Edit' : 'View') + ': ' + this.props.href}</DialogTitle>\n {EXTENSIONS.images.includes(this.state.ext) && <div>\n <IconButton size=\"large\"\n color={'inherit'}\n onClick={this.props.setStateBackgroundImage}\n >\n <Brightness5Icon />\n </IconButton>\n </div>\n }\n </div>\n <DialogContent className={this.props.classes.content}>\n {this.getContent()}\n </DialogContent>\n <DialogActions>\n {this.state.copyPossible ?\n <Button\n color=\"grey\"\n onClick={e => Utils.copyToClipboard(this.state.text || this.state.code, e)}\n startIcon={<CopyIcon />}\n >\n {this.props.t('Copy content')}\n </Button> : null}\n {this.state.editing ?\n <Button\n color=\"grey\"\n disabled={this.state.editingValue === this.state.code || this.state.editingValue === this.state.text}\n variant=\"contained\"\n onClick={this.writeFile64}\n startIcon={<SaveIcon />}\n >\n {this.props.t('Save')}\n </Button> : null}\n <Button\n variant=\"contained\"\n onClick={() => this.props.onClose()}\n color=\"primary\"\n startIcon={<CloseIcon />}\n >\n {this.props.t('Close')}\n </Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nFileViewer.propTypes = {\n t: PropTypes.func,\n lang: PropTypes.string,\n expertMode: PropTypes.bool,\n onClose: PropTypes.func,\n href: PropTypes.string.isRequired,\n supportSubscribes: PropTypes.bool,\n};\n\n/** @type {typeof FileViewer} */\nconst _export = withWidth()(withStyles(styles)(FileViewer));\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,MAAM,EAAE;MACJC,MAAM,EAAE;IADJ,CADa;IAIrBC,KAAK,EAAE;MACHD,MAAM,EAAE;IADL,CAJc;IAOrBE,OAAO,EAAE;MACLC,SAAS,EAAE;IADN,CAPY;IAUrBC,QAAQ,EAAE;MACNC,KAAK,EAAE,MADD;MAENL,MAAM,EAAE;IAFF,CAVW;IAcrBM,GAAG,EAAE;MACDD,KAAK,EAAE,MADN;MAEDL,MAAM,EAAE,kBAFP;MAGDO,SAAS,EAAE;IAHV,CAdgB;IAmBrBC,WAAW,EAAE;MACTC,cAAc,EAAE,eADP;MAETC,OAAO,EAAE;IAFA;EAnBQ,CAAL;AAAA,CAApB;;AAyBO,IAAMC,UAAU,GAAG;EACtBC,MAAM,EAAE,CAAC,KAAD,EAAQ,KAAR,EAAe,KAAf,EAAsB,MAAtB,EAA8B,KAA9B,CADc;EAEtBC,IAAI,EAAI,CAAC,IAAD,EAAO,MAAP,EAAe,IAAf,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AAL,CAAWgB,YAAX,KAA4B,KAAKhB,KAAL,CAAWrB,IAAvC,IAA+C,KAAKqB,KAAL,CAAWgB,YAAX,KAA4B,KAAKhB,KAAL,CAAWM,IAFpG;QAGI,OAAO,EAAC,WAHZ;QAII,OAAO,EAAE,KAAKgB,WAJlB;QAKI,SAAS,eAAE,gCAAC,gBAAD;MALf,GAOK,KAAK1B,KAAL,CAAW0D,CAAX,CAAa,MAAb,CAPL,CADH,GASe,IAlBpB,eAmBI,gCAAC,kBAAD;QACI,OAAO,EAAC,WADZ;QAEI,OAAO,EAAE;UAAA,OAAM,MAAI,CAAC1D,KAAL,CAAWgC,OAAX,EAAN;QAAA,CAFb;QAGI,KAAK,EAAC,SAHV;QAII,SAAS,eAAE,gCAAC,iBAAD;MAJf,GAMK,KAAKhC,KAAL,CAAW0D,CAAX,CAAa,OAAb,CANL,CAnBJ,CAxBG,CAAP;IAqDH;;;EA3MoBI,gB;;AA8MzB/D,UAAU,CAACgE,SAAX,GAAuB;EACnBL,CAAC,EAAEM,qBAAA,CAAUC,IADM;EAEnBC,IAAI,EAAEF,qBAAA,CAAUG,MAFG;EAGnBC,UAAU,EAAEJ,qBAAA,CAAUK,IAHH;EAInBrC,OAAO,EAAEgC,qBAAA,CAAUC,IAJA;EAKnBhD,IAAI,EAAE+C,qBAAA,CAAUG,MAAV,CAAiBG,UALJ;EAMnBvB,iBAAiB,EAAEiB,qBAAA,CAAUK;AANV,CAAvB;AASA;;AACA,IAAME,OAAO,GAAG,IAAAC,qBAAA,IAAY,IAAAC,kBAAA,EAAW1G,MAAX,EAAmBgC,UAAnB,CAAZ,CAAhB;;eACewE,O"}
1
+ {"version":3,"file":"FileViewer.js","names":["styles","theme","dialog","height","paper","content","textAlign","textarea","width","img","objectFit","dialogTitle","justifyContent","display","EXTENSIONS","images","code","txt","audio","video","bufferToBase64","buffer","binary","bytes","Uint8Array","len","byteLength","i","String","fromCharCode","window","btoa","FileViewer","props","id","fileName","size","state","changed","timeout","clearTimeout","setTimeout","alert","text","readFile","setState","forceUpdate","Date","now","parts","href","split","data","editingValue","splice","adapter","name","join","socket","writeFile64","Buffer","from","toString","then","_","onClose","e","ext","Utils","getFileExtension","editing","formatEditFile","copyPossible","includes","imgError","file","undefined","newState","type","detectMimeType","supportSubscribes","subscribeFiles","onFileChanged","clsx","classes","getClassBackgroundImage","target","onerror","newValue","readOnly","scrollPaper","t","setStateBackgroundImage","getContent","copyToClipboard","Component","propTypes","PropTypes","func","lang","string","expertMode","bool","isRequired","_export","withWidth","withStyles"],"sources":["FileViewer.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { withStyles } from '@mui/styles';\nimport PropTypes from 'prop-types';\n\nimport TextField from '@mui/material/TextField';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport { IconButton } from '@mui/material';\n\nimport IconNoIcon from '../icons/IconNoIcon';\nimport withWidth from './withWidth';\nimport Utils from './Utils';\n\n// Icons\nimport { FaCopy as CopyIcon } from 'react-icons/fa';\nimport Brightness5Icon from '@mui/icons-material/Brightness6';\nimport CloseIcon from '@mui/icons-material/Close';\nimport SaveIcon from '@mui/icons-material/Save';\n\nconst styles = theme => ({\n dialog: {\n height: '100%',\n },\n paper: {\n height: 'calc(100% - 64px)',\n },\n content: {\n textAlign: 'center',\n },\n textarea: {\n width: '100%',\n height: '100%',\n },\n img: {\n width: 'auto',\n height: 'calc(100% - 5px)',\n objectFit: 'contain',\n },\n dialogTitle: {\n justifyContent: 'space-between',\n display: 'flex'\n }\n});\n\nexport const EXTENSIONS = {\n images: ['png', 'jpg', 'svg', 'jpeg', 'bmp'],\n code: ['js', 'json', 'md'],\n txt: ['log', 'txt', 'html', 'css', 'xml'],\n audio: ['mp3', 'wav', 'ogg', 'acc'],\n video: ['mp4', 'mov', 'avi'],\n};\n\nfunction bufferToBase64(buffer) {\n let binary = '';\n let bytes = new Uint8Array(buffer);\n let len = bytes.byteLength;\n for (let i = 0; i < len && i < 50; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\n/**\n * @typedef {object} FileViewerProps\n * @property {import('../types').Translator} t Translation function\n * @property {ioBroker.Languages} [lang] The selected language.\n * @property {boolean} [expertMode] Is expert mode enabled? (default: false)\n * @property {() => void} onClose Callback when the viewer is closed.\n * @property {string} href The URL to the file to be displayed.\n *\n * @extends {React.Component<FileViewerProps>}\n */\nclass FileViewer extends Component {\n /**\n * @param {Readonly<FileViewerProps>} props\n */\n constructor(props) {\n super(props);\n const ext = Utils.getFileExtension(this.props.href);\n\n this.state = {\n text: null,\n code: null,\n ext,\n editing: !!this.props.formatEditFile || false,\n editingValue: null,\n copyPossible: EXTENSIONS.code.includes(ext) || EXTENSIONS.txt.includes(ext),\n forceUpdate: Date.now(),\n changed: false,\n imgError: false,\n };\n }\n\n readFile() {\n if (this.props.href) {\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n\n this.props.socket.readFile(adapter, name)\n .then(data => {\n if (data.file !== undefined) {\n data = data.file;\n }\n\n const newState = {copyPossible: this.state.copyPossible};\n // try to detect valid extension\n if (data.type === 'Buffer') {\n const ext = Utils.detectMimeType(bufferToBase64(data.data));\n if (ext) {\n newState.ext = ext;\n newState.copyPossible = EXTENSIONS.code.includes(ext) || EXTENSIONS.txt.includes(ext);\n }\n }\n\n if (newState.copyPossible) {\n if (EXTENSIONS.txt.includes(this.state.ext)) {\n newState.text = data;\n newState.editingValue = data;\n } else if (EXTENSIONS.code.includes(this.state.ext)) {\n newState.code = data;\n newState.editingValue = data;\n }\n }\n\n this.setState(newState);\n })\n .catch(e => window.alert('Cannot read file: ' + e));\n }\n }\n\n componentDidMount() {\n this.readFile();\n\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n\n this.props.supportSubscribes && this.props.socket.subscribeFiles(adapter, name, this.onFileChanged);\n }\n\n componentWillUnmount() {\n this.timeout && clearTimeout(this.timeout);\n const parts = this.props.href.split('/');\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n this.props.supportSubscribes && this.props.socket.subscribeFiles(adapter, name, this.onFileChanged);\n }\n\n onFileChanged = (id, fileName, size) => {\n if (!this.state.changed) {\n this.timeout && clearTimeout(this.timeout);\n this.timeout = setTimeout(() => {\n this.timeout = null;\n if (size === null) {\n window.alert('Show file was deleted!');\n } else if (this.state.text !== null || this.state.code !== null) {\n this.readFile();\n } else {\n this.setState({ forceUpdate: Date.now() });\n }\n }, 300);\n }\n };\n\n writeFile64 = () => {\n const parts = this.props.href.split('/');\n const data = this.state.editingValue;\n parts.splice(0, 2);\n const adapter = parts[0];\n const name = parts.splice(1).join('/');\n this.props.socket.writeFile64(adapter, name, Buffer.from(data).toString('base64'))\n .then(_ => this.props.onClose())\n .catch(e => window.alert('Cannot write file: ' + e));\n }\n\n getEditFile(ext) {\n switch (ext) {\n case 'json':\n return 'json';\n case 'js':\n return 'javascript';\n case 'html':\n return 'html';\n case 'txt':\n return 'html';\n default:\n return 'json';\n }\n }\n\n getContent() {\n if (EXTENSIONS.images.includes(this.state.ext)) {\n if (this.state.imgError) {\n return <IconNoIcon className={Utils.clsx(this.props.classes.img, this.props.getClassBackgroundImage())} />;\n } else {\n return <img\n onError={e => {\n e.target.onerror = null;\n this.setState({ imgError: true });\n }}\n className={Utils.clsx(this.props.classes.img, this.props.getClassBackgroundImage())}\n src={this.props.href + '?ts=' + this.state.forceUpdate}\n alt={this.props.href}\n />;\n }\n } else if (this.state.code !== null || this.state.text !== null || this.state.editing) {\n return <TextField\n variant=\"standard\"\n className={ this.props.classes.textarea }\n multiline\n value={ this.state.editingValue || this.state.code || this.state.text }\n onChange={newValue => this.setState({ editingValue: newValue, changed: true })}\n InputProps={{ readOnly: !this.state.editing,}}\n />;\n }\n }\n\n render() {\n return <Dialog\n classes={{ scrollPaper: this.props.classes.dialog, paper: this.props.classes.paper }}\n scroll=\"paper\"\n open={!!this.props.href}\n onClose={() => this.props.onClose()}\n fullWidth={true}\n maxWidth=\"xl\"\n aria-labelledby=\"form-dialog-title\"\n >\n <div className={this.props.classes.dialogTitle}>\n <DialogTitle id=\"form-dialog-title\">{this.props.t(this.state.editing ? 'Edit' : 'View') + ': ' + this.props.href}</DialogTitle>\n {EXTENSIONS.images.includes(this.state.ext) && <div>\n <IconButton size=\"large\"\n color={'inherit'}\n onClick={this.props.setStateBackgroundImage}\n >\n <Brightness5Icon />\n </IconButton>\n </div>\n }\n </div>\n <DialogContent className={this.props.classes.content}>\n {this.getContent()}\n </DialogContent>\n <DialogActions>\n {this.state.copyPossible ?\n <Button\n color=\"grey\"\n onClick={e => Utils.copyToClipboard(this.state.text || this.state.code, e)}\n startIcon={<CopyIcon />}\n >\n {this.props.t('Copy content')}\n </Button> : null}\n {this.state.editing ?\n <Button\n color=\"grey\"\n disabled={this.state.editingValue === this.state.code || this.state.editingValue === this.state.text}\n variant=\"contained\"\n onClick={this.writeFile64}\n startIcon={<SaveIcon />}\n >\n {this.props.t('Save')}\n </Button> : null}\n <Button\n variant=\"contained\"\n onClick={() => this.props.onClose()}\n color=\"primary\"\n startIcon={<CloseIcon />}\n >\n {this.props.t('Close')}\n </Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nFileViewer.propTypes = {\n t: PropTypes.func,\n lang: PropTypes.string,\n expertMode: PropTypes.bool,\n onClose: PropTypes.func,\n href: PropTypes.string.isRequired,\n supportSubscribes: PropTypes.bool,\n};\n\n/** @type {typeof FileViewer} */\nconst _export = withWidth()(withStyles(styles)(FileViewer));\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;A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A8MzB/D,UAAU,CAACgE,SAAX,GAAuB;EACnBL,CAAC,EAAEM,qBAAA,CAAUC,IADM;EAEnBC,IAAI,EAAEF,qBAAA,CAAUG,MAFG;EAGnBC,UAAU,EAAEJ,qBAAA,CAAUK,IAHH;EAInBrC,OAAO,EAAEgC,qBAAA,CAAUC,IAJA;EAKnBhD,IAAI,EAAE+C,qBAAA,CAAUG,MAAV,CAAiBG,UALJ;EAMnBvB,iBAAiB,EAAEiB,qBAAA,CAAUK;AANV,CAAvB;AASA;;AACA,IAAME,OAAO,GAAG,IAAAC,qBAAA,IAAY,IAAAC,kBAAA,EAAW1G,MAAX,EAAmBgC,UAAnB,CAAZ,CAAhB;;eACewE,O"}
@@ -67,7 +67,6 @@ function serializeAttrs(map) {
67
67
  }
68
68
  /**
69
69
  * @typedef {object} ImageProps
70
- * @property {string} [key] The key to identify this component.
71
70
  * @property {string} [color] The color.
72
71
  * @property {string} [src] The source of the image.
73
72
  * @property {string} [imagePrefix] The image prefix (default: './files/')
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","names":["getElementFromSource","src","svgContainer","document","createElement","innerHTML","svg","firstElementChild","remove","removeChild","serializeAttrs","map","ret","prop","i","length","key","name","startsWith","replace","g","toUpperCase","value","Image","props","state","created","color","imgError","showError","getSvgFromData","len","substring","atob","inner","svgProps","attributes","className","__html","e","setTimeout","setState","imagePrefix","newState","changed","React","Component","propTypes","PropTypes","string","isRequired"],"sources":["Image.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport IconNoIcon from '../icons/IconNoIcon';\n\nfunction getElementFromSource(src) {\n const svgContainer = document.createElement('div');\n svgContainer.innerHTML = src;\n const svg = svgContainer.firstElementChild;\n if (svg.remove) {\n svg.remove();\n } else {\n svgContainer.removeChild(svg);\n }\n\n svgContainer.remove();\n return svg;\n}\n\nfunction serializeAttrs(map) {\n const ret = {};\n for (let prop, i = 0; i < map.length; i++) {\n const key = map[i].name;\n if (key === 'class') {\n prop = 'className';\n }\n else if (!key.startsWith('data-')) {\n prop = key.replace(/[-|:]([a-z])/g, g => g[1].toUpperCase());\n } else {\n prop = key;\n }\n\n ret[prop] = map[i].value;\n }\n return ret;\n}\n\n/**\n * @typedef {object} ImageProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [color] The color.\n * @property {string} [src] The source of the image.\n * @property {string} [imagePrefix] The image prefix (default: './files/')\n * @property {string} [className] The CSS class name.\n * @property {boolean} [showError] Show image errors (or just show no image)?\n *\n * @extends {React.Component<ImageProps>}\n */\nclass Image extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n svg: !!(this.props.src && this.props.src.startsWith('data:')),\n created: true,\n color: this.props.color || '',\n src: this.props.src || '',\n imgError: false,\n showError: this.props.showError,\n };\n\n this.svg = this.state.svg ? this.getSvgFromData(this.state.src) : null;\n }\n\n static getDerivedStateFromProps(props, state) {\n const newState = {};\n let changed = false;\n\n if (props && state && props.src !== state.src) {\n newState.src = props.src;\n newState.svg = props.src && props.src.startsWith('data:');\n newState.created = false;\n changed = true;\n }\n\n if (props && state && props.color !== state.color) {\n newState.color = props.color;\n newState.created = false;\n changed = true;\n }\n\n if (props && state && props.showError !== state.showError) {\n newState.showError = props.showError;\n changed = true;\n }\n\n return changed ? newState : null;\n }\n\n getSvgFromData(src) {\n const len = 'data:image/svg+xml;base64,';\n if (!src.startsWith(len)) {\n return null;\n }\n src = src.substring(len.length);\n try {\n src = atob(src);\n const svg = getElementFromSource(src);\n const inner = svg.innerHTML;\n const svgProps = serializeAttrs(svg.attributes || []);\n\n svg.remove();\n\n return <svg\n className={this.props.className}\n style={this.state.color ? {color: this.state.color} : {}}\n {...svgProps}\n dangerouslySetInnerHTML={{ __html: inner }}\n />;\n } catch (e) {\n\n }\n return null;\n }\n\n render() {\n if (this.state.svg) {\n if (!this.state.created) {\n setTimeout(() => {\n this.svg = this.getSvgFromData(this.state.src);\n this.setState({created: true});\n }, 50);\n }\n\n return this.svg;\n } else if (this.state.src) {\n if (this.state.imgError || !this.state.src) {\n return <IconNoIcon className={this.props.className} />;\n } else {\n return <img\n className={this.props.className}\n src={(this.props.imagePrefix || '') + this.state.src}\n alt=\"\"\n onError={() => this.props.showError ? this.setState({imgError: true}) : this.setState({src: ''})}\n />;\n }\n } else {\n return null;\n }\n }\n}\n\nImage.propTypes = {\n color: PropTypes.string,\n src: PropTypes.string.isRequired,\n className: PropTypes.string,\n imagePrefix: PropTypes.string,\n};\n\nexport default Image;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA,SAASA,oBAAT,CAA8BC,GAA9B,EAAmC;EAC/B,IAAMC,YAAY,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAArB;EACAF,YAAY,CAACG,SAAb,GAAyBJ,GAAzB;EACA,IAAMK,GAAG,GAAGJ,YAAY,CAACK,iBAAzB;;EACA,IAAID,GAAG,CAACE,MAAR,EAAgB;IACZF,GAAG,CAACE,MAAJ;EACH,CAFD,MAEO;IACHN,YAAY,CAACO,WAAb,CAAyBH,GAAzB;EACH;;EAEDJ,YAAY,CAACM,MAAb;EACA,OAAOF,GAAP;AACH;;AAED,SAASI,cAAT,CAAwBC,GAAxB,EAA6B;EACzB,IAAMC,GAAG,GAAG,EAAZ;;EACA,KAAK,IAAIC,IAAJ,EAAUC,CAAC,GAAG,CAAnB,EAAsBA,CAAC,GAAGH,GAAG,CAACI,MAA9B,EAAsCD,CAAC,EAAvC,EAA2C;IACvC,IAAME,GAAG,GAAGL,GAAG,CAACG,CAAD,CAAH,CAAOG,IAAnB;;IACA,IAAID,GAAG,KAAK,OAAZ,EAAqB;MACjBH,IAAI,GAAG,WAAP;IACH,CAFD,MAGK,IAAI,CAACG,GAAG,CAACE,UAAJ,CAAe,OAAf,CAAL,EAA8B;MAC/BL,IAAI,GAAGG,GAAG,CAACG,OAAJ,CAAY,eAAZ,EAA6B,UAAAC,CAAC;QAAA,OAAIA,CAAC,CAAC,CAAD,CAAD,CAAKC,W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AAK,CAACwB,SAAN,GAAkB;EACdpB,KAAK,EAAEqB,qBAAA,CAAUC,MADH;EAEdhD,GAAG,EAAE+C,qBAAA,CAAUC,MAAV,CAAiBC,UAFR;EAGdb,SAAS,EAAEW,qBAAA,CAAUC,MAHP;EAIdP,WAAW,EAAEM,qBAAA,CAAUC;AAJT,CAAlB;eAOe1B,K"}
1
+ {"version":3,"file":"Image.js","names":["getElementFromSource","src","svgContainer","document","createElement","innerHTML","svg","firstElementChild","remove","removeChild","serializeAttrs","map","ret","prop","i","length","key","name","startsWith","replace","g","toUpperCase","value","Image","props","state","created","color","imgError","showError","getSvgFromData","len","substring","atob","inner","svgProps","attributes","className","__html","e","setTimeout","setState","imagePrefix","newState","changed","React","Component","propTypes","PropTypes","string","isRequired"],"sources":["Image.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport IconNoIcon from '../icons/IconNoIcon';\n\nfunction getElementFromSource(src) {\n const svgContainer = document.createElement('div');\n svgContainer.innerHTML = src;\n const svg = svgContainer.firstElementChild;\n if (svg.remove) {\n svg.remove();\n } else {\n svgContainer.removeChild(svg);\n }\n\n svgContainer.remove();\n return svg;\n}\n\nfunction serializeAttrs(map) {\n const ret = {};\n for (let prop, i = 0; i < map.length; i++) {\n const key = map[i].name;\n if (key === 'class') {\n prop = 'className';\n }\n else if (!key.startsWith('data-')) {\n prop = key.replace(/[-|:]([a-z])/g, g => g[1].toUpperCase());\n } else {\n prop = key;\n }\n\n ret[prop] = map[i].value;\n }\n return ret;\n}\n\n/**\n * @typedef {object} ImageProps\n * @property {string} [color] The color.\n * @property {string} [src] The source of the image.\n * @property {string} [imagePrefix] The image prefix (default: './files/')\n * @property {string} [className] The CSS class name.\n * @property {boolean} [showError] Show image errors (or just show no image)?\n *\n * @extends {React.Component<ImageProps>}\n */\nclass Image extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n svg: !!(this.props.src && this.props.src.startsWith('data:')),\n created: true,\n color: this.props.color || '',\n src: this.props.src || '',\n imgError: false,\n showError: this.props.showError,\n };\n\n this.svg = this.state.svg ? this.getSvgFromData(this.state.src) : null;\n }\n\n static getDerivedStateFromProps(props, state) {\n const newState = {};\n let changed = false;\n\n if (props && state && props.src !== state.src) {\n newState.src = props.src;\n newState.svg = props.src && props.src.startsWith('data:');\n newState.created = false;\n changed = true;\n }\n\n if (props && state && props.color !== state.color) {\n newState.color = props.color;\n newState.created = false;\n changed = true;\n }\n\n if (props && state && props.showError !== state.showError) {\n newState.showError = props.showError;\n changed = true;\n }\n\n return changed ? newState : null;\n }\n\n getSvgFromData(src) {\n const len = 'data:image/svg+xml;base64,';\n if (!src.startsWith(len)) {\n return null;\n }\n src = src.substring(len.length);\n try {\n src = atob(src);\n const svg = getElementFromSource(src);\n const inner = svg.innerHTML;\n const svgProps = serializeAttrs(svg.attributes || []);\n\n svg.remove();\n\n return <svg\n className={this.props.className}\n style={this.state.color ? {color: this.state.color} : {}}\n {...svgProps}\n dangerouslySetInnerHTML={{ __html: inner }}\n />;\n } catch (e) {\n\n }\n return null;\n }\n\n render() {\n if (this.state.svg) {\n if (!this.state.created) {\n setTimeout(() => {\n this.svg = this.getSvgFromData(this.state.src);\n this.setState({created: true});\n }, 50);\n }\n\n return this.svg;\n } else if (this.state.src) {\n if (this.state.imgError || !this.state.src) {\n return <IconNoIcon className={this.props.className} />;\n } else {\n return <img\n className={this.props.className}\n src={(this.props.imagePrefix || '') + this.state.src}\n alt=\"\"\n onError={() => this.props.showError ? this.setState({imgError: true}) : this.setState({src: ''})}\n />;\n }\n } else {\n return null;\n }\n }\n}\n\nImage.propTypes = {\n color: PropTypes.string,\n src: PropTypes.string.isRequired,\n className: PropTypes.string,\n imagePrefix: PropTypes.string,\n};\n\nexport default Image;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA,SAASA,oBAAT,CAA8BC,GAA9B,EAAmC;EAC/B,IAAMC,YAAY,GAAGC,QAAQ,CAACC,aAAT,CA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,CAACvB,GAAN,KAAcwB,KAAK,CAACxB,GAA1C,EAA+C;QAC3C0C,QAAQ,CAAC1C,GAAT,GAAeuB,KAAK,CAACvB,GAArB;QACA0C,QAAQ,CAACrC,GAAT,GAAekB,KAAK,CAACvB,GAAN,IAAauB,KAAK,CAACvB,GAAN,CAAUiB,UAAV,CAAqB,OAArB,CAA5B;QACAyB,QAAQ,CAACjB,OAAT,GAAmB,KAAnB;QACAkB,OAAO,GAAG,IAAV;MACH;;MAED,IAAIpB,KAAK,IAAIC,KAAT,IAAkBD,KAAK,CAACG,KAAN,KAAgBF,KAAK,CAACE,KAA5C,EAAmD;QAC/CgB,QAAQ,CAAChB,KAAT,GAAiBH,KAAK,CAACG,KAAvB;QACAgB,QAAQ,CAACjB,OAAT,GAAmB,KAAnB;QACAkB,OAAO,GAAG,IAAV;MACH;;MAED,IAAIpB,KAAK,IAAIC,KAAT,IAAkBD,KAAK,CAACK,SAAN,KAAoBJ,KAAK,CAACI,SAAhD,EAA2D;QACvDc,QAAQ,CAACd,SAAT,GAAqBL,KAAK,CAACK,SAA3B;QACAe,OAAO,GAAG,IAAV;MACH;;MAED,OAAOA,OAAO,GAAGD,QAAH,GAAc,IAA5B;IACH;;;EAtCeE,iBAAA,CAAMC,S;;AA6F1BvB,KAAK,CAACwB,SAAN,GAAkB;EACdpB,KAAK,EAAEqB,qBAAA,CAAUC,MADH;EAEdhD,GAAG,EAAE+C,qBAAA,CAAUC,MAAV,CAAiBC,UAFR;EAGdb,SAAS,EAAEW,qBAAA,CAAUC,MAHP;EAIdP,WAAW,EAAEM,qBAAA,CAAUC;AAJT,CAAlB;eAOe1B,K"}
@@ -41,20 +41,16 @@ var _i18n = _interopRequireDefault(require("../../i18n"));
41
41
 
42
42
  var _CustomModal = _interopRequireDefault(require("../CustomModal"));
43
43
 
44
- var _reactAce = _interopRequireDefault(require("react-ace"));
45
-
46
- require("ace-builds/src-noconflict/mode-json");
47
-
48
- require("ace-builds/src-noconflict/theme-clouds_midnight");
49
-
50
- require("ace-builds/src-noconflict/theme-chrome");
51
-
52
- require("ace-builds/src-noconflict/ext-language_tools");
53
-
54
44
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
55
45
 
56
46
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
57
47
 
48
+ // import AceEditor from 'react-ace';
49
+ // import 'ace-builds/webpack-resolver';
50
+ // import 'ace-builds/src-noconflict/mode-json';
51
+ // import 'ace-builds/src-noconflict/theme-clouds_midnight';
52
+ // import 'ace-builds/src-noconflict/theme-chrome';
53
+ // import 'ace-builds/src-noconflict/ext-language_tools';
58
54
  var styles = function styles(theme) {
59
55
  return {
60
56
  fullWidth: {
@@ -168,28 +164,7 @@ var ConfigJsonEditor = /*#__PURE__*/function (_ConfigGeneric) {
168
164
  }
169
165
  }, /*#__PURE__*/_react["default"].createElement("div", {
170
166
  className: classes.wrapper
171
- }, /*#__PURE__*/_react["default"].createElement(_reactAce["default"], {
172
- mode: "json",
173
- theme: this.props.themeName === 'dark' ? 'clouds_midnight' : 'chrome',
174
- value: value,
175
- width: "100%",
176
- height: "100%",
177
- onChange: function onChange(newValue) {
178
- return _this.setState({
179
- value: newValue
180
- });
181
- },
182
- name: "ConfigJsonEditor",
183
- fontSize: 14,
184
- setOptions: {
185
- enableBasicAutocompletion: true,
186
- enableLiveAutocompletion: true,
187
- enableSnippets: true
188
- },
189
- editorProps: {
190
- $blockScrolling: true
191
- }
192
- }))) : null, schema.help ? /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
167
+ }, /*#__PURE__*/_react["default"].createElement("div", null, "NOT SUPPORTED"))) : null, schema.help ? /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
193
168
  }
194
169
  }]);
195
170
  return ConfigJsonEditor;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigJsonEditor.js","names":["styles","theme","fullWidth","width","flex","display","button","height","minWidth","wrapper","ConfigJsonEditor","props","data","attr","value","ConfigGeneric","getValue","setState","initialized","error","disabled","defaultValue","state","classes","schema","showSelectId","I18n","t","getText","label","onChange","themeName","newValue","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets","$blockScrolling","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigJsonEditor.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';\nimport { Button } from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\nimport CustomModal from '../CustomModal';\n\nimport AceEditor from 'react-ace';\n// import 'ace-builds/webpack-resolver';\nimport 'ace-builds/src-noconflict/mode-json';\nimport 'ace-builds/src-noconflict/theme-clouds_midnight';\nimport 'ace-builds/src-noconflict/theme-chrome';\nimport 'ace-builds/src-noconflict/ext-language_tools';\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 wrapper: {\n width: 'calc(100vw - 40px)',\n height: 'calc(100vh - 188px)',\n }\n});\n\nclass ConfigJsonEditor 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, initialized: true });\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.initialized) {\n return null;\n }\n const { classes, schema, data, attr } = this.props;\n const { value, showSelectId } = this.state;\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <div className={classes.flex}>\n <Button\n color=\"grey\"\n className={classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showSelectId: true })}\n >{I18n.t('ra_JSON editor')}</Button>\n </div>\n {showSelectId ? <CustomModal\n title={this.getText(schema.label)}\n open={showSelectId}\n overflowHidden\n onClose={() => this.setState({ showSelectId: false, value: ConfigGeneric.getValue(data, attr) || {} })}\n onApply={() => this.setState({ showSelectId: false }, () => this.onChange(attr, value))}\n >\n <div className={classes.wrapper}>\n <AceEditor\n mode=\"json\"\n theme={this.props.themeName === 'dark' ? 'clouds_midnight' : 'chrome'}\n value={value}\n width=\"100%\"\n height=\"100%\"\n onChange={newValue => this.setState({ value: newValue })}\n name=\"ConfigJsonEditor\"\n fontSize={14}\n setOptions={{\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n enableSnippets: true\n }}\n editorProps={{ $blockScrolling: true }}\n />\n </div>\n </CustomModal> : null}\n {schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigJsonEditor.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)(ConfigJsonEditor);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;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,KAAK,EAAEkB;UAAT,CAAd,CAAJ;QAAA,CANtB;QAOI,IAAI,EAAC,kBAPT;QAQI,QAAQ,EAAE,EARd;QASI,UAAU,EAAE;UACRC,yBAAyB,EAAE,IADnB;UAERC,wBAAwB,EAAE,IAFlB;UAGRC,cAAc,EAAE;QAHR,CAThB;QAcI,WAAW,EAAE;UAAEC,eAAe,EAAE;QAAnB;MAdjB,EADJ,CAPY,CAAH,GAyBI,IAnCd,EAoCFZ,MAAM,CAACa,IAAP,gBAAc,gCAAC,0BAAD,QAAiB,KAAKC,UAAL,CAAgB,KAAK3B,KAAL,CAAWa,MAAX,CAAkBa,IAAlC,EAAwC,KAAK1B,KAAL,CAAWa,MAAX,CAAkBe,QAA1D,EAAoE,KAAK5B,KAAL,CAAWa,MAAX,CAAkBgB,aAAtF,CAAjB,CAAd,GAAwJ,IApCtJ,CAAP;IAsCH;;;EApD0BzB,0B;;AAuD/BL,gBAAgB,CAAC+B,SAAjB,GAA6B;EACzBC,MAAM,EAAEC,qBAAA,CAAUC,MAAV,CAAiBC,UADA;EAEzBC,SAAS,EAAEH,qBAAA,CAAUI,MAFI;EAGzBhB,SAAS,EAAEY,qBAAA,CAAUI,MAHI;EAIzBC,KAAK,EAAEL,qBAAA,CAAUC,MAJQ;EAKzBK,SAAS,EAAEN,qBAAA,CAAUI,MALI;EAMzBnC,IAAI,EAAE+B,qBAAA,CAAUC,MAAV,CAAiBC,UANE;EAOzBrB,MAAM,EAAEmB,qBAAA,CAAUC,MAPO;EAQzBM,OAAO,EAAEP,qBAAA,CAAUQ,IARM;EASzBrB,QAAQ,EAAEa,qBAAA,CAAUQ;AATK,CAA7B;;eAYe,IAAAC,kBAAA,EAAWpD,MAAX,EAAmBU,gBAAnB,C"}
1
+ {"version":3,"file":"ConfigJsonEditor.js","names":["styles","theme","fullWidth","width","flex","display","button","height","minWidth","wrapper","ConfigJsonEditor","props","data","attr","value","ConfigGeneric","getValue","setState","initialized","error","disabled","defaultValue","state","classes","schema","showSelectId","I18n","t","getText","label","onChange","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigJsonEditor.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';\nimport { Button } from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from '../../i18n';\nimport CustomModal from '../CustomModal';\n\n// import AceEditor from 'react-ace';\n// import 'ace-builds/webpack-resolver';\n// import 'ace-builds/src-noconflict/mode-json';\n// import 'ace-builds/src-noconflict/theme-clouds_midnight';\n// import 'ace-builds/src-noconflict/theme-chrome';\n// import 'ace-builds/src-noconflict/ext-language_tools';\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 wrapper: {\n width: 'calc(100vw - 40px)',\n height: 'calc(100vh - 188px)',\n }\n});\n\nclass ConfigJsonEditor 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, initialized: true });\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.initialized) {\n return null;\n }\n const { classes, schema, data, attr } = this.props;\n const { value, showSelectId } = this.state;\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <div className={classes.flex}>\n <Button\n color=\"grey\"\n className={classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showSelectId: true })}\n >{I18n.t('ra_JSON editor')}</Button>\n </div>\n {showSelectId ? <CustomModal\n title={this.getText(schema.label)}\n open={showSelectId}\n overflowHidden\n onClose={() => this.setState({ showSelectId: false, value: ConfigGeneric.getValue(data, attr) || {} })}\n onApply={() => this.setState({ showSelectId: false }, () => this.onChange(attr, value))}\n >\n <div className={classes.wrapper}>\n {/*<AceEditor\n mode=\"json\"\n theme={this.props.themeName === 'dark' ? 'clouds_midnight' : 'chrome'}\n value={value}\n width=\"100%\"\n height=\"100%\"\n onChange={newValue => this.setState({ value: newValue })}\n name=\"ConfigJsonEditor\"\n fontSize={14}\n setOptions={{\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n enableSnippets: true\n }}\n editorProps={{ $blockScrolling: true }}\n />*/}\n <div>NOT SUPPORTED</div>\n </div>\n </CustomModal> : null}\n {schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigJsonEditor.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)(ConfigJsonEditor);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CADU;IAIrBC,IAAI,EAAE;MACFC,OAAO,EAAE;IADP,CAJe;IAOrBC,MAAM,EAAE;MACJC,MAAM,EAAE,EADJ;MAEJ;MACAC,QAAQ,EAAE;IAHN,CAPa;IAYrBC,OAAO,EAAE;MACLN,KAAK,EAAE,oBADF;MAELI,MAAM,EAAE;IAFH;EAZY,CAAL;AAAA,CAApB;;IAkBMG,gB;;;;;;;;;;;;;6GACF;QAAA;;QAAA;UAAA;YAAA;cAAA;gBACI;gBADJ,cAE2B,KAAKC,KAFhC,EAEYC,IAFZ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S;AATK,CAA7B;;eAYe,IAAAC,kBAAA,EAAW/C,MAAX,EAAmBU,gBAAnB,C"}
@@ -29,7 +29,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
29
29
  var loaderStyles = "\n/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n overflow: hidden;\n border-radius: 50%;\n z-index: 2;\n}\n.logo-border {\n /*border-color: #164477;*/\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n border-radius: 50%;\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.logo-top {\n position: absolute;\n width: 4.5%;\n height: 16%;\n top: 0;\n z-index: 2;\n}\n.logo-i {\n position: absolute;\n width: 14.5%;\n height: 60%;\n top: 20%;\n left: 42%;\n background: #3399CC;\n}\n.logo-i-top {\n position: absolute;\n width: 14.5%;\n height: 4%;\n left: 42%;\n background: #3399CC;\n border-radius: 100%;\n}\n.logo-back {\n width: 100%;\n height: 100%;\n z-index: 0;\n overflow: hidden;\n}\n@keyframes logo-grow {\n 0% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(1);\n opacity: 1\n }\n 99% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(10);\n opacity: 0;\n }\n 100% {\n width: 0;\n height: 0;\n opacity: 0;\n }\n}\n@keyframes logo-spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }\n@keyframes logo-color-inside-light {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-dark {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-colored {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-blue {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n\n@keyframes logo-color-outside-light {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-dark {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-colored {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-blue {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n\n.logo-animate-wait {\n animation: logo-color-outside 1.5s, logo-spin 1.5s linear infinite;\n}\n\n.logo-animate-grow-light {\n background: #DDD;\n}\n.logo-animate-grow-dark {\n background: #1d1d1d;\n}\n.logo-animate-grow-colored {\n background: #DDD;\n}\n.logo-animate-grow-blue {\n background: #1d1d1d;\n}\n\n.logo-animate-grow {\n display: inline-block;\n text-align: center;\n z-index: 1;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n width: 245px;\n height: 245px;\n border-radius: 50%;\n position: absolute;\n animation: logo-grow 1s 1 ease forwards;\n}\n\n.logo-animate-color-inside-light {\n animation: logo-color-inside-light 2.5s;\n}\n.logo-animate-color-inside-dark {\n animation: logo-color-inside-dark 2.5s;\n}\n.logo-animate-color-inside-colored {\n animation: logo-color-inside-colored 2.5s;\n}\n.logo-animate-color-inside-blue {\n animation: logo-color-inside-blue 2.5s;\n}\n\n.logo-animate-color-outside-light {\n animation: logo-color-outside-light 1.5s;\n}\n.logo-animate-color-outside-dark {\n animation: logo-color-outside-dark 1.5s;\n}\n.logo-animate-color-outside-colored {\n animation: logo-color-outside-colored 1.5s;\n}\n.logo-animate-color-outside-blue {\n animation: logo-color-outside-blue 1.5s;\n}\n";
30
30
  /**
31
31
  * @typedef {object} LoaderProps
32
- * @property {string} [key] The key to identify this component.
33
32
  * @property {number} [size] The size in pixels of this loader.
34
33
  * @property {string} [themeType] The chosen theme type.
35
34
  * @property {string} [theme] The chosen theme.
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.js","names":["loaderStyles","Loader","props","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","size","theme","themeType","backgroundImage","loadingBackgroundImage","undefined","backgroundColor","loadingBackgroundColor","backgroundSize","loadingHideLogo","width","height","left","borderWidth","top","bottom","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loader.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\n// import './loader.css'\nconst loaderStyles = `\n/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n overflow: hidden;\n border-radius: 50%;\n z-index: 2;\n}\n.logo-border {\n /*border-color: #164477;*/\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n border-radius: 50%;\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.logo-top {\n position: absolute;\n width: 4.5%;\n height: 16%;\n top: 0;\n z-index: 2;\n}\n.logo-i {\n position: absolute;\n width: 14.5%;\n height: 60%;\n top: 20%;\n left: 42%;\n background: #3399CC;\n}\n.logo-i-top {\n position: absolute;\n width: 14.5%;\n height: 4%;\n left: 42%;\n background: #3399CC;\n border-radius: 100%;\n}\n.logo-back {\n width: 100%;\n height: 100%;\n z-index: 0;\n overflow: hidden;\n}\n@keyframes logo-grow {\n 0% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(1);\n opacity: 1\n }\n 99% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(10);\n opacity: 0;\n }\n 100% {\n width: 0;\n height: 0;\n opacity: 0;\n }\n}\n@keyframes logo-spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }\n@keyframes logo-color-inside-light {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-dark {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-colored {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-blue {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n\n@keyframes logo-color-outside-light {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-dark {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-colored {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-blue {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n\n.logo-animate-wait {\n animation: logo-color-outside 1.5s, logo-spin 1.5s linear infinite;\n}\n\n.logo-animate-grow-light {\n background: #DDD;\n}\n.logo-animate-grow-dark {\n background: #1d1d1d;\n}\n.logo-animate-grow-colored {\n background: #DDD;\n}\n.logo-animate-grow-blue {\n background: #1d1d1d;\n}\n\n.logo-animate-grow {\n display: inline-block;\n text-align: center;\n z-index: 1;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n width: 245px;\n height: 245px;\n border-radius: 50%;\n position: absolute;\n animation: logo-grow 1s 1 ease forwards;\n}\n\n.logo-animate-color-inside-light {\n animation: logo-color-inside-light 2.5s;\n}\n.logo-animate-color-inside-dark {\n animation: logo-color-inside-dark 2.5s;\n}\n.logo-animate-color-inside-colored {\n animation: logo-color-inside-colored 2.5s;\n}\n.logo-animate-color-inside-blue {\n animation: logo-color-inside-blue 2.5s;\n}\n\n.logo-animate-color-outside-light {\n animation: logo-color-outside-light 1.5s;\n}\n.logo-animate-color-outside-dark {\n animation: logo-color-outside-dark 1.5s;\n}\n.logo-animate-color-outside-colored {\n animation: logo-color-outside-colored 1.5s;\n}\n.logo-animate-color-outside-blue {\n animation: logo-color-outside-blue 1.5s;\n}\n`;\n\n/**\n * @typedef {object} LoaderProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderProps>}\n */\nclass Loader extends React.Component {\n constructor(props) {\n super(props);\n\n if (!window.document.getElementById('loader-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'loader-iobroker-component');\n style.innerHTML = loaderStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const size = this.props.size || 234;\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'logo-back logo-background-' + theme}\n style={{\n backgroundImage: window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@' ? 'url(' + window.loadingBackgroundImage + ')' : undefined,\n backgroundColor: window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@' ? window.loadingBackgroundColor : undefined,\n backgroundSize: 'cover',\n }}\n >\n {window.loadingHideLogo === 'true' ?\n null\n :\n <>\n <div className=\"logo-div\" style={{ width: size, height: size }}>\n <div className={'logo-top logo-background-' + theme} style={{ left: '37%' }}/>\n <div className={'logo-top logo-background-' + theme} style={{ left: '57%' }}/>\n <div\n className={`logo-border logo-background-${theme} logo-animate-wait`}\n style={{ borderWidth: size * 0.132 }}\n />\n <div className={'logo-i logo-animate-color-inside-' + theme}/>\n <div className={'logo-i-top logo-animate-color-inside-' + theme} style={{ top: '18%' }}/>\n <div className={'logo-i-top logo-animate-color-inside-' + theme} style={{ bottom: '18%' }}/>\n </div>\n <div className={'logo-animate-grow logo-animate-grow-' + theme}\n style={{ width: size + 11, height: size + 11 }}\n />\n </>\n }\n </div>;\n }\n}\n\nLoader.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof Loader} */\nconst _export = Loader;\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;;;;;AACA;AACA,IAAMA,YAAY,otJAAlB;AAiOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,M;;;;;EACF,gBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,2BAA/B,CAAL,EAAkE;MAC9D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,2BAAzB;MACAF,KAAK,CAACG,SAAN,GAA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AK,EAAE;UAAEa,GAAG,EAAE;QAAP;MAAxE,EARJ,eASI;QAAK,SAAS,EAAE,0CAA0Cb,KAA1D;QAAiE,KAAK,EAAE;UAAEc,MAAM,EAAE;QAAV;MAAxE,EATJ,CADJ,eAYI;QAAK,SAAS,EAAE,yCAAyCd,KAAzD;QACA,KAAK,EAAE;UAAES,KAAK,EAAEV,IAAI,GAAG,EAAhB;UAAoBW,MAAM,EAAEX,IAAI,GAAG;QAAnC;MADP,EAZJ,CAVD,CAAP;IA4BH;;;EA3CgBgB,iBAAA,CAAMC,S;;AA8C3B5B,MAAM,CAAC6B,SAAP,GAAmB;EACflB,IAAI,EAAEmB,qBAAA,CAAUC,MADD;EAEflB,SAAS,EAAEiB,qBAAA,CAAUE;AAFN,CAAnB;AAKA;;AACA,IAAMC,OAAO,GAAGjC,MAAhB;eACeiC,O"}
1
+ {"version":3,"file":"Loader.js","names":["loaderStyles","Loader","props","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","size","theme","themeType","backgroundImage","loadingBackgroundImage","undefined","backgroundColor","loadingBackgroundColor","backgroundSize","loadingHideLogo","width","height","left","borderWidth","top","bottom","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loader.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\n// import './loader.css'\nconst loaderStyles = `\n/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n overflow: hidden;\n border-radius: 50%;\n z-index: 2;\n}\n.logo-border {\n /*border-color: #164477;*/\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n border-radius: 50%;\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.logo-top {\n position: absolute;\n width: 4.5%;\n height: 16%;\n top: 0;\n z-index: 2;\n}\n.logo-i {\n position: absolute;\n width: 14.5%;\n height: 60%;\n top: 20%;\n left: 42%;\n background: #3399CC;\n}\n.logo-i-top {\n position: absolute;\n width: 14.5%;\n height: 4%;\n left: 42%;\n background: #3399CC;\n border-radius: 100%;\n}\n.logo-back {\n width: 100%;\n height: 100%;\n z-index: 0;\n overflow: hidden;\n}\n@keyframes logo-grow {\n 0% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(1);\n opacity: 1\n }\n 99% {\n width: 230px;\n height: 230px;\n transform: translate(-50%,-50%) scale(10);\n opacity: 0;\n }\n 100% {\n width: 0;\n height: 0;\n opacity: 0;\n }\n}\n@keyframes logo-spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }\n@keyframes logo-color-inside-light {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-dark {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-colored {\n 0% {\n background: #FEFEFE;\n }\n 100% {\n background: #3399CC;\n }\n}\n@keyframes logo-color-inside-blue {\n 0% {\n background: #030303;\n }\n 100% {\n background: #3399CC;\n }\n}\n\n@keyframes logo-color-outside-light {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-dark {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-colored {\n 0% {\n border-color: #FEFEFE;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n@keyframes logo-color-outside-blue {\n 0% {\n border-color: #040404;\n }\n 100% {\n border-top-color: #3399CC;\n border-left-color: #164477;\n border-bottom-color: #164477;\n border-right-color: #164477;\n }\n}\n\n.logo-animate-wait {\n animation: logo-color-outside 1.5s, logo-spin 1.5s linear infinite;\n}\n\n.logo-animate-grow-light {\n background: #DDD;\n}\n.logo-animate-grow-dark {\n background: #1d1d1d;\n}\n.logo-animate-grow-colored {\n background: #DDD;\n}\n.logo-animate-grow-blue {\n background: #1d1d1d;\n}\n\n.logo-animate-grow {\n display: inline-block;\n text-align: center;\n z-index: 1;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n width: 245px;\n height: 245px;\n border-radius: 50%;\n position: absolute;\n animation: logo-grow 1s 1 ease forwards;\n}\n\n.logo-animate-color-inside-light {\n animation: logo-color-inside-light 2.5s;\n}\n.logo-animate-color-inside-dark {\n animation: logo-color-inside-dark 2.5s;\n}\n.logo-animate-color-inside-colored {\n animation: logo-color-inside-colored 2.5s;\n}\n.logo-animate-color-inside-blue {\n animation: logo-color-inside-blue 2.5s;\n}\n\n.logo-animate-color-outside-light {\n animation: logo-color-outside-light 1.5s;\n}\n.logo-animate-color-outside-dark {\n animation: logo-color-outside-dark 1.5s;\n}\n.logo-animate-color-outside-colored {\n animation: logo-color-outside-colored 1.5s;\n}\n.logo-animate-color-outside-blue {\n animation: logo-color-outside-blue 1.5s;\n}\n`;\n\n/**\n * @typedef {object} LoaderProps\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderProps>}\n */\nclass Loader extends React.Component {\n constructor(props) {\n super(props);\n\n if (!window.document.getElementById('loader-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'loader-iobroker-component');\n style.innerHTML = loaderStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const size = this.props.size || 234;\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'logo-back logo-background-' + theme}\n style={{\n backgroundImage: window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@' ? 'url(' + window.loadingBackgroundImage + ')' : undefined,\n backgroundColor: window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@' ? window.loadingBackgroundColor : undefined,\n backgroundSize: 'cover',\n }}\n >\n {window.loadingHideLogo === 'true' ?\n null\n :\n <>\n <div className=\"logo-div\" style={{ width: size, height: size }}>\n <div className={'logo-top logo-background-' + theme} style={{ left: '37%' }}/>\n <div className={'logo-top logo-background-' + theme} style={{ left: '57%' }}/>\n <div\n className={`logo-border logo-background-${theme} logo-animate-wait`}\n style={{ borderWidth: size * 0.132 }}\n />\n <div className={'logo-i logo-animate-color-inside-' + theme}/>\n <div className={'logo-i-top logo-animate-color-inside-' + theme} style={{ top: '18%' }}/>\n <div className={'logo-i-top logo-animate-color-inside-' + theme} style={{ bottom: '18%' }}/>\n </div>\n <div className={'logo-animate-grow logo-animate-grow-' + theme}\n style={{ width: size + 11, height: size + 11 }}\n />\n </>\n }\n </div>;\n }\n}\n\nLoader.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof Loader} */\nconst _export = Loader;\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;;;;;AACA;AACA,IAAMA,YAAY,otJAAlB;AAiOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,M;;;;;EACF,gBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,2BAA/B,CAAL,EAAkE;MAC9D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA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eAOI;QAAK,SAAS,EAAE,sCAAsCC;MAAtD,EAPJ,eAQI;QAAK,SAAS,EAAE,0CAA0CA,KAA1D;QAAiE,KAAK,EAAE;UAAEa,GAAG,EAAE;QAAP;MAAxE,EARJ,eASI;QAAK,SAAS,EAAE,0CAA0Cb,KAA1D;QAAiE,KAAK,EAAE;UAAEc,MAAM,EAAE;QAAV;MAAxE,EATJ,CADJ,eAYI;QAAK,SAAS,EAAE,yCAAyCd,KAAzD;QACA,KAAK,EAAE;UAAES,KAAK,EAAEV,IAAI,GAAG,EAAhB;UAAoBW,MAAM,EAAEX,IAAI,GAAG;QAAnC;MADP,EAZJ,CAVD,CAAP;IA4BH;;;EA3CgBgB,iBAAA,CAAMC,S;;AA8C3B5B,MAAM,CAAC6B,SAAP,GAAmB;EACflB,IAAI,EAAEmB,qBAAA,CAAUC,MADD;EAEflB,SAAS,EAAEiB,qBAAA,CAAUE;AAFN,CAAnB;AAKA;;AACA,IAAMC,OAAO,GAAGjC,MAAhB;eACeiC,O"}
@@ -29,7 +29,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
29
29
  var ptStyles = "\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.pt-logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n z-index: 2;\n}\n.pt-logo-border {\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.pt-loader-block {\n height: 65px;\n width: 74px;\n border-radius: 15px;\n position: absolute;\n box-sizing: content-box;\n}\n.pt-loader-blue {\n border: 9px solid #0F99DE;\n transform: rotate(5grad);\n left: 93px;\n top: 0;\n animation: spin-blue 5s ease-in-out infinite;\n}\n.pt-loader-green {\n border: 9px solid #88A536;\n transform: rotate(-6grad);\n left: 70px;\n top: 58px;\n animation: spin-green 5s ease-in-out infinite;\n}\n.pt-loader-red {\n border: 9px solid #BD1B24;\n transform: rotate(-15grad);\n left: 24px;\n top: 100px;\n animation: spin-red 5s ease-in-out infinite;\n}\n\n@keyframes spin-blue {\n 0% {\n transform: rotate(5deg);\n }\n 25% {\n transform: rotate(185deg);\n }\n 50% {\n transform: rotate(185deg);\n }\n 75% {\n transform: rotate(185deg);\n }\n 100% {\n transform: rotate(185deg);\n }\n}\n@keyframes spin-green {\n 0% {\n transform: rotate(-6deg);\n }\n 25% {\n transform: rotate(-6deg);\n }\n 50% {\n transform: rotate(174deg);\n }\n 75% {\n transform: rotate(174deg);\n }\n 100% {\n transform: rotate(-6deg);\n }\n}\n@keyframes spin-red {\n 0% {\n transform: rotate(-15deg);\n }\n 25% {\n transform: rotate(-15deg);\n }\n 50% {\n transform: rotate(-15deg);\n }\n 75% {\n transform: rotate(165deg);\n }\n 100% {\n transform: rotate(165deg);\n }\n}\n";
30
30
  /**
31
31
  * @typedef {object} LoaderPTProps
32
- * @property {string} [key] The key to identify this component.
33
32
  * @property {number} [size] The size in pixels of this loader.
34
33
  * @property {string} [themeType] The chosen theme type.
35
34
  * @property {string} [theme] The chosen theme.
@@ -1 +1 @@
1
- {"version":3,"file":"PT.js","names":["ptStyles","LoaderPT","props","size","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","theme","themeType","width","height","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loaders/PT.js"],"sourcesContent":["/**\n * Copyright 2021-2022 ioBroker GmbH\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\n// import './PT.css'\nconst ptStyles = `\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.pt-logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n z-index: 2;\n}\n.pt-logo-border {\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.pt-loader-block {\n height: 65px;\n width: 74px;\n border-radius: 15px;\n position: absolute;\n box-sizing: content-box;\n}\n.pt-loader-blue {\n border: 9px solid #0F99DE;\n transform: rotate(5grad);\n left: 93px;\n top: 0;\n animation: spin-blue 5s ease-in-out infinite;\n}\n.pt-loader-green {\n border: 9px solid #88A536;\n transform: rotate(-6grad);\n left: 70px;\n top: 58px;\n animation: spin-green 5s ease-in-out infinite;\n}\n.pt-loader-red {\n border: 9px solid #BD1B24;\n transform: rotate(-15grad);\n left: 24px;\n top: 100px;\n animation: spin-red 5s ease-in-out infinite;\n}\n\n@keyframes spin-blue {\n 0% {\n transform: rotate(5deg);\n }\n 25% {\n transform: rotate(185deg);\n }\n 50% {\n transform: rotate(185deg);\n }\n 75% {\n transform: rotate(185deg);\n }\n 100% {\n transform: rotate(185deg);\n }\n}\n@keyframes spin-green {\n 0% {\n transform: rotate(-6deg);\n }\n 25% {\n transform: rotate(-6deg);\n }\n 50% {\n transform: rotate(174deg);\n }\n 75% {\n transform: rotate(174deg);\n }\n 100% {\n transform: rotate(-6deg);\n }\n}\n@keyframes spin-red {\n 0% {\n transform: rotate(-15deg);\n }\n 25% {\n transform: rotate(-15deg);\n }\n 50% {\n transform: rotate(-15deg);\n }\n 75% {\n transform: rotate(165deg);\n }\n 100% {\n transform: rotate(165deg);\n }\n}\n`;\n\n/**\n * @typedef {object} LoaderPTProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderPTProps>}\n */\nclass LoaderPT extends React.Component {\n /**\n * @param {LoaderPTProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n\n if (!window.document.getElementById('pt-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'pt-iobroker-component');\n style.innerHTML = ptStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'pt-logo-back logo-background-' + theme}>\n <div className=\"pt-logo-div\" style={{width: this.size, height: this.size}}>\n <div style={{width: 200, height: 200}}>\n <div className=\"pt-loader-blue pt-loader-block\"/>\n <div className=\"pt-loader-green pt-loader-block\"/>\n <div className=\"pt-loader-red pt-loader-block\"/>\n </div>\n </div>\n </div>;\n }\n}\n\nLoaderPT.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof LoaderPT} */\nconst _export = LoaderPT;\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;;;;;AACA;AACA,IAAMA,QAAQ,ohEAAd;AAyGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,Q;;;;;EACF;AACJ;AACA;EACI,kBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,uBAA/B,CAAL,EAA8D;MAC1D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,uBAAzB;MACAF,KAAK,CAACG,SAAN,GAAkBV,QAAlB;MACAI,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IATc;EAUlB;;;;WAED,kBAAS;MACL,IAAMM,KAAK,GAAG,KAAKX,KAAL,CAAWY,SAAX,IAAwB,KAAKZ,KAAL,CAAWW,KAAnC,IAA4C,OAA1D;MACA,oBAAO;QAAK,SAAS,EAAE,kCAAkCA;MAAlD,gBACH;QAAK,SAAS,EAAC,aAAf;QAA6B,KAAK,EAAE;UAACE,KAAK,EAAE,KAAKZ,IAAb;UAAmBa,MAAM,EAAE,KAAKb;QAAhC;MAApC,gBACI;QAAK,KAAK,EAAE;UAACY,KAAK,EAAE,GAAR;UAAaC,MAAM,EAAE;QAArB;MAAZ,gBACI;QAAK,SAAS,EAAC;MAAf,EADJ,eAEI;QAAK,SAAS,EAAC;MAAf,EAFJ,eAGI;QAAK,SAAS,EAAC;MAAf,EAHJ,CADJ,CADG,CAAP;IASH;;;EA3BkBC,iBAAA,CAAMC,S;;AA8B7BjB,QAAQ,CAACkB,SAAT,GAAqB;EACjBhB,IAAI,EAAEiB,qBAAA,CAAUC,MADC;EAEjBP,SAAS,EAAEM,qBAAA,CAAUE;AAFJ,CAArB;AAKA;;AACA,IAAMC,OAAO,GAAGtB,QAAhB;eACesB,O"}
1
+ {"version":3,"file":"PT.js","names":["ptStyles","LoaderPT","props","size","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","theme","themeType","width","height","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loaders/PT.js"],"sourcesContent":["/**\n * Copyright 2021-2022 ioBroker GmbH\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\n// import './PT.css'\nconst ptStyles = `\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n.pt-logo-div {\n position: absolute;\n top: 50%;\n left: 50%;\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translate(-50%,-50%);\n transform: translate(-50%,-50%);\n z-index: 2;\n}\n.pt-logo-border {\n border-style: solid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n.pt-loader-block {\n height: 65px;\n width: 74px;\n border-radius: 15px;\n position: absolute;\n box-sizing: content-box;\n}\n.pt-loader-blue {\n border: 9px solid #0F99DE;\n transform: rotate(5grad);\n left: 93px;\n top: 0;\n animation: spin-blue 5s ease-in-out infinite;\n}\n.pt-loader-green {\n border: 9px solid #88A536;\n transform: rotate(-6grad);\n left: 70px;\n top: 58px;\n animation: spin-green 5s ease-in-out infinite;\n}\n.pt-loader-red {\n border: 9px solid #BD1B24;\n transform: rotate(-15grad);\n left: 24px;\n top: 100px;\n animation: spin-red 5s ease-in-out infinite;\n}\n\n@keyframes spin-blue {\n 0% {\n transform: rotate(5deg);\n }\n 25% {\n transform: rotate(185deg);\n }\n 50% {\n transform: rotate(185deg);\n }\n 75% {\n transform: rotate(185deg);\n }\n 100% {\n transform: rotate(185deg);\n }\n}\n@keyframes spin-green {\n 0% {\n transform: rotate(-6deg);\n }\n 25% {\n transform: rotate(-6deg);\n }\n 50% {\n transform: rotate(174deg);\n }\n 75% {\n transform: rotate(174deg);\n }\n 100% {\n transform: rotate(-6deg);\n }\n}\n@keyframes spin-red {\n 0% {\n transform: rotate(-15deg);\n }\n 25% {\n transform: rotate(-15deg);\n }\n 50% {\n transform: rotate(-15deg);\n }\n 75% {\n transform: rotate(165deg);\n }\n 100% {\n transform: rotate(165deg);\n }\n}\n`;\n\n/**\n * @typedef {object} LoaderPTProps\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderPTProps>}\n */\nclass LoaderPT extends React.Component {\n /**\n * @param {LoaderPTProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n\n if (!window.document.getElementById('pt-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'pt-iobroker-component');\n style.innerHTML = ptStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'pt-logo-back logo-background-' + theme}>\n <div className=\"pt-logo-div\" style={{width: this.size, height: this.size}}>\n <div style={{width: 200, height: 200}}>\n <div className=\"pt-loader-blue pt-loader-block\"/>\n <div className=\"pt-loader-green pt-loader-block\"/>\n <div className=\"pt-loader-red pt-loader-block\"/>\n </div>\n </div>\n </div>;\n }\n}\n\nLoaderPT.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof LoaderPT} */\nconst _export = LoaderPT;\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;;;;;AACA;AACA,IAAMA,QAAQ,ohEAAd;AAyGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,Q;;;;;EACF;AACJ;AACA;EACI,kBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,uBAA/B,CAAL,EAA8D;MAC1D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,uBAAzB;MACAF,KAAK,CAACG,SAAN,GAAkBV,QAAlB;MACAI,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IATc;EAUlB;;;;WAED,kBAAS;MACL,IAAMM,KAAK,GAAG,KAAKX,KAAL,CAAWY,SAAX,IAAwB,KAAKZ,KAAL,CAAWW,KAAnC,IAA4C,OAA1D;MACA,oBAAO;QAAK,SAAS,EAAE,kCAAkCA;MAAlD,gBACH;QAAK,SAAS,EAAC,aAAf;QAA6B,KAAK,EAAE;UAACE,KAAK,EAAE,KAAKZ,IAAb;UAAmBa,MAAM,EAAE,KAAKb;QAAhC;MAApC,gBACI;QAAK,KAAK,EAAE;UAACY,KAAK,EAAE,GAAR;UAAaC,MAAM,EAAE;QAArB;MAAZ,gBACI;QAAK,SAAS,EAAC;MAAf,EADJ,eAEI;QAAK,SAAS,EAAC;MAAf,EAFJ,eAGI;QAAK,SAAS,EAAC;MAAf,EAHJ,CADJ,CADG,CAAP;IASH;;;EA3BkBC,iBAAA,CAAMC,S;;AA8B7BjB,QAAQ,CAACkB,SAAT,GAAqB;EACjBhB,IAAI,EAAEiB,qBAAA,CAAUC,MADC;EAEjBP,SAAS,EAAEM,qBAAA,CAAUE;AAFJ,CAArB;AAKA;;AACA,IAAMC,OAAO,GAAGtB,QAAhB;eACesB,O"}
@@ -31,7 +31,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
31
31
  var vendorStyles = "\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n";
32
32
  /**
33
33
  * @typedef {object} LoaderVendorProps
34
- * @property {string} [key] The key to identify this component.
35
34
  * @property {number} [size] The size in pixels of this loader.
36
35
  * @property {string} [themeType] The chosen theme type.
37
36
  * @property {string} [theme] The chosen theme.
@@ -1 +1 @@
1
- {"version":3,"file":"Vendor.js","names":["vendorStyles","LoaderVendor","props","size","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","theme","themeType","display","flexDirection","height","width","margin","flexGrow","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loaders/Vendor.js"],"sourcesContent":["/**\n * Copyright 2021-2022 ioBroker GmbH\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CircularProgress from '@mui/material/CircularProgress';\n// import './Vendor.css'\nconst vendorStyles = `\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n`;\n\n/**\n * @typedef {object} LoaderVendorProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderVendorProps>}\n */\nclass LoaderVendor extends React.Component {\n /**\n * @param {LoaderVendorProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n\n if (!window.document.getElementById('vendor-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'vendor-iobroker-component');\n style.innerHTML = vendorStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'vendor-logo-back logo-background-' + theme} style={{\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n width: '10%',\n margin: 'auto'\n }}>\n <div style={{flexGrow: 1}}/>\n <CircularProgress color=\"secondary\" size={200} thickness={5}/>\n <div style={{flexGrow: 1}}/>\n </div>;\n }\n}\n\nLoaderVendor.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof LoaderVendor} */\nconst _export = LoaderVendor;\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;;;;;AACA;AACA,IAAMA,YAAY,iKAAlB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,Y;;;;;EACF;AACJ;AACA;EACI,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,2BAA/B,CAAL,EAAkE;MAC9D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,2BAAzB;MACAF,KAAK,CAACG,SAAN,GAAkBV,YAAlB;MACAI,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IATc;EAUlB;;;;WAED,kBAAS;MACL,IAAMM,KAAK,GAAG,KAAKX,KAAL,CAAWY,SAAX,IAAwB,KAAKZ,KAAL,CAAWW,KAAnC,IAA4C,OAA1D;MACA,oBAAO;QAAK,SAAS,EAAE,sCAAsCA,KAAtD;QAA6D,KAAK,EAAE;UACvEE,OAAO,EAAE,MAD8D;UAEvEC,aAAa,EAAE,QAFwD;UAGvEC,MAAM,EAAE,MAH+D;UAIvEC,KAAK,EAAE,KAJgE;UAKvEC,MAAM,EAAE;QAL+D;MAApE,gBAOH;QAAK,KAAK,EAAE;UAACC,QAAQ,EAAE;QAAX;MAAZ,EAPG,eAQH,gCAAC,4BAAD;QAAkB,KAAK,EAAC,WAAxB;QAAoC,IAAI,EAAE,GAA1C;QAA+C,SAAS,EAAE;MAA1D,EARG,eASH;QAAK,KAAK,EAAE;UAACA,QAAQ,EAAE;QAAX;MAAZ,EATG,CAAP;IAWH;;;EA7BsBC,iBAAA,CAAMC,S;;AAgCjCrB,YAAY,CAACsB,SAAb,GAAyB;EACrBpB,IAAI,EAAEqB,qBAAA,CAAUC,MADK;EAErBX,SAAS,EAAEU,qBAAA,CAAUE;AAFA,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAG1B,YAAhB;eACe0B,O"}
1
+ {"version":3,"file":"Vendor.js","names":["vendorStyles","LoaderVendor","props","size","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","theme","themeType","display","flexDirection","height","width","margin","flexGrow","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loaders/Vendor.js"],"sourcesContent":["/**\n * Copyright 2021-2022 ioBroker GmbH\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CircularProgress from '@mui/material/CircularProgress';\n// import './Vendor.css'\nconst vendorStyles = `\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n`;\n\n/**\n * @typedef {object} LoaderVendorProps\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderVendorProps>}\n */\nclass LoaderVendor extends React.Component {\n /**\n * @param {LoaderVendorProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n\n if (!window.document.getElementById('vendor-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'vendor-iobroker-component');\n style.innerHTML = vendorStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'vendor-logo-back logo-background-' + theme} style={{\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n width: '10%',\n margin: 'auto'\n }}>\n <div style={{flexGrow: 1}}/>\n <CircularProgress color=\"secondary\" size={200} thickness={5}/>\n <div style={{flexGrow: 1}}/>\n </div>;\n }\n}\n\nLoaderVendor.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof LoaderVendor} */\nconst _export = LoaderVendor;\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;;;;;AACA;AACA,IAAMA,YAAY,iKAAlB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,Y;;;;;EACF;AACJ;AACA;EACI,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,2BAA/B,CAAL,EAAkE;MAC9D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,2BAAzB;MACAF,KAAK,CAACG,SAAN,GAAkBV,YAAlB;MACAI,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IATc;EAUlB;;;;WAED,kBAAS;MACL,IAAMM,KAAK,GAAG,KAAKX,KAAL,CAAWY,SAAX,IAAwB,KAAKZ,KAAL,CAAWW,KAAnC,IAA4C,OAA1D;MACA,oBAAO;QAAK,SAAS,EAAE,sCAAsCA,KAAtD;QAA6D,KAAK,EAAE;UACvEE,OAAO,EAAE,MAD8D;UAEvEC,aAAa,EAAE,QAFwD;UAGvEC,MAAM,EAAE,MAH+D;UAIvEC,KAAK,EAAE,KAJgE;UAKvEC,MAAM,EAAE;QAL+D;MAApE,gBAOH;QAAK,KAAK,EAAE;UAACC,QAAQ,EAAE;QAAX;MAAZ,EAPG,eAQH,gCAAC,4BAAD;QAAkB,KAAK,EAAC,WAAxB;QAAoC,IAAI,EAAE,GAA1C;QAA+C,SAAS,EAAE;MAA1D,EARG,eASH;QAAK,KAAK,EAAE;UAACA,QAAQ,EAAE;QAAX;MAAZ,EATG,CAAP;IAWH;;;EA7BsBC,iBAAA,CAAMC,S;;AAgCjCrB,YAAY,CAACsB,SAAb,GAAyB;EACrBpB,IAAI,EAAEqB,qBAAA,CAAUC,MADK;EAErBX,SAAS,EAAEU,qBAAA,CAAUE;AAFA,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAG1B,YAAhB;eACe0B,O"}
@@ -49,7 +49,6 @@ var styles = {
49
49
  };
50
50
  /**
51
51
  * @typedef {object} TabContainerProps
52
- * @property {string} [key] The key to identify this component.
53
52
  * @property {number} [elevation] The elevation of the tab container.
54
53
  * @property {string} [overflow] Set to 'visible' show the overflow.
55
54
  * @property {{ [key in keyof styles]: string}} classes The styling class names.
@@ -1 +1 @@
1
- {"version":3,"file":"TabContainer.js","names":["styles","root","width","height","overflowHidden","overflow","container","TabContainer","classes","props","isNaN","elevation","Utils","clsx","children","React","Component","propTypes","PropTypes","number","string","_export","withStyles"],"sources":["TabContainer.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\nimport Paper from '@mui/material/Paper';\n\nconst styles = {\n root: {\n width: '100%',\n height: '100%'\n },\n overflowHidden: {\n overflow: 'hidden'\n },\n container: {\n height: '100%'\n }\n};\n\n/**\n * @typedef {object} TabContainerProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [elevation] The elevation of the tab container.\n * @property {string} [overflow] Set to 'visible' show the overflow.\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContainerProps>}\n */\nclass TabContainer extends React.Component {\n\n render() {\n const { classes } = this.props;\n\n return <Paper\n elevation={ !isNaN(this.props.elevation) ? this.props.elevation : 1 }\n className={ Utils.clsx(classes.root, {[classes.overflowHidden]: this.props.overflow !== 'visible'}) }\n >\n <Grid\n container\n direction=\"column\"\n wrap=\"nowrap\"\n className={ classes.container }\n >\n { this.props.children }\n </Grid>\n </Paper>;\n }\n}\n\nTabContainer.propTypes = {\n elevation: PropTypes.number,\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContainer} */\nconst _export = withStyles(styles)(TabContainer);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,IAAI,EAAE;IACFC,KAAK,EAAE,MADL;IAEFC,MAAM,EAAE;EAFN,CADK;EAKXC,cAAc,EAAE;IACZC,QAAQ,EAAE;EADE,CALL;EAQXC,SAAS,EAAE;IACPH,MAAM,EAAE;EADD;AARA,CAAf;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMI,Y;;;;;;;;;;;;WAEF,kBAAS;MACL,IAAQC,OAAR,GAAoB,KAAKC,KAAzB,CAAQD,OAAR;MAEA,oBAAO,gCAAC,iBAAD;QACH,SAAS,EAAG,CAACE,KAAK,CAAC,KAAKD,KAAL,CAAWE,SAAZ,CAAN,GAA+B,KAAKF,KAAL,CAAWE,SAA1C,GAAsD,CAD/D;QAEH,SAAS,EAAGC,iBAAA,CAAMC,IAAN,CAAWL,OAAO,CAACP,IAAnB,uCAA2BO,OAAO,CAACJ,cAAnC,EAAoD,KAAKK,KAAL,CAAWJ,QAAX,KAAwB,SAA5E;MAFT,gBAIH,gCAAC,gBAAD;QACI,SAAS,MADb;QAEI,SAAS,EAAC,QAFd;QAGI,IAAI,EAAC,QAHT;QAII,SAAS,EAAGG,OAAO,CAACF;MAJxB,GAMM,KAAKG,KAAL,CAAWK,QANjB,CAJG,CAAP;IAaH;;;EAlBsBC,iBAAA,CAAMC,S;;AAqBjCT,YAAY,CAACU,SAAb,GAAyB;EACrBN,SAAS,EAAEO,qBAAA,CAAUC,MADA;EAErBd,QAAQ,EAAEa,qBAAA,CAAUE;AAFC,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAWtB,MAAX,EAAmBO,YAAnB,CAAhB;;eACec,O"}
1
+ {"version":3,"file":"TabContainer.js","names":["styles","root","width","height","overflowHidden","overflow","container","TabContainer","classes","props","isNaN","elevation","Utils","clsx","children","React","Component","propTypes","PropTypes","number","string","_export","withStyles"],"sources":["TabContainer.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\nimport Paper from '@mui/material/Paper';\n\nconst styles = {\n root: {\n width: '100%',\n height: '100%'\n },\n overflowHidden: {\n overflow: 'hidden'\n },\n container: {\n height: '100%'\n }\n};\n\n/**\n * @typedef {object} TabContainerProps\n * @property {number} [elevation] The elevation of the tab container.\n * @property {string} [overflow] Set to 'visible' show the overflow.\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContainerProps>}\n */\nclass TabContainer extends React.Component {\n\n render() {\n const { classes } = this.props;\n\n return <Paper\n elevation={ !isNaN(this.props.elevation) ? this.props.elevation : 1 }\n className={ Utils.clsx(classes.root, {[classes.overflowHidden]: this.props.overflow !== 'visible'}) }\n >\n <Grid\n container\n direction=\"column\"\n wrap=\"nowrap\"\n className={ classes.container }\n >\n { this.props.children }\n </Grid>\n </Paper>;\n }\n}\n\nTabContainer.propTypes = {\n elevation: PropTypes.number,\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContainer} */\nconst _export = withStyles(styles)(TabContainer);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,IAAI,EAAE;IACFC,KAAK,EAAE,MADL;IAEFC,MAAM,EAAE;EAFN,CADK;EAKXC,cAAc,EAAE;IACZC,QAAQ,EAAE;EADE,CALL;EAQXC,SAAS,EAAE;IACPH,MAAM,EAAE;EADD;AARA,CAAf;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMI,Y;;;;;;;;;;;;WAEF,kBAAS;MACL,IAAQC,OAAR,GAAoB,KAAKC,KAAzB,CAAQD,OAAR;MAEA,oBAAO,gCAAC,iBAAD;QACH,SAAS,EAAG,CAACE,KAAK,CAAC,KAAKD,KAAL,CAAWE,SAAZ,CAAN,GAA+B,KAAKF,KAAL,CAAWE,SAA1C,GAAsD,CAD/D;QAEH,SAAS,EAAGC,iBAAA,CAAMC,IAAN,CAAWL,OAAO,CAACP,IAAnB,uCAA2BO,OAAO,CAACJ,cAAnC,EAAoD,KAAKK,KAAL,CAAWJ,QAAX,KAAwB,SAA5E;MAFT,gBAIH,gCAAC,gBAAD;QACI,SAAS,MADb;QAEI,SAAS,EAAC,QAFd;QAGI,IAAI,EAAC,QAHT;QAII,SAAS,EAAGG,OAAO,CAACF;MAJxB,GAMM,KAAKG,KAAL,CAAWK,QANjB,CAJG,CAAP;IAaH;;;EAlBsBC,iBAAA,CAAMC,S;;AAqBjCT,YAAY,CAACU,SAAb,GAAyB;EACrBN,SAAS,EAAEO,qBAAA,CAAUC,MADA;EAErBd,QAAQ,EAAEa,qBAAA,CAAUE;AAFC,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAWtB,MAAX,EAAmBO,YAAnB,CAAhB;;eACec,O"}
@@ -44,7 +44,6 @@ var styles = {
44
44
  };
45
45
  /**
46
46
  * @typedef {object} TabContentProps
47
- * @property {string} [key] The key to identify this component.
48
47
  * @property {string} [overflow]
49
48
  * @property {{ [key in keyof styles]: string}} classes The styling class names.
50
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"TabContent.js","names":["styles","root","height","overflow","overflowAuto","TabContent","classes","props","Utils","clsx","children","React","Component","propTypes","PropTypes","string","_export","withStyles"],"sources":["TabContent.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\n\nconst styles = {\n root: {\n height: '100%',\n overflow: 'hidden'\n },\n overflowAuto: {\n overflow: 'auto'\n }\n};\n\n/**\n * @typedef {object} TabContentProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [overflow]\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContentProps>}\n */\nclass TabContent extends React.Component {\n render() {\n const { classes } = this.props;\n\n return <Grid\n item\n className={ Utils.clsx(classes.root, {[classes.overflowAuto]: this.props.overflow === 'auto'}) }\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nTabContent.propTypes = {\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContent} */\nconst _export = withStyles(styles)(TabContent);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,IAAI,EAAE;IACFC,MAAM,EAAE,MADN;IAEFC,QAAQ,EAAE;EAFR,CADK;EAKXC,YAAY,EAAE;IACVD,QAAQ,EAAE;EADA;AALH,CAAf;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACME,U;;;;;;;;;;;;WACF,kBAAS;MACL,IAAQC,OAAR,GAAoB,KAAKC,KAAzB,CAAQD,OAAR;MAEA,oBAAO,gCAAC,gBAAD;QACH,IAAI,MADD;QAEH,SAAS,EAAGE,iBAAA,CAAMC,IAAN,CAAWH,OAAO,CAACL,IAAnB,uCAA2BK,OAAO,CAACF,YAAnC,EAAkD,KAAKG,KAAL,CAAWJ,QAAX,KAAwB,MAA1E;MAFT,GAID,KAAKI,KAAL,CAAWG,QAJV,CAAP;IAMH;;;EAVoBC,iBAAA,CAAMC,S;;AAa/BP,UAAU,CAACQ,SAAX,GAAuB;EACnBV,QAAQ,EAAEW,qBAAA,CAAUC;AADD,CAAvB;AAIA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAWjB,MAAX,EAAmBK,UAAnB,CAAhB;;eACeW,O"}
1
+ {"version":3,"file":"TabContent.js","names":["styles","root","height","overflow","overflowAuto","TabContent","classes","props","Utils","clsx","children","React","Component","propTypes","PropTypes","string","_export","withStyles"],"sources":["TabContent.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\n\nconst styles = {\n root: {\n height: '100%',\n overflow: 'hidden'\n },\n overflowAuto: {\n overflow: 'auto'\n }\n};\n\n/**\n * @typedef {object} TabContentProps\n * @property {string} [overflow]\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContentProps>}\n */\nclass TabContent extends React.Component {\n render() {\n const { classes } = this.props;\n\n return <Grid\n item\n className={ Utils.clsx(classes.root, {[classes.overflowAuto]: this.props.overflow === 'auto'}) }\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nTabContent.propTypes = {\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContent} */\nconst _export = withStyles(styles)(TabContent);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,IAAI,EAAE;IACFC,MAAM,EAAE,MADN;IAEFC,QAAQ,EAAE;EAFR,CADK;EAKXC,YAAY,EAAE;IACVD,QAAQ,EAAE;EADA;AALH,CAAf;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;;IACME,U;;;;;;;;;;;;WACF,kBAAS;MACL,IAAQC,OAAR,GAAoB,KAAKC,KAAzB,CAAQD,OAAR;MAEA,oBAAO,gCAAC,gBAAD;QACH,IAAI,MADD;QAEH,SAAS,EAAGE,iBAAA,CAAMC,IAAN,CAAWH,OAAO,CAACL,IAAnB,uCAA2BK,OAAO,CAACF,YAAnC,EAAkD,KAAKG,KAAL,CAAWJ,QAAX,KAAwB,MAA1E;MAFT,GAID,KAAKI,KAAL,CAAWG,QAJV,CAAP;IAMH;;;EAVoBC,iBAAA,CAAMC,S;;AAa/BP,UAAU,CAACQ,SAAX,GAAuB;EACnBV,QAAQ,EAAEW,qBAAA,CAAUC;AADD,CAAvB;AAIA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAWjB,MAAX,EAAmBK,UAAnB,CAAhB;;eACeW,O"}
@@ -19,8 +19,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
19
19
 
20
20
  var _react = _interopRequireDefault(require("react"));
21
21
 
22
- var _propTypes = _interopRequireDefault(require("prop-types"));
23
-
24
22
  var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
25
23
 
26
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
@@ -29,7 +27,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
29
27
 
30
28
  /**
31
29
  * @typedef {object} TabHeaderProps
32
- * @property {string} [key] The key to identify this component.
33
30
  *
34
31
  * @extends {React.Component<TabHeaderProps>}
35
32
  */
@@ -56,7 +53,6 @@ var TabHeader = /*#__PURE__*/function (_React$Component) {
56
53
  return TabHeader;
57
54
  }(_react["default"].Component);
58
55
 
59
- TabHeader.propTypes = {};
60
56
  var _default = TabHeader;
61
57
  exports["default"] = _default;
62
58
  //# sourceMappingURL=TabHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabHeader.js","names":["TabHeader","props","children","React","Component","propTypes"],"sources":["TabHeader.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from \"prop-types\";\n\nimport Grid from '@mui/material/Grid';\n\n/**\n * @typedef {object} TabHeaderProps\n * @property {string} [key] The key to identify this component.\n *\n * @extends {React.Component<TabHeaderProps>}\n */\nclass TabHeader extends React.Component {\n render() {\n return <Grid\n item\n container\n alignItems=\"center\"\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nTabHeader.propTypes = {\n};\n\nexport default TabHeader;"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;IACMA,S;;;;;;;;;;;;WACF,kBAAS;MACL,oBAAO,gCAAC,gBAAD;QACH,IAAI,MADD;QAEH,SAAS,MAFN;QAGH,UAAU,EAAC;MAHR,GAKD,KAAKC,KAAL,CAAWC,QALV,CAAP;IAOH;;;EATmBC,iBAAA,CAAMC,S;;AAY9BJ,SAAS,CAACK,SAAV,GAAsB,EAAtB;eAGeL,S"}
1
+ {"version":3,"file":"TabHeader.js","names":["TabHeader","props","children","React","Component"],"sources":["TabHeader.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\n\nimport Grid from '@mui/material/Grid';\n\n/**\n * @typedef {object} TabHeaderProps\n *\n * @extends {React.Component<TabHeaderProps>}\n */\nclass TabHeader extends React.Component {\n render() {\n return <Grid\n item\n container\n alignItems=\"center\"\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nexport default TabHeader;"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;IACMA,S;;;;;;;;;;;;WACF,kBAAS;MACL,oBAAO,gCAAC,gBAAD;QACH,IAAI,MADD;QAEH,SAAS,MAFN;QAGH,UAAU,EAAC;MAHR,GAKD,KAAKC,KAAL,CAAWC,QALV,CAAP;IAOH;;;EATmBC,iBAAA,CAAMC,S;;eAYfJ,S"}
@@ -59,7 +59,6 @@ var styles = {
59
59
  };
60
60
  /**
61
61
  * @typedef {object} DialogConfirmProps
62
- * @property {string} [key] The key to identify this component.
63
62
  * @property {string} [title] The dialog title; default: Are you sure? (translated)
64
63
  * @property {string} text The dialog text.
65
64
  * @property {string} [ok] The ok button text; default: OK (translated)
@@ -1 +1 @@
1
- {"version":3,"file":"Confirm.js","names":["styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","props","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","setItem","onClose","setTimeout","event","reason","handleCancel","title","I18n","t","icon","text","label","classes","root","setState","suppressText","handleOk","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","string","object","number","_export","withStyles"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n (window._localStorage || window.localStorage).removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n (window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={true}\n maxWidth=\"md\"\n fullWidth={true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,QAAQ,EAAE;IACNC,QAAQ,EAAE;EADJ,CADC;EAIXC,Y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AEY,qBAAA,CAAUG,MAHM;EAItBR,EAAE,EAAEK,qBAAA,CAAUG,MAJQ;EAKtBP,MAAM,EAAEI,qBAAA,CAAUG,MALI;EAMtBhB,IAAI,EAAEa,qBAAA,CAAUI,MANM;EAOtBrC,uBAAuB,EAAEiC,qBAAA,CAAUK,MAPb;EAQtBZ,YAAY,EAAEO,qBAAA,CAAUG,MARF;EAStBrC,UAAU,EAAEkC,qBAAA,CAAUG;AATA,CAA1B;;AAYA,IAAMG,OAAO,GAAG,IAAAC,sBAAA,EAAWhD,MAAX,EAAmBK,aAAnB,CAAhB;;eACe0C,O"}
1
+ {"version":3,"file":"Confirm.js","names":["styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","props","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","setItem","onClose","setTimeout","event","reason","handleCancel","title","I18n","t","icon","text","label","classes","root","setState","suppressText","handleOk","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","string","object","number","_export","withStyles"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n (window._localStorage || window.localStorage).removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n (window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={true}\n maxWidth=\"md\"\n fullWidth={true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,QAAQ,EAAE;IACNC,QAAQ,EAAE;EADJ,CADC;EAIXC,YAAY,EAAE;IACVC,SAAS,EAAE;EADD;AAJH,CAAf;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,a;;;;;EACF,uBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;;IAEA,IAAI,CAAC,MAAKA,KAAL,CAAWC,UAAZ,IAA0B,MAAKD,KAAL,CAAWE,uBAAzC,EAAkE;MAC9D,MAAM,IAAIC,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AMG,OAAO,GAAG,IAAAC,sBAAA,EAAWhD,MAAX,EAAmBK,aAAnB,CAAhB;;eACe0C,O"}
package/Dialogs/Error.js CHANGED
@@ -51,7 +51,6 @@ var styles = function styles(theme) {
51
51
  };
52
52
  /**
53
53
  * @typedef {object} DialogErrorProps
54
- * @property {string} [key] The key to identify this component.
55
54
  * @property {string} [title] The dialog title; default: Error (translated)
56
55
  * @property {string | JSX.Element} text The dialog text.
57
56
  * @property {() => void} [onClose] Close handler.
@@ -1 +1 @@
1
- {"version":3,"file":"Error.js","names":["styles","theme","titleBackground","titleColor","DialogError","props","onClose","handleOk","classes","root","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","oneOfType","element","icon","object","_export","withStyles"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,eAAe,EAAE,EADI;IAIrBC,UAAU,EAAE;EAJS,CAAL;AAAA,CAApB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;IACMC,W;;;;;;;;;;;;WACF,oBAAW;MACP,KAAKC,KAAL,CAAWC,OAAX,IAAsB,KAAKD,KAAL,CAAWC,OAAX,EAAtB;IACH;;;WAED,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QACH,IAAI,EAAE,IADH;QAEH,QAAQ,EAAC,IAFN;QAGH,SAAS,EAAE,IAHR;QAIH,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,EAAN;QAAA,CAJN;QAKH,mBAAgB,oBALb;QAMH,oBAAiB;MANd,gBAQH,gCAAC,uBAAD;QAAa,SAAS,EAAE,KAAKF,KAAL,CAAWG,OAAX,CAAmBN,eAA3C;QACa,OAAO,EAAE;UAACO,IAAI,EAAE,KAAKJ,KAAL,CAAWG,OAAX,CAAmBL;QAA1B,CADtB;QAEa,EAAE,EAAC;MAFhB,GAEsC,KAAKE,KAAL,CAAWK,KAAX,IAAoBC,gBAAA,CAAKC,CAAL,CAAO,UAAP,CAF1D,CARG,eAWH,gCAAC,yBAAD,qBACI,gCAAC,6BAAD;QAAmB,EAAE,EAAC;MAAtB,GACK,KAAKP,KAAL,CAAWQ,IAAX,IAAmBF,gBAAA,CAAKC,CAAL,CAAO,mBAAP,CADxB,CADJ,CAXG,eAgBH,gCAAC,yBAAD,qBACI,gCAAC,kBAAD;QAAQ,OAAO,EAAC,WAAhB;QAA4B,OAAO,EAAE;UAAA,OAAM,KAAI,CAACL,QAAL,EAAN;QAAA,CAArC;QAA4D,KAAK,EAAC,SAAlE;QAA4E,SAAS,MAArF;QAAsF,SAAS,eAAE,gCAAC,iBAAD;MAAjG,GAAiHI,gBAAA,CAAKC,CAAL,CAAO,OAAP,CAAjH,CADJ,CAhBG,CAAP;IAoBH;;;EA1BqBE,iBAAA,CAAMC,S;;AA6BhCX,WAAW,CAACY,SAAZ,GAAwB;EACpBV,OAAO,EAAEW,qBAAA,CAAUC,IAAV,CAAeC,UADJ;EAEpBT,KAAK,EAAEO,qBAAA,CAAUG,MAFG;EAGpBP,IAAI,EAAEI,qBAAA,CAAUI,SAAV,CAAoB,CACtBJ,qBAAA,CAAUG,MADY,EAEtBH,qBAAA,CAAUK,OAFY,CAApB,CAHc;EAOpBC,IAAI,EAAEN,qBAAA,CAAUO;AAPI,CAAxB;AAUA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAW1B,MAAX,EAAmBI,WAAnB,CAAhB;;eACeqB,O"}
1
+ {"version":3,"file":"Error.js","names":["styles","theme","titleBackground","titleColor","DialogError","props","onClose","handleOk","classes","root","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","oneOfType","element","icon","object","_export","withStyles"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,eAAe,EAAE,EADI;IAIrBC,UAAU,EAAE;EAJS,CAAL;AAAA,CAApB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;IACMC,W;;;;;;;;;;;;WACF,oBAAW;MACP,KAAKC,KAAL,CAAWC,OAAX,IAAsB,KAAKD,KAAL,CAAWC,OAAX,EAAtB;IACH;;;WAED,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QACH,IAAI,EAAE,IADH;QAEH,QAAQ,EAAC,IAFN;QAGH,SAAS,EAAE,IAHR;QAIH,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,EAAN;QAAA,CAJN;QAKH,mBAAgB,oBALb;QAMH,oBAAiB;MANd,gBAQH,gCAAC,uBAAD;QAAa,SAAS,EAAE,KAAKF,KAAL,CAAWG,OAAX,CAAmBN,eAA3C;QACa,OAAO,EAAE;UAACO,IAAI,EAAE,KAAKJ,KAAL,CAAWG,OAAX,CAAmBL;QAA1B,CADtB;QAEa,EAAE,EAAC;MAFhB,GAEsC,KAAKE,KAAL,CAAWK,KAAX,IAAoBC,gBAAA,CAAKC,CAAL,CAAO,UAAP,CAF1D,CARG,eAWH,gCAAC,yBAAD,qBACI,gCAAC,6BAAD;QAAmB,EAAE,EAAC;MAAtB,GACK,KAAKP,KAAL,CAAWQ,IAAX,IAAmBF,gBAAA,CAAKC,CAAL,CAAO,mBAAP,CADxB,CADJ,CAXG,eAgBH,gCAAC,yBAAD,qBACI,gCAAC,kBAAD;QAAQ,OAAO,EAAC,WAAhB;QAA4B,OAAO,EAAE;UAAA,OAAM,KAAI,CAACL,QAAL,EAAN;QAAA,CAArC;QAA4D,KAAK,EAAC,SAAlE;QAA4E,SAAS,MAArF;QAAsF,SAAS,eAAE,gCAAC,iBAAD;MAAjG,GAAiHI,gBAAA,CAAKC,CAAL,CAAO,OAAP,CAAjH,CADJ,CAhBG,CAAP;IAoBH;;;EA1BqBE,iBAAA,CAAMC,S;;AA6BhCX,WAAW,CAACY,SAAZ,GAAwB;EACpBV,OAAO,EAAEW,qBAAA,CAAUC,IAAV,CAAeC,UADJ;EAEpBT,KAAK,EAAEO,qBAAA,CAAUG,MAFG;EAGpBP,IAAI,EAAEI,qBAAA,CAAUI,SAAV,CAAoB,CACtBJ,qBAAA,CAAUG,MADY,EAEtBH,qBAAA,CAAUK,OAFY,CAApB,CAHc;EAOpBC,IAAI,EAAEN,qBAAA,CAAUO;AAPI,CAAxB;AAUA;;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAA,EAAW1B,MAAX,EAAmBI,WAAnB,CAAhB;;eACeqB,O"}
@@ -43,7 +43,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
43
43
 
44
44
  /**
45
45
  * @typedef {object} DialogMessageProps
46
- * @property {string} [key] The key to identify this component.
47
46
  * @property {string} [title] The dialog title; default: Message (translated)
48
47
  * @property {string} text The dialog text.
49
48
  * @property {() => void} [onClose] Close handler.
@@ -1 +1 @@
1
- {"version":3,"file":"Message.js","names":["DialogMessage","props","onClose","handleOk","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","icon","object"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n {this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n icon: PropTypes.object\n};\n\nexport default DialogMessage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACMA,a;;;;;;;;;;;;WAEF,oBAAW;MACP,KAAKC,KAAL,CAAWC,OAAX,IAAsB,KAAKD,KAAL,CAAWC,OAAX,EAAtB;IACH;;;WAED,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QACH,IAAI,EAAE,IADH;QAEH,QAAQ,EAAC,IAFN;QAGH,SAAS,EAAE,IAHR;QAIH,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,EAAN;QAAA,CAJN;QAKH,mBAAgB,sBALb;QAMH,oBAAiB;MANd,gBAQH,gCAAC,uBAAD;QAAa,EAAE,EAAC;MAAhB,GAAwC,KAAKF,KAAL,CAAWG,KAAX,IAAoBC,gBAAA,CAAKC,CAAL,CAAO,YAAP,CAA5D,CARG,eASH,gCAAC,yBAAD,qBACI,gCAAC,6BAAD;QAAmB,EAAE,EAAC;MAAtB,GACK,KAAKL,KAAL,CAAWM,IADhB,CADJ,CATG,eAcH,gCAAC,yBAAD,qBACI,gCAAC,kBAAD;QAAQ,OAAO,EAAC,WAAhB;QAA4B,OAAO,EAAE;UAAA,OAAM,KAAI,CAACJ,QAAL,EAAN;QAAA,CAArC;QAA4D,KAAK,EAAC,SAAlE;QAA4E,SAAS,MAArF;QAAsF,SAAS,eAAE,gCAAC,iBAAD;MAAjG,GAAiHE,gBAAA,CAAKC,CAAL,CAAO,UAAP,CAAjH,CADJ,CAdG,CAAP;IAkBH;;;EAzBuBE,iBAAA,CAAMC,S;;AA4BlCT,aAAa,CAACU,SAAd,GAA0B;EACtBR,OAAO,EAAES,qBAAA,CAAUC,IAAV,CAAeC,UADF;EAEtBT,KAAK,EAAEO,qBAAA,CAAUG,MAFK;EAGtBP,IAAI,EAAEI,qBAAA,CAAUG,MAHM;EAItBC,IAAI,EAAEJ,qBAAA,CAAUK;AAJM,CAA1B;eAOehB,a"}
1
+ {"version":3,"file":"Message.js","names":["DialogMessage","props","onClose","handleOk","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","icon","object"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n {this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n icon: PropTypes.object\n};\n\nexport default DialogMessage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACMA,a;;;;;;;;;;;;WAEF,oBAAW;MACP,KAAKC,KAAL,CAAWC,OAAX,IAAsB,KAAKD,KAAL,CAAWC,OAAX,EAAtB;IACH;;;WAED,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QACH,IAAI,EAAE,IADH;QAEH,QAAQ,EAAC,IAFN;QAGH,SAAS,EAAE,IAHR;QAIH,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,EAAN;QAAA,CAJN;QAKH,mBAAgB,sBALb;QAMH,oBAAiB;MANd,gBAQH,gCAAC,uBAAD;QAAa,EAAE,EAAC;MAAhB,GAAwC,KAAKF,KAAL,CAAWG,KAAX,IAAoBC,gBAAA,CAAKC,CAAL,CAAO,YAAP,CAA5D,CARG,eASH,gCAAC,yBAAD,qBACI,gCAAC,6BAAD;QAAmB,EAAE,EAAC;MAAtB,GACK,KAAKL,KAAL,CAAWM,IADhB,CADJ,CATG,eAcH,gCAAC,yBAAD,qBACI,gCAAC,kBAAD;QAAQ,OAAO,EAAC,WAAhB;QAA4B,OAAO,EAAE;UAAA,OAAM,KAAI,CAACJ,QAAL,EAAN;QAAA,CAArC;QAA4D,KAAK,EAAC,SAAlE;QAA4E,SAAS,MAArF;QAAsF,SAAS,eAAE,gCAAC,iBAAD;MAAjG,GAAiHE,gBAAA,CAAKC,CAAL,CAAO,UAAP,CAAjH,CADJ,CAdG,CAAP;IAkBH;;;EAzBuBE,iBAAA,CAAMC,S;;AA4BlCT,aAAa,CAACU,SAAd,GAA0B;EACtBR,OAAO,EAAES,qBAAA,CAAUC,IAAV,CAAeC,UADF;EAEtBT,KAAK,EAAEO,qBAAA,CAAUG,MAFK;EAGtBP,IAAI,EAAEI,qBAAA,CAAUG,MAHM;EAItBC,IAAI,EAAEJ,qBAAA,CAAUK;AAJM,CAA1B;eAOehB,a"}
@@ -49,7 +49,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
49
49
 
50
50
  /**
51
51
  * @typedef {object} TextInputProps
52
- * @property {string} [key] The key to identify this component.
53
52
  * @property {(text: string | null) => void} onClose The dialog close callback.
54
53
  * @property {string} titleText The title text.
55
54
  * @property {string} [promptText] Prompt text (default: empty).
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","names":["TextInput","props","state","text","input","value","error","onClose","titleText","promptText","labelText","type","e","charCode","verify","target","rule","setState","applyText","I18n","t","cancelText","React","Component","propTypes","PropTypes","func","isRequired","string","replace","_export","withWidth"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport I18n from '../i18n';\n\nimport IconClose from '@mui/icons-material/Close';\nimport IconCheck from '@mui/icons-material/Check';\n\nimport withWidth from '../Components/withWidth';\n\n/**\n * @typedef {object} TextInputProps\n * @property {string} [key] The key to identify this component.\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprectaed\n error: ''\n }\n }\n render() {\n return <Dialog open={true} onClose={() => this.props.onClose(null)} aria-labelledby=\"form-dialog-title\">\n <DialogTitle id=\"form-dialog-title\">{this.props.titleText}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {this.props.promptText}\n </DialogContentText>\n <TextField\n variant=\"standard\"\n autoFocus\n margin=\"dense\"\n error={!!this.state.error}\n title={this.state.error}\n value={this.state.text}\n label={this.props.labelText || ''}\n type={this.props.type || 'text'}\n onKeyPress={e => e.charCode === 13 && this.state.text && this.props.onClose(this.state.text)}\n onChange={e => {\n let error = '';\n if (this.props.verify) {\n error = !this.props.verify(e.target.value);\n }\n\n if (this.props.rule) {\n this.setState({text: this.props.rule(e.target.value), error});\n } else {\n this.setState({text: e.target.value, error});\n }\n }}\n fullWidth\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" disabled={!this.state.text || this.state.error} onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\" startIcon={<IconCheck />}>{this.props.applyText || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.props.onClose(null)} startIcon={<IconClose />}>{this.props.cancelText || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n onClose: PropTypes.func.isRequired,\n titleText: PropTypes.string.isRequired,\n promptText: PropTypes.string,\n labelText: PropTypes.string,\n cancelText: PropTypes.string,\n applyText: PropTypes.string,\n verify: PropTypes.func,\n replace: PropTypes.func,\n type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACMA,S;;;;;EACF;AACJ;AACA;EACI,mBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IAEA,MAAKC,KAAL,GAAa;MACTC,IAAI,EAAE,MAAKF,KAAL,CAAWG,KAAX,IAAoB,MAAKH,KAAL,CAAWI,KAA/B,IAAwC,EADrC;MACyC;MAClDC,KAAK,EAAE;IAFE,CAAb;IAHe;EAOlB;;;;WACD,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QAAQ,IAAI,EAAE,IAAd;QAAoB,OAAO,EAAE;UAAA,OAAM,MAAI,CAACL,KAAL,CA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UG,MALJ;EAMlBV,SAAS,EAAEO,qBAAA,CAAUG,MANH;EAOlBd,MAAM,EAAEW,qBAAA,CAAUC,IAPA;EAQlBG,OAAO,EAAEJ,qBAAA,CAAUC,IARD;EASlBf,IAAI,EAAEc,qBAAA,CAAUG,MATE;EASM;EACxBvB,KAAK,EAAEoB,qBAAA,CAAUG;AAVC,CAAtB;AAaA;;AACA,IAAME,OAAO,GAAG,IAAAC,qBAAA,IAAY/B,SAAZ,CAAhB;;eACe8B,O"}
1
+ {"version":3,"file":"TextInput.js","names":["TextInput","props","state","text","input","value","error","onClose","titleText","promptText","labelText","type","e","charCode","verify","target","rule","setState","applyText","I18n","t","cancelText","React","Component","propTypes","PropTypes","func","isRequired","string","replace","_export","withWidth"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport I18n from '../i18n';\n\nimport IconClose from '@mui/icons-material/Close';\nimport IconCheck from '@mui/icons-material/Check';\n\nimport withWidth from '../Components/withWidth';\n\n/**\n * @typedef {object} TextInputProps\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprectaed\n error: ''\n }\n }\n render() {\n return <Dialog open={true} onClose={() => this.props.onClose(null)} aria-labelledby=\"form-dialog-title\">\n <DialogTitle id=\"form-dialog-title\">{this.props.titleText}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {this.props.promptText}\n </DialogContentText>\n <TextField\n variant=\"standard\"\n autoFocus\n margin=\"dense\"\n error={!!this.state.error}\n title={this.state.error}\n value={this.state.text}\n label={this.props.labelText || ''}\n type={this.props.type || 'text'}\n onKeyPress={e => e.charCode === 13 && this.state.text && this.props.onClose(this.state.text)}\n onChange={e => {\n let error = '';\n if (this.props.verify) {\n error = !this.props.verify(e.target.value);\n }\n\n if (this.props.rule) {\n this.setState({text: this.props.rule(e.target.value), error});\n } else {\n this.setState({text: e.target.value, error});\n }\n }}\n fullWidth\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" disabled={!this.state.text || this.state.error} onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\" startIcon={<IconCheck />}>{this.props.applyText || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.props.onClose(null)} startIcon={<IconClose />}>{this.props.cancelText || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n onClose: PropTypes.func.isRequired,\n titleText: PropTypes.string.isRequired,\n promptText: PropTypes.string,\n labelText: PropTypes.string,\n cancelText: PropTypes.string,\n applyText: PropTypes.string,\n verify: PropTypes.func,\n replace: PropTypes.func,\n type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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7F,GAA6G,KAAKN,KAAL,CAAWoB,UAAX,IAAyBF,gBAAA,CAAKC,CAAL,CAAO,WAAP,CAAtI,CAHJ,CA/BG,CAAP;IAqCH;;;EAlDmBE,iBAAA,CAAMC,S;;AAqD9BvB,SAAS,CAACwB,SAAV,GAAsB;EAClBjB,OAAO,EAAEkB,qBAAA,CAAUC,IAAV,CAAeC,UADN;EAElBnB,SAAS,EAAEiB,qBAAA,CAAUG,MAAV,CAAiBD,UAFV;EAGlBlB,UAAU,EAAEgB,qBAAA,CAAUG,MAHJ;EAIlBlB,SAAS,EAAEe,qBAAA,CAAUG,MAJH;EAKlBP,UAAU,EAAEI,qBAAA,CAAUG,MALJ;EAMlBV,SAAS,EAAEO,qBAAA,CAAUG,MANH;EAOlBd,MAAM,EAAEW,qBAAA,CAAUC,IAPA;EAQlBG,OAAO,EAAEJ,qBAAA,CAAUC,IARD;EASlBf,IAAI,EAAEc,qBAAA,CAAUG,MATE;EASM;EACxBvB,KAAK,EAAEoB,qBAAA,CAAUG;AAVC,CAAtB;AAaA;;AACA,IAAME,OAAO,GAAG,IAAAC,qBAAA,IAAY/B,SAAZ,CAAhB;;eACe8B,O"}
package/README.md CHANGED
@@ -624,6 +624,7 @@ The icons may not be reused in other projects without the proper flaticon licens
624
624
  - All `@material-ui/icons/...` => `@mui/icons-material/...`
625
625
  - Change `import { withStyles } from '@material-ui/core/styles';` => `import { withStyles } from '@mui/styles';`
626
626
  - Change `import { makeStyles } from '@mui/material/styles';` => `import { makeStyles } from '@mui/styles';`
627
+ - Change `import withWidth from '@material-ui/core/withWidth';` => `import { withWidth } from '@iobroker/adapter-react-v5';`
627
628
  - All `@material-ui/core...` => `@mui/material...`
628
629
  - Change `import { MuiThemeProvider } from '@material-ui/core/styles';` => `import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles';`
629
630
  - Change all `<MuiThemeProvider theme={this.state.theme}>` to `<StyledEngineProvider injectFirst><ThemeProvider theme={this.state.theme}>`
@@ -641,6 +642,9 @@ If you still have questions, try to find an answer [here](https://mui.com/guides
641
642
  -->
642
643
 
643
644
  ## Changelog
645
+ ### 3.1.17 (2022-07-05)
646
+ * (bluefox) Deactivate JSON editor for JSONConfig because of space
647
+
644
648
  ### 3.1.16 (2022-06-27)
645
649
  * (bluefox) Update object browser
646
650
 
package/icons/IconCopy.js CHANGED
@@ -13,7 +13,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  /**
15
15
  * @typedef {object} IconCopyProps
16
- * @property {string} [key] The key to identify this component.
17
16
  * @property {number} [width] The width in pixels of the icon.
18
17
  * @property {number} [height] The height in pixels of the icon.
19
18
  * @property {(e: React.MouseEvent) => void} [onClick] Click handler.
@@ -1 +1 @@
1
- {"version":3,"file":"IconCopy.js","names":["IconCopy","props","e","onClick","width","height","className","propTypes","PropTypes","func","oneOfType","number","string"],"sources":["IconCopy.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * @typedef {object} IconCopyProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [width] The width in pixels of the icon.\n * @property {number} [height] The height in pixels of the icon.\n * @property {(e: React.MouseEvent) => void} [onClick] Click handler.\n * @property {string} [className] The class name for the SVG element.\n *\n * @extends {React.Component<IconCopyProps>}\n */\nconst IconCopy = props => {\n return <svg onClick={e => props.onClick && props.onClick(e)} viewBox=\"0 0 512 512\" width={props.width || 20} height={props.height || props.width || 20} xmlns=\"http://www.w3.org/2000/svg\" className={ props.className }>\n <path fill=\"currentColor\" d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"/>\n </svg>;\n}\n\nIconCopy.propTypes = {\n onClick: PropTypes.func,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\n\nexport default IconCopy;"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAAAC,KAAK,EAAI;EACtB,oBAAO;IAAK,OAAO,EAAE,iBAAAC,CAAC;MAAA,OAAID,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACE,OAAN,CAAcD,CAAd,CAArB;IAAA,CAAf;IAAsD,OAAO,EAAC,aAA9D;IAA4E,KAAK,EAAED,KAAK,CAACG,KAAN,IAAe,EAAlG;IAAsG,MAAM,EAAEH,KAAK,CAACI,MAAN,IAAgBJ,KAAK,CAACG,KAAtB,IAA+B,EAA7I;IAAiJ,KAAK,EAAC,4BAAvJ;IAAoL,SAAS,EAAGH,KAAK,CAACK;EAAtM,gBACH;IAAM,IAAI,EAAC,cAAX;IAA0B,CAAC,EAAC;EAA5B,EADG,CAAP;AAGH,CAJD;;AAMAN,QAAQ,CAACO,SAAT,GAAqB;EACjBJ,OAAO,EAAEK,qBAAA,CAAUC,IADF;EAEjBL,KAAK,EAAEI,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUG,MAAX,EAAmBH,qBAAA,CAAUI,MAA7B,CAApB,CAFU;EAGjBP,MAAM,EAAEG,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUG,MAAX,EAAmBH,qBAAA,CAAUI,MAA7B,CAApB,CAHS;EAIjBN,SAAS,EAAEE,qBAAA,CAAUI;AAJJ,CAArB;eAOeZ,Q"}
1
+ {"version":3,"file":"IconCopy.js","names":["IconCopy","props","e","onClick","width","height","className","propTypes","PropTypes","func","oneOfType","number","string"],"sources":["IconCopy.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * @typedef {object} IconCopyProps\n * @property {number} [width] The width in pixels of the icon.\n * @property {number} [height] The height in pixels of the icon.\n * @property {(e: React.MouseEvent) => void} [onClick] Click handler.\n * @property {string} [className] The class name for the SVG element.\n *\n * @extends {React.Component<IconCopyProps>}\n */\nconst IconCopy = props => {\n return <svg onClick={e => props.onClick && props.onClick(e)} viewBox=\"0 0 512 512\" width={props.width || 20} height={props.height || props.width || 20} xmlns=\"http://www.w3.org/2000/svg\" className={ props.className }>\n <path fill=\"currentColor\" d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"/>\n </svg>;\n}\n\nIconCopy.propTypes = {\n onClick: PropTypes.func,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\n\nexport default IconCopy;"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAAAC,KAAK,EAAI;EACtB,oBAAO;IAAK,OAAO,EAAE,iBAAAC,CAAC;MAAA,OAAID,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACE,OAAN,CAAcD,CAAd,CAArB;IAAA,CAAf;IAAsD,OAAO,EAAC,aAA9D;IAA4E,KAAK,EAAED,KAAK,CAACG,KAAN,IAAe,EAAlG;IAAsG,MAAM,EAAEH,KAAK,CAACI,MAAN,IAAgBJ,KAAK,CAACG,KAAtB,IAA+B,EAA7I;IAAiJ,KAAK,EAAC,4BAAvJ;IAAoL,SAAS,EAAGH,KAAK,CAACK;EAAtM,gBACH;IAAM,IAAI,EAAC,cAAX;IAA0B,CAAC,EAAC;EAA5B,EADG,CAAP;AAGH,CAJD;;AAMAN,QAAQ,CAACO,SAAT,GAAqB;EACjBJ,OAAO,EAAEK,qBAAA,CAAUC,IADF;EAEjBL,KAAK,EAAEI,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUG,MAAX,EAAmBH,qBAAA,CAAUI,MAA7B,CAApB,CAFU;EAGjBP,MAAM,EAAEG,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUG,MAAX,EAAmBH,qBAAA,CAAUI,MAA7B,CAApB,CAHS;EAIjBN,SAAS,EAAEE,qBAAA,CAAUI;AAJJ,CAArB;eAOeZ,Q"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "bluefox",