@iobroker/gui-components 8.0.2 → 10.0.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 (160) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +834 -543
  3. package/build/AdminConnection.js.map +1 -1
  4. package/build/Components/404.js +13 -13
  5. package/build/Components/404.js.map +1 -1
  6. package/build/Components/ColorPicker.js.map +1 -1
  7. package/build/Components/ComplexCron.js +2 -2
  8. package/build/Components/ComplexCron.js.map +1 -1
  9. package/build/Components/CopyToClipboard.js.map +1 -1
  10. package/build/Components/CustomModal.js +1 -1
  11. package/build/Components/CustomModal.js.map +1 -1
  12. package/build/Components/DeviceType/DeviceTypeIcon.js +1 -0
  13. package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -1
  14. package/build/Components/DeviceType/DeviceTypeSelector.js +2 -2
  15. package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -1
  16. package/build/Components/DeviceType/i18n/de.json +1 -0
  17. package/build/Components/DeviceType/i18n/en.json +1 -0
  18. package/build/Components/DeviceType/i18n/fr.json +1 -0
  19. package/build/Components/DeviceType/i18n/it.json +1 -0
  20. package/build/Components/DeviceType/i18n/nl.json +1 -0
  21. package/build/Components/DeviceType/i18n/pl.json +1 -0
  22. package/build/Components/DeviceType/i18n/pt.json +1 -0
  23. package/build/Components/DeviceType/i18n/ru.json +1 -0
  24. package/build/Components/DeviceType/i18n/uk.json +1 -0
  25. package/build/Components/DeviceType/i18n/zh-cn.json +1 -0
  26. package/build/Components/FileBrowser.d.ts +39 -4
  27. package/build/Components/FileBrowser.js +104 -11
  28. package/build/Components/FileBrowser.js.map +1 -1
  29. package/build/Components/FileViewer.js +2 -4
  30. package/build/Components/FileViewer.js.map +1 -1
  31. package/build/Components/Icon.d.ts +1 -3
  32. package/build/Components/Icon.js +11 -11
  33. package/build/Components/Icon.js.map +1 -1
  34. package/build/Components/Image.js +8 -4
  35. package/build/Components/Image.js.map +1 -1
  36. package/build/Components/InfoBox.js +1 -1
  37. package/build/Components/InfoBox.js.map +1 -1
  38. package/build/Components/IobUri.js +5 -5
  39. package/build/Components/IobUri.js.map +1 -1
  40. package/build/Components/Loader.d.ts +2 -3
  41. package/build/Components/Loader.js +25 -257
  42. package/build/Components/Loader.js.map +1 -1
  43. package/build/Components/Loaders/Community.d.ts +31 -0
  44. package/build/Components/Loaders/Community.js +265 -0
  45. package/build/Components/Loaders/Community.js.map +1 -0
  46. package/build/Components/Loaders/HA.d.ts +17 -0
  47. package/build/Components/Loaders/HA.js +99 -0
  48. package/build/Components/Loaders/HA.js.map +1 -0
  49. package/build/Components/Loaders/MV.js.map +1 -1
  50. package/build/Components/Loaders/NW.d.ts +17 -0
  51. package/build/Components/Loaders/NW.js +70 -0
  52. package/build/Components/Loaders/NW.js.map +1 -0
  53. package/build/Components/Loaders/PT.js +103 -103
  54. package/build/Components/Loaders/PT.js.map +1 -1
  55. package/build/Components/Loaders/Vendor.js +7 -7
  56. package/build/Components/Loaders/Vendor.js.map +1 -1
  57. package/build/Components/MDUtils.js.map +1 -1
  58. package/build/Components/ObjectBrowser.d.ts +25 -406
  59. package/build/Components/ObjectBrowser.js +460 -1543
  60. package/build/Components/ObjectBrowser.js.map +1 -1
  61. package/build/Components/Router.js.map +1 -1
  62. package/build/Components/SaveCloseButtons.js.map +1 -1
  63. package/build/Components/Schedule.d.ts +27 -1
  64. package/build/Components/Schedule.js +60 -50
  65. package/build/Components/Schedule.js.map +1 -1
  66. package/build/Components/SelectWithIcon.js +1 -1
  67. package/build/Components/SelectWithIcon.js.map +1 -1
  68. package/build/Components/SimpleCron/cronText.js.map +1 -1
  69. package/build/Components/SimpleCron/index.js +3 -3
  70. package/build/Components/SimpleCron/index.js.map +1 -1
  71. package/build/Components/TabContainer.js +7 -2
  72. package/build/Components/TabContainer.js.map +1 -1
  73. package/build/Components/TabContent.d.ts +1 -1
  74. package/build/Components/TabContent.js +5 -5
  75. package/build/Components/TabContent.js.map +1 -1
  76. package/build/Components/TabHeader.js +2 -2
  77. package/build/Components/TabHeader.js.map +1 -1
  78. package/build/Components/TableResize.js.map +1 -1
  79. package/build/Components/TextWithIcon.js.map +1 -1
  80. package/build/Components/TreeTable.d.ts +1 -0
  81. package/build/Components/TreeTable.js +16 -6
  82. package/build/Components/TreeTable.js.map +1 -1
  83. package/build/Components/UploadImage.js +305 -305
  84. package/build/Components/UploadImage.js.map +1 -1
  85. package/build/Components/Utils.d.ts +17 -3
  86. package/build/Components/Utils.js +167 -9
  87. package/build/Components/Utils.js.map +1 -1
  88. package/build/Components/objectBrowser.types.d.ts +496 -0
  89. package/build/Components/objectBrowserUtils.d.ts +170 -0
  90. package/build/Components/objectBrowserUtils.js +1375 -0
  91. package/build/Components/objectBrowserUtils.js.map +1 -0
  92. package/build/Connection.js.map +1 -1
  93. package/build/Dialogs/ComplexCron.js.map +1 -1
  94. package/build/Dialogs/Confirm.js.map +1 -1
  95. package/build/Dialogs/Cron.js.map +1 -1
  96. package/build/Dialogs/Error.js.map +1 -1
  97. package/build/Dialogs/Message.js.map +1 -1
  98. package/build/Dialogs/SelectFile.d.ts +1 -1
  99. package/build/Dialogs/SelectFile.js +1 -1
  100. package/build/Dialogs/SelectFile.js.map +1 -1
  101. package/build/Dialogs/SelectID.d.ts +1 -1
  102. package/build/Dialogs/SelectID.js +1 -1
  103. package/build/Dialogs/SelectID.js.map +1 -1
  104. package/build/Dialogs/SimpleCron.js.map +1 -1
  105. package/build/Dialogs/TextInput.js +1 -1
  106. package/build/Dialogs/TextInput.js.map +1 -1
  107. package/build/GenericApp.d.ts +6 -4
  108. package/build/GenericApp.js +22 -16
  109. package/build/GenericApp.js.map +1 -1
  110. package/build/Prompt.js +7 -7
  111. package/build/Prompt.js.map +1 -1
  112. package/build/Theme.js +57 -11
  113. package/build/Theme.js.map +1 -1
  114. package/build/assets/devices/parseNames.js +1 -0
  115. package/build/assets/devices/parseNames.js.map +1 -1
  116. package/build/assets/rooms/parseNames.js +1 -0
  117. package/build/assets/rooms/parseNames.js.map +1 -1
  118. package/build/dictionary.js.map +1 -1
  119. package/build/globals.d.ts +2 -0
  120. package/build/i18n/de.json +5 -66
  121. package/build/i18n/en.json +5 -66
  122. package/build/i18n/es.json +5 -66
  123. package/build/i18n/fr.json +5 -66
  124. package/build/i18n/it.json +5 -61
  125. package/build/i18n/nl.json +5 -61
  126. package/build/i18n/pl.json +5 -61
  127. package/build/i18n/pt.json +5 -61
  128. package/build/i18n/ru.json +5 -61
  129. package/build/i18n/uk.json +5 -61
  130. package/build/i18n/zh-cn.json +5 -61
  131. package/build/i18n.js +12 -15
  132. package/build/i18n.js.map +1 -1
  133. package/build/index.css +56 -56
  134. package/build/index.d.ts +9 -4
  135. package/build/index.js +5 -2
  136. package/build/index.js.map +1 -1
  137. package/build/modulefederation.admin.config.d.ts +1 -0
  138. package/build/modulefederation.admin.config.js +1 -1
  139. package/build/modulefederation.admin.config.js.map +1 -1
  140. package/build/types.d.ts +4 -84
  141. package/i18n/de.json +5 -66
  142. package/i18n/en.json +5 -66
  143. package/i18n/es.json +5 -66
  144. package/i18n/fr.json +5 -66
  145. package/i18n/it.json +5 -61
  146. package/i18n/nl.json +5 -61
  147. package/i18n/pl.json +5 -61
  148. package/i18n/pt.json +5 -61
  149. package/i18n/ru.json +5 -61
  150. package/i18n/uk.json +5 -61
  151. package/i18n/zh-cn.json +5 -61
  152. package/index.css +56 -56
  153. package/modulefederation.admin.config.d.ts +1 -0
  154. package/modulefederation.admin.config.js +1 -2
  155. package/package.json +50 -35
  156. package/tasksExample.ts +93 -0
  157. package/build/LegacyConnection.d.ts +0 -938
  158. package/build/LegacyConnection.js +0 -2849
  159. package/build/LegacyConnection.js.map +0 -1
  160. package/tasksExample.js +0 -91
