@iobroker/adapter-react-v5 4.3.0 → 4.3.2

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 (140) 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 +21 -23
  8. package/Components/ComplexCron.js.map +1 -1
  9. package/Components/FileBrowser.js +3 -2
  10. package/Components/FileBrowser.js.map +1 -1
  11. package/Components/FileViewer.d.ts +0 -2
  12. package/Components/FileViewer.js +16 -18
  13. package/Components/FileViewer.js.map +1 -1
  14. package/Components/Icon.d.ts +0 -2
  15. package/Components/Icon.js +27 -29
  16. package/Components/Icon.js.map +1 -1
  17. package/Components/IconPicker.js +2 -2
  18. package/Components/IconPicker.js.map +1 -1
  19. package/Components/IconSelector.js +1817 -1819
  20. package/Components/IconSelector.js.map +1 -1
  21. package/Components/Image.js +18 -17
  22. package/Components/Image.js.map +1 -1
  23. package/Components/Loader.js +8 -8
  24. package/Components/Loader.js.map +1 -1
  25. package/Components/Loaders/PT.js +2 -2
  26. package/Components/Loaders/PT.js.map +1 -1
  27. package/Components/Loaders/Vendor.d.ts +0 -7
  28. package/Components/Loaders/Vendor.js +1 -4
  29. package/Components/Loaders/Vendor.js.map +1 -1
  30. package/Components/Logo.js +6 -6
  31. package/Components/Logo.js.map +1 -1
  32. package/Components/MDUtils.js +1 -2
  33. package/Components/MDUtils.js.map +1 -1
  34. package/Components/ObjectBrowser.d.ts +8 -6
  35. package/Components/ObjectBrowser.js +87 -62
  36. package/Components/ObjectBrowser.js.map +1 -1
  37. package/Components/Router.js.map +1 -1
  38. package/Components/SaveCloseButtons.d.ts +0 -1
  39. package/Components/SaveCloseButtons.js +6 -4
  40. package/Components/SaveCloseButtons.js.map +1 -1
  41. package/Components/Schedule.d.ts +1 -1
  42. package/Components/Schedule.js +36 -33
  43. package/Components/Schedule.js.map +1 -1
  44. package/Components/SelectWithIcon.d.ts +1 -1
  45. package/Components/SelectWithIcon.js +12 -11
  46. package/Components/SelectWithIcon.js.map +1 -1
  47. package/Components/SimpleCron/cron2text.js +71 -74
  48. package/Components/SimpleCron/cron2text.js.map +1 -1
  49. package/Components/SimpleCron/cronText.js +1 -1
  50. package/Components/SimpleCron/cronText.js.map +1 -1
  51. package/Components/SimpleCron/index.d.ts +1 -1
  52. package/Components/SimpleCron/index.js +3 -4
  53. package/Components/SimpleCron/index.js.map +1 -1
  54. package/Components/SimpleCron/jquery.cron.locale.js +77 -74
  55. package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
  56. package/Components/TabContainer.js +3 -3
  57. package/Components/TabContainer.js.map +1 -1
  58. package/Components/TabContent.js +3 -3
  59. package/Components/TabContent.js.map +1 -1
  60. package/Components/TabHeader.js.map +1 -1
  61. package/Components/TextWithIcon.js +6 -3
  62. package/Components/TextWithIcon.js.map +1 -1
  63. package/Components/ToggleThemeMenu.d.ts +1 -1
  64. package/Components/ToggleThemeMenu.js.map +1 -1
  65. package/Components/TreeTable.js +142 -153
  66. package/Components/TreeTable.js.map +1 -1
  67. package/Components/Utils.d.ts +1 -1
  68. package/Components/Utils.js +164 -167
  69. package/Components/Utils.js.map +1 -1
  70. package/Components/copy-to-clipboard.js +8 -9
  71. package/Components/copy-to-clipboard.js.map +1 -1
  72. package/Components/withWidth.js.map +1 -1
  73. package/Connection.js.map +1 -1
  74. package/Dialogs/ComplexCron.d.ts +1 -3
  75. package/Dialogs/ComplexCron.js +2 -4
  76. package/Dialogs/ComplexCron.js.map +1 -1
  77. package/Dialogs/Confirm.d.ts +1 -1
  78. package/Dialogs/Confirm.js +2 -2
  79. package/Dialogs/Confirm.js.map +1 -1
  80. package/Dialogs/Cron.d.ts +1 -2
  81. package/Dialogs/Cron.js +10 -17
  82. package/Dialogs/Cron.js.map +1 -1
  83. package/Dialogs/Error.d.ts +0 -1
  84. package/Dialogs/Error.js +10 -28
  85. package/Dialogs/Error.js.map +1 -1
  86. package/Dialogs/Message.js.map +1 -1
  87. package/Dialogs/SelectFile.js +2 -2
  88. package/Dialogs/SelectFile.js.map +1 -1
  89. package/Dialogs/SelectID.d.ts +0 -4
  90. package/Dialogs/SelectID.js +3 -7
  91. package/Dialogs/SelectID.js.map +1 -1
  92. package/Dialogs/SimpleCron.d.ts +1 -3
  93. package/Dialogs/SimpleCron.js +3 -5
  94. package/Dialogs/SimpleCron.js.map +1 -1
  95. package/Dialogs/TextInput.d.ts +0 -1
  96. package/Dialogs/TextInput.js +9 -17
  97. package/Dialogs/TextInput.js.map +1 -1
  98. package/GenericApp.js +39 -42
  99. package/GenericApp.js.map +1 -1
  100. package/LegacyConnection.d.ts +6 -6
  101. package/LegacyConnection.js +61 -63
  102. package/LegacyConnection.js.map +1 -1
  103. package/Prompt.js.map +1 -1
  104. package/README.md +13 -10
  105. package/Theme.js +1 -1
  106. package/Theme.js.map +1 -1
  107. package/assets/devices/parseNames.js +1 -1
  108. package/assets/rooms/parseNames.js +1 -1
  109. package/i18n/de.json +4 -1
  110. package/i18n/en.json +4 -1
  111. package/i18n/es.json +4 -1
  112. package/i18n/fr.json +4 -1
  113. package/i18n/it.json +4 -1
  114. package/i18n/nl.json +4 -1
  115. package/i18n/pl.json +4 -1
  116. package/i18n/pt.json +4 -1
  117. package/i18n/ru.json +4 -1
  118. package/i18n/uk.json +4 -1
  119. package/i18n/zh-cn.json +4 -1
  120. package/i18n.d.ts +1 -1
  121. package/i18n.js +20 -18
  122. package/i18n.js.map +1 -1
  123. package/icons/IconAdapter.js.map +1 -1
  124. package/icons/IconAlias.js.map +1 -1
  125. package/icons/IconChannel.js.map +1 -1
  126. package/icons/IconClearFilter.js.map +1 -1
  127. package/icons/IconClosed.js.map +1 -1
  128. package/icons/IconCopy.js.map +1 -1
  129. package/icons/IconDevice.js.map +1 -1
  130. package/icons/IconDocument.js.map +1 -1
  131. package/icons/IconDocumentReadOnly.js.map +1 -1
  132. package/icons/IconExpert.js.map +1 -1
  133. package/icons/IconFx.js.map +1 -1
  134. package/icons/IconInstance.js.map +1 -1
  135. package/icons/IconLogout.js.map +1 -1
  136. package/icons/IconNoIcon.js.map +1 -1
  137. package/icons/IconOpen.js.map +1 -1
  138. package/icons/IconState.js.map +1 -1
  139. package/index.js +0 -1
  140. package/package.json +7 -7
