@iobroker/adapter-react-v5 4.1.0 → 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.
Files changed (81) hide show
  1. package/Components/ColorPicker.d.ts +8 -8
  2. package/Components/FileBrowser.d.ts +24 -24
  3. package/Components/FileViewer.d.ts +12 -12
  4. package/Components/Icon.d.ts +7 -7
  5. package/Components/Icon.js +1 -1
  6. package/Components/Icon.js.map +1 -1
  7. package/Components/IconPicker.d.ts +10 -10
  8. package/Components/IconSelector.d.ts +7 -7
  9. package/Components/Image.d.ts +4 -4
  10. package/Components/JsonConfigComponent/ConfigCRON.d.ts +1 -1
  11. package/Components/JsonConfigComponent/ConfigCertCollection.js +2 -2
  12. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
  13. package/Components/JsonConfigComponent/ConfigCertificates.js +2 -2
  14. package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -1
  15. package/Components/JsonConfigComponent/ConfigCheckLicense.js +7 -7
  16. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
  17. package/Components/JsonConfigComponent/ConfigCustom.d.ts +10 -10
  18. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +23 -23
  19. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +1 -1
  20. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +1 -1
  21. package/Components/JsonConfigComponent/ConfigPort.js +1 -1
  22. package/Components/JsonConfigComponent/ConfigPort.js.map +1 -1
  23. package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
  24. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  25. package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
  26. package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
  27. package/Components/JsonConfigComponent/ConfigTable.js +2 -2
  28. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  29. package/Components/JsonConfigComponent/ConfigUUID.d.ts +2 -2
  30. package/Components/JsonConfigComponent/ConfigUUID.js +1 -1
  31. package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -1
  32. package/Components/Loader.d.ts +2 -2
  33. package/Components/Loaders/PT.d.ts +2 -2
  34. package/Components/Loaders/Vendor.d.ts +2 -2
  35. package/Components/Logo.d.ts +7 -7
  36. package/Components/ObjectBrowser.d.ts +52 -52
  37. package/Components/ObjectBrowser.js +22 -25
  38. package/Components/ObjectBrowser.js.map +1 -1
  39. package/Components/SaveCloseButtons.d.ts +10 -10
  40. package/Components/SelectWithIcon.js +1 -1
  41. package/Components/SelectWithIcon.js.map +1 -1
  42. package/Components/TabContainer.d.ts +2 -2
  43. package/Components/TabContent.d.ts +1 -1
  44. package/Components/TextWithIcon.js.map +1 -1
  45. package/Components/TreeTable.js +1 -1
  46. package/Components/TreeTable.js.map +1 -1
  47. package/Components/UploadImage.js +2 -2
  48. package/Components/UploadImage.js.map +1 -1
  49. package/Components/Utils.js +8 -6
  50. package/Components/Utils.js.map +1 -1
  51. package/Dialogs/Confirm.js +1 -1
  52. package/Dialogs/Confirm.js.map +1 -1
  53. package/Dialogs/Error.d.ts +5 -5
  54. package/Dialogs/Message.d.ts +6 -6
  55. package/Dialogs/SelectFile.d.ts +28 -28
  56. package/Dialogs/SelectID.d.ts +27 -27
  57. package/Dialogs/TextInput.d.ts +11 -11
  58. package/GenericApp.d.ts +10 -9
  59. package/GenericApp.js +16 -13
  60. package/GenericApp.js.map +1 -1
  61. package/LegacyConnection.d.ts +13 -7
  62. package/LegacyConnection.js +181 -161
  63. package/LegacyConnection.js.map +1 -1
  64. package/README.md +10 -3
  65. package/icons/IconAdapter.d.ts +4 -4
  66. package/icons/IconAlias.d.ts +4 -4
  67. package/icons/IconChannel.d.ts +4 -4
  68. package/icons/IconClearFilter.d.ts +4 -4
  69. package/icons/IconClosed.d.ts +4 -4
  70. package/icons/IconCopy.d.ts +4 -4
  71. package/icons/IconDevice.d.ts +4 -4
  72. package/icons/IconDocument.d.ts +4 -4
  73. package/icons/IconDocumentReadOnly.d.ts +4 -4
  74. package/icons/IconExpert.d.ts +4 -4
  75. package/icons/IconFx.d.ts +4 -4
  76. package/icons/IconInstance.d.ts +4 -4
  77. package/icons/IconLogout.d.ts +4 -4
  78. package/icons/IconNoIcon.d.ts +4 -4
  79. package/icons/IconOpen.d.ts +4 -4
  80. package/icons/IconState.d.ts +4 -4
  81. package/package.json +10 -10
