@iobroker/gui-components 8.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 (368) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1450 -0
  3. package/build/AdminConnection.d.ts +1 -0
  4. package/build/AdminConnection.js +2 -0
  5. package/build/AdminConnection.js.map +1 -0
  6. package/build/Components/404.d.ts +4 -0
  7. package/build/Components/404.js +97 -0
  8. package/build/Components/404.js.map +1 -0
  9. package/build/Components/ColorPicker.d.ts +86 -0
  10. package/build/Components/ColorPicker.js +222 -0
  11. package/build/Components/ColorPicker.js.map +1 -0
  12. package/build/Components/ComplexCron.d.ts +40 -0
  13. package/build/Components/ComplexCron.js +401 -0
  14. package/build/Components/ComplexCron.js.map +1 -0
  15. package/build/Components/CopyToClipboard.d.ts +14 -0
  16. package/build/Components/CopyToClipboard.js +160 -0
  17. package/build/Components/CopyToClipboard.js.map +1 -0
  18. package/build/Components/CustomModal.d.ts +26 -0
  19. package/build/Components/CustomModal.js +62 -0
  20. package/build/Components/CustomModal.js.map +1 -0
  21. package/build/Components/DeviceType/DeviceTypeIcon.d.ts +29 -0
  22. package/build/Components/DeviceType/DeviceTypeIcon.js +108 -0
  23. package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -0
  24. package/build/Components/DeviceType/DeviceTypeOptions.d.ts +2 -0
  25. package/build/Components/DeviceType/DeviceTypeOptions.js +69 -0
  26. package/build/Components/DeviceType/DeviceTypeOptions.js.map +1 -0
  27. package/build/Components/DeviceType/DeviceTypeSelector.d.ts +20 -0
  28. package/build/Components/DeviceType/DeviceTypeSelector.js +83 -0
  29. package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -0
  30. package/build/Components/DeviceType/deviceTypeTranslations.d.ts +1 -0
  31. package/build/Components/DeviceType/deviceTypeTranslations.js +30 -0
  32. package/build/Components/DeviceType/deviceTypeTranslations.js.map +1 -0
  33. package/build/Components/DeviceType/i18n/de.json +46 -0
  34. package/build/Components/DeviceType/i18n/en.json +46 -0
  35. package/build/Components/DeviceType/i18n/fr.json +46 -0
  36. package/build/Components/DeviceType/i18n/it.json +46 -0
  37. package/build/Components/DeviceType/i18n/nl.json +46 -0
  38. package/build/Components/DeviceType/i18n/pl.json +46 -0
  39. package/build/Components/DeviceType/i18n/pt.json +46 -0
  40. package/build/Components/DeviceType/i18n/ru.json +46 -0
  41. package/build/Components/DeviceType/i18n/uk.json +46 -0
  42. package/build/Components/DeviceType/i18n/zh-cn.json +46 -0
  43. package/build/Components/DeviceType/icons/Cleaner.d.ts +3 -0
  44. package/build/Components/DeviceType/icons/Cleaner.js +14 -0
  45. package/build/Components/DeviceType/icons/Cleaner.js.map +1 -0
  46. package/build/Components/DeviceType/icons/DoorClosed.d.ts +3 -0
  47. package/build/Components/DeviceType/icons/DoorClosed.js +7 -0
  48. package/build/Components/DeviceType/icons/DoorClosed.js.map +1 -0
  49. package/build/Components/DeviceType/icons/DoorOpened.d.ts +3 -0
  50. package/build/Components/DeviceType/icons/DoorOpened.js +7 -0
  51. package/build/Components/DeviceType/icons/DoorOpened.js.map +1 -0
  52. package/build/Components/DeviceType/icons/FireOff.d.ts +3 -0
  53. package/build/Components/DeviceType/icons/FireOff.js +8 -0
  54. package/build/Components/DeviceType/icons/FireOff.js.map +1 -0
  55. package/build/Components/DeviceType/icons/FireOn.d.ts +3 -0
  56. package/build/Components/DeviceType/icons/FireOn.js +14 -0
  57. package/build/Components/DeviceType/icons/FireOn.js.map +1 -0
  58. package/build/Components/DeviceType/icons/FloodOff.d.ts +3 -0
  59. package/build/Components/DeviceType/icons/FloodOff.js +11 -0
  60. package/build/Components/DeviceType/icons/FloodOff.js.map +1 -0
  61. package/build/Components/DeviceType/icons/FloodOn.d.ts +3 -0
  62. package/build/Components/DeviceType/icons/FloodOn.js +18 -0
  63. package/build/Components/DeviceType/icons/FloodOn.js.map +1 -0
  64. package/build/Components/DeviceType/icons/Gate.d.ts +3 -0
  65. package/build/Components/DeviceType/icons/Gate.js +8 -0
  66. package/build/Components/DeviceType/icons/Gate.js.map +1 -0
  67. package/build/Components/DeviceType/icons/HeatValve.d.ts +3 -0
  68. package/build/Components/DeviceType/icons/HeatValve.js +6 -0
  69. package/build/Components/DeviceType/icons/HeatValve.js.map +1 -0
  70. package/build/Components/DeviceType/icons/Home.d.ts +3 -0
  71. package/build/Components/DeviceType/icons/Home.js +6 -0
  72. package/build/Components/DeviceType/icons/Home.js.map +1 -0
  73. package/build/Components/DeviceType/icons/Humidity.d.ts +3 -0
  74. package/build/Components/DeviceType/icons/Humidity.js +8 -0
  75. package/build/Components/DeviceType/icons/Humidity.js.map +1 -0
  76. package/build/Components/DeviceType/icons/IconHome.d.ts +5 -0
  77. package/build/Components/DeviceType/icons/IconHome.js +21 -0
  78. package/build/Components/DeviceType/icons/IconHome.js.map +1 -0
  79. package/build/Components/DeviceType/icons/Jalousie.d.ts +3 -0
  80. package/build/Components/DeviceType/icons/Jalousie.js +7 -0
  81. package/build/Components/DeviceType/icons/Jalousie.js.map +1 -0
  82. package/build/Components/DeviceType/icons/Material.d.ts +3 -0
  83. package/build/Components/DeviceType/icons/Material.js +8 -0
  84. package/build/Components/DeviceType/icons/Material.js.map +1 -0
  85. package/build/Components/DeviceType/icons/MotionOff.d.ts +3 -0
  86. package/build/Components/DeviceType/icons/MotionOff.js +11 -0
  87. package/build/Components/DeviceType/icons/MotionOff.js.map +1 -0
  88. package/build/Components/DeviceType/icons/MotionOn.d.ts +3 -0
  89. package/build/Components/DeviceType/icons/MotionOn.js +7 -0
  90. package/build/Components/DeviceType/icons/MotionOn.js.map +1 -0
  91. package/build/Components/DeviceType/icons/PushButton.d.ts +3 -0
  92. package/build/Components/DeviceType/icons/PushButton.js +9 -0
  93. package/build/Components/DeviceType/icons/PushButton.js.map +1 -0
  94. package/build/Components/DeviceType/icons/RGB.d.ts +3 -0
  95. package/build/Components/DeviceType/icons/RGB.js +43 -0
  96. package/build/Components/DeviceType/icons/RGB.js.map +1 -0
  97. package/build/Components/DeviceType/icons/RepairExpert.d.ts +3 -0
  98. package/build/Components/DeviceType/icons/RepairExpert.js +6 -0
  99. package/build/Components/DeviceType/icons/RepairExpert.js.map +1 -0
  100. package/build/Components/DeviceType/icons/Socket.d.ts +3 -0
  101. package/build/Components/DeviceType/icons/Socket.js +8 -0
  102. package/build/Components/DeviceType/icons/Socket.js.map +1 -0
  103. package/build/Components/DeviceType/icons/Thermometer.d.ts +3 -0
  104. package/build/Components/DeviceType/icons/Thermometer.js +7 -0
  105. package/build/Components/DeviceType/icons/Thermometer.js.map +1 -0
  106. package/build/Components/DeviceType/icons/ThermometerSimple.d.ts +3 -0
  107. package/build/Components/DeviceType/icons/ThermometerSimple.js +8 -0
  108. package/build/Components/DeviceType/icons/ThermometerSimple.js.map +1 -0
  109. package/build/Components/DeviceType/icons/Thermostat.d.ts +3 -0
  110. package/build/Components/DeviceType/icons/Thermostat.js +9 -0
  111. package/build/Components/DeviceType/icons/Thermostat.js.map +1 -0
  112. package/build/Components/DeviceType/icons/Valve.d.ts +3 -0
  113. package/build/Components/DeviceType/icons/Valve.js +7 -0
  114. package/build/Components/DeviceType/icons/Valve.js.map +1 -0
  115. package/build/Components/DeviceType/icons/WindowClosed.d.ts +3 -0
  116. package/build/Components/DeviceType/icons/WindowClosed.js +8 -0
  117. package/build/Components/DeviceType/icons/WindowClosed.js.map +1 -0
  118. package/build/Components/DeviceType/icons/WindowOpened.d.ts +3 -0
  119. package/build/Components/DeviceType/icons/WindowOpened.js +9 -0
  120. package/build/Components/DeviceType/icons/WindowOpened.js.map +1 -0
  121. package/build/Components/DeviceType/icons/WindowTilted.d.ts +3 -0
  122. package/build/Components/DeviceType/icons/WindowTilted.js +8 -0
  123. package/build/Components/DeviceType/icons/WindowTilted.js.map +1 -0
  124. package/build/Components/DeviceType/icons/index.d.ts +28 -0
  125. package/build/Components/DeviceType/icons/index.js +28 -0
  126. package/build/Components/DeviceType/icons/index.js.map +1 -0
  127. package/build/Components/FileBrowser.d.ts +187 -0
  128. package/build/Components/FileBrowser.js +1711 -0
  129. package/build/Components/FileBrowser.js.map +1 -0
  130. package/build/Components/FileViewer.d.ts +49 -0
  131. package/build/Components/FileViewer.js +247 -0
  132. package/build/Components/FileViewer.js.map +1 -0
  133. package/build/Components/Icon.d.ts +35 -0
  134. package/build/Components/Icon.js +140 -0
  135. package/build/Components/Icon.js.map +1 -0
  136. package/build/Components/IconPicker.d.ts +25 -0
  137. package/build/Components/IconPicker.js +72 -0
  138. package/build/Components/IconPicker.js.map +1 -0
  139. package/build/Components/IconSelector.d.ts +33 -0
  140. package/build/Components/IconSelector.js +2086 -0
  141. package/build/Components/IconSelector.js.map +1 -0
  142. package/build/Components/Image.d.ts +31 -0
  143. package/build/Components/Image.js +126 -0
  144. package/build/Components/Image.js.map +1 -0
  145. package/build/Components/InfoBox.d.ts +37 -0
  146. package/build/Components/InfoBox.js +115 -0
  147. package/build/Components/InfoBox.js.map +1 -0
  148. package/build/Components/IobUri.d.ts +14 -0
  149. package/build/Components/IobUri.js +168 -0
  150. package/build/Components/IobUri.js.map +1 -0
  151. package/build/Components/Loader.d.ts +31 -0
  152. package/build/Components/Loader.js +265 -0
  153. package/build/Components/Loader.js.map +1 -0
  154. package/build/Components/Loaders/MV.d.ts +17 -0
  155. package/build/Components/Loaders/MV.js +61 -0
  156. package/build/Components/Loaders/MV.js.map +1 -0
  157. package/build/Components/Loaders/PT.d.ts +27 -0
  158. package/build/Components/Loaders/PT.js +150 -0
  159. package/build/Components/Loaders/PT.js.map +1 -0
  160. package/build/Components/Loaders/Vendor.d.ts +22 -0
  161. package/build/Components/Loaders/Vendor.js +52 -0
  162. package/build/Components/Loaders/Vendor.js.map +1 -0
  163. package/build/Components/Logo.d.ts +18 -0
  164. package/build/Components/Logo.js +109 -0
  165. package/build/Components/Logo.js.map +1 -0
  166. package/build/Components/MDUtils.d.ts +11 -0
  167. package/build/Components/MDUtils.js +99 -0
  168. package/build/Components/MDUtils.js.map +1 -0
  169. package/build/Components/ObjectBrowser.d.ts +665 -0
  170. package/build/Components/ObjectBrowser.js +6245 -0
  171. package/build/Components/ObjectBrowser.js.map +1 -0
  172. package/build/Components/Router.d.ts +21 -0
  173. package/build/Components/Router.js +77 -0
  174. package/build/Components/Router.js.map +1 -0
  175. package/build/Components/SaveCloseButtons.d.ts +20 -0
  176. package/build/Components/SaveCloseButtons.js +65 -0
  177. package/build/Components/SaveCloseButtons.js.map +1 -0
  178. package/build/Components/Schedule.d.ts +62 -0
  179. package/build/Components/Schedule.js +1266 -0
  180. package/build/Components/Schedule.js.map +1 -0
  181. package/build/Components/SelectWithIcon.d.ts +37 -0
  182. package/build/Components/SelectWithIcon.js +139 -0
  183. package/build/Components/SelectWithIcon.js.map +1 -0
  184. package/build/Components/SimpleCron/cronText.d.ts +10 -0
  185. package/build/Components/SimpleCron/cronText.js +14 -0
  186. package/build/Components/SimpleCron/cronText.js.map +1 -0
  187. package/build/Components/SimpleCron/index.d.ts +55 -0
  188. package/build/Components/SimpleCron/index.js +698 -0
  189. package/build/Components/SimpleCron/index.js.map +1 -0
  190. package/build/Components/TabContainer.d.ts +15 -0
  191. package/build/Components/TabContainer.js +23 -0
  192. package/build/Components/TabContainer.js.map +1 -0
  193. package/build/Components/TabContent.d.ts +11 -0
  194. package/build/Components/TabContent.js +20 -0
  195. package/build/Components/TabContent.js.map +1 -0
  196. package/build/Components/TabHeader.d.ts +6 -0
  197. package/build/Components/TabHeader.js +6 -0
  198. package/build/Components/TabHeader.js.map +1 -0
  199. package/build/Components/TableResize.d.ts +45 -0
  200. package/build/Components/TableResize.js +204 -0
  201. package/build/Components/TableResize.js.map +1 -0
  202. package/build/Components/TextWithIcon.d.ts +21 -0
  203. package/build/Components/TextWithIcon.js +113 -0
  204. package/build/Components/TextWithIcon.js.map +1 -0
  205. package/build/Components/ToggleThemeMenu.d.ts +12 -0
  206. package/build/Components/ToggleThemeMenu.js +13 -0
  207. package/build/Components/ToggleThemeMenu.js.map +1 -0
  208. package/build/Components/TreeTable.d.ts +79 -0
  209. package/build/Components/TreeTable.js +538 -0
  210. package/build/Components/TreeTable.js.map +1 -0
  211. package/build/Components/UploadImage.d.ts +23 -0
  212. package/build/Components/UploadImage.js +516 -0
  213. package/build/Components/UploadImage.js.map +1 -0
  214. package/build/Components/Utils.d.ts +331 -0
  215. package/build/Components/Utils.js +1605 -0
  216. package/build/Components/Utils.js.map +1 -0
  217. package/build/Components/withWidth.d.ts +2 -0
  218. package/build/Components/withWidth.js +22 -0
  219. package/build/Components/withWidth.js.map +1 -0
  220. package/build/Connection.d.ts +1 -0
  221. package/build/Connection.js +2 -0
  222. package/build/Connection.js.map +1 -0
  223. package/build/Dialogs/ComplexCron.d.ts +24 -0
  224. package/build/Dialogs/ComplexCron.js +85 -0
  225. package/build/Dialogs/ComplexCron.js.map +1 -0
  226. package/build/Dialogs/Confirm.d.ts +39 -0
  227. package/build/Dialogs/Confirm.js +83 -0
  228. package/build/Dialogs/Confirm.js.map +1 -0
  229. package/build/Dialogs/Cron.d.ts +29 -0
  230. package/build/Dialogs/Cron.js +72 -0
  231. package/build/Dialogs/Cron.js.map +1 -0
  232. package/build/Dialogs/Error.d.ts +18 -0
  233. package/build/Dialogs/Error.js +27 -0
  234. package/build/Dialogs/Error.js.map +1 -0
  235. package/build/Dialogs/Message.d.ts +20 -0
  236. package/build/Dialogs/Message.js +29 -0
  237. package/build/Dialogs/Message.js.map +1 -0
  238. package/build/Dialogs/SelectFile.d.ts +85 -0
  239. package/build/Dialogs/SelectFile.js +115 -0
  240. package/build/Dialogs/SelectFile.js.map +1 -0
  241. package/build/Dialogs/SelectID.d.ts +102 -0
  242. package/build/Dialogs/SelectID.js +151 -0
  243. package/build/Dialogs/SelectID.js.map +1 -0
  244. package/build/Dialogs/SimpleCron.d.ts +19 -0
  245. package/build/Dialogs/SimpleCron.js +46 -0
  246. package/build/Dialogs/SimpleCron.js.map +1 -0
  247. package/build/Dialogs/TextInput.d.ts +2 -0
  248. package/build/Dialogs/TextInput.js +31 -0
  249. package/build/Dialogs/TextInput.js.map +1 -0
  250. package/build/GenericApp.d.ts +209 -0
  251. package/build/GenericApp.js +842 -0
  252. package/build/GenericApp.js.map +1 -0
  253. package/build/LegacyConnection.d.ts +938 -0
  254. package/build/LegacyConnection.js +2849 -0
  255. package/build/LegacyConnection.js.map +1 -0
  256. package/build/Prompt.d.ts +5 -0
  257. package/build/Prompt.js +19 -0
  258. package/build/Prompt.js.map +1 -0
  259. package/build/Theme.d.ts +5 -0
  260. package/build/Theme.js +344 -0
  261. package/build/Theme.js.map +1 -0
  262. package/build/assets/devices/parseNames.d.ts +0 -0
  263. package/build/assets/devices/parseNames.js +35 -0
  264. package/build/assets/devices/parseNames.js.map +1 -0
  265. package/build/assets/devices.json +1 -0
  266. package/build/assets/lamp_ceiling.svg +9 -0
  267. package/build/assets/lamp_table.svg +8 -0
  268. package/build/assets/no_icon.svg +9 -0
  269. package/build/assets/rooms/parseNames.d.ts +0 -0
  270. package/build/assets/rooms/parseNames.js +35 -0
  271. package/build/assets/rooms/parseNames.js.map +1 -0
  272. package/build/assets/rooms.json +1 -0
  273. package/build/dictionary.d.ts +1 -0
  274. package/build/dictionary.js +25 -0
  275. package/build/dictionary.js.map +1 -0
  276. package/build/globals.d.ts +19 -0
  277. package/build/i18n/de.json +480 -0
  278. package/build/i18n/en.json +480 -0
  279. package/build/i18n/es.json +480 -0
  280. package/build/i18n/fr.json +480 -0
  281. package/build/i18n/it.json +475 -0
  282. package/build/i18n/nl.json +475 -0
  283. package/build/i18n/pl.json +475 -0
  284. package/build/i18n/pt.json +475 -0
  285. package/build/i18n/ru.json +475 -0
  286. package/build/i18n/uk.json +475 -0
  287. package/build/i18n/zh-cn.json +475 -0
  288. package/build/i18n.d.ts +84 -0
  289. package/build/i18n.js +224 -0
  290. package/build/i18n.js.map +1 -0
  291. package/build/icons/IconAdapter.d.ts +3 -0
  292. package/build/icons/IconAdapter.js +7 -0
  293. package/build/icons/IconAdapter.js.map +1 -0
  294. package/build/icons/IconAlias.d.ts +3 -0
  295. package/build/icons/IconAlias.js +7 -0
  296. package/build/icons/IconAlias.js.map +1 -0
  297. package/build/icons/IconButtonImage.d.ts +3 -0
  298. package/build/icons/IconButtonImage.js +9 -0
  299. package/build/icons/IconButtonImage.js.map +1 -0
  300. package/build/icons/IconChannel.d.ts +3 -0
  301. package/build/icons/IconChannel.js +10 -0
  302. package/build/icons/IconChannel.js.map +1 -0
  303. package/build/icons/IconClearFilter.d.ts +3 -0
  304. package/build/icons/IconClearFilter.js +8 -0
  305. package/build/icons/IconClearFilter.js.map +1 -0
  306. package/build/icons/IconClosed.d.ts +3 -0
  307. package/build/icons/IconClosed.js +7 -0
  308. package/build/icons/IconClosed.js.map +1 -0
  309. package/build/icons/IconCopy.d.ts +3 -0
  310. package/build/icons/IconCopy.js +6 -0
  311. package/build/icons/IconCopy.js.map +1 -0
  312. package/build/icons/IconDevice.d.ts +3 -0
  313. package/build/icons/IconDevice.js +16 -0
  314. package/build/icons/IconDevice.js.map +1 -0
  315. package/build/icons/IconDocument.d.ts +3 -0
  316. package/build/icons/IconDocument.js +7 -0
  317. package/build/icons/IconDocument.js.map +1 -0
  318. package/build/icons/IconDocumentReadOnly.d.ts +3 -0
  319. package/build/icons/IconDocumentReadOnly.js +8 -0
  320. package/build/icons/IconDocumentReadOnly.js.map +1 -0
  321. package/build/icons/IconExpert.d.ts +3 -0
  322. package/build/icons/IconExpert.js +7 -0
  323. package/build/icons/IconExpert.js.map +1 -0
  324. package/build/icons/IconFx.d.ts +3 -0
  325. package/build/icons/IconFx.js +6 -0
  326. package/build/icons/IconFx.js.map +1 -0
  327. package/build/icons/IconInstance.d.ts +3 -0
  328. package/build/icons/IconInstance.js +7 -0
  329. package/build/icons/IconInstance.js.map +1 -0
  330. package/build/icons/IconLogout.d.ts +3 -0
  331. package/build/icons/IconLogout.js +7 -0
  332. package/build/icons/IconLogout.js.map +1 -0
  333. package/build/icons/IconNoIcon.d.ts +3 -0
  334. package/build/icons/IconNoIcon.js +6 -0
  335. package/build/icons/IconNoIcon.js.map +1 -0
  336. package/build/icons/IconOpen.d.ts +3 -0
  337. package/build/icons/IconOpen.js +7 -0
  338. package/build/icons/IconOpen.js.map +1 -0
  339. package/build/icons/IconState.d.ts +3 -0
  340. package/build/icons/IconState.js +7 -0
  341. package/build/icons/IconState.js.map +1 -0
  342. package/build/icons/IconVacuum.d.ts +3 -0
  343. package/build/icons/IconVacuum.js +12 -0
  344. package/build/icons/IconVacuum.js.map +1 -0
  345. package/build/index.css +56 -0
  346. package/build/index.d.ts +87 -0
  347. package/build/index.js +85 -0
  348. package/build/index.js.map +1 -0
  349. package/build/modulefederation.admin.config.d.ts +13 -0
  350. package/build/modulefederation.admin.config.js +45 -0
  351. package/build/modulefederation.admin.config.js.map +1 -0
  352. package/build/types.d.ts +236 -0
  353. package/i18n/de.json +480 -0
  354. package/i18n/en.json +480 -0
  355. package/i18n/es.json +480 -0
  356. package/i18n/fr.json +480 -0
  357. package/i18n/it.json +475 -0
  358. package/i18n/nl.json +475 -0
  359. package/i18n/pl.json +475 -0
  360. package/i18n/pt.json +475 -0
  361. package/i18n/ru.json +475 -0
  362. package/i18n/uk.json +475 -0
  363. package/i18n/zh-cn.json +475 -0
  364. package/index.css +56 -0
  365. package/modulefederation.admin.config.d.ts +20 -0
  366. package/modulefederation.admin.config.js +54 -0
  367. package/package.json +86 -0
  368. package/tasksExample.js +91 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyToClipboard.js","sourceRoot":"./src/","sources":["Components/CopyToClipboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,sEAAsE;AACtE,SAAS,eAAe;IACpB,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IAC1C,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,MAAM,GAAG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AAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE,IAAI,CAAC,CAAC;YACtE,mEAAmE;YACnE,OAAO,GAAG,IAAI,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;YACtE,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;YACjD,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;YACtF,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;YAAS,CAAC;QACP,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,KAAK,IAAI,OAAO,SAAS,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;gBACvD,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACJ,SAAS,CAAC,eAAe,EAAE,CAAC;YAChC,CAAC;QACL,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YACP,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["/*\r\nMIT License\r\n\r\nCopyright (c) 2017 sudodoki <smd.deluzion@gmail.com>\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n */\r\n// https://github.com/sudodoki/toggle-selection/blob/gh-pages/index.js\r\nfunction deselectCurrent() {\r\n const selection = document.getSelection();\r\n if (!selection?.rangeCount) {\r\n return () => {};\r\n }\r\n let active = document.activeElement as HTMLElement | null;\r\n\r\n const ranges: Range[] = [];\r\n for (let i = 0; i < selection.rangeCount; i++) {\r\n ranges.push(selection.getRangeAt(i));\r\n }\r\n\r\n switch (\r\n active?.tagName.toUpperCase() // .toUpperCase handles XHTML\r\n ) {\r\n case 'INPUT':\r\n case 'TEXTAREA':\r\n active.blur();\r\n break;\r\n\r\n default:\r\n active = null;\r\n break;\r\n }\r\n\r\n selection.removeAllRanges();\r\n return () => {\r\n selection.type === 'Caret' && selection.removeAllRanges();\r\n\r\n if (!selection.rangeCount) {\r\n ranges.forEach(range => selection.addRange(range));\r\n }\r\n\r\n active && active.focus();\r\n };\r\n}\r\n\r\n// https://github.com/sudodoki/copy-to-clipboard/blob/master/index.js\r\n\r\nconst clipboardToIE11Formatting = {\r\n 'text/plain': 'Text',\r\n 'text/html': 'Url',\r\n default: 'Text',\r\n};\r\n\r\nconst defaultMessage = 'Copy to clipboard: #{key}, Enter';\r\n\r\nfunction format(message: string): string {\r\n const copyKey = `${/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl'}+C`;\r\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\r\n}\r\n\r\n/**\r\n * Copy text to clipboard\r\n *\r\n * @param text Text to copy\r\n * @param options Options\r\n * @param options.debug Debug mode\r\n * @param options.format Format of the data\r\n * @param options.message Message to show in prompt\r\n */\r\nexport function copy(\r\n text: string,\r\n options?: { debug?: boolean; format?: 'text/plain' | 'text/html'; message?: string },\r\n): boolean {\r\n let reselectPrevious;\r\n let range;\r\n let selection;\r\n let mark;\r\n let success = false;\r\n options = options || {};\r\n const debug = options.debug || false;\r\n try {\r\n reselectPrevious = deselectCurrent();\r\n\r\n range = document.createRange();\r\n selection = document.getSelection();\r\n\r\n mark = document.createElement('span');\r\n mark.textContent = text;\r\n // avoid screen readers from reading out loud the text\r\n mark.ariaHidden = 'true';\r\n // reset user styles for span element\r\n mark.style.all = 'unset';\r\n // prevents scrolling to the end of the page\r\n mark.style.position = 'fixed';\r\n mark.style.top = '0px';\r\n mark.style.clip = 'rect(0, 0, 0, 0)';\r\n // used to preserve spaces and line breaks\r\n mark.style.whiteSpace = 'pre';\r\n // do not inherit user-select (it may be `none`)\r\n mark.style.userSelect = 'text';\r\n mark.addEventListener('copy', e => {\r\n e.stopPropagation();\r\n if (options?.format) {\r\n e.preventDefault();\r\n if (typeof e.clipboardData === 'undefined') {\r\n // IE 11\r\n debug && console.warn('unable to use e.clipboardData');\r\n debug && console.warn('trying IE specific stuff');\r\n (window as any).clipboardData?.clearData();\r\n const _format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting.default;\r\n (window as any).clipboardData?.setData(_format, text);\r\n } else {\r\n // all other browsers\r\n e.clipboardData?.clearData();\r\n e.clipboardData?.setData(options.format, text);\r\n }\r\n }\r\n });\r\n\r\n document.body.appendChild(mark);\r\n\r\n range.selectNodeContents(mark);\r\n selection?.addRange(range);\r\n\r\n // there is no alternative for execCommand\r\n const successful = document.execCommand('copy');\r\n if (!successful) {\r\n throw new Error('copy command was unsuccessful');\r\n }\r\n success = true;\r\n } catch (err) {\r\n debug && console.error('unable to copy using execCommand: ', err);\r\n debug && console.warn('trying IE specific stuff');\r\n try {\r\n (window as any).clipboardData.setData(options.format || 'text', text);\r\n // options.onCopy && options.onCopy((window as any).clipboardData);\r\n success = true;\r\n } catch (error) {\r\n debug && console.error('unable to copy using clipboardData: ', error);\r\n debug && console.error('falling back to prompt');\r\n const message = format('message' in options ? options.message || '' : defaultMessage);\r\n window.prompt(message, text);\r\n }\r\n } finally {\r\n if (selection) {\r\n if (range && typeof selection.removeRange === 'function') {\r\n selection.removeRange(range);\r\n } else {\r\n selection.removeAllRanges();\r\n }\r\n }\r\n\r\n if (mark) {\r\n document.body.removeChild(mark);\r\n }\r\n reselectPrevious && reselectPrevious();\r\n }\r\n\r\n return success;\r\n}\r\n"]}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { IobTheme } from '../types';