package/build/i18n.js CHANGED
@@ -71,9 +71,8 @@ export class I18n {
71
71
  if (words.en && words.de && words.ru) {
72
72
  Object.keys(words).forEach(key => {
73
73
  const _lang = key;
74
- I18n.translations[_lang] = I18n.translations[_lang] || {};
75
- const wordsOfOneLang = I18n.translations[_lang];
76
- Object.assign(wordsOfOneLang, words[_lang]);
74
+ I18n.translations[_lang] ||= {};
75
+ Object.assign(I18n.translations[_lang], words[_lang]);
77
76
  });
78
77
  }
79
78
  else {
@@ -101,18 +100,16 @@ export class I18n {
101
100
  if (!I18n.translations[lang]) {
102
101
  console.warn(`Used unknown language: ${lang}`);
103
102
  }
104
- I18n.translations[lang] = I18n.translations[lang] || {};
103
+ I18n.translations[lang] ||= {};
105
104
  const languageDictionary = I18n.translations[lang];
106
- if (languageDictionary) {
107
- Object.keys(words).forEach(word => {
108
- if (!languageDictionary[word]) {
109
- languageDictionary[word] = words[word];
110
- }
111
- else if (languageDictionary[word] !== words[word]) {
112
- console.warn(`Translation for word "${word}" in "${lang}" was ignored: existing = "${languageDictionary[word]}", new = ${words[word]}`);
113
- }
114
- });
115
- }
105
+ Object.keys(words).forEach(word => {
106
+ if (!languageDictionary[word]) {
107
+ languageDictionary[word] = words[word];
108
+ }
109
+ else if (languageDictionary[word] !== words[word]) {
110
+ console.warn(`Translation for word "${word}" in "${lang}" was ignored: existing = "${languageDictionary[word]}", new = ${words[word]}`);
111
+ }
112
+ });
116
113
  }
117
114
  }
118
115
  catch (e) {
@@ -190,7 +187,7 @@ export class I18n {
190
187
  });
191
188
  console.log(JSON.stringify(result, null, 2));
192
189
  }
