@iobroker/adapter-react-v5 4.2.1 → 4.3.1

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 (152) hide show
  1. package/AdminConnection.js.map +1 -1
  2. package/Components/404.js +11 -14
  3. package/Components/404.js.map +1 -1
  4. package/Components/ColorPicker.js +2 -2
  5. package/Components/ColorPicker.js.map +1 -1
  6. package/Components/ComplexCron.d.ts +1 -1
  7. package/Components/ComplexCron.js +40 -50
  8. package/Components/ComplexCron.js.map +1 -1
  9. package/Components/CustomModal.js +8 -12
  10. package/Components/CustomModal.js.map +1 -1
  11. package/Components/FileBrowser.js +3 -2
  12. package/Components/FileBrowser.js.map +1 -1
  13. package/Components/FileViewer.d.ts +0 -2
  14. package/Components/FileViewer.js +25 -35
  15. package/Components/FileViewer.js.map +1 -1
  16. package/Components/Icon.d.ts +0 -2
  17. package/Components/Icon.js +37 -46
  18. package/Components/Icon.js.map +1 -1
  19. package/Components/IconPicker.js +8 -10
  20. package/Components/IconPicker.js.map +1 -1
  21. package/Components/IconSelector.js +1830 -1841
  22. package/Components/IconSelector.js.map +1 -1
  23. package/Components/Image.js +18 -17
  24. package/Components/Image.js.map +1 -1
  25. package/Components/JsonConfigComponent/ConfigTable.js +357 -38
  26. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  27. package/Components/Loader.js +9 -9
  28. package/Components/Loader.js.map +1 -1
  29. package/Components/Loaders/PT.js +2 -2
  30. package/Components/Loaders/PT.js.map +1 -1
  31. package/Components/Loaders/Vendor.d.ts +0 -7
  32. package/Components/Loaders/Vendor.js +1 -4
  33. package/Components/Loaders/Vendor.js.map +1 -1
  34. package/Components/Logo.js +16 -18
  35. package/Components/Logo.js.map +1 -1
  36. package/Components/MDUtils.js +2 -3
  37. package/Components/MDUtils.js.map +1 -1
  38. package/Components/ObjectBrowser.d.ts +20 -6
  39. package/Components/ObjectBrowser.js +635 -610
  40. package/Components/ObjectBrowser.js.map +1 -1
  41. package/Components/Router.d.ts +1 -1
  42. package/Components/Router.js +6 -6
  43. package/Components/Router.js.map +1 -1
  44. package/Components/SaveCloseButtons.d.ts +0 -1
  45. package/Components/SaveCloseButtons.js +17 -17
  46. package/Components/SaveCloseButtons.js.map +1 -1
  47. package/Components/Schedule.d.ts +1 -1
  48. package/Components/Schedule.js +171 -162
  49. package/Components/Schedule.js.map +1 -1
  50. package/Components/SelectWithIcon.d.ts +1 -1
  51. package/Components/SelectWithIcon.js +12 -11
  52. package/Components/SelectWithIcon.js.map +1 -1
  53. package/Components/SimpleCron/cron2text.js +71 -74
  54. package/Components/SimpleCron/cron2text.js.map +1 -1
  55. package/Components/SimpleCron/cronText.js +1 -1
  56. package/Components/SimpleCron/cronText.js.map +1 -1
  57. package/Components/SimpleCron/index.d.ts +1 -1
  58. package/Components/SimpleCron/index.js +3 -4
  59. package/Components/SimpleCron/index.js.map +1 -1
  60. package/Components/SimpleCron/jquery.cron.locale.js +77 -74
  61. package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
  62. package/Components/TabContainer.js +6 -7
  63. package/Components/TabContainer.js.map +1 -1
  64. package/Components/TabContent.js +4 -4
  65. package/Components/TabContent.js.map +1 -1
  66. package/Components/TabHeader.js +2 -2
  67. package/Components/TabHeader.js.map +1 -1
  68. package/Components/TableResize.js +6 -6
  69. package/Components/TableResize.js.map +1 -1
  70. package/Components/TextWithIcon.js +6 -3
  71. package/Components/TextWithIcon.js.map +1 -1
  72. package/Components/ToggleThemeMenu.d.ts +1 -1
  73. package/Components/ToggleThemeMenu.js +5 -8
  74. package/Components/ToggleThemeMenu.js.map +1 -1
  75. package/Components/TreeTable.js +170 -201
  76. package/Components/TreeTable.js.map +1 -1
  77. package/Components/UploadImage.js +11 -12
  78. package/Components/UploadImage.js.map +1 -1
  79. package/Components/Utils.d.ts +14 -7
  80. package/Components/Utils.js +219 -202
  81. package/Components/Utils.js.map +1 -1
  82. package/Components/copy-to-clipboard.js +8 -9
  83. package/Components/copy-to-clipboard.js.map +1 -1
  84. package/Components/withWidth.js.map +1 -1
  85. package/Connection.js.map +1 -1
  86. package/Dialogs/ComplexCron.d.ts +1 -3
  87. package/Dialogs/ComplexCron.js +2 -4
  88. package/Dialogs/ComplexCron.js.map +1 -1
  89. package/Dialogs/Confirm.d.ts +1 -1
  90. package/Dialogs/Confirm.js +2 -2
  91. package/Dialogs/Confirm.js.map +1 -1
  92. package/Dialogs/Cron.d.ts +1 -2
  93. package/Dialogs/Cron.js +10 -17
  94. package/Dialogs/Cron.js.map +1 -1
  95. package/Dialogs/Error.d.ts +0 -1
  96. package/Dialogs/Error.js +10 -24
  97. package/Dialogs/Error.js.map +1 -1
  98. package/Dialogs/Message.js.map +1 -1
  99. package/Dialogs/SelectFile.js +2 -2
  100. package/Dialogs/SelectFile.js.map +1 -1
  101. package/Dialogs/SelectID.d.ts +0 -4
  102. package/Dialogs/SelectID.js +3 -7
  103. package/Dialogs/SelectID.js.map +1 -1
  104. package/Dialogs/SimpleCron.d.ts +1 -3
  105. package/Dialogs/SimpleCron.js +3 -5
  106. package/Dialogs/SimpleCron.js.map +1 -1
  107. package/Dialogs/TextInput.d.ts +0 -1
  108. package/Dialogs/TextInput.js +9 -17
  109. package/Dialogs/TextInput.js.map +1 -1
  110. package/GenericApp.js +39 -42
  111. package/GenericApp.js.map +1 -1
  112. package/LegacyConnection.d.ts +6 -6
  113. package/LegacyConnection.js +61 -63
  114. package/LegacyConnection.js.map +1 -1
  115. package/Prompt.js.map +1 -1
  116. package/README.md +19 -10
  117. package/Theme.js +1 -1
  118. package/Theme.js.map +1 -1
  119. package/assets/devices/parseNames.js +1 -1
  120. package/assets/rooms/parseNames.js +1 -1
  121. package/i18n/de.json +12 -1
  122. package/i18n/en.json +12 -1
  123. package/i18n/es.json +12 -1
  124. package/i18n/fr.json +12 -1
  125. package/i18n/it.json +12 -1
  126. package/i18n/nl.json +12 -1
  127. package/i18n/pl.json +12 -1
  128. package/i18n/pt.json +12 -1
  129. package/i18n/ru.json +12 -1
  130. package/i18n/uk.json +12 -1
  131. package/i18n/zh-cn.json +12 -1
  132. package/i18n.d.ts +1 -1
  133. package/i18n.js +20 -18
  134. package/i18n.js.map +1 -1
  135. package/icons/IconAdapter.js.map +1 -1
  136. package/icons/IconAlias.js.map +1 -1
  137. package/icons/IconChannel.js.map +1 -1
  138. package/icons/IconClearFilter.js.map +1 -1
  139. package/icons/IconClosed.js.map +1 -1
  140. package/icons/IconCopy.js.map +1 -1
  141. package/icons/IconDevice.js.map +1 -1
  142. package/icons/IconDocument.js.map +1 -1
  143. package/icons/IconDocumentReadOnly.js.map +1 -1
  144. package/icons/IconExpert.js.map +1 -1
  145. package/icons/IconFx.js.map +1 -1
  146. package/icons/IconInstance.js.map +1 -1
  147. package/icons/IconLogout.js.map +1 -1
  148. package/icons/IconNoIcon.js.map +1 -1
  149. package/icons/IconOpen.js.map +1 -1
  150. package/icons/IconState.js.map +1 -1
  151. package/index.js +0 -1
  152. package/package.json +7 -7
