@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.
Files changed (110) hide show
  1. package/Components/404.js +17 -25
  2. package/Components/404.js.map +1 -1
  3. package/Components/ColorPicker.js +25 -35
  4. package/Components/ColorPicker.js.map +1 -1
  5. package/Components/ComplexCron.js +29 -37
  6. package/Components/ComplexCron.js.map +1 -1
  7. package/Components/FileBrowser.js +40 -61
  8. package/Components/FileBrowser.js.map +1 -1
  9. package/Components/FileViewer.js +18 -28
  10. package/Components/FileViewer.js.map +1 -1
  11. package/Components/Icon.js +15 -25
  12. package/Components/Icon.js.map +1 -1
  13. package/Components/IconPicker.js +6 -6
  14. package/Components/IconPicker.js.map +1 -1
  15. package/Components/IconSelector.js +25 -31
  16. package/Components/IconSelector.js.map +1 -1
  17. package/Components/Image.js +15 -25
  18. package/Components/Image.js.map +1 -1
  19. package/Components/Loader.js +14 -24
  20. package/Components/Loader.js.map +1 -1
  21. package/Components/Loaders/PT.js +13 -23
  22. package/Components/Loaders/PT.js.map +1 -1
  23. package/Components/Loaders/Vendor.js +14 -24
  24. package/Components/Loaders/Vendor.js.map +1 -1
  25. package/Components/Logo.js +15 -25
  26. package/Components/Logo.js.map +1 -1
  27. package/Components/MDUtils.js +14 -11
  28. package/Components/MDUtils.js.map +1 -1
  29. package/Components/ObjectBrowser.js +110 -175
  30. package/Components/ObjectBrowser.js.map +1 -1
  31. package/Components/Router.js +13 -21
  32. package/Components/Router.js.map +1 -1
  33. package/Components/SaveCloseButtons.js +15 -25
  34. package/Components/SaveCloseButtons.js.map +1 -1
  35. package/Components/Schedule.js +23 -37
  36. package/Components/Schedule.js.map +1 -1
  37. package/Components/SelectWithIcon.js +17 -25
  38. package/Components/SelectWithIcon.js.map +1 -1
  39. package/Components/SimpleCron/cronText.js +2 -2
  40. package/Components/SimpleCron/cronText.js.map +1 -1
  41. package/Components/SimpleCron/index.js +24 -34
  42. package/Components/SimpleCron/index.js.map +1 -1
  43. package/Components/TabContainer.js +18 -28
  44. package/Components/TabContainer.js.map +1 -1
  45. package/Components/TabContent.js +17 -27
  46. package/Components/TabContent.js.map +1 -1
  47. package/Components/TabHeader.js +13 -23
  48. package/Components/TabHeader.js.map +1 -1
  49. package/Components/TextWithIcon.js +5 -5
  50. package/Components/TextWithIcon.js.map +1 -1
  51. package/Components/ToggleThemeMenu.js +2 -2
  52. package/Components/ToggleThemeMenu.js.map +1 -1
  53. package/Components/TreeTable.js +21 -42
  54. package/Components/TreeTable.js.map +1 -1
  55. package/Components/Utils.js +31 -42
  56. package/Components/Utils.js.map +1 -1
  57. package/Connection.js +15 -22
  58. package/Connection.js.map +1 -1
  59. package/Dialogs/ComplexCron.js +15 -25
  60. package/Dialogs/ComplexCron.js.map +1 -1
  61. package/Dialogs/Confirm.js +15 -25
  62. package/Dialogs/Confirm.js.map +1 -1
  63. package/Dialogs/Cron.js +19 -27
  64. package/Dialogs/Cron.js.map +1 -1
  65. package/Dialogs/Error.js +15 -25
  66. package/Dialogs/Error.js.map +1 -1
  67. package/Dialogs/Message.js +15 -25
  68. package/Dialogs/Message.js.map +1 -1
  69. package/Dialogs/SelectID.js +19 -27
  70. package/Dialogs/SelectID.js.map +1 -1
  71. package/Dialogs/SimpleCron.js +15 -25
  72. package/Dialogs/SimpleCron.js.map +1 -1
  73. package/Dialogs/TextInput.js +18 -28
  74. package/Dialogs/TextInput.js.map +1 -1
  75. package/GenericApp.js +37 -49
  76. package/GenericApp.js.map +1 -1
  77. package/README.md +4 -0
  78. package/Theme.js +2 -2
  79. package/Theme.js.map +1 -1
  80. package/i18n.js +10 -14
  81. package/i18n.js.map +1 -1
  82. package/icons/IconAdapter.js +2 -2
  83. package/icons/IconAdapter.js.map +1 -1
  84. package/icons/IconAlias.js +2 -2
  85. package/icons/IconAlias.js.map +1 -1
  86. package/icons/IconChannel.js +2 -2
  87. package/icons/IconChannel.js.map +1 -1
  88. package/icons/IconClearFilter.js +2 -2
  89. package/icons/IconClearFilter.js.map +1 -1
  90. package/icons/IconClosed.js +2 -2
  91. package/icons/IconClosed.js.map +1 -1
  92. package/icons/IconCopy.js +2 -2
  93. package/icons/IconCopy.js.map +1 -1
  94. package/icons/IconDevice.js +2 -2
  95. package/icons/IconDevice.js.map +1 -1
  96. package/icons/IconDocument.js +2 -2
  97. package/icons/IconDocument.js.map +1 -1
  98. package/icons/IconExpert.js +2 -2
  99. package/icons/IconExpert.js.map +1 -1
  100. package/icons/IconFx.js +2 -2
  101. package/icons/IconFx.js.map +1 -1
  102. package/icons/IconInstance.js +2 -2
  103. package/icons/IconInstance.js.map +1 -1
  104. package/icons/IconLogout.js +2 -2
  105. package/icons/IconLogout.js.map +1 -1
  106. package/icons/IconOpen.js +2 -2
  107. package/icons/IconOpen.js.map +1 -1
  108. package/icons/IconState.js +6 -6
  109. package/icons/IconState.js.map +1 -1
  110. package/package.json +9 -9
