@iobroker/adapter-react-v5 2.1.7 → 2.1.9
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 +17 -25
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +25 -35
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +29 -37
- package/Components/ComplexCron.js.map +1 -1
- package/Components/FileBrowser.js +40 -61
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +18 -28
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.js +15 -25
- package/Components/Icon.js.map +1 -1
- package/Components/IconPicker.js +6 -6
- package/Components/IconPicker.js.map +1 -1
- package/Components/IconSelector.js +25 -31
- package/Components/IconSelector.js.map +1 -1
- package/Components/Image.js +15 -25
- package/Components/Image.js.map +1 -1
- package/Components/Loader.js +14 -24
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +13 -23
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +14 -24
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +15 -25
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +14 -11
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.js +110 -175
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +13 -21
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +15 -25
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/Schedule.js +23 -37
- package/Components/Schedule.js.map +1 -1
- package/Components/SelectWithIcon.js +17 -25
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/cronText.js +2 -2
- package/Components/SimpleCron/cronText.js.map +1 -1
- package/Components/SimpleCron/index.js +24 -34
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/TabContainer.js +18 -28
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +17 -27
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +13 -23
- package/Components/TabHeader.js.map +1 -1
- package/Components/TextWithIcon.js +5 -5
- package/Components/TextWithIcon.js.map +1 -1
- package/Components/ToggleThemeMenu.js +2 -2
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/TreeTable.js +21 -42
- package/Components/TreeTable.js.map +1 -1
- package/Components/Utils.js +31 -42
- package/Components/Utils.js.map +1 -1
- package/Connection.js +15 -22
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js +15 -25
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.js +15 -25
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Cron.js +19 -27
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/Error.js +15 -25
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/Message.js +15 -25
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectID.js +19 -27
- package/Dialogs/SelectID.js.map +1 -1
- package/Dialogs/SimpleCron.js +15 -25
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +18 -28
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +37 -49
- package/GenericApp.js.map +1 -1
- package/README.md +4 -0
- package/Theme.js +2 -2
- package/Theme.js.map +1 -1
- package/i18n.js +10 -14
- package/i18n.js.map +1 -1
- package/icons/IconAdapter.js +2 -2
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.js +2 -2
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.js +2 -2
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.js +2 -2
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.js +2 -2
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.js +2 -2
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.js +2 -2
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.js +2 -2
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconExpert.js +2 -2
- package/icons/IconExpert.js.map +1 -1
- package/icons/IconFx.js +2 -2
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.js +2 -2
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.js +2 -2
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconOpen.js +2 -2
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.js +6 -6
- package/icons/IconState.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
9
11
|
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
10
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
23
|
|
|
12
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -21,32 +33,14 @@ var _Utils = _interopRequireDefault(require("./Utils"));
|
|
|
21
33
|
|
|
22
34
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
23
35
|
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
37
|
|
|
28
38
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
39
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
|
-
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
-
|
|
36
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
-
|
|
38
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
-
|
|
40
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
-
|
|
42
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
|
-
|
|
44
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
40
|
+
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); }; }
|
|
45
41
|
|
|
46
42
|
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; } }
|
|
47
43
|
|
|
48
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
-
|
|
50
44
|
var styles = function styles(theme) {
|
|
51
45
|
return {
|
|
52
46
|
different: {
|
|
@@ -61,15 +55,14 @@ var styles = function styles(theme) {
|
|
|
61
55
|
};
|
|
62
56
|
|
|
63
57
|
var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
64
|
-
|
|
58
|
+
(0, _inherits2["default"])(SelectWithIcon, _Component);
|
|
65
59
|
|
|
66
60
|
var _super = _createSuper(SelectWithIcon);
|
|
67
61
|
|
|
68
62
|
function SelectWithIcon(props) {
|
|
69
63
|
var _this;
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
(0, _classCallCheck2["default"])(this, SelectWithIcon);
|
|
73
66
|
_this = _super.call(this, props);
|
|
74
67
|
|
|
75
68
|
if (_this.props.different) {
|
|
@@ -122,7 +115,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
122
115
|
return _this;
|
|
123
116
|
}
|
|
124
117
|
|
|
125
|
-
|
|
118
|
+
(0, _createClass2["default"])(SelectWithIcon, [{
|
|
126
119
|
key: "render",
|
|
127
120
|
value: function render() {
|
|
128
121
|
var _this2 = this;
|
|
@@ -240,7 +233,6 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
240
233
|
}
|
|
241
234
|
}
|
|
242
235
|
}]);
|
|
243
|
-
|
|
244
236
|
return SelectWithIcon;
|
|
245
237
|
}(_react.Component);
|
|
246
238
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWithIcon.js","names":["styles","theme","different","opacity","icon","width","height","marginRight","SelectWithIcon","props","wordDifferent","t","list","Array","isArray","options","map","obj","name","Utils","getObjectNameFromObj","lang","replace","value","_id","common","color","Object","values","unshift","allowNone","I18n","state","find","timeout","setTimeout","JSON","parse","stringify","setState","i","findIndex","splice","item","it","removePrefix","style","undefined","backgroundColor","getInvertedColor","themeType","dense","assign","select","disabled","inputProps","classes","root","clsx","className","el","target","pos","length","clone","onChange","fullWidth","label","Component","propTypes","PropTypes","func","isRequired","string","bool","oneOfType","array","object"],"sources":["SelectWithIcon.js"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport {FormControl, InputLabel, MenuItem, Select} from '@mui/material';\n\nimport Icon from './Icon';\nimport Utils from './Utils';\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n different: {\n opacity: 0.5\n },\n icon: {\n width: 16,\n height: 16,\n marginRight: 8\n }\n});\n\nclass SelectWithIcon extends Component {\n constructor(props) {\n super(props);\n\n if (this.props.different) {\n this.wordDifferent = this.props.t(this.props.different);\n }\n\n let list;\n if (Array.isArray(this.props.list || this.props.options)) {\n list = this.props.list.map(obj => ({\n name: Utils.getObjectNameFromObj(obj, this.props.lang)\n .replace('system.group.', '')\n .replace('system.user.', '')\n .replace('enum.rooms.', '')\n .replace('enum.functions.', ''),\n value: obj._id,\n icon: obj.common?.icon,\n color: obj.common?.color,\n }));\n } else {\n list = Object.values(this.props.list || this.props.options).map(obj => ({\n name: Utils.getObjectNameFromObj(obj, this.props.lang)\n .replace('system.group.', '')\n .replace('system.user.', '')\n .replace('enum.rooms.', '')\n .replace('enum.functions.', ''),\n value: obj._id,\n icon: obj.common?.icon,\n color: obj.common?.color,\n }));\n }\n\n if (this.props.different && this.props.value === this.props.different) {\n list.unshift({value: this.props.different, name: this.wordDifferent});\n }\n\n if (this.props.allowNone) {\n list.unshift({value: '', name: I18n.t('ra_none')});\n }\n\n this.state = {\n list,\n };\n }\n\n render() {\n if (this.props.allowNone && !this.state.list.find(obj => obj.value === '')) {\n this.timeout = this.timeout || setTimeout(() => {\n this.timeout = null;\n const list = JSON.parse(JSON.stringify(this.state.list));\n list.unshift({value: '', name: I18n.t('ra_none')});\n this.setState({list});\n }, 100);\n } else if (!this.props.allowNone && this.state.list.find(obj => obj.value === '')) {\n this.timeout = this.timeout || setTimeout(() => {\n this.timeout = null;\n const list = JSON.parse(JSON.stringify(this.state.list));\n const i = this.state.list.findIndex(obj => obj.value === '');\n list.splice(i, 1);\n this.setState({list});\n }, 100);\n }\n\n const item = this.state.list.find(it => it.value === this.props.value || (this.props.removePrefix && it.value.replace(this.props.removePrefix, '') === this.props.value));\n\n const style = this.props.value === this.props.different ? {} :\n {\n color: item?.color || undefined,\n backgroundColor: Utils.getInvertedColor(item?.color, this.props.themeType)\n };\n\n if (this.props.dense && this.props.style) {\n Object.assign(style, this.props.style);\n }\n\n const select = <Select\n variant=\"standard\"\n disabled={this.props.disabled}\n value={this.props.value}\n inputProps={this.props.inputProps}\n renderValue={value => <span>{item?.icon ? <Icon src={item?.icon} className={this.props.classes.icon} /> : null}{item?.name}</span>}\n classes={{root: Utils.clsx(\n this.props.value === this.props.different ? this.props.classes.different : '',\n this.props.dense ? this.props.className : ''\n )}}\n style={style}\n onChange={el => {\n if (this.props.different && el.target.value !== this.props.different) {\n let pos = null;\n for (let i = 0; i < this.state.list.length; i++) {\n if (this.state.list[i].value === this.props.different) {\n pos = i;\n break;\n }\n }\n if (pos !== null) {\n const list = Utils.clone(this.state.list);\n list.splice(pos, 1);\n return this.setState({list}, () => this.props.onChange(el.target.value));\n }\n }\n\n this.props.onChange(this.props.removePrefix ? el.target.value.replace(this.props.removePrefix, '') : el.target.value);\n }}\n >\n {this.state.list.map(el => <MenuItem\n className={this.props.different && el.value === this.props.different ? this.props.classes.different : ''}\n style={this.props.different && el.value === this.props.different ? {} : { color: el.color || undefined, backgroundColor: Utils.getInvertedColor(el.color, this.props.themeType) }}\n key={el.value}\n value={el.value}\n >\n {el.icon ? <Icon src={el.icon} className={this.props.classes.icon} /> : null}\n {el.name}\n </MenuItem>)}\n </Select>;\n\n if (this.props.dense) {\n return select;\n } else {\n return <FormControl variant=\"standard\" fullWidth={!!this.props.fullWidth} style={this.props.style} className={this.props.className}>\n <InputLabel>{this.props.label}</InputLabel>\n {select}\n </FormControl>;\n\n }\n }\n}\n\nSelectWithIcon.propTypes = {\n t: PropTypes.func.isRequired,\n lang: PropTypes.string.isRequired,\n themeType: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n list: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), // one of \"list\"(Array) or \"options\"(object) is required\n options: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), // one of \"list\"(Array) or \"options\"(object) is required\n different: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n label: PropTypes.string,\n fullWidth: PropTypes.bool,\n className: PropTypes.string,\n style: PropTypes.object,\n removePrefix: PropTypes.string,\n allowNone: PropTypes.bool,\n inputProps: PropTypes.object,\n};\n\nexport default withStyles(styles)(SelectWithIcon);"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,OAAO,EAAE;IADF,CADU;IAIrBC,IAAI,EAAE;MACFC,KAAK,EAAE,EADL;MAEFC,MAAM,EAAE,EAFN;MAGFC,WAAW,EAAE;IAHX;EAJe,CAAL;AAAA,CAApB;;IAWMC,c;;;;;EACF,wBAAYC,KAAZ,EAAmB;IAAA;;IAAA;;IACf,0BAAMA,KAAN;;IAEA,IAAI,MAAKA,KAAL,CAAWP,SAAf,EAA0B;MACtB,MAAKQ,aAAL,GAAqB,MAAKD,KAAL,CAAWE,CAAX,CAAa,MAAKF,KAAL,CAAWP,SAAxB,CAArB;IACH;;IAED,IAAIU,IAAJ;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAc,MAAKL,KAAL,CAAWG,IAAX,IAAmB,MAAKH,KAAL,CAAWM,OAA5C,CAAJ,EAA0D;MACtDH,IAAI,GAAG,MAAKH,KAAL,CAAWG,IAAX,CAAgBI,GAAhB,CAAoB,UAAAC,GAAG;QAAA;;QAAA,OAAK;UAC/BC,IAAI,EAAEC,kBAAMC,oBAAN,C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EAAE+C,sBAAUG,MAJM;EAKvBR,QAAQ,EAAEK,sBAAUC,IAAV,CAAeC,UALF;EAMvBlB,QAAQ,EAAEgB,sBAAUI,IANG;EAOvB9D,IAAI,EAAE0D,sBAAUK,SAAV,CAAoB,CAACL,sBAAUM,KAAX,EAAkBN,sBAAUO,MAA5B,CAApB,CAPiB;EAOyC;EAChE9D,OAAO,EAAEuD,sBAAUK,SAAV,CAAoB,CAACL,sBAAUM,KAAX,EAAkBN,sBAAUO,MAA5B,CAApB,CARc;EAQ4C;EACnE3E,SAAS,EAAEoE,sBAAUK,SAAV,CAAoB,CAACL,sBAAUG,MAAX,EAAmBH,sBAAUI,IAA7B,CAApB,CATY;EAUvBP,KAAK,EAAEG,sBAAUG,MAVM;EAWvBP,SAAS,EAAEI,sBAAUI,IAXE;EAYvBf,SAAS,EAAEW,sBAAUG,MAZE;EAavB3B,KAAK,EAAEwB,sBAAUO,MAbM;EAcvBhC,YAAY,EAAEyB,sBAAUG,MAdD;EAevB3C,SAAS,EAAEwC,sBAAUI,IAfE;EAgBvBnB,UAAU,EAAEe,sBAAUO;AAhBC,CAA3B;;eAmBe,4BAAW7E,MAAX,EAAmBQ,cAAnB,C"}
|
|
1
|
+
{"version":3,"file":"SelectWithIcon.js","names":["styles","theme","different","opacity","icon","width","height","marginRight","SelectWithIcon","props","wordDifferent","t","list","Array","isArray","options","map","obj","name","Utils","getObjectNameFromObj","lang","replace","value","_id","common","color","Object","values","unshift","allowNone","I18n","state","find","timeout","setTimeout","JSON","parse","stringify","setState","i","findIndex","splice","item","it","removePrefix","style","undefined","backgroundColor","getInvertedColor","themeType","dense","assign","select","disabled","inputProps","classes","root","clsx","className","el","target","pos","length","clone","onChange","fullWidth","label","Component","propTypes","PropTypes","func","isRequired","string","bool","oneOfType","array","object"],"sources":["SelectWithIcon.js"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport {FormControl, InputLabel, MenuItem, Select} from '@mui/material';\n\nimport Icon from './Icon';\nimport Utils from './Utils';\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n different: {\n opacity: 0.5\n },\n icon: {\n width: 16,\n height: 16,\n marginRight: 8\n }\n});\n\nclass SelectWithIcon extends Component {\n constructor(props) {\n super(props);\n\n if (this.props.different) {\n this.wordDifferent = this.props.t(this.props.different);\n }\n\n let list;\n if (Array.isArray(this.props.list || this.props.options)) {\n list = this.props.list.map(obj => ({\n name: Utils.getObjectNameFromObj(obj, this.props.lang)\n .replace('system.group.', '')\n .replace('system.user.', '')\n .replace('enum.rooms.', '')\n .replace('enum.functions.', ''),\n value: obj._id,\n icon: obj.common?.icon,\n color: obj.common?.color,\n }));\n } else {\n list = Object.values(this.props.list || this.props.options).map(obj => ({\n name: Utils.getObjectNameFromObj(obj, this.props.lang)\n .replace('system.group.', '')\n .replace('system.user.', '')\n .replace('enum.rooms.', '')\n .replace('enum.functions.', ''),\n value: obj._id,\n icon: obj.common?.icon,\n color: obj.common?.color,\n }));\n }\n\n if (this.props.different && this.props.value === this.props.different) {\n list.unshift({value: this.props.different, name: this.wordDifferent});\n }\n\n if (this.props.allowNone) {\n list.unshift({value: '', name: I18n.t('ra_none')});\n }\n\n this.state = {\n list,\n };\n }\n\n render() {\n if (this.props.allowNone && !this.state.list.find(obj => obj.value === '')) {\n this.timeout = this.timeout || setTimeout(() => {\n this.timeout = null;\n const list = JSON.parse(JSON.stringify(this.state.list));\n list.unshift({value: '', name: I18n.t('ra_none')});\n this.setState({list});\n }, 100);\n } else if (!this.props.allowNone && this.state.list.find(obj => obj.value === '')) {\n this.timeout = this.timeout || setTimeout(() => {\n this.timeout = null;\n const list = JSON.parse(JSON.stringify(this.state.list));\n const i = this.state.list.findIndex(obj => obj.value === '');\n list.splice(i, 1);\n this.setState({list});\n }, 100);\n }\n\n const item = this.state.list.find(it => it.value === this.props.value || (this.props.removePrefix && it.value.replace(this.props.removePrefix, '') === this.props.value));\n\n const style = this.props.value === this.props.different ? {} :\n {\n color: item?.color || undefined,\n backgroundColor: Utils.getInvertedColor(item?.color, this.props.themeType)\n };\n\n if (this.props.dense && this.props.style) {\n Object.assign(style, this.props.style);\n }\n\n const select = <Select\n variant=\"standard\"\n disabled={this.props.disabled}\n value={this.props.value}\n inputProps={this.props.inputProps}\n renderValue={value => <span>{item?.icon ? <Icon src={item?.icon} className={this.props.classes.icon} /> : null}{item?.name}</span>}\n classes={{root: Utils.clsx(\n this.props.value === this.props.different ? this.props.classes.different : '',\n this.props.dense ? this.props.className : ''\n )}}\n style={style}\n onChange={el => {\n if (this.props.different && el.target.value !== this.props.different) {\n let pos = null;\n for (let i = 0; i < this.state.list.length; i++) {\n if (this.state.list[i].value === this.props.different) {\n pos = i;\n break;\n }\n }\n if (pos !== null) {\n const list = Utils.clone(this.state.list);\n list.splice(pos, 1);\n return this.setState({list}, () => this.props.onChange(el.target.value));\n }\n }\n\n this.props.onChange(this.props.removePrefix ? el.target.value.replace(this.props.removePrefix, '') : el.target.value);\n }}\n >\n {this.state.list.map(el => <MenuItem\n className={this.props.different && el.value === this.props.different ? this.props.classes.different : ''}\n style={this.props.different && el.value === this.props.different ? {} : { color: el.color || undefined, backgroundColor: Utils.getInvertedColor(el.color, this.props.themeType) }}\n key={el.value}\n value={el.value}\n >\n {el.icon ? <Icon src={el.icon} className={this.props.classes.icon} /> : null}\n {el.name}\n </MenuItem>)}\n </Select>;\n\n if (this.props.dense) {\n return select;\n } else {\n return <FormControl variant=\"standard\" fullWidth={!!this.props.fullWidth} style={this.props.style} className={this.props.className}>\n <InputLabel>{this.props.label}</InputLabel>\n {select}\n </FormControl>;\n\n }\n }\n}\n\nSelectWithIcon.propTypes = {\n t: PropTypes.func.isRequired,\n lang: PropTypes.string.isRequired,\n themeType: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n list: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), // one of \"list\"(Array) or \"options\"(object) is required\n options: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), // one of \"list\"(Array) or \"options\"(object) is required\n different: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n label: PropTypes.string,\n fullWidth: PropTypes.bool,\n className: PropTypes.string,\n style: PropTypes.object,\n removePrefix: PropTypes.string,\n allowNone: PropTypes.bool,\n inputProps: PropTypes.object,\n};\n\nexport default withStyles(styles)(SelectWithIcon);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,OAAO,EAAE;IADF,CADU;IAIrBC,IAAI,EAAE;MACFC,KAAK,EAAE,EADL;MAEFC,MAAM,EAAE,EAFN;MAGFC,WAAW,EAAE;IAHX;EAJe,CAAL;AAAA,CAApB;;IAWMC,c;;;;;EACF,wBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;;IAEA,IAAI,MAAKA,KAAL,CAAWP,SAAf,EAA0B;MACtB,MAAKQ,aAAL,GAAqB,MAAKD,KAAL,CAAWE,CAAX,CAAa,MAAKF,KAAL,CAAWP,SAAxB,CAArB;IACH;;IAED,IAAIU,IAAJ;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAc,MAAKL,KAAL,CAAWG,IAAX,IAAmB,MAAKH,KAAL,CAAWM,OAA5C,CAAJ,EAA0D;MACtDH,IAAI,GAAG,MAAKH,KAAL,CAAWG,IAAX,CAAgBI,GAAhB,CAAoB,UAAAC,GAAG;QAAA;;QAAA,OAAK;UAC/BC,IAAI,EAAEC,kBAAMC,oBAAN,CAA2BH,GAA3B,EAAgC,MAAKR,KAAL,CAAWY,IAA3C,EACDC,OADC,CACO,eADP,EACwB,EADxB,EAEDA,OAFC,CAEO,cAFP,EAEuB,EAFvB,EAGDA,OAHC,CAGO,aAHP,EAGsB,EAHtB,E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BAAUM,KAAX,EAAkBN,sBAAUO,MAA5B,CAApB,CAPiB;EAOyC;EAChE9D,OAAO,EAAEuD,sBAAUK,SAAV,CAAoB,CAACL,sBAAUM,KAAX,EAAkBN,sBAAUO,MAA5B,CAApB,CARc;EAQ4C;EACnE3E,SAAS,EAAEoE,sBAAUK,SAAV,CAAoB,CAACL,sBAAUG,MAAX,EAAmBH,sBAAUI,IAA7B,CAApB,CATY;EAUvBP,KAAK,EAAEG,sBAAUG,MAVM;EAWvBP,SAAS,EAAEI,sBAAUI,IAXE;EAYvBf,SAAS,EAAEW,sBAAUG,MAZE;EAavB3B,KAAK,EAAEwB,sBAAUO,MAbM;EAcvBhC,YAAY,EAAEyB,sBAAUG,MAdD;EAevB3C,SAAS,EAAEwC,sBAAUI,IAfE;EAgBvBnB,UAAU,EAAEe,sBAAUO;AAhBC,CAA3B;;eAmBe,4BAAW7E,MAAX,EAAmBQ,cAAnB,C"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,8 +11,6 @@ var _cron2text = _interopRequireDefault(require("./cron2text"));
|
|
|
9
11
|
|
|
10
12
|
var _jqueryCron = _interopRequireDefault(require("./jquery.cron.locale"));
|
|
11
13
|
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
14
|
function correctCasus(text, seconds) {
|
|
15
15
|
text = text.replace('Каждую(ый) минуту', 'Каждую минуту');
|
|
16
16
|
text = text.replace('Каждую(ый) минут(у)', 'Каждую минуту');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cronText.js","names":["correctCasus","text","seconds","replace","convertCronToText","cron","lang","withSeconds","split","length","JQUERY_CRON_LOCALE","en"],"sources":["SimpleCron/cronText.js"],"sourcesContent":["import cronToText from './cron2text';\nimport JQUERY_CRON_LOCALE from './jquery.cron.locale';\n\nfunction correctCasus(text, seconds) {\n text = text.replace('Каждую(ый) минуту', 'Каждую минуту');\n text = text.replace('Каждую(ый) минут(у)', 'Каждую минуту');\n text = text.replace('Каждую(ый) час', 'Каждый час');\n text = text.replace('Каждую(ый) секунду', 'Каждую секунду');\n text = text.replace(/ (\\d{1,2}) числа/, ' $1го числа');\n\n text = text.replace(/ (\\d{1,2}) в Январе/, ' $1го числа в Январе');\n text = text.replace(/ (\\d{1,2}) в Феврале/, ' $1го числа в Феврале');\n text = text.replace(/ (\\d{1,2}) в Марте/, ' $1го числа в Марте');\n text = text.replace(/ (\\d{1,2}) в Апреле/, ' $1го числа в Апреле');\n text = text.replace(/ (\\d{1,2}) в Майе/, ' $1го числа в Майе');\n text = text.replace(/ (\\d{1,2}) в Июне/, ' $1го числа в Июне');\n text = text.replace(/ (\\d{1,2}) в Июле/, ' $1го числа в Июле');\n text = text.replace(/ (\\d{1,2}) в Августе/, ' $1го числа в Августе');\n text = text.replace(/ (\\d{1,2}) в Сентябре/, ' $1го числа в Сентябре');\n text = text.replace(/ (\\d{1,2}) в Октябре/, ' $1го числа в Октябре');\n text = text.replace(/ (\\d{1,2}) в Ноябре/, ' $1го числа в Ноябре');\n text = text.replace(/ (\\d{1,2}) в Декабре/, ' $1го числа в Декабре');\n\n text = text.replace('Каждую(ый) 0 минуту', 'Каждые ноль минут');\n text = text.replace(/Каждую\\(ый\\) ([\\d\\sи,]+) минуту/, 'Каждую $1 минуту');\n\n text = text.replace(/каждой\\(го\\) ([\\d\\sи,]+) минуту/, 'каждой $1 минуты');\n text = text.replace('каждой(го) минут(у)', 'каждой минуты');\n\n text = text.replace(' 0 часа(ов)', ' 0 часов');\n text = text.replace(' 1 часа(ов)', ' 1 час');\n text = text.replace(' 2 часа(ов)', ' 2 часа');\n text = text.replace(' 3 часа(ов)', ' 3 часа');\n text = text.replace(' 4 часа(ов)', ' 4 часа');\n text = text.replace(/ (\\d{1,2}) часа\\(ов\\)/, ' $1 часов');\n\n text = text.replace('Jede(r) Sekunde', 'Jede Sekunde');\n text = text.replace(/Jede\\(r\\) ([\\d\\sund,]+) Sekunde/, 'Jede $1 Sekunde');\n text = text.replace('Jede(r) Minute', 'Jede Minute');\n text = text.replace('Jede Minuten', 'Jede Minute');\n text = text.replace('Jede(r) Stunde', 'Jede Stunde');\n text = text.replace(/Jede\\(r\\) ([\\d\\sund,]+) Minute/, 'Jede $1 Minute');\n text = text.replace('Jede Sekunde in Minuten', 'Jede Sekunde in jeder Minute');\n\n return text;\n}\n\nfunction convertCronToText(cron, lang) {\n const withSeconds = cron.split(' ').length === 6;\n let text = cronToText(cron, withSeconds, JQUERY_CRON_LOCALE[lang] || JQUERY_CRON_LOCALE.en);\n return correctCasus(text, withSeconds);\n}\n\nexport default convertCronToText;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cronText.js","names":["correctCasus","text","seconds","replace","convertCronToText","cron","lang","withSeconds","split","length","JQUERY_CRON_LOCALE","en"],"sources":["SimpleCron/cronText.js"],"sourcesContent":["import cronToText from './cron2text';\nimport JQUERY_CRON_LOCALE from './jquery.cron.locale';\n\nfunction correctCasus(text, seconds) {\n text = text.replace('Каждую(ый) минуту', 'Каждую минуту');\n text = text.replace('Каждую(ый) минут(у)', 'Каждую минуту');\n text = text.replace('Каждую(ый) час', 'Каждый час');\n text = text.replace('Каждую(ый) секунду', 'Каждую секунду');\n text = text.replace(/ (\\d{1,2}) числа/, ' $1го числа');\n\n text = text.replace(/ (\\d{1,2}) в Январе/, ' $1го числа в Январе');\n text = text.replace(/ (\\d{1,2}) в Феврале/, ' $1го числа в Феврале');\n text = text.replace(/ (\\d{1,2}) в Марте/, ' $1го числа в Марте');\n text = text.replace(/ (\\d{1,2}) в Апреле/, ' $1го числа в Апреле');\n text = text.replace(/ (\\d{1,2}) в Майе/, ' $1го числа в Майе');\n text = text.replace(/ (\\d{1,2}) в Июне/, ' $1го числа в Июне');\n text = text.replace(/ (\\d{1,2}) в Июле/, ' $1го числа в Июле');\n text = text.replace(/ (\\d{1,2}) в Августе/, ' $1го числа в Августе');\n text = text.replace(/ (\\d{1,2}) в Сентябре/, ' $1го числа в Сентябре');\n text = text.replace(/ (\\d{1,2}) в Октябре/, ' $1го числа в Октябре');\n text = text.replace(/ (\\d{1,2}) в Ноябре/, ' $1го числа в Ноябре');\n text = text.replace(/ (\\d{1,2}) в Декабре/, ' $1го числа в Декабре');\n\n text = text.replace('Каждую(ый) 0 минуту', 'Каждые ноль минут');\n text = text.replace(/Каждую\\(ый\\) ([\\d\\sи,]+) минуту/, 'Каждую $1 минуту');\n\n text = text.replace(/каждой\\(го\\) ([\\d\\sи,]+) минуту/, 'каждой $1 минуты');\n text = text.replace('каждой(го) минут(у)', 'каждой минуты');\n\n text = text.replace(' 0 часа(ов)', ' 0 часов');\n text = text.replace(' 1 часа(ов)', ' 1 час');\n text = text.replace(' 2 часа(ов)', ' 2 часа');\n text = text.replace(' 3 часа(ов)', ' 3 часа');\n text = text.replace(' 4 часа(ов)', ' 4 часа');\n text = text.replace(/ (\\d{1,2}) часа\\(ов\\)/, ' $1 часов');\n\n text = text.replace('Jede(r) Sekunde', 'Jede Sekunde');\n text = text.replace(/Jede\\(r\\) ([\\d\\sund,]+) Sekunde/, 'Jede $1 Sekunde');\n text = text.replace('Jede(r) Minute', 'Jede Minute');\n text = text.replace('Jede Minuten', 'Jede Minute');\n text = text.replace('Jede(r) Stunde', 'Jede Stunde');\n text = text.replace(/Jede\\(r\\) ([\\d\\sund,]+) Minute/, 'Jede $1 Minute');\n text = text.replace('Jede Sekunde in Minuten', 'Jede Sekunde in jeder Minute');\n\n return text;\n}\n\nfunction convertCronToText(cron, lang) {\n const withSeconds = cron.split(' ').length === 6;\n let text = cronToText(cron, withSeconds, JQUERY_CRON_LOCALE[lang] || JQUERY_CRON_LOCALE.en);\n return correctCasus(text, withSeconds);\n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GAAGA,IAAI,CAACE,OAAL,CAAa,yBAAb,EAAwC,8BAAxC,CAAP;EAEA,OAAOF,IAAP;AACH;;AAED,SAASG,iBAAT,CAA2BC,IAA3B,EAAiCC,IAAjC,EAAuC;EACnC,IAAMC,WAAW,GAAGF,IAAI,CAACG,KAAL,CAAW,GAAX,EAAgBC,MAAhB,KAA2B,CAA/C;EACA,IAAIR,IAAI,GAAG,2BAAWI,IAAX,EAAiBE,WAAjB,EAA8BG,uBAAmBJ,IAAnB,KAA4BI,uBAAmBC,EAA7E,CAAX;EACA,OAAOX,YAAY,CAACC,IAAD,EAAOM,WAAP,CAAnB;AACH;;eAEcH,iB"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
10
22
|
var _react = _interopRequireDefault(require("react"));
|
|
11
23
|
|
|
12
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -31,30 +43,10 @@ var _cronText = _interopRequireDefault(require("./cronText"));
|
|
|
31
43
|
|
|
32
44
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
33
45
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
-
|
|
38
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
|
-
|
|
40
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
41
|
-
|
|
42
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
43
|
-
|
|
44
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
45
|
-
|
|
46
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
|
-
|
|
48
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
49
|
-
|
|
50
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
51
|
-
|
|
52
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
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); }; }
|
|
53
47
|
|
|
54
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; } }
|
|
55
49
|
|
|
56
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
-
|
|
58
50
|
var styles = function styles(theme) {
|
|
59
51
|
return {
|
|
60
52
|
mainDiv: {
|
|
@@ -105,15 +97,14 @@ var DEFAULT_STATE = {
|
|
|
105
97
|
};
|
|
106
98
|
|
|
107
99
|
var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
108
|
-
|
|
100
|
+
(0, _inherits2["default"])(SimpleCron, _React$Component);
|
|
109
101
|
|
|
110
102
|
var _super = _createSuper(SimpleCron);
|
|
111
103
|
|
|
112
104
|
function SimpleCron(props) {
|
|
113
105
|
var _this;
|
|
114
106
|
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
(0, _classCallCheck2["default"])(this, SimpleCron);
|
|
117
108
|
_this = _super.call(this, props);
|
|
118
109
|
var cron = typeof _this.props.cronExpression === 'string' ? _this.props.cronExpression.replace(/^["']/, '').replace(/["']\n?$/, '') : '';
|
|
119
110
|
|
|
@@ -157,7 +148,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
157
148
|
return _this;
|
|
158
149
|
}
|
|
159
150
|
|
|
160
|
-
|
|
151
|
+
(0, _createClass2["default"])(SimpleCron, [{
|
|
161
152
|
key: "recalcCron",
|
|
162
153
|
value: function recalcCron() {
|
|
163
154
|
this.onChange(SimpleCron.state2cron(this.state));
|
|
@@ -187,7 +178,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
187
178
|
!e.target.checked && pos !== -1 && settings.weekdays.splice(pos, 1);
|
|
188
179
|
settings.weekdays.sort();
|
|
189
180
|
|
|
190
|
-
_this2.setState(
|
|
181
|
+
_this2.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
191
182
|
return _this2.recalcCron();
|
|
192
183
|
});
|
|
193
184
|
},
|
|
@@ -230,7 +221,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
230
221
|
settings.minutes = parseInt(e.target.value, 10);
|
|
231
222
|
if (settings.minutes < 1) settings.minutes = 1;
|
|
232
223
|
|
|
233
|
-
_this3.setState(
|
|
224
|
+
_this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
234
225
|
return _this3.recalcCron();
|
|
235
226
|
});
|
|
236
227
|
},
|
|
@@ -256,7 +247,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
256
247
|
settings.hours = parseInt(e.target.value, 10);
|
|
257
248
|
if (settings.hours < 1) settings.hours = 1;
|
|
258
249
|
|
|
259
|
-
_this3.setState(
|
|
250
|
+
_this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
260
251
|
return _this3.recalcCron();
|
|
261
252
|
});
|
|
262
253
|
},
|
|
@@ -294,7 +285,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
294
285
|
settings.period = parseInt(e.target.value, 10);
|
|
295
286
|
if (settings.period < 1) settings.period = 1;
|
|
296
287
|
|
|
297
|
-
_this3.setState(
|
|
288
|
+
_this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
298
289
|
return _this3.recalcCron();
|
|
299
290
|
});
|
|
300
291
|
},
|
|
@@ -315,7 +306,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
315
306
|
var settings = JSON.parse(JSON.stringify(_this3.state[type]));
|
|
316
307
|
settings.unit = e.target.value;
|
|
317
308
|
|
|
318
|
-
_this3.setState(
|
|
309
|
+
_this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
319
310
|
return _this3.recalcCron();
|
|
320
311
|
});
|
|
321
312
|
}
|
|
@@ -349,7 +340,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
349
340
|
var settings = JSON.parse(JSON.stringify(_this4.state[type]));
|
|
350
341
|
settings.time = e.target.value;
|
|
351
342
|
|
|
352
|
-
_this4.setState(
|
|
343
|
+
_this4.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
353
344
|
return _this4.recalcCron();
|
|
354
345
|
});
|
|
355
346
|
},
|
|
@@ -388,7 +379,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
388
379
|
var settings = JSON.parse(JSON.stringify(_this5.state[type]));
|
|
389
380
|
settings.date = e.target.value;
|
|
390
381
|
|
|
391
|
-
_this5.setState(
|
|
382
|
+
_this5.setState((0, _defineProperty2["default"])({}, type, settings), function () {
|
|
392
383
|
return _this5.recalcCron();
|
|
393
384
|
});
|
|
394
385
|
},
|
|
@@ -845,7 +836,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
|
|
|
845
836
|
return cron;
|
|
846
837
|
}
|
|
847
838
|
}]);
|
|
848
|
-
|
|
849
839
|
return SimpleCron;
|
|
850
840
|
}(_react["default"].Component);
|
|
851
841
|
|