@@ -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-2022 bluefox <dogafox@gmail.com>
29
+ * Copyright 2019-2023 bluefox <dogafox@gmail.com>
30
30
  *
31
31
  * MIT License
32
32
  *
@@ -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,sBAA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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,CAA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BAAS,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"}
@@ -39,11 +39,11 @@ declare class DialogError extends React.Component<DialogErrorProps, any, any> {
39
39
  }
40
40
  declare namespace DialogError {
41
41
  namespace propTypes {
42
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
43
- const fullWidth: PropTypes.Requireable<boolean>;
44
- const title: PropTypes.Requireable<string>;
45
- const text: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
46
- const icon: PropTypes.Requireable<object>;
42
+ let onClose: PropTypes.Validator<(...args: any[]) => any>;
43
+ let fullWidth: PropTypes.Requireable<boolean>;
44
+ let title: PropTypes.Requireable<string>;
45
+ let text: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
46
+ let icon: PropTypes.Requireable<object>;
47
47
  }
48
48
  }
49
49
  import React from 'react';
@@ -29,12 +29,12 @@ declare class DialogMessage extends React.Component<DialogMessageProps, any, any
29
29
  }
30
30
  declare namespace DialogMessage {
31
31
  namespace propTypes {
32
- const fullWidth: PropTypes.Requireable<boolean>;
33
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
34
- const title: PropTypes.Requireable<string>;
35
- const text: PropTypes.Requireable<string>;
36
- const ok: PropTypes.Requireable<string>;
37
- const icon: PropTypes.Requireable<object>;
32
+ let fullWidth: PropTypes.Requireable<boolean>;
33
+ let onClose: PropTypes.Validator<(...args: any[]) => any>;
34
+ let title: PropTypes.Requireable<string>;
35
+ let text: PropTypes.Requireable<string>;
36
+ let ok: PropTypes.Requireable<string>;
37
+ let icon: PropTypes.Requireable<object>;
38
38
  }
39
39
  }
40
40
  import React from 'react';
@@ -152,34 +152,34 @@ declare class DialogSelectFile extends React.Component<DialogSelectIDProps, any,
152
152
  }
