@iobroker/adapter-react-v5 3.1.34 → 3.1.35

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 (243) hide show
  1. package/Components/404.js +0 -23
  2. package/Components/404.js.map +1 -1
  3. package/Components/ColorPicker.js +6 -37
  4. package/Components/ColorPicker.js.map +1 -1
  5. package/Components/ComplexCron.js +10 -84
  6. package/Components/ComplexCron.js.map +1 -1
  7. package/Components/CustomModal.js +29 -54
  8. package/Components/CustomModal.js.map +1 -1
  9. package/Components/FileBrowser.js +15 -265
  10. package/Components/FileBrowser.js.map +1 -1
  11. package/Components/FileViewer.js +7 -68
  12. package/Components/FileViewer.js.map +1 -1
  13. package/Components/Icon.d.ts +1 -1
  14. package/Components/Icon.js +2 -42
  15. package/Components/Icon.js.map +1 -1
  16. package/Components/IconPicker.js +6 -28
  17. package/Components/IconPicker.js.map +1 -1
  18. package/Components/IconSelector.js +3 -55
  19. package/Components/IconSelector.js.map +1 -1
  20. package/Components/Image.js +1 -38
  21. package/Components/Image.js.map +1 -1
  22. package/Components/JsonConfigComponent/ChipInput.js +66 -197
  23. package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
  24. package/Components/JsonConfigComponent/ConfigAlive.js +0 -31
  25. package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
  26. package/Components/JsonConfigComponent/ConfigAutocomplete.js +6 -39
  27. package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
  28. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +6 -52
  29. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  30. package/Components/JsonConfigComponent/ConfigCRON.js +5 -39
  31. package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
  32. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +4 -42
  33. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
  34. package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -28
  35. package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
  36. package/Components/JsonConfigComponent/ConfigChip.js +4 -33
  37. package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
  38. package/Components/JsonConfigComponent/ConfigColor.js +0 -34
  39. package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
  40. package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -33
  41. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
  42. package/Components/JsonConfigComponent/ConfigCustom.js +14 -73
  43. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
  44. package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -25
  45. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
  46. package/Components/JsonConfigComponent/ConfigFile.js +0 -46
  47. package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
  48. package/Components/JsonConfigComponent/ConfigFileSelector.js +7 -126
  49. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
  50. package/Components/JsonConfigComponent/ConfigFunc.js +0 -34
  51. package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -1
  52. package/Components/JsonConfigComponent/ConfigGeneric.js +15 -110
  53. package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  54. package/Components/JsonConfigComponent/ConfigIP.js +2 -35
  55. package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
  56. package/Components/JsonConfigComponent/ConfigImageUpload.js +4 -44
  57. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
  58. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +1 -59
  59. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  60. package/Components/JsonConfigComponent/ConfigJsonEditor.js +7 -40
  61. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  62. package/Components/JsonConfigComponent/ConfigLanguage.js +2 -42
  63. package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  64. package/Components/JsonConfigComponent/ConfigNumber.js +2 -45
  65. package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
  66. package/Components/JsonConfigComponent/ConfigObjectId.js +6 -40
  67. package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
  68. package/Components/JsonConfigComponent/ConfigPanel.js +7 -91
  69. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  70. package/Components/JsonConfigComponent/ConfigPassword.js +0 -42
  71. package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
  72. package/Components/JsonConfigComponent/ConfigPattern.js +0 -25
  73. package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
  74. package/Components/JsonConfigComponent/ConfigRoom.js +0 -34
  75. package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
  76. package/Components/JsonConfigComponent/ConfigSelect.js +4 -34
  77. package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
  78. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +11 -67
  79. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  80. package/Components/JsonConfigComponent/ConfigSendto.js +8 -91
  81. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  82. package/Components/JsonConfigComponent/ConfigSetState.js +0 -55
  83. package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
  84. package/Components/JsonConfigComponent/ConfigSlider.js +0 -28
  85. package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -1
  86. package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -21
  87. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
  88. package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -24
  89. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
  90. package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -23
  91. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
  92. package/Components/JsonConfigComponent/ConfigStaticText.js +0 -31
  93. package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
  94. package/Components/JsonConfigComponent/ConfigTable.js +13 -105
  95. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  96. package/Components/JsonConfigComponent/ConfigTabs.js +2 -35
  97. package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
  98. package/Components/JsonConfigComponent/ConfigText.js +0 -34
  99. package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
  100. package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -37
  101. package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
  102. package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -25
  103. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
  104. package/Components/JsonConfigComponent/ConfigTopic.js +0 -29
  105. package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
  106. package/Components/JsonConfigComponent/ConfigUser.js +2 -40
  107. package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
  108. package/Components/JsonConfigComponent/index.js +5 -81
  109. package/Components/JsonConfigComponent/index.js.map +1 -1
  110. package/Components/Loader.js +2 -20
  111. package/Components/Loader.js.map +1 -1
  112. package/Components/Loaders/PT.js +2 -20
  113. package/Components/Loaders/PT.js.map +1 -1
  114. package/Components/Loaders/Vendor.js +2 -21
  115. package/Components/Loaders/Vendor.js.map +1 -1
  116. package/Components/Logo.js +6 -39
  117. package/Components/Logo.js.map +1 -1
  118. package/Components/MDUtils.js +3 -27
  119. package/Components/MDUtils.js.map +1 -1
  120. package/Components/ObjectBrowser.d.ts +1 -1
  121. package/Components/ObjectBrowser.js +181 -788
  122. package/Components/ObjectBrowser.js.map +1 -1
  123. package/Components/Router.js +7 -31
  124. package/Components/Router.js.map +1 -1
  125. package/Components/SaveCloseButtons.js +2 -32
  126. package/Components/SaveCloseButtons.js.map +1 -1
  127. package/Components/Schedule.js +29 -251
  128. package/Components/Schedule.js.map +1 -1
  129. package/Components/SelectWithIcon.d.ts +1 -1
  130. package/Components/SelectWithIcon.js +0 -48
  131. package/Components/SelectWithIcon.js.map +1 -1
  132. package/Components/SimpleCron/cron2text.js +45 -91
  133. package/Components/SimpleCron/cron2text.js.map +1 -1
  134. package/Components/SimpleCron/cronText.js +0 -6
  135. package/Components/SimpleCron/cronText.js.map +1 -1
  136. package/Components/SimpleCron/index.js +19 -102
  137. package/Components/SimpleCron/index.js.map +1 -1
  138. package/Components/SimpleCron/jquery.cron.locale.js +44 -24
  139. package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
  140. package/Components/TabContainer.js +2 -23
  141. package/Components/TabContainer.js.map +1 -1
  142. package/Components/TabContent.js +2 -22
  143. package/Components/TabContent.js.map +1 -1
  144. package/Components/TabHeader.js +1 -17
  145. package/Components/TabHeader.js.map +1 -1
  146. package/Components/TableResize.js +6 -51
  147. package/Components/TableResize.js.map +1 -1
  148. package/Components/TextWithIcon.js +0 -20
  149. package/Components/TextWithIcon.js.map +1 -1
  150. package/Components/ToggleThemeMenu.js +5 -13
  151. package/Components/ToggleThemeMenu.js.map +1 -1
  152. package/Components/TreeTable.js +4 -121
  153. package/Components/TreeTable.js.map +1 -1
  154. package/Components/UploadImage.js +17 -60
  155. package/Components/UploadImage.js.map +1 -1
  156. package/Components/Utils.js +87 -263
  157. package/Components/Utils.js.map +1 -1
  158. package/Components/copy-to-clipboard.js +16 -38
  159. package/Components/copy-to-clipboard.js.map +1 -1
  160. package/Components/withWidth.js +2 -10
  161. package/Components/withWidth.js.map +1 -1
  162. package/Connection.d.ts +1 -0
  163. package/Connection.js +156 -527
  164. package/Connection.js.map +1 -1
  165. package/Dialogs/ComplexCron.js +0 -34
  166. package/Dialogs/ComplexCron.js.map +1 -1
  167. package/Dialogs/Confirm.js +1 -39
  168. package/Dialogs/Confirm.js.map +1 -1
  169. package/Dialogs/Cron.js +1 -37
  170. package/Dialogs/Cron.js.map +1 -1
  171. package/Dialogs/Error.d.ts +1 -1
  172. package/Dialogs/Error.js +2 -29
  173. package/Dialogs/Error.js.map +1 -1
  174. package/Dialogs/FileSelect.js +2 -36
  175. package/Dialogs/FileSelect.js.map +1 -1
  176. package/Dialogs/Message.js +2 -27
  177. package/Dialogs/Message.js.map +1 -1
  178. package/Dialogs/SelectID.d.ts +1 -1
  179. package/Dialogs/SelectID.js +3 -40
  180. package/Dialogs/SelectID.js.map +1 -1
  181. package/Dialogs/SimpleCron.js +1 -33
  182. package/Dialogs/SimpleCron.js.map +1 -1
  183. package/Dialogs/TextInput.js +2 -34
  184. package/Dialogs/TextInput.js.map +1 -1
  185. package/GenericApp.js +54 -150
  186. package/GenericApp.js.map +1 -1
  187. package/Prompt.js +0 -2
  188. package/Prompt.js.map +1 -1
  189. package/README.md +8 -4
  190. package/Theme.js +7 -22
  191. package/Theme.js.map +1 -1
  192. package/i18n.d.ts +2 -0
  193. package/i18n.js +9 -29
  194. package/i18n.js.map +1 -1
  195. package/icons/IconAdapter.d.ts +2 -2
  196. package/icons/IconAdapter.js +2 -6
  197. package/icons/IconAdapter.js.map +1 -1
  198. package/icons/IconAlias.d.ts +2 -2
  199. package/icons/IconAlias.js +2 -6
  200. package/icons/IconAlias.js.map +1 -1
  201. package/icons/IconChannel.d.ts +2 -2
  202. package/icons/IconChannel.js +2 -6
  203. package/icons/IconChannel.js.map +1 -1
  204. package/icons/IconClearFilter.d.ts +2 -2
  205. package/icons/IconClearFilter.js +0 -5
  206. package/icons/IconClearFilter.js.map +1 -1
  207. package/icons/IconClosed.d.ts +2 -2
  208. package/icons/IconClosed.js +0 -5
  209. package/icons/IconClosed.js.map +1 -1
  210. package/icons/IconCopy.d.ts +2 -2
  211. package/icons/IconCopy.js +0 -5
  212. package/icons/IconCopy.js.map +1 -1
  213. package/icons/IconDevice.d.ts +2 -2
  214. package/icons/IconDevice.js +0 -5
  215. package/icons/IconDevice.js.map +1 -1
  216. package/icons/IconDocument.d.ts +2 -2
  217. package/icons/IconDocument.js +0 -5
  218. package/icons/IconDocument.js.map +1 -1
  219. package/icons/IconDocumentReadOnly.d.ts +2 -2
  220. package/icons/IconDocumentReadOnly.js +0 -5
  221. package/icons/IconDocumentReadOnly.js.map +1 -1
  222. package/icons/IconExpert.d.ts +2 -2
  223. package/icons/IconExpert.js +0 -5
  224. package/icons/IconExpert.js.map +1 -1
  225. package/icons/IconFx.d.ts +2 -2
  226. package/icons/IconFx.js +0 -5
  227. package/icons/IconFx.js.map +1 -1
  228. package/icons/IconInstance.d.ts +2 -2
  229. package/icons/IconInstance.js +0 -5
  230. package/icons/IconInstance.js.map +1 -1
  231. package/icons/IconLogout.d.ts +2 -2
  232. package/icons/IconLogout.js +0 -5
  233. package/icons/IconLogout.js.map +1 -1
  234. package/icons/IconNoIcon.d.ts +2 -2
  235. package/icons/IconNoIcon.js +0 -5
  236. package/icons/IconNoIcon.js.map +1 -1
  237. package/icons/IconOpen.d.ts +2 -2
  238. package/icons/IconOpen.js +0 -5
  239. package/icons/IconOpen.js.map +1 -1
  240. package/icons/IconState.d.ts +2 -2
  241. package/icons/IconState.js +0 -6
  242. package/icons/IconState.js.map +1 -1
  243. package/package.json +15 -15
