@iobroker/adapter-react-v5 4.6.11 → 4.6.13

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 (33) hide show
  1. package/Components/FileBrowser.js +1 -1
  2. package/Components/FileBrowser.js.map +1 -1
  3. package/Components/FileViewer.js +1 -1
  4. package/Components/FileViewer.js.map +1 -1
  5. package/Components/JsonConfigComponent/ConfigColor.d.ts +2 -1
  6. package/Components/JsonConfigComponent/ConfigFile.js +1 -1
  7. package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
  8. package/Components/JsonConfigComponent/ConfigFileSelector.js +4 -4
  9. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
  10. package/Components/JsonConfigComponent/ConfigInterface.d.ts +14 -0
  11. package/Components/JsonConfigComponent/ConfigInterface.js +146 -0
  12. package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -0
  13. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -1
  14. package/Components/JsonConfigComponent/ConfigJsonEditor.js +6 -11
  15. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  16. package/Components/JsonConfigComponent/ConfigLicense.d.ts +2 -1
  17. package/Components/JsonConfigComponent/ConfigPattern.d.ts +2 -1
  18. package/Components/JsonConfigComponent/ConfigUUID.d.ts +2 -1
  19. package/Components/types.d.ts +1 -1
  20. package/Dialogs/SelectFile.d.ts +2 -2
  21. package/Dialogs/SelectFile.js +2 -2
  22. package/Dialogs/SelectFile.js.map +1 -1
  23. package/README.md +2 -1
  24. package/package.json +1 -1
  25. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -87
  26. package/Components/JsonConfigComponent/ConfigGeneric.js +0 -702
  27. package/Components/JsonConfigComponent/ConfigGeneric.js.map +0 -1
  28. package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -3
  29. package/Components/JsonConfigComponent/ConfigNumber.js +0 -213
  30. package/Components/JsonConfigComponent/ConfigNumber.js.map +0 -1
  31. package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
  32. package/Components/JsonConfigComponent/ConfigPort.js +0 -227
  33. package/Components/JsonConfigComponent/ConfigPort.js.map +0 -1
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
11
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _react = _interopRequireDefault(require("react"));
15
+ var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _styles = require("@mui/styles");
17
+ var _material = require("@mui/material");
18
+ var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
19
+ 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); }; }
20
+ 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; } }
21
+ var styles = function styles() {
22
+ return {
23
+ fullWidth: {
24
+ width: '100%'
25
+ },
26
+ address: {
27
+ fontSize: 'smaller',
28
+ opacity: 0.5,
29
+ marginLeft: 8
30
+ }
31
+ };
32
+ };
33
+ var ConfigInterface = /*#__PURE__*/function (_ConfigGeneric) {
34
+ (0, _inherits2["default"])(ConfigInterface, _ConfigGeneric);
35
+ var _super = _createSuper(ConfigInterface);
36
+ function ConfigInterface() {
37
+ (0, _classCallCheck2["default"])(this, ConfigInterface);
38
+ return _super.apply(this, arguments);
39
+ }
40
+ (0, _createClass2["default"])(ConfigInterface, [{
41
+ key: "componentDidMount",
42
+ value: function componentDidMount() {
43
+ var _this = this;
44
+ (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigInterface.prototype), "componentDidMount", this).call(this);
45
+ this.props.socket.getObject("system.host.".concat(this.props.common.host)).then(function (obj) {
46
+ var _obj$native;
47
+ var interfaces = [];
48
+ if (obj !== null && obj !== void 0 && (_obj$native = obj["native"]) !== null && _obj$native !== void 0 && (_obj$native = _obj$native.hardware) !== null && _obj$native !== void 0 && _obj$native.networkInterfaces) {
49
+ var list = obj["native"].hardware.networkInterfaces;
50
+ Object.keys(list).forEach(function (inter) {
51
+ if (_this.props.schema.ignoreInternal && !list[inter].find(function (_ip) {
52
+ return !_ip.internal;
53
+ })) {
54
+ return;
55
+ }
56
+ if (_this.props.schema.ignoreLoopback && list[inter].find(function (_ip) {
57
+ return ip.address === '127.0.0.1' || ip.address === '::1';
58
+ })) {
59
+ return;
60
+ }
61
+
62
+ // find ipv4 address
63
+ var ip = list[inter].find(function (_ip) {
64
+ return _ip.family === 'IPv4';
65
+ });
66
+ ip = ip || list[inter].find(function (_ip) {
67
+ return _ip.family === 'IPv6';
68
+ });
69
+ interfaces.push({
70
+ value: inter,
71
+ address: ip.address
72
+ });
73
+ });
74
+ }
75
+ _this.setState({
76
+ interfaces: interfaces
77
+ });
78
+ })["catch"](function (e) {
79
+ return window.alert("Cannot read interfaces: ".concat(e));
80
+ });
81
+ }
82
+ }, {
83
+ key: "renderItem",
84
+ value: function renderItem(error, disabled /* , defaultValue */) {
85
+ var _this$state$interface,
86
+ _this$state$interface2,
87
+ _this$state$interface3,
88
+ _this2 = this;
89
+ var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
90
+ var item = (_this$state$interface = this.state.interfaces) === null || _this$state$interface === void 0 ? void 0 : _this$state$interface.find(function (it) {
91
+ return it.value === value;
92
+ });
93
+ return /*#__PURE__*/_react["default"].createElement(_material.FormControl, {
94
+ className: this.props.classes.fullWidth,
95
+ variant: "standard"
96
+ }, (_this$state$interface2 = this.state.interfaces) !== null && _this$state$interface2 !== void 0 && _this$state$interface2.length && this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_material.InputLabel, null, this.getText(this.props.schema.label)) : null, !((_this$state$interface3 = this.state.interfaces) !== null && _this$state$interface3 !== void 0 && _this$state$interface3.length) ? /*#__PURE__*/_react["default"].createElement(_material.TextField, {
97
+ fullWidth: true,
98
+ variant: "standard",
99
+ error: !!error,
100
+ disabled: !!disabled,
101
+ value: value,
102
+ onChange: function onChange(e) {
103
+ return _this2.onChange(_this2.props.attr, e.target.value);
104
+ },
105
+ label: this.getText(this.props.schema.label)
106
+ }) : /*#__PURE__*/_react["default"].createElement(_material.Select, {
107
+ variant: "standard",
108
+ error: !!error,
109
+ disabled: !!disabled,
110
+ value: value,
111
+ renderValue: function renderValue(val) {
112
+ if (item) {
113
+ return /*#__PURE__*/_react["default"].createElement("span", null, item.value, /*#__PURE__*/_react["default"].createElement("span", {
114
+ className: _this2.props.classes.address
115
+ }, item.address));
116
+ }
117
+ return val;
118
+ },
119
+ onChange: function onChange(e) {
120
+ return _this2.onChange(_this2.props.attr, e.target.value);
121
+ }
122
+ }, this.state.interfaces.map(function (it, i) {
123
+ return /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
124
+ key: i,
125
+ value: it.value
126
+ }, /*#__PURE__*/_react["default"].createElement("span", null, it.value, /*#__PURE__*/_react["default"].createElement("span", {
127
+ className: _this2.props.classes.address
128
+ }, it.address)));
129
+ })), this.props.schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
130
+ }
131
+ }]);
132
+ return ConfigInterface;
133
+ }(_ConfigGeneric2["default"]);
134
+ ConfigInterface.propTypes = {
135
+ socket: _propTypes["default"].object.isRequired,
136
+ themeType: _propTypes["default"].string,
137
+ themeName: _propTypes["default"].string,
138
+ style: _propTypes["default"].object,
139
+ className: _propTypes["default"].string,
140
+ data: _propTypes["default"].object.isRequired,
141
+ schema: _propTypes["default"].object,
142
+ onError: _propTypes["default"].func,
143
+ onChange: _propTypes["default"].func
144
+ };
145
+ var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigInterface);
146
+ //# sourceMappingURL=ConfigInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigInterface.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_ConfigGeneric2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","fullWidth","width","address","fontSize","opacity","marginLeft","ConfigInterface","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","componentDidMount","_this","_get2","props","socket","getObject","concat","common","host","then","obj","_obj$native","interfaces","hardware","networkInterfaces","list","Object","keys","forEach","inter","schema","ignoreInternal","find","_ip","internal","ignoreLoopback","ip","family","push","setState","window","alert","renderItem","error","disabled","_this$state$interface","_this$state$interface2","_this$state$interface3","_this2","ConfigGeneric","getValue","data","attr","item","state","it","createElement","FormControl","className","classes","variant","length","label","InputLabel","getText","TextField","onChange","target","Select","renderValue","val","map","i","MenuItem","help","FormHelperText","renderHelp","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigInterface.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n InputLabel,\n TextField,\n FormHelperText,\n MenuItem,\n FormControl,\n Select,\n} from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%',\n },\n address: {\n fontSize: 'smaller',\n opacity: 0.5,\n marginLeft: 8,\n },\n});\n\nclass ConfigInterface extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n this.props.socket.getObject(`system.host.${this.props.common.host}`)\n .then(obj => {\n const interfaces = [];\n if (obj?.native?.hardware?.networkInterfaces) {\n const list = obj.native.hardware.networkInterfaces;\n Object.keys(list).forEach(inter => {\n if (this.props.schema.ignoreInternal && !list[inter].find(_ip => !_ip.internal)) {\n return;\n }\n if (this.props.schema.ignoreLoopback && list[inter].find(_ip => ip.address === '127.0.0.1' || ip.address === '::1')) {\n return;\n }\n\n // find ipv4 address\n let ip = list[inter].find(_ip => _ip.family === 'IPv4');\n ip = ip || list[inter].find(_ip => _ip.family === 'IPv6');\n interfaces.push({ value: inter, address: ip.address });\n });\n }\n\n this.setState({ interfaces });\n })\n .catch(e => window.alert(`Cannot read interfaces: ${e}`));\n }\n\n renderItem(error, disabled /* , defaultValue */) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n const item = this.state.interfaces?.find(it => it.value === value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n {this.state.interfaces?.length && this.props.schema.label ? <InputLabel>{this.getText(this.props.schema.label)}</InputLabel> : null}\n {!this.state.interfaces?.length ?\n <TextField\n fullWidth\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={value}\n onChange={e => this.onChange(this.props.attr, e.target.value)}\n label={this.getText(this.props.schema.label)}\n /> :\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={value}\n renderValue={val => {\n if (item) {\n return <span>\n {item.value}\n <span className={this.props.classes.address}>{item.address}</span>\n </span>;\n }\n return val;\n }}\n onChange={e => this.onChange(this.props.attr, e.target.value)}\n >\n {this.state.interfaces.map((it, i) =>\n <MenuItem key={i} value={it.value}>\n <span>\n {it.value}\n <span className={this.props.classes.address}>{it.address}</span>\n </span>\n </MenuItem>)}\n </Select>}\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigInterface.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)(ConfigInterface);\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AASA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA4C,SAAAK,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,2BAAAC,KAAA,oCAAAC,OAAA,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,EAAE,CAACzD,OAAc,CAC7D,CACA,CAAC;MAAA,EACX,CAAC,EACZ,IAAI,CAACe,KAAK,CAACiB,MAAM,CAAC4C,IAAI,gBAAG5G,MAAA,YAAA0F,aAAA,CAACrF,SAAA,CAAAwG,cAAc,QAAE,IAAI,CAACC,UAAU,CAAC,IAAI,CAAC/D,KAAK,CAACiB,MAAM,CAAC4C,IAAI,EAAE,IAAI,CAAC7D,KAAK,CAACiB,MAAM,CAAC+C,QAAQ,EAAE,IAAI,CAAChE,KAAK,CAACiB,MAAM,CAACgD,aAAa,CAAkB,CAAC,GAAG,IAC3J,CAAC;IAClB;EAAC;EAAA,OAAA5E,eAAA;AAAA,EAtEyB+C,0BAAa;AAyE3C/C,eAAe,CAAC6E,SAAS,GAAG;EACxBjE,MAAM,EAAEkE,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC3BC,SAAS,EAAEL,qBAAS,CAACI,MAAM;EAC3BE,KAAK,EAAEN,qBAAS,CAACC,MAAM;EACvBvB,SAAS,EAAEsB,qBAAS,CAACI,MAAM;EAC3BjC,IAAI,EAAE6B,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCpD,MAAM,EAAEkD,qBAAS,CAACC,MAAM;EACxBM,OAAO,EAAEP,qBAAS,CAACQ,IAAI;EACvBtB,QAAQ,EAAEc,qBAAS,CAACQ;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAAChG,MAAM,CAAC,CAACO,eAAe,CAAC"}
@@ -1,7 +1,6 @@
1
1
  declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
