@iobroker/adapter-react-v5 3.0.12 → 3.0.15

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 (31) hide show
  1. package/Components/FileBrowser.js +1 -0
  2. package/Components/FileBrowser.js.map +1 -1
  3. package/Components/FileViewer.js +3 -3
  4. package/Components/FileViewer.js.map +1 -1
  5. package/Components/IconSelector.js +1822 -6
  6. package/Components/IconSelector.js.map +1 -1
  7. package/Components/JsonConfigComponent/ConfigCustom.js +80 -18
  8. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
  9. package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  10. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  11. package/Components/JsonConfigComponent/ConfigPanel.js +8 -1
  12. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  13. package/Components/JsonConfigComponent/ConfigPassword.js +2 -2
  14. package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
  15. package/Components/JsonConfigComponent/ConfigTable.js +58 -11
  16. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  17. package/Components/JsonConfigComponent/ConfigTabs.js +19 -1
  18. package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
  19. package/Components/Loader.js +16 -12
  20. package/Components/Loader.js.map +1 -1
  21. package/Components/Loaders/PT.js +11 -2
  22. package/Components/Loaders/PT.js.map +1 -1
  23. package/Components/Loaders/Vendor.js +11 -2
  24. package/Components/Loaders/Vendor.js.map +1 -1
  25. package/Dialogs/TextInput.js +3 -15
  26. package/Dialogs/TextInput.js.map +1 -1
  27. package/README.md +4 -1
  28. package/index.js +2 -2
  29. package/package.json +1 -1
  30. package/Components/JsonConfigComponent/ConfigCustomEasyAccess.js +0 -182
  31. package/Components/JsonConfigComponent/ConfigCustomEasyAccess.js.map +0 -1
@@ -23,12 +23,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
25
25
 
26
- require("./Vendor.css");
27
-
28
26
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
29
27
 
30
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; } }
31
29
 
30
+ // import './Vendor.css'
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
34
  * @property {string} [key] The key to identify this component.
@@ -38,6 +38,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
38
38
  *
39
39
  * @extends {React.Component<LoaderVendorProps>}
40
40
  */