@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
10
20
  var _react = _interopRequireDefault(require("react"));
11
21
 
12
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -33,28 +43,10 @@ var _ComplexCron = _interopRequireDefault(require("../Components/ComplexCron"));
33
43
 
34
44
  var _i18n = _interopRequireDefault(require("../i18n"));
35
45
 
36
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": 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
  // Generate cron expression
59
51
  var styles = function styles(theme) {
60
52
  return {
@@ -72,15 +64,14 @@ var styles = function styles(theme) {
72
64
  };
73
65
 
74
66
  var DialogComplexCron = /*#__PURE__*/function (_React$Component) {
75
- _inherits(DialogComplexCron, _React$Component);
67
+ (0, _inherits2["default"])(DialogComplexCron, _React$Component);
76
68
 
77
69
  var _super = _createSuper(DialogComplexCron);
78
70
 
79
71
  function DialogComplexCron(props) {
80
72
  var _this;
81
73
 
82
- _classCallCheck(this, DialogComplexCron);
83
-
74
+ (0, _classCallCheck2["default"])(this, DialogComplexCron);
84
75
  _this = _super.call(this, props);
85
76
  var cron;
86
77
 
@@ -100,7 +91,7 @@ var DialogComplexCron = /*#__PURE__*/function (_React$Component) {
100
91
  return _this;
101
92
  }
102
93
 
103
- _createClass(DialogComplexCron, [{
94
+ (0, _createClass2["default"])(DialogComplexCron, [{
104
95
  key: "handleCancel",
105
96
  value: function handleCancel() {
106
97
  this.props.onClose();
@@ -170,7 +161,6 @@ var DialogComplexCron = /*#__PURE__*/function (_React$Component) {
170
161
  }, this.props.cancel || _i18n["default"].t('ra_Cancel'))));
171
162
  }
172
163
  }]);
173
-
174
164
  return DialogComplexCron;
175
165
  }(_react["default"].Component);
176
166
 
@@ -1 +1 @@
1
- {"version":3,"file":"ComplexCron.js","names":["styles","theme","headerID","fontWeight","fontStyle","radio","display","dialogPaper","height","DialogComplexCron","props","cron","replace","trim","state","onClose","onOk","paper","classes","title","I18n","t","overflow","setState","getLanguage","clearButton","handleClear","clear","handleOk","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","object","func","isRequired","string","simple","bool","language"],"sources":["ComplexCron.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\n\nimport IconOk from '@mui/icons-material/Check';\nimport IconCancel from '@mui/icons-material/Cancel';\nimport IconClear from '@mui/icons-material/Delete';\n\nimport ComplexCron from '../Components/ComplexCron';\n\nimport I18n from '../i18n';\n\n// Generate cron expression\nconst styles = theme => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic'\n },\n radio: {\n display: 'inline-block'\n },\n dialogPaper: {\n height: 'calc(100% - 96px)'\n }\n});\n\nclass DialogComplexCron extends React.Component {\n constructor(props) {\n super(props);\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n handleClear() {\n this.props.onOk(false);\n this.props.onClose();\n }\n\n render() {\n return <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth={true}\n classes={{paper: this.props.classes.dialogPaper}}\n open={true}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>\n <DialogContent style={{height: '100%', overflow: 'hidden'}}>\n <ComplexCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />\n </DialogContent>\n <DialogActions>\n {!!this.props.clearButton && <Button color=\"grey\" variant=\"contained\" onClick={() => this.handleClear()} startIcon={<IconClear />}>{this.props.clear || I18n.t('ra_Clear')}</Button>}\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" startIcon={<IconOk />}>{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\nDialogComplexCron.propTypes = {\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n cron: PropTypes.string,\n cancel: PropTypes.string,\n ok: PropTypes.string,\n simple: PropTypes.bool,\n language: PropTypes.string,\n clearButton: PropTypes.bool,\n};\n\nexport default withStyles(styles)(DialogComplexCron);\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,QAAQ,EAAE;MACNC,UAAU,EAAE,MADN;MAENC,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,gCAAC,kBAAD;QAAQ,KAAK,EAAC,MAAd;QAAqB,OAAO,EAAC,WAA7B;QAAyC,OAAO,EAAE;UAAA,OAAM,MAAI,CAACS,YAAL,EAAN;QAAA,CAAlD;QAA6E,SAAS,eAAE,gCAAC,kBAAD;MAAxF,GAAyG,KAAKpB,KAAL,CAAWqB,MAAX,IAAqBX,iBAAKC,CAAL,CAAO,WAAP,CAA9H,CAHJ,CAhBG,CAAP;IAsBH;;;;EAvD2BW,kBAAMC,S;;AA0DtCxB,iBAAiB,CAACyB,SAAlB,GAA8B;EAC1BhB,OAAO,EAAEiB,sBAAUC,MADO;EAE1BrB,OAAO,EAAEoB,sBAAUE,IAAV,CAAeC,UAFE;EAG1BtB,IAAI,EAAEmB,sBAAUE,IAAV,CAAeC,UAHK;EAI1BnB,KAAK,EAAEgB,sBAAUI,MAJS;EAK1B5B,IAAI,EAAEwB,sBAAUI,MALU;EAM1BR,MAAM,EAAEI,sBAAUI,MANQ;EAO1BV,EAAE,EAAEM,sBAAUI,MAPY;EAQ1BC,MAAM,EAAEL,sBAAUM,IARQ;EAS1BC,QAAQ,EAAEP,sBAAUI,MATM;EAU1Bd,WAAW,EAAEU,sBAAUM;AAVG,CAA9B;;eAae,4BAAWzC,MAAX,EAAmBS,iBAAnB,C"}
1
+ {"version":3,"file":"ComplexCron.js","names":["styles","theme","headerID","fontWeight","fontStyle","radio","display","dialogPaper","height","DialogComplexCron","props","cron","replace","trim","state","onClose","onOk","paper","classes","title","I18n","t","overflow","setState","getLanguage","clearButton","handleClear","clear","handleOk","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","object","func","isRequired","string","simple","bool","language"],"sources":["ComplexCron.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\n\nimport IconOk from '@mui/icons-material/Check';\nimport IconCancel from '@mui/icons-material/Cancel';\nimport IconClear from '@mui/icons-material/Delete';\n\nimport ComplexCron from '../Components/ComplexCron';\n\nimport I18n from '../i18n';\n\n// Generate cron expression\nconst styles = theme => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic'\n },\n radio: {\n display: 'inline-block'\n },\n dialogPaper: {\n height: 'calc(100% - 96px)'\n }\n});\n\nclass DialogComplexCron extends React.Component {\n constructor(props) {\n super(props);\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n handleClear() {\n this.props.onOk(false);\n this.props.onClose();\n }\n\n render() {\n return <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth={true}\n classes={{paper: this.props.classes.dialogPaper}}\n open={true}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>\n <DialogContent style={{height: '100%', overflow: 'hidden'}}>\n <ComplexCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />\n </DialogContent>\n <DialogActions>\n {!!this.props.clearButton && <Button color=\"grey\" variant=\"contained\" onClick={() => this.handleClear()} startIcon={<IconClear />}>{this.props.clear || I18n.t('ra_Clear')}</Button>}\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" startIcon={<IconOk />}>{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\nDialogComplexCron.propTypes = {\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n cron: PropTypes.string,\n cancel: PropTypes.string,\n ok: PropTypes.string,\n simple: PropTypes.bool,\n language: PropTypes.string,\n clearButton: PropTypes.bool,\n};\n\nexport default withStyles(styles)(DialogComplexCron);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA;AACA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,QAAQ,EAAE;MACNC,UAAU,EAAE,MADN;MAENC,SAAS,EAAE;IAFL,CADW;IAKrBC,KAAK,EAAE;MACHC,OAAO,EAAE;IADN,CALc;IAQrBC,WAAW,EAAE;MACTC,MAAM,EAAE;IADC;EARQ,CAAL;AAAA,CAApB;;IAaMC,iB;;;;;EACF,2BAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IACA,IAAIC,IAAJ;;IACA,IAAI,MAAKD,KAAL,CAAWC,IAAX,IAAmB,OAAO,MAAKD,KAAL,CAAWC,IAAlB,KAA2B,QAA9C,IAA0D,MAAKD,KAAL,CAAWC,IAAX,CAAgBC,OAAhB,CAAwB,OAAxB,EAAiC,EAAjC,EAAqC,CAArC,MAA4C,GAA1G,EAA+G;MAC3GD,IAAI,GAAG,MAAKD,KAAL,CAAWC,IAAX,CAAgBC,OAAhB,CAAwB,OAAxB,EAAiC,EAAjC,EAAqCC,IAArC,EAAP;IACH,CAFD,MAEO;MACHF,IAAI,GAAG,MAAKD,KAAL,CAAWC,IAAX,IAAmB,IAA1B;;MACA,IAAI,OAAOA,IAAP,KAAgB,QAApB,EAA8B;QAC1BA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AAQ,EAAEP,sBAAUI,MATM;EAU1Bd,WAAW,EAAEU,sBAAUM;AAVG,CAA9B;;eAae,4BAAWzC,MAAX,EAAmBS,iBAAnB,C"}
@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
10
20
  var _react = _interopRequireDefault(require("react"));
11
21
 
12
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -35,28 +45,10 @@ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
35
45
 
36
46
  var _i18n = _interopRequireDefault(require("../i18n"));
37
47
 
38
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
39
-
40
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41
-
42
- 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); } }
43
-
44
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
45
-
46
- 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); }
47
-
48
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
49
-
50
- 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); }; }
51
-
52
- 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); }
53
-
54
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
48
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
55
49
 
