@iobroker/adapter-react-v5 8.0.4 → 8.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/LICENSE +22 -22
- package/README.md +5 -1
- package/build/AdminConnection.js.map +1 -1
- package/build/Components/404.js +13 -13
- package/build/Components/404.js.map +1 -1
- package/build/Components/ColorPicker.js.map +1 -1
- package/build/Components/CopyToClipboard.js.map +1 -1
- package/build/Components/Icon.js.map +1 -1
- package/build/Components/IobUri.js.map +1 -1
- package/build/Components/Loader.d.ts +2 -3
- package/build/Components/Loader.js +21 -257
- package/build/Components/Loader.js.map +1 -1
- package/build/Components/Loaders/Community.d.ts +31 -0
- package/build/Components/Loaders/Community.js +265 -0
- package/build/Components/Loaders/Community.js.map +1 -0
- package/build/Components/Loaders/MV.js.map +1 -1
- package/build/Components/Loaders/NW.d.ts +17 -0
- package/build/Components/Loaders/NW.js +70 -0
- package/build/Components/Loaders/NW.js.map +1 -0
- package/build/Components/Loaders/PT.js +103 -103
- package/build/Components/Loaders/PT.js.map +1 -1
- package/build/Components/Loaders/Vendor.js +7 -7
- package/build/Components/Loaders/Vendor.js.map +1 -1
- package/build/Components/MDUtils.js.map +1 -1
- package/build/Components/ObjectBrowser.d.ts +0 -1
- package/build/Components/ObjectBrowser.js +4 -3
- package/build/Components/ObjectBrowser.js.map +1 -1
- package/build/Components/Router.js.map +1 -1
- package/build/Components/SaveCloseButtons.js.map +1 -1
- package/build/Components/SimpleCron/cronText.js.map +1 -1
- package/build/Components/SimpleCron/index.js.map +1 -1
- package/build/Components/TabContainer.js.map +1 -1
- package/build/Components/TabContent.js.map +1 -1
- package/build/Components/TabHeader.js.map +1 -1
- package/build/Components/TableResize.js.map +1 -1
- package/build/Components/TreeTable.js.map +1 -1
- package/build/Components/UploadImage.js +305 -305
- package/build/Components/UploadImage.js.map +1 -1
- package/build/Components/Utils.d.ts +14 -0
- package/build/Components/Utils.js +154 -0
- package/build/Components/Utils.js.map +1 -1
- package/build/Connection.js.map +1 -1
- package/build/Dialogs/ComplexCron.js.map +1 -1
- package/build/Dialogs/Confirm.js.map +1 -1
- package/build/Dialogs/Cron.js.map +1 -1
- package/build/Dialogs/Error.js.map +1 -1
- package/build/Dialogs/Message.js.map +1 -1
- package/build/Dialogs/SimpleCron.js.map +1 -1
- package/build/Dialogs/TextInput.js.map +1 -1
- package/build/Prompt.js +7 -7
- package/build/Prompt.js.map +1 -1
- package/build/Theme.js +32 -0
- package/build/Theme.js.map +1 -1
- package/build/dictionary.js.map +1 -1
- package/build/i18n.js.map +1 -1
- package/build/index.css +56 -56
- 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 +1 -1
- package/index.css +56 -56
- package/package.json +6 -6
- package/tasksExample.js +91 -91
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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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,IAA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C,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] = I18n.translations[_lang] || {};\n const wordsOfOneLang: I18nOneLanguageDictionary | undefined = I18n.translations[_lang];\n Object.assign(wordsOfOneLang as Record<string, string>, 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] = I18n.translations[lang] || {};\n const languageDictionary: I18nOneLanguageDictionary | undefined = I18n.translations[lang];\n if (languageDictionary) {\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 }\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 (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
|
@@ -40,6 +40,7 @@ export { convertCronToText } from './Components/SimpleCron/cronText';
|
|
|
40
40
|
export { LoaderVendor } from './Components/Loaders/Vendor';
|
|
41
41
|
export { LoaderPT } from './Components/Loaders/PT';
|
|
42
42
|
export { LoaderMV } from './Components/Loaders/MV';
|
|
43
|
+
export { LoaderNW } from './Components/Loaders/NW';
|
|
43
44
|
export { type IconProps } from './Components/Icon';
|
|
44
45
|
export { type IconsIconProps } from './icons/types';
|
|
45
46
|
export { IconAdapter } from './icons/IconAdapter';
|
package/build/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export { convertCronToText } from './Components/SimpleCron/cronText';
|
|
|
40
40
|
export { LoaderVendor } from './Components/Loaders/Vendor';
|
|
41
41
|
export { LoaderPT } from './Components/Loaders/PT';
|
|
42
42
|
export { LoaderMV } from './Components/Loaders/MV';
|
|
43
|
+
export { LoaderNW } from './Components/Loaders/NW';
|
|
43
44
|
export { IconAdapter } from './icons/IconAdapter';
|
|
44
45
|
export { IconAlias } from './icons/IconAlias';
|
|
45
46
|
export { IconButtonImage } from './icons/IconButtonImage';
|
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,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,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,2BAA2B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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 { 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":["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;A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c,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;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 { LoaderNW } from './Components/Loaders/NW';\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"]}
|
package/build/types.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export type ObjectChangeHandler = (
|
|
|
69
69
|
oldObj: OldObject,
|
|
70
70
|
) => void | Promise<void>;
|
|
71
71
|
|
|
72
|
-
export type ThemeName = 'dark' | 'light' | 'colored' | 'blue' | 'PT' | 'DX';
|
|
72
|
+
export type ThemeName = 'dark' | 'light' | 'colored' | 'blue' | 'PT' | 'DX' | 'NW';
|
|
73
73
|
export type ThemeType = 'dark' | 'light';
|
|
74
74
|
|
|
75
75
|
export interface GenericAppProps {
|
package/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/adapter-react-v5",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.6",
|
|
4
4
|
"description": "React components to develop ioBroker interfaces with react.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"@emotion/styled": "^11.14.1",
|
|
57
57
|
"@iobroker/js-controller-common": "^7.0.8-alpha.7-20250928-40cb80c18",
|
|
58
58
|
"@iobroker/js-controller-common-db": "^7.0.8-alpha.7-20250928-40cb80c18",
|
|
59
|
-
"@iobroker/socket-client": "5.0.
|
|
60
|
-
"@iobroker/type-detector": "^4.
|
|
59
|
+
"@iobroker/socket-client": "5.0.3",
|
|
60
|
+
"@iobroker/type-detector": "^4.6.2",
|
|
61
61
|
"@iobroker/types": "^7.0.8-alpha.7-20250928-40cb80c18",
|
|
62
62
|
"@mui/icons-material": "^6.5.0",
|
|
63
63
|
"@mui/material": "^6.5.0",
|
|
64
|
-
"@sentry/browser": "^10.
|
|
65
|
-
"cronstrue": "^
|
|
64
|
+
"@sentry/browser": "^10.22.0",
|
|
65
|
+
"cronstrue": "^3.9.0",
|
|
66
66
|
"file-selector": "^2.1.2",
|
|
67
67
|
"react-color": "^2.19.3",
|
|
68
68
|
"react-colorful": "^5.6.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@alcalzone/release-script-plugin-license": "^4.0.0",
|
|
77
77
|
"@iobroker/build-tools": "^2.0.15",
|
|
78
78
|
"@iobroker/eslint-config": "^2.2.0",
|
|
79
|
-
"@types/node": "^
|
|
79
|
+
"@types/node": "^24.9.1",
|
|
80
80
|
"@types/react": "^18.3.23",
|
|
81
81
|
"@types/react-color": "^3.0.13",
|
|
82
82
|
"ajv": "^8.17.1",
|
package/tasksExample.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 bluefox <dogafox@gmail.com>
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
const fs = require('node:fs');
|
|
10
|
-
const { deleteFoldersRecursive, npmInstall, buildReact, copyFiles } = require('@iobroker/build-tools');
|
|
11
|
-
|
|
12
|
-
const SRC = 'src';
|
|
13
|
-
|
|
14
|
-
function copyAllFiles() {
|
|
15
|
-
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
16
|
-
|
|
17
|
-
copyFiles(
|
|
18
|
-
[
|
|
19
|
-
`${SRC}/build/*`,
|
|
20
|
-
`!${SRC}/build/index.html`,
|
|
21
|
-
`!${SRC}/build/static/js/main.*.chunk.js`,
|
|
22
|
-
`!${SRC}/build/static/media/*.svg`,
|
|
23
|
-
`!${SRC}/build/static/media/*.txt`,
|
|
24
|
-
`!${SRC}/build/i18n/*`,
|
|
25
|
-
`!${SRC}/build/i18n`,
|
|
26
|
-
],
|
|
27
|
-
'admin',
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
copyFiles(`${SRC}/build/index.html`, 'admin');
|
|
31
|
-
|
|
32
|
-
copyFiles(`${SRC}/build/static/js/main.*.chunk.js`, 'admin/static/js');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function clean() {
|
|
36
|
-
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
37
|
-
deleteFoldersRecursive(`${SRC}/build`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function installNpmLocal() {
|
|
41
|
-
if (fs.existsSync(`${SRC}/node_modules`)) {
|
|
42
|
-
return Promise.resolve();
|
|
43
|
-
}
|
|
44
|
-
return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function patchFiles() {
|
|
48
|
-
if (fs.existsSync(`${__dirname}/admin/index.html`)) {
|
|
49
|
-
let code = fs.readFileSync(`${__dirname}/admin/index.html`).toString('utf8');
|
|
50
|
-
code = code.replace(
|
|
51
|
-
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
52
|
-
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
fs.writeFileSync(`${__dirname}/admin/index.html`, code);
|
|
56
|
-
}
|
|
57
|
-
if (fs.existsSync(`${__dirname}/${SRC}/build/index.html`)) {
|
|
58
|
-
let code = fs.readFileSync(`${__dirname}/${SRC}/build/index.html`).toString('utf8');
|
|
59
|
-
code = code.replace(
|
|
60
|
-
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
61
|
-
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
fs.writeFileSync(`${SRC}/build/index.html`, code);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (process.argv.find(arg => arg === '--0-clean')) {
|
|
69
|
-
clean();
|
|
70
|
-
} else if (process.argv.find(arg => arg === '--1-npm')) {
|
|
71
|
-
npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch(e => {
|
|
72
|
-
console.error(`Cannot install: ${e}`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
});
|
|
75
|
-
} else if (process.argv.find(arg => arg === '--2-build')) {
|
|
76
|
-
buildReact(SRC, { rootDir: __dirname }).catch(e => {
|
|
77
|
-
console.error(`Cannot build: ${e}`);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
});
|
|
80
|
-
} else if (process.argv.find(arg => arg === '--3-copy')) {
|
|
81
|
-
copyAllFiles();
|
|
82
|
-
} else if (process.argv.find(arg => arg === '--4-patch')) {
|
|
83
|
-
patchFiles();
|
|
84
|
-
} else {
|
|
85
|
-
clean();
|
|
86
|
-
|
|
87
|
-
installNpmLocal()
|
|
88
|
-
.then(() => buildReact(SRC, { rootDir: __dirname }))
|
|
89
|
-
.then(() => copyAllFiles())
|
|
90
|
-
.then(() => patchFiles());
|
|
91
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 bluefox <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const fs = require('node:fs');
|
|
10
|
+
const { deleteFoldersRecursive, npmInstall, buildReact, copyFiles } = require('@iobroker/build-tools');
|
|
11
|
+
|
|
12
|
+
const SRC = 'src';
|
|
13
|
+
|
|
14
|
+
function copyAllFiles() {
|
|
15
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
16
|
+
|
|
17
|
+
copyFiles(
|
|
18
|
+
[
|
|
19
|
+
`${SRC}/build/*`,
|
|
20
|
+
`!${SRC}/build/index.html`,
|
|
21
|
+
`!${SRC}/build/static/js/main.*.chunk.js`,
|
|
22
|
+
`!${SRC}/build/static/media/*.svg`,
|
|
23
|
+
`!${SRC}/build/static/media/*.txt`,
|
|
24
|
+
`!${SRC}/build/i18n/*`,
|
|
25
|
+
`!${SRC}/build/i18n`,
|
|
26
|
+
],
|
|
27
|
+
'admin',
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
copyFiles(`${SRC}/build/index.html`, 'admin');
|
|
31
|
+
|
|
32
|
+
copyFiles(`${SRC}/build/static/js/main.*.chunk.js`, 'admin/static/js');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function clean() {
|
|
36
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
37
|
+
deleteFoldersRecursive(`${SRC}/build`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function installNpmLocal() {
|
|
41
|
+
if (fs.existsSync(`${SRC}/node_modules`)) {
|
|
42
|
+
return Promise.resolve();
|
|
43
|
+
}
|
|
44
|
+
return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function patchFiles() {
|
|
48
|
+
if (fs.existsSync(`${__dirname}/admin/index.html`)) {
|
|
49
|
+
let code = fs.readFileSync(`${__dirname}/admin/index.html`).toString('utf8');
|
|
50
|
+
code = code.replace(
|
|
51
|
+
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
52
|
+
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
fs.writeFileSync(`${__dirname}/admin/index.html`, code);
|
|
56
|
+
}
|
|
57
|
+
if (fs.existsSync(`${__dirname}/${SRC}/build/index.html`)) {
|
|
58
|
+
let code = fs.readFileSync(`${__dirname}/${SRC}/build/index.html`).toString('utf8');
|
|
59
|
+
code = code.replace(
|
|
60
|
+
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
61
|
+
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
fs.writeFileSync(`${SRC}/build/index.html`, code);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (process.argv.find(arg => arg === '--0-clean')) {
|
|
69
|
+
clean();
|
|
70
|
+
} else if (process.argv.find(arg => arg === '--1-npm')) {
|
|
71
|
+
npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch(e => {
|
|
72
|
+
console.error(`Cannot install: ${e}`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
});
|
|
75
|
+
} else if (process.argv.find(arg => arg === '--2-build')) {
|
|
76
|
+
buildReact(SRC, { rootDir: __dirname }).catch(e => {
|
|
77
|
+
console.error(`Cannot build: ${e}`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|
|
80
|
+
} else if (process.argv.find(arg => arg === '--3-copy')) {
|
|
81
|
+
copyAllFiles();
|
|
82
|
+
} else if (process.argv.find(arg => arg === '--4-patch')) {
|
|
83
|
+
patchFiles();
|
|
84
|
+
} else {
|
|
85
|
+
clean();
|
|
86
|
+
|
|
87
|
+
installNpmLocal()
|
|
88
|
+
.then(() => buildReact(SRC, { rootDir: __dirname }))
|
|
89
|
+
.then(() => copyAllFiles())
|
|
90
|
+
.then(() => patchFiles());
|
|
91
|
+
}
|