@iobroker/adapter-react-v5 4.13.0 → 4.13.2

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 (464) hide show
  1. package/AdminConnection.js.map +1 -1
  2. package/Components/404.js +13 -13
  3. package/Components/404.js.map +1 -0
  4. package/Components/ColorPicker.js +54 -54
  5. package/Components/ColorPicker.js.map +1 -1
  6. package/Components/ComplexCron.js.map +1 -1
  7. package/Components/CustomModal.js.map +1 -0
  8. package/Components/FileBrowser.js +5 -1
  9. package/Components/FileBrowser.js.map +1 -0
  10. package/Components/FileViewer.js.map +1 -0
  11. package/Components/Icon.js.map +1 -0
  12. package/Components/IconPicker.js.map +1 -0
  13. package/Components/IconSelector.js.map +1 -0
  14. package/Components/Image.js.map +1 -0
  15. package/Components/JsonConfigComponent/ChipInput.d.ts +12 -0
  16. package/Components/JsonConfigComponent/ChipInput.js +763 -0
  17. package/Components/JsonConfigComponent/ChipInput.js.map +1 -0
  18. package/Components/JsonConfigComponent/ConfigAccordion.d.ts +15 -0
  19. package/Components/JsonConfigComponent/ConfigAccordion.js +348 -0
  20. package/Components/JsonConfigComponent/ConfigAccordion.js.map +1 -0
  21. package/Components/JsonConfigComponent/ConfigAlive.d.ts +10 -0
  22. package/Components/JsonConfigComponent/ConfigAlive.js +105 -0
  23. package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -0
  24. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +37 -0
  25. package/Components/JsonConfigComponent/ConfigAutocomplete.js +73 -0
  26. package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -0
  27. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +17 -0
  28. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +131 -0
  29. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -0
  30. package/Components/JsonConfigComponent/ConfigCRON.d.ts +15 -0
  31. package/Components/JsonConfigComponent/ConfigCRON.js +157 -0
  32. package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -0
  33. package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +14 -0
  34. package/Components/JsonConfigComponent/ConfigCertCollection.js +128 -0
  35. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -0
  36. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
  37. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +149 -0
  38. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -0
  39. package/Components/JsonConfigComponent/ConfigCertificates.d.ts +14 -0
  40. package/Components/JsonConfigComponent/ConfigCertificates.js +284 -0
  41. package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -0
  42. package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +3 -0
  43. package/Components/JsonConfigComponent/ConfigCheckLicense.js +821 -0
  44. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -0
  45. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +15 -0
  46. package/Components/JsonConfigComponent/ConfigCheckbox.js +40 -0
  47. package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -0
  48. package/Components/JsonConfigComponent/ConfigChip.d.ts +14 -0
  49. package/Components/JsonConfigComponent/ConfigChip.js +120 -0
  50. package/Components/JsonConfigComponent/ConfigChip.js.map +1 -0
  51. package/Components/JsonConfigComponent/ConfigColor.d.ts +22 -0
  52. package/Components/JsonConfigComponent/ConfigColor.js +120 -0
  53. package/Components/JsonConfigComponent/ConfigColor.js.map +1 -0
  54. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
  55. package/Components/JsonConfigComponent/ConfigCoordinates.js +265 -0
  56. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -0
  57. package/Components/JsonConfigComponent/ConfigCustom.d.ts +26 -0
  58. package/Components/JsonConfigComponent/ConfigCustom.js +316 -0
  59. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -0
  60. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
  61. package/Components/JsonConfigComponent/ConfigDatePicker.js +91 -0
  62. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -0
  63. package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +6 -0
  64. package/Components/JsonConfigComponent/ConfigDeviceManager.js +18 -0
  65. package/Components/JsonConfigComponent/ConfigFile.d.ts +15 -0
  66. package/Components/JsonConfigComponent/ConfigFile.js +228 -0
  67. package/Components/JsonConfigComponent/ConfigFile.js.map +1 -0
  68. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
  69. package/Components/JsonConfigComponent/ConfigFileSelector.js +625 -0
  70. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
  71. package/Components/JsonConfigComponent/ConfigFunc.d.ts +14 -0
  72. package/Components/JsonConfigComponent/ConfigFunc.js +124 -0
  73. package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -0
  74. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +95 -0
  75. package/Components/JsonConfigComponent/ConfigGeneric.js +646 -0
  76. package/Components/JsonConfigComponent/ConfigIP.d.ts +14 -0
  77. package/Components/JsonConfigComponent/ConfigIP.js +130 -0
  78. package/Components/JsonConfigComponent/ConfigIP.js.map +1 -0
  79. package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +10 -0
  80. package/Components/JsonConfigComponent/ConfigImageSendTo.js +114 -0
  81. package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +1 -0
  82. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
  83. package/Components/JsonConfigComponent/ConfigImageUpload.js +166 -0
  84. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -0
  85. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
  86. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +264 -0
  87. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -0
  88. package/Components/JsonConfigComponent/ConfigInterface.d.ts +14 -0
  89. package/Components/JsonConfigComponent/ConfigInterface.js +146 -0
  90. package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -0
  91. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +13 -0
  92. package/Components/JsonConfigComponent/ConfigJsonEditor.js +145 -0
  93. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -0
  94. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +7 -0
  95. package/Components/JsonConfigComponent/ConfigLanguage.js +110 -0
  96. package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -0
  97. package/Components/JsonConfigComponent/ConfigLicense.d.ts +24 -0
  98. package/Components/JsonConfigComponent/ConfigLicense.js +183 -0
  99. package/Components/JsonConfigComponent/ConfigLicense.js.map +1 -0
  100. package/Components/JsonConfigComponent/ConfigNumber.d.ts +17 -0
  101. package/Components/JsonConfigComponent/ConfigNumber.js +117 -0
  102. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
  103. package/Components/JsonConfigComponent/ConfigObjectId.js +167 -0
  104. package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -0
  105. package/Components/JsonConfigComponent/ConfigPanel.d.ts +3 -0
  106. package/Components/JsonConfigComponent/ConfigPanel.js +396 -0
  107. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -0
  108. package/Components/JsonConfigComponent/ConfigPassword.d.ts +14 -0
  109. package/Components/JsonConfigComponent/ConfigPassword.js +193 -0
  110. package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -0
  111. package/Components/JsonConfigComponent/ConfigPattern.d.ts +21 -0
  112. package/Components/JsonConfigComponent/ConfigPattern.js +65 -0
  113. package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -0
  114. package/Components/JsonConfigComponent/ConfigPort.d.ts +3 -0
  115. package/Components/JsonConfigComponent/ConfigPort.js +176 -0
  116. package/Components/JsonConfigComponent/ConfigRoom.d.ts +14 -0
  117. package/Components/JsonConfigComponent/ConfigRoom.js +124 -0
  118. package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -0
  119. package/Components/JsonConfigComponent/ConfigSelect.d.ts +14 -0
  120. package/Components/JsonConfigComponent/ConfigSelect.js +159 -0
  121. package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -0
  122. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
  123. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +272 -0
  124. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -0
  125. package/Components/JsonConfigComponent/ConfigSendto.d.ts +24 -0
  126. package/Components/JsonConfigComponent/ConfigSendto.js +294 -0
  127. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -0
  128. package/Components/JsonConfigComponent/ConfigSetState.d.ts +18 -0
  129. package/Components/JsonConfigComponent/ConfigSetState.js +185 -0
  130. package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -0
  131. package/Components/JsonConfigComponent/ConfigSlider.d.ts +14 -0
  132. package/Components/JsonConfigComponent/ConfigSlider.js +119 -0
  133. package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -0
  134. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
  135. package/Components/JsonConfigComponent/ConfigStaticDivider.js +68 -0
  136. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -0
  137. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
  138. package/Components/JsonConfigComponent/ConfigStaticHeader.js +81 -0
  139. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -0
  140. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
  141. package/Components/JsonConfigComponent/ConfigStaticImage.js +71 -0
  142. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -0
  143. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
  144. package/Components/JsonConfigComponent/ConfigStaticText.js +88 -0
  145. package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -0
  146. package/Components/JsonConfigComponent/ConfigTable.d.ts +3 -0
  147. package/Components/JsonConfigComponent/ConfigTable.js +1064 -0
  148. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -0
  149. package/Components/JsonConfigComponent/ConfigTabs.d.ts +34 -0
  150. package/Components/JsonConfigComponent/ConfigTabs.js +162 -0
  151. package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -0
  152. package/Components/JsonConfigComponent/ConfigText.d.ts +14 -0
  153. package/Components/JsonConfigComponent/ConfigText.js +226 -0
  154. package/Components/JsonConfigComponent/ConfigText.js.map +1 -0
  155. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
  156. package/Components/JsonConfigComponent/ConfigTextSendTo.js +129 -0
  157. package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -0
  158. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
  159. package/Components/JsonConfigComponent/ConfigTimePicker.js +85 -0
  160. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -0
  161. package/Components/JsonConfigComponent/ConfigTopic.d.ts +17 -0
  162. package/Components/JsonConfigComponent/ConfigTopic.js +110 -0
  163. package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -0
  164. package/Components/JsonConfigComponent/ConfigUUID.d.ts +15 -0
  165. package/Components/JsonConfigComponent/ConfigUUID.js +95 -0
  166. package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -0
  167. package/Components/JsonConfigComponent/ConfigUser.d.ts +14 -0
  168. package/Components/JsonConfigComponent/ConfigUser.js +142 -0
  169. package/Components/JsonConfigComponent/ConfigUser.js.map +1 -0
  170. package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +63 -0
  171. package/Components/JsonConfigComponent/DeviceManager/Communication.js +268 -0
  172. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +11 -0
  173. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +15 -0
  174. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +53 -0
  175. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +340 -0
  176. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +45 -0
  177. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +146 -0
  178. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +12 -0
  179. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +69 -0
  180. package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +51 -0
  181. package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +226 -0
  182. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +13 -0
  183. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +111 -0
  184. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +7 -0
  185. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +16 -0
  186. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +11 -0
  187. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +94 -0
  188. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +10 -0
  189. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +22 -0
  190. package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +12 -0
  191. package/Components/JsonConfigComponent/DeviceManager/Utils.js +158 -0
  192. package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +21 -0
  193. package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +21 -0
  194. package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +21 -0
  195. package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +21 -0
  196. package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +26 -0
  197. package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +21 -0
  198. package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +21 -0
  199. package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +21 -0
  200. package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +21 -0
  201. package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +21 -0
  202. package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +21 -0
  203. package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +21 -0
  204. package/Components/JsonConfigComponent/DeviceManager/index.d.ts +2 -0
  205. package/Components/JsonConfigComponent/DeviceManager/index.js +10 -0
  206. package/Components/JsonConfigComponent/DeviceManager/index.js.map +1 -0
  207. package/Components/JsonConfigComponent/Utils.d.ts +9 -0
  208. package/Components/JsonConfigComponent/Utils.js +13 -0
  209. package/Components/JsonConfigComponent/index.d.ts +26 -0
  210. package/Components/JsonConfigComponent/index.js +520 -0
  211. package/Components/JsonConfigComponent/index.js.map +1 -0
  212. package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +2 -0
  213. package/Components/JsonConfigComponent/wrapper/AdminConnection.js +7 -0
  214. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +2 -0
  215. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +10 -0
  216. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +1 -0
  217. package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +2 -0
  218. package/Components/JsonConfigComponent/wrapper/Components/Icon.js +10 -0
  219. package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +1 -0
  220. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +2 -0
  221. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +10 -0
  222. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +1 -0
  223. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +2 -0
  224. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +10 -0
  225. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +1 -0
  226. package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +2 -0
  227. package/Components/JsonConfigComponent/wrapper/Components/Utils.js +10 -0
  228. package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +1 -0
  229. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +2 -0
  230. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +10 -0
  231. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +1 -0
  232. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +2 -0
  233. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +10 -0
  234. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +1 -0
  235. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +2 -0
  236. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +10 -0
  237. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +1 -0
  238. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +2 -0
  239. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +10 -0
  240. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +1 -0
  241. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +2 -0
  242. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +10 -0
  243. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +1 -0
  244. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +2 -0
  245. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +10 -0
  246. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +1 -0
  247. package/Components/JsonConfigComponent/wrapper/i18n.d.ts +2 -0
  248. package/Components/JsonConfigComponent/wrapper/i18n.js +10 -0
  249. package/Components/JsonConfigComponent/wrapper/i18n.js.map +1 -0
  250. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +2 -0
  251. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +10 -0
  252. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +1 -0
  253. package/Components/Loader.js +223 -223
  254. package/Components/Loader.js.map +1 -0
  255. package/Components/Loaders/PT.css +108 -108
  256. package/Components/Loaders/PT.js +103 -103
  257. package/Components/Loaders/PT.js.map +1 -0
  258. package/Components/Loaders/Vendor.css +13 -13
  259. package/Components/Loaders/Vendor.js +7 -7
  260. package/Components/Loaders/Vendor.js.map +1 -0
  261. package/Components/Logo.js.map +1 -0
  262. package/Components/MDUtils.js.map +1 -0
  263. package/Components/ObjectBrowser.js +344 -344
  264. package/Components/ObjectBrowser.js.map +1 -1
  265. package/Components/Router.js.map +1 -0
  266. package/Components/SaveCloseButtons.js.map +1 -0
  267. package/Components/Schedule.js.map +1 -0
  268. package/Components/SelectWithIcon.js.map +1 -0
  269. package/Components/SimpleCron/cron2text.js.map +1 -0
  270. package/Components/SimpleCron/cronText.js.map +1 -0
  271. package/Components/SimpleCron/index.js.map +1 -0
  272. package/Components/SimpleCron/jquery.cron.locale.js.map +1 -0
  273. package/Components/TabContainer.js.map +1 -0
  274. package/Components/TabContent.js.map +1 -0
  275. package/Components/TabHeader.js.map +1 -0
  276. package/Components/TableResize.js +5 -5
  277. package/Components/TableResize.js.map +1 -1
  278. package/Components/TextWithIcon.js.map +1 -0
  279. package/Components/ToggleThemeMenu.js.map +1 -0
  280. package/Components/TreeTable.js +70 -70
  281. package/Components/TreeTable.js.map +1 -1
  282. package/Components/UploadImage.js +305 -305
  283. package/Components/UploadImage.js.map +1 -0
  284. package/Components/Utils.js.map +1 -0
  285. package/Components/copy-to-clipboard.d.ts +13 -0
  286. package/Components/copy-to-clipboard.js +156 -0
  287. package/Components/copy-to-clipboard.js.map +1 -0
  288. package/Components/loader.css +221 -221
  289. package/Components/types.d.ts +82 -82
  290. package/Components/withWidth.js.map +1 -1
  291. package/Connection.js.map +1 -1
  292. package/Dialogs/ComplexCron.js.map +1 -0
  293. package/Dialogs/Confirm.js.map +1 -0
  294. package/Dialogs/Cron.js.map +1 -0
  295. package/Dialogs/Error.js.map +1 -0
  296. package/Dialogs/Message.js.map +1 -0
  297. package/Dialogs/SelectFile.js.map +1 -0
  298. package/Dialogs/SelectID.js.map +1 -0
  299. package/Dialogs/SimpleCron.js.map +1 -0
  300. package/Dialogs/TextInput.js.map +1 -0
  301. package/GenericApp.d.ts +2 -2
  302. package/GenericApp.js +49 -49
  303. package/GenericApp.js.map +1 -0
  304. package/LICENSE +22 -22
  305. package/LegacyConnection.d.ts +1 -1
  306. package/LegacyConnection.js +1 -0
  307. package/LegacyConnection.js.map +1 -0
  308. package/Prompt.js +7 -7
  309. package/Prompt.js.map +1 -0
  310. package/README.md +1101 -1101
  311. package/Theme.js.map +1 -0
  312. package/assets/devices/Alarm Systems.svg +18 -18
  313. package/assets/devices/Amplifier.svg +21 -21
  314. package/assets/devices/Awnings.svg +4 -4
  315. package/assets/devices/Battery Status.svg +4 -4
  316. package/assets/devices/Ceiling Spotlights.svg +15 -15
  317. package/assets/devices/Chandelier.svg +6 -6
  318. package/assets/devices/Climate.svg +11 -11
  319. package/assets/devices/Coffee Makers.svg +5 -5
  320. package/assets/devices/Cold Water.svg +31 -31
  321. package/assets/devices/Computer.svg +21 -21
  322. package/assets/devices/Consumption.svg +7 -7
  323. package/assets/devices/Curtains.svg +43 -43
  324. package/assets/devices/Dishwashers.svg +11 -11
  325. package/assets/devices/Doors.svg +5 -5
  326. package/assets/devices/Doorstep.svg +35 -35
  327. package/assets/devices/Dryer.svg +13 -13
  328. package/assets/devices/Fan.svg +20 -20
  329. package/assets/devices/Floor Lamps.svg +4 -4
  330. package/assets/devices/Garage Doors.svg +9 -9
  331. package/assets/devices/Gates.svg +32 -32
  332. package/assets/devices/Hairdryer.svg +23 -23
  333. package/assets/devices/Handle.svg +6 -6
  334. package/assets/devices/Hanging Lamps.svg +8 -8
  335. package/assets/devices/Heater.svg +44 -44
  336. package/assets/devices/Hoods.svg +11 -11
  337. package/assets/devices/Hot Water.svg +9 -9
  338. package/assets/devices/Humidity.svg +41 -41
  339. package/assets/devices/Iron.svg +4 -4
  340. package/assets/devices/Irrigation.svg +22 -22
  341. package/assets/devices/Led Strip.svg +30 -30
  342. package/assets/devices/Light.svg +29 -29
  343. package/assets/devices/Lightings.svg +46 -46
  344. package/assets/devices/Lock.svg +19 -19
  345. package/assets/devices/Louvre.svg +6 -6
  346. package/assets/devices/Mowing Machine.svg +8 -8
  347. package/assets/devices/Music.svg +12 -12
  348. package/assets/devices/Outdoor Blinds.svg +6 -6
  349. package/assets/devices/People.svg +19 -19
  350. package/assets/devices/Pool.svg +7 -7
  351. package/assets/devices/Power Consumption.svg +12 -12
  352. package/assets/devices/Printer.svg +9 -9
  353. package/assets/devices/Pump.svg +9 -9
  354. package/assets/devices/Receiver.svg +18 -18
  355. package/assets/devices/Sconces.svg +9 -9
  356. package/assets/devices/Security.svg +34 -34
  357. package/assets/devices/Shading.svg +4 -4
  358. package/assets/devices/Shutters.svg +10 -10
  359. package/assets/devices/SmokeDetector.svg +12 -12
  360. package/assets/devices/Sockets.svg +13 -13
  361. package/assets/devices/Speaker.svg +35 -35
  362. package/assets/devices/Stove.svg +11 -11
  363. package/assets/devices/Table Lamps.svg +11 -11
  364. package/assets/devices/Temperature Sensors.svg +28 -28
  365. package/assets/devices/Tv.svg +7 -7
  366. package/assets/devices/Vacuum Cleaner.svg +15 -15
  367. package/assets/devices/Ventilation.svg +12 -12
  368. package/assets/devices/Washing Machines.svg +15 -15
  369. package/assets/devices/Water Consumption.svg +5 -5
  370. package/assets/devices/Water Heater.svg +8 -8
  371. package/assets/devices/Water.svg +40 -40
  372. package/assets/devices/Weather.svg +28 -28
  373. package/assets/devices/Window.svg +7 -7
  374. package/assets/devices/list.json +993 -993
  375. package/assets/devices/names.txt +62 -62
  376. package/assets/devices/parseNames.js +34 -34
  377. package/assets/lamp_ceiling.svg +8 -8
  378. package/assets/lamp_table.svg +7 -7
  379. package/assets/no_icon.svg +9 -9
  380. package/assets/rooms/Anteroom.svg +52 -52
  381. package/assets/rooms/Attic.svg +21 -21
  382. package/assets/rooms/Balcony.svg +12 -12
  383. package/assets/rooms/Barn.svg +5 -5
  384. package/assets/rooms/Basement.svg +4 -4
  385. package/assets/rooms/Bathroom.svg +38 -38
  386. package/assets/rooms/Bedroom.svg +5 -5
  387. package/assets/rooms/Boiler Room.svg +12 -12
  388. package/assets/rooms/Carport.svg +17 -17
  389. package/assets/rooms/Cellar.svg +89 -89
  390. package/assets/rooms/Chamber.svg +9 -9
  391. package/assets/rooms/Corridor.svg +52 -52
  392. package/assets/rooms/Dining Area.svg +37 -37
  393. package/assets/rooms/Dining Room.svg +37 -37
  394. package/assets/rooms/Dining.svg +37 -37
  395. package/assets/rooms/Dressing Room.svg +4 -4
  396. package/assets/rooms/Driveway.svg +14 -14
  397. package/assets/rooms/Entrance.svg +44 -44
  398. package/assets/rooms/Equipment Room.svg +14 -14
  399. package/assets/rooms/Front Yard.svg +64 -64
  400. package/assets/rooms/Gallery.svg +13 -13
  401. package/assets/rooms/Garage.svg +20 -20
  402. package/assets/rooms/Garden.svg +12 -12
  403. package/assets/rooms/Ground Floor.svg +95 -95
  404. package/assets/rooms/Guest Bathroom.svg +32 -32
  405. package/assets/rooms/Guest Room.svg +5 -5
  406. package/assets/rooms/Gym.svg +4 -4
  407. package/assets/rooms/Hall.svg +19 -19
  408. package/assets/rooms/Home Theater.svg +7 -7
  409. package/assets/rooms/Kitchen.svg +17 -17
  410. package/assets/rooms/Laundry Room.svg +11 -11
  411. package/assets/rooms/Living Area.svg +10 -10
  412. package/assets/rooms/Living Room.svg +10 -10
  413. package/assets/rooms/Locker Room.svg +16 -16
  414. package/assets/rooms/Nursery.svg +4 -4
  415. package/assets/rooms/Office.svg +8 -8
  416. package/assets/rooms/Outdoors.svg +7 -7
  417. package/assets/rooms/Playroom.svg +5 -5
  418. package/assets/rooms/Pool.svg +7 -7
  419. package/assets/rooms/Rear Wall.svg +30 -30
  420. package/assets/rooms/Second Floor.svg +95 -95
  421. package/assets/rooms/Shed.svg +16 -16
  422. package/assets/rooms/Sleeping Area.svg +22 -22
  423. package/assets/rooms/Stairway.svg +4 -4
  424. package/assets/rooms/Stairwell.svg +15 -15
  425. package/assets/rooms/Storeroom.svg +4 -4
  426. package/assets/rooms/Summer House.svg +27 -27
  427. package/assets/rooms/Swimming Pool.svg +21 -21
  428. package/assets/rooms/Terrace.svg +6 -6
  429. package/assets/rooms/Toilet.svg +10 -10
  430. package/assets/rooms/Upstairs.svg +5 -5
  431. package/assets/rooms/Wardrobe.svg +60 -60
  432. package/assets/rooms/Washroom.svg +19 -19
  433. package/assets/rooms/Wc.svg +10 -10
  434. package/assets/rooms/Windscreen.svg +60 -60
  435. package/assets/rooms/Workshop.svg +22 -22
  436. package/assets/rooms/Workspace.svg +8 -8
  437. package/assets/rooms/list.json +945 -945
  438. package/assets/rooms/names.txt +59 -59
  439. package/assets/rooms/parseNames.js +34 -34
  440. package/craco-module-federation.js +69 -69
  441. package/i18n.js.map +1 -0
  442. package/icons/IconAdapter.js.map +1 -1
  443. package/icons/IconAlias.js.map +1 -1
  444. package/icons/IconChannel.js.map +1 -1
  445. package/icons/IconClearFilter.js.map +1 -1
  446. package/icons/IconClosed.js.map +1 -1
  447. package/icons/IconCopy.js +8 -8
  448. package/icons/IconCopy.js.map +1 -1
  449. package/icons/IconDevice.js.map +1 -1
  450. package/icons/IconDocument.js.map +1 -1
  451. package/icons/IconDocumentReadOnly.js.map +1 -1
  452. package/icons/IconExpert.js.map +1 -0
  453. package/icons/IconFx.js +1 -1
  454. package/icons/IconFx.js.map +1 -1
  455. package/icons/IconInstance.js.map +1 -1
  456. package/icons/IconLogout.js +9 -9
  457. package/icons/IconLogout.js.map +1 -1
  458. package/icons/IconNoIcon.js +8 -8
  459. package/icons/IconNoIcon.js.map +1 -1
  460. package/icons/IconOpen.js.map +1 -1
  461. package/icons/IconState.js.map +1 -1
  462. package/index.css +54 -54
  463. package/package.json +2 -2
  464. package/types.d.ts +94 -94
