@iobroker/adapter-react-v5 3.1.3 → 3.1.4

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 (69) hide show
  1. package/Components/FileBrowser.js +277 -237
  2. package/Components/FileBrowser.js.map +1 -1
  3. package/Components/FileViewer.js +3 -1
  4. package/Components/FileViewer.js.map +1 -1
  5. package/Components/JsonConfigComponent/ConfigAutocomplete.js +5 -3
  6. package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
  7. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +5 -3
  8. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  9. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +16 -2
  10. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
  11. package/Components/JsonConfigComponent/ConfigCustom.js +148 -25
  12. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
  13. package/Components/JsonConfigComponent/ConfigGeneric.js +105 -20
  14. package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  15. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +132 -46
  16. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  17. package/Components/JsonConfigComponent/ConfigLanguage.js +25 -1
  18. package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  19. package/Components/JsonConfigComponent/ConfigNumber.js +5 -4
  20. package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
  21. package/Components/JsonConfigComponent/ConfigObjectId.js +3 -2
  22. package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
  23. package/Components/JsonConfigComponent/ConfigPanel.js +51 -40
  24. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  25. package/Components/JsonConfigComponent/ConfigPattern.js +1 -1
  26. package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
  27. package/Components/JsonConfigComponent/ConfigSelect.js +4 -2
  28. package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
  29. package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
  30. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  31. package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
  32. package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
  33. package/Components/JsonConfigComponent/ConfigStaticHeader.js +31 -8
  34. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
  35. package/Components/JsonConfigComponent/ConfigStaticImage.js +1 -1
  36. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
  37. package/Components/JsonConfigComponent/ConfigTable.js +1 -1
  38. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  39. package/Components/JsonConfigComponent/ConfigTabs.js +12 -3
  40. package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
  41. package/Components/JsonConfigComponent/ConfigText.js +4 -2
  42. package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
  43. package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
  44. package/Components/JsonConfigComponent/index.js +12 -4
  45. package/Components/JsonConfigComponent/index.js.map +1 -1
  46. package/Components/ObjectBrowser.js +228 -222
  47. package/Components/ObjectBrowser.js.map +1 -1
  48. package/Components/TableResize.js +34 -16
  49. package/Components/TableResize.js.map +1 -1
  50. package/Components/TreeTable.js +2 -2
  51. package/Components/TreeTable.js.map +1 -1
  52. package/Components/Utils.js +5 -5
  53. package/Components/Utils.js.map +1 -1
  54. package/Dialogs/Confirm.js +3 -3
  55. package/Dialogs/Confirm.js.map +1 -1
  56. package/Dialogs/FileSelect.js +259 -0
  57. package/Dialogs/FileSelect.js.map +1 -0
  58. package/Dialogs/SelectID.js +15 -16
  59. package/Dialogs/SelectID.js.map +1 -1
  60. package/README.md +3 -0
  61. package/package.json +1 -1
  62. package/GenericApp.js +0 -1025
  63. package/GenericApp.js.map +0 -1
  64. package/Prompt.js +0 -21
  65. package/Prompt.js.map +0 -1
  66. package/Theme.js +0 -422
  67. package/Theme.js.map +0 -1
  68. package/i18n.js +0 -180
  69. package/i18n.js.map +0 -1
