@iobroker/adapter-react-v5 7.2.3 → 7.2.6

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 (375) hide show
  1. package/README.md +3 -3
  2. package/build/AdminConnection.d.ts +1 -0
  3. package/build/AdminConnection.js +2 -0
  4. package/build/AdminConnection.js.map +1 -0
  5. package/{src/Components/404.tsx → build/Components/404.js} +14 -39
  6. package/build/Components/404.js.map +1 -0
  7. package/{Components → build/Components}/ColorPicker.d.ts +2 -2
  8. package/{Components → build/Components}/ColorPicker.js +50 -65
  9. package/build/Components/ColorPicker.js.map +1 -0
  10. package/{Components → build/Components}/ComplexCron.d.ts +2 -2
  11. package/{Components → build/Components}/ComplexCron.js +43 -71
  12. package/build/Components/ComplexCron.js.map +1 -0
  13. package/{Components → build/Components}/CopyToClipboard.d.ts +1 -2
  14. package/{src/Components/CopyToClipboard.tsx → build/Components/CopyToClipboard.js} +20 -38
  15. package/build/Components/CopyToClipboard.js.map +1 -0
  16. package/{Components → build/Components}/CustomModal.d.ts +3 -3
  17. package/build/Components/CustomModal.js +60 -0
  18. package/build/Components/CustomModal.js.map +1 -0
  19. package/{Components → build/Components}/FileBrowser.d.ts +21 -21
  20. package/{Components → build/Components}/FileBrowser.js +253 -248
  21. package/build/Components/FileBrowser.js.map +1 -0
  22. package/build/Components/FileViewer.d.ts +48 -0
  23. package/build/Components/FileViewer.js +277 -0
  24. package/build/Components/FileViewer.js.map +1 -0
  25. package/{Components → build/Components}/Icon.d.ts +1 -1
  26. package/build/Components/Icon.js +140 -0
  27. package/build/Components/Icon.js.map +1 -0
  28. package/{Components → build/Components}/IconPicker.d.ts +2 -2
  29. package/build/Components/IconPicker.js +73 -0
  30. package/build/Components/IconPicker.js.map +1 -0
  31. package/{Components → build/Components}/IconSelector.d.ts +3 -3
  32. package/{Components → build/Components}/IconSelector.js +29 -57
  33. package/build/Components/IconSelector.js.map +1 -0
  34. package/{Components → build/Components}/Image.d.ts +2 -2
  35. package/{Components → build/Components}/Image.js +16 -22
  36. package/build/Components/Image.js.map +1 -0
  37. package/{Components → build/Components}/Loader.d.ts +2 -2
  38. package/{Components → build/Components}/Loader.js +15 -40
  39. package/build/Components/Loader.js.map +1 -0
  40. package/{Components → build/Components}/Loaders/MV.d.ts +2 -2
  41. package/build/Components/Loaders/MV.js +61 -0
  42. package/build/Components/Loaders/MV.js.map +1 -0
  43. package/{Components → build/Components}/Loaders/PT.d.ts +2 -2
  44. package/{Components → build/Components}/Loaders/PT.js +10 -35
  45. package/build/Components/Loaders/PT.js.map +1 -0
  46. package/{Components → build/Components}/Loaders/Vendor.d.ts +2 -2
  47. package/build/Components/Loaders/Vendor.js +52 -0
  48. package/build/Components/Loaders/Vendor.js.map +1 -0
  49. package/{Components → build/Components}/Logo.d.ts +2 -2
  50. package/build/Components/Logo.js +108 -0
  51. package/build/Components/Logo.js.map +1 -0
  52. package/{Components → build/Components}/MDUtils.d.ts +1 -2
  53. package/{Components → build/Components}/MDUtils.js +4 -9
  54. package/build/Components/MDUtils.js.map +1 -0
  55. package/{Components → build/Components}/ObjectBrowser.d.ts +7 -4
  56. package/{Components → build/Components}/ObjectBrowser.js +1183 -1133
  57. package/build/Components/ObjectBrowser.js.map +1 -0
  58. package/{Components → build/Components}/Router.d.ts +1 -2
  59. package/{Components → build/Components}/Router.js +6 -7
  60. package/build/Components/Router.js.map +1 -0
  61. package/{Components → build/Components}/SaveCloseButtons.d.ts +2 -2
  62. package/build/Components/SaveCloseButtons.js +65 -0
  63. package/build/Components/SaveCloseButtons.js.map +1 -0
  64. package/{Components → build/Components}/Schedule.d.ts +3 -3
  65. package/{Components → build/Components}/Schedule.js +246 -261
  66. package/build/Components/Schedule.js.map +1 -0
  67. package/{Components → build/Components}/SelectWithIcon.d.ts +2 -2
  68. package/build/Components/SelectWithIcon.js +135 -0
  69. package/build/Components/SelectWithIcon.js.map +1 -0
  70. package/build/Components/SimpleCron/cronText.js +15 -0
  71. package/build/Components/SimpleCron/cronText.js.map +1 -0
  72. package/{Components → build/Components}/SimpleCron/index.d.ts +2 -2
  73. package/{Components → build/Components}/SimpleCron/index.js +55 -56
  74. package/build/Components/SimpleCron/index.js.map +1 -0
  75. package/{Components → build/Components}/TabContainer.d.ts +2 -2
  76. package/build/Components/TabContainer.js +23 -0
  77. package/build/Components/TabContainer.js.map +1 -0
  78. package/{Components → build/Components}/TabContent.d.ts +3 -2
  79. package/build/Components/TabContent.js +20 -0
  80. package/build/Components/TabContent.js.map +1 -0
  81. package/build/Components/TabHeader.d.ts +6 -0
  82. package/build/Components/TabHeader.js +6 -0
  83. package/build/Components/TabHeader.js.map +1 -0
  84. package/{Components → build/Components}/TableResize.d.ts +2 -2
  85. package/{src/Components/TableResize.tsx → build/Components/TableResize.js} +64 -134
  86. package/build/Components/TableResize.js.map +1 -0
  87. package/{Components → build/Components}/TextWithIcon.d.ts +2 -2
  88. package/{src/Components/TextWithIcon.tsx → build/Components/TextWithIcon.js} +30 -75
  89. package/build/Components/TextWithIcon.js.map +1 -0
  90. package/{Components → build/Components}/ToggleThemeMenu.d.ts +1 -1
  91. package/build/Components/ToggleThemeMenu.js +13 -0
  92. package/build/Components/ToggleThemeMenu.js.map +1 -0
  93. package/{Components → build/Components}/TreeTable.d.ts +3 -3
  94. package/{Components → build/Components}/TreeTable.js +87 -99
  95. package/build/Components/TreeTable.js.map +1 -0
  96. package/{Components → build/Components}/UploadImage.d.ts +2 -2
  97. package/{Components → build/Components}/UploadImage.js +46 -69
  98. package/build/Components/UploadImage.js.map +1 -0
  99. package/{Components → build/Components}/Utils.d.ts +2 -2
  100. package/{Components → build/Components}/Utils.js +47 -60
  101. package/build/Components/Utils.js.map +1 -0
  102. package/build/Components/withWidth.d.ts +2 -0
  103. package/build/Components/withWidth.js +22 -0
  104. package/build/Components/withWidth.js.map +1 -0
  105. package/build/Connection.d.ts +1 -0
  106. package/build/Connection.js +2 -0
  107. package/build/Connection.js.map +1 -0
  108. package/{Dialogs → build/Dialogs}/ComplexCron.d.ts +2 -2
  109. package/build/Dialogs/ComplexCron.js +85 -0
  110. package/build/Dialogs/ComplexCron.js.map +1 -0
  111. package/{Dialogs → build/Dialogs}/Confirm.d.ts +2 -2
  112. package/build/Dialogs/Confirm.js +83 -0
  113. package/build/Dialogs/Confirm.js.map +1 -0
  114. package/{Dialogs → build/Dialogs}/Cron.d.ts +2 -2
  115. package/build/Dialogs/Cron.js +72 -0
  116. package/build/Dialogs/Cron.js.map +1 -0
  117. package/{Dialogs → build/Dialogs}/Error.d.ts +2 -2
  118. package/build/Dialogs/Error.js +27 -0
  119. package/build/Dialogs/Error.js.map +1 -0
  120. package/{Dialogs → build/Dialogs}/Message.d.ts +2 -2
  121. package/build/Dialogs/Message.js +29 -0
  122. package/build/Dialogs/Message.js.map +1 -0
  123. package/{Dialogs → build/Dialogs}/SelectFile.d.ts +2 -2
  124. package/build/Dialogs/SelectFile.js +116 -0
  125. package/build/Dialogs/SelectFile.js.map +1 -0
  126. package/{Dialogs → build/Dialogs}/SelectID.d.ts +3 -3
  127. package/{Dialogs → build/Dialogs}/SelectID.js +28 -53
  128. package/build/Dialogs/SelectID.js.map +1 -0
  129. package/{Dialogs → build/Dialogs}/SimpleCron.d.ts +2 -2
  130. package/build/Dialogs/SimpleCron.js +46 -0
  131. package/build/Dialogs/SimpleCron.js.map +1 -0
  132. package/build/Dialogs/TextInput.d.ts +2 -0
  133. package/build/Dialogs/TextInput.js +31 -0
  134. package/build/Dialogs/TextInput.js.map +1 -0
  135. package/{GenericApp.d.ts → build/GenericApp.d.ts} +2 -3
  136. package/{GenericApp.js → build/GenericApp.js} +162 -176
  137. package/build/GenericApp.js.map +1 -0
  138. package/{LegacyConnection.d.ts → build/LegacyConnection.d.ts} +69 -4
  139. package/{LegacyConnection.js → build/LegacyConnection.js} +106 -99
  140. package/build/LegacyConnection.js.map +1 -0
  141. package/{Prompt.d.ts → build/Prompt.d.ts} +1 -1
  142. package/{Prompt.js → build/Prompt.js} +3 -4
  143. package/build/Prompt.js.map +1 -0
  144. package/build/Theme.d.ts +5 -0
  145. package/{Theme.js → build/Theme.js} +37 -32
  146. package/build/Theme.js.map +1 -0
  147. package/build/assets/devices/parseNames.d.ts +0 -0
  148. package/build/assets/devices/parseNames.js +35 -0
  149. package/build/assets/devices/parseNames.js.map +1 -0
  150. package/build/assets/rooms/parseNames.d.ts +0 -0
  151. package/build/assets/rooms/parseNames.js +35 -0
  152. package/build/assets/rooms/parseNames.js.map +1 -0
  153. package/build/dictionary.d.ts +1 -0
  154. package/build/dictionary.js +25 -0
  155. package/build/dictionary.js.map +1 -0
  156. package/build/i18n/de.json +449 -0
  157. package/build/i18n/en.json +449 -0
  158. package/build/i18n/es.json +449 -0
  159. package/build/i18n/fr.json +449 -0
  160. package/build/i18n/it.json +449 -0
  161. package/build/i18n/nl.json +449 -0
  162. package/build/i18n/pl.json +449 -0
  163. package/build/i18n/pt.json +449 -0
  164. package/build/i18n/ru.json +449 -0
  165. package/build/i18n/uk.json +449 -0
  166. package/build/i18n/zh-cn.json +449 -0
  167. package/{i18n.d.ts → build/i18n.d.ts} +2 -2
  168. package/{i18n.js → build/i18n.js} +9 -11
  169. package/build/i18n.js.map +1 -0
  170. package/build/icons/IconAdapter.d.ts +3 -0
  171. package/build/icons/IconAdapter.js +6 -0
  172. package/build/icons/IconAdapter.js.map +1 -0
  173. package/build/icons/IconAlias.d.ts +3 -0
  174. package/build/icons/IconAlias.js +6 -0
  175. package/build/icons/IconAlias.js.map +1 -0
  176. package/build/icons/IconChannel.d.ts +3 -0
  177. package/build/icons/IconChannel.js +9 -0
  178. package/build/icons/IconChannel.js.map +1 -0
  179. package/build/icons/IconClearFilter.d.ts +3 -0
  180. package/build/icons/IconClearFilter.js +7 -0
  181. package/build/icons/IconClearFilter.js.map +1 -0
  182. package/build/icons/IconClosed.d.ts +3 -0
  183. package/build/icons/IconClosed.js +6 -0
  184. package/build/icons/IconClosed.js.map +1 -0
  185. package/build/icons/IconCopy.d.ts +3 -0
  186. package/build/icons/IconCopy.js +5 -0
  187. package/build/icons/IconCopy.js.map +1 -0
  188. package/build/icons/IconDevice.d.ts +3 -0
  189. package/build/icons/IconDevice.js +15 -0
  190. package/build/icons/IconDevice.js.map +1 -0
  191. package/build/icons/IconDocument.d.ts +3 -0
  192. package/build/icons/IconDocument.js +6 -0
  193. package/build/icons/IconDocument.js.map +1 -0
  194. package/build/icons/IconDocumentReadOnly.d.ts +3 -0
  195. package/build/icons/IconDocumentReadOnly.js +7 -0
  196. package/build/icons/IconDocumentReadOnly.js.map +1 -0
  197. package/build/icons/IconExpert.d.ts +3 -0
  198. package/build/icons/IconExpert.js +6 -0
  199. package/build/icons/IconExpert.js.map +1 -0
  200. package/build/icons/IconFx.d.ts +3 -0
  201. package/build/icons/IconFx.js +5 -0
  202. package/build/icons/IconFx.js.map +1 -0
  203. package/build/icons/IconInstance.d.ts +3 -0
  204. package/build/icons/IconInstance.js +6 -0
  205. package/build/icons/IconInstance.js.map +1 -0
  206. package/build/icons/IconLogout.d.ts +3 -0
  207. package/build/icons/IconLogout.js +6 -0
  208. package/build/icons/IconLogout.js.map +1 -0
  209. package/build/icons/IconNoIcon.d.ts +3 -0
  210. package/build/icons/IconNoIcon.js +5 -0
  211. package/build/icons/IconNoIcon.js.map +1 -0
  212. package/build/icons/IconOpen.d.ts +3 -0
  213. package/build/icons/IconOpen.js +6 -0
  214. package/build/icons/IconOpen.js.map +1 -0
  215. package/{icons → build/icons}/IconProps.d.ts +1 -1
  216. package/build/icons/IconProps.js +2 -0
  217. package/build/icons/IconProps.js.map +1 -0
  218. package/build/icons/IconState.d.ts +3 -0
  219. package/build/icons/IconState.js +6 -0
  220. package/build/icons/IconState.js.map +1 -0
  221. package/build/index.d.ts +67 -0
  222. package/build/index.js +67 -0
  223. package/build/index.js.map +1 -0
  224. package/{types.d.ts → build/types.d.ts} +1 -1
  225. package/package.json +84 -47
  226. package/AdminConnection.d.ts +0 -2
  227. package/AdminConnection.js +0 -4
  228. package/Components/404.js +0 -101
  229. package/Components/CopyToClipboard.js +0 -163
  230. package/Components/CustomModal.js +0 -88
  231. package/Components/FileViewer.d.ts +0 -10
  232. package/Components/FileViewer.js +0 -305
  233. package/Components/Icon.js +0 -148
  234. package/Components/IconPicker.js +0 -98
  235. package/Components/Loaders/MV.js +0 -66
  236. package/Components/Loaders/Vendor.js +0 -77
  237. package/Components/Logo.js +0 -117
  238. package/Components/SaveCloseButtons.js +0 -69
  239. package/Components/SelectWithIcon.js +0 -168
  240. package/Components/SimpleCron/cronText.js +0 -19
  241. package/Components/TabContainer.js +0 -25
  242. package/Components/TabContent.js +0 -21
  243. package/Components/TabHeader.d.ts +0 -6
  244. package/Components/TabHeader.js +0 -11
  245. package/Components/TableResize.js +0 -226
  246. package/Components/TextWithIcon.js +0 -119
  247. package/Components/ToggleThemeMenu.js +0 -18
  248. package/Components/withWidth.d.ts +0 -3
  249. package/Components/withWidth.js +0 -27
  250. package/Connection.d.ts +0 -3
  251. package/Connection.js +0 -8
  252. package/Dialogs/ComplexCron.js +0 -90
  253. package/Dialogs/Confirm.js +0 -111
  254. package/Dialogs/Cron.js +0 -100
  255. package/Dialogs/Error.js +0 -55
  256. package/Dialogs/Message.js +0 -57
  257. package/Dialogs/SelectFile.js +0 -119
  258. package/Dialogs/SimpleCron.js +0 -51
  259. package/Dialogs/TextInput.d.ts +0 -3
  260. package/Dialogs/TextInput.js +0 -35
  261. package/Theme.d.ts +0 -6
  262. package/i18n/de.json +0 -449
  263. package/i18n/en.json +0 -449
  264. package/i18n/es.json +0 -449
  265. package/i18n/fr.json +0 -449
  266. package/i18n/it.json +0 -449
  267. package/i18n/nl.json +0 -449
  268. package/i18n/pl.json +0 -449
  269. package/i18n/pt.json +0 -449
  270. package/i18n/ru.json +0 -449
  271. package/i18n/uk.json +0 -449
  272. package/i18n/zh-cn.json +0 -449
  273. package/icons/IconAdapter.d.ts +0 -4
  274. package/icons/IconAdapter.js +0 -10
  275. package/icons/IconAlias.d.ts +0 -4
  276. package/icons/IconAlias.js +0 -10
  277. package/icons/IconChannel.d.ts +0 -4
  278. package/icons/IconChannel.js +0 -13
  279. package/icons/IconClearFilter.d.ts +0 -4
  280. package/icons/IconClearFilter.js +0 -11
  281. package/icons/IconClosed.d.ts +0 -4
  282. package/icons/IconClosed.js +0 -10
  283. package/icons/IconCopy.d.ts +0 -4
  284. package/icons/IconCopy.js +0 -9
  285. package/icons/IconDevice.d.ts +0 -4
  286. package/icons/IconDevice.js +0 -19
  287. package/icons/IconDocument.d.ts +0 -4
  288. package/icons/IconDocument.js +0 -10
  289. package/icons/IconDocumentReadOnly.d.ts +0 -4
  290. package/icons/IconDocumentReadOnly.js +0 -11
  291. package/icons/IconExpert.d.ts +0 -4
  292. package/icons/IconExpert.js +0 -10
  293. package/icons/IconFx.d.ts +0 -4
  294. package/icons/IconFx.js +0 -9
  295. package/icons/IconInstance.d.ts +0 -4
  296. package/icons/IconInstance.js +0 -10
  297. package/icons/IconLogout.d.ts +0 -4
  298. package/icons/IconLogout.js +0 -10
  299. package/icons/IconNoIcon.d.ts +0 -4
  300. package/icons/IconNoIcon.js +0 -9
  301. package/icons/IconOpen.d.ts +0 -4
  302. package/icons/IconOpen.js +0 -10
  303. package/icons/IconProps.js +0 -2
  304. package/icons/IconState.d.ts +0 -4
  305. package/icons/IconState.js +0 -10
  306. package/index.d.ts +0 -128
  307. package/index.js +0 -215
  308. package/src/AdminConnection.tsx +0 -3
  309. package/src/Components/ColorPicker.tsx +0 -343
  310. package/src/Components/ComplexCron.tsx +0 -561
  311. package/src/Components/CustomModal.tsx +0 -170
  312. package/src/Components/FileBrowser.tsx +0 -2550
  313. package/src/Components/FileViewer.tsx +0 -412
  314. package/src/Components/Icon.tsx +0 -238
  315. package/src/Components/IconPicker.tsx +0 -165
  316. package/src/Components/IconSelector.tsx +0 -2220
  317. package/src/Components/Image.tsx +0 -193
  318. package/src/Components/Loader.tsx +0 -328
  319. package/src/Components/Logo.tsx +0 -176
  320. package/src/Components/MDUtils.tsx +0 -104
  321. package/src/Components/ObjectBrowser.tsx +0 -8935
  322. package/src/Components/Router.tsx +0 -90
  323. package/src/Components/SaveCloseButtons.tsx +0 -117
  324. package/src/Components/Schedule.tsx +0 -1995
  325. package/src/Components/SelectWithIcon.tsx +0 -239
  326. package/src/Components/TabContainer.tsx +0 -57
  327. package/src/Components/TabContent.tsx +0 -38
  328. package/src/Components/TabHeader.tsx +0 -20
  329. package/src/Components/ToggleThemeMenu.tsx +0 -52
  330. package/src/Components/TreeTable.tsx +0 -1002
  331. package/src/Components/UploadImage.tsx +0 -643
  332. package/src/Components/Utils.tsx +0 -1802
  333. package/src/Components/loader.css +0 -231
  334. package/src/Components/withWidth.tsx +0 -32
  335. package/src/Connection.tsx +0 -5
  336. package/src/Dialogs/ComplexCron.tsx +0 -163
  337. package/src/Dialogs/Confirm.tsx +0 -185
  338. package/src/Dialogs/Cron.tsx +0 -192
  339. package/src/Dialogs/Error.tsx +0 -67
  340. package/src/Dialogs/Message.tsx +0 -73
  341. package/src/Dialogs/SelectFile.tsx +0 -280
  342. package/src/Dialogs/SelectID.tsx +0 -310
  343. package/src/Dialogs/SimpleCron.tsx +0 -101
  344. package/src/Dialogs/TextInput.tsx +0 -99
  345. package/src/GenericApp.tsx +0 -1076
  346. package/src/LegacyConnection.tsx +0 -3720
  347. package/src/Prompt.tsx +0 -22
  348. package/src/Theme.tsx +0 -472
  349. package/src/icons/IconAdapter.tsx +0 -22
  350. package/src/icons/IconAlias.tsx +0 -22
  351. package/src/icons/IconChannel.tsx +0 -60
  352. package/src/icons/IconClearFilter.tsx +0 -24
  353. package/src/icons/IconClosed.tsx +0 -22
  354. package/src/icons/IconCopy.tsx +0 -21
  355. package/src/icons/IconDevice.tsx +0 -126
  356. package/src/icons/IconDocument.tsx +0 -22
  357. package/src/icons/IconDocumentReadOnly.tsx +0 -27
  358. package/src/icons/IconExpert.tsx +0 -26
  359. package/src/icons/IconFx.tsx +0 -38
  360. package/src/icons/IconInstance.tsx +0 -22
  361. package/src/icons/IconLogout.tsx +0 -32
  362. package/src/icons/IconNoIcon.tsx +0 -21
  363. package/src/icons/IconOpen.tsx +0 -22
  364. package/src/icons/IconProps.tsx +0 -16
  365. package/src/icons/IconState.tsx +0 -38
  366. package/src/index.css +0 -56
  367. /package/{Components → build/Components}/404.d.ts +0 -0
  368. /package/{Components → build/Components}/SimpleCron/cronText.d.ts +0 -0
  369. /package/{assets → build/assets}/devices.json +0 -0
  370. /package/{assets → build/assets}/lamp_ceiling.svg +0 -0
  371. /package/{assets → build/assets}/lamp_table.svg +0 -0
  372. /package/{assets → build/assets}/no_icon.svg +0 -0
  373. /package/{assets → build/assets}/rooms.json +0 -0
  374. /package/{index.css → build/index.css} +0 -0
  375. /package/{tasks.js → tasksExample.js} +0 -0
