@iobroker/gui-components 10.0.4 → 10.0.6
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.
- package/README.md +9 -1
- package/build/Components/ToggleThemeMenu.js +5 -2
- package/build/Components/ToggleThemeMenu.js.map +1 -1
- package/build/Components/Utils.js +13 -11
- package/build/Components/Utils.js.map +1 -1
- package/build/Theme.d.ts +35 -1
- package/build/Theme.js +12 -3
- package/build/Theme.js.map +1 -1
- package/build/ThemeModern.d.ts +53 -0
- package/build/ThemeModern.js +572 -0
- package/build/ThemeModern.js.map +1 -0
- package/build/i18n.d.ts +4 -5
- package/build/i18n.js +20 -26
- package/build/i18n.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/types.d.ts +13 -1
- package/package.json +1 -1
package/build/i18n.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2018-
|
|
2
|
+
* Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
+
// The dictionary and the current language live on `window` instead of in static class fields:
|
|
8
|
+
// module federation can hand a remote its own copy of this module, and only a global keeps every
|
|
9
|
+
// copy working on the same data. Both must exist before the first `extendTranslations` call, so
|
|
10
|
+
// they are initialized here at module scope - that runs before any consumer can reach the class.
|
|
11
|
+
window.i18nTranslations ||= {};
|
|
12
|
+
window.sysLang ||= 'en';
|
|
7
13
|
/**
|
|
8
14
|
* Translation string management.
|
|
9
15
|
*/
|
|
10
16
|
export class I18n {
|
|
11
|
-
/** List of all languages with their translations. */
|
|
12
|
-
static translations = {};
|
|
13
17
|
/** List of unknown translations during development. */
|
|
14
18
|
static unknownTranslations = [];
|
|
15
|
-
/** The currently displayed language. */
|
|
16
|
-
static lang = window.sysLang || 'en';
|
|
17
19
|
static _disableWarning = false;
|
|
18
20
|
/**
|
|
19
21
|
* Set the language to display
|
|
@@ -22,7 +24,7 @@ export class I18n {
|
|
|
22
24
|
*/
|
|
23
25
|
static setLanguage(lang) {
|
|
24
26
|
if (lang) {
|
|
25
|
-
|
|
27
|
+
window.sysLang = lang;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
@@ -71,8 +73,8 @@ export class I18n {
|
|
|
71
73
|
if (words.en && words.de && words.ru) {
|
|
72
74
|
Object.keys(words).forEach(key => {
|
|
73
75
|
const _lang = key;
|
|
74
|
-
|
|
75
|
-
Object.assign(
|
|
76
|
+
window.i18nTranslations[_lang] ||= {};
|
|
77
|
+
Object.assign(window.i18nTranslations[_lang], words[_lang]);
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
else {
|
|
@@ -81,7 +83,7 @@ export class I18n {
|
|
|
81
83
|
const _word = words[word];
|
|
82
84
|
Object.keys(_word).forEach(key => {
|
|
83
85
|
const _lang = key;
|
|
84
|
-
const languageDictionary =
|
|
86
|
+
const languageDictionary = window.i18nTranslations[_lang];
|
|
85
87
|
if (!languageDictionary) {
|
|
86
88
|
console.warn(`Used unknown language: ${_lang}`);
|
|
87
89
|
}
|
|
@@ -97,11 +99,11 @@ export class I18n {
|
|
|
97
99
|
}
|
|
98
100
|
else {
|
|
99
101
|
// translations for one language
|
|
100
|
-
if (!
|
|
102
|
+
if (!window.i18nTranslations[lang]) {
|
|
101
103
|
console.warn(`Used unknown language: ${lang}`);
|
|
102
104
|
}
|
|
103
|
-
|
|
104
|
-
const languageDictionary =
|
|
105
|
+
window.i18nTranslations[lang] ||= {};
|
|
106
|
+
const languageDictionary = window.i18nTranslations[lang];
|
|
105
107
|
Object.keys(words).forEach(word => {
|
|
106
108
|
if (!languageDictionary[word]) {
|
|
107
109
|
languageDictionary[word] = words[word];
|
|
@@ -119,11 +121,12 @@ export class I18n {
|
|
|
119
121
|
/**
|
|
120
122
|
* Sets all translations (in all languages).
|
|
121
123
|
*
|
|
124
|
+
* @deprecated Use {@link extendTranslations}
|
|
122
125
|
* @param translations The translations to add.
|
|
123
126
|
*/
|
|
124
127
|
static setTranslations(translations) {
|
|
125
128
|
if (translations) {
|
|
126
|
-
I18n.translations
|
|
129
|
+
I18n.extendTranslations(translations);
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
/**
|
|
@@ -132,7 +135,7 @@ export class I18n {
|
|
|
132
135
|
* @returns The current language.
|
|
133
136
|
*/
|
|
134
137
|
static getLanguage() {
|
|
135
|
-
return
|
|
138
|
+
return window.sysLang;
|
|
136
139
|
}
|
|
137
140
|
/**
|
|
138
141
|
* Translate the given string to the selected language
|
|
@@ -141,7 +144,7 @@ export class I18n {
|
|
|
141
144
|
* @param args Optional arguments which will replace the first (second, third, ...) occurrences of %s
|
|
142
145
|
*/
|
|
143
146
|
static t(word, ...args) {
|
|
144
|
-
const translation =
|
|
147
|
+
const translation = window.i18nTranslations[window.sysLang];
|
|
145
148
|
if (translation) {
|
|
146
149
|
const w = translation[word];
|
|
147
150
|
if (w) {
|
|
@@ -153,8 +156,8 @@ export class I18n {
|
|
|
153
156
|
!I18n._disableWarning && console.log(`Translate: ${word}`);
|
|
154
157
|
}
|
|
155
158
|
// fallback to english
|
|
156
|
-
if (
|
|
157
|
-
const wordEn =
|
|
159
|
+
if (window.sysLang !== 'en' && window.i18nTranslations.en) {
|
|
160
|
+
const wordEn = window.i18nTranslations.en[word];
|
|
158
161
|
if (wordEn) {
|
|
159
162
|
word = wordEn;
|
|
160
163
|
}
|
|
@@ -209,13 +212,4 @@ export class I18n {
|
|
|
209
212
|
// install global handlers
|
|
210
213
|
window.i18nShow = I18n.i18nShow;
|
|
211
214
|
window.i18nDisableWarning = I18n.disableWarning;
|
|
212
|
-
/*
|
|
213
|
-
I18n.translations = {
|
|
214
|
-
'en': require('./i18n/en'),
|
|
215
|
-
'ru': require('./i18n/ru'),
|
|
216
|
-
'de': require('./i18n/de'),
|
|
217
|
-
};
|
|
218
|
-
I18n.fallbacks = true;
|
|
219
|
-
I18n.t = function () {};
|
|
220
|
-
*/
|
|
221
215
|
//# sourceMappingURL=i18n.js.map
|
package/build/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"./src/","sources":["i18n.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsBH;;GAEG;AACH,MAAM,OAAO,IAAI;IACb,qDAAqD;IACrD,MAAM,CAAC,YAAY,GAAmB,EAAE,CAAC;IAEzC,uDAAuD;IACvD,MAAM,CAAC,mBAAmB,GAAa,EAAE,CAAC;IAE1C,wCAAwC;IACxC,MAAM,CAAC,IAAI,GAAuB,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC;IAEzD,MAAM,CAAC,eAAe,GAAY,KAAK,CAAC;IAExC;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,IAAwB;QACvC,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,kBAAkB,CACrB,KAA4E,EAC5E,IAAyB;QAEzB,iDAAiD;QACjD,IAAK,KAA6B,CAAC,MAAM,EAAE,CAAC;YACxC,MAAM,eAAe,GAAG,KAA4B,CAAC;YACrD,IAAI,OAAO,eAAe,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC7C,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;gBACtC,OAAO,eAAe,CAAC,MAAM,CAAC;gBAC9B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,KAAK,GAAG,GAAyB,CAAC;oBACxC,MAAM,MAAM,GAA8B,EAAE,CAAC;oBAC7C,MAAM,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;oBAClD,MAAM,CAAC,IAAI,CAAC,kBAA4C,CA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CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC9C,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACpC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;gBACxB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAgB;QAClC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC;IACrC,CAAC;;AAGL,0BAA0B;AAC1B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AAChC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC;AAEhD;;;;;;;;EAQE","sourcesContent":["/**\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n\ndeclare global {\n interface Window {\n sysLang: ioBroker.Languages;\n i18nShow: (filter: string | RegExp) => void;\n i18nDisableWarning: (disable: boolean) => void;\n }\n}\n\ntype I18nWordDictionary = Record<ioBroker.Languages, string>;\n\ntype I18nWordsDictionary = Record<string, I18nWordDictionary>;\n\ntype I18nOneLanguageDictionary = Record<string, string>;\n\ntype I18nDictionary = {\n [lang in ioBroker.Languages]?: I18nOneLanguageDictionary;\n};\n\ntype I18nWordsWithPrefix = I18nDictionary & { prefix?: string };\n\n/**\n * Translation string management.\n */\nexport class I18n {\n /** List of all languages with their translations. */\n static translations: I18nDictionary = {};\n\n /** List of unknown translations during development. */\n static unknownTranslations: string[] = [];\n\n /** The currently displayed language. */\n static lang: ioBroker.Languages = window.sysLang || 'en';\n\n static _disableWarning: boolean = false;\n\n /**\n * Set the language to display\n *\n * @param lang The default language for translations.\n */\n static setLanguage(lang: ioBroker.Languages): void {\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 *\n * @param words additional words for specific language\n * @param lang language for the words\n */\n static extendTranslations(\n words: I18nWordsWithPrefix | I18nOneLanguageDictionary | I18nWordsDictionary,\n lang?: ioBroker.Languages,\n ): void {\n // automatically extend all languages with prefix\n if ((words as I18nWordsWithPrefix).prefix) {\n const wordsWithPrefix = words as I18nWordsWithPrefix;\n if (typeof wordsWithPrefix.prefix === 'string') {\n const prefix = wordsWithPrefix.prefix;\n delete wordsWithPrefix.prefix;\n Object.keys(wordsWithPrefix).forEach(key => {\n const _lang = key as ioBroker.Languages;\n const _words: I18nOneLanguageDictionary = {};\n const wordsOfOneLanguage = wordsWithPrefix[_lang];\n Object.keys(wordsOfOneLanguage as Record<string, string>).forEach(word => {\n if (!word) {\n return;\n }\n if (wordsOfOneLanguage) {\n if (!word.startsWith(prefix)) {\n _words[`${prefix}${word}`] = wordsOfOneLanguage[word];\n } else {\n _words[word] = wordsOfOneLanguage[word];\n }\n }\n });\n words[_lang] = _words;\n });\n } else {\n console.warn('Found prefix in translations, but it is not a string');\n }\n }\n\n try {\n if (!lang) {\n // if it is a dictionary with all/many languages\n if (words.en && words.de && words.ru) {\n Object.keys(words).forEach(key => {\n const _lang = key as ioBroker.Languages;\n I18n.translations[_lang] ||= {};\n Object.assign(I18n.translations[_lang], words[_lang]);\n });\n } else {\n // It could be vice versa: words.word1 = {en: 'translated word1', de: 'übersetztes Wort2'}\n Object.keys(words).forEach(word => {\n const _word: I18nWordDictionary = (words as I18nWordsDictionary)[word];\n Object.keys(_word).forEach(key => {\n const _lang = key as ioBroker.Languages;\n const languageDictionary: I18nOneLanguageDictionary | undefined = I18n.translations[_lang];\n if (!languageDictionary) {\n console.warn(`Used unknown language: ${_lang}`);\n } else if (!languageDictionary[word]) {\n languageDictionary[word] = _word[_lang];\n } else if (languageDictionary[word] !== _word[_lang]) {\n console.warn(\n `Translation for word \"${word}\" in \"${_lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${_word[_lang]}`,\n );\n }\n });\n });\n }\n } else {\n // translations for one language\n if (!I18n.translations[lang]) {\n console.warn(`Used unknown language: ${lang}`);\n }\n I18n.translations[lang] ||= {};\n const languageDictionary = I18n.translations[lang];\n Object.keys(words).forEach(word => {\n if (!languageDictionary[word]) {\n languageDictionary[word] = (words as I18nOneLanguageDictionary)[word];\n } else if (languageDictionary[word] !== (words as I18nOneLanguageDictionary)[word]) {\n console.warn(\n `Translation for word \"${word}\" in \"${lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${(words as I18nOneLanguageDictionary)[word]}`,\n );\n }\n });\n }\n } catch (e: any) {\n console.error(`Cannot apply translations: ${e}`);\n }\n }\n\n /**\n * Sets all translations (in all languages).\n *\n * @param translations The translations to add.\n */\n static setTranslations(translations: I18nDictionary): void {\n if (translations) {\n I18n.translations = translations;\n }\n }\n\n /**\n * Get the currently chosen language.\n *\n * @returns The current language.\n */\n static getLanguage(): ioBroker.Languages {\n return I18n.lang;\n }\n\n /**\n * Translate the given string to the selected language\n *\n * @param word The (key) word to look up the string.\n * @param args Optional arguments which will replace the first (second, third, ...) occurrences of %s\n */\n static t(word: string, ...args: any[]): string {\n const translation = I18n.translations[I18n.lang];\n if (translation) {\n const w = translation[word];\n if (w) {\n word = w;\n } else {\n if (!I18n.unknownTranslations.includes(word)) {\n I18n.unknownTranslations.push(word);\n !I18n._disableWarning && console.log(`Translate: ${word}`);\n }\n // fallback to english\n if (I18n.lang !== 'en' && I18n.translations.en) {\n const wordEn = I18n.translations.en[word];\n if (wordEn) {\n word = wordEn;\n }\n }\n }\n }\n for (const arg of args) {\n word = word.replace('%s', arg);\n }\n return word;\n }\n\n /**\n * Show non-translated words\n * Required during development\n *\n * @param filter The filter to apply to the list of non-translated words.\n */\n static i18nShow(filter?: string | RegExp): void {\n /** List words with their translations. */\n const result: Record<string, string> = {};\n if (!filter) {\n I18n.unknownTranslations.forEach(word => (result[word] = word));\n console.log(JSON.stringify(result, null, 2));\n } else if (typeof filter === 'string') {\n I18n.unknownTranslations.forEach(word => {\n if (word.startsWith(filter)) {\n result[word] = word.replace(filter, '');\n }\n });\n console.log(JSON.stringify(result, null, 2));\n } else if (filter && typeof filter === 'object') {\n I18n.unknownTranslations.forEach(word => {\n if (filter.test(word)) {\n result[word] = word;\n }\n });\n console.log(JSON.stringify(result, null, 2));\n }\n }\n\n /**\n * Disable warning about non-translated words\n * Required during development\n *\n * @param disable Whether to disable the warning\n */\n static disableWarning(disable: boolean): void {\n I18n._disableWarning = !!disable;\n }\n}\n\n// install global handlers\nwindow.i18nShow = I18n.i18nShow;\nwindow.i18nDisableWarning = I18n.disableWarning;\n\n/*\nI18n.translations = {\n 'en': require('./i18n/en'),\n 'ru': require('./i18n/ru'),\n 'de': require('./i18n/de'),\n};\nI18n.fallbacks = true;\nI18n.t = function () {};\n*/\n"]}
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"./src/","sources":["i18n.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH,8FAA8F;AAC9F,iGAAiG;AACjG,gGAAgG;AAChG,iGAAiG;AACjG,MAAM,CAAC,gBAAgB,KAAK,EAAE,CAAC;AAC/B,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;AAExB;;GAEG;AACH,MAAM,OAAO,IAAI;IACb,uDAAuD;IACvD,MAAM,CAAC,mBAAmB,GAAa,EAAE,CAAC;IAE1C,MAAM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CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAgB;QAClC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC;IACrC,CAAC;;AAGL,0BAA0B;AAC1B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AAChC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC","sourcesContent":["/**\n * Copyright 2018-2026 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n\ndeclare global {\n interface Window {\n sysLang: ioBroker.Languages;\n i18nShow: (filter: string | RegExp) => void;\n i18nDisableWarning: (disable: boolean) => void;\n /** List of all languages with their translations. */\n i18nTranslations: I18nDictionary;\n }\n}\n\ntype I18nWordDictionary = Record<ioBroker.Languages, string>;\n\ntype I18nWordsDictionary = Record<string, I18nWordDictionary>;\n\ntype I18nOneLanguageDictionary = Record<string, string>;\n\ntype I18nDictionary = {\n [lang in ioBroker.Languages]?: I18nOneLanguageDictionary;\n};\n\ntype I18nWordsWithPrefix = I18nDictionary & { prefix?: string };\n\n// The dictionary and the current language live on `window` instead of in static class fields:\n// module federation can hand a remote its own copy of this module, and only a global keeps every\n// copy working on the same data. Both must exist before the first `extendTranslations` call, so\n// they are initialized here at module scope - that runs before any consumer can reach the class.\nwindow.i18nTranslations ||= {};\nwindow.sysLang ||= 'en';\n\n/**\n * Translation string management.\n */\nexport class I18n {\n /** List of unknown translations during development. */\n static unknownTranslations: string[] = [];\n\n static _disableWarning: boolean = false;\n\n /**\n * Set the language to display\n *\n * @param lang The default language for translations.\n */\n static setLanguage(lang: ioBroker.Languages): void {\n if (lang) {\n window.sysLang = 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 *\n * @param words additional words for specific language\n * @param lang language for the words\n */\n static extendTranslations(\n words: I18nWordsWithPrefix | I18nOneLanguageDictionary | I18nWordsDictionary,\n lang?: ioBroker.Languages,\n ): void {\n // automatically extend all languages with prefix\n if ((words as I18nWordsWithPrefix).prefix) {\n const wordsWithPrefix = words as I18nWordsWithPrefix;\n if (typeof wordsWithPrefix.prefix === 'string') {\n const prefix = wordsWithPrefix.prefix;\n delete wordsWithPrefix.prefix;\n Object.keys(wordsWithPrefix).forEach(key => {\n const _lang = key as ioBroker.Languages;\n const _words: I18nOneLanguageDictionary = {};\n const wordsOfOneLanguage = wordsWithPrefix[_lang];\n Object.keys(wordsOfOneLanguage as Record<string, string>).forEach(word => {\n if (!word) {\n return;\n }\n if (wordsOfOneLanguage) {\n if (!word.startsWith(prefix)) {\n _words[`${prefix}${word}`] = wordsOfOneLanguage[word];\n } else {\n _words[word] = wordsOfOneLanguage[word];\n }\n }\n });\n words[_lang] = _words;\n });\n } else {\n console.warn('Found prefix in translations, but it is not a string');\n }\n }\n\n try {\n if (!lang) {\n // if it is a dictionary with all/many languages\n if (words.en && words.de && words.ru) {\n Object.keys(words).forEach(key => {\n const _lang = key as ioBroker.Languages;\n window.i18nTranslations[_lang] ||= {};\n Object.assign(window.i18nTranslations[_lang], words[_lang]);\n });\n } else {\n // It could be vice versa: words.word1 = {en: 'translated word1', de: 'übersetztes Wort2'}\n Object.keys(words).forEach(word => {\n const _word: I18nWordDictionary = (words as I18nWordsDictionary)[word];\n Object.keys(_word).forEach(key => {\n const _lang = key as ioBroker.Languages;\n const languageDictionary: I18nOneLanguageDictionary | undefined =\n window.i18nTranslations[_lang];\n if (!languageDictionary) {\n console.warn(`Used unknown language: ${_lang}`);\n } else if (!languageDictionary[word]) {\n languageDictionary[word] = _word[_lang];\n } else if (languageDictionary[word] !== _word[_lang]) {\n console.warn(\n `Translation for word \"${word}\" in \"${_lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${_word[_lang]}`,\n );\n }\n });\n });\n }\n } else {\n // translations for one language\n if (!window.i18nTranslations[lang]) {\n console.warn(`Used unknown language: ${lang}`);\n }\n window.i18nTranslations[lang] ||= {};\n const languageDictionary = window.i18nTranslations[lang];\n Object.keys(words).forEach(word => {\n if (!languageDictionary[word]) {\n languageDictionary[word] = (words as I18nOneLanguageDictionary)[word];\n } else if (languageDictionary[word] !== (words as I18nOneLanguageDictionary)[word]) {\n console.warn(\n `Translation for word \"${word}\" in \"${lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${(words as I18nOneLanguageDictionary)[word]}`,\n );\n }\n });\n }\n } catch (e: any) {\n console.error(`Cannot apply translations: ${e}`);\n }\n }\n\n /**\n * Sets all translations (in all languages).\n *\n * @deprecated Use {@link extendTranslations}\n * @param translations The translations to add.\n */\n static setTranslations(translations: I18nDictionary): void {\n if (translations) {\n I18n.extendTranslations(translations);\n }\n }\n\n /**\n * Get the currently chosen language.\n *\n * @returns The current language.\n */\n static getLanguage(): ioBroker.Languages {\n return window.sysLang;\n }\n\n /**\n * Translate the given string to the selected language\n *\n * @param word The (key) word to look up the string.\n * @param args Optional arguments which will replace the first (second, third, ...) occurrences of %s\n */\n static t(word: string, ...args: any[]): string {\n const translation = window.i18nTranslations[window.sysLang];\n if (translation) {\n const w = translation[word];\n if (w) {\n word = w;\n } else {\n if (!I18n.unknownTranslations.includes(word)) {\n I18n.unknownTranslations.push(word);\n !I18n._disableWarning && console.log(`Translate: ${word}`);\n }\n // fallback to english\n if (window.sysLang !== 'en' && window.i18nTranslations.en) {\n const wordEn = window.i18nTranslations.en[word];\n if (wordEn) {\n word = wordEn;\n }\n }\n }\n }\n for (const arg of args) {\n word = word.replace('%s', arg);\n }\n return word;\n }\n\n /**\n * Show non-translated words\n * Required during development\n *\n * @param filter The filter to apply to the list of non-translated words.\n */\n static i18nShow(filter?: string | RegExp): void {\n /** List words with their translations. */\n const result: Record<string, string> = {};\n if (!filter) {\n I18n.unknownTranslations.forEach(word => (result[word] = word));\n console.log(JSON.stringify(result, null, 2));\n } else if (typeof filter === 'string') {\n I18n.unknownTranslations.forEach(word => {\n if (word.startsWith(filter)) {\n result[word] = word.replace(filter, '');\n }\n });\n console.log(JSON.stringify(result, null, 2));\n } else if (filter && typeof filter === 'object') {\n I18n.unknownTranslations.forEach(word => {\n if (filter.test(word)) {\n result[word] = word;\n }\n });\n console.log(JSON.stringify(result, null, 2));\n }\n }\n\n /**\n * Disable warning about non-translated words\n * Required during development\n *\n * @param disable Whether to disable the warning\n */\n static disableWarning(disable: boolean): void {\n I18n._disableWarning = !!disable;\n }\n}\n\n// install global handlers\nwindow.i18nShow = I18n.i18nShow;\nwindow.i18nDisableWarning = I18n.disableWarning;\n"]}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACH,WAAW,EAOX,gBAAgB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,UAAU,EACV,UAAU,EACV,eAAe,GAGlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,mB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AAc,EAAwB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC,CAAC,aAAa;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAC,CAAC,aAAa;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC,CAAC,aAAa;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC,CAAC,aAAa;AACjF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAIH,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,GACb,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export { Theme } from './Theme';\nexport { GenericApp } from './GenericApp';\nexport { I18n } from './i18n';\nexport { printPrompt } from './Prompt';\nexport { ColorPicker } from './Components/ColorPicker';\nexport { ComplexCron } from './Components/ComplexCron';\nexport { copy } from './Components/CopyToClipboard';\nexport { CustomModal } from './Components/CustomModal';\nexport {\n FileBrowser,\n type MetaACL,\n type MetaObject,\n type FileBrowserProps,\n type FileBrowserNavigation,\n type FolderOrFileItem,\n type Folders,\n FileBrowserClass,\n} from './Components/FileBrowser';\nexport {\n EXTENSIONS,\n FileViewer,\n FileViewerClass,\n type FileViewerProps,\n type FileViewerState,\n} from './Components/FileViewer';\nexport { getSystemIcon, getSelectIdIcon, Icon } from './Components/Icon';\nexport { IconPicker } from './Components/IconPicker';\nexport { IconSelector } from './Components/IconSelector';\nexport { Image } from './Components/Image';\nexport { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';\nexport { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';\nexport { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';\nexport { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';\nexport {\n type IconPropsSVG,\n Cleaner,\n DoorClosed,\n DoorOpened,\n FireOff,\n FireOn,\n FloodOff,\n FloodOn,\n Gate,\n HeatValve,\n Home,\n Humidity,\n IconHome,\n Jalousie,\n Material,\n MotionOff,\n MotionOn,\n PushButton,\n RepairExpert,\n RGB,\n Socket,\n Thermometer,\n ThermometerSimple,\n Thermostat,\n Valve,\n WindowClosed,\n WindowOpened,\n WindowTilted,\n} from './Components/DeviceType/icons';\nexport { Loader } from './Components/Loader';\nexport { Logo } from './Components/Logo';\nexport { MDUtils } from './Components/MDUtils';\nexport { ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES } from './Components/ObjectBrowser';\nexport {\n type TreeItemData,\n type TreeItem,\n type ObjectBrowserFilter,\n type ObjectBrowserCustomFilter,\n type ObjectBrowserColumn,\n type ObjectBrowserProps,\n type ObjectBrowserNavigation,\n} from './Components/ObjectBrowser/types';\n\nexport { InfoBox } from './Components/InfoBox';\nexport { Router } from './Components/Router';\nexport { SaveCloseButtons } from './Components/SaveCloseButtons';\nexport { Schedule, type ScheduleConfig } from './Components/Schedule';\nexport { SelectWithIcon } from './Components/SelectWithIcon';\nexport { TabContainer } from './Components/TabContainer';\nexport { TabContent } from './Components/TabContent';\nexport { TabHeader } from './Components/TabHeader';\nexport { TableResize } from './Components/TableResize';\nexport { TextWithIcon } from './Components/TextWithIcon';\nexport { ToggleThemeMenu } from './Components/ToggleThemeMenu';\nexport { TreeTable } from './Components/TreeTable';\nexport { UploadImage } from './Components/UploadImage';\nexport { Utils } from './Components/Utils';\nexport { withWidth } from './Components/withWidth';\nexport { cron2state, SimpleCron } from './Components/SimpleCron';\nexport { convertCronToText } from './Components/SimpleCron/cronText';\nexport { LoaderVendor } from './Components/Loaders/Vendor';\nexport { LoaderPT } from './Components/Loaders/PT';\nexport { LoaderMV } from './Components/Loaders/MV';\nexport { LoaderNW } from './Components/Loaders/NW';\nexport { LoaderHA } from './Components/Loaders/HA';\nexport { type IconProps } from './Components/Icon';\nexport { type IconsIconProps } from './icons/types';\nexport { IconAdapter } from './icons/IconAdapter';\nexport { IconAlias } from './icons/IconAlias';\nexport { IconButtonImage } from './icons/IconButtonImage';\nexport { IconChannel } from './icons/IconChannel';\nexport { IconClearFilter } from './icons/IconClearFilter';\nexport { IconClosed } from './icons/IconClosed';\nexport { IconCopy } from './icons/IconCopy';\nexport { IconDevice } from './icons/IconDevice';\nexport { IconDocument } from './icons/IconDocument';\nexport { IconDocumentReadOnly } from './icons/IconDocumentReadOnly';\nexport { IconExpert } from './icons/IconExpert';\nexport { IconFx } from './icons/IconFx';\nexport { IconInstance } from './icons/IconInstance';\nexport { IconLogout } from './icons/IconLogout';\nexport { IconNoIcon } from './icons/IconNoIcon';\nexport { IconOpen } from './icons/IconOpen';\nexport { IconState } from './icons/IconState';\nexport { IconVacuum } from './icons/IconVacuum';\nexport { DialogComplexCron } from './Dialogs/ComplexCron';\nexport { DialogComplexCron as ComplexCronDialog } from './Dialogs/ComplexCron'; // deprecated\nexport { DialogConfirm } from './Dialogs/Confirm';\nexport { DialogConfirm as Confirm } from './Dialogs/Confirm'; // deprecated\nexport { DialogCron } from './Dialogs/Cron';\nexport { DialogCron as Cron } from './Dialogs/Cron'; // deprecated\nexport { DialogError } from './Dialogs/Error';\nexport { DialogError as Error } from './Dialogs/Error'; // deprecated\nexport { DialogMessage } from './Dialogs/Message';\nexport { DialogMessage as Message } from './Dialogs/Message'; // deprecated\nexport { DialogSelectID, type SelectIDFilters } from './Dialogs/SelectID';\nexport { DialogSelectID as SelectID } from './Dialogs/SelectID'; // deprecated\nexport { DialogSelectFile } from './Dialogs/SelectFile';\nexport { DialogSelectFile as SelectFile } from './Dialogs/SelectFile'; // deprecated\nexport { DialogSimpleCron } from './Dialogs/SimpleCron';\nexport { DialogSimpleCron as SimpleCronDialog } from './Dialogs/SimpleCron'; // deprecated\nexport { DialogTextInput } from './Dialogs/TextInput';\nexport { DialogTextInput as TextInput } from './Dialogs/TextInput'; // deprecated\nexport { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';\nexport { AdminConnection } from './AdminConnection';\nexport { dictionary } from './dictionary';\n// `LegacyConnection` was removed in v9. The types it used to re-export now come directly\n// from `@iobroker/socket-client`, `pattern2RegEx` from the object browser utils.\nexport { type ConnectOptions, type SocketClient, type BinaryStateChangeHandler } from '@iobroker/socket-client';\nexport { pattern2RegEx } from './Components/ObjectBrowser/utils';\n\nexport {\n type IobUri,\n type IobUriType,\n type IobUriParsed,\n getAttrInObject,\n setAttrInObject,\n iobUriToString,\n iobUriParse,\n iobUriRead,\n} from './Components/IobUri';\n\nexport type {\n Translate,\n ConnectionProps,\n OldObject,\n ObjectChangeHandler,\n ThemeName,\n ThemeType,\n GenericAppProps,\n GenericAppSettings,\n IobTheme,\n Width,\n GenericAppState,\n} from './types';\n\nexport { moduleFederationShared } from './modulefederation.admin.config';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,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,WAAW,EACX,UAAU,GACb,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export { Theme } from './Theme';\nexport { getModernTheme, MODERN_DARK, MODERN_LIGHT, type ModernTokens } from './ThemeModern';\nexport { GenericApp } from './GenericApp';\nexport { I18n } from './i18n';\nexport { printPrompt } from './Prompt';\nexport { ColorPicker } from './Components/ColorPicker';\nexport { ComplexCron } from './Components/ComplexCron';\nexport { copy } from './Components/CopyToClipboard';\nexport { CustomModal } from './Components/CustomModal';\nexport {\n FileBrowser,\n type MetaACL,\n type MetaObject,\n type FileBrowserProps,\n type FileBrowserNavigation,\n type FolderOrFileItem,\n type Folders,\n FileBrowserClass,\n} from './Components/FileBrowser';\nexport {\n EXTENSIONS,\n FileViewer,\n FileViewerClass,\n type FileViewerProps,\n type FileViewerState,\n} from './Components/FileViewer';\nexport { getSystemIcon, getSelectIdIcon, Icon } from './Components/Icon';\nexport { IconPicker } from './Components/IconPicker';\nexport { IconSelector } from './Components/IconSelector';\nexport { Image } from './Components/Image';\nexport { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';\nexport { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';\nexport { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';\nexport { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';\nexport {\n type IconPropsSVG,\n Cleaner,\n DoorClosed,\n DoorOpened,\n FireOff,\n FireOn,\n FloodOff,\n FloodOn,\n Gate,\n HeatValve,\n Home,\n Humidity,\n IconHome,\n Jalousie,\n Material,\n MotionOff,\n MotionOn,\n PushButton,\n RepairExpert,\n RGB,\n Socket,\n Thermometer,\n ThermometerSimple,\n Thermostat,\n Valve,\n WindowClosed,\n WindowOpened,\n WindowTilted,\n} from './Components/DeviceType/icons';\nexport { Loader } from './Components/Loader';\nexport { Logo } from './Components/Logo';\nexport { MDUtils } from './Components/MDUtils';\nexport { ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES } from './Components/ObjectBrowser';\nexport {\n type TreeItemData,\n type TreeItem,\n type ObjectBrowserFilter,\n type ObjectBrowserCustomFilter,\n type ObjectBrowserColumn,\n type ObjectBrowserProps,\n type ObjectBrowserNavigation,\n} from './Components/ObjectBrowser/types';\n\nexport { InfoBox } from './Components/InfoBox';\nexport { Router } from './Components/Router';\nexport { SaveCloseButtons } from './Components/SaveCloseButtons';\nexport { Schedule, type ScheduleConfig } from './Components/Schedule';\nexport { SelectWithIcon } from './Components/SelectWithIcon';\nexport { TabContainer } from './Components/TabContainer';\nexport { TabContent } from './Components/TabContent';\nexport { TabHeader } from './Components/TabHeader';\nexport { TableResize } from './Components/TableResize';\nexport { TextWithIcon } from './Components/TextWithIcon';\nexport { ToggleThemeMenu } from './Components/ToggleThemeMenu';\nexport { TreeTable } from './Components/TreeTable';\nexport { UploadImage } from './Components/UploadImage';\nexport { Utils } from './Components/Utils';\nexport { withWidth } from './Components/withWidth';\nexport { cron2state, SimpleCron } from './Components/SimpleCron';\nexport { convertCronToText } from './Components/SimpleCron/cronText';\nexport { LoaderVendor } from './Components/Loaders/Vendor';\nexport { LoaderPT } from './Components/Loaders/PT';\nexport { LoaderMV } from './Components/Loaders/MV';\nexport { LoaderNW } from './Components/Loaders/NW';\nexport { LoaderHA } from './Components/Loaders/HA';\nexport { type IconProps } from './Components/Icon';\nexport { type IconsIconProps } from './icons/types';\nexport { IconAdapter } from './icons/IconAdapter';\nexport { IconAlias } from './icons/IconAlias';\nexport { IconButtonImage } from './icons/IconButtonImage';\nexport { IconChannel } from './icons/IconChannel';\nexport { IconClearFilter } from './icons/IconClearFilter';\nexport { IconClosed } from './icons/IconClosed';\nexport { IconCopy } from './icons/IconCopy';\nexport { IconDevice } from './icons/IconDevice';\nexport { IconDocument } from './icons/IconDocument';\nexport { IconDocumentReadOnly } from './icons/IconDocumentReadOnly';\nexport { IconExpert } from './icons/IconExpert';\nexport { IconFx } from './icons/IconFx';\nexport { IconInstance } from './icons/IconInstance';\nexport { IconLogout } from './icons/IconLogout';\nexport { IconNoIcon } from './icons/IconNoIcon';\nexport { IconOpen } from './icons/IconOpen';\nexport { IconState } from './icons/IconState';\nexport { IconVacuum } from './icons/IconVacuum';\nexport { DialogComplexCron } from './Dialogs/ComplexCron';\nexport { DialogComplexCron as ComplexCronDialog } from './Dialogs/ComplexCron'; // deprecated\nexport { DialogConfirm } from './Dialogs/Confirm';\nexport { DialogConfirm as Confirm } from './Dialogs/Confirm'; // deprecated\nexport { DialogCron } from './Dialogs/Cron';\nexport { DialogCron as Cron } from './Dialogs/Cron'; // deprecated\nexport { DialogError } from './Dialogs/Error';\nexport { DialogError as Error } from './Dialogs/Error'; // deprecated\nexport { DialogMessage } from './Dialogs/Message';\nexport { DialogMessage as Message } from './Dialogs/Message'; // deprecated\nexport { DialogSelectID, type SelectIDFilters } from './Dialogs/SelectID';\nexport { DialogSelectID as SelectID } from './Dialogs/SelectID'; // deprecated\nexport { DialogSelectFile } from './Dialogs/SelectFile';\nexport { DialogSelectFile as SelectFile } from './Dialogs/SelectFile'; // deprecated\nexport { DialogSimpleCron } from './Dialogs/SimpleCron';\nexport { DialogSimpleCron as SimpleCronDialog } from './Dialogs/SimpleCron'; // deprecated\nexport { DialogTextInput } from './Dialogs/TextInput';\nexport { DialogTextInput as TextInput } from './Dialogs/TextInput'; // deprecated\nexport { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';\nexport { AdminConnection } from './AdminConnection';\nexport { dictionary } from './dictionary';\n// `LegacyConnection` was removed in v9. The types it used to re-export now come directly\n// from `@iobroker/socket-client`, `pattern2RegEx` from the object browser utils.\nexport { type ConnectOptions, type SocketClient, type BinaryStateChangeHandler } from '@iobroker/socket-client';\nexport { pattern2RegEx } from './Components/ObjectBrowser/utils';\n\nexport {\n type IobUri,\n type IobUriType,\n type IobUriParsed,\n getAttrInObject,\n setAttrInObject,\n iobUriToString,\n iobUriParse,\n iobUriRead,\n} from './Components/IobUri';\n\nexport type {\n Translate,\n ConnectionProps,\n OldObject,\n ObjectChangeHandler,\n ThemeName,\n ThemeType,\n GenericAppProps,\n GenericAppSettings,\n IobTheme,\n Width,\n GenericAppState,\n} from './types';\n\nexport { moduleFederationShared } from './modulefederation.admin.config';\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -66,7 +66,19 @@ export type ObjectChangeHandler = (
|
|
|
66
66
|
oldObj?: OldObject,
|
|
67
67
|
) => void | Promise<void>;
|
|
68
68
|
|
|
69
|
-
export type ThemeName =
|
|
69
|
+
export type ThemeName =
|
|
70
|
+
| 'dark'
|
|
71
|
+
| 'light'
|
|
72
|
+
| 'colored'
|
|
73
|
+
| 'blue'
|
|
74
|
+
| 'PT'
|
|
75
|
+
| 'DX'
|
|
76
|
+
| 'NW'
|
|
77
|
+
| 'HA'
|
|
78
|
+
/** New design (dark). Successor of "dark" */
|
|
79
|
+
| 'modernDark'
|
|
80
|
+
/** New design (light). Successor of "light" */
|
|
81
|
+
| 'modernLight';
|
|
70
82
|
export type ThemeType = 'dark' | 'light';
|
|
71
83
|
|
|
72
84
|
export interface GenericAppProps {
|
package/package.json
CHANGED