153
153
  declare namespace DialogSelectFile {
154
154
  namespace propTypes {
155
- const imagePrefix: PropTypes.Requireable<string>;
156
- const dialogName: PropTypes.Requireable<string>;
157
- const selected: PropTypes.Requireable<NonNullable<string | any[]>>;
158
- const classes: PropTypes.Requireable<object>;
159
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
160
- const onOk: PropTypes.Validator<(...args: any[]) => any>;
161
- const ok: PropTypes.Requireable<string>;
162
- const cancel: PropTypes.Requireable<string>;
163
- const socket: PropTypes.Validator<object>;
164
- const allowUpload: PropTypes.Requireable<boolean>;
165
- const allowDownload: PropTypes.Requireable<boolean>;
166
- const allowCreateFolder: PropTypes.Requireable<boolean>;
167
- const allowDelete: PropTypes.Requireable<boolean>;
168
- const allowView: PropTypes.Requireable<boolean>;
169
- const showToolbar: PropTypes.Requireable<boolean>;
170
- const filterFiles: PropTypes.Requireable<string[]>;
171
- const filterByType: PropTypes.Requireable<string>;
172
- const limitPath: PropTypes.Requireable<string>;
173
- const selectOnlyFolders: PropTypes.Requireable<boolean>;
174
- const showViewTypeButton: PropTypes.Requireable<boolean>;
175
- const showTypeSelector: PropTypes.Requireable<boolean>;
176
- const title: PropTypes.Requireable<string>;
177
- const lang: PropTypes.Requireable<string>;
178
- const themeName: PropTypes.Requireable<string>;
179
- const themeType: PropTypes.Requireable<string>;
180
- const showExpertButton: PropTypes.Requireable<boolean>;
181
- const expertMode: PropTypes.Requireable<boolean>;
182
- const multiSelect: PropTypes.Requireable<boolean>;
155
+ let imagePrefix: PropTypes.Requireable<string>;
156
+ let dialogName: PropTypes.Requireable<string>;
157
+ let selected: PropTypes.Requireable<NonNullable<string | any[]>>;
158
+ let classes: PropTypes.Requireable<object>;
159
+ let onClose: PropTypes.Validator<(...args: any[]) => any>;
160
+ let onOk: PropTypes.Validator<(...args: any[]) => any>;
161
+ let ok: PropTypes.Requireable<string>;
162
+ let cancel: PropTypes.Requireable<string>;
163
+ let socket: PropTypes.Validator<object>;
164
+ let allowUpload: PropTypes.Requireable<boolean>;
165
+ let allowDownload: PropTypes.Requireable<boolean>;
166
+ let allowCreateFolder: PropTypes.Requireable<boolean>;
167
+ let allowDelete: PropTypes.Requireable<boolean>;
168
+ let allowView: PropTypes.Requireable<boolean>;
169
+ let showToolbar: PropTypes.Requireable<boolean>;
170
+ let filterFiles: PropTypes.Requireable<string[]>;
171
+ let filterByType: PropTypes.Requireable<string>;
172
+ let limitPath: PropTypes.Requireable<string>;
173
+ let selectOnlyFolders: PropTypes.Requireable<boolean>;
174
+ let showViewTypeButton: PropTypes.Requireable<boolean>;
175
+ let showTypeSelector: PropTypes.Requireable<boolean>;
176
+ let title: PropTypes.Requireable<string>;
177
+ let lang: PropTypes.Requireable<string>;
178
+ let themeName: PropTypes.Requireable<string>;
179
+ let themeType: PropTypes.Requireable<string>;
180
+ let showExpertButton: PropTypes.Requireable<boolean>;
181
+ let expertMode: PropTypes.Requireable<boolean>;
182
+ let multiSelect: PropTypes.Requireable<boolean>;
183
183
  }
184
184
  }
185
185
  import React from 'react';
@@ -130,33 +130,33 @@ declare class DialogSelectID extends React.Component<DialogSelectIDProps, any, a
130
130
  }