@@ -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
- // maybe later some changes for a 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,16 +527,16 @@ 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);
@@ -551,12 +550,11 @@ var Utils = /*#__PURE__*/function () {
551
550
  secs = "0".concat(secs);
552
551
  }
553
552
  return "".concat(hours, ":").concat(minutes, ":").concat(secs);
554
- } else {
555
- if (secs < 10) {
556
- secs = "0".concat(secs);
557
- }
558
- return "".concat(minutes, ":").concat(secs);
559
553
  }
554
+ if (secs < 10) {
555
+ secs = "0".concat(secs);
556
+ }
557
+ return "".concat(minutes, ":").concat(secs);
560
558
  }
561
559
 
562
560
  /**
@@ -569,43 +567,58 @@ var Utils = /*#__PURE__*/function () {
569
567
  value: function getWindDirection(angle) {
570
568
  if (angle >= 0 && angle < 11.25) {
571
569
  return 'N';
572
- } else if (angle >= 11.25 && angle < 33.75) {
570
+ }
571
+ if (angle >= 11.25 && angle < 33.75) {
573
572
  return 'NNE';
574
- } else if (angle >= 33.75 && angle < 56.25) {
573
+ }
574
+ if (angle >= 33.75 && angle < 56.25) {
575
575
  return 'NE';
576
- } else if (angle >= 56.25 && angle < 78.75) {
576
+ }
577
+ if (angle >= 56.25 && angle < 78.75) {
577
578
  return 'ENE';
578
- } else if (angle >= 78.75 && angle < 101.25) {
579
+ }
580
+ if (angle >= 78.75 && angle < 101.25) {
579
581
  return 'E';
580
- } else if (angle >= 101.25 && angle < 123.75) {
582
+ }
583
+ if (angle >= 101.25 && angle < 123.75) {
581
584
  return 'ESE';
582
- } else if (angle >= 123.75 && angle < 146.25) {
585
+ }
586
+ if (angle >= 123.75 && angle < 146.25) {
583
587
  return 'SE';
584
- } else if (angle >= 146.25 && angle < 168.75) {
588
+ }
589
+ if (angle >= 146.25 && angle < 168.75) {
585
590
  return 'SSE';
586
- } else if (angle >= 168.75 && angle < 191.25) {
591
+ }
592
+ if (angle >= 168.75 && angle < 191.25) {
587
593
  return 'S';
588
- } else if (angle >= 191.25 && angle < 213.75) {
594
+ }
595
+ if (angle >= 191.25 && angle < 213.75) {
589
596
  return 'SSW';
590
- } else if (angle >= 213.75 && angle < 236.25) {
597
+ }
598
+ if (angle >= 213.75 && angle < 236.25) {
591
599
  return 'SW';
592
- } else if (angle >= 236.25 && angle < 258.75) {
600
+ }
601
+ if (angle >= 236.25 && angle < 258.75) {
593
602
  return 'WSW';
594
- } else if (angle >= 258.75 && angle < 281.25) {
603
+ }
604
+ if (angle >= 258.75 && angle < 281.25) {
595
605
  return 'W';
596
- } else if (angle >= 281.25 && angle < 303.75) {
606
+ }
607
+ if (angle >= 281.25 && angle < 303.75) {
597
608
  return 'WNW';
598
- } else if (angle >= 303.75 && angle < 326.25) {
609
+ }
610
+ if (angle >= 303.75 && angle < 326.25) {
599
611
  return 'NW';
600
- } else if (angle >= 326.25 && angle < 348.75) {
612
+ }
613
+ if (angle >= 326.25 && angle < 348.75) {
601
614
  return 'NNW';
602
- } else if (angle >= 348.75) {
603
- return 'N';
604
615
  }
616
+ // if (angle >= 348.75) {
617
+ return 'N';
605
618
  }
606
619
 
607
620
  /**
608
- * 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.
609
622
  * @param {string | number} num
610
623
  */
611
624
  }, {
@@ -614,14 +627,13 @@ var Utils = /*#__PURE__*/function () {
614
627
  if (typeof num === 'string') {
615
628
  if (num.length < 2) {
616
629
  return "0".concat(num);
617
- } else {
618
- return num;
619
630
  }
620
- } else if (num < 10) {
621
- return "0".concat(num);
622
- } else {
623
631
  return num;
624
632
  }
633
+ if (num < 10) {
634
+ return "0".concat(num);
635
+ }
636
+ return num;
625
637
  }
626
638
 
627
639
  /**
@@ -673,16 +685,15 @@ var Utils = /*#__PURE__*/function () {
673
685
  if (Math.abs(now.getTime - Date.now()) > 3600000 * 24 * 10) {
674
686
  now = new Date(year, a[1] - 1, a[0]);
675
687
  }
676
- } else
688
+ } else if (Utils.dateFormat[0][0] === 'D' && Utils.dateFormat[1][0] === 'M') {
677
689
  // DD MM
678
- if (Utils.dateFormat[0][0] === 'D' && Utils.dateFormat[1][0] === 'M') {
679
- now = new Date(year, a[1] - 1, a[0]);
680
- if (Math.abs(now.getTime - Date.now()) > 3600000 * 24 * 10) {
681
- now = new Date(year, a[0] - 1, a[1]);
682
- }
683
- } else {
684
- 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]);
685
693
  }
