@iobroker/adapter-react-v5 3.1.16 → 3.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/FileViewer.js +0 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/Image.js +0 -1
- package/Components/Image.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +7 -32
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/Loader.js +0 -1
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +0 -1
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +0 -1
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/ObjectBrowser.js +14 -4
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TabContainer.js +0 -1
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +0 -1
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +0 -4
- package/Components/TabHeader.js.map +1 -1
- package/Dialogs/Confirm.js +0 -1
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Error.js +0 -1
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/Message.js +0 -1
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/TextInput.js +0 -1
- package/Dialogs/TextInput.js.map +1 -1
- package/README.md +10 -0
- package/i18n/de.json +2 -1
- package/i18n/en.json +2 -1
- package/i18n/es.json +2 -1
- package/i18n/fr.json +2 -1
- package/i18n/it.json +2 -1
- package/i18n/nl.json +2 -1
- package/i18n/pl.json +2 -1
- package/i18n/pt.json +2 -1
- package/i18n/ru.json +2 -1
- package/i18n/zh-cn.json +2 -1
- package/i18n.js +19 -12
- package/i18n.js.map +1 -1
- package/icons/IconCopy.js +0 -1
- package/icons/IconCopy.js.map +1 -1
- package/package.json +1 -1
package/Components/FileViewer.js
CHANGED
|
@@ -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,CAFc;EAGtBC,GAAG,EAAK,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,EAAuB,KAAvB,EAA8B,KAA9B,CAHc;EA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AAKhB,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;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,MAAM,EAAE;MACJC,MAAM,E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EF,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"}
|
package/Components/Image.js
CHANGED
|
@@ -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/')
|
package/Components/Image.js.map
CHANGED
|
@@ -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} [
|
|
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,CAAuB,KAAvB,CAArB;EACAF,YAAY,CAACG,SAAb,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,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(
|
|
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","
|
|
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,eAEYA,IAFZ,EAEkBC,IAFlB,eAEkBA,IAFlB;gBAGUC,KAHV,GAGkBC,0BAAA,CAAcC,QAAd,CAAuBJ,IAAvB,EAA6BC,IAA7B,KAAsC,EAHxD;gBAII,KAAKI,QAAL,CAAc;kBAAEH,KAAK,EAALA,KAAF;kBAASI,WAAW,EAAE;gBAAtB,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CAAN;QAAA,CAJG;QAKZ,OAAO,EAAE;UAAA,OAAM,KAAI,CAACI,QAAL,CAAc;YAAEQ,YAAY,EAAE;UAAhB,CAAd,EAAuC;YAAA,OAAM,KAAI,CAACK,QAAL,CAAcjB,IAAd,EAAoBC,KAApB,CAAN;UAAA,CAAvC,CAAN;QAAA;MALG,gBAOZ;QAAK,SAAS,EAAES,OAAO,CAACd;MAAxB,gBAiBI,6DAjBJ,CAPY,CAAH,GA0BI,IApCd,EAqCFe,MAAM,CAACO,IAAP,gBAAc,gCAAC,0BAAD,QAAiB,KAAKC,UAAL,CAAgB,KAAKrB,KAAL,CAAWa,MAAX,CAAkBO,IAAlC,EAAwC,KAAKpB,KAAL,CAAWa,MAAX,CAAkBS,QAA1D,EAAoE,KAAKtB,KAAL,CAAWa,MAAX,CAAkBU,aAAtF,CAAjB,CAAd,GAAwJ,IArCtJ,CAAP;IAuCH;;;EArD0BnB,0B;;AAwD/BL,gBAAgB,CAACyB,SAAjB,GAA6B;EACzBC,MAAM,EAAEC,qBAAA,CAAUC,MAAV,CAAiBC,UADA;EAEzBC,SAAS,EAAEH,qBAAA,CAAUI,MAFI;EAGzBC,SAAS,EAAEL,qBAAA,CAAUI,MAHI;EAIzBE,KAAK,EAAEN,qBAAA,CAAUC,MAJQ;EAKzBM,SAAS,EAAEP,qBAAA,CAAUI,MALI;EAMzB7B,IAAI,EAAEyB,qBAAA,CAAUC,MAAV,CAAiBC,UANE;EAOzBf,MAAM,EAAEa,qBAAA,CAAUC,MAPO;EAQzBO,OAAO,EAAER,qBAAA,CAAUS,IARM;EASzBhB,QAAQ,EAAEO,qBAAA,CAAUS;AATK,CAA7B;;eAYe,IAAAC,kBAAA,EAAW/C,MAAX,EAAmBU,gBAAnB,C"}
|
package/Components/Loader.js
CHANGED
|
@@ -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.
|
package/Components/Loader.js.map
CHANGED
|
@@ -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,GAAkBT,YAAlB;MACAG,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IARc;EASlB;;;;WAED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E;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,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"}
|
package/Components/Loaders/PT.js
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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"}
|
|
@@ -67,6 +67,8 @@ var _List = _interopRequireDefault(require("@mui/material/List"));
|
|
|
67
67
|
|
|
68
68
|
var _ListItem = _interopRequireDefault(require("@mui/material/ListItem"));
|
|
69
69
|
|
|
70
|
+
var _ListItemButton = _interopRequireDefault(require("@mui/material/ListItemButton"));
|
|
71
|
+
|
|
70
72
|
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
71
73
|
|
|
72
74
|
var _ListItemSecondaryAction = _interopRequireDefault(require("@mui/material/ListItemSecondaryAction"));
|
|
@@ -1534,7 +1536,7 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1534
1536
|
}
|
|
1535
1537
|
|
|
1536
1538
|
if (state.from) {
|
|
1537
|
-
var from = state.from
|
|
1539
|
+
var from = state.from.toString();
|
|
1538
1540
|
|
|
1539
1541
|
if (from.startsWith('system.adapter.')) {
|
|
1540
1542
|
from = from.substring(15);
|
|
@@ -1547,7 +1549,7 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1547
1549
|
}
|
|
1548
1550
|
|
|
1549
1551
|
if (state.user) {
|
|
1550
|
-
var user = state.user
|
|
1552
|
+
var user = state.user.toString();
|
|
1551
1553
|
|
|
1552
1554
|
if (user.startsWith('system.user.')) {
|
|
1553
1555
|
user = user.substring(12);
|
|
@@ -1559,6 +1561,13 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1559
1561
|
});
|
|
1560
1562
|
}
|
|
1561
1563
|
|
|
1564
|
+
if (state.c) {
|
|
1565
|
+
valFull.push({
|
|
1566
|
+
t: texts.c,
|
|
1567
|
+
v: state.c
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1562
1571
|
valFull.push({
|
|
1563
1572
|
t: texts.quality,
|
|
1564
1573
|
v: _Utils["default"].quality2text(state.q || 0).join(', '),
|
|
@@ -2730,6 +2739,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2730
2739
|
lc: props.t('ra_tooltip_lc'),
|
|
2731
2740
|
from: props.t('ra_tooltip_from'),
|
|
2732
2741
|
user: props.t('ra_tooltip_user'),
|
|
2742
|
+
c: props.t('ra_tooltip_comment'),
|
|
2733
2743
|
quality: props.t('ra_tooltip_quality'),
|
|
2734
2744
|
editObject: props.t('ra_tooltip_editObject'),
|
|
2735
2745
|
deleteObject: props.t('ra_tooltip_deleteObject'),
|
|
@@ -3178,7 +3188,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3178
3188
|
return cols.filter(function (id) {
|
|
3179
3189
|
return isLast && (id === 'val' || id === 'buttons') || !isLast && id !== 'val' && id !== 'buttons';
|
|
3180
3190
|
}).map(function (id) {
|
|
3181
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
3191
|
+
return /*#__PURE__*/_react["default"].createElement(_ListItemButton["default"], {
|
|
3182
3192
|
onClick: function onClick() {
|
|
3183
3193
|
if (!_this9.state.columnsAuto && id !== 'id') {
|
|
3184
3194
|
var columns = (0, _toConsumableArray2["default"])(_this9.state.columns || []);
|
|
@@ -3342,7 +3352,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3342
3352
|
}
|
|
3343
3353
|
}), /*#__PURE__*/_react["default"].createElement(_List["default"], null, this._renderDefinedList(false), this.state.columnsForAdmin && Object.keys(this.state.columnsForAdmin).sort().map(function (adapter) {
|
|
3344
3354
|
return _this10.state.columnsForAdmin[adapter].map(function (column) {
|
|
3345
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
3355
|
+
return /*#__PURE__*/_react["default"].createElement(_ListItemButton["default"], {
|
|
3346
3356
|
onClick: function onClick() {
|
|
3347
3357
|
if (!_this10.state.columnsAuto) {
|
|
3348
3358
|
var columns = (0, _toConsumableArray2["default"])(_this10.state.columns || []);
|