@iobroker/adapter-react-v5 4.13.2 → 4.13.4

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 (469) hide show
  1. package/AdminConnection.js.map +1 -1
  2. package/Components/404.js +13 -13
  3. package/Components/ColorPicker.js +54 -54
  4. package/Components/ColorPicker.js.map +1 -1
  5. package/Components/ComplexCron.js.map +1 -1
  6. package/Components/FileBrowser.js +3 -3
  7. package/Components/FileViewer.js +9 -16
  8. package/Components/Loader.js +223 -223
  9. package/Components/Loaders/PT.css +108 -108
  10. package/Components/Loaders/PT.js +103 -103
  11. package/Components/Loaders/Vendor.css +13 -13
  12. package/Components/Loaders/Vendor.js +7 -7
  13. package/Components/ObjectBrowser.d.ts +2 -2
  14. package/Components/ObjectBrowser.js +359 -351
  15. package/Components/ObjectBrowser.js.map +1 -1
  16. package/Components/TabContent.d.ts +3 -7
  17. package/Components/TabContent.js +1 -3
  18. package/Components/TableResize.d.ts +20 -13
  19. package/Components/TableResize.js +244 -262
  20. package/Components/TreeTable.js +70 -70
  21. package/Components/TreeTable.js.map +1 -1
  22. package/Components/UploadImage.js +305 -305
  23. package/Components/loader.css +221 -221
  24. package/Components/types.d.ts +82 -82
  25. package/Components/withWidth.js +2 -2
  26. package/Components/withWidth.js.map +1 -1
  27. package/Connection.js.map +1 -1
  28. package/GenericApp.js +49 -49
  29. package/LICENSE +22 -22
  30. package/LegacyConnection.d.ts +4 -0
  31. package/LegacyConnection.js +14 -0
  32. package/Prompt.js +7 -7
  33. package/README.md +1105 -1101
  34. package/assets/devices/Alarm Systems.svg +18 -18
  35. package/assets/devices/Amplifier.svg +21 -21
  36. package/assets/devices/Awnings.svg +4 -4
  37. package/assets/devices/Battery Status.svg +4 -4
  38. package/assets/devices/Ceiling Spotlights.svg +15 -15
  39. package/assets/devices/Chandelier.svg +6 -6
  40. package/assets/devices/Climate.svg +11 -11
  41. package/assets/devices/Coffee Makers.svg +5 -5
  42. package/assets/devices/Cold Water.svg +31 -31
  43. package/assets/devices/Computer.svg +21 -21
  44. package/assets/devices/Consumption.svg +7 -7
  45. package/assets/devices/Curtains.svg +43 -43
  46. package/assets/devices/Dishwashers.svg +11 -11
  47. package/assets/devices/Doors.svg +5 -5
  48. package/assets/devices/Doorstep.svg +35 -35
  49. package/assets/devices/Dryer.svg +13 -13
  50. package/assets/devices/Fan.svg +20 -20
  51. package/assets/devices/Floor Lamps.svg +4 -4
  52. package/assets/devices/Garage Doors.svg +9 -9
  53. package/assets/devices/Gates.svg +32 -32
  54. package/assets/devices/Hairdryer.svg +23 -23
  55. package/assets/devices/Handle.svg +6 -6
  56. package/assets/devices/Hanging Lamps.svg +8 -8
  57. package/assets/devices/Heater.svg +44 -44
  58. package/assets/devices/Hoods.svg +11 -11
  59. package/assets/devices/Hot Water.svg +9 -9
  60. package/assets/devices/Humidity.svg +41 -41
  61. package/assets/devices/Iron.svg +4 -4
  62. package/assets/devices/Irrigation.svg +22 -22
  63. package/assets/devices/Led Strip.svg +30 -30
  64. package/assets/devices/Light.svg +29 -29
  65. package/assets/devices/Lightings.svg +46 -46
  66. package/assets/devices/Lock.svg +19 -19
  67. package/assets/devices/Louvre.svg +6 -6
  68. package/assets/devices/Mowing Machine.svg +8 -8
  69. package/assets/devices/Music.svg +12 -12
  70. package/assets/devices/Outdoor Blinds.svg +6 -6
  71. package/assets/devices/People.svg +19 -19
  72. package/assets/devices/Pool.svg +7 -7
  73. package/assets/devices/Power Consumption.svg +12 -12
  74. package/assets/devices/Printer.svg +9 -9
  75. package/assets/devices/Pump.svg +9 -9
  76. package/assets/devices/Receiver.svg +18 -18
  77. package/assets/devices/Sconces.svg +9 -9
  78. package/assets/devices/Security.svg +34 -34
  79. package/assets/devices/Shading.svg +4 -4
  80. package/assets/devices/Shutters.svg +10 -10
  81. package/assets/devices/SmokeDetector.svg +12 -12
  82. package/assets/devices/Sockets.svg +13 -13
  83. package/assets/devices/Speaker.svg +35 -35
  84. package/assets/devices/Stove.svg +11 -11
  85. package/assets/devices/Table Lamps.svg +11 -11
  86. package/assets/devices/Temperature Sensors.svg +28 -28
  87. package/assets/devices/Tv.svg +7 -7
  88. package/assets/devices/Vacuum Cleaner.svg +15 -15
  89. package/assets/devices/Ventilation.svg +12 -12
  90. package/assets/devices/Washing Machines.svg +15 -15
  91. package/assets/devices/Water Consumption.svg +5 -5
  92. package/assets/devices/Water Heater.svg +8 -8
  93. package/assets/devices/Water.svg +40 -40
  94. package/assets/devices/Weather.svg +28 -28
  95. package/assets/devices/Window.svg +7 -7
  96. package/assets/devices/list.json +993 -993
  97. package/assets/devices/names.txt +62 -62
  98. package/assets/devices/parseNames.js +34 -34
  99. package/assets/lamp_ceiling.svg +8 -8
  100. package/assets/lamp_table.svg +7 -7
  101. package/assets/no_icon.svg +9 -9
  102. package/assets/rooms/Anteroom.svg +52 -52
  103. package/assets/rooms/Attic.svg +21 -21
  104. package/assets/rooms/Balcony.svg +12 -12
  105. package/assets/rooms/Barn.svg +5 -5
  106. package/assets/rooms/Basement.svg +4 -4
  107. package/assets/rooms/Bathroom.svg +38 -38
  108. package/assets/rooms/Bedroom.svg +5 -5
  109. package/assets/rooms/Boiler Room.svg +12 -12
  110. package/assets/rooms/Carport.svg +17 -17
  111. package/assets/rooms/Cellar.svg +89 -89
  112. package/assets/rooms/Chamber.svg +9 -9
  113. package/assets/rooms/Corridor.svg +52 -52
  114. package/assets/rooms/Dining Area.svg +37 -37
  115. package/assets/rooms/Dining Room.svg +37 -37
  116. package/assets/rooms/Dining.svg +37 -37
  117. package/assets/rooms/Dressing Room.svg +4 -4
  118. package/assets/rooms/Driveway.svg +14 -14
  119. package/assets/rooms/Entrance.svg +44 -44
  120. package/assets/rooms/Equipment Room.svg +14 -14
  121. package/assets/rooms/Front Yard.svg +64 -64
  122. package/assets/rooms/Gallery.svg +13 -13
  123. package/assets/rooms/Garage.svg +20 -20
  124. package/assets/rooms/Garden.svg +12 -12
  125. package/assets/rooms/Ground Floor.svg +95 -95
  126. package/assets/rooms/Guest Bathroom.svg +32 -32
  127. package/assets/rooms/Guest Room.svg +5 -5
  128. package/assets/rooms/Gym.svg +4 -4
  129. package/assets/rooms/Hall.svg +19 -19
  130. package/assets/rooms/Home Theater.svg +7 -7
  131. package/assets/rooms/Kitchen.svg +17 -17
  132. package/assets/rooms/Laundry Room.svg +11 -11
  133. package/assets/rooms/Living Area.svg +10 -10
  134. package/assets/rooms/Living Room.svg +10 -10
  135. package/assets/rooms/Locker Room.svg +16 -16
  136. package/assets/rooms/Nursery.svg +4 -4
  137. package/assets/rooms/Office.svg +8 -8
  138. package/assets/rooms/Outdoors.svg +7 -7
  139. package/assets/rooms/Playroom.svg +5 -5
  140. package/assets/rooms/Pool.svg +7 -7
  141. package/assets/rooms/Rear Wall.svg +30 -30
  142. package/assets/rooms/Second Floor.svg +95 -95
  143. package/assets/rooms/Shed.svg +16 -16
  144. package/assets/rooms/Sleeping Area.svg +22 -22
  145. package/assets/rooms/Stairway.svg +4 -4
  146. package/assets/rooms/Stairwell.svg +15 -15
  147. package/assets/rooms/Storeroom.svg +4 -4
  148. package/assets/rooms/Summer House.svg +27 -27
  149. package/assets/rooms/Swimming Pool.svg +21 -21
  150. package/assets/rooms/Terrace.svg +6 -6
  151. package/assets/rooms/Toilet.svg +10 -10
  152. package/assets/rooms/Upstairs.svg +5 -5
  153. package/assets/rooms/Wardrobe.svg +60 -60
  154. package/assets/rooms/Washroom.svg +19 -19
  155. package/assets/rooms/Wc.svg +10 -10
  156. package/assets/rooms/Windscreen.svg +60 -60
  157. package/assets/rooms/Workshop.svg +22 -22
  158. package/assets/rooms/Workspace.svg +8 -8
  159. package/assets/rooms/list.json +945 -945
  160. package/assets/rooms/names.txt +59 -59
  161. package/assets/rooms/parseNames.js +34 -34
  162. package/craco-module-federation.js +69 -69
  163. package/icons/IconAdapter.js.map +1 -1
  164. package/icons/IconAlias.js.map +1 -1
  165. package/icons/IconChannel.js.map +1 -1
  166. package/icons/IconClearFilter.js.map +1 -1
  167. package/icons/IconClosed.js.map +1 -1
  168. package/icons/IconCopy.js +8 -8
  169. package/icons/IconCopy.js.map +1 -1
  170. package/icons/IconDevice.js.map +1 -1
  171. package/icons/IconDocument.js.map +1 -1
  172. package/icons/IconDocumentReadOnly.js.map +1 -1
  173. package/icons/IconFx.js +1 -1
  174. package/icons/IconFx.js.map +1 -1
  175. package/icons/IconInstance.js.map +1 -1
  176. package/icons/IconLogout.js +9 -9
  177. package/icons/IconLogout.js.map +1 -1
  178. package/icons/IconNoIcon.js +8 -8
  179. package/icons/IconNoIcon.js.map +1 -1
  180. package/icons/IconOpen.js.map +1 -1
  181. package/icons/IconState.js.map +1 -1
  182. package/index.css +54 -54
  183. package/package.json +2 -2
  184. package/types.d.ts +94 -94
  185. package/Components/404.js.map +0 -1
  186. package/Components/CustomModal.js.map +0 -1
  187. package/Components/FileBrowser.js.map +0 -1
  188. package/Components/FileViewer.js.map +0 -1
  189. package/Components/Icon.js.map +0 -1
  190. package/Components/IconPicker.js.map +0 -1
  191. package/Components/IconSelector.js.map +0 -1
  192. package/Components/Image.js.map +0 -1
  193. package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
  194. package/Components/JsonConfigComponent/ChipInput.js +0 -763
  195. package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
  196. package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
  197. package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
  198. package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
  199. package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
  200. package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
  201. package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
  202. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
  203. package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
  204. package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +0 -1
  205. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
  206. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
  207. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +0 -1
  208. package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
  209. package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
  210. package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
  211. package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
  212. package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
  213. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
  214. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
  215. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
  216. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
  217. package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
  218. package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
  219. package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
  220. package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
  221. package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
  222. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
  223. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
  224. package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
  225. package/Components/JsonConfigComponent/ConfigCheckbox.js.map +0 -1
  226. package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
  227. package/Components/JsonConfigComponent/ConfigChip.js +0 -120
  228. package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
  229. package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
  230. package/Components/JsonConfigComponent/ConfigColor.js +0 -120
  231. package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
  232. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
  233. package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
  234. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
  235. package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
  236. package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
  237. package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
  238. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
  239. package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
  240. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
  241. package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
  242. package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
  243. package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
  244. package/Components/JsonConfigComponent/ConfigFile.js +0 -228
  245. package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
  246. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
  247. package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
  248. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
  249. package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
  250. package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
  251. package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
  252. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
  253. package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
  254. package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
  255. package/Components/JsonConfigComponent/ConfigIP.js +0 -130
  256. package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
  257. package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
  258. package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
  259. package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
  260. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
  261. package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
  262. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
  263. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
  264. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
  265. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
  266. package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
  267. package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
  268. package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
  269. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
  270. package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
  271. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
  272. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
  273. package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
  274. package/Components/JsonConfigComponent/ConfigLanguage.js.map +0 -1
  275. package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
  276. package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
  277. package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
  278. package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
  279. package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
  280. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
  281. package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
  282. package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
  283. package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
  284. package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
  285. package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
  286. package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
  287. package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
  288. package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
  289. package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
  290. package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
  291. package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
  292. package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
  293. package/Components/JsonConfigComponent/ConfigPort.js +0 -176
  294. package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
  295. package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
  296. package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
  297. package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
  298. package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
  299. package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
  300. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
  301. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
  302. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
  303. package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
  304. package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
  305. package/Components/JsonConfigComponent/ConfigSendto.js.map +0 -1
  306. package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
  307. package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
  308. package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
  309. package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
  310. package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
  311. package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
  312. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
  313. package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
  314. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
  315. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
  316. package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
  317. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
  318. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
  319. package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
  320. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
  321. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
  322. package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
  323. package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
  324. package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
  325. package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
  326. package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
  327. package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
  328. package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
  329. package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
  330. package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
  331. package/Components/JsonConfigComponent/ConfigText.js +0 -226
  332. package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
  333. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
  334. package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
  335. package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
  336. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
  337. package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
  338. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
  339. package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
  340. package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
  341. package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
  342. package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
  343. package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
  344. package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
  345. package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
  346. package/Components/JsonConfigComponent/ConfigUser.js +0 -142
  347. package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
  348. package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
  349. package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
  350. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
  351. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
  352. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
  353. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
  354. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
  355. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
  356. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
  357. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
  358. package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
  359. package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
  360. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
  361. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
  362. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
  363. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
  364. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
  365. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
  366. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
  367. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
  368. package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
  369. package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
  370. package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
  371. package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
  372. package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
  373. package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
  374. package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
  375. package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
  376. package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
  377. package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
  378. package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
  379. package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
  380. package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
  381. package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
  382. package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
  383. package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
  384. package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
  385. package/Components/JsonConfigComponent/Utils.d.ts +0 -9
  386. package/Components/JsonConfigComponent/Utils.js +0 -13
  387. package/Components/JsonConfigComponent/index.d.ts +0 -26
  388. package/Components/JsonConfigComponent/index.js +0 -520
  389. package/Components/JsonConfigComponent/index.js.map +0 -1
  390. package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
  391. package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
  392. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
  393. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
  394. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
  395. package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
  396. package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
  397. package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
  398. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
  399. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
  400. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
  401. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
  402. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
  403. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
  404. package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
  405. package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
  406. package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
  407. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
  408. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
  409. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
  410. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
  411. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
  412. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
  413. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
  414. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
  415. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
  416. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
  417. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
  418. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
  419. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
  420. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
  421. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
  422. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
  423. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
  424. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
  425. package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
  426. package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
  427. package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
  428. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
  429. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
  430. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
  431. package/Components/Loader.js.map +0 -1
  432. package/Components/Loaders/PT.js.map +0 -1
  433. package/Components/Loaders/Vendor.js.map +0 -1
  434. package/Components/Logo.js.map +0 -1
  435. package/Components/MDUtils.js.map +0 -1
  436. package/Components/Router.js.map +0 -1
  437. package/Components/SaveCloseButtons.js.map +0 -1
  438. package/Components/Schedule.js.map +0 -1
  439. package/Components/SelectWithIcon.js.map +0 -1
  440. package/Components/SimpleCron/cron2text.js.map +0 -1
  441. package/Components/SimpleCron/cronText.js.map +0 -1
  442. package/Components/SimpleCron/index.js.map +0 -1
  443. package/Components/SimpleCron/jquery.cron.locale.js.map +0 -1
  444. package/Components/TabContainer.js.map +0 -1
  445. package/Components/TabContent.js.map +0 -1
  446. package/Components/TabHeader.js.map +0 -1
  447. package/Components/TableResize.js.map +0 -1
  448. package/Components/TextWithIcon.js.map +0 -1
  449. package/Components/ToggleThemeMenu.js.map +0 -1
  450. package/Components/UploadImage.js.map +0 -1
  451. package/Components/Utils.js.map +0 -1
  452. package/Components/copy-to-clipboard.d.ts +0 -13
  453. package/Components/copy-to-clipboard.js +0 -156
  454. package/Components/copy-to-clipboard.js.map +0 -1
  455. package/Dialogs/ComplexCron.js.map +0 -1
  456. package/Dialogs/Confirm.js.map +0 -1
  457. package/Dialogs/Cron.js.map +0 -1
  458. package/Dialogs/Error.js.map +0 -1
  459. package/Dialogs/Message.js.map +0 -1
  460. package/Dialogs/SelectFile.js.map +0 -1
  461. package/Dialogs/SelectID.js.map +0 -1
  462. package/Dialogs/SimpleCron.js.map +0 -1
  463. package/Dialogs/TextInput.js.map +0 -1
  464. package/GenericApp.js.map +0 -1
  465. package/LegacyConnection.js.map +0 -1
  466. package/Prompt.js.map +0 -1
  467. package/Theme.js.map +0 -1
  468. package/i18n.js.map +0 -1
  469. package/icons/IconExpert.js.map +0 -1
@@ -1,646 +0,0 @@
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;
@@ -1,14 +0,0 @@
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';