2
  socket: PropTypes.Validator<object>;
3
3
  themeType: PropTypes.Requireable<string>;
4
- themeName: PropTypes.Requireable<string>;
5
4
  style: PropTypes.Requireable<object>;
6
5
  className: PropTypes.Requireable<string>;
7
6
  data: PropTypes.Validator<object>;
@@ -16,19 +16,14 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
16
16
  var _react = _interopRequireDefault(require("react"));
17
17
  var _propTypes = _interopRequireDefault(require("prop-types"));
18
18
  var _styles = require("@mui/styles");
19
- var _FormHelperText = _interopRequireDefault(require("@mui/material/FormHelperText"));
20
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
21
19
  var _material = require("@mui/material");
22
20
  var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
23
21
  var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
24
22
  var _CustomModal = _interopRequireDefault(require("../CustomModal"));
25
23
  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); }; }
26
- 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; } } // import AceEditor from 'react-ace';
27
- // import 'ace-builds/src-min-noconflict/mode-json';
28
- // import 'ace-builds/src-min-noconflict/worker-json';
29
- // import 'ace-builds/src-min-noconflict/theme-clouds_midnight';
30
- // import 'ace-builds/src-min-noconflict/theme-chrome';
31
- // import 'ace-builds/src-min-noconflict/ext-language_tools';
24
+ 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; } }
25
+ // import Editor from '../Editor';
26
+
32
27
  var styles = function styles() {
33
28
  return {
34
29
  fullWidth: {
@@ -97,7 +92,7 @@ var ConfigJsonEditor = /*#__PURE__*/function (_ConfigGeneric) {
97
92
  var _this$state = this.state,
98
93
  value = _this$state.value,
99
94
  showSelectId = _this$state.showSelectId;
100
- return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
95
+ return /*#__PURE__*/_react["default"].createElement(_material.FormControl, {
101
96
  className: classes.fullWidth,
102
97
  variant: "standard"
103
98
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -131,7 +126,7 @@ var ConfigJsonEditor = /*#__PURE__*/function (_ConfigGeneric) {
131
126
  }
132
127
  }, /*#__PURE__*/_react["default"].createElement("div", {
133
128
  className: classes.wrapper
134
- }, /*#__PURE__*/_react["default"].createElement("div", null, "NOT SUPPORTED"))) : null, schema.help ? /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
129
+ }, /*#__PURE__*/_react["default"].createElement("div", null, "NOT SUPPORTED"))) : null, schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null);
135
130
  }