@@ -76,17 +76,17 @@ var Utils = /*#__PURE__*/function () {
76
76
  seconds %= 3600 * 24;
77
77
  var hours = Math.floor(seconds / 3600);
78
78
  if (hours < 10) {
79
- hours = '0' + hours;
79
+ hours = "0".concat(hours);
80
80
  }
81
81
  seconds %= 3600;
82
82
  var minutes = Math.floor(seconds / 60);
83
83
  if (minutes < 10) {
84
- minutes = '0' + minutes;
84
+ minutes = "0".concat(minutes);
85
85
  }
86
86
  seconds %= 60;
87
87
  seconds = Math.floor(seconds);
88
88
  if (seconds < 10) {
89
- seconds = '0' + seconds;
89
+ seconds = "0".concat(seconds);
90
90
  }
91
91
  var text = '';
92
92
  if (days) {
@@ -210,10 +210,8 @@ var Utils = /*#__PURE__*/function () {
210
210
  if (settings[user].subOrder && settings[user].subOrder[forEnumId]) {
211
211
  return JSON.parse(JSON.stringify(settings[user].subOrder[forEnumId]));
212
212
  }
213
- } else {
214
- if (settings[user].order) {
215
- return JSON.parse(JSON.stringify(settings[user].order));
216
- }
213
+ } else if (settings[user].order) {
214
+ return JSON.parse(JSON.stringify(settings[user].order));
217
215
  }
218
216
  }
219
217
  }
@@ -240,10 +238,8 @@ var Utils = /*#__PURE__*/function () {
240
238
  if (settings[user].subURLs && settings[user].subURLs[forEnumId]) {
241
239
  return JSON.parse(JSON.stringify(settings[user].subURLs[forEnumId]));
242
240
  }
243
- } else {
244
- if (settings[user].URLs) {
245
- return JSON.parse(JSON.stringify(settings[user].URLs));
246
- }
241
+ } else if (settings[user].URLs) {
242
+ return JSON.parse(JSON.stringify(settings[user].URLs));
247
243
  }