193
- else if (typeof filter === 'object') {
190
+ else if (filter && typeof filter === 'object') {
194
191
  I18n.unknownTranslations.forEach(word => {
195
192
  if (filter.test(word)) {
196
193
  result[word] = word;
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,wCAA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AC,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":["/**\r\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\r\n *\r\n * MIT License\r\n *\r\n */\r\n\r\ndeclare global {\r\n interface Window {\r\n sysLang: ioBroker.Languages;\r\n i18nShow: (filter: string | RegExp) => void;\r\n i18nDisableWarning: (disable: boolean) => void;\r\n }\r\n}\r\n\r\ntype I18nWordDictionary = Record<ioBroker.Languages, string>;\r\n\r\ntype I18nWordsDictionary = Record<string, I18nWordDictionary>;\r\n\r\ntype I18nOneLanguageDictionary = Record<string, string>;\r\n\r\ntype I18nDictionary = {\r\n [lang in ioBroker.Languages]?: I18nOneLanguageDictionary;\r\n};\r\n\r\ntype I18nWordsWithPrefix = I18nDictionary & { prefix?: string };\r\n\r\n/**\r\n * Translation string management.\r\n */\r\nexport class I18n {\r\n /** List of all languages with their translations. */\r\n static translations: I18nDictionary = {};\r\n\r\n /** List of unknown translations during development. */\r\n static unknownTranslations: string[] = [];\r\n\r\n /** The currently displayed language. */\r\n static lang: ioBroker.Languages = window.sysLang || 'en';\r\n\r\n static _disableWarning: boolean = false;\r\n\r\n /**\r\n * Set the language to display\r\n *\r\n * @param lang The default language for translations.\r\n */\r\n static setLanguage(lang: ioBroker.Languages): void {\r\n if (lang) {\r\n I18n.lang = lang;\r\n }\r\n }\r\n\r\n /**\r\n * Add translations\r\n * User can provide two types of structures:\r\n * - {\"word1\": \"translated word1\", \"word2\": \"translated word2\"}, but in this case the lang must be provided\r\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\r\n *\r\n * @param words additional words for specific language\r\n * @param lang language for the words\r\n */\r\n static extendTranslations(\r\n words: I18nWordsWithPrefix | I18nOneLanguageDictionary | I18nWordsDictionary,\r\n lang?: ioBroker.Languages,\r\n ): void {\r\n // automatically extend all languages with prefix\r\n if ((words as I18nWordsWithPrefix).prefix) {\r\n const wordsWithPrefix = words as I18nWordsWithPrefix;\r\n if (typeof wordsWithPrefix.prefix === 'string') {\r\n const prefix = wordsWithPrefix.prefix;\r\n delete wordsWithPrefix.prefix;\r\n Object.keys(wordsWithPrefix).forEach(key => {\r\n const _lang = key as ioBroker.Languages;\r\n const _words: I18nOneLanguageDictionary = {};\r\n const wordsOfOneLanguage = wordsWithPrefix[_lang];\r\n Object.keys(wordsOfOneLanguage as Record<string, string>).forEach(word => {\r\n if (!word) {\r\n return;\r\n }\r\n if (wordsOfOneLanguage) {\r\n if (!word.startsWith(prefix)) {\r\n _words[`${prefix}${word}`] = wordsOfOneLanguage[word];\r\n } else {\r\n _words[word] = wordsOfOneLanguage[word];\r\n }\r\n }\r\n });\r\n words[_lang] = _words;\r\n });\r\n } else {\r\n console.warn('Found prefix in translations, but it is not a string');\r\n }\r\n }\r\n\r\n try {\r\n if (!lang) {\r\n // if it is a dictionary with all/many languages\r\n if (words.en && words.de && words.ru) {\r\n Object.keys(words).forEach(key => {\r\n const _lang = key as ioBroker.Languages;\r\n I18n.translations[_lang] = I18n.translations[_lang] || {};\r\n const wordsOfOneLang: I18nOneLanguageDictionary | undefined = I18n.translations[_lang];\r\n Object.assign(wordsOfOneLang as Record<string, string>, words[_lang]);\r\n });\r\n } else {\r\n // It could be vice versa: words.word1 = {en: 'translated word1', de: 'übersetztes Wort2'}\r\n Object.keys(words).forEach(word => {\r\n const _word: I18nWordDictionary = (words as I18nWordsDictionary)[word];\r\n Object.keys(_word).forEach(key => {\r\n const _lang = key as ioBroker.Languages;\r\n const languageDictionary: I18nOneLanguageDictionary | undefined = I18n.translations[_lang];\r\n if (!languageDictionary) {\r\n console.warn(`Used unknown language: ${_lang}`);\r\n } else if (!languageDictionary[word]) {\r\n languageDictionary[word] = _word[_lang];\r\n } else if (languageDictionary[word] !== _word[_lang]) {\r\n console.warn(\r\n `Translation for word \"${word}\" in \"${_lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${_word[_lang]}`,\r\n );\r\n }\r\n });\r\n });\r\n }\r\n } else {\r\n // translations for one language\r\n if (!I18n.translations[lang]) {\r\n console.warn(`Used unknown language: ${lang}`);\r\n }\r\n I18n.translations[lang] = I18n.translations[lang] || {};\r\n const languageDictionary: I18nOneLanguageDictionary | undefined = I18n.translations[lang];\r\n if (languageDictionary) {\r\n Object.keys(words).forEach(word => {\r\n if (!languageDictionary[word]) {\r\n languageDictionary[word] = (words as I18nOneLanguageDictionary)[word];\r\n } else if (languageDictionary[word] !== (words as I18nOneLanguageDictionary)[word]) {\r\n console.warn(\r\n `Translation for word \"${word}\" in \"${lang}\" was ignored: existing = \"${languageDictionary[word]}\", new = ${(words as I18nOneLanguageDictionary)[word]}`,\r\n );\r\n }\r\n });\r\n }\r\n }\r\n } catch (e: any) {\r\n console.error(`Cannot apply translations: ${e}`);\r\n }\r\n }\r\n\r\n /**\r\n * Sets all translations (in all languages).\r\n *\r\n * @param translations The translations to add.\r\n */\r\n static setTranslations(translations: I18nDictionary): void {\r\n if (translations) {\r\n I18n.translations = translations;\r\n }\r\n }\r\n\r\n /**\r\n * Get the currently chosen language.\r\n *\r\n * @returns The current language.\r\n */\r\n static getLanguage(): ioBroker.Languages {\r\n return I18n.lang;\r\n }\r\n\r\n /**\r\n * Translate the given string to the selected language\r\n *\r\n * @param word The (key) word to look up the string.\r\n * @param args Optional arguments which will replace the first (second, third, ...) occurrences of %s\r\n */\r\n static t(word: string, ...args: any[]): string {\r\n const translation = I18n.translations[I18n.lang];\r\n if (translation) {\r\n const w = translation[word];\r\n if (w) {\r\n word = w;\r\n } else {\r\n if (!I18n.unknownTranslations.includes(word)) {\r\n I18n.unknownTranslations.push(word);\r\n !I18n._disableWarning && console.log(`Translate: ${word}`);\r\n }\r\n // fallback to english\r\n if (I18n.lang !== 'en' && I18n.translations.en) {\r\n const wordEn = I18n.translations.en[word];\r\n if (wordEn) {\r\n word = wordEn;\r\n }\r\n }\r\n }\r\n }\r\n for (const arg of args) {\r\n word = word.replace('%s', arg);\r\n }\r\n return word;\r\n }\r\n\r\n /**\r\n * Show non-translated words\r\n * Required during development\r\n *\r\n * @param filter The filter to apply to the list of non-translated words.\r\n */\r\n static i18nShow(filter?: string | RegExp): void {\r\n /** List words with their translations. */\r\n const result: Record<string, string> = {};\r\n if (!filter) {\r\n I18n.unknownTranslations.forEach(word => (result[word] = word));\r\n console.log(JSON.stringify(result, null, 2));\r\n } else if (typeof filter === 'string') {\r\n I18n.unknownTranslations.forEach(word => {\r\n if (word.startsWith(filter)) {\r\n result[word] = word.replace(filter, '');\r\n }\r\n });\r\n console.log(JSON.stringify(result, null, 2));\r\n } else if (typeof filter === 'object') {\r\n I18n.unknownTranslations.forEach(word => {\r\n if (filter.test(word)) {\r\n result[word] = word;\r\n }\r\n });\r\n console.log(JSON.stringify(result, null, 2));\r\n }\r\n }\r\n\r\n /**\r\n * Disable warning about non-translated words\r\n * Required during development\r\n *\r\n * @param disable Whether to disable the warning\r\n */\r\n static disableWarning(disable: boolean): void {\r\n I18n._disableWarning = !!disable;\r\n }\r\n}\r\n\r\n// install global handlers\r\nwindow.i18nShow = I18n.i18nShow;\r\nwindow.i18nDisableWarning = I18n.disableWarning;\r\n\r\n/*\r\nI18n.translations = {\r\n 'en': require('./i18n/en'),\r\n 'ru': require('./i18n/ru'),\r\n 'de': require('./i18n/de'),\r\n};\r\nI18n.fallbacks = true;\r\nI18n.t = function () {};\r\n*/\r\n"]}
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,CAA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AAC,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"]}
package/build/index.css CHANGED
@@ -1,56 +1,56 @@
1
- /**
2
- * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
3
- *
4
- * MIT License
5
- *
6
- **/
7
-
8
- html {
9
- height: 100%;
10
- }
11
-
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
16
- 'Droid Sans', 'Helvetica Neue', sans-serif;
17
- -webkit-font-smoothing: antialiased;
18
- -moz-osx-font-smoothing: grayscale;
19
- width: 100%;
20
- height: 100%;
21
- overflow: hidden;
22
- }
23
-
24
- /* scrollbar */
25
- ::-webkit-scrollbar-track {
26
- background-color: #ccc;
27
- border-radius: 5px;
28
- }
29
-
30
- ::-webkit-scrollbar {
31
- width: 5px;
32
- height: 5px;
33
- background-color: #ccc;
34
- }
35
-
36
- ::-webkit-scrollbar-thumb {
37
- background-color: #575757;
38
- border-radius: 5px;
39
- }
40
-
41
- #root {
42
- height: 100%;
43
- }
44
-
45
- .App {
46
- height: 100%;
47
- }
48
-
49
- @keyframes glow {
50
- from {
51
- background-color: initial;
52
- }
53
- to {
54
- background-color: #58c458;
55
- }
56
- }
1
+ /**
2
+ * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
3
+ *
4
+ * MIT License
5
+ *
6
+ **/
7
+
8
+ html {
9
+ height: 100%;
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ padding: 0;
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
16
+ 'Droid Sans', 'Helvetica Neue', sans-serif;
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+ width: 100%;
20
+ height: 100%;
21
+ overflow: hidden;
22
+ }
23
+
24
+ /* scrollbar */
25
+ ::-webkit-scrollbar-track {
26
+ background-color: #ccc;
27
+ border-radius: 5px;
28
+ }
29
+
30
+ ::-webkit-scrollbar {
31
+ width: 5px;
32
+ height: 5px;
33
+ background-color: #ccc;
34
+ }
35
+
36
+ ::-webkit-scrollbar-thumb {
37
+ background-color: #575757;
38
+ border-radius: 5px;
39
+ }
40
+
41
+ #root {
42
+ height: 100%;
43
+ }
44
+
45
+ .App {
46
+ height: 100%;
47
+ }
48
+
49
+ @keyframes glow {
50
+ from {
51
+ background-color: initial;
52
+ }
53
+ to {
54
+ background-color: #58c458;
55
+ }
56
+ }
package/build/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { ColorPicker } from './Components/ColorPicker';
6
6
  export { ComplexCron } from './Components/ComplexCron';
7
7
  export { copy } from './Components/CopyToClipboard';
8
8
  export { CustomModal } from './Components/CustomModal';
9
- export { FileBrowser, type MetaACL, type MetaObject, type FileBrowserProps, type FolderOrFileItem, type Folders, FileBrowserClass, } from './Components/FileBrowser';
9
+ export { FileBrowser, type MetaACL, type MetaObject, type FileBrowserProps, type FileBrowserNavigation, type FolderOrFileItem, type Folders, FileBrowserClass, } from './Components/FileBrowser';
10
10
  export { EXTENSIONS, FileViewer, FileViewerClass, type FileViewerProps, type FileViewerState, } from './Components/FileViewer';
11
11
  export { getSystemIcon, getSelectIdIcon, Icon } from './Components/Icon';
12
12
  export { IconPicker } from './Components/IconPicker';
@@ -16,10 +16,12 @@ export { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';
16
16
  export { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';
17
17
  export { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';
18
18
  export { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';
19
+ export { type IconPropsSVG, Cleaner, DoorClosed, DoorOpened, FireOff, FireOn, FloodOff, FloodOn, Gate, HeatValve, Home, Humidity, IconHome, Jalousie, Material, MotionOff, MotionOn, PushButton, RepairExpert, RGB, Socket, Thermometer, ThermometerSimple, Thermostat, Valve, WindowClosed, WindowOpened, WindowTilted, } from './Components/DeviceType/icons';
19
20
  export { Loader } from './Components/Loader';
20
21
  export { Logo } from './Components/Logo';
21
22
  export { MDUtils } from './Components/MDUtils';
22
- export { type TreeItemData, type TreeItem, type ObjectBrowserFilter, type ObjectBrowserCustomFilter, type ObjectBrowserColumn, type ObjectBrowserProps, ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES, } from './Components/ObjectBrowser';
23
+ export { ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES } from './Components/ObjectBrowser';
24
+ export { type TreeItemData, type TreeItem, type ObjectBrowserFilter, type ObjectBrowserCustomFilter, type ObjectBrowserColumn, type ObjectBrowserProps, type ObjectBrowserNavigation, } from './Components/objectBrowser.types';
23
25
  export { InfoBox } from './Components/InfoBox';
24
26
  export { Router } from './Components/Router';
25
27
  export { SaveCloseButtons } from './Components/SaveCloseButtons';
@@ -40,6 +42,8 @@ export { convertCronToText } from './Components/SimpleCron/cronText';
40
42
  export { LoaderVendor } from './Components/Loaders/Vendor';
41
43
  export { LoaderPT } from './Components/Loaders/PT';
42
44
  export { LoaderMV } from './Components/Loaders/MV';
45
+ export { LoaderNW } from './Components/Loaders/NW';
46
+ export { LoaderHA } from './Components/Loaders/HA';
43
47
  export { type IconProps } from './Components/Icon';
44
48
  export { type IconsIconProps } from './icons/types';
45
49
  export { IconAdapter } from './icons/IconAdapter';
@@ -70,7 +74,7 @@ export { DialogError } from './Dialogs/Error';
70
74
  export { DialogError as Error } from './Dialogs/Error';
71
75
  export { DialogMessage } from './Dialogs/Message';
72
76
  export { DialogMessage as Message } from './Dialogs/Message';
73
- export { DialogSelectID } from './Dialogs/SelectID';
77
+ export { DialogSelectID, type SelectIDFilters } from './Dialogs/SelectID';
74
78
  export { DialogSelectID as SelectID } from './Dialogs/SelectID';
75
79
  export { DialogSelectFile } from './Dialogs/SelectFile';
76
80
  export { DialogSelectFile as SelectFile } from './Dialogs/SelectFile';
@@ -81,7 +85,8 @@ export { DialogTextInput as TextInput } from './Dialogs/TextInput';
81
85
  export { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';
82
86
  export { AdminConnection } from './AdminConnection';
83
87
  export { dictionary } from './dictionary';
84
- export { LegacyConnection, type ConnectOptions, type CompactSystemRepositoryEntry, type CompactSystemRepository, type SocketClient, type BinaryStateChangeHandler, pattern2RegEx, } from './LegacyConnection';
88
+ export { type ConnectOptions, type SocketClient, type BinaryStateChangeHandler } from '@iobroker/socket-client';
89
+ export { pattern2RegEx } from './Components/objectBrowserUtils';
85
90
  export { type IobUri, type IobUriType, type IobUriParsed, getAttrInObject, setAttrInObject, iobUriToString, iobUriParse, iobUriRead, } from './Components/IobUri';
86
91
  export type { Translate, ConnectionProps, OldObject, ObjectChangeHandler, ThemeName, ThemeType, GenericAppProps, GenericAppSettings, IobTheme, Width, GenericAppState, } from './types';
87
92
  export { moduleFederationShared } from './modulefederation.admin.config';
package/build/index.js CHANGED
@@ -16,10 +16,11 @@ export { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';
16
16
  export { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';
17
17
  export { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';
18
18
  export { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';
19
+ export { Cleaner, DoorClosed, DoorOpened, FireOff, FireOn, FloodOff, FloodOn, Gate, HeatValve, Home, Humidity, IconHome, Jalousie, Material, MotionOff, MotionOn, PushButton, RepairExpert, RGB, Socket, Thermometer, ThermometerSimple, Thermostat, Valve, WindowClosed, WindowOpened, WindowTilted, } from './Components/DeviceType/icons';
19
20
  export { Loader } from './Components/Loader';
20
21
  export { Logo } from './Components/Logo';
21
22
  export { MDUtils } from './Components/MDUtils';
22
- export { ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES, } from './Components/ObjectBrowser';
23
+ export { ObjectBrowserClass, ObjectBrowser, getSelectIdIconFromObjects, ITEM_IMAGES } from './Components/ObjectBrowser';
23
24
  export { InfoBox } from './Components/InfoBox';
24
25
  export { Router } from './Components/Router';
25
26
  export { SaveCloseButtons } from './Components/SaveCloseButtons';
@@ -40,6 +41,8 @@ export { convertCronToText } from './Components/SimpleCron/cronText';
40
41
  export { LoaderVendor } from './Components/Loaders/Vendor';
41
42
  export { LoaderPT } from './Components/Loaders/PT';
42
43
  export { LoaderMV } from './Components/Loaders/MV';
44
+ export { LoaderNW } from './Components/Loaders/NW';
45
+ export { LoaderHA } from './Components/Loaders/HA';
43
46
  export { IconAdapter } from './icons/IconAdapter';
44
47
  export { IconAlias } from './icons/IconAlias';
45
48
  export { IconButtonImage } from './icons/IconButtonImage';
@@ -79,7 +82,7 @@ export { DialogTextInput as TextInput } from './Dialogs/TextInput'; // deprecate
79
82
  export { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';
80
83
  export { AdminConnection } from './AdminConnection';
81
84
  export { dictionary } from './dictionary';
82
- export { LegacyConnection, pattern2RegEx, } from './LegacyConnection';
85
+ export { pattern2RegEx } from './Components/objectBrowserUtils';
83
86
  export { getAttrInObject, setAttrInObject, iobUriToString, iobUriParse, iobUriRead, } from './Components/IobUri';
84
87
  export { moduleFederationShared } from './modulefederation.admin.config';
85
88
  //# sourceMappingURL=index.js.map
@@ -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,EAMX,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,mBAAmB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,O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AE,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;AAC1C,OAAO,EACH,gBAAgB,EAMhB,aAAa,GAChB,MAAM,oBAAoB,CAAC;AAE5B,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 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 { Loader } from './Components/Loader';\nexport { Logo } from './Components/Logo';\nexport { MDUtils } from './Components/MDUtils';\nexport {\n type TreeItemData,\n type TreeItem,\n type ObjectBrowserFilter,\n type ObjectBrowserCustomFilter,\n type ObjectBrowserColumn,\n type ObjectBrowserProps,\n ObjectBrowserClass,\n ObjectBrowser,\n getSelectIdIconFromObjects,\n ITEM_IMAGES,\n} from './Components/ObjectBrowser';\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 { 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 } 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';\nexport {\n LegacyConnection,\n type ConnectOptions,\n type CompactSystemRepositoryEntry,\n type CompactSystemRepository,\n type SocketClient,\n type BinaryStateChangeHandler,\n pattern2RegEx,\n} from './LegacyConnection';\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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EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,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/objectBrowserUtils';\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"]}
@@ -10,4 +10,5 @@ export declare function moduleFederationShared(packageJson?: {
10
10
  } | string[]): Record<string, {
11
11
  requiredVersion: '*';
12
12
  singleton: true;
13
+ eager?: boolean;
13
14
  }>;
@@ -18,7 +18,7 @@ export function moduleFederationShared(packageJson) {
18
18
  const list = [
19
19
  '@emotion/react',
20
20
  '@emotion/styled',
21
- '@iobroker/adapter-react-v5',
21
+ '@iobroker/gui-components',
22
22
  '@iobroker/json-config',
23
23
  '@iobroker/dm-gui-components',
24
24
  '@mui/icons-material',
@@ -1 +1 @@
1
- {"version":3,"file":"modulefederation.admin.config.js","sourceRoot":"./src/","sources":["modulefederation.admin.config.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,IAAc,EAA6D,EAAE;IAC7F,MAAM,MAAM,GAA8D,EAAE,CAAC;IAC7E,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACvB,MAAM,CAAC,WAAW,CAAC,GAAG;YAClB,eAAe,EAAE,GAAG;YACpB,SAAS,EAAE,IAAI;SAClB,CAAC;IACN,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAClC,WAKc;IAEd,MAAM,IAAI,GAAa;QACnB,gBAAgB;QAChB,iBAAiB;QACjB,4BAA4B;QAC5B,uBAAuB;QACvB,6BAA6B;QAC7B,qBAAqB;QACrB,eAAe;QACf,qBAAqB;QACrB,UAAU;QACV,iBAAiB;QACjB,SAAS;QACT,mBAAmB;QACnB,OAAO;QACP,WAAW;QACX,WAAW;QACX,gBAAgB;QAChB,QAAQ;KACX,CAAC;IAEF,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;IAED,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3E,OAAO,UAAU,CACb,IAAI,CAAC,MAAM,CACP,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CACvG,CACJ,CAAC;IACN,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["const makeShared = (pkgs: string[]): Record<string, { requiredVersion: '*'; singleton: true }> => {\n const result: Record<string, { requiredVersion: '*'; singleton: true }> = {};\n pkgs.forEach(packageName => {\n result[packageName] = {\n requiredVersion: '*',\n singleton: true,\n };\n });\n return result;\n};\n\n/**\n * Admin shares these modules for all components\n *\n * @param packageJson - package.json or list of modules that used in component\n * @returns Object with shared modules for \"federation\"\n */\nexport function moduleFederationShared(\n packageJson?:\n | {\n dependencies: Record<string, string>;\n devDependencies?: Record<string, string>;\n }\n | string[],\n): Record<string, { requiredVersion: '*'; singleton: true }> {\n const list: string[] = [\n '@emotion/react',\n '@emotion/styled',\n '@iobroker/adapter-react-v5',\n '@iobroker/json-config',\n '@iobroker/dm-gui-components',\n '@mui/icons-material',\n '@mui/material',\n '@mui/x-date-pickers',\n 'date-fns',\n 'date-fns/locale',\n 'leaflet',\n 'leaflet-geosearch',\n 'react',\n 'react-ace',\n 'react-dom',\n 'react-dropzone',\n 'semver',\n ];\n\n if (Array.isArray(packageJson)) {\n return makeShared(list.filter(packageName => packageJson.includes(packageName)));\n }\n\n if (packageJson && (packageJson.dependencies || packageJson.devDependencies)) {\n return makeShared(\n list.filter(\n packageName => packageJson.dependencies?.[packageName] || packageJson.devDependencies?.[packageName],\n ),\n );\n }\n\n return makeShared(list);\n}\n"]}
1
+ {"version":3,"file":"modulefederation.admin.config.js","sourceRoot":"./src/","sources":["modulefederation.admin.config.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,IAAc,EAA8E,EAAE;IAC9G,MAAM,MAAM,GAA+E,EAAE,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACvB,MAAM,CAAC,WAAW,CAAC,GAAG;YAClB,eAAe,EAAE,GAAG;YACpB,SAAS,EAAE,IAAI;SAClB,CAAC;IACN,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAClC,WAKc;IAEd,MAAM,IAAI,GAAa;QACnB,gBAAgB;QAChB,iBAAiB;QACjB,0BAA0B;QAC1B,uBAAuB;QACvB,6BAA6B;QAC7B,qBAAqB;QACrB,eAAe;QACf,qBAAqB;QACrB,UAAU;QACV,iBAAiB;QACjB,SAAS;QACT,mBAAmB;QACnB,OAAO;QACP,WAAW;QACX,WAAW;QACX,gBAAgB;QAChB,QAAQ;KACX,CAAC;IAEF,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;IAED,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3E,OAAO,UAAU,CACb,IAAI,CAAC,MAAM,CACP,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CACvG,CACJ,CAAC;IACN,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["const makeShared = (pkgs: string[]): Record<string, { requiredVersion: '*'; singleton: true; eager?: boolean }> => {\n const result: Record<string, { requiredVersion: '*'; singleton: true; eager?: boolean }> = {};\n pkgs.forEach(packageName => {\n result[packageName] = {\n requiredVersion: '*',\n singleton: true,\n };\n });\n return result;\n};\n\n/**\n * Admin shares these modules for all components\n *\n * @param packageJson - package.json or list of modules that used in component\n * @returns Object with shared modules for \"federation\"\n */\nexport function moduleFederationShared(\n packageJson?:\n | {\n dependencies: Record<string, string>;\n devDependencies?: Record<string, string>;\n }\n | string[],\n): Record<string, { requiredVersion: '*'; singleton: true; eager?: boolean }> {\n const list: string[] = [\n '@emotion/react',\n '@emotion/styled',\n '@iobroker/gui-components',\n '@iobroker/json-config',\n '@iobroker/dm-gui-components',\n '@mui/icons-material',\n '@mui/material',\n '@mui/x-date-pickers',\n 'date-fns',\n 'date-fns/locale',\n 'leaflet',\n 'leaflet-geosearch',\n 'react',\n 'react-ace',\n 'react-dom',\n 'react-dropzone',\n 'semver',\n ];\n\n if (Array.isArray(packageJson)) {\n return makeShared(list.filter(packageName => packageJson.includes(packageName)));\n }\n\n if (packageJson && (packageJson.dependencies || packageJson.devDependencies)) {\n return makeShared(\n list.filter(\n packageName => packageJson.dependencies?.[packageName] || packageJson.devDependencies?.[packageName],\n ),\n );\n }\n\n return makeShared(list);\n}\n"]}
package/build/types.d.ts CHANGED
@@ -2,9 +2,6 @@ import type { JSX, CSSProperties } from 'react';
2
2
  import type { Theme as MuiTheme, Palette as MuiPalette } from '@mui/material/styles';
3
3
  import type { AdminConnection, Connection } from '@iobroker/socket-client';
4
4
 
5
- import type { LegacyConnection } from './LegacyConnection';
6
- import type Router from './Components/Router';
7
-
8
5
  export type Translate = (key: string, ...args: (string | number | boolean)[]) => string;
9
6
 
10
7
  export type LogMessage = {
@@ -66,10 +63,10 @@ export interface OldObject {
66
63
  export type ObjectChangeHandler = (
67
64
  id: string,
68
65
  obj: ioBroker.Object | null | undefined,
69
- oldObj: OldObject,
66
+ oldObj?: OldObject,
70
67
  ) => void | Promise<void>;
71
68
 
72
- export type ThemeName = 'dark' | 'light' | 'colored' | 'blue' | 'PT' | 'DX';
69
+ export type ThemeName = 'dark' | 'light' | 'colored' | 'blue' | 'PT' | 'DX' | 'NW' | 'HA';
73
70
  export type ThemeType = 'dark' | 'light';
74
71
 
75
72
  export interface GenericAppProps {
@@ -86,7 +83,7 @@ export interface GenericAppProps {
86
83
  /** Socket.io configuration. */
87
84
  socket?: ConnectionProps;
88
85
  /** Desired connection object */
89
- Connection?: LegacyConnection | Connection | AdminConnection;
86
+ Connection?: Connection | AdminConnection;
90
87
  /** sentry DNS */
91
88
  sentryDSN?: string;
92
89
  /** Callback if user changes the theme. Call it to trigger change */
@@ -102,6 +99,7 @@ export interface GenericAppSettings extends GenericAppProps {
102
99
  interface Palette extends MuiPalette {
103
100
  mode: ThemeType;
104
101
  expert: string;
102
+ nonAck?: string;
105
103
  grey: {
106
104
  main: string;
107
105
  dark: string;
@@ -156,81 +154,3 @@ export interface GenericAppState {
156
154
  _alertMessage: string | JSX.Element;
157
155
  common?: Record<string, any>;
158
156
  }
159
-
160
- export interface ObjectBrowserTableFilter {
161
- id?: string;
162
- name?: string;
163
- room?: string;
164
- func?: string;
165
- role?: string;
166
- expertMode?: boolean;
167
- }
168
-
169
- export interface ObjectBrowserCustomFilter {
170
- readonly type?: string | string[];
171
- readonly common?: {
172
- readonly type?: string | string[];
173
- readonly role?: string | string[];
174
- // If "_" - no custom set
175
- // If "_dataSources" - only data sources (history, sql, influxdb, ...)
176
- // Else "telegram." or something like this
177
- // `true` - If common.custom not empty
178
- // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
179
- readonly custom?: '_' | '_dataSources' | true | string;
180
- };
181
- }
182
-
183
- export type ObjectBrowserType = 'state' | 'instance' | 'channel' | 'device' | 'chart';
184
-
185
- export interface ObjectBrowserProps {
186
- /** The title of the dialog. */
187
- title: string;
188
- /** The key to store state in the browser (default: 'App') */
189
- key?: string;
190
- /** The CSS classes. */
191
- classes: Record<string, any>;
192
- /** Default filters to be applied to the object table. */
193
- defaultFilters?: ObjectBrowserTableFilter;
194
- /** The selected ID or IDs. */
195
- selected?: string | string[];
196
- /** Callback when object is selected. */
197
- onSelect?: (selectedItems: string[], name: string, isDouble?: boolean) => void;
198
- /** The socket connection. */
199
- socket: Connection;
200
- /** Show the expert button? */
201
- showExpertButton?: boolean;
202
- /** Is expert mode enabled? (default: false) */
203
- expertMode?: boolean;
204
- /** Prefix (default: '.') */
205
- imagePrefix?: string;
206
- /** Theme name. */
207
- themeName?: string;
208
- /** Translation function. */
209
- t: Translate;
210
- /** The selected language. */
211
- lang: ioBroker.Languages;
212
- /** Allow to select multiple objects? (default: false) */
213
- multiSelect?: boolean;
214
- /** Can't objects be edited? (default: false) */
215
- notEditable?: boolean;
216
- /** Show folders first? (default: false) */
217
- foldersFirst?: boolean;
218
- /** Disable the column selector? (default: false) */
219
- disableColumnSelector?: boolean;
220
- /** The custom dialog React component to use */
221
- objectCustomDialog?: any;
222
- /** Custom filter. Optional {common: {custom: true}} or {common: {custom: 'sql.0'}} */
223
- customFilter?: ObjectBrowserCustomFilter;
224
- /** Custom value React component to use */
225
- objectBrowserValue?: any;
226
- /** Custom object editor React component to use */
227
- objectBrowserEditObject?: any;
228
- /** Router */
229
- router?: Router;
230
- /** Object types to show */
231
- types?: ObjectBrowserType[];
232
- /** Columns to display */
233
- columns?: ObjectBrowserColumn[];
234
- /** The width of the dialog. */
235
- width?: Width;
236
- }