@@ -1,192 +0,0 @@
1
- import React, { type JSX } from 'react';
2
-
3
- import { Button, DialogTitle, DialogContent, DialogActions, Dialog, Radio } from '@mui/material';
4
-
5
- import { Check as IconOk, Cancel as IconCancel } from '@mui/icons-material';
6
-
7
- import ComplexCron from '../Components/ComplexCron';
8
- import SimpleCron, { cron2state } from '../Components/SimpleCron';
9
- import Schedule from '../Components/Schedule';
10
-
11
- import I18n from '../i18n';
12
- import type { IobTheme } from '../types';
13
-
14
- // Generate cron expression
15
-
16
- const styles: Record<string, React.CSSProperties> = {
17
- dialogPaper: {
18
- height: 'calc(100% - 96px)',
19
- },
20
- };
21
-
22
- interface DialogCronProps {
23
- onClose: () => void;
24
- onOk: (cron: string) => void;
25
- title?: string;
26
- cron?: string;
27
- cancel?: string;
28
- ok?: string;
29
- /** show only simple configuration */
30
- simple?: boolean;
31
- /** show only complex configuration */
32
- complex?: boolean;
33
- /** do not show wizard */
34
- noWizard?: boolean;
35
- theme: IobTheme;
36
- }
37
-
38
- interface DialogCronState {
39
- cron: string;
40
- mode: 'simple' | 'complex' | 'wizard';
41
- }
42
-
43
- class DialogCron extends React.Component<DialogCronProps, DialogCronState> {
44
- constructor(props: DialogCronProps) {
45
- super(props);
46
- let cron;
47
- if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^["']/, '')[0] !== '{') {
48
- cron = this.props.cron.replace(/['"]/g, '').trim();
49
- } else {
50
- cron = this.props.cron || '{}';
51
- if (typeof cron === 'string') {
52
- cron = cron.replace(/^["']/, '').replace(/["']\n?$/, '');
53
- }
54
- }
55
-
56
- this.state = {
57
- cron,
58
- mode: this.props.simple
59
- ? 'simple'
60
- : this.props.complex
61
- ? 'complex'
62
- : (typeof cron === 'object' || cron[0] === '{') && !this.props.noWizard
63
- ? 'wizard'
64
- : cron2state(this.props.cron || '* * * * *')
65
- ? 'simple'
66
- : 'complex',
67
- };
68
- }
69
-
70
- handleCancel(): void {
71
- this.props.onClose();
72
- }
73
-
74
- handleOk(): void {
75
- this.props.onOk(this.state.cron);
76
- this.props.onClose();
77
- }
78
-
79
- setMode(mode: 'simple' | 'complex' | 'wizard'): void {
80
- this.setState({ mode });
81
- }
82
-
83
- render(): JSX.Element {
84
- return (
85
- <Dialog
86
- onClose={() => {}}
87
- maxWidth="md"
88
- fullWidth
89
- sx={{ '& .MuiDialog-paper': styles.dialogPaper }}
90
- open={!0}
91
- aria-labelledby="cron-dialog-title"
92
- >
93
- <DialogTitle id="cron-dialog-title">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>
94
- <DialogContent style={{ height: '100%', overflow: 'hidden' }}>
95
- {(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? (
96
- <div>
97
- {!this.props.simple && !this.props.complex && !this.props.noWizard && (
98
- <>
99
- <Radio
100
- key="wizard"
101
- checked={this.state.mode === 'wizard'}
102
- onChange={() => this.setMode('wizard')}
103
- />
104
- <label
105
- onClick={() => this.setMode('wizard')}
106
- style={this.state.mode !== 'wizard' ? { color: 'lightgrey' } : {}}
107
- >
108
- {I18n.t('sc_wizard')}
109
- </label>
110
- </>
111
- )}
112
-
113
- {((!this.props.simple && !this.props.complex) || this.props.simple) && (
114
- <>
115
- <Radio
116
- key="simple"
117
- checked={this.state.mode === 'simple'}
118
- onChange={() => this.setMode('simple')}
119
- />
120
- <label
121
- onClick={() => this.setMode('simple')}
122
- style={this.state.mode !== 'simple' ? { color: 'lightgrey' } : {}}
123
- >
124
- {I18n.t('sc_simple')}
125
- </label>
126
- </>
127
- )}
128
-
129
- {((!this.props.simple && !this.props.complex) || this.props.complex) && (
130
- <>
131
- <Radio
132
- key="complex"
133
- checked={this.state.mode === 'complex'}
134
- onChange={() => this.setMode('complex')}
135
- />
136
- <label
137
- onClick={() => this.setMode('complex')}
138
- style={this.state.mode !== 'complex' ? { color: 'lightgrey' } : {}}
139
- >
140
- {I18n.t('sc_cron')}
141
- </label>
142
- </>
143
- )}
144
- </div>
145
- ) : null}
146
-
147
- {this.state.mode === 'simple' && (
148
- <SimpleCron
149
- cronExpression={this.state.cron}
150
- onChange={cron => this.setState({ cron })}
151
- language={I18n.getLanguage()}
152
- />
153
- )}
154
- {this.state.mode === 'wizard' && (
155
- <Schedule
156
- theme={this.props.theme}
157
- schedule={this.state.cron}
158
- onChange={(cron: string) => this.setState({ cron })}
159
- />
160
- )}
161
- {this.state.mode === 'complex' && (
162
- <ComplexCron
163
- cronExpression={this.state.cron}
164
- onChange={cron => this.setState({ cron })}
165
- language={I18n.getLanguage()}
166
- />
167
- )}
168
- </DialogContent>
169
- <DialogActions>
170
- <Button
171
- variant="contained"
172
- onClick={() => this.handleOk()}
173
- color="primary"
174
- startIcon={<IconOk />}
175
- >
176
- {this.props.ok || I18n.t('ra_Ok')}
177
- </Button>
178
- <Button
179
- variant="contained"
180
- onClick={() => this.handleCancel()}
181
- color="grey"
182
- startIcon={<IconCancel />}
183
- >
184
- {this.props.cancel || I18n.t('ra_Cancel')}
185
- </Button>
186
- </DialogActions>
187
- </Dialog>
188
- );
189
- }
190
- }
191
-
192
- export default DialogCron;
@@ -1,67 +0,0 @@
1
- /**
2
- * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
3
- *
4
- * MIT License
5
- *
6
- */
7
- // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
8
- import React, { Component, type JSX } from 'react';
9
-
10
- import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
11
-
12
- import { Check as IconCheck } from '@mui/icons-material';
13
-
14
- import I18n from '../i18n';
15
-
16
- interface DialogErrorProps {
17
- /* The dialog title; default: Error (translated) */
18
- title?: string;
19
- /* The dialog text */
20
- text: string | React.JSX.Element | React.JSX.Element[];
21
- /* Close handler. */
22
- onClose?: () => void;
23
- /* if the dialog must be fill sized */
24
- fullWidth?: boolean;
25
- }
26
-
27
- class DialogError extends Component<DialogErrorProps> {
28
- handleOk(): void {
29
- if (this.props.onClose) {
30
- this.props.onClose();
31
- }
32
- }
33
-
34
- render(): JSX.Element {
35
- return (
36
- <Dialog
37
- open={!0}
38
- maxWidth="sm"
39
- fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}
40
- onClose={() => this.handleOk()}
41
- aria-labelledby="alert-dialog-title"
42
- aria-describedby="alert-dialog-description"
43
- >
44
- <DialogTitle id="ar_alert_dialog_title">{this.props.title || I18n.t('ra_Error')}</DialogTitle>
45
- <DialogContent>
46
- <DialogContentText id="ar_alert_dialog_description">
47
- {this.props.text || I18n.t('ra_Unknown error!')}
48
- </DialogContentText>
49
- </DialogContent>
50
- <DialogActions>
51
- <Button
52
- id="ar_dialog_error_ok"
53
- variant="contained"
54
- onClick={() => this.handleOk()}
55
- color="primary"
56
- autoFocus
57
- startIcon={<IconCheck />}
58
- >
59
- {I18n.t('ra_Ok')}
60
- </Button>
61
- </DialogActions>
62
- </Dialog>
63
- );
64
- }
65
- }
66
-
67
- export default DialogError;
@@ -1,73 +0,0 @@
1
- /**
2
- * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
3
- *
4
- * MIT License
5
- *
6
- */
7
-
8
- // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
9
- import React, { Component, type JSX } from 'react';
10
-
11
- import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
12
-
13
- import { Close as IconClose } from '@mui/icons-material';
14
-
15
- import I18n from '../i18n';
16
-
17
- interface DialogMessageProps {
18
- /* The dialog title; default: Message (translated) */
19
- title?: string;
20
- /* The dialog text */
21
- text: string | React.JSX.Element | React.JSX.Element[];
22
- /* Close handler. */
23
- onClose?: () => void;
24
- /* if the dialog must be fill sized */
25
- fullWidth?: boolean;
26
- /* optional icon */
27
- icon?: React.JSX.Element;
28
- /* optional ok button text */
29
- ok?: string;
30
- }
31
-
32
- class DialogMessage extends Component<DialogMessageProps> {
33
- handleOk(): void {
34
- if (this.props.onClose) {
35
- this.props.onClose();
36
- }
37
- }
38
-
39
- render(): JSX.Element {
40
- return (
41
- <Dialog
42
- open={!0}
43
- maxWidth="sm"
44
- fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}
45
- onClose={() => this.handleOk()}
46
- aria-labelledby="ar_dialog_message_title"
47
- aria-describedby="ar_dialog_message_description"
48
- >
49
- <DialogTitle id="ar_dialog_message_title">{this.props.title || I18n.t('ra_Message')}</DialogTitle>
50
- <DialogContent>
51
- <DialogContentText id="ar_dialog_message_description">
52
- <span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>
53
- {this.props.text}
54
- </DialogContentText>
55
- </DialogContent>
56
- <DialogActions>
57
- <Button
58
- id="ar_dialog_message_ok"
59
- variant="contained"
60
- onClick={() => this.handleOk()}
61
- color="primary"
62
- autoFocus
63
- startIcon={<IconClose />}
64
- >
65
- {this.props.ok || I18n.t('ra_Close')}
66
- </Button>
67
- </DialogActions>
68
- </Dialog>
69
- );
70
- }
71
- }
72
-
73
- export default DialogMessage;
@@ -1,280 +0,0 @@
1
- /*
2
- * Copyright 2022-2024 Denis Haev (bluefox) <dogafox@gmail.com>
3
- *
4
- * MIT License
5
- *
6
- */
7
- // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
8
- import React, { type JSX } from 'react';
9
-
10
- import { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';
11
-
12
- import { Cancel as IconCancel, Check as IconOk } from '@mui/icons-material';
13
-
14
- import type { Connection } from '@iobroker/socket-client';
15
-
16
- import I18n from '../i18n';
17
- import FileBrowser from '../Components/FileBrowser';
18
- import type { IobTheme } from '../types';
19
-
20
- const styles: Record<string, React.CSSProperties> = {
21
- headerID: {
22
- fontWeight: 'bold',
23
- fontStyle: 'italic',
24
- },
25
- dialog: {
26
- height: '95%',
27
- },
28
- dialogMobile: {
29
- // it is sx
30
- padding: '4px',
31
- width: '100%',
32
- maxWidth: '100%',
33
- maxHeight: 'calc(100% - 16px)',
34
- height: '100%',
35
- },
36
- content: {
37
- height: '100%',
38
- overflow: 'hidden',
39
- },
40
- contentMobile: {
41
- padding: '8px 4px',
42
- },
43
- titleRoot: {
44
- whiteSpace: 'nowrap',
45
- width: 'calc(100% - 72px)',
46
- overflow: 'hidden',
47
- display: 'inline-block',
48
- textOverflow: 'ellipsis',
49
- },
50
- };
51
-
52
- interface DialogSelectFileProps {
53
- /** where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated) */
54
- dialogName?: string;
55
- /** The dialog title; default: Please select object ID... (translated) */
56
- title?: string;
57
- /** Set to true to allow the selection of multiple IDs. */
58
- multiSelect?: boolean;
59
- /** Image prefix. Normally, admin has '../..' and the web has '../' */
60
- imagePrefix?: string; // Prefix (default: '.')
61
- /** @deprecated Image prefix */
62
- prefix?: string;
63
- /** Show the expert button? */
64
- showExpertButton?: boolean;
65
- /** Language */
66
- lang?: ioBroker.Languages;
67
- /** Socket class */
68
- socket: Connection;
69
- /** Theme name. */
70
- themeName?: string;
71
- /** Theme type. */
72
- themeType?: 'dark' | 'light';
73
- /** Theme object. */
74
- theme: IobTheme;
75
- /** The selected IDs. */
76
- selected?: string | string[];
77
- /** The ok button text; default: OK (translated) */
78
- ok?: string;
79
- /** The cancel button text; default: Cancel (translated) */
80
- cancel?: string;
81
- /** If download of files enabled */
82
- allowUpload?: boolean;
83
- /** If download of files enabled */
84
- allowDownload?: boolean;
85
- /** If creation of folders enabled */
86
- allowCreateFolder?: boolean;
87
- /** If creation of folders enabled */
88
- allowDelete?: boolean;
89
- /** if tile view enabled (default true) */
90
- allowView?: boolean;
91
- /** Show toolbar (default true) */
92
- showToolbar?: boolean;
93
- /** Limit file browser to one specific objectID of type meta and the following path (like vis.0/main) */
94
- limitPath?: string;
95
- /** like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']` */
96
- filterFiles?: string[];
97
- /** images, code, txt, audio, video */
98
- filterByType?: 'images' | 'code' | 'txt';
99
- /** allow only folder's selection */
100
- selectOnlyFolders?: boolean;
101
- /** Close handler that is always called when the dialog is closed. */
102
- onClose: () => void;
103
- /** Handler that is called when the user presses OK or by double click. */
104
- onOk: (selected: string | string[] | undefined) => void;
105
- /** The styling class names. */
106
- filters?: Record<string, string>;
107
- /** Allow switch views Table<=>Rows */
108
- showViewTypeButton?: boolean;
109
- /** If type selector should be shown */
110
- showTypeSelector?: boolean;
111
- /** If defined, allow selecting only files from this folder */
112
- restrictToFolder?: string;
113
- /** If restrictToFolder defined, allow selecting files outside of this folder */
114
- allowNonRestricted?: boolean;
115
- /** force expert mode */
116
- expertMode?: boolean;
117
- /** Translate function - optional */
118
- t?: (text: string, ...args: any[]) => string;
119
- }
120
-
121
- interface DialogSelectFileState {
122
- selected: string[];
123
- }
124
-
125
- class DialogSelectFile extends React.Component<DialogSelectFileProps, DialogSelectFileState> {
126
- private readonly dialogName: string;
127
-
128
- private readonly filters: Record<string, string>;
129
-
130
- constructor(props: DialogSelectFileProps) {
131
- super(props);
132
- this.dialogName = this.props.dialogName || 'default';
133
- this.dialogName = `SelectFile.${this.dialogName}`;
134
-
135
- const filters: string = ((window as any)._localStorage || window.localStorage).getItem(this.dialogName) || '{}';
136
-
137
- try {
138
- this.filters = JSON.parse(filters);
139
- } catch {
140
- this.filters = {};
141
- }
142
-
143
- if (props.filters) {
144
- this.filters = { ...this.filters, ...props.filters };
145
- }
146
-
147
- let selected = this.props.selected || [];
148
- if (typeof selected !== 'object') {
149
- selected = [selected];
150
- } else {
151
- selected = [...selected];
152
- }
153
- selected = selected.filter(id => id);
154
-
155
- this.state = {
156
- selected,
157
- };
158
- }
159
-
160
- handleCancel(): void {
161
- this.props.onClose();
162
- }
163
-
164
- handleOk(): void {
165
- this.props.onOk(
166
- this.props.multiSelect || !Array.isArray(this.state.selected)
167
- ? this.state.selected
168
- : this.state.selected[0] || '',
169
- );
170
- this.props.onClose();
171
- }
172
-
173
- render(): JSX.Element {
174
- let title;
175
- if (this.state.selected.length) {
176
- if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {
177
- title = [
178
- <span key="selected">
179
- {I18n.t('ra_Selected')}
180
- &nbsp;
181
- </span>,
182
- <span
183
- key="id"
184
- style={styles.headerID}
185
- >
186
- {this.state.selected}
187
- </span>,
188
- ];
189
- } else {
190
- title = [
191
- <span key="selected">
192
- {I18n.t('ra_Selected')}
193
- &nbsp;
194
- </span>,
195
- <span
196
- key="id"
197
- style={styles.headerID}
198
- >
199
- {I18n.t('%s items', this.state.selected.length)}
200
- </span>,
201
- ];
202
- }
203
- } else {
204
- title = this.props.title || I18n.t('ra_Please select file...');
205
- }
206
-
207
- return (
208
- <Dialog
209
- onClose={() => {}}
210
- maxWidth={false}
211
- sx={{ '& .MuiDialog-paper': { ...styles.dialog, ...styles.dialogMobile } }}
212
- fullWidth
213
- open={!0}
214
- aria-labelledby="ar_dialog_selectfile_title"
215
- >
216
- <DialogTitle
217
- id="ar_dialog_selectfile_title"
218
- sx={{ '&.MuiDialogTitle-root': styles.titleRoot }}
219
- >
220
- {title}
221
- </DialogTitle>
222
- <DialogContent style={{ ...styles.content, ...styles.contentMobile }}>
223
- <FileBrowser
224
- ready
225
- imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility
226
- allowUpload={!!this.props.allowUpload}
227
- allowDownload={this.props.allowDownload !== false}
228
- allowCreateFolder={!!this.props.allowCreateFolder}
229
- allowDelete={!!this.props.allowDelete}
230
- allowView={this.props.allowView !== false}
231
- showViewTypeButton={this.props.showViewTypeButton !== false}
232
- showToolbar={this.props.showToolbar !== false}
233
- limitPath={this.props.limitPath}
234
- filterFiles={this.props.filterFiles}
235
- filterByType={this.props.filterByType}
236
- selected={this.props.selected}
237
- restrictToFolder={this.props.restrictToFolder}
238
- allowNonRestricted={this.props.allowNonRestricted}
239
- onSelect={(selected: string | string[], isDoubleClick?: boolean, isFolder?: boolean) => {
240
- this.setState(
241
- { selected: Array.isArray(selected) ? selected : [selected] },
242
- () => isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk(),
243
- );
244
- }}
245
- t={this.props.t || I18n.t}
246
- lang={this.props.lang || I18n.getLanguage()}
247
- socket={this.props.socket}
248
- themeType={this.props.themeType}
249
- themeName={this.props.themeName}
250
- theme={this.props.theme}
251
- showExpertButton={this.props.showExpertButton}
252
- expertMode={this.props.expertMode}
253
- showTypeSelector={this.props.showTypeSelector}
254
- />
255
- </DialogContent>
256
- <DialogActions>
257
- <Button
258
- variant="contained"
259
- onClick={() => this.handleOk()}
260
- startIcon={<IconOk />}
261
- disabled={!this.state.selected.length}
262
- color="primary"
263
- >
264
- {this.props.ok || I18n.t('ra_Ok')}
265
- </Button>
266
- <Button
267
- color="grey"
268
- variant="contained"
269
- onClick={() => this.handleCancel()}
270
- startIcon={<IconCancel />}
271
- >
272
- {this.props.cancel || I18n.t('ra_Cancel')}
273
- </Button>
274
- </DialogActions>
275
- </Dialog>
276
- );
277
- }
278
- }
279
-
280
- export default DialogSelectFile;