248
244
  }
249
245
  }
@@ -266,15 +262,15 @@ var Utils = /*#__PURE__*/function () {
266
262
  result.splice(dest, 0, removed);
267
263
  return result;
268
264
  }
269
- }, {
270
- key: "getSettings",
271
- value:
265
+
272
266
  /**
273
267
  * @param {any} obj
274
268
  * @param {{ id: any; user: any; name: any; icon: any; color: any; language: ioBroker.Languages; }} options
275
269
  * @param {boolean} [defaultEnabling]
276
270
  */
277
- function getSettings(obj, options, defaultEnabling) {
271
+ }, {
272
+ key: "getSettings",
273
+ value: function getSettings(obj, options, defaultEnabling) {
278
274
  var settings;
279
275
  var id = obj && obj._id || options && options.id;
280
276
  if (obj && obj.hasOwnProperty('common')) {
@@ -295,9 +291,15 @@ var Utils = /*#__PURE__*/function () {
295
291
  settings.enabled = defaultEnabling === undefined ? true : defaultEnabling;
296
292
  }
297
293
  if (false && settings.useCommon) {
298
- if (obj.color) settings.color = obj.color;
299
- if (obj.icon) settings.icon = obj.icon;
300
- if (obj.name) settings.name = obj.name;
294
+ if (obj.color) {
295
+ settings.color = obj.color;
296
+ }
297
+ if (obj.icon) {
298
+ settings.icon = obj.icon;
299
+ }
300
+ if (obj.name) {
301
+ settings.name = obj.name;
302
+ }
301
303
  } else {
302
304
  if (options) {
303
305
  if (!settings.name && options.name) settings.name = options.name;
@@ -360,9 +362,8 @@ var Utils = /*#__PURE__*/function () {
360
362
  }
361
363
  }
362
364
  return true;
363
- } else {
364
- return false;
365
365
  }
366
+ return false;
366
367
  }
367
368
 
368
369
  /**
@@ -380,20 +381,20 @@ var Utils = /*#__PURE__*/function () {
380
381
  return /*#__PURE__*/_react["default"].createElement("span", {
381
382
  style: style || {}
382
383
  }, settings.icon);
383
- } else if (settings.icon.startsWith('data:image')) {
384
+ }
385
+ if (settings.icon.startsWith('data:image')) {
384
386
  return /*#__PURE__*/_react["default"].createElement("img", {
385
387
  alt: settings.name,
386
388
  src: settings.icon,
387
389
  style: style || {}
388
390
  });
389
- } else {
390
- // may be later some changes for second type
391
- return /*#__PURE__*/_react["default"].createElement("img", {
392
- alt: settings.name,
393
- src: (settings.prefix || '') + settings.icon,
394
- style: style || {}
395
- });
396
391
  }
392
+ // maybe later some changes for a second type
393
+ return /*#__PURE__*/_react["default"].createElement("img", {
394
+ alt: settings.name,
395
+ src: (settings.prefix || '') + settings.icon,
396
+ style: style || {}
397
+ });
397
398
  }
398
399
  return null;
399
400
  }
@@ -417,27 +418,26 @@ var Utils = /*#__PURE__*/function () {
417
418
  // If UTF-8 icon
418
419
  if (typeof icon === 'string' && icon.length <= 2) {
419
420
  return icon;
420
- } else if (icon.startsWith('data:image')) {
421
+ }
422
+ if (icon.startsWith('data:image')) {
421
423
  return icon;
424
+ }
425
+ var parts = id.split('.');
426
+ if (parts[0] === 'system') {
427
+ icon = "adapter/".concat(parts[2]).concat(icon.startsWith('/') ? '' : '/').concat(icon);
422
428
  } else {
423
- var parts = id.split('.');
424
- if (parts[0] === 'system') {
425
- icon = "adapter/".concat(parts[2]).concat(icon.startsWith('/') ? '' : '/').concat(icon);
426
- } else {
427
- icon = "adapter/".concat(parts[0]).concat(icon.startsWith('/') ? '' : '/').concat(icon);
428
- }
429
- if (window.location.pathname.match(/adapter\/[^/]+\/[^/]+\.html/)) {
430
- icon = "../../".concat(icon);
431
- } else if (window.location.pathname.match(/material\/[.\d]+/)) {
432
- icon = "../../".concat(icon);
433
- } else if (window.location.pathname.match(/material\//)) {
434
- icon = "../".concat(icon);
435
- }
436
- return icon;
429
+ icon = "adapter/".concat(parts[0]).concat(icon.startsWith('/') ? '' : '/').concat(icon);
437
430
  }
438
- } else {
439
- return null;
431
+ if (window.location.pathname.match(/adapter\/[^/]+\/[^/]+\.html/)) {
432
+ icon = "../../".concat(icon);
433
+ } else if (window.location.pathname.match(/material\/[.\d]+/)) {
434
+ icon = "../../".concat(icon);
435
+ } else if (window.location.pathname.match(/material\//)) {
436
+ icon = "../".concat(icon);
437
+ }
438
+ return icon;
440
439
  }
440
+ return null;
441
441
  }
442
442
 
443
443
  /**
@@ -479,9 +479,8 @@ var Utils = /*#__PURE__*/function () {
479
479
  }
480
480
  return '';
481
481
  }).join(' ');
