@iobroker/adapter-react-v5 4.13.1 → 4.13.3

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 (462) 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.js.map +1 -0
  306. package/Prompt.js +7 -7
  307. package/Prompt.js.map +1 -0
  308. package/README.md +841 -841
  309. package/Theme.js.map +1 -0
  310. package/assets/devices/Alarm Systems.svg +18 -18
  311. package/assets/devices/Amplifier.svg +21 -21
  312. package/assets/devices/Awnings.svg +4 -4
  313. package/assets/devices/Battery Status.svg +4 -4
  314. package/assets/devices/Ceiling Spotlights.svg +15 -15
  315. package/assets/devices/Chandelier.svg +6 -6
  316. package/assets/devices/Climate.svg +11 -11
  317. package/assets/devices/Coffee Makers.svg +5 -5
  318. package/assets/devices/Cold Water.svg +31 -31
  319. package/assets/devices/Computer.svg +21 -21
  320. package/assets/devices/Consumption.svg +7 -7
  321. package/assets/devices/Curtains.svg +43 -43
  322. package/assets/devices/Dishwashers.svg +11 -11
  323. package/assets/devices/Doors.svg +5 -5
  324. package/assets/devices/Doorstep.svg +35 -35
  325. package/assets/devices/Dryer.svg +13 -13
  326. package/assets/devices/Fan.svg +20 -20
  327. package/assets/devices/Floor Lamps.svg +4 -4
  328. package/assets/devices/Garage Doors.svg +9 -9
  329. package/assets/devices/Gates.svg +32 -32
  330. package/assets/devices/Hairdryer.svg +23 -23
  331. package/assets/devices/Handle.svg +6 -6
  332. package/assets/devices/Hanging Lamps.svg +8 -8
  333. package/assets/devices/Heater.svg +44 -44
  334. package/assets/devices/Hoods.svg +11 -11
  335. package/assets/devices/Hot Water.svg +9 -9
  336. package/assets/devices/Humidity.svg +41 -41
  337. package/assets/devices/Iron.svg +4 -4
  338. package/assets/devices/Irrigation.svg +22 -22
  339. package/assets/devices/Led Strip.svg +30 -30
  340. package/assets/devices/Light.svg +29 -29
  341. package/assets/devices/Lightings.svg +46 -46
  342. package/assets/devices/Lock.svg +19 -19
  343. package/assets/devices/Louvre.svg +6 -6
  344. package/assets/devices/Mowing Machine.svg +8 -8
  345. package/assets/devices/Music.svg +12 -12
  346. package/assets/devices/Outdoor Blinds.svg +6 -6
  347. package/assets/devices/People.svg +19 -19
  348. package/assets/devices/Pool.svg +7 -7
  349. package/assets/devices/Power Consumption.svg +12 -12
  350. package/assets/devices/Printer.svg +9 -9
  351. package/assets/devices/Pump.svg +9 -9
  352. package/assets/devices/Receiver.svg +18 -18
  353. package/assets/devices/Sconces.svg +9 -9
  354. package/assets/devices/Security.svg +34 -34
  355. package/assets/devices/Shading.svg +4 -4
  356. package/assets/devices/Shutters.svg +10 -10
  357. package/assets/devices/SmokeDetector.svg +12 -12
  358. package/assets/devices/Sockets.svg +13 -13
  359. package/assets/devices/Speaker.svg +35 -35
  360. package/assets/devices/Stove.svg +11 -11
  361. package/assets/devices/Table Lamps.svg +11 -11
  362. package/assets/devices/Temperature Sensors.svg +28 -28
  363. package/assets/devices/Tv.svg +7 -7
  364. package/assets/devices/Vacuum Cleaner.svg +15 -15
  365. package/assets/devices/Ventilation.svg +12 -12
  366. package/assets/devices/Washing Machines.svg +15 -15
  367. package/assets/devices/Water Consumption.svg +5 -5
  368. package/assets/devices/Water Heater.svg +8 -8
  369. package/assets/devices/Water.svg +40 -40
  370. package/assets/devices/Weather.svg +28 -28
  371. package/assets/devices/Window.svg +7 -7
  372. package/assets/devices/list.json +993 -993
  373. package/assets/devices/names.txt +62 -62
  374. package/assets/devices/parseNames.js +34 -34
  375. package/assets/lamp_ceiling.svg +8 -8
  376. package/assets/lamp_table.svg +7 -7
  377. package/assets/no_icon.svg +9 -9
  378. package/assets/rooms/Anteroom.svg +52 -52
  379. package/assets/rooms/Attic.svg +21 -21
  380. package/assets/rooms/Balcony.svg +12 -12
  381. package/assets/rooms/Barn.svg +5 -5
  382. package/assets/rooms/Basement.svg +4 -4
  383. package/assets/rooms/Bathroom.svg +38 -38
  384. package/assets/rooms/Bedroom.svg +5 -5
  385. package/assets/rooms/Boiler Room.svg +12 -12
  386. package/assets/rooms/Carport.svg +17 -17
  387. package/assets/rooms/Cellar.svg +89 -89
  388. package/assets/rooms/Chamber.svg +9 -9
  389. package/assets/rooms/Corridor.svg +52 -52
  390. package/assets/rooms/Dining Area.svg +37 -37
  391. package/assets/rooms/Dining Room.svg +37 -37
  392. package/assets/rooms/Dining.svg +37 -37
  393. package/assets/rooms/Dressing Room.svg +4 -4
  394. package/assets/rooms/Driveway.svg +14 -14
  395. package/assets/rooms/Entrance.svg +44 -44
  396. package/assets/rooms/Equipment Room.svg +14 -14
  397. package/assets/rooms/Front Yard.svg +64 -64
  398. package/assets/rooms/Gallery.svg +13 -13
  399. package/assets/rooms/Garage.svg +20 -20
  400. package/assets/rooms/Garden.svg +12 -12
  401. package/assets/rooms/Ground Floor.svg +95 -95
  402. package/assets/rooms/Guest Bathroom.svg +32 -32
  403. package/assets/rooms/Guest Room.svg +5 -5
  404. package/assets/rooms/Gym.svg +4 -4
  405. package/assets/rooms/Hall.svg +19 -19
  406. package/assets/rooms/Home Theater.svg +7 -7
  407. package/assets/rooms/Kitchen.svg +17 -17
  408. package/assets/rooms/Laundry Room.svg +11 -11
  409. package/assets/rooms/Living Area.svg +10 -10
  410. package/assets/rooms/Living Room.svg +10 -10
  411. package/assets/rooms/Locker Room.svg +16 -16
  412. package/assets/rooms/Nursery.svg +4 -4
  413. package/assets/rooms/Office.svg +8 -8
  414. package/assets/rooms/Outdoors.svg +7 -7
  415. package/assets/rooms/Playroom.svg +5 -5
  416. package/assets/rooms/Pool.svg +7 -7
  417. package/assets/rooms/Rear Wall.svg +30 -30
  418. package/assets/rooms/Second Floor.svg +95 -95
  419. package/assets/rooms/Shed.svg +16 -16
  420. package/assets/rooms/Sleeping Area.svg +22 -22
  421. package/assets/rooms/Stairway.svg +4 -4
  422. package/assets/rooms/Stairwell.svg +15 -15
  423. package/assets/rooms/Storeroom.svg +4 -4
  424. package/assets/rooms/Summer House.svg +27 -27
  425. package/assets/rooms/Swimming Pool.svg +21 -21
  426. package/assets/rooms/Terrace.svg +6 -6
  427. package/assets/rooms/Toilet.svg +10 -10
  428. package/assets/rooms/Upstairs.svg +5 -5
  429. package/assets/rooms/Wardrobe.svg +60 -60
  430. package/assets/rooms/Washroom.svg +19 -19
  431. package/assets/rooms/Wc.svg +10 -10
  432. package/assets/rooms/Windscreen.svg +60 -60
  433. package/assets/rooms/Workshop.svg +22 -22
  434. package/assets/rooms/Workspace.svg +8 -8
  435. package/assets/rooms/list.json +945 -945
  436. package/assets/rooms/names.txt +59 -59
  437. package/assets/rooms/parseNames.js +34 -34
  438. package/craco-module-federation.js +69 -69
  439. package/i18n.js.map +1 -0
  440. package/icons/IconAdapter.js.map +1 -1
  441. package/icons/IconAlias.js.map +1 -1
  442. package/icons/IconChannel.js.map +1 -1
  443. package/icons/IconClearFilter.js.map +1 -1
  444. package/icons/IconClosed.js.map +1 -1
  445. package/icons/IconCopy.js +8 -8
  446. package/icons/IconCopy.js.map +1 -1
  447. package/icons/IconDevice.js.map +1 -1
  448. package/icons/IconDocument.js.map +1 -1
  449. package/icons/IconDocumentReadOnly.js.map +1 -1
  450. package/icons/IconExpert.js.map +1 -0
  451. package/icons/IconFx.js +1 -1
  452. package/icons/IconFx.js.map +1 -1
  453. package/icons/IconInstance.js.map +1 -1
  454. package/icons/IconLogout.js +9 -9
  455. package/icons/IconLogout.js.map +1 -1
  456. package/icons/IconNoIcon.js +8 -8
  457. package/icons/IconNoIcon.js.map +1 -1
  458. package/icons/IconOpen.js.map +1 -1
  459. package/icons/IconState.js.map +1 -1
  460. package/index.css +54 -54
  461. package/package.json +2 -2
  462. package/types.d.ts +94 -94
