@iobroker/adapter-react-v5 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/JsonConfigComponent/ConfigCertCollection.js +2 -2
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificates.js +2 -2
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +7 -7
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPort.js +1 -1
- package/Components/JsonConfigComponent/ConfigPort.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +2 -2
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUUID.js +1 -1
- package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -1
- package/Components/ObjectBrowser.js +22 -25
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/UploadImage.js +2 -2
- package/Components/UploadImage.js.map +1 -1
- package/Components/Utils.js +1 -1
- package/Components/Utils.js.map +1 -1
- package/Dialogs/Confirm.js +1 -1
- package/Dialogs/Confirm.js.map +1 -1
- package/LegacyConnection.d.ts +6 -0
- package/LegacyConnection.js +181 -161
- package/LegacyConnection.js.map +1 -1
- package/README.md +7 -3
- package/package.json +9 -9
package/Dialogs/Confirm.js
CHANGED
|
@@ -26,7 +26,7 @@ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
|
26
26
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
27
27
|
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); }; }
|
|
28
28
|
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; } } /**
|
|
29
|
-
* Copyright 2019-
|
|
29
|
+
* Copyright 2019-2023 bluefox <dogafox@gmail.com>
|
|
30
30
|
*
|
|
31
31
|
* MIT License
|
|
32
32
|
*
|
package/Dialogs/Confirm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirm.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_FormControlLabel","_Checkbox","_Check","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","_createClass2","key","value","handleOk","setItem","onClose","handleCancel","render","_this2","setTimeout","createElement","open","maxWidth","fullWidth","undefined","event","reason","id","title","I18n","t","icon","text","classes","label","root","control","concat","checked","onChange","setState","suppressText","variant","onClick","color","autoFocus","startIcon","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","bool","string","object","number","_export","withStyles","_default","exports"],"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={!0}\n maxWidth=\"md\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel();\n }\n }}\n aria-labelledby=\"ar_confirmation_dialog_title\"\n aria-describedby=\"ar_confirmation_dialog_description\"\n >\n <DialogTitle id=\"ar_confirmation_dialog_title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"ar_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 id={`ar_dialog_confirm_suppress_${this.props.dialogName || ''}`} 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 id={`ar_dialog_confirm_ok_${this.props.dialogName || ''}`} variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button id={`ar_dialog_confirm_cancel_${this.props.dialogName || ''}`} 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 fullWidth: PropTypes.bool,\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AAEA,IAAAW,MAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,MAAA,GAAAb,sBAAA,CAAAC,OAAA;AAEA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAA2B,SAAAc,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE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CAAC;QAAA,CAAC;QAAC4B,KAAK,EAAC,MAAM;QAACE,SAAS,eAAElG,MAAA,YAAAwE,aAAA,CAAC1D,MAAA,WAAS,MAAE;MAAE,GAAE,IAAI,CAACiC,KAAK,CAACqD,MAAM,IAAInB,gBAAI,CAACC,CAAC,CAAC,WAAW,CAAU,CAC7M,CACX,CAAC;IACb;EAAC;EAAA,OAAAvC,aAAA;AAAA,EA1EuB0D,iBAAK,CAACC,SAAS;AA6E3C3D,aAAa,CAAC4D,SAAS,GAAG;EACtBpC,OAAO,EAAEqC,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClC/B,SAAS,EAAE6B,qBAAS,CAACG,IAAI;EACzB3B,KAAK,EAAEwB,qBAAS,CAACI,MAAM;EACvBxB,IAAI,EAAEoB,qBAAS,CAACI,MAAM;EACtBT,EAAE,EAAEK,qBAAS,CAACI,MAAM;EACpBR,MAAM,EAAEI,qBAAS,CAACI,MAAM;EACxBzB,IAAI,EAAEqB,qBAAS,CAACK,MAAM;EACtB1D,uBAAuB,EAAEqD,qBAAS,CAACM,MAAM;EACzCjB,YAAY,EAAEW,qBAAS,CAACI,MAAM;EAC9B1D,UAAU,EAAEsD,qBAAS,CAACI;AAC1B,CAAC;AAED,IAAMG,OAAO,GAAG,IAAAC,sBAAU,EAAC1E,MAAM,CAAC,CAACK,aAAa,CAAC;AAAC,IAAAsE,QAAA,GACnCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"Confirm.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_FormControlLabel","_Checkbox","_Check","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","_createClass2","key","value","handleOk","setItem","onClose","handleCancel","render","_this2","setTimeout","createElement","open","maxWidth","fullWidth","undefined","event","reason","id","title","I18n","t","icon","text","classes","label","root","control","concat","checked","onChange","setState","suppressText","variant","onClick","color","autoFocus","startIcon","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","bool","string","object","number","_export","withStyles","_default","exports"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2023 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={!0}\n maxWidth=\"md\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel();\n }\n }}\n aria-labelledby=\"ar_confirmation_dialog_title\"\n aria-describedby=\"ar_confirmation_dialog_description\"\n >\n <DialogTitle id=\"ar_confirmation_dialog_title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"ar_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 id={`ar_dialog_confirm_suppress_${this.props.dialogName || ''}`} 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 id={`ar_dialog_confirm_ok_${this.props.dialogName || ''}`} variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button id={`ar_dialog_confirm_cancel_${this.props.dialogName || ''}`} 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 fullWidth: PropTypes.bool,\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AAEA,IAAAW,MAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,MAAA,GAAAb,sBAAA,CAAAC,OAA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GACnCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
package/LegacyConnection.d.ts
CHANGED
|
@@ -233,6 +233,12 @@ declare class Connection {
|
|
|
233
233
|
* @returns {Promise<Record<string, ioBroker.Object>> | undefined}
|
|
234
234
|
*/
|
|
235
235
|
getObjects(update: boolean, disableProgressUpdate: boolean): Promise<Record<string, ioBroker.Object>> | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Gets objects by list of IDs.
|
|
238
|
+
* @param {string[]} list Array of object IDs to retrieve.
|
|
239
|
+
* @returns {void}
|
|
240
|
+
*/
|
|
241
|
+
getObjectsById(list: string[]): void;
|
|
236
242
|
/**
|
|
237
243
|
* Called internally.
|
|
238
244
|
* @private
|