694
+ } else {
695
+ now = new Date(now);
696
+ }
686
697
  }
687
698
  } else {
688
699
  now = new Date(now);
@@ -750,9 +761,8 @@ var Utils = /*#__PURE__*/function () {
750
761
  }
751
762
  } while (m);
752
763
  return result;
753
- } else {
754
- return text;
755
764
  }
765
+ return text;
756
766
  }
757
767
 
758
768
  /**
@@ -769,25 +779,21 @@ var Utils = /*#__PURE__*/function () {
769
779
  if (!noCommon) {
770
780
  if (!states.common) {
771
781
  return states.smartName;
772
- } else {
773
- if (states && !states.common) {
774
- return states.smartName;
775
- } else {
776
- return states.common.smartName;
777
- }
778
782
  }
779
- } else {
780
783
  if (states && !states.common) {
781
784
  return states.smartName;
782
- } else {
783
- return states && states.common && states.common.custom && states.common.custom[instanceId] ? states.common.custom[instanceId].smartName : undefined;
784
785
  }
786
+ return states.common.smartName;
787
+ }
788
+ if (states && !states.common) {
789
+ return states.smartName;
785
790
  }
786
- } 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) {
787
794
  return states[id].common.smartName;
788
- } else {
789
- return states[id] && states[id].common && states[id].common.custom && states[id].common.custom[instanceId] ? states[id].common.custom[instanceId].smartName || null : null;
790
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;
791
797
  }
