@iobroker/adapter-react-v5 4.13.3 → 4.13.5

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 +165 -104
  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 +845 -841
  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 +1 -1
  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,1064 +0,0 @@
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