41
+
41
42
  var LoaderVendor = /*#__PURE__*/function (_React$Component) {
42
43
  (0, _inherits2["default"])(LoaderVendor, _React$Component);
43
44
 
@@ -52,6 +53,14 @@ var LoaderVendor = /*#__PURE__*/function (_React$Component) {
52
53
  (0, _classCallCheck2["default"])(this, LoaderVendor);
53
54
  _this = _super.call(this, props);
54
55
  _this.size = _this.props.size || 200;
56
+
57
+ if (!window.document.getElementById('vendor-iobroker-component')) {
58
+ var style = window.document.createElement('style');
59
+ style.setAttribute('id', 'vendor-iobroker-component');
60
+ style.innerHTML = vendorStyles;
61
+ window.document.head.appendChild(style);
62
+ }
63
+
55
64
  return _this;
56
65
  }
57
66
 
@@ -1 +1 @@
1
- {"version":3,"file":"Vendor.js","names":["LoaderVendor","props","size","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';\nimport './Vendor.css'\n\n/**\n * @typedef {object} LoaderVendorProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderVendorProps>}\n */\nclass LoaderVendor extends React.Component {\n /**\n * @param {LoaderVendorProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n }\n\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;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACMA,Y;;;;;EACF;AACJ;AACA;EACI,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;IAFe;EAGlB;;;;WAED,kBAAS;MACL,IAAMC,KAAK,GAAG,KAAKF,KAAL,CAAWG,SAAX,IAAwB,KAAKH,KAAL,CAAWE,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;;;EAtBsBC,iBAAA,CAAMC,S;;AAyBjCZ,YAAY,CAACa,SAAb,GAAyB;EACrBX,IAAI,EAAEY,qBAAA,CAAUC,MADK;EAErBX,SAAS,EAAEU,qBAAA,CAAUE;AAFA,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAGjB,YAAhB;eACeiB,O"}
1
+ {"version":3,"file":"Vendor.js","names":["vendorStyles","LoaderVendor","props","size","window","document","getElementById","style","createElement","setAttribute","innerHTML","head","appendChild","theme","themeType","display","flexDirection","height","width","margin","flexGrow","React","Component","propTypes","PropTypes","number","string","_export"],"sources":["Loaders/Vendor.js"],"sourcesContent":["/**\n * Copyright 2021-2022 ioBroker GmbH\n *\n * MIT License\n *\n **/\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CircularProgress from '@mui/material/CircularProgress';\n// import './Vendor.css'\nconst vendorStyles = `\n.logo-background-light, .logo-background-colored {\n background: white;\n}\n.logo-background-dark, .logo-background-blue {\n background: black;\n}\n`;\n\n/**\n * @typedef {object} LoaderVendorProps\n * @property {string} [key] The key to identify this component.\n * @property {number} [size] The size in pixels of this loader.\n * @property {string} [themeType] The chosen theme type.\n * @property {string} [theme] The chosen theme.\n *\n * @extends {React.Component<LoaderVendorProps>}\n */\nclass LoaderVendor extends React.Component {\n /**\n * @param {LoaderVendorProps} props\n */\n constructor(props) {\n super(props);\n this.size = this.props.size || 200;\n\n if (!window.document.getElementById('vendor-iobroker-component')) {\n const style = window.document.createElement('style');\n style.setAttribute('id', 'vendor-iobroker-component');\n style.innerHTML = vendorStyles;\n window.document.head.appendChild(style);\n }\n }\n\n render() {\n const theme = this.props.themeType || this.props.theme || 'light';\n return <div className={'vendor-logo-back logo-background-' + theme} style={{\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n width: '10%',\n margin: 'auto'\n }}>\n <div style={{flexGrow: 1}}/>\n <CircularProgress color=\"secondary\" size={200} thickness={5}/>\n <div style={{flexGrow: 1}}/>\n </div>;\n }\n}\n\nLoaderVendor.propTypes = {\n size: PropTypes.number,\n themeType: PropTypes.string\n};\n\n/** @type {typeof LoaderVendor} */\nconst _export = LoaderVendor;\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;;;;;AACA;AACA,IAAMA,YAAY,iKAAlB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,Y;;;;;EACF;AACJ;AACA;EACI,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,MAAKC,IAAL,GAAY,MAAKD,KAAL,CAAWC,IAAX,IAAmB,GAA/B;;IAEA,IAAI,CAACC,MAAM,CAACC,QAAP,CAAgBC,cAAhB,CAA+B,2BAA/B,CAAL,EAAkE;MAC9D,IAAMC,KAAK,GAAGH,MAAM,CAACC,QAAP,CAAgBG,aAAhB,CAA8B,OAA9B,CAAd;MACAD,KAAK,CAACE,YAAN,CAAmB,IAAnB,EAAyB,2BAAzB;MACAF,KAAK,CAACG,SAAN,GAAkBV,YAAlB;MACAI,MAAM,CAACC,QAAP,CAAgBM,IAAhB,CAAqBC,WAArB,CAAiCL,KAAjC;IACH;;IATc;EAUlB;;;;WAED,kBAAS;MACL,IAAMM,KAAK,GAAG,KAAKX,KAAL,CAAWY,SAAX,IAAwB,KAAKZ,KAAL,CAAWW,KAAnC,IAA4C,OAA1D;MACA,oBAAO;QAAK,SAAS,EAAE,sCAAsCA,KAAtD;QAA6D,KAAK,EAAE;UACvEE,OAAO,EAAE,MAD8D;UAEvEC,aAAa,EAAE,QAFwD;UAGvEC,MAAM,EAAE,MAH+D;UAIvEC,KAAK,EAAE,KAJgE;UAKvEC,MAAM,EAAE;QAL+D;MAApE,gBAOH;QAAK,KAAK,EAAE;UAACC,QAAQ,EAAE;QAAX;MAAZ,EAPG,eAQH,gCAAC,4BAAD;QAAkB,KAAK,EAAC,WAAxB;QAAoC,IAAI,EAAE,GAA1C;QAA+C,SAAS,EAAE;MAA1D,EARG,eASH;QAAK,KAAK,EAAE;UAACA,QAAQ,EAAE;QAAX;MAAZ,EATG,CAAP;IAWH;;;EA7BsBC,iBAAA,CAAMC,S;;AAgCjCrB,YAAY,CAACsB,SAAb,GAAyB;EACrBpB,IAAI,EAAEqB,qBAAA,CAAUC,MADK;EAErBX,SAAS,EAAEU,qBAAA,CAAUE;AAFA,CAAzB;AAKA;;AACA,IAAMC,OAAO,GAAG1B,YAAhB;eACe0B,O"}
@@ -17,8 +17,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
17
17
 
18
18
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
19
 
20
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
21
-
22
20
  var _react = _interopRequireDefault(require("react"));
23
21
 
24
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -43,20 +41,12 @@ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
43
41
 
44
42
  var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
45
43
 
44
+ var _withWidth = _interopRequireDefault(require("../Components/withWidth"));
45
+
46
46
  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); }; }