792
798
 
793
799
  /**
@@ -802,20 +808,16 @@ var Utils = /*#__PURE__*/function () {
802
808
  if (!noCommon) {
803
809
  if (!obj.common) {
804
810
  return obj.smartName;
805
- } else {
806
- if (obj && !obj.common) {
807
- return obj.smartName;
808
- } else {
809
- return obj.common.smartName;
810
- }
811
811
  }
812
- } else {
813
812
  if (obj && !obj.common) {
814
813
  return obj.smartName;
815
- } else {
816
- return obj && obj.common && obj.common.custom && obj.common.custom[instanceId] ? obj.common.custom[instanceId].smartName : undefined;
817
814
  }
815
+ return obj.common.smartName;
818
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;
819
821
  }
820
822
 
821
823
  /**
@@ -959,22 +961,20 @@ var Utils = /*#__PURE__*/function () {
959
961
  delete obj.common.custom[instanceId].uk;
960
962
  delete obj.common.custom[instanceId]['zh-cn'];
961
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'];
962
976
  } else {
963
- if (obj.common.smartName.byON !== undefined) {
964
- delete obj.common.smartName.en;
965
- delete obj.common.smartName.de;
966
- delete obj.common.smartName.ru;
967
- delete obj.common.smartName.nl;
968
- delete obj.common.smartName.pl;
969
- delete obj.common.smartName.it;
970
- delete obj.common.smartName.fr;
971
- delete obj.common.smartName.pt;
972
- delete obj.common.smartName.es;
973
- delete obj.common.smartName.uk;
974
- delete obj.common.smartName['zh-cn'];
975
- } else {
976
- obj.common.smartName = null;
977
- }
977
+ obj.common.smartName = null;
978
978
  }
979
979
  }
980
980
  }
@@ -1023,9 +1023,8 @@ var Utils = /*#__PURE__*/function () {
1023
1023
  var pos = (fileName || '').lastIndexOf('.');
1024
1024
  if (pos !== -1) {
1025
1025
  return fileName.substring(pos + 1).toLowerCase();
1026
- } else {
1027
- return null;
1028
1026
  }
1027
+ return null;
1029
1028
  }
1030
1029
 
1031
1030
  /**
@@ -1041,7 +1040,7 @@ var Utils = /*#__PURE__*/function () {
1041
1040
  return "".concat(bytes, " B");
1042
1041
  }
1043
1042
  var units = ['KB', 'MB', 'GB'];
