@iobroker/adapter-react-v5 4.9.5 → 4.9.7
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/404.js +4 -5
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +5 -6
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +4 -5
- package/Components/ComplexCron.js.map +1 -1
- package/Components/FileBrowser.js +5 -6
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +5 -6
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.js +4 -5
- package/Components/Icon.js.map +1 -1
- package/Components/IconSelector.js +4 -5
- package/Components/IconSelector.js.map +1 -1
- package/Components/Loader.js +4 -5
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +4 -5
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +4 -5
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/ObjectBrowser.js +5 -6
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +5 -6
- package/Components/Router.js.map +1 -1
- package/Components/SelectWithIcon.js +4 -5
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/index.js +4 -5
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/TableResize.js +5 -6
- package/Components/TableResize.js.map +1 -1
- package/Components/TreeTable.js +4 -5
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +4 -5
- package/Components/UploadImage.js.map +1 -1
- package/Dialogs/ComplexCron.js +4 -5
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Cron.js +4 -5
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/SelectFile.js +4 -5
- package/Dialogs/SelectFile.js.map +1 -1
- package/Dialogs/SimpleCron.js +4 -5
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +4 -5
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +7 -7
- package/GenericApp.js.map +1 -1
- package/README.md +3 -0
- package/package.json +4 -4
- package/types.d.ts +2 -0
package/Dialogs/SimpleCron.js
CHANGED
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _styles = require("@mui/styles");
|
|
@@ -22,8 +22,8 @@ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
|
22
22
|
var _Cancel = _interopRequireDefault(require("@mui/icons-material/Cancel"));
|
|
23
23
|
var _SimpleCron = _interopRequireDefault(require("../Components/SimpleCron"));
|
|
24
24
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
25
|
-
function
|
|
26
|
-
function _isNativeReflectConstruct() {
|
|
25
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
27
|
// Generates cron expression
|
|
28
28
|
|
|
29
29
|
var styles = function styles() {
|
|
@@ -42,11 +42,10 @@ var styles = function styles() {
|
|
|
42
42
|
};
|
|
43
43
|
var DialogSimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
44
44
|
(0, _inherits2["default"])(DialogSimpleCron, _React$Component);
|
|
45
|
-
var _super = _createSuper(DialogSimpleCron);
|
|
46
45
|
function DialogSimpleCron(props) {
|
|
47
46
|
var _this;
|
|
48
47
|
(0, _classCallCheck2["default"])(this, DialogSimpleCron);
|
|
49
|
-
_this =
|
|
48
|
+
_this = _callSuper(this, DialogSimpleCron, [props]);
|
|
50
49
|
var cron;
|
|
51
50
|
if (_this.props.cron && typeof _this.props.cron === 'string' && _this.props.cron.replace(/^["']/, '')[0] !== '{') {
|
|
52
51
|
cron = _this.props.cron.replace(/['"]/g, '').trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleCron.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Button","_DialogTitle","_DialogContent","_DialogActions","_Dialog","_Check","_Cancel","_SimpleCron","_i18n","
|
|
1
|
+
{"version":3,"file":"SimpleCron.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Button","_DialogTitle","_DialogContent","_DialogActions","_Dialog","_Check","_Cancel","_SimpleCron","_i18n","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","styles","headerID","fontWeight","fontStyle","radio","display","dialogPaper","height","DialogSimpleCron","_React$Component","_inherits2","props","_this","_classCallCheck2","cron","replace","trim","state","_createClass2","key","value","handleCancel","onClose","handleOk","onOk","render","_this2","createElement","maxWidth","fullWidth","classes","paper","open","id","title","I18n","style","overflow","cronExpression","onChange","setState","language","getLanguage","variant","onClick","color","startIcon","ok","cancel","React","Component","propTypes","PropTypes","object","func","isRequired","string","_default","exports","withStyles"],"sources":["SimpleCron.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\n\nimport IconOk from '@mui/icons-material/Check';\nimport IconCancel from '@mui/icons-material/Cancel';\n\nimport SimpleCron from '../Components/SimpleCron';\n\nimport I18n from '../i18n';\n\n// Generates cron expression\n\nconst styles = () => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic',\n },\n radio: {\n display: 'inline-block',\n },\n dialogPaper: {\n height: 'calc(100% - 96px)',\n },\n});\n\nclass DialogSimpleCron extends React.Component {\n constructor(props) {\n super(props);\n\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n render() {\n return <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth\n classes={{ paper: this.props.classes.dialogPaper }}\n open={!0}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define CRON...')}</DialogTitle>\n <DialogContent style={{ height: '100%', overflow: 'hidden' }}>\n <SimpleCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({ cron })}\n language={I18n.getLanguage()}\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" startIcon={<IconOk />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconCancel />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogSimpleCron.propTypes = {\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n cron: PropTypes.string,\n cancel: PropTypes.string,\n ok: PropTypes.string,\n};\n\nexport default withStyles(styles)(DialogSimpleCron);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AAEA,IAAAW,KAAA,GAAAZ,sBAAA,CAAAC,OAAA;AAA2B,SAAAY,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAA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MAAM;EACxBT,EAAE,EAAEK,qBAAS,CAACI;AAClB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAAC3D,MAAM,CAAC,CAACQ,gBAAgB,CAAC"}
|
package/Dialogs/TextInput.js
CHANGED
|
@@ -7,17 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _material = require("@mui/material");
|
|
16
16
|
var _iconsMaterial = require("@mui/icons-material");
|
|
17
17
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
18
18
|
var _withWidth = _interopRequireDefault(require("../Components/withWidth"));
|
|
19
|
-
function
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
19
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
21
|
/**
|
|
22
22
|
* @typedef {object} TextInputProps
|
|
23
23
|
* @property {(text: string | null) => void} onClose The dialog close callback.
|
|
@@ -35,14 +35,13 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
35
35
|
*/
|
|
36
36
|
var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
37
37
|
(0, _inherits2["default"])(TextInput, _React$Component);
|
|
38
|
-
var _super = _createSuper(TextInput);
|
|
39
38
|
/**
|
|
40
39
|
* @param {Readonly<TextInputProps>} props
|
|
41
40
|
*/
|
|
42
41
|
function TextInput(props) {
|
|
43
42
|
var _this;
|
|
44
43
|
(0, _classCallCheck2["default"])(this, TextInput);
|
|
45
|
-
_this =
|
|
44
|
+
_this = _callSuper(this, TextInput, [props]);
|
|
46
45
|
_this.state = {
|
|
47
46
|
text: _this.props.input || _this.props.value || '',
|
|
48
47
|
// input is deprecated
|
package/Dialogs/TextInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","names":["_react","_interopRequireDefault","require","_propTypes","_material","_iconsMaterial","_i18n","_withWidth","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","TextInput","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","state","text","input","value","error","_createClass2","key","render","_this2","createElement","Dialog","open","onClose","fullWidth","undefined","DialogTitle","id","titleText","DialogContent","DialogContentText","promptText","TextField","variant","autoFocus","margin","title","label","labelText","type","onKeyPress","charCode","onChange","verify","target","rule","setState","DialogActions","Button","disabled","onClick","color","startIcon","Check","applyText","I18n","t","Close","cancelText","React","Component","propTypes","PropTypes","bool","func","isRequired","string","_export","withWidth","_default","exports"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport {\n Button,\n TextField,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { Close as IconClose, Check as IconCheck } from '@mui/icons-material';\n\nimport I18n from '../i18n';\n\nimport withWidth from '../Components/withWidth';\n\n/**\n * @typedef {object} TextInputProps\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprecated\n error: '',\n };\n }\n\n render() {\n return <Dialog\n open={!0}\n onClose={() => this.props.onClose(null)}\n aria-labelledby=\"form-dialog-title\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : false}\n >\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\n variant=\"contained\"\n disabled={!this.state.text || this.state.error}\n onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\"\n startIcon={<IconCheck />}\n >\n {this.props.applyText || I18n.t('ra_Ok')}\n </Button>\n <Button\n color=\"grey\"\n variant=\"contained\"\n onClick={() => this.props.onClose(null)}\n startIcon={<IconClose />}\n >\n {this.props.cancelText || I18n.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n fullWidth: PropTypes.bool,\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 type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAUA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAgD,SAAAM,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,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2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,EAtEmBuD,iBAAK,CAACC,SAAS;AAyEvCxD,SAAS,CAACyD,SAAS,GAAG;EAClBrC,SAAS,EAAEsC,qBAAS,CAACC,IAAI;EACzBxC,OAAO,EAAEuC,qBAAS,CAACE,IAAI,CAACC,UAAU;EAClCrC,SAAS,EAAEkC,qBAAS,CAACI,MAAM,CAACD,UAAU;EACtClC,UAAU,EAAE+B,qBAAS,CAACI,MAAM;EAC5B5B,SAAS,EAAEwB,qBAAS,CAACI,MAAM;EAC3BR,UAAU,EAAEI,qBAAS,CAACI,MAAM;EAC5BZ,SAAS,EAAEQ,qBAAS,CAACI,MAAM;EAC3BvB,MAAM,EAAEmB,qBAAS,CAACE,IAAI;EACtBzB,IAAI,EAAEuB,qBAAS,CAACI,MAAM;EAAE;EACxBpD,KAAK,EAAEgD,qBAAS,CAACI;AACrB,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,qBAAS,EAAC,CAAC,CAAChE,SAAS,CAAC;AAAC,IAAAiE,QAAA,GAAAC,OAAA,cACxBH,OAAO"}
|
|
1
|
+
{"version":3,"file":"TextInput.js","names":["_react","_interopRequireDefault","require","_propTypes","_material","_iconsMaterial","_i18n","_withWidth","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","TextInput","_React$Component","_inherits2","props","_this","_classCallCheck2","state","text","input","value","error","_createClass2","key","render","_this2","createElement","Dialog","open","onClose","fullWidth","undefined","DialogTitle","id","titleText","DialogContent","DialogContentText","promptText","TextField","variant","autoFocus","margin","title","label","labelText","type","onKeyPress","charCode","onChange","verify","target","rule","setState","DialogActions","Button","disabled","onClick","color","startIcon","Check","applyText","I18n","Close","cancelText","React","Component","propTypes","PropTypes","bool","func","isRequired","string","_export","withWidth","_default","exports"],"sources":["TextInput.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport {\n Button,\n TextField,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { Close as IconClose, Check as IconCheck } from '@mui/icons-material';\n\nimport I18n from '../i18n';\n\nimport withWidth from '../Components/withWidth';\n\n/**\n * @typedef {object} TextInputProps\n * @property {(text: string | null) => void} onClose The dialog close callback.\n * @property {string} titleText The title text.\n * @property {string} [promptText] Prompt text (default: empty).\n * @property {string} [labelText] Label text (default: empty).\n * @property {string} cancelText The text of the cancel button.\n * @property {string} applyText The text of the apply button.\n * @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.\n * @property {(text: string) => string} [rule] The text replacement callback.\n * @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).\n * @property {string} [input] The input when opening the dialog.\n *\n * @extends {React.Component<TextInputProps>}\n */\nclass TextInput extends React.Component {\n /**\n * @param {Readonly<TextInputProps>} props\n */\n constructor(props) {\n super(props);\n\n this.state = {\n text: this.props.input || this.props.value || '', // input is deprecated\n error: '',\n };\n }\n\n render() {\n return <Dialog\n open={!0}\n onClose={() => this.props.onClose(null)}\n aria-labelledby=\"form-dialog-title\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : false}\n >\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\n variant=\"contained\"\n disabled={!this.state.text || this.state.error}\n onClick={() => this.props.onClose(this.state.text)}\n color=\"primary\"\n startIcon={<IconCheck />}\n >\n {this.props.applyText || I18n.t('ra_Ok')}\n </Button>\n <Button\n color=\"grey\"\n variant=\"contained\"\n onClick={() => this.props.onClose(null)}\n startIcon={<IconClose />}\n >\n {this.props.cancelText || I18n.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nTextInput.propTypes = {\n fullWidth: PropTypes.bool,\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 type: PropTypes.string, // text, number, password, email\n value: PropTypes.string,\n};\n\n/** @type {typeof TextInput} */\nconst _export = withWidth()(TextInput);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAUA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAgD,SAAAM,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,C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C,SAAS,EAAEiC,qBAAS,CAACI,MAAM,CAACD,UAAU;EACtCjC,UAAU,EAAE8B,qBAAS,CAACI,MAAM;EAC5B3B,SAAS,EAAEuB,qBAAS,CAACI,MAAM;EAC3BR,UAAU,EAAEI,qBAAS,CAACI,MAAM;EAC5BX,SAAS,EAAEO,qBAAS,CAACI,MAAM;EAC3BtB,MAAM,EAAEkB,qBAAS,CAACE,IAAI;EACtBxB,IAAI,EAAEsB,qBAAS,CAACI,MAAM;EAAE;EACxBnD,KAAK,EAAE+C,qBAAS,CAACI;AACrB,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,qBAAS,EAAC,CAAC,CAAC9D,SAAS,CAAC;AAAC,IAAA+D,QAAA,GAAAC,OAAA,cACxBH,OAAO"}
|
package/GenericApp.js
CHANGED
|
@@ -9,11 +9,11 @@ exports["default"] = void 0;
|
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
13
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
14
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
19
|
var _socketClient = require("@iobroker/socket-client");
|
|
@@ -35,8 +35,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
35
35
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
36
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
38
|
-
function
|
|
39
|
-
function _isNativeReflectConstruct() {
|
|
38
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
39
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
40
40
|
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
41
41
|
*
|
|
42
42
|
* MIT License
|
|
@@ -62,12 +62,12 @@ if (!window.localStorage) {
|
|
|
62
62
|
*/
|
|
63
63
|
var GenericApp = /*#__PURE__*/function (_Router) {
|
|
64
64
|
(0, _inherits2["default"])(GenericApp, _Router);
|
|
65
|
-
var _super = _createSuper(GenericApp);
|
|
66
65
|
/**
|
|
67
66
|
* @param {import('./types').GenericAppProps} props
|
|
68
67
|
* @param {import('./types').GenericAppSettings | undefined} settings
|
|
69
68
|
*/
|
|
70
69
|
function GenericApp(props, settings) {
|
|
70
|
+
var _ref, _settings$instance;
|
|
71
71
|
var _this;
|
|
72
72
|
(0, _classCallCheck2["default"])(this, GenericApp);
|
|
73
73
|
var ConnectionClass = props.Connection || settings.Connection || _socketClient.Connection;
|
|
@@ -90,7 +90,7 @@ var GenericApp = /*#__PURE__*/function (_Router) {
|
|
|
90
90
|
// ignore
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
_this =
|
|
93
|
+
_this = _callSuper(this, GenericApp, [props]);
|
|
94
94
|
/**
|
|
95
95
|
* @var {LegacyConnection | AdminConnection}
|
|
96
96
|
*/
|
|
@@ -162,7 +162,7 @@ var GenericApp = /*#__PURE__*/function (_Router) {
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
// extract instance from URL
|
|
165
|
-
_this.instance = args.instance !== undefined ? parseInt(args.instance, 10) || 0 : parseInt(window.location.search.slice(1), 10) || 0;
|
|
165
|
+
_this.instance = (_ref = (_settings$instance = settings === null || settings === void 0 ? void 0 : settings.instance) !== null && _settings$instance !== void 0 ? _settings$instance : props.instance) !== null && _ref !== void 0 ? _ref : args.instance !== undefined ? parseInt(args.instance, 10) || 0 : parseInt(window.location.search.slice(1), 10) || 0;
|
|
166
166
|
// extract adapter name from URL
|
|
167
167
|
var tmp = window.location.pathname.split('/');
|
|
168
168
|
_this.adapterName = (settings === null || settings === void 0 ? void 0 : settings.adapterName) || props.adapterName || window.adapterName || tmp[tmp.length - 2] || 'iot';
|