package/i18n.js DELETED
@@ -1,180 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- /***
17
- * Copyright 2018-2022 bluefox <dogafox@gmail.com>
18
- *
19
- * MIT License
20
- *
21
- ***/
22
-
23
- /**
24
- * Translation string management.
25
- */
26
- var I18n = /*#__PURE__*/function () {
27
- function I18n() {
28
- (0, _classCallCheck2["default"])(this, I18n);
29
- }
30
-
31
- (0, _createClass2["default"])(I18n, null, [{
32
- key: "setLanguage",
33
- value:
34
- /**
35
- * List of all languages with their translations.
36
- * @type {{ [lang in ioBroker.Languages]?: Record<string, string>; }}
37
- */
38
-
39
- /**
40
- * The currently displayed language.
41
- * @type {ioBroker.Languages}
42
- */
43
-
44
- /**
45
- * Set the language to display.
46
- * @param {ioBroker.Languages} lang
47
- */
48
- function setLanguage(lang) {
49
- if (lang) {
50
- I18n.lang = lang;
51
- }
52
- }
53
- /**
54
- * Add translations
55
- * User can provide two types of structures:
56
- * - {"word1": "translated word1", "word2": "translated word2"}, but in this case the lang must be provided
57
- * - {"word1": {"en": "translated en word1", "de": "translated de word1"}, "word2": {"en": "translated en word2", "de": "translated de word2"}}, but no lang must be provided
58
- * @param {object} words additional words for specific language
59
- * @param {ioBroker.Languages} lang
60
- */
61
-
62
- }, {
63
- key: "extendTranslations",
64
- value: function extendTranslations(words, lang) {
65
- try {
66
- if (!lang) {
67
- Object.keys(words).forEach(function (word) {
68
- Object.keys(words[word]).forEach(function (lang) {
69
- if (!I18n.translations[lang]) {
70
- console.warn("Used unknown language: ".concat(lang));
71
- }
72
-
73
- if (!I18n.translations[lang][word]) {
74
- I18n.translations[lang][word] = words[word][lang];
75
- } else if (I18n.translations[lang][word] !== words[word][lang]) {
76
- console.warn("Translation for word \"".concat(word, "\" in \"").concat(lang, "\" was ignored: existing = \"").concat(I18n.translations[lang][word], "\", new = ").concat(words[word][lang]));
77
- }
78
- });
79
- });
80
- } else {
81
- if (!I18n.translations[lang]) {
82
- console.warn("Used unknown language: ".concat(lang));
83
- }
84
-
85
- I18n.translations[lang] = I18n.translations[lang] || {};
86
- Object.keys(words).forEach(function (word) {
87
- if (!I18n.translations[lang][word]) {
88
- I18n.translations[lang][word] = words[word];
89
- } else if (I18n.translations[lang][word] !== words[word]) {
90
- console.warn("Translation for word \"".concat(word, "\" in \"").concat(lang, "\" was ignored: existing = \"").concat(I18n.translations[lang][word], "\", new = ").concat(words[word]));
91
- }
92
- });
93
- }
94
- } catch (e) {
95
- console.error("Cannot apply translations: ".concat(e));
96
- }
97
- }
98
- /**
99
- * Sets all translations (in all languages).
100
- * @param {{ [lang in ioBroker.Languages]?: Record<string, string>; }} translations
101
- */
102
-
103
- }, {
104
- key: "setTranslations",
105
- value: function setTranslations(translations) {
106
- if (translations) {
107
- I18n.translations = translations;
108
- }
109
- }
110
- /**
111
- * Get the currently chosen language.
112
- * @returns {ioBroker.Languages} The current language.
113
- */
114
-
115
- }, {
116
- key: "getLanguage",
117
- value: function getLanguage() {
118
- return I18n.lang;
119
- }
120
- /**
121
- * Translate the given string to the selected language.
122
- * @param {string} word The (key) word to look up the string.
123
- * @param {string[]} args Optional arguments which will replace the first (second, third, ...) occurrences of %s
124
- */
125
-
126
- }, {
127
- key: "t",
128
- value: function t(word) {
129
- var translation = I18n.translations[I18n.lang];
130
-
131
- if (translation) {
132
- var w = translation[word];
133
-
134
- if (w) {
135
- word = w;
136
- } else {
137
- I18n._disableWarning && console.log("Translate: ".concat(word));
138
- }
139
- }
140
-
141
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
142
- args[_key - 1] = arguments[_key];
143
- }
144
-
145
- for (var _i = 0, _args = args; _i < _args.length; _i++) {
146
- var arg = _args[_i];
147
- word = word.replace('%s', arg);
148
- }
149
-
150
- return word;
151
- }
152
- /**
153
- * Disable warning about non-translated words
154
- * Required during development
155
- * @param {boolean} disable Do the warning should be disabled
156
- */
157
-
158
- }, {
159
- key: "disableWarning",
160
- value: function disableWarning(disable) {
161
- I18n._disableWarning = !!disable;
162
- }
163
- }]);
164
- return I18n;
165
- }();
166
- /*I18n.translations = {
167
- 'en': require('./i18n/en'),
168
- 'ru': require('./i18n/ru'),
169
- 'de': require('./i18n/de'),
170
- };
171
- I18n.fallbacks = true;
172
- I18n.t = function () {};*/
173
-
174
-
175
- (0, _defineProperty2["default"])(I18n, "translations", {});
176
- (0, _defineProperty2["default"])(I18n, "lang", window.sysLang || 'en');
177
- (0, _defineProperty2["default"])(I18n, "_disableWarning", false);
178
- var _default = I18n;
179
- exports["default"] = _default;
180
- //# sourceMappingURL=i18n.js.map
package/i18n.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.js","names":["I18n","lang","words","Object","keys","forEach","word","translations","console","warn","e","error","translation","w","_disableWarning","log","args","arg","replace","disable","window","sysLang"],"sources":["i18n.js"],"sourcesContent":["/***\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n ***/\n\n /**\n * Translation string management.\n */\nclass I18n {\n /**\n * List of all languages with their translations.\n * @type {{ [lang in ioBroker.Languages]?: Record<string, string>; }}\n */\n static translations = {};\n\n /**\n * The currently displayed language.\n * @type {ioBroker.Languages}\n */\n static lang = window.sysLang || 'en';\n\n static _disableWarning = false;\n\n /**\n * Set the language to display.\n * @param {ioBroker.Languages} lang\n */\n static setLanguage(lang) {\n if (lang) {\n I18n.lang = lang;\n }\n }\n\n /**\n * Add translations\n * User can provide two types of structures:\n * - {\"word1\": \"translated word1\", \"word2\": \"translated word2\"}, but in this case the lang must be provided\n * - {\"word1\": {\"en\": \"translated en word1\", \"de\": \"translated de word1\"}, \"word2\": {\"en\": \"translated en word2\", \"de\": \"translated de word2\"}}, but no lang must be provided\n * @param {object} words additional words for specific language\n * @param {ioBroker.Languages} lang\n */\n static extendTranslations(words, lang) {\n try {\n if (!lang) {\n Object.keys(words).forEach(word => {\n Object.keys(words[word]).forEach(lang => {\n if (!I18n.translations[lang]) {\n console.warn(`Used unknown language: ${lang}`);\n }\n if (!I18n.translations[lang][word]) {\n I18n.translations[lang][word] = words[word][lang];\n } else if (I18n.translations[lang][word] !== words[word][lang]) {\n console.warn(`Translation for word \"${word}\" in \"${lang}\" was ignored: existing = \"${I18n.translations[lang][word]}\", new = ${words[word][lang]}`);\n }\n });\n });\n } else {\n if (!I18n.translations[lang]) {\n console.warn(`Used unknown language: ${lang}`);\n }\n I18n.translations[lang] = I18n.translations[lang] || {};\n Object.keys(words)\n .forEach(word => {\n if (!I18n.translations[lang][word]) {\n I18n.translations[lang][word] = words[word];\n } else if (I18n.translations[lang][word] !== words[word]) {\n console.warn(`Translation for word \"${word}\" in \"${lang}\" was ignored: existing = \"${I18n.translations[lang][word]}\", new = ${words[word]}`);\n }\n });\n }\n } catch (e) {\n console.error(`Cannot apply translations: ${e}`);\n }\n }\n\n /**\n * Sets all translations (in all languages).\n * @param {{ [lang in ioBroker.Languages]?: Record<string, string>; }} translations\n */\n static setTranslations(translations) {\n if (translations) {\n I18n.translations = translations;\n }\n }\n\n /**\n * Get the currently chosen language.\n * @returns {ioBroker.Languages} The current language.\n */\n static getLanguage() {\n return I18n.lang;\n }\n\n /**\n * Translate the given string to the selected language.\n * @param {string} word The (key) word to look up the string.\n * @param {string[]} args Optional arguments which will replace the first (second, third, ...) occurrences of %s\n */\n static t(word, ...args) {\n const translation = I18n.translations[I18n.lang];\n if (translation) {\n const w = translation[word];\n if (w) {\n word = w;\n } else {\n I18n._disableWarning && console.log(`Translate: ${word}`);\n }\n }\n for (const arg of args) {\n word = word.replace('%s', arg);\n }\n return word;\n }\n\n /**\n * Disable warning about non-translated words\n * Required during development\n * @param {boolean} disable Do the warning should be disabled\n */\n static disableWarning(disable) {\n I18n._disableWarning = !!disable;\n }\n}\n\n/*I18n.translations = {\n 'en': require('./i18n/en'),\n 'ru': require('./i18n/ru'),\n 'de': require('./i18n/de'),\n};\nI18n.fallbacks = true;\nI18n.t = function () {};*/\n\nexport default I18n;"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEC;AACD;AACA;IACMA,I;;;;;;;;IACF;AACJ;AACA;AACA;;IAGI;AACJ;AACA;AACA;;IAKI;AACJ;AACA;AACA;IACI,qBAAmBC,IAAnB,EAAyB;MACrB,IAAIA,IAAJ,EAAU;QACND,IAAI,CAACC,IAAL,GAAYA,IAAZ;MACH;IACJ;IAEA;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACK,4BAA0BC,KAA1B,EAAiCD,IAAjC,EAAuC;MACnC,IAAI;QACA,IAAI,CAACA,IAAL,EAAW;UACPE,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,OAAnB,CAA2B,UAAAC,IAAI,EAAI;YAC/BH,MAAM,CAACC,IAAP,CAAYF,KAAK,CAACI,IAAD,CAAjB,EAAyBD,OAAzB,CAAiC,UAAAJ,IAAI,EAAI;cACrC,IAAI,CAACD,IAAI,CAACO,YAAL,CAAkBN,IAAlB,CAAL,EAA8B;gBAC1BO,OAAO,CAACC,IAAR,kCAAuCR,IAAvC;cACH;;cACD,IAAI,CAACD,IAAI,CAACO,YAAL,CAAkBN,IAAlB,EAAwBK,IAAxB,CAAL,EAAoC;gBAChCN,IAAI,CAACO,YAAL,CAAkBN,IAAlB,EAAwBK,IAAxB,IAAgCJ,KAAK,CAACI,IAAD,CAAL,CAAYL,IAAZ,CAAhC;cACH,CAFD,MA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