482
- } else {
483
- return Utils.CapitalWords(text);
484
482
  }
483
+ return Utils.CapitalWords(text);
485
484
  }
486
485
 
487
486
  /**
@@ -528,29 +527,34 @@ var Utils = /*#__PURE__*/function () {
528
527
  // http://stackoverflow.com/a/3943023/112731
529
528
  return r * 0.299 + g * 0.587 + b * 0.114 <= 186;
530
529
  }
531
- }, {
532
- key: "getTimeString",
533
- value:
530
+
534
531
  /**
535
532
  * Get the time string in the format 00:00.
536
533
  * @param {string | number} seconds
537
534
  */
538
- function getTimeString(seconds) {
535
+ }, {
536
+ key: "getTimeString",
537
+ value: function getTimeString(seconds) {
539
538
  seconds = parseFloat(seconds);
540
- if (isNaN(seconds)) {
539
+ if (Number.isNaN(seconds)) {
541
540
  return '--:--';
542
541
  }
543
542
  var hours = Math.floor(seconds / 3600);
544
543
  var minutes = Math.floor(seconds % 3600 / 60);
545
544
  var secs = seconds % 60;
546
545
  if (hours) {
547
- if (minutes < 10) minutes = '0' + minutes;
548
- if (secs < 10) secs = '0' + secs;
549
- return hours + ':' + minutes + ':' + secs;
550
- } else {
551
- if (secs < 10) secs = '0' + secs;
552
- return minutes + ':' + secs;
546
+ if (minutes < 10) {
547
+ minutes = "0".concat(minutes);
548
+ }
549
+ if (secs < 10) {
550
+ secs = "0".concat(secs);
551
+ }
552
+ return "".concat(hours, ":").concat(minutes, ":").concat(secs);
553
+ }
554
+ if (secs < 10) {
555
+ secs = "0".concat(secs);
553
556
  }
557
+ return "".concat(minutes, ":").concat(secs);
554
558
  }
555
559
 
556
560
  /**
@@ -563,43 +567,58 @@ var Utils = /*#__PURE__*/function () {
563
567
  value: function getWindDirection(angle) {
564
568
  if (angle >= 0 && angle < 11.25) {
565
569
  return 'N';
566
- } else if (angle >= 11.25 && angle < 33.75) {
570
+ }
571
+ if (angle >= 11.25 && angle < 33.75) {
567
572
  return 'NNE';
568
- } else if (angle >= 33.75 && angle < 56.25) {
573
+ }
574
+ if (angle >= 33.75 && angle < 56.25) {
569
575
  return 'NE';
570
- } else if (angle >= 56.25 && angle < 78.75) {
576
+ }
577
+ if (angle >= 56.25 && angle < 78.75) {
571
578
  return 'ENE';
572
- } else if (angle >= 78.75 && angle < 101.25) {
579
+ }
580
+ if (angle >= 78.75 && angle < 101.25) {
573
581
  return 'E';
574
- } else if (angle >= 101.25 && angle < 123.75) {
582
+ }
583
+ if (angle >= 101.25 && angle < 123.75) {
575
584
  return 'ESE';
576
- } else if (angle >= 123.75 && angle < 146.25) {
585
+ }
586
+ if (angle >= 123.75 && angle < 146.25) {
577
587
  return 'SE';
578
- } else if (angle >= 146.25 && angle < 168.75) {
588
+ }
589
+ if (angle >= 146.25 && angle < 168.75) {
579
590
  return 'SSE';
580
- } else if (angle >= 168.75 && angle < 191.25) {
591
+ }
592
+ if (angle >= 168.75 && angle < 191.25) {
581
593
  return 'S';
582
- } else if (angle >= 191.25 && angle < 213.75) {
594
+ }
595
+ if (angle >= 191.25 && angle < 213.75) {
583
596
  return 'SSW';
584
- } else if (angle >= 213.75 && angle < 236.25) {
597
+ }
598
+ if (angle >= 213.75 && angle < 236.25) {
585
599
  return 'SW';
586
- } else if (angle >= 236.25 && angle < 258.75) {
600
+ }
601
+ if (angle >= 236.25 && angle < 258.75) {
587
602
  return 'WSW';
588
- } else if (angle >= 258.75 && angle < 281.25) {
603
+ }
604
+ if (angle >= 258.75 && angle < 281.25) {
589
605
  return 'W';
590
- } else if (angle >= 281.25 && angle < 303.75) {
606
+ }
607
+ if (angle >= 281.25 && angle < 303.75) {
591
608
  return 'WNW';
592
- } else if (angle >= 303.75 && angle < 326.25) {
609
+ }
610
+ if (angle >= 303.75 && angle < 326.25) {
593
611
  return 'NW';
594
- } else if (angle >= 326.25 && angle < 348.75) {
612
+ }
613
+ if (angle >= 326.25 && angle < 348.75) {
595
614
  return 'NNW';
596
- } else if (angle >= 348.75) {
597
- return 'N';
598
615
  }
616
+ // if (angle >= 348.75) {
617
+ return 'N';
599
618
  }
600
619
 
601
620
  /**
602
- * Pad the given number with a zero if its not 2 digits long.
621
+ * Pad the given number with a zero if it's not 2 digits long.
603
622
  * @param {string | number} num
604
623
  */
605
624
  }, {
@@ -607,15 +626,14 @@ var Utils = /*#__PURE__*/function () {
607
626
  value: function padding(num) {
608
627
  if (typeof num === 'string') {
609
628
  if (num.length < 2) {
610
- return '0' + num;
611
- } else {
612
- return num;
629
+ return "0".concat(num);
613
630
  }
614
- } else if (num < 10) {
615
- return '0' + num;
616
- } else {
617
631
  return num;
618
632
  }
633
+ if (num < 10) {
634
+ return "0".concat(num);
635
+ }
636
+ return num;
619
637
  }
620
638
 
621
639
  /**
@@ -644,7 +662,7 @@ var Utils = /*#__PURE__*/function () {
644
662
  if (!now) return '';
645
663
  // only letters
646
664
  if (now.match(/^[\w\s]+$/)) {
647
- // Day of week
665
+ // Day of the week
648
666
  return now;
649
667
  }
650
668
  var m = now.match(/(\d{1,4})[-./](\d{1,2})[-./](\d{1,4})/);
@@ -667,16 +685,15 @@ var Utils = /*#__PURE__*/function () {
667
685
  if (Math.abs(now.getTime - Date.now()) > 3600000 * 24 * 10) {
668
686
  now = new Date(year, a[1] - 1, a[0]);
669
687
  }
670
- } else
688
+ } else if (Utils.dateFormat[0][0] === 'D' && Utils.dateFormat[1][0] === 'M') {
671
689
  // DD MM
672
- if (Utils.dateFormat[0][0] === 'D' && Utils.dateFormat[1][0] === 'M') {
673
- now = new Date(year, a[1] - 1, a[0]);
674
- if (Math.abs(now.getTime - Date.now()) > 3600000 * 24 * 10) {
675
- now = new Date(year, a[0] - 1, a[1]);
676
- }
677
- } else {
678
- now = new Date(now);
690
+ now = new Date(year, a[1] - 1, a[0]);
691
+ if (Math.abs(now.getTime - Date.now()) > 3600000 * 24 * 10) {
692
+ now = new Date(year, a[0] - 1, a[1]);
679
693
  }
694
+ } else {
695
+ now = new Date(now);
696
+ }
680
697
  }
681
698
  } else {
682
699
  now = new Date(now);
@@ -684,8 +701,8 @@ var Utils = /*#__PURE__*/function () {
684
701
  } else {
685
702
  now = new Date(now);
686
703
  }
687
- var date = _i18n["default"].t('ra_dow_' + days[now.getDay()]).replace('ra_dow_', '');
688
- date += '. ' + now.getDate() + ' ' + _i18n["default"].t('ra_month_' + months[now.getMonth()]).replace('ra_month_', '');
704
+ var date = _i18n["default"].t("ra_dow_".concat(days[now.getDay()])).replace('ra_dow_', '');
705
+ date += ". ".concat(now.getDate(), " ").concat(_i18n["default"].t("ra_month_".concat(months[now.getMonth()])).replace('ra_month_', ''));
689
706
  return date;
690
707
  }
691
708
 
@@ -739,14 +756,13 @@ var Utils = /*#__PURE__*/function () {
739
756
  m = text && text.match(/<a [^<]+<\/a>|<br\/?>|<b>[^<]+<\/b>|<i>[^<]+<\/i>/);
740
757
  if (!m) {
741
758
  text && result.push( /*#__PURE__*/_react["default"].createElement("span", {
742
- key: 'a' + key++
759
+ key: "a".concat(key++)
743
760
  }, text));
744
761
  }
745
762
  } while (m);
746
763
  return result;
747
- } else {
748
- return text;
749
764
  }
765
+ return text;
750
766
  }
751
767
 
752
768
  /**
@@ -763,25 +779,21 @@ var Utils = /*#__PURE__*/function () {
763
779
  if (!noCommon) {
764
780
  if (!states.common) {
765
781
  return states.smartName;
766
- } else {
767
- if (states && !states.common) {
768
- return states.smartName;
769
- } else {
770
- return states.common.smartName;
771
- }
772
782
  }
773
- } else {
774
783
  if (states && !states.common) {
775
784
  return states.smartName;
776
- } else {
777
- return states && states.common && states.common.custom && states.common.custom[instanceId] ? states.common.custom[instanceId].smartName : undefined;
778
785
  }
786
+ return states.common.smartName;
787
+ }
788
+ if (states && !states.common) {
789
+ return states.smartName;
779
790
  }
780
- } else if (!noCommon) {
791
+ return states && states.common && states.common.custom && states.common.custom[instanceId] ? states.common.custom[instanceId].smartName : undefined;
792
+ }
793
+ if (!noCommon) {
781
794
  return states[id].common.smartName;
782
- } else {
783
- return states[id] && states[id].common && states[id].common.custom && states[id].common.custom[instanceId] ? states[id].common.custom[instanceId].smartName || null : null;
784
795
  }
796
+ return states[id] && states[id].common && states[id].common.custom && states[id].common.custom[instanceId] ? states[id].common.custom[instanceId].smartName || null : null;
785
797
  }
786
798
 
787
799
  /**
@@ -796,20 +808,16 @@ var Utils = /*#__PURE__*/function () {
796
808
  if (!noCommon) {
797
809
  if (!obj.common) {
798
810
  return obj.smartName;
799
- } else {
800
- if (obj && !obj.common) {
801
- return obj.smartName;
802
- } else {
803
- return obj.common.smartName;
804
- }
805
811
  }
806
- } else {
807
812
  if (obj && !obj.common) {
808
813
  return obj.smartName;
809
- } else {
810
- return obj && obj.common && obj.common.custom && obj.common.custom[instanceId] ? obj.common.custom[instanceId].smartName : undefined;
811
814
  }
815
+ return obj.common.smartName;
812
816
  }
817
+ if (obj && !obj.common) {
818
+ return obj.smartName;
819
+ }
820
+ return obj && obj.common && obj.common.custom && obj.common.custom[instanceId] ? obj.common.custom[instanceId].smartName : undefined;
813
821
  }
814
822
 
815
823
  /**
@@ -953,22 +961,20 @@ var Utils = /*#__PURE__*/function () {
953
961
  delete obj.common.custom[instanceId].uk;
954
962
  delete obj.common.custom[instanceId]['zh-cn'];
955
963
  }
964
+ } else if (obj.common.smartName.byON !== undefined) {
965
+ delete obj.common.smartName.en;
966
+ delete obj.common.smartName.de;
967
+ delete obj.common.smartName.ru;
968
+ delete obj.common.smartName.nl;
969
+ delete obj.common.smartName.pl;
970
+ delete obj.common.smartName.it;
971
+ delete obj.common.smartName.fr;
972
+ delete obj.common.smartName.pt;
973
+ delete obj.common.smartName.es;
974
+ delete obj.common.smartName.uk;
975
+ delete obj.common.smartName['zh-cn'];
956
976
  } else {
957
- if (obj.common.smartName.byON !== undefined) {
958
- delete obj.common.smartName.en;
959
- delete obj.common.smartName.de;
960
- delete obj.common.smartName.ru;
961
- delete obj.common.smartName.nl;
962
- delete obj.common.smartName.pl;
963
- delete obj.common.smartName.it;
964
- delete obj.common.smartName.fr;
965
- delete obj.common.smartName.pt;
966
- delete obj.common.smartName.es;
967
- delete obj.common.smartName.uk;
968
- delete obj.common.smartName['zh-cn'];
969
- } else {
970
- obj.common.smartName = null;
971
- }
977
+ obj.common.smartName = null;
972
978
  }