131
131
  declare namespace DialogSelectID {
132
132
  namespace propTypes {
133
- const dialogName: PropTypes.Requireable<string>;
134
- const classes: PropTypes.Requireable<object>;
135
- const notEditable: PropTypes.Requireable<boolean>;
136
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
137
- const onOk: PropTypes.Validator<(...args: any[]) => any>;
138
- const title: PropTypes.Requireable<string>;
139
- const lang: PropTypes.Requireable<string>;
140
- const foldersFirst: PropTypes.Requireable<boolean>;
141
- const isFloatComma: PropTypes.Requireable<boolean>;
142
- const dateFormat: PropTypes.Requireable<string>;
143
- const selected: PropTypes.Requireable<NonNullable<string | any[]>>;
144
- const filters: PropTypes.Requireable<object>;
145
- const customFilter: PropTypes.Requireable<object>;
146
- const statesOnly: PropTypes.Requireable<boolean>;
147
- const socket: PropTypes.Validator<object>;
148
- const cancel: PropTypes.Requireable<string>;
149
- const imagePrefix: PropTypes.Requireable<string>;
150
- const ok: PropTypes.Requireable<string>;
151
- const themeName: PropTypes.Requireable<string>;
152
- const themeType: PropTypes.Requireable<string>;
153
- const showExpertButton: PropTypes.Requireable<boolean>;
154
- const expertMode: PropTypes.Requireable<boolean>;
155
- const multiSelect: PropTypes.Requireable<boolean>;
156
- const types: PropTypes.Requireable<any[]>;
157
- const columns: PropTypes.Requireable<any[]>;
158
- const root: PropTypes.Requireable<string>;
159
- const filterFunc: PropTypes.Requireable<(...args: any[]) => any>;
133
+ let dialogName: PropTypes.Requireable<string>;
134
+ let classes: PropTypes.Requireable<object>;
135
+ let notEditable: PropTypes.Requireable<boolean>;
136
+ let onClose: PropTypes.Validator<(...args: any[]) => any>;
137
+ let onOk: PropTypes.Validator<(...args: any[]) => any>;
138
+ let title: PropTypes.Requireable<string>;
139
+ let lang: PropTypes.Requireable<string>;
140
+ let foldersFirst: PropTypes.Requireable<boolean>;
141
+ let isFloatComma: PropTypes.Requireable<boolean>;
142
+ let dateFormat: PropTypes.Requireable<string>;
143
+ let selected: PropTypes.Requireable<NonNullable<string | any[]>>;
144
+ let filters: PropTypes.Requireable<object>;
145
+ let customFilter: PropTypes.Requireable<object>;
146
+ let statesOnly: PropTypes.Requireable<boolean>;
147
+ let socket: PropTypes.Validator<object>;
148
+ let cancel: PropTypes.Requireable<string>;
149
+ let imagePrefix: PropTypes.Requireable<string>;
150
+ let ok: PropTypes.Requireable<string>;
151
+ let themeName: PropTypes.Requireable<string>;
152
+ let themeType: PropTypes.Requireable<string>;
153
+ let showExpertButton: PropTypes.Requireable<boolean>;
154
+ let expertMode: PropTypes.Requireable<boolean>;
155
+ let multiSelect: PropTypes.Requireable<boolean>;
156
+ let types: PropTypes.Requireable<any[]>;
157
+ let columns: PropTypes.Requireable<any[]>;
158
+ let root: PropTypes.Requireable<string>;
159
+ let filterFunc: PropTypes.Requireable<(...args: any[]) => any>;
160
160
  }
161
161
  }
162
162
  import React from 'react';
@@ -71,17 +71,17 @@ declare class TextInput extends React.Component<TextInputProps, any, any> {
71
71
  }
72
72
  declare namespace TextInput {
73
73
  namespace propTypes {
74
- const fullWidth: PropTypes.Requireable<boolean>;
75
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
76
- const titleText: PropTypes.Validator<string>;
77
- const promptText: PropTypes.Requireable<string>;
78
- const labelText: PropTypes.Requireable<string>;
79
- const cancelText: PropTypes.Requireable<string>;
80
- const applyText: PropTypes.Requireable<string>;
81
- const verify: PropTypes.Requireable<(...args: any[]) => any>;
82
- const replace: PropTypes.Requireable<(...args: any[]) => any>;
83
- const type: PropTypes.Requireable<string>;
84
- const value: PropTypes.Requireable<string>;
74
+ let fullWidth: PropTypes.Requireable<boolean>;
75
+ let onClose: PropTypes.Validator<(...args: any[]) => any>;
76
+ let titleText: PropTypes.Validator<string>;
77
+ let promptText: PropTypes.Requireable<string>;
78
+ let labelText: PropTypes.Requireable<string>;
79
+ let cancelText: PropTypes.Requireable<string>;
80
+ let applyText: PropTypes.Requireable<string>;
81
+ let verify: PropTypes.Requireable<(...args: any[]) => any>;
82
+ let replace: PropTypes.Requireable<(...args: any[]) => any>;
83
+ let type: PropTypes.Requireable<string>;
84
+ let value: PropTypes.Requireable<string>;
85
85
  }
86
86
  }
87
87
  import React from 'react';
package/GenericApp.d.ts CHANGED
@@ -82,8 +82,9 @@ declare class GenericApp extends Router<import("./types").GenericAppProps, impor
82
82
  getThemeType(theme: import('./types').Theme): string;