1044
- //const units = ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
1043
+ // const units = ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
1045
1044
  var u = -1;
1046
1045
  do {
1047
1046
  bytes /= 1024;
@@ -1062,16 +1061,15 @@ var Utils = /*#__PURE__*/function () {
1062
1061
  value: function getInvertedColor(color, themeType, invert) {
1063
1062
  if (!color) {
1064
1063
  return undefined;
1065
- } else {
1066
- var invertedColor = Utils.invertColor(color, true);
1067
- if (invertedColor === '#FFFFFF' && (themeType === 'dark' || invert && themeType === 'light')) {
1068
- return '#DDD';
1069
- } else if (invertedColor === '#000000' && (themeType === 'light' || invert && themeType === 'dark')) {
1070
- return '#222';
1071
- } else {
1072
- return undefined;
1073
- }
1074
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;
1075
1073
  }
1076
1074
 
1077
1075
  // Big thanks to: https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color
@@ -1269,8 +1267,10 @@ var Utils = /*#__PURE__*/function () {
1269
1267
  var x;
1270
1268
  var str = '';
1271
1269
  while (i < arguments.length) {
1272
- if (tmp = arguments[i++]) {
1273
- if (x = Utils._toVal(tmp)) {
1270
+ tmp = arguments[i++];
1271
+ if (tmp) {
1272
+ x = Utils._toVal(tmp);
1273
+ if (x) {
1274
1274
  str && (str += ' ');
1275
1275
  str += x;
1276
1276
  }
@@ -1412,9 +1412,8 @@ var Utils = /*#__PURE__*/function () {
1412
1412
  if (p.length > 1) {
1413
1413
  p.pop();
1414
1414
  return p.join('.');
1415
- } else {
1416
- return null;
1417
1415
  }
1416
+ return null;
1418
1417
  }
1419
1418
  }, {
1420
1419
  key: "formatDate",
@@ -1479,11 +1478,11 @@ var Utils = /*#__PURE__*/function () {
1479
1478
  var s = seconds % 60;
1480
1479
  if (d) {
1481
1480
  return "".concat(d, ".").concat(h.toString().padStart(2, '0'), ":").concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1482
- } else if (h) {
1481
+ }
1482
+ if (h) {
1483
1483
  return "".concat(h, ":").concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1484
- } else {
1485
- return "0:".concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1486
1484
  }
1485
+ return "0:".concat(m.toString().padStart(2, '0'), ":").concat(s.toString().padStart(2, '0'));
1487
1486
  } else {
1488
1487
  return '0:00:00';
1489
1488
  }
@@ -1525,9 +1524,8 @@ var Utils = /*#__PURE__*/function () {
1525
1524
  }
1526
1525
  }
1527
1526
  return '';
1528
- } else {
1529
- return header.title;
1530
1527
  }
1528
+ return header.title;
1531
1529
  }
1532
1530
  }, {
1533
1531
  key: "MDextractHeader",
@@ -1650,31 +1648,30 @@ var Utils = /*#__PURE__*/function () {
1650
1648
  console.error("Cannot parse states: ".concat(states));
1651
1649
  states = null;
1652
1650
  }
1653
- } else
1651
+ } else if (typeof states === 'string') {
1654
1652
  // if old format val1:text1;val2:text2
1655
- if (typeof states === 'string') {
1656
- var parts = states.split(';');
1657
- states = {};
1658
- for (var p = 0; p < parts.length; p++) {
1659
- var s = parts[p].split(':');
1660
- states[s[0]] = s[1];
1661
- }
1662
- } else if (Array.isArray(states)) {
1663
- var result = {};
1664
- if (obj.common.type === 'number') {
1665
- states.forEach(function (value, key) {
1666
- return result[key] = value;
1667
- });
1668
- } else if (obj.common.type === 'string') {
1669
- states.forEach(function (value) {
1670
- return result[value] = value;
1671
- });
1672
- } else if (obj.common.type === 'boolean') {
1673
- result['false'] = states[0];
1674
- result['true'] = states[1];
1675
- }
1676
- 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];
1677
1672
  }
1673
+ return result;
1674
+ }
1678
1675
  }
1679
1676
  return states;
1680
1677
  }