136
131
  }]);
137
132
  return ConfigJsonEditor;
@@ -139,7 +134,7 @@ var ConfigJsonEditor = /*#__PURE__*/function (_ConfigGeneric) {
139
134
  ConfigJsonEditor.propTypes = {
140
135
  socket: _propTypes["default"].object.isRequired,
141
136
  themeType: _propTypes["default"].string,
142
- themeName: _propTypes["default"].string,
137
+ // themeName: PropTypes.string,
143
138
  style: _propTypes["default"].object,
144
139
  className: _propTypes["default"].string,
145
140
  data: _propTypes["default"].object.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigJsonEditor.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_FormHelperText","_FormControl","_material","_ConfigGeneric2","_i18n","_CustomModal","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","fullWidth","width","flex","display","button","height","minWidth","wrapper","ConfigJsonEditor","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","_componentDidMount","_asyncToGenerator2","_regenerator","mark","_callee","_this$props","data","attr","wrap","_callee$","_context","prev","next","_get2","props","ConfigGeneric","getValue","setState","initialized","stop","componentDidMount","renderItem","_this","state","_this$props2","classes","schema","_this$state","showSelectId","createElement","className","variant","Button","color","size","onClick","I18n","t","title","getText","label","open","overflowHidden","onClose","onApply","onChange","help","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","style","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigJsonEditor.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport { Button } from '@mui/material';\n\n// import AceEditor from 'react-ace';\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from './wrapper/i18n';\nimport CustomModal from '../CustomModal';\n\n// import 'ace-builds/src-min-noconflict/mode-json';\n// import 'ace-builds/src-min-noconflict/worker-json';\n// import 'ace-builds/src-min-noconflict/theme-clouds_midnight';\n// import 'ace-builds/src-min-noconflict/theme-chrome';\n// import 'ace-builds/src-min-noconflict/ext-language_tools';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%',\n },\n flex: {\n display: 'flex',\n },\n button: {\n height: 48,\n // marginLeft: 4,\n minWidth: 48,\n },\n wrapper: {\n width: 'calc(100vw - 40px)',\n height: 'calc(100vh - 188px)',\n },\n});\n\nclass ConfigJsonEditor extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr) || {};\n this.setState({ value, initialized: true });\n }\n\n renderItem(/* error, disabled, defaultValue */) {\n if (!this.state.initialized) {\n return null;\n }\n\n const {\n classes, schema, data, attr,\n } = this.props;\n const { value, showSelectId } = this.state;\n\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <div className={classes.flex}>\n <Button\n color=\"grey\"\n className={classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showSelectId: true })}\n >\n {I18n.t('ra_JSON editor')}\n </Button>\n </div>\n {showSelectId ? <CustomModal\n title={this.getText(schema.label)}\n open={showSelectId}\n overflowHidden\n onClose={() =>\n this.setState({ showSelectId: false, value: ConfigGeneric.getValue(data, attr) || {} })}\n onApply={() => this.setState({ showSelectId: false }, () => this.onChange(attr, value))}\n >\n <div className={classes.wrapper}>\n {/*<AceEditor\n mode=\"json\"\n theme={this.props.themeName === 'dark' ? 'clouds_midnight' : 'chrome'}\n value={typeof value === 'object' ? JSON.stringify(value) : value}\n width=\"100%\"\n height=\"100%\"\n onChange={newValue => this.setState({ value: newValue })}\n name=\"ConfigJsonEditor\"\n fontSize={14}\n setOptions={{\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n enableSnippets: true,\n }}\n editorProps={{ $blockScrolling: true }}\n />*/}\n <div>NOT SUPPORTED</div>\n </div>\n </CustomModal> : null}\n {schema.help ? <FormHelperText>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigJsonEditor.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigJsonEditor);"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OA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OAAA,cAEa,IAAAC,kBAAU,EAAChF,MAAM,CAAC,CAACS,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ConfigJsonEditor.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_ConfigGeneric2","_i18n","_CustomModal","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","fullWidth","width","flex","display","button","height","minWidth","wrapper","ConfigJsonEditor","_ConfigGeneric","_inherits2","_super","_classCallCheck2","_createClass2","key","value","_componentDidMount","_asyncToGenerator2","_regenerator","mark","_callee","_this$props","data","attr","wrap","_callee$","_context","prev","next","_get2","props","ConfigGeneric","getValue","setState","initialized","stop","componentDidMount","renderItem","_this","state","_this$props2","classes","schema","_this$state","showSelectId","createElement","FormControl","className","variant","Button","color","size","onClick","I18n","t","title","getText","label","open","overflowHidden","onClose","onApply","onChange","help","FormHelperText","renderHelp","helpLink","noTranslation","propTypes","socket","PropTypes","object","isRequired","themeType","string","style","onError","func","_default","exports","withStyles"],"sources":["JsonConfigComponent/ConfigJsonEditor.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport {\n FormHelperText,\n FormControl,\n Button,\n} from '@mui/material';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport I18n from './wrapper/i18n';\nimport CustomModal from '../CustomModal';\n// import Editor from '../Editor';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%',\n },\n flex: {\n display: 'flex',\n },\n button: {\n height: 48,\n // marginLeft: 4,\n minWidth: 48,\n },\n wrapper: {\n width: 'calc(100vw - 40px)',\n height: 'calc(100vh - 188px)',\n },\n});\n\nclass ConfigJsonEditor extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n const { data, attr } = this.props;\n const value = ConfigGeneric.getValue(data, attr) || {};\n this.setState({ value, initialized: true });\n }\n\n renderItem(/* error, disabled, defaultValue */) {\n if (!this.state.initialized) {\n return null;\n }\n\n const {\n classes, schema, data, attr,\n } = this.props;\n const { value, showSelectId } = this.state;\n\n return <FormControl className={classes.fullWidth} variant=\"standard\">\n <div className={classes.flex}>\n <Button\n color=\"grey\"\n className={classes.button}\n size=\"small\"\n variant=\"outlined\"\n onClick={() => this.setState({ showSelectId: true })}\n >\n {I18n.t('ra_JSON editor')}\n </Button>\n </div>\n {showSelectId ? <CustomModal\n title={this.getText(schema.label)}\n open={showSelectId}\n overflowHidden\n onClose={() =>\n this.setState({ showSelectId: false, value: ConfigGeneric.getValue(data, attr) || {} })}\n onApply={() => this.setState({ showSelectId: false }, () => this.onChange(attr, value))}\n >\n <div className={classes.wrapper}>\n {/*<Editor\n value={typeof value === 'object' ? JSON.stringify(value) : value}\n onChange={newValue => this.setState({ value: newValue })}\n name=\"ConfigJsonEditor\"\n themeType={this.props.themeType}\n />*/}\n <div>NOT SUPPORTED</div>\n </div>\n </CustomModal> : null}\n {schema.help ? <FormHelperText>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigJsonEditor.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n// themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigJsonEditor);"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAMA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAA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AQ,CAACvC,IAAI,EAAER,KAAK,CAAC;UAAA,EAAC;QAAA;MAAC,gBAExF/C,MAAA,YAAA6E,aAAA;QAAKE,SAAS,EAAEN,OAAO,CAAClC;MAAQ,gBAO5BvC,MAAA,YAAA6E,aAAA,cAAK,eAAkB,CACtB,CACI,CAAC,GAAG,IAAI,EACpBH,MAAM,CAACqB,IAAI,gBAAG/F,MAAA,YAAA6E,aAAA,CAACxE,SAAA,CAAA2F,cAAc,QACzB,IAAI,CAACC,UAAU,CACZ,IAAI,CAACnC,KAAK,CAACY,MAAM,CAACqB,IAAI,EACtB,IAAI,CAACjC,KAAK,CAACY,MAAM,CAACwB,QAAQ,EAC1B,IAAI,CAACpC,KAAK,CAACY,MAAM,CAACyB,aACtB,CACY,CAAC,GAAG,IACX,CAAC;IAClB;EAAC;EAAA,OAAA3D,gBAAA;AAAA,EAxD0BuB,0BAAa;AA2D5CvB,gBAAgB,CAAC4D,SAAS,GAAG;EACzBC,MAAM,EAAEC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC/B;EACIC,KAAK,EAAEL,qBAAS,CAACC,MAAM;EACvBxB,SAAS,EAAEuB,qBAAS,CAACI,MAAM;EAC3BpD,IAAI,EAAEgD,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjC9B,MAAM,EAAE4B,qBAAS,CAACC,MAAM;EACxBK,OAAO,EAAEN,qBAAS,CAACO,IAAI;EACvBf,QAAQ,EAAEQ,qBAAS,CAACO;AACxB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa,IAAAC,kBAAU,EAACjF,MAAM,CAAC,CAACS,gBAAgB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export default ConfigLicense;
2
- declare class ConfigLicense extends ConfigGeneric {
2
+ declare class ConfigLicense extends ConfigGeneric<any, any> {
3
+ constructor(props: any);
3
4
  scrollRef: React.RefObject<any>;
4
5
  noPlaceRequired: boolean;
5
6
  scrolledDown(): boolean;
@@ -1,5 +1,6 @@
1
1
  export default ConfigPattern;
2
- declare class ConfigPattern extends ConfigGeneric {
2
+ declare class ConfigPattern extends ConfigGeneric<any, any> {
3
+ constructor(props: any);
3
4
  renderItem(error: any, disabled: any): React.JSX.Element;
4
5
  }
5
6
  declare namespace ConfigPattern {
@@ -1,5 +1,6 @@
1
1
  export default ConfigUUID;
2
- declare class ConfigUUID extends ConfigGeneric {
2
+ declare class ConfigUUID extends ConfigGeneric<any, any> {
3
+ constructor(props: any);
3
4
  componentDidMount(): Promise<void>;
4
5
  renderItem(error: any, disabled: any): React.JSX.Element;
5
6
  }
@@ -41,7 +41,7 @@ export interface FileBrowserProps {
41
41
  showViewTypeButton?: boolean;
42
42
  /** The ID of the selected file. */
43
43
  selected?: string;
44
- /** The file extensions to show, like ['png', 'svg', 'bmp', 'jpg', 'jpeg']. */
44
+ /** The file extensions to show, like ['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']. */
45
45
  filterFiles?: string[];
46
46
  /** The file extension categories to show. */
47
47
  filterByType?: 'images' | 'code' | 'txt';
@@ -77,7 +77,7 @@ export type DialogSelectFileProps = {
77
77
  */
78
78
  limitPath?: any[];
79
79
  /**
80
- * like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
80
+ * like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']`
81
81
  */
82
82
  filterFiles?: any[];
83
83
  /**
@@ -128,7 +128,7 @@ declare const _export: typeof DialogSelectFile;
128
128
  * @property {boolean} [allowView] if tile view enabled (default true)
129
129
  * @property {boolean} [showToolbar] Show toolbar (default true)
130
130
  * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)
131
- * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
131
+ * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']`
132
132
  * @property {string} [filterByType] images, code, txt, audio, video
133
133
  * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.
134
134
  * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.
@@ -84,7 +84,7 @@ var styles = function styles() {
84
84
  * @property {boolean} [allowView] if tile view enabled (default true)
85
85
  * @property {boolean} [showToolbar] Show toolbar (default true)
86
86
  * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)
87
- * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
87
+ * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']`
88
88
  * @property {string} [filterByType] images, code, txt, audio, video
89
89
  * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.
90
90
  * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.
@@ -251,7 +251,7 @@ DialogSelectFile.propTypes = {
251
251
  // allow view of files
252
252
  showToolbar: _propTypes["default"].bool,
253
253
  filterFiles: _propTypes["default"].arrayOf(_propTypes["default"].string),
254
- // array of extensions ['jpg', 'png]
254
+ // array of extensions ['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']
255
255
  filterByType: _propTypes["default"].string,
256
256
  // e.g. images
257
257
  limitPath: _propTypes["default"].string,
@@ -1 +1 @@
1
- {"version":3,"file":"SelectFile.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_iconsMaterial","_Utils","_i18n","_FileBrowser","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","styles","headerID","fontWeight","fontStyle","dialog","height","dialogMobile","padding","width","maxWidth","maxHeight","content","overflow","contentMobile","titleRoot","whiteSpace","display","textOverflow","DialogSelectFile","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","concat","filters","window","_localStorage","localStorage","getItem","JSON","parse","selected","_typeof2","_toConsumableArray2","id","state","_createClass2","key","value","handleCancel","onClose","handleOk","onOk","multiSelect","Array","isArray","render","_this2","title","createElement","I18n","className","classes","Dialog","paper","Utils","clsx","fullWidth","open","DialogTitle","root","DialogContent","ready","imagePrefix","prefix","allowUpload","allowDownload","allowCreateFolder","allowDelete","allowView","showViewTypeButton","showToolbar","limitPath","filterFiles","filterByType","restrictToFolder","allowNonRestricted","onSelect","isDoubleClick","isFolder","setState","selectOnlyFolders","lang","getLanguage","socket","themeType","themeName","showExpertButton","expertMode","showTypeSelector","DialogActions","Button","variant","onClick","startIcon","Check","disabled","color","ok","Cancel","cancel","React","Component","propTypes","PropTypes","string","oneOfType","array","object","func","isRequired","bool","arrayOf","_export","withStyles","_default","exports"],"sources":["SelectFile.jsx"],"sourcesContent":["/*\n * Copyright 2022-2023 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\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';\n\nimport {\n Button,\n DialogTitle,\n DialogContent,\n DialogActions,\n Dialog,\n} from '@mui/material';\n\nimport {\n Cancel as IconCancel,\n Check as IconOk,\n} from '@mui/icons-material';\n\nimport Utils from '../Components/Utils';\nimport I18n from '../i18n';\nimport FileBrowser from '../Components/FileBrowser';\n\nconst styles = () => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic',\n },\n dialog: {\n height: '95%',\n },\n dialogMobile: {\n padding: 4,\n width: '100%',\n maxWidth: '100%',\n maxHeight: 'calc(100% - 16px)',\n height: '100%',\n },\n content: {\n height: '100%',\n overflow: 'hidden',\n },\n contentMobile: {\n padding: '8px 4px',\n },\n titleRoot: {\n whiteSpace: 'nowrap',\n width: 'calc(100% - 72px)',\n overflow: 'hidden',\n display: 'inline-block',\n textOverflow: 'ellipsis',\n },\n});\n\n/**\n * @typedef {object} DialogSelectFileProps\n * @property {boolean} [dialogName] PropTypes.string, // where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated)\n * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.\n * @property {string} [imagePrefix] Prefix (default: '.')\n * @property {boolean} [showExpertButton] Show the expert button?\n * @property {ioBroker.Languages} [lang] The language.\n * @property {import('../Connection').default} socket The socket connection.\n * @property {string} [themeName] Theme name.\n * @property {string} [themeType] Theme type.\n * @property {string | string[]} [selected] The selected IDs.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {boolean} [socket] Socket class (required)\n * @property {boolean} [allowUpload] If download of files enabled\n * @property {boolean} [allowDownload] If download of files enabled\n * @property {boolean} [allowCreateFolder] If creation of folders enabled\n * @property {boolean} [allowDelete] If creation of folders enabled\n * @property {boolean} [allowView] if tile view enabled (default true)\n * @property {boolean} [showToolbar] Show toolbar (default true)\n * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)\n * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`\n * @property {string} [filterByType] images, code, txt, audio, video\n * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.\n * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.\n * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.\n *\n * @extends {React.Component<DialogSelectIDProps>}\n */\nclass DialogSelectFile extends React.Component {\n /**\n * @param {DialogSelectFileProps} props\n */\n constructor(props) {\n super(props);\n this.dialogName = this.props.dialogName || 'default';\n this.dialogName = `SelectFile.${this.dialogName}`;\n\n this.filters = (window._localStorage || window.localStorage).getItem(this.dialogName) || '{}';\n\n try {\n this.filters = JSON.parse(this.filters);\n } catch (e) {\n this.filters = {};\n }\n\n if (props.filters) {\n this.filters = { ...this.filters, ...props.filters };\n }\n\n let selected = this.props.selected || [];\n if (typeof selected !== 'object') {\n selected = [selected];\n } else {\n selected = [...selected];\n }\n selected = selected.filter(id => id);\n\n this.state = {\n selected,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.props.multiSelect || !Array.isArray(this.state.selected) ? this.state.selected : this.state.selected[0] || '');\n this.props.onClose();\n }\n\n render() {\n let title;\n if (this.state.selected.length) {\n if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {this.state.selected}\n </span>,\n ];\n } else {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {I18n.t('%s items', this.state.selected.length)}\n </span>,\n ];\n }\n } else {\n title = this.props.title || I18n.t('ra_Please select file...');\n }\n\n return <Dialog\n onClose={() => {}}\n maxWidth={false}\n classes={{ paper: Utils.clsx(this.props.classes.dialog, this.props.classes.dialogMobile) }}\n fullWidth\n open={!0}\n aria-labelledby=\"ar_dialog_selectfile_title\"\n >\n <DialogTitle id=\"ar_dialog_selectfile_title\" classes={{ root: this.props.classes.titleRoot }}>{title}</DialogTitle>\n <DialogContent className={Utils.clsx(this.props.classes.content, this.props.classes.contentMobile)}>\n <FileBrowser\n ready\n imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility\n allowUpload={!!this.props.allowUpload}\n allowDownload={this.props.allowDownload !== false}\n allowCreateFolder={!!this.props.allowCreateFolder}\n allowDelete={!!this.props.allowDelete}\n allowView={this.props.allowView !== false}\n showViewTypeButton={this.props.showViewTypeButton !== false}\n showToolbar={this.props.showToolbar !== false}\n limitPath={this.props.limitPath}\n filterFiles={this.props.filterFiles}\n filterByType={this.props.filterByType}\n selected={this.props.selected}\n restrictToFolder={this.props.restrictToFolder}\n allowNonRestricted={this.props.allowNonRestricted}\n onSelect={(selected, isDoubleClick, isFolder) => {\n this.setState({ selected }, () =>\n isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk());\n }}\n t={this.props.t || I18n.t}\n lang={this.props.lang || I18n.getLanguage()}\n socket={this.props.socket}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n showExpertButton={this.props.showExpertButton}\n expertMode={this.props.expertMode}\n showTypeSelector={this.props.showTypeSelector}\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} startIcon={<IconOk />} disabled={!this.state.selected.length} color=\"primary\">{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.handleCancel()} startIcon={<IconCancel />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogSelectFile.propTypes = {\n imagePrefix: PropTypes.string,\n dialogName: PropTypes.string, // where to store settings in localStorage\n selected: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.array, // not implemented\n ]),\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n socket: PropTypes.object.isRequired,\n allowUpload: PropTypes.bool,\n allowDownload: PropTypes.bool,\n allowCreateFolder: PropTypes.bool,\n allowDelete: PropTypes.bool,\n allowView: PropTypes.bool, // allow view of files\n showToolbar: PropTypes.bool,\n filterFiles: PropTypes.arrayOf(PropTypes.string), // array of extensions ['jpg', 'png]\n filterByType: PropTypes.string, // e.g. images\n limitPath: PropTypes.string,\n selectOnlyFolders: PropTypes.bool,\n showViewTypeButton: PropTypes.bool, // Allow switch views Table<=>Rows\n showTypeSelector: PropTypes.bool, // If type selector should be shown\n restrictToFolder: PropTypes.string, // If defined, allow selecting only files from this folder\n allowNonRestricted: PropTypes.bool, // If restrictToFolder defined, allow selecting files outside of this folder\n\n title: PropTypes.string,\n lang: PropTypes.string,\n\n themeName: PropTypes.string,\n themeType: PropTypes.string,\n showExpertButton: PropTypes.bool,\n expertMode: PropTypes.bool, // force expert mode\n multiSelect: PropTypes.bool, // not implemented\n};\n\n/** @type {typeof DialogSelectFile} */\nconst _export = withStyles(styles)(DialogSelectFile);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAQA,IAAAI,cAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAoD,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CA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;EAC5BpE,WAAW,EAAE6D,qBAAS,CAACO,IAAI,CAAE;AACjC,CAAC;;AAED;AACA,IAAME,OAAO,GAAG,IAAAC,kBAAU,EAACrH,MAAM,CAAC,CAACkB,gBAAgB,CAAC;AAAC,IAAAoG,QAAA,GAAAC,OAAA,cACtCH,OAAO"}
1
+ {"version":3,"file":"SelectFile.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_iconsMaterial","_Utils","_i18n","_FileBrowser","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","styles","headerID","fontWeight","fontStyle","dialog","height","dialogMobile","padding","width","maxWidth","maxHeight","content","overflow","contentMobile","titleRoot","whiteSpace","display","textOverflow","DialogSelectFile","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","concat","filters","window","_localStorage","localStorage","getItem","JSON","parse","selected","_typeof2","_toConsumableArray2","id","state","_createClass2","key","value","handleCancel","onClose","handleOk","onOk","multiSelect","Array","isArray","render","_this2","title","createElement","I18n","className","classes","Dialog","paper","Utils","clsx","fullWidth","open","DialogTitle","root","DialogContent","ready","imagePrefix","prefix","allowUpload","allowDownload","allowCreateFolder","allowDelete","allowView","showViewTypeButton","showToolbar","limitPath","filterFiles","filterByType","restrictToFolder","allowNonRestricted","onSelect","isDoubleClick","isFolder","setState","selectOnlyFolders","lang","getLanguage","socket","themeType","themeName","showExpertButton","expertMode","showTypeSelector","DialogActions","Button","variant","onClick","startIcon","Check","disabled","color","ok","Cancel","cancel","React","Component","propTypes","PropTypes","string","oneOfType","array","object","func","isRequired","bool","arrayOf","_export","withStyles","_default","exports"],"sources":["SelectFile.jsx"],"sourcesContent":["/*\n * Copyright 2022-2023 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\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';\n\nimport {\n Button,\n DialogTitle,\n DialogContent,\n DialogActions,\n Dialog,\n} from '@mui/material';\n\nimport {\n Cancel as IconCancel,\n Check as IconOk,\n} from '@mui/icons-material';\n\nimport Utils from '../Components/Utils';\nimport I18n from '../i18n';\nimport FileBrowser from '../Components/FileBrowser';\n\nconst styles = () => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic',\n },\n dialog: {\n height: '95%',\n },\n dialogMobile: {\n padding: 4,\n width: '100%',\n maxWidth: '100%',\n maxHeight: 'calc(100% - 16px)',\n height: '100%',\n },\n content: {\n height: '100%',\n overflow: 'hidden',\n },\n contentMobile: {\n padding: '8px 4px',\n },\n titleRoot: {\n whiteSpace: 'nowrap',\n width: 'calc(100% - 72px)',\n overflow: 'hidden',\n display: 'inline-block',\n textOverflow: 'ellipsis',\n },\n});\n\n/**\n * @typedef {object} DialogSelectFileProps\n * @property {boolean} [dialogName] PropTypes.string, // where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated)\n * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.\n * @property {string} [imagePrefix] Prefix (default: '.')\n * @property {boolean} [showExpertButton] Show the expert button?\n * @property {ioBroker.Languages} [lang] The language.\n * @property {import('../Connection').default} socket The socket connection.\n * @property {string} [themeName] Theme name.\n * @property {string} [themeType] Theme type.\n * @property {string | string[]} [selected] The selected IDs.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {boolean} [socket] Socket class (required)\n * @property {boolean} [allowUpload] If download of files enabled\n * @property {boolean} [allowDownload] If download of files enabled\n * @property {boolean} [allowCreateFolder] If creation of folders enabled\n * @property {boolean} [allowDelete] If creation of folders enabled\n * @property {boolean} [allowView] if tile view enabled (default true)\n * @property {boolean} [showToolbar] Show toolbar (default true)\n * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)\n * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']`\n * @property {string} [filterByType] images, code, txt, audio, video\n * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.\n * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.\n * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.\n *\n * @extends {React.Component<DialogSelectIDProps>}\n */\nclass DialogSelectFile extends React.Component {\n /**\n * @param {DialogSelectFileProps} props\n */\n constructor(props) {\n super(props);\n this.dialogName = this.props.dialogName || 'default';\n this.dialogName = `SelectFile.${this.dialogName}`;\n\n this.filters = (window._localStorage || window.localStorage).getItem(this.dialogName) || '{}';\n\n try {\n this.filters = JSON.parse(this.filters);\n } catch (e) {\n this.filters = {};\n }\n\n if (props.filters) {\n this.filters = { ...this.filters, ...props.filters };\n }\n\n let selected = this.props.selected || [];\n if (typeof selected !== 'object') {\n selected = [selected];\n } else {\n selected = [...selected];\n }\n selected = selected.filter(id => id);\n\n this.state = {\n selected,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.props.multiSelect || !Array.isArray(this.state.selected) ? this.state.selected : this.state.selected[0] || '');\n this.props.onClose();\n }\n\n render() {\n let title;\n if (this.state.selected.length) {\n if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {this.state.selected}\n </span>,\n ];\n } else {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {I18n.t('%s items', this.state.selected.length)}\n </span>,\n ];\n }\n } else {\n title = this.props.title || I18n.t('ra_Please select file...');\n }\n\n return <Dialog\n onClose={() => {}}\n maxWidth={false}\n classes={{ paper: Utils.clsx(this.props.classes.dialog, this.props.classes.dialogMobile) }}\n fullWidth\n open={!0}\n aria-labelledby=\"ar_dialog_selectfile_title\"\n >\n <DialogTitle id=\"ar_dialog_selectfile_title\" classes={{ root: this.props.classes.titleRoot }}>{title}</DialogTitle>\n <DialogContent className={Utils.clsx(this.props.classes.content, this.props.classes.contentMobile)}>\n <FileBrowser\n ready\n imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility\n allowUpload={!!this.props.allowUpload}\n allowDownload={this.props.allowDownload !== false}\n allowCreateFolder={!!this.props.allowCreateFolder}\n allowDelete={!!this.props.allowDelete}\n allowView={this.props.allowView !== false}\n showViewTypeButton={this.props.showViewTypeButton !== false}\n showToolbar={this.props.showToolbar !== false}\n limitPath={this.props.limitPath}\n filterFiles={this.props.filterFiles}\n filterByType={this.props.filterByType}\n selected={this.props.selected}\n restrictToFolder={this.props.restrictToFolder}\n allowNonRestricted={this.props.allowNonRestricted}\n onSelect={(selected, isDoubleClick, isFolder) => {\n this.setState({ selected }, () =>\n isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk());\n }}\n t={this.props.t || I18n.t}\n lang={this.props.lang || I18n.getLanguage()}\n socket={this.props.socket}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n showExpertButton={this.props.showExpertButton}\n expertMode={this.props.expertMode}\n showTypeSelector={this.props.showTypeSelector}\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} startIcon={<IconOk />} disabled={!this.state.selected.length} color=\"primary\">{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.handleCancel()} startIcon={<IconCancel />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogSelectFile.propTypes = {\n imagePrefix: PropTypes.string,\n dialogName: PropTypes.string, // where to store settings in localStorage\n selected: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.array, // not implemented\n ]),\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n socket: PropTypes.object.isRequired,\n allowUpload: PropTypes.bool,\n allowDownload: PropTypes.bool,\n allowCreateFolder: PropTypes.bool,\n allowDelete: PropTypes.bool,\n allowView: PropTypes.bool, // allow view of files\n showToolbar: PropTypes.bool,\n filterFiles: PropTypes.arrayOf(PropTypes.string), // array of extensions ['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']\n filterByType: PropTypes.string, // e.g. images\n limitPath: PropTypes.string,\n selectOnlyFolders: PropTypes.bool,\n showViewTypeButton: PropTypes.bool, // Allow switch views Table<=>Rows\n showTypeSelector: PropTypes.bool, // If type selector should be shown\n restrictToFolder: PropTypes.string, // If defined, allow selecting only files from this folder\n allowNonRestricted: PropTypes.bool, // If restrictToFolder defined, allow selecting files outside of this folder\n\n title: PropTypes.string,\n lang: PropTypes.string,\n\n themeName: PropTypes.string,\n themeType: PropTypes.string,\n showExpertButton: PropTypes.bool,\n expertMode: PropTypes.bool, // force expert mode\n multiSelect: PropTypes.bool, // not implemented\n};\n\n/** @type {typeof DialogSelectFile} */\nconst _export = withStyles(styles)(DialogSelectFile);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAQA,IAAAI,cAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,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CAACC,MAAM,CAAC;EAAE;EAClD/B,YAAY,EAAE8B,qBAAS,CAACC,MAAM;EAAE;EAChCjC,SAAS,EAAEgC,qBAAS,CAACC,MAAM;EAC3BxB,iBAAiB,EAAEuB,qBAAS,CAACO,IAAI;EACjCzC,kBAAkB,EAAEkC,qBAAS,CAACO,IAAI;EAAE;EACpCtB,gBAAgB,EAAEe,qBAAS,CAACO,IAAI;EAAE;EAClCpC,gBAAgB,EAAE6B,qBAAS,CAACC,MAAM;EAAE;EACpC7B,kBAAkB,EAAE4B,qBAAS,CAACO,IAAI;EAAE;;EAEpC/D,KAAK,EAAEwD,qBAAS,CAACC,MAAM;EACvBvB,IAAI,EAAEsB,qBAAS,CAACC,MAAM;EAEtBnB,SAAS,EAAEkB,qBAAS,CAACC,MAAM;EAC3BpB,SAAS,EAAEmB,qBAAS,CAACC,MAAM;EAC3BlB,gBAAgB,EAAEiB,qBAAS,CAACO,IAAI;EAChCvB,UAAU,EAAEgB,qBAAS,CAACO,IAAI;EAAE;EAC5BpE,WAAW,EAAE6D,qBAAS,CAACO,IAAI,CAAE;AACjC,CAAC;;AAED;AACA,IAAME,OAAO,GAAG,IAAAC,kBAAU,EAACrH,MAAM,CAAC,CAACkB,gBAAgB,CAAC;AAAC,IAAAoG,QAAA,GAAAC,OAAA,cACtCH,OAAO"}
package/README.md CHANGED
@@ -670,8 +670,9 @@ socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
670
670
  -->
671
671
 
672
672
  ## Changelog
673
- ### 4.6.11 (2023-10-30)
673
+ ### 4.6.13 (2023-10-30)
674
674
  * (bluefox) Synced with admin
675
+ * (bluefox) Added GIF to image files
675
676
 
676
677
  ### 4.6.7 (2023-10-19)
677
678
  * (bluefox) Added return value for `subscribeOnInstance` for Connection class
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "4.6.11",
3
+ "version": "4.6.13",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "Denis Haev (bluefox)",
@@ -1,87 +0,0 @@
1
- export default ConfigGeneric;
2
- declare class ConfigGeneric extends React.Component<any, any, any> {
3
- static DIFFERENT_VALUE: string;
4
- static DIFFERENT_LABEL: string;
5
- static NONE_VALUE: string;
6
- static NONE_LABEL: string;
7
- static AsyncFunction: any;
8
- /**
9
- * Extract attribute out of data
10
- *
11
- * @param {Record<string, any>} data
12
- * @param {string|string[]} attr
13
- * @return {*|null}
14
- */
15
- static getValue(data: Record<string, any>, attr: string | string[]): any | null;
16
- static setValue(data: any, attr: any, value: any): void;
17
- constructor(props: any);
18
- state: {
19
- confirmDialog: boolean;
20
- confirmNewValue: any;
21
- confirmAttr: any;
22
- confirmData: any;
23
- };
24
- isError: {};
25
- defaultValue: any;
26
- lang: ioBroker.Languages;
27
- componentDidMount(): void;
28
- sendTo(): void;
29
- defaultSendToDone: boolean;
30
- componentWillUnmount(): void;
31
- sendToTimeout: any;
32
- onUpdate: (data: any) => void;
33
- getText(text: any, noTranslation: any): any;
34
- renderConfirmDialog(): React.JSX.Element;
35
- /**
36
- * Trigger onChange, to activate save button on change
37
- *
38
- * @param attr the changed attribute
39
- * @param newValue new value of the attribute
40
- * @param {(() => void)?} cb optional callback function, else returns a Promise
41
- * @return {Promise<void>}
42
- */
43
- onChange(attr: any, newValue: any, cb: (() => void) | null): Promise<void>;
44
- execute(func: any, defaultValue: any, data: any, arrayIndex: any, globalData: any): any;
45
- executeCustom(func: any, data: any, customObj: any, instanceObj: any, arrayIndex: any, globalData: any): any;
46
- calculate(schema: any): {
47
- error: boolean;
48
- disabled: any;
49
- hidden: any;
50
- defaultValue: any;
51
- };
52
- onError(attr: any, error: any): void;
53
- renderItem(): any;
54
- renderHelp(text: any, link: any, noTranslation: any): any;
55
- getPattern(pattern: any, data: any): any;
56
- render(): any;
57
- }
58
- declare namespace ConfigGeneric {
59
- namespace propTypes {
60
- let socket: PropTypes.Validator<object>;
61
- let data: PropTypes.Requireable<object>;
62
- let originalData: PropTypes.Requireable<object>;
63
- let schema: PropTypes.Requireable<object>;
64
- let attr: PropTypes.Requireable<string>;
65
- let value: PropTypes.Requireable<any>;
66
- let themeName: PropTypes.Requireable<string>;
67
- let style: PropTypes.Requireable<object>;
68
- let onError: PropTypes.Requireable<(...args: any[]) => any>;
69
- let onChange: PropTypes.Requireable<(...args: any[]) => any>;
70
- let customs: PropTypes.Requireable<object>;
71
- let forceUpdate: PropTypes.Validator<(...args: any[]) => any>;
72
- let disabled: PropTypes.Requireable<boolean>;
73
- let systemConfig: PropTypes.Requireable<object>;
74
- let alive: PropTypes.Requireable<boolean>;
75
- let changed: PropTypes.Requireable<boolean>;
76
- let common: PropTypes.Requireable<object>;
77
- let adapterName: PropTypes.Requireable<string>;
78
- let instance: PropTypes.Requireable<number>;
79
- let dateFormat: PropTypes.Requireable<string>;
80
- let isFloatComma: PropTypes.Requireable<boolean>;
81
- let customObj: PropTypes.Requireable<object>;
82
- let instanceObj: PropTypes.Requireable<object>;
83
- let custom: PropTypes.Requireable<boolean>;
84
- }
85
- }
86
- import React from 'react';
87
- import PropTypes from 'prop-types';