@@ -0,0 +1,646 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.isObject = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const material_1 = require("@mui/material");
32
+ const icons_material_1 = require("@mui/icons-material");
33
+ const i18n_1 = __importDefault(require("./wrapper/i18n"));
34
+ const Utils_1 = __importDefault(require("./wrapper/Components/Utils"));
35
+ const Confirm_1 = __importDefault(require("./wrapper/Dialogs/Confirm"));
36
+ const Icon_1 = __importDefault(require("./wrapper/Components/Icon"));
37
+ // because this class is used in adapter-react-v5, do not include here any foreign files like from '../../helpers/utils.ts'
38
+ function isObject(it) {
39
+ // This is necessary because:
40
+ // typeof null === 'object'
41
+ // typeof [] === 'object'
42
+ // [] instanceof Object === true
43
+ return Object.prototype.toString.call(it) === '[object Object]'; // this code is 25% faster than below one
44
+ // return it && typeof it === 'object' && !(it instanceof Array);
45
+ }
46
+ exports.isObject = isObject;
47
+ class ConfigGeneric extends react_1.Component {
48
+ constructor(props) {
49
+ super(props);
50
+ this.onUpdate = (data) => {
51
+ const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';
52
+ if (this.state.value !== value) {
53
+ this.setState({ value });
54
+ }
55
+ else {
56
+ this.forceUpdate();
57
+ }
58
+ };
59
+ // @ts-expect-error of course, as we just
60
+ this.state = {
61
+ confirmDialog: false,
62
+ confirmNewValue: null,
63
+ confirmAttr: null,
64
+ confirmData: null,
65
+ };
66
+ this.isError = {};
67
+ if (props.schema) {
68
+ if (props.custom) {
69
+ this.defaultValue = props.schema.defaultFunc
70
+ ? this.executeCustom(props.schema.defaultFunc, props.schema.default, props.data, props.instanceObj, props.arrayIndex, props.globalData)
71
+ : props.schema.default;
72
+ }
73
+ else {
74
+ this.defaultValue = props.schema.defaultFunc
75
+ ? this.execute(props.schema.defaultFunc, props.schema.default, props.data, props.arrayIndex, props.globalData)
76
+ : props.schema.default;
77
+ }
78
+ }
79
+ this.lang = i18n_1.default.getLanguage();
80
+ }
81
+ componentDidMount() {
82
+ this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr, this.onUpdate);
83
+ const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];
84
+ // init default value
85
+ if (this.defaultValue !== undefined) {
86
+ const value = ConfigGeneric.getValue(this.props.data, this.props.attr);
87
+ if (value === undefined ||
88
+ (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))) {
89
+ setTimeout(() => {
90
+ if (this.props.custom) {
91
+ this.props.onChange(this.props.attr, this.defaultValue, () => setTimeout(() => this.props.forceUpdate([this.props.attr], this.props.data), 100));
92
+ }
93
+ else {
94
+ ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);
95
+ this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
96
+ }
97
+ }, 100);
98
+ }
99
+ }
100
+ else if (this.props.schema.defaultSendTo) {
101
+ this.sendTo();
102
+ }
103
+ }
104
+ sendTo() {
105
+ if (this.props.alive) {
106
+ this.defaultSendToDone = true;
107
+ let data = this.props.schema.data;
108
+ if (data === undefined && this.props.schema.jsonData) {
109
+ data = this.getPattern(this.props.schema.jsonData);
110
+ try {
111
+ data = JSON.parse(data);
112
+ }
113
+ catch (e) {
114
+ console.error(`Cannot parse json data: ${data}`);
115
+ }
116
+ }
117
+ else {
118
+ data = {
119
+ attr: this.props.attr,
120
+ value: ConfigGeneric.getValue(this.props.data, this.props.attr),
121
+ };
122
+ }
123
+ if (data === undefined) {
124
+ data = null;
125
+ }
126
+ this.props.socket
127
+ .sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.defaultSendTo, data)
128
+ .then((value) => {
129
+ if (value !== null && value !== undefined) {
130
+ if (this.props.custom) {
131
+ this.props.onChange(this.props.attr, value, () => this.props.forceUpdate([this.props.attr], this.props.data));
132
+ }
133
+ else {
134
+ ConfigGeneric.setValue(this.props.data, this.props.attr, value);
135
+ this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
136
+ }
137
+ }
138
+ });
139
+ }
140
+ else {
141
+ this.defaultSendToDone = false;
142
+ // show error, that instance did not start
143
+ this.onError(this.props.attr, i18n_1.default.t('ra_Instance %s is not alive', this.props.instance.toString()));
144
+ }
145
+ }
146
+ componentWillUnmount() {
147
+ this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr);
148
+ if (this.sendToTimeout) {
149
+ clearTimeout(this.sendToTimeout);
150
+ this.sendToTimeout = null;
151
+ }
152
+ }
153
+ /**
154
+ * Extract attribute out of data
155
+ *
156
+ * @param data
157
+ * @param attr
158
+ */
159
+ static getValue(data, attr) {
160
+ if (typeof attr === 'string') {
161
+ return ConfigGeneric.getValue(data, attr.split('.'));
162
+ }
163
+ if (attr.length === 1) {
164
+ return data[attr[0]];
165
+ }
166
+ const part = attr.shift();
167
+ if (typeof part === 'string' && typeof data[part] === 'object') {
168
+ return ConfigGeneric.getValue(data[part], attr);
169
+ }
170
+ return null;
171
+ }
172
+ static setValue(data, attr, value) {
173
+ if (typeof attr === 'string') {
174
+ ConfigGeneric.setValue(data, attr.split('.'), value);
175
+ return;
176
+ }
177
+ if (attr.length === 1) {
178
+ if (value === null) {
179
+ delete data[attr[0]];
180
+ }
181
+ else {
182
+ data[attr[0]] = value;
183
+ }
184
+ }
185
+ else {
186
+ const part = attr.shift();
187
+ if (typeof part !== 'string') {
188
+ return;
189
+ }
190
+ if (!data[part] || typeof data[part] === 'object') {
191
+ data[part] = data[part] || {};
192
+ }
193
+ ConfigGeneric.setValue(data[part], attr, value);
194
+ }
195
+ }
196
+ getText(text, noTranslation) {
197
+ if (!text) {
198
+ return '';
199
+ }
200
+ if (typeof text === 'string') {
201
+ const strText = noTranslation ? text : i18n_1.default.t(text);
202
+ if (strText.includes('${')) {
203
+ return this.getPattern(strText);
204
+ }
205
+ return strText;
206
+ }
207
+ if (isObject(text)) {
208
+ if (text.func) {
209
+ // calculate pattern
210
+ if (typeof text.func === 'object') {
211
+ return this.getPattern(text.func[this.lang] || text.func.en || '');
212
+ }
213
+ return this.getPattern(text.func);
214
+ }
215
+ return text[this.lang] || text.en || '';
216
+ }
217
+ return text.toString();
218
+ }
219
+ renderConfirmDialog() {
220
+ if (!this.state.confirmDialog) {
221
+ return null;
222
+ }
223
+ const confirm = this.state.confirmData || this.props.schema.confirm;
224
+ let icon = null;
225
+ if (confirm.type === 'warning') {
226
+ icon = react_1.default.createElement(icons_material_1.Warning, null);
227
+ }
228
+ else if (confirm.type === 'error') {
229
+ icon = react_1.default.createElement(icons_material_1.Error, null);
230
+ }
231
+ else if (confirm.type === 'info') {
232
+ icon = react_1.default.createElement(icons_material_1.Info, null);
233
+ }
234
+ return (react_1.default.createElement(Confirm_1.default, { title: this.getText(confirm.title) || i18n_1.default.t('ra_Please confirm'), text: this.getText(confirm.text), ok: this.getText(confirm.ok) || i18n_1.default.t('ra_Ok'), cancel: this.getText(confirm.cancel) || i18n_1.default.t('ra_Cancel'), icon: icon, onClose: isOk => this.setState({ confirmDialog: false }, () => {
235
+ if (isOk) {
236
+ const data = JSON.parse(JSON.stringify(this.props.data));
237
+ if (this.state.confirmDepAttr) {
238
+ ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);
239
+ }
240
+ ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);
241
+ this.setState({
242
+ confirmDialog: false,
243
+ confirmDepAttr: null,
244
+ confirmDepNewValue: null,
245
+ confirmNewValue: null,
246
+ confirmAttr: null,
247
+ confirmData: null,
248
+ }, () => this.props.onChange(data));
249
+ }
250
+ else {
251
+ this.setState({
252
+ confirmDialog: false,
253
+ confirmDepAttr: null,
254
+ confirmDepNewValue: null,
255
+ confirmNewValue: null,
256
+ confirmAttr: null,
257
+ confirmData: null,
258
+ });
259
+ }
260
+ }) }));
261
+ }
262
+ // eslint-disable-next-line react/no-unused-class-component-methods
263
+ getIcon(iconSettings) {
264
+ iconSettings = iconSettings || this.props.schema.icon;
265
+ let icon = null;
266
+ if (iconSettings === 'auth') {
267
+ icon = react_1.default.createElement(icons_material_1.Key, null);
268
+ }
269
+ else if (iconSettings === 'send') {
270
+ icon = react_1.default.createElement(icons_material_1.Send, null);
271
+ }
272
+ else if (iconSettings === 'web') {
273
+ icon = react_1.default.createElement(icons_material_1.Public, null);
274
+ }
275
+ else if (iconSettings === 'warning') {
276
+ icon = react_1.default.createElement(icons_material_1.Warning, null);
277
+ }
278
+ else if (iconSettings === 'error') {
279
+ icon = react_1.default.createElement(icons_material_1.Error, null);
280
+ }
281
+ else if (iconSettings === 'info') {
282
+ icon = react_1.default.createElement(icons_material_1.Info, null);
283
+ }
284
+ else if (iconSettings === 'search') {
285
+ icon = react_1.default.createElement(icons_material_1.Search, null);
286
+ }
287
+ else if (iconSettings === 'book') {
288
+ icon = react_1.default.createElement(icons_material_1.MenuBook, null);
289
+ }
290
+ else if (iconSettings === 'help') {
291
+ icon = react_1.default.createElement(icons_material_1.Help, null);
292
+ }
293
+ else if (iconSettings === 'upload') {
294
+ icon = react_1.default.createElement(icons_material_1.UploadFile, null);
295
+ }
296
+ else if (iconSettings) {
297
+ if (iconSettings.endsWith('.png') || iconSettings.endsWith('.svg') || iconSettings.endsWith('.jpg')) {
298
+ // this path is relative to ./adapter/NAME
299
+ if (!iconSettings.startsWith('http://') && !iconSettings.startsWith('https://')) {
300
+ iconSettings = `./adapter/${this.props.adapterName}/${iconSettings}`;
301
+ }
302
+ }
303
+ icon = react_1.default.createElement(Icon_1.default, { src: iconSettings, style: { width: 22, height: 22 } });
304
+ }
305
+ return icon;
306
+ }
307
+ /**
308
+ * Trigger onChange, to activate save button on change
309
+ *
310
+ * @param attr the changed attribute
311
+ * @param newValue new value of the attribute
312
+ */
313
+ onChangeAsync(attr, newValue) {
314
+ return new Promise(resolve => this.onChange(attr, newValue, resolve));
315
+ }
316
+ /**
317
+ * Trigger onChange, to activate save button on change
318
+ *
319
+ * @param attr the changed attribute
320
+ * @param newValue new value of the attribute
321
+ * @param cb optional callback function, else returns a Promise
322
+ */
323
+ // eslint-disable-next-line react/no-unused-class-component-methods
324
+ onChange(attr, newValue, cb) {
325
+ // Do not use here deep copy, as it is not JsonConfig
326
+ const data = JSON.parse(JSON.stringify(this.props.data));
327
+ ConfigGeneric.setValue(data, attr, newValue);
328
+ if (this.props.schema.confirm &&
329
+ this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
330
+ return new Promise(resolve => {
331
+ this.setState({
332
+ confirmDialog: true,
333
+ confirmNewValue: newValue,
334
+ confirmAttr: attr,
335
+ confirmData: null,
336
+ }, () => {
337
+ if (typeof cb === 'function') {
338
+ cb();
339
+ }
340
+ else {
341
+ resolve();
342
+ }
343
+ });
344
+ });
345
+ }
346
+ // find any inputs with confirmation
347
+ if (this.props.schema.confirmDependsOn) {
348
+ for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {
349
+ const dep = this.props.schema.confirmDependsOn[z];
350
+ if (dep.confirm) {
351
+ const val = ConfigGeneric.getValue(data, dep.attr);
352
+ if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
353
+ return new Promise(resolve => {
354
+ this.setState({
355
+ confirmDialog: true,
356
+ confirmNewValue: newValue,
357
+ confirmAttr: attr,
358
+ confirmDepNewValue: val,
359
+ confirmDepAttr: dep.attr,
360
+ confirmData: dep.confirm,
361
+ }, () => {
362
+ if (typeof cb === 'function') {
363
+ cb();
364
+ }
365
+ else {
366
+ resolve();
367
+ }
368
+ });
369
+ });
370
+ }
371
+ }
372
+ }
373
+ }
374
+ const changed = [];
375
+ if (this.props.schema.onChangeDependsOn) {
376
+ for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {
377
+ const dep = this.props.schema.onChangeDependsOn[z];
378
+ if (dep.onChange) {
379
+ const val = ConfigGeneric.getValue(data, dep.attr);
380
+ let _newValue;
381
+ if (this.props.custom) {
382
+ _newValue = this.executeCustom(dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);
383
+ }
384
+ else {
385
+ _newValue = this.execute(dep.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
386
+ }
387
+ if (_newValue !== val) {
388
+ ConfigGeneric.setValue(data, dep.attr, _newValue);
389
+ changed.push(dep.attr);
390
+ }
391
+ }
392
+ }
393
+ }
394
+ if (this.props.schema.hiddenDependsOn) {
395
+ for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {
396
+ const dep = this.props.schema.hiddenDependsOn[z];
397
+ dep.hidden && changed.push(dep.attr);
398
+ }
399
+ }
400
+ if (this.props.schema.labelDependsOn) {
401
+ for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {
402
+ const dep = this.props.schema.labelDependsOn[z];
403
+ dep.hidden && changed.push(dep.attr);
404
+ }
405
+ }
406
+ if (this.props.schema.helpDependsOn) {
407
+ for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {
408
+ const dep = this.props.schema.helpDependsOn[z];
409
+ dep.hidden && changed.push(dep.attr);
410
+ }
411
+ }
412
+ if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {
413
+ const val = ConfigGeneric.getValue(data, this.props.attr);
414
+ const newValue_ = this.props.custom
415
+ ? this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
416
+ : this.execute(this.props.schema.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
417
+ if (newValue_ !== val) {
418
+ ConfigGeneric.setValue(data, this.props.attr, newValue_);
419
+ }
420
+ }
421
+ if (this.props.custom) {
422
+ this.props.onChange(attr, newValue, () => cb && cb());
423
+ changed &&
424
+ changed.length &&
425
+ changed.forEach((_attr, i) => setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50));
426
+ }
427
+ else {
428
+ this.props.onChange(data, undefined, () => {
429
+ changed.length && this.props.forceUpdate(changed, data);
430
+ cb && cb();
431
+ });
432
+ }
433
+ return Promise.resolve();
434
+ }
435
+ execute(func, defaultValue, data, arrayIndex, globalData) {
436
+ let fun;
437
+ if (isObject(func)) {
438
+ fun = func.func;
439
+ }
440
+ else {
441
+ fun = func;
442
+ }
443
+ if (!fun) {
444
+ return defaultValue;
445
+ }
446
+ try {
447
+ // eslint-disable-next-line no-new-func
448
+ const f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
449
+ return f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData, this.props.changed);
450
+ }
451
+ catch (e) {
452
+ console.error(`Cannot execute ${func}: ${e}`);
453
+ return defaultValue;
454
+ }
455
+ }
456
+ executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {
457
+ let fun;
458
+ if (isObject(func)) {
459
+ fun = func.func;
460
+ }
461
+ else {
462
+ fun = func;
463
+ }
464
+ if (!fun) {
465
+ return null;
466
+ }
467
+ try {
468
+ // eslint-disable-next-line no-new-func
469
+ const f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
470
+ return f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData, this.props.changed);
471
+ }
472
+ catch (e) {
473
+ console.error(`Cannot execute ${fun}: ${e}`);
474
+ return null;
475
+ }
476
+ }
477
+ calculate(schema) {
478
+ let error;
479
+ let disabled;
480
+ let hidden;
481
+ let defaultValue;
482
+ if (this.props.custom) {
483
+ error = schema.validator
484
+ ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
485
+ : false;
486
+ disabled = schema.disabled
487
+ ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
488
+ : false;
489
+ hidden = schema.hidden
490
+ ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
491
+ : false;
492
+ defaultValue = schema.defaultFunc
493
+ ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
494
+ : schema.default;
495
+ }
496
+ else {
497
+ error = schema.validator
498
+ ? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData)
499
+ : false;
500
+ disabled = schema.disabled
501
+ ? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData)
502
+ : false;
503
+ hidden = schema.hidden
504
+ ? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData)
505
+ : false;
506
+ defaultValue = schema.defaultFunc
507
+ ? this.execute(schema.defaultFunc, schema.default, this.props.data, this.props.arrayIndex, this.props.globalData)
508
+ : schema.default;
509
+ }
510
+ return {
511
+ error, disabled, hidden, defaultValue,
512
+ };
513
+ }
514
+ onError(attr, error) {
515
+ if (!error) {
516
+ delete this.isError[attr];
517
+ }
518
+ else {
519
+ this.isError[attr] = error;
520
+ }
521
+ this.props.onError && this.props.onError(attr, error);
522
+ }
523
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
524
+ renderItem(_error, _disabled, _defaultValue) {
525
+ return this.getText(this.props.schema.label) || this.getText(this.props.schema.text);
526
+ }
527
+ // eslint-disable-next-line react/no-unused-class-component-methods
528
+ renderHelp(text, link, noTranslation) {
529
+ if (!link) {
530
+ text = this.getText(text, noTranslation) || '';
531
+ if (text &&
532
+ (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {
533
+ return Utils_1.default.renderTextWithA(text);
534
+ }
535
+ return text;
536
+ }
537
+ return react_1.default.createElement("a", { href: link, target: "_blank", rel: "noreferrer", style: {
538
+ color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f',
539
+ textDecoration: 'underline',
540
+ } }, this.getText(text, noTranslation));
541
+ }
542
+ getPattern(pattern, data) {
543
+ data = data || this.props.data;
544
+ if (!pattern) {
545
+ return '';
546
+ }
547
+ if (typeof pattern === 'object') {
548
+ if (pattern.func) {
549
+ pattern = pattern.func;
550
+ }
551
+ else {
552
+ console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);
553
+ pattern = JSON.stringify(pattern);
554
+ }
555
+ }
556
+ try {
557
+ if (this.props.custom) {
558
+ // eslint-disable-next-line no-new-func
559
+ const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
560
+ return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket, this.props.changed);
561
+ }
562
+ // eslint-disable-next-line no-new-func
563
+ const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
564
+ return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.changed);
565
+ }
566
+ catch (e) {
567
+ console.error(`Cannot execute ${pattern}: ${e}`);
568
+ return pattern;
569
+ }
570
+ }
571
+ render() {
572
+ const schema = this.props.schema;
573
+ if (!schema) {
574
+ return null;
575
+ }
576
+ if (this.props.alive && this.defaultSendToDone === false) {
577
+ this.sendToTimeout = setTimeout(() => {
578
+ this.sendToTimeout = null;
579
+ this.sendTo();
580
+ }, 200);
581
+ }
582
+ const { error, disabled, hidden, defaultValue, } = this.calculate(schema);
583
+ if (hidden) {
584
+ // Remove all errors if element is hidden
585
+ if (Object.keys(this.isError).length) {
586
+ setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
587
+ this.isError = {};
588
+ }
589
+ if (schema.hideOnlyControl) {
590
+ const item = react_1.default.createElement(material_1.Grid, { item: true, xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0, textAlign: 'left' }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) });
591
+ if (schema.newLine) {
592
+ return react_1.default.createElement(react_1.default.Fragment, null,
593
+ react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
594
+ item);
595
+ }
596
+ return item;
597
+ }
598
+ return null;
599
+ }
600
+ // Add error
601
+ if (schema.validatorNoSaveOnError) {
602
+ if (error && !Object.keys(this.isError).length) {
603
+ this.isError = {
604
+ [this.props.attr]: schema.validatorErrorText ? i18n_1.default.t(schema.validatorErrorText) : true,
605
+ };
606
+ setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])), 100, JSON.parse(JSON.stringify(this.isError)));
607
+ }
608
+ else if (!error && Object.keys(this.isError).length) {
609
+ setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
610
+ this.isError = {};
611
+ }
612
+ }
613
+ const renderedItem = this.renderItem(error, disabled || this.props.commandRunning || this.props.disabled, defaultValue);
614
+ if (this.noPlaceRequired) {
615
+ return renderedItem;
616
+ }
617
+ const item = react_1.default.createElement(material_1.Grid, { item: true, title: this.getText(schema.tooltip), xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0,
618
+ // marginRight: 8,
619
+ textAlign: 'left', width: schema.type === 'divider' || schema.type === 'header'
620
+ ? schema.width || '100%'
621
+ : undefined }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) }, this.props.schema.defaultSendTo && this.props.schema.button ?
622
+ react_1.default.createElement(material_1.Grid, { container: true, style: { width: '100%' } },
623
+ react_1.default.createElement(material_1.Grid, { item: true, flex: 1 }, renderedItem),
624
+ react_1.default.createElement(material_1.Grid, { item: true },
625
+ react_1.default.createElement(material_1.Button, { variant: "outlined", onClick: () => this.sendTo(), title: this.props.schema.buttonTooltip
626
+ ? this.getText(this.props.schema.buttonTooltip, this.props.schema.buttonTooltipNoTranslation)
627
+ : i18n_1.default.t('ra_Request data by instance') }, this.getText(this.props.schema.button)))) : renderedItem);
628
+ if (schema.newLine) {
629
+ return react_1.default.createElement(react_1.default.Fragment, null,
630
+ react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
631
+ this.renderConfirmDialog(),
632
+ item);
633
+ }
634
+ if (this.state.confirmDialog) {
635
+ return react_1.default.createElement(react_1.default.Fragment, null,
636
+ this.renderConfirmDialog(),
637
+ item);
638
+ }
639
+ return item;
640
+ }
641
+ }
642
+ ConfigGeneric.DIFFERENT_VALUE = '__different__';
643
+ ConfigGeneric.DIFFERENT_LABEL = 'ra___different__';
644
+ ConfigGeneric.NONE_VALUE = '';
645
+ ConfigGeneric.NONE_LABEL = 'ra_none';
646
+ exports.default = ConfigGeneric;
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "changed" | "classes" | "disabled" | "data" | "onChange" | "onError" | "common" | "instance" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "adapterName" | "themeType"> & Pick<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "changed" | "classes" | "disabled" | "common" | "instance" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "adapterName" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from 'prop-types';
14
+ import React from 'react';