@@ -1,52 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
11
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
14
  var _react = _interopRequireDefault(require("react"));
23
-
24
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
16
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
27
-
28
17
  var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
29
-
30
18
  var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
31
-
32
19
  var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
33
-
34
20
  var _Select = _interopRequireDefault(require("@mui/material/Select"));
35
-
36
21
  var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
37
-
38
22
  var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
39
-
40
23
  var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
41
-
42
24
  var _cronText = _interopRequireDefault(require("./cronText"));
43
-
44
25
  var _i18n = _interopRequireDefault(require("../../i18n"));
45
-
46
26
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
47
-
48
27
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
50
28
  var styles = function styles(theme) {
51
29
  return {
52
30
  mainDiv: {
@@ -66,7 +44,6 @@ var styles = function styles(theme) {
66
44
  }
67
45
  };
68
46
  };
69
-
70
47
  var PERIODIC = {
71
48
  once: 'once',
72
49
  interval: 'interval',
@@ -75,11 +52,11 @@ var PERIODIC = {
75
52
  };
76
53
  var PERIODIC_TYPES = {
77
54
  seconds: 'seconds',
78
- minutes: 'minutes' //hours: 'hours',
79
-
55
+ minutes: 'minutes'
56
+ //hours: 'hours',
80
57
  };
81
- var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
82
58
 
59
+ var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
83
60
  function padding(num) {
84
61
  if (num < 10) {
85
62
  return '0' + num;
@@ -87,7 +64,6 @@ function padding(num) {
87
64
  return '' + num;
88
65
  }
89
66
  }
90
-
91
67
  var DEFAULT_STATE = {
92
68
  mode: PERIODIC.interval,
93
69
  interval: {
@@ -95,23 +71,17 @@ var DEFAULT_STATE = {
95
71
  unit: PERIODIC_TYPES.minutes
96
72
  }
97
73
  };
98
-
99
74
  var SimpleCron = /*#__PURE__*/function (_React$Component) {
100
75
  (0, _inherits2["default"])(SimpleCron, _React$Component);
101
-
102
76
  var _super = _createSuper(SimpleCron);
103
-
104
77
  function SimpleCron(props) {
105
78
  var _this;
106
-
107
79
  (0, _classCallCheck2["default"])(this, SimpleCron);
108
80
  _this = _super.call(this, props);
109
81
  var cron = typeof _this.props.cronExpression === 'string' ? _this.props.cronExpression.replace(/^["']/, '').replace(/["']\n?$/, '') : '';
110
-
111
82
  if (cron[0] === '{') {
112
83
  cron = '';
113
84
  }
114
-
115
85
  var state = SimpleCron.cron2state(cron || '* * * * *') || DEFAULT_STATE;
116
86
  _this.state = {
117
87
  extended: false,
@@ -138,16 +108,13 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
138
108
  }
139
109
  };
140
110
  Object.assign(_this.state, state);
141
-
142
111
  if (_this.state.cron !== _this.props.cronExpression) {
143
112
  setTimeout(function () {
144
113
  return _this.props.onChange && _this.props.onChange(_this.state.cron);
145
114
  }, 100);
146
115
  }
147
-
148
116
  return _this;
149
117
  }
150
-
151
118
  (0, _createClass2["default"])(SimpleCron, [{
152
119
  key: "recalcCron",
153
120
  value: function recalcCron() {
@@ -157,7 +124,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
157
124
  key: "getControlsWeekdaysElements",
158
125
  value: function getControlsWeekdaysElements(type) {
159
126
  var _this2 = this;
160
-
161
127
  var settings = this.state[type];
162
128
  return /*#__PURE__*/_react["default"].createElement("div", {
163
129
  key: "weekdays",
@@ -177,7 +143,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
177
143
  e.target.checked && pos === -1 && settings.weekdays.push(day);
178
144
  !e.target.checked && pos !== -1 && settings.weekdays.splice(pos, 1);
179
145
  settings.weekdays.sort();
180
-
181
146
  _this2.setState((0, _defineProperty2["default"])({}, type, settings), function () {
182
147
  return _this2.recalcCron();
183
148
  });
@@ -192,9 +157,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
192
157
  key: "getControlsPeriodElements",
193
158
  value: function getControlsPeriodElements(type) {
194
159
  var _this3 = this;
195
-
196
160
  var settings = this.state[type];
197
-
198
161
  if (this.state.extended) {
199
162
  return /*#__PURE__*/_react["default"].createElement("div", {
200
163
  key: "period",
@@ -220,7 +183,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
220
183
  var settings = JSON.parse(JSON.stringify(_this3.state[type]));
221
184
  settings.minutes = parseInt(e.target.value, 10);
222
185
  if (settings.minutes < 1) settings.minutes = 1;
223
-
224
186
  _this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
225
187
  return _this3.recalcCron();
226
188
  });
@@ -246,7 +208,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
246
208
  var settings = JSON.parse(JSON.stringify(_this3.state[type]));
247
209
  settings.hours = parseInt(e.target.value, 10);
248
210
  if (settings.hours < 1) settings.hours = 1;
249
-
250
211
  _this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
251
212
  return _this3.recalcCron();
252
213
  });
@@ -284,7 +245,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
284
245
  var settings = JSON.parse(JSON.stringify(_this3.state[type]));
285
246
  settings.period = parseInt(e.target.value, 10);
286
247
  if (settings.period < 1) settings.period = 1;
287
-
288
248
  _this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
289
249
  return _this3.recalcCron();
290
250
  });
@@ -305,7 +265,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
305
265
  onChange: function onChange(e) {
306
266
  var settings = JSON.parse(JSON.stringify(_this3.state[type]));
307
267
  settings.unit = e.target.value;
308
-
309
268
  _this3.setState((0, _defineProperty2["default"])({}, type, settings), function () {
310
269
  return _this3.recalcCron();
311
270
  });
@@ -322,7 +281,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
322
281
  key: "getControlsTime",
323
282
  value: function getControlsTime(type) {
324
283
  var _this4 = this;
325
-
326
284
  var settings = this.state[type];
327
285
  return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
328
286
  variant: "standard",
@@ -339,7 +297,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
339
297
  onChange: function onChange(e) {
340
298
  var settings = JSON.parse(JSON.stringify(_this4.state[type]));
341
299
  settings.time = e.target.value;
342
-
343
300
  _this4.setState((0, _defineProperty2["default"])({}, type, settings), function () {
344
301
  return _this4.recalcCron();
345
302
  });
@@ -354,15 +311,13 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
354
311
  key: "getControlsDate",
355
312
  value: function getControlsDate(type) {
356
313
  var _this5 = this;
357
-
358
314
  var settings = this.state[type];
359
-
360
315
  if (!settings.date) {
361
316
  var d = new Date();
362
317
  settings.date = d.getDate() + '.' + padding(d.getMonth() + 1);
363
- } //<InputLabel htmlFor="formatted-text-mask-input">{I18n.t('sc_at')}</InputLabel>
364
-
318
+ }
365
319
 
320
+ //<InputLabel htmlFor="formatted-text-mask-input">{I18n.t('sc_at')}</InputLabel>
366
321
  return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
367
322
  variant: "standard",
368
323
  className: this.props.classes.formControl
@@ -378,7 +333,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
378
333
  onChange: function onChange(e) {
379
334
  var settings = JSON.parse(JSON.stringify(_this5.state[type]));
380
335
  settings.date = e.target.value;
381
-
382
336
  _this5.setState((0, _defineProperty2["default"])({}, type, settings), function () {
383
337
  return _this5.recalcCron();
384
338
  });
@@ -407,7 +361,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
407
361
  key: "getIntervalBetweenElements",
408
362
  value: function getIntervalBetweenElements() {
409
363
  var _this6 = this;
410
-
411
364
  var settings = this.state.intervalBetween;
412
365
  return [this.getControlsPeriodElements('intervalBetween'), /*#__PURE__*/_react["default"].createElement("div", {
413
366
  key: "between",
@@ -435,7 +388,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
435
388
  onChange: function onChange(e) {
436
389
  var settings = JSON.parse(JSON.stringify(_this6.state.intervalBetween));
437
390
  settings.timeFrom = parseInt(e.target.value, 10);
438
-
439
391
  _this6.setState({
440
392
  intervalBetween: settings
441
393
  }, function () {
@@ -462,7 +414,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
462
414
  onChange: function onChange(e) {
463
415
  var settings = JSON.parse(JSON.stringify(_this6.state.intervalBetween));
464
416
  settings.timeTo = parseInt(e.target.value, 10);
465
-
466
417
  _this6.setState({
467
418
  intervalBetween: settings
468
419
  }, function () {
@@ -490,7 +441,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
490
441
  key: "onModeChange",
491
442
  value: function onModeChange(mode) {
492
443
  var _this7 = this;
493
-
494
444
  if (mode !== this.state.mode) {
495
445
  this.setState({
496
446
  mode: mode
@@ -513,7 +463,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
513
463
  key: "render",
514
464
  value: function render() {
515
465
  var _this8 = this;
516
-
517
466
  return /*#__PURE__*/_react["default"].createElement("div", {
518
467
  className: this.props.classes.mainDiv
519
468
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -561,14 +510,12 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
561
510
  key: "periodArray2text",
562
511
  value: function periodArray2text(list, max) {
563
512
  max = max || 7;
564
-
565
513
  if (list.length === max) {
566
514
  return '*';
567
515
  } else {
568
516
  var text = [];
569
517
  var start = null;
570
518
  var end = null;
571
-
572
519
  for (var i = 0; i < list.length; i++) {
573
520
  if (start === null) {
574
521
  start = list[i];
@@ -581,18 +528,15 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
581
528
  } else {
582
529
  text.push(start);
583
530
  }
584
-
585
531
  start = list[i];
586
532
  end = list[i];
587
533
  }
588
534
  }
589
-
590
535
  if (start !== end) {
591
536
  text.push(start + '-' + end);
592
537
  } else {
593
538
  text.push(start);
594
539
  }
595
-
596
540
  return text.join(',');
597
541
  }
598
542
  }
@@ -602,16 +546,13 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
602
546
  if (text === '*') {
603
547
  return [0, 1, 2, 3, 4, 5, 6];
604
548
  }
605
-
606
549
  var parts = text.split(',');
607
550
  var list = [];
608
551
  parts.forEach(function (part) {
609
552
  var _parts = part.split('-');
610
-
611
553
  if (_parts.length === 2) {
612
554
  var start = parseInt(_parts[0], 10);
613
555
  var end = parseInt(_parts[1], 10);
614
-
615
556
  for (var day = start; day <= end; day++) {
616
557
  if (list.indexOf(day === 7 ? 0 : day) === -1) {
617
558
  list.push(day === 7 ? 0 : day);
@@ -621,9 +562,7 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
621
562
  if (part === '7') {
622
563
  part = 0;
623
564
  }
624
-
625
565
  part = parseInt(part, 10);
626
-
627
566
  if (list.indexOf(part) === -1) {
628
567
  list.push(part);
629
568
  }
@@ -641,7 +580,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
641
580
  var state = {
642
581
  mode: ''
643
582
  };
644
-
645
583
  if (cronParts.length === 6) {
646
584
  options.seconds = cronParts[0] || '*';
647
585
  options.minutes = cronParts[1] || '*';
@@ -656,9 +594,9 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
656
594
  options.date = cronParts[2] || '*';
657
595
  options.months = cronParts[3] || '*';
658
596
  options.dow = cronParts[4] || '*';
659
- } // * * * * *
660
-
597
+ }
661
598
 
599
+ // * * * * *
662
600
  if (options.seconds === null && options.minutes === '*' && options.hours === '*' && options.date === '*' && options.months === '*') {
663
601
  state.mode = PERIODIC.interval;
664
602
  state.interval = {
@@ -666,29 +604,30 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
666
604
  unit: PERIODIC_TYPES.minutes
667
605
  };
668
606
  } // * * * * * *
669
-
670
-
671
607
  if (options.seconds === '*' && options.minutes === '*' && options.hours === '*' && options.date === '*' && options.months === '*') {
672
608
  state.mode = PERIODIC.interval;
673
609
  state.interval = {
674
610
  period: 1,
675
611
  unit: PERIODIC_TYPES.seconds
676
612
  };
677
- } else // */n * * * *
613
+ } else
614
+ // */n * * * *
678
615
  if (options.seconds === null && options.minutes.indexOf('/') !== -1 && options.hours === '*' && options.date === '*' && options.months === '*') {
679
616
  state.mode = PERIODIC.interval;
680
617
  state.interval = {
681
618
  period: parseInt(options.minutes.split('/')[1], 10),
682
619
  unit: PERIODIC_TYPES.minutes
683
620
  };
684
- } else // */n * * * * *
621
+ } else
622
+ // */n * * * * *
685
623
  if (options.seconds !== null && options.seconds.indexOf('/') !== -1 && options.minutes === '*' && options.hours === '*' && options.date === '*' && options.months === '*') {
686
624
  state.mode = PERIODIC.interval;
687
625
  state.interval = {
688
626
  period: parseInt(options.seconds.split('/')[1], 10),
689
627
  unit: PERIODIC_TYPES.seconds
690
628
  };
691
- } else // */n * 1-24 * * 1-7 or */n * 1-24 * * *
629
+ } else
630
+ // */n * 1-24 * * 1-7 or */n * 1-24 * * *
692
631
  if (options.seconds !== null && options.seconds.indexOf('/') !== -1 && options.minutes === '*' && options.hours.indexOf('-') !== -1 && options.date === '*' && options.months === '*') {
693
632
  state.mode = PERIODIC.intervalBetween;
694
633
  state.intervalBetween = {
@@ -698,7 +637,8 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
698
637
  timeTo: parseInt(options.hours.split('-')[1], 10),
699
638
  weekdays: SimpleCron.text2weekdays(options.dow)
700
639
  };
701
- } else // */n 1-24 * * 1-7 or */n 1-24 * * *
640
+ } else
641
+ // */n 1-24 * * 1-7 or */n 1-24 * * *
702
642
  if (options.seconds === null && options.minutes.indexOf('/') !== -1 && options.hours.indexOf('-') !== -1 && options.date === '*' && options.months === '*') {
703
643
  state.mode = PERIODIC.intervalBetween;
704
644
  state.intervalBetween = {
@@ -708,14 +648,16 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
708
648
  timeTo: parseInt(options.hours.split('-')[1], 10),
709
649
  weekdays: SimpleCron.text2weekdays(options.dow)
710
650
  };
711
- } else // m h * * 1-7 or m h * * *
651
+ } else
652
+ // m h * * 1-7 or m h * * *
712
653
  if (options.seconds === null && parseInt(options.minutes, 10).toString() === options.minutes && parseInt(options.hours, 10).toString() === options.hours && options.date === '*' && options.months === '*') {
713
654
  state.mode = PERIODIC.specific;
714
655
  state.specific = {
715
656
  time: padding(parseInt(options.hours, 10)) + ':' + padding(parseInt(options.minutes, 10)),
716
657
  weekdays: SimpleCron.text2weekdays(options.dow)
717
658
  };
718
- } else // m h d M *
659
+ } else
660
+ // m h d M *
719
661
  if (options.seconds === null && parseInt(options.minutes, 10).toString() === options.minutes && parseInt(options.hours, 10).toString() === options.hours && parseInt(options.date, 10).toString() === options.date && parseInt(options.months, 10).toString() === options.months && options.dow === '*') {
720
662
  state.mode = PERIODIC.once;
721
663
  state.once = {
@@ -725,7 +667,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
725
667
  weekdays: SimpleCron.text2weekdays(options.dow)
726
668
  };
727
669
  }
728
-
729
670
  if (state.mode) {
730
671
  return state;
731
672
  } else {
@@ -736,7 +677,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
736
677
  key: "state2cron",
737
678
  value: function state2cron(state) {
738
679
  var cron = '* * * * *';
739
-
740
680
  if (state.mode === PERIODIC.interval) {
741
681
  var settings = state.interval || {};
742
682
  if (settings.period > 60) settings.period = 60;
@@ -745,7 +685,6 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
745
685
  if (settings.minutes < 1) settings.minutes = 1;
746
686
  if (settings.hours > 24) settings.hours = 24;
747
687
  if (settings.hours < 1) settings.hours = 1;
748
-
749
688
  if (state.extended) {
750
689
  cron = "".concat(settings.minutes > 1 ? '*/' + settings.minutes : '*', " ").concat(settings.hours > 1 ? '*/' + settings.hours : '*', " * * *");
751
690
  } else {
@@ -753,75 +692,57 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
753
692
  case PERIODIC_TYPES.seconds:
754
693
  cron = "".concat(settings.period > 1 ? '*/' + settings.period : '*', " * * * * *");
755
694
  break;
756
-
757
695
  case PERIODIC_TYPES.minutes:
758
696
  cron = "".concat(settings.period > 1 ? '*/' + settings.period : '*', " * * * *");
759
697
  break;
760
-
761
698
  default:
762
699
  break;
763
700
  }
764
701
  }
765
702
  } else if (state.mode === PERIODIC.intervalBetween) {
766
703
  var _settings = state.intervalBetween || {};
767
-
768
704
  var hours;
769
705
  _settings.timeFrom = _settings.timeFrom || 0;
770
706
  _settings.timeTo = _settings.timeTo === undefined ? 24 : _settings.timeTo;
771
-
772
707
  if (_settings.timeFrom === 0 && _settings.timeTo === 24) {
773
708
  hours = '*';
774
709
  } else {
775
710
  hours = _settings.timeFrom !== _settings.timeTo ? _settings.timeFrom + '-' + _settings.timeTo : '*';
776
711
  }
777
-
778
712
  if (_settings.period > 60) _settings.period = 60;
779
713
  if (_settings.period < 1) _settings.period = 1;
780
714
  _settings.unit = _settings.unit || PERIODIC_TYPES.minutes;
781
-
782
715
  switch (_settings.unit) {
783
716
  case PERIODIC_TYPES.seconds:
784
717
  cron = "".concat(_settings.period > 1 ? '*/' + _settings.period : '*', " * ").concat(hours, " * * ").concat(this.periodArray2text(_settings.weekdays));
785
718
  break;
786
-
787
719
  case PERIODIC_TYPES.minutes:
788
720
  cron = "".concat(_settings.period > 1 ? '*/' + _settings.period : '*', " ").concat(hours, " * * ").concat(this.periodArray2text(_settings.weekdays));
789
721
  break;
790
-
791
722
  default:
792
723
  break;
793
724
  }
794
725
  } else if (state.mode === PERIODIC.specific) {
795
726
  var _settings2 = state.specific || {};
796
-
797
727
  var parts = (_settings2.time || '00:00').split(':');
798
728
  var minutes = parseInt(parts[1], 10) || 0;
799
729
  if (minutes > 59) minutes = 59;
800
730
  if (minutes < 0) minutes = 0;
801
-
802
731
  var _hours = parseInt(parts[0], 10) || 0;
803
-
804
732
  if (_hours > 23) _hours = 59;
805
733
  if (_hours < 0) _hours = 0;
806
734
  cron = "".concat(minutes, " ").concat(_hours, " * * ").concat(this.periodArray2text(_settings2.weekdays || []));
807
735
  } else if (state.mode === PERIODIC.once) {
808
736
  var _settings3 = state.once || {};
809
-
810
737
  if (!_settings3.date) {
811
738
  _settings3.date = new Date().getDate() + '.' + padding(new Date().getMonth() + 1);
812
739
  }
813
-
814
740
  var _parts2 = (_settings3.time || '00:00').split(':');
815
-
816
741
  var partsDate = _settings3.date.split('.');
817
-
818
742
  var _minutes = parseInt(_parts2[1], 10) || 0;
819
-
820
743
  if (_minutes > 59) _minutes = 59;
821
744
  if (_minutes < 0) _minutes = 0;
822
-
823
745
  var _hours2 = parseInt(_parts2[0], 10) || 0;
824
-
825
746
  if (_hours2 > 23) _hours2 = 59;
826
747
  if (_hours2 < 0) _hours2 = 0;
827
748
  var date = parseInt(partsDate[0], 10) || 1;
@@ -832,20 +753,16 @@ var SimpleCron = /*#__PURE__*/function (_React$Component) {
832
753
  if (month < 1) month = 1;
833
754
  cron = "".concat(_minutes, " ").concat(_hours2, " ").concat(date, " ").concat(month, " *");
834
755
  }
835
-
836
756
  return cron;
837
757
  }
838
758
  }]);
839
759
  return SimpleCron;
840
760
  }(_react["default"].Component);
841
-
842
761
  SimpleCron.propTypes = {
843
762
  cronExpression: _propTypes["default"].string,
844
763
  onChange: _propTypes["default"].func,
845
764
  language: _propTypes["default"].string
846
765
  };
847
-
848
766
  var _default = (0, _withStyles["default"])(styles)(SimpleCron);
849
-
850
767
  exports["default"] = _default;
851
768
  //# sourceMappingURL=index.js.map