973
979
  }
974
980
  }
@@ -1017,9 +1023,8 @@ var Utils = /*#__PURE__*/function () {
1017
1023
  var pos = (fileName || '').lastIndexOf('.');
1018
1024
  if (pos !== -1) {
1019
1025
  return fileName.substring(pos + 1).toLowerCase();
1020
- } else {
1021
- return null;
1022
1026
  }
1027
+ return null;
1023
1028
  }
1024
1029
 
1025
1030
  /**
@@ -1032,40 +1037,39 @@ var Utils = /*#__PURE__*/function () {
1032
1037
  key: "formatBytes",
1033
1038
  value: function formatBytes(bytes) {
1034
1039
  if (Math.abs(bytes) < 1024) {
1035
- return bytes + ' B';
1040
+ return "".concat(bytes, " B");
1036
1041
  }
1037
1042
  var units = ['KB', 'MB', 'GB'];
1038
- //const units = ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
1043
+ // const units = ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
1039
1044
  var u = -1;
1040
1045
  do {
1041
1046
  bytes /= 1024;
1042
1047
  ++u;
1043
1048
  } while (Math.abs(bytes) >= 1024 && u < units.length - 1);
1044
- return bytes.toFixed(1) + ' ' + units[u];
1049
+ return "".concat(bytes.toFixed(1), " ").concat(units[u]);
1045
1050
  }
1046
1051
 
1047
1052
  /**
1048
- * Invert the given color according to theme type to get the inverted text color for background
1049
- * @param {string} color Color in the format '#rrggbb' or '#rgb' (or without hash)
1053
+ * Invert the given color according to a theme type to get the inverted text color for background
1054
+ * @param {string} color Color in the format '#rrggbb' or '#rgb' (or without a hash)
1050
1055
  * @param {string} themeType theme type
1051
1056
  * @param {string} invert dark theme has light color in control or light theme has light color in control
1052
- * @returns {string}
1057
+ * @returns {string | undefined}
1053
1058
  */
1054
1059
  }, {
1055
1060
  key: "getInvertedColor",
1056
1061
  value: function getInvertedColor(color, themeType, invert) {
1057
1062
  if (!color) {
1058
1063
  return undefined;
1059
- } else {
1060
- var invertedColor = Utils.invertColor(color, true);
1061
- if (invertedColor === '#FFFFFF' && (themeType === 'dark' || invert && themeType === 'light')) {
1062
- return '#DDD';
1063
- } else if (invertedColor === '#000000' && (themeType === 'light' || invert && themeType === 'dark')) {
1064
- return '#222';
1065
- } else {
1066
- return undefined;
1067
- }
1068
1064
  }
1065
+ var invertedColor = Utils.invertColor(color, true);
1066
+ if (invertedColor === '#FFFFFF' && (themeType === 'dark' || invert && themeType === 'light')) {
1067
+ return '#DDD';
1068
+ }
1069
+ if (invertedColor === '#000000' && (themeType === 'light' || invert && themeType === 'dark')) {
1070
+ return '#222';
1071
+ }
1072
+ return undefined;
1069
1073
  }
1070
1074
 
1071
1075
  // Big thanks to: https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color
@@ -1103,7 +1107,7 @@ var Utils = /*#__PURE__*/function () {
1103
1107
  alfa = hex.substring(6, 8);
1104
1108
  hex = hex.substring(0, 6);
1105
1109
  } else if (hex.length !== 6) {
1106
- console.warn('Cannot invert color: ' + hex);
1110
+ console.warn("Cannot invert color: ".concat(hex));
1107
1111
  return hex;
1108
1112
  }
1109
1113
  var r = parseInt(hex.slice(0, 2), 16);
@@ -1263,8 +1267,10 @@ var Utils = /*#__PURE__*/function () {
1263
1267
  var x;
1264
1268
  var str = '';
1265
1269
  while (i < arguments.length) {
1266
- if (tmp = arguments[i++]) {
1267
- if (x = Utils._toVal(tmp)) {
1270
+ tmp = arguments[i++];
1271
+ if (tmp) {
1272
+ x = Utils._toVal(tmp);
1273
+ if (x) {
1268
1274
  str && (str += ' ');
1269
1275
  str += x;
1270
1276
  }
@@ -1406,9 +1412,8 @@ var Utils = /*#__PURE__*/function () {
1406
1412
  if (p.length > 1) {
1407
1413
  p.pop();
1408
1414
  return p.join('.');
1409
- } else {
1410
- return null;
1411
1415
  }
1416
+ return null;
1412
1417
  }
1413
1418
  }, {
1414
1419
  key: "formatDate",
@@ -1421,44 +1426,44 @@ var Utils = /*#__PURE__*/function () {
1421
1426
  var text;
1422
1427
  var mm = dateObj.getMonth() + 1;
1423
1428
  if (mm < 10) {
1424
- mm = '0' + mm;
1429
+ mm = "0".concat(mm);
1425
1430
  }
1426
1431
  var dd = dateObj.getDate();
1427
1432
  if (dd < 10) {
1428
- dd = '0' + dd;
1433
+ dd = "0".concat(dd);
1429
1434
  }
1430
1435
  if (dateFormat === 'MM/DD/YYYY') {
1431
- text = mm + '/' + dd + '/' + dateObj.getFullYear();
1436
+ text = "".concat(mm, "/").concat(dd, "/").concat(dateObj.getFullYear());
1432
1437
  } else {
1433
- text = dateObj.getFullYear() + '-' + mm + '-' + dd;
1438
+ text = "".concat(dateObj.getFullYear(), "-").concat(mm, "-").concat(dd);
1434
1439
  }
1435
1440
 
1436
1441
  // time
1437
1442
  var v = dateObj.getHours();
1438
1443
  if (v < 10) {
1439
- text += ' 0' + v;
1444
+ text += " 0".concat(v);
1440
1445
  } else {
1441
- text += ' ' + v;
1446
+ text += " ".concat(v);
1442
1447
  }
1443
1448
  v = dateObj.getMinutes();
1444
1449
  if (v < 10) {
1445
- text += ':0' + v;
1450
+ text += ":0".concat(v);
1446
1451
  } else {
1447
- text += ':' + v;
1452
+ text += ":".concat(v);
1448
1453
  }
1449
1454
  v = dateObj.getSeconds();
1450
1455
  if (v < 10) {
1451
- text += ':0' + v;
1456
+ text += ":0".concat(v);
1452
1457
  } else {
1453
- text += ':' + v;
1458
+ text += ":".concat(v);
1454
1459
  }
1455
1460
  v = dateObj.getMilliseconds();
1456
1461
  if (v < 10) {
1457
- text += '.00' + v;
1462
+ text += ".00".concat(v);
1458
1463
  } else if (v < 100) {
1459
- text += '.0' + v;
1464
+ text += ".0".concat(v);
1460
1465
  } else {
1461
- text += '.' + v;
1466
+ text += ".".concat(v);
1462
1467
  }
1463
1468
  return text;
1464
1469
  }
@@ -1473,11 +1478,11 @@ var Utils = /*#__PURE__*/function () {
1473
1478
  var s = seconds % 60;
1474
1479
  if (d) {
1475
1480
  return "".concat(d, ".").concat(h.toString().padStart(2, '0'), ":").concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1476
- } else if (h) {
1481
+ }
1482
+ if (h) {
1477
1483
  return "".concat(h, ":").concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1478
- } else {
1479
- return "0:".concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1480
1484
  }
1485
+ return "0:".concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1481
1486
  } else {
1482
1487
  return '0:00:00';
1483
1488
  }
@@ -1519,9 +1524,8 @@ var Utils = /*#__PURE__*/function () {
1519
1524
  }
1520
1525
  }
1521
1526
  return '';
1522
- } else {
1523
- return header.title;
1524
1527
  }
1528
+ return header.title;
1525
1529
  }
1526
1530
  }, {
1527
1531
  key: "MDextractHeader",
@@ -1581,7 +1585,7 @@ var Utils = /*#__PURE__*/function () {
1581
1585
  key: "generateFile",
1582
1586
  value: function generateFile(filename, json) {
1583
1587
  var el = document.createElement('a');
1584
- el.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(json, null, 2)));
1588
+ el.setAttribute('href', "data:application/json;charset=utf-8,".concat(encodeURIComponent(JSON.stringify(json, null, 2))));
1585
1589
  el.setAttribute('download', filename);
1586
1590
  el.style.display = 'none';
1587
1591
  document.body.appendChild(el);
@@ -1592,7 +1596,7 @@ var Utils = /*#__PURE__*/function () {
1592
1596
  /**
1593
1597
  * Convert quality code into text
1594
1598
  * @param {number} quality code
1595
- * @returns {array<string>} lines that decode qulity
1599
+ * @returns {array<string>} lines that decode quality
1596
1600
  */
1597
1601
  }, {
1598
1602
  key: "quality2text",
@@ -1603,14 +1607,14 @@ var Utils = /*#__PURE__*/function () {
1603
1607
  if (text) {
1604
1608
  result = [text];
1605
1609
  } else if (quality & 0x01) {
1606
- result = [QUALITY_BITS[0x01], '0x' + (quality & (0xFFFF & ~1)).toString(16)];
1610
+ result = [QUALITY_BITS[0x01], "0x".concat((quality & (0xFFFF & ~1)).toString(16))];
1607
1611
  } else if (quality & 0x02) {
1608
- result = [QUALITY_BITS[0x02], '0x' + (quality & (0xFFFF & ~2)).toString(16)];
1612
+ result = [QUALITY_BITS[0x02], "0x".concat((quality & (0xFFFF & ~2)).toString(16))];
1609
1613
  } else {
1610
- result = ['0x' + quality.toString(16)];
1614
+ result = ["0x".concat(quality.toString(16))];
1611
1615
  }
1612
1616
  if (custom) {
1613
- result.push('0x' + (custom >> 16).toString(16).toUpperCase());
1617
+ result.push("0x".concat((custom >> 16).toString(16).toUpperCase()));
1614
1618
  }
1615
1619
  return result;
1616
1620
  }
@@ -1644,31 +1648,30 @@ var Utils = /*#__PURE__*/function () {
1644
1648
  console.error("Cannot parse states: ".concat(states));
1645
1649
  states = null;
1646
1650
  }
1647
- } else
1651
+ } else if (typeof states === 'string') {
1648
1652
  // if old format val1:text1;val2:text2
1649
- if (typeof states === 'string') {
1650
- var parts = states.split(';');
1651
- states = {};
1652
- for (var p = 0; p < parts.length; p++) {
1653
- var s = parts[p].split(':');
1654
- states[s[0]] = s[1];
1655
- }
1656
- } else if (Array.isArray(states)) {
1657
- var result = {};
1658
- if (obj.common.type === 'number') {
1659
- states.forEach(function (value, key) {
1660
- return result[key] = value;
1661
- });
1662
- } else if (obj.common.type === 'string') {
1663
- states.forEach(function (value) {
1664
- return result[value] = value;
1665
- });
1666
- } else if (obj.common.type === 'boolean') {
1667
- result['false'] = states[0];
1668
- result['true'] = states[1];
1669
- }
1670
- return result;
1653
+ var parts = states.split(';');
1654
+ states = {};
1655
+ for (var p = 0; p < parts.length; p++) {
1656
+ var s = parts[p].split(':');
1657
+ states[s[0]] = s[1];
1658
+ }
1659
+ } else if (Array.isArray(states)) {
1660
+ var result = {};
1661
+ if (obj.common.type === 'number') {
1662
+ states.forEach(function (value, key) {
1663
+ return result[key] = value;
1664
+ });
1665
+ } else if (obj.common.type === 'string') {
1666
+ states.forEach(function (value) {
1667
+ return result[value] = value;
1668
+ });
1669
+ } else if (obj.common.type === 'boolean') {
1670
+ result["false"] = states[0];
1671
+ result["true"] = states[1];
1671
1672
  }
1673
+ return result;
1674
+ }
1672
1675
  }
1673
1676
  return states;
1674
1677
  }
@@ -1696,7 +1699,7 @@ var Utils = /*#__PURE__*/function () {
1696
1699
  }
1697
1700
 
1698
1701
  /**
1699
- * Detect file xtension by its content
1702
+ * Detect file extension by its content
1700
1703
  * @param {string} base64 Base64 encoded binary file
1701
1704
  * @returns {string} Detected extension, like 'jpg'
1702
1705
  */
@@ -1708,6 +1711,20 @@ var Utils = /*#__PURE__*/function () {
1708
1711
  });
1709
1712
  return signature ? SIGNATURES[signature] : null;
1710
1713
  }
1714
+
1715
+ /**
1716
+ * Check if configured repository is the stable repository
1717
+ *
1718
+ * @param {string | string[]} activeRepo current configured repository or multi repository
1719
+ * @return {boolean}
1720
+ */
1721
+ }, {
1722
+ key: "isStableRepository",
1723
+ value: function isStableRepository(activeRepo) {
1724
+ return !!(typeof activeRepo === 'string' && activeRepo.toLowerCase().startsWith('stable') || activeRepo && typeof activeRepo !== 'string' && activeRepo.find(function (r) {
1725
+ return r.toLowerCase().startsWith('stable');
1726
+ }));
1727
+ }
1711
1728
  }]);
1712
1729
  return Utils;
1713
1730
  }();