47
47
 
48
48
  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; } }
49
49
 
50
- // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
51
- var withWidth = function withWidth() {
52
- return function (WrappedComponent) {
53
- return function (props) {
54
- return /*#__PURE__*/_react["default"].createElement(WrappedComponent, (0, _extends2["default"])({}, props, {
55
- width: "xs"
56
- }));
57
- };
58
- };
59
- };
60
50
  /**
61
51
  * @typedef {object} TextInputProps
62
52
  * @property {string} [key] The key to identify this component.
@@ -73,8 +63,6 @@ var withWidth = function withWidth() {
73
63
  *
74
64
  * @extends {React.Component<TextInputProps>}
75
65
  */
76
-
77
-
78
66
  var TextInput = /*#__PURE__*/function (_React$Component) {
79
67
  (0, _inherits2["default"])(TextInput, _React$Component);
80
68
 
@@ -177,7 +165,7 @@ TextInput.propTypes = {
177
165
  };
178
166
  /** @type {typeof TextInput} */
179
167
 
180
- var _export = withWidth()(TextInput);
168
+ var _export = (0, _withWidth["default"])()(TextInput);
181
169
 
182
170
  var _default = _export;
183
171
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","names":["withWidth","WrappedComponent","props","TextInput","state","text","input","value","error","onClose","titleText","promptText","labelText","type","e","charCode","verify","target","rule","setState","applyText","I18n","t","cancelText","React","Component","propTypes","PropTypes","func","isRequired","string","replace","_export"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport I18n from '../i18n';\n\nimport IconClose from '@mui/icons-material/Close';\nimport IconCheck from '@mui/icons-material/Check';\n\n// FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth\nconst withWidth = () => WrappedComponent => props => <WrappedComponent {...props} width=\"xs\" />;\n\n/**\n * @typedef {object} TextInputProps\n * @property {string} [key] The key to identify this component.\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprectaed\n error: ''\n }\n }\n render() {\n return <Dialog open={true} onClose={() => this.props.onClose(null)} aria-labelledby=\"form-dialog-title\">\n <DialogTitle id=\"form-dialog-title\">{this.props.titleText}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {this.props.promptText}\n </DialogContentText>\n <TextField\n variant=\"standard\"\n autoFocus\n margin=\"dense\"\n error={!!this.state.error}\n title={this.state.error}\n value={this.state.text}\n label={this.props.labelText || ''}\n type={this.props.type || 'text'}\n onKeyPress={e => e.charCode === 13 && this.state.text && this.props.onClose(this.state.text)}\n onChange={e => {\n let error = '';\n if (this.props.verify) {\n error = !this.props.verify(e.target.value);\n }\n\n if (this.props.rule) {\n this.setState({text: this.props.rule(e.target.value), error});\n } else {\n this.setState({text: e.target.value, error});\n }\n }}\n fullWidth\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" disabled={!this.state.text || this.state.error} onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\" startIcon={<IconCheck />}>{this.props.applyText || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.props.onClose(null)} startIcon={<IconClose />}>{this.props.cancelText || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n onClose: PropTypes.func.isRequired,\n titleText: PropTypes.string.isRequired,\n promptText: PropTypes.string,\n labelText: PropTypes.string,\n cancelText: PropTypes.string,\n applyText: PropTypes.string,\n verify: PropTypes.func,\n replace: PropTypes.func,\n type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;AAEA;AACA,IAAMA,SAAS,GAAG,SAAZA,SAAY;EAAA,OAAM,UAAAC,gBAAgB;IAAA,OAAI,UAAAC,KAAK;MAAA,oBAAI,gCAAC,gBAAD,gCAAsBA,KAAtB;QAA6B,KAAK,EAAC;MAAnC,GAAJ;IAAA,CAAT;EAAA,CAAtB;AAAA,CAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;IACMC,S;;;;;EACF;AACJ;AACA;EACI,mBAAYD,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IAEA,MAAKE,KAAL,GAAa;MACTC,IAAI,EAAE,MAAKH,KAAL,CAAWI,KAAX,IAAoB,MAAKJ,KAAL,CAAWK,KAA/B,IAAwC,EADrC;MACyC;MAClDC,KAAK,EAAE;IAFE,CAAb;IAHe;EAO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BD,UAFV;EAGlBlB,UAAU,EAAEgB,qBAAA,CAAUG,MAHJ;EAIlBlB,SAAS,EAAEe,qBAAA,CAAUG,MAJH;EAKlBP,UAAU,EAAEI,qBAAA,CAAUG,MALJ;EAMlBV,SAAS,EAAEO,qBAAA,CAAUG,MANH;EAOlBd,MAAM,EAAEW,qBAAA,CAAUC,IAPA;EAQlBG,OAAO,EAAEJ,qBAAA,CAAUC,IARD;EASlBf,IAAI,EAAEc,qBAAA,CAAUG,MATE;EASM;EACxBvB,KAAK,EAAEoB,qBAAA,CAAUG;AAVC,CAAtB;AAaA;;AACA,IAAME,OAAO,GAAGhC,SAAS,GAAGG,SAAH,CAAzB;;eACe6B,O"}
1
+ {"version":3,"file":"TextInput.js","names":["TextInput","props","state","text","input","value","error","onClose","titleText","promptText","labelText","type","e","charCode","verify","target","rule","setState","applyText","I18n","t","cancelText","React","Component","propTypes","PropTypes","func","isRequired","string","replace","_export","withWidth"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport I18n from '../i18n';\n\nimport IconClose from '@mui/icons-material/Close';\nimport IconCheck from '@mui/icons-material/Check';\n\nimport withWidth from '../Components/withWidth';\n\n/**\n * @typedef {object} TextInputProps\n * @property {string} [key] The key to identify this component.\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprectaed\n error: ''\n }\n }\n render() {\n return <Dialog open={true} onClose={() => this.props.onClose(null)} aria-labelledby=\"form-dialog-title\">\n <DialogTitle id=\"form-dialog-title\">{this.props.titleText}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {this.props.promptText}\n </DialogContentText>\n <TextField\n variant=\"standard\"\n autoFocus\n margin=\"dense\"\n error={!!this.state.error}\n title={this.state.error}\n value={this.state.text}\n label={this.props.labelText || ''}\n type={this.props.type || 'text'}\n onKeyPress={e => e.charCode === 13 && this.state.text && this.props.onClose(this.state.text)}\n onChange={e => {\n let error = '';\n if (this.props.verify) {\n error = !this.props.verify(e.target.value);\n }\n\n if (this.props.rule) {\n this.setState({text: this.props.rule(e.target.value), error});\n } else {\n this.setState({text: e.target.value, error});\n }\n }}\n fullWidth\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" disabled={!this.state.text || this.state.error} onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\" startIcon={<IconCheck />}>{this.props.applyText || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.props.onClose(null)} startIcon={<IconClose />}>{this.props.cancelText || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n onClose: PropTypes.func.isRequired,\n titleText: PropTypes.string.isRequired,\n promptText: PropTypes.string,\n labelText: PropTypes.string,\n cancelText: PropTypes.string,\n applyText: PropTypes.string,\n verify: PropTypes.func,\n replace: PropTypes.func,\n type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;"],"mappings":";;;;;;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O,EAAC,WAA7B;QAAyC,OAAO,EAAE;UAAA,OAAM,MAAI,CAACnB,KAAL,CAAWM,OAAX,CAAmB,IAAnB,CAAN;QAAA,CAAlD;QAAkF,SAAS,eAAE,gCAAC,iBAAD;MAA7F,GAA6G,KAAKN,KAAL,CAAWoB,UAAX,IAAyBF,gBAAA,CAAKC,CAAL,CAAO,WAAP,CAAtI,CAHJ,CA/BG,CAAP;IAqCH;;;EAlDmBE,iBAAA,CAAMC,S;;AAqD9BvB,SAAS,CAACwB,SAAV,GAAsB;EAClBjB,OAAO,EAAEkB,qBAAA,CAAUC,IAAV,CAAeC,UADN;EAElBnB,SAAS,EAAEiB,qBAAA,CAAUG,MAAV,CAAiBD,UAFV;EAGlBlB,UAAU,EAAEgB,qBAAA,CAAUG,MAHJ;EAIlBlB,SAAS,EAAEe,qBAAA,CAAUG,MAJH;EAKlBP,UAAU,EAAEI,qBAAA,CAAUG,MALJ;EAMlBV,SAAS,EAAEO,qBAAA,CAAUG,MANH;EAOlBd,MAAM,EAAEW,qBAAA,CAAUC,IAPA;EAQlBG,OAAO,EAAEJ,qBAAA,CAAUC,IARD;EASlBf,IAAI,EAAEc,qBAAA,CAAUG,MATE;EASM;EACxBvB,KAAK,EAAEoB,qBAAA,CAAUG;AAVC,CAAtB;AAaA;;AACA,IAAME,OAAO,GAAG,IAAAC,qBAAA,IAAY/B,SAAZ,CAAhB;;eACe8B,O"}
package/README.md CHANGED
@@ -641,7 +641,10 @@ If you still have questions, try to find an answer [here](https://mui.com/guides
641
641
  -->
642
642
 
643
643
  ## Changelog
644
- ### 3.0.12 (2022-05-25)
644
+ ### 3.0.15 (2022-06-01)
645
+ * (bluefox) Updated JsonConfigComponent: password, table
646
+
647
+ ### 3.0.14 (2022-05-25)
645
648
  * (bluefox) Added ConfigGeneric to import
646
649
 
647
650
  ### 3.0.7 (2022-05-25)
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { default as Theme } from './Theme';
2
2
  export * from './Theme';
3
3
 
4
- export { default as GenericApp } from './GenericApp';
5
- export * from './GenericApp';
4
+ // export { default as GenericApp } from './GenericApp';
5
+ // export * from './GenericApp';
6
6
 
7
7
  export { default as Connection } from './Connection';
8
8
  export * from './Connection';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "3.0.12",
3
+ "version": "3.0.15",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "bluefox",
@@ -1,182 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
17
-
18
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
- var _react = _interopRequireDefault(require("react"));
25
-
26
- var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
- var _styles = require("@mui/styles");
29
-
30
- var _Table = _interopRequireDefault(require("@mui/material/Table"));
31
-
32
- var _TableBody = _interopRequireDefault(require("@mui/material/TableBody"));
33
-
34
- var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
35
-
36
- var _TableContainer = _interopRequireDefault(require("@mui/material/TableContainer"));
37
-
38
- var _TableHead = _interopRequireDefault(require("@mui/material/TableHead"));
39
-
40
- var _TableRow = _interopRequireDefault(require("@mui/material/TableRow"));
41
-
42
- var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
43
-
44
- var _i18n = _interopRequireDefault(require("../../i18n"));
45
-
46
- var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
47
-
48
- 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); }; }
49
-
50
- 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; } }
51
-
52
- var styles = function styles(theme) {
53
- return {
54
- table: {
55
- minWidth: 400
56
- },
57
- header: {
58
- fontSize: 16,
59
- fontWeight: 'bold'
60
- }
61
- };
62
- };
63
-
64
- var ConfigCustomEasyAccess = /*#__PURE__*/function (_ConfigGeneric) {
65
- (0, _inherits2["default"])(ConfigCustomEasyAccess, _ConfigGeneric);
66
-
67
- var _super = _createSuper(ConfigCustomEasyAccess);
68
-
69
- function ConfigCustomEasyAccess() {
70
- (0, _classCallCheck2["default"])(this, ConfigCustomEasyAccess);
71
- return _super.apply(this, arguments);
72
- }
73
-
74
- (0, _createClass2["default"])(ConfigCustomEasyAccess, [{
75
- key: "componentDidMount",
76
- value: function componentDidMount() {
77
- var _this = this;
78
-
79
- (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigCustomEasyAccess.prototype), "componentDidMount", this).call(this);
80
- this.props.socket.getAdapterInstances().then(function (instances) {
81
- instances = instances.filter(function (instance) {
82
- var _instance$common;
83
-
84
- return (instance === null || instance === void 0 ? void 0 : (_instance$common = instance.common) === null || _instance$common === void 0 ? void 0 : _instance$common.adminUI) && (instance.common.adminUI.config !== 'none' || instance.common.adminUI.tab);
85
- }).map(function (instance) {
86
- return {
87
- id: instance._id.replace(/^system\.adapter\./, ''),
88
- config: instance.common.adminUI.config !== 'none',
89
- adminTab: instance.common.adminTab
90
- };
91
- }).sort(function (a, b) {
92
- return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
93
- });
94
-
95
- _this.setState({
96
- instances: instances
97
- });
98
- });
99
- }
100
- }, {
101
- key: "renderItem",
102
- value: function renderItem(error, disabled, defaultValue) {
103
- var _this2 = this;
104
-
105
- if (!this.state.instances) {
106
- return null;
107
- } else {
108
- var accessAllowedConfigs = _ConfigGeneric2["default"].getValue(this.props.data, 'accessAllowedConfigs') || [];
109
- var accessAllowedTabs = _ConfigGeneric2["default"].getValue(this.props.data, 'accessAllowedTabs') || [];
110
- return /*#__PURE__*/_react["default"].createElement(_TableContainer["default"], null, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
111
- className: this.props.classes.table,
112
- size: "small"
113
- }, /*#__PURE__*/_react["default"].createElement(_TableHead["default"], null, /*#__PURE__*/_react["default"].createElement(_TableRow["default"], null, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
114
- className: this.props.classes.header
115
- }, _i18n["default"].t('Instance')), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
116
- className: this.props.classes.header
117
- }, _i18n["default"].t('Config')), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
118
- className: this.props.classes.header
119
- }, _i18n["default"].t('Tab')))), /*#__PURE__*/_react["default"].createElement(_TableBody["default"], null, this.state.instances.map(function (row) {
120
- return /*#__PURE__*/_react["default"].createElement(_TableRow["default"], {
121
- key: row.id
122
- }, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
123
- component: "th",
124
- scope: "row"
125
- }, row.id), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, row.config ? /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
126
- checked: accessAllowedConfigs.includes(row.id),
127
- onClick: function onClick() {
128
- var _accessAllowedConfigs = (0, _toConsumableArray2["default"])(accessAllowedConfigs);
129
-
130
- var pos = _accessAllowedConfigs.indexOf(row.id);
131
-
132
- if (pos !== -1) {
133
- _accessAllowedConfigs.splice(pos, 1);
134
- } else {
135
- _accessAllowedConfigs.push(row.id);
136
-
137
- _accessAllowedConfigs.sort();
138
- }
139
-
140
- _this2.onChange('accessAllowedConfigs', _accessAllowedConfigs);
141
- }
142
- }) : null), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, row.adminTab ? /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
143
- checked: accessAllowedTabs.includes(row.id),
144
- onClick: function onClick() {
145
- var _accessAllowedTabs = (0, _toConsumableArray2["default"])(accessAllowedTabs);
146
-
147
- var pos = _accessAllowedTabs.indexOf(row.id);
148
-
149
- if (pos !== -1) {
150
- _accessAllowedTabs.splice(pos, 1);
151
- } else {
152
- _accessAllowedTabs.push(row.id);
153
-
154
- _accessAllowedTabs.sort();
155
- }
156
-
157
- _this2.onChange('accessAllowedTabs', _accessAllowedTabs);
158
- }
159
- }) : null));
160
- }))));
161
- }
162
- }
163
- }]);
164
- return ConfigCustomEasyAccess;
165
- }(_ConfigGeneric2["default"]);
166
-
167
- ConfigCustomEasyAccess.propTypes = {
168
- socket: _propTypes["default"].object.isRequired,
169
- themeType: _propTypes["default"].string,
170
- themeName: _propTypes["default"].string,
171
- style: _propTypes["default"].object,
172
- className: _propTypes["default"].string,
173
- data: _propTypes["default"].object.isRequired,
174
- schema: _propTypes["default"].object,
175
- onError: _propTypes["default"].func,
176
- onChange: _propTypes["default"].func
177
- };
178
-
179
- var _default = (0, _styles.withStyles)(styles)(ConfigCustomEasyAccess);
180
-
181
- exports["default"] = _default;
182
- //# sourceMappingURL=ConfigCustomEasyAccess.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfigCustomEasyAccess.js","names":["styles","theme","table","minWidth","header","fontSize","fontWeight","ConfigCustomEasyAccess","props","socket","getAdapterInstances","then","instances","filter","instance","common","adminUI","config","tab","map","id","_id","replace","adminTab","sort","a","b","setState","error","disabled","defaultValue","state","accessAllowedConfigs","ConfigGeneric","getValue","data","accessAllowedTabs","classes","I18n","t","row","includes","_accessAllowedConfigs","pos","indexOf","splice","push","onChange","_accessAllowedTabs","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","schema","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCustomEasyAccess.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Table from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n table: {\n minWidth: 400\n },\n header: {\n fontSize: 16,\n fontWeight: 'bold'\n }\n});\n\nclass ConfigCustomEasyAccess extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n\n this.props.socket.getAdapterInstances()\n .then(instances => {\n instances = instances\n .filter(instance =>\n instance?.common?.adminUI && (instance.common.adminUI.config !== 'none' || instance.common.adminUI.tab))\n .map(instance => ({\n id: instance._id.replace(/^system\\.adapter\\./, ''),\n config: instance.common.adminUI.config !== 'none',\n adminTab: instance.common.adminTab\n }))\n .sort((a, b) => a.id > b.id ? 1 : (a.id < b.id ? -1 : 0));\n\n this.setState({instances});\n });\n }\n\n renderItem(error, disabled, defaultValue) {\n if (!this.state.instances) {\n return null;\n } else {\n const accessAllowedConfigs = ConfigGeneric.getValue(this.props.data, 'accessAllowedConfigs') || [];\n const accessAllowedTabs = ConfigGeneric.getValue(this.props.data, 'accessAllowedTabs') || [];\n\n return <TableContainer>\n <Table className={this.props.classes.table} size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell className={this.props.classes.header}>{I18n.t('Instance')}</TableCell>\n <TableCell className={this.props.classes.header}>{I18n.t('Config')}</TableCell>\n <TableCell className={this.props.classes.header}>{I18n.t('Tab')}</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {this.state.instances.map((row) => (\n <TableRow key={row.id}>\n <TableCell component=\"th\" scope=\"row\">{row.id}</TableCell>\n <TableCell>\n {row.config ?\n <Checkbox checked={accessAllowedConfigs.includes(row.id)}\n onClick={() => {\n const _accessAllowedConfigs = [...accessAllowedConfigs];\n const pos = _accessAllowedConfigs.indexOf(row.id);\n if (pos !== -1) {\n _accessAllowedConfigs.splice(pos, 1);\n } else {\n _accessAllowedConfigs.push(row.id);\n _accessAllowedConfigs.sort();\n }\n this.onChange('accessAllowedConfigs', _accessAllowedConfigs);\n }}\n />\n : null}</TableCell>\n <TableCell>\n {row.adminTab ?\n <Checkbox\n checked={accessAllowedTabs.includes(row.id)}\n onClick={() => {\n const _accessAllowedTabs = [...accessAllowedTabs];\n const pos = _accessAllowedTabs.indexOf(row.id);\n if (pos !== -1) {\n _accessAllowedTabs.splice(pos, 1);\n } else {\n _accessAllowedTabs.push(row.id);\n _accessAllowedTabs.sort();\n }\n this.onChange('accessAllowedTabs', _accessAllowedTabs);\n }}\n /> : null}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableContainer>;\n }\n }\n}\n\nConfigCustomEasyAccess.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)(ConfigCustomEasyAccess);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;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