83
83
  /**
84
84
  * Changes the current theme
85
- */
86
- toggleTheme(): void;
85
+ * @param {string} newThemeName Theme name
86
+ **/
87
+ toggleTheme(newThemeName: string): void;
87
88
  /**
88
89
  * Gets the system configuration.
89
90
  * @returns {Promise<ioBroker.OtherObject>}
@@ -189,7 +190,7 @@ declare class GenericApp extends Router<import("./types").GenericAppProps, impor
189
190
  * @param {any} value The new value.
190
191
  * @param {(() => void)} [cb] Callback which will be called upon completion.
191
192
  */
192
- updateNativeValue(attr: string, value: any, cb?: () => void): void;
193
+ updateNativeValue(attr: string, value: any, cb?: (() => void)): void;
193
194
  /**
194
195
  * Set the error text to be shown.
195
196
  * @param {string | JSX.Element} text
@@ -213,12 +214,12 @@ declare class GenericApp extends Router<import("./types").GenericAppProps, impor
213
214
  }
214
215
  declare namespace GenericApp {
215
216
  namespace propTypes {
216
- const adapterName: PropTypes.Requireable<string>;
217
- const onThemeChange: PropTypes.Requireable<(...args: any[]) => any>;
218
- const socket: PropTypes.Requireable<object>;
219
- const encryptedFields: PropTypes.Requireable<any[]>;
220
- const bottomButtons: PropTypes.Requireable<boolean>;
221
- const Connection: PropTypes.Requireable<object>;
217
+ let adapterName: PropTypes.Requireable<string>;
218
+ let onThemeChange: PropTypes.Requireable<(...args: any[]) => any>;
219
+ let socket: PropTypes.Requireable<object>;
220
+ let encryptedFields: PropTypes.Requireable<any[]>;
221
+ let bottomButtons: PropTypes.Requireable<boolean>;
222
+ let Connection: PropTypes.Requireable<object>;
222
223
  }
223
224
  }
224
225
  import Router from './Components/Router';
package/GenericApp.js CHANGED
@@ -425,25 +425,28 @@ var GenericApp = /*#__PURE__*/function (_Router) {
425
425
 
426
426
  /**
427
427
  * Changes the current theme
428
- */
428
+ * @param {string} newThemeName Theme name
429
+ **/
429
430
  }, {
430
431
  key: "toggleTheme",
431
- value: function toggleTheme() {
432
+ value: function toggleTheme(newThemeName) {
432
433
  var _this3 = this;
433
434
  var themeName = this.state.themeName;
434
435
 
435
436
  // dark => blue => colored => light => dark
436
- var newThemeName = themeName === 'dark' ? 'blue' : themeName === 'blue' ? 'colored' : themeName === 'colored' ? 'light' : 'dark';
437
- _Utils["default"].setThemeName(newThemeName);
438
- var theme = this.createTheme(newThemeName);
439
- this.setState({
440
- theme: theme,
441
- themeName: this.getThemeName(theme),
442
- themeType: this.getThemeType(theme)
443
- }, function () {
444
- _this3.props.onThemeChange && _this3.props.onThemeChange(newThemeName);
445
- _this3.onThemeChanged && _this3.onThemeChanged(newThemeName);
446
- });
437
+ newThemeName = newThemeName || (themeName === 'dark' ? 'blue' : themeName === 'blue' ? 'colored' : themeName === 'colored' ? 'light' : 'dark');
438
+ if (newThemeName !== themeName) {
439
+ _Utils["default"].setThemeName(newThemeName);
440
+ var _theme2 = this.createTheme(newThemeName);
441
+ this.setState({
442
+ theme: _theme2,
443
+ themeName: this.getThemeName(_theme2),
444
+ themeType: this.getThemeType(_theme2)
445
+ }, function () {
446
+ _this3.props.onThemeChange && _this3.props.onThemeChange(newThemeName);
447
+ _this3.onThemeChanged && _this3.onThemeChanged(newThemeName);
448
+ });
449
+ }
447
450
  }
448
451
 
449
452
  /**