3
+ interface CustomModalProps {
4
+ icon?: any;
5
+ open: boolean;
6
+ onClose: () => void;
7
+ children: React.JSX.Element | null;
8
+ titleButtonClose?: string;
9
+ titleButtonApply?: string;
10
+ onApply: (result: string) => void;
11
+ fullWidth?: boolean;
12
+ maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
13
+ applyButton?: boolean;
14
+ applyDisabled?: boolean;
15
+ overflowHidden?: boolean;
16
+ help?: string;
17
+ noTranslation?: boolean;
18
+ toggleTranslation?: () => void;
19
+ title?: string;
20
+ progress?: boolean;
21
+ textInput?: boolean;
22
+ defaultValue?: string;
23
+ theme: IobTheme;
24
+ }
25
+ export declare function CustomModal(props: CustomModalProps): React.JSX.Element;
26
+ export {};
@@ -0,0 +1,62 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Dialog, DialogActions, DialogContent, DialogTitle, IconButton, TextField, Button, useMediaQuery, useTheme, } from '@mui/material';
3
+ import { Check as CheckIcon, Close as CloseIcon, Language as LanguageIcon } from '@mui/icons-material';
4
+ import { I18n } from '../i18n';
5
+ import { Utils } from './Utils';
6
+ const styles = {
7
+ modalDialog: {
8
+ minWidth: 400,
9
+ maxWidth: 800,
10
+ },
11
+ overflowHidden: {
12
+ display: 'flex',
13
+ overflow: 'hidden',
14
+ },
15
+ titleIcon: {
16
+ marginRight: 5,
17
+ },
18
+ content: {
19
+ fontSize: 16,
20
+ },
21
+ languageButton: {
22
+ position: 'absolute',
23
+ right: 8,
24
+ top: 8,
25
+ },
26
+ languageButtonActive: (theme) => ({
27
+ color: theme.palette.primary.main,
28
+ }),
29
+ };
30
+ export function CustomModal(props) {
31
+ const { open, toggleTranslation, noTranslation, title, fullWidth, help, maxWidth, progress, icon, applyDisabled, applyButton, onClose, children, titleButtonApply, titleButtonClose, onApply, textInput, defaultValue, overflowHidden, } = props;
32
+ const [value, setValue] = useState(defaultValue || '');
33
+ useEffect(() => {
34
+ setValue(defaultValue || '');
35
+ }, [defaultValue]);
36
+ const muiTheme = useTheme();
37
+ const isSmallScreen = useMediaQuery(muiTheme.breakpoints.down('md'));
38
+ let Icon = null;
39
+ if (icon) {
40
+ Icon = icon;
41
+ }
42
+ return (React.createElement(Dialog, { open: open, maxWidth: isSmallScreen ? false : maxWidth || 'md', fullWidth: !!fullWidth, fullScreen: isSmallScreen, disableEscapeKeyDown: false, onClose: onClose, sx: { '& .MuiDialog-paper': isSmallScreen ? {} : styles.modalDialog } },
43
+ title && (React.createElement(DialogTitle, null,
44
+ icon ? React.createElement(Icon, { style: styles.titleIcon }) : null,
45
+ title,
46
+ I18n.getLanguage() !== 'en' && toggleTranslation ? (React.createElement(IconButton, { size: "large", sx: Utils.getStyle(props.theme, styles.languageButton, noTranslation && styles.languageButtonActive), onClick: () => toggleTranslation(), title: I18n.t('Disable/Enable translation') },
47
+ React.createElement(LanguageIcon, null))) : null)),
48
+ React.createElement(DialogContent, { style: { ...styles.content, ...(overflowHidden ? styles.overflowHidden : undefined), paddingTop: 8 } },
49
+ textInput && (React.createElement(TextField
50
+ // className={className}
51
+ , {
52
+ // className={className}
53
+ autoComplete: "off", fullWidth: true, autoFocus: true, variant: "outlined", size: "medium",
54
+ // rows={10}
55
+ multiline: true, value: value, onChange: e => setValue(e.target.value) })),
56
+ children,
57
+ help ? React.createElement("div", null, help) : null),
58
+ React.createElement(DialogActions, null,
59
+ applyButton !== false && (React.createElement(Button, { startIcon: React.createElement(CheckIcon, null), disabled: progress || (applyDisabled && defaultValue === value), onClick: () => onApply(textInput ? value : ''), variant: "contained", color: "primary" }, I18n.t(titleButtonApply || 'ra_Ok'))),
60
+ React.createElement(Button, { color: "grey", onClick: onClose, disabled: progress, variant: "contained", startIcon: React.createElement(CloseIcon, null) }, I18n.t(titleButtonClose || 'ra_Cancel')))));
61
+ }
62
+ //# sourceMappingURL=CustomModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomModal.js","sourceRoot":"./src/","sources":["Components/CustomModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EACH,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,aAAa,EACb,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,IAAI,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,MAAM,GAAwB;IAChC,WAAW,EAAE;QACT,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;KAChB;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,QAAQ;KACrB;IACD,SAAS,EAAE;QACP,WAAW,EAAE,CAAC;KACjB;IACD,OAAO,EAAE;QACL,QAAQ,EAAE,EAAE;K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;YACR,IAAI,CAAC,CAAC,CAAC,iCAAM,IAAI,CAAO,CAAC,CAAC,CAAC,IAAI,CACpB;QAChB,oBAAC,aAAa;YACT,WAAW,KAAK,KAAK,IAAI,CACtB,oBAAC,MAAM,IACH,SAAS,EAAE,oBAAC,SAAS,OAAG,EACxB,QAAQ,EAAE,QAAQ,IAAI,CAAC,aAAa,IAAI,YAAY,KAAK,KAAK,CAAC,EAC/D,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9C,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,IAEd,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,OAAO,CAAC,CAC/B,CACZ;YACD,oBAAC,MAAM,IACH,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,oBAAC,SAAS,OAAG,IAEvB,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,WAAW,CAAC,CACnC,CACG,CACX,CACZ,CAAC;AACN,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport {\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n TextField,\n Button,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\n\nimport { Check as CheckIcon, Close as CloseIcon, Language as LanguageIcon } from '@mui/icons-material';\n\nimport { I18n } from '../i18n';\nimport type { IobTheme } from '../types';\nimport { Utils } from './Utils';\n\nconst styles: Record<string, any> = {\n modalDialog: {\n minWidth: 400,\n maxWidth: 800,\n },\n overflowHidden: {\n display: 'flex',\n overflow: 'hidden',\n },\n titleIcon: {\n marginRight: 5,\n },\n content: {\n fontSize: 16,\n },\n languageButton: {\n position: 'absolute',\n right: 8,\n top: 8,\n },\n languageButtonActive: (theme: IobTheme) => ({\n color: theme.palette.primary.main,\n }),\n};\n\ninterface CustomModalProps {\n icon?: any;\n open: boolean;\n onClose: () => void;\n children: React.JSX.Element | null;\n titleButtonClose?: string;\n titleButtonApply?: string;\n onApply: (result: string) => void;\n fullWidth?: boolean;\n maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n applyButton?: boolean;\n applyDisabled?: boolean;\n overflowHidden?: boolean;\n help?: string;\n noTranslation?: boolean;\n toggleTranslation?: () => void;\n title?: string;\n progress?: boolean;\n textInput?: boolean;\n defaultValue?: string;\n theme: IobTheme;\n}\n\nexport function CustomModal(props: CustomModalProps): React.JSX.Element {\n const {\n open,\n toggleTranslation,\n noTranslation,\n title,\n fullWidth,\n help,\n maxWidth,\n progress,\n icon,\n applyDisabled,\n applyButton,\n onClose,\n children,\n titleButtonApply,\n titleButtonClose,\n onApply,\n textInput,\n defaultValue,\n overflowHidden,\n } = props;\n\n const [value, setValue] = useState<string>(defaultValue || '');\n\n useEffect(() => {\n setValue(defaultValue || '');\n }, [defaultValue]);\n\n const muiTheme = useTheme();\n const isSmallScreen = useMediaQuery(muiTheme.breakpoints.down('md'));\n\n let Icon = null;\n\n if (icon) {\n Icon = icon;\n }\n\n return (\n <Dialog\n open={open}\n maxWidth={isSmallScreen ? false : maxWidth || 'md'}\n fullWidth={!!fullWidth}\n fullScreen={isSmallScreen}\n disableEscapeKeyDown={false}\n onClose={onClose}\n sx={{ '& .MuiDialog-paper': isSmallScreen ? {} : styles.modalDialog }}\n >\n {title && (\n <DialogTitle>\n {icon ? <Icon style={styles.titleIcon} /> : null}\n {title}\n {I18n.getLanguage() !== 'en' && toggleTranslation ? (\n <IconButton\n size=\"large\"\n sx={Utils.getStyle(\n props.theme,\n styles.languageButton,\n noTranslation && styles.languageButtonActive,\n )}\n onClick={() => toggleTranslation()}\n title={I18n.t('Disable/Enable translation')}\n >\n <LanguageIcon />\n </IconButton>\n ) : null}\n </DialogTitle>\n )}\n <DialogContent\n style={{ ...styles.content, ...(overflowHidden ? styles.overflowHidden : undefined), paddingTop: 8 }}\n >\n {textInput && (\n <TextField\n // className={className}\n autoComplete=\"off\"\n fullWidth\n autoFocus\n variant=\"outlined\"\n size=\"medium\"\n // rows={10}\n multiline\n value={value}\n onChange={e => setValue(e.target.value)}\n // customValue\n />\n )}\n {children}\n {help ? <div>{help}</div> : null}\n </DialogContent>\n <DialogActions>\n {applyButton !== false && (\n <Button\n startIcon={<CheckIcon />}\n disabled={progress || (applyDisabled && defaultValue === value)}\n onClick={() => onApply(textInput ? value : '')}\n variant=\"contained\"\n color=\"primary\"\n >\n {I18n.t(titleButtonApply || 'ra_Ok')}\n </Button>\n )}\n <Button\n color=\"grey\"\n onClick={onClose}\n disabled={progress}\n variant=\"contained\"\n startIcon={<CloseIcon />}\n >\n {I18n.t(titleButtonClose || 'ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { Types } from '@iobroker/type-detector';
3
+ export type TypesExtended = Types | 'invalid' | 'hub3' | 'node' | 'hub5' | 'controller';
4
+ export interface IconProps {
5
+ /** URL, UTF-8 character, or svg code (data:image/svg...) */
6
+ src?: string | React.JSX.Element | null | undefined;
7
+ /** Class name */
8
+ className?: string;
9
+ /** Style for image */
10
+ style?: React.CSSProperties;
11
+ /** Styles for mui */
12
+ sx?: Record<string, any>;
13
+ /** Tooltip */
14
+ title?: string | true;
15
+ /** Styles for utf-8 characters */
16
+ styleUTF8?: React.CSSProperties;
17
+ /** On error handler */
18
+ onError?: React.ReactEventHandler<HTMLImageElement>;
19
+ /** Reference to image */
20
+ ref?: React.RefObject<HTMLImageElement>;
21
+ /** Alternative text for image */
22
+ alt?: string;
23
+ /** On click handler */
24
+ onClick?: React.MouseEventHandler<any>;
25
+ }
26
+ export type TypeIconProps = IconProps & {
27
+ type?: TypesExtended;
28
+ };
29
+ export declare function DeviceTypeIcon(props: TypeIconProps): React.JSX.Element | null;
@@ -0,0 +1,108 @@
1
+ import React, { useEffect } from 'react';
2
+ import { Box, Tooltip } from '@mui/material';
3
+ import { AiOutlineLineChart as TypeIconChart } from 'react-icons/ai';
4
+ import { GoDeviceCameraVideo as TypeIconCamera } from 'react-icons/go';
5
+ import {
6
+ // FaExternalLinkSquareAlt as TypeIconURL,
7
+ FaImage as TypeIconImage, FaRegLightbulb as TypeIconDimmer, FaInfoCircle as TypeIconInfo, FaLightbulb as TypeIconLight, FaLock as TypeIconLock, FaStreetView as TypeIconLocation, FaStepForward as TypeIconMedia, FaSlidersH as TypeIconSlider, FaVolumeDown as TypeIconVolume, FaVolumeUp as TypeIconVolumeGroup, FaFan as TypeIconAC, FaWrench as TypeIconInstance, } from 'react-icons/fa';
8
+ import { MdFormatColorFill as TypeIconHUE, MdFormatColorFill as TypeIconCT, MdWarning as TypeIconWarning, MdQuestionMark as TypeIconUnknown, MdOutlineMyLocation as TypeIconLocationOne, MdDeviceHub as TypeIconHub3, MdPolyline as TypeIconNode, MdHub as TypeIconHub5, MdControlCamera as TypeIconController, } from 'react-icons/md';
9
+ import { WiCloudy as TypeIconWeather } from 'react-icons/wi';
10
+ import { IoIosRadioButtonOn as TypeIconButtonSensor } from 'react-icons/io';
11
+ import { TbSunElectricity as TypeIconIlluminance } from 'react-icons/tb';
12
+ import { PiPaletteDuotone as TypeIconRGBWSingle } from 'react-icons/pi';
13
+ import { Types } from '@iobroker/type-detector';
14
+ import { I18n } from '../../i18n';
15
+ import { Icon } from '../Icon';
16
+ import { Cleaner as TypeIconVacuumCleaner, Humidity as TypeIconHumidity, Jalousie as TypeIconBlinds, PushButton as TypeIconButton, DoorOpened as TypeIconDoor, FireOn as TypeIconFireAlarm, FloodOn as TypeIconFloodAlarm, Gate as TypeIconGate, MotionOn as TypeIconMotion, RGB as TypeIconRGB, Socket as TypeIconSocket, Thermometer as TypeIconTemperature, Thermostat as TypeIconThermostat,
17
+ // HeatValve as TypeIconValve,
18
+ WindowOpened as TypeIconWindow, WindowTilted as TypeIconWindowTilt, } from './icons';
19
+ import { extendDeviceTypeTranslation } from './deviceTypeTranslations';
20
+ const TYPE_ICONS = {
21
+ [Types.airCondition]: TypeIconAC,
22
+ [Types.blind]: TypeIconBlinds,
23
+ [Types.blindButtons]: TypeIconBlinds,
24
+ [Types.button]: TypeIconButton,
25
+ [Types.buttonSensor]: TypeIconButtonSensor,
26
+ [Types.camera]: TypeIconCamera,
27
+ [Types.chart]: TypeIconChart,
28
+ // [Types.url]: TypeIconURL,
29
+ [Types.image]: TypeIconImage,
30
+ [Types.dimmer]: TypeIconDimmer,
31
+ [Types.door]: TypeIconDoor,
32
+ [Types.fireAlarm]: TypeIconFireAlarm,
33
+ // @ts-expect-error special case
34
+ 'sensor.alarm.fire': TypeIconFireAlarm,
35
+ [Types.floodAlarm]: TypeIconFloodAlarm,
36
+ 'sensor.alarm.flood': TypeIconFloodAlarm,
37
+ [Types.gate]: TypeIconGate,
38
+ [Types.humidity]: TypeIconHumidity,
39
+ [Types.illuminance]: TypeIconIlluminance,
40
+ [Types.info]: TypeIconInfo,
41
+ [Types.light]: TypeIconLight,
42
+ [Types.lock]: TypeIconLock,
43
+ [Types.location]: TypeIconLocation,
44
+ [Types.locationOne]: TypeIconLocationOne,
45
+ [Types.media]: TypeIconMedia,
46
+ [Types.motion]: TypeIconMotion,
47
+ [Types.ct]: TypeIconCT,
48
+ [Types.rgb]: TypeIconRGB,
49
+ [Types.rgbSingle]: TypeIconRGB,
50
+ [Types.rgbwSingle]: TypeIconRGBWSingle,
51
+ [Types.hue]: TypeIconHUE,
52
+ [Types.cie]: TypeIconRGB,
53
+ [Types.slider]: TypeIconSlider,
54
+ [Types.socket]: TypeIconSocket,
55
+ [Types.temperature]: TypeIconTemperature,
56
+ [Types.thermostat]: TypeIconThermostat,
57
+ // [Types.valve]: TypeIconValve,
58
+ [Types.vacuumCleaner]: TypeIconVacuumCleaner,
59
+ [Types.volume]: TypeIconVolume,
60
+ [Types.volumeGroup]: TypeIconVolumeGroup,
61
+ [Types.window]: TypeIconWindow,
62
+ [Types.windowTilt]: TypeIconWindowTilt,
63
+ [Types.weatherCurrent]: TypeIconWeather,
64
+ [Types.weatherForecast]: TypeIconWeather,
65
+ [Types.warning]: TypeIconWarning,
66
+ [Types.unknown]: TypeIconUnknown,
67
+ [Types.instance]: TypeIconInstance,
68
+ // Special matter types
69
+ invalid: TypeIconWarning,
70
+ hub3: TypeIconHub3,
71
+ node: TypeIconNode,
72
+ hub5: TypeIconHub5,
73
+ controller: TypeIconController,
74
+ };
75
+ const defaultStyle = {
76
+ width: 32,
77
+ height: 32,
78
+ };
79
+ export function DeviceTypeIcon(props) {
80
+ const [loaded, setLoaded] = React.useState(false);
81
+ useEffect(() => {
82
+ if (props.title && !loaded) {
83
+ extendDeviceTypeTranslation();
84
+ setLoaded(true);
85
+ }
86
+ }, [props.title, loaded]);
87
+ if (!loaded && props.title) {
88
+ return (React.createElement(Box, { style: { ...defaultStyle, ...(props.style || undefined) }, className: props.className, sx: props.sx }));
89
+ }
90
+ // src could contain a device type too, so detect if it is a type
91
+ const type = props.type ||
92
+ (props.src ? Object.keys(TYPE_ICONS).find(type => props.src === type) : undefined);
93
+ if (!type && props.src) {
94
+ return (React.createElement(Icon, { style: defaultStyle, ...props, title: props.title === true ? undefined : props.title, src: props.src }));
95
+ }
96
+ const TypeIcon = type && TYPE_ICONS[type];
97
+ if (!TypeIcon) {
98
+ // Show the first letter of a type
99
+ return type ? (React.createElement("span", { style: { ...defaultStyle, ...(props.style || undefined) } }, type[0].toUpperCase())) : null;
100
+ }
101
+ const icon = (React.createElement(TypeIcon, { style: { ...defaultStyle, ...(props.style || undefined) }, onClick: props.onClick, className: props.className, sx: props.sx }));
102
+ if (props.title) {
103
+ return (React.createElement(Tooltip, { slotProps: { popper: { sx: { pointerEvents: 'none' } } }, title: props.title === true ? I18n.t(`type-${type}`) : props.title },
104
+ React.createElement("div", { style: { display: 'flex' } }, icon)));
105
+ }
106
+ return icon;
107
+ }
108
+ //# sourceMappingURL=DeviceTypeIcon.js.map
@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GACd,CACL,CAAC;IAEF,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,CACH,oBAAC,OAAO,IACJ,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,EACxD,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;YAElE,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,IAAI,CAAO,CACvC,CACb,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import React, { useEffect } from 'react';\n\nimport { Box, Tooltip } from '@mui/material';\n\nimport { AiOutlineLineChart as TypeIconChart } from 'react-icons/ai';\nimport { GoDeviceCameraVideo as TypeIconCamera } from 'react-icons/go';\n\nimport {\n // FaExternalLinkSquareAlt as TypeIconURL,\n FaImage as TypeIconImage,\n FaRegLightbulb as TypeIconDimmer,\n FaInfoCircle as TypeIconInfo,\n FaLightbulb as TypeIconLight,\n FaLock as TypeIconLock,\n FaStreetView as TypeIconLocation,\n FaStepForward as TypeIconMedia,\n FaSlidersH as TypeIconSlider,\n FaVolumeDown as TypeIconVolume,\n FaVolumeUp as TypeIconVolumeGroup,\n FaFan as TypeIconAC,\n FaWrench as TypeIconInstance,\n} from 'react-icons/fa';\n\nimport {\n MdFormatColorFill as TypeIconHUE,\n MdFormatColorFill as TypeIconCT,\n MdWarning as TypeIconWarning,\n MdQuestionMark as TypeIconUnknown,\n MdOutlineMyLocation as TypeIconLocationOne,\n MdDeviceHub as TypeIconHub3,\n MdPolyline as TypeIconNode,\n MdHub as TypeIconHub5,\n MdControlCamera as TypeIconController,\n} from 'react-icons/md';\nimport { WiCloudy as TypeIconWeather } from 'react-icons/wi';\nimport { IoIosRadioButtonOn as TypeIconButtonSensor } from 'react-icons/io';\nimport { TbSunElectricity as TypeIconIlluminance } from 'react-icons/tb';\nimport { PiPaletteDuotone as TypeIconRGBWSingle } from 'react-icons/pi';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\n\nimport {\n Cleaner as TypeIconVacuumCleaner,\n Humidity as TypeIconHumidity,\n Jalousie as TypeIconBlinds,\n PushButton as TypeIconButton,\n DoorOpened as TypeIconDoor,\n FireOn as TypeIconFireAlarm,\n FloodOn as TypeIconFloodAlarm,\n Gate as TypeIconGate,\n MotionOn as TypeIconMotion,\n RGB as TypeIconRGB,\n Socket as TypeIconSocket,\n Thermometer as TypeIconTemperature,\n Thermostat as TypeIconThermostat,\n // HeatValve as TypeIconValve,\n WindowOpened as TypeIconWindow,\n WindowTilted as TypeIconWindowTilt,\n type IconPropsSVG,\n} from './icons';\nimport { extendDeviceTypeTranslation } from './deviceTypeTranslations';\n\nexport type TypesExtended = Types | 'invalid' | 'hub3' | 'node' | 'hub5' | 'controller';\n\nconst TYPE_ICONS: Record<TypesExtended, React.FC<IconPropsSVG>> = {\n [Types.airCondition]: TypeIconAC,\n [Types.blind]: TypeIconBlinds,\n [Types.blindButtons]: TypeIconBlinds,\n [Types.button]: TypeIconButton,\n [Types.buttonSensor]: TypeIconButtonSensor,\n [Types.camera]: TypeIconCamera,\n [Types.chart]: TypeIconChart,\n // [Types.url]: TypeIconURL,\n [Types.image]: TypeIconImage,\n [Types.dimmer]: TypeIconDimmer,\n [Types.door]: TypeIconDoor,\n [Types.fireAlarm]: TypeIconFireAlarm,\n // @ts-expect-error special case\n 'sensor.alarm.fire': TypeIconFireAlarm,\n [Types.floodAlarm]: TypeIconFloodAlarm,\n 'sensor.alarm.flood': TypeIconFloodAlarm,\n [Types.gate]: TypeIconGate,\n [Types.humidity]: TypeIconHumidity,\n [Types.illuminance]: TypeIconIlluminance,\n [Types.info]: TypeIconInfo,\n [Types.light]: TypeIconLight,\n [Types.lock]: TypeIconLock,\n [Types.location]: TypeIconLocation,\n [Types.locationOne]: TypeIconLocationOne,\n [Types.media]: TypeIconMedia,\n [Types.motion]: TypeIconMotion,\n [Types.ct]: TypeIconCT,\n [Types.rgb]: TypeIconRGB,\n [Types.rgbSingle]: TypeIconRGB,\n [Types.rgbwSingle]: TypeIconRGBWSingle,\n [Types.hue]: TypeIconHUE,\n [Types.cie]: TypeIconRGB,\n [Types.slider]: TypeIconSlider,\n [Types.socket]: TypeIconSocket,\n [Types.temperature]: TypeIconTemperature,\n [Types.thermostat]: TypeIconThermostat,\n // [Types.valve]: TypeIconValve,\n [Types.vacuumCleaner]: TypeIconVacuumCleaner,\n [Types.volume]: TypeIconVolume,\n [Types.volumeGroup]: TypeIconVolumeGroup,\n [Types.window]: TypeIconWindow,\n [Types.windowTilt]: TypeIconWindowTilt,\n [Types.weatherCurrent]: TypeIconWeather,\n [Types.weatherForecast]: TypeIconWeather,\n [Types.warning]: TypeIconWarning,\n\n [Types.unknown]: TypeIconUnknown,\n [Types.instance]: TypeIconInstance,\n\n // Special matter types\n invalid: TypeIconWarning,\n hub3: TypeIconHub3,\n node: TypeIconNode,\n hub5: TypeIconHub5,\n controller: TypeIconController,\n};\n\nconst defaultStyle: React.CSSProperties = {\n width: 32,\n height: 32,\n};\n\nexport interface IconProps {\n /** URL, UTF-8 character, or svg code (data:image/svg...) */\n src?: string | React.JSX.Element | null | undefined;\n /** Class name */\n className?: string;\n /** Style for image */\n style?: React.CSSProperties;\n /** Styles for mui */\n sx?: Record<string, any>;\n /** Tooltip */\n title?: string | true;\n /** Styles for utf-8 characters */\n styleUTF8?: React.CSSProperties;\n /** On error handler */\n onError?: React.ReactEventHandler<HTMLImageElement>;\n /** Reference to image */\n ref?: React.RefObject<HTMLImageElement>;\n /** Alternative text for image */\n alt?: string;\n /** On click handler */\n onClick?: React.MouseEventHandler<any>;\n}\n\nexport type TypeIconProps = IconProps & { type?: TypesExtended };\n\nexport function DeviceTypeIcon(props: TypeIconProps): React.JSX.Element | null {\n const [loaded, setLoaded] = React.useState(false);\n\n useEffect(() => {\n if (props.title && !loaded) {\n extendDeviceTypeTranslation();\n setLoaded(true);\n }\n }, [props.title, loaded]);\n\n if (!loaded && props.title) {\n return (\n <Box\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n className={props.className}\n sx={props.sx}\n />\n );\n }\n // src could contain a device type too, so detect if it is a type\n const type: TypesExtended | undefined =\n props.type ||\n (props.src ? (Object.keys(TYPE_ICONS).find(type => props.src === type) as TypesExtended) : undefined);\n\n if (!type && props.src) {\n return (\n <Icon\n style={defaultStyle}\n {...props}\n title={props.title === true ? undefined : props.title}\n src={props.src}\n />\n );\n }\n\n const TypeIcon = type && TYPE_ICONS[type];\n if (!TypeIcon) {\n // Show the first letter of a type\n return type ? (\n <span style={{ ...defaultStyle, ...(props.style || undefined) }}>{type[0].toUpperCase()}</span>\n ) : null;\n }\n\n const icon = (\n <TypeIcon\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n onClick={props.onClick}\n className={props.className}\n sx={props.sx}\n />\n );\n\n if (props.title) {\n return (\n <Tooltip\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n title={props.title === true ? I18n.t(`type-${type}`) : props.title}\n >\n <div style={{ display: 'flex' }}>{icon}</div>\n </Tooltip>\n );\n }\n\n return icon;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { IconType } from 'react-icons';
2
+ export declare const STATES_NAME_ICONS: Record<string, IconType>;
@@ -0,0 +1,69 @@
1
+ import { FcElectricalSensor } from 'react-icons/fc';
2
+ import { SiBoost } from 'react-icons/si';
3
+ import { TiCogOutline as IconWorking } from 'react-icons/ti';
4
+ import { MdPermScanWifi as IconUnreach, MdPriorityHigh as IconMaintain, MdBatteryAlert as IconLowbat, MdError as IconError, MdDirections, MdGpsFixed, MdWork, MdDeveloperMode, } from 'react-icons/md';
5
+ import { AiOutlineAppstoreAdd, AiOutlineRadiusBottomleft, AiOutlineColumnHeight, AiOutlineColumnWidth, AiOutlineSwap, AiFillPauseCircle, AiOutlinePoweroff, } from 'react-icons/ai';
6
+ import { BiLastPage } from 'react-icons/bi';
7
+ import { FaCompressArrowsAlt, FaRunning, FaSun, FaCompress, FaVolumeMute, FaToggleOn, FaDoorOpen, } from 'react-icons/fa';
8
+ import { GiElectricalResistance, GiLaserPrecision, GiStopSign, GiNuclearWaste, GiMatterStates, GiTreeSwing, GiSpeedometer, GiElectric, GiLightningFrequency, } from 'react-icons/gi';
9
+ import { IoIosColorPalette, IoIosWater } from 'react-icons/io';
10
+ import { WiDaySunny, WiFire, WiHumidity, WiSmoke, WiThermometer } from 'react-icons/wi';
11
+ import { FiPower } from 'react-icons/fi';
12
+ import { HiOutlineLightBulb } from 'react-icons/hi';
13
+ import { ImPower } from 'react-icons/im';
14
+ import { WindowTilted } from './icons';
15
+ export const STATES_NAME_ICONS = {
16
+ SET: AiOutlineAppstoreAdd,
17
+ WORKING: MdWork,
18
+ UNREACH: IconUnreach,
19
+ LOWBAT: IconLowbat,
20
+ MAINTAIN: IconMaintain,
21
+ ERROR: IconError,
22
+ DIRECTION: MdDirections,
23
+ CONNECTED: IconUnreach,
24
+ ACTUAL: IconWorking,
25
+ SECOND: BiLastPage,
26
+ PRESS_LONG: FaCompressArrowsAlt,
27
+ PRESS: FaCompress,
28
+ MUTE: FaVolumeMute,
29
+ ACCURACY: GiLaserPrecision,
30
+ RADIUS: AiOutlineRadiusBottomleft,
31
+ ELEVATION: AiOutlineColumnHeight,
32
+ LATITUDE: AiOutlineColumnWidth,
33
+ LONGITUDE: AiOutlineSwap,
34
+ GPS: MdGpsFixed,
35
+ ON_ACTUAL: FaToggleOn,
36
+ ON_SET: FaToggleOn,
37
+ OPEN: FaDoorOpen,
38
+ STOP: GiStopSign,
39
+ WATER_ALARM: IoIosWater, // water
40
+ WASTE_ALARM: GiNuclearWaste,
41
+ PAUSE: AiFillPauseCircle,
42
+ STATE: GiMatterStates,
43
+ BATTERY: IconLowbat,
44
+ WASTE: GiNuclearWaste,
45
+ WATER: IoIosWater,
46
+ WORK_MODE: MdWork,
47
+ MODE: MdDeveloperMode,
48
+ POWER: AiOutlinePoweroff,
49
+ BOOST: SiBoost,
50
+ HUMIDITY: WiHumidity,
51
+ TEMPERATURE: WiThermometer,
52
+ BRIGHTNESS: WiDaySunny,
53
+ MOTION: FaRunning,
54
+ FIRE: WiFire,
55
+ WINDOW: WindowTilted,
56
+ SMOKE: WiSmoke,
57
+ SWING: GiTreeSwing,
58
+ SPEED: GiSpeedometer,
59
+ DIMMER: HiOutlineLightBulb,
60
+ ON: FiPower,
61
+ COLOR_TEMP: FaSun,
62
+ ELECTRIC_POWER: ImPower,
63
+ CURRENT: GiElectric,
64
+ VOLTAGE: GiElectricalResistance,
65
+ CONSUMPTION: FcElectricalSensor,
66
+ FREQUENCY: GiLightningFrequency,
67
+ HUE: IoIosColorPalette,
68
+ };
69
+ //# sourceMappingURL=DeviceTypeOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceTypeOptions.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EACH,cAAc,IAAI,WAAW,EAC7B,cAAc,IAAI,YAAY,EAC9B,cAAc,IAAI,UAAU,EAC5B,OAAO,IAAI,SAAS,EACpB,YAAY,EACZ,UAAU,EACV,MAAM,EACN,eAAe,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM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UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU,EAAE,QAAQ;IACjC,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,UAAU;IACtB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,kBAAkB;IAC1B,EAAE,EAAE,OAAO;IACX,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,OAAO;IACvB,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,sBAAsB;IAC/B,WAAW,EAAE,kBAAkB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,GAAG,EAAE,iBAAiB;CACzB,CAAC","sourcesContent":["import { FcElectricalSensor } from 'react-icons/fc';\nimport { SiBoost } from 'react-icons/si';\nimport { TiCogOutline as IconWorking } from 'react-icons/ti';\nimport {\n MdPermScanWifi as IconUnreach,\n MdPriorityHigh as IconMaintain,\n MdBatteryAlert as IconLowbat,\n MdError as IconError,\n MdDirections,\n MdGpsFixed,\n MdWork,\n MdDeveloperMode,\n} from 'react-icons/md';\nimport {\n AiOutlineAppstoreAdd,\n AiOutlineRadiusBottomleft,\n AiOutlineColumnHeight,\n AiOutlineColumnWidth,\n AiOutlineSwap,\n AiFillPauseCircle,\n AiOutlinePoweroff,\n} from 'react-icons/ai';\nimport { BiLastPage } from 'react-icons/bi';\nimport {\n FaCompressArrowsAlt,\n FaRunning,\n FaSun,\n FaCompress,\n FaVolumeMute,\n FaToggleOn,\n FaDoorOpen,\n} from 'react-icons/fa';\nimport {\n GiElectricalResistance,\n GiLaserPrecision,\n GiStopSign,\n GiNuclearWaste,\n GiMatterStates,\n GiTreeSwing,\n GiSpeedometer,\n GiElectric,\n GiLightningFrequency,\n} from 'react-icons/gi';\nimport { IoIosColorPalette, IoIosWater } from 'react-icons/io';\nimport { WiDaySunny, WiFire, WiHumidity, WiSmoke, WiThermometer } from 'react-icons/wi';\nimport { FiPower } from 'react-icons/fi';\nimport { HiOutlineLightBulb } from 'react-icons/hi';\nimport { ImPower } from 'react-icons/im';\nimport type { IconType } from 'react-icons';\n\nimport { WindowTilted } from './icons';\n\nexport const STATES_NAME_ICONS: Record<string, IconType> = {\n SET: AiOutlineAppstoreAdd,\n WORKING: MdWork,\n UNREACH: IconUnreach,\n LOWBAT: IconLowbat,\n MAINTAIN: IconMaintain,\n ERROR: IconError,\n DIRECTION: MdDirections,\n CONNECTED: IconUnreach,\n ACTUAL: IconWorking,\n SECOND: BiLastPage,\n PRESS_LONG: FaCompressArrowsAlt,\n PRESS: FaCompress,\n MUTE: FaVolumeMute,\n ACCURACY: GiLaserPrecision,\n RADIUS: AiOutlineRadiusBottomleft,\n ELEVATION: AiOutlineColumnHeight,\n LATITUDE: AiOutlineColumnWidth,\n LONGITUDE: AiOutlineSwap,\n GPS: MdGpsFixed,\n ON_ACTUAL: FaToggleOn,\n ON_SET: FaToggleOn,\n OPEN: FaDoorOpen,\n STOP: GiStopSign,\n WATER_ALARM: IoIosWater, // water\n WASTE_ALARM: GiNuclearWaste,\n PAUSE: AiFillPauseCircle,\n STATE: GiMatterStates,\n BATTERY: IconLowbat,\n WASTE: GiNuclearWaste,\n WATER: IoIosWater,\n WORK_MODE: MdWork,\n MODE: MdDeveloperMode,\n POWER: AiOutlinePoweroff,\n BOOST: SiBoost,\n HUMIDITY: WiHumidity,\n TEMPERATURE: WiThermometer,\n BRIGHTNESS: WiDaySunny,\n MOTION: FaRunning,\n FIRE: WiFire,\n WINDOW: WindowTilted,\n SMOKE: WiSmoke,\n SWING: GiTreeSwing,\n SPEED: GiSpeedometer,\n DIMMER: HiOutlineLightBulb,\n ON: FiPower,\n COLOR_TEMP: FaSun,\n ELECTRIC_POWER: ImPower,\n CURRENT: GiElectric,\n VOLTAGE: GiElectricalResistance,\n CONSUMPTION: FcElectricalSensor,\n FREQUENCY: GiLightningFrequency,\n HUE: IoIosColorPalette,\n};\n"]}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { Types } from '@iobroker/type-detector';
3
+ import type { ThemeType } from '../../types';
4
+ export declare function DeviceTypeSelector(props: {
5
+ themeType: ThemeType;
6
+ supportedDevices?: Types[];
7
+ unsupportedDevices?: Types[];
8
+ value?: Types | '';
9
+ onChange: (value: Types) => void;
10
+ label?: string;
11
+ style?: React.CSSProperties;
12
+ sx?: Record<string, any>;
13
+ disabled?: boolean;
14
+ error?: boolean;
15
+ /** Show icons for applications: google, amazon, material, alias. Used in devices */
16
+ showApplications?: {
17
+ TYPE_OPTIONS: Partial<Record<Types, Record<string, boolean>>>;
18
+ ICONS_TYPE: Record<string, React.JSX.Element>;
19
+ };
20
+ }): React.JSX.Element;
@@ -0,0 +1,83 @@
1
+ import React, { useEffect } from 'react';
2
+ import { Box, FormControl, InputLabel, MenuItem, Select } from '@mui/material';
3
+ import { Types } from '@iobroker/type-detector';
4
+ import { I18n } from '../../i18n';
5
+ import { Icon } from '../Icon';
6
+ import { DeviceTypeIcon } from './DeviceTypeIcon';
7
+ import { extendDeviceTypeTranslation } from './deviceTypeTranslations';
8
+ const styles = {
9
+ itemChildrenWrapper: {
10
+ display: 'flex',
11
+ width: '100%',
12
+ justifyContent: 'space-between',
13
+ },
14
+ type: {
15
+ marginTop: 10,
16
+ },
17
+ selectIcon: {
18
+ paddingRight: 8,
19
+ verticalAlign: 'middle',
20
+ width: 20,
21
+ height: 20,
22
+ },
23
+ selectText: {
24
+ verticalAlign: 'middle',
25
+ },
26
+ iconWrapper: {
27
+ display: 'flex',
28
+ alignItems: 'center',
29
+ },
30
+ iconStyle: {
31
+ width: 16,
32
+ height: 16,
33
+ margin: '0 3px',
34
+ },
35
+ emptyIcon: {
36
+ width: 16,
37
+ height: 16,
38
+ margin: '0 3px',
39
+ },
40
+ };
41
+ export function DeviceTypeSelector(props) {
42
+ const [typesWords, setTypesWords] = React.useState({});
43
+ const [types, setTypes] = React.useState([]);
44
+ useEffect(() => {
45
+ const _typesWords = {};
46
+ Object.keys(Types)
47
+ .filter(id => (!props.supportedDevices || props.supportedDevices?.includes(id)) &&
48
+ !props.unsupportedDevices?.includes(id))
49
+ .forEach(typeId => (_typesWords[typeId] = I18n.t(`type-${Types[typeId]}`)));
50
+ // sort types by ABC in the current language
51
+ const _types = Object.keys(_typesWords);
52
+ _types.sort((a, b) => {
53
+ if (_typesWords[a] === _typesWords[b]) {
54
+ return 0;
55
+ }
56
+ return _typesWords[a].localeCompare(_typesWords[b], 'de');
57
+ });
58
+ extendDeviceTypeTranslation();
59
+ setTypes(_types);
60
+ setTypesWords(_typesWords);
61
+ }, [props.supportedDevices, props.unsupportedDevices]);
62
+ if (!types) {
63
+ return (React.createElement(Box, { style: {
64
+ ...styles.type,
65
+ ...props.style,
66
+ }, sx: props.sx }));
67
+ }
68
+ return (React.createElement(FormControl, { style: {
69
+ ...styles.type,
70
+ ...props.style,
71
+ }, sx: props.sx, variant: "standard", error: !!props.error },
72
+ React.createElement(InputLabel, null, props.label || I18n.t('type-Device type')),
73
+ React.createElement(Select, { variant: "standard", disabled: !!props.disabled, value: props.value, onChange: e => props.onChange(e.target.value) }, types.map(typeId => (React.createElement(MenuItem, { key: Types[typeId], value: Types[typeId] },
74
+ React.createElement("div", { style: styles.itemChildrenWrapper },
75
+ React.createElement("div", null,
76
+ React.createElement(DeviceTypeIcon, { type: Types[typeId], style: {
77
+ ...styles.selectIcon,
78
+ color: props.themeType === 'dark' ? '#FFFFFF' : '#000',
79
+ } }),
80
+ React.createElement("span", { style: styles.selectText }, typesWords[typeId])),
81
+ props.showApplications?.TYPE_OPTIONS[typeId] ? (React.createElement("div", { style: styles.iconWrapper }, Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key => props.showApplications.TYPE_OPTIONS[typeId][key] ? (React.createElement(Icon, { key: key, style: styles.iconStyle, src: props.showApplications.ICONS_TYPE[key] })) : (React.createElement("div", { key: key, style: styles.emptyIcon }))))) : null)))))));
82
+ }
83
+ //# sourceMappingURL=DeviceTypeSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceTypeSelector.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,MAAM,GAGR;IACA,mBAAmB,EAAE;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,eAAe;KAClC;IACD,IAAI,EAAE;QACF,SAAS,EAAE,EAAE;KAChB;IACD,UAAU,EAAE;QACR,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACb;IACD,UAAU,EAAE;QACR,aAAa,EAAE,QAAQ;KAC1B;IACD,WAAW,EAAE;QACT,OAAO,EAAE,MAAM;QACf,UAAU,EAA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oBACI,oBAAC,cAAc,IACX,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EACnB,KAAK,EAAE;4BACH,GAAG,MAAM,CAAC,UAAU;4BACpB,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;yBACzD,GACH;oBACF,8BAAM,KAAK,EAAE,MAAM,CAAC,UAAU,IAAG,UAAU,CAAC,MAAM,CAAC,CAAQ,CACzD;gBACL,KAAK,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5C,6BAAK,KAAK,EAAE,MAAM,CAAC,WAAW,IACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAChE,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/C,oBAAC,IAAI,IACD,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,CAAC,SAAS,EACvB,GAAG,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,6BACI,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,CAAC,SAAS,GACzB,CACL,CACJ,CACC,CACT,CAAC,CAAC,CAAC,IAAI,CACN,CACC,CACd,CAAC,CACG,CACC,CACjB,CAAC;AACN,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport { Box, FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\nimport type { ThemeType } from '../../types';\n\nimport { DeviceTypeIcon } from './DeviceTypeIcon';\nimport { extendDeviceTypeTranslation } from './deviceTypeTranslations';\n\nconst styles: Record<\n 'itemChildrenWrapper' | 'type' | 'selectIcon' | 'selectText' | 'iconWrapper' | 'iconStyle' | 'emptyIcon',\n React.CSSProperties\n> = {\n itemChildrenWrapper: {\n display: 'flex',\n width: '100%',\n justifyContent: 'space-between',\n },\n type: {\n marginTop: 10,\n },\n selectIcon: {\n paddingRight: 8,\n verticalAlign: 'middle',\n width: 20,\n height: 20,\n },\n selectText: {\n verticalAlign: 'middle',\n },\n iconWrapper: {\n display: 'flex',\n alignItems: 'center',\n },\n iconStyle: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n emptyIcon: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n};\n\nexport function DeviceTypeSelector(props: {\n themeType: ThemeType;\n supportedDevices?: Types[];\n unsupportedDevices?: Types[];\n value?: Types | '';\n onChange: (value: Types) => void;\n label?: string;\n style?: React.CSSProperties;\n sx?: Record<string, any>;\n disabled?: boolean;\n error?: boolean;\n /** Show icons for applications: google, amazon, material, alias. Used in devices */\n showApplications?: {\n TYPE_OPTIONS: Partial<Record<Types, Record<string, boolean>>>;\n ICONS_TYPE: Record<string, React.JSX.Element>;\n };\n}): React.JSX.Element {\n const [typesWords, setTypesWords] = React.useState<Partial<Record<Types, string>>>({});\n const [types, setTypes] = React.useState<Types[] | null>([]);\n\n useEffect(() => {\n const _typesWords: Partial<Record<Types, string>> = {};\n Object.keys(Types)\n .filter(\n id =>\n (!props.supportedDevices || props.supportedDevices?.includes(id as Types)) &&\n !props.unsupportedDevices?.includes(id as Types),\n )\n .forEach(typeId => (_typesWords[typeId as Types] = I18n.t(`type-${Types[typeId as Types]}`)));\n\n // sort types by ABC in the current language\n const _types: Types[] = Object.keys(_typesWords) as Types[];\n\n _types.sort((a, b) => {\n if (_typesWords[a] === _typesWords[b]) {\n return 0;\n }\n return _typesWords[a].localeCompare(_typesWords[b], 'de');\n });\n\n extendDeviceTypeTranslation();\n\n setTypes(_types);\n setTypesWords(_typesWords);\n }, [props.supportedDevices, props.unsupportedDevices]);\n\n if (!types) {\n return (\n <Box\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n />\n );\n }\n\n return (\n <FormControl\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n variant=\"standard\"\n error={!!props.error}\n >\n <InputLabel>{props.label || I18n.t('type-Device type')}</InputLabel>\n <Select\n variant=\"standard\"\n disabled={!!props.disabled}\n value={props.value}\n onChange={e => props.onChange(e.target.value as Types)}\n >\n {types.map(typeId => (\n <MenuItem\n key={Types[typeId]}\n value={Types[typeId]}\n >\n <div style={styles.itemChildrenWrapper}>\n <div>\n <DeviceTypeIcon\n type={Types[typeId]}\n style={{\n ...styles.selectIcon,\n color: props.themeType === 'dark' ? '#FFFFFF' : '#000',\n }}\n />\n <span style={styles.selectText}>{typesWords[typeId]}</span>\n </div>\n {props.showApplications?.TYPE_OPTIONS[typeId] ? (\n <div style={styles.iconWrapper}>\n {Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key =>\n props.showApplications.TYPE_OPTIONS[typeId][key] ? (\n <Icon\n key={key}\n style={styles.iconStyle}\n src={props.showApplications.ICONS_TYPE[key]}\n />\n ) : (\n <div\n key={key}\n style={styles.emptyIcon}\n />\n ),\n )}\n </div>\n ) : null}\n </div>\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function extendDeviceTypeTranslation(): void;
@@ -0,0 +1,30 @@
1
+ import { I18n } from '../../i18n';
2
+ import enLang from './i18n/en.json';
3
+ import deLang from './i18n/de.json';
4
+ import ruLang from './i18n/ru.json';
5
+ import ptLang from './i18n/pt.json';
6
+ import plLang from './i18n/pl.json';
7
+ import frLang from './i18n/fr.json';
8
+ import itLang from './i18n/it.json';
9
+ import nlLang from './i18n/nl.json';
10
+ import ukLang from './i18n/uk.json';
11
+ import zhLang from './i18n/zh-cn.json';
12
+ let translationLoaded = false;
13
+ export function extendDeviceTypeTranslation() {
14
+ if (!translationLoaded) {
15
+ translationLoaded = true;
16
+ I18n.extendTranslations({
17
+ en: enLang,
18
+ de: deLang,
19
+ ru: ruLang,
20
+ pt: ptLang,
21
+ pl: plLang,
22
+ fr: frLang,
23
+ it: itLang,
24
+ nl: nlLang,
25
+ uk: ukLang,
26
+ 'zh-cn': zhLang,
27
+ });
28
+ }
29
+ }
30
+ //# sourceMappingURL=deviceTypeTranslations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceTypeTranslations.js","sourceRoot":"./src/","sources":["Components/DeviceType/deviceTypeTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,MAAM,UAAU,2BAA2B;IACvC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACrB,iBAAiB,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,kBAAkB,CAAC;YACpB,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,OAAO,EAAE,MAAM;SAClB,CAAC,CAAC;IACP,CAAC;AACL,CAAC","sourcesContent":["import { I18n } from '../../i18n';\nimport enLang from './i18n/en.json';\nimport deLang from './i18n/de.json';\nimport ruLang from './i18n/ru.json';\nimport ptLang from './i18n/pt.json';\nimport plLang from './i18n/pl.json';\nimport frLang from './i18n/fr.json';\nimport itLang from './i18n/it.json';\nimport nlLang from './i18n/nl.json';\nimport ukLang from './i18n/uk.json';\nimport zhLang from './i18n/zh-cn.json';\n\nlet translationLoaded = false;\nexport function extendDeviceTypeTranslation(): void {\n if (!translationLoaded) {\n translationLoaded = true;\n I18n.extendTranslations({\n en: enLang,\n de: deLang,\n ru: ruLang,\n pt: ptLang,\n pl: plLang,\n fr: frLang,\n it: itLang,\n nl: nlLang,\n uk: ukLang,\n 'zh-cn': zhLang,\n });\n }\n}\n"]}
@@ -0,0 +1,46 @@
1
+ {
2
+ "type-Device type": "Gerätetyp",
3
+ "type-airCondition": "Klimaanlage",
4
+ "type-blind": "Jalousien",
5
+ "type-blindButtons": "Jalousie über Tasten gesteuert",
6
+ "type-button": "Taste",
7
+ "type-buttonSensor": "Taste mit Rückmeldung",
8
+ "type-camera": "Kamera",
9
+ "type-chart": "Diagramm",
10
+ "type-cie": "CIE Farblicht",
11
+ "type-ct": "Farbtemperatur",
12
+ "type-dimmer": "Dimmer",
13
+ "type-door": "Türsensor",
14
+ "type-fireAlarm": "Feueralarm",
15
+ "type-floodAlarm": "Wasseralarm",
16
+ "type-gate": "Tor-Steuerung",
17
+ "type-hue": "HUE-Licht",
18
+ "type-humidity": "Feuchtigkeit",
19
+ "type-illuminance": "Beleuchtungsstärke",
20
+ "type-image": "Bild",
21
+ "type-info": "Information",
22
+ "type-instance": "Instanz",
23
+ "type-light": "Licht",
24
+ "type-location": "Position",
25
+ "type-locationOne": "Position als ein Zustand",
26
+ "type-lock": "Schloss",
27
+ "type-media": "Mediaplayer",
28
+ "type-motion": "Bewegungssensor",
29
+ "type-rgb": "RGB-Licht",
30
+ "type-rgbSingle": "R,G,B-Licht Einzelwerte",
31
+ "type-rgbwSingle": "R,G,B,W-Licht Einzelwerte",
32
+ "type-slider": "Schieberegler",
33
+ "type-socket": "Steckdose",
34
+ "type-temperature": "Temperatur",
35
+ "type-thermostat": "Thermostat",
36
+ "type-url": "URL",
37
+ "type-vacuumCleaner": "Staubsauger",
38
+ "type-valve": "Ventil",
39
+ "type-volume": "Lautstärke",
40
+ "type-volumeGroup": "Lautstärke-Gruppe",
41
+ "type-warning": "Warnung",
42
+ "type-weatherCurrent": "Aktuelle Wetterlage",
43
+ "type-weatherForecast": "Wettervorhersage",
44
+ "type-window": "Fenstersensor",
45
+ "type-windowTilt": "Fensterkippung-Sensor"
46
+ }