@@ -0,0 +1,1064 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
16
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
17
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
20
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
21
+ var _react = _interopRequireWildcard(require("react"));
22
+ var _propTypes = _interopRequireDefault(require("prop-types"));
23
+ var _styles = require("@mui/styles");
24
+ var _reactDropzone = _interopRequireDefault(require("react-dropzone"));
25
+ var _material = require("@mui/material");
26
+ var _iconsMaterial = require("@mui/icons-material");
27
+ var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
28
+ var _Utils = _interopRequireDefault(require("./wrapper/Components/Utils"));
29
+ var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
30
+ var _ConfigPanel = _interopRequireDefault(require("./ConfigPanel"));
31
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
32
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
33
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
34
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
36
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
37
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // eslint-disable-next-line import/no-cycle
38
+ var MAX_SIZE = 1024 * 1024; // 1MB
39
+
40
+ var styles = function styles(theme) {
41
+ return {
42
+ fullWidth: {
43
+ width: '100%'
44
+ },
45
+ root: {
46
+ width: '100%'
47
+ },
48
+ paper: {
49
+ width: '100%',
50
+ marginBottom: theme.spacing(2),
51
+ backgroundColor: 'rgba(255, 255, 255, 0.1)'
52
+ },
53
+ headerText: {
54
+ width: '100%'
55
+ },
56
+ table: {
57
+ minWidth: 750
58
+ },
59
+ visuallyHidden: {
60
+ border: 0,
61
+ clip: 'rect(0 0 0 0)',
62
+ height: 1,
63
+ margin: -1,
64
+ overflow: 'hidden',
65
+ padding: 0,
66
+ position: 'absolute',
67
+ top: 20,
68
+ width: 1
69
+ },
70
+ label: {
71
+ display: 'flex',
72
+ justifyContent: 'space-between'
73
+ },
74
+ highlight: theme.palette.mode === 'light' ? {
75
+ color: theme.palette.secondary.main
76
+ // backgroundColor: lighten(theme.palette.secondary.light, 0.85),
77
+ } : {
78
+ color: theme.palette.text.primary,
79
+ backgroundColor: theme.palette.secondary.dark
80
+ },
81
+ title: {
82
+ flex: '1 1 100%'
83
+ },
84
+ rootTool: {
85
+ paddingLeft: theme.spacing(2),
86
+ paddingRight: theme.spacing(1)
87
+ },
88
+ silver: {
89
+ opacity: 0.2
90
+ },
91
+ flex: {
92
+ display: 'flex',
93
+ alignItems: 'baseline'
94
+ },
95
+ filteredOut: {
96
+ padding: 10,
97
+ display: 'flex',
98
+ textAlign: 'center'
99
+ },
100
+ buttonEmpty: {
101
+ width: 34,
102
+ display: 'inline-block'
103
+ },
104
+ buttonCell: {
105
+ whiteSpace: 'nowrap'
106
+ },
107
+ dropZone: {
108
+ width: '100%',
109
+ height: 100,
110
+ position: 'relative'
111
+ },
112
+ dropZoneEmpty: {},
113
+ uploadDiv: {
114
+ position: 'relative',
115
+ width: '100%',
116
+ height: 300,
117
+ opacity: 0.9,
118
+ marginTop: 30,
119
+ cursor: 'pointer',
120
+ outline: 'none'
121
+ },
122
+ uploadDivDragging: {
123
+ opacity: 1,
124
+ background: 'rgba(128,255,128,0.1)'
125
+ },
126
+ image: {
127
+ objectFit: 'contain',
128
+ margin: 'auto',
129
+ display: 'flex',
130
+ width: '100%',
131
+ height: '100%'
132
+ },
133
+ uploadCenterDiv: {
134
+ margin: 5,
135
+ border: '3px dashed grey',
136
+ borderRadius: 5,
137
+ width: 'calc(100% - 10px)',
138
+ height: 'calc(100% - 10px)',
139
+ minHeight: 300,
140
+ position: 'relative',
141
+ display: 'flex'
142
+ },
143
+ uploadCenterIcon: {
144
+ paddingTop: 10,
145
+ width: 48,
146
+ height: 48
147
+ },
148
+ uploadCenterText: {
149
+ fontSize: 16
150
+ },
151
+ uploadCenterTextAndIcon: {
152
+ textAlign: 'center',
153
+ position: 'absolute',
154
+ top: 0,
155
+ bottom: 0,
156
+ left: 0,
157
+ right: 0,
158
+ display: 'flex',
159
+ flexDirection: 'column',
160
+ alignItems: 'center',
161
+ justifyContent: 'center'
162
+ },
163
+ buttonRemoveWrapper: {
164
+ position: 'absolute',
165
+ zIndex: 222,
166
+ right: 0
167
+ },
168
+ error: {
169
+ border: '2px solid red',
170
+ boxSizing: 'border-box'
171
+ }
172
+ };
173
+ };
174
+ function objectToArray(object, nameOfFirstAttr, nameOfSecondAttr) {
175
+ nameOfFirstAttr = nameOfFirstAttr || 'key';
176
+ var array = [];
177
+ Object.keys(object).forEach(function (key) {
178
+ var item = {};
179
+ item[nameOfFirstAttr] = key;
180
+ if (nameOfSecondAttr) {
181
+ item[nameOfSecondAttr] = object[key];
182
+ array.push(item);
183
+ } else {
184
+ array.push(Object.assign(item, object[key]));
185
+ }
186
+ });
187
+ return array;
188
+ }
189
+ function arrayToObject(array, nameOfFirstAttr, nameOfSecondAttr) {
190
+ nameOfFirstAttr = nameOfFirstAttr || 'key';
191
+ var object = {};
192
+ array.forEach(function (row) {
193
+ var key = row[nameOfFirstAttr];
194
+ if (key === null || key === undefined) {
195
+ key = '';
196
+ }
197
+ delete row[nameOfFirstAttr];
198
+ if (nameOfSecondAttr) {
199
+ object[key] = row[nameOfSecondAttr];
200
+ } else {
201
+ object[key] = row;
202
+ }
203
+ });
204
+ return object;
205
+ }
206
+ var ConfigTable = /*#__PURE__*/function (_ConfigGeneric) {
207
+ (0, _inherits2["default"])(ConfigTable, _ConfigGeneric);
208
+ var _super = _createSuper(ConfigTable);
209
+ function ConfigTable(props) {
210
+ var _this;
211
+ (0, _classCallCheck2["default"])(this, ConfigTable);
212
+ _this = _super.call(this, props);
213
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleRequestSort", function (property) {
214
+ var orderCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
215
+ var _this$state = _this.state,
216
+ order = _this$state.order,
217
+ orderBy = _this$state.orderBy;
218
+ if (orderBy) {
219
+ var isAsc = orderBy === property && order === 'asc';
220
+ var newOrder = orderCheck ? order : isAsc ? 'desc' : 'asc';
221
+ var newValue = _this.stableSort(newOrder, property);
222
+ _this.setState({
223
+ order: newOrder,
224
+ orderBy: property,
225
+ iteration: _this.state.iteration + 10000
226
+ }, function () {
227
+ return _this.applyFilter(false, newValue);
228
+ });
229
+ }
230
+ });
231
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "stableSort", function (order, orderBy) {
232
+ var value = _this.state.value;
233
+ var comparator = ConfigTable.getComparator(order, orderBy);
234
+ var stabilizedThis = value.map(function (el, index) {
235
+ return [el, index];
236
+ });
237
+ stabilizedThis.sort(function (a, b) {
238
+ var order_ = comparator(a[0], b[0]);
239
+ if (order_ !== 0) {
240
+ return order_;
241
+ }
242
+ return a[1] - b[1];
243
+ });
244
+ return stabilizedThis.map(function (el) {
245
+ return el[0];
246
+ });
247
+ });
248
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDelete", function (index) {
249
+ return function () {
250
+ var newValue = JSON.parse(JSON.stringify(_this.state.value));
251
+ newValue.splice(index, 1);
252
+ _this.setState({
253
+ value: newValue,
254
+ iteration: _this.state.iteration + 10000
255
+ }, function () {
256
+ return _this.applyFilter(false, null, function () {
257
+ return _this.onChangeWrapper(newValue);
258
+ });
259
+ });
260
+ };
261
+ });
262
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClone", function (index) {
263
+ return function () {
264
+ var newValue = JSON.parse(JSON.stringify(_this.state.value));
265
+ var cloned = JSON.parse(JSON.stringify(newValue[index]));
266
+ if (typeof _this.props.schema.clone === 'string' && typeof cloned[_this.props.schema.clone] === 'string') {
267
+ var i = 1;
268
+ var text = cloned[_this.props.schema.clone];
269
+ var pattern = text.match(/(\d+)$/);
270
+ if (pattern) {
271
+ text = text.replace(pattern[0], '');
272
+ i = parseInt(pattern[0], 10) + 1;
273
+ } else {
274
+ text += '_';
275
+ }
276
+ // eslint-disable-next-line no-loop-func
277
+ while (newValue.find(function (it) {
278
+ return it[_this.props.schema.clone] === text + i.toString();
279
+ })) {
280
+ i++;
281
+ }
282
+ cloned[_this.props.schema.clone] = "".concat(cloned[_this.props.schema.clone], "_").concat(i);
283
+ }
284
+ newValue.splice(index, 0, cloned);
285
+ _this.setState({
286
+ value: newValue,
287
+ iteration: _this.state.iteration + 10000
288
+ }, function () {
289
+ return _this.applyFilter(false, null, function () {
290
+ return _this.onChangeWrapper(newValue);
291
+ });
292
+ });
293
+ };
294
+ });
295
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChangeWrapper", function (newValue) {
296
+ var updateVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
297
+ _this.typingTimer && clearTimeout(_this.typingTimer);
298
+ _this.typingTimer = setTimeout(function (value, _updateVisible) {
299
+ _this.typingTimer = null;
300
+ if (_this.props.schema.objKeyName) {
301
+ var objValue = arrayToObject(JSON.parse(JSON.stringify(value)), _this.props.schema.objKeyName, _this.props.schema.objValueName);
302
+ _this.onChange(_this.props.attr, objValue);
303
+ } else {
304
+ _this.onChange(_this.props.attr, value);
305
+ }
306
+ if (_updateVisible) {
307
+ _this.applyFilter(false, value);
308
+ _this.handleRequestSort(_this.state.orderBy, true);
309
+ }
310
+ }, 300, newValue, updateVisible);
311
+ });
312
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function () {
313
+ var schema = _this.props.schema;
314
+ var newValue = JSON.parse(JSON.stringify(_this.state.value));
315
+ var newItem = schema.items && schema.items.reduce(function (accumulator, currentValue) {
316
+ var defaultValue;
317
+ if (currentValue.defaultFunc) {
318
+ if (_this.props.custom) {
319
+ defaultValue = currentValue.defaultFunc ? _this.executeCustom(currentValue.defaultFunc, _this.props.schema["default"], _this.props.data, _this.props.instanceObj, newValue.length, _this.props.data) : _this.props.schema["default"];
320
+ } else {
321
+ defaultValue = currentValue.defaultFunc ? _this.execute(currentValue.defaultFunc, _this.props.schema["default"], _this.props.data, newValue.length, _this.props.data) : _this.props.schema["default"];
322
+ }
323
+ } else {
324
+ defaultValue = currentValue["default"] === undefined ? null : currentValue["default"];
325
+ }
326
+ accumulator[currentValue.attr] = defaultValue;
327
+ return accumulator;
328
+ }, {});
329
+ newValue.push(newItem);
330
+ _this.setState({
331
+ value: newValue
332
+ }, function () {
333
+ return _this.applyFilter(false, null, function () {
334
+ return _this.onChangeWrapper(newValue);
335
+ });
336
+ });
337
+ });
338
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "applyFilter", function (clear, value, cb) {
339
+ value = value || _this.state.value;
340
+ var visibleValue = value.map(function (_, i) {
341
+ return i;
342
+ });
343
+ Object.keys(_this.filterRefs).forEach(function (attr) {
344
+ var _this$filterRefs$attr;
345
+ var valueInputRef = (_this$filterRefs$attr = _this.filterRefs[attr].current) === null || _this$filterRefs$attr === void 0 ? void 0 : _this$filterRefs$attr.children[0].children[0].value;
346
+ if (!clear && valueInputRef) {
347
+ valueInputRef = valueInputRef.toLowerCase();
348
+ visibleValue = visibleValue.filter(function (idx) {
349
+ return value[idx] && value[idx][attr] && value[idx][attr].toLowerCase().includes(valueInputRef);
350
+ });
351
+ } else if (_this.filterRefs[attr].current) {
352
+ _this.filterRefs[attr].current.children[0].children[0].value = '';
353
+ }
354
+ });
355
+ if (visibleValue.length === value.length) {
356
+ visibleValue = null;
357
+ }
358
+ if (visibleValue === null && _this.state.visibleValue === null) {
359
+ cb && cb();
360
+ return;
361
+ }
362
+ if (JSON.stringify(visibleValue) !== JSON.stringify(_this.state.visibleValue)) {
363
+ _this.setState({
364
+ visibleValue: visibleValue
365
+ }, function () {
366
+ return cb && cb();
367
+ });
368
+ } else {
369
+ cb && cb();
370
+ }
371
+ });
372
+ _this.filterRefs = {};
373
+ _this.props.schema.items = _this.props.schema.items || [];
374
+ _this.props.schema.items.forEach(function (el) {
375
+ if (el.filter) {
376
+ _this.filterRefs[el.attr] = /*#__PURE__*/(0, _react.createRef)();
377
+ }
378
+ });
379
+ return _this;
380
+ }
381
+
382
+ /**
383
+ * React lifecycle hook, called once component is mounted
384
+ * @return {Promise<void>}
385
+ */
386
+ (0, _createClass2["default"])(ConfigTable, [{
387
+ key: "componentDidMount",
388
+ value: (function () {
389
+ var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
390
+ var _this2 = this;
391
+ var value;
392
+ return _regenerator["default"].wrap(function _callee$(_context) {
393
+ while (1) switch (_context.prev = _context.next) {
394
+ case 0:
395
+ (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigTable.prototype), "componentDidMount", this).call(this);
396
+ value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr) || []; // if the list is given as an object
397
+ if (this.props.schema.objKeyName) {
398
+ value = objectToArray(value, this.props.schema.objKeyName, this.props.schema.objValueName);
399
+ }
400
+ if (!Array.isArray(value)) {
401
+ value = [];
402
+ }
403
+ this.setState({
404
+ value: value,
405
+ visibleValue: null,
406
+ orderBy: /* this.props.schema.items.length ? this.props.schema.items[0].attr : */'',
407
+ order: 'asc',
408
+ iteration: 0,
409
+ filterOn: []
410
+ }, function () {
411
+ return _this2.validateUniqueProps();
412
+ });
413
+ case 5:
414
+ case "end":
415
+ return _context.stop();
416
+ }
417
+ }, _callee, this);
418
+ }));
419
+ function componentDidMount() {
420
+ return _componentDidMount.apply(this, arguments);
421
+ }
422
+ return componentDidMount;
423
+ }())
424
+ }, {
425
+ key: "componentWillUnmount",
426
+ value: function componentWillUnmount() {
427
+ this.typingTimer && clearTimeout(this.typingTimer);
428
+ this.typingTimer = null;
429
+ (0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigTable.prototype), "componentWillUnmount", this).call(this);
430
+ }
431
+ }, {
432
+ key: "itemTable",
433
+ value: function itemTable(attrItem, data, idx) {
434
+ var _this3 = this;
435
+ var value = this.state.value;
436
+ var schema = this.props.schema;
437
+ var schemaForAttribute = schema.items && schema.items.find(function (el) {
438
+ return el.attr === attrItem;
439
+ });
440
+ if (!schemaForAttribute) {
441
+ return null;
442
+ }
443
+ var schemaItem = {
444
+ items: (0, _defineProperty2["default"])({}, attrItem, schemaForAttribute)
445
+ };
446
+ return /*#__PURE__*/_react["default"].createElement(_ConfigPanel["default"], {
447
+ index: idx + this.state.iteration,
448
+ arrayIndex: idx,
449
+ changed: this.props.changed,
450
+ globalData: this.props.data,
451
+ socket: this.props.socket,
452
+ adapterName: this.props.adapterName,
453
+ instance: this.props.instance,
454
+ common: this.props.common,
455
+ alive: this.props.alive,
456
+ themeType: this.props.themeType,
457
+ themeName: this.props.themeName,
458
+ data: data,
459
+ table: true,
460
+ custom: true,
461
+ schema: schemaItem,
462
+ systemConfig: this.props.systemConfig,
463
+ originalData: this.props.originalData,
464
+ customs: this.props.customs,
465
+ onChange: function onChange(attr, valueChange) {
466
+ var newObj = JSON.parse(JSON.stringify(value));
467
+ newObj[idx][attr] = valueChange;
468
+ _this3.setState({
469
+ value: newObj
470
+ }, function () {
471
+ _this3.validateUniqueProps();
472
+ _this3.onChangeWrapper(newObj, true);
473
+ });
474
+ },
475
+ onError: function onError(error, attr) {
476
+ return _this3.onError(error, attr);
477
+ }
478
+ });
479
+ }
480
+
481
+ /**
482
+ * Validate that columns configured in `uniqueColumns` have unique values
483
+ */
484
+ }, {
485
+ key: "validateUniqueProps",
486
+ value: function validateUniqueProps() {
487
+ var _this4 = this;
488
+ if (!this.props.schema.uniqueColumns) {
489
+ return;
490
+ }
491
+ var _iterator = _createForOfIteratorHelper(this.props.schema.uniqueColumns),
492
+ _step;
493
+ try {
494
+ var _loop = function _loop() {
495
+ var uniqueCol = _step.value;
496
+ /** @type {string[]} */
497
+ var allVals = [];
498
+ var found = _this4.state.value.find(function (entry) {
499
+ var val = entry[uniqueCol];
500
+ if (allVals.includes(val)) {
501
+ _this4.onError(uniqueCol, 'is not unique');
502
+ _this4.setState({
503
+ errorMessage: _i18n["default"].t('Non-allowed duplicate entry "%s" in column "%s"', val, uniqueCol)
504
+ });
505
+ return true;
506
+ }
507
+ allVals.push(val);
508
+ return false;
509
+ });
510
+ if (!found) {
511
+ _this4.onError(uniqueCol, null);
512
+ _this4.setState({
513
+ errorMessage: ''
514
+ });
515
+ }
516
+ };
517
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
518
+ _loop();
519
+ }
520
+ } catch (err) {
521
+ _iterator.e(err);
522
+ } finally {
523
+ _iterator.f();
524
+ }
525
+ }
526
+ }, {
527
+ key: "enhancedTableHead",
528
+ value: function enhancedTableHead(buttonsWidth, doAnyFilterSet) {
529
+ var _this5 = this;
530
+ var _this$props = this.props,
531
+ schema = _this$props.schema,
532
+ classes = _this$props.classes;
533
+ var _this$state2 = this.state,
534
+ order = _this$state2.order,
535
+ orderBy = _this$state2.orderBy;
536
+ return /*#__PURE__*/_react["default"].createElement(_material.TableHead, null, /*#__PURE__*/_react["default"].createElement(_material.TableRow, null, schema.items && schema.items.map(function (headCell, i) {
537
+ var _this5$filterRefs$hea;
538
+ return /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
539
+ style: {
540
+ width: typeof headCell.width === 'string' && headCell.width.endsWith('%') ? headCell.width : headCell.width
541
+ },
542
+ key: "".concat(headCell.attr, "_").concat(i),
543
+ align: "left",
544
+ sortDirection: orderBy === headCell.attr ? order : false
545
+ }, /*#__PURE__*/_react["default"].createElement("div", {
546
+ className: classes.flex,
547
+ style: schema.showFirstAddOnTop ? {
548
+ flexDirection: 'column'
549
+ } : undefined
550
+ }, !i && !schema.noDelete ? /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
551
+ title: doAnyFilterSet ? _i18n["default"].t('ra_Cannot add items with set filter') : _i18n["default"].t('ra_Add row')
552
+ }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
553
+ size: "small",
554
+ color: "primary",
555
+ disabled: !!doAnyFilterSet && !_this5.props.schema.allowAddByFilter,
556
+ onClick: _this5.onAdd
557
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Add, null)))) : null, headCell.sort && /*#__PURE__*/_react["default"].createElement(_material.TableSortLabel, {
558
+ active: true,
559
+ className: _Utils["default"].clsx(orderBy !== headCell.attr && classes.silver),
560
+ direction: orderBy === headCell.attr ? order : 'asc',
561
+ onClick: function onClick() {
562
+ return _this5.handleRequestSort(headCell.attr);
563
+ }
564
+ }), headCell.filter && _this5.state.filterOn.includes(headCell.attr) ? /*#__PURE__*/_react["default"].createElement(_material.TextField, {
565
+ variant: "standard",
566
+ ref: _this5.filterRefs[headCell.attr],
567
+ onChange: function onChange() {
568
+ return _this5.applyFilter();
569
+ },
570
+ title: _i18n["default"].t('ra_You can filter entries by entering here some text'),
571
+ InputProps: {
572
+ endAdornment: ((_this5$filterRefs$hea = _this5.filterRefs[headCell.attr]) === null || _this5$filterRefs$hea === void 0 || (_this5$filterRefs$hea = _this5$filterRefs$hea.current) === null || _this5$filterRefs$hea === void 0 || (_this5$filterRefs$hea = _this5$filterRefs$hea.children[0]) === null || _this5$filterRefs$hea === void 0 || (_this5$filterRefs$hea = _this5$filterRefs$hea.children[0]) === null || _this5$filterRefs$hea === void 0 ? void 0 : _this5$filterRefs$hea.value) && /*#__PURE__*/_react["default"].createElement(_material.InputAdornment, {
573
+ position: "end"
574
+ }, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
575
+ size: "small",
576
+ onClick: function onClick() {
577
+ _this5.filterRefs[headCell.attr].current.children[0].children[0].value = '';
578
+ _this5.applyFilter();
579
+ }
580
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Close, null)))
581
+ },
582
+ fullWidth: true,
583
+ placeholder: _this5.getText(headCell.title)
584
+ }) : /*#__PURE__*/_react["default"].createElement("span", {
585
+ className: _this5.props.classes.headerText
586
+ }, _this5.getText(headCell.title)), headCell.filter ? /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
587
+ title: _i18n["default"].t('ra_Show/hide filter input'),
588
+ size: "small",
589
+ onClick: function onClick() {
590
+ var filterOn = (0, _toConsumableArray2["default"])(_this5.state.filterOn);
591
+ var pos = _this5.state.filterOn.indexOf(headCell.attr);
592
+ if (pos === -1) {
593
+ filterOn.push(headCell.attr);
594
+ } else {
595
+ filterOn.splice(pos, 1);
596
+ }
597
+ _this5.setState({
598
+ filterOn: filterOn
599
+ }, function () {
600
+ if (pos && _this5.filterRefs[headCell.attr].current.children[0].children[0].value) {
601
+ _this5.filterRefs[headCell.attr].current.children[0].children[0].value = '';
602
+ _this5.applyFilter();
603
+ }
604
+ });
605
+ }
606
+ }, _this5.state.filterOn.includes(headCell.attr) ? /*#__PURE__*/_react["default"].createElement(_iconsMaterial.FilterAltOff, null) : /*#__PURE__*/_react["default"].createElement(_iconsMaterial.FilterAlt, null)) : null));
607
+ }), !schema.noDelete && /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
608
+ style: {
609
+ paddingLeft: 20,
610
+ paddingRight: 20,
611
+ width: buttonsWidth,
612
+ textAlign: 'right'
613
+ },
614
+ padding: "checkbox"
615
+ }, schema["import"] ? /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
616
+ style: {
617
+ marginRight: 10
618
+ },
619
+ size: "small",
620
+ onClick: function onClick() {
621
+ return _this5.setState({
622
+ showImportDialog: true
623
+ });
624
+ },
625
+ title: _i18n["default"].t('ra_import data from %s file', 'CSV')
626
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.UploadFile, null)) : null, schema["export"] ? /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
627
+ style: {
628
+ marginRight: 10
629
+ },
630
+ size: "small",
631
+ onClick: function onClick() {
632
+ return _this5.onExport();
633
+ },
634
+ title: _i18n["default"].t('ra_Export data to %s file', 'CSV')
635
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Download, null)) : null, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
636
+ disabled: true,
637
+ size: "small"
638
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Delete, null)))));
639
+ }
640
+ }, {
641
+ key: "onExport",
642
+ value: function onExport() {
643
+ var schema = this.props.schema;
644
+ var value = this.state.value;
645
+ var cols = schema.items.map(function (it) {
646
+ return it.attr;
647
+ });
648
+ var lines = [cols.join(';')];
649
+ value.forEach(function (row) {
650
+ var line = [];
651
+ schema.items.forEach(function (it) {
652
+ if (row[it.attr].includes(';')) {
653
+ line.push("\"".concat(row[it.attr], "\""));
654
+ } else {
655
+ line.push(row[it.attr]);
656
+ }
657
+ });
658
+ lines.push(line.join(';'));
659
+ });
660
+ var el = document.createElement('a');
661
+ el.setAttribute('href', "data:text/csv;charset=utf-8,".concat(encodeURIComponent(lines.join('\n'))));
662
+ var now = new Date();
663
+ el.setAttribute('download', "".concat(now.getFullYear(), "_").concat((now.getMonth() + 1).toString().padStart(2, '0'), "_").concat(now.getDate().toString().padStart(2, '0'), "_").concat(this.props.adapterName, ".").concat(this.props.instance, "_").concat(this.props.attr, ".csv"));
664
+ el.style.display = 'none';
665
+ document.body.appendChild(el);
666
+ el.click();
667
+ document.body.removeChild(el);
668
+ }
669
+ }, {
670
+ key: "onImport",
671
+ value: function onImport(text) {
672
+ var _this6 = this;
673
+ var lines = text.split('\n').map(function (line) {
674
+ return line.replace('\r', '').trim();
675
+ });
676
+ // the first line is header
677
+ var schema = this.props.schema;
678
+ var header = lines.shift().split(';').filter(function (it) {
679
+ return it && schema.items.find(function (it2) {
680
+ return it2.attr === it;
681
+ });
682
+ });
683
+ var values = [];
684
+ lines.forEach(function (line) {
685
+ var parts = line.split(';');
686
+ var obj = {};
687
+ var _loop2 = function _loop2(_p) {
688
+ var value = parts[_p];
689
+ if (value.startsWith('"')) {
690
+ value = value.substring(1);
691
+ while (_p < parts.length && !value.endsWith('"')) {
692
+ value += ";".concat(parts[++_p]);
693
+ }
694
+ value = value.substring(0, value.length - 1);
695
+ }
696
+ if (parts[_p] === 'true') {
697
+ parts[_p] = true;
698
+ } else if (parts[_p] === 'false') {
699
+ parts[_p] = false;
700
+ // eslint-disable-next-line no-restricted-properties
701
+ } else if (window.isFinite(parts[_p])) {
702
+ var attr = _this6.props.schema.items.find(function (it) {
703
+ return it.attr === header[_p];
704
+ });
705
+ if (attr && attr.type === 'number') {
706
+ // if a type of attribute is a "number"
707
+ parts[_p] = parseFloat(parts[_p]);
708
+ }
709
+ }
710
+ obj[header[_p]] = parts[_p];
711
+ p = _p;
712
+ };
713
+ for (var p = 0; p < parts.length; p++) {
714
+ _loop2(p);
715
+ }
716
+ values.push(obj);
717
+ });
718
+ if (values.length) {
719
+ var _this$state$value;
720
+ if ((_this$state$value = this.state.value) !== null && _this$state$value !== void 0 && _this$state$value.length) {
721
+ this.setState({
722
+ showTypeOfImportDialog: values,
723
+ showImportDialog: false
724
+ });
725
+ } else {
726
+ this.setState({
727
+ value: values,
728
+ showImportDialog: false
729
+ });
730
+ }
731
+ } else {
732
+ window.alert('ra_No data found in file');
733
+ }
734
+ }
735
+ }, {
736
+ key: "isAnyFilterSet",
737
+ value: function isAnyFilterSet() {
738
+ var _this7 = this;
739
+ return Object.keys(this.filterRefs).find(function (attr) {
740
+ var _this7$filterRefs$att;
741
+ return (_this7$filterRefs$att = _this7.filterRefs[attr].current) === null || _this7$filterRefs$att === void 0 ? void 0 : _this7$filterRefs$att.children[0].children[0].value;
742
+ });
743
+ }
744
+ }, {
745
+ key: "onMoveUp",
746
+ value: function onMoveUp(idx) {
747
+ var _this8 = this;
748
+ var newValue = JSON.parse(JSON.stringify(this.state.value));
749
+ var item = newValue[idx];
750
+ newValue.splice(idx, 1);
751
+ newValue.splice(idx - 1, 0, item);
752
+ this.setState({
753
+ value: newValue,
754
+ iteration: this.state.iteration + 10000
755
+ }, function () {
756
+ return _this8.applyFilter(false, null, function () {
757
+ return _this8.onChangeWrapper(newValue);
758
+ });
759
+ });
760
+ }
761
+ }, {
762
+ key: "onMoveDown",
763
+ value: function onMoveDown(idx) {
764
+ var _this9 = this;
765
+ var newValue = JSON.parse(JSON.stringify(this.state.value));
766
+ var item = newValue[idx];
767
+ newValue.splice(idx, 1);
768
+ newValue.splice(idx + 1, 0, item);
769
+ this.setState({
770
+ value: newValue,
771
+ iteration: this.state.iteration + 10000
772
+ }, function () {
773
+ return _this9.applyFilter(false, null, function () {
774
+ return _this9.onChangeWrapper(newValue);
775
+ });
776
+ });
777
+ }
778
+ }, {
779
+ key: "onDrop",
780
+ value: function onDrop(acceptedFiles) {
781
+ var _this10 = this;
782
+ var file = acceptedFiles[0];
783
+ var reader = new FileReader();
784
+ reader.onabort = function () {
785
+ return console.log('file reading was aborted');
786
+ };
787
+ reader.onerror = function () {
788
+ return console.log('file reading has failed');
789
+ };
790
+ reader.onload = function () {
791
+ if (file.size > MAX_SIZE) {
792
+ window.alert(_i18n["default"].t('ra_File is too big. Max %sk allowed. Try use SVG.', Math.round(MAX_SIZE / 1024)));
793
+ return;
794
+ }
795
+ var text = new Uint8Array(reader.result).reduce(function (data, _byte) {
796
+ return data + String.fromCharCode(_byte);
797
+ }, '');
798
+ _this10.onImport(text);
799
+ };
800
+ reader.readAsArrayBuffer(file);
801
+ }
802
+ }, {
803
+ key: "showTypeOfImportDialog",
804
+ value: function showTypeOfImportDialog() {
805
+ var _this11 = this;
806
+ if (!this.state.showTypeOfImportDialog) {
807
+ return null;
808
+ }
809
+ return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
810
+ open: !0,
811
+ onClose: function onClose() {
812
+ return _this11.setState({
813
+ showTypeOfImportDialog: false
814
+ });
815
+ },
816
+ maxWidth: "md"
817
+ }, /*#__PURE__*/_react["default"].createElement(_material.DialogTitle, null, _i18n["default"].t('ra_Append or replace?')), /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, _i18n["default"].t('ra_Append %s entries or replace existing?', this.state.showTypeOfImportDialog.length)), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
818
+ variant: "contained",
819
+ color: "primary",
820
+ autoFocus: true,
821
+ onClick: function onClick() {
822
+ var value = JSON.parse(JSON.stringify(_this11.state.value));
823
+ _this11.state.showTypeOfImportDialog.forEach(function (obj) {
824
+ return value.push(obj);
825
+ });
826
+ _this11.setState({
827
+ value: value,
828
+ iteration: _this11.state.iteration + 10000,
829
+ showTypeOfImportDialog: false
830
+ }, function () {
831
+ return _this11.applyFilter(false, null, function () {
832
+ return _this11.onChangeWrapper(value);
833
+ });
834
+ });
835
+ }
836
+ }, _i18n["default"].t('ra_Append')), /*#__PURE__*/_react["default"].createElement(_material.Button, {
837
+ variant: "contained",
838
+ color: "secondary",
839
+ autoFocus: true,
840
+ onClick: function onClick() {
841
+ var value = _this11.state.showTypeOfImportDialog;
842
+ _this11.setState({
843
+ value: value,
844
+ iteration: _this11.state.iteration + 10000,
845
+ showTypeOfImportDialog: false
846
+ }, function () {
847
+ return _this11.applyFilter(false, null, function () {
848
+ return _this11.onChangeWrapper(value);
849
+ });
850
+ });
851
+ }
852
+ }, _i18n["default"].t('ra_Replace'))));
853
+ }
854
+ }, {
855
+ key: "showImportDialog",
856
+ value: function showImportDialog() {
857
+ var _this12 = this;
858
+ if (!this.state.showImportDialog) {
859
+ return null;
860
+ }
861
+ return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
862
+ open: !0,
863
+ onClose: function onClose() {
864
+ return _this12.setState({
865
+ showImportDialog: false
866
+ });
867
+ },
868
+ maxWidth: "md",
869
+ fullWidth: true
870
+ }, /*#__PURE__*/_react["default"].createElement(_material.DialogTitle, null, _i18n["default"].t('ra_Import from %s', 'CSV')), /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, /*#__PURE__*/_react["default"].createElement(_reactDropzone["default"], {
871
+ multiple: false,
872
+ accept: {
873
+ 'text/csv': ['.csv']
874
+ },
875
+ maxSize: MAX_SIZE,
876
+ onDragEnter: function onDragEnter() {
877
+ return _this12.setState({
878
+ uploadFile: 'dragging'
879
+ });
880
+ },
881
+ onDragLeave: function onDragLeave() {
882
+ return _this12.setState({
883
+ uploadFile: true
884
+ });
885
+ },
886
+ onDrop: function onDrop(acceptedFiles, errors) {
887
+ _this12.setState({
888
+ uploadFile: false
889
+ });
890
+ if (!acceptedFiles.length) {
891
+ window.alert(errors && errors[0] && errors[0].errors && errors[0].errors[0] && errors[0].errors[0].message || _i18n["default"].t('ra_Cannot upload'));
892
+ } else {
893
+ _this12.onDrop(acceptedFiles);
894
+ }
895
+ }
896
+ }, function (_ref) {
897
+ var getRootProps = _ref.getRootProps,
898
+ getInputProps = _ref.getInputProps;
899
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
900
+ className: _Utils["default"].clsx(_this12.props.classes.uploadDiv, _this12.state.uploadFile === 'dragging' && _this12.props.classes.uploadDivDragging, _this12.props.classes.dropZone, !_this12.state.icon && _this12.props.classes.dropZoneEmpty)
901
+ }, getRootProps()), /*#__PURE__*/_react["default"].createElement("input", getInputProps()), /*#__PURE__*/_react["default"].createElement("div", {
902
+ className: _Utils["default"].clsx(_this12.props.classes.uploadCenterDiv)
903
+ }, /*#__PURE__*/_react["default"].createElement("div", {
904
+ className: _this12.props.classes.uploadCenterTextAndIcon
905
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.UploadFile, {
906
+ className: _this12.props.classes.uploadCenterIcon
907
+ }), /*#__PURE__*/_react["default"].createElement("div", {
908
+ className: _this12.props.classes.uploadCenterText
909
+ }, _this12.state.uploadFile === 'dragging' ? _i18n["default"].t('ra_Drop file here') : _i18n["default"].t('ra_Place your files here or click here to open the browse dialog')))));
910
+ })), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
911
+ variant: "contained",
912
+ onClick: function onClick() {
913
+ return _this12.setState({
914
+ showImportDialog: false
915
+ });
916
+ },
917
+ color: "primary",
918
+ startIcon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Close, null)
919
+ }, _i18n["default"].t('Cancel'))));
920
+ }
921
+ }, {
922
+ key: "renderItem",
923
+ value: function renderItem( /* error, disabled, defaultValue */
924
+ ) {
925
+ var _this13 = this;
926
+ var _this$props2 = this.props,
927
+ classes = _this$props2.classes,
928
+ schema = _this$props2.schema;
929
+ var visibleValue = this.state.visibleValue;
930
+ if (!this.state.value) {
931
+ return null;
932
+ }
933
+ visibleValue = visibleValue || this.state.value.map(function (_, i) {
934
+ return i;
935
+ });
936
+ var doAnyFilterSet = this.isAnyFilterSet();
937
+ return /*#__PURE__*/_react["default"].createElement(_material.Paper, {
938
+ className: classes.paper
939
+ }, this.showImportDialog(), this.showTypeOfImportDialog(), schema.label ? /*#__PURE__*/_react["default"].createElement("div", {
940
+ className: classes.label
941
+ }, /*#__PURE__*/_react["default"].createElement(_material.Toolbar, {
942
+ variant: "dense",
943
+ className: classes.rootTool
944
+ }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
945
+ className: classes.title,
946
+ variant: "h6",
947
+ id: "tableTitle",
948
+ component: "div"
949
+ }, this.getText(schema.label)))) : null, /*#__PURE__*/_react["default"].createElement(_material.TableContainer, null, /*#__PURE__*/_react["default"].createElement(_material.Table, {
950
+ className: classes.table,
951
+ size: "small"
952
+ }, this.enhancedTableHead(!doAnyFilterSet && !this.state.orderBy ? 120 : 64, doAnyFilterSet), /*#__PURE__*/_react["default"].createElement(_material.TableBody, null, visibleValue.map(function (idx, i) {
953
+ return /*#__PURE__*/_react["default"].createElement(_material.TableRow, {
954
+ hover: true,
955
+ key: "".concat(idx, "_").concat(i)
956
+ }, schema.items && schema.items.map(function (headCell) {
957
+ return /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
958
+ key: "".concat(headCell.attr, "_").concat(idx),
959
+ align: "left"
960
+ }, _this13.itemTable(headCell.attr, _this13.state.value[idx], idx));
961
+ }), !schema.noDelete && /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
962
+ align: "left",
963
+ className: classes.buttonCell
964
+ }, !doAnyFilterSet && !_this13.state.orderBy ? i ? /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
965
+ title: _i18n["default"].t('ra_Move up')
966
+ }, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
967
+ size: "small",
968
+ onClick: function onClick() {
969
+ return _this13.onMoveUp(idx);
970
+ }
971
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.ArrowUpward, null))) : /*#__PURE__*/_react["default"].createElement("div", {
972
+ className: classes.buttonEmpty
973
+ }) : null, !doAnyFilterSet && !_this13.state.orderBy ? i < visibleValue.length - 1 ? /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
974
+ title: _i18n["default"].t('ra_Move down')
975
+ }, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
976
+ size: "small",
977
+ onClick: function onClick() {
978
+ return _this13.onMoveDown(idx);
979
+ }
980
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.ArrowDownward, null))) : /*#__PURE__*/_react["default"].createElement("div", {
981
+ className: classes.buttonEmpty
982
+ }) : null, /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
983
+ title: _i18n["default"].t('ra_Delete current row')
984
+ }, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
985
+ size: "small",
986
+ onClick: _this13.onDelete(idx)
987
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Delete, null))), _this13.props.schema.clone ? /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
988
+ title: _i18n["default"].t('ra_Clone current row')
989
+ }, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
990
+ size: "small",
991
+ onClick: _this13.onClone(idx)
992
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.ContentCopy, null))) : null));
993
+ }), !schema.noDelete && visibleValue.length >= (schema.showSecondAddAt || 5) ? /*#__PURE__*/_react["default"].createElement(_material.TableRow, null, /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
994
+ colSpan: schema.items.length + 1
995
+ }, /*#__PURE__*/_react["default"].createElement(_material.Tooltip, {
996
+ title: doAnyFilterSet ? _i18n["default"].t('ra_Cannot add items with set filter') : _i18n["default"].t('ra_Add row')
997
+ }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
998
+ size: "small",
999
+ color: "primary",
1000
+ disabled: !!doAnyFilterSet && !this.props.schema.allowAddByFilter,
1001
+ onClick: this.onAdd
1002
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Add, null)))))) : null)), !visibleValue.length && this.state.value.length ? /*#__PURE__*/_react["default"].createElement("div", {
1003
+ className: classes.filteredOut
1004
+ }, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
1005
+ className: classes.title,
1006
+ variant: "h6",
1007
+ id: "tableTitle",
1008
+ component: "div"
1009
+ }, _i18n["default"].t('ra_All items are filtered out'), /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
1010
+ size: "small",
1011
+ onClick: function onClick() {
1012
+ return _this13.applyFilter(true);
1013
+ }
1014
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Close, null)))) : null), schema.help ? /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)) : null, this.state.errorMessage ? /*#__PURE__*/_react["default"].createElement("div", {
1015
+ style: {
1016
+ display: 'flex',
1017
+ padding: '5px'
1018
+ }
1019
+ }, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Warning, {
1020
+ color: "error"
1021
+ }), /*#__PURE__*/_react["default"].createElement("span", {
1022
+ style: {
1023
+ color: 'red',
1024
+ alignSelf: 'center'
1025
+ }
1026
+ }, this.state.errorMessage)) : null);
1027
+ }
1028
+ }], [{
1029
+ key: "descendingComparator",
1030
+ value: function descendingComparator(a, b, orderBy) {
1031
+ if (b[orderBy] < a[orderBy]) {
1032
+ return -1;
1033
+ }
1034
+ if (b[orderBy] > a[orderBy]) {
1035
+ return 1;
1036
+ }
1037
+ return 0;
1038
+ }
1039
+ }, {
1040
+ key: "getComparator",
1041
+ value: function getComparator(order, orderBy) {
1042
+ return order === 'desc' ? function (a, b) {
1043
+ return ConfigTable.descendingComparator(a, b, orderBy);
1044
+ } : function (a, b) {
1045
+ return -ConfigTable.descendingComparator(a, b, orderBy);
1046
+ };
1047
+ }
1048
+ }]);
1049
+ return ConfigTable;
1050
+ }(_ConfigGeneric2["default"]);
1051
+ ConfigTable.propTypes = {
1052
+ socket: _propTypes["default"].object.isRequired,
1053
+ changed: _propTypes["default"].bool,
1054
+ themeType: _propTypes["default"].string,
1055
+ themeName: _propTypes["default"].string,
1056
+ style: _propTypes["default"].object,
1057
+ className: _propTypes["default"].string,
1058
+ data: _propTypes["default"].object.isRequired,
1059
+ schema: _propTypes["default"].object,
1060
+ onError: _propTypes["default"].func,
1061
+ onChange: _propTypes["default"].func
1062
+ };
1063
+ var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigTable);
1064
+ //# sourceMappingURL=ConfigTable.js.map