56
50
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
57
51
 
58
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
59
-
60
52
  var styles = {
61
53
  suppress: {
62
54
  fontSize: 12
@@ -81,15 +73,14 @@ var styles = {
81
73
  */
82
74
 
83
75
  var DialogConfirm = /*#__PURE__*/function (_React$Component) {
84
- _inherits(DialogConfirm, _React$Component);
76
+ (0, _inherits2["default"])(DialogConfirm, _React$Component);
85
77
 
86
78
  var _super = _createSuper(DialogConfirm);
87
79
 
88
80
  function DialogConfirm(props) {
89
81
  var _this;
90
82
 
91
- _classCallCheck(this, DialogConfirm);
92
-
83
+ (0, _classCallCheck2["default"])(this, DialogConfirm);
93
84
  _this = _super.call(this, props);
94
85
 
95
86
  if (!_this.props.dialogName && _this.props.suppressQuestionMinutes) {
@@ -115,7 +106,7 @@ var DialogConfirm = /*#__PURE__*/function (_React$Component) {
115
106
  return _this;
116
107
  }
117
108
 
118
- _createClass(DialogConfirm, [{
109
+ (0, _createClass2["default"])(DialogConfirm, [{
119
110
  key: "handleOk",
120
111
  value: function handleOk() {
121
112
  if (this.state.suppress) {
@@ -188,7 +179,6 @@ var DialogConfirm = /*#__PURE__*/function (_React$Component) {
188
179
  }, this.props.cancel || _i18n["default"].t('ra_Cancel'))));
189
180
  }
190
181
  }]);
191
-
192
182
  return DialogConfirm;
193
183
  }(_react["default"].Component);
194
184
 
@@ -1 +1 @@
1
- {"version":3,"file":"Confirm.js","names":["styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","props","dialogName","suppressQuestionMinutes","Error","parseInt","window","localStorage","getItem","Date","now","removeItem","state","setItem","onClose","setTimeout","event","reason","handleCancel","title","I18n","t","icon","text","label","classes","root","setState","suppressText","handleOk","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","string","object","number","_export"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt(window.localStorage.getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n window.localStorage.removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n window.localStorage.setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={true}\n maxWidth=\"md\"\n fullWidth={true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;AAQA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,QAAQ,EAAE;IACNC,QAAQ,EAAE;EADJ,CADC;EAIXC,YAAY,EAAE;IACVC,SAAS,EAAE;EADD;AAJH,CAAf;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,a;;;;;EACF,uBAAYC,KAAZ,EAAmB;IAAA;;IAAA;;IACf,0BAAMA,KAAN;;IAEA,IAAI,CAAC,MAAKA,KAAL,CAAWC,UAAZ,IAA0B,MAAKD,KAAL,CAAWE,uBAAzC,EAAkE;MAC9D,MAAM,IAAIC,KAAJ,CAAU,qDAAV,CAAN;IACH;;IACD,IAAIR,QAAQ,GAAG,KAAf;;IAEA,IAAI,MAAKK,KAAL,CAAWE,uBAAf,EAAwC;MACpCP,QAAQ,GAAGS,QAAQ,CAACC,MAAM,CAACC,YAAP,CAAoBC,OAApB,CAA4B,MAAKP,KAAL,CAAWC,UAAvC,CAAD,EAAqD,EAArD,CAAR,IAAoE,CAA/E;;MAEA,IAAI,CAACN,QAAL,EAAe;QACXA,QAAQ,GAAG,KAAX;MACH,CAFD,MAEO,IAAIa,IAAI,CAACC,GAAL,KAAad,QAAjB,EAA2B;QAC9BU,MAAM,CAACC,YAAP,CAAoBI,UAApB,CAA+B,MAAKV,KAAL,CAAWC,UAA1C;QACAN,QAAQ,GAAG,KAAX;MACH;IACJ;;IAED,MAAKgB,KAAL,GAAa;MACThB,QAAQ,EAARA;IADS,CAAb;IAnBe;EAsBlB;;;;WAED,oBAAW;MACP,IAAI,KAAKgB,KAAL,CAAWhB,QAAf,E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P;IAgCH;;;;EA1EuBW,kBAAMC,S;;AA6ElCjC,aAAa,CAACkC,SAAd,GAA0B;EACtBpB,OAAO,EAAEqB,sBAAUC,IAAV,CAAeC,UADF;EAEtBlB,KAAK,EAAEgB,sBAAUG,MAFK;EAGtBf,IAAI,EAAEY,sBAAUG,MAHM;EAItBR,EAAE,EAAEK,sBAAUG,MAJQ;EAKtBP,MAAM,EAAEI,sBAAUG,MALI;EAMtBhB,IAAI,EAAEa,sBAAUI,MANM;EAOtBpC,uBAAuB,EAAEgC,sBAAUK,MAPb;EAQtBZ,YAAY,EAAEO,sBAAUG,MARF;EAStBpC,UAAU,EAAEiC,sBAAUG;AATA,CAA1B;;AAYA,IAAMG,OAAO,GAAG,4BAAW9C,MAAX,EAAmBK,aAAnB,CAAhB;;eACeyC,O"}
1
+ {"version":3,"file":"Confirm.js","names":["styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","props","dialogName","suppressQuestionMinutes","Error","parseInt","window","localStorage","getItem","Date","now","removeItem","state","setItem","onClose","setTimeout","event","reason","handleCancel","title","I18n","t","icon","text","label","classes","root","setState","suppressText","handleOk","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","string","object","number","_export"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt(window.localStorage.getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n window.localStorage.removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n window.localStorage.setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={true}\n maxWidth=\"md\"\n fullWidth={true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,QAAQ,EAAE;IACNC,QAAQ,EAAE;EADJ,CADC;EAIXC,YAAY,EAAE;IACVC,SAAS,EAAE;EADD;AAJH,CAAf;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC,a;;;;;EACF,uBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;;I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Cron.js CHANGED
@@ -1,10 +1,24 @@
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
  });
6
8
  exports["default"] = void 0;
7
9
 
10
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
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
+
8
22
  var _react = _interopRequireDefault(require("react"));
9
23
 
10
24
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -35,30 +49,10 @@ var _Schedule = _interopRequireDefault(require("../Components/Schedule"));
35
49
 
36
50
  var _i18n = _interopRequireDefault(require("../i18n"));
37
51
 
38
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
39
-
40
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
41
-
42
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
43
-
44
- 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); } }
45
-
46
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
47
-
48
- 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); }
49
-
50
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
51
-
52
- 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); }; }
53
-
54
- 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); }
55
-
56
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
52
+ 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); }; }
57
53
 
58
54
  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; } }
59
55
 
60
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
61
-
62
56
  // Generate cron expression
63
57
  var styles = function styles(theme) {
64
58
  return {
@@ -79,15 +73,14 @@ var styles = function styles(theme) {
79
73
  };
80
74
 
81
75
  var DialogCron = /*#__PURE__*/function (_React$Component) {
82
- _inherits(DialogCron, _React$Component);
76
+ (0, _inherits2["default"])(DialogCron, _React$Component);
83
77
 
84
78
  var _super = _createSuper(DialogCron);
85
79
 
86
80
  function DialogCron(props) {
87
81
  var _this;
88
82
 
89
- _classCallCheck(this, DialogCron);
90
-
83
+ (0, _classCallCheck2["default"])(this, DialogCron);
91
84
  _this = _super.call(this, props);
92
85
  var cron;
93
86
 
@@ -103,12 +96,12 @@ var DialogCron = /*#__PURE__*/function (_React$Component) {
103
96
 
104
97
  _this.state = {
105
98
  cron: cron,
106
- mode: _this.props.simple ? 'simple' : _this.props.complex ? 'complex' : _typeof(cron) === 'object' || cron[0] === '{' ? 'wizard' : _SimpleCron["default"].cron2state(_this.props.cron || '* * * * *') ? 'simple' : 'complex'
99
+ mode: _this.props.simple ? 'simple' : _this.props.complex ? 'complex' : (0, _typeof2["default"])(cron) === 'object' || cron[0] === '{' ? 'wizard' : _SimpleCron["default"].cron2state(_this.props.cron || '* * * * *') ? 'simple' : 'complex'
107
100
  };
108
101
  return _this;
109
102
  }
110
103
 
111
- _createClass(DialogCron, [{
104
+ (0, _createClass2["default"])(DialogCron, [{
112
105
  key: "handleCancel",
113
106
  value: function handleCancel() {
114
107
  this.props.onClose();
@@ -229,7 +222,6 @@ var DialogCron = /*#__PURE__*/function (_React$Component) {
229
222
  }), this.props.cancel || _i18n["default"].t('ra_Cancel'))));
230
223
  }
231
224
  }]);
232
-
233
225
  return DialogCron;
234
226
  }(_react["default"].Component);
235
227
 
@@ -1 +1 @@
1
- {"version":3,"file":"Cron.js","names":["styles","theme","headerID","fontWeight","fontStyle","radio","display","dialogPaper","height","buttonIcon","marginRight","spacing","DialogCron","props","cron","replace","trim","state","mode","simple","complex","SimpleCron","cron2state","onClose","onOk","setState","paper","classes","title","I18n","t","overflow","e","setMode","color","getLanguage","handleOk","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","object","func","isRequired","string","bool","language"],"sources":["Cron.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\nimport Radio from '@mui/material/Radio';\n\nimport IconOk from '@mui/icons-material/Check';\nimport IconCancel from '@mui/icons-material/Cancel';\n\nimport ComplexCron from '../Components/ComplexCron';\nimport SimpleCron from '../Components/SimpleCron';\nimport Schedule from '../Components/Schedule';\n\nimport I18n from '../i18n';\n\n// Generate cron expression\n\nconst styles = theme => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic'\n },\n radio: {\n display: 'inline-block'\n },\n dialogPaper: {\n height: 'calc(100% - 96px)'\n },\n buttonIcon: {\n marginRight: theme.spacing(1),\n }\n});\n\nclass DialogCron extends React.Component {\n constructor(props) {\n super(props);\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n mode: this.props.simple ? 'simple' :\n (this.props.complex ? 'complex' :\n (typeof cron === 'object' || cron[0] === '{' ?\n 'wizard' :\n (SimpleCron.cron2state(this.props.cron || '* * * * *') ? 'simple' : 'complex')))\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n setMode(mode) {\n this.setState({mode});\n }\n\n render() {\n return <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth={true}\n classes={{paper: this.props.classes.dialogPaper}}\n open={true}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>\n <DialogContent style={{height: '100%', overflow: 'hidden'}}>\n {(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? <div>\n {!this.props.simple && !this.props.complex && <><Radio\n key=\"wizard\"\n checked={this.state.mode === 'wizard'}\n onChange={e => this.setMode('wizard')}\n /><label onClick={e => this.setMode('wizard')}\n style={this.state.mode !== 'wizard' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_wizard')}</label></>}\n\n {((!this.props.simple && !this.props.complex) || this.props.simple) && <><Radio\n key=\"simple\"\n checked={this.state.mode === 'simple'}\n onChange={e => this.setMode('simple')}\n /><label onClick={e => this.setMode('simple')}\n style={this.state.mode !== 'simple' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_simple')}</label></>}\n\n {((!this.props.simple && !this.props.complex) || this.props.complex) && <><Radio\n key=\"complex\"\n checked={this.state.mode === 'complex'}\n onChange={e => this.setMode('complex')}\n /><label onClick={e => this.setMode('complex')} style={this.state.mode !== 'complex' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_cron')}</label></>}\n </div> : null}\n\n {this.state.mode === 'simple' && <SimpleCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n {this.state.mode === 'wizard' && <Schedule\n schedule={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n {this.state.mode === 'complex' && <ComplexCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\"><IconOk className={this.props.classes.buttonIcon}/>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\"><IconCancel className={this.props.classes.buttonIcon}/>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogCron.propTypes = {\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n cron: PropTypes.string,\n cancel: PropTypes.string,\n ok: PropTypes.string,\n simple: PropTypes.bool, // show only simple configuration\n complex: PropTypes.bool, // show only complex configuration\n language: PropTypes.string\n};\n\nexport default withStyles(styles)(DialogCron);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,QAAQ,EAAE;MACNC,UAAU,EAAE,MADN;MAENC,SAAS,EAAE;IAFL,CADW;IAKrBC,KAAK,EAAE;MACHC,OAAO,EAAE;IADN,CALc;IAQrBC,WAAW,EAAE;MACTC,MAAM,EAAE;IADC,CARQ;IAWrBC,UAAU,EAAE;MACRC,WAAW,EAAET,KAAK,CAACU,OAAN,CAAc,CAAd;IADL;EAXS,CAAL;AAAA,CAApB;;IAgBMC,U;;;;;EACF,oBAAYC,KAAZ,EAAmB;IAAA;;IAAA;;IACf,0BAAMA,KAAN;IACA,IAAIC,IAAJ;;IACA,IAAI,MAAKD,KAAL,CAAWC,IAAX,IAAmB,OAAO,MAAKD,KAAL,CAAWC,IAAlB,KAA2B,QAA9C,IAA0D,MAAKD,KAAL,CAAWC,IAAX,CAAgBC,OAAhB,CAAwB,OAAxB,EAAiC,EAA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AKI,KAAL,CAAW0B,MAAX,IAAqBV,iBAAKC,CAAL,CAAO,WAAP,CAA1J,CAFJ,CAhDG,CAAP;IAqDH;;;;EA1FoBU,kBAAMC,S;;AA6F/B7B,UAAU,CAAC8B,SAAX,GAAuB;EACnBf,OAAO,EAAEgB,sBAAUC,MADA;EAEnBrB,OAAO,EAAEoB,sBAAUE,IAAV,CAAeC,UAFL;EAGnBtB,IAAI,EAAEmB,sBAAUE,IAAV,CAAeC,UAHF;EAInBlB,KAAK,EAAEe,sBAAUI,MAJE;EAKnBjC,IAAI,EAAE6B,sBAAUI,MALG;EAMnBR,MAAM,EAAEI,sBAAUI,MANC;EAOnBV,EAAE,EAAEM,sBAAUI,MAPK;EAQnB5B,MAAM,EAAEwB,sBAAUK,IARC;EAQK;EACxB5B,OAAO,EAAEuB,sBAAUK,IATA;EASM;EACzBC,QAAQ,EAAEN,sBAAUI;AAVD,CAAvB;;eAae,4BAAW/C,MAAX,EAAmBY,UAAnB,C"}
1
+ {"version":3,"file":"Cron.js","names":["styles","theme","headerID","fontWeight","fontStyle","radio","display","dialogPaper","height","buttonIcon","marginRight","spacing","DialogCron","props","cron","replace","trim","state","mode","simple","complex","SimpleCron","cron2state","onClose","onOk","setState","paper","classes","title","I18n","t","overflow","e","setMode","color","getLanguage","handleOk","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","object","func","isRequired","string","bool","language"],"sources":["Cron.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\nimport Radio from '@mui/material/Radio';\n\nimport IconOk from '@mui/icons-material/Check';\nimport IconCancel from '@mui/icons-material/Cancel';\n\nimport ComplexCron from '../Components/ComplexCron';\nimport SimpleCron from '../Components/SimpleCron';\nimport Schedule from '../Components/Schedule';\n\nimport I18n from '../i18n';\n\n// Generate cron expression\n\nconst styles = theme => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic'\n },\n radio: {\n display: 'inline-block'\n },\n dialogPaper: {\n height: 'calc(100% - 96px)'\n },\n buttonIcon: {\n marginRight: theme.spacing(1),\n }\n});\n\nclass DialogCron extends React.Component {\n constructor(props) {\n super(props);\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n mode: this.props.simple ? 'simple' :\n (this.props.complex ? 'complex' :\n (typeof cron === 'object' || cron[0] === '{' ?\n 'wizard' :\n (SimpleCron.cron2state(this.props.cron || '* * * * *') ? 'simple' : 'complex')))\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n setMode(mode) {\n this.setState({mode});\n }\n\n render() {\n return <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth={true}\n classes={{paper: this.props.classes.dialogPaper}}\n open={true}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>\n <DialogContent style={{height: '100%', overflow: 'hidden'}}>\n {(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? <div>\n {!this.props.simple && !this.props.complex && <><Radio\n key=\"wizard\"\n checked={this.state.mode === 'wizard'}\n onChange={e => this.setMode('wizard')}\n /><label onClick={e => this.setMode('wizard')}\n style={this.state.mode !== 'wizard' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_wizard')}</label></>}\n\n {((!this.props.simple && !this.props.complex) || this.props.simple) && <><Radio\n key=\"simple\"\n checked={this.state.mode === 'simple'}\n onChange={e => this.setMode('simple')}\n /><label onClick={e => this.setMode('simple')}\n style={this.state.mode !== 'simple' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_simple')}</label></>}\n\n {((!this.props.simple && !this.props.complex) || this.props.complex) && <><Radio\n key=\"complex\"\n checked={this.state.mode === 'complex'}\n onChange={e => this.setMode('complex')}\n /><label onClick={e => this.setMode('complex')} style={this.state.mode !== 'complex' ? {color: 'lightgrey'} : {}}>{I18n.t('sc_cron')}</label></>}\n </div> : null}\n\n {this.state.mode === 'simple' && <SimpleCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n {this.state.mode === 'wizard' && <Schedule\n schedule={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n {this.state.mode === 'complex' && <ComplexCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({cron})}\n language={I18n.getLanguage()}\n />}\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\"><IconOk className={this.props.classes.buttonIcon}/>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\"><IconCancel className={this.props.classes.buttonIcon}/>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogCron.propTypes = {\n classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n cron: PropTypes.string,\n cancel: PropTypes.string,\n ok: PropTypes.string,\n simple: PropTypes.bool, // show only simple configuration\n complex: PropTypes.bool, // show only complex configuration\n language: PropTypes.string\n};\n\nexport default withStyles(styles)(DialogCron);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;;;;;A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@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
10
20
  var _react = _interopRequireDefault(require("react"));
11
21
 
12
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -29,28 +39,10 @@ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
29
39
 
30
40
  var _i18n = _interopRequireDefault(require("../i18n"));
31
41
 
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
-
34
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
35
-
36
- 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); } }
37
-
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
-
40
- 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); }
41
-
42
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
43
-
44
- 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); }; }
45
-
46
- 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); }
47
-
48
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
42
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
49
43
 
50
44
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
51
45
 
52
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
53
-
54
46
  var styles = function styles(theme) {
55
47
  return {
56
48
  titleBackground: {},
@@ -70,17 +62,16 @@ var styles = function styles(theme) {
70
62
 
71
63
 
72
64
  var DialogError = /*#__PURE__*/function (_React$Component) {
73
- _inherits(DialogError, _React$Component);
65
+ (0, _inherits2["default"])(DialogError, _React$Component);
74
66
 
75
67
  var _super = _createSuper(DialogError);
76
68
 
77
69
  function DialogError() {
78
- _classCallCheck(this, DialogError);
79
-
70
+ (0, _classCallCheck2["default"])(this, DialogError);
80
71
  return _super.apply(this, arguments);
81
72
  }
82
73
 
83
- _createClass(DialogError, [{
74
+ (0, _createClass2["default"])(DialogError, [{
84
75
  key: "handleOk",
85
76
  value: function handleOk() {
86
77
  this.props.onClose && this.props.onClose();
@@ -118,7 +109,6 @@ var DialogError = /*#__PURE__*/function (_React$Component) {
118
109
  }, _i18n["default"].t('ra_Ok'))));
119
110
  }
120
111
  }]);
121
-
122
112
  return DialogError;
123
113
  }(_react["default"].Component);
124
114
 
@@ -1 +1 @@
1
- {"version":3,"file":"Error.js","names":["styles","theme","titleBackground","titleColor","DialogError","props","onClose","handleOk","classes","root","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","oneOfType","element","icon","object","_export"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 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/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;AAOA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,eAAe,EAAE,EADI;IAIrBC,UAAU,EAAE;EAJS,CAAL;AAAA,CAApB;AASA;AACA;AACA;AACA;A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GpBP,IAAI,EAAEI,sBAAUI,SAAV,CAAoB,CACtBJ,sBAAUG,MADY,EAEtBH,sBAAUK,OAFY,CAApB,CAHc;EAOpBC,IAAI,EAAEN,sBAAUO;AAPI,CAAxB;AAUA;;AACA,IAAMC,OAAO,GAAG,4BAAWzB,MAAX,EAAmBI,WAAnB,CAAhB;;eACeqB,O"}
1
+ {"version":3,"file":"Error.js","names":["styles","theme","titleBackground","titleColor","DialogError","props","onClose","handleOk","classes","root","title","I18n","t","text","React","Component","propTypes","PropTypes","func","isRequired","string","oneOfType","element","icon","object","_export"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 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/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [key] The key to identify this component.\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={true}\n maxWidth=\"sm\"\n fullWidth={true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,eAAe,EAAE,EADI;IAIrBC,UAAU,EAAE;EAJS,CAAL;AAAA,CAApB;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;IACMC,W;;;;;;;;;;;;WACF,oBAAW;MACP,KAAKC,KAAL,CAAWC,OAAX,IAAsB,KAAKD,KAAL,CAAWC,OAAX,EAAtB;IACH;;;WAED,kBAAS;MAAA;;MACL,oBAAO,gCAAC,kBAAD;QACH,IAAI,EAAE,IADH;QAEH,QAAQ,EAAC,IAFN;QAGH,SAAS,EAAE,IAHR;QAIH,OAAO,EAAE;UAAA,OAAM,KAAI,CAACC,QAAL,EAAN;QAAA,CAJN;QAKH,mBAAgB,oBALb;QAMH,oBAAiB;MANd,gBAQH,gCAAC,uBAAD;QAAa,SAAS,EAAE,KAAKF,KAAL,CAAWG,OAAX,CAAmBN,eAA3C;QACa,OAAO,EAAE;UAACO,IAAI,EAAE,